posthog-js 1.428.7 → 1.428.8
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.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/default-extensions.js.map +1 -1
- package/dist/exception-autocapture.js +1 -1
- package/dist/exception-autocapture.js.map +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/extension-bundles.js.map +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.mjs.map +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/lib/package.json +10 -4
- package/package.json +14 -8
package/dist/module.full.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t,e=["type"],i=["retriesPerformedSoFar"],r=["$set_once","$set"];function n(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}function s(){return s=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},s.apply(null,arguments)}function o(t,e,i,r,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void i(t)}a.done?e(l):Promise.resolve(l).then(r,n)}function a(t){return function(){var e=this,i=arguments;return new Promise(function(r,n){var s=t.apply(e,i);function a(t){o(s,r,n,a,l,"next",t)}function l(t){o(s,r,n,a,l,"throw",t)}a(void 0)})}}var l="u">typeof window?window:void 0,u="u">typeof globalThis?globalThis:l,h=null==u?void 0:u.navigator,d=null==u?void 0:u.document,v=null==u?void 0:u.location,c=null==u?void 0:u.fetch,f=null!=u&&u.XMLHttpRequest&&"withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:void 0,p=null==u?void 0:u.AbortController,g=null==u?void 0:u.CompressionStream,m=null==h?void 0:h.userAgent;function y(){return!(!l||!1===l.navigator.onLine)}var _="undefined"!=typeof globalThis?globalThis:l;_&&"undefined"==typeof self&&(_.self=_),_&&"undefined"==typeof File&&(_.File=function(){});var b=null!=l?l:{},w="$people_distinct_id",k="distinct_id",S="$device_id",x="$device_model",C="__alias",T="__cmpns",E="$fbc",M="$fbc_persistence",I="__timers",R="$autocapture_disabled_server_side",A="$heatmaps_enabled_server_side",P="$exception_capture_enabled_server_side",O="$error_tracking_suppression_rules",F="$error_tracking_capture_extension_exceptions",D="$web_vitals_enabled_server_side",L="$dead_clicks_enabled_server_side",N="$product_tours_enabled_server_side",q="$logs_capture_enabled_server_side",j="$web_vitals_allowed_metrics",B="$session_recording_remote_config",U="$session_recording_enabled_server_side",H="$replay_sample_rate",z="$replay_override_sampling",W="$replay_override_linked_flag",V="$replay_override_url_trigger",G="$replay_override_event_trigger",Z="$sesid",Q="$session_is_sampled",J="$session_past_minimum_duration",K="$session_recording_url_trigger_activated_session",Y="$session_recording_event_trigger_activated_session",X="$posthog_sr_group_event_trigger_",tt="$posthog_sr_group_url_trigger_",et="$posthog_sr_group_sampling_",it="$debug_first_full_snapshot_timestamp",rt="$sess_rec_flush_size",nt="$enabled_feature_flags",st="$active_feature_flags",ot="$early_access_features",at="$feature_flag_details",lt="$feature_flag_payloads",ut="$feature_flag_request_id",ht="$minimal_flag_called_events",dt="$override_feature_flags",vt="$override_feature_flag_payloads",ct="$stored_person_properties",ft="$stored_group_properties",pt="$groups",gt="$surveys",mt="$surveys_loaded_at",yt="$surveys_activated",_t="$surveys_activated_session",bt="$surveys_activated_timestamps",wt="ph_product_tours",kt="$product_tours_activated",St="$product_tours_activated_session",xt="$conversations_widget_session_id",Ct="$conversations_ticket_id",Tt="$conversations_widget_state",Et="$conversations_user_traits",Mt="$flag_call_reported",It="$flag_call_reported_session_id",Rt="$feature_flag_errors",At="$feature_flag_evaluated_at",Pt="$user_state",Ot="$client_session_props",Ft="$capture_rate_limit",$t="$initial_campaign_params",Dt="$initial_referrer_info",Lt="$initial_person_info",Nt="$epp",qt="$posthog_cookieless",jt="$cookieless_mode",Bt="$sdk_debug_extensions_init_method",Ut="$sdk_debug_extensions_init_time_ms",Ht="$sdk_debug_recording_script_not_loaded",zt="$sdk_debug_replay_event_trigger_status",Wt="$sdk_debug_replay_linked_flag_trigger_status",Vt="$sdk_debug_replay_matched_recording_trigger_groups",Gt="$sdk_debug_replay_pending_trigger_conditions",Zt="$sdk_debug_replay_remote_trigger_matching_config",Qt="$sdk_debug_replay_trigger_groups_count",Jt="$sdk_debug_replay_url_trigger_status",Kt="$sdk_debug_rrweb_attached",Yt="$sdk_debug_rrweb_start_attempted",Xt="$session_recording_start_reason",te="PostHog loadExternalDependency extension not found.",ee="anonymous",ie="identified",re="identified_only",ne="visibilitychange",se="beforeunload",oe="$pageview",ae="$pageleave",le="$identify",ue="$groupidentify",he=["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","pinterestbot","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"],de=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return he.concat(e).some(t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)})};function ve(t,e){return-1!==t.indexOf(e)}var ce=function(t){return t.trim()},fe=function(t){return t.replace(/^\$/,"")};function pe(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 ge=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}({}),me=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),ye="min_length",_e="max_length",be=["$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"],we=["token"],ke=Object.prototype,Se=ke.hasOwnProperty,xe=ke.toString,Ce=Array.isArray||function(t){return"[object Array]"===xe.call(t)},Te=t=>"function"==typeof t,Ee=t=>t===Object(t)&&!Ce(t),Me=t=>{if(Ee(t)){for(var e in t)if(Se.call(t,e))return!1;return!0}return!1},Ie=t=>void 0===t,Re=t=>"[object String]"==xe.call(t),Ae=t=>Re(t)&&0===t.trim().length,Pe=t=>null===t,Oe=t=>Ie(t)||Pe(t),Fe=t=>"[object Number]"==xe.call(t)&&t==t,$e=t=>Fe(t)&&t>0,De=t=>"[object Boolean]"===xe.call(t),Le=t=>t instanceof FormData,Ne=t=>ve(be,t),qe=t=>ve(we,t);function je(t){return null===t||"object"!=typeof t}function Be(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Ue(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 ze(t,Error)}}function He(t){return"u">typeof Event&&ze(t,Event)}function ze(t,e){try{return t instanceof e}catch(t){return!1}}var We=[!0,"true",1,"1","yes"],Ve=t=>ve(We,t),Ge=[!1,"false",0,"0","no"];function Ze(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),Fe(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),Ze(null!=n?n:i,e,i,r))}var Qe=class{constructor(t){this.C={},this.I=t.I,this.R=Ze(t.bucketSize,0,100,t.A),this.O=Ze(t.refillRate,0,this.R,t.A),this.N=Ze(t.refillInterval,0,864e5,t.A)}F(t,e){var i=Math.floor((e-t.lastAccess)/this.N);i>0&&(t.tokens=Math.min(t.tokens+i*this.O,this.R),t.lastAccess=t.lastAccess+i*this.N)}consumeRateLimit(t){var e,i=Date.now(),r=String(t),n=this.C[r];return n?this.F(n,i):this.C[r]=n={tokens:this.R,lastAccess:i},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}},Je="Mobile",Ke="Android",Ye="Tablet",Xe="Android Tablet",ti="iPad",ei="Apple Watch",ii="Safari",ri="BlackBerry",ni="Samsung Internet",si="Chrome",oi="Chrome iOS",ai="Internet Explorer",li="Internet Explorer Mobile",ui="Opera",hi="Microsoft Edge",di="Firefox",vi="Firefox iOS",ci="Nintendo",fi="PlayStation",pi="Xbox",gi="Android Mobile",mi="Mobile Safari",yi="Windows",_i="Windows Phone",bi="Nokia",wi="Ouya",ki="Generic "+Je.toLowerCase(),Si="Generic "+Ye.toLowerCase(),xi="Konqueror",Ci="Oculus Browser",Ti="Vivaldi",Ei="Yandex",Mi="Whale",Ii="DuckDuckGo",Ri="Pale Moon",Ai="Waterfox",Pi="Brave",Oi="Claude",Fi="Codex",$i="ChatGPT",Di="Google Search App",Li=new RegExp("Version/(\\d+(\\.\\d+)?)"),Ni=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),qi=new RegExp(pi,"i"),ji=new RegExp("PlayStation \\w+","i"),Bi=new RegExp("Nintendo \\w+","i"),Ui=new RegExp("BlackBerry|PlayBook|BB10","i"),Hi={"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"},zi=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?Pi:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&ve(t,"GSA/")?Di:ve(t," OPR/")&&ve(t,"Mini")?"Opera Mini":ve(t," OPR/")?ui:Ui.test(t)?ri:ve(t,"IEMobile")||ve(t,"WPDesktop")?li:ve(t,"OculusBrowser")?Ci:ve(t,"SamsungBrowser")?ni:ve(t,"Edge")||ve(t,"Edg/")?hi:ve(t,"Vivaldi/")?Ti:ve(t,"YaBrowser/")?Ei:ve(t,"Whale/")?Mi:ve(t,"DuckDuckGo/")||ve(t,"Ddg/")?Ii:ve(t,"Claude/")?Oi:ve(t,"Codex/")?Fi:ve(t,"ChatGPT/")?$i:ve(t,"FBIOS")?"Facebook Mobile":ve(t,"UCWEB")||ve(t,"UCBrowser")?"UC Browser":ve(t,"CriOS")?oi:ve(t,"CrMo")||ve(t,si)?si:ve(t,Ke)&&ve(t,ii)?gi:ve(t,"FxiOS")?vi:ve(t.toLowerCase(),xi.toLowerCase())?xi:ve(t,"Brave/")?Pi:((t,e)=>e&&ve(e,"Apple")||function(t){return ve(t,ii)&&!ve(t,si)&&!ve(t,Ke)}(t))(t,e)?ve(t,Je)?mi:ii:ve(t,"PaleMoon/")?Ri:ve(t,"Waterfox/")?Ai:ve(t,di)?di:ve(t,"MSIE")||ve(t,"Trident/")?ai:ve(t,"Gecko")?di:"")},Wi={[li]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[hi]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[si]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[oi]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[ii]:[Li],[mi]:[Li],[ui]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[di]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[vi]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[xi]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[ri]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Li],[gi]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[ni]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[Ci]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Ti]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[Ei]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[Mi]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Pi]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[Oi]:[Ni],[Fi]:[Ni],[$i]:[Ni],[Ii]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[Ri]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[Ai]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[Di]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[ai]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},Vi=function(t,e,i,r){var n=Wi[zi(t,e,i,r)];if(Ie(n))return null;for(var s=0;n.length>s;s++){var o=t.match(n[s]);if(o)return parseFloat(o[o.length-2])}return null},Gi=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[pi,t&&t[1]||""]],[new RegExp(ci,"i"),[ci,""]],[new RegExp(fi,"i"),[fi,""]],[Ui,[ri,""]],[new RegExp(yi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[_i,""];if(new RegExp(Je).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=Hi[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[yi,r]}return[yi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Ie(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[Ke,[t[2],t[3],t[4]||"0"].join(".")]:[Ke,""]],[/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/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],Zi=function(t){for(var e=0;Gi.length>e;e++){var i=Gi[e],r=i[1],n=i[0].exec(t),s=n&&(Te(r)?r(n,t):r);if(s)return s}return["",""]},Qi=function(t){return Bi.test(t)?ci:ji.test(t)?fi:qi.test(t)?pi:new RegExp(wi,"i").test(t)?wi:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?_i:/iPad/.test(t)?ti:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ei:Ui.test(t)?ri:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(bi,"i").test(t)?bi:/(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(Je).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)?Ke:Xe:new RegExp("(pda|Mobile)","i").test(t)?ki:new RegExp(Ye,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?Si:""},Ji=function(t,e){var i,r,n,s,o=Qi(t);return o===ti||o===Xe||"Kobo"===o||"Kindle Fire"===o||o===Si?Ye:o===ci||o===pi||o===fi||o===wi?"Console":o===ei?"Wearable":o?Je:"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)?Je:Ye:"Desktop"},Ki=/\bFBAV\/(\d+(?:\.\d+)*)/i,Yi=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Ki],[/\bFBAN\/EMA\b/i,"Facebook Lite",Ki],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Ki],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Xi="[Truncated]",tr="[Unserializable]";function er(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}Date,Date;var ir,rr,nr,sr=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function or(t,e){return"string"==typeof(i=t)&&sr.test(i)?t:e();var i}function ar(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 lr(t){return t?t.split("#")[0]:t}function ur(t,e){var i=setTimeout(t,e);return null!=i&&i.unref&&(null==i||i.unref()),i}function hr(t,e,i){return dr.apply(this,arguments)}function dr(){return(dr=a(function*(t,e,i){var r;try{return yield Promise.race([t,new Promise((t,n)=>{r=ur(()=>{try{null==i||i(),t()}catch(t){n(t)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function vr(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return nr&&i.length===rr?nr:(rr=i.length,nr=i.reduce((i,r)=>{ir||(ir={});var n=ir[r];if(n)i[n[0]]=n[1];else for(var s=t(r),o=s.length-1;o>=0;o--){var a,l=null==(a=s[o])?void 0:a.filename,u=e[r];if(l&&u){i[l]=u,ir[r]=[l,u];break}}return i},{}))}}var cr=class{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 a(function*(){for(var i of t)i.stacktrace&&i.stacktrace.frames&&Ce(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)),s({},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 a(function*(){var i=t;for(var r of e.modifiers)i=yield r(i);return i})()}convertToExceptionList(t,e){var i,r,n,o={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&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,s({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:vr(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 s({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>r(t,i),next:t=>r(t,i+1)})}};function fr(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?"?":i,in_app:!!e&&!e.startsWith("webkit-masked-url://")&&"<anonymous>"!==e};return Ie(r)||(s.lineno=r),Ie(n)||(s.colno=n),s}var pr=(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]:"?",i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},gr=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,mr=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,yr=/\((\S*)(?::(\d+))(?::(\d+))\)/,_r=(t,e)=>{var i=gr.exec(t);if(i)return fr(e,i[1],"?",+i[2],+i[3]);var r=mr.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=yr.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=pr(r[1]||"?",r[2]);return fr(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},br=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,wr=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,kr=(t,e)=>{var i=br.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=wr.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]||"?",o=pr(s,n);return fr(e,n=o[1],s=o[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},Sr=/\(error: (.*)\)/;var xr=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Re(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 Be(t,"DOMException")}isDOMError(t){return Be(t,"DOMError")}},Cr=class{match(t){return Ue(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}},Tr=class{match(t){return!!Be(t,"ErrorEvent")&&(null!=t.error||this.an(t))}coerce(t,e){var i;if(null!=t.error)return e.apply(t.error);var r=e.apply(t.message);return s({},r,{stack:null!==(i=this.sn(t))&&void 0!==i?i:r.stack,synthetic:!0})}an(t){return Re(t.message)&&t.message.length>0}sn(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(Re(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}},Er=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Mr=class{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(Er);return r&&(e=r[1],i=r[2]),[e,i]}},Ir=["fatal","error","warning","log","info","debug"];function Rr(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""}var Ar=class{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(He(t))return t.constructor.name;var e="name"in t?t.name:void 0;return Re(e)&&!Ae(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: "+Rr(t)}isSeverityLevel(t){return Re(t)&&!Ae(t)&&Ir.indexOf(t)>=0}getStack(t){try{return Re(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Re(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(Ue(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}},Pr=class{match(t){return He(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Rr(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}},Or=class{match(t){return je(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}}},Fr=class{match(t){return Be(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!He(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 je(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}},$r="$message",Dr="$timestamp",Lr=new Set([$r,Dr]),Nr={enabled:!0,max_bytes:32768};function qr(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Nr.enabled,max_bytes:Br(t.max_bytes,Nr.max_bytes)}:s({},Nr)}var jr=class{constructor(t){this.Gn=[],this.Zn=0,this.Rn=qr(t)}setConfig(t){this.Rn=qr(t),this.Jn()}add(t){var e=function(t){var e;try{e=pe(t)}catch(t){return}try{var i=JSON.parse(e);if(!Ee(i))return;var r=i,n=r[$r],s=r[Dr];if(!Re(n)||0===n.trim().length)return;if(!Re(s)&&!Fe(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("u">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.Rn.max_bytes||(this.Gn.push({step:e.step,bytes:i}),this.Zn+=i,this.Jn())}}getAttachable(){return this.Gn.map(t=>t.step)}clear(){this.Gn=[],this.Zn=0}size(){return this.Gn.length}Jn(){for(;this.Zn>this.Rn.max_bytes&&this.Gn.length>0;){var t=this.Gn.shift();t&&(this.Zn-=t.bytes)}}};function Br(t,e){if(!Fe(t)||1/0===t||-1/0===t)return e;var i=Math.floor(t);return 0>i?e:i}var Ur=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function Hr(t){return"string"==typeof t||t}function zr(t){return"string"==typeof t?t:void 0}var Wr,Vr=["$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"],Gr="NativeGzipValidationError",Zr=t=>t.length>=2&&31===t[0]&&139===t[1],Qr=(t,e)=>t===me.GZipJS||e===me.GZipJS||"gzip"===e,Jr=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Kr=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Jr(t)||e===Gr},Yr=t=>{throw ar(Gr,"Native gzip produced invalid output: "+t)},Xr=function(){var t=a(function*(t,e){18>t.size&&Yr("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());Zr(i)&&8===i[2]||Yr("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Wr)return Wr;Wr=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;Wr[t]=e>>>0}return Wr})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&Yr("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&Yr("invalid-size")});return function(e,i){return t.apply(this,arguments)}}();function tn(t,e,i){return en.apply(this,arguments)}function en(){return en=a(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(),o=s.write(r).then(()=>s.close()).catch(function(){var t=a(function*(t){try{yield s.abort(t)}catch(t){}throw t});return function(e){return t.apply(this,arguments)}}()),l=new Response(n.readable).blob(),u=(yield Promise.all([l,o]))[0];return yield Xr(u,r),u}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),en.apply(this,arguments)}var rn={}.propertyIsEnumerable;function nn(t,e){try{return an(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(t){return[]}}function sn(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:Xi};if(i.remainingNodes--,De(t))return{boolValue:t};if("bigint"==typeof t)return function(t,e){var i=t.toString(),r=BigInt("9223372036854775808");return t>=r||-r>t?(null==e||e.debug("Attribute "+i+" is outside the int64 range; encoding it as a string"),{stringValue:i}):{intValue:i}}(t,e);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(typeof BigInt>"u")return{stringValue:String(t)};var n=BigInt(t).toString();return t>=0x8000000000000000||-0x8000000000000000>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:er(t)};if("function"==typeof t)return{stringValue:"[Function]"};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:Xi};if(t instanceof Date){var s=t.getTime(),o=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof o?er(o):String(o)}}i.ancestors.add(t);try{try{var a=t.toJSON;if("function"==typeof a)return sn(a.call(t),e,i,r+1)}catch(t){}return Ce(t)?{arrayValue:{values:on(t,e,i,r+1)}}:{kvlistValue:{values:an(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:er(String(t))}}function on(t,e,i,r){for(var n=[],s=Math.min(t.length,1e3),o=0;s>o&&i.remainingNodes>0;o++)try{var a=o in t?t[o]:void 0;if(Oe(a))continue;n.push(sn(a,e,i,r))}catch(t){n.push({stringValue:tr})}return t.length>o&&n.push({stringValue:Xi}),n}function an(t,e,i,r){var n=[];for(var s in t)if(rn.call(t,s)){if(!s){null==e||e.debug("Dropping an attribute with an empty key");continue}if(n.length>=1e3||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=t[s];if(Pe(o)||Ie(o))continue;n.push({key:er(s),value:sn(o,e,i,r)})}catch(t){n.push({key:er(s),value:{stringValue:tr}})}}return n}function ln(t,e,i){return s({},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})}var un={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var hn={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}},dn=hn.info;function vn(t){try{return er(String(t))}catch(t){return tr}}function cn(t,e,i,r){var n,o=hn[t.level||"info"]||dn,a=o.text,l=o.number,u=(void 0===(n=Fe(r)?r:void 0)&&(n=Date.now()),String(n)+"000000"),h={};e.distinctId&&(h.posthogDistinctId=e.distinctId),e.sessionId&&(h.sessionId=e.sessionId),e.windowId&&(h["window.id"]=e.windowId),Oe(e.sessionStartTimestamp)||(h.sessionStartTimestamp=String(e.sessionStartTimestamp)),Oe(e.lastActivityTimestamp)||(h.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(h["url.full"]=e.currentUrl),e.screenName&&(h["screen.name"]=e.screenName),e.appState&&(h["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(h.feature_flags=e.activeFeatureFlags);var d=s({},h),v=t.attributes;if(v){var c=[];try{c=Object.keys(v)}catch(t){c=[]}for(var f of c){var p=void 0;try{p=v[f]}catch(t){p=tr}Object.defineProperty(d,f,{value:p,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:u,observedTimeUnixNano:u,severityNumber:l,severityText:a,body:{stringValue:vn(t.body)},attributes:nn(d,i)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),Ie(t.trace_flags)||(g.flags=t.trace_flags),g}function fn(t,e,i){return ln(t,e,i)}function pn(t,e,i,r){return{resourceLogs:[{resource:{attributes:nn(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}var gn=class{constructor(t,e,i,r,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.Rn=e,this.A=i,this.Qn=r,this.Kn=n,this.Xn=s,this.Yn=o,this.ts=null,this.es=0,this.rs=0,this.ns=0,this.ss=0,this.ls=0,this.us=!1,this.hs=e.maxBufferSize,this.ds=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this.vs=e.flushIntervalMs,this.cs=e.maxBatchRecordsPerPost,this.fs=e.rateCapWindowMs,this.ps=e.maxLogsPerInterval}clearQueue(){this.rs++,this._instance.setPersistedProperty(ge.LogsQueue,[])}reset(){this.gs(),this.ss=0,this.ls=0,this.us=!1,this.ns=0,this.cs=this.Rn.maxBatchRecordsPerPost}onReconnect(){this.ns=0,this.ys()}captureLog(t,e){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var r=this.bs(t);if(null!==r)if(r.body){if(this._s()){var n={record:cn(r,null!==(i=null==e?void 0:e.context)&&void 0!==i?i:this.Qn(),this.A,null==e?void 0:e.occurredAtMs)};this.Kn(()=>this.ws(n))}}else this.A.info("Log was rejected in beforeSend function")}}bs(t){var e=this.Rn.beforeSend;if(!e)return t;var i=Ce(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.A.info("Log was rejected in beforeSend function"),null;r=s}catch(t){return this.A.error("Error in beforeSend function for log:",t),null}return r}_s(){if(void 0===this.ps)return!0;var t=Date.now(),e=t-this.ss;return this.fs>e&&e>=0||(this.ss=t,this.ls=0,this.us=!1),this.ps>this.ls?(this.ls++,!0):(this.us||(this.A.warn("captureLog dropping logs: exceeded "+this.ps+" logs per "+this.fs+"ms"),this.us=!0),!1)}flush(){var t=this;return a(function*(){if(!t._instance.isDisabled)return t.ts||(t.ts=t.ks().finally(()=>{t.ts=null})),t.ts})()}ks(){var t=this;return a(function*(){var e;t.gs();var i=null!==(e=t._instance.getPersistedProperty(ge.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,o,a=t.rs;t.es=0;var l=Math.min(i.length,t.cs),u=i.slice(0,l),h=pn(u.map(t=>t.record),t.Ss(),null!==(s=t.Yn)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.xs(h);if(t.rs!==a)return;if("too-large"===d.kind&&u.length>1)t.cs=Math.max(1,Math.floor(u.length/2)),t.A.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+t.cs);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.A.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.Rn.maxBatchRecordsPerPost>t.cs&&(t.cs=Math.min(t.Rn.maxBatchRecordsPerPost,t.cs+1)),yield t.Cs(u.length),i=null!==(o=t._instance.getPersistedProperty(ge.LogsQueue))&&void 0!==o?o:[],n+=u.length,"fatal"===d.kind)throw d.error}}})()}Cs(t){var e=this;return a(function*(){var i,r=Math.max(0,t-e.es),n=null!==(i=e._instance.getPersistedProperty(ge.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(ge.LogsQueue,n.slice(r)),yield e.Xn()})()}Ss(){return fn(this.Rn,this._instance.getLibraryId(),this._instance.getLibraryVersion())}ws(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(ge.LogsQueue))&&void 0!==e?e:[];this.ds>i.length||(i.shift(),this.es++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(ge.LogsQueue,i),this.hs>i.length?this.Ts():this.ys()}}Ts(t){void 0===t&&(t=this.vs),this.Ms||(this.Ms=ur(()=>{this.Ms=void 0,this.ys()},t))}Is(){var t=Math.min(Math.max(0,this.ns-1),6);return this.vs*Math.pow(2,t)}Es(){var t=this._instance.getPersistedProperty(ge.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return a(function*(){e.gs();var i=e.flush().catch(()=>{});void 0!==t?yield hr(i,t):yield i})()}flushWithTimeout(t){var e=this;return a(function*(){var i=e.flush();yield hr(i,t,()=>{i.catch(()=>{})})})()}ys(){this.flush().then(()=>{this.ns=0},t=>{this.ns++,this.A.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.Es()&&this.Ts(this.Is())})}gs(){this.Ms&&(clearTimeout(this.Ms),this.Ms=void 0)}},mn=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function yn(t){return String(t)+"000000"}function _n(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}var bn=class{constructor(t,e,i){this._instance=t,this.Rn=e,this.A=i,this.Rs=new Map,this.ts=null,this.As=!1,this.Ps=new Map,this.Fs=new Set,this.Os=0}count(t,e,i){void 0===e&&(e=1),this.$s({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.$s({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.$s({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.ts,i=function(){var i=a(function*(){e&&(yield e.catch(()=>{})),yield t.Ds()});return function(){return i.apply(this,arguments)}}()().finally(()=>{this.ts===i&&(this.ts=null)});return this.ts=i,i}drainWindow(){if(0===this.Rs.size)return null;var t=this.Rs;return this.Rs=new Map,this.As=!1,this.Ps=new Map,this.Fs=new Set,this.Ls(t)}reset(){this.Os++,this.gs(),this.Rs=new Map,this.ts=null,this.As=!1,this.Ps=new Map,this.Fs=new Set}$s(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.bs(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.A.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,r;try{i=e.attributes?s({},e.attributes):void 0,r=_n(e.type,e.name,e.unit,i)}catch(t){return void this.A.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var n=this.Rs.get(r);if(!n){if(!this.Ns())return;n={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Rs.set(r,n)}var o=this.Ps.get(e.name);void 0===o?this.Ps.set(e.name,e.type):o===e.type||this.Fs.has(e.name)||(this.Fs.add(e.name),this.A.warn("Metric name '"+e.name+"' is already used as a "+o+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.qs(n,e.value),this.Ts()}else this.A.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}Ns(){return this.Rn.maxSeriesPerFlush>this.Rs.size||(this.As||(this.As=!0,this.A.warn("Metric series cap reached ("+this.Rn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}qs(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(mn.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,mn)]+=1}}bs(t){var e=this.Rn.beforeSend;if(!e)return t;var i=Ce(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.A.info("Metric was rejected in beforeSend function"),null;r=s}catch(t){return this.A.error("Error in beforeSend function for metric:",t),null}return r}Ts(){this.Ms||(this.Ms=ur(()=>{this.Ms=void 0,this.flush().catch(t=>{this.A.error("Metrics flush failed:",t)})},this.Rn.flushIntervalMs))}gs(){this.Ms&&(clearTimeout(this.Ms),this.Ms=void 0)}Ds(){var t=this;return a(function*(){if(0!==t.Rs.size){var e=t.Rs;t.Rs=new Map,t.As=!1,t.Ps=new Map,t.Fs=new Set;var i=t.Os,r=yield t._instance.js(t.Ls(e));if(i===t.Os)switch(r.kind){case"ok":return;case"retry-later":return t.Bs(e),void t.Ts();case"too-large":return void t.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.A.error("Failed to send metrics batch:",r.error)}}})()}Ls(t){return e=this.Hs(t),i=function(t,e,i){return ln(t,e,i)}(this.Rn,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:nn(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}Hs(t){var e=yn(Date.now()),i=new Map;for(var r of t.values()){var n,o=_n(r.type,r.name,r.unit,void 0),a=i.get(o);a||(a=s({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(o,a));var l=nn(null!==(n=r.attributes)&&void 0!==n?n:{},this.A),u=yn(r.windowStartMs);if("count"===r.type){var h,d={attributes:l,startTimeUnixNano:u,timeUnixNano:e,asDouble:null!==(h=r.total)&&void 0!==h?h:0};a.sum.dataPoints.push(d)}else if("gauge"===r.type){var v,c={attributes:l,timeUnixNano:e,asDouble:null!==(v=r.last)&&void 0!==v?v:0};a.gauge.dataPoints.push(c)}else r.hist&&a.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:mn})}return Array.from(i.values())}Bs(t){var e,i;for(var r of t){var n=r[0],s=r[1],o=this.Rs.get(n);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=(null!==(e=o.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(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.Ns()&&this.Rs.set(n,s)}}};function wn(t,e){var i;if(t)return null==(i=t.find(t=>t.type===e))?void 0:i.value}var kn="0.8.2",Sn={DEBUG:!1,LIB_VERSION:kn,LIB_NAME:"browser-common",JS_SDK_VERSION:kn},xn=function(t,e){var i=(void 0===e?{}:e).debugEnabled,r={q(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;r>s;s++)n[s-1]=arguments[s];l&&(Sn.DEBUG||l.POSTHOG_DEBUG||i)&&!Ie(l.console)&&l.console&&("__rrweb_original__"in l.console[e]?l.console[e].__rrweb_original__:l.console[e])(t,...n)},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("error",...e)},critical(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning(t){r.error("You must initialize PostHog before calling "+t)},createLogger:(e,i)=>xn(t+" "+e,i)};return r},Cn=xn("[PostHog.js]"),Tn=Cn.createLogger;function En(t,e){Ce(t)&&t.forEach(e)}function Mn(t,e){if(!Oe(t))if(Ce(t))t.forEach(e);else if(Le(t))t.forEach((t,i)=>e(t,i));else for(var i in t)Se.call(t,i)&&e(t[i],i)}var In=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 Rn(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 An=function(t){try{return t()}catch(t){return}},Pn=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){Cn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Cn.critical(t)}}},On=function(t){var e={};return Mn(t,function(t,i){(Re(t)&&t.length>0||Fe(t))&&(e[i]=t)}),e};function Fn(t){var e=s({},t);for(var i of["name","message","stack","cause","errors"])try{i in t&&(e[i]=t[i])}catch(t){}return e}var $n=["herokuapp.com","vercel.app","netlify.app"];function Dn(t){var e=null==t?void 0:t.hostname;if(!Re(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of $n)if(i===r)return!1;return!0}function Ln(t,e,i,r){var n=null!=r?r:{},s=n.capture,o=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===o||o})}function Nn(t){return"ph_toolbar_internal"===t.name}var qn=["localhost","127.0.0.1"],jn=(t,e)=>{try{var i;return JSON.stringify(t,(t,e)=>Ue(e)?(null!=i||(i=new WeakMap),i.has(e)||i.set(e,Fn(e)),i.get(e)):"bigint"==typeof e?e.toString():e,e)}catch(e){return pe(t)}},Bn=t=>{var e=null==d?void 0:d.createElement("a");return Ie(e)?null:(e.href=t,e)},Un=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return Mn(t,function(t,e){Ie(t)||Ie(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)},Hn=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(!Ce(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){Cn.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},zn=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");Ce(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=a;return null!=o&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},Wn=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},Vn=(t,e)=>t>=e&&y(),Gn=(t,e,i,r)=>{if(0===t){if(y()){var n=e+1;return n===i&&r(),n}return e}return 0};function Zn(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Te(r))return e;try{var n=r(e);return Re(n)&&n?n:e}catch(t){return Cn.error("Error in get_current_url, falling back to window.location.href",t),e}}function Qn(t){var e,i=null==l||null==(e=l.location)?void 0:e.href;return Ie(i)?void 0:Zn(t,i)}function Jn(t){return t instanceof Element&&("__POSTHOG_TOOLBAR__"===t.id||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function Kn(t){return!!t&&1===t.nodeType}function Yn(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Xn(t){return!!t&&3===t.nodeType}function ts(t){return!!t&&11===t.nodeType&&Kn(t.host)}function es(t){return t?ce(t).split(/\s+/):[]}function is(t,e){var i=Qn(e);return!!(i&&t&&t.some(t=>i.match(t)))}function rs(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 es(e)}function ns(t){return Oe(t)?null:ce(t).split(/(\s+)/).filter(t=>Rs(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ss(t){var e="";return ws(t)&&!ks(t)&&t.childNodes&&t.childNodes.length&&Mn(t.childNodes,function(t){var i;Xn(t)&&t.textContent&&(e+=null!==(i=ns(t.textContent))&&void 0!==i?i:"")}),ce(e)}function os(t){var e;return Ie(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var as=["a","button","form","input","select","textarea","label"];function ls(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}}function us(t,e){if(Ie(e))return!0;var i,r=function(t){if(e.some(e=>ls(t,e)))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function hs(t){var e=t.parentNode;return!(!e||!Kn(e))&&e}var ds=[".ph-no-autocapture","[data-ph-no-autocapture]"],vs=["next","previous","prev",">","<"],cs=[...vs,"+","-","−","–"],fs=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,ps=[".ph-no-deadclick",".ph-no-capture"],gs=[".ph-no-rageclick",".ph-no-capture"],ms=["","text","search","email","password","url","tel","number"];function ys(t,e){if(!l||_s(t))return!1;var i,r,n,s,o;if(De(e)?(i=!!e&&gs,r=void 0,n=!1):(i=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:gs,r=null==e?void 0:e.content_ignorelist,n=null!==(o=null==e?void 0:e.ignore_text_selection)&&void 0!==o&&o),!1===i)return!1;if(n&&function(t){return!(!t||!Kn(t))&&(!!Yn(t,"textarea")||(Yn(t,"input")?ve(ms,(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)))}(t))return!1;var a=bs(t,!1).targetElementList;return!function(t,e){if(!1===t||Ie(t))return!1;var i;if(!0===t)i=vs;else{if(!Ce(t))return!1;if(t.length>10)return Cn.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=>fs(e,t)||fs(r,t))})}(r,a.map(t=>{var e;return{safeText:ss(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}}))&&!us(a,i)}var _s=t=>!t||Yn(t,"html")||!Kn(t),bs=(t,e)=>{if(!l||_s(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[t],n=t;n.parentNode&&!Yn(n,"body");)if(ts(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var s=hs(n);if(!s)break;if(e||as.indexOf(s.tagName.toLowerCase())>-1)i=!0;else try{var o=l.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(s),n=s}return{parentIsUsefulElement:i,targetElementList:r}};function ws(t){for(var e=new Set,i=0,r=t;r.parentNode&&!Yn(r,"body");r=r.parentNode){if(i++>=1e3||e.has(r))return!1;e.add(r);var n=rs(r);if(ve(n,"ph-sensitive")||ve(n,"ph-no-capture"))return!1}if(ve(rs(t),"ph-include"))return!0;var s=t.type||"";if(Re(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Re(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function ks(t){return!!(Yn(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Yn(t,"select")||Yn(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Ss=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}))$"),xs=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Cs=[16,15,14,13],Ts=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Es=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Ms=/[0-9A-Za-z_]/;function Is(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 Rs(t,e){if(void 0===e&&(e=!0),Oe(t))return!1;if(Re(t)){if(t=ce(t),e?Ss.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(xs.lastIndex=0;e=xs.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Cs){var o=n+s;if(r.length>=o){var a=r.slice(n,o);if(Ss.test(a)&&Is(a))return!0}}}return!1}(t))return!1;if(e?Ts.test(t):function(t){var e;for(Es.lastIndex=0;e=Es.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&Ms.test(i)&&Ms.test(r)))return!0}return!1}(t))return!1}return!0}function As(t){var e=ss(t);return Rs(e=(e+" "+Ps(t)).trim())?e:""}function Ps(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Mn(t.childNodes,function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=ss(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Ps(t)).trim())}catch(t){Cn.error("[AutoCapture]",t)}}),e}function Os(t){return t.replace(/"|\\"/g,'\\"')}function Fs(t){var e=t.attr__class;if(e)return Ce(e)?e:es(e)}var $s=1e6;function Ds(t){var e;return Math.min($s,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:1e6)}var Ls={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:$s,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},Ns=["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"],qs=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],js=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Bs=t=>{Oe(t)||Mn(Object.keys(t),e=>{(t=>{var e=t.toLowerCase();return Ns.includes(e)||js.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Us=["/s/","/e/","/i/"];function Hs(t,e,i,r){if(Oe(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Re(n)&&(n=parseInt(n)),n>i?"[SessionRecording] "+r+" body too large to record ("+n+" bytes)":t}function zs(t,e){if(Oe(t))return t;var i=t;return Rs(i,!1)||(i="[SessionRecording] "+e+" body redacted"),Mn(qs,t=>{var r,n;null!=(r=i)&&r.length&&-1!==(null==(n=i)?void 0:n.indexOf(t))&&(i="[SessionRecording] "+e+" body redacted as might contain: "+t)}),i}var Ws=new WeakSet,Vs="disabled",Gs="sampled",Zs="active",Qs="buffering",Js="paused",Ks="lazy_loading",Ys="rrweb_error",Xs="trigger_activated",to="trigger_pending",eo="trigger_disabled";function io(t,e,i,r,n,s){return 0===e?eo:(null==t?void 0:t.get_property(i?r+i:n))===s?Xs:to}function ro(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 no(t){return t.includes("trigger_activated")?Xs:t.includes("trigger_pending")?to:eo}function so(t){var e=new Set(t);switch(e.delete(eo),e.size){case 0:return eo;case 1:return Array.from(e)[0];default:return to}}var oo=class{constructor(t){this.j=t}triggerStatus(t){return no(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return no(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},ao=class{constructor(t){this.j=t}triggerStatus(t){return so(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return so(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},lo=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return Xs}stop(){}},uo=t=>"sessionRecording"in t,ho=class{constructor(t,e){this._instance=t,this.B=[],this.H=[],this.$=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,i;this.B=(uo(t)?Ee(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(uo(t)?Ee(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){for(var t of(this.$.clear(),this.U.clear(),this.B))if("regex"===t.matching&&!this.$.has(t.url))try{this.$.set(t.url,new RegExp(t.url))}catch(e){Cn.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.H)if("regex"===e.matching&&!this.U.has(e.url))try{this.U.set(e.url,new RegExp(e.url))}catch(t){Cn.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return io(this._instance,this.B.length,this.V,tt,K,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Jt]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=Qn(this._instance);if(!t)return!1;try{return ro(t,this.H,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){var i=Qn(this._instance);if(i&&i!==this.W){this.W=i;var r=this.urlBlocked,n=ro(i,this.H,this.U);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=Qn(this._instance);if(n&&n!==this.W){this.W=n;var s=this.urlBlocked,o=ro(n,this.H,this.U);o&&!s?t():!o&&s&&e();var a=this.G(r)===Xs,l=ro(n,this.B,this.$);!a&&l&&i("url",n)}}stop(){this.W=""}},vo=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Wt]:t}),t}triggerStatusNoSideEffects(){var t=to;return Oe(this.linkedFlag)&&(t=eo),this.linkedFlagSeen&&(t=Xs),t}onConfig(t,e){var i;if(this.linkedFlag=(uo(t)?Ee(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Oe(this.linkedFlag)&&!this.linkedFlagSeen){var r=Re(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Re(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((t,i)=>{var s=!1;if(Ee(i)&&r in i){var o=i[r];s=De(o)?!0===o:n?o===n:!!o}var a=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,a&&e(r,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}},co=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(uo(t)?Ee(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return io(this._instance,this.K.length,this.V,X,Y,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[zt]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,i){if(0!==this.K.length){var r=this.X(i)===Xs,n=this.K.includes(t);!r&&n&&e("event",t)}}stop(){}},fo=class{constructor(t,e,i){if(this._instance=t,this.group=e,this.Y=new ho(t,e.id),this.tt=new co(t,e.id),this.et=new vo(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.Y.onConfig(n),this.tt.onConfig(n),this.et.onConfig(n,i);var s=[this.tt,this.Y,this.et];this.rt="any"===e.conditions.matchType?new oo(s):new ao(s)}else this.rt=new lo}triggerStatus(t){return this.rt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.rt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===to).map(t=>t.label)}checkEventTriggerConditions(t,e,i){this.tt.checkEventTriggerConditions(t,e,i)}checkUrlTriggerConditions(t,e,i,r){this.Y.checkUrlTriggerConditions(t,e,i,r)}activateTrigger(t,e){var i,r="url"===t?tt+this.group.id:X+this.group.id;null==(i=this._instance.persistence)||i.register({[r]:e})}stop(){this.Y.stop(),this.tt.stop(),this.et.stop()}};function po(t){if(t.rrwebError)return Ys;if(!t.receivedFlags)return Qs;if(!t.isRecordingEnabled)return Vs;if(t.urlTriggerMatching.urlBlocked)return Js;var e=!0===t.isSampled,i=new oo([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Gs:"trigger_activated"===i?Zs:"trigger_pending"===i?Qs:!1===t.isSampled?Vs:Zs}function go(t){if(t.rrwebError)return Ys;if(!t.receivedFlags)return Qs;if(!t.isRecordingEnabled)return Vs;if(t.urlTriggerMatching.urlBlocked)return Js;var e=new ao([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==eo,r=De(t.isSampled);return i&&"trigger_pending"===e?Qs:i&&"trigger_disabled"===e||r&&!t.isSampled?Vs:!0===t.isSampled?Gs:Zs}function mo(){var t=[];return function(e,i){if(Ee(i)||Ce(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function yo(t){var e=JSON.stringify(t,mo());return e?new Blob([e]).size:0}function _o(t){if(Pe(t))return 4;if(Ie(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(Ce(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=Ie(r)||Pe(r)?4:_o(r)}return e}var n=t,s=2,o=!0;for(var a in n)if({}.hasOwnProperty.call(n,a)){var l=n[a];Ie(l)||(o||(s+=1),o=!1,s+=a.length+3+_o(l))}return s;default:return 0}}function bo(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[bo({size:r.reduce((t,e)=>t+e,0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),bo({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 wo=Uint8Array,ko=Uint16Array,So=Uint32Array,xo=new wo([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]),Co=new wo([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]),To=new wo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Eo=function(t,e){for(var i=new ko(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new So(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]},Mo=Eo(xo,2),Io=Mo[1];Mo[0][28]=258,Io[258]=28;for(var Ro=Eo(Co,0)[1],Ao=new ko(32768),Po=0;32768>Po;++Po){var Oo=(43690&Po)>>>1|(21845&Po)<<1;Ao[Po]=((65280&(Oo=(61680&(Oo=(52428&Oo)>>>2|(13107&Oo)<<2))>>>4|(3855&Oo)<<4))>>>8|(255&Oo)<<8)>>>1}var Fo=function(t,e,i){for(var r=t.length,n=0,s=new ko(e);r>n;++n)++s[t[n]-1];var o,a=new ko(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new ko(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=a[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)o[Ao[d]>>>l]=u}else for(o=new ko(r),n=0;r>n;++n)o[n]=Ao[a[t[n]-1]++]>>>15-t[n];return o},$o=new wo(288);for(Po=0;144>Po;++Po)$o[Po]=8;for(Po=144;256>Po;++Po)$o[Po]=9;for(Po=256;280>Po;++Po)$o[Po]=7;for(Po=280;288>Po;++Po)$o[Po]=8;var Do=new wo(32);for(Po=0;32>Po;++Po)Do[Po]=5;var Lo=Fo($o,9,0),No=Fo(Do,5,0),qo=function(t){return(t/8|0)+(7&t&&1)},jo=function(t,e,i){(null==e||0>e)&&(e=0),(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof ko?ko:t instanceof So?So:wo)(i-e);return r.set(t.subarray(e,i)),r},Bo=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Uo=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Ho=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 wo(0),0];if(1==n){var o=new wo(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(t,e){return t.f-e.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=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:a.f+l.f,l:a,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new ko(v+1),f=zo(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 _=s[r].s;e>c[_]?p-=1<<e-c[_]++-1:++r}for(;r>=0&&p;--r){var b=s[r].s;c[b]==e&&(--c[b],++p)}f=e}return[new wo(c),f]},zo=function(t,e,i){return-1==t.s?Math.max(zo(t.l,e,i+1),zo(t.r,e,i+1)):e[t.s]=i},Wo=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new ko(++e),r=0,n=t[0],s=1,o=function(t){i[r++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[i.subarray(0,r),e]},Vo=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Go=function(t,e,i){var r=i.length,n=qo(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)},Zo=function(t,e,i,r,n,s,o,a,l,u,h){Bo(e,h++,i),++n[256];for(var d=Ho(n,15),v=d[0],c=d[1],f=Ho(s,15),p=f[0],g=f[1],m=Wo(v),y=m[0],_=m[1],b=Wo(p),w=b[0],k=b[1],S=new ko(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=Ho(S,7),T=C[0],E=C[1],M=19;M>4&&!T[To[M-1]];--M);var I,R,A,P,O=u+5<<3,F=Vo(n,$o)+Vo(s,Do)+o,D=Vo(n,v)+Vo(s,p)+o+14+3*M+Vo(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(F>=O&&D>=O)return Go(e,h,t.subarray(l,l+u));if(Bo(e,h,1+(F>D)),h+=2,F>D){I=Fo(v,c,0),R=v,A=Fo(p,g,0),P=p;var L=Fo(T,E,0);for(Bo(e,h,_-257),Bo(e,h+5,k-1),Bo(e,h+10,M-4),h+=14,x=0;M>x;++x)Bo(e,h+3*x,T[To[x]]);h+=3*M;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)Bo(e,h,L[B=31&j[x]]),h+=T[B],B>15&&(Bo(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else I=Lo,R=$o,A=No,P=Do;for(x=0;a>x;++x)if(r[x]>255){var B;Uo(e,h,I[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(Bo(e,h,r[x]>>>23&31),h+=xo[B]);var U=31&r[x];Uo(e,h,A[U]),h+=P[U],U>3&&(Uo(e,h,r[x]>>>5&8191),h+=Co[U])}else Uo(e,h,I[r[x]]),h+=R[r[x]];return Uo(e,h,I[256]),h+R[256]},Qo=new So([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Jo=new wo(0),Ko=function(){for(var t=new So(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Yo=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function Xo(t,e){void 0===e&&(e={});var i=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=Ko[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var n,s,o,a,l,u=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,i,r,n,s){var o=t.length,a=new wo(r+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(r,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=Go(l,u,t.subarray(h,d)):(l[h]=s,u=Go(l,u,t.subarray(h,o)))}else{for(var v=Qo[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new ko(32768),m=new ko(p+1),y=Math.ceil(i/3),_=2*y,b=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<_)&p},w=new So(25e3),k=new ko(288),S=new ko(32),x=0,C=0,T=(h=0,0),E=0,M=0;o>h;++h){var I=b(h),R=32767&h,A=m[I];if(g[R]=A,m[I]=R,h>=E){var P=o-h;if((x>7e3||T>24576)&&P>423){u=Zo(t,l,0,w,k,S,C,T,M,h-M,u),T=x=C=0,M=h;for(var O=0;286>O;++O)k[O]=0;for(O=0;30>O;++O)S[O]=0}var F=2,D=0,L=f,N=R-A&32767;if(P>2&&I==b(h-N))for(var q=Math.min(c,P)-1,j=Math.min(32767,h),B=Math.min(258,P);j>=N&&--L&&R!=A;){if(t[h+F]==t[h+F-N]){for(var U=0;B>U&&t[h+U]==t[h+U-N];++U);if(U>F){if(F=U,D=N,U>q)break;var H=Math.min(N,U-2),z=0;for(O=0;H>O;++O){var W=h-N+O+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,A=W)}}}N+=(R=A)-(A=g[R])+32768&32767}if(D){w[T++]=268435456|Io[F]<<18|Ro[D];var G=31&Io[F],Z=31&Ro[D];C+=xo[G]+Co[Z],++k[257+G],++S[Z],E=h+F,++x}else w[T++]=t[h],++k[t[h]]}}u=Zo(t,l,s,w,k,S,C,T,M,h-M,u),s||(u=Go(l,u,Jo))}return jo(a,0,r+qo(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a,!l)),h=u.length;return 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&&Yo(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)}}(u,e),Yo(u,h-8,i.d()),Yo(u,h-4,r),u}function ta(t,e){var i=t.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new wo(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},o=0;i>o;++o){if(n+5>r.length){var a=new wo(n+8+(i-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);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(++o))>>>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 jo(r,0,n)}function ea(t,e){var i="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var r=0;t.length>r;){var n=t[r++];128>n||e?i+=String.fromCharCode(n):224>n?i+=String.fromCharCode((31&n)<<6|63&t[r++]):240>n?i+=String.fromCharCode((15&n)<<12|(63&t[r++])<<6|63&t[r++]):(n=((15&n)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++])-65536,i+=String.fromCharCode(55296|n>>10,56320|1023&n))}return i}var ia=class{constructor(t,e){var i,r,n,s;void 0===e&&(e={}),this._rrweb=t,this.it=e,this.nt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{var t=Date.now(),e=t-this.ot;e>0?(this.ht=Math.min(this.ct,this.ht+e/1e3*this.dt),this.ot=t):this.ot=t},this.vt=t=>{if(!this.nt[t]){var e,i;this.nt[t]=!0;var r=this.ft(t);null==(e=(i=this.it).onBlockedNode)||e.call(i,t,r)}},this.yt=t=>{var e=this.ft(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.ft=t=>this._rrweb.mirror.getNode(t),this.bt=t=>{var e,i,r,n,s,o,a,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==(o=t.texts)?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null==(l=t.adds)?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,i=this.bt(e);if(e.attributes){var r,n,s=e.attributes.length;e.attributes=e.attributes.filter(t=>{var e=this.yt(t.id)[0];return!this.wt.consumeRateLimit(e)&&t});var o=s-e.attributes.length;o>0&&(null==(r=(n=this.it).onDroppedAttributeMutations)||r.call(n,o))}var a=this.bt(e);if(0!==a||i===a){if(this.kt)return t;this.ut();var l,u,h=_o(t);return h>this.ht?(null==(l=(u=this.it).onDroppedOversizedMutation)||l.call(u,h),void this._t()):(this.ht-=h,t)}},this._t=()=>{if(!this.St){var t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null==(t=(e=this.it).requestFullSnapshot)||t.call(e)},t)}},this.wt=new Qe({bucketSize:null!==(i=this.it.bucketSize)&&void 0!==i?i:100,refillRate:null!==(r=this.it.refillRate)&&void 0!==r?r:10,refillInterval:1e3,I:this.vt,A:Cn}),this.ct=null!==(n=this.it.bytesBucketSize)&&void 0!==n?n:0,this.dt=null!==(s=this.it.bytesRefillRate)&&void 0!==s?s:25600,this.kt=!Number.isFinite(this.ct)||0>=this.ct,this.ht=this.ct;var o=this.it.resyncIntervalMs;this.xt=Fe(o)&&Number.isFinite(o)&&o>0?o:3e5}reset(){this.nt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ht=this.ct,this.ot=Date.now(),this.st=-1/0}},ra=t=>{if(d){try{for(var e=t+"=",i=d.cookie.split(";").filter(t=>t.length),r=0;i.length>r;r++){for(var n=i[r];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Fe(t)&&isFinite(t)&&Math.floor(t)===t});var na=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,i,r,n){if(!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||!Number.isInteger(n)||0>e||0>i||0>r||0>n||e>0xffffffffffff||i>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/256,s[5]=e,s[6]=112|i>>>8,s[7]=i,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new t(s)}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 t(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}},sa=class{generate(){var t=this.generateOrAbort();if(!Ie(t))return t;this.Ct=0;var e=this.generateOrAbort();if(Ie(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t,e=(t=Date.now(),Fe(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0);if(e>this.Ct)this.Ct=e,this.Mt();else{if(this.Ct>=e+1e4)return;this.Tt++,this.Tt>4398046511103&&(this.Ct++,this.Mt())}return na.fromFieldsV7(this.Ct,Math.trunc(this.Tt/Math.pow(2,30)),this.Tt&Math.pow(2,30)-1,this.It.nextUint32())}Mt(){this.Tt=1024*this.It.nextUint32()+(1023&this.It.nextUint32())}constructor(){this.Ct=0,this.Tt=0,this.It=new la}},oa=t=>{if("u">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};l&&!Ie(l.crypto)&&crypto.getRandomValues&&(oa=t=>crypto.getRandomValues(t));var aa,la=class{nextUint32(){return this.Rt.length>this.At||(oa(this.Rt),this.At=0),this.Rt[this.At++]}constructor(){this.Rt=new Uint32Array(8),this.At=1/0}},ua=()=>ha().toString(),ha=()=>(aa||(aa=new sa)).generate(),da="",va=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var ca=null,fa={Et(){if(!Pe(ca))return ca;if(ca=!1,d)try{var t="__ph_cookie_support_"+ua();fa.Ot(t,"xyz"),ca='"xyz"'===ra(t),fa.Dt(t)}catch(t){ca=!1}return ca},Pt(t){Cn.error("cookieStore error: "+t)},Lt:ra,Nt(t){var e;try{e=JSON.parse(fa.Lt(t))||{}}catch(t){}return e},Ot(t,e,i,r,n){if(!d)return!1;try{var s="",o="",a=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=d),da)return da;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),r=Math.min(i.length,8),n="dmn_chk_"+ua();!da&&r--;){var s=i.slice(r).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",da=s)}return da}(t);if(!i){var r=(t=>{var e=t.match(va);return e?e[0]:""})(t);r!==i&&Cn.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(d.location.hostname,r);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&Cn.warn("cookieStore warning: large cookie, len="+u.length),d.cookie=u,!0}catch(t){return!1}},Dt(t,e){if(null!=d&&d.cookie)try{fa.Ot(t,"",-1,e)}catch(t){return}}},pa=null,ga={Et(){if(!Pe(pa))return pa;var t=!0;if(Ie(l))t=!1;else try{var e="__mplssupport__";ga.Ot(e,"xyz"),'"xyz"'!==ga.Lt(e)&&(t=!1),ga.Dt(e)}catch(e){t=!1}return t||Cn.error("localStorage unsupported; falling back to cookie store"),pa=t,t},Pt(t){Cn.error("localStorage error: "+t)},Lt(t){try{return null==l?void 0:l.localStorage.getItem(t)}catch(t){ga.Pt(t)}return null},Nt(t){try{return JSON.parse(ga.Lt(t))||{}}catch(t){}return null},Ot(t,e){try{return null==l||l.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){ga.Pt(t)}return!1},Dt(t){try{null==l||l.localStorage.removeItem(t)}catch(t){ga.Pt(t)}}},ma=[ct,st,nt,at,lt,ut,At,Rt,Mt],ya=[S,k,Z,Q,Nt,Lt,M,Pt],_a=t=>t+"_cpm",ba=["__proto__","constructor","prototype"],wa=t=>{if(!Ee(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===ba.indexOf(i)&&(e[i]=t[i])}),e},ka=function(t,e){void 0===e&&(e=[]);var i={};return[...ya,...e].forEach(e=>{var r=t[e];Ie(r)||Pe(r)||""===r||(i[e]=r)}),i},Sa=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)},xa=(t,e)=>({p:e,f:Sa(JSON.stringify(t))}),Ca=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=fa.Nt(_a(t)),r=(null==i?void 0:i.f)===Sa(e)&&Ce(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Ta=(t,e)=>e+"|"+(fa.Lt(_a(t))||""),Ea={},Ma={Et:()=>!0,Pt(t){Cn.error("memoryStorage error: "+t)},Lt:t=>t in Ea?Ea[t]:null,Nt:t=>t in Ea?Ea[t]:null,Ot:(t,e)=>(Ea[t]=e,!0),Dt(t){delete Ea[t]}},Ia=null,Ra={Et(){if(!Pe(Ia))return Ia;if(Ia=!0,Ie(l))Ia=!1;else try{var t="__support__";Ra.Ot(t,"xyz"),'"xyz"'!==Ra.Lt(t)&&(Ia=!1),Ra.Dt(t)}catch(t){Ia=!1}return Ia},Pt(t){Cn.error("sessionStorage error: ",t)},Lt(t){try{return null==l?void 0:l.sessionStorage.getItem(t)}catch(t){Ra.Pt(t)}return null},Nt(t){try{return JSON.parse(Ra.Lt(t))||null}catch(t){}return null},Ot(t,e){try{return null==l||l.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Ra.Pt(t)}return!1},Dt(t){try{null==l||l.sessionStorage.removeItem(t)}catch(t){Ra.Pt(t)}}};Sn.DEBUG=!1,Sn.LIB_VERSION="1.428.7",Sn.LIB_NAME="web";var Aa=Sn,Pa=class{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.Ft=t.get_property.bind(t),this.qt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.qt(rt,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.Ft(rt);return Ee(e=i)&&Re(e.sessionId)&&Fe(e.size)&&i.sessionId===t?i.size:0}};function Oa(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<Ze(100*e,0,100,Cn)}function Fa(t){return"$survey_response_"+t}function $a(t,e){if(!e)return null;var i=t[Fa(e)];return Ce(i)?[...i]:i}function Da(t,e,i){void 0===t&&(t={});var r={};return e.questions.forEach(e=>{if(!Ie(e.originalQuestionIndex)){var i,n=0===(i=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,s=$a(t,e.id);Ie(s)||(r[n]=s)}}),s({$survey_questions:e.questions.map(e=>{var r,n;return{id:e.id,question:null!==(r=null==i?void 0:i[null!==(n=e.id)&&void 0!==n?n:""])&&void 0!==r?r:e.question,response:$a(t,e.id)}})},t,r)}function La(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 Na(t){return"string"==typeof t&&t.trim()?t.trim():null}function qa(t){return t.toLowerCase()}function ja(t,e,i){if(!t||!e)return null;var r=qa(e),n=Object.keys(t).find(t=>qa(t)===r);if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],o=Object.keys(t).find(t=>qa(t)===s);if(o)return null==i||i.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}var Ba=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Ua(t,e,i){var r,n=ja(t.translations,e,i),o=s({},t),a=!1;if(n){var l,u=null==(l=t.translations)?void 0:l[n];if(u)if(null==i||i.info("Applying survey-level translation for language: "+n),Ie(u.name)||(o.name=u.name,a=!0),o.appearance){var h=s({},o.appearance);for(var d of Ba){var v=u[d];Ie(v)||(h[d]=v,a=!0)}o.appearance=h}else(function(t){return Ba.some(e=>!Ie(t[e]))})(u)&&(a=!0)}var c=t.questions.map(t=>function(t,e,i){var r,n=ja(t.translations,e,i);if(!n)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(r=t.translations)?void 0:r[n];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=s({},t),l=!1;return Ie(o.question)||(a.question=o.question,l=!0),Ie(o.description)||(a.description=o.description,l=!0),Ie(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Ie(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Ie(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Ie(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(t){return Ce(t.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:t,matchedKey:l?n:null,hasChanges:l}}(t,e,i)),f=c.map(t=>t.question),p=c.some(t=>t.hasChanges),g=null;return n||(g=(null==(r=c.find(t=>t.matchedKey))?void 0:r.matchedKey)||null),p&&(o.questions=f,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:o,matchedKey:a?n||g:null}}function Ha(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function za(t){var e;return Ha(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var Wa=(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}},Va=t=>t.toLowerCase(),Ga={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=>Wa(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Wa(e,t))),icontains:(t,e)=>e.map(Va).some(e=>t.map(Va).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Va).every(e=>t.map(Va).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 Za(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=Ga[i.operator];return!!n&&n(i.values,[String(r)])})}function Qa(t,e,i){return jn({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var Ja=new Set(["is_not","not_icontains","not_regex"]);function Ka(t,e,i){return!t||0===t.length||t.every(t=>{var r,n=null==(r="person"===t.type?i:e)?void 0:r[t.key],s=t.operator||"exact";if(Ie(n)||Pe(n))return Ja.has(s);var o=Ga[s];return!!o&&!Ie(t.value)&&!Pe(t.value)&&o(Ce(t.value)?t.value.map(String):[String(t.value)],Ce(n)?n.map(String):[String(n)])})}var Ya=Tn("[SessionRecording]");function Xa(t,e){return e?t:"!"+t}function tl(t,e){return t===e||t!=="!"+e&&null}var el=class{constructor(t,e,i,r,n,s,o){this._instance=t,this.Y=e,this.tt=i,this.et=r,this.jt=n,this.Bt=s,this.Ht=o,this.$t=null,this.zt=go}onRemoteConfig(t){this.$t=Fe(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ut=new oo([this.tt,this.Y]),this.zt=po):(this.Ut=new ao([this.tt,this.Y]),this.zt=go),this._instance.register_for_session({[Zt]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.jt("linked_flag_matched",{flag:t,variant:e}),this.Ht()})}getStatus(t){return this.zt({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,i=null==(e=this._instance.get_property("$session_recording_remote_config"))?void 0:e.minimumDurationMilliseconds;return Fe(i)?i:null}checkUrlTriggers(t,e,i,r){this.Y.checkUrlTriggerConditions(e,i,r,t)}setupEventTriggerListeners(t,e,i){if(0!==this.tt.K.length&&Oe(this.Wt))return this.Wt=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,i,e)}catch(t){Ya.error("Could not activate event trigger",t)}}),this.Wt}makeSamplingDecisions(t){var e,i,r,n=this.$t;if(!Fe(n))return null==(i=this._instance.persistence)||i.unregister(Q),void(null==(r=this._instance.persistence)||r.unregister(H));var s=this._instance.get_property(Q),o=this._instance.get_property(H),a=tl(s,t),l=Fe(o)&&o!==n,u=Ie(o)&&s===t,h=l||u||!De(a),d=h?Oa(t,n):a;h&&(d?this.jt("sampled"):Ya.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Q]:Xa(t,d),[H]:Pe(o)&&s===t?null:n})}ensureSamplingDecision(t){Fe(this.$t)&&(De(tl(this._instance.get_property(Q),t))||this.makeSamplingDecisions(t))}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(Y),null==(e=this._instance.persistence)||e.unregister(K),null==(i=this._instance.persistence)||i.unregister(Q),null==(r=this._instance.persistence)||r.unregister(H),null==(n=this._instance.persistence)||n.unregister(J)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Ut)?void 0:e.triggerStatus(t))===to}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===to).map(t=>t.label)}stop(){var t;null==(t=this.Wt)||t.call(this),this.Wt=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},il=class{constructor(t,e,i,r,n){this._instance=t,this.Y=e,this.jt=i,this.Vt=r,this.Ht=n,this.Zt=[],this.Gt=new Map,this.Qt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Jt(t.triggerGroups),this._instance.register_for_session({[Zt]:"v2_trigger_groups",[Qt]:t.triggerGroups.length}),this.Y.onConfig(t)):Ya.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Ys;if(!t.receivedFlags)return Qs;if(!t.isRecordingEnabled)return Vs;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 o=s.triggerStatus(t.sessionId);if("trigger_activated"===o){var a=s.group.id,l=i.get(a);Ie(l)?Cn.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:a}):!0===l&&(n=!0)}else"trigger_pending"===o&&(r=!0)}return n?Gs:r?Qs:Vs}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Zt,triggerGroupSamplingResults:this.Gt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var i of this.Zt)if("trigger_activated"===i.triggerStatus(t)){var r=i.group.minDurationMs;Fe(r)&&(Pe(e)||e>r)&&(e=r)}return e}checkUrlTriggers(t,e,i,r){var n=this;this.Y.checkUrlBlocklist(e,i);var s=function(r){r.checkUrlTriggerConditions(e,i,e=>{n.Kt(r,void 0)&&(r.activateTrigger(e,t),n.updateActiveTriggers(t),n.Ht(e))},t)};for(var o of this.Zt)s(o)}setupEventTriggerListeners(t,e,i){var r=this;return this.Wt=t(t=>{var i;if(this.Qt)return Ya.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(i=this.Wt)||i.call(this),void(this.Wt=void 0);try{var n=function(i){i.checkEventTriggerConditions(t.event,n=>{if(r.Kt(i,t.properties)){var s=(i.group.conditions.events||[]).filter(e=>e.name===t.event),o=r._instance.get_property(ct);s.some(e=>!e.properties||0===e.properties.length||Ka(e.properties,t.properties,o))&&(i.activateTrigger(n,e),r.updateActiveTriggers(e),r.Ht(n))}},e)};for(var s of this.Zt)n(s)}catch(t){Ya.error("Could not activate event trigger for trigger groups",t)}}),this.Wt}makeSamplingDecisions(t){for(var e of this.Zt){var i,r=e.group,n=r.id,s=r.sampleRate,o=et+n,a=this._instance.get_property(o),l=null,u=!1,h=!1,d=!1;if(Ee(a)){var v=a.sessionId,c=a.sampleRate,f=a.sampled;u="string"==typeof v&&v!==t,h=Fe(c)&&c!==s,l=v===t&&Fe(c)&&c===s&&De(f)?f:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;var p=u||h||d||!De(l),g=p?Oa(t+n,s):l;p&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:n,group_name:r.name,sampleRate:s,isSampled:g}),this.Gt.set(n,g),null==(i=this._instance.persistence)||i.register({[o]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Qt=!0}clearConditionalRecordingPersistence(){var t,e,i;for(var r of(null==(t=this._instance.persistence)||t.unregister(Q),null==(e=this._instance.persistence)||e.unregister(H),null==(i=this._instance.persistence)||i.unregister(J),this.Zt)){var n,s,o,a=r.group.id;null==(n=this._instance.persistence)||n.unregister(X+a),null==(s=this._instance.persistence)||s.unregister(tt+a),null==(o=this._instance.persistence)||o.unregister(et+a)}}updateActiveTriggers(t){var e=[];for(var i of this.Zt){var r=i.group,n=r.id,s="trigger_activated"===i.triggerStatus(t),o=!0===this.Gt.get(n);s&&e.push({id:n,name:r.name,matched:!0,sampled:o})}this._instance.register_for_session({[Vt]:e})}hasPendingTriggers(t){for(var e of this.Zt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Zt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>'trigger group "'+e.group.name+'": '+t))}stop(){var t;null==(t=this.Wt)||t.call(this),this.Wt=void 0,this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear(),this.Y.stop()}Kt(t,e){var i=t.group.conditions.properties;return!i||0===i.length||Ka(i,e,this._instance.get_property(ct))}Jt(t){var e=this;this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear();var i=function(t){var i=new fo(e._instance,t,(i,r)=>{e.jt("linked_flag_matched",{flag:i,variant:r,group_id:t.id,group_name:t.name}),e.Ht()});e.Zt.push(i)};for(var r of t)i(r)}},rl=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],nl=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...rl],sl="<masked>",ol=["li_fat_id"];function al(t,e,i){if(!d)return{};var r,n=e?[...rl,...i||[]]:[],s=ll(zn(d.URL,n,sl),t);return In((r={},Mn(ol,function(t){var e=ra(t);r[t]=e||null}),r),s)}function ll(t,e){var i=nl.concat(e||[]),r={};return Mn(i,function(e){var i=Hn(t,e);r[e]=i||null}),r}function ul(t){var e=function(t){return t?0===t.search("https?://(.*)google.([^/?]*)")?"google":0===t.search("https?://(.*)bing.com")?"bing":0===t.search("https?://(.*)yahoo.com")?"yahoo":0===t.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",r={};if(!Pe(e)){r.$search_engine=e;var n=d?Hn(d.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function hl(){return navigator.language||navigator.userLanguage}var dl="$direct";function vl(){return(null==d?void 0:d.referrer)||dl}function cl(t,e,i){var r;void 0===i&&(i=!1);var n=t?[...rl,...e||[]]:[],s=null==(r=i?lr(null==v?void 0:v.href):null==v?void 0:v.href)?void 0:r.substring(0,1e3);return{r:vl().substring(0,1e3),u:s?zn(s,n,sl):void 0}}function fl(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?lr(n):n,o={$referrer:r,$referring_domain:null==r?void 0:r==dl?dl:null==(i=Bn(r))?void 0:i.host};if(s){o.$current_url=s;var a=Bn(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,In(o,ll(s))}return r&&In(o,ul(r)),o}function pl(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function gl(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var ml=1e5,yl=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,_l=[],bl=()=>!1,wl="@type @id 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(" "),kl="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),Sl="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(" "),xl="Accommodation AdministrativeArea Country Place State".split(" "),Cl={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:kl,publisher:Sl},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:_l},Offer:{seller:Sl},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},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:Sl,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:Sl,areaServed:xl,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:_l}},Tl=[["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(" "),Cl.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),Cl.Event],[Sl,Cl.Organization],[xl,Cl.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),Cl.Product]];function El(t,e){return Se.call(t,e)?t[e]:void 0}function Ml(t){var e=typeof t;return Pe(t)||"string"===e||"number"===e||"boolean"===e}function Il(t){return Ml(t)||Ce(t)&&t.every(Ml)?t:void 0}function Rl(t,e){if("string"==typeof t){var i=t.trim(),r=i.indexOf("#"),n=0>r?i:i.slice(r+1);if(!(!n||0>r&&(/^[a-z][a-z\d+.-]*:/i.test(i)||i.includes("/")||i.includes("?"))))try{return e(n)?n:void 0}catch(t){return}}}function Al(t){if(Se.call(Cl,t))return Cl[t];for(var e of Tl){var i=e[1];if(e[0].includes(t))return i}}function Pl(t,e,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0})}function Ol(t,e,i,r){if(Ce(t)){var n=t.map(t=>Ol(t,e,i,r)).filter(t=>!Ie(t));return n.length?n:void 0}return Fl(t,e,i,r)||void 0}function Fl(t,e,i,r){if(!Ee(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(i))return null;var n=El(t,"@type"),s=function(t){var e=new Set,i="string"==typeof t?[t]:Ce(t)?t:[],r=[];for(var n of i)if("string"==typeof n){var s=n.replace(/^https?:\/\/schema\.org\//,"");if(100>=s.length&&yl.test(s)&&!e.has(s)&&(e.add(s),r.push(s),20===r.length))break}return r}(n),o=s.filter(t=>!!Al(t)&&(!r||!r.length||r.includes(t))),a={};for(var l of wl){var u="@type"===l?s.length?"string"==typeof n?s[0]:s:void 0:"@id"===l?Rl(El(t,l),e):Il(El(t,l));Ie(u)||Pl(a,l,u)}for(var h of o){var d=Al(h);for(var v of Object.keys(d)){var c=El(t,v),f=d[v];if(!0===f){var p=Il(c);Ie(p)||Pl(a,v,p)}else{var g=Ol(c,e,i,f);Ie(g)||Pl(a,v,g)}}}var m=Ol(El(t,"@graph"),e,i);return Ie(m)||Pl(a,"@graph",m),Object.keys(a).length?a:null}function $l(t,e,i){if(!Ee(t))return null;var r=El(t,"@context");if("string"!=typeof r||!/^https?:\/\/schema\.org\/?$/.test(r))return null;var n=Fl(t,e,i);return n?s({"@context":"https://schema.org"},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 Ll(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 Nl(t,e,i){for(var r=t;r;){if(Ll(r,e,i))return!0;var n=r.parentNode;r=r.parentElement||(n&&n.nodeType===n.DOCUMENT_FRAGMENT_NODE?n.host:null)}return!1}function ql(t){return Dl(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Dl)}function jl(t){return Ie(t)?void 0:Math.round(t)}function Bl(t){return Ee(t)?t.network_timing:t}var Ul,Hl,zl=Tn("[SessionRecording]"),Wl=[1,2,3,4,5,6,7,12],Vl=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Gl(){var t;return null==b||null==(t=b.__PosthogExtensions__)?void 0:t.rrweb}function Zl(){var t;return null==(t=Gl())?void 0:t.record}function Ql(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,mo())}}function Jl(t){return ea(Xo(ta(Ql(t))),!0)}function Kl(t){return Yl.apply(this,arguments)}function Yl(){return(Yl=a(function*(t){var e=yield tn(Ql(t),Aa.DEBUG,{rethrow:!0});return ea(new Uint8Array(yield e.arrayBuffer()),!0)})).apply(this,arguments)}var Xl="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,tu=!1;function eu(t){return Ce(t)&&0===t.length?Ul=null!=Ul?Ul:Jl([]):Jl(t)}function iu(t){return ru.apply(this,arguments)}function ru(){return(ru=a(function*(t){return Ce(t)&&0===t.length?Ul||(Hl=null!=Hl?Hl:Kl([]).then(t=>(Ul=t,t)).catch(t=>{throw Ul=void 0,Hl=void 0,t})):Kl(t)})).apply(this,arguments)}function nu(t){return Xl&&!tu&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function su(t){return{event:t,size:_o(t)}}function ou(t,e){return s({},t,{data:e,cv:"2024-10"})}function au(t,e){return s({},t,{cv:"2024-10",data:s({},t.data,e)})}function lu(t){try{if(2===t.type)return su(ou(t,Jl(t.data)));if(3===t.type&&0===t.data.source)return su(au(t,{texts:eu(t.data.texts),attributes:eu(t.data.attributes),removes:eu(t.data.removes),adds:eu(t.data.adds)}));if(3===t.type&&8===t.data.source)return su(au(t,{adds:t.data.adds?Jl(t.data.adds):void 0,removes:t.data.removes?Jl(t.data.removes):void 0}))}catch(t){zl.error("could not compress event - will use uncompressed event",t)}return{event:t,size:yo(t)}}function uu(){return uu=a(function*(t){try{if(2===t.type)return su(ou(t,yield Kl(t.data)));if(3===t.type&&0===t.data.source){var e=yield Promise.all([iu(t.data.texts),iu(t.data.attributes),iu(t.data.removes),iu(t.data.adds)]);return su(au(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(3===t.type&&8===t.data.source){var i=yield Promise.all([t.data.adds?Kl(t.data.adds):void 0,t.data.removes?Kl(t.data.removes):void 0]);return su(au(t,{adds:i[0],removes:i[1]}))}}catch(e){return Kr(e)&&(tu=!0),zl.error("could not compress event asynchronously - trying synchronous compression",e),lu(t)}return{event:t,size:yo(t)}}),uu.apply(this,arguments)}function hu(t,e){return 5===t.type&&t.data.tag===e}function du(t){return hu(t,"sessionIdle")}function vu(t){return hu(t,"$session_ending")}function cu(t){return hu(t,"$session_starting")}var fu=class{get sessionId(){return this.Xt}get Yt(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get te(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ee(){return tl(this._instance.get_property(Q),this.sessionId)}get $t(){var t,e=null==(t=this.re)?void 0:t.sampleRate;return Fe(e)?e:null}get ie(){var t,e;return null!==(t=null==(e=this.ne)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.oe="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.ae=void 0,this.se=!1,this.ue=Date.now(),this.le=!1,this.he=[],this.ce="unknown",this.de=0,this.ve=0,this.fe=0,this.pe=0,this.ge=!1,this.me=!1,this.ye=!1,this.be=!1,this.we=!1,this.ke=!1,this._e=!1,this.Se=!1,this.xe=!1,this.Ce=!1,this.Me=!1,this.Te=!1,this.Ie=[],this.Re=void 0,this.Ae=void 0,this.Ee=!1,this.Oe=[],this.Le=0,this.De=0,this.Pe=!1,this.Ne=void 0,this.Wt=void 0,this.Fe=void 0,this.qe=void 0,this.je=void 0,this.Be=(t,e,i)=>{var r,n,s,o;if(i&&(t!==this.Xt||e!==this.He)){var a=!i.noSessionId&&(i.activityTimeout||i.sessionPastMaximumLength),l=this.Xt,u=this.He;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.ue,flushed_size:null==(r=this.$e)?void 0:r.currentTrackedSize(l)}),null==(n=this._instance.persistence)||n.unregister(it),this._e=!1,null==(s=Gl())||null==s.resetMaxDepthState||s.resetMaxDepthState(),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.ze(),!(!1===this.ce&&this.isStarted||this.Xt===t&&this.He===e)){var h=this.Xt!==t&&!1!==this.ce;this.ce="unknown",this.Ue(h)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.ue}),null==(o=this.ne)||o.makeSamplingDecisions(t)}},this.We=!1,this.Ve=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[J])===this.Xt},this.Ze=()=>{var t,e;if(0===this.Rt.data.length)return null;var i=null==(t=this.Rt.data[0])?void 0:t.timestamp,r=null==(e=this.Rt.data[this.Rt.data.length-1])?void 0:e.timestamp;return Fe(i)&&Fe(r)?r-i:null},this.Ge=()=>{var t,e,i=this.ie;if(!Fe(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.Qe;return Fe(r)&&r>=0&&i>r}if(this.Ve())return!1;var n,s=this.Ze();return!!Pe(s)||i>s||(null==(n=this._instance.persistence)||n.register({[J]:this.Xt}),!1)},this.Je=()=>{"buffering"!==this.status?(this.ge&&this.me&&this.Ke&&!this.ye&&this.Xe(void 0),this.Ye(),this.tr(!0)):this.er()},this.rr=()=>{this.Je()},this.ir=()=>{this.Vt("browser offline",{})},this.nr=()=>{this.Vt("browser online",{})},this.ar=()=>{null!=d&&d.visibilityState&&("visible"===d.visibilityState&&(this.Ke=!0),this.Vt("window "+d.visibilityState,{}))},this.Ke=null==e||e;var i=this.Yt.checkAndGetSessionAndWindowId(),r=i.windowId,n=i.sessionStartTimestamp;this.Xt=i.sessionId,this.He=r,this._sessionStartTimestamp=n,this.et=new vo(this._instance),this.Y=new ho(this._instance),this.tt=new co(this._instance),this.Rt=this.er(),this.sr="ph_"+(this._instance.config.persistence_name||this._instance.config.token)+"_replay_pending_buffer",this.Yt.sessionTimeoutMs>this.te||zl.warn("session_idle_threshold_ms ("+this.te+") is greater than the session timeout ("+this.Yt.sessionTimeoutMs+"). Session will never be detected as idle"),this.$e=new Pa(this._instance)}setDocumentWasEverVisible(t){t&&(this.Ke=!0)}get ur(){var t,e,i,r,n,s,o,a,l,u=null==(t=this.re)?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!==(o=null==h?void 0:h.maskTextSelector)&&void 0!==o?o:null==u?void 0:u.maskTextSelector,c=null!==(a=null==h?void 0:h.blockSelector)&&void 0!==a?a: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 Ie(d)&&Ie(v)&&Ie(c)&&Ie(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}lr(){var t;if(!this.xe){var e=null==(t=this.re)?void 0:t.masking;if(!Oe(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!Ie(r)&&r!==n});0!==r.length&&(this.xe=!0,zl.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 hr(){var t;return Ze(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Tn("canvas recording resolution scale"),1)}get cr(){var t,e,i,r,n,s,o,a=this._instance.config.session_recording.captureCanvas,l=null==(t=this.re)?void 0:t.canvasRecording,u=null!==(e=null!==(i=null==a?void 0:a.recordCanvas)&&void 0!==i?i:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(r=null!==(n=null==a?void 0:a.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==r?r:4,d=null!==(s=null!==(o=null==a?void 0:a.canvasQuality)&&void 0!==o?o: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:Ze(h,0,12,Tn("canvas recording fps"),4),quality:Ze(d,0,1,Tn("canvas recording quality"),.4)}}get dr(){var t,e,i=!(null==(t=this.re)||!t.consoleLogRecordingEnabled);return null!==(e=this._instance.config.enable_recording_console_log)&&void 0!==e?e:i}get vr(){var t,e,i,r=null==(t=this.re)?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),o=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),a=Bl(this._instance.config.capture_performance),l=Bl(null==r?void 0:r.capturePerformance),u=!!(De(a)?a:l);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}pr(){var t,e,i=[],r=null==(t=b.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.dr&&i.push(r());var n=null==(e=b.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.vr&&Te(n))if(!qn.includes(v.hostname)||this._forceAllowLocalhostNetworkCapture){var o=Te(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(n(((t,e,i)=>{var r,n={payloadSizeLimitBytes:Ls.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ls.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Ls.payloadHostDenyList]},o=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,l=!1!==t.capture_performance&&e.recordPerformance,u=(r=Ds(n),t=>(null!=t&&t.requestBody&&(t.requestBody=Hs(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=Hs(t.responseBody,t.responseHeaders,r,"Response")),t)),h=e=>{return u(((t,e,i)=>{var r;if(null==i||!i(t.name)){var n=Bn(t.name),s=0===e.indexOf("http")?null==(r=Bn(e))?void 0:r.pathname:e;"/"===s&&(s="");var o=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&o&&Us.some(t=>0===o.indexOf(t))))return t}})((Bs((r=e).requestHeaders),Bs(r.responseHeaders),r),t.api_host,i));var r},d=Te(t.session_recording.maskNetworkRequestFn);return d&&Te(t.session_recording.maskCapturedNetworkRequestFn)&&Cn.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return!i&&e.isInitial?i:s({},e,{name:null==i?void 0:i.url})}),n.maskRequestFn=Te(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var i=h(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 Oe(n)&&r?(Ws.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!Ie(t))return t.requestBody=zs(t.requestBody,"Request"),t.responseBody=zs(t.responseBody,"Response"),t}(h(t)),s({},Ls,n,{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.vr,o)))}else zl.info("NetworkCapture not started because we are on localhost.");return i}gr(t){return this._instance.config.disable_capture_url_hashes?lr(t):t}mr(t,e){void 0===e&&(e=!1);var i=e?lr(t):this.gr(t),r=this._instance.config.mask_personal_data_properties?[...rl,...this._instance.config.custom_personal_data_properties||[]]:[];return this.yr(zn(i,r,sl))}yr(t){var e,i=this._instance.config.session_recording;if(i.maskCapturedNetworkRequestFn){var r,n=i.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==n?void 0:n.name)&&void 0!==r?r:null==n?void 0:n.url}return i.maskNetworkRequestFn?null==(e=i.maskNetworkRequestFn({url:t}))?void 0:e.url:t}br(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.he.length?this.he.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):zl.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.br(Vl(()=>Zl().addCustomEvent(t,e)))}wr(){var t;return this.se&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.ce}kr(t){if(!this.wr())return!1;try{var e=Zl();return!!e&&(e.addCustomEvent("$json_ld",t),this.wr())}catch(t){return!1}}_r(t){void 0===t&&(t=!1),Promise.resolve().then(()=>{var e;return null==(e=this.Sr)?void 0:e.scan(t)})}Cr(){try{if(this._instance.config.capture_pageview||!l)return;var t=new URL(l.location.href),e=this.mr(t.origin+t.pathname+t.search);this.Mr!==e&&(this.Mr=e,this.Vt("$url_changed",{href:e}))}catch(t){}}Tr(){if(this.he.length){var t=[...this.he];this.he=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.br(t)})}}Bt(){return this.br(Vl(()=>Zl().takeFullSnapshot()))}get Ir(){var t,e,i;if(null!=(t=this.ne)&&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 Fe(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}Rr(){if(this.Ar&&clearInterval(this.Ar),!0!==this.ce){var t=this.Ir;t&&(this.Ar=setInterval(()=>{this.Bt()},t))}}Ht(t){"event"===t&&this.Er(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Rr()}Or(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null==(t=this.Sr)||t.scan(),clearInterval(this.Ar),zl.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}Lr(){var t;this.Y.urlBlocked&&(null==(t=this.Sr)||t.scan(),this.Y.urlBlocked=!1,this.Bt(),this._r(),this.Rr(),this.Vt("recording resumed",{reason:"left blocked url"}),zl.info("recording resumed"))}Dr(t,e){var i;if("event"===t&&this.Er(),!this.le&&null!=(i=this.ne)&&i.hasPendingTriggers(this.sessionId)){this.le=!0;try{var r,n,s="url"===t?K:Y;null==(r=this._instance.persistence)||r.register({[s]:this.sessionId}),null==(n=this.ne)||n.updateActiveTriggers(this.sessionId),this.Ht(),this.tr(),this.jt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.le=!1}}}get isStarted(){return!!this.ae}get re(){var t=this._instance.get_property(B);if(t){var e;try{e=Ee(t)?t:JSON.parse(t)}catch(t){return void zl.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.We){var i,r,n=null!==(i=e.cache_timestamp)&&void 0!==i?i:Date.now();if(Date.now()-n>36e5)return zl.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(B))}return e}}Pr(t,e,i){this._instance.get_property(t)&&(e(),i())}start(t){var e,i,r=this.re;if(r){if(!this.isStarted){var n=!1!==this.ce&&!this.be;this.Xe(n?"no_interaction_since_recording_started":void 0),this.be=!1,this.me=n,this.ye=!1}this.Pe&&(this.Nr(),this.er());var s=this.Yt.checkAndGetSessionAndWindowId(),o=s.windowId,a=s.sessionStartTimestamp;this.Xt=s.sessionId,this.He=o,this._sessionStartTimestamp=a,this.Fr(),null==(e=this._instance.persistence)||e.unregister(it),null!=r&&r.endpoint&&(this.oe=null==r?void 0:r.endpoint),this.ne=2===(null==r?void 0:r.version)&&null!=r&&r.triggerGroups&&r.triggerGroups.length>0?new il(this._instance,this.Y,this.jt.bind(this),this.Vt.bind(this),this.Ht.bind(this)):new el(this._instance,this.Y,this.tt,this.et,this.jt.bind(this),this.Bt.bind(this),this.Ht.bind(this)),this.ne.onRemoteConfig(r),null==(i=this.Wt)||i.call(this),this.Wt=this.ne.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.Dr(t,e)),this.Pr(z,()=>{this.overrideSampling()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(z)}),this.Pr(W,()=>{this.overrideLinkedFlag()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(W)}),this.Pr(G,()=>{this.overrideTrigger("event")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(G)}),this.Pr(V,()=>{this.overrideTrigger("url")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(V)}),this.ne.makeSamplingDecisions(this.sessionId),this.qr(),this.we||(Ln(l,"beforeunload",this.Je),Ln(l,"pagehide",this.rr),Ln(l,"offline",this.ir),Ln(l,"online",this.nr),Ln(d,"visibilitychange",this.ar),!this.Fe&&Te(this.Yt.onSessionId)&&(this.Fe=this.Yt.onSessionId(this.Be)),!this.qe&&Te(this.Yt.on)?this.qe=this.Yt.on("forcedIdleReset",()=>{this.ze(),this.ce="unknown",this.stop(),this.je=this.Yt.onSessionId((t,e,i)=>{var r;null==(r=this.je)||r.call(this),this.je=void 0,this.Be(t,e,i)})}):Te(this.Yt.on)||zl.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Oe(this.Ne)&&(this.Ne=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.mr(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){zl.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.jt(t||"recording_initialized"))}else zl.info("remote config must be stored in persistence before recording can start")}jr(){var t,e,i,r,n,s;null==l||l.removeEventListener("beforeunload",this.Je),null==l||l.removeEventListener("pagehide",this.rr),null==l||l.removeEventListener("offline",this.ir),null==l||l.removeEventListener("online",this.nr),null==d||d.removeEventListener("visibilitychange",this.ar),clearInterval(this.Ar),this.Br(),null==(t=this.Ne)||t.call(this),this.Ne=void 0,null==(e=this.Wt)||e.call(this),this.Wt=void 0,null==(i=this.Fe)||i.call(this),this.Fe=void 0,null==(r=this.qe)||r.call(this),this.qe=void 0,null==(n=this.je)||n.call(this),this.je=void 0,null==(s=this.ne)||s.stop(),this.Hr(),this.Nr()}Nr(){this.De+=1,this.Oe=[],this.Le=0,this.$r=void 0,this.Pe=!1}Hr(){var t,e;null==(t=this.zr)||t.stop(),this.he=[],null==(e=this.Sr)||e.stop(),this.Sr=void 0,this.se=!1;try{var i;null==(i=this.ae)||i.call(this)}catch(t){zl.warn("could not stop rrweb",t)}this.ae=void 0}Ur(){if(!this.$r||0===this.Le)return!1;if(this.Pe)return!0;this.Pe=!0,this.Wr=void 0;var t=this.De;return this.Br(),this.Hr(),this.$r.catch(()=>{}).then(()=>{t===this.De&&(this.Pe=!1,this.tr(),this.er(),this.Vr(),this.jr(),zl.info("stopped"))}).catch(()=>{this.Pe=!1,this.Vr(),this.jr(),zl.info("stopped")}),!0}stop(){if(this.Hr(),this.We)this.Ye();else if(this.Ur())return;this.tr(),this.er(),this.Vr(),this.jr(),zl.info("stopped")}Vr(){this.Xe(void 0,{preserveLogDedup:this.We}),this.me=!1}flushBeforeIdentityReset(){(this.isStarted||this.Pe)&&(this.Ye(),this.tr())}Ue(t){this.We=!0,this.ue=Date.now();try{var e;this.stop(),this.Zr=void 0,this.Gr=void 0,this.ve=0,this.fe=0,this.pe=0,null==(e=Gl())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.We=!1}this.Xe(t?"no_interaction_since_session_rotated":void 0),this.me=!1}Xe(t,e){var i=(void 0===e?{}:e).preserveLogDedup,r=void 0!==i&&i;if(this.ge=!Ie(t),this.Wr=t,Ie(t))r||(this.Qr=void 0);else if(!this.We){var n=this.sessionId+":"+t;n!==this.Qr&&(this.Qr=n,zl.info("holding buffer: "+t+". nothing is uploaded until the user interacts with the page"))}}Er(){this.isStarted||(this.be=!0),this.ge&&(this.Xe(void 0),this.me=!1,this.ye&&(this.ye=!1,this.Bt()),this.Jr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents,i=void 0!==e&&e;this.ge=!0,i&&(this.er(),this.Hr()),this.er(),this.jr(),this.er(),this.Vr(),zl.info("discarded")}Kr(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};"disabled"!==this.status?(this.Xr(t,r),this.Yr(s)):this.er()}ti(){try{this.ei()}catch(t){this.Se||(this.Se=!0,zl.error("could not track full snapshot cost",t))}}ei(){var t,e=null==(t=Gl())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Gr&&(this.Gr=e,this.Zr&&this.Zr.durationMs>=e.durationMs||(this.Zr=e),500>e.durationMs||zl.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}))}Xr(t,e){2!==t.type?3===t.type&&(Ie(this.Re)||this.Re===e||this.Ae===e||(this.Ae=e,zl.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Bt())):this.Re=e}ri(t){t.counted&&t.generation===this.De&&(this.Le=Math.max(0,this.Le-1)),t.counted=!1,this.Oe=this.Oe.filter(e=>e!==t)}ii(t,e,i){t.processed||t.generation!==this.De||(t.processed=!0,this.Kr(t.event,e,i,t.targetSessionId,t.targetWindowId))}ni(t){try{var e=t.event,i=yo(t.event);if(t.compressionEnabled)try{var r=lu(t.event);e=r.event,i=r.size}catch(t){zl.error("could not process queued compression event - will use uncompressed event",t)}try{this.ii(t,e,i)}catch(t){zl.error("could not capture queued compression event",t)}}finally{this.ri(t)}}Ye(){[...this.Oe].forEach(t=>{this.ni(t)})}oi(t,e,i,r){var n=this,s={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:r,generation:this.De,processed:!1,counted:!0};this.Oe.push(s),this.Le+=1;var o=function(){var i=a(function*(){try{if(s.processed)return;var i,r;try{var o=e?nu(t)?yield function(t){return uu.apply(this,arguments)}(t):lu(t):{event:t,size:yo(t)};i=o.event,r=o.size}catch(e){zl.error("could not process queued compression event - will use uncompressed event",e),i=t,r=yo(t)}n.ii(s,i,r)}finally{n.ri(s)}});return function(){return i.apply(this,arguments)}}();this.$r=this.$r?this.$r.catch(()=>{}).then(o):o()}onRRwebEmit(t){var e,i,r,n,s,o,a,l,u;if(this._instance.sessionManager&&(this.Tr(),t&&Ee(t))){if(4===t.type){var h=this.mr(t.data.href);if(this.Mr=h,!h)return;t.data.href=h}else this.Cr();if(null==(e=this.ne)||e.checkUrlTriggers(this.sessionId,()=>this.Or(),()=>this.Lr(),(t,e)=>this.Dr(t,e)),!this.Y.urlBlocked||function(t){return 5===t.type&&"recording paused"===t.data.tag}(t)){var d,v,c;2===t.type&&(null!=(d=Gl())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this._e=!0),this.ti(),Promise.resolve().then(()=>this.ti()),this.Rr(),null==(v=this.zr)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[it]:t.timestamp},void 0));var f=2===t.type&&(null==(i=this.ne)?void 0:i.hasPendingTriggers(this.sessionId));f&&this.ai();var p=this.zr?this.zr.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&Ee(e)&&6===e.type&&Ee(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),m=function(t){return vu(t)?t.data.payload:null}(g),y=function(t){return cu(t)?t.data.payload:null}(g),_=function(t){return du(t)?t.data.payload:null}(g);m||y?null!=m&&m.lastActivityTimestamp&&(g.timestamp=m.lastActivityTimestamp):null!=_&&_.sessionId||this.si(g),2===t.type&&(this.Ie.push([this.Xt,t.timestamp]),this.Ie.length>6&&(this.Ie=this.Ie.slice(-6)));var b=null!==(r=null!==(n=null!==(s=null==m?void 0:m.currentSessionId)&&void 0!==s?s:null==y?void 0:y.nextSessionId)&&void 0!==n?n:null==_?void 0:_.sessionId)&&void 0!==r?r:this.Xt,w=null!==(o=null!==(a=null!==(l=null==m?void 0:m.currentWindowId)&&void 0!==l?l:null==y?void 0:y.nextWindowId)&&void 0!==a?a:null==_?void 0:_.windowId)&&void 0!==o?o:this.He;if(!0!==this.ce||function(t){return du(t)||vu(t)||cu(t)}(g)){2===g.type&&(this.de=0),_&&(g.timestamp=_.lastActivityTimestamp+_.threshold);var k=this.se;this.se=!0,f?this._r(!0):k||this._r();var S=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.Le>0||S&&nu(g))this.oi(g,S,b,w);else{var x=S?lu(g):{event:g,size:yo(g)};this.Kr(g,x.event,x.size,b,w)}}else(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source})(g)&&this.de++}else!0===this.ce&&this.de++}}}get status(){return this.ne?this.ne.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ee,rrwebError:this.we,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.re}):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.et.linkedFlagSeen=!0,this.Bt(),this.Er(),this.jt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Q]:this.sessionId,[H]:null}),this.Bt(),this.Er(),this.jt("sampling_overridden")}overrideTrigger(t){this.Dr(t),this.Er()}ui(){try{var t,e=null==l||null==(t=l.location)?void 0:t.href;if(!e)return;var i=this.mr(e);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}Br(){this.li&&(clearTimeout(this.li),this.li=void 0)}Jr(){this.li||(this.li=setTimeout(()=>{this.tr()},2e3))}hi(){return this.Re!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!vu(t)&&!cu(t))}ci(){var t,e;return null!==(t=null==(e=this.ne)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}di(t){if("buffering"!==t)return Ie(this.fi)||this._instance.register_for_session({[Gt]:[]}),void(this.fi=void 0);var e=this.ci();if(0===e.length)return Ie(this.fi)||this._instance.register_for_session({[Gt]:[]}),void(this.fi=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.fi&&(this.fi=r,this._instance.register_for_session({[Gt]:e}),zl.info("buffering: "+i))}pi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null==(t=this._instance.persistence)?void 0:t.gi)&&Ra.Et()}mi(){0!==this.Rt.data.length&&this.Rt.size!==this.yi&&943718.4>=this.Rt.size&&this.pi()&&(this.yi=this.Rt.size,Ra.Ot(this.sr,this.Rt))}Fr(){if(!this.Ee&&this.pi()){this.Ee=!0;var t=Ra.Nt(this.sr);Ra.Dt(this.sr),Ee(t)&&Ce(t.data)&&0!==t.data.length&&Ce(t.sizes)&&t.sizes.length===t.data.length&&Fe(t.size)&&t.sessionId===this.Xt&&t.windowId===this.He&&(this.Rt.data.length>0||(this.Rt=t))}}tr(t){var e;if(void 0===t&&(t=!1),this.Br(),this.ge)return this.Rt;if(this.hi())return this.Rt.size>943718.4?this.er():(t&&this.mi(),this.Rt);var i=this.Rt;null==(e=this.ne)||e.ensureSamplingDecision(this.sessionId);var r=this.Ge(),n=this.status;if(this.di(n),"buffering"===n||"paused"===n||"disabled"===n||r)return!t||"active"!==n&&"sampled"!==n||this.mi(),this.Jr(),this.Rt;if(this.Rt!==i)return this.Rt;if(i.data.length>0){var s,o=this.ui();bo(i).forEach(t=>{try{var e;null==(e=this.$e)||e.trackSize(t.sessionId,t.size),this.bi({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:Aa.LIB_NAME,$lib_version:Aa.LIB_VERSION,$snapshot_host:o})}catch(t){zl.warn("could not capture snapshot chunk - skipping it",t)}}),Ie(this.yi)||(Ra.Dt(this.sr),this.yi=void 0),null==(s=this.ne)||s.onFlushComplete()}return this.er()}Yr(t){var e,i=2+((null==(e=this.Rt)?void 0:e.data.length)||0),r=t.$session_id,n=this.Rt.sessionId!==r;if(n||!0!==this.ce&&!this.ge&&this.Rt.size+t.$snapshot_bytes+i>943718.4){var s=this.Xt;if(this.Rt=this.tr(),this.Xt!==s)return;n&&this.Rt.data.length>0&&(this.Rt=this.er()),this.Rt.sessionId=r,this.Rt.windowId=t.$window_id}this.ge&&(this.ye||this.Rt.size+t.$snapshot_bytes+i>943718.4)?this.ye||(this.ye=!0,this.Rt=this.er()):(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.ce||this.ge||this.Jr())}bi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.oe),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Qe(){var t,e,i=null==(t=this.Rt)?void 0:t.data[(null==(e=this.Rt)?void 0:e.data.length)-1];return i?i.timestamp-this._sessionStartTimestamp:null}ai(){if(!this.Rt||0===this.Rt.data.length)return this.er();for(var t=-1,e=this.Rt.data.length-1;e>=0;e--)if(4===this.Rt.data[e].type){t=e;break}return 0>t?this.er():(this.Rt.data=this.Rt.data.slice(t),this.Rt.sizes=this.Rt.sizes.slice(t),this.Rt.size=this.Rt.sizes.reduce((t,e)=>t+e,0),this.Rt)}er(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.He},this.Rt}jt(t,e){this._instance.register_for_session({[Xt]:t}),zl.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",s({reason:t},e))}wi(t){var e;return 3===t.type&&-1!==Wl.indexOf(null==(e=t.data)?void 0:e.source)}si(t){var e=this.wi(t);e||!0===this.ce||t.timestamp-this.ue>this.te&&(this.ce=!0,clearInterval(this.Ar),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.ue,threshold:this.te,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.He}),this.tr());var i=this.Yt.checkAndGetSessionAndWindowId(!e,t.timestamp),r=i.windowId,n=i.sessionId,s=!1;if(e&&(this.ue=t.timestamp,this.ce)){var o="unknown"===this.ce;this.ce=!1,o||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),s=!0)}var a=this.Xt!==n,l=this.He!==r;if(this.He=r,this.Xt=n,a||l){var u=a&&!1!==this.ce;u&&(this.ce="unknown"),this.Ue(u)}else if(e&&this.Er(),s){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.ne)?void 0:h.hasPendingTriggers(this.sessionId));this.de>0&&d&&this.Bt(),this._r(),this.Rr()}}ze(){var t;null==(t=this.ne)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,o,a,l,u=null==(t=Gl())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Wr,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_current_session_duration:this.Qe,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null==(e=this.$e)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Ie,$snapshot_max_depth_exceeded:this._e,$sdk_debug_replay_slowest_full_snapshot_ms:jl(null==(i=this.Zr)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:jl(null==(r=this.Zr)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Zr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Zr)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(o=this.Zr)?void 0:o.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==u?void 0:u.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==u?void 0:u.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==u?void 0:u.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:jl(null==u?void 0:u.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:jl(null==u?void 0:u.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:jl(null==(a=Gl())||null==a.getMutationCost||null==(a=a.getMutationCost())?void 0:a.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=Gl())||null==l.getDiscardedDurationSamples?void 0:l.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.ve,$sdk_debug_replay_oversized_mutations_dropped:this.fe,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.pe,$sdk_debug_replay_rrweb_error:this.we,[Kt]:!!this.ae,[Yt]:this.ke}}qr(){var t;if(!this.ae){this.ke=!0;var e,i,r,n,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},a=this._instance.config.session_recording;for(var u of Object.entries(a||{})){var h=u[0],v=u[1];if(h in o)if("maskInputOptions"===h)o.maskInputOptions=s({password:!0},v);else if("sampling"===h){var c=null!=v?v:{},f={};Ie(c.mousemove)||(f.mousemove=c.mousemove),Ie(c.mouseInteraction)||(f.mouseInteraction=c.mouseInteraction),o.sampling=f}else o[h]=v}!0===(null==a?void 0:a.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=s({},o.slimDOMOptions,{script:!0})),this.cr&&this.cr.enabled&&(o.recordCanvas=!0,o.sampling=s({},o.sampling,{canvas:this.cr.fps}),o.dataURLOptions={type:"image/webp",quality:this.cr.quality},o.canvasResolutionScale=this.hr,o.canvasMasking={configured:()=>{var t;return Te(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(Te(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.Me||(this.Me=!0,zl.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.ur&&(o.maskAllInputs=null===(e=this.ur.maskAllInputs)||void 0===e||e,o.maskTextSelector=null!==(i=this.ur.maskTextSelector)&&void 0!==i?i:void 0,o.blockSelector=null!==(r=this.ur.blockSelector)&&void 0!==r?r:void 0,o.maskAllElementAttributes=null!==(n=this.ur.maskAllElementAttributes)&&void 0!==n&&n),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.Ce||(this.Ce=!0,zl.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.lr();var p=Zl();if(p){this.zr=null!==(t=this.zr)&&void 0!==t?t:new ia(p,{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";zl.info(i,{node:e}),this.log("[SessionRecording] "+i,"warn")},onDroppedAttributeMutations:t=>this.ve+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.Ir,onDroppedOversizedMutation:t=>{0===this.fe&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.fe+=1,this.pe+=t},requestFullSnapshot:()=>this.Bt()});var g=this.pr();if(this.ae=p(s({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.Te||(this.Te=!0,zl.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.ae)return this.we=!0,void zl.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.we=!1,!0===(null==a?void 0:a.captureJsonLd)&&d&&null!=l&&l.MutationObserver&&!this.Sr&&(this.Sr=function(t,e,i){var r=new WeakMap,n=i.getCaptureState||(()=>!0),s=ml,o=function(t,e){var i=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||null!=i&&i.length&&!i.includes("id")?bl:i=>{var r=t.getElementById(i);return!!r&&"SCRIPT"!==r.nodeName&&(!e.isRecordedElement||e.isRecordedElement(r))&&!Nl(r,e.blockClass,e.blockSelector)}}(t,i),a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){return Nl(t,e.blockClass,e.blockSelector)||Nl(t,e.maskTextClass,e.maskTextSelector)}(e,i))return;var l=function(t,e){if(void 0===e&&(e=bl),!t||t.length>ml)return null;try{var i=JSON.parse(t),r={remainingNodes:2048,exceeded:!1},n=Ce(i)?i.map(t=>$l(t,e,r)):$l(i,e,r);if(r.exceeded||Pe(n)||Ce(n)&&(!n.length||n.some(Pe)))return null;var s=JSON.stringify(n);return s.length>2e4?null:[n,s]}catch(t){return null}}(e.text,o);if(!l)return void r.delete(e);var u=l[0],h=l[1];if(Pe(a))return void r.set(e,h);if(r.get(e)!==h){if(h.length>s)return void(s=0);i.emit(u)&&(r.set(e,h),s-=h.length)}}catch(t){return}};try{var l=new e(t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of ql(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 l.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&ql(t.documentElement).forEach(t=>{e&&r.delete(t),a(t)})},stop(){return l.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(d,l.MutationObserver,{attributeFilter:o.attributeFilter,blockClass:o.blockClass,blockSelector:o.blockSelector,isRecordedElement:t=>p.mirror.getId(t)>0,maskAllElementAttributes:o.maskAllElementAttributes,maskAttributeFn:o.maskAttributeFn,maskTextClass:o.maskTextClass,maskTextSelector:o.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.wr()},emit:t=>this.kr(t)}),this.Y.isCurrentUrlBlocked()&&this.Sr.scan()),this.ue=Date.now(),this.ce=De(this.ce)?this.ce:"unknown",this.tryAddCustomEvent("$remote_config_received",this.re),this.Vt("$session_options",{sessionRecordingOptions:o,activePlugins:g.map(t=>null==t?void 0:t.name)}),this.Vt("$posthog_config",{config:this._instance.config})}else zl.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Vt(t,e)}},pu=function(t){return 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}({}),gu=function(t){return 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}({}),mu=function(t){return 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}({}),yu=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),_u=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),bu=function(t){return 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}({}),wu=function(t){return 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}({});function ku(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Su={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},xu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},Cu={};function Tu(t){if(Cu[t])return Cu[t];var e=function(t){var e,i,r=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(i=e.__symbol__)||void 0===i?void 0:i.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],i=e.prototype,r=t in Su?Su[t]:void 0,n=Boolean(r&&r.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(i,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),s=t in xu?xu[t]:void 0,o=Boolean(s&&s.every(t=>{var e;return"function"==typeof i[t]&&(null===(e=i[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(n&&o)return Cu[t]=e.prototype,e.prototype;var a=document.createElement("iframe");a.style.display="none";var l=!1;try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return ku(t,"AppleWebKit")&&!ku(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),Cu[t]=h):i}catch(t){return i}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var Eu=Object.create(null);function Mu(t,e,i){var r,n=Eu[t],s=n[i];if(s)return s.call(e);var o=Tu(t),a=null===(r=Object.getOwnPropertyDescriptor(o,i))||void 0===r?void 0:r.get;return a?(n[i]=a,a.call(e)):e[i]}Eu.Node=Object.create(null),Eu.ShadowRoot=Object.create(null),Eu.MutationObserver=Object.create(null),Eu.Element=Object.create(null);var Iu,Ru={};function Au(t,e,i){var r=t+"."+String(i);if(Ru[r])return Ru[r].bind(e);var n=Tu(t)[i];return"function"!=typeof n?e[i]:(Ru[r]=n,n.bind(e))}function Pu(){return Tu("MutationObserver").constructor}function Ou(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],o=i(r);o;){if(o.next===s)return void(o.next=n.next);o=i(r=o.next)}else t[e]=n.next}}catch(t){return()=>{}}}var Fu={childNodes:t=>Mu("Node",t,"childNodes"),parentNode:t=>Mu("Node",t,"parentNode"),parentElement:t=>Mu("Node",t,"parentElement"),textContent:t=>Mu("Node",t,"textContent"),isConnected(t){if(void 0===Iu){var e,i=null===(e=Object.getOwnPropertyDescriptor(Tu("Node"),"isConnected"))||void 0===e?void 0:e.get;Iu=(null==i?void 0:i.toString().includes("[native code]"))?i:null}return null==Iu?void 0:Iu.call(t)},contains:(t,e)=>Au("Node",t,"contains")(e),getRootNode:t=>Au("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Mu("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Mu("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Au("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Au("Element",t,"querySelectorAll")(e),mutationObserver:Pu,patch:Ou};function $u(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var Du=0;function Lu(){Du+=1}function Nu(){return Du}function qu(t,e){return(e!==Du||t>6e4)&&!0}var ju=0,Bu=0,Uu=0,Hu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},zu=null,Wu=null,Vu=[],Gu=0,Zu=0,Qu={slowestBatchMs:0},Ju={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function Ku(t){(ju+=1)>1||(Hu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Vu=[],Gu=0,Wu=(t=>t&&t>0?t:null)(t),Bu=$u(),Uu=Du)}function Yu(){return 0===ju?zu||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(ju-=1)>0?Hu:(Hu.durationMs=$u()-Bu,Hu.deferredStylesheetCount=Gu,Ju.deferredCount+=Gu,Wu=null,qu(Hu.durationMs,Uu)?Hu:zu=Hu)}function Xu(t,e,i){var r=t.length;if(i>=32)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var o=s.cssRules;if(o&&o.length)r+=Xu(o,e,i+1);else if(e&&s.styleSheet){var a=s.styleSheet;if(!e.has(a)){e.add(a);var l=a.rules||a.cssRules;l&&(r+=Xu(l,e,i+1))}}}catch(t){}}return r}function th(t){if(0!==ju){var e=Xu(t,null,0);Hu.cssRuleCount+=e,Zu>0&&(Hu.nonDeferrableCssRuleCount+=e)}}function eh(t){Zu+=1;try{return t()}finally{Zu-=1}}function ih(t){ju>0&&(Hu.stylesheetMs+=t)}function rh(t){if(0===ju||null===Wu)return!1;var e=Hu.cssRuleCount-Hu.nonDeferrableCssRuleCount;return e>=Wu||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),Xu(e,i,0)}catch(t){return 0}}(t)>Wu}function nh(){Ju.failedCount+=1}function sh(t){t>0&&(Ju.abandonedCount+=t)}function oh(t){return oh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(t)}function ah(t,e,i){return(e=function(t){var e=function(t){if("object"!=oh(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=oh(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==oh(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function lh(t){return t.nodeType===t.ELEMENT_NODE}function uh(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 hh(t){return"[object ShadowRoot]"==={}.toString.call(t)}function dh(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 vh(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 ch=0;function fh(t){var e=0===ch,i=e?$u():0;ch+=1;try{var r=t.rules||t.cssRules;if(!r)return null;th(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),dh(Array.from(r,t=>ph(t,n)).join(""))}catch(t){return null}finally{ch-=1,e&&ih($u()-i)}}function ph(t,e){if(mh(t)){var i;try{i=fh(t.styleSheet)||vh(t)}catch(e){i=t.cssText}try{var r;if(i&&(null===(r=t.styleSheet)||void 0===r?void 0:r.href))return Oh(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return yh(t)&&t.selectorText.includes(":")&&(n=gh(n)),e?Oh(n,e):n}function gh(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function mh(t){return"styleSheet"in t}function yh(t){return"selectorText"in t}var _h=/^-?[A-Za-z_][\w-]*$/,bh=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function wh(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 a=e[e.length-1];return a.parts.push(t),void(a.index+=1)}if(!n.importRule)return i=!0,void(r=t);o(e[e.length-1],n.importRule,t)}function o(t,e,i){try{var r;try{r=i||vh(e)}catch(t){r=e.cssText}try{var n;r&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(r=Oh(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){s(null)}}function a(t){var i=t.rules[t.index];if("sheet"===t.kind&&mh(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 o(t,i,null)}if(!function(t,i){try{var r=function(t){var e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return"@media "+e.media.mediaText+" {";if(yh(t)){if("number"==typeof e.type&&1!==e.type)return null;var i=e.style?e.style.cssText:"";return t.selectorText+" {"+(i?" "+i:"")}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!_h.test(e.containerName)?null:"@container "+(e.containerName?e.containerName+" ":"")+e.containerQuery+" {";if("string"==typeof e.conditionText){var r="";try{var n;r=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===r||"Object"===r||"CSSSupportsRule"===r?"@supports "+e.conditionText+" {":null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?_h.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":bh.test(e.name)?"@layer "+e.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?Oh(r,n):r,fixColons:"sheet"===i.kind&&yh(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&yh(i)&&i.selectorText.includes(":")&&(s=gh(s)),t.parts.push(t.sheetHref?Oh(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;th(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,!mh(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;th(s);var o=r.href;!o&&r.ownerNode&&(o=r.ownerNode.baseURI);var a=Array.from(s);n.set(e,{sheet:r,rules:a,sheetHref:o}),i.push({sheet:r,rules:a,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=$u(),o=t>0?t:1;try{for(;!i&&o>0;){var l=e[e.length-1];if(l.rules.length>l.index){o-=1;try{a(l)}catch(t){s(null)}}else{var u=null;try{if("group"===l.kind){var h=l.prelude+l.parts.join("")+"}";u=l.fixColons?gh(h):h}else u=dh(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{ih($u()-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}}}var kh=class{constructor(){ah(this,"idNodeMap",new Map),ah(this,"nodeMetaMap",new WeakMap)}getId(t){var e,i;return t&&null!==(e=null===(i=this.getMeta(t))||void 0===i?void 0:i.id)&&void 0!==e?e:-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)),lh(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,o=t.value||"",a=n&&xh(n);return(i[r.toLowerCase()]||a&&i[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function xh(t){return t.toLowerCase()}var Ch=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 Th(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&&Ch.has(xh(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var Eh="__rrweb_original__";function Mh(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?xh(e):null}catch(t){return null}}var Ih=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Rh=/^(?:[a-z+]+:)?\/\//i,Ah=/^www\..*/i,Ph=/^(data:)([^,]*),(.*)/i;function Oh(t,e){return(t||"").replace(Ih,(t,i,r,n,s,o)=>{var a,l=r||s||o,u=i||n||"";if(!l)return t;if(Rh.test(l)||Ah.test(l))return"url("+u+l+u+")";if(Ph.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.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 Fh,$h,Dh=new Map,Lh=1,Nh=new RegExp("[^a-z0-9-_:]");function qh(){return Lh++}var jh=/^[^ \t\n\r\u000c]+/,Bh=/^[, \t\n\r\u000c]+/,Uh=new WeakMap;function Hh(t,e){return e&&""!==e.trim()?zh(t,e):e}function zh(t,e){var i=Uh.get(t);if(i||(i=t.createElement("a"),Uh.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function Wh(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function Vh(t,e,i,r,n,s){if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var o,a=null===(o=n.sheet)||void 0===o?void 0:o.href;if(a)return a}var l=Hh(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(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;var n=Dh.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 o=s.getContext("2d");if(!o)return e;o.drawImage(t,0,0);var a=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>a.length?a:e;if(Dh.size>=10){var u=Dh.keys().next().value;void 0!==u&&Dh.delete(u)}return Dh.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),Wh(u,s)}if("image"===e)return Wh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=Hh(t,r);return"image"===e&&h.startsWith("data:")?Wh(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(Bh),e.length>i;){var s=r(jh);if(","===s.slice(-1))s=Hh(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Hh(t,s);for(var a=!1;;){var l=e.charAt(i);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){i+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?Oh(r,zh(t)):"object"===e&&"data"===i?Hh(t,r):r:Hh(t,r)}function Gh(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function Zh(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&Zh(Fu.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&Zh(Fu.parentNode(t),e,i)}function Qh(t,e,i,r){var n;if(lh(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(Zh(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 Jh(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var Kh=new Map;function Yh(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function Xh(t){return null==t?"":t.toLowerCase()}var td=!1,ed=!1;function id(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=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,_=e.slimDOMOptions,b=e.dataURLOptions,w=void 0===b?{}:b,k=e.inlineImages,S=void 0!==k&&k,x=e.recordCanvas,C=void 0!==x&&x,T=e.canvasMaskingConfigured,E=e.onSerialize,M=e.onIframeLoad,I=e.iframeLoadTimeout,R=void 0===I?5e3:I,A=e.onIframeListenerRegistered,P=e.onStylesheetLoad,O=e.stylesheetLoadTimeout,F=void 0===O?5e3:O,D=e.keepIframeSrcFn,L=void 0===D?()=>!1:D,N=e.newlyAddedElement,q=void 0!==N&&N,j=e.depth,B=void 0===j?0:j,U=e.maxDepth,H=void 0===U?50:U,z=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=H)return ed=!0,td||(td=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+H+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;z||(z=Qh(t,o,a,void 0===z)),ju>0&&(Hu.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,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,_=e.keepIframeSrcFn,b=e.newlyAddedElement,w=void 0!==b&&b,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:wu.Document,childNodes:[],compatMode:t.compatMode}:{type:wu.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:wu.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return function(t,e){for(var i=e.doc,r=e.inlineStylesheet,n=e.maskInputOptions,s=void 0===n?{}:n,o=e.maskInputFn,a=e.maskAllElementAttributes,l=void 0!==a&&a,u=e.maskAttributeFn,h=e.dataURLOptions,d=void 0===h?{}:h,v=e.inlineImages,c=e.recordCanvas,f=e.canvasMaskingConfigured,p=e.keepIframeSrcFn,g=e.newlyAddedElement,m=void 0!==g&&g,y=e.rootId,_=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),b=function(t){if(t instanceof HTMLFormElement)return"form";var e=xh(t.tagName);return Nh.test(e)?"div":e}(t),w=new Set,k={},S=t.attributes.length,x=0;S>x;x++){var C=t.attributes[x];Gh(b,C.name)||(k[C.name]=Vh(i,b,xh(C.name),C.value,t,d))}if("link"===b&&r&&!_){var T=t.sheet;if(!T){var E=function(t){return t.href}(t);E&&!(T=Yh(i,E))&&E.includes(".css")&&(T=Yh(i,window.location.origin+"/"+E.replace(window.location.href,"")))}var M=null;T&&(rh(T)?ju>0&&(Vu.push(t),Gu+=1):M=fh(T)),M&&(delete k.rel,delete k.href,k._cssText=M)}if("style"===b&&t.sheet&&!(t.innerText||Fu.textContent(t)||"").trim().length){var I=eh(()=>fh(t.sheet));I&&(k._cssText=I)}if("input"===b||"textarea"===b||"select"===b){var R=t.value,A=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&R?k.value=Sh({element:t,type:Mh(t),tagName:b,value:R,maskInputOptions:s,maskInputFn:o}):A&&(k.checked=A)}if("option"===b&&(t.selected&&!s.select?k.selected=!0:delete k.selected),"dialog"===b&&t.open){try{k.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}w.add("rr_open_mode")}if("canvas"===b&&c&&!(null==f?void 0:f()))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((Eh in n?n[Eh]: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)||(k.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){var P=t.toDataURL(d.type,d.quality),O=i.createElement("canvas");O.width=t.width,O.height=t.height,P!==O.toDataURL(d.type,d.quality)&&(k.rr_dataURL=P)}var F,D,L=!1;if("img"===b&&v){Fh||(Fh=i.createElement("canvas"),$h=Fh.getContext("2d"));var N=t,q=N.currentSrc||N.getAttribute("src")||"<unknown-src>",j=N.crossOrigin,B=(e,i)=>L?Th({element:t,name:e,value:i,maskAllElementAttributes:l,maskAttributeFn:u}):i,U=()=>{Jh(N,"load",U);try{Fh.width=N.naturalWidth,Fh.height=N.naturalHeight,$h.drawImage(N,0,0);var t=Fh.toDataURL(d.type,d.quality);k.rr_dataURL=B("rr_dataURL",t)}catch(t){if("anonymous"!==N.crossOrigin)return N.crossOrigin="anonymous",void(N.complete&&0!==N.naturalWidth?U():N.addEventListener("load",U));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===N.crossOrigin&&(j?k.crossOrigin=B("crossOrigin",j):N.removeAttribute("crossorigin"))};N.complete&&0!==N.naturalWidth?U():N.addEventListener("load",U)}if("audio"===b||"video"===b){var H=k;H.rr_mediaState=t.paused?"paused":"played",w.add("rr_mediaState"),H.rr_mediaCurrentTime=t.currentTime,H.rr_mediaPlaybackRate=t.playbackRate,H.rr_mediaMuted=t.muted,H.rr_mediaLoop=t.loop,H.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),_){var z,W,V,G=t.getBoundingClientRect(),Z=G.width,Q=G.height,J=G.left,K=G.top,Y=null===(z=i.defaultView)||void 0===z?void 0:z.getComputedStyle(t);k={class:k.class,rr_width:Z+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null===(W=i.defaultView)||void 0===W?void 0:W.scrollX)||0))+"px",rr_top:Math.floor(K+((null===(V=i.defaultView)||void 0===V?void 0:V.scrollY)||0))+"px"},w.add("rr_width"),w.add("rr_height"),w.add("rr_left"),w.add("rr_top"),Y&&(k.rr_position=Y.position||"static",w.add("rr_position"),Y.transform&&"none"!==Y.transform&&(k.rr_transform=Y.transform,w.add("rr_transform")),Y.display&&Y.display.startsWith("inline")&&(k.rr_display=Y.display,w.add("rr_display")))}if("iframe"!==b||p(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src),l||u)for(var X of Object.entries(k)){var tt=X[0],et=X[1];"string"!=typeof et&&null!==et||(k[tt]=Th({element:t,name:tt,value:et,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:w.has(tt)}))}L=!0;try{customElements.get(b)&&(F=!0)}catch(t){}return{type:wu.Element,tagName:b,attributes:k,childNodes:[],isSVG:(D=t,Boolean("svg"===D.tagName||D.ownerSVGElement)||void 0),needBlock:_,rootId:y,isCustom:F}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,maskAllElementAttributes:v,maskAttributeFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:_,newlyAddedElement:w,rootId:k});case t.TEXT_NODE:return function(t,e){var i=e.needsMask,r=e.maskTextFn,n=e.rootId,s=Fu.parentNode(t),o=s&&s.tagName,a=Fu.textContent(t),l="STYLE"===o||void 0,u="SCRIPT"===o||void 0;if(l&&a){try{var h;if(t.nextSibling||t.previousSibling);else if(rh(s.sheet));else if(null===(h=s.sheet)||void 0===h?void 0:h.cssRules){var d=fh(s.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(a=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}a=Oh(a,zh(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&i&&(a=r?r(a,Fu.parentElement(t)):a.replace(/[\S]/g,"*")),{type:wu.Text,textContent:a||"",isStyle:l,rootId:n}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:wu.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:wu.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:L,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===wu.Comment)return!0;if(t.type===wu.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){var e,i;try{i=new URL(t,window.location.href)}catch(t){return null}var r=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==r?void 0:r[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Xh(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Xh(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Xh(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Xh(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Xh(t.attributes.property).match(/^(og|twitter|fb):/)||Xh(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Xh(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Xh(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(Xh(t.attributes.name))||Xh(t.attributes.property).match(/^article:/)||Xh(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(Xh(t.attributes.name)))return!0}}return!1}(Z,_)||!V&&Z.type===wu.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?-2:qh();var Q=Object.assign(Z,{id:G});if(r.add(t,Q),-2===G)return null;E&&E(t);var J=!u;if(Q.type===wu.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=Fu.shadowRoot(t);K&&hh(K)&&(Q.isShadowHost=!0)}if((Q.type===wu.Document||Q.type===wu.Element)&&J){_.headWhitespace&&Q.type===wu.Element&&"head"===Q.tagName&&(V=!1);var Y={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:F,keepIframeSrcFn:L,depth:B+1,maxDepth:H};if(Q.type===wu.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(Fu.childNodes(t))){var tt=id(X,Y);tt&&Q.childNodes.push(tt)}var et=null;if(lh(t)&&(et=Fu.shadowRoot(t)))for(var it of Array.from(Fu.childNodes(et))){var rt=id(it,Y);rt&&(hh(et)&&(rt.isShadow=!0),Q.childNodes.push(rt))}}var nt=Fu.parentNode(t);if(nt&&uh(nt)&&hh(nt)&&(Q.isShadow=!0),Q.type===wu.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 o=()=>e();if("complete"!==r){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),Jh(t,"load",h),t.addEventListener("load",o),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?Jh(t,"load",o):(a=!0,Jh(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",o),()=>{clearTimeout(c),Jh(t,"load",o)}}return t.addEventListener("load",o),()=>{Jh(t,"load",o)}}(t,()=>{var e=t.contentDocument;if(e&&M){var i=id(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:F,keepIframeSrcFn:L,depth:B+1,maxDepth:H});i&&M(t,i)}},R);null==A||A(t,st)}return Q.type===wu.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,l,u){if(!Kh.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var v=new AbortController,g=!1,b=()=>{if(!g){g=!0;try{(()=>{if(P){var e=id(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onStylesheetLoad:P,stylesheetLoadTimeout:F,keepIframeSrcFn:L,depth:B,maxDepth:H});e&&P(t,e)}})()}finally{Kh.delete(e),v.abort()}}},k=setTimeout(b,u);v.signal.addEventListener("abort",()=>clearTimeout(k),{once:!0}),e.addEventListener("load",b,{signal:v.signal,once:!0}),Kh.set(e,v)}}}(t,0,F),Q}function rd(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}var nd=class t{constructor(){ah(this,"parentElement",null),ah(this,"parentNode",null),ah(this,"ownerDocument",void 0),ah(this,"firstChild",null),ah(this,"lastChild",null),ah(this,"previousSibling",null),ah(this,"nextSibling",null),ah(this,"ELEMENT_NODE",1),ah(this,"TEXT_NODE",3),ah(this,"nodeType",void 0),ah(this,"nodeName",void 0),ah(this,"RRNodeType",void 0)}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.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 sd(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>od(i,t,e,r)}function od(t,e,i,r){ad(()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))})}function ad(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function ld(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var ud="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.",hd={map:{},getId(){return console.error(ud),-1},getNode(){return console.error(ud),null},removeNodeFromMap(){console.error(ud)},has(){return console.error(ud),!1},reset(){console.error(ud)}};function dd(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];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,o)):r||!1===i.trailing||(r=setTimeout(()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,o)},u))}}function vd(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)}}}),()=>vd(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(hd=new Proxy(hd,{get(t,e,i){return"map"===e&&console.error(ud),Reflect.get(t,e,i)}}));var cd=Date.now;function fd(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?void 0:e.scrollLeft)||(null==s||null===(i=s.body)||void 0===i?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?void 0:r.scrollTop)||(null==s||null===(n=s.body)||void 0===n?void 0:n.scrollTop)||0}}function pd(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function gd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function md(t){return t?t.nodeType===t.ELEMENT_NODE?t:Fu.parentElement(t):null}function yd(t,e,i,r){if(!t)return!1;var n=md(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(Zh(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 _d(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||-2===e.getId(t)}function bd(t,e){if(uh(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||bd(r,e))}function wd(t){return Boolean(t.changedTouches)}function kd(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Sd(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function xd(t){return!!t&&(t instanceof nd&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Fu.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(cd=()=>(new Date).getTime());var Cd=class{constructor(){ah(this,"id",1),ah(this,"styleIDMap",new WeakMap),ah(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 Td(t){var e,i=null;return"getRootNode"in t&&(null===(e=Fu.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Fu.host(Fu.getRootNode(t))&&(i=Fu.host(Fu.getRootNode(t))),i}function Ed(t){var e=t.ownerDocument;if(!e)return!1;if(Fu.contains(e,t))return!0;var i=Fu.isConnected(t);return"boolean"==typeof i?i:function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Td(i);)i=e;return i}(t);return Fu.contains(e,i)}(t)}function Md(t){return"__ln"in t}var Id,Rd=class{constructor(){ah(this,"length",0),ah(this,"head",null),ah(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--)}},Ad=(t,e)=>t+"@"+e,Pd=class{constructor(){ah(this,"frozen",!1),ah(this,"locked",!1),ah(this,"texts",[]),ah(this,"attributes",[]),ah(this,"attributeMap",new WeakMap),ah(this,"generatedAttributes",new WeakMap),ah(this,"removes",[]),ah(this,"mapRemoves",new Set),ah(this,"movedMap",{}),ah(this,"addedSet",new Set),ah(this,"movedSet",new Set),ah(this,"droppedSet",new Set),ah(this,"removesSubTreeCache",new Set),ah(this,"mutationCb",void 0),ah(this,"blockClass",void 0),ah(this,"blockSelector",void 0),ah(this,"maskTextClass",void 0),ah(this,"maskTextSelector",void 0),ah(this,"inlineStylesheet",void 0),ah(this,"maskInputOptions",void 0),ah(this,"maskTextFn",void 0),ah(this,"maskInputFn",void 0),ah(this,"maskAllElementAttributes",void 0),ah(this,"maskAttributeFn",void 0),ah(this,"keepIframeSrcFn",void 0),ah(this,"recordCanvas",void 0),ah(this,"canvasMaskingConfigured",void 0),ah(this,"inlineImages",void 0),ah(this,"slimDOMOptions",void 0),ah(this,"dataURLOptions",void 0),ah(this,"doc",void 0),ah(this,"mirror",void 0),ah(this,"iframeManager",void 0),ah(this,"stylesheetManager",void 0),ah(this,"shadowDomManager",void 0),ah(this,"canvasManager",void 0),ah(this,"processedNodeManager",void 0),ah(this,"unattachedDoc",void 0),ah(this,"canvasManagerReleased",!1),ah(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),ah(this,"emit",()=>{if(!this.frozen&&!this.locked){var t,e,i=$u(),r=Nu();try{this.processBufferedMutations()}finally{t=$u()-i,e=r,ju>0||qu(t,null!=e?e:Du)||t>Qu.slowestBatchMs&&(Qu.slowestBatchMs=t)}}}),ah(this,"processBufferedMutations",()=>{var t,e=[],i=new Set,r=new Rd,n=t=>{for(var e=t,i=-2;-2===i;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},s=s=>{var o=Fu.parentNode(s);if(o&&Ed(s)&&"TEXTAREA"!==o.tagName&&!this.isBlockedAtEmission(o)){var a=uh(o)?this.mirror.getId(Td(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);null!=t||(t={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=>{kd(t,this.mirror)&&this.iframeManager.addIframe(t),Sd(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),xd(t)&&!yd(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)}});var u=id(s,t);u&&(e.push({parentId:a,nextId:l,node:u}),i.add(u.id))}};for(var o of this.mapRemoves)this.mapRemoves.delete(o),this.mirror.removeNodeFromMap(o);for(var a of this.movedSet)Fd(this.removesSubTreeCache,a)&&!this.movedSet.has(Fu.parentNode(a))||s(a);for(var l of this.addedSet)$d(this.droppedSet,l)||Fd(this.removesSubTreeCache,l)?$d(this.movedSet,l)?s(l):this.droppedSet.add(l):s(l);for(var u=null;r.length;){var h=null;if(u){var d=this.mirror.getId(Fu.parentNode(u.value)),v=n(u.value);-1!==d&&-1!==v&&(h=u)}if(!h)for(var c=r.tail;c;){var f=c;if(c=c.previous,f){var p=this.mirror.getId(Fu.parentNode(f.value));if(-1===n(f.value))continue;if(-1!==p){h=f;break}var g=Fu.parentNode(f.value);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var m=Fu.host(g);if(-1!==this.mirror.getId(m)){h=f;break}}}}if(!h){for(;r.head;)r.removeNode(r.head.value);break}u=h.previous,r.removeNode(h.value),s(h.value)}var y={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).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=>!i.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){var i=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);e.style.length>i.length&&(i+r).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var n of Object.entries(e)){var s,o=n[0],a=n[1];"string"!=typeof a&&null!==a||(e[o]=Th({element:t.node,name:o,value:a,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(s=this.generatedAttributes.get(t.node))||void 0===s?void 0:s.has(o)}))}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!i.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:e};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={},(y.texts.length||y.attributes.length||y.removes.length||y.adds.length)&&this.mutationCb(y)}),ah(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),ah(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:Mh(t),value:i,maskInputFn:this.maskInputFn})}),ah(this,"processMutation",t=>{if(!_d(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=Fu.textContent(t.target);yd(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Qh(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,md(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var i,r=t.target,n=t.attributeName,s=null!==(i=t.attributeNamespace)&&void 0!==i?i: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}(r,n,s),a=s?r.getAttributeNS(s,n):t.target.getAttribute(n);if("value"===o){var l=r,u=Mh(l);a=Sh({element:l,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:u,value:a,maskInputFn:this.maskInputFn})}if(yd(t.target,this.blockClass,this.blockSelector,!1)||a===t.oldValue)return;var h=this.attributeMap.get(t.target),d="IFRAME"===r.tagName&&"src"===o;if(d&&!this.keepIframeSrcFn(a)&&r.contentDocument)return;if(h||(this.attributes.push(h={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,h)),"type"===o&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!Gh(r.tagName,o)){var v,c=Vh(this.doc,xh(r.tagName),xh(o),a,r,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(a)&&(o="rr_src"),h.attributes[o]=c,null===(v=this.generatedAttributes.get(t.target))||void 0===v||v.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=r.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)?h.styleDiff[g]=""===y?m:[m,y]:h._unchangedStyles[g]=[m,y]}for(var _ of Array.from(f.style))""===p.getPropertyValue(_)&&(h.styleDiff[_]=!1)}else if("open"===o&&"DIALOG"===r.tagName){h.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal";var b=this.generatedAttributes.get(t.target);b||this.generatedAttributes.set(t.target,b=new Set),b.add("rr_open_mode")}}break;case"childList":if(yd(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=uh(t.target)?this.mirror.getId(Fu.host(t.target)):this.mirror.getId(t.target);yd(t.target,this.blockClass,this.blockSelector,!1)||_d(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Od(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||bd(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Ad(i,r)]?Od(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!uh(t.target)||!hh(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.add(e))})}}),ah(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(_d(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[Ad(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!yd(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;for(var r=Fu.childNodes(t),n=0,s=r.length;s>n;n++){var o=r[n];o&&this.genAdds(o)}if(xd(t))for(var a=Fu.childNodes(Fu.shadowRoot(t)),l=0,u=a.length;u>l;l++){var h=a[l];h&&(this.processedNodeManager.add(h,this),this.genAdds(h,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(var t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t){for(var e=this.blockClass,i=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;t;){if(i&&(i.lastIndex=0),yd(t,i||e,this.blockSelector,!0))return!0;var r="getRootNode"in t?Fu.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?Fu.host(r):null}return!1}};function Od(t,e){for(var i=[e];i.length;){var r=i.pop();if(t.delete(r),r.nodeType!==r.TEXT_NODE)for(var n=Fu.childNodes(r),s=0,o=n.length;o>s;s++){var a=n[s];a&&i.push(a)}}}function Fd(t,e,i){return 0!==t.size&&function(t,e){var i=Fu.parentNode(e);return!!i&&t.has(i)}(t,e)}function $d(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 Dd=function(t,e){return void 0===e&&(e="rrweb"),Id?function(){try{return t(...arguments)}catch(t){if(Id&&!0===Id(t,e))return;throw t}}:t},Ld=[];function Nd(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 qd(t,e){var i,r=new Pd;r.init(t);try{i=new(Pu())(Dd(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),Ld.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function jd(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling,a=new Map,l=t=>{var o=Nd(t);if(o&&!yd(o,n,s,!0)){var l,u,h=r.getId(o);if(o===i&&i.defaultView){var d=fd(i.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var v=l+","+u;a.get(h)!==v&&(a.set(h,v),e({id:h,x:l,y:u}))}},u=[sd("scroll",Dd(dd(Dd(t=>l(t)),o.scroll||100)),i)];return"onscrollend"in i&&u.push(sd("scrollend",Dd(l),i)),()=>u.forEach(t=>t())}function Bd(t,e){for(var i=Ld.length-1;i>=0;i--){var r=Ld[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),Ld.splice(i,1))}}}var Ud=["INPUT","TEXTAREA","SELECT"],Hd=new WeakMap;function zd(t){return function t(e,i){if(Zd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Zd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Zd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Zd("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 Wd(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}function Vd(t,e){var i,r,n,s=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:Fu.host(e));var o="#document"===e.nodeName?null===(i=e.defaultView)||void 0===i?void 0:i.Document:null===(r=e.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.ShadowRoot,a=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&o&&a?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var t;return null===(t=a.get)||void 0===t?void 0:t.call(this)},set(t){var e;try{var i;e=null===(i=a.set)||void 0===i?void 0:i.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==n&&-1!==n)try{s.adoptStyleSheets(t,n)}catch(t){}return e}}),Dd(()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}function Gd(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,o=t.viewportResizeCb,a=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),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...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 o=[],a=Dd(()=>{try{if(r)try{r.destroy(),r.reset()}finally{var e=Ld.indexOf(r);-1!==e&&Ld.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{ld(o)}});try{if(t.recordDOM){var l=qd(t,t.doc);i=l.observer,r=l.buffer}if(o.push(function(t){var e=t.mousemoveCb,i=t.sampling,r=t.doc,n=t.mirror;if(!1===i.mousemove)return()=>{};var s,o="number"==typeof i.mousemove?i.mousemove:50,a="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=dd(Dd(t=>{var i=Date.now()-s;e(l.map(t=>(t.timeOffset-=i,t)),t),l=[],s=null}),a),h=Dd(dd(Dd(t=>{var e=Nd(t),i=wd(t)?t.changedTouches[0]:t,r=i.clientX,o=i.clientY;s||(s=cd()),l.push({x:r,y:o,id:n.getId(e),timeOffset:cd()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?gu.Drag:t instanceof MouseEvent?gu.MouseMove:gu.TouchMove)}),o,{trailing:!1})),d=[sd("mousemove",h,r),sd("touchmove",h,r),sd("drag",h,r)];return Dd(()=>{d.forEach(t=>t())})}(t)),o.push(function(t){var e=t.mouseInteractionCb,i=t.doc,r=t.mirror,n=t.blockClass,o=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(mu).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t]).forEach(t=>{var a=xh(t),l=(t=>i=>{var a=Nd(i);if(!yd(a,n,o,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=yu.Mouse;break;case"touch":l=yu.Touch;break;case"pen":l=yu.Pen}l===yu.Touch&&(mu[t]===mu.MouseDown?u="TouchStart":mu[t]===mu.MouseUp&&(u="TouchEnd"))}else wd(i)&&(l=yu.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===yu.Touch||u.startsWith("Mouse")&&l===yu.Mouse)&&(l=null)):mu[t]===mu.Click&&(l=h,h=null);var d=wd(i)?i.changedTouches[0]:i;if(d){var v=r.getId(a),c=d.clientX,f=d.clientY;Dd(e)(s({type:mu[u],id:v,x:c,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(mu[t]){case mu.MouseDown:case mu.MouseUp:a=a.replace("mouse","pointer");break;case mu.TouchStart:case mu.TouchEnd:return}u.push(sd(a,l,i))}),Dd(()=>{u.forEach(t=>t())})}(t)),o.push(jd(t)),o.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return sd("resize",Dd(dd(Dd(()=>{var t=pd(),e=gd();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)}),200)),r)}(t,{win:n})),o.push(function(t){var e=t.inputCb,i=t.doc,r=t.mirror,n=t.blockClass,o=t.blockSelector,a=t.ignoreClass,l=t.ignoreSelector,u=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function v(t){var e=Nd(t),r=t.isTrusted,s=i.defaultView;if(!e||!s||e instanceof s.HTMLElement){var v=e&&e.tagName;if(e&&"OPTION"===v&&(e=Fu.parentElement(e)),e&&v&&Ud.indexOf(v)>=0&&!yd(e,n,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=Mh(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[v.toLowerCase()]||u[g])&&(f=Sh({element:e,maskInputOptions:u,tagName:v,type:g,value:f,maskInputFn:h})),c(e,d?{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;c(t,d?{text:i,isChecked:!p,userTriggered:!1}:{text:i,isChecked:!p})}})}}}function c(t,i){var n=Hd.get(t);if(!n||n.text!==i.text||n.isChecked!==i.isChecked){Hd.set(t,i);var o=r.getId(t);Dd(e)(s({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map(t=>sd(t,Dd(v),i)),p=i.defaultView;if(!p)return()=>{f.forEach(t=>t())};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map(t=>vd(t[0],t[1],{set(){Dd(v)({target:this,isTrusted:!1})}},!1,p))),Dd(()=>{ld(f)})}(t)),o.push(function(t){var e=t.mediaInteractionCb,i=t.blockClass,r=t.blockSelector,n=t.mirror,s=t.sampling,o=t.doc,a=Dd(t=>dd(Dd(s=>{var o=Nd(s);if(o&&!yd(o,i,r,!0)){var a=o.currentTime,l=o.volume,u=o.muted,h=o.playbackRate,d=o.loop;e({type:t,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:d})}}),s.media||500)),l=[sd("play",a(bu.Play),o),sd("pause",a(bu.Pause),o),sd("seeked",a(bu.Seeked),o),sd("volumechange",a(bu.VolumeChange),o),sd("ratechange",a(bu.RateChange),o)];return Dd(()=>{l.forEach(t=>t())})}(t)),t.recordDOM){var u=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?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(o,a,l){if(!r)return()=>{};var u=e.get(o);u||e.set(o,u=[]);var h={emit:a,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(o))};try{d=t.setTimeout(f,5e3),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(o)))}},reset(){r=!1,i.forEach(e=>t.clearTimeout(e)),i.clear(),e.clear()}}}(n);o.push(u.reset),o.push(function(t,e){var i=t.styleSheetRuleCb,r=t.mirror,n=t.stylesheetManager,s=e.win,o=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var a=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Dd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Wd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,adds:[{rule:a,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:Dd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Wd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,removes:[{index:a}]})),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:Dd((t,e,s)=>{var a=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=Wd(e,r,n.styleMirror),d=h.id,v=h.styleId;if(!(d&&-1!==d||v&&-1!==v))return l;var c=o.queuePendingMutation(e,()=>i({id:d,styleId:v,replace:a}),()=>{var t=fh(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:Dd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Wd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,replaceSync:a})),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:Dd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Wd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...zd(e),l];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,adds:[{rule:a,index:v}]}))}return l},"host")}),s.prototype.deleteRule=new Proxy(v[e].deleteRule,{apply:Dd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Wd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...zd(e),a];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,removes:[{index:v}]}))}return l},"host")})}),Dd(()=>{s.CSSStyleSheet.prototype.insertRule=a,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:u})),o.push(Vd(t,t.doc)),o.push(function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,o=e.win,a=e.mutationQueue,l=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(l,{apply:Dd((t,e,o)=>{var l,u=o[0],h=o[1],d=o[2],v=t.apply(e,o);if(n.has(u))return v;var c=null===(l=e.parentRule)||void 0===l?void 0:l.parentStyleSheet;s.onCssomSheetMutation(c);var f=Wd(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=zd(e.parentRule);a.queueMutation(c,()=>i({id:p,styleId:g,set:{property:u,value:h,priority:d},index:m}))}return v},"host")});var u=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Dd((t,e,o)=>{var l,u=o[0],h=t.apply(e,o);if(n.has(u))return h;var d=null===(l=e.parentRule)||void 0===l?void 0:l.parentStyleSheet;s.onCssomSheetMutation(d);var v=Wd(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=zd(e.parentRule);a.queueMutation(d,()=>i({id:c,styleId:f,remove:{property:u},index:p}))}return h},"host")}),Dd(()=>{o.CSSStyleDeclaration.prototype.setProperty=l,o.CSSStyleDeclaration.prototype.removeProperty=u})}(t,{win:n,mutationQueue:u})),t.collectFonts&&o.push(function(t){var e=t.fontCb,i=t.doc,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(t,e,i){var r=new o(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 a=Ou(i.fonts,"add",function(t){return function(i){return setTimeout(Dd(()=>{var t=s.get(i);t&&(e(t),s.delete(i))}),0),t.apply(this,[i])}});return n.push(()=>{r.FontFace=o}),n.push(a),Dd(()=>{n.forEach(t=>t())})}(t))}for(var h of(o.push(function(t){var e=t.doc,i=t.mirror,r=t.blockClass,n=t.blockSelector,s=t.selectionCb,o=!0,a=Dd(()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),d=h.startContainer,v=h.startOffset,c=h.endContainer,f=h.endOffset;yd(d,r,n,!0)||yd(c,r,n,!0)||a.push({start:i.getId(d),startOffset:v,end:i.getId(c),endOffset:f})}s({ranges:a})}});return a(),sd("selectionchange",a)}(t)),o.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?Ou(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))o.push(h.observer(h.callback,n,h.options))}catch(t){try{a()}catch(t){}throw t}return a}function Zd(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)}var Jd=class{constructor(t){ah(this,"generateIdFn",void 0),ah(this,"iframeRemoteIdToLocalIdMap",new WeakMap),ah(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),o=n.get(e);return void 0===o&&(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}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}},Kd=class{constructor(t){ah(this,"iframes",new WeakMap),ah(this,"crossOriginIframeMap",new WeakMap),ah(this,"crossOriginIframeMirror",new Jd(qh)),ah(this,"crossOriginIframeStyleMirror",void 0),ah(this,"crossOriginIframeRootIdMap",new WeakMap),ah(this,"mirror",void 0),ah(this,"mutationCb",void 0),ah(this,"wrappedEmit",void 0),ah(this,"loadListener",void 0),ah(this,"pageHideListener",void 0),ah(this,"stylesheetManager",void 0),ah(this,"recordCrossOriginIframes",void 0),ah(this,"messageHandler",void 0),ah(this,"nestedIframeListeners",new Map),ah(this,"attachedWindows",new WeakMap),ah(this,"attachedDocuments",new WeakMap),ah(this,"attachedIframes",new Map),ah(this,"loadListenerDisposers",new WeakMap),ah(this,"iframeElementsById",new Map),ah(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?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=>ad(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach(t=>{od(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 o=this.handleMessage.bind(this);ad(()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)})}ad(()=>{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)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",n),i||this.pageHideHandlers.set(t,i=new Set),i.add({win:e,handler:n})}}),null===(i=this.loadListener)||void 0===i||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){switch(e.type){case pu.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:pu.IncrementalSnapshot,data:{source:gu.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case pu.Meta:case pu.Load:case pu.DomContentLoaded:return!1;case pu.Plugin:return e;case pu.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case pu.IncrementalSnapshot:switch(e.data.source){case gu.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 gu.Drag:case gu.TouchMove:case gu.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case gu.ViewportResize:return!1;case gu.MediaInteraction:case gu.MouseInteraction:case gu.Scroll:case gu.CanvasMutation:case gu.Input:return this.replaceIds(e.data,t,["id"]),e;case gu.StyleSheetRule:case gu.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case gu.Font:return e;case gu.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case gu.AdoptedStyleSheet:var r;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(r=e.data.styles)||void 0===r||r.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===wu.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&&(od(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(od(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=>{ad(()=>this.mirror.removeNodeFromMap(t))}),ad(()=>Bd(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&&od(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{od(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}},Yd=class{constructor(t){ah(this,"shadowDoms",new WeakSet),ah(this,"mutationCb",void 0),ah(this,"scrollCb",void 0),ah(this,"bypassOptions",void 0),ah(this,"mirror",void 0),ah(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(hh(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(i=null===(r=Fu.host(t))||void 0===r?void 0:r.ownerDocument)&&void 0!==i?i:e,o=qd(s({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:n,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var t=Ld.indexOf(l);-1!==t&&Ld.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:jd(s({},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:Vd({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:Ou(t.prototype,"attachShadow",function(t){return function(r){var n=t.call(this,r),s=Fu.shadowRoot(this);return s&&Ed(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}},Xd="skip-frame";function tv(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 ev="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",iv="undefined"==typeof Uint8Array?[]:new Uint8Array(256),rv=0;64>rv;rv++)iv[ev.charCodeAt(rv)]=rv;var nv=function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=ev[i[e]>>2],n+=ev[(3&i[e])<<4|i[e+1]>>4],n+=ev[(15&i[e+1])<<2|i[e+2]>>6],n+=ev[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},sv=new Map,ov=(t,e,i)=>{if(t&&(uv(t,e)||"object"==typeof t)){var r=function(t,e){var i=sv.get(t);return i||sv.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 av(t,e,i,r){return t instanceof Array?t.map(t=>av(t,e,i,r)):null===t?t: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?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:nv(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[av(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:[av(t.data,e,i,r),t.width,t.height]}:uv(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ov(t,e,i)}:t}var lv=(t,e,i,r)=>t.map(t=>av(t,e,i,r)),uv=(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]))},hv=["webgl","webgl2"];function dv(t){return"nodeType"in t}function vv(t,e,i,r){var n=[];try{if(r){var o=function(t,e,i){var r=t.GPUCanvasContext;if((null==r?void 0:r.prototype)&&"function"==typeof r.prototype.configure)return Ou(r.prototype,"configure",function(r){return function(n){var o=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!o||dv(o)&&yd(o,e,i,!0))return r.call(this,n);dv(o)&&!("__context"in o)&&(o.__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?s({},n,{usage:"number"==typeof n.usage?n.usage|a:a}):n)}})}(t,e,i);o&&n.push(o)}var a=Ou(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!yd(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&hv.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...a])}});n.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(t=>t())}}function cv(t,e,i,r,n,s,o){var a=[],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=Ou(t,l,function(t){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(ov(d,s,this),this.canvas&&"tagName"in this.canvas&&!yd(this.canvas,r,n,!0)){var v={type:e,property:l,args:lv(u,s,this,o)};i(this.canvas,v)}return d}});a.push(u)}catch(s){var h=vd(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!yd(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var fv='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',pv="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",fv],{type:"text/javascript;charset=utf-8"});function gv(t){var e;try{if(!(e=pv&&(self.URL||self.webkitURL).createObjectURL(pv)))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(fv),{name:null==t?void 0:t.name})}}var mv,yv,_v,bv=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||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}constructor(t){ah(this,"pendingCanvasMutations",new Map),ah(this,"rafStamps",{latestId:0,invokeId:null}),ah(this,"mirror",void 0),ah(this,"mutationCb",void 0),ah(this,"resetObservers",void 0),ah(this,"frozen",!1),ah(this,"locked",!1),ah(this,"rafIdTimestamp",null),ah(this,"rafIdFlush",null),ah(this,"refCount",0),ah(this,"torndown",!1),ah(this,"resetFrameDedup",null),ah(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,o=t.recordCanvas,a=t.dataURLOptions,l=t.resolutionScale,u=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===i&&this.initCanvasMutationObserver(r,n,s,a),o&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:a,resolutionScale:l,canvasMasking:u})}initCanvasFPSObserver(t,e,i,r,n){var s=this;if("OffscreenCanvas"in e){var o,l="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,u=vv(e,i,r,!0),h=new Map;try{o=new gv}catch(t){return}var d=!1;o.onerror=()=>{var t;d=!0,cancelAnimationFrame(v),null===(t=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var i=t.data,r=i.displayWidth,n=i.displayHeight;this.mutationCb({id:e,type:_u["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 v,c=1e3/t,f=0,p=t=>{var u,g;d||(f&&c>t-f||(f=t,(u=[],g=t=>{try{t.querySelectorAll("canvas").forEach(t=>{yd(t,i,r,!0)||u.push(t)}),t.querySelectorAll("*").forEach(t=>{t.shadowRoot&&g(t.shadowRoot)})}catch(t){}},g(e.document),u).forEach(function(){var t=a(function*(t){var e=s.mirror.getId(t);if(!h.get(e)&&0!==t.width&&0!==t.height){h.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var i,r,a=t.getContext(t.__context);if(null==a||null===(i=a.isContextLost)||void 0===i?void 0:i.call(a))return void h.set(e,!1);!1===(null==a||null===(r=a.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&a.clear(a.COLOR_BUFFER_BIT)}var u=t.clientWidth||t.width,d=t.clientHeight||t.height,v=Math.max(1,Math.round(u*l)),c=Math.max(1,Math.round(d*l)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var o;try{o=t.regionsFn(e)}catch(t){return Xd}if(void 0!==o){if(!Array.isArray(o)||!o.every(tv))return Xd;var a=i/n,l=r/s;return o.filter(t=>t.width>0&&t.height>0).map(t=>{var e=Math.floor(t.x*a),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-i}})}}}(n.canvasMasking,t,v,c,u,d);if("skip-frame"===f)return void h.set(e,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});o.postMessage({id:e,bitmap:p,width:v,height:c,displayWidth:u,displayHeight:d,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(e,!1)}}});return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(p))};v=requestAnimationFrame(p),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(v),null===(t=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=vv(t,e,i,!1),s=function(t,e,i,r,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=Ou(e.CanvasRenderingContext2D.prototype,o,function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return yd(this.canvas,i,r,!0)||setTimeout(()=>{var i=lv(l,e,this,n);t(this.canvas,{type:_u["2D"],property:o,args:i})},0),s.apply(this,l)}});s.push(a)}catch(n){var l=vd(e.CanvasRenderingContext2D.prototype,o,{set(e){yd(this.canvas,i,r,!0)||t(this.canvas,{type:_u["2D"],property:o,args:[e],setter:!0})}});s.push(l)}};for(var l of o)if(a(l))continue;return()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i,r),o=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...cv(e.WebGLRenderingContext.prototype,_u.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...cv(e.WebGL2RenderingContext.prototype,_u.WebGL2,t,i,r,e,n)),()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),o()}}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,i){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==i){var s=r.map(t=>n(t,e));this.mutationCb({id:i,type:r[0].type,commands:s}),this.pendingCanvasMutations.delete(t)}}}},wv=class{constructor(t){var e;ah(this,"trackedLinkElements",new WeakSet),ah(this,"pendingDeferredSheets",new Set),ah(this,"mutationCb",void 0),ah(this,"adoptedStyleSheetCb",void 0),ah(this,"maskAllElementAttributes",void 0),ah(this,"maskAttributeFn",void 0),ah(this,"styleMirror",new Cd),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=wh(r))}catch(t){}if(!i||!r)return nh(),null;var n=i,s=!1,o={sheet:r,invalidate(){s=!0}};this.pendingDeferredSheets.add(o);var a=!1;return{advance:i=>{if(a)return!0;var l,u,h=$u(),d=Nu(),v=!0;try{if(s)return a=!0,nh(),!0;if(!n.advance(i))return v=!1,!1;a=!0;var c=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==r?(nh(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(nh(),!0)}finally{v&&this.pendingDeferredSheets.delete(o),qu(l=$u()-h,null!=(u=d)?u:Du)||(Ju.totalMs+=l,l>Ju.slowestSliceMs&&(Ju.slowestSliceMs=l))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}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))||void 0===i||i.advance(1/0)}emitCssTextMutation(t,e,i){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:Th({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 o=$u();try{eh(()=>{try{var e=t.rules||t.cssRules;e&&th(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,(e,i)=>({rule:ph(e,t.href),index:i}))})})}finally{ih($u()-o)}}r.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),Kh.forEach(t=>t.abort()),Kh.clear()}trackStylesheetInLinkElement(t){}},kv=class{constructor(){ah(this,"nodeMap",new WeakMap),ah(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(){}},Sv=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var xv,Cv=document.createElement("iframe");document.body.appendChild(Cv),Array.from=(null===(xv=Cv.contentWindow)||void 0===xv?void 0:xv.Array.from)||Array.from,document.body.removeChild(Cv)}}catch(t){console.debug("Unable to override Array.from",t)}var Tv=new kh,Ev=new Set([gu.Mutation,gu.MediaInteraction,gu.StyleSheetRule,gu.CanvasMutation,gu.Font,gu.Log,gu.StyleDeclaration,gu.AdoptedStyleSheet]);function Mv(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?void 0:t.call(e,i)}}}var r=setTimeout(t,250);return{cancel:()=>clearTimeout(r)}}function Iv(t){var e;void 0===t&&(t={});var i=t,r=i.emit,n=i.checkoutEveryNms,o=i.checkoutEveryNth,a=i.blockClass,l=void 0===a?"rr-block":a,u=i.blockSelector,h=void 0===u?null:u,d=i.ignoreClass,v=void 0===d?"rr-ignore":d,c=i.ignoreSelector,f=void 0===c?null:c,p=i.maskTextClass,g=void 0===p?"rr-mask":p,m=i.maskTextSelector,y=void 0===m?null:m,_=i.inlineStylesheet,b=void 0===_||_,w=i.inlineStylesheetBudgetRules,k=i.maskAllInputs,S=i.maskInputOptions,x=i.slimDOMOptions,C=i.maskInputFn,T=i.maskTextFn,E=i.maskAllElementAttributes,M=void 0!==E&&E,I=i.maskAttributeFn,R=i.hooks,A=i.packFn,P=i.sampling,O=void 0===P?{}:P,F=i.dataURLOptions,D=void 0===F?{}:F,L=i.canvasResolutionScale,N=i.canvasMasking,q=i.mousemoveWait,j=i.recordDOM,B=void 0===j||j,U=i.recordCanvas,H=void 0!==U&&U,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;Id=i.errorHandler;var ot=s({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},D),at=!W||window.parent===window,lt=!1;if(!at)try{window.parent.document&&(lt=!1)}catch(t){lt=!0}if(at&&!r)throw new Error("emit function is required");if(!at&&!lt)return()=>{};void 0!==q&&void 0===O.mousemove&&(O.mousemove=q),Tv.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=rd(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 A&&!lt&&(t=A(t)),t};mv=(t,e)=>{var i,s=t;if(s.timestamp=cd(),!(null===(i=Ld[0])||void 0===i?void 0:i.isFrozen())||s.type===pu.FullSnapshot||s.type===pu.IncrementalSnapshot&&Ev.has(s.data.source)||Ld.forEach(t=>t.unfreeze()),at)null==r||r(gt(s),e);else if(lt){var a={type:"rrweb",event:gt(s),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(s.type===pu.FullSnapshot)ut=s,ft=0;else if(s.type===pu.IncrementalSnapshot){if(s.data.source===gu.Mutation&&s.data.isAttachIframe)return;ft++,(o&&ft>=o||n&&s.timestamp-ut.timestamp>n)&&yv(!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=Tv.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()}mv({type:pu.IncrementalSnapshot,data:s({source:gu.Mutation},t)})},yt=t=>mv({type:pu.IncrementalSnapshot,data:s({source:gu.Scroll},t)}),_t=t=>mv({type:pu.IncrementalSnapshot,data:s({source:gu.CanvasMutation},t)}),bt=new wv({mutationCb:mt,adoptedStyleSheetCb:t=>mv({type:pu.IncrementalSnapshot,data:s({source:gu.AdoptedStyleSheet},t)}),maskAllElementAttributes:M,maskAttributeFn:I}),wt=new Kd({mirror:Tv,mutationCb:mt,stylesheetManager:bt,recordCrossOriginIframes:W,wrappedEmit:mv});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:Tv,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new kv,xt=null==N?void 0:N.configured;_v=new bv({recordCanvas:H,mutationCb:_t,win:window,blockClass:l,blockSelector:h,mirror:Tv,sampling:O.canvas,dataURLOptions:ot,resolutionScale:L,canvasMasking:N});var Ct=new Yd({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskInputOptions:ht,dataURLOptions:ot,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:M,maskAttributeFn:I,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,sampling:O,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:bt,canvasManager:_v,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:Tv});yv=function(t){if(void 0===t&&(t=!1),B){Ku(w);try{mv({type:pu.Meta,data:{href:window.location.href,width:gd(),height:pd()}},t),null==e||e.cancel(),e=void 0,bt.reset(),Ct.init(),Ld.forEach(t=>t.lock());var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new kh:r,s=i.blockClass,o=void 0===s?"rr-block":s,a=i.blockSelector,l=void 0===a?null:a,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,_=i.canvasMaskingConfigured,b=i.maskAllInputs,w=void 0!==b&&b,k=i.maskTextFn,S=i.maskInputFn,x=i.maskAllElementAttributes,C=void 0!==x&&x,T=i.maskAttributeFn,E=i.slimDOM,M=i.dataURLOptions,I=i.preserveWhiteSpace,R=i.onSerialize,A=i.onIframeLoad,P=i.iframeLoadTimeout,O=i.onIframeListenerRegistered,F=i.onStylesheetLoad,D=i.stylesheetLoadTimeout,L=i.keepIframeSrcFn,N=void 0===L?()=>!1:L,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,U=rd(void 0!==E&&E);Ku(j);try{return id(t,{doc:t,mirror:n,blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:U,dataURLOptions:M,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:_,preserveWhiteSpace:I,onSerialize:R,onIframeLoad:A,iframeLoadTimeout:P,onIframeListenerRegistered:O,onStylesheetLoad:F,stylesheetLoadTimeout:D,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{Yu()}}(document,{mirror:Tv,blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:M,maskAttributeFn:I,slimDOM:dt,dataURLOptions:ot,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){kd(t,Tv)&&wt.addIframe(t),Sd(t,Tv)&&bt.trackLinkElement(t),xd(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){bt.attachLinkElement(t,e)},keepIframeSrcFn:it})}finally{s=Vu,Vu=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(mv({type:pu.FullSnapshot,data:{node:r,initialOffset:fd(window)}},t),Ld.forEach(t=>t.unlock()),_v.onFullSnapshot(),i.length){var n=function(t,e,i){var r=!1,n=null,s=0,o=null,a=()=>null!==o||t.length>s,l=()=>{var i=t[s];t[s]=null,s+=1,i&&ad(()=>{o=e.beginDeferredLinkInlining(i,Tv.getId(i))})},u=()=>{if(o){var t=o,e=!0;ad(()=>{e=t.advance(200)}),e&&(o=null)}},h=()=>{o||l(),u()},d=t=>{if(n=null,!r){var e=0;do{try{h()}catch(t){null==o||o.discard(),o=null,sh(1)}e+=1}while(!r&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(a()?n=Mv(d):i())}};return n=Mv(d),{cancel(){r=!0,null==o||o.discard(),o=null,null==n||n.cancel(),n=null},flush(){if(!r){r=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;a()&&50>e;){o||l();var d=o;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),o=null,h+=1;else{try{u()}catch(t){null==o||o.discard(),o=null,h+=1}e+=1}}if(a()||h>0){for(var v=h+(null!==o?1:0),c=s;t.length>c;c++)null!==t[c]&&(v+=1);sh(v),null==o||o.discard(),o=null}i()}}}}(i,bt,()=>{e===n&&(e=void 0)});e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&bt.adoptStyleSheets(document.adoptedStyleSheets,Tv.getId(document))}finally{Yu()}var s}};try{var Tt=[];for(var Et of(Tt.push(sd("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window)),["visibilitychange","freeze","resume"]))Tt.push(sd(Et,Lu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach(t=>{ad(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=Tv.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 Mt=t=>{var e;return Dd(Gd)({mutationCb:mt,mousemoveCb:(t,e)=>mv({type:pu.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>mv({type:pu.IncrementalSnapshot,data:s({source:gu.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>mv({type:pu.IncrementalSnapshot,data:s({source:gu.ViewportResize},t)}),inputCb:t=>mv({type:pu.IncrementalSnapshot,data:s({source:gu.Input},t)}),mediaInteractionCb:t=>mv({type:pu.IncrementalSnapshot,data:s({source:gu.MediaInteraction},t)}),styleSheetRuleCb:t=>mv({type:pu.IncrementalSnapshot,data:s({source:gu.StyleSheetRule},t)}),styleDeclarationCb:t=>mv({type:pu.IncrementalSnapshot,data:s({source:gu.StyleDeclaration},t)}),canvasMutationCb:_t,fontCb:t=>mv({type:pu.IncrementalSnapshot,data:s({source:gu.Font},t)}),selectionCb(t){mv({type:pu.IncrementalSnapshot,data:s({source:gu.Selection},t)})},customElementCb(t){mv({type:pu.IncrementalSnapshot,data:s({source:gu.CustomElement},t)})},blockClass:l,ignoreClass:v,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:b,sampling:O,recordDOM:B,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,userTriggeredOnInput:Q,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:M,maskAttributeFn:I,keepIframeSrcFn:it,blockSelector:h,slimDOMOptions:dt,dataURLOptions:ot,mirror:Tv,iframeManager:wt,stylesheetManager:bt,shadowDomManager:Ct,processedNodeManager:St,canvasManager:_v,ignoreCSSAttributes:nt,attributeFilter:st,plugins:(null==tt||null===(e=tt.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({observer:t.observer,options:t.options,callback:e=>mv({type:pu.Plugin,data:{plugin:t.name,payload:e}})})))||[]},R)};wt.addLoadListener(t=>{try{var e=Tv.getId(t),i=Mt(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=Tv.getId(t);null==vt||vt(e),Bd(t)});var It=-1,Rt=t=>mv({type:pu.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),At=()=>{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,o=s?Tv.getId(s):-1;o!==It&&(-1!==It&&Rt({id:It,enter:!1}),It=o,-1!==o&&Rt({id:o,enter:!0}))},Pt=()=>{yv();var t=Mt(document);"function"==typeof t&&Tt.push(t),Tt.push(sd("fullscreenchange",At)),Tt.push(sd("webkitfullscreenchange",At)),Tt.push(sd("mozfullscreenchange",At)),Tt.push(sd("MSFullscreenChange",At)),Sv=!0};return["interactive","complete"].includes(document.readyState)?Pt():(Tt.push(sd("DOMContentLoaded",()=>{mv({type:pu.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&Pt()})),Tt.push(sd("load",()=>{mv({type:pu.Load,data:{}}),"load"===G&&Pt()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,ld(Tt),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),Tv.reset(),Sv=!1,Id=void 0}}catch(t){console.warn(t)}}Iv.addCustomEvent=(t,e)=>{if(!Sv)throw new Error("please add custom event after start recording");mv({type:pu.Custom,data:{tag:t,payload:e}})},Iv.freezePage=()=>{Ld.forEach(t=>t.freeze())},Iv.takeFullSnapshot=t=>{if(!Sv)throw new Error("please take full snapshot after start recording");yv(t)},Iv.mirror=Tv,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Rv=Object.create(null);function Av(t){return Av="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Av(t)}function Pv(t,e,i){return(e=function(t){var e=function(t){if("object"!=Av(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=Av(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Av(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}Rv.Node=Object.create(null),Rv.ShadowRoot=Object.create(null),Rv.MutationObserver=Object.create(null),Rv.Element=Object.create(null);var Ov=class{constructor(t){Pv(this,"fileName",void 0),Pv(this,"functionName",void 0),Pv(this,"lineNumber",void 0),Pv(this,"columnNumber",void 0),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}},Fv=/(^|@)\S+:\d+/,$v=/^\s*at .*(\S+:\d+|\(native\))/m,Dv=/^(eval@)?(\[native code])?$/,Lv={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());return new Ov({functionName:r.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(Dv)},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 Ov({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ov({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 o=e.exec(i[n]);o&&r.push(new Ov({fileName:o[2],lineNumber:parseFloat(o[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 o=e.exec(i[n]);o&&r.push(new Ov({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(Fv)&&!t.match(/^Error created at/)},this).map(function(t){var e=t.split("@"),i=this.extractLocation(e.pop());return new Ov({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})},this)}};function Nv(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 o=r.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===i&&n.push(o)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function qv(t){return Array.isArray(t)}function jv(t){return"object"==typeof t&&null!==t&&!qv(t)}function Bv(t,e){if(0===e)return!0;for(var i of Object.keys(t))if(jv(t[i])&&Bv(t[i],e-1))return!0;return!1}function Uv(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(jv(o=e)&&Object.keys(o).length>i.numOfKeysLimit||"function"==typeof o||jv(o)&&Bv(o,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 o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=qv(u)?Nv(u.length?u[0]:null):u}return a}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 Hv={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 zv(t,e,i){var r,n=i?Object.assign({},Hv,i):Hv,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message;t({level:"error",trace:Lv.parse(e.error).map(t=>t.toString()),payload:[Uv(i,n.stringifyOptions)]})};e.addEventListener("error",u),l.push(()=>{e.removeEventListener("error",u)});var h=e=>{var i,r;e.reason instanceof Error?r=[Uv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[Uv("Uncaught (in promise)",n.stringifyOptions),Uv(e.reason,n.stringifyOptions)]),t({level:"error",trace:Lv.parse(i).map(t=>t.toString()),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){try{if(!(s in e))return()=>{};var l=e[s],u={next:l},h=(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]||a)){a=!0;try{var h=Lv.parse(new Error).map(t=>t.toString()).splice(1),d=("assert"===i?l.slice(1):l).map(t=>Uv(t,n.stringifyOptions));o++,n.lengthThreshold>o?t({level:i,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Uv("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})(function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return u.next.apply(this,e)});return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:u}})),e[s]=h,()=>{if(e[s]!==h)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===h)return void(r.next=u.next);r=t(i=r.next)}else e[s]=u.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var Wv=t=>({name:"rrweb/console@1",observer:zv,options:t}),Vv=()=>{},Gv=t=>{var e;if(Te(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Zv(t,e,i){try{if(!(e in t))return Vv;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 Te(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=Gv(i);s;){if(s.next===n)return void(s.next=r.next);s=Gv(i=s.next)}else t[e]=r.next}}catch(t){return Vv}}function Qv(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 Jv=Tn("[Recorder]"),Kv=t=>"navigation"===t.entryType,Yv=t=>"resource"===t.entryType;function Xv(t,e){return!!e&&(De(e)||e[t])}function tc(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 ec=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function ic(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:!!tc(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(ec))return!1;if(De(i))return!0;if(Ce(i))return n(i);var s=i[e];return De(s)?s:n(s)}function rc(t,e,i,r,n,s){return nc.apply(this,arguments)}function nc(){return nc=a(function*(t,e,i,r,n,s){return void 0===s&&(s=0),s>10?(Jv.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null):function(t,e){for(var i=t.length-1;i>=0;i-=1)if(e(t[i]))return t[i]}(t.performance.getEntriesByName(i),t=>Yv(t)&&t.initiatorType===e&&(Ie(r)||t.startTime>=r)&&(Ie(n)||n>=t.startTime))||(yield new Promise(t=>setTimeout(t,50*s)),rc(t,e,i,r,n,s+1))}),nc.apply(this,arguments)}function sc(t){var e=t.body,i=t.options,r=t.url;if(Oe(e))return null;var n=Qv(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Re(e))return e;if((t=>"u">typeof Document&&t instanceof Document)(e))return e.textContent;if(Le(e))return Un(e);if(Ee(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 oc=t=>!Pe(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ac(t){var e=t.entry,i=t.method,r=t.status,n=t.networkRequest,o=t.isInitial,a=t.start,l=t.end,u=t.url,h=t.initiatorType;a=e?e.startTime:a,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),v=Math.floor(d+(a||0)),c=[s({},e?e.toJSON():{name:u},{startTime:Ie(a)?void 0:Math.round(a),endTime:Ie(l)?void 0:Math.round(l),timeOrigin:d,timestamp:v,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:r,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:o})];if(oc(e))for(var f of e.serverTiming||[])c.push({timeOrigin:d,timestamp:v,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return c}var lc=["video/","audio/"];function uc(t){return Ee(t)&&Te(t.getReader)&&Te(t.tee)}var hc="[SessionReplay] Timeout while trying to read body",dc="[SessionReplay] Failed to read body";function vc(t){return dc+": "+t}function cc(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function fc(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{var i=setTimeout(()=>e(hc),500);try{t.clone().text().then(t=>e(t),t=>e(vc(t))).finally(()=>clearTimeout(i))}catch(t){clearTimeout(i),e(dc)}})}(t);var i=Ds(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(cc(i)):function(t,e){return new Promise(i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel().catch(()=>{})}catch(t){}}function o(t){n||(n=!0,clearTimeout(l),s(),i(t))}var a,l=setTimeout(()=>o(hc),500);try{a=t.clone()}catch(t){return void o(dc)}var u=a.body;if(uc(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void o(dc)}var h=[],d=0;!function t(){r.read().then(i=>{var r=i.done,a=i.value;if(n)s();else if(r)o((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(a){if(d+a.byteLength>e)return void o(cc(e));d+=a.byteLength,h.push(a)}t()}},t=>o(vc(t)))}()}else try{a.text().then(t=>o(t),t=>o(vc(t)))}catch(t){o(dc)}})}(t,i)}function pc(){return pc=a(function*(t){var e=t.r,i=t.options,r=Qv(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):fc(e,i)}),pc.apply(this,arguments)}function gc(){return gc=a(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(),o=lc.some(t=>null==s?void 0:s.startsWith(t));if(s&&o)return"Content-Type "+s+" is not supported";var a=Qv(n,r);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return Pe(r)?fc(e,i):Promise.resolve(r)}),gc.apply(this,arguments)}var mc=null;function yc(t,e,i){if(!("performance"in e))return()=>{};if(mc)return Jv.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},Ls,i):Ls,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&&Ws.has(t))(s)),s&&i.push(s)}}),i.length>0&&t(s({},e,{requests:i}))},o=function(t,e,i){i.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>Kv(t)||Yv(t)&&i.initiatorTypes.includes(t.initiatorType)).flatMap(t=>ac({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0});var r=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>Kv(t)||Yv(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>ac({entry:t,method:void 0,status:void 0,networkRequest:{}}))})}),n=PerformanceObserver.supportedEntryTypes.filter(t=>i.performanceEntryTypeToObserve.includes(t));return r.observe({entryTypes:n}),()=>{r.disconnect()}}(n,e,r),l=()=>{},u=()=>{};return(r.recordHeaders||r.recordBody)&&(l=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=Xv("request",i.recordHeaders),n=Xv("response",i.recordHeaders),s=Zv(e.XMLHttpRequest.prototype,"open",s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(a),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=>(ic({type:"request",headers:g,url:a,recordBody:i.recordBody})&&(p.requestBody=sc({body:t,options:i,url:a})),v=e.performance.now(),y(t));var _=()=>{d.removeEventListener("readystatechange",b),d.removeEventListener("error",_),d.removeEventListener("abort",_),d.removeEventListener("timeout",_)},b=()=>{if(d.readyState===d.DONE){_(),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),ic({type:"response",headers:r,url:a,recordBody:i.recordBody})&&(p.responseBody=sc({body:d.response,options:i,url:a})),rc(e,"xmlhttprequest",f.url,v,c).then(e=>{t({requests:ac({entry:e,method:o,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})}};d.addEventListener("readystatechange",b),d.addEventListener("error",_),d.addEventListener("abort",_),d.addEventListener("timeout",_)}catch(t){Jv.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)});return()=>{s()}}(n,e,r),u=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=Xv("request",i.recordHeaders),n=Xv("response",i.recordHeaders),s=Zv(e,"fetch",s=>function(){var o=a(function*(o,a){var l,u;try{l=new Request(o,a)}catch(t){return Jv.error("Failed to instrument fetch for network capture",t),s(o,a)}var h,d,v={};try{try{var c={};l.headers.forEach((t,e)=>{c[e]=t}),r&&(v.requestHeaders=c),!uc(null==a?void 0:a.body)&&ic({type:"request",headers:c,url:o,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return pc.apply(this,arguments)}({r:l,options:i,url:o}))}catch(t){Jv.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=tc(o)?yield s(l):yield s(o,a),d=e.performance.now();try{var f={};u.headers.forEach((t,e)=>{f[e]=t}),n&&(v.responseHeaders=f),ic({type:"response",headers:f,url:o,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return gc.apply(this,arguments)}({r:u,options:i,url:o}))}catch(t){Jv.error("Failed to record fetch response for network capture",t)}return u}finally{rc(e,"fetch",l.url,h,d).then(e=>{var i;t({requests:ac({entry:e,method:l.method,status:null==(i=u)?void 0:i.status,networkRequest:v,start:h,end:d,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return o.apply(this,arguments)}}());return()=>{s()}}(n,e,r)),mc=()=>{o(),l(),u(),mc=null}}var _c,bc,wc,kc,Sc,xc,Cc,Tc,Ec,Mc,Ic,Rc,Ac,Pc,Oc,Fc=t=>({name:"rrweb/network@1",observer:yc,options:t});b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Wv,getRecordNetworkPlugin:Fc},b.__PosthogExtensions__.rrweb={record:Iv,version:"v2",wasMaxDepthReached:()=>ed,resetMaxDepthState(){ed=!1,td=!1},getLastSnapshotCost:()=>zu,getMutationCost:()=>s({},Qu),resetSnapshotCostState(){ju=0,Bu=0,Uu=0,Du=0,Hu={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},zu=null,Wu=null,Vu=[],Gu=0,Zu=0,Qu={slowestBatchMs:0},Ju={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},b.rrweb={record:Iv,version:"v2"},b.rrwebConsoleRecord={getRecordConsolePlugin:Wv},b.getRecordNetworkPlugin=Fc,b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initSessionRecording=(t,e)=>new fu(t,e);var $c,Dc,Lc,Nc,qc={},jc=[],Bc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Uc=Array.isArray;function Hc(t,e){for(var i in e)t[i]=e[i];return t}function zc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Wc(t,e,i){var r,n,s,o={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?_c.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return Vc(t,o,r,n,null)}function Vc(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?++wc:n,__i:-1,__u:0};return null==n&&null!=bc.vnode&&bc.vnode(s),s}function Gc(t){return t.children}function Zc(t,e){this.props=t,this.context=e}function Qc(t,e){if(null==e)return t.__?Qc(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?Qc(t):null}function Jc(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Hc({},e);s.__v=e.__v+1,bc.vnode&&bc.vnode(s),af(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?Qc(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,uf(r,s,n),e.__e=e.__=null,s.__e!=i&&Kc(s)}}function Kc(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}),Kc(t)}function Yc(t){(!t.__d&&(t.__d=!0)&&kc.push(t)&&!Xc.__r++||Sc!=bc.debounceRendering)&&((Sc=bc.debounceRendering)||xc)(Xc)}function Xc(){try{for(var t,e=1;kc.length;)kc.length>e&&kc.sort(Cc),t=kc.shift(),e=kc.length,Jc(t)}finally{kc.length=Xc.__r=0}}function tf(t,e,i,r,n,s,o,a,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||jc,_=e.length;for(l=function(t,e,i,r,n){var s,o,a,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=Vc(null,o,null,null,null):Uc(o)?o=t.__k[s]=Vc(Gc,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=Vc(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+v,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=rf(o,i,l,d))&&(d--,(a=i[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,o.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=i[s])&&!(2&a.__u)&&(a.__e==r&&(r=Qc(a)),vf(a,a));return r}(i,e,y,l,_),d=0;_>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||qc,c.__i=d,g=af(t,c,v,n,s,o,a,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&df(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=ef(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 ef(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=ef(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Qc(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function rf(t,e,i,r){var n,s,o,a=t.key,l=t.type,u=e[i],h=null!=u&&!(2&u.__u);if(null===u&&null==a||h&&a==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[o=0>n?s++:n--])&&!(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function nf(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||Bc.test(e)?i:i+"px"}function sf(t,e,i,r,n){var s,o;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||nf(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||nf(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Ic,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[Mc]=r[Mc]:(i[Mc]=Rc,t.addEventListener(e,s?Pc:Ac,s)):t.removeEventListener(e,s?Pc:Ac,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 of(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[Ec])e[Ec]=Rc++;else if(i[Mc]>e[Ec])return;return i(bc.event?bc.event(e):e)}}}function af(t,e,i,r,n,s,o,a,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=[a=e.__e=i.__e]),(h=bc.__b)&&h(e);t:if("function"==typeof C){d=o.length;try{if(y=e.props,_=C.prototype&&C.prototype.render,$=(h=C.contextType)&&r[h.__c],b=h?$?$.props.value:h.__:r,i.__c?m=(v=e.__c=i.__c).__=v.__E:(_?e.__c=v=new C(y,b):(e.__c=v=new Zc(y,b),v.constructor=C,v.render=cf),$&&$.sub(v),v.state||(v.state={}),v.__n=r,c=v.__d=!0,v.__h=[],v._sb=[]),_&&null==v.__s&&(v.__s=v.state),_&&null!=C.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=Hc({},v.__s)),Hc(v.__s,C.getDerivedStateFromProps(y,v.__s))),f=v.props,p=v.state,v.__v=e,c)_&&null==C.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),_&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(_&&null==C.getDerivedStateFromProps&&y!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(y,b),e.__v==i.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(y,v.__s,b)){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)}),jc.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&o.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=b,v.props=y,v.__P=t,v.__e=!1,w=bc.__r,k=0,_)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),jc.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=Hc(Hc({},r),v.getChildContext())),_&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===Gc&&null==h.key?hf(h.props.children):h,a=tf(t,Uc(S)?S:[S],e,i,r,n,s,o,a,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&o.push(v),m&&(v.__E=v.__=null)}catch(t){if(o.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),e.__e=a}else{if(null!=s)for(x=s.length;x--;)zc(s[x]);lf(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||lf(e);bc.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):a=e.__e=function(t,e,i,r,n,s,o,a,l){var u,h,d,v,c,f,p,g=i.props||qc,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),a&&(bc.__m&&bc.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&_c.call(t.childNodes),!a&&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||sf(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:a&&"function"!=typeof c||g[u]===c||sf(t,u,c,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),tf("template"==e.type?t.content:t,Uc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:i.__k&&Qc(i,0),a,l),null!=s)for(u=s.length;u--;)zc(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&sf(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&sf(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,o,l,u);return(h=bc.diffed)&&h(e),128&e.__u?void 0:a}function lf(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(lf))}function uf(t,e,i){for(var r=0;i.length>r;r++)df(i[r],i[++r],i[++r]);bc.__c&&bc.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){bc.__e(t,e.__v)}})}function hf(t){return"object"!=typeof t||null==t||t.__b>0?t:Uc(t)?t.map(hf):void 0!==t.constructor?null:Hc({},t)}function df(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){bc.__e(t,i)}}function vf(t,e,i){var r,n;if(bc.unmount&&bc.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||df(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){bc.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&vf(r[n],e,i||"function"!=typeof t.type);i||zc(t.__e),t.__c=t.__=t.__e=void 0}function cf(t,e,i){return this.constructor(t,i)}function ff(t,e,i){var r,n,s,o;e==document&&(e=document.documentElement),bc.__&&bc.__(t,e),n=(r="function"==typeof i)?null:i&&i.__k||e.__k,s=[],o=[],af(e,t=(!r&&i||e).__k=Wc(Gc,null,[t]),n||qc,qc,e.namespaceURI,!r&&i?[i]:n?null:e.firstChild?_c.call(e.childNodes):null,s,!r&&i?i:n?n.__e:e.firstChild,r,o),uf(s,t,o),t.props.children=null}_c=jc.slice,bc={__e(t,e,i,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},wc=0,Zc.prototype.setState=function(t,e){var i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Hc({},this.state);"function"==typeof t&&(t=t(Hc({},i),this.props)),t&&Hc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),Yc(this))},Zc.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Yc(this))},Zc.prototype.render=Gc,kc=[],xc="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Cc=function(t,e){return t.__v.__b-e.__v.__b},Xc.__r=0,Tc=Math.random().toString(8),Ec="__d"+Tc,Mc="__a"+Tc,Ic=/(PointerCapture)$|Capture$/i,Rc=0,Ac=of(!1),Pc=of(!0),Oc=0;var pf=0,gf=[],mf=bc,yf=mf.__b,_f=mf.__r,bf=mf.diffed,wf=mf.__c,kf=mf.unmount,Sf=mf.__;function xf(t,e){mf.__h&&mf.__h(Dc,t,pf||e),pf=0;var i=Dc.__H||(Dc.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Cf(t){return pf=1,function(t,e){var i=xf($c++,2);if(i.t=t,!i.__c&&(i.__=[Df(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Dc,!Dc.__f)){var r=function(t,e,r){if(!i.__c.__H)return!0;var s=!1,o=i.__c.props!==t;if(i.__c.__H.__.some(function(t){if(t.__N){s=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}}),n){var a=n.call(this,t,e,r);return s?a||o:a}return!s||o};Dc.__f=!0;var n=Dc.shouldComponentUpdate,s=Dc.componentWillUpdate;Dc.componentWillUpdate=function(t,e,i){if(this.__e){var o=n;n=void 0,r(t,e,i),n=o}s&&s.call(this,t,e,i)},Dc.shouldComponentUpdate=r}return i.__N||i.__}(Df,t)}function Tf(t,e){var i=xf($c++,3);!mf.__s&&$f(i.__H,e)&&(i.__=t,i.u=e,Dc.__H.__h.push(i))}function Ef(t){return pf=5,Mf(function(){return{current:t}},[])}function Mf(t,e){var i=xf($c++,7);return $f(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function If(t){var e,i=Dc.context[t.__c],r=xf($c++,9);return r.c=t,i?(null!==(e=r.__)&&void 0!==e||(r.__=!0,i.sub(Dc)),i.props.value):t.__}function Rf(){for(var t;t=gf.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Of),e.__h.some(Ff),e.__h=[]}catch(i){e.__h=[],mf.__e(i,t.__v)}}}mf.__b=function(t){Dc=null,yf&&yf(t)},mf.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Sf&&Sf(t,e)},mf.__r=function(t){_f&&_f(t),$c=0;var e=(Dc=t.__c).__H;e&&(Lc===Dc?(e.__h=[],Dc.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&Rf(),$c=0)),Lc=Dc},mf.diffed=function(t){bf&&bf(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==gf.push(e)&&Nc===mf.requestAnimationFrame||((Nc=mf.requestAnimationFrame)||Pf)(Rf)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Lc=Dc=null},mf.__c=function(t,e){e.some(function(t){try{t.__h.some(Of),t.__h=t.__h.filter(function(t){return!t.__||Ff(t)})}catch(i){e.some(function(t){t.__h&&(t.__h=[])}),e=[],mf.__e(i,t.__v)}}),wf&&wf(t,e)},mf.unmount=function(t){kf&&kf(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some(function(t){try{Of(t)}catch(t){e=t}}),i.__H=void 0,e&&mf.__e(e,i.__v))};var Af="function"==typeof requestAnimationFrame;function Pf(t){var e,i=function(){clearTimeout(r),Af&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);Af&&(e=requestAnimationFrame(i))}function Of(t){var e=Dc,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),Dc=e}function Ff(t){var e=Dc;t.__c=t.__(),Dc=e}function $f(t,e){return!t||t.length!==e.length||e.some(function(e,i){return e!==t[i]})}function Df(t,e){return"function"==typeof e?e(t):e}var Lf={GZipJS:"gzip-js",Base64:"base64"},Nf={Activation:"events",Cancellation:"cancelEvents"},qf={Button:"button",Tab:"tab",Selector:"selector"},jf={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"},Bf={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Uf={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Hf={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},zf={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Wf={Once:"once",Recurring:"recurring",Always:"always"},Vf={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Gf={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Zf={Popover:"popover",Inline:"inline"};function Qf(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Te(i.then)&&i.then(void 0,()=>{})}}}}var Jf=Tn("[Surveys]");function Kf(t){return!(!t.start_date||t.end_date)}function Yf(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Xf=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),tp=t=>Xf("seenSurvey_",t),ep=t=>{try{var e=tp(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Jf.error("Failed to persist survey seen state",t)}},ip=[Uf.Popover,Uf.Widget,Uf.API],rp={ignoreConditions:!1,ignoreDelay:!1,displayType:Zf.Popover},np="logs",sp=Tn("[Stylesheet Loader]"),op=l,ap=d,lp="#020617",up={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:jf.Right,widgetType:qf.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:lp,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},hp=[jf.Center,jf.Left,jf.Right];function dp(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 vp(t){var e;void 0===t&&(t=up.backgroundColor),"#"===t[0]&&(e=dp(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=dp(i)),!e)return lp;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),o=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?lp:"white"}return lp}var cp=(t,e,i)=>{var r=Pp(t),n=ap.querySelector("."+r);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var o=ap.createElement("div");((t,e,i)=>{var r=s({},up,i),n=t.style,o=!hp.includes(r.position)||e===Uf.Widget&&(null==i?void 0:i.widgetType)===qf.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),o?(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)||vp(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",vp(r.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||vp(r.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),n.setProperty("--ph-widget-color",r.widgetColor),n.setProperty("--ph-widget-text-color",vp(r.widgetColor)),n.setProperty("--ph-widget-z-index",r.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||r.inputBackground;a||"white"!==r.backgroundColor||(l="#f8f8f8"),n.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||vp(l);n.setProperty("--ph-survey-input-text-color",u),n.setProperty("--ph-survey-rating-text-color",u),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)})(o,t.type,t.appearance),o.className=r;var a=o.attachShadow({mode:"open"}),l=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return Te(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(sp.error("prepare_external_dependency_stylesheet returned null"),null)})(ap,':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:calc(2147480000 + 3645);--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 #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.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){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{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);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.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{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}: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{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;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}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.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;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{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{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.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{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.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}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!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(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return(i||ap.body).appendChild(o),{shadow:a,isNewlyCreated:!0}},fp=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,n=t.posthog,o=t.isSurveyCompleted,a=t.properties,l=t.surveyLanguage,u=t.questionSnapshots;n?(ep(i),n.capture(Vf.SENT,s({[Gf.SURVEY_NAME]:i.name,[Gf.SURVEY_ID]:i.id,[Gf.SURVEY_ITERATION]:i.current_iteration,[Gf.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Gf.SURVEY_SUBMISSION_ID]:r,[Gf.SURVEY_COMPLETED]:o},l&&{[Gf.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},Da(e,i,u),a,{$set:{[La(i,"responded")]:!0}})),o&&(op.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Ap(i),n.reloadFeatureFlags())):Jf.error("[survey sent] event not captured, PostHog instance not found.")},pp=(t,e,i)=>{return s({[Gf.SURVEY_NAME]:t.name,[Gf.SURVEY_ID]:t.id,[Gf.SURVEY_ITERATION]:t.current_iteration,[Gf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Gf.SURVEY_PARTIALLY_COMPLETED]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some(t=>!Oe(t)))},(null==e?void 0:e.surveyLanguage)&&{[Gf.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Gf.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},Da(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var r},gp=(t,e,i,r)=>{if(e){if(!i){var n=Ip(t),o=n?n.surveyLanguage:r;e.capture(Vf.DISMISSED,s({},pp(t,n,e),o&&{[Gf.SURVEY_LANGUAGE]:o},{$set:{[La(t,"dismissed")]:!0}})),Ap(t),ep(t),op.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Jf.error("[survey dismissed] event not captured, PostHog instance not found.")},mp=(t,e)=>{if(e){var i=(t=>Xf("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=Ip(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(Vf.ABANDONED,pp(t,r,e),{transport:"sendBeacon"})}}else Jf.error("[survey abandoned] event not captured, PostHog instance not found.")},yp=t=>t.map(t=>({sort:Math.floor(10*Math.random()),value:t})).sort((t,e)=>t.sort-e.sort).map(t=>t.value),_p=(t,e)=>t.length===e.length&&t.every((t,i)=>t===e[i])?e.reverse():e,bp=t=>{var e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},wp=(t,e)=>{var i;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?_p(t.questions,yp(t.questions)):t.questions},kp=t=>za(t)||Rp(t),Sp=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,Yc(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"+Oc++,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}),xp=()=>If(Sp),Cp=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,o,a=Hc({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?_c.call(arguments,2):i),Vc(t.type,a,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function Tp(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n,s=Qn(e);return!!s&&Ga[n=null==(r=t.conditions)?void 0:r.urlMatchType,null!=n?n:"icontains"]([t.conditions.url],[s])}var Ep=t=>Xf("inProgressSurvey_",t),Mp=(t,e)=>{try{localStorage.setItem(Ep(t),JSON.stringify(e))}catch(t){Jf.error("Error setting in-progress survey state in localStorage",t)}},Ip=t=>{try{var e=localStorage.getItem(Ep(t));if(e)return JSON.parse(e)}catch(t){Jf.error("Error getting in-progress survey state from localStorage",t)}return null},Rp=t=>{var e=Ip(t);return!Oe(null==e?void 0:e.surveySubmissionId)},Ap=t=>{try{localStorage.removeItem(Ep(t))}catch(t){Jf.error("Error clearing in-progress survey state from localStorage",t)}};function Pp(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function Op(t,e,i){if(void 0===e&&(e=jf.Right),t===Uf.ExternalSurvey)return{};switch(e){case jf.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case jf.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case jf.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case jf.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case jf.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case jf.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case jf.Left:return{left:"30px"};case jf.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Uf.Widget&&i===qf.Tab?"60px":"30px"}}}var Fp=0;function $p(t,e,i,r,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Fp,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return bc.vnode&&bc.vnode(u),u}var Dp=$p("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:$p("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"})}),Lp=$p("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:$p("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"})}),Np=$p("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:$p("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"})}),qp=$p("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:$p("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"})}),jp=$p("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:$p("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"})}),Bp=$p("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:$p("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"})}),Up=$p("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:$p("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"})}),Hp=$p("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[$p("g",{"clip-path":"url(#clip0_2415_6911)",children:[$p("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:$p("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),$p("g",{mask:"url(#mask0_2415_6911)",children:[$p("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"}),$p("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"}),$p("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"}),$p("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"}),$p("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"}),$p("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"})]})]}),$p("defs",{children:$p("clipPath",{id:"clip0_2415_6911",children:$p("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function zp(t){var e=t.urlParams,i=e?Object.entries(e).map(t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)}).join("&"):"";return $p("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Hp]})}function Wp(t){var e=t.text,i=t.submitDisabled,r=t.appearance,n=t.onSubmit,s=t.link,o=t.onPreviewSubmit,a=t.skipSubmitButton,u=t.canGoBack,h=t.onBack,d=If(Sp).isPreviewMode,v=!!u&&!!h,c=!a&&$p("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==l||l.open(s)),d?null==o||o():n()},children:e});return $p("div",{className:"bottom-section",children:[v?$p("div",{className:"form-buttons form-buttons-with-back",children:[$p("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:r.backButtonText||"Back"}),c]}):c,!r.whiteLabel&&$p(zp,{urlParams:{utm_source:"survey-footer"}})]})}function Vp(t){var e=t.question,i=t.forceDisableHtml;return $p("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[$p(e.type===Hf.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&Cp({component:Wc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function Gp(t){var e,i,r;return $p("button",{className:"form-cancel",onClick:t.onClick,disabled:If(Sp).isPreviewMode,"aria-label":"Close survey",type:"button",children:(e={fill:"black"},i=(void 0===e?{}:e).fill,r=void 0===i?"currentColor":i,$p("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[$p("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),$p("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:r})]}))})}var Zp=l;function Qp(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=If(Sp).isPopup;return Tf(()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Ln(Zp,"keydown",t),()=>{Zp.removeEventListener("keydown",t)}},[o]),$p("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&$p(Gp,{onClick:()=>o()}),$p("h3",{className:"thank-you-message-header",children:e}),i&&Cp({component:Wc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),a&&$p(Wp,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}function Jp(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onStart,a=If(Sp),l=a.onPreviewSubmit,u=a.onPopupSurveyDismissed;return $p("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&$p(Gp,{onClick:()=>u()}),e&&$p("h3",{className:"intro-screen-header",children:e}),i&&Cp({component:Wc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),$p(Wp,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:()=>l(null)})]})}var Kp=t=>Ce(t)&&t.every(t=>Re(t));function Yp(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,o=t.displayQuestionIndex,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=xp().isPreviewMode,d=Ef(null),v=Cf(()=>Re(a)?a:""),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Tf(()=>{p||setTimeout(()=>{var t;h||null==(t=d.current)||t.focus()},100)},[h,p]);var g="surveyQuestion"+o,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 o of e)switch(o.type){case ye:if(void 0!==o.value&&o.value>s.length)return null!==(r=o.errorMessage)&&void 0!==r?r:"Please enter at least "+o.value+" characters";break;case _e:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(c,e.validation,e.optional),[c,e.validation,e.optional]),y=wn(e.validation,ye),_=wn(e.validation,_e),b=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,_),[y,_]),w=()=>{m||n(c.trim())},k=()=>{m||s(c.trim())};return $p(Gc,{children:[$p("div",{className:"question-container",children:[$p(Vp,{question:e,forceDisableHtml:i,htmlFor:g}),$p("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:_,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}),b&&$p("div",{className:"validation-hint",children:b})]}),$p(Wp,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function Xp(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return $p(Gc,{children:[$p("div",{className:"question-container",children:$p(Vp,{question:e,forceDisableHtml:t.forceDisableHtml})}),$p(Wp,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function tg(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=Cf(()=>Fe(l)?l:Ce(l)&&l.length>0&&Fe(parseInt(l[0]))?parseInt(l[0]):Re(l)&&Fe(parseInt(l))?parseInt(l):null),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=xp().isPreviewMode,y=t=>m?a(t):o(t);return $p(Gc,{children:[$p("div",{className:"question-container",children:[$p(Vp,{question:i,forceDisableHtml:r}),$p("div",{className:"rating-section",children:[$p("div",{className:"rating-options",children:["emoji"===i.display&&$p("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=og[i.scale])?void 0:e.map((t,e)=>$p("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&&$p("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:ag(i.scale).map((t,e)=>$p(eg,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e))})]}),!g&&$p("div",{className:"rating-text",children:[$p("div",{children:i.lowerBoundLabel}),$p("div",{children:i.upperBoundLabel})]})]})]}),$p(Wp,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Pe(f)&&!i.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function eg(t){var e=t.num,i=t.setActiveNumber;return $p("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 ig(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,n=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=Ef(null),v=Mf(()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=_p(e,yp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e),[e]),c=Cf(()=>((t,e)=>Re(t)||Kp(t)?t:e===Hf.SingleChoice?null:[])(l,e.type)),f=c[0],p=c[1],g=Cf(()=>((t,e)=>{if(Re(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Kp(t)){var i=t.find(t=>!e.includes(t));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(l,v)),m=g[0],y=g[1],_=xp().isPreviewMode,b=e.type===Hf.SingleChoice,w=e.type===Hf.MultipleChoice,k=e.skipSubmitButton&&b&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y(t=>s({},t,{isSelected:i,inputValue:i?t.inputValue:""})),b&&p(""),void(i&&setTimeout(()=>{var t;return null==(t=d.current)?void 0:t.focus()},75))}if(b)return p(t),y(t=>s({},t,{isSelected:!1,inputValue:""})),void(k&&(o(t),_&&a(t)));w&&Ce(f)&&(f.includes(t)?p(f.filter(e=>e!==t)):p([...f,t]))},x=t=>{t.stopPropagation();var e=t.currentTarget.value;y(t=>s({},t,{inputValue:e})),b&&p(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),E()),"Escape"===t.key&&(t.preventDefault(),y(t=>s({},t,{isSelected:!1,inputValue:""})),b&&p(null))},T=()=>!(e.optional||!Pe(f)&&(!Ce(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),E=()=>{m.isSelected&&w?Ce(f)&&(_?a([...f,m.inputValue]):o([...f,m.inputValue])):_?a(f):o(f)};return $p(Gc,{children:[$p("div",{className:"question-container",children:[$p(Vp,{question:e,forceDisableHtml:i}),$p("fieldset",{className:"multiple-choice-options limit-height",children:[$p("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),v.map((t,i)=>{var n=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+r+"Choice"+i,o=s+"Open",a=n?m.isSelected:b?f===t:Ce(f)&&f.includes(t);return $p("label",{className:n?"choice-option-open":"",children:[$p("div",{className:"response-choice",children:[$p("input",{type:b?"radio":"checkbox",name:s,checked:a,onChange:()=>S(t,n),id:s,"aria-controls":o}),$p("span",{children:n?t+":":t})]}),n&&$p("input",{type:"text",ref:d,id:o,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)})]})]}),$p(Wp,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:k,canGoBack:u,onBack:h})]})}var rg=[1,2,3,4,5],ng=[1,2,3,4,5,6,7],sg=[0,1,2,3,4,5,6,7,8,9,10],og={2:[Bp,Up],3:[Np,Lp,Dp],5:[qp,Np,Lp,Dp,jp]};function ag(t){switch(t){case 5:default:return rg;case 7:return ng;case 10:return sg}}var lg=Tn("[Surveys]");function ug(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?zf.End:s;if(n.branching.type===zf.End)return zf.End;if(n.branching.type===zf.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===zf.ResponseBased){if(n.type===Hf.SingleChoice){var o,a=n.choices.indexOf(""+i);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===zf.End?zf.End:s}}else if(n.type===Hf.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===zf.End?zf.End:s}}return s}return lg.warn("Falling back to next question index due to unexpected branching type"),s}var hg=Tn("[SurveyTranslations]");function dg(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=Na(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?Na(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var o=Na(r);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Te(t.get_property)?t.get_property(ct):void 0,locale:hl()},hg)}(e);if(!i)return hg.info("No user language detected"),{survey:t,language:null};var r=Ua(t,i,hg);return{survey:r.survey,language:r.matchedKey}}var vg=l,cg=d,fg="ph:show_survey_widget",pg="PHWidgetSurveyClickListener";function gg(t,e){try{var i=t.getBoundingClientRect(),r=vg.innerHeight,n=vg.innerWidth,s=i.left+i.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=r-i.bottom,a=250>o&&i.top>o;return{position:"fixed",top:a?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:a?r-i.top+12+"px":"auto",zIndex:up.zIndex}}catch(t){return Jf.warn("Failed to calculate trigger position:",t),null}}var mg=class{constructor(t){var e=this;this.ki=new Map,this.Si=new Map,this.xi=new Map,this.Ci=new Set,this.Mi=null,this.Ti=!1,this.Ii=null,this.Ri=null,this.Ai=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(gt);if(t)for(var e of t)Rp(e)&&mp(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var n,o,a,l,u,h=(void 0===r?{}:r).resumeDelayFromActivation,d=void 0!==h&&h,v=e.Ei(t),c=v.survey,f=v.language;e.Mi=f,e.Ai=null,e.Oi=i;var p=e.Li(c,i);e.Di(p.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,_=!(!y||0>=Object.keys(y).length)&&e.Pi(p,y,m,f);if(!_||null!=(n=p.appearance)&&n.displayThankYouMessage){e.Ni(p);var b={};if((null==(o=p.appearance)?void 0:o.position)===jf.NextToTrigger&&null!=(a=p.appearance)&&a.widgetSelector){var w,k=cg.querySelector(p.appearance.widgetSelector);k&&(b=gg(k,parseInt((null==(w=p.appearance)?void 0:w.maxWidth)||up.maxWidth))||{})}var S=(null==(l=p.appearance)?void 0:l.surveyPopupDelaySeconds)||0,x=cp(p,e._posthog).shadow;e.xi.set(x,x.host);var C={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.Fi,properties:m,style:b,isSurveyCompleted:_,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:f};if(e.Ai=C,0>=S)return e.Ti=!0,ff($p(kg,s({},C)),x);var T=()=>{if(!e.qi(p))return Jf.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),e.Fi(p);(()=>{e.Ti=!0;var r=e.Ei(t),n=r.survey,o=r.language;e.Mi=o;var a=e.Li(n,i),l=s({},C,{survey:a,surveyLanguage:o});e.Ai=l,ff($p(kg,s({},l,{survey:s({},a,{appearance:s({},a.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},E=d?null==(u=e._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,M=Fe(E)?Math.max(0,Date.now()-E):0,I=Math.max(0,1e3*S-M);if(0>=I)return T();var R=vg.setTimeout(()=>{e.ki.delete(p.id),T()},I);e.ki.set(p.id,R)}},this.ji=t=>{var e=this.Ei(t),i=e.survey,r=e.language,n=cp(i,this._posthog),s=n.shadow,o=n.isNewlyCreated;this.xi.set(s,s.host),o&&ff($p(xg,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.Bi=t=>{var e=this.Si.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(pg),this.Si.delete(t),Jf.info("Removed click listener for survey "+t))},this.Hi=t=>{this.$i(t)||(this.zi(t),this.Bi(t.id))},this.$i=t=>{try{var e;return!(null==(e=cg.querySelector(Pp(t,!0)))||null==(e=e.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Ui=(t,e)=>{var i=cg.querySelector(e),r=this.Si.get(t.id);if(i){if(this.ji(t),r){if(i===r.element)return;Jf.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Bi(t.id)}if(!i.hasAttribute(pg)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===jf.NextToTrigger?gg(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||up.maxWidth)):{};vg.dispatchEvent(new CustomEvent(fg,{detail:{surveyId:t.id,position:n}}))};Ln(i,"click",n),i.setAttribute(pg,"true"),this.Si.set(t.id,{element:i,listener:n,survey:t}),Jf.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.Hi(t)},this.renderPopover=t=>{var e=this.Ei(t),i=e.survey,r=e.language,n=cp(i,this._posthog).shadow;this.xi.set(n,n.host),ff($p(kg,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.Fi,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.Ei(t),s=n.survey,o=n.language,a=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(a=this.Wi(s,o,i)),ff($p(kg,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Fi,isPopup:!1,properties:i,isSurveyCompleted:a,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||null==(r=r.surveys)||r.getSurveys(i=>{t(i.filter(t=>e.qi(t)))},i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys(t=>{var i=t.filter(t=>t.type===Uf.Popover||t.type===Uf.Widget),r=new Set(i.map(t=>t.id));for(var n of Array.from(e.ki.keys()))r.has(n)||e.cancelSurvey(n);var s=e.Vi(i),o=new Set;s.forEach(t=>{if(t.type===Uf.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===qf.Tab)return void e.ji(t);(null==(r=t.appearance)?void 0:r.widgetType)===qf.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.Ui(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Pe(e.Zi)&&t.type===Uf.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),e.Si.forEach(t=>{var i=t.survey;o.has(i.id)||e.Hi(i)})},t)},this.Ni=t=>{Pe(this.Zi)||Jf.error("Survey "+this.Zi+" already in focus. Cannot add survey "+t.id+"."),this.Zi=t.id},this.Fi=t=>{this.Zi!==t.id&&Jf.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Di(t.id),this.Zi=null,this.Mi=null,this.Ti=!1,this.Ai=null,this.Oi=void 0,this.zi(t)},this._posthog=t,this.Zi=null,this.Ii=()=>this.Gi(),Ln(vg,"languagechange",this.Ii),this.Ri=t.onFeatureFlags(()=>this.Gi())}Gi(){var t;if(!Pe(this.Zi)){var e=null==(t=this._posthog.get_property(gt))?void 0:t.find(t=>t.id===this.Zi);if(e){var i=this.Ei(e),r=i.survey,n=i.language;if(n!==this.Mi&&(this.Mi=n,this.Ti)){var o=this.Li(r,this.Oi),a=cp(o,this._posthog).shadow;ff($p(kg,s({},this.Ai,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.Fi,surveyLanguage:n})),a)}}}}get Qi(){var t,e,i;return null!==(t=null==(e=(i=this._posthog).getExtension)?void 0:e.call(i,"featureFlags"))&&void 0!==t?t:this._posthog.featureFlags}Li(t,e){return null!=e&&e.position||null!=e&&e.selector?s({},t,{appearance:s({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t}Di(t){var e=this.ki.get(t);e&&(clearTimeout(e),this.ki.delete(t))}cancelSurvey(t){this.ki.has(t)&&(Jf.info("Cancelled pending survey "+t),this.Di(t),this.Zi===t&&(this.Zi=null,this.Mi=null,this.Ti=!1,this.Ai=null,this.Oi=void 0))}setAutomaticDisplayDispose(t){this.Ji=t}dispose(){var t;null==(t=this.Ji)||t.call(this),this.Ji=void 0,this.Ii&&(vg.removeEventListener("languagechange",this.Ii),this.Ii=null),this.Ri&&(this.Ri(),this.Ri=null),this.ki.forEach((t,e)=>this.Di(e)),this.Si.forEach((t,e)=>this.Bi(e)),this.xi.forEach((t,e)=>{ff(null,e),null==t||t.remove()}),this.xi.clear(),this.Zi=null}Vi(t){return t.sort((t,e)=>{var i,r,n=Rp(t),s=Rp(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===Wf.Always,a=e.schedule===Wf.Always;return o&&!a?1:!o&&a?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)})}Ei(t){return dg(t,this._posthog)}Wi(t,e,i){if(this.Ci.has(t.id))return!1;var r=function(){var t={},e=!1,i=vg.location.search.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:e};for(var r of i.split("&")){var n=r.split("="),s=n[0],o=n[1];if(s&&!Ie(o)){var a=decodeURIComponent(s),l=decodeURIComponent(o);if("auto_submit"!==a||"true"!==l){var u=a.match(/^q(\d+)$/);if(u){var h=parseInt(u[1],10);t[h]||(t[h]=[]),t[h].push(l)}}else e=!0}}return{params:t,autoSubmit:e}}().params;if(0===Object.keys(r).length)return!1;Jf.info("[Survey Prefill] Detected URL prefill parameters");var n=this.Ki(t,r,e);return!!n&&(this.Xi(t,n,i,e),this.Ci.add(t.id),n.isSurveyCompleted)}Xi(t,e,i,r){var n=e.responses,s=e.submissionId,o=e.isSurveyCompleted,a=e.skippedResponses;(Object.keys(a).length>0&&t.enable_partial_responses||o)&&fp({responses:o?n:a,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,properties:i,surveyLanguage:r})}Pi(t,e,i,r){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=Ce(o)?o.map(String):[String(o)]}Jf.info("[Survey] Processing initial responses");var a=this.Ki(t,n,r);return!!a&&(this.Xi(t,a,i,r),a.isSurveyCompleted)}Ki(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=Fa(t.id);try{switch(t.type){case Hf.SingleChoice:if(!t.choices||0===t.choices.length)return void Cn.warn("[Survey Prefill] Question "+r+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void Cn.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[o];break;case Hf.MultipleChoice:if(!t.choices||0===t.choices.length)return void Cn.warn("[Survey Prefill] Question "+r+" has no choices");var a=n.map(t=>parseInt(t,10)).filter(e=>!isNaN(e)&&e>=0&&t.choices.length>e);if(0===a.length)return void Cn.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(a.map(e=>t.choices[e]))];a.length>l.length&&Cn.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case Hf.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void Cn.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:Cn.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Cn.error("[Survey Prefill] Error converting q"+r+":",t)}}}),i}(t,e);if(0===Object.keys(r).length)return Jf.warn("[Survey Prefill] No valid responses after conversion"),null;var n=ua(),s=function(t,e,i){for(var r=0,n={},s=[],o=t.questions.length+1,a=0;t.questions.length>r&&o>a&&(a++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=Fa(l.id);Ie(i[u])||(n[u]=i[u])}s.push(r);var h=ug(t,r,l.id?i[Fa(l.id)]:null);if(h===zf.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};r=h}return{startQuestionIndex:r,skippedResponses:n,skippedIndices:s}}(t,Object.keys(e).map(t=>parseInt(t,10)),r),o=s.startQuestionIndex,a=s.skippedResponses,l=s.skippedIndices,u=o>=t.questions.length;return Mp(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:bp(t.questions),visitedIndices:l,surveyLanguage:i}),Jf.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return Jf.error("[Survey Prefill] Error handling prefill:",t),null}}Yi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.Qi,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}tn(t){return!t.conditions||Tp(t,this._posthog)&&function(t){var e,i;return function(t,e){var i,r,n;if(!t||0===t.length)return!0;if(!m)return!1;var s=Ji(m,{userAgentDataPlatform:null==h||null==(i=h.userAgentData)?void 0:i.platform,maxTouchPoints:null==h?void 0:h.maxTouchPoints,screenWidth:null==l||null==(r=l.screen)?void 0:r.width,screenHeight:null==l||null==(n=l.screen)?void 0:n.height,devicePixelRatio:null==l?void 0:l.devicePixelRatio});return Ga[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(i=t.conditions)?void 0:i.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==ap||!ap.querySelector(t.conditions.selector))}(t)}en(t){var e;return kp(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.Qi)&&e.hasLoadedFlags?{satisfied:this.Yi(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(!Kf(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!ip.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.Yi(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.Yi(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,o=this.en(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var i="string"==typeof e?new Date(e):e,r=Math.abs((new Date).getTime()-i.getTime());return Math.ceil(r/864e5)>t}(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays,ga.Lt("lastSeenSurveyDate"))?(t=>!!ga.Lt(tp(t))&&!kp(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=o.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.rn(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}rn(t){var e;return!Ha(t)&&!Yf(t)||!(null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)||null==(e=e.getSurveys())||!e.includes(t.id))}nn(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.Yi(e)})}qi(t){return this.checkSurveyEligibility(t).eligible&&this.tn(t)&&this.rn(t)&&this.nn(t)}zi(t){try{var e=cg.querySelector(Pp(t,!0));null!=e&&e.shadowRoot&&(ff(null,e.shadowRoot),this.xi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){Jf.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Ni,removeSurveyFromFocus:this.Fi,surveyInFocus:this.Zi,surveyTimeouts:this.ki,handleWidget:this.ji,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Ui,sortSurveysByAppearanceDelay:this.Vi,checkFlags:this.nn.bind(this),isSurveyFeatureFlagEnabled:this.Yi.bind(this),onLanguageChange:this.Gi.bind(this),currentLanguage:this.Mi,surveyIsRendered:this.Ti}}};function yg(t,e){if(cg&&vg){var i,r=new mg(t);if(t.config.disable_surveys_automatic_display)return Jf.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return Jf.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Ie(i)&&(i=setInterval(()=>{r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},s=()=>{Ie(i)||(clearInterval(i),i=void 0)};n();var o=()=>{cg.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return Ln(cg,"visibilitychange",o),r.setAutomaticDisplayDispose(()=>{s(),cg.removeEventListener("visibilitychange",o)}),r}}function _g(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,o=void 0!==s&&s,a=t.posthog;Tf(()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===Uf.Widget,s=Tp(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===qf.Tab&&i;if(!s)return Jf.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);o&&(Jf.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Ln(vg,"popstate",i),Ln(vg,"hashchange",i);var s=vg.history.pushState,l=vg.history.replaceState;return vg.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()},vg.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()},()=>{vg.removeEventListener("popstate",i),vg.removeEventListener("hashchange",i),vg.history.pushState=s,vg.history.replaceState=l}}},[o,e,r,n,a])}var bg=200;function wg(t){switch(void 0===t&&(t=Bf.Right),t){case Bf.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Bf.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Bf.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function kg(t){var e,i,r,n,o,a,l,u,h,d,v,c,f=t.survey,p=t.forceDisableHtml,g=t.posthog,m=t.style,y=void 0===m?{}:m,_=t.previewPageIndex,b=t.removeSurveyFromFocus,w=void 0===b?()=>{}:b,k=t.isPopup,S=void 0===k||k,x=t.onPreviewSubmit,C=void 0===x?()=>{}:x,T=t.onPreviewBack,E=void 0===T?()=>{}:T,M=t.onPopupSurveyDismissed,I=void 0===M?()=>{}:M,R=t.onCloseConfirmationMessage,A=void 0===R?()=>{}:R,P=t.properties,O=t.isSurveyCompleted,F=t.skipShownEvent,D=t.surveyLanguage,L=Ef(null),N=Number.isInteger(_),q=function(t,e,i,r,n,o,a,l,u){var h=Cf(r||0===i||t.type===Uf.ExternalSurvey),d=h[0],v=h[1],c=Cf(!1),f=c[0],p=c[1],g=Ef(!1),m=()=>{var e=()=>{o&&n(t),v(!1)};if(!g.current){var i=null==a?void 0:a.current;i?(g.current=!0,i.style.transition="opacity "+bg+"ms ease-out",i.style.opacity="0",setTimeout(()=>{g.current=!1,e()},250)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Tf(()=>{if(e){if(!r){var n,o=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return m();p(!0),null!=(r=t.appearance)&&r.autoDisappear&&(n&&clearTimeout(n),n=setTimeout(m,5e3))}},a=()=>{if(Tp(t,e)){v(!0),vg.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(Vf.SHOWN,s({[Gf.SURVEY_NAME]:t.name,[Gf.SURVEY_ID]:t.id,[Gf.SURVEY_ITERATION]:t.current_iteration,[Gf.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},u&&{[Gf.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};Ln(vg,"PHSurveyClosed",y),Ln(vg,"PHSurveySent",o);var h=i>0?setTimeout(a,i):void 0;return Ie(h)&&a(),()=>{Ie(h)||clearTimeout(h),Ie(n)||clearTimeout(n),vg.removeEventListener("PHSurveyClosed",y),vg.removeEventListener("PHSurveySent",o)}}}else Jf.error("usePopupVisibility hook called without a PostHog instance.")},[]),_g({survey:t,removeSurveyFromFocus:n,setSurveyVisible:v,isPreviewMode:r,posthog:e}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:v,hidePopupWithAnimation:m}}(f,g,null!=(e=f.appearance)&&e.surveyPopupDelaySeconds?1e3*f.appearance.surveyPopupDelaySeconds:0,N,w,S,L,F,D),j=q.isPopupVisible,B=q.hidePopupWithAnimation,U=q.isSurveySent||_===f.questions.length||!0===O,H=Cf(!1),z=H[0],W=H[1],V=Mf(()=>!!Ip(f),[f]),G=!!(null!=(i=f.appearance)&&i.introScreenHeader||null!=(r=f.appearance)&&r.introScreenDescription),Z=N?-1===_:!(null==(n=f.appearance)||!n.displayIntroScreen)&&G&&!z&&!V,Q=Mf(()=>{var t,e=(null==(t=Ip(f))?void 0:t.surveySubmissionId)||ua();return{isPreviewMode:N,previewPageIndex:_,onPopupSurveyDismissed(){D?gp(f,g,N,D):gp(f,g,N),I()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:E,posthog:g,properties:P,surveyLanguage:D}},[N,_,S,g,f,I,C,E,P,D]);return j?$p(Sp.Provider,{value:Q,children:$p("div",{className:"ph-survey",style:s({},Op(f.type,null==(o=f.appearance)?void 0:o.position,null==(a=f.appearance)?void 0:a.widgetType),y),ref:L,children:U?$p(Qp,{header:(null==(l=f.appearance)?void 0:l.thankYouMessageHeader)||"Thank you!",description:(null==(u=f.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(h=f.appearance)?void 0:h.thankYouMessageDescriptionContentType,appearance:f.appearance||up,onClose(){B(),A()}}):Z?$p(Jp,{header:(null==(d=f.appearance)?void 0:d.introScreenHeader)||"",description:(null==(v=f.appearance)?void 0:v.introScreenDescription)||"",forceDisableHtml:!!p,contentType:null==(c=f.appearance)?void 0:c.introScreenDescriptionContentType,appearance:f.appearance||up,onStart:()=>W(!0)}):$p(Sg,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function Sg(t){var e,i,r=t.survey,n=t.forceDisableHtml,o=t.posthog,a=Mf(()=>{var t=Ip(r);if(!t)return null;var e=Fe(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(Ap(r),null)},[r]),l=Cf(()=>(null!=a&&a.responses&&Jf.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{})),u=l[0],h=l[1],d=If(Sp),v=d.previewPageIndex,c=d.onPopupSurveyDismissed,f=d.isPopup,p=d.onPreviewSubmit,g=d.onPreviewBack,m=d.surveySubmissionId,y=d.isPreviewMode,_=d.properties,b=d.surveyLanguage,w=Cf(()=>{var t=null==a?void 0:a.lastQuestionIndex,e=Fe(t)&&t>=0&&r.questions.length>t?t:0;return Fe(v)&&v>=0?v:e}),k=w[0],S=w[1],x=Cf(()=>{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],E=Cf(()=>{var t,e;return null!==(t=null==(e=Ip(r))?void 0:e.questionSnapshots)&&void 0!==t?t:{}}),M=E[0],I=E[1],R=Mf(()=>bp(wp(r,a)),[r.id,a]),A=Mf(()=>{if(!R||new Set(R).size!==R.length)return wp(r,a);var t=new Map(r.questions.map(t=>[t.id,t])),e=R.map(e=>t.get(e)).filter(t=>!!t);return e.length===R.length?e:r.questions},[R,r.questions,r,a]);Tf(()=>{!y||Ie(v)||0>v||S(v)},[v,y]);var P=!(null==(e=r.appearance)||!e.allowGoBack)&&(y?(null!=v?v:0)>0:C.length>0),O=A.at(k);return O?$p("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&$p(Gp,{onClick(){c()}}),$p("div",{className:"survey-box","data-question-index":k,children:Cg({question:O,forceDisableHtml:n,displayQuestionIndex:k,appearance:r.appearance||up,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,n=t.questionId;if(o)if(n){var a=Fa(n),l=s({},u,{[a]:e});h(l);var d=A[i],v=null!=d&&d.id?s({},M,{[d.id]:d.question}):M;I(v);var c=ug(r,i,e),f=c===zf.End,p=[...C,i];if(f||(T(p),S(c),Mp(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:c,questionOrder:bp(A),visitedIndices:p,surveyLanguage:b,questionSnapshots:v})),r.enable_partial_responses||f){var g=new Set(p.map(t=>{var e;return null==(e=A[t])?void 0:e.id}).filter(t=>!!t).map(t=>Fa(t)));fp({responses:Object.fromEntries(Object.entries(l).filter(t=>g.has(t[0]))),survey:r,surveySubmissionId:m,isSurveyCompleted:f,posthog:o,properties:_,surveyLanguage:b,questionSnapshots:v})}}else Jf.error("onNextButtonClick called without a questionId.");else Jf.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:O.id}),onPreviewSubmit:p,initialValue:O.id?u[Fa(O.id)]:void 0,canGoBack:P,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);T(e),S(t),Mp(r,{surveySubmissionId:m,responses:u,lastQuestionIndex:t,questionOrder:bp(A),visitedIndices:e,surveyLanguage:b,questionSnapshots:M})}}})})]}):null}function xg(t){var e,i,r,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=Cf(!0),f=c[0],p=c[1],g=Cf(!1),m=g[0],y=g[1],_=Cf({}),b=_[0],w=_[1],k=Ef(void 0),S=()=>{y(!m)};if(Tf(()=>{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&&(Jf.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return Ln(vg,fg,e),()=>{Ie(k.current)||(clearTimeout(k.current),k.current=void 0),vg.removeEventListener(fg,e)}}}else Jf.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]),_g({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==Wf.Always&&p(!1),Ie(k.current)||clearTimeout(k.current),k.current=setTimeout(()=>{k.current=void 0,y(!1)},200)};return $p(Gc,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&$p("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Bf.Top?"widget-tab-top":""),onClick:S,disabled:d,style:wg(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&$p(kg,{posthog:h,survey:l,forceDisableHtml:u,style:b,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var Cg=t=>{var e=t.question,i=t.displayQuestionIndex,r=t.onSubmit,n=t.onPreviewSubmit,o={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){n(t)},onSubmit(t){r(t)},initialValue:t.initialValue,displayQuestionIndex:i,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case Hf.Open:return Wc(Yp,s({},o,{question:e,key:e.id}));case Hf.Link:return Wc(Xp,s({},o,{question:e,key:e.id}));case Hf.Rating:return Wc(tg,s({},o,{question:e,key:e.id}));case Hf.SingleChoice:case Hf.MultipleChoice:return Wc(ig,s({},o,{question:e,key:e.id}));default:return Jf.error("Unsupported question type: "+e.type),null}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.generateSurveys=yg,b.extendPostHogWithSurveys=yg;var Tg=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},Eg=1e4,Mg=(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),Ig=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return Mg(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 o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>i.remaining?s=o-1:n=o}return Mg(e,JSON.stringify(t.slice(0,n)),i)},Rg=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Ag=(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}},Pg=(t,e,i)=>{if(!i.truncated)if(Ee(t)){if(i.seen.has(t))return void Ag(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(Pg(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else Ag(e,t,i)},Og=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!Rg(t))return!n||Mg(e,"null",i);if(Pe(t)||(t=>{try{return Fe(t)||De(t)}catch(t){return!1}})(t))return Mg(e,JSON.stringify(t),i);if("string"==typeof t)return Ig(t,e,i);if(!Ee(t)&&!Ce(t))return Mg(e,JSON.stringify(t),i);if(r.has(t))return Ig("[Circular]",e,i);r.add(t);try{var o=t.toJSON;if(Te(o))return Og(o.call(t),e,i,r,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return Ig(String(t.valueOf()),e,i);if("[object Number]"===a||"[object Boolean]"===a)return Mg(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 Og(l,e,i,r,n,s)}if(Ce(t)){if(!Mg(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Mg(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!Og(d,e,i,r,!0))return!1}return Mg(e,"]",i)}if(!Mg(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{Pg(f,c,s)}catch(t){}if(Rg(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(!Mg(e,p,i))return!1;var _=e.length,b=Og(f,e,i,r,!1),w=i.truncated;if(e.length!==_){if(v=!1,!b)return!1}else if(e.length=g,i.remaining=m,i.truncated=b?y:w,!b)return!1}}}catch(t){}return Mg(e,"}",i)},Fg=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=Ee(t[0])?{result:{},keysRemaining:50,sizeRemaining:Eg,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||Mg(i," ",r))&&Og(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)||{}}},$g={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},Dg=t=>"canCapture"in t,Lg=t=>Dg(t)?t.canCapture?t.getExtension(np):void 0:t.is_capturing()?t.logs:void 0;b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.logs={initializeLogs(t){var e=t,i=[],r={host:b.location.host},n=!1,o=function(t){var o=b.console[t];i.push(Zv(b.console,t,i=>{var a=(i=>function(){for(var o=!1,a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];try{var h=e;if(l.length>0&&!n&&h){var d=Lg(h);if(d){n=!0,o=!0;var v=Fg(l,Eg),c=v.body,f=v.attributes,p=s({},r,v.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(Dg(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;Te(n)&&n.call(e,i)}})(h,d,{level:$g[t],body:c,attributes:s({"log.source":"console."+t},p,f)})}}}catch(t){}finally{o&&(n=!1),i.apply(b.console,l)}})(i);return a.__rrweb_original__=Tg(o),a}))};for(var a of Object.keys($g))o(a);return()=>{e=void 0,i.forEach(t=>t())}},replayConsoleBuffer(t,e){var i=Lg(t);if(i)for(var r of e)try{var n=Fg(r.args,Eg);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:$g[r.level],body:n.body,attributes:s({"log.source":"console."+r.level,host:b.location.host},n.truncated?{body_truncated:"true"}:{},n.attributes)},r.context,r.occurredAtMs)}catch(t){}}};var Ng=t=>Ue(t)&&("RangeError"===t.name&&0===t.message.indexOf("Maximum call stack size exceeded")||"InternalError"===t.name&&"too much recursion"===t.message),qg=Tn("[Error tracking]"),jg="webkit-masked-url:",Bg=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],Ug=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",jg],Hg=["__firefox__","__gCrWeb"];function zg(){return new cr([new xr,new Fr,new Tr,new Cr,new Pr,new Ar,new Mr,new Or],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=[],o=e.split("\n"),a=r;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=Sr.test(l)?l.replace(Sr,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var d=h(u,t);if(d){n.push(d);break}}if(n.length>=50)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,50).map(t=>{return s({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||"?"});var i})}(n)}}("web:javascript",_r,kr))}var Wg=Tn("[ExceptionAutocapture]"),Vg=zg(),Gg=(t,e)=>{try{return t()}catch(t){return e}},Zg=(t,e)=>Gg(()=>t(e()),void 0),Qg=t=>Gg(()=>Te(t)&&Te(t.call),!1),Jg=(t,e)=>Gg(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),Kg=(t,e,i)=>{Gg(()=>{var i;null==(i=t[e])||delete i.__POSTHOG_INSTRUMENTED__},void 0),Gg(()=>{t[e]=i},void 0)},Yg=t=>{var e=l;e||Wg.info("window not available, cannot wrap onerror");var i=Gg(()=>e.onerror,void 0);return e.onerror=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];return Zg(t,()=>Vg.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Re(e)&&Re(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}})),!!Qg(i)&&null!==(e=i(...n))&&void 0!==e&&e},Jg(e,"onerror"),()=>Kg(e,"onerror",i)},Xg=function(t,e){void 0===e&&(e=!1);var i=l;i||Wg.info("window not available, cannot wrap onUnhandledRejection");var r=Gg(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(i){var n;return Zg(t,()=>Vg.buildFromUnknown(i,{mechanism:{handled:!1}})),Qg(r)?null!==(n=r(i))&&void 0!==n&&n:e},Jg(i,"onunhandledrejection"),()=>Kg(i,"onunhandledrejection",r)},tm={wrapOnError:Yg,wrapUnhandledRejection:Xg,wrapConsoleError(t){var e=console;e||Wg.info("console not available, cannot wrap console.error");var i=Gg(()=>e.error,void 0);return e.error=function(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];Zg(t,()=>{var t;t=1==r.length?r[0]:r.join(" ");var e=r.find(t=>t instanceof Error);return Vg.buildFromUnknown(e||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),Qg(i)&&i(...r)},Jg(e,"error"),()=>Kg(e,"error",i)}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.errorWrappingFunctions=tm,b.posthogErrorWrappingFunctions=tm;var em=(t,e)=>{if(Te(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!Pe(i)&&"object"==typeof i&&Ce(i.errors_to_ignore)?i.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){Wg.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){Wg.error("Failed to capture exception for a legacy client",t)}};Yg(t=>{r.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||n(t)}),Xg(n,!0)}};b.extendPostHogWithExceptionAutoCapture=em,b.extendPostHogWithExceptionAutocapture=em;var im="X-POSTHOG-SESSION-ID",rm="X-POSTHOG-WINDOW-ID",nm="X-POSTHOG-DISTINCT-ID",sm=[im,rm,nm],om=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],am=(t,e)=>({}.hasOwnProperty.call(t,e)),lm=t=>"object"==typeof t&&!Pe(t)||Te(t),um=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),hm=t=>{try{var e;return um(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==l||null==(e=l.location)?void 0:e.href).toString()}catch(t){return}},dm=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(Ce(t)&&!t.includes(s))return!1;var o=!1;if(i){var a=i.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(im,a.sessionId),n.set(rm,l),o=!0}var u=(t=>Te(t)?t():t)(e);return u&&"$posthog_cookieless"!==u&&(n.set(nm,u),o=!0),o};b.__PosthogExtensions__=b.__PosthogExtensions__||{};var vm={_patchFetch:(t,e,i)=>Zv(l,"fetch",r=>function(n,o){var a=arguments.length>1?[n,o]:[n],l=a;try{var u=hm(n);if(u)if(um(n)){var h=new Request(n,o);dm(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(lm(o)?o.headers:void 0);if(dm(t,e,i,u,d)){var v=((t,e)=>{if(Ie(t)||Pe(t))return{headers:e};if(lm(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)=>am(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>am(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach(t=>e.add(t)),om.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&&om.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?s({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);v&&(l=[n,v])}}}catch(t){l=a}return r.apply(this,l)}),_patchXHR:(t,e,i)=>Zv(l.XMLHttpRequest.prototype,"open",r=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=hm(s);d&&dm(t,e,i,d,h);var v=r.call(u,n,s,o,a,l);return sm.forEach(t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),v})};b.__PosthogExtensions__.tracingHeadersPatchFns=vm,b.postHogTracingHeadersPatchFns=vm,"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}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(var i=this.length-1;i>=0;i--){var r=this[i];if(t.call(e,r,i,this))return r}},writable:!0,enumerable:!1,configurable:!0});var cm=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)}}},fm=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},pm=t=>{if("loading"===document.readyState)return"loading";var e=fm();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"},gm=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},mm=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[gm(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},ym=new WeakMap;function _m(t,e){var i=ym.get(e);return i||ym.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var bm,wm=-1,km=()=>wm,Sm=t=>{addEventListener("pageshow",e=>{e.persisted&&(wm=e.timeStamp,t(e))},!0)},xm=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||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))}},Cm=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Tm=()=>{var t,e;return null!==(t=null==(e=fm())?void 0:e.activationStart)&&void 0!==t?t:0},Em=-1,Mm=new Set,Im=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Rm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Mm)e();isFinite(Em)||(Em="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Rm,!0))}},Am=function(t){if(void 0===t&&(t=!1),t&&(Em=1/0),0>Em){var e,i,r=Tm();Em=null!==(e=document.prerendering||null==(i=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=r))?void 0:i.startTime)&&void 0!==e?e:Im(),addEventListener("visibilitychange",Rm,!0),addEventListener("prerenderingchange",Rm,!0),Sm(()=>{setTimeout(()=>{Em=Im()})})}return{get firstHiddenTime(){return Em},onHidden(t){Mm.add(t)}}},Pm=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=fm(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>km()?a&&(document.prerendering||Tm()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.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==a?void 0:a.name),navigationStartTime:o||0}},Om=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 o of r)n.observe(s({type:o,buffered:!0},i));return n}}catch(t){}},Fm=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},$m=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Dm=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Lm=class{constructor(){this.u=void 0}},Nm=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},qm=[1800,3e3],jm=function(t,e){void 0===e&&(e={});var i=Fm(e);Nm(()=>{var r,n=_m(e,Lm),s=Am(),o=Pm("FCP"),a=Om(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-Tm(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=xm(t,o,qm,e.reportAllChanges),Sm(i=>{o=Pm("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,km()),r=xm(t,o,qm,e.reportAllChanges),Cm(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&Om(["soft-navigation"],i=>{i.forEach(i=>{n.u&&i.navigationId&&$m(n.u,i),o=Pm("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=xm(t,o,qm,e.reportAllChanges))(!0)})},e)})},Bm=[.1,.25],Um=t=>t.find(t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)})||t[0],Hm=function(t,e){void 0===e&&(e={});var i=_m(e=Object.assign({},e),cm),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=Um(t.sources),s=null==n?void 0:n.node;if(s){var o,a=null!==(o=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==o?o:mm(s);r.set(n,a)}}},function(t,e){void 0===e&&(e={});var i=Am();jm(Dm(()=>{var r,n=Pm("CLS",0),s=_m(e,cm),o=(i,o,a,l,u)=>{n=Pm("CLS",0,i,o,a,l,u),s.o=0,r=xm(t,n,Bm,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{a(!0),o("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);a()},h=["layout-shift"];Fm(e)&&h.push("soft-navigation");var d=Om(h,u);d&&(r=xm(t,n,Bm,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),Sm(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,km()),Cm(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=Um(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:pm(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},zm=function(t,e){void 0===e&&(e={});var i=_m(e=Object.assign({},e),Lm);Fm(e)&&(i.u=new Map),jm(e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:pm(km())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=fm(),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:pm(t.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}}else{var o,a=null==(o=i.u)?void 0:o.get(t.navigationId);a&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:a})}return Object.assign(t,{attribution:e})})(e))},e)},Wm=0,Vm=1/0,Gm=0,Zm=t=>{for(var e of t)e.interactionId&&(Vm=Math.min(Vm,e.interactionId),Gm=Math.max(Gm,e.interactionId),Wm=Gm?(Gm-Vm)/7+1:0)},Qm=()=>{var t;return bm?Wm:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Jm=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return Qm()-this.h}D(){this.h=Qm(),this.v.length=0,this.p.clear()}S(t){var e=this.T(),i=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[i]:{k:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId){var i=this.v.at(-1),r=this.p.get(t.interactionId);if(r||10>this.v.length||t.duration>i.k){var n;if(r?t.duration>r.k?(r.entries=[t],r.k=t.duration):t.duration===r.k&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.p.set((r={id:t.interactionId,entries:[t],k:t.duration}).id,r),this.v.push(r)),this.v.sort((t,e)=>e.k-t.k),this.v.length>10)for(var s of this.v.splice(10))this.p.delete(s.id);null==(n=this.M)||n.call(this,r)}}}},Km=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Dm(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},Ym=[200,500],Xm=function(t,e){void 0===e&&(e={});var i=_m(e=Object.assign({},e),Jm),r=[],n=[],o=0,a=new WeakMap,l=new WeakMap,u=!1,h=()=>{u||(Km(d),u=!0)},d=()=>{var t=new Set(i.v.map(t=>a.get(t.entries[0]))),e=n.length-10;n=n.filter((i,r)=>r>=e||t.has(i));var s=new Set;for(var l of n)for(var h of v(l.startTime,l.processingEnd))s.add(h);r=r.filter(t=>t.startTime>o||s.has(t)),u=!1};i.m=t=>{var i,r=t.startTime+t.duration;o=Math.max(o,t.processingEnd);for(var s=n.length-1;s>=0;s--){var l=n[s];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&&a.set(t,i),h()},i.M=t=>{if(!l.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:mm(r);l.set(t,s)}else{var o,a=null==(o=t.entries.find(t=>t.targetSelector))?void 0:o.targetSelector;a&&l.set(t,a)}}};var v=(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};Om(["long-animation-frame"],t=>{r=r.concat(t),h()},e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Am();Nm(()=>{var r;"interactionCount"in performance||bm||(bm=Om(["event"],Zm,{durationThreshold:0}));var n,o=Pm("INP"),a=_m(e,Jm),l=(i,r,s,l,u)=>{a.D(),o=Pm("INP",-1,i,r,s,l,u),n=xm(t,o,Ym,e.reportAllChanges)},u=()=>{var t=a.S(o.navigationType);t&&t.k!==o.value&&(o.value=t.k,o.entries=t.entries,n())},h=t=>{u(),n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),Km(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):h(i);u(),e&&n(!0)})},v=["event","first-input"];Fm(e)&&v.push("soft-navigation");var c=Om(v,d,s({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=xm(t,o,Ym,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),Sm(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,km())}))})}}(e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:pm(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var r=t.entries[0],n=a.get(r),s=Math.max(n.processingStart,r.startTime),o=Math.max(r.startTime+r.duration,s),u=Math.min(n.processingEnd,o),h=n.entries.sort((t,e)=>t.processingStart-e.processingStart),d=v(r.startTime,u),c=i.p.get(r.interactionId),f={interactionTarget:l.get(c),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:o,processedEventEntries:h,longAnimationFrameEntries:d,inputDelay:s-r.startTime,processingDuration:u-s,presentationDelay:o-u,loadState:pm(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,o=t.inputDelay,a=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+o>c.startTime?"input-delay":i+o+a>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+o+a&&(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)},ty=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}},$=[2500,4e3],ey=50,iy=[];Om(["resource"],t=>{for(var e of t)iy.push(e),iy.length>ey&&iy.shift()});var ry=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(ey=e.resourceBufferSize);var i=_m(e,ty),r=new WeakMap;Fm(e)&&(i.u=new Map),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:mm(i);r.set(t,s)}else t.id&&r.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=Fm(e);Nm(()=>{var n,s=Am(),o=Pm("LCP"),a=_m(e,ty),l=(r,a,l,u,h)=>{o=Pm("LCP",-1,r,a,l,u,h),n=xm(t,o,$,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Am(!0))},u=t=>{a.u&&t.navigationId&&$m(a.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-Tm(),0),a.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Om(d,h);if(v){n=xm(t,o,$,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;Km(()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}})}};for(var p of c)addEventListener(p,f,{capture:!0});Sm(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,km()),n=xm(t,o,$,e.reportAllChanges),Cm(()=>{o.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,o,a,l,u,h,d=t.entries.at(-1),v=d.url&&(iy.findLast(t=>t.name===d.url)||performance.getEntriesByType("resource").findLast(t=>t.name===d.url));e.target=r.get(d),e.lcpEntry=d,d.url&&(e.url=d.url),v&&(e.lcpResourceEntry=v);var c=0,f=0;if("soft-navigation"!==t.navigationType?(c=null!==(n=null==(o=h=fm())?void 0:o.activationStart)&&void 0!==n?n:0,f=null!==(a=null==(l=h)?void 0:l.responseStart)&&void 0!==a?a:0):(c=t.navigationStartTime||0,h=null==(u=i.u)?void 0:u.get(t.navigationId)),h){var p=Math.max(0,f-c),g=Math.max(p,v?(v.requestStart||v.startTime)-c:0),m=Math.min(t.value,Math.max(g,v?v.responseEnd-c:0));e=s({},e,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:h})}}return Object.assign(t,{attribution:e})})(e))},e)},ny=-1,sy=()=>ny,oy=t=>{addEventListener("pageshow",e=>{e.persisted&&(ny=e.timeStamp,t(e))},!0)},ay=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||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))}},ly=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},uy=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},hy=()=>{var t,e;return null!==(t=null==(e=uy())?void 0:e.activationStart)&&void 0!==t?t:0},dy=-1,vy=new Set,cy=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,fy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of vy)e();isFinite(dy)||(dy="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",fy,!0))}},py=function(t){if(void 0===t&&(t=!1),t&&(dy=1/0),0>dy){var e,i,r=hy();dy=null!==(e=document.prerendering||null==(i=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=r))?void 0:i.startTime)&&void 0!==e?e:cy(),addEventListener("visibilitychange",fy,!0),addEventListener("prerenderingchange",fy,!0),oy(()=>{setTimeout(()=>{dy=cy()})})}return{get firstHiddenTime(){return dy},onHidden(t){vy.add(t)}}},gy=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=uy(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>sy()?a&&(document.prerendering||hy()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.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==a?void 0:a.name),navigationStartTime:o||0}},my=new WeakMap;function yy(t,e){var i=my.get(e);return i||my.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var _y,by=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)}}},wy=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 o of r)n.observe(s({type:o,buffered:!0},i));return n}}catch(t){}},ky=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Sy=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},xy=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Cy=class{constructor(){this.l=void 0}},Ty=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Ey=[1800,3e3],My=function(t,e){void 0===e&&(e={});var i=ky(e);Ty(()=>{var r,n=yy(e,Cy),s=py(),o=gy("FCP"),a=wy(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-hy(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=ay(t,o,Ey,e.reportAllChanges),oy(i=>{o=gy("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,sy()),r=ay(t,o,Ey,e.reportAllChanges),ly(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&wy(["soft-navigation"],i=>{i.forEach(i=>{n.l&&i.navigationId&&Sy(n.l,i),o=gy("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=ay(t,o,Ey,e.reportAllChanges))(!0)})},e)})},Iy=[.1,.25],Ry=function(t,e){void 0===e&&(e={});var i=py();My(xy(()=>{var r,n=gy("CLS",0),s=yy(e,by),o=(i,o,a,l,u)=>{n=gy("CLS",0,i,o,a,l,u),s.i=0,r=ay(t,n,Iy,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{a(!0),o("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);a()},h=["layout-shift"];ky(e)&&h.push("soft-navigation");var d=wy(h,u);d&&(r=ay(t,n,Iy,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),oy(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,sy()),ly(r)}),setTimeout(r))}))},Ay=0,Py=1/0,Oy=0,Fy=t=>{for(var e of t)e.interactionId&&(Py=Math.min(Py,e.interactionId),Oy=Math.max(Oy,e.interactionId),Ay=Oy?(Oy-Py)/7+1:0)},$y=()=>{var t;return _y?Ay:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Dy=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return $y()-this.u}M(){this.u=$y(),this.v.length=0,this.m.clear()}L(t){var e=this._(),i=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[i]:{P:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId){var i=this.v.at(-1),r=this.m.get(t.interactionId);if(r||10>this.v.length||t.duration>i.P){var n;if(r?t.duration>r.P?(r.entries=[t],r.P=t.duration):t.duration===r.P&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.m.set((r={id:t.interactionId,entries:[t],P:t.duration}).id,r),this.v.push(r)),this.v.sort((t,e)=>e.P-t.P),this.v.length>10)for(var s of this.v.splice(10))this.m.delete(s.id);null==(n=this.T)||n.call(this,r)}}}},Ly=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=xy(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},Ny=[200,500],qy=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=py();Ty(()=>{var r;"interactionCount"in performance||_y||(_y=wy(["event"],Fy,{durationThreshold:0}));var n,o=gy("INP"),a=yy(e,Dy),l=(i,r,s,l,u)=>{a.M(),o=gy("INP",-1,i,r,s,l,u),n=ay(t,o,Ny,e.reportAllChanges)},u=()=>{var t=a.L(o.navigationType);t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,n())},h=t=>{u(),n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),Ly(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):h(i);u(),e&&n(!0)})},v=["event","first-input"];ky(e)&&v.push("soft-navigation");var c=wy(v,d,s({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=ay(t,o,Ny,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),oy(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,sy())}))})}},jy=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}},By=[2500,4e3],Uy=function(t,e){void 0===e&&(e={});var i=!1,r=ky(e);Ty(()=>{var n,s=py(),o=gy("LCP"),a=yy(e,jy),l=(r,a,l,u,h)=>{o=gy("LCP",-1,r,a,l,u,h),n=ay(t,o,By,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=py(!0))},u=t=>{a.l&&t.navigationId&&Sy(a.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-hy(),0),a.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=wy(d,h);if(v){n=ay(t,o,By,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;Ly(()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}})}};for(var p of c)addEventListener(p,f,{capture:!0});oy(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,sy()),n=ay(t,o,By,e.reportAllChanges),ly(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})},Hy={onLCP:ry,onCLS:Hm,onFCP:zm,onINP:Xm,withoutAttribution:{onLCP:Uy,onCLS:Ry,onFCP:My,onINP:qy}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Hy,b.__PosthogExtensions__.postHogWebVitalsCallbacks=Hy,b.postHogWebVitalsCallbacks=Hy;var zy={onLCP:Uy,onCLS:Ry,onFCP:My,onINP:qy};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=zy,b.__PosthogExtensions__.postHogWebVitalsCallbacks=zy,b.postHogWebVitalsCallbacks=zy,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>zy;var Wy={onLCP:ry,onCLS:Hm,onFCP:zm,onINP:Xm,withoutAttribution:{onLCP:Uy,onCLS:Ry,onFCP:My,onINP:qy}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=Wy,b.__PosthogExtensions__.postHogWebVitalsCallbacks=Wy,b.postHogWebVitalsCallbacks=Wy;var Vy={onLCP:Uy,onCLS:Ry,onFCP:My,onINP:qy};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=Vy,b.__PosthogExtensions__.postHogWebVitalsCallbacks=Vy,b.postHogWebVitalsCallbacks=Vy,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Vy;var Gy=class{constructor(t){this.disabled=!1===t;var e=Ee(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}},Zy="$copy_autocapture",Qy=Tn("[AutoCapture]");function Jy(t,e){return e.length>t?e.slice(0,t)+"...":e}function Ky(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!Kn(e));return e}function Yy(t,e){var i,r,n=e.e,o=e.maskAllElementAttributes,a=e.maskAllText,u=e.elementAttributeIgnoreList,h=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!Kn(t))return{props:{}};for(var v=[t],c=new Set([t]),f=t;f.parentNode&&!Yn(f,"body")&&1e3>v.length;)if(ts(f.parentNode)){var p=f.parentNode.host;if(c.has(p))break;c.add(p),v.push(p),f=p}else{if(!Kn(f.parentNode))break;if(c.has(f.parentNode))break;c.add(f.parentNode),v.push(f.parentNode),f=f.parentNode}var g="click"===n.type&&"http://www.w3.org/2000/svg"===t.namespaceURI?v.findIndex(t=>Yn(t,"button")||Yn(t,"a")):-1;g>0&&(a=a||v.slice(0,g+1).some(t=>!ws(t)||ks(t)));var m,y,_,b=[],w={},k=!1,S=!1;if(Mn(v,t=>{var e=ws(t);if(Yn(t,"a")){var i=t.getAttribute("href");k=!!(e&&i&&Rs(i))&&(d?lr(i):i)}ve(rs(t),"ph-no-capture")&&(S=!0),b.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};as.indexOf(s)>-1&&!i&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?Jy(1024,As(t)):Jy(1024,ss(t)));var a=rs(t);a.length>0&&(o.classes=a.filter(function(t){return""!==t})),Mn(t.attributes,function(i){var s;if((!ks(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Rs(i.value)&&(!Re(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=i.value;"class"===i.name&&(a=es(a).join(" ")),o["attr__"+i.name]=Jy(1024,"href"===i.name&&n?lr(a):a)}});for(var l=1,u=1,h=t;h=Ky(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,a,u,d)),Mn(function(t){if(!ws(t))return{};var e={};return Mn(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&&Rs(r)&&(e[i]=r)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(w,e)||(w[e]=t)})}),S)return{props:{},explicitNoCapture:S};if(g>0&&(t=v[g],b.splice(0,g)),a||(b[0].$el_text=Yn(t,"a")||Yn(t,"button")?As(t):ss(t)),k){var x,C;b[0].attr__href=k;var T=null==(x=Bn(k))?void 0:x.host,E=null==l||null==(C=l.location)?void 0:C.host;T&&E&&T!==E&&(m=k)}return{props:In((y=n.type,{$event_type:y,$ce_version:1}),h?{}:{$elements:b},{$elements_chain:(_=b,Ce(_)?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 o=s({},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 Rn(o).sort((t,e)=>function(t,e){return e>t?-1:t>e?1:0}(t[0],e[0])).forEach(t=>{var e=t[1];return a[Os(t[0].toString())]=Os(e.toString())}),(r+=":")+Rn(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:Fs(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Rn(t).filter(t=>0===t[0].indexOf("attr__")).forEach(t=>r.attributes[t[0]]=t[1]),r})}(_)):"")},null!=(i=b[0])&&i.$el_text?{$el_text:null==(r=b[0])?void 0:r.$el_text}:{},m&&"click"===n.type?{$external_click_url:m}:{},w),target:t}}var Xy=class{zs(){this.Us=void 0,clearTimeout(this.Ws),this.Ws=void 0}Vs(t){var e;if(!ws(t))return!0;for(var i,r=null!==(e=this.Gs().css_selector_ignorelist)&&void 0!==e?e:ds,n=new Set,s=t,o=function(){if(n.size>=1e3||n.has(s))return{v:!0};n.add(s);var t=s,e=rs(t);if(ve(e,"ph-no-capture")||ve(e,"ph-sensitive")||ks(t)||r.some(e=>ls(t,e)))return{v:!0};var i=s.parentNode;s=ts(i)?i.host:i&&Kn(i)?i:null};s;)if(i=o())return i.v;return!1}Zs(t){if(this.isEnabled&&"pointercancel"!==t.type)if("pointerdown"!==t.type){var e=this.Us;e&&(t.pointerId!==e.id||Math.abs(t.clientX-e.x)>5||Math.abs(t.clientY-e.y)>5?this.zs():"pointerup"===t.type&&(e.released=!0,this.Ws=setTimeout(()=>this.zs(),0)))}else{var i;this.zs();var r=os(t);t.isPrimary&&0===t.button&&!t.ctrlKey&&r&&Kn(r)&&(this.Us={target:r,excluded:this.Vs(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:null==(i=this.Js)?void 0:i.distinctId})}else this.zs()}Qs(t){var e,i=this.Us;this.zs();var r=os(t);if(null!=i&&i.released&&i.target.isConnected&&i.distinctId===(null==(e=this.Js)?void 0:e.distinctId)&&t.pointerId===i.id&&(t.detail>0||"touch"===t.pointerType||"pen"===t.pointerType)&&0===t.button&&5>=Math.abs(t.clientX-i.x)&&5>=Math.abs(t.clientY-i.y)&&r&&(Yn(r,"html")||Yn(r,"body"))){var n;if(i.excluded)return null;var s=null!==(n=this.Gs().css_selector_ignorelist)&&void 0!==n?n:ds;return[r,null==d?void 0:d.documentElement,null==d?void 0:d.body].some(t=>{if(!t)return!1;var e=rs(t);return ve(e,"ph-no-capture")||ve(e,"ph-sensitive")||!ws(t)||ks(t)||s.some(e=>ls(t,e))})?null:i.target}}constructor(t){this.Ks=t,this.name="autocapture",this.Xs=!1,this.Ys=null,this.eo=!1,this.io=!1,this.Rn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.ro=!1,this.Ks.refresh(this.Rn),this.rageclicks=new Gy(this.Rn.rageclick),this.no=null}setup(t){this.so(),this.Js=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.ro?e.dispose():(this.oo=e,this.startIfEnabled())}dispose(){var t;this.ro||(this.ro=!0,this.Js=void 0,null==(t=this.oo)||t.dispose(),this.oo=void 0,this.ao())}Gs(){return this.Ks.refresh(this.Rn),this.Rn}so(){var t,e;return this.Gs(),this.Rn.url_allowlist=null==(t=this.Rn.url_allowlist)?void 0:t.map(t=>new RegExp(t)),this.Rn.url_ignorelist=null==(e=this.Rn.url_ignorelist)?void 0:e.map(t=>new RegExp(t)),this.Rn}lo(){if(this.isBrowserSupported()){if(l&&d){var t=this.uo=t=>{t=t||(null==l?void 0:l.event);try{if("blur"===t.type)return void this.zs();if(0===t.type.indexOf("pointer"))return void this.Zs(t);var e="click"===t.type?this.Qs(t):void 0;if(Pe(e))return;this.ho(t,"$autocapture",e)}catch(t){Qy.error("Failed to capture event",t)}};if(Ln(l,"blur",t),Ln(d,"submit",t,{capture:!0}),Ln(d,"change",t,{capture:!0}),Ln(d,"click",t,{capture:!0}),Mn(["pointerdown","pointermove","pointerup","pointercancel"],e=>{Ln(d,e,t,{capture:!0})}),this.Gs().capture_copied_text){var e=this.do=t=>{t=t||(null==l?void 0:l.event);try{this.ho(t,Zy)}catch(t){Qy.error("Failed to capture clipboard event",t)}};Ln(d,"copy",e,{capture:!0}),Ln(d,"cut",e,{capture:!0}),Ln(d,"paste",e,{capture:!0})}}}else Qy.info("Disabling Automatic Event Collection because this browser is not supported")}ao(){this.zs(),this.uo&&(null==l||l.removeEventListener("blur",this.uo),Mn(["pointerdown","pointermove","pointerup","pointercancel"],t=>{null==d||d.removeEventListener(t,this.uo,!0)}),null==d||d.removeEventListener("submit",this.uo,!0),null==d||d.removeEventListener("change",this.uo,!0),null==d||d.removeEventListener("click",this.uo,!0),this.uo=void 0),this.do&&(null==d||d.removeEventListener("copy",this.do,!0),null==d||d.removeEventListener("cut",this.do,!0),null==d||d.removeEventListener("paste",this.do,!0),this.do=void 0),this.Xs=!1}startIfEnabled(){this.isEnabled||this.zs(),!this.ro&&this.Js&&this.isEnabled&&!this.Xs&&(this.lo(),this.Xs=!0)}onRemoteConfig(t){if(!this.ro)if(this.eo=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.io=e.elementsChainAsString);var i,r=e.autocapture_opt_out;De(r)&&(null==(i=this.Js)||i.kv.set(R,r),this.Ys=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.no=t}getElementSelectors(t,e){var i,r=[];return null==(i=this.no)||i.forEach(i=>{var n;null==d||null==(n=d.querySelectorAll(i))||n.forEach(n=>{t!==n&&e!==n||ve(r,i)||r.push(i)})}),r}get isEnabled(){var t,e;if(this.ro)return!1;var i=null==(t=this.Js)?void 0:t.kv.get(R),r=this.Ys,n=this.Gs();if(!n.remoteRequestsDisabled&&!this.eo)return!1;var s=n.remoteRequestsDisabled&&!this.eo;if(Pe(r)&&!De(i)&&!s)return!1;var o=null!==(e=this.Ys)&&void 0!==e?e:!!i;return!!n.enabled&&!o}ho(t,e,i){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r=i||os(t);Xn(r)&&(r=r.parentNode||null);var n,o=this.so();"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&o.rageclick&&null!=(n=this.rageclicks)&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&ys(r,o.rageclick)&&this.ho(t,"$rageclick",i);var a=e===Zy,u=a?s({},o,{dom_event_allowlist:void 0}):o;if(r&&function(t,e,i,r,n,s){var o;if(!l||_s(t))return!1;if(null!=i&&i.url_allowlist&&!is(i.url_allowlist,s))return!1;if(null!=i&&i.url_ignorelist&&is(i.url_ignorelist,s))return!1;if(null!=i&&i.dom_event_allowlist){var a=i.dom_event_allowlist;if(a&&!a.some(t=>e.type===t))return!1}var u=bs(t,r),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(Ie(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,i))return!1;if(!us(d,null==i?void 0:i.css_selector_allowlist))return!1;if(us(d,null!==(o=null==i?void 0:i.css_selector_ignorelist)&&void 0!==o?o:ds))return!1;try{var v=l.getComputedStyle(t);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===e.type)return!0}catch(t){}var c=t.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return h?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(as.indexOf(c)>-1||"true"===t.getAttribute("contenteditable"))}}(r,t,u,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:o.getCurrentUrl}})){var h,d=Yy(r,{e:t,maskAllElementAttributes:o.maskAllElementAttributes,maskAllText:o.maskAllText,elementAttributeIgnoreList:o.element_attribute_ignorelist,elementsChainAsString:this.io,disableCaptureUrlHashes:o.disableCaptureUrlHashes}),v=d.props;if(d.explicitNoCapture)return!1;var c=this.getElementSelectors(r,d.target);if(c&&c.length>0&&(v.$element_selectors=c),e===Zy){var f=t.type||"clipboard";if("paste"!==f){var p,g,m=null==l||null==(p=l.getSelection())?void 0:p.toString(),y=ns(m);if(!y)return!1;v.$selected_content=y,v.$clipboard_text_length=null!==(g=null==m?void 0:m.length)&&void 0!==g?g:0}v.$copy_type=f}return null==(h=this.Js)||h.capture(e,v).catch(t=>Qy.error("Failed to capture event",t)),!0}}else this.zs()}isBrowserSupported(){return Te(null==d?void 0:d.querySelectorAll)}},t_={};function e_(t,e){var i=os(t);return i?s({node:i,originalEvent:t,timestamp:Date.now()},e):null}function i_(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function r_(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var n_="canvas,video,audio,embed,object";function s_(t,e){return Fe(t)&&t>=e}function o_(t){return t>=0&&1e3>t?t:void 0}function a_(t,e){return e?o_(t-e):void 0}var l_=class{un(t){var e,i,r,n,s,o,a,l,u=this.ln((null==t?void 0:t.__onCapture)||this.hn.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!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a: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.instance=t,this.cn=[],this.dn=0,this.ln=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.vn=t=>{var e=e_(t,{type:"click"});Pe(e)||this.fn(e)||this.pn(e),this.gn()},this.mn=()=>{var t=Date.now();this.yn=t,t%50==0&&this.cn.forEach(e=>{Ie(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.bn=()=>{this.wn=Date.now()},this.ar=()=>{var t=Date.now();this.kn=t,this._n("visibilityChangedDelayMs",t)},this.Sn=()=>{var t=Date.now();this.xn=t,this._n("focusChangedDelayMs",t)},this.Cn=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.Mn=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.Tn=()=>{this.Mn=void 0},this.In=t=>{var e,i=this.Mn;if(this.Mn=void 0,!Ie(i)&&this.Rn.max_dead_swipes_per_page_load>this.dn){var r=t,n=null==(e=r.changedTouches)?void 0:e[0];if(n){var s=n.clientX-i.x,o=n.clientY-i.y,a=s*s+o*o,l=this.Rn.swipe_threshold_px;if(a>=l*l&&![this.yn,this.An,this.wn].some(t=>Fe(t)&&t>=i.timestamp)){var u;if(this.En()&&(null!==(u=null==d||null==d.elementsFromPoint?void 0:d.elementsFromPoint(i.x,i.y))&&void 0!==u?u:[]).some(t=>null==t.matches?void 0:t.matches(n_)))return;var h=e_(r,{type:"swipe",swipeDirection:i_(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Pe(h)||this.fn(h)||this.pn(h),this.gn()}}}},this.Rn=this.un(e),this._onCapture=this.Rn.__onCapture}start(t){this.On(),this.Ln(),this.Dn(),this.Pn(),this.Nn(),this.Fn(t),this.Rn.capture_dead_swipes&&this.qn()}Fn(t){if(!this.jn){var e=function(t){return function(t,e){var i=t_[t];if(i)return i;var r=e[t];if((t=>Te(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&(null==l||!l.Zone))return t_[t]=r.bind(e);var n=e.document;if(n&&Te(n.createElement)){var s,o=!1;try{(s=n.createElement("iframe")).hidden=!0,n.head.appendChild(s);var a,u,h=s.contentWindow;h&&h[t]&&(r=h[t],"MutationObserver"===t&&function(t){return ve(t,"AppleWebKit")&&!ve(t,"Chrome")}(null!==(a=null==(u=e.navigator)?void 0:u.userAgent)&&void 0!==a?a:"")&&(s.classList.add("rr-block","ph-no-capture"),o=!0))}catch(e){Cn.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var d;!o&&null!=(d=s)&&d.parentNode&&s.parentNode.removeChild(s)}}return r&&Te(r)?t_[t]=r.bind(e):r}("MutationObserver",t)}(b);this.jn=new e(t=>{this.Bn(t)}),this.jn.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.jn)||t.disconnect(),this.jn=void 0,b.removeEventListener("click",this.vn),b.removeEventListener("scroll",this.mn,{capture:!0}),b.removeEventListener("selectionchange",this.bn),b.removeEventListener("touchstart",this.Cn,{capture:!0}),b.removeEventListener("touchend",this.In,{capture:!0}),b.removeEventListener("touchcancel",this.Tn,{capture:!0}),null==d||d.removeEventListener("visibilitychange",this.ar),b.removeEventListener("blur",this.Sn),b.removeEventListener("focus",this.Sn),this.Mn=void 0}Bn(t){this.An=Date.now()}On(){Ln(b,"click",this.vn)}pn(t){t.visibilityChangedDelayMs=a_(t.timestamp,this.kn),t.focusChangedDelayMs=a_(t.timestamp,this.xn),this.cn.push(t)}gn(){this.cn.length&&Ie(this.Hn)&&(this.Hn=b.setTimeout(()=>{this.$n()},1e3))}Ln(){Ln(b,"scroll",this.mn,{capture:!0})}Dn(){Ln(b,"selectionchange",this.bn)}Pn(){Ln(d,"visibilitychange",this.ar)}Nn(){Ln(b,"blur",this.Sn),Ln(b,"focus",this.Sn)}_n(t,e){this.cn.forEach(i=>{var r=o_(e-i.timestamp);Fe(r)&&(Ie(i[t])||i[t]>r)&&(i[t]=r)})}qn(){Ln(b,"touchstart",this.Cn,{capture:!0,passive:!0}),Ln(b,"touchend",this.In,{capture:!0,passive:!0}),Ln(b,"touchcancel",this.Tn,{capture:!0,passive:!0})}En(){var t=Ie(this.zn)||Fe(this.An)&&this.An>this.zn;return(Ie(this.Un)||t)&&(this.zn=Date.now(),this.Un=!(null==d||!d.querySelector(n_))),!!this.Un}fn(t){return!t||("swipe"===t.type?this.Wn(t):this.Vn(t))}Wn(t){return!(!Jn(t.node)&&!this.cn.some(e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp))&&!Yn(t.node,"html")&&Kn(t.node)&&function(t,e){var i;if(!l||_s(t))return!1;var r=De(e)?ps:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:ps;return!us(bs(t,!1).targetElementList,r)}(t.node,{css_selector_ignorelist:this.Rn.css_selector_ignorelist}))}Vn(t){return!(this.Rn.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.Wn(t)||(i=t.node,!(!l||_s(i))&&bs(i,!1).targetElementList.some(t=>Yn(t,"a")));var e,i}$n(){if(this.cn.length){clearTimeout(this.Hn),this.Hn=void 0;var t=this.cn;for(var e of(this.cn=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.An&&this.An>=e.timestamp?this.An-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.wn&&this.wn>=e.timestamp?this.wn-e.timestamp:void 0;var r=s_(e.scrollDelayMs,this.Rn.scroll_threshold_ms),n=s_(e.selectionChangedDelayMs,this.Rn.selection_change_threshold_ms),s=s_(e.mutationDelayMs,this.Rn.mutation_threshold_ms),o=s_(e.absoluteDelayMs,1.1*this.Rn.mutation_threshold_ms),a=Fe(e.scrollDelayMs)&&this.Rn.scroll_threshold_ms>e.scrollDelayMs,l=Fe(e.mutationDelayMs)&&this.Rn.mutation_threshold_ms>e.mutationDelayMs,u=Fe(e.selectionChangedDelayMs)&&this.Rn.selection_change_threshold_ms>e.selectionChangedDelayMs,h=Fe(e.visibilityChangedDelayMs),d=Fe(e.focusChangedDelayMs);if(!(a||l||u||h||d))if(r||s||o||n){var v=r_(e);if("$dead_swipe"===v){if(this.dn>=this.Rn.max_dead_swipes_per_page_load)continue;this.dn++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.An,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:o,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:!1})}else this.Rn.mutation_threshold_ms>e.absoluteDelayMs&&this.cn.push(e)}this.gn()}}hn(t,e){var i=r_(t);this.instance.capture(i,s({},e,Yy(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Rn.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)})}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new l_(t,e);var u_=Tn("[ExternalScriptsLoader]"),h_=t=>{var e=null==d?void 0:d.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 u_.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=h_(e);if(r){if(r.__posthog_loading_callback_fired)return i();var n=r.__posthog_loading_error;return n?i(n):(r.addEventListener("load",t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)}),void r.addEventListener("error",t=>{r.__posthog_loading_error=t,i(t)}))}var s=()=>{if(!d)return i("document not found");if(h_(e))return d_(t,e,i);var r=d.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=e,r.onload=t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)},r.onerror=t=>{r.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(r=t.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)d.head.appendChild(r);else{var n,s=d.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(r,s[0]):d.body.appendChild(r)}};null!=d&&d.body?s():null==d||d.addEventListener("DOMContentLoaded",s)},v_={},c_=(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)};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__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=v_[n];if("fallback"===r&&s){if(h_(s))return void d_(t,s,i);delete v_[n]}d_(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var o,a=c_(t,e);v_[n]=a;var l=h_(n);null==l||null==(o=l.parentNode)||o.removeChild(l),d_(t,a,i)}else i(void 0,s)}:i)}else d_(t,c_(t,e),i)}else d_(t,t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js"),i)},b.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{d_(t,t.requestRouter.endpointFor("api",e),i)};var f_=class{constructor(t){this._instance=t}get Rn(){return this._instance.config}get consent(){return this.vo()?0:this.co}isOptedOut(){return"always"===this.Rn.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.Rn.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Rn.opt_out_capturing_by_default}optInOut(t){this.fo.Ot(this.po,t?1:0,this.Rn.cookie_expiration,this.Rn.cross_subdomain_cookie,this.Rn.secure_cookie)}reset(){this.fo.Dt(this.po,this.Rn.cross_subdomain_cookie)}get po(){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 co(){var t=this.fo.Lt(this.po);return Ve(t)?1:ve(Ge,t)?0:-1}get fo(){var t=this.Rn.opt_out_capturing_persistence_type,e="localStorage"===t?ga:fa,i=e.Et()?e:Ma;if(!this.mo||this.mo!==i){this.mo=i;var r="localStorage"===t?fa:ga;r.Lt(this.po)&&(this.mo.Lt(this.po)||this.optInOut(Ve(r.Lt(this.po))),r.Dt(this.po,this.Rn.cross_subdomain_cookie))}return this.mo}vo(){return!!this.Rn.respect_dnt&&[null==h?void 0:h.doNotTrack,null==h?void 0:h.msDoNotTrack,b.doNotTrack,null==h?void 0:h.globalPrivacyControl].some(t=>Ve(t))}},p_=Tn("[Dead Clicks]"),g_=()=>!0,m_=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(L)),r=t.instance.config.capture_dead_clicks;return De(r)?r:!!Ee(r)||i},y_=class{get lazyLoadedDeadClicksAutocapture(){return this.yo}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({[L]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.bo(()=>{this._o()}):this.stop()}bo(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",e=>{e?p_.error("failed to load script",e):t()})}_o(){var t;if(d){if(!this.yo&&null!=(t=b.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Ee(this.instance.config.capture_dead_clicks)?s({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.yo=b.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.yo.start(d),p_.info("starting...")}}else p_.error("`document` not found. Cannot start.")}stop(){this.yo&&(this.yo.stop(),this.yo=void 0,p_.info("stopping..."))}},__=Tn("[SegmentIntegration]");function b_(t,e,i){void 0===i&&(i=!0);var r=t.config.segment;if(!r)return e();!function(t,e,i){var r=t.config.segment;if(!r)return e();var n=r=>{var n=()=>r.anonymousId()||ua();t.config.get_device_id=n,i&&r.id()&&(t.register({distinct_id:r.id(),$device_id:n()}),t.persistence.set_property(Pt,ie)),e(i?void 0:r.anonymousId()||void 0)},s=r.user();"then"in s&&Te(s.then)?s.then(n):n(s)}(t,i=>{r.register(((t,e)=>{"undefined"!=typeof Promise&&Promise.resolve||__.warn("This browser does not have Promise support, and can not use the segment integration");var i=(i,r)=>{if(!r)return i;var n=!!e&&i.event.anonymousId===e&&!i.event.userId;n||i.event.userId||i.event.anonymousId===t.get_distinct_id()||(__.info("No userId set, resetting PostHog"),t.reset()),n||(e=void 0),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(__.info("UserId set, identifying with PostHog"),t.identify(i.event.userId));var s=t.calculateEventProperties(r,i.event.properties);return i.event.properties=Object.assign({},s,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return i(t,t.event.event)},page(t){return i(t,oe)},identify(t){return i(t,le)},screen(t){return i(t,"$screen")}}})(t,i)).then(()=>{e()},t=>{__.error("Failed to register the Segment integration",t),e()})},i)}var w_="posthog-js";function k_(t,e){var i=void 0===e?{}:e,r=i.organization,n=i.projectId,o=i.prefix,a=i.severityAllowList,l=void 0===a?["error"]:a,u=i.sendExceptionsToPostHog,h=void 0===u||u;return e=>{var i,a,u,d,v,c;if("*"!==l&&!l.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var f=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=f,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var p=(null==(i=e.exception)?void 0:i.values)||[],g=p.map(t=>s({},t,{stacktrace:t.stacktrace?s({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map(t=>s({},t,{platform:"web:javascript"}))}):void 0})),m={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(v=p[0])?void 0:v.type,$sentry_tags:e.tags};return r&&n&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+e.event_id),h&&(null==(c=t.exceptions)||c.sendExceptionEvent(m)),e}}var S_=class{constructor(t,e,i,r,n,s){this.name=w_,this.setupOnce=function(o){o(k_(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}},x_=class{constructor(t){this.wo=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Cn.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.ko=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.So()}So(){var t;this.xo=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.wo)}destroy(){var t;null==(t=this.xo)||t.call(this),this.xo=void 0}doPageView(t,e){var i,r=this.Co(t,e);return this.ko={pathname:null!==(i=null==l?void 0:l.location.pathname)&&void 0!==i?i:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.Co(t,null==(e=this.ko)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ko)?void 0:t.pageViewId}}Co(t,e){var i=this.ko;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,o=n.lastScrollY,a=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(Ie(s)||Ie(o)||Ie(a)||Ie(l)||Ie(u)||Ie(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?Ze(o/s,0,1,Cn):1,v=s>1?Ze(a/s,0,1,Cn):1,c=l>1?Ze(u/l,0,1,Cn):1,f=l>1?Ze(h/l,0,1,Cn):1;r=In(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$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}},C_=["flags","surveys"],T_={[w]:{exposure:"hidden"},[C]:{exposure:"hidden"},[T]:{exposure:"hidden"},[I]:{exposure:"hidden"},[M]:{exposure:"hidden"},[R]:{exposure:"event"},[A]:{exposure:"hidden"},[q]:{exposure:"hidden"},[P]:{exposure:"event"},[O]:{exposure:"hidden"},[F]:{exposure:"event"},[D]:{exposure:"event"},[L]:{exposure:"event"},[N]:{exposure:"hidden"},[j]:{exposure:"event"},[B]:{exposure:"hidden"},[U]:{exposure:"hidden"},[Z]:{exposure:"hidden"},[Q]:{exposure:"event"},[H]:{exposure:"event",shouldSkipFromEventProperties:t=>Pe(t)},[J]:{exposure:"event"},[K]:{exposure:"event"},[Y]:{exposure:"event"},[it]:{exposure:"event"},[rt]:{exposure:"hidden"},[nt]:{exposure:"hidden",storageGroup:"flags"},[st]:{exposure:"hidden",storageGroup:"flags"},[ot]:{exposure:"hidden"},[at]:{exposure:"hidden",storageGroup:"flags"},[lt]:{exposure:"hidden",storageGroup:"flags"},[ut]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ht]:{exposure:"hidden",storageGroup:"flags"},[dt]:{exposure:"hidden"},[vt]:{exposure:"hidden"},[ct]:{exposure:"hidden"},[ft]:{exposure:"hidden"},[gt]:{exposure:"hidden",storageGroup:"surveys"},[mt]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[yt]:{exposure:"event"},[_t]:{exposure:"hidden"},[bt]:{exposure:"hidden"},[wt]:{exposure:"hidden"},[kt]:{exposure:"hidden"},[St]:{exposure:"hidden"},[xt]:{exposure:"event"},[Ct]:{exposure:"event"},[Tt]:{exposure:"event"},[Et]:{exposure:"event"},[Mt]:{exposure:"hidden"},[It]:{exposure:"hidden"},[pt]:{exposure:"event"},[Rt]:{exposure:"hidden"},[At]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Pt]:{exposure:"hidden"},[Ot]:{exposure:"hidden"},[Ft]:{exposure:"hidden"},[$t]:{exposure:"hidden"},[Dt]:{exposure:"hidden"},[Lt]:{exposure:"hidden"},[Nt]:{exposure:"hidden"},[z]:{exposure:"event"},[W]:{exposure:"event"},[V]:{exposure:"event"},[G]:{exposure:"event"},[Bt]:{exposure:"event"},[Ut]:{exposure:"event"},[Ht]:{exposure:"event"},[zt]:{exposure:"event"},[Wt]:{exposure:"event"},[Vt]:{exposure:"event"},[Gt]:{exposure:"event"},[Zt]:{exposure:"event"},[Qt]:{exposure:"event"},[Jt]:{exposure:"event"},[Xt]:{exposure:"event"}},E_=[[X,{exposure:"hidden"}],[tt,{exposure:"hidden"}],[et,{exposure:"hidden"}]],M_=t=>{var e=T_[t];if(e)return e;for(var i of E_){var r=i[1];if(0===t.indexOf(i[0]))return r}},I_={flags:At,surveys:mt},R_=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],A_=t=>t+"_cookie_identity_change_pending",P_=t=>{var e="",i=0;for(var r of t){var n=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(i+n>1e3)break;e+=r,i+=n}return e},O_="main",F_=[nt,st,at,lt,ut,At,ht,ct],$_=t=>-1!==F_.indexOf(t),D_=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},L_=t=>{if(!t)return{};var e=JSON.parse(t);return Ee(e)?e:{}},N_=(t,e)=>{Mn(t,(i,r)=>{var n=M_(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]})},q_=class{constructor(t,e,i){if(void 0===i&&(i=!0),this.To={},this.Mo=!1,this.Io=!1,this.Eo=!1,this.Ro=!1,this.Ao=!1,this.Po=new Map,this.Fo=!1,this.Oo=!1,this.$o=!1,this.Do=!1,this.Lo=new Set,this.Rn=t,this.No=i,this.props={},this.qo=void 0,this.jo=(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"})(t),this.fo=this.Bo(t),this.Eo=this.Ho(t),this.load(),this.zo(),t.debug&&Cn.info("Persistence loaded",t.persistence,s({},this.props)),this.update_config(t,t,e),this.save(),l){var r=()=>this.flush();Ln(l,"beforeunload",r,{capture:!1}),Ln(l,"pagehide",r,{capture:!1}),this.Uo=t=>{if(this.Mo&&(!t.storageArea||t.storageArea===(null==l?void 0:l.localStorage))&&t.key)if(t.key!==this.jo){if(this.Eo){var e=C_.find(e=>t.key===this.Wo(e));e&&this.Vo(t.key,e)}}else this.Vo(t.key,O_)},Ln(l,"storage",this.Uo)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(t=>{var e=t[0],i=t[1],r=this.Po.get(e);if($_(e)&&!0!==r)if(!0!==i){var n=new Set(r||[]);i.forEach(t=>n.add(t)),n.size&&this.Go(e,n)}else this.Go(e,!0)})}onCrossTabFeatureFlagChange(t){return this.Lo.add(t),()=>this.Lo.delete(t)}destroy(){this.Uo&&l&&(l.removeEventListener("storage",this.Uo),this.Uo=void 0),this.Lo.clear()}Vo(t,e,i){if(void 0===i&&(i=!0),this.gi)return!1;var r,n;try{if(n=ga.Lt(t),Pe(n)){var s=this.Zo(e);return s.storageValue=null,e!==O_&&(s.persisted=!1),!1}r=L_(n)}catch(t){return!1}var o=e===O_?r:ga.Nt(this.jo);if(o&&this.Jo(o))return!1;var a=this.Qo(r,e,i);return e===O_&&this.Eo&&!D_(this.Ko().main,r)||this.Xo(r,e,!0,n),a}Jo(t){var e=this.props[k],i=t[k];return!Ie(e)&&!Ie(i)&&e!==i}Xo(t,e,i,r){var n=this.Zo(e);n.storageValue=r,e!==O_&&(n.persisted=i);try{n.fingerprint=this.Yo(t,e)}catch(t){n.fingerprint=void 0}}Qo(t,e,i){var r=!1;return F_.forEach(i=>{var n,s=null==(n=M_(i))?void 0:n.storageGroup;if(!(e===O_&&this.Eo&&s||e!==O_&&s!==e)){var o=i in t,a=this.ta(i,o?t[i]:void 0),l=this.Po.has(i)?i in this.props:o;l===i in this.props&&D_(a,this.props[i])||(l?this.ea(i,a,!1):this.ia(i,!1),r=!0)}}),r&&i&&this.Lo.forEach(t=>t()),r}ra(){if(!this.Mo)return!1;try{this.$o=!1;var t,e=ga.Lt(this.jo),i=this.Zo(O_),r=!1,n=!1;if(e!==i.storageValue)if(Pe(e))i.storageValue=null;else{if(t=L_(e),this.$o=!this.Oo&&this.Jo(t),this.$o)return!1;n=this.Qo(t,O_,!1),!this.Eo||D_(this.Ko().main,t)?this.Xo(t,O_,!0,e):i.storageValue=e,r=!0}return this.Eo&&C_.forEach(e=>{var i=ga.Lt(this.Wo(e)),s=this.Zo(e),o=t||{},a=r&&F_.some(t=>{var i;return(null==(i=M_(t))?void 0:i.storageGroup)===e&&t in o});if(i!==s.storageValue||a){if(Pe(i))return s.storageValue=null,s.persisted=!1,void(a&&(n=this.Qo(o,e,!1)||n));var l=L_(i);n=this.Qo(l,e,!1)||n,this.Xo(l,e,!0,i)}}),n}catch(t){return!1}}Go(t,e){this.Po.set(t,e);var i=M_(t);null!=i&&i.volatile||(this.Zo((this.Eo?null==i?void 0:i.storageGroup:void 0)||O_).fingerprint=void 0,this.na(t))}sa(){F_.forEach(t=>this.Po.set(t,!0))}zo(){if(this.Mo)try{var t=ga.Lt(this.jo),e=L_(t);this.Zo(O_).storageValue=t,F_.forEach(t=>{var i,r=this.Eo?null==(i=M_(t))?void 0:i.storageGroup:void 0,n=r?ga.Lt(this.Wo(r)):null;if(r){var s=this.Zo(r);s.storageValue=n,s.persisted=!Pe(n)}var o=r&&!Pe(n)?L_(n):e;t in this.props?this.oa(t,o[t],this.props[t]):t in o&&this.Go(t,!0)})}catch(t){}}ta(t,e){var i=this.Po.get(t);if(!i)return e;if(!0===i)return this.props[t];if("$active_feature_flags"===t){var r=new Set(Ce(e)?e:[]),n=new Set(Ce(this.props[t])?this.props[t]:[]);return i.forEach(t=>n.has(t)?r.add(t):r.delete(t)),Array.from(r)}var o=Ee(e)?s({},e):{},a=Ee(this.props[t])?this.props[t]:{};return i.forEach(t=>{t in a?o[t]=a[t]:delete o[t]}),o}oa(t,e,i){if($_(t)){var r=this.Po.get(t);if(!0!==r){var n=e;if(this.Mo)try{var s,o=this.Eo?null==(s=M_(t))?void 0:s.storageGroup:void 0,a=o?this.Wo(o):this.jo;n=L_(ga.Lt(a))[t]}catch(t){}var l=new Set(r||[]);if("$active_feature_flags"===t){if(!Ie(e)&&!Ce(e)||!Ie(n)&&!Ce(n)||!Ce(i))return void this.Go(t,!0);var u=new Set(e||[]),h=new Set(n||[]),d=new Set(i);new Set([...u,...d]).forEach(t=>{u.has(t)!==d.has(t)&&l.add(t)}),l.forEach(t=>{h.has(t)===d.has(t)&&l.delete(t)})}else{if(!Ee(i))return void(D_(n,i)?this.Po.delete(t):this.Go(t,!0));if(!Ie(e)&&!Ee(e)||Ie(e)&&Me(i)&&Ie(n))return void this.Go(t,!0);var v=Ee(e)?e:{},c=Ee(n)?n:{};new Set([...Object.keys(v),...Object.keys(i)]).forEach(t=>{t in v==t in i&&D_(v[t],i[t])||l.add(t)}),l.forEach(t=>{t in c==t in i&&D_(c[t],i[t])&&l.delete(t)})}l.size?this.Go(t,l):this.Po.delete(t)}}}aa(){var t,e=null==(t=this.Rn)?void 0:t.persistence_save_debounce_ms;return Fe(e)&&e>0?e:0}la(t){if(this.Rn.cookieWinsOnConflict&&"localstorage+cookie"===this.Rn.persistence.toLowerCase())if(t)try{var e=ka(t,this.Rn.cookie_persisted_properties||[]),i=xa(e,this.Rn.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=fa.Lt(this.jo)||void 0;n&&Ta(this.jo,n)===r&&(this.ua=r,this.ha=n)}catch(t){}else try{var s=fa.Lt(this.jo)||void 0;this.ua=s?Ta(this.jo,s):void 0,this.ha=s}catch(t){}}syncCookieProperties(){return this.da(this.Rn)}da(t,e){if(void 0===e&&(e=!1),this.gi&&!e||this.Ao||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=fa.Lt(this.jo)||void 0}catch(t){}if(!i||i===this.ha)return!1;var r,n=Ta(this.jo,i);try{r=wa(JSON.parse(i))}catch(t){return!1}if((fa.Lt(this.jo)||void 0)!==i)return!1;this.ua=n,this.ha=i;var s=Ca(this.jo,i),o=[...ya,...s.properties],a={};if(Object.keys(r).forEach(t=>{var e=r[t];(Ie(e)||Pe(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e)&&(a[t]=!0,delete r[t])}),Me(r))return!1;var l="distinct_id"in r||"anonymous"===r.$user_state||"identified"===r.$user_state,u=this.props,h=u[k],d=u[Pt],v=In({},u);[...ya,...t.cookie_persisted_properties||[]].forEach(t=>{if(-1!==o.indexOf(t)&&!(t in r)&&!a[t]&&(l||"distinct_id"!==t&&"$user_state"!==t)){var e=v[t];(s.isValid||-1===ya.indexOf(t)||!1!==e&&0!==e)&&delete v[t]}}),this.props=In(v,r),F_.forEach(t=>{var e=t in this.props;t in u===e&&D_(u[t],this.props[t])||(e?this.oa(t,u[t],this.props[t]):this.Go(t,!0))}),!l||"$user_state"in r||"$user_state"in this.props||this.ea(Pt,ee);var c=this.props[k],f=this.props[Pt];return!l||c===h&&f===d||(this.Oo=!0,this.Ro=!0,Ra.Ot(A_(this.jo),!0),this.ia(ct),this.ia(st),this.ia(nt),this.ia(at),this.ia(lt),this.ia(ut),this.ia(At),this.ia(Rt),this.ia(Mt),"anonymous"!==f||"identified"!==d&&"anonymous"!==r.$user_state&&(Ie(h)||c===h)||(N_(this.props,r),this.ia(ft)),"identified"===f?this.props.$user_id=c:delete this.props.$user_id,this.ia(C)),!0}consumeCookieIdentityChange(){var t=A_(this.jo),e=this.Ro||!!Ra.Lt(t);return this.Ro=!1,e&&Ra.Dt(t),e}va(t){return void 0===t&&(t=!1),!(this.Ao||this.gi&&!t||!this.Rn.cookieWinsOnConflict||"localstorage+cookie"!==this.Rn.persistence.toLowerCase()||(this.Ao=!0,0))}ca(){this.Ao&&(Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0),delete this.To[O_],this.pa(!0))}ga(t){if(void 0===t&&(t=!0),this.Ao)try{t?this.ca():Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0)}finally{this.Ao=!1}}isDisabled(){return!!this.gi}Bo(t){-1===R_.indexOf(t.persistence.toLowerCase())&&(Cn.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,i=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var i=[...ya,...t];return s({},ga,{Nt(t){try{var r,n={};try{r=fa.Lt(t)||void 0,n=r?wa(JSON.parse(r)):{}}catch(t){}var s,o=JSON.parse(ga.Lt(t)||"{}");if(e){var a=Ca(t,r),l=[...ya,...a.properties],u={};Object.keys(n).forEach(t=>{var e=n[t];Pe(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e||(u[t]=e)});var h="distinct_id"in u||"anonymous"===u.$user_state||"identified"===u.$user_state;if(Object.keys(u).length>0){var d,v=o[k],c=null!==(d=o.$user_state)&&void 0!==d?d:"anonymous";i.forEach(t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||"distinct_id"!==t&&"$user_state"!==t)){var e=o[t];(a.isValid||-1===ya.indexOf(t)||!1!==e&&0!==e)&&delete o[t]}}),!h||"$user_state"in n||"$user_state"in o||(o[Pt]=ee),!h||("distinct_id"in u?u[k]:o[k])===v&&("$user_state"in u?u[Pt]:o[Pt])===c||(ma.forEach(t=>delete o[t]),"identified"===u.$user_state&&"distinct_id"in u?o.$user_id=u[k]:delete o.$user_id,"identified"!==u.$user_state&&(delete o[pt],delete o[ft]),delete o.__alias)}s=In(o,u)}else s=In(n,o);return ga.Ot(t,s),s}catch(t){}return null},Ot(i,r,n,s,o,a){var l=ga.Ot(i,r,void 0,void 0,a);try{var u=ka(r,t);if(Object.keys(u).length){if(e){var h=_a(i),d=xa(u,t);if(fa.Ot(h,d,n,s,o,a),fa.Lt(h)!==JSON.stringify(d)){fa.Dt(h,s);var v=ka(r);return fa.Ot(i,v,n,s,o,a),l}}fa.Ot(i,u,n,s,o,a)}}catch(t){ga.Pt(t)}return l},Dt(t,e){try{null==l||l.localStorage.removeItem(t),fa.Dt(t,e),fa.Dt(_a(t),e)}catch(t){ga.Pt(t)}}})}(t.cookie_persisted_properties||[],t.cookieWinsOnConflict),r=!1,n=!1,o=t.persistence.toLowerCase();return"localstorage"===o&&ga.Et()?(e=ga,n=!0):"localstorage+cookie"===o&&i.Et()?(e=i,n=!0,r=!0):"sessionstorage"===o&&Ra.Et()?e=Ra:"memory"===o?e=Ma:"cookie"===o&&fa.Et()?(e=fa,r=!0):i.Et()?(e=i,n=!0,r=!0):fa.Et()?(e=fa,r=!0):e=Ma,this.Mo=n,this.Io=r,e}Wo(t){return this.jo+"__"+t}Ho(t){return this.Mo&&!!t.split_storage}properties(){var t={};return Mn(this.props,(e,i)=>{var r=M_(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.gi||t){var e=this.Rn.cookieWinsOnConflict&&"localstorage+cookie"===this.Rn.persistence.toLowerCase(),i=e?ga.Nt(this.jo):null,r={};if(e)try{Mn(r=wa(fa.Nt(this.jo)),(t,e)=>{(Ie(t)||Pe(t)||""===t)&&delete r[e]})}catch(t){}var n=this.fo.Nt(this.jo);if(n&&(this.props=In({},n)),this.Eo&&this.ma(),e&&n){var s,o,a=null==i?void 0:i[k],l=null!==(s=null==i?void 0:i.$user_state)&&void 0!==s?s:"anonymous",u=n[k],h=null!==(o=n.$user_state)&&void 0!==o?o:"anonymous";if(u!==a||h!==l){this.Ro=!0,Ra.Ot(A_(this.jo),!0);var d=In({},this.props);ma.forEach(t=>delete d[t]),"anonymous"!==h||"identified"!==l&&"anonymous"!==r.$user_state&&(Ie(a)||u===a)||(N_(d,r),delete d[ft]),this.props=d;var v=new Set;ma.forEach(t=>{var e,i=null==(e=M_(t))?void 0:e.storageGroup;i&&v.add(i)}),v.forEach(t=>{var e={};Mn(this.props,(i,r)=>{var n;(null==(n=M_(r))?void 0:n.storageGroup)===t&&(e[r]=i)}),Me(e)?(ga.Dt(this.Wo(t)),this.To[t]={}):ga.Ot(this.Wo(t),e)&&(this.To[t]={persisted:!0,fingerprint:this.Yo(e,t)})})}}Ra.Lt(A_(this.jo))&&(this.Ro=!0)}}ma(){for(var t of C_){var e=ga.Nt(this.Wo(t));if(e&&!Me(e)){var i=this.Zo(t);i.persisted=!0,this.ya(t)||(i.fingerprint=this.Yo(e,t)),this.ba(t,e)||In(this.props,e)}}}ya(t){return Object.keys(this.props).some(e=>{var i;return(null==(i=M_(e))?void 0:i.storageGroup)===t})}ba(t,e){var i=I_[t];if(!i)return!1;var r=e[i],n=this.props[i];return Fe(r)&&Fe(n)&&n>r}refreshKey(t){var e;if(!(this.gi||"$fbc_persistence"===t&&this.Do)){var i=this.Eo?null==(e=M_(t))?void 0:e.storageGroup:void 0,r=i?ga.Nt(this.Wo(i)):this.fo.Nt(this.jo);if(r&&t in r)this.ea(t,r[t],!1);else{if(i){var n=this.fo.Nt(this.jo);if(n&&t in n)return void this.ea(t,n[t],!1)}this.ia(t,!1)}}}save(){if(!this.gi){var t=this.aa();t>0?Ie(this.fa)&&(this.fa=setTimeout(()=>{this.fa=void 0,this.pa()},t)):this.pa()}}flush(){Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0,this.pa())}pa(t){if(void 0===t&&(t=!1),!(this.gi||this.Ao&&!t)){t||(this.syncCookieProperties(),this.Do||this.Rn.cookieWinsOnConflict&&"localstorage+cookie"===this.Rn.persistence.toLowerCase()||this.refreshKey(M));var e=!t&&!this.Fo;e||(this.$o=!1);var i=!!e&&this.ra();if(this.$o)this.Rn.debug&&Cn.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.Eo)return this._a(),void(i&&this.Lo.forEach(t=>t()));var r=this.wa(this.fo,this.jo,this.props,O_);"written"===r&&this.la(this.props),"failed"!==r&&(this.Po.clear(),this.Oo=!1,this.Do=!1),i&&this.Lo.forEach(t=>t())}}}_a(){var t=this,e=this.Ko(),i=e.main,r=e.groups,n=this.wa(this.fo,this.jo,i,O_);"written"===n&&this.la(i),"failed"!==n&&(this.Oo=!1,this.Do=!1,F_.forEach(t=>{var e;null!=(e=M_(t))&&e.storageGroup||this.Po.delete(t)}));var s=function(e){var i,n=r[e];if(Me(n)&&(null==(i=t.To[e])||!i.persisted))return F_.forEach(i=>{var r;(null==(r=M_(i))?void 0:r.storageGroup)===e&&t.Po.delete(i)}),1;var s=t.wa(ga,t.Wo(e),n,e);"failed"!==s&&F_.forEach(i=>{var r=M_(i);(null==r?void 0:r.storageGroup)!==e||"written"!==s&&r.volatile||t.Po.delete(i)})};for(var o of C_)if(s(o))continue}Ko(){var t={},e={flags:{},surveys:{}};return Mn(this.props,(i,r)=>{var n,s=null==(n=M_(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i}),{main:t,groups:e}}Yo(t,e){if(e===O_)return JSON.stringify(t)+"|"+this.ka+"|"+this.Sa+"|"+this.xa;var i={};return Mn(t,(t,e)=>{var r;i[e]=null!=(r=M_(e))&&r.volatile?"__volatile__":t}),JSON.stringify(i)}wa(t,e,i,r){var n,s=this.Zo(r);if(r!==O_&&!s.dirty&&!Ie(s.fingerprint))return"skipped";try{if((n=this.Yo(i,r))===s.fingerprint)return s.dirty=!1,"skipped"}catch(t){n=void 0}return t.Ot(e,i,this.ka,this.Sa,this.xa,this.Rn.debug)?(s.dirty=!1,r!==O_&&(s.persisted=!0),Ie(n)||(s.fingerprint=n),this.Mo&&(s.storageValue=ga.Lt(e)),"written"):(this.Rn.debug&&Cn.warn('failed to persist storage entry "'+e+'"; will retry on next save'),"failed")}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(this.sa(),Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0),this.fo.Dt(this.jo,!1),this.fo.Dt(this.jo,!0),!i&&this.No)for(var r of C_)ga.Dt(this.Wo(r));i?delete this.To[O_]:this.To={},this.ua=void 0,this.ha=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Ee(t)){this.syncCookieProperties(),Ie(e)&&(e="None"),this.ka=Ie(i)?this.Ca:i;var r=!1;if(Mn(t,(t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.ea(i,t),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(Ee(t)){this.syncCookieProperties(),this.ka=Ie(e)?this.Ca:e;var i=!1;if(Mn(t,(e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||Ee(e)||Ce(e))&&(this.ea(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.ia(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==d?void 0:d.URL;if(t!==this.qo){var e=al(this.Rn.custom_campaign_params,this.Rn.mask_personal_data_properties,this.Rn.custom_personal_data_properties),i=!Me(On(e));return i&&this.register(e),this.qo=t,i?e:void 0}}update_search_keyword(){var t;this.register((t=null==d?void 0:d.referrer)?ul(t):{})}update_referrer_info(){var t;this.register_once({$referrer:vl(),$referring_domain:null!=d&&d.referrer&&(null==(t=Bn(d.referrer))?void 0:t.host)||dl},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=cl(this.Rn.mask_personal_data_properties,this.Rn.custom_personal_data_properties,this.Rn.disable_capture_url_hashes);this.register_once({[Lt]:this.Io?{r:P_(t.r),u:t.u?P_(t.u):void 0}:t},void 0)}}get_initial_props(){var t={};Mn([Dt,$t],e=>{var i=this.props[e];i&&Mn(i,function(e,i){t["$initial_"+fe(i)]=e})});var e=this.props[Lt];return e&&In(t,function(t,e){void 0===e&&(e=!1);var i=fl(t,e),r={};return Mn(i,function(t,e){r["$initial_"+fe(e)]=t}),r}(e,this.Rn.disable_capture_url_hashes)),t}safe_merge(t){return Mn(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||[]),o=r||n,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!i,u=!!this.gi&&!l;l||this.da(e,u),this.Rn=t,!l&&(r||n||a)&&(this.ua=void 0,this.ha=void 0,this.da(s({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),u));var h=o||a?this.Bo(t):this.fo;this.Ta();var d=this.Ho(t),v=o||d!==this.Eo,c=!l&&(v||t.cross_subdomain_cookie!==this.Sa||t.secure_cookie!==this.xa)&&this.va(u);this.Fo=v;try{if(this.Ca=this.ka=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),v){var f=this.props;this.clear(),this.fo=h,this.Eo=d,this.props=f,this.save()}else a&&(this.fo=h,l||(delete this.To[O_],this.pa()))}finally{this.Fo=!1,c&&this.ga()}}Ta(){var t=this.props[Lt];if(this.Io&&Ee(t)&&"string"==typeof t.r){var e=P_(t.r),i="string"==typeof t.u?P_(t.u):t.u;e===t.r&&i===t.u||this.ea(Lt,s({},t,{r:e,u:i}))}}set_disabled(t){this.gi=t,this.gi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Sa&&(this.Sa=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.xa&&(this.xa=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props.__timers||{};i[t]=e,this.ea(I,i),this.save()}remove_event_timer(t){var e=this.props.__timers||{},i=e[t];return Ie(i)||(delete e[t],this.ea(I,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.ea(t,e),this.save()}ea(t,e,i){var r;void 0===i&&(i=!0);var n=this.props[t];this.props[t]=e,i&&("distinct_id"!==t&&"$user_state"!==t||n===e||(this.Oo=!0),"$fbc_persistence"!==t||D_(n,e)||(this.Do=!0),this.oa(t,n,e),null!=(r=M_(t))&&r.volatile||this.na(t))}ia(t,e){void 0===e&&(e=!0),delete this.props[t],e&&($_(t)&&this.Go(t,!0),"$fbc_persistence"===t&&(this.Do=!0),this.na(t))}na(t){var e,i=null==(e=M_(t))?void 0:e.storageGroup;i&&(this.Zo(i).dirty=!0)}Zo(t){return this.To[t]||(this.To[t]={})}},j_={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},B_={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},U_={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},H_=Tn("[RateLimiter]"),z_=class{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=>{H_.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4})}catch(t){return void H_.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,o=(new Date).getTime(),a=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property("$capture_rate_limit"))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;if(l||t||(a.tokens=Math.max(0,a.tokens-1)),l&&!t){var u=(Fe(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.Ma(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(Ft,a),{isRateLimited:l,remainingTokens:a.tokens}}Ia(t){var e=this.instance.config.property_denylist;return!Ce(e)||!e.includes(t)}Ea(){var t;if(this.Ia("$current_url")&&this.Ia("$pathname")&&null!=v&&v.pathname)return""+(null!==(t=v.origin)&&void 0!==t?t:"")+v.pathname}Ma(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.Ea(),o=this.Ia("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,a=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". 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}},W_=Tn("[RemoteConfig]"),V_=class{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=b._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Ra(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>t(this.remoteConfig)):t()}Aa(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 W_.info("Using preloaded remote config",this.remoteConfig),void this.Pa(this.remoteConfig);if(this._instance.Fa())return void W_.warn("Remote config is disabled. Falling back to local config.");this.Ra(t=>{if(!t)return W_.info("No config found after loading remote JS config. Falling back to JSON."),void this.Aa(t=>{this.Pa(t.json,t)});this.Pa(t)})}catch(t){W_.error("Error loading remote config",t),this.Pa()}}Pa(t,e){!t&&e&&(0===e.statusCode?e.error||W_.warn("Failed to fetch remote config from PostHog."):W_.error("Failed to fetch remote config from PostHog."));try{this._instance.Pa(t?{ok:!0,config:t}:{ok:!1})}catch(t){W_.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){W_.error("Error loading feature flags",t)}}},G_=["fatal","error","warning","log","info","debug"],Z_=!!f||!!c,Q_="text/plain",J_=!1,K_=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],o=n[1];if(!o)return t;var a=o.split("&").filter(t=>t.split("=")[0]!==e).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")},Y_=function(t,e,i){var r;void 0===i&&(i=!0);var n=t.split("?"),o=n[0],a=n[1],l=s({},e),u=null!==(r=null==a?void 0:a.split("&").map(t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=l[n])&&void 0!==e?e:r[1];return delete l[n],n+"="+s}))&&void 0!==r?r:[],h=Un(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},X_=t=>{if(t.Oa)return t.Oa;var e=t.data,i=t.compression;if(e){if(i===Lf.GZipJS){var r=Xo(ta(jn(e)),{mtime:0});return{contentType:Q_,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Lf.Base64){var n=(t=>"data="+encodeURIComponent("string"==typeof t?t:jn(t)))(function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(t,e)=>String.fromCharCode(parseInt(e,16)))):t}(jn(e)));return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var s=jn(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},tb=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:Y_(t.url,{compression:Lf.Base64}),encodedBody:X_(s({},t,{compression:Lf.Base64,Oa:void 0}))}:{url:K_(t.url,"compression"),encodedBody:X_(s({},t,{compression:void 0,Oa:void 0}))};try{e=X_(t)}catch(e){if(Qr(t.compression,Hn(t.url,"compression")))return Cn.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&Qr(t.compression,Hn(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?Zr(new Uint8Array(i)):ArrayBuffer.isView(i)&&Zr(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(J_=!0,r()):{url:t.url,encodedBody:e}},eb=t=>{try{return tb(t)}catch(e){return Cn.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},ib=function(){var t=a(function*(t){var e=yield tn(jn(t.data),Aa.DEBUG,{rethrow:!0});if(!e)return t;var i=yield e.arrayBuffer();return s({},t,{Oa:{contentType:Q_,body:i,estimatedSize:i.byteLength}})});return function(e){return t.apply(this,arguments)}}(),rb=/Failed to fetch|NetworkError|Load failed/i,nb=t=>"TypeError"===(null==t?void 0:t.name)&&rb.test((null==t?void 0:t.message)||""),sb=t=>{var e=eb(t);if(e){var i=new f,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,o=n.body;Mn(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)}},ob=t=>{var e=eb(t);if(e){var i=e.url,r=e.encodedBody,n=null!=r?r:{},o=n.contentType,a=n.body,l=n.estimatedSize,u=new Headers;Mn(t.headers,function(t,e){u.append(e,t)}),o&&u.append("Content-Type",o);var h=null,d=!1;if(p){var v=new p;h={signal:v.signal,timeout:setTimeout(()=>{var e;d=!0,v.abort(ar("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))},t.timeout)}}var f=e=>{d&&"AbortError"===(null==e?void 0:e.name)||nb(e)?Cn.warn(e):Cn.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var g;c(i,s({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.$a&&52428.8>(l||0),body:a,signal:null==(g=h)?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){Cn.error(t)}null==t.callback||t.callback(r)})).catch(f).finally(()=>h?clearTimeout(h.timeout):null)}catch(t){h&&clearTimeout(h.timeout),f(t)}}},ab=t=>{try{var e,i=tb(t),r=i.url,n=i.encodedBody,o=null!=n?n:{},a=o.body,l=o.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(h.sendBeacon(r,u))return;var d=Ce(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(Ce(d)&&d.length>1&&(null!=l?l:0)>16384){var v=Math.ceil(d.length/2),f=e=>Ce(t.data)?e:s({},t.data,{batch:e});return ab(s({},t,{data:f(d.slice(0,v))})),void ab(s({},t,{data:f(d.slice(v))}))}Cn.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to "+(c?"fetch":"XHR")),c?ob(s({},t,{$a:!0})):sb(t)}catch(t){Cn.warn("Beacon send failed",t)}},lb=(t,e,i,r)=>{var n="query"===r?"POST"===e?"sent_at":"_":void 0;return Y_(i===Lf.GZipJS?K_(t,"compression"):t,s({},n?{[n]:Date.now().toString()}:{},i===Lf.GZipJS?{}:{compression:i}))},ub=[];c&&ub.push({transport:"fetch",method:ob}),f&&ub.push({transport:"XHR",method:sb}),null!=h&&h.sendBeacon&&ub.push({transport:"sendBeacon",method:ab});var hb=class{constructor(t,e){this.Da=!0,this.La=[],this.Na=Ze((null==e?void 0:e.flush_interval_ms)||3e3,250,5e3,Cn.createLogger("flush interval"),3e3),this.qa=t}enqueue(t){this.La.push(t),this.ja||this.Ba()}unload(){this.Ha();var t=this.La.length>0?this.za():{},e=Object.values(t);[...e.filter(t=>0===t.url.indexOf("/e")),...e.filter(t=>0!==t.url.indexOf("/e"))].map(t=>{this.Ua(s({},t,{transport:"sendBeacon"}))})}enable(){this.Da=!1,this.Ba()}Ba(){var t=this;this.Da||(this.ja=setTimeout(()=>{if(this.Ha(),this.La.length>0){var e=this.za(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&Ce(i.data)&&Mn(i.data,t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp}),t.Ua(i)};for(var r in e)i()}},this.Na))}Ua(t){try{this.qa(t)}catch(t){Cn.error(t)}}Ha(){clearTimeout(this.ja),this.ja=void 0}za(){var t={};return Mn(this.La,e=>{var i,r=e,n=(r?r.batchKey:null)||r.url;Ie(t[n])&&(t[n]=s({},r,{data:[]})),null==(i=t[n].data)||i.push(r.data)}),this.La=[],t}},db=class{constructor(t){this._instance=t,this.Wa=!1,this.Va=3e3,this.La=[],this.La=[],this.Ga=!0,this.resume()}resume(){if(!Ie(l)&&"onLine"in l.navigator){if(this.Ga=l.navigator.onLine,this.Za)return;this.Za=()=>{this.Ga=!0,this.Ja()},this.Qa=()=>{this.Ga=!1},Ln(l,"online",this.Za),Ln(l,"offline",this.Qa)}}get length(){return this.La.length}retriableRequest(t){var e=t.retriesPerformedSoFar,r=n(t,i);$e(e)&&(r.url=Y_(r.url,{retry_count:e})),this._instance._send_request(s({},r,{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.ws(s({retriesPerformedSoFar:e},r));0===t.statusCode&&Cn.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==r.callback||r.callback(t)}}))}ws(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)*(r-i);return Math.ceil(r+n)}(e),r=Date.now()+i;this.La.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),Cn.warn(n),this.Wa||(this.Wa=!0,this.Ka())}Ka(){if(this.Xa&&clearTimeout(this.Xa),0===this.La.length)return this.Wa=!1,void(this.Xa=void 0);this.Xa=setTimeout(()=>{this.Ga&&this.La.length>0&&this.Ja(),this.Ka()},this.Va)}Ja(){var t=Date.now(),e=[],i=this.La.filter(i=>t>i.retryAt||(e.push(i),!1));if(this.La=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var t of(this.Xa&&(clearTimeout(this.Xa),this.Xa=void 0),this.Wa=!1,Ie(l)||(this.Za&&(l.removeEventListener("online",this.Za),this.Za=void 0),this.Qa&&(l.removeEventListener("offline",this.Qa),this.Qa=void 0)),this.La)){var e=t.requestOptions;try{this._instance._send_request(s({},e,{transport:"sendBeacon"}))}catch(t){Cn.error(t)}}this.La=[]}},vb=class{constructor(t){this._instance=t,this.Ya=()=>{var t,e,i,r;this.tl||(this.tl={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.tl.lastScrollY=Math.ceil(s),this.tl.maxScrollY=Math.max(s,null!==(t=this.tl.maxScrollY)&&void 0!==t?t:0),this.tl.maxScrollHeight=Math.max(o,null!==(e=this.tl.maxScrollHeight)&&void 0!==e?e:0),this.tl.lastContentY=a,this.tl.maxContentY=Math.max(a,null!==(i=this.tl.maxContentY)&&void 0!==i?i:0),this.tl.maxContentHeight=Math.max(l,null!==(r=this.tl.maxContentHeight)&&void 0!==r?r:0)}}get el(){return this._instance.config.scroll_root_selector}getContext(){return this.tl}resetContext(){var t=this.tl;return setTimeout(this.Ya,0),t}startMeasuringScrollPosition(){Ln(l,"scroll",this.Ya,{capture:!0}),Ln(l,"scrollend",this.Ya,{capture:!0}),Ln(l,"resize",this.Ya)}scrollElement(){var t;if(!this.el)return null==l||null==(t=l.document)?void 0:t.documentElement;for(var e of Ce(this.el)?this.el:[this.el]){var i,r=null==l||null==(i=l.document)?void 0:i.querySelector(e);if(r)return r}}il(t){var e,i,r="y"===t?"scrollTop":"scrollLeft";if(this.el){var n=this.scrollElement();return n&&n[r]||0}return l?"y"===t?l.scrollY||l.pageYOffset||(null==(e=l.document)||null==(e=e.documentElement)?void 0:e.scrollTop)||0:l.scrollX||l.pageXOffset||(null==(i=l.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.il("y")}scrollX(){return this.il("x")}},cb=t=>cl(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),fb=class{constructor(t,e,i,r){this.Be=t=>{var e=this.rl();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.nl(this._instance)};this.sl.register({[Ot]:i})}},this._instance=t,this.ol=e,this.sl=i,this.nl=r||cb,this.ol.onSessionId(this.Be)}rl(){return this.sl.props[Ot]}getSetOnceProps(){var t,e=null==(t=this.rl())?void 0:t.props;return e?"r"in e?fl(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 Mn(On(this.getSetOnceProps()),(e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+fe(i)]=e}),t}},pb=class{on(t,e){return this.al[t]||(this.al[t]=[]),this.al[t].push(e),()=>{this.al[t]=this.al[t].filter(t=>t!==e)}}emit(t,e){for(var i of this.al[t]||[])i(e);for(var r of this.al["*"]||[])r(t,e)}constructor(){this.al={}}},gb=Tn("[SessionId]"),mb=864e5,yb=class{on(t,e){return this.ll.on(t,e)}constructor(t,e,i){var r;if(this.ul=null,this.hl=null,this.dl=[],this.vl=void 0,this.cl=!1,this.ll=new pb,this.fl=(t,e)=>!(!$e(t)||!$e(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Rn=t.config,this.sl=t.persistence,this.He=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.pl=void 0,this._sessionActivityTimestamp=null,this.gl=e||ua,this.ml=i||ua;var n=this.Rn.persistence_name||this.Rn.token;if(this._sessionTimeoutMs=1e3*Ze(this.Rn.session_idle_timeout_seconds||1800,60,36e3,gb.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.yl(),this.bl="ph_"+n+"_window_id",this._l="ph_"+n+"_primary_window_exists",this.wl()){var s=Ra.Nt(this.bl),o=Ra.Nt(this._l);s&&!o?this.He=s:Ra.Dt(this.bl),Ra.Ot(this._l,!0)}null!=(r=this.Rn.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.Rn.bootstrap.sessionID),this.kl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Ie(this.dl)&&(this.dl=[]),this.dl.push(t),this.Xt&&t(this.Xt,this.He),()=>{this.dl=this.dl.filter(e=>e!==t)}}wl(){return"memory"!==this.Rn.persistence&&!this.sl.gi&&Ra.Et()}Sl(t){t!==this.He&&(this.He=t,this.wl()&&Ra.Ot(this.bl,t))}xl(){return this.He?this.He:this.wl()?Ra.Nt(this.bl):null}Cl(t){var e=this.ul;return!Pe(e)&&!Pe(t)&&5e3>Math.abs(t-e)}Tl(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this.Xt||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Xt=t,n&&!r||n&&this.Cl(e)||(this.ul=e,this.sl.register({[Z]:[e,t,i]}))}Ml(){var t,e=null==(t=this.Rn)?void 0:t.persistence_save_debounce_ms;return $e(e)&&e>0}Il(){this.Ml()?this.sl.refreshKey(Z):(this.sl.flush(),this.sl.load())}El(){var t;if(!Pe(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.ul){this.Il();var e=this.Rl();e[1]===this.Xt&&e[2]===this._sessionStartTimestamp&&(this.ul=this._sessionActivityTimestamp,this.sl.register({[Z]:[this._sessionActivityTimestamp,null!==(t=this.Xt)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.sl.flush())}}Al(){var t=this.Rl()[0],e=$e(t)?t:0,i=$e(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}Pl(t){return this.Il(),this.fl(t,this.Al())}Rl(){var t=this.sl.props[Z];return Ce(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.ul=null,this.pl=void 0,clearTimeout(this.Fl),this.Fl=void 0,this.Tl(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 gb.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void gb.error("Invalid sessionID in bootstrap",t)}}(t);return!Ie(i)&&(e?this.pl={sessionId:t,sessionStartTimestamp:i}:this.Tl(t,(new Date).getTime(),i),!0)}destroy(){this.cl=!0,this.El(),clearTimeout(this.Fl),this.Fl=void 0,this.vl&&l&&(l.removeEventListener(se,this.vl,{capture:!1}),this.vl=void 0),this.dl=[]}kl(){this.vl=()=>{this.El(),this.wl()&&Ra.Dt(this._l)},Ln(l,se,this.vl,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),"always"===this.Rn.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this.Xt;if(i)this.hl=r;else if(Pe(this.hl)||this.hl>r||r-this.hl>=1e3){var s,o;null==(s=(o=this.sl).syncCookieProperties)||s.call(o),this.hl=r}var a=this.Rl(),l=a[1],u=a[2],h=!Ie(n)&&l!==n,d=this.Al(),v=this.xl(),c=this.pl,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>mb),p=c?f:$e(u)&&Math.abs(r-u)>mb,g=!1,m=h,y=!l||!!c,_=l,b=!y&&!t&&this.fl(r,d);if(b){(b=this.Pl(r))||gb.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.Rl();l=w[1],u=w[2]}if(y||b||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.gl(),v=this.ml(),gb.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:b,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.pl=void 0,g=!0}else v||(v=this.ml(),g=!0),(m=m||l!==_)&&(gb.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=$e(d)&&t&&!p?d:r,x=$e(u)?u:(new Date).getTime();this.Sl(v),this.Tl(l,S,x),t||this.yl();var C={noSessionId:y,activityTimeout:b,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.dl.forEach(t=>t(l,v,C)),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}yl(){this.cl||(clearTimeout(this.Fl),this.Fl=setTimeout(()=>{if(!this.cl)if(this.Pl((new Date).getTime())){var t=this.Xt;this.resetSessionId(),this.ll.emit("forcedIdleReset",{idleSessionId:t})}else this.yl()},1.1*this.sessionTimeoutMs))}},_b=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&de(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some(t=>de(null==t?void 0:t.brand,e)))return!0}catch(t){}return!!t.webdriver};function bb(){return bb=a(function*(){var t=null==h?void 0:h.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e,i=null==(e=yield t.getHighEntropyValues(["model"]))?void 0:e.model;return Re(i)&&i.length>0?i:void 0}catch(t){return void Cn.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}}),bb.apply(this,arguments)}var wb="custom",kb="i.posthog.com",Sb=/^\/static\//,xb=["/s/","/e/","/i/"],Cb=class{constructor(t){this.Ol={},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("."+kb,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Ol[this.apiHost]||(this.Ol[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":wb),this.Ol[this.apiHost]}$l(t){if(Sb.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}Dl(t){var e=Bn(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Ll(t,e,i){if("ui"===t)return i;var r=i,n=this.instance.config.rewriteRequestPath;if(n){var s,o=(null==(s=Bn(i))?void 0:s.href)||i;r=n(new URL(o)).toString()}if(n&&"api"===t&&xb.some(t=>0===e.indexOf(t))){var a=this.Dl(r);if(a){var l,u=this.apiHost,h=this.Nl;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(this.Nl=h={apiHost:u,rewriteRequestPath:n,urls:new Set}),h.urls.add(a)}}return r}isIngestionEndpoint(t){var e=this.Nl,i=this.Dl(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.Ll(t,e,this.uiHost+e);if("flags"===t)return this.Ll(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.$l(e);if(i)return this.Ll(t,e,""+i+e)}if(this.region===wb)return this.Ll(t,e,this.apiHost+e);var r=kb+e;switch(t){case"assets":return this.Ll(t,e,"https://"+this.region+"-assets."+r);case"api":return this.Ll(t,e,"https://"+this.region+"."+r)}}},Tb=Tn("[PostHog ExternalIntegrations]"),Eb={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Mb=class{constructor(t){this._instance=t}bo(t,e){var i;null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,t=>{if(t)return Tb.error("failed to load script",t);e()})}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],o=i[1];!o||null!=(e=b.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.bo(Eb[s],()=>{var e;null==(e=b.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)}),!o&&null!=(r=b.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[s]&&(null==(n=b.__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()}}},Ib=class{constructor(t,e){this.A=t,this.Js=e,this.ql=new Map,this.ro=!1}add(t){var e=this;return a(function*(){if(e.ro)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.ql.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.ql.set(t.name,t);try{var i=t.setup(e.Js);i&&(yield i)}catch(i){var r=e.ql.get(t.name)===t;r&&e.ql.delete(t.name),e.A.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.jl(t)}})()}getExtension(t){return this.ql.get(t)}dispose(){if(!this.ro){this.ro=!0;var t=Array.from(this.ql.values()).reverse();for(var e of(this.ql.clear(),t))this.jl(e)}}jl(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Te(e.then)&&e.then(void 0,e=>{this.A.error('Failed to dispose browser extension "'+t.name+'"',e)})}catch(e){this.A.error('Failed to dispose browser extension "'+t.name+'"',e)}}},Rb=class{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);Ie(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)}},Ab="extensionsRemoteConfig",Pb=class{constructor(t){this.instance=t,this.ro=!1,this.A=Cn,this.Bl=t.Hl,this.kv=new Rb(t),this.onEvent=t=>Qf(this.instance.on("eventCaptured",e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.A.error("Browser extension event listener failed",t)}})),this.onRemoteConfig=t=>{if(this.ro)return Qf(()=>{});var e=e=>{try{t(e)}catch(t){this.A.error("Browser extension remote config listener failed",t)}},i=this.instance.zl.on(Ab,e);return this.Bl&&e(this.Bl),Qf(i)},this.Ul=new Ib(Cn.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property("$device_id"))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(S);return"string"==typeof t?t:void 0}get library(){return{name:Aa.LIB_NAME,version:Aa.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.Ul.add(t)}getExtension(t){return this.Ul.getExtension(t)}capture(t,e,i){var r=this;return a(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 Qf(this.instance.Wl(t))}handleRemoteConfig(t){this.ro||(this.Bl=t,this.instance.zl.emit(Ab,t))}sendRequest(t,e){var i=this;return a(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?Y_(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?me.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.ro||(this.ro=!0,this.Ul.dispose())}},Ob={},Fb=0,$b=()=>{},Db='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Lb="Surveys module not available",Nb="sanitize_properties is deprecated. Use before_send instead",qb="Invalid value for property_denylist config: ",jb=/^[A-Za-z0-9_-]{1,400}$/,Bb=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,Ub=["token","distinct_id",jt],Hb="posthog",zb=!Z_&&-1===(null==m?void 0:m.indexOf("MSIE"))&&-1===(null==m?void 0:m.indexOf("Mozilla")),Wb=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},Vb=t=>{var e;return s({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Dn(null==d?void 0:d.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:$b,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:v&&Re(null==v?void 0:v.search)&&-1!==v.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,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==l||null==(e=l.location)?void 0:e.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){Cn.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:re,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:$b},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:cs,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:Wb(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)}))(t))},Gb=[["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"]],Zb=t=>{var e={};for(var i of Gb){var r=i[0],n=i[1];Ie(t[r])||(e[n]=t[r])}var s=In({},e,t),o=t.__preview_external_dependency_versioned_paths;return Ie(o)||(Ie(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),Re(o)&&Ie(t.asset_host)&&(s.asset_host=o)),Ce(t.property_blacklist)&&(Ie(t.property_denylist)?s.property_denylist=t.property_blacklist:Ce(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:Cn.error(qb+t.property_denylist)),s},Qb=class{constructor(){this.__forceAllowLocalhost=!1}get Vl(){return this.__forceAllowLocalhost}set Vl(t){Cn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},Jb=(t=class t{Gl(t){if(t){var e=this.ql.indexOf(t);-1!==e&&this.ql.splice(e,1)}}Zl(t,e){return this.Gl(t),this.ql.push(e),null==e.initialize||e.initialize(),e}Jl(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}Ql(){if(!(this.Kl||this.config.reuseAnonymousId||this.config.segment||this.Jl())){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.Xl||(r?(t="persistence is set to '"+this.config.persistence+"'",e="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(t="persistence is disabled (disable_persistence is true)",e="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.Kl=!0,console.warn("[PostHog.js]",t+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+e+", so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. "+i)))}}Yl(){if(!this.Jl()&&"$posthog_cookieless"===this.get_distinct_id()){var t=this.persistence;if(t){this.tu()||t.load(!0);var e=this.get_distinct_id();if(!e||"$posthog_cookieless"===e){var i=this.config.get_device_id(ua());this.register({distinct_id:i,$device_id:i}),t.set_property(Pt,ee)}this.eu()}}}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 e;this.iu=!1,this.ru=!1,this.webPerformance=new Qb,this.nu=!1,this.version=Aa.LIB_VERSION,this.su=new Set,this.ou="",this.zl=new pb,this.ql=[],this.au=[],this.Xl=!1,this.Kl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Vb(),this.SentryIntegration=S_,this.sentryIntegration=t=>function(t,e){var i=k_(t,e);return{name:w_,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.lu=!1,this.uu=null,this.hu=null,this.du=null,this.scrollManager=new vb(this),this.pageViewManager=new x_(this),this.rateLimiter=new z_(this),this.requestRouter=new Cb(this),this.consent=new f_(this),this.externalIntegrations=new Mb(this);var i=null!==(e=t.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:(t,e,i)=>{var r=Re(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Re(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",t=>Cn.info('send "'+(null==t?void 0:t.event)+'"',t))}init(e,i,r){if(r&&r!==Hb){var n,s=null!==(n=Ob[r])&&void 0!==n?n:new t;return s._init(e,i,r),Ob[r]=s,Ob[Hb][r]=s,s}return this._init(e,i,r)}_init(t,e,i){var r,n,o;void 0===e&&(e={});var a,u=Re(t)?t.trim():"";if(!u)return Cn.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 u!==(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('"+u+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=Vb(e.defaults),e.debug=this.vu(e.debug),this.cu=e,this.fu=[],e.person_profiles?this.hu=e.person_profiles:e.process_person&&(this.hu=e.process_person);var h=Vb(e.defaults),d=Zb(e),v=In({},h,d,{name:i,token:u});Ee(h.rageclick)&&Ee(d.rageclick)&&(v.rageclick=In({},h.rageclick,d.rageclick)),Ee(h.session_recording)&&Ee(d.session_recording)&&(v.session_recording=In({},h.session_recording,d.session_recording)),this.set_config(v),this.config.on_xhr_error&&Cn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Lf.GZipJS;var c=this.tu();if(this.persistence=new q_(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new q_(s({},this.config,{persistence:"sessionStorage"}),c,!1),this.ou="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&Ra.Et()){var f=Ra.Nt(this.ou);Ce(f)&&f.forEach(t=>{Re(t)&&this.su.add(t)})}else Ra.Dt(this.ou);var p=s({},this.persistence.props),g=s({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.pu=new hb(t=>this.gu(t),this.config.request_queue_config),this.mu=new db(this),this.__request_queue=[];var m=this.Jl();m||(this.sessionManager=new yb(this),this.sessionPropsManager=new fb(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.yu()})),this.bu(),this.config.__preview_deferred_init_extensions?(Cn.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this._u(m)},0)):(Cn.info("Initializing extensions synchronously"),this._u(m)),Aa.DEBUG=Aa.DEBUG||this.config.debug,Aa.DEBUG&&Cn.info("Starting in debug mode",{this:this,config:e,thisC:s({},this.config),p:p,s:g}),!this.config.identity_distinct_id||null!=(r=e.bootstrap)&&r.distinctID||(e.bootstrap=s({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var y=null==(n=e.bootstrap)?void 0:n.distinctID;if(this.Xl=!!y&&!Ae(y),void 0!==(null==(o=e.bootstrap)?void 0:o.distinctID)){var _=e.bootstrap.distinctID,b=this.get_distinct_id(),w=this.persistence.get_property(Pt);if(e.bootstrap.isIdentifiedID&&null!=b&&b!==_&&"anonymous"===w)this.identify(_);else if(e.bootstrap.isIdentifiedID&&null!=b&&b!==_&&"identified"===w)Cn.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 k=this.config.get_device_id(ua()),S=e.bootstrap.isIdentifiedID?k:_;this.persistence.set_property(Pt,e.bootstrap.isIdentifiedID?ie:ee),this.register({distinct_id:_,$device_id:S})}}if(m)this.register_once({distinct_id:qt,$device_id:null},"");else if(!this.get_distinct_id()){var C=this.config.get_device_id(ua());this.register_once({distinct_id:C,$device_id:C},""),this.persistence.set_property(Pt,ee)}return Ln(l,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),Ln(l,"pageshow",()=>{var t;this.iu=!1,this.ru||null==(t=this.mu)||t.resume()}),e.segment?b_(this,()=>this.wu()):this.wu(),Te(this.config._onCapture)&&this.config._onCapture!==$b&&(Cn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",t=>this.config._onCapture(t.event,t))),this.config.ip&&Cn.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 bb.apply(this,arguments)}().then(t=>{t&&this.register({[x]:t})}).catch($b),this}ku(t){var e=t;return Re(e.name)&&Te(e.setup)}Su(t,e){this.ku(t)?e.push(()=>{this.xu().add(t).catch(()=>null==t.dispose?void 0:t.dispose()).catch(e=>{Cn.error('Failed to dispose browser extension "'+t.name+'"',e)})}):this.ql.push(t)}bu(){var e,i,r,n,s,o,a=null!==(e=null==(i=this.config.__extensionClasses)?void 0:i.featureFlags)&&void 0!==e?e:null==(r=t.__defaultExtensionClasses)?void 0:r.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(o=this.Cu)||o.call(this),this.Cu=void 0,this.featureFlags=new a(this)),Te(this.featureFlags.onReloading)&&Te(this.featureFlags.setup)?this.Cu||(this.Cu=this.featureFlags.onReloading(()=>{this.zl.emit("featureFlagsReloading",!0)}),this.xu().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}_u(e){var i,r,n,o,a,l,u,h=performance.now(),d=s({},t.__defaultExtensionClasses,this.config.__extensionClasses),v=[];d.exceptions&&this.ql.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new d.exceptions(this)),d.historyAutocapture&&this.ql.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.ql.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.ql.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!e&&this.ql.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||v.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),d.autocapture&&this.Su(this.autocapture=new d.autocapture(this),v),d.surveys&&this.Su(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new d.surveys(this),v),d.logs&&this.Su(this.logs=null!==(n=this.logs)&&void 0!==n?n:new d.logs(this),v),d.metrics&&this.ql.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new d.metrics(this)),d.conversations&&this.ql.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new d.conversations(this)),d.productTours&&this.ql.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.ql.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.ql.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.ql.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.ql.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,m_)),d.toolbar&&this.ql.push(this.toolbar=null!==(l=this.toolbar)&&void 0!==l?l:new d.toolbar(this)),d.experiments&&this.ql.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this.ql.forEach(t=>{t.initialize&&v.push(()=>{null==t.initialize||t.initialize()})}),v.push(()=>{if(this.Tu){var t=this.Tu;this.Tu=void 0,this.ql.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}}),this.Mu(v,h)}Mu(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout(()=>{this.Mu(t,e)},0);var i=t.shift();if(i)try{i()}catch(t){Cn.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[Bt]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Ut]:r}),this.config.__preview_deferred_init_extensions&&Cn.info("PostHog extensions initialized ("+r+"ms)")}Pa(t){var e;if(!d||!d.body)return Cn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Pa(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.Tu=t),this.Hl=t,this.compression=void 0,t.ok){var i,r=t.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=ve(r.supportedCompression,Lf.GZipJS)?Lf.GZipJS:ve(r.supportedCompression,Lf.Base64)?Lf.Base64:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.hu?this.hu:re}),null==(e=this.Iu)||e.handleRemoteConfig(t),this.ql.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}wu(){try{this.config.loaded(this)}catch(t){Cn.critical("`loaded` function failed",t)}if(this.Eu(),this.config.internal_or_test_user_hostname&&null!=v&&v.hostname){var t=v.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.Jl())&&this.Ru()},1),this.Au=new V_(this),this.Au.load()}Eu(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.pu)||t.enable())}_dom_loaded(){this.is_capturing()&&En(this.__request_queue,t=>this.gu(t)),this.__request_queue=[],this.Eu()}_handle_unload(){var t,e,i,r,n;this.iu=!0,null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.Pu()&&this.capture(ae),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.pu)||r.unload(),null==(n=this.mu)||n.unload()):this.Pu()&&this.capture(ae,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?zb?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=s({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?null!==(e=this.compression)&&void 0!==e?e:t.compressionFallback:t.compression,(Ie(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=s({},t);n.timeout=n.timeout||6e4;var o,a,l,u,h,d=null!==(e=n.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Ie(n.compression)&&n.data&&(n.compression=Lf.Base64),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(a=null==(h=(u=(Ce(o=n.data)?o:[o]).map(t=>s({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{})))[0])||null==(l=h.properties)?void 0:l.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()),Ce(t)?t.map(t=>s({},t,{sent_at:e})):s({},t,{sent_at:e})}(n.data))),n.url=lb(n.url,n.method,n.compression,n.timestampMode);var v=ub.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){nb(t)?Cn.warn(t):Cn.error(t),null==n.callback||n.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&n.data&&n.compression===Lf.GZipJS&&g&&"undefined"!=typeof Promise&&!J_?ib(n).then(t=>{f(t)}).catch(e=>{if(Jr(e))return J_=!0,void f(s({},n,{compression:void 0,url:lb(t.url,t.method,void 0,t.timestampMode)}));Kr(e)&&(J_=!0),f(n)}):c(n)})(s({},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}))}gu(t){this.mu?this.mu.retriableRequest(t):this._send_request(t)}_execute_array(t){Fb++;try{var e,i=[],r=[],n=[];En(t,t=>{if(t)if(Ce(e=t[0]))n.push(t);else if(Te(t))try{t.call(this)}catch(e){Cn.error("Error executing queued PostHog call",t,e)}else Ce(t)&&"alias"===e?i.push(t):Ce(t)&&-1!==e.indexOf("capture")&&Te(this[e])?n.push(t):r.push(t)});var s=function(t,e){En(t,function(t){try{if(Ce(t[0])){var i=e;Mn(t,function(t){i=i[t[0]].apply(i,t.slice(1))})}else e[t[0]].apply(e,t.slice(1))}catch(e){Cn.error("Error executing queued PostHog call",t,e)}})};s(i,this),s(r,this),s(n,this)}finally{Fb--}}push(e){if(Fb>0&&Ce(e)&&Re(e[0])){var i=t.prototype[e[0]];Te(i)&&i.apply(this,e.slice(1))}else this._execute_array([e])}Fu(){var t,e=null==(t=this.persistence)?void 0:t.get_property(M);return Re(e)&&Bb.test(e)?{value:e,delivered:!1}:Ee(e)&&Re(e.value)&&Bb.test(e.value)?{value:e.value,delivered:!0===e.delivered}:void 0}Ou(t,e,i,r){if(this.persistence){this.persistence.refreshKey(M);var n=this.Fu();if(!r){if(i)return Re(e)&&Bb.test(e)?(e!==(null==n?void 0:n.value)&&this.persistence.register({[M]:{value:e,delivered:!1}}),{value:e,pending:e!==(null==n?void 0:n.value)||!n.delivered}):void this.persistence.unregister(M);if(Re(t)&&jb.test(t)){if((null==n?void 0:n.value.split(".")[3])===t)return{value:n.value,pending:!n.delivered};var s="fb.1."+Date.now()+"."+t;return this.persistence.register({[M]:{value:s,delivered:!1}}),{value:s,pending:!0}}return n?{value:n.value,pending:!n.delivered}:void 0}this.persistence.unregister(M)}}$u(t){if(this.persistence){this.persistence.refreshKey(M);var e=this.Fu();(null==e?void 0:e.value)!==t||e.delivered||this.persistence.register({[M]:{value:t,delivered:!0}})}}capture(t,e,i){var r,n,o,a,l,u,h,d,v,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.pu){if(this.is_capturing())if(!Ie(t)&&Re(t)){this.Yl();var f=!this.config.opt_out_useragent_filter&&this._is_bot();if(!f||this.config.__preview_capture_bot_pageviews){var p=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==p||!p.isRateLimited){var g;null!=e&&e.$current_url&&!Re(null==e?void 0:e.$current_url)&&(Cn.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.Du||Cn.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&&(g=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 m=new Date,y=(null==i?void 0:i.timestamp)||m,_=or(null==i?void 0:i.uuid,ua),b={uuid:_,event:t,properties:this.calculateEventProperties(t,e||{},y,_)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&f&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),p&&(b.properties.$lib_rate_limit_remaining_tokens=p.remainingTokens);var w="$feature_flag_called"===t&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=i&&i.$set&&!w&&(b.$set=null==i?void 0:i.$set);var k=Ee(null==e?void 0:e.$set)?e.$set:void 0,S=!(null==i||!i.$set)&&"$fbc"in i.$set,x=S||!!k&&"$fbc"in k,C=S?null==i||null==(r=i.$set)?void 0:r[E]:null==k?void 0:k[E],T=Ce(null==e?void 0:e.$unset)?e.$unset:[],M=(null==i?void 0:i.$unset)||[],I=-1!==T.indexOf("$fbc")||-1!==M.indexOf("$fbc"),R=this.Ou(null==(n=g)?void 0:n.fbclid,C,x,I);R&&!0===b.properties.$process_person_profile&&R.pending&&!x&&!w&&(b.$set=s({[E]:R.value},b.$set));var A=null==i?void 0:i.$unset;A&&(b.$unset=A);var P=w?void 0:this.Lu(null==i?void 0:i.$set_once,t!==ue,t===le);if(P&&(b.$set_once=P),null!=i&&i._noTruncate||(h=this.config.properties_string_max_length,d=b,v=t=>Re(t)?t.slice(0,h):t,c=new Set,b=function t(e,i){if(e!==Object(e))return v?v(e):e;if(!c.has(e)){var r;if(c.add(e),Ce(e))r=[],En(e,e=>{r.push(t(e))});else{var n={};Mn(Ue(e)?Fn(e):e,(e,i)=>{c.has(e)||(n[i]=t(e,i))}),r=n}return r}}(d)),b.timestamp=y,Ie(null==i?void 0:i.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=m),w&&(b.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return Vr.forEach(r),e.forEach(r),i}(b.properties,Ub)),t===Vf.DISMISSED||t===Vf.SENT){var O=null==e?void 0:e[Gf.SURVEY_ID],F=null==e?void 0:e[Gf.SURVEY_ITERATION];ep({id:O,current_iteration:F}),b.$set=s({},b.$set,{[La({id:O,current_iteration:F},t===Vf.SENT?"responded":"dismissed")]:!0})}else t===Vf.SHOWN&&(b.$set=s({},b.$set,{[Gf.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===B_.SHOWN){var D=null==e?void 0:e[U_.TOUR_TYPE];D&&(b.$set=s({},b.$set,{[U_.TOUR_LAST_SEEN_DATE+"/"+D]:(new Date).toISOString()}))}var L=s({},b.properties.$set,b.$set);if(Me(L)||this.setPersonPropertiesForFlags(L),!Oe(this.config.before_send)){var N=this.bs(b);if(!N)return;(b=N).uuid=or(b.uuid,ua)}var q=null!==(o=null==(a=b.$set)?void 0:a.$fbc)&&void 0!==o?o:Ee(null==(l=b.properties)?void 0:l.$set)?b.properties.$set.$fbc:void 0,j=null!=R&&R.pending&&q===R.value?R.value:void 0;this.zl.emit("eventCaptured",b);var B,U=null!==(u=null==i?void 0:i._url)&&void 0!==u?u:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),H=s({method:"POST",url:U,data:b,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(U)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},j?{fireCallbackOnDrop:!0,callback:t=>{t.statusCode>=200&&300>t.statusCode&&this.$u(j)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||j?(!H.transport&&!H.callback&&Me(null!==(B=this.config.request_headers)&&void 0!==B?B:{})&&this.iu&&(H.transport="sendBeacon"),this.gu(H)):this.pu.enqueue(H),b}Cn.critical("This capture call is ignored due to client rate limiting.")}}else Cn.error("No event name provided to posthog.capture")}else Cn.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",e=>t(e.event,e))}getExtension(t){var e;return null==(e=this.Iu)?void 0:e.getExtension(t)}xu(){var t;return null!==(t=this.Iu)&&void 0!==t?t:this.Iu=new Pb(this)}Wl(t){this.au.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.au.indexOf(t);-1!==i&&this.au.splice(i,1)}}}Nu(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.du=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(r=this.sessionPersistence)||r.clear(),this.su.clear(),this.qu()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(t,e,i,r,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;this.persistence.syncCookieProperties(),this.Nu();var o=n?void 0:this.persistence.remove_event_timer(t),a=s({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Jl()&&(a[jt]=!0),"$snapshot"===t){var u=s({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!Re(a.distinct_id)&&!Fe(a.distinct_id)||Ae(a.distinct_id))&&Cn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var h,c=function(t,e,i,r){var n,s,o,a;if(void 0===r&&(r=!1),!m)return{};var u,h=t?[...rl,...e||[]]:[],d=Zi(m),c=d[0],f=d[1],p=function(t){for(var e=0;Yi.length>e;e++){var i,r=Yi[e],n=r[1],s=r[2],o=t.match(r[0]);if(o)return[n,(null==(i=s&&t.match(s)||o)?void 0:i[1])||""]}return["",""]}(m),g=p[0],y=p[1],_=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},b={};Ie(i)||(b.detectGoogleSearchApp=i);var w={},k=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,S=null==(s=navigator)?void 0:s.maxTouchPoints,x=null==l||null==(o=l.screen)?void 0:o.width,C=null==l||null==(a=l.screen)?void 0:a.height,T=null==l?void 0:l.devicePixelRatio;Ie(k)||(w.userAgentDataPlatform=k),Ie(S)||(w.maxTouchPoints=S),Ie(x)||(w.screenWidth=x),Ie(C)||(w.screenHeight=C),Ie(T)||(w.devicePixelRatio=T);var E,M=In(On({$os:c,$os_version:f,$browser:zi(m,navigator.vendor,_,b),$webview_app:g,$webview_app_version:y,$device:Qi(m),$device_type:Ji(m,w),$timezone:pl(),$timezone_offset:gl()}),{$current_url:zn(r?lr(null==v?void 0:v.href):null==v?void 0:v.href,h,sl),$host:null==v?void 0:v.host,$pathname:null==v?void 0:v.pathname,$raw_user_agent:m.length>1e3?m.substring(0,997)+"...":m,$browser_version:Vi(m,navigator.vendor,_,b),$browser_language:hl(),$browser_language_prefix:(E=hl(),"string"==typeof E?E.split("-")[0]:void 0),$screen_height:null==l?void 0:l.screen.height,$screen_width:null==l?void 0:l.screen.width,$viewport_height:null==l?void 0:l.innerHeight,$viewport_width:null==l?void 0:l.innerWidth,$lib:Sn.LIB_NAME,$lib_version:Sn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Sn.SDK_DIST_CHANNEL&&(M.$sdk_dist_channel=Sn.SDK_DIST_CHANNEL),M}(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(n,i.getTime(),!0),p=f.windowId;a.$session_id=f.sessionId,a.$window_id=p}this.sessionPropsManager&&In(a,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&In(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(g=this.mu)?void 0:g.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===wb&&(a.$lib_custom_api_host=this.config.api_host),h="$pageview"!==t||n?"$pageleave"!==t||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),a=In(a,h),"$pageview"===t&&d&&(a.title=d.title),!Ie(o)){var y=i.getTime()-o;a.$duration=parseFloat((y/1e3).toFixed(3))}m&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var _=this.persistence.properties(),b=this.sessionPersistence.properties(),w=a.$groups,k=_.$groups;Ee(w)&&!Me(w)&&(a.$groups=s({},Ee(k)?k:{},w)),Mn(["$referrer","$referring_domain"],t=>{t in _&&delete b[t]});var S={};if(this.au.length>0)for(var x of this.au.slice())try{In(S,x())}catch(t){Cn.error("Failed to produce browser extension event properties",t)}(a=In({},c,_,b,s({},S,a))).$is_identified=this._isIdentified(),Ce(this.config.property_denylist)?Mn(this.config.property_denylist,function(t){delete a[t]}):Cn.error(qb+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var C=this.config.sanitize_properties;C&&(Cn.error(Nb),a=C(a,t));var T=this.ju();return a.$process_person_profile=T,T&&!n&&this.Bu("_calculate_event_properties"),a}Lu(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.ju())return t;if(this.nu&&!i)return t;var n=In({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},t||{}),s=this.config.sanitize_properties;return s&&(Cn.error(Nb),n=s(n,"$set_once")),e&&(this.nu=!0),Me(n)?void 0:n}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.Nu(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach(t=>this.su.add(t)),this.qu()}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.su.delete(t),this.qu()}Hu(t,e){this.register({[t]:e})}yu(){this.su.forEach(t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)}),this.su.clear(),this.qu()}qu(){var t;if(this.ou)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.gi||!Ra.Et())Ra.Dt(this.ou);else{var e=[];this.su.forEach(t=>e.push(t)),e.length>0?Ra.Ot(this.ou,e):Ra.Dt(this.ou)}}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.zl.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:Lb}),()=>{})}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:Lb})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Lb})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=rp),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:Lb}}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:Lb})}zu(t){return!t||Ae(t)?(Cn.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===t?(Cn.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())||(Cn.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 Cn.uninitializedWarning("posthog.identify");if(Fe(t)&&(t=t.toString(),Cn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.zu(t)&&this.Bu("posthog.identify")){this.Yl();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.Nu(!1),o=this.persistence.va(),a=!1;try{var l=this.get_distinct_id();this.register({$user_id:t}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),t!==l&&t!==this.get_property("__alias")&&(this.unregister(C),this.register({distinct_id:t}));var u=(this.persistence.get_property("$user_state")||"anonymous")===ee,h=t!==l,d=!h&&u;if(h&&u){var v,c=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:l};this.persistence.set_property(Pt,ie),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.ca(),this.capture(le,c,{$set:e||{},$set_once:i||{}}),this.du=Qa(t,e,i),null==(v=this.featureFlags)||v.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:l)}else if(d){this.persistence.set_property(Pt,ie);var f=e||{},p=i||{};this.setPersonPropertiesForFlags({$set:f,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.ca(),this.capture("$set",{$set:f,$set_once:p}),this.du=Qa(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);h||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Mt)):d&&(e||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.ga(a)}}}setPersonProperties(t,e){if((t||e)&&this.Bu("posthog.setPersonProperties")){var i=Qa(this.get_distinct_id(),t,e);this.du!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.du=i):Cn.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(Ce(t)?t:[t]).filter(t=>Re(t)&&t.length>0);0!==i.length&&this.Bu("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.du=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.Nu();var n=this.getGroups(),o=n[t]!==e;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:s({},n,{[t]:e})}),(o||i)&&this.ju()){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(ue,a)}i&&this.setGroupPropertiesForFlags({[t]:i}),o&&!i&&this.reloadFeatureFlags()}else Cn.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.Bu("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=De(t)?t:null==t?void 0:t.resetDeviceID,i=De(t)||null==t?void 0:t.bootstrap;this.Uu(e,!1,i)}Uu(t,e,i){var r,n,o,a;if(void 0===e&&(e=!1),Cn.info("reset"),!this.__loaded)return Cn.uninitializedWarning("posthog.reset");var l=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.cu)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this.Fa());var u=this.get_property(S),h=this.get_property(x),d=this.get_property(B);null==(o=this.sessionRecording)||o.flushBeforeIdentityReset();var v=this.is_capturing();this.consent.reset(),e||!v||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 c=null==(a=this.persistence)||null==a.va?void 0:a.va(),f=!1;try{var p,g,m,y,_,b,w,k,C,T,E,M,I;if(null==(p=this.persistence)||p.clear(),null==(g=this.sessionPersistence)||g.clear(),this.su.clear(),this.qu(),Ie(d)||null==(m=this.persistence)||m.register({[B]:d}),null==(y=this.surveys)||y.reset(),null==(_=this.featureFlags)||_.reset(),null==(b=this.conversations)||b.reset(),null==(w=this.logs)||w.reset(),null==(k=this.metrics)||k.reset(),null==(C=this.persistence)||C.set_property(Pt,ee),null==(T=this.sessionManager)||T.resetSessionId(),this.du=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:qt,$device_id:null},"");else{var R=this.config.get_device_id(ua());this.register_once({distinct_id:R,$device_id:t?R:u},""),t||Ie(h)||this.register({[x]:h})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.Jl()||(null==(I=this.persistence)||I.set_property(Pt,i.isIdentifiedID?ie:ee),this.register({distinct_id:i.distinctID})),null==(E=this.featureFlags)||E.initialize(),!(Ie(l)||null!=(M=this.sessionManager)&&M.setBootstrapSessionId(l,!0))){var A=s({},i);delete A.sessionID,this.config.bootstrap=A}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,f=!0}finally{var P;c&&(null==(P=this.persistence)||null==P.ga||P.ga(f))}this.reloadFeatureFlags()}shutdown(t){var e=this;return a(function*(){var t,i,r,n,s,o,a;if(e.__loaded){e.ru=!0,e.xu().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.pu)||n.unload(),null==(s=e.mu)||s.unload();try{var l;null==(l=e.featureFlags)||l.destroy()}catch(t){Cn.error("Error while destroying feature flags",t)}null==(o=e.persistence)||o.destroy(),null==(a=e.sessionPersistence)||a.destroy()}else Cn.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,e){var i;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.Wu()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(t=this.conversations)||t.Vu()}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("$people_distinct_id")?(Cn.critical("Attempting to create alias for existing People user - aborting."),-2):this.Bu("posthog.alias")?(Ie(e)&&(e=this.get_distinct_id()),t!==e?(this.Hu(C,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(Cn.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=s({},this.config);if(Ee(t)){var i,r,n,o,a,l,u,h,d,v,c,f,p;In(this.config,Zb(t));var g=this.tu();null==(i=this.persistence)||i.update_config(this.config,e,g),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new q_(s({},this.config,{persistence:"sessionStorage"}),g,!1);var m=this.vu(this.config.debug);De(m)&&(this.config.debug=m),De(this.config.debug)&&(this.config.debug?(Aa.DEBUG=!0,ga.Et()&&ga.Ot("ph_debug",!0),Cn.info("set_config",{config:t,oldConfig:e,newConfig:s({},this.config)})):(Aa.DEBUG=!1,ga.Et()&&ga.Dt("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Fa()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(o=this.exceptions)||o.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(l=this.tracingHeaders)||l.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(h=this.heatmaps)||h.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(d=this.historyAutocapture)||d.startIfEnabledOrStop()),null==(v=this.exceptionObserver)||v.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||c.startIfEnabledOrStop(),null==(f=this.surveys)||f.loadIfEnabled(),this.eu(),null==(p=this.externalIntegrations)||p.startIfEnabledOrStop(),!e.segment&&this.config.segment&&this.persistence&&b_(this,$b,!1)}}_overrideSDKInfo(t,e){Aa.LIB_NAME=t,Aa.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.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){try{if(!this.exceptions)return;var i=this.exceptions.buildProperties(t,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(s({},i,e))}catch(t){return}}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 e,i;return null!==(e=null==(i=this.logs)?void 0:i.logger)&&void 0!==e?e:t.Gu}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:Hb;return e!==Hb&&(e="posthog."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property("$user_state"))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property("$user_state"))}ju(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Me(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t.__alias)&&(null==(e=this.persistence)||null==(e=e.props)||!e.$epp))}Pu(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.ju()||this.Bu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Bu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Bu(t){return"never"===this.config.person_profiles?(Cn.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ql(),this.Hu(Nt,!0),!0)}tu(){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&&"on_reject"!==this.config.cookieless_mode)}eu(){var t,e,i,r,n,s=this.tu();return this.is_capturing()||null==(t=this.logs)||t.Zu(),(null==(e=this.persistence)?void 0:e.gi)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(r=this.sessionPersistence)?void 0:r.gi)!==s&&(null==(n=this.sessionPersistence)||n.set_disabled(s)),s&&(this.su.clear(),this.qu()),s}opt_in_capturing(e){var i,r,n;if("always"!==this.config.cookieless_mode){if(this.Jl()){var s,o,a,l,u,h;null==(s=this.sessionRecording)||s.dispose({discardBufferedEvents:!0}),this.Uu(!0,!0),null==(o=this.sessionManager)||o.destroy(),null==(a=this.pageViewManager)||a.destroy(),this.sessionManager=new yb(this),this.pageViewManager=new x_(this),this.persistence&&(this.sessionPropsManager=new fb(this,this.sessionManager,this.persistence));var d,v=null!==(l=null==(u=this.config.__extensionClasses)?void 0:u.sessionRecording)&&void 0!==l?l:null==(h=t.__defaultExtensionClasses)?void 0:h.sessionRecording;v&&(this.sessionRecording=this.Zl(this.sessionRecording,new v(this)),this.Hl&&(null==(d=this.sessionRecording)||null==d.onRemoteConfig||d.onRemoteConfig(this.Hl)))}this.consent.optInOut(!0),this.eu(),this.Eu(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(r=this.surveys)||r.loadIfEnabled()),(Ie(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(n=null==e?void 0:e.captureEventName)&&void 0!==n?n:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ru()}else Cn.warn(Db)}opt_out_capturing(){if("always"!==this.config.cookieless_mode){var t,e,i="on_reject"===this.config.cookieless_mode?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),"on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.Uu(!0,!0),this.consent.optInOut(!1),this.eu(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:qt,$device_id:null}),this.Gl(i),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Ru(),this.Eu())}else Cn.warn(Db)}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"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.eu()}_is_bot(){return h?_b(h,this.config.custom_blocked_useragents):void 0}Ru(){d&&("visible"===d.visibilityState?this.lu||(this.lu=!0,this.capture(oe,{title:d.title},{send_instantly:!0}),this.uu&&(d.removeEventListener(ne,this.uu),this.uu=null)):this.uu||(this.uu=this.Ru.bind(this),Ln(d,ne,this.uu)))}debug(t){!1===t?(null==l||l.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==l||l.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}))}Fa(){var t=this.cu||{};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?(Cn.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&&!Oe(t[e]),o=i in t&&!Oe(t[i]);return s?t[e]:!!o&&(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,Cn)}bs(t){var e;if(Oe(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(qe),r=Ce(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),Oe(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return Ne(t.event)?Cn.warn(o+". This can cause unexpected behavior."):Cn.info(o),null}n.properties&&!Me(n.properties)||Cn.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return Cn.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var a of i)if(n.properties&&Oe(n.properties[a]))return Cn.warn("Event '"+t.event+"' had its '"+a+"' 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.ko)?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)})}vu(t){var e=De(t)&&!t,i=ga.Et()&&"true"===ga.Lt("ph_debug");return!e&&(!!i||t)}},t.__defaultExtensionClasses={},t.Gu=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),t);!function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Pn(t.prototype[e[i]])}(Jb,["identify"]);var Kb=class{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=Ee(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.Fa(),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}},Yb=Tn("[ExceptionAutocapture]"),Xb=Tn("[TracingHeaders]"),tw=Tn("[Web Vitals]"),ew=9e5,iw=["CLS","FCP","INP","LCP"],rw=["INP","LCP"],nw=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],sw=Tn("[SessionRecording]"),ow=Tn("[Heatmaps]");function aw(t){return Ee(t)&&"clientX"in t&&"clientY"in t&&Fe(t.clientX)&&Fe(t.clientY)}var lw=Tn("[Product Tours]"),uw=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(N))},hw=Tn("[SiteApps]"),dw="Error while initializing PostHog app with config id ",vw=(t,e)=>null!=t&&t.then?t.then(e):e(t),cw="SDK is not enabled or survey functionality is not yet loaded",fw="Disabled. Not loading surveys.",pw=class{constructor(t,e){this.Ks=t,this.Ju=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Qu=!1,this.Ku=[],this.Xu=null,this.Yu=null,this.ro=!1,this.th=new Set,this.onRemoteConfig=t=>{if(!this.ro&&!this.Rn.disableSurveys){if(!t.ok)return Jf.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Oe(e))return Jf.warn("Flags not loaded yet. Not loading surveys.");this.eh=De(e)?e:e.length>0,Jf.info("flags response received, isSurveysEnabled: "+this.eh),this.loadIfEnabled()}}}setup(t){if(!this.ro)return this.ih=t,vw(t.kv.initialize(),()=>{if(this.ih===t&&!this.ro){this.ih=void 0,this.Js=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.ro?e.dispose():(this.oo=e,this.loadIfEnabled())}})}dispose(){var t,e,i;this.ro||(this.ro=!0,this.ih=void 0,this.Js=void 0,null==(t=this.oo)||t.dispose(),this.oo=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Ku=[],this.Xu=null,this.th.forEach(t=>clearTimeout(t)),this.th.clear())}get Rn(){return this.Ks.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("seenSurvey_")||null!=r&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach(t=>localStorage.removeItem(t))}catch(t){}}loadIfEnabled(){if(!this.ro&&this.Js){var t=this.Rn;if(!this._surveyManager)if(this.Qu)Jf.info("Already initializing surveys, skipping...");else if(t.disableSurveys)Jf.info(fw);else if(t.cookielessMode&&this.Ks.isOptedOut())Jf.info("Not loading surveys in cookieless mode without consent.");else{var e=this.Ks.getExtensions();if(e){if(!Ie(this.eh)||t.advancedEnableSurveys){var i=this.eh||t.advancedEnableSurveys;this.Qu=!0;try{var r=e.generateSurveys;if(r)return this.rh(r,i),void(this.Qu=!1);var n=e.loadExternalDependency;if(!n)return this.nh(te),void(this.Qu=!1);n(t=>{try{if(this.ro)return;var e=this.Ks.getExtensions();t||null==e||!e.generateSurveys?this.nh("Could not load surveys script",t):this.rh(e.generateSurveys,i)}finally{this.Qu=!1}})}catch(t){throw this.Qu=!1,this.nh("Error initializing surveys",t),t}}}else Jf.error("PostHog Extensions not found.")}}}rh(t,e){this.ro||(this._surveyManager=t(e),this._surveyEventReceiver=this.Ks.createEventReceiver(),Jf.info("Surveys loaded successfully"),this.sh({isLoaded:!0}))}nh(t,e){Jf.error(t,e),this.sh({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ku.push(t),this._surveyManager&&this.sh({isLoaded:!0}),()=>{this.Ku=this.Ku.filter(e=>e!==t)}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.Js)&&void 0!==i?i:this.Ju;if(r&&!this.ro){if(this.Rn.disableSurveys)return Jf.info(fw),t([]);var n=r.kv.get(gt);if(n&&!e)return t(n,{isLoaded:!0}),void(this.oh()&&this.getSurveys(()=>{},!0));if(this.Xu)this.Xu.then(e=>{this.ro||t(e.surveys,e.context)}).catch(t=>Jf.error("Error in survey callback",t));else{var s=this.ah("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.Rn.requestTimeoutMs}).then(t=>{try{return this.uh(r,t)}catch(t){return Jf.error("Error processing surveys response",t),this.uh(r,{statusCode:0,error:t})}},t=>this.uh(r,{statusCode:0,error:t}));this.Xu=s;var o=()=>{this.Xu===s&&(this.Xu=null)};s.then(e=>{o(),this.ro||t(e.surveys,e.context)},o).catch(t=>Jf.error("Error in survey callback",t))}}}ah(t,e){var i=this.Js;return i?i.sendRequest(t,e):new Promise(t=>t({statusCode:0,error:new Error(cw)}))}uh(t,e){var i;if(this.ro)return{surveys:[],context:{isLoaded:!1,error:cw}};var r=e.statusCode;if(200!==r||!e.json){var n="Surveys API could not be loaded, status: "+r;return 0!==r?Jf.error(n):e.error||Jf.warn(n),this.Yu=Date.now(),{surveys:[],context:{isLoaded:!1,error:n}}}this.Yu=null;var s=e.json.surveys||[],o=s.filter(t=>Kf(t)&&(Ha(t)||Yf(t)));return o.length>0&&(null==(i=this._surveyEventReceiver)||i.register(o)),t.kv.set({[gt]:s,[mt]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}oh(){return this.hh()&&!this.Xu&&!this.dh()}hh(){var t,e,i=null==(t=null!==(e=this.Js)&&void 0!==e?e:this.Ju)?void 0:t.kv.get(mt);return Fe(i)&&Date.now()-i>3e5}dh(){return Fe(this.Yu)&&3e5>Date.now()-this.Yu}markSurveyAsSeen(t,e){var i;ep({id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}sh(t){for(var e of this.Ku)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Jf.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Oe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Jf.warn("init was not called")}fh(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}ph(t){if(Oe(this._surveyManager))return{eligible:!1,reason:cw};var e="string"==typeof t?this.fh(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}gh(t){if(Oe(this._surveyManager))return{eligible:!1,reason:cw};var e="string"==typeof t?this.fh(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Oe(this._surveyManager))return Jf.warn("init was not called"),{visible:!1,disabledReason:cw};var e=this.gh(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Oe(this._surveyManager)?(Jf.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:cw})):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.gh(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,i){var r;if(Oe(this._surveyManager))Jf.warn("init was not called");else{var n="string"==typeof t?this.fh(t):t;if(null!=n&&n.id)if(ip.includes(n.type)){var s=null==d?void 0:d.querySelector(e);if(s)if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds){Jf.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout(()=>{var t,e;this.th.delete(o),this.ro||(Jf.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,i),Jf.info("Survey "+n.id+" rendered"))},1e3*n.appearance.surveyPopupDelaySeconds);this.th.add(o)}else this._surveyManager.renderSurvey(n,s,i);else Jf.warn("Survey element not found")}else Jf.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Jf.warn("Survey not found")}}displaySurvey(t,e){var i;if(Oe(this._surveyManager))Jf.warn("init was not called");else{var r=this.fh(t);if(r){var n=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(n=s({},r,{appearance:s({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Zf.Popover&&e.initialResponses&&Jf.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.ph(r);if(!o.eligible)return void Jf.warn("Survey is not eligible to be displayed: ",o.reason)}e.displayType!==Zf.Inline?this._surveyManager.handlePopoverSurvey(n,e):this.renderSurvey(n,e.selector,e.properties)}else Jf.warn("Survey not found")}}cancelPendingSurvey(t){Oe(this._surveyManager)?Jf.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}};function gw(t,e,i){if(Oe(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}}var mw=class{constructor(t){this._instance=t,this.mh=new Set,this.yh=new Set,this.bh=new pb,this._h=(t,e)=>this.wh(t,e)&&this.kh(t,e)&&this.Sh(t,e)&&this.xh(t,e),this.wh=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event)}init(){var t,e;Ie(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Ch=null==(e=this._instance)?void 0:e._addCaptureHook((t,e)=>{this.on(t,e)}))}dispose(){var t;null==(t=this.Ch)||t.call(this),this.Ch=void 0,this.bh=new pb}register(t){var e,i;if(!Ie(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach(t=>{var e;this.mh.add(t),null==(e=t.steps)||e.forEach(t=>{this.yh.add((null==t?void 0:t.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.mh.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.mh.clear(),this.yh.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.yh.has(t)||this.yh.has(e.event))&&this.mh.forEach(t=>{this.Th(e,t)&&this.bh.emit("actionCaptured",t.name)})}Mh(t){this.onAction("actionCaptured",e=>t(e))}Th(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this._h(t,i))return!0;return!1}onAction(t,e){return this.bh.on(t,e)}kh(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(!gw(r,e.url,e.url_matching||"contains"))return!1}return!0}Sh(t,e){return!!this.Ih(t,e)&&!!this.Eh(t,e)&&!!this.Rh(t,e)}Ih(t,e){var i;if(null==e||!e.href)return!0;var r=this.Ah(t);if(r.length>0)return r.some(t=>gw(t.href,e.href,e.href_matching||"exact"));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&gw((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Eh(t,e){var i;if(null==e||!e.text)return!0;var r=this.Ah(t);if(r.length>0)return r.some(t=>gw(t.text,e.text,e.text_matching||"exact")||gw(t.$el_text,e.text,e.text_matching||"exact"));var n,s,o,a=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!a&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!Oe(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(a),s=e.text,o=e.text_matching||"exact",n.some(t=>gw(t,s,o)))}Rh(t,e){var i,r;if(null==e||!e.selector)return!0;if(null!=t&&null!=(i=t.properties)&&null!=(i=i.$element_selectors)&&i.includes(e.selector))return!0;var n=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&n)try{return new RegExp(e.selector_regex).test(n)}catch(t){return!1}return!1}Ah(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}xh(t,e){return null==e||!e.properties||0===e.properties.length||Za(e.properties.reduce((t,e)=>{var i=Ce(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)}},yw=class{constructor(t){var e;this.Ph=[],this._instance=t,this.Fh=new Map,this.Oh=new Map,this.$h=new Map,this.Dh=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId(t=>this.Lh(t))}Nh(t){return!1}qh(){return null}jh(t){}Bh(){}Hh(t,e){return!!t&&Za(t.propertyFilters,null==e?void 0:e.properties)}zh(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}Uh(t,e,i){var r=(i===Nf.Activation?this.Fh:this.Oh).get(t),n=[];return this.Wh(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.Hh(s,e)})}register(t){this.Vh(t,!1)}replace(t){this.Vh(t,!0)}Vh(t,e){var i;Ie(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.Gh(t,e),this.Zh(t,e))}Zh(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.$h.clear(),0!==i.length){this.Jh||(this.Jh=new mw(this._instance),this.Jh.init(),this.Jh.Mh(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.$h.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.$h.set(e.name,n)}})}),e?this.Jh.replace(r):this.Jh.register(r)}else{var n;e&&(null==(n=this.Jh)||n.replace([]))}}Qh(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)})}Gh(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}),o=this.zh(t,Nf.Activation),a=this.zh(t,Nf.Cancellation);e?(this.Fh=o,this.Oh=a):(this.Qh(this.Fh,o),this.Qh(this.Oh,a)),(0!==n.length||0!==s.length)&&(null!==(i=this.Ch)&&void 0!==i||(this.Ch=null==(r=this._instance)?void 0:r._addCaptureHook((t,e)=>{this.onEvent(t,e)})))}onEvent(t,e){var i,r,n=this.Kh(),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 o=this.Xh(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Yh([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.td(s),void this.ed([s])}if(this.Oh.has(t)){var a=this.Uh(t,e,Nf.Cancellation);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map(t=>t.id)}),this.Yh(a.map(t=>t.id)),a.forEach(t=>this.rd(t.id)))}if(this.Fh.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.Fh.get(t)});var l=this.Uh(t,e,Nf.Activation);this.nd(l.map(t=>t.id))}}onAction(t){this.$h.has(t)&&this.nd(this.$h.get(t)||[])}nd(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.Nh(n)?this.td(n)&&this.sd(n):r.push(n);r.length>0&&(this.Ph=[...new Set([...this.Ph,...r])]),this.Kh().info("updating activated items",{activatedItems:this.getActivatedIds()})}}td(t){this.Ph=this.Ph.filter(e=>e!==t);var e=this.od();return!e.includes(t)&&(this.ad([...e,t]),this.ld(),!0)}Yh(t){var e=new Set(t);this.Ph=this.Ph.filter(t=>!e.has(t));var i=this.ud(),r=i.filter(t=>!e.has(t));r.length!==i.length&&(this.ad(r),0===r.length&&this.hd()),this.ed(t)}dd(){var t,e=this.qh();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}sd(t){if(this.qh()){var e=this.dd();this.jh(s({},e,{[t]:Date.now()}))}}ed(t){if(this.qh()){var e=this.dd(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],o=n[1];t.includes(s)?r=!0:i[s]=o}r&&(Me(i)?this.Bh():this.jh(i))}}vd(){this.qh()&&this.Bh()}getActivationTimestamp(t){if(this.od().includes(t)){var e=this.dd()[t];return Fe(e)?e:void 0}}ud(){var t,e=this.fd();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}od(){var t,e,i=this.ud();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.pd()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}ld(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.gd(e)}hd(){this.md()}Lh(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.pd()];if(i&&i!==t){var r=this.ud(),n=this.dd();r.length>0&&(this.ad([]),r.filter(t=>Fe(n[t])).forEach(t=>this.rd(t))),this.hd(),this.vd()}}getActivatedIds(){return[...new Set([...this.od(),...this.Ph])].filter(t=>!this.yd(t))}dispose(){var t,e,i;null==(t=this.Dh)||t.call(this),this.Dh=void 0,null==(e=this.Ch)||e.call(this),this.Ch=void 0,null==(i=this.Jh)||i.dispose(),this.Jh=void 0}reset(){this.Ph=[],this.ud().length>0&&this.ad([]),this.hd(),this.vd()}getEventToItemsMap(){return this.Fh}bd(){return this.Jh}},_w=class extends yw{constructor(t){super(t)}fd(){return yt}pd(){return _t}qh(){return bt}jh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[bt]:t})}Bh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(bt)}Nh(t){var e,i;this.Wh(e=>{i=e.find(e=>e.id===t)});var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return Fe(r)&&r>0}_d(){return Vf.SHOWN}Wh(t){var e;null==(e=this._instance)||e.getSurveys(t)}rd(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Kh(){return Jf}ad(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[yt]:t})}gd(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[_t]:t})}md(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(_t)}yd(){return!1}Xh(t,e){var i;return this.Wh(t=>{i=t.find(t=>t.id===e)}),!i||za(i)?t===Vf.SHOWN?"consume":"ignore":t===Vf.SHOWN?"persist":t===Vf.DISMISSED||t===Vf.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},bw=class{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);Ie(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)}},ww=class{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==b?void 0:b.__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 _w(this._instance)}},kw=null!=l&&l.location?Wn(l.location.hash,"__posthog")||Wn(location.hash,"state"):null,Sw="_postHogToolbarParams",xw=Tn("[Toolbar]"),Cw=Tn("[FeatureFlags]"),Tw=class{constructor(t,e){void 0===e&&(e=!1),this.wd=!1,this.update(t,e)}update(t,e){this.kd=((t,e)=>{var i,r,n,s,o;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!==(o=t.evaluation_contexts)&&void 0!==o?o:t.evaluation_environments)&&void 0!==s?s:[],flagKeys:Ce(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.wd||(Cw.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.wd=!0),Ie(t.flag_keys)||Ce(t.flag_keys)||Cw.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.kd}},Ew=Tn("[FeatureFlags]"),Mw=Tn("[FeatureFlags]",{debugEnabled:!0}),Iw="\" failed. Feature flags didn't load in time.",Rw="connection_error",Aw=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},Pw=t=>{var e={};for(var i of Rn(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},Ow="Refusing to render web experiment since the viewer is a likely bot",Fw={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>Wa(e,t),not_regex:(t,e)=>!Wa(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},$w=Tn("[Conversations]"),Dw="Conversations not available yet.";function Lw(t,e){var i,r,n,o,a,l,u,d=null!==(i=null==t?void 0:t.flushIntervalMs)&&void 0!==i?i:3e3,v=null!==(r=null==t?void 0:t.maxBufferSize)&&void 0!==r?r:100,c=null!=e&&e.consoleCapture?void 0:null!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,f=Ie(c)?Math.max(v,2048):Math.max(v,c),p=s({},function(){var t="",e="";try{var i=null==h?void 0:h.userAgent;if(i){var r=Zi(i);t=r[0],e=r[1]}}catch(t){}return function(t,e){var i=function(t){if(t)return{}.hasOwnProperty.call(un,t)?un[t]:t}(t);return s({},i?{"os.name":i}:{},e?{"os.version":e}:{})}(t,e)}(),null==t?void 0:t.resourceAttributes);return{serviceName:null!==(o=null!==(a=null==p?void 0:p["service.name"])&&void 0!==a?a:null==t?void 0:t.serviceName)&&void 0!==o?o:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(l=null==p?void 0:p["service.version"])&&void 0!==l?l:null==t?void 0:t.serviceVersion,environment:null!==(u=null==p?void 0:p["deployment.environment"])&&void 0!==u?u:null==t?void 0:t.environment,resourceAttributes:p,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:v,maxQueueSize:f,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:c,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var Nw=["debug","log","warn","error","info"],qw="console",jw="__posthogHandledLogsRequestError",Bw=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[jw]=!0,i},Uw=t=>!!t&&"object"==typeof t&&!0===t[jw],Hw={featureFlags:class{constructor(t){this.name="featureFlags",this.Sd=!1,this.featureFlagEventHandlers=[],this.A=Ew,this.xd={},this.Cd={},this.Td=[],this.Md=!1,this.Id=!1,this.Ed=0,this.Rd=!1,this.Ad=!1,this.Pd=!1,this.Fd=!1,this.Od=0,this.nr=()=>{var t=this.$d();this.Od=0,t&&this.reloadFeatureFlags()},this.Dd=()=>{var t,e=this.Ld;Ie(e)||this.Rn.remoteRequestsDisabled||!d||"hidden"===d.visibilityState||Date.now()-(null!==(t=this.Nd)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.qd())},this.ar=()=>{"visible"===(null==d?void 0:d.visibilityState)&&this.Dd()},"get"in t?this.Ks=t:(this._instance=t,this.jd=new Tw(t.config,t.Fa()),this.Ks=this.jd)}updateConfig(t,e){var i;null==(i=this.jd)||i.update(t,e),this.Js&&this.Bd()}setup(t){return this.ih=t,this.A=t.logger.createLogger("[FeatureFlags]"),vw(t.kv.initialize(),()=>{this.ih===t&&(this.ih=void 0,this.Js=t,this.Hd(t))})}Hd(t){var e;if(this.Js===t)return l&&Ln(l,"online",this.nr),this.Bd(),this.zd=t.registerDynamicEventProperties(()=>this.Ud()?this.xd:this.Cd),this.Wd=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.onCrossTabFeatureFlagChange(()=>{this.Vd(),this.Gd(),this.Zd()}),this.Gd(),this.initialize()}Bd(){var t=this.Rn.refreshIntervalMs,e=!this.Rn.remoteRequestsDisabled&&d&&!Ie(t)&&t>0?t:void 0;e!==this.Ld&&(this.Jd(),Ie(e)||(this.Ld=e,this.qd(),null!=d&&d.addEventListener&&Ln(d,ne,this.ar)))}qd(){Ie(this.Ld)||(Ie(this.Qd)||clearInterval(this.Qd),this.Nd=Date.now(),this.Qd=setInterval(this.Dd,this.Ld))}Jd(){Ie(this.Qd)||(clearInterval(this.Qd),this.Qd=void 0,null==d||null==d.removeEventListener||d.removeEventListener(ne,this.ar)),this.Ld=void 0,this.Nd=void 0}destroy(){this.Kd()}dispose(){this.Kd()}Kd(){var t,e;this.Jd(),this.Ed++,this.Ad=!1,this.ih=void 0,this.Js&&(this.Xd(),null==(t=this.zd)||t.dispose(),this.zd=void 0,null==(e=this.Wd)||e.call(this),this.Wd=void 0,this.Td=[],null==l||l.removeEventListener("online",this.nr),this.Js=void 0)}get Rn(){return this.Ks.get()}Yd(t){var e;return this.tv&&t in this.tv?this.tv[t]:null==(e=this.Js)?void 0:e.kv.get(t)}Vd(){return!!this.tv&&(this.tv=void 0,!0)}ev(){var t;return!Ie(null==(t=this.Js)?void 0:t.kv.get("$enabled_feature_flags"))&&this.Vd()}Ot(t){this.iv(()=>{var e;return null==(e=this.Js)?void 0:e.kv.set(t)})}rv(t,e,i){var r;if(null!=(r=this._instance)&&r.persistence&&t.$enabled_feature_flags){var n=this.Yd("$enabled_feature_flags")||{},s=t.$enabled_feature_flags||{},o=e.flags||e.featureFlags,a=e.flags?Object.entries(e.flags).filter(t=>{var e=t[1];return!(null!=e&&e.failed)}).map(t=>t[0]):[],l=!!e.errorsWhileComputingFlags&&!!e.flags,u=l?a:i&&!Ce(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(n),...Object.keys(s)])),h=this.Yd("$feature_flag_payloads")||{},d=t.$feature_flag_payloads||{},v=l||i?u:Array.from(new Set([...Object.keys(h),...Object.keys(d)])),c=!l&&!i,f=!!c||u,p=!!c||v,g={[st]:f,[nt]:f,[lt]:p};for(var m of(t.$feature_flag_details&&(g[at]=f),[ut,At,ht]))Ie(t[m])||(g[m]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(g)}}Dt(t){this.iv(()=>{var e;return null==(e=this.Js)?void 0:e.kv.remove(t)})}iv(t){try{t()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}Gd(){var t={};for(var e of[st,lt,ut,dt]){var i=this.Yd(e);Ie(i)||(t[e]=i)}this.xd=t;var r=s({},t),n=this.Yd(nt);if(n)for(var o of Object.entries(n))r["$feature/"+o[0]]=o[1];this.Cd=r}Ud(){var t=this.Rn.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Yd(At);return"number"!=typeof e||Date.now()-e>t}nv(){return!!this.Ud()&&(this.Fd||this.Id||(this.Fd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}sv(){var t=this.Rn.evaluationContexts;return null!=t&&t.length?t.filter(t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.A.error("Invalid evaluation context found:",t,"Expected non-empty string"),e}):[]}ov(){var t=this.Rn.flagKeys;if(!Ie(t))return t.filter(t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.A.error("Invalid flag key found:",t,"Expected non-empty string"),e})}initialize(){var t,e,i=this.Rn,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,o=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(r).filter(t=>!Ie(r[t])).reduce((t,e)=>(t[e]=r[e],t),{}),l=Object.keys(o).filter(t=>a[t]).reduce((t,e)=>(t[e]=o[e],t),{});return this.av({featureFlags:a,featureFlagPayloads:l},void 0,{persist:!1})}}updateFlags(t,e,i){var r,n,o=null!=i&&i.merge&&null!==(r=this.Yd("$enabled_feature_flags"))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(n=this.Yd("$feature_flag_payloads"))&&void 0!==n?n:{},l=s({},o,t),u=s({},a,e),h={};for(var d of Object.entries(l)){var v=d[0],c=d[1];h[v]={key:v,enabled:Hr(c),variant:zr(c),reason:void 0,metadata:Ie(null==u?void 0:u[v])?void 0:{id:0,version:void 0,description:void 0,payload:u[v]}}}this.av({flags:h})}get hasLoadedFlags(){return this.Md}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Yd(at),e=this.Yd(dt),i=this.Yd(vt);if(!i&&!e)return t||{};var r=In({},t||{});for(var n of[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])]){var o,a,l=r[n],u=null==e?void 0:e[n],h=Ie(u)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!u,d=Ie(u)?null==l?void 0:l.variant:"string"==typeof u?u:void 0,v=null==i?void 0:i[n],c=s({},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=s({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),r[n]=c}return this.Sd||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.Sd=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(i=>{var r=t[i];return{key:i,enabled:Hr(r),variant:zr(r),payload:Ur(e[i])}})}getFlagVariants(){var t=this.Yd(nt),e=this.Yd(dt);if(!e)return t||{};for(var i=In({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.Sd||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.Sd=!0),i}getFlagPayloads(){var t=this.Yd(lt),e=this.Yd(vt);if(!e)return t||{};for(var i=In({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.Sd||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.Sd=!0),i}reloadFeatureFlags(){this.Rd||this.Rn.featureFlagsDisabled||this.$d()||(this.Id&&(this.Ad=!0),this.lv||(this.Td.slice().forEach(t=>{try{t()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}}),this.lv=setTimeout(()=>{this.uv()},5)))}Xd(){clearTimeout(this.lv),this.lv=void 0}onReloading(t){return this.Td.push(t),()=>{this.Td=this.Td.filter(e=>e!==t)}}ensureFlagsLoaded(){this.Md||this.Id||this.lv||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Rd=t}resetFlagCallReported(){this.Dt(Mt)}uv(t){this.Xd();var e=this.Js;if(e&&!this.Rn.remoteRequestsDisabled&&!this.$d())if(this.Id)this.Ad=!0;else{var i={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:s({},e.initialPersonProperties,this.Yd("$stored_person_properties")||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Yd(ft),timezone:pl()};Ie(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.Rn.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.sv();r.length&&(i.evaluation_contexts=r);var n=this.ov();Ie(n)||(i.flag_keys=n);var o=this.Rn.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),l=this.Ed;this.Id=!0;var u=()=>{this.Ad&&(this.Ad=!1,this.uv())},h=t=>{this.Id=!1,l===this.Ed?(this.Ot({[Rt]:[Rw]}),this.A.error("Feature flag request failed",t),this.ev()&&this.Zd(!0),u()):u()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this.Rn.compression,sentAt:"body",timeoutMs:this.Rn.requestTimeoutMs}).then(t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},s=200!==t.statusCode;if(this.Id=!1,l===this.Ed){if(this.hv(t.statusCode),s||this.Ad||(this.$anon_distinct_id=void 0),!i.disable_flags||this.Ad){this.Pd=!s;var a=[];t.error?a.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?Rw:"unknown_error"):200!==t.statusCode&&a.push("api_error_"+t.statusCode),n.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");var h=!(null==(r=n.quotaLimited)||!r.includes("feature_flags"));h&&a.push("quota_limited"),this.Ot({[Rt]:a}),h?this.A.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.av(n,s,{partialResponse:o}),u()}}else u()}).catch(h)}catch(t){h(t)}}}$d(){return Vn(this.Od,3)}hv(t){this.Od=Gn(t,this.Od,3,()=>this.A.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.Pd)if(this.Md||this.getFlags()&&this.getFlags().length>0){if(!this.nv()){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.A.warn('getFeatureFlag for key "'+t+Iw)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e;return null==(e=this.getFeatureFlagResult(t,{send_event:!1}))?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.Pd)if(this.Md||this.getFlags()&&this.getFlags().length>0){if(!this.nv()){var i,r=this.getFlagVariants(),n=t in r,o=r[t],a=this.getFlagPayloads()[t],l=String(o),u=this.Yd("$feature_flag_request_id")||void 0,h=this.Yd("$feature_flag_evaluated_at")||void 0,d=this.Yd("$flag_call_reported")||{};if(this.Rn.deduplicateCallsPerSession){var v,c=null==(v=this.Js)?void 0:v.session.sessionId,f=this.Yd(It);c&&c!==f&&(d={},i=c)}if(e.send_event||!("send_event"in e))if(t in d&&d[t].includes(l))i&&this.Ot({[Mt]:d,[It]:i});else{var p,g,m,y,_,b,w,k,S,x,C,T,E;Ce(d[t])?d[t].push(l):d[t]=[l],this.Ot(s({[Mt]:d},i?{[It]:i}:{}));var M=this.getFeatureFlagDetails(t),I=[...null!==(p=this.Yd("$feature_flag_errors"))&&void 0!==p?p:[]];Ie(o)&&I.push("flag_missing");var R={$feature_flag:t,$feature_flag_response:o,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:u,$feature_flag_evaluated_at:h,$feature_flag_bootstrapped_response:null!==(g=null==(m=this.Rn.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(_=this.Rn.bootstrap)||null==(_=_.featureFlagPayloads)?void 0:_[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.Pd};Ie(null==M||null==(b=M.metadata)?void 0:b.has_experiment)||(R.$feature_flag_has_experiment=M.metadata.has_experiment),Ie(null==M||null==(w=M.metadata)?void 0:w.version)||(R.$feature_flag_version=M.metadata.version);var A=null!==(k=null==M||null==(S=M.reason)?void 0:S.description)&&void 0!==k?k:null==M||null==(x=M.reason)?void 0:x.code;A&&(R.$feature_flag_reason=A),null!=M&&null!=(C=M.metadata)&&C.id&&(R.$feature_flag_id=M.metadata.id),Ie(null==M?void 0:M.original_variant)&&Ie(null==M?void 0:M.original_enabled)||(R.$feature_flag_original_response=Ie(M.original_variant)?M.original_enabled:M.original_variant),null!=M&&null!=(T=M.metadata)&&T.original_payload&&(R.$feature_flag_original_payload=null==M||null==(E=M.metadata)?void 0:E.original_payload),I.length&&(R.$feature_flag_error=I.join(",")),this.dv(R)}else i&&this.Ot({[Mt]:d,[It]:i});if(n)return{key:t,enabled:!!o,variant:"string"==typeof o?o:void 0,payload:Ur(a)}}}else this.A.warn('getFeatureFlagResult for key "'+t+Iw)}dv(t){try{var e;null==(e=this.Js)||e.capture("$feature_flag_called",t).catch(t=>{this.A.error("Failed to capture feature flag call",t)})}catch(t){this.A.error("Failed to capture feature flag call",t)}}getRemoteConfigPayload(t,e){this.vv(t,e)}vv(t,e){var i=this;return a(function*(){var r=i.Js;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.sv();s.length&&(n.evaluation_contexts=s);var o,a=i.ov();Ie(a)||(n.flag_keys=a);try{var l;o=(null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.Rn.compression,sentAt:"body",timeoutMs:i.Rn.requestTimeoutMs})).json)||null==(l=l.featureFlagPayloads)?void 0:l[t])||void 0}catch(t){return void i.A.error("Remote config feature flag request failed",t)}try{e(o)}catch(t){i.A.error("Remote config feature flag callback failed",t)}}})()}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.Pd)return e.defaultValue;if(!(this.Md||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+Iw),e.defaultValue;var i=this.getFeatureFlag(t,e);return Ie(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.av(t,e,i)}av(t,e,i){if(this.Js){this.Md=!0;var r=function(t,e,i,r,n,o){void 0===e&&(e={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===o&&(o=Ew);var a=((t,e)=>{var i=t.flags;return i?s({},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!Ie(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,o),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=t.requestId,v=t.evaluatedAt;if(Ce(u)){o.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var c={};if(u)for(var f=0;u.length>f;f++)c[u[f]]=!0;return{[st]:u,[nt]:c,[ht]:!1}}var p=u,g=h,m=l;if(null!=n&&n.partialResponse){var y=Object.keys(p),_=g||{};p=s({},e,p),g=s({},i,_),y.forEach(t=>{var e;t in _||null==(e=g)||delete e[t]}),m=s({},r,m)}else if(t.errorsWhileComputingFlags)if(l){var b=new Set(Object.keys(l).filter(t=>{var e;return!(null!=(e=l[t])&&e.failed)}));p=s({},e,Object.fromEntries(Object.entries(p).filter(t=>b.has(t[0]))));var w=Object.fromEntries(Object.entries(g||{}).filter(t=>b.has(t[0])));g=s({},i,w),b.forEach(t=>{var e;t in w||null==(e=g)||delete e[t]}),m=s({},r,Object.fromEntries(Object.entries(m||{}).filter(t=>b.has(t[0]))))}else p=s({},e,p),g=s({},i,g),m=s({},r,m);return s({[st]:Object.keys(Pw(p)),[nt]:p||{},[lt]:g||{},[at]:m||{},[ht]:!0===t.minimalFlagCalledEvents},d?{[ut]:d}:{},v?{[At]:v}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);if(r)if(!1===(null==i?void 0:i.persist)){var n=!Ie(this.Js.kv.get(nt));this.tv=r,n||this.Ot(r)}else this.Vd(),this.rv(r,t,!(null==i||!i.partialResponse)),this.Ot(r);else e&&this.ev();e||(this.Fd=!1),this.Zd(e)}}override(t,e){void 0===e&&(e=!1),this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.fv(t)}fv(t){if(this.Js){if(!1===t)return this.Dt([dt,vt]),this.Zd(),void Mw.info("All overrides cleared");if(Ce(t))return this.Ot({[dt]:Aw(t)}),this.Zd(),void Mw.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.Sd=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[dt]=Ce(n)?Aw(n):n),s&&(r[vt]=s),Object.keys(r).length&&this.Ot(r),!1===n&&!1===s?this.Dt([dt,vt]):!1===n?this.Dt(dt):!1===s&&this.Dt(vt),this.Zd(),!1===n?Mw.info("Flag overrides cleared"):n&&Mw.info("Flag overrides set",{flags:n}),void(!1===s?Mw.info("Payload overrides cleared"):s&&Mw.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.Ot({[dt]:t}),this.Zd(),void Mw.info("Flag overrides set",{flags:t});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Md){var e=this.pv(),i=e.flags,r=e.flagVariants;try{t(i,r)}catch(t){this.A.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var r,n=(this.Yd("$early_access_features")||[]).find(e=>e.flagKey===t),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};n&&(a.$early_access_feature_name=n.name),i&&(a.$feature_enrollment_stage=i);var l=s({},this.getFlagVariants(),{[t]:e});null==(r=this._instance)||null==(r=r.persistence)||r.markCrossTabFeatureFlagChanges({[st]:[t],[nt]:[t],[ct]:Object.keys(o)}),this.Ot({[st]:Object.keys(Pw(l)),[nt]:l,[ct]:s({},this.Yd("$stored_person_properties")||{},o)}),this.Zd();try{var u;null==(u=this.Js)||u.capture("$feature_enrollment_update",a).catch(t=>{this.A.error("Failed to capture early access feature enrollment",t)})}catch(t){this.A.error("Failed to capture early access feature enrollment",t)}}getEarlyAccessFeatures(t,e,i){void 0===e&&(e=!1);var r=this.Yd(ot);!r||e?this.gv(t,i):t(r)}gv(t,e){var i=this;return a(function*(){var r=i.Js;if(r){var n,s=e?"&"+e.map(t=>"stage="+t).join("&"):"";try{var o=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;n=o.json.earlyAccessFeatures,i.Ot({[ot]:n})}catch(t){return void i.A.error("Early access feature request failed",t)}try{t(n)}catch(t){i.A.error("Early access feature callback failed",t)}}})()}pv(){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),{})}}Zd(t){this.Gd();var e=this.pv(),i=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach(e=>{try{e(i,r,{errorsLoading:t})}catch(t){this.A.error("Error while running feature flags callback",t)}})}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.mv(t,e)}mv(t,e){void 0===e&&(e=!0);var i=this.Yd("$stored_person_properties")||{},r=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),n=null==t?void 0:t.$set_once,o={};if(n)for(var a in n)({}).hasOwnProperty.call(n,a)&&(a in i||(o[a]=n[a]));this.Ot({[ct]:s({},i,o,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=s({},this.Yd("$stored_person_properties")||{});t.forEach(t=>{delete i[t]}),this.Ot({[ct]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.Dt(ct),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Yd("$stored_group_properties")||{},r=s({},i);for(var n of Object.keys(t))r[n]=s({},i[n],t[n]);this.Ot({[ft]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Yd("$stored_group_properties")||{};this.Ot({[ft]:s({},e,{[t]:{}})})}else this.Dt(ft)}reset(){this.Ed++,this.Ad=!1,this.xd={},this.Cd={},this.tv=void 0,this.Md=!1,this.Rd=!1,this.Pd=!1,this.$anon_distinct_id=void 0,this.Xd(),this.Sd=!1,this.Od=0}}},zw={sessionRecording:class{get Rn(){return this._instance.config}get sl(){return this._instance.persistence}get started(){var t;return!(null==(t=this.yv)||!t.isStarted)}get status(){var t,e;return"awaiting_config"===this.bv||"missing_config"===this.bv?this.bv:null!==(t=null==(e=this.yv)?void 0:e.status)&&void 0!==t?t:this.bv}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.bv=Vs,this._v=void 0,this.wv=!1,this.Ke=(()=>{var t;if(null==d||!d.visibilityState||"visible"===d.visibilityState)return!0;var e=null==l||null==(t=l.performance)||null==t.getEntriesByType?void 0:t.getEntriesByType("visibility-state");return!(null!=e&&e.length)||e.some(t=>"visible"===t.name)})(),this.ar=()=>{var t;"visible"===(null==d?void 0:d.visibilityState)&&(this.Ke=!0,null==(t=this.yv)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw sw.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this.Rn.cookieless_mode)throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');null!=d&&d.addEventListener&&Ln(d,"visibilitychange",this.ar)}initialize(){this.startIfEnabledOrStop()}dispose(t){var e=(void 0===t?{}:t).discardBufferedEvents,i=void 0!==e&&e;this.wv=!0,null==d||null==d.removeEventListener||d.removeEventListener("visibilitychange",this.ar),i?this.Sv(!0):this.stopRecording()}get xv(){var t,e=!(null==(t=this._instance.get_property(B))||!t.enabled),i=!this.Rn.disable_session_recording,r=this.Rn.disable_session_recording||this._instance.consent.isOptedOut();return l&&e&&i&&!r}startIfEnabledOrStop(t){var e;if(!(this.wv||this.xv&&null!=(e=this.yv)&&e.isStarted)){var i=!Ie(Object.assign)&&!Ie(Array.from);this.xv&&i?(this.Cv(t),sw.info("starting")):(this.bv=Vs,this.stopRecording())}}Cv(t){var e,i;if(this.xv)if("awaiting_config"!==this.bv&&"missing_config"!==this.bv&&(this.bv=Ks),null!=b&&null!=(e=b.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=b.__PosthogExtensions__)&&i.initSessionRecording)this.Tv(t);else{var r,n=this._instance.sessionManager;null==(r=b.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Mv,e=>{if(!this.wv&&this.xv&&this._instance.sessionManager===n)return e?(this._instance.register_for_session({[Ht]:!0}),sw.error("could not load recorder",e)):void this.Tv(t);this.bv=Vs})}}stopRecording(){var t,e;null==(t=this._v)||t.call(this),this._v=void 0,null==(e=this.yv)||e.stop()}Sv(t){var e,i;void 0===t&&(t=!1),null==(e=this._v)||e.call(this),this._v=void 0,null==(i=this.yv)||i.discard({discardProducerEvents:t})}Iv(){var t,e;null==(t=this.sl)||t.unregister(Q),null==(e=this.sl)||e.unregister(H)}Ev(t,e){if(Oe(t))return null;var i,r=Fe(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(sw.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}Rv(t){if(this.sl){var e,i,r=this.sl,n=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,n=this.Ev(null==(e=this.Rn.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.Ev(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=n?n:o;Oe(a)&&this.Iv();var l=null==i?void 0:i.minimumDurationMilliseconds;r.register({[B]:s({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:s({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:Ie(l)?null:l,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};n(),null==(e=this._v)||e.call(this),this._v=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.Rv(e),void this.Sv()):(this.Rv(e),void this.startIfEnabledOrStop()):("awaiting_config"===this.bv&&(this.bv="missing_config",sw.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.yv)&&i.log?this.yv.log(t,e):sw.warn("log called before recorder was ready")}get Mv(){var t;return(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.get_property("$session_recording_remote_config"))||null==(t=t.scriptConfig)?void 0:t.script)||"lazy-recorder"}Av(){var t,e=this._instance.get_property(B);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return sw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!Oe(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}Tv(t){var e,i,r;if(!this.wv&&this.xv&&this._instance.sessionManager){if(null==(e=b.__PosthogExtensions__)||!e.initSessionRecording)return sw.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Ht]:!0});var n;if(this.yv||(this.yv=null==(n=b.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.Ke),this.yv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Av()){if("missing_config"===this.bv||"awaiting_config"===this.bv)return;return this.bv="awaiting_config",sw.info("persisted remote config is stale, requesting fresh config before starting"),void new V_(this._instance).load()}this.bv=Ks,null==(i=(r=this.yv).setDocumentWasEverVisible)||i.call(r,this.Ke),this.yv.start(t)}else this.bv=Vs}onRRwebEmit(t){var e;null==(e=this.yv)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.yv||null==(t=this.sl)||t.register({[W]:!0}),null==(e=this.yv)||e.overrideLinkedFlag()}overrideSampling(){var t,e;this.yv||null==(t=this.sl)||t.register({[z]:!0}),null==(e=this.yv)||e.overrideSampling()}overrideTrigger(t){var e,i;this.yv||null==(e=this.sl)||e.register({["url"===t?V:G]:!0}),null==(i=this.yv)||i.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.yv)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.yv)||!i.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t;null==(t=this.yv)||null==t.flushBeforeIdentityReset||t.flushBeforeIdentityReset()}}},Ww={autocapture:class extends Xy{constructor(t){super(new Kb(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.Pv=this.Fv()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.Ov();return!!(t.path||t.search||this.$v(t))}startIfEnabled(){this.isEnabled&&(Cn.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Pv=this.Fv(),this.startIfEnabled()}stop(){this.Dv&&this.Dv(),this.Dv=void 0,this.Lv&&this.Lv(),this.Lv=void 0,Cn.info("History API monitoring stopped")}monitorHistoryChanges(){l&&l.history&&(this.Nv("pushState"),this.Nv("replaceState"),this.qv(),this.$v()&&this.jv())}Nv(t){var e;if(l&&(null==(e=l.history[t])||!e.__posthog_wrapped__)){var i=this;Zv(l.history,t,e=>function(r,n,s){e.call(this,r,n,s),i.Bv(t)})}}Fv(){var t=null==l?void 0:l.location;if(null!=t&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}Ov(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:Ee(t)?t:{}}$v(t){return void 0===t&&(t=this.Ov()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}Hv(t){var e=this.Ov(),i=this.Pv;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.$v(e)&&t.hash!==i.hash))}Bv(t){try{var e=this.Fv();if(!e)return;this.Hv(e)&&this._instance.capture(oe,{navigation_type:t}),this.Pv=e}catch(e){Cn.error("Error capturing "+t+" pageview",e)}}qv(){if(!this.Dv){var t=()=>{this.Bv("popstate")};Ln(l,"popstate",t),this.Dv=()=>{l&&l.removeEventListener("popstate",t)}}}jv(){if(!this.Lv){var t=()=>{this.Bv("hashchange")};Ln(l,"hashchange",t),this.Lv=()=>{l&&l.removeEventListener("hashchange",t)}}}},heatmaps:class{get Rn(){return this.instance.config}constructor(t){var e;this.zv=!1,this.Xs=!1,this.Uv=null,this.instance=t,this.zv=!(null==(e=this.instance.persistence)||!e.props[A]),this.rageclicks=new Gy(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Ee(this.Rn.capture_heatmaps)&&this.Rn.capture_heatmaps.flush_interval_milliseconds&&(t=this.Rn.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Oe(this.Rn.capture_heatmaps)?Oe(this.Rn.enable_heatmaps)?this.zv:this.Rn.enable_heatmaps:!1!==this.Rn.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Xs)return;ow.info("starting..."),this.Wv(),this.ar()}else{var t;clearInterval(null!==(t=this.Uv)&&void 0!==t?t:void 0),this.Vv(),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({[A]:i}),this.zv=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.Rt;return this.Rt=void 0,t}Gv(t){aw(t.originalEvent)&&this.vn(t.originalEvent,"deadclick")}ar(){this.Uv&&clearInterval(this.Uv),this.Uv="visible"===(null==d?void 0:d.visibilityState)?setInterval(this.Ja.bind(this),this.flushIntervalMilliseconds):null}Wv(){l&&d&&(this.Zv=this.Ja.bind(this),Ln(l,se,this.Zv),this.Jv=t=>this.vn(t||(null==l?void 0:l.event)),Ln(d,"click",this.Jv,{capture:!0}),this.Qv=t=>this.Kv(t||(null==l?void 0:l.event)),Ln(d,"mousemove",this.Qv,{capture:!0}),this.Xv=new y_(this.instance,g_,this.Gv.bind(this)),this.Xv.startIfEnabledOrStop(),this.Yv=this.ar.bind(this),Ln(d,ne,this.Yv),this.Xs=!0)}Vv(){var t;l&&d&&(this.Zv&&l.removeEventListener(se,this.Zv),this.Jv&&d.removeEventListener("click",this.Jv,{capture:!0}),this.Qv&&d.removeEventListener("mousemove",this.Qv,{capture:!0}),this.Yv&&d.removeEventListener(ne,this.Yv),clearTimeout(this.tc),null==(t=this.Xv)||t.stop(),this.Xs=!1)}ec(t,e){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,i){for(var r=t;r&&Kn(r)&&!Yn(r,"body");){if(r===i)return!1;var n=void 0;try{var s,o,a;n=null==(s=null!==(o=null==(a=r.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:l)?void 0:s.getComputedStyle(r).position}catch(t){return!1}if(ve(e,n))return!0;r=hs(r)}return!1}(os(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:r),y:t.clientY+(s?0:i),target_fixed:s,type:e}}vn(t,e){var i;if(void 0===e&&(e="click"),!Jn(t.target)&&aw(t)){var r=this.ec(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&ys(os(t),this.instance.config.rageclick)&&this.$s(s({},r,{type:"rageclick"})),this.$s(r)}}Kv(t){!Jn(t.target)&&aw(t)&&(clearTimeout(this.tc),this.tc=setTimeout(()=>{this.$s(this.ec(t,"mousemove"))},500))}$s(t){if(l){var e=this.Rn.disable_capture_url_hashes?lr(l.location.href):l.location.href,i=this.Rn.custom_personal_data_properties,r=zn(e,this.Rn.mask_personal_data_properties?[...rl,...i||[]]:[],sl);this.Rt=this.Rt||{},this.Rt[r]||(this.Rt[r]=[]),this.Rt[r].push(t)}}Ja(){this.Rt&&!Me(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:y_,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.zv=!1,this.Xs=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.rc=()=>{clearTimeout(this.nc),this.nc=void 0,0!==this.Rt.metrics.length&&(this._instance.capture("$web_vitals",s({$current_url:this.Rt.url},this.Rt.metrics.reduce((t,e)=>s({},t,{["$web_vitals_"+e.name+"_event"]:s({},e),["$web_vitals_"+e.name+"_value"]:e.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.sc=t=>{var e;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Oe(null==t?void 0:t.name)||Oe(null==t?void 0:t.value))tw.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.oc(i);if(!Ie(r)){var n=Fe(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.ac||this.ac>t.value){this.Rt.navigationKey!==n&&(this.rc(),this.nc=setTimeout(this.rc,this.flushToCaptureTimeoutMs)),Ie(this.Rt.navigationKey)&&(this.Rt.navigationKey=n,this.Rt.url=r),this.Rt.firstMetricTimestamp=Ie(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;var o=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),a=s({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,Ee(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var l={};for(var u of nw){var h="url"===u&&"string"==typeof t.attribution[u]?this.oc(t.attribution[u]):t.attribution[u];Ie(h)||(l[u]=h)}a.attribution=l}else delete a.attribution;Ie(o)||(a.$session_id=o.sessionId,a.$window_id=o.windowId),this.Rt.metrics.push(a),this.Rt.metrics.length===this.allowedMetrics.length&&this.rc()}else tw.error("Ignoring metric with value >= "+this.ac,t)}}},this.lc=()=>{if(!this.Xs){var t,e,i,r,n=!1,o=b.__PosthogExtensions__,a=null==o?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(null==a?void 0:a[this.uc])||("web-vitals"===this.uc&&Ie(a)?null==o?void 0:o.postHogWebVitalsCallbacks:void 0);if(!Ie(l)){var u=l.withoutAttribution,h=this.attributionMetrics;n=!Ie(u),t=h.indexOf("LCP")>-1?l.onLCP:(null==u?void 0:u.onLCP)||l.onLCP,e=h.indexOf("CLS")>-1?l.onCLS:(null==u?void 0:u.onCLS)||l.onCLS,i=h.indexOf("FCP")>-1?l.onFCP:(null==u?void 0:u.onFCP)||l.onFCP,r=h.indexOf("INP")>-1?l.onINP:(null==u?void 0:u.onINP)||l.onINP}if(t&&e&&i&&r){var d={reportSoftNavs:this.useSoftNavs},v=n&&this.attributionMetrics.indexOf("INP")>-1?s({},d,{includeProcessedEventEntries:!1}):d;this.allowedMetrics.indexOf("LCP")>-1&&t(this.sc.bind(this),d),this.allowedMetrics.indexOf("CLS")>-1&&e(this.sc.bind(this),d),this.allowedMetrics.indexOf("FCP")>-1&&i(this.sc.bind(this),d),this.allowedMetrics.indexOf("INP")>-1&&r(this.sc.bind(this),v),this.Xs=!0}else tw.error("web vitals callbacks not loaded - not starting")}},this.zv=!(null==(e=this._instance.persistence)||!e.props[D]),this.startIfEnabled()}get hc(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Ee(this.hc)?null==(t=this.hc)?void 0:t.web_vitals_allowed_metrics:void 0;return Oe(i)?(null==(e=this._instance.persistence)?void 0:e.props.$web_vitals_allowed_metrics)||iw:i}get flushToCaptureTimeoutMs(){return(Ee(this.hc)?this.hc.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=Ee(this.hc)?this.hc.web_vitals_attribution:void 0;return De(t)?t?iw:[]:Ce(t)?t:rw}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t;return null!==(t=Ee(this.hc)?this.hc.__preview_web_vitals_soft_navs:void 0)&&void 0!==t&&t}get ac(){var t=Ee(this.hc)&&Fe(this.hc.__web_vitals_max_value)?this.hc.__web_vitals_max_value:ew;return t>0&&6e4>=t?ew:t}get isEnabled(){var t=null==v?void 0:v.protocol;if("http:"!==t&&"https:"!==t)return tw.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Ee(this.hc)?this.hc.web_vitals:De(this.hc)?this.hc:void 0;return De(e)?e:this.zv}startIfEnabled(){this.isEnabled&&!this.Xs&&(tw.info("enabled, starting..."),this.bo(this.lc))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=Ee(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Ee(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[D]:i}),this._instance.persistence.register({[j]:r})),this.zv=i,this.startIfEnabled()}}}get uc(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}bo(t){var e=b.__PosthogExtensions__,i=this.uc,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&Ie(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,e=>{e?tw.error("failed to load script",e):t()})}oc(t){var e=t||(null==l?void 0:l.location.href);if(e){var i=this._instance.config.disable_capture_url_hashes?lr(e):e,r=this._instance.config.custom_personal_data_properties;return zn(i,this._instance.config.mask_personal_data_properties?[...rl,...r||[]]:[],sl)}tw.error("Could not determine current URL")}}},Vw={exceptionObserver:class{constructor(t){var e;this.lc=()=>{var t;if(l&&this.isEnabled&&null!=(t=b.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=b.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=b.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=b.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.dc&&this.Rn.capture_unhandled_errors&&(this.dc=e(this.captureException.bind(this))),!this.vc&&this.Rn.capture_unhandled_rejections&&(this.vc=i(this.captureException.bind(this))),!this.cc&&this.Rn.capture_console_errors&&(this.cc=r(this.captureException.bind(this)))}catch(t){Yb.error("failed to start",t),this.fc()}}},this._instance=t,this.gc=!(null==(e=this._instance.persistence)||!e.props[P]),this.wt=new Qe(s({},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,A:Yb})),this.Rn=this.mc(),this.startIfEnabledOrStop()}mc(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ee(t)?e=s({},e,t):(Ie(t)?this.gc:t)&&(e=s({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Rn.capture_console_errors||this.Rn.capture_unhandled_errors||this.Rn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Yb.info("enabled"),this.fc(),this.bo(this.lc)):this.fc()}bo(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",e=>{if(e)return Yb.error("failed to load script",e);t()})}fc(){var t,e,i;null==(t=this.dc)||t.call(this),this.dc=void 0,null==(e=this.vc)||e.call(this),this.vc=void 0,null==(i=this.cc)||i.call(this),this.cc=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.gc=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[P]:this.gc}),this.Rn=this.mc(),this.startIfEnabledOrStop())}}onConfigChange(){this.Rn=this.mc()}captureException(t){try{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";if(this.wt.consumeRateLimit(n))return void Yb.info("Skipping exception capture because of client rate limiting.",{exception:n});null==(r=this._instance.exceptions)||r.sendExceptionEvent(t)}catch(t){}}},exceptions:class{constructor(t){var e,i;this.yc=[],this.bc=zg(),this._instance=t,this.yc=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property("$error_tracking_suppression_rules"))&&void 0!==e?e:[],this._c=qr(this.wc()),this.kc=new jr(this._c)}onConfigChange(){this._c=qr(this.wc()),this.kc.setConfig(this._c)}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:[],o=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this.yc=s,this._instance.persistence&&this._instance.persistence.register({[O]:this.yc,[F]:o})}}}get Sc(){var t,e,i=!!this._instance.get_property(F);return null!==(t=null!==(e=this._instance.config.error_tracking.captureExtensionExceptions)&&void 0!==e?e:i)&&void 0!==t&&t}buildProperties(t,e){return this.bc.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this._c.enabled)try{if(!Re(t)||0===t.trim().length)return void qg.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)=>Lr.has(r)?(e.push(r),i):(i[r]=t[r],i),{}),droppedKeys:e}}(this.xc(e)),r=i.sanitizedProperties,n=i.droppedKeys;n.length>0&&qg.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.kc.add(s({[$r]:t,[Dr]:(new Date).toISOString()},r))}catch(t){qg.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Cc(e)){if(this.Tc(e))return this.Mc("Exception dropped: matched a suppression rule"),void qg.info("Skipping exception capture because a suppression rule matched");if(!this.Sc&&this.Ic(e))return this.Mc("Exception dropped: thrown by a browser extension"),void qg.info("Skipping exception capture because it was thrown by an extension");if(!this.Sc&&this.Ec(e))return this.Mc("Exception dropped: thrown by an injected browser script"),void qg.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Rc(e))return this.Mc("Exception dropped: thrown by the PostHog SDK"),void qg.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this._c.enabled&&Oe(t.$exception_steps)?this.Ac(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",Du:!0});return n&&this.kc.clear(),n}catch(t){return Ng(t)||qg.error("Failed to capture exception event. Dropping this exception.",t),void this.kc.clear()}}catch(t){return void(Ng(t)||qg.error("Failed to process exception event. Ignoring this exception.",t))}var s}Ac(t){try{var e=this.kc.getAttachable();return 0===e.length?t:s({},t,{$exception_steps:e})}catch(e){return qg.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Mc(t){this._c.enabled&&this.kc.add({[$r]:t,[Dr]:(new Date).toISOString()})}xc(t){return Ee(t)?s({},t):{}}wc(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}Tc(t){if(0===t.length)return!1;try{var e=t.reduce((t,e)=>{var i=e.type,r=e.value;return Re(i)&&i.length>0&&t.$exception_types.push(i),Re(r)&&r.length>0&&t.$exception_values.push(r),t},{$exception_types:[],$exception_values:[]});return this.yc.some(t=>{var i=t.values.map(t=>{var i=Ga[t.operator],r=e[t.key];if(!i||!r)return!1;var n=Ce(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 qg.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}Ic(t){var e=t.flatMap(t=>{var e,i;return null!==(e=null==(i=t.stacktrace)?void 0:i.frames)&&void 0!==e?e:[]}),i=e.filter(t=>{var e=t.filename;return!!e&&Ug.some(t=>e.startsWith(t))});return 0!==i.length&&(!i.every(t=>{var e=t.filename;return!!e&&e.startsWith(jg)})||t.some(t=>{var e=t.value;return"NoResponse"===t.type||Re(e)&&Bg.some(t=>{var i=t.value;return t.exact?e===i:e.includes(i)})})&&!e.some(t=>{var e=t.filename;return t.in_app&&!(null!=e&&e.startsWith(jg))}))}Ec(t){return t.some(t=>{var e=t.value;return Re(e)&&Hg.some(t=>e.includes(t))})}Rc(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:[];return null!==(r=null==(n=s[s.length-1])||null==(n=n.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Cc(t){return!Oe(t)&&Ce(t)}}},Gw=s({productTours:class{get sl(){return this._instance.persistence}constructor(t){this.Pc=null,this.Fc=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.sl&&this.sl.register({[N]:!!e.productTours}),!uw(this._instance))return!this.Pc&&Oe(null==(i=this.sl)?void 0:i.props.ph_product_tours)||lw.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.Pc)||r.stop(),this.Pc=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Pc&&uw(this._instance)&&this.bo(()=>this.Oc())}bo(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",e=>{e?lw.error("Could not load product tours script",e):t()})}Oc(){var t;!this.Pc&&null!=(t=b.__PosthogExtensions__)&&t.generateProductTours&&(this.Pc=b.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Ce(this.Fc)||e){var i=this.sl;if(i){var r=i.props[wt];if(Ce(r)&&!e)return this.Fc=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(uw(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||lw.warn(n):lw.error(n),void t([],{isLoaded:!1,error:n})}var s=Ce(e.json.product_tours)?e.json.product_tours:[];this.Fc=s,i&&i.register({[wt]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Fc,{isLoaded:!0})}getActiveProductTours(t){Oe(this.Pc)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Pc.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Pc)||e.showTourById(t)}previewTour(t){this.Pc?this.Pc.previewTour(t):this.bo(()=>{var e;this.Oc(),null==(e=this.Pc)||e.previewTour(t)})}dismissProductTour(){var t;null==(t=this.Pc)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Pc)||t.nextStep()}previousStep(){var t;null==(t=this.Pc)||t.previousStep()}clearCache(){var t;this.Fc=null,null==(t=this.sl)||t.unregister(wt)}resetTour(t){var e;null==(e=this.Pc)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Pc)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Pc)||e.cancelPendingTour(t)}}},Hw),Zw={siteApps:class{constructor(t){this._instance=t,this.$c=0,this.Dc=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Lc(t,e){if(e){var i=this.globalsForEvent(e);this.Dc.push(i),this.Dc.length>1e3&&(this.Dc=this.Dc.slice(10))}}get siteAppLoaders(){var t;return null==(t=b._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Lc.bind(this));this.Nc=()=>{t(),this.Dc=[],this.Nc=void 0}}}globalsForEvent(t){var e,i,o,a,l,u,h;if(!t)throw new Error("Event payload is required");var d={},v=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var f of Object.entries(c)){var p=f[0];d[p]={id:v[p],type:p,properties:f[1]}}var g=t.$set_once,m=t.$set;return{event:s({},n(t,r),{properties:s({},t.properties,m?{$set:s({},null!==(e=null==(i=t.properties)?void 0:i.$set)&&void 0!==e?e:{},m)}:{},g?{$set_once:s({},null!==(o=null==(a=t.properties)?void 0:a.$set_once)&&void 0!==o?o:{},g)}:{}),elements_chain:null!==(l=null==(u=t.properties)?void 0:u.$elements_chain)&&void 0!==l?l:"",distinct_id:null==(h=t.properties)?void 0:h.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}}qc(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)||(hw.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)||(hw.error("prepare_external_dependency_script returned null"),null):t}jc(){var t,e,i,r,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==d?void 0:d.defaultView,u=null==l||null==(t=l.Node)?void 0:t.prototype;if(!l||!u)return()=>{};if(this.$c++,this.Bc)return this.Hc();var h=[],v=this,c=new WeakSet,f=(t,e,i)=>{if(null!=t&&t[e]){var r=t[e];t[e]=i(r),h.push(()=>{t[e]=r})}},p=t=>{if(c.has(t))return t;var e=v.qc(t);return e&&c.add(e),e},g=t=>t.map(t=>"string"==typeof t?t:p(t)).filter(t=>!Pe(t));return f(u,"appendChild",t=>function(e){var i=p(e);return i?t.call(this,i):e}),f(u,"insertBefore",t=>function(e,i){var r=p(e);return r?t.call(this,r,i):e}),f(u,"replaceChild",t=>function(e,i){var r=p(e);return r?t.call(this,r,i):i}),[null==(e=l.Element)?void 0:e.prototype,null==(i=l.Document)?void 0:i.prototype,null==(r=l.DocumentFragment)?void 0:r.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==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.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==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",t=>function(e,i){var r=p(i);return r?t.call(this,e,r):null}),this.Bc=()=>{h.forEach(t=>t()),this.Bc=void 0},this.Hc()}Hc(){var t=!1;return()=>{var e;t||(t=!0,this.$c--,0===this.$c&&(null==(e=this.Bc)||e.call(this)))}}zc(t,e){void 0===e&&(e=!0);var i=this.jc();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.Dc.length&&(hw.info("Processing "+this.Dc.length+" events for site app with id "+t.id),this.Dc.forEach(t=>this.zc(()=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every(t=>t.processedBuffer||t.errored)&&(null==(i=this.Nc)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,hw.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.zc(e=>t.init({posthog:this._instance,callback(t){e(),n(t)}}),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){hw.error(dw+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){hw.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}Uc(){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)}Wc(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.zc(()=>null==r.processEvent?void 0:r.processEvent(i))}catch(e){hw.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.Uc(),void this._instance.on("eventCaptured",t=>this.Wc(t))):void hw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Nc)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var o=function(){var t,e=a.id,i=a.url;b["__$$ph_site_app_"+e]=n._instance,null==(t=b.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,t=>{if(t)return hw.error(dw+e,t)})};for(var a of s.siteApps)o()}else hw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},Qw={tracingHeaders:class{constructor(t){this._instance=t,this.Vc=void 0,this.Gc=void 0,this.Zc=void 0,this.lc=()=>{var t,e,i=this.Jc();i?(Ie(this.Vc)&&(this.Vc=null==(t=b.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Ie(this.Gc)&&(this.Gc=null==(e=b.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.fc()}}initialize(){this.startIfEnabledOrStop()}bo(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",e=>{if(e)return Xb.error("failed to load script",e);t()})}Qc(){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}Jc(){var t=this.Qc();return Ce(t)?(Ce(this.Zc)?this.Zc.splice(0,this.Zc.length,...t):this.Zc=[...t],t.length>0?this.Zc:void 0):(Ce(this.Zc)&&this.Zc.splice(0),this.Zc=t||void 0,this.Zc)}fc(){var t,e;null==(t=this.Vc)||t.call(this),null==(e=this.Gc)||e.call(this),this.Vc=void 0,this.Gc=void 0}startIfEnabledOrStop(){this.Jc()?this.bo(this.lc):this.fc()}}},Jw=s({surveys:class extends pw{constructor(t){var e;super(new ww(t),(e=t,{get projectToken(){return e.config.token},kv:new bw(e)})),this._instance=t}ah(t,e){var i=e.query?Y_(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})})}}},Hw),Kw={toolbar:class{constructor(t){this.instance=t}Kc(t){b.ph_toolbar_state=t}Xc(){var t;return null!==(t=b.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,i){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),Nn(this.instance.config))return!1;if(!l||!d)return!1;t=null!=t?t:l.location,i=null!=i?i:l.history;try{if(!e){try{l.localStorage.setItem("test","test"),l.localStorage.removeItem("test")}catch(t){return!1}e=null==l?void 0:l.localStorage}var r,n=kw||Wn(t.hash,"__posthog")||Wn(t.hash,"state"),s=n?An(()=>JSON.parse(atob(decodeURIComponent(n))))||An(()=>JSON.parse(decodeURIComponent(n))):null;return s&&"ph_authorize"===s.action?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?t.hash=s.desiredHash:i?i.replaceState(i.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(Sw)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(t){return!1}}Yc(t){var e=b.ph_load_toolbar||b.ph_load_editor;!Oe(e)&&Te(e)?e(t,this.instance):xw.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==d||!d.getElementById("__POSTHOG_TOOLBAR__"));if(!l||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=s({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(l.localStorage.setItem(Sw,JSON.stringify(s({},r,{source:void 0}))),2===this.Xc())this.Yc(r);else if(0===this.Xc()){var n;this.Kc(1),null==(n=b.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"toolbar",t=>{if(t)return xw.error("[Toolbar] Failed to load",t),void this.Kc(0);this.Kc(2),this.Yc(r)}),Ln(l,"turbolinks:load",()=>{this.Kc(0),this.loadToolbar(r)})}return!0}tf(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)}}},Yw=s({experiments:class t{get Rn(){return this._instance.config}constructor(e){var i=this;this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),i.getWebExperiments(e=>{t.ef("retrieved web experiments from the server"),i.if=new Map,e.forEach(e=>{if(e.feature_flag_key){var r;i.if&&(t.ef("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=i.if)||r.set(e.feature_flag_key,e));var n=i._instance.getFeatureFlag(e.feature_flag_key);Re(n)&&e.variants[n]&&i.rf(e.name,n,e.variants[n].transforms)}else if(e.variants)for(var s in e.variants){var o=e.variants[s];t.nf(o,i._instance)&&i.rf(e.name,s,o.transforms)}})},e)},this._instance.onFeatureFlags(t=>{this.onFeatureFlags(t)})}initialize(){}onFeatureFlags(e){if(this._is_bot())t.ef(Ow);else if(!this.Rn.disable_web_experiments){if(Oe(this.if))return this.if=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.ef("applying feature flags",e),e.forEach(t=>{var e;if(this.if&&null!=(e=this.if)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.if)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.rf(n.name,r,n.variants[r].transforms)}})}}previewWebExperiment(){var e=t.getWindowLocation();if(null!=e&&e.search){var i=Hn(null==e?void 0:e.search,"__experiment_id"),r=Hn(null==e?void 0:e.search,"__experiment_variant");i&&r&&(t.ef("previewing web experiments "+i+" && "+r),this.getWebExperiments(t=>{this.sf(parseInt(i),r,t)},!1,!0))}}loadIfEnabled(){this.Rn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.Rn.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.Rn.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}sf(e,i,r){var n=r.filter(t=>t.id===e);n&&n.length>0&&(t.ef("Previewing web experiment ["+n[0].name+"] with variant ["+i+"]"),this.rf(n[0].name,i,n[0].variants[i].transforms))}static nf(e,i){return!Oe(e.conditions)&&t.af(e,i)&&t.lf(e)}static af(e,i){var r;if(Oe(e.conditions)||Oe(null==(r=e.conditions)?void 0:r.url))return!0;var n=t.getWindowLocation();if(n){var s,o,a,l=Zn(i,n.href);return null==(s=e.conditions)||!s.url||Fw[null!==(o=null==(a=e.conditions)?void 0:a.urlMatchType)&&void 0!==o?o:"icontains"](e.conditions.url,l)}return!1}static getWindowLocation(){return null==l?void 0:l.location}static lf(t){var e;if(Oe(t.conditions)||Oe(null==(e=t.conditions)?void 0:e.utm))return!0;var i=al();if(i.utm_source){var r,n,s,o,a,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==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.utm_source,c=null==(a=t.conditions)||null==(a=a.utm)||!a.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 ef(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];Cn.info("[WebExperiments] "+t,i)}rf(e,i,r){this._is_bot()?t.ef(Ow):"control"!==i?r.forEach(r=>{var n;r.selector&&(t.ef("applying transform of variant "+i+" for experiment "+e+" ",r),null==(n=document)||null==(n=n.querySelectorAll(r.selector))||n.forEach(t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}):t.ef("Control variants leave the page unmodified.")}_is_bot(){return h&&this._instance?_b(h,this.Rn.custom_blocked_useragents):void 0}}},Hw),Xw=s({},Hw,zw,Ww,Vw,Gw,Zw,Jw,Qw,Kw,Yw,{conversations:class{constructor(t){this._instance=t,this.uf=void 0,this._conversationsManager=null,this.hf=!1,this.re=null,this.df=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.vf=t.ok,t.ok)){var e=t.config.conversations;Oe(e)||(De(e)?this.uf=e:(this.uf=e.enabled,this.re=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.uf=void 0,this.re=null,this.vf=void 0,this.df=!1}loadIfEnabled(){if(!(this._conversationsManager||this.hf||this._instance.config.disable_conversations||Nn(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==b?void 0:b.__PosthogExtensions__;if(t&&!Ie(this.uf)&&this.uf)if(this.re&&this.re.token){this.hf=!0;try{var e=t.initConversations;if(e)return this.cf(e),void(this.hf=!1);var i=t.loadExternalDependency;if(!i)return void this.ff(te);i(this._instance,"conversations",e=>{e||!t.initConversations?this.ff("Could not load conversations script",e):this.cf(t.initConversations),this.hf=!1})}catch(t){this.ff("Error initializing conversations",t),this.hf=!1}}else $w.error("Conversations enabled but missing token in remote config.")}}cf(t){if(this.re)try{this._conversationsManager=t(this.re,this._instance),this.df=!1,$w.info("Conversations loaded successfully")}catch(t){this.ff("Error completing conversations initialization",t)}else $w.error("Cannot complete initialization: remote config is null")}ff(t,e){$w.error(t,e),this._conversationsManager=null,this.hf=!1,this.df=!0}show(){this._conversationsManager?this._conversationsManager.show():$w.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.uf&&!Pe(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Nn(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.vf?"remote_config_failed":Ie(this.uf)?this.vf?"disabled_in_project":"remote_config_pending":this.uf?Oe(this.re)||!this.re.token?"missing_token":null!=b&&b.__PosthogExtensions__?this.hf?"initializing":this.df?"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 a(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,i):($w.warn(Dw),null)})()}getMessages(t,e){var i=this;return a(function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):($w.warn(Dw),null)})()}markAsRead(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):($w.warn(Dw),null)})()}getTickets(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):($w.warn(Dw),null)})()}requestRestoreLink(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):($w.warn(Dw),null)})()}restoreFromToken(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):($w.warn(Dw),null)})()}restoreFromUrlToken(){var t=this;return a(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():($w.warn(Dw),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}Wu(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Vu(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},{logs:class{constructor(t){var e,i=this;this._instance=t,this.name=np,this.pf=!1,this.gf=!1,this.mf=!1,this.A=Tn("[logs]"),this.yf=s({},this.A,{error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];e.some(Uw)||i.A.error(...e)}}),this.La=[],this.bf=[],this.Od=0,this.ro=!1,this._f=[],this.wf=[],this.kf=!1,this.Sf=!1,this.xf=()=>{var t,e;this.ro||(this.Od=0,null==(t=this.Cf)||t.onReconnect(),null==(e=this.Tf)||e.onReconnect())},this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.pf=!0),l&&Ln(l,"online",this.xf)}Mf(t,e,i,r){var n,s=Lw(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new gn(this.If(t,e),s,this.yf,()=>this.Ef(),t=>t(),void 0,r),s]}Rf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Cf||this.Af!==e){var i;null==(i=this.Cf)||i.reset(),this.Af=e;var r=this.Mf(()=>this.La,t=>{this.La=t});this.Cf=r[0],this.Pf=r[1]}return this.Cf}Ff(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Tf||this.Of!==e){var i;null==(i=this.Tf)||i.reset(),this.Of=e;var r=this.Mf(()=>this.bf,t=>{this.bf=t},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},qw);this.Tf=r[0],this.$f=r[1]}return this.Tf}setup(t){var e;if(!this.ro){this.Js=t,null!=(e=this._instance)&&null!=(e=e.config)&&null!=(e=e.logs)&&e.captureConsoleLogs&&(this.pf=!0),(this.pf||this.Df()&&this.Lf())&&this.Nf();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.ro?r.dispose():(this.oo=r,i||this.loadIfEnabled())}}dispose(){var t,e,i,r;this.ro||(this.ro=!0,this.qf(),null==(t=this.oo)||t.dispose(),this.oo=void 0,this.Js=void 0,this.mf=!1,null==l||l.removeEventListener("online",this.xf),null==(e=this.jf)||e.call(this),this.jf=void 0,null==(i=this.Cf)||i.reset(),null==(r=this.Tf)||r.reset())}onRemoteConfig(t){var e,i;if(!this.ro){var r=t.ok?null==(e=t.config.logs)?void 0:e.captureConsoleLogs:void 0;Oe(r)?this.Bf():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[q]:!!r}),r?(this.pf=!0,this.gf||this.Nf(),this.loadIfEnabled()):this.Bf())}}reset(){var t,e,i,r;this.qf(),null==(t=this.Cf)||t.clearQueue(),this.La=[],null==(e=this.Cf)||e.reset(),null==(i=this.Tf)||i.clearQueue(),this.bf=[],null==(r=this.Tf)||r.reset(),this.Od=0}captureLog(t){this.ro||this.Rf().captureLog(t)}captureConsoleLog(t){this.ro||this.Ff().captureLog(t)}captureBufferedConsoleLog(t,e,i){this.ro||this.Ff().captureLog(t,{context:e,occurredAtMs:i})}Lf(){var t;return!(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.props)||!t[q])}Df(){var t,e;return null==(t=this._instance)||null==t.Fa||!t.Fa()||!(null==(e=b._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])||!e.config)}Zu(){var t;this.qf(),null==(t=this.Tf)||t.clearQueue(),this.bf=[]}Bf(){this.pf||this.qf()}Nf(){var t,e=this;if(!this.kf&&null!=b&&b.console){var i=Lw(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=Tg(b.console[t])}catch(t){return 0}if(!r)return 0;e.wf.push(Zv(b.console,t,n=>{var s=function(){for(var r=arguments.length,s=new Array(r),o=0;r>o;o++)s[o]=arguments[o];try{e.Hf(t,s,i)}catch(t){}return n.apply(b.console,s)};return s.__rrweb_original__=r,s}))};for(var n of Nw)r(n);this.kf=!0,this.zf=setTimeout(()=>{this.qf()},3e4)}}Hf(t,e,i){var r;if(this.kf&&!this.Sf&&0!==e.length)if(null!=(r=this._instance)&&r.is_capturing()){if(i>this._f.length){this.Sf=!0;try{this._f.push({level:t,args:e,occurredAtMs:Date.now(),context:this.Ef()})}finally{this.Sf=!1}}}else this.qf()}qf(){if(this._f=[],this.kf){for(var t of(this.kf=!1,this.zf&&(clearTimeout(this.zf),this.zf=void 0),this.wf))t();this.wf=[]}}Uf(){var t=this._f;return this.qf(),t}get logger(){return this.Wf||(this.Wf={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.Wf}flushLogs(t){t?this.Vf(t):(this.Cf&&this.Cf.flush().catch(t=>this.Gf(t)),this.Tf&&this.Tf.flush().catch(t=>this.Gf(t)))}Gf(t){Uw(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.ro&&this.pf&&!this.gf&&!this.mf){var t=null==b?void 0:b.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.qf();var e=t.loadExternalDependency;if(!e)return this.A.error(te),void this.qf();this.mf=!0;try{e(this._instance,"logs",e=>{if(this.mf=!1,!this.ro&&this.pf){var i=t.logs;if(e||null==i||!i.initializeLogs)this.A.error("Could not load logs script",e),this.qf();else{var r,n,s=this.Uf();this.jf=i.initializeLogs(null!==(r=this.Js)&&void 0!==r?r:this._instance),this.gf=!0,s.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(n=this.Js)&&void 0!==n?n:this._instance,s))}}})}catch(t){throw this.mf=!1,t}}}If(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===ge.LogsQueue?t():void 0,setPersistedProperty(t,i){t===ge.LogsQueue&&e(null!=i?i:[])},xs:t=>this.xs(t),getLibraryId:()=>Aa.LIB_NAME,getLibraryVersion:()=>Aa.LIB_VERSION}}xs(t){return new Promise(e=>{if(Vn(this.Od,3))e({kind:"fatal",error:Bw(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=t=>{i||(i=!0,clearTimeout(n),e(t))},n=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:Bw(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Zf(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.Jf(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.A.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:Bw(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)})}}})}})}Jf(t){(0!==t||this._instance.__loaded)&&(this.Od=Gn(t,this.Od,3,()=>this.A.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.")))}Vf(t){this.La.length>0&&this.Qf(t,this.La,this.Pf,Aa.LIB_NAME,t=>{this.La=t}),this.bf.length>0&&this.Qf(t,this.bf,this.$f,qw,t=>{this.bf=t})}Qf(t,e,i,r,n){if(0!==e.length){var s=e.map(t=>t.record);n([]);var o=pn(s,fn(i,Aa.LIB_NAME,Aa.LIB_VERSION),r,Aa.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Zf(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}Zf(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Ef(){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,Oe(n)||(e.sessionStartTimestamp=n),Oe(s)||(e.lastActivityTimestamp=s)}if(null!=b&&null!=(t=b.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?lr(b.location.href):b.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},{metrics:class{constructor(t){this._instance=t,this.A=Tn("[metrics]")}initialize(){}Rf(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Cf&&this.Af===i||(null==(e=this.Cf)||e.reset(),this.Af=i,this.Cf=new bn(this.If(),function(t){var e,i,r,n,s,o=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==o?void 0:o["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==o?void 0:o["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==o?void 0:o["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:o,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.A)),this.Cf}count(t,e,i){void 0===e&&(e=1),this.Rf().count(t,e,i)}gauge(t,e,i){this.Rf().gauge(t,e,i)}histogram(t,e,i){this.Rf().histogram(t,e,i)}flush(t){if(!this.Cf)return Promise.resolve();if(t){var e=this.Cf.drainWindow();return e&&this.js(e,t),Promise.resolve()}return this.Cf.flush().catch(t=>this.A.error("PostHog metrics flush failed:",t))}reset(){var t;null==(t=this.Cf)||t.reset()}If(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},js:t=>e.js(t),getLibraryId:()=>Aa.LIB_NAME,getLibraryVersion:()=>Aa.LIB_VERSION}}js(t,e){return new Promise(i=>{var r=!1,n=t=>{r||(r=!0,clearTimeout(o),i(t))},o=setTimeout(()=>n({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(s({method:"POST",url:this.Kf(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e,i=t.statusCode;n(i>=200&&300>i?{kind:"ok"}:413===i?{kind:"too-large"}:0!==i&&408!==i&&429!==i&&500>i?{kind:"fatal",error:new Error("metrics request failed with status "+i)}:{kind:"retry-later",error:null!==(e=t.error)&&void 0!==e?e:new Error("metrics request failed with status "+i)})}}))})}Kf(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});Jb.__defaultExtensionClasses=s({},Xw);var tk=function(){Aa.SDK_DIST_CHANNEL="npm";var t=Ob[Hb]=new Jb;return function(){function t(){t.done||(t.done=!0,zb=!1,Mn(Ob,function(t){t._dom_loaded()}))}null!=d&&d.addEventListener?"complete"===d.readyState?t():Ln(d,"DOMContentLoaded",t,{capture:!1}):l&&Cn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}(),ek=tk;export{Lf as Compression,j_ as DEFAULT_PRODUCT_TOUR_APPEARANCE,Zf as DisplaySurveyType,Jb as PostHog,B_ as ProductTourEventName,U_ as ProductTourEventProperties,Vf as SurveyEventName,Gf as SurveyEventProperties,Nf as SurveyEventType,jf as SurveyPosition,zf as SurveyQuestionBranchingType,Hf as SurveyQuestionType,Wf as SurveySchedule,Bf as SurveyTabPosition,Uf as SurveyType,qf as SurveyWidgetType,ek as default,tk as posthog,G_ as severityLevels};
|
|
1
|
+
var t,e=["type"],i=["retriesPerformedSoFar"],r=["$set_once","$set"];function n(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}function s(){return s=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},s.apply(null,arguments)}function o(t,e,i,r,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void i(t)}a.done?e(l):Promise.resolve(l).then(r,n)}function a(t){return function(){var e=this,i=arguments;return new Promise(function(r,n){var s=t.apply(e,i);function a(t){o(s,r,n,a,l,"next",t)}function l(t){o(s,r,n,a,l,"throw",t)}a(void 0)})}}var l="u">typeof window?window:void 0,u="u">typeof globalThis?globalThis:l,h=null==u?void 0:u.navigator,d=null==u?void 0:u.document,v=null==u?void 0:u.location,c=null==u?void 0:u.fetch,f=null!=u&&u.XMLHttpRequest&&"withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:void 0,p=null==u?void 0:u.AbortController,g=null==u?void 0:u.CompressionStream,m=null==h?void 0:h.userAgent;function y(){return!(!l||!1===l.navigator.onLine)}var _="undefined"!=typeof globalThis?globalThis:l;_&&"undefined"==typeof self&&(_.self=_),_&&"undefined"==typeof File&&(_.File=function(){});var b=null!=l?l:{},w="$people_distinct_id",k="distinct_id",S="$device_id",x="$device_model",C="__alias",T="__cmpns",E="$fbc",M="$fbc_persistence",I="__timers",R="$autocapture_disabled_server_side",A="$heatmaps_enabled_server_side",P="$exception_capture_enabled_server_side",O="$error_tracking_suppression_rules",F="$error_tracking_capture_extension_exceptions",D="$web_vitals_enabled_server_side",L="$dead_clicks_enabled_server_side",N="$product_tours_enabled_server_side",q="$logs_capture_enabled_server_side",j="$web_vitals_allowed_metrics",B="$session_recording_remote_config",U="$session_recording_enabled_server_side",H="$replay_sample_rate",z="$replay_override_sampling",W="$replay_override_linked_flag",V="$replay_override_url_trigger",G="$replay_override_event_trigger",Z="$sesid",Q="$session_is_sampled",J="$session_past_minimum_duration",K="$session_recording_url_trigger_activated_session",Y="$session_recording_event_trigger_activated_session",X="$posthog_sr_group_event_trigger_",tt="$posthog_sr_group_url_trigger_",et="$posthog_sr_group_sampling_",it="$debug_first_full_snapshot_timestamp",rt="$sess_rec_flush_size",nt="$enabled_feature_flags",st="$active_feature_flags",ot="$early_access_features",at="$feature_flag_details",lt="$feature_flag_payloads",ut="$feature_flag_request_id",ht="$minimal_flag_called_events",dt="$override_feature_flags",vt="$override_feature_flag_payloads",ct="$stored_person_properties",ft="$stored_group_properties",pt="$groups",gt="$surveys",mt="$surveys_loaded_at",yt="$surveys_activated",_t="$surveys_activated_session",bt="$surveys_activated_timestamps",wt="ph_product_tours",kt="$product_tours_activated",St="$product_tours_activated_session",xt="$conversations_widget_session_id",Ct="$conversations_ticket_id",Tt="$conversations_widget_state",Et="$conversations_user_traits",Mt="$flag_call_reported",It="$flag_call_reported_session_id",Rt="$feature_flag_errors",At="$feature_flag_evaluated_at",Pt="$user_state",Ot="$client_session_props",Ft="$capture_rate_limit",$t="$initial_campaign_params",Dt="$initial_referrer_info",Lt="$initial_person_info",Nt="$epp",qt="$posthog_cookieless",jt="$cookieless_mode",Bt="$sdk_debug_extensions_init_method",Ut="$sdk_debug_extensions_init_time_ms",Ht="$sdk_debug_recording_script_not_loaded",zt="$sdk_debug_replay_event_trigger_status",Wt="$sdk_debug_replay_linked_flag_trigger_status",Vt="$sdk_debug_replay_matched_recording_trigger_groups",Gt="$sdk_debug_replay_pending_trigger_conditions",Zt="$sdk_debug_replay_remote_trigger_matching_config",Qt="$sdk_debug_replay_trigger_groups_count",Jt="$sdk_debug_replay_url_trigger_status",Kt="$sdk_debug_rrweb_attached",Yt="$sdk_debug_rrweb_start_attempted",Xt="$session_recording_start_reason",te="PostHog loadExternalDependency extension not found.",ee="anonymous",ie="identified",re="identified_only",ne="visibilitychange",se="beforeunload",oe="$pageview",ae="$pageleave",le="$identify",ue="$groupidentify",he=["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","pinterestbot","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"],de=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return he.concat(e).some(t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)})};function ve(t,e){return-1!==t.indexOf(e)}var ce=function(t){return t.trim()},fe=function(t){return t.replace(/^\$/,"")};function pe(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 ge=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}({}),me=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),ye="min_length",_e="max_length",be=["$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"],we=["token"],ke=Object.prototype,Se=ke.hasOwnProperty,xe=ke.toString,Ce=Array.isArray||function(t){return"[object Array]"===xe.call(t)},Te=t=>"function"==typeof t,Ee=t=>t===Object(t)&&!Ce(t),Me=t=>{if(Ee(t)){for(var e in t)if(Se.call(t,e))return!1;return!0}return!1},Ie=t=>void 0===t,Re=t=>"[object String]"==xe.call(t),Ae=t=>Re(t)&&0===t.trim().length,Pe=t=>null===t,Oe=t=>Ie(t)||Pe(t),Fe=t=>"[object Number]"==xe.call(t)&&t==t,$e=t=>Fe(t)&&t>0,De=t=>"[object Boolean]"===xe.call(t),Le=t=>t instanceof FormData,Ne=t=>ve(be,t),qe=t=>ve(we,t);function je(t){return null===t||"object"!=typeof t}function Be(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Ue(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 ze(t,Error)}}function He(t){return"u">typeof Event&&ze(t,Event)}function ze(t,e){try{return t instanceof e}catch(t){return!1}}var We=[!0,"true",1,"1","yes"],Ve=t=>ve(We,t),Ge=[!1,"false",0,"0","no"];function Ze(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),Fe(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),Ze(null!=n?n:i,e,i,r))}var Qe=class{constructor(t){this.C={},this.I=t.I,this.R=Ze(t.bucketSize,0,100,t.A),this.O=Ze(t.refillRate,0,this.R,t.A),this.N=Ze(t.refillInterval,0,864e5,t.A)}F(t,e){var i=Math.floor((e-t.lastAccess)/this.N);i>0&&(t.tokens=Math.min(t.tokens+i*this.O,this.R),t.lastAccess=t.lastAccess+i*this.N)}consumeRateLimit(t){var e,i=Date.now(),r=String(t),n=this.C[r];return n?this.F(n,i):this.C[r]=n={tokens:this.R,lastAccess:i},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}},Je="Mobile",Ke="Android",Ye="Tablet",Xe="Android Tablet",ti="iPad",ei="Apple Watch",ii="Safari",ri="BlackBerry",ni="Samsung Internet",si="Chrome",oi="Chrome iOS",ai="Internet Explorer",li="Internet Explorer Mobile",ui="Opera",hi="Microsoft Edge",di="Firefox",vi="Firefox iOS",ci="Nintendo",fi="PlayStation",pi="Xbox",gi="Android Mobile",mi="Mobile Safari",yi="Windows",_i="Windows Phone",bi="Nokia",wi="Ouya",ki="Generic "+Je.toLowerCase(),Si="Generic "+Ye.toLowerCase(),xi="Konqueror",Ci="Oculus Browser",Ti="Vivaldi",Ei="Yandex",Mi="Whale",Ii="DuckDuckGo",Ri="Pale Moon",Ai="Waterfox",Pi="Brave",Oi="Claude",Fi="Codex",$i="ChatGPT",Di="Google Search App",Li=new RegExp("Version/(\\d+(\\.\\d+)?)"),Ni=new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),qi=new RegExp(pi,"i"),ji=new RegExp("PlayStation \\w+","i"),Bi=new RegExp("Nintendo \\w+","i"),Ui=new RegExp("BlackBerry|PlayBook|BB10","i"),Hi={"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"},zi=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?Pi:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&ve(t,"GSA/")?Di:ve(t," OPR/")&&ve(t,"Mini")?"Opera Mini":ve(t," OPR/")?ui:Ui.test(t)?ri:ve(t,"IEMobile")||ve(t,"WPDesktop")?li:ve(t,"OculusBrowser")?Ci:ve(t,"SamsungBrowser")?ni:ve(t,"Edge")||ve(t,"Edg/")?hi:ve(t,"Vivaldi/")?Ti:ve(t,"YaBrowser/")?Ei:ve(t,"Whale/")?Mi:ve(t,"DuckDuckGo/")||ve(t,"Ddg/")?Ii:ve(t,"Claude/")?Oi:ve(t,"Codex/")?Fi:ve(t,"ChatGPT/")?$i:ve(t,"FBIOS")?"Facebook Mobile":ve(t,"UCWEB")||ve(t,"UCBrowser")?"UC Browser":ve(t,"CriOS")?oi:ve(t,"CrMo")||ve(t,si)?si:ve(t,Ke)&&ve(t,ii)?gi:ve(t,"FxiOS")?vi:ve(t.toLowerCase(),xi.toLowerCase())?xi:ve(t,"Brave/")?Pi:((t,e)=>e&&ve(e,"Apple")||function(t){return ve(t,ii)&&!ve(t,si)&&!ve(t,Ke)}(t))(t,e)?ve(t,Je)?mi:ii:ve(t,"PaleMoon/")?Ri:ve(t,"Waterfox/")?Ai:ve(t,di)?di:ve(t,"MSIE")||ve(t,"Trident/")?ai:ve(t,"Gecko")?di:"")},Wi={[li]:[new RegExp("rv:(\\d+(\\.\\d+)?)")],[hi]:[new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[si]:[new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[oi]:[new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[ii]:[Li],[mi]:[Li],[ui]:[new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[di]:[new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[vi]:[new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[xi]:[new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[ri]:[new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Li],[gi]:[new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[ni]:[new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[Ci]:[new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Ti]:[new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[Ei]:[new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[Mi]:[new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Pi]:[new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[Oi]:[Ni],[Fi]:[Ni],[$i]:[Ni],[Ii]:[new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[Ri]:[new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[Ai]:[new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[Di]:[new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[ai]:[new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[new RegExp("rv:(\\d+(\\.\\d+)?)")]},Vi=function(t,e,i,r){var n=Wi[zi(t,e,i,r)];if(Ie(n))return null;for(var s=0;n.length>s;s++){var o=t.match(n[s]);if(o)return parseFloat(o[o.length-2])}return null},Gi=[[new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[pi,t&&t[1]||""]],[new RegExp(ci,"i"),[ci,""]],[new RegExp(fi,"i"),[fi,""]],[Ui,[ri,""]],[new RegExp(yi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[_i,""];if(new RegExp(Je).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=Hi[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[yi,r]}return[yi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Ie(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[Ke,[t[2],t[3],t[4]||"0"].join(".")]:[Ke,""]],[/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/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],Zi=function(t){for(var e=0;Gi.length>e;e++){var i=Gi[e],r=i[1],n=i[0].exec(t),s=n&&(Te(r)?r(n,t):r);if(s)return s}return["",""]},Qi=function(t){return Bi.test(t)?ci:ji.test(t)?fi:qi.test(t)?pi:new RegExp(wi,"i").test(t)?wi:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?_i:/iPad/.test(t)?ti:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ei:Ui.test(t)?ri:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(bi,"i").test(t)?bi:/(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(Je).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)?Ke:Xe:new RegExp("(pda|Mobile)","i").test(t)?ki:new RegExp(Ye,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?Si:""},Ji=function(t,e){var i,r,n,s,o=Qi(t);return o===ti||o===Xe||"Kobo"===o||"Kindle Fire"===o||o===Si?Ye:o===ci||o===pi||o===fi||o===wi?"Console":o===ei?"Wearable":o?Je:"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)?Je:Ye:"Desktop"},Ki=/\bFBAV\/(\d+(?:\.\d+)*)/i,Yi=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Ki],[/\bFBAN\/EMA\b/i,"Facebook Lite",Ki],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Ki],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],Xi="[Truncated]",tr="[Unserializable]";function er(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}Date,Date;var ir,rr,nr,sr=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function or(t,e){return"string"==typeof(i=t)&&sr.test(i)?t:e();var i}function ar(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 lr(t){return t?t.split("#")[0]:t}function ur(t,e){var i=setTimeout(t,e);return null!=i&&i.unref&&(null==i||i.unref()),i}function hr(t,e,i){return dr.apply(this,arguments)}function dr(){return(dr=a(function*(t,e,i){var r;try{return yield Promise.race([t,new Promise((t,n)=>{r=ur(()=>{try{null==i||i(),t()}catch(t){n(t)}},e)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function vr(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return nr&&i.length===rr?nr:(rr=i.length,nr=i.reduce((i,r)=>{ir||(ir={});var n=ir[r];if(n)i[n[0]]=n[1];else for(var s=t(r),o=s.length-1;o>=0;o--){var a,l=null==(a=s[o])?void 0:a.filename,u=e[r];if(l&&u){i[l]=u,ir[r]=[l,u];break}}return i},{}))}}var cr=class{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 a(function*(){for(var i of t)i.stacktrace&&i.stacktrace.frames&&Ce(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)),s({},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 a(function*(){var i=t;for(var r of e.modifiers)i=yield r(i);return i})()}convertToExceptionList(t,e){var i,r,n,o={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&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,s({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:vr(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 s({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>r(t,i),next:t=>r(t,i+1)})}};function fr(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?"?":i,in_app:!!e&&!e.startsWith("webkit-masked-url://")&&"<anonymous>"!==e};return Ie(r)||(s.lineno=r),Ie(n)||(s.colno=n),s}var pr=(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]:"?",i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},gr=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,mr=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,yr=/\((\S*)(?::(\d+))(?::(\d+))\)/,_r=(t,e)=>{var i=gr.exec(t);if(i)return fr(e,i[1],"?",+i[2],+i[3]);var r=mr.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=yr.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=pr(r[1]||"?",r[2]);return fr(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},br=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,wr=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,kr=(t,e)=>{var i=br.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=wr.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]||"?",o=pr(s,n);return fr(e,n=o[1],s=o[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},Sr=/\(error: (.*)\)/;function xr(t,e){return t.filename===e.filename&&t.function===e.function&&t.module===e.module&&t.lineno===e.lineno&&t.colno===e.colno}function Cr(t){for(var e=1;10>=e;e++){var i=t.length-2*e;if(0>i)break;for(var r=!0,n=0;e>n;n++)if(!xr(t[i+n],t[i+e+n])){r=!1;break}if(r){for(var s=0;e>s;s++)t[i+s]=t[i+e+s];return t.length=i+e,{start:i,length:e}}}}function Tr(t,e){var i=e.start+e.length,r=Mr(t,e);r&&t.splice(i+r===t.length?i:e.start,r)}function Er(t,e){for(var i=e.start;i>0&&xr(t[i-1],t[i-1+e.length]);)i--;return e.start-i}function Mr(t,e){for(var i=e.start+e.length,r=i;t.length>r&&xr(t[r],t[r-e.length]);)r++;return r-i}function Ir(t,e){var i=e[0],r=t.length-(i?Er(t,i):0);for(var n of e)r-=Mr(t,n);return r}function Rr(t,e,i){for(var r=0;t.length>r;r++){var n=t[(e+r)%t.length],s=t[(i+r)%t.length];if(n!==s)return s>n}return!1}var Ar=class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Re(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 Be(t,"DOMException")}isDOMError(t){return Be(t,"DOMError")}},Pr=class{match(t){return Ue(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}},Or=class{match(t){return!!Be(t,"ErrorEvent")&&(null!=t.error||this.an(t))}coerce(t,e){var i;if(null!=t.error)return e.apply(t.error);var r=e.apply(t.message);return s({},r,{stack:null!==(i=this.sn(t))&&void 0!==i?i:r.stack,synthetic:!0})}an(t){return Re(t.message)&&t.message.length>0}sn(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(Re(r.filename)&&0!==r.filename.length&&0!==n)return"Error\n at "+r.filename+":"+n+":"+s}},Fr=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,$r=class{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(Fr);return r&&(e=r[1],i=r[2]),[e,i]}},Dr=["fatal","error","warning","log","info","debug"];function Lr(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""}var Nr=class{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(He(t))return t.constructor.name;var e="name"in t?t.name:void 0;return Re(e)&&!Ae(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: "+Lr(t)}isSeverityLevel(t){return Re(t)&&!Ae(t)&&Dr.indexOf(t)>=0}getStack(t){try{return Re(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Re(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(Ue(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}},qr=class{match(t){return He(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Lr(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}},jr=class{match(t){return je(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}}},Br=class{match(t){return Be(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!He(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 je(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}},Ur="$message",Hr="$timestamp",zr=new Set([Ur,Hr]),Wr={enabled:!0,max_bytes:32768};function Vr(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:Wr.enabled,max_bytes:Zr(t.max_bytes,Wr.max_bytes)}:s({},Wr)}var Gr=class{constructor(t){this.Gn=[],this.Zn=0,this.Rn=Vr(t)}setConfig(t){this.Rn=Vr(t),this.Jn()}add(t){var e=function(t){var e;try{e=pe(t)}catch(t){return}try{var i=JSON.parse(e);if(!Ee(i))return;var r=i,n=r[Ur],s=r[Hr];if(!Re(n)||0===n.trim().length)return;if(!Re(s)&&!Fe(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("u">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.Rn.max_bytes||(this.Gn.push({step:e.step,bytes:i}),this.Zn+=i,this.Jn())}}getAttachable(){return this.Gn.map(t=>t.step)}clear(){this.Gn=[],this.Zn=0}size(){return this.Gn.length}Jn(){for(;this.Zn>this.Rn.max_bytes&&this.Gn.length>0;){var t=this.Gn.shift();t&&(this.Zn-=t.bytes)}}};function Zr(t,e){if(!Fe(t)||1/0===t||-1/0===t)return e;var i=Math.floor(t);return 0>i?e:i}var Qr=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function Jr(t){return"string"==typeof t||t}function Kr(t){return"string"==typeof t?t:void 0}var Yr,Xr=["$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"],tn="NativeGzipValidationError",en=t=>t.length>=2&&31===t[0]&&139===t[1],rn=(t,e)=>t===me.GZipJS||e===me.GZipJS||"gzip"===e,nn=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),sn=t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return nn(t)||e===tn},on=t=>{throw ar(tn,"Native gzip produced invalid output: "+t)},an=function(){var t=a(function*(t,e){18>t.size&&on("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());en(i)&&8===i[2]||on("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Yr)return Yr;Yr=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;Yr[t]=e>>>0}return Yr})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&on("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&on("invalid-size")});return function(e,i){return t.apply(this,arguments)}}();function ln(t,e,i){return un.apply(this,arguments)}function un(){return un=a(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(),o=s.write(r).then(()=>s.close()).catch(function(){var t=a(function*(t){try{yield s.abort(t)}catch(t){}throw t});return function(e){return t.apply(this,arguments)}}()),l=new Response(n.readable).blob(),u=(yield Promise.all([l,o]))[0];return yield an(u,r),u}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),un.apply(this,arguments)}var hn={}.propertyIsEnumerable;function dn(t,e){try{return fn(t,e,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(t){return[]}}function vn(t,e,i,r){if(0>=i.remainingNodes)return{stringValue:Xi};if(i.remainingNodes--,De(t))return{boolValue:t};if("bigint"==typeof t)return function(t,e){var i=t.toString(),r=BigInt("9223372036854775808");return t>=r||-r>t?(null==e||e.debug("Attribute "+i+" is outside the int64 range; encoding it as a string"),{stringValue:i}):{intValue:i}}(t,e);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(typeof BigInt>"u")return{stringValue:String(t)};var n=BigInt(t).toString();return t>=0x8000000000000000||-0x8000000000000000>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:er(t)};if("function"==typeof t)return{stringValue:"[Function]"};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(i.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:Xi};if(t instanceof Date){var s=t.getTime(),o=Number.isFinite(s)?t.toISOString():String(t);return{stringValue:"string"==typeof o?er(o):String(o)}}i.ancestors.add(t);try{try{var a=t.toJSON;if("function"==typeof a)return vn(a.call(t),e,i,r+1)}catch(t){}return Ce(t)?{arrayValue:{values:cn(t,e,i,r+1)}}:{kvlistValue:{values:fn(t,e,i,r+1)}}}finally{i.ancestors.delete(t)}}return{stringValue:er(String(t))}}function cn(t,e,i,r){for(var n=[],s=Math.min(t.length,1e3),o=0;s>o&&i.remainingNodes>0;o++)try{var a=o in t?t[o]:void 0;if(Oe(a))continue;n.push(vn(a,e,i,r))}catch(t){n.push({stringValue:tr})}return t.length>o&&n.push({stringValue:Xi}),n}function fn(t,e,i,r){var n=[];for(var s in t)if(hn.call(t,s)){if(!s){null==e||e.debug("Dropping an attribute with an empty key");continue}if(n.length>=1e3||0>=i.remainingNodes){null==e||e.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var o=t[s];if(Pe(o)||Ie(o))continue;n.push({key:er(s),value:vn(o,e,i,r)})}catch(t){n.push({key:er(s),value:{stringValue:tr}})}}return n}function pn(t,e,i){return s({},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})}var gn={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"};var mn={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}},yn=mn.info;function _n(t){try{return er(String(t))}catch(t){return tr}}function bn(t,e,i,r){var n,o=mn[t.level||"info"]||yn,a=o.text,l=o.number,u=(void 0===(n=Fe(r)?r:void 0)&&(n=Date.now()),String(n)+"000000"),h={};e.distinctId&&(h.posthogDistinctId=e.distinctId),e.sessionId&&(h.sessionId=e.sessionId),e.windowId&&(h["window.id"]=e.windowId),Oe(e.sessionStartTimestamp)||(h.sessionStartTimestamp=String(e.sessionStartTimestamp)),Oe(e.lastActivityTimestamp)||(h.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(h["url.full"]=e.currentUrl),e.screenName&&(h["screen.name"]=e.screenName),e.appState&&(h["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(h.feature_flags=e.activeFeatureFlags);var d=s({},h),v=t.attributes;if(v){var c=[];try{c=Object.keys(v)}catch(t){c=[]}for(var f of c){var p=void 0;try{p=v[f]}catch(t){p=tr}Object.defineProperty(d,f,{value:p,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:u,observedTimeUnixNano:u,severityNumber:l,severityText:a,body:{stringValue:_n(t.body)},attributes:dn(d,i)};return t.trace_id&&(g.traceId=t.trace_id),t.span_id&&(g.spanId=t.span_id),Ie(t.trace_flags)||(g.flags=t.trace_flags),g}function wn(t,e,i){return pn(t,e,i)}function kn(t,e,i,r){return{resourceLogs:[{resource:{attributes:dn(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}var Sn=class{constructor(t,e,i,r,n,s,o){var a;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.Rn=e,this.A=i,this.Qn=r,this.Kn=n,this.Xn=s,this.Yn=o,this.ts=null,this.es=0,this.rs=0,this.ns=0,this.ss=0,this.ls=0,this.us=!1,this.hs=e.maxBufferSize,this.ds=Math.max(null!==(a=e.maxQueueSize)&&void 0!==a?a:e.maxBufferSize,e.maxBufferSize),this.vs=e.flushIntervalMs,this.cs=e.maxBatchRecordsPerPost,this.fs=e.rateCapWindowMs,this.ps=e.maxLogsPerInterval}clearQueue(){this.rs++,this._instance.setPersistedProperty(ge.LogsQueue,[])}reset(){this.gs(),this.ss=0,this.ls=0,this.us=!1,this.ns=0,this.cs=this.Rn.maxBatchRecordsPerPost}onReconnect(){this.ns=0,this.ys()}captureLog(t,e){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var r=this.bs(t);if(null!==r)if(r.body){if(this._s()){var n={record:bn(r,null!==(i=null==e?void 0:e.context)&&void 0!==i?i:this.Qn(),this.A,null==e?void 0:e.occurredAtMs)};this.Kn(()=>this.ws(n))}}else this.A.info("Log was rejected in beforeSend function")}}bs(t){var e=this.Rn.beforeSend;if(!e)return t;var i=Ce(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.A.info("Log was rejected in beforeSend function"),null;r=s}catch(t){return this.A.error("Error in beforeSend function for log:",t),null}return r}_s(){if(void 0===this.ps)return!0;var t=Date.now(),e=t-this.ss;return this.fs>e&&e>=0||(this.ss=t,this.ls=0,this.us=!1),this.ps>this.ls?(this.ls++,!0):(this.us||(this.A.warn("captureLog dropping logs: exceeded "+this.ps+" logs per "+this.fs+"ms"),this.us=!0),!1)}flush(){var t=this;return a(function*(){if(!t._instance.isDisabled)return t.ts||(t.ts=t.ks().finally(()=>{t.ts=null})),t.ts})()}ks(){var t=this;return a(function*(){var e;t.gs();var i=null!==(e=t._instance.getPersistedProperty(ge.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,o,a=t.rs;t.es=0;var l=Math.min(i.length,t.cs),u=i.slice(0,l),h=kn(u.map(t=>t.record),t.Ss(),null!==(s=t.Yn)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.xs(h);if(t.rs!==a)return;if("too-large"===d.kind&&u.length>1)t.cs=Math.max(1,Math.floor(u.length/2)),t.A.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+t.cs);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.A.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.Rn.maxBatchRecordsPerPost>t.cs&&(t.cs=Math.min(t.Rn.maxBatchRecordsPerPost,t.cs+1)),yield t.Cs(u.length),i=null!==(o=t._instance.getPersistedProperty(ge.LogsQueue))&&void 0!==o?o:[],n+=u.length,"fatal"===d.kind)throw d.error}}})()}Cs(t){var e=this;return a(function*(){var i,r=Math.max(0,t-e.es),n=null!==(i=e._instance.getPersistedProperty(ge.LogsQueue))&&void 0!==i?i:[];e._instance.setPersistedProperty(ge.LogsQueue,n.slice(r)),yield e.Xn()})()}Ss(){return wn(this.Rn,this._instance.getLibraryId(),this._instance.getLibraryVersion())}ws(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(ge.LogsQueue))&&void 0!==e?e:[];this.ds>i.length||(i.shift(),this.es++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(ge.LogsQueue,i),this.hs>i.length?this.Ts():this.ys()}}Ts(t){void 0===t&&(t=this.vs),this.Ms||(this.Ms=ur(()=>{this.Ms=void 0,this.ys()},t))}Is(){var t=Math.min(Math.max(0,this.ns-1),6);return this.vs*Math.pow(2,t)}Es(){var t=this._instance.getPersistedProperty(ge.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return a(function*(){e.gs();var i=e.flush().catch(()=>{});void 0!==t?yield hr(i,t):yield i})()}flushWithTimeout(t){var e=this;return a(function*(){var i=e.flush();yield hr(i,t,()=>{i.catch(()=>{})})})()}ys(){this.flush().then(()=>{this.ns=0},t=>{this.ns++,this.A.error("PostHog logs flush failed:",t)}).finally(()=>{!this._instance.isDisabled&&this.Es()&&this.Ts(this.Is())})}gs(){this.Ms&&(clearTimeout(this.Ms),this.Ms=void 0)}},xn=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Cn(t){return String(t)+"000000"}function Tn(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}var En=class{constructor(t,e,i){this._instance=t,this.Rn=e,this.A=i,this.Rs=new Map,this.ts=null,this.As=!1,this.Ps=new Map,this.Fs=new Set,this.Os=0}count(t,e,i){void 0===e&&(e=1),this.$s({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.$s({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.$s({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.ts,i=function(){var i=a(function*(){e&&(yield e.catch(()=>{})),yield t.Ds()});return function(){return i.apply(this,arguments)}}()().finally(()=>{this.ts===i&&(this.ts=null)});return this.ts=i,i}drainWindow(){if(0===this.Rs.size)return null;var t=this.Rs;return this.Rs=new Map,this.As=!1,this.Ps=new Map,this.Fs=new Set,this.Ls(t)}reset(){this.Os++,this.gs(),this.Rs=new Map,this.ts=null,this.As=!1,this.Ps=new Map,this.Fs=new Set}$s(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.bs(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.A.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var i,r;try{i=e.attributes?s({},e.attributes):void 0,r=Tn(e.type,e.name,e.unit,i)}catch(t){return void this.A.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var n=this.Rs.get(r);if(!n){if(!this.Ns())return;n={name:e.name,type:e.type,unit:e.unit,attributes:i,windowStartMs:Date.now()},this.Rs.set(r,n)}var o=this.Ps.get(e.name);void 0===o?this.Ps.set(e.name,e.type):o===e.type||this.Fs.has(e.name)||(this.Fs.add(e.name),this.A.warn("Metric name '"+e.name+"' is already used as a "+o+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.qs(n,e.value),this.Ts()}else this.A.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}Ns(){return this.Rn.maxSeriesPerFlush>this.Rs.size||(this.As||(this.As=!0,this.A.warn("Metric series cap reached ("+this.Rn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}qs(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(xn.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,xn)]+=1}}bs(t){var e=this.Rn.beforeSend;if(!e)return t;var i=Ce(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.A.info("Metric was rejected in beforeSend function"),null;r=s}catch(t){return this.A.error("Error in beforeSend function for metric:",t),null}return r}Ts(){this.Ms||(this.Ms=ur(()=>{this.Ms=void 0,this.flush().catch(t=>{this.A.error("Metrics flush failed:",t)})},this.Rn.flushIntervalMs))}gs(){this.Ms&&(clearTimeout(this.Ms),this.Ms=void 0)}Ds(){var t=this;return a(function*(){if(0!==t.Rs.size){var e=t.Rs;t.Rs=new Map,t.As=!1,t.Ps=new Map,t.Fs=new Set;var i=t.Os,r=yield t._instance.js(t.Ls(e));if(i===t.Os)switch(r.kind){case"ok":return;case"retry-later":return t.Bs(e),void t.Ts();case"too-large":return void t.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.A.error("Failed to send metrics batch:",r.error)}}})()}Ls(t){return e=this.Hs(t),i=function(t,e,i){return pn(t,e,i)}(this.Rn,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),n=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:dn(i)},scopeMetrics:[{scope:{name:r,version:n},metrics:e}]}]};var e,i,r,n}Hs(t){var e=Cn(Date.now()),i=new Map;for(var r of t.values()){var n,o=Tn(r.type,r.name,r.unit,void 0),a=i.get(o);a||(a=s({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(o,a));var l=dn(null!==(n=r.attributes)&&void 0!==n?n:{},this.A),u=Cn(r.windowStartMs);if("count"===r.type){var h,d={attributes:l,startTimeUnixNano:u,timeUnixNano:e,asDouble:null!==(h=r.total)&&void 0!==h?h:0};a.sum.dataPoints.push(d)}else if("gauge"===r.type){var v,c={attributes:l,timeUnixNano:e,asDouble:null!==(v=r.last)&&void 0!==v?v:0};a.gauge.dataPoints.push(c)}else r.hist&&a.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:xn})}return Array.from(i.values())}Bs(t){var e,i;for(var r of t){var n=r[0],s=r[1],o=this.Rs.get(n);if(o)switch(o.windowStartMs=Math.min(o.windowStartMs,s.windowStartMs),o.type){case"count":o.total=(null!==(e=o.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(o.hist){o.hist.count+=s.hist.count,o.hist.sum+=s.hist.sum,o.hist.min=Math.min(o.hist.min,s.hist.min),o.hist.max=Math.max(o.hist.max,s.hist.max);for(var a=0;o.hist.bucketCounts.length>a;a++)o.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else o.hist=s.hist}else this.Ns()&&this.Rs.set(n,s)}}};function Mn(t,e){var i;if(t)return null==(i=t.find(t=>t.type===e))?void 0:i.value}var In="0.8.2",Rn={DEBUG:!1,LIB_VERSION:In,LIB_NAME:"browser-common",JS_SDK_VERSION:In},An=function(t,e){var i=(void 0===e?{}:e).debugEnabled,r={q(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;r>s;s++)n[s-1]=arguments[s];l&&(Rn.DEBUG||l.POSTHOG_DEBUG||i)&&!Ie(l.console)&&l.console&&("__rrweb_original__"in l.console[e]?l.console[e].__rrweb_original__:l.console[e])(t,...n)},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.q("error",...e)},critical(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning(t){r.error("You must initialize PostHog before calling "+t)},createLogger:(e,i)=>An(t+" "+e,i)};return r},Pn=An("[PostHog.js]"),On=Pn.createLogger;function Fn(t,e){Ce(t)&&t.forEach(e)}function $n(t,e){if(!Oe(t))if(Ce(t))t.forEach(e);else if(Le(t))t.forEach((t,i)=>e(t,i));else for(var i in t)Se.call(t,i)&&e(t[i],i)}var Dn=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 Ln(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 Nn=function(t){try{return t()}catch(t){return}},qn=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){Pn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Pn.critical(t)}}},jn=function(t){var e={};return $n(t,function(t,i){(Re(t)&&t.length>0||Fe(t))&&(e[i]=t)}),e};function Bn(t){var e=s({},t);for(var i of["name","message","stack","cause","errors"])try{i in t&&(e[i]=t[i])}catch(t){}return e}var Un=["herokuapp.com","vercel.app","netlify.app"];function Hn(t){var e=null==t?void 0:t.hostname;if(!Re(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Un)if(i===r)return!1;return!0}function zn(t,e,i,r){var n=null!=r?r:{},s=n.capture,o=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===o||o})}function Wn(t){return"ph_toolbar_internal"===t.name}var Vn=["localhost","127.0.0.1"],Gn=(t,e)=>{try{var i;return JSON.stringify(t,(t,e)=>Ue(e)?(null!=i||(i=new WeakMap),i.has(e)||i.set(e,Bn(e)),i.get(e)):"bigint"==typeof e?e.toString():e,e)}catch(e){return pe(t)}},Zn=t=>{var e=null==d?void 0:d.createElement("a");return Ie(e)?null:(e.href=t,e)},Qn=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return $n(t,function(t,e){Ie(t)||Ie(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)},Jn=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(!Ce(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){Pn.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Kn=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");Ce(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=a;return null!=o&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},Yn=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},Xn=(t,e)=>t>=e&&y(),ts=(t,e,i,r)=>{if(0===t){if(y()){var n=e+1;return n===i&&r(),n}return e}return 0};function es(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Te(r))return e;try{var n=r(e);return Re(n)&&n?n:e}catch(t){return Pn.error("Error in get_current_url, falling back to window.location.href",t),e}}function is(t){var e,i=null==l||null==(e=l.location)?void 0:e.href;return Ie(i)?void 0:es(t,i)}function rs(t){return t instanceof Element&&("__POSTHOG_TOOLBAR__"===t.id||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function ns(t){return!!t&&1===t.nodeType}function ss(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function os(t){return!!t&&3===t.nodeType}function as(t){return!!t&&11===t.nodeType&&ns(t.host)}function ls(t){return t?ce(t).split(/\s+/):[]}function us(t,e){var i=is(e);return!!(i&&t&&t.some(t=>i.match(t)))}function hs(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 ls(e)}function ds(t){return Oe(t)?null:ce(t).split(/(\s+)/).filter(t=>Ls(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function vs(t){var e="";return Ms(t)&&!Is(t)&&t.childNodes&&t.childNodes.length&&$n(t.childNodes,function(t){var i;os(t)&&t.textContent&&(e+=null!==(i=ds(t.textContent))&&void 0!==i?i:"")}),ce(e)}function cs(t){var e;return Ie(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var fs=["a","button","form","input","select","textarea","label"];function ps(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}}function gs(t,e){if(Ie(e))return!0;var i,r=function(t){if(e.some(e=>ps(t,e)))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function ms(t){var e=t.parentNode;return!(!e||!ns(e))&&e}var ys=[".ph-no-autocapture","[data-ph-no-autocapture]"],_s=["next","previous","prev",">","<"],bs=[..._s,"+","-","−","–"],ws=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,ks=[".ph-no-deadclick",".ph-no-capture"],Ss=[".ph-no-rageclick",".ph-no-capture"],xs=["","text","search","email","password","url","tel","number"];function Cs(t,e){if(!l||Ts(t))return!1;var i,r,n,s,o;if(De(e)?(i=!!e&&Ss,r=void 0,n=!1):(i=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:Ss,r=null==e?void 0:e.content_ignorelist,n=null!==(o=null==e?void 0:e.ignore_text_selection)&&void 0!==o&&o),!1===i)return!1;if(n&&function(t){return!(!t||!ns(t))&&(!!ss(t,"textarea")||(ss(t,"input")?ve(xs,(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)))}(t))return!1;var a=Es(t,!1).targetElementList;return!function(t,e){if(!1===t||Ie(t))return!1;var i;if(!0===t)i=_s;else{if(!Ce(t))return!1;if(t.length>10)return Pn.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=>ws(e,t)||ws(r,t))})}(r,a.map(t=>{var e;return{safeText:vs(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}}))&&!gs(a,i)}var Ts=t=>!t||ss(t,"html")||!ns(t),Es=(t,e)=>{if(!l||Ts(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[t],n=t;n.parentNode&&!ss(n,"body");)if(as(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var s=ms(n);if(!s)break;if(e||fs.indexOf(s.tagName.toLowerCase())>-1)i=!0;else try{var o=l.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(s),n=s}return{parentIsUsefulElement:i,targetElementList:r}};function Ms(t){for(var e=new Set,i=0,r=t;r.parentNode&&!ss(r,"body");r=r.parentNode){if(i++>=1e3||e.has(r))return!1;e.add(r);var n=hs(r);if(ve(n,"ph-sensitive")||ve(n,"ph-no-capture"))return!1}if(ve(hs(t),"ph-include"))return!0;var s=t.type||"";if(Re(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var o=t.name||t.id||"";return!Re(o)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(o.replace(/[^a-zA-Z0-9]/g,""))}function Is(t){return!!(ss(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||ss(t,"select")||ss(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Rs=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}))$"),As=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Ps=[16,15,14,13],Os=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Fs=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),$s=/[0-9A-Za-z_]/;function Ds(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 Ls(t,e){if(void 0===e&&(e=!0),Oe(t))return!1;if(Re(t)){if(t=ce(t),e?Rs.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(As.lastIndex=0;e=As.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Ps){var o=n+s;if(r.length>=o){var a=r.slice(n,o);if(Rs.test(a)&&Ds(a))return!0}}}return!1}(t))return!1;if(e?Os.test(t):function(t){var e;for(Fs.lastIndex=0;e=Fs.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&$s.test(i)&&$s.test(r)))return!0}return!1}(t))return!1}return!0}function Ns(t){var e=vs(t);return Ls(e=(e+" "+qs(t)).trim())?e:""}function qs(t){var e="";return t&&t.childNodes&&t.childNodes.length&&$n(t.childNodes,function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=vs(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+qs(t)).trim())}catch(t){Pn.error("[AutoCapture]",t)}}),e}function js(t){return t.replace(/"|\\"/g,'\\"')}function Bs(t){var e=t.attr__class;if(e)return Ce(e)?e:ls(e)}var Us=1e6;function Hs(t){var e;return Math.min(Us,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:1e6)}var zs={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:Us,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},Ws=["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"],Vs=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Gs=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Zs=t=>{Oe(t)||$n(Object.keys(t),e=>{(t=>{var e=t.toLowerCase();return Ws.includes(e)||Gs.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Qs=["/s/","/e/","/i/"];function Js(t,e,i,r){if(Oe(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Re(n)&&(n=parseInt(n)),n>i?"[SessionRecording] "+r+" body too large to record ("+n+" bytes)":t}function Ks(t,e){if(Oe(t))return t;var i=t;return Ls(i,!1)||(i="[SessionRecording] "+e+" body redacted"),$n(Vs,t=>{var r,n;null!=(r=i)&&r.length&&-1!==(null==(n=i)?void 0:n.indexOf(t))&&(i="[SessionRecording] "+e+" body redacted as might contain: "+t)}),i}var Ys=new WeakSet,Xs="disabled",to="sampled",eo="active",io="buffering",ro="paused",no="lazy_loading",so="rrweb_error",oo="trigger_activated",ao="trigger_pending",lo="trigger_disabled";function uo(t,e,i,r,n,s){return 0===e?lo:(null==t?void 0:t.get_property(i?r+i:n))===s?oo:ao}function ho(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 vo(t){return t.includes("trigger_activated")?oo:t.includes("trigger_pending")?ao:lo}function co(t){var e=new Set(t);switch(e.delete(lo),e.size){case 0:return lo;case 1:return Array.from(e)[0];default:return ao}}var fo=class{constructor(t){this.j=t}triggerStatus(t){return vo(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return vo(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},po=class{constructor(t){this.j=t}triggerStatus(t){return co(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return co(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},go=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return oo}stop(){}},mo=t=>"sessionRecording"in t,yo=class{constructor(t,e){this._instance=t,this.B=[],this.H=[],this.$=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,i;this.B=(mo(t)?Ee(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(mo(t)?Ee(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){for(var t of(this.$.clear(),this.U.clear(),this.B))if("regex"===t.matching&&!this.$.has(t.url))try{this.$.set(t.url,new RegExp(t.url))}catch(e){Pn.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.H)if("regex"===e.matching&&!this.U.has(e.url))try{this.U.set(e.url,new RegExp(e.url))}catch(t){Pn.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return uo(this._instance,this.B.length,this.V,tt,K,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[Jt]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=is(this._instance);if(!t)return!1;try{return ho(t,this.H,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){var i=is(this._instance);if(i&&i!==this.W){this.W=i;var r=this.urlBlocked,n=ho(i,this.H,this.U);r&&n||(n&&!r?t():!n&&r&&e())}}checkUrlTriggerConditions(t,e,i,r){var n=is(this._instance);if(n&&n!==this.W){this.W=n;var s=this.urlBlocked,o=ho(n,this.H,this.U);o&&!s?t():!o&&s&&e();var a=this.G(r)===oo,l=ho(n,this.B,this.$);!a&&l&&i("url",n)}}stop(){this.W=""}},_o=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Wt]:t}),t}triggerStatusNoSideEffects(){var t=ao;return Oe(this.linkedFlag)&&(t=lo),this.linkedFlagSeen&&(t=oo),t}onConfig(t,e){var i;if(this.linkedFlag=(mo(t)?Ee(t.sessionRecording)?null==(i=t.sessionRecording)?void 0:i.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Oe(this.linkedFlag)&&!this.linkedFlagSeen){var r=Re(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Re(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((t,i)=>{var s=!1;if(Ee(i)&&r in i){var o=i[r];s=De(o)?!0===o:n?o===n:!!o}var a=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,a&&e(r,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}},bo=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(mo(t)?Ee(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return uo(this._instance,this.K.length,this.V,X,Y,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[zt]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,i){if(0!==this.K.length){var r=this.X(i)===oo,n=this.K.includes(t);!r&&n&&e("event",t)}}stop(){}},wo=class{constructor(t,e,i){if(this._instance=t,this.group=e,this.Y=new yo(t,e.id),this.tt=new bo(t,e.id),this.et=new _o(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.Y.onConfig(n),this.tt.onConfig(n),this.et.onConfig(n,i);var s=[this.tt,this.Y,this.et];this.rt="any"===e.conditions.matchType?new fo(s):new po(s)}else this.rt=new go}triggerStatus(t){return this.rt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.rt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===ao).map(t=>t.label)}checkEventTriggerConditions(t,e,i){this.tt.checkEventTriggerConditions(t,e,i)}checkUrlTriggerConditions(t,e,i,r){this.Y.checkUrlTriggerConditions(t,e,i,r)}activateTrigger(t,e){var i,r="url"===t?tt+this.group.id:X+this.group.id;null==(i=this._instance.persistence)||i.register({[r]:e})}stop(){this.Y.stop(),this.tt.stop(),this.et.stop()}};function ko(t){if(t.rrwebError)return so;if(!t.receivedFlags)return io;if(!t.isRecordingEnabled)return Xs;if(t.urlTriggerMatching.urlBlocked)return ro;var e=!0===t.isSampled,i=new fo([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?to:"trigger_activated"===i?eo:"trigger_pending"===i?io:!1===t.isSampled?Xs:eo}function So(t){if(t.rrwebError)return so;if(!t.receivedFlags)return io;if(!t.isRecordingEnabled)return Xs;if(t.urlTriggerMatching.urlBlocked)return ro;var e=new po([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),i=e!==lo,r=De(t.isSampled);return i&&"trigger_pending"===e?io:i&&"trigger_disabled"===e||r&&!t.isSampled?Xs:!0===t.isSampled?to:eo}function xo(){var t=[];return function(e,i){if(Ee(i)||Ce(i)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i}}function Co(t){var e=JSON.stringify(t,xo());return e?new Blob([e]).size:0}function To(t){if(Pe(t))return 4;if(Ie(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(Ce(t)){for(var e=2,i=0;t.length>i;i++){i>0&&(e+=1);var r=t[i];e+=Ie(r)||Pe(r)?4:To(r)}return e}var n=t,s=2,o=!0;for(var a in n)if({}.hasOwnProperty.call(n,a)){var l=n[a];Ie(l)||(o||(s+=1),o=!1,s+=a.length+3+To(l))}return s;default:return 0}}function Eo(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[Eo({size:r.reduce((t,e)=>t+e,0),data:t.data.slice(0,i),sizes:r,sessionId:t.sessionId,windowId:t.windowId}),Eo({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 Mo=Uint8Array,Io=Uint16Array,Ro=Uint32Array,Ao=new Mo([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]),Po=new Mo([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]),Oo=new Mo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Fo=function(t,e){for(var i=new Io(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new Ro(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]},$o=Fo(Ao,2),Do=$o[1];$o[0][28]=258,Do[258]=28;for(var Lo=Fo(Po,0)[1],No=new Io(32768),qo=0;32768>qo;++qo){var jo=(43690&qo)>>>1|(21845&qo)<<1;No[qo]=((65280&(jo=(61680&(jo=(52428&jo)>>>2|(13107&jo)<<2))>>>4|(3855&jo)<<4))>>>8|(255&jo)<<8)>>>1}var Bo=function(t,e,i){for(var r=t.length,n=0,s=new Io(e);r>n;++n)++s[t[n]-1];var o,a=new Io(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new Io(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=a[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)o[No[d]>>>l]=u}else for(o=new Io(r),n=0;r>n;++n)o[n]=No[a[t[n]-1]++]>>>15-t[n];return o},Uo=new Mo(288);for(qo=0;144>qo;++qo)Uo[qo]=8;for(qo=144;256>qo;++qo)Uo[qo]=9;for(qo=256;280>qo;++qo)Uo[qo]=7;for(qo=280;288>qo;++qo)Uo[qo]=8;var Ho=new Mo(32);for(qo=0;32>qo;++qo)Ho[qo]=5;var zo=Bo(Uo,9,0),Wo=Bo(Ho,5,0),Vo=function(t){return(t/8|0)+(7&t&&1)},Go=function(t,e,i){(null==e||0>e)&&(e=0),(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof Io?Io:t instanceof Ro?Ro:Mo)(i-e);return r.set(t.subarray(e,i)),r},Zo=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Qo=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Jo=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 Mo(0),0];if(1==n){var o=new Mo(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(t,e){return t.f-e.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=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:a.f+l.f,l:a,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new Io(v+1),f=Ko(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 _=s[r].s;e>c[_]?p-=1<<e-c[_]++-1:++r}for(;r>=0&&p;--r){var b=s[r].s;c[b]==e&&(--c[b],++p)}f=e}return[new Mo(c),f]},Ko=function(t,e,i){return-1==t.s?Math.max(Ko(t.l,e,i+1),Ko(t.r,e,i+1)):e[t.s]=i},Yo=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new Io(++e),r=0,n=t[0],s=1,o=function(t){i[r++]=t},a=1;e>=a;++a)if(t[a]==n&&a!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=t[a]}return[i.subarray(0,r),e]},Xo=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},ta=function(t,e,i){var r=i.length,n=Vo(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)},ea=function(t,e,i,r,n,s,o,a,l,u,h){Zo(e,h++,i),++n[256];for(var d=Jo(n,15),v=d[0],c=d[1],f=Jo(s,15),p=f[0],g=f[1],m=Yo(v),y=m[0],_=m[1],b=Yo(p),w=b[0],k=b[1],S=new Io(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=Jo(S,7),T=C[0],E=C[1],M=19;M>4&&!T[Oo[M-1]];--M);var I,R,A,P,O=u+5<<3,F=Xo(n,Uo)+Xo(s,Ho)+o,D=Xo(n,v)+Xo(s,p)+o+14+3*M+Xo(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(F>=O&&D>=O)return ta(e,h,t.subarray(l,l+u));if(Zo(e,h,1+(F>D)),h+=2,F>D){I=Bo(v,c,0),R=v,A=Bo(p,g,0),P=p;var L=Bo(T,E,0);for(Zo(e,h,_-257),Zo(e,h+5,k-1),Zo(e,h+10,M-4),h+=14,x=0;M>x;++x)Zo(e,h+3*x,T[Oo[x]]);h+=3*M;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(x=0;j.length>x;++x)Zo(e,h,L[B=31&j[x]]),h+=T[B],B>15&&(Zo(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else I=zo,R=Uo,A=Wo,P=Ho;for(x=0;a>x;++x)if(r[x]>255){var B;Qo(e,h,I[257+(B=r[x]>>>18&31)]),h+=R[B+257],B>7&&(Zo(e,h,r[x]>>>23&31),h+=Ao[B]);var U=31&r[x];Qo(e,h,A[U]),h+=P[U],U>3&&(Qo(e,h,r[x]>>>5&8191),h+=Po[U])}else Qo(e,h,I[r[x]]),h+=R[r[x]];return Qo(e,h,I[256]),h+R[256]},ia=new Ro([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ra=new Mo(0),na=function(){for(var t=new Ro(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),sa=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function oa(t,e){void 0===e&&(e={});var i=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=na[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var n,s,o,a,l,u=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,i,r,n,s){var o=t.length,a=new Mo(r+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(r,a.length-n),u=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?u=ta(l,u,t.subarray(h,d)):(l[h]=s,u=ta(l,u,t.subarray(h,o)))}else{for(var v=ia[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new Io(32768),m=new Io(p+1),y=Math.ceil(i/3),_=2*y,b=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<_)&p},w=new Ro(25e3),k=new Io(288),S=new Io(32),x=0,C=0,T=(h=0,0),E=0,M=0;o>h;++h){var I=b(h),R=32767&h,A=m[I];if(g[R]=A,m[I]=R,h>=E){var P=o-h;if((x>7e3||T>24576)&&P>423){u=ea(t,l,0,w,k,S,C,T,M,h-M,u),T=x=C=0,M=h;for(var O=0;286>O;++O)k[O]=0;for(O=0;30>O;++O)S[O]=0}var F=2,D=0,L=f,N=R-A&32767;if(P>2&&I==b(h-N))for(var q=Math.min(c,P)-1,j=Math.min(32767,h),B=Math.min(258,P);j>=N&&--L&&R!=A;){if(t[h+F]==t[h+F-N]){for(var U=0;B>U&&t[h+U]==t[h+U-N];++U);if(U>F){if(F=U,D=N,U>q)break;var H=Math.min(N,U-2),z=0;for(O=0;H>O;++O){var W=h-N+O+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,A=W)}}}N+=(R=A)-(A=g[R])+32768&32767}if(D){w[T++]=268435456|Do[F]<<18|Lo[D];var G=31&Do[F],Z=31&Lo[D];C+=Ao[G]+Po[Z],++k[257+G],++S[Z],E=h+F,++x}else w[T++]=t[h],++k[t[h]]}}u=ea(t,l,s,w,k,S,C,T,M,h-M,u),s||(u=ta(l,u,ra))}return Go(a,0,r+Vo(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a,!l)),h=u.length;return 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&&sa(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)}}(u,e),sa(u,h-8,i.d()),sa(u,h-4,r),u}function aa(t,e){var i=t.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Mo(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},o=0;i>o;++o){if(n+5>r.length){var a=new Mo(n+8+(i-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);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(++o))>>>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 Go(r,0,n)}function la(t,e){var i="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var r=0;t.length>r;){var n=t[r++];128>n||e?i+=String.fromCharCode(n):224>n?i+=String.fromCharCode((31&n)<<6|63&t[r++]):240>n?i+=String.fromCharCode((15&n)<<12|(63&t[r++])<<6|63&t[r++]):(n=((15&n)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++])-65536,i+=String.fromCharCode(55296|n>>10,56320|1023&n))}return i}var ua=class{constructor(t,e){var i,r,n,s;void 0===e&&(e={}),this._rrweb=t,this.it=e,this.nt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{var t=Date.now(),e=t-this.ot;e>0?(this.ht=Math.min(this.ct,this.ht+e/1e3*this.dt),this.ot=t):this.ot=t},this.vt=t=>{if(!this.nt[t]){var e,i;this.nt[t]=!0;var r=this.ft(t);null==(e=(i=this.it).onBlockedNode)||e.call(i,t,r)}},this.yt=t=>{var e=this.ft(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.ft=t=>this._rrweb.mirror.getNode(t),this.bt=t=>{var e,i,r,n,s,o,a,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==(o=t.texts)?void 0:o.length)&&void 0!==s?s:0)+(null!==(a=null==(l=t.adds)?void 0:l.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,i=this.bt(e);if(e.attributes){var r,n,s=e.attributes.length;e.attributes=e.attributes.filter(t=>{var e=this.yt(t.id)[0];return!this.wt.consumeRateLimit(e)&&t});var o=s-e.attributes.length;o>0&&(null==(r=(n=this.it).onDroppedAttributeMutations)||r.call(n,o))}var a=this.bt(e);if(0!==a||i===a){if(this.kt)return t;this.ut();var l,u,h=To(t);return h>this.ht?(null==(l=(u=this.it).onDroppedOversizedMutation)||l.call(u,h),void this._t()):(this.ht-=h,t)}},this._t=()=>{if(!this.St){var t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null==(t=(e=this.it).requestFullSnapshot)||t.call(e)},t)}},this.wt=new Qe({bucketSize:null!==(i=this.it.bucketSize)&&void 0!==i?i:100,refillRate:null!==(r=this.it.refillRate)&&void 0!==r?r:10,refillInterval:1e3,I:this.vt,A:Pn}),this.ct=null!==(n=this.it.bytesBucketSize)&&void 0!==n?n:0,this.dt=null!==(s=this.it.bytesRefillRate)&&void 0!==s?s:25600,this.kt=!Number.isFinite(this.ct)||0>=this.ct,this.ht=this.ct;var o=this.it.resyncIntervalMs;this.xt=Fe(o)&&Number.isFinite(o)&&o>0?o:3e5}reset(){this.nt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ht=this.ct,this.ot=Date.now(),this.st=-1/0}},ha=t=>{if(d){try{for(var e=t+"=",i=d.cookie.split(";").filter(t=>t.length),r=0;i.length>r;r++){for(var n=i[r];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Fe(t)&&isFinite(t)&&Math.floor(t)===t});var da=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,i,r,n){if(!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||!Number.isInteger(n)||0>e||0>i||0>r||0>n||e>0xffffffffffff||i>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/256,s[5]=e,s[6]=112|i>>>8,s[7]=i,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=n>>>24,s[13]=n>>>16,s[14]=n>>>8,s[15]=n,new t(s)}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 t(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}},va=class{generate(){var t=this.generateOrAbort();if(!Ie(t))return t;this.Ct=0;var e=this.generateOrAbort();if(Ie(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t,e=(t=Date.now(),Fe(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0);if(e>this.Ct)this.Ct=e,this.Mt();else{if(this.Ct>=e+1e4)return;this.Tt++,this.Tt>4398046511103&&(this.Ct++,this.Mt())}return da.fromFieldsV7(this.Ct,Math.trunc(this.Tt/Math.pow(2,30)),this.Tt&Math.pow(2,30)-1,this.It.nextUint32())}Mt(){this.Tt=1024*this.It.nextUint32()+(1023&this.It.nextUint32())}constructor(){this.Ct=0,this.Tt=0,this.It=new pa}},ca=t=>{if("u">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};l&&!Ie(l.crypto)&&crypto.getRandomValues&&(ca=t=>crypto.getRandomValues(t));var fa,pa=class{nextUint32(){return this.Rt.length>this.At||(ca(this.Rt),this.At=0),this.Rt[this.At++]}constructor(){this.Rt=new Uint32Array(8),this.At=1/0}},ga=()=>ma().toString(),ma=()=>(fa||(fa=new va)).generate(),ya="",_a=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var ba=null,wa={Et(){if(!Pe(ba))return ba;if(ba=!1,d)try{var t="__ph_cookie_support_"+ga();wa.Ot(t,"xyz"),ba='"xyz"'===ha(t),wa.Dt(t)}catch(t){ba=!1}return ba},Pt(t){Pn.error("cookieStore error: "+t)},Lt:ha,Nt(t){var e;try{e=JSON.parse(wa.Lt(t))||{}}catch(t){}return e},Ot(t,e,i,r,n){if(!d)return!1;try{var s="",o="",a=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=d),ya)return ya;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),r=Math.min(i.length,8),n="dmn_chk_"+ga();!ya&&r--;){var s=i.slice(r).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",ya=s)}return ya}(t);if(!i){var r=(t=>{var e=t.match(_a);return e?e[0]:""})(t);r!==i&&Pn.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(d.location.hostname,r);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&Pn.warn("cookieStore warning: large cookie, len="+u.length),d.cookie=u,!0}catch(t){return!1}},Dt(t,e){if(null!=d&&d.cookie)try{wa.Ot(t,"",-1,e)}catch(t){return}}},ka=null,Sa={Et(){if(!Pe(ka))return ka;var t=!0;if(Ie(l))t=!1;else try{var e="__mplssupport__";Sa.Ot(e,"xyz"),'"xyz"'!==Sa.Lt(e)&&(t=!1),Sa.Dt(e)}catch(e){t=!1}return t||Pn.error("localStorage unsupported; falling back to cookie store"),ka=t,t},Pt(t){Pn.error("localStorage error: "+t)},Lt(t){try{return null==l?void 0:l.localStorage.getItem(t)}catch(t){Sa.Pt(t)}return null},Nt(t){try{return JSON.parse(Sa.Lt(t))||{}}catch(t){}return null},Ot(t,e){try{return null==l||l.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Sa.Pt(t)}return!1},Dt(t){try{null==l||l.localStorage.removeItem(t)}catch(t){Sa.Pt(t)}}},xa=[ct,st,nt,at,lt,ut,At,Rt,Mt],Ca=[S,k,Z,Q,Nt,Lt,M,Pt],Ta=t=>t+"_cpm",Ea=["__proto__","constructor","prototype"],Ma=t=>{if(!Ee(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===Ea.indexOf(i)&&(e[i]=t[i])}),e},Ia=function(t,e){void 0===e&&(e=[]);var i={};return[...Ca,...e].forEach(e=>{var r=t[e];Ie(r)||Pe(r)||""===r||(i[e]=r)}),i},Ra=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)},Aa=(t,e)=>({p:e,f:Ra(JSON.stringify(t))}),Pa=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=wa.Nt(Ta(t)),r=(null==i?void 0:i.f)===Ra(e)&&Ce(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Oa=(t,e)=>e+"|"+(wa.Lt(Ta(t))||""),Fa={},$a={Et:()=>!0,Pt(t){Pn.error("memoryStorage error: "+t)},Lt:t=>t in Fa?Fa[t]:null,Nt:t=>t in Fa?Fa[t]:null,Ot:(t,e)=>(Fa[t]=e,!0),Dt(t){delete Fa[t]}},Da=null,La={Et(){if(!Pe(Da))return Da;if(Da=!0,Ie(l))Da=!1;else try{var t="__support__";La.Ot(t,"xyz"),'"xyz"'!==La.Lt(t)&&(Da=!1),La.Dt(t)}catch(t){Da=!1}return Da},Pt(t){Pn.error("sessionStorage error: ",t)},Lt(t){try{return null==l?void 0:l.sessionStorage.getItem(t)}catch(t){La.Pt(t)}return null},Nt(t){try{return JSON.parse(La.Lt(t))||null}catch(t){}return null},Ot(t,e){try{return null==l||l.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){La.Pt(t)}return!1},Dt(t){try{null==l||l.sessionStorage.removeItem(t)}catch(t){La.Pt(t)}}};Rn.DEBUG=!1,Rn.LIB_VERSION="1.428.8",Rn.LIB_NAME="web";var Na=Rn,qa=class{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.Ft=t.get_property.bind(t),this.qt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.qt(rt,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,i=this.Ft(rt);return Ee(e=i)&&Re(e.sessionId)&&Fe(e.size)&&i.sessionId===t?i.size:0}};function ja(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<Ze(100*e,0,100,Pn)}function Ba(t){return"$survey_response_"+t}function Ua(t,e){if(!e)return null;var i=t[Ba(e)];return Ce(i)?[...i]:i}function Ha(t,e,i){void 0===t&&(t={});var r={};return e.questions.forEach(e=>{if(!Ie(e.originalQuestionIndex)){var i,n=0===(i=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,s=Ua(t,e.id);Ie(s)||(r[n]=s)}}),s({$survey_questions:e.questions.map(e=>{var r,n;return{id:e.id,question:null!==(r=null==i?void 0:i[null!==(n=e.id)&&void 0!==n?n:""])&&void 0!==r?r:e.question,response:Ua(t,e.id)}})},t,r)}function za(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 Wa(t){return"string"==typeof t&&t.trim()?t.trim():null}function Va(t){return t.toLowerCase()}function Ga(t,e,i){if(!t||!e)return null;var r=Va(e),n=Object.keys(t).find(t=>Va(t)===r);if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],o=Object.keys(t).find(t=>Va(t)===s);if(o)return null==i||i.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}var Za=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function Qa(t,e,i){var r,n=Ga(t.translations,e,i),o=s({},t),a=!1;if(n){var l,u=null==(l=t.translations)?void 0:l[n];if(u)if(null==i||i.info("Applying survey-level translation for language: "+n),Ie(u.name)||(o.name=u.name,a=!0),o.appearance){var h=s({},o.appearance);for(var d of Za){var v=u[d];Ie(v)||(h[d]=v,a=!0)}o.appearance=h}else(function(t){return Za.some(e=>!Ie(t[e]))})(u)&&(a=!0)}var c=t.questions.map(t=>function(t,e,i){var r,n=Ga(t.translations,e,i);if(!n)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(r=t.translations)?void 0:r[n];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=s({},t),l=!1;return Ie(o.question)||(a.question=o.question,l=!0),Ie(o.description)||(a.description=o.description,l=!0),Ie(o.buttonText)||(a.buttonText=o.buttonText,l=!0),"link"in a&&!Ie(o.link)&&(a.link=o.link,l=!0),"lowerBoundLabel"in a&&!Ie(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,l=!0),"upperBoundLabel"in a&&!Ie(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,l=!0),"choices"in a&&function(t){return Ce(t.choices)}(o)&&(a.choices=o.choices,l=!0),{question:l?a:t,matchedKey:l?n:null,hasChanges:l}}(t,e,i)),f=c.map(t=>t.question),p=c.some(t=>t.hasChanges),g=null;return n||(g=(null==(r=c.find(t=>t.matchedKey))?void 0:r.matchedKey)||null),p&&(o.questions=f,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:o,matchedKey:a?n||g:null}}function Ja(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Ka(t){var e;return Ja(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var Ya=(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}},Xa=t=>t.toLowerCase(),tl={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=>Ya(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Ya(e,t))),icontains:(t,e)=>e.map(Xa).some(e=>t.map(Xa).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Xa).every(e=>t.map(Xa).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 el(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=tl[i.operator];return!!n&&n(i.values,[String(r)])})}function il(t,e,i){return Gn({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var rl=new Set(["is_not","not_icontains","not_regex"]);function nl(t,e,i){return!t||0===t.length||t.every(t=>{var r,n=null==(r="person"===t.type?i:e)?void 0:r[t.key],s=t.operator||"exact";if(Ie(n)||Pe(n))return rl.has(s);var o=tl[s];return!!o&&!Ie(t.value)&&!Pe(t.value)&&o(Ce(t.value)?t.value.map(String):[String(t.value)],Ce(n)?n.map(String):[String(n)])})}var sl=On("[SessionRecording]");function ol(t,e){return e?t:"!"+t}function al(t,e){return t===e||t!=="!"+e&&null}var ll=class{constructor(t,e,i,r,n,s,o){this._instance=t,this.Y=e,this.tt=i,this.et=r,this.jt=n,this.Bt=s,this.Ht=o,this.$t=null,this.zt=So}onRemoteConfig(t){this.$t=Fe(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ut=new fo([this.tt,this.Y]),this.zt=ko):(this.Ut=new po([this.tt,this.Y]),this.zt=So),this._instance.register_for_session({[Zt]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.jt("linked_flag_matched",{flag:t,variant:e}),this.Ht()})}getStatus(t){return this.zt({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,i=null==(e=this._instance.get_property("$session_recording_remote_config"))?void 0:e.minimumDurationMilliseconds;return Fe(i)?i:null}checkUrlTriggers(t,e,i,r){this.Y.checkUrlTriggerConditions(e,i,r,t)}setupEventTriggerListeners(t,e,i){if(0!==this.tt.K.length&&Oe(this.Wt))return this.Wt=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,i,e)}catch(t){sl.error("Could not activate event trigger",t)}}),this.Wt}makeSamplingDecisions(t){var e,i,r,n=this.$t;if(!Fe(n))return null==(i=this._instance.persistence)||i.unregister(Q),void(null==(r=this._instance.persistence)||r.unregister(H));var s=this._instance.get_property(Q),o=this._instance.get_property(H),a=al(s,t),l=Fe(o)&&o!==n,u=Ie(o)&&s===t,h=l||u||!De(a),d=h?ja(t,n):a;h&&(d?this.jt("sampled"):sl.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Q]:ol(t,d),[H]:Pe(o)&&s===t?null:n})}ensureSamplingDecision(t){Fe(this.$t)&&(De(al(this._instance.get_property(Q),t))||this.makeSamplingDecisions(t))}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,i,r,n;null==(t=this._instance.persistence)||t.unregister(Y),null==(e=this._instance.persistence)||e.unregister(K),null==(i=this._instance.persistence)||i.unregister(Q),null==(r=this._instance.persistence)||r.unregister(H),null==(n=this._instance.persistence)||n.unregister(J)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Ut)?void 0:e.triggerStatus(t))===ao}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===ao).map(t=>t.label)}stop(){var t;null==(t=this.Wt)||t.call(this),this.Wt=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},ul=class{constructor(t,e,i,r,n){this._instance=t,this.Y=e,this.jt=i,this.Vt=r,this.Ht=n,this.Zt=[],this.Gt=new Map,this.Qt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Jt(t.triggerGroups),this._instance.register_for_session({[Zt]:"v2_trigger_groups",[Qt]:t.triggerGroups.length}),this.Y.onConfig(t)):sl.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return so;if(!t.receivedFlags)return io;if(!t.isRecordingEnabled)return Xs;if(t.urlTriggerMatching.urlBlocked)return ro;var e=t.triggerGroupMatchers,i=t.triggerGroupSamplingResults;if(0===e.length)return Xs;var r=!1,n=!1;for(var s of e){var o=s.triggerStatus(t.sessionId);if("trigger_activated"===o){var a=s.group.id,l=i.get(a);Ie(l)?Pn.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:a}):!0===l&&(n=!0)}else"trigger_pending"===o&&(r=!0)}return n?to:r?io:Xs}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Zt,triggerGroupSamplingResults:this.Gt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var i of this.Zt)if("trigger_activated"===i.triggerStatus(t)){var r=i.group.minDurationMs;Fe(r)&&(Pe(e)||e>r)&&(e=r)}return e}checkUrlTriggers(t,e,i,r){var n=this;this.Y.checkUrlBlocklist(e,i);var s=function(r){r.checkUrlTriggerConditions(e,i,e=>{n.Kt(r,void 0)&&(r.activateTrigger(e,t),n.updateActiveTriggers(t),n.Ht(e))},t)};for(var o of this.Zt)s(o)}setupEventTriggerListeners(t,e,i){var r=this;return this.Wt=t(t=>{var i;if(this.Qt)return sl.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(i=this.Wt)||i.call(this),void(this.Wt=void 0);try{var n=function(i){i.checkEventTriggerConditions(t.event,n=>{if(r.Kt(i,t.properties)){var s=(i.group.conditions.events||[]).filter(e=>e.name===t.event),o=r._instance.get_property(ct);s.some(e=>!e.properties||0===e.properties.length||nl(e.properties,t.properties,o))&&(i.activateTrigger(n,e),r.updateActiveTriggers(e),r.Ht(n))}},e)};for(var s of this.Zt)n(s)}catch(t){sl.error("Could not activate event trigger for trigger groups",t)}}),this.Wt}makeSamplingDecisions(t){for(var e of this.Zt){var i,r=e.group,n=r.id,s=r.sampleRate,o=et+n,a=this._instance.get_property(o),l=null,u=!1,h=!1,d=!1;if(Ee(a)){var v=a.sessionId,c=a.sampleRate,f=a.sampled;u="string"==typeof v&&v!==t,h=Fe(c)&&c!==s,l=v===t&&Fe(c)&&c===s&&De(f)?f:null}else l=a===t||null,u="string"==typeof a&&a!==t,d=a===t;var p=u||h||d||!De(l),g=p?ja(t+n,s):l;p&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:n,group_name:r.name,sampleRate:s,isSampled:g}),this.Gt.set(n,g),null==(i=this._instance.persistence)||i.register({[o]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Qt=!0}clearConditionalRecordingPersistence(){var t,e,i;for(var r of(null==(t=this._instance.persistence)||t.unregister(Q),null==(e=this._instance.persistence)||e.unregister(H),null==(i=this._instance.persistence)||i.unregister(J),this.Zt)){var n,s,o,a=r.group.id;null==(n=this._instance.persistence)||n.unregister(X+a),null==(s=this._instance.persistence)||s.unregister(tt+a),null==(o=this._instance.persistence)||o.unregister(et+a)}}updateActiveTriggers(t){var e=[];for(var i of this.Zt){var r=i.group,n=r.id,s="trigger_activated"===i.triggerStatus(t),o=!0===this.Gt.get(n);s&&e.push({id:n,name:r.name,matched:!0,sampled:o})}this._instance.register_for_session({[Vt]:e})}hasPendingTriggers(t){for(var e of this.Zt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Zt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>'trigger group "'+e.group.name+'": '+t))}stop(){var t;null==(t=this.Wt)||t.call(this),this.Wt=void 0,this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear(),this.Y.stop()}Kt(t,e){var i=t.group.conditions.properties;return!i||0===i.length||nl(i,e,this._instance.get_property(ct))}Jt(t){var e=this;this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear();var i=function(t){var i=new wo(e._instance,t,(i,r)=>{e.jt("linked_flag_matched",{flag:i,variant:r,group_id:t.id,group_name:t.name}),e.Ht()});e.Zt.push(i)};for(var r of t)i(r)}},hl=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],dl=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...hl],vl="<masked>",cl=["li_fat_id"];function fl(t,e,i){if(!d)return{};var r,n=e?[...hl,...i||[]]:[],s=pl(Kn(d.URL,n,vl),t);return Dn((r={},$n(cl,function(t){var e=ha(t);r[t]=e||null}),r),s)}function pl(t,e){var i=dl.concat(e||[]),r={};return $n(i,function(e){var i=Jn(t,e);r[e]=i||null}),r}function gl(t){var e=function(t){return t?0===t.search("https?://(.*)google.([^/?]*)")?"google":0===t.search("https?://(.*)bing.com")?"bing":0===t.search("https?://(.*)yahoo.com")?"yahoo":0===t.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",r={};if(!Pe(e)){r.$search_engine=e;var n=d?Jn(d.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function ml(){return navigator.language||navigator.userLanguage}var yl="$direct";function _l(){return(null==d?void 0:d.referrer)||yl}function bl(t,e,i){var r;void 0===i&&(i=!1);var n=t?[...hl,...e||[]]:[],s=null==(r=i?lr(null==v?void 0:v.href):null==v?void 0:v.href)?void 0:r.substring(0,1e3);return{r:_l().substring(0,1e3),u:s?Kn(s,n,vl):void 0}}function wl(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?lr(n):n,o={$referrer:r,$referring_domain:null==r?void 0:r==yl?yl:null==(i=Zn(r))?void 0:i.host};if(s){o.$current_url=s;var a=Zn(s);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,Dn(o,pl(s))}return r&&Dn(o,gl(r)),o}function kl(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Sl(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var xl=1e5,Cl=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,Tl=[],El=()=>!1,Ml="@type @id 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(" "),Il="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),Rl="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(" "),Al="Accommodation AdministrativeArea Country Place State".split(" "),Pl={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:Il,publisher:Rl},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:Tl},Offer:{seller:Rl},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},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:Rl,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:Rl,areaServed:Al,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:Tl}},Ol=[["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(" "),Pl.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),Pl.Event],[Rl,Pl.Organization],[Al,Pl.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),Pl.Product]];function Fl(t,e){return Se.call(t,e)?t[e]:void 0}function $l(t){var e=typeof t;return Pe(t)||"string"===e||"number"===e||"boolean"===e}function Dl(t){return $l(t)||Ce(t)&&t.every($l)?t:void 0}function Ll(t,e){if("string"==typeof t){var i=t.trim(),r=i.indexOf("#"),n=0>r?i:i.slice(r+1);if(!(!n||0>r&&(/^[a-z][a-z\d+.-]*:/i.test(i)||i.includes("/")||i.includes("?"))))try{return e(n)?n:void 0}catch(t){return}}}function Nl(t){if(Se.call(Pl,t))return Pl[t];for(var e of Ol){var i=e[1];if(e[0].includes(t))return i}}function ql(t,e,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0})}function jl(t,e,i,r){if(Ce(t)){var n=t.map(t=>jl(t,e,i,r)).filter(t=>!Ie(t));return n.length?n:void 0}return Bl(t,e,i,r)||void 0}function Bl(t,e,i,r){if(!Ee(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(i))return null;var n=Fl(t,"@type"),s=function(t){var e=new Set,i="string"==typeof t?[t]:Ce(t)?t:[],r=[];for(var n of i)if("string"==typeof n){var s=n.replace(/^https?:\/\/schema\.org\//,"");if(100>=s.length&&Cl.test(s)&&!e.has(s)&&(e.add(s),r.push(s),20===r.length))break}return r}(n),o=s.filter(t=>!!Nl(t)&&(!r||!r.length||r.includes(t))),a={};for(var l of Ml){var u="@type"===l?s.length?"string"==typeof n?s[0]:s:void 0:"@id"===l?Ll(Fl(t,l),e):Dl(Fl(t,l));Ie(u)||ql(a,l,u)}for(var h of o){var d=Nl(h);for(var v of Object.keys(d)){var c=Fl(t,v),f=d[v];if(!0===f){var p=Dl(c);Ie(p)||ql(a,v,p)}else{var g=jl(c,e,i,f);Ie(g)||ql(a,v,g)}}}var m=jl(Fl(t,"@graph"),e,i);return Ie(m)||ql(a,"@graph",m),Object.keys(a).length?a:null}function Ul(t,e,i){if(!Ee(t))return null;var r=Fl(t,"@context");if("string"!=typeof r||!/^https?:\/\/schema\.org\/?$/.test(r))return null;var n=Bl(t,e,i);return n?s({"@context":"https://schema.org"},n):null}function Hl(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function zl(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 Wl(t,e,i){for(var r=t;r;){if(zl(r,e,i))return!0;var n=r.parentNode;r=r.parentElement||(n&&n.nodeType===n.DOCUMENT_FRAGMENT_NODE?n.host:null)}return!1}function Vl(t){return Hl(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Hl)}function Gl(t){return Ie(t)?void 0:Math.round(t)}function Zl(t){return Ee(t)?t.network_timing:t}var Ql,Jl,Kl=On("[SessionRecording]"),Yl=[1,2,3,4,5,6,7,12],Xl=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function tu(){var t;return null==b||null==(t=b.__PosthogExtensions__)?void 0:t.rrweb}function eu(){var t;return null==(t=tu())?void 0:t.record}function iu(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,xo())}}function ru(t){return la(oa(aa(iu(t))),!0)}function nu(t){return su.apply(this,arguments)}function su(){return(su=a(function*(t){var e=yield ln(iu(t),Na.DEBUG,{rethrow:!0});return la(new Uint8Array(yield e.arrayBuffer()),!0)})).apply(this,arguments)}var ou="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,au=!1;function lu(t){return Ce(t)&&0===t.length?Ql=null!=Ql?Ql:ru([]):ru(t)}function uu(t){return hu.apply(this,arguments)}function hu(){return(hu=a(function*(t){return Ce(t)&&0===t.length?Ql||(Jl=null!=Jl?Jl:nu([]).then(t=>(Ql=t,t)).catch(t=>{throw Ql=void 0,Jl=void 0,t})):nu(t)})).apply(this,arguments)}function du(t){return ou&&!au&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function vu(t){return{event:t,size:To(t)}}function cu(t,e){return s({},t,{data:e,cv:"2024-10"})}function fu(t,e){return s({},t,{cv:"2024-10",data:s({},t.data,e)})}function pu(t){try{if(2===t.type)return vu(cu(t,ru(t.data)));if(3===t.type&&0===t.data.source)return vu(fu(t,{texts:lu(t.data.texts),attributes:lu(t.data.attributes),removes:lu(t.data.removes),adds:lu(t.data.adds)}));if(3===t.type&&8===t.data.source)return vu(fu(t,{adds:t.data.adds?ru(t.data.adds):void 0,removes:t.data.removes?ru(t.data.removes):void 0}))}catch(t){Kl.error("could not compress event - will use uncompressed event",t)}return{event:t,size:Co(t)}}function gu(){return gu=a(function*(t){try{if(2===t.type)return vu(cu(t,yield nu(t.data)));if(3===t.type&&0===t.data.source){var e=yield Promise.all([uu(t.data.texts),uu(t.data.attributes),uu(t.data.removes),uu(t.data.adds)]);return vu(fu(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(3===t.type&&8===t.data.source){var i=yield Promise.all([t.data.adds?nu(t.data.adds):void 0,t.data.removes?nu(t.data.removes):void 0]);return vu(fu(t,{adds:i[0],removes:i[1]}))}}catch(e){return sn(e)&&(au=!0),Kl.error("could not compress event asynchronously - trying synchronous compression",e),pu(t)}return{event:t,size:Co(t)}}),gu.apply(this,arguments)}function mu(t,e){return 5===t.type&&t.data.tag===e}function yu(t){return mu(t,"sessionIdle")}function _u(t){return mu(t,"$session_ending")}function bu(t){return mu(t,"$session_starting")}var wu=class{get sessionId(){return this.Xt}get Yt(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get te(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ee(){return al(this._instance.get_property(Q),this.sessionId)}get $t(){var t,e=null==(t=this.re)?void 0:t.sampleRate;return Fe(e)?e:null}get ie(){var t,e;return null!==(t=null==(e=this.ne)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.oe="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.ae=void 0,this.se=!1,this.ue=Date.now(),this.le=!1,this.he=[],this.ce="unknown",this.de=0,this.ve=0,this.fe=0,this.pe=0,this.ge=!1,this.me=!1,this.ye=!1,this.be=!1,this.we=!1,this.ke=!1,this._e=!1,this.Se=!1,this.xe=!1,this.Ce=!1,this.Me=!1,this.Te=!1,this.Ie=[],this.Re=void 0,this.Ae=void 0,this.Ee=!1,this.Oe=[],this.Le=0,this.De=0,this.Pe=!1,this.Ne=void 0,this.Wt=void 0,this.Fe=void 0,this.qe=void 0,this.je=void 0,this.Be=(t,e,i)=>{var r,n,s,o;if(i&&(t!==this.Xt||e!==this.He)){var a=!i.noSessionId&&(i.activityTimeout||i.sessionPastMaximumLength),l=this.Xt,u=this.He;if(a&&this.Vt("$session_ending",{currentSessionId:l,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.ue,flushed_size:null==(r=this.$e)?void 0:r.currentTrackedSize(l)}),null==(n=this._instance.persistence)||n.unregister(it),this._e=!1,null==(s=tu())||null==s.resetMaxDepthState||s.resetMaxDepthState(),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:i}),this.ze(),!(!1===this.ce&&this.isStarted||this.Xt===t&&this.He===e)){var h=this.Xt!==t&&!1!==this.ce;this.ce="unknown",this.Ue(h)}a&&this.Vt("$session_starting",{previousSessionId:l,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:i,lastActivityTimestamp:this.ue}),null==(o=this.ne)||o.makeSamplingDecisions(t)}},this.We=!1,this.Ve=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[J])===this.Xt},this.Ze=()=>{var t,e;if(0===this.Rt.data.length)return null;var i=null==(t=this.Rt.data[0])?void 0:t.timestamp,r=null==(e=this.Rt.data[this.Rt.data.length-1])?void 0:e.timestamp;return Fe(i)&&Fe(r)?r-i:null},this.Ge=()=>{var t,e,i=this.ie;if(!Fe(i))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var r=this.Qe;return Fe(r)&&r>=0&&i>r}if(this.Ve())return!1;var n,s=this.Ze();return!!Pe(s)||i>s||(null==(n=this._instance.persistence)||n.register({[J]:this.Xt}),!1)},this.Je=()=>{"buffering"!==this.status?(this.ge&&this.me&&this.Ke&&!this.ye&&this.Xe(void 0),this.Ye(),this.tr(!0)):this.er()},this.rr=()=>{this.Je()},this.ir=()=>{this.Vt("browser offline",{})},this.nr=()=>{this.Vt("browser online",{})},this.ar=()=>{null!=d&&d.visibilityState&&("visible"===d.visibilityState&&(this.Ke=!0),this.Vt("window "+d.visibilityState,{}))},this.Ke=null==e||e;var i=this.Yt.checkAndGetSessionAndWindowId(),r=i.windowId,n=i.sessionStartTimestamp;this.Xt=i.sessionId,this.He=r,this._sessionStartTimestamp=n,this.et=new _o(this._instance),this.Y=new yo(this._instance),this.tt=new bo(this._instance),this.Rt=this.er(),this.sr="ph_"+(this._instance.config.persistence_name||this._instance.config.token)+"_replay_pending_buffer",this.Yt.sessionTimeoutMs>this.te||Kl.warn("session_idle_threshold_ms ("+this.te+") is greater than the session timeout ("+this.Yt.sessionTimeoutMs+"). Session will never be detected as idle"),this.$e=new qa(this._instance)}setDocumentWasEverVisible(t){t&&(this.Ke=!0)}get ur(){var t,e,i,r,n,s,o,a,l,u=null==(t=this.re)?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!==(o=null==h?void 0:h.maskTextSelector)&&void 0!==o?o:null==u?void 0:u.maskTextSelector,c=null!==(a=null==h?void 0:h.blockSelector)&&void 0!==a?a: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 Ie(d)&&Ie(v)&&Ie(c)&&Ie(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:v,blockSelector:c,maskAllElementAttributes:f}}lr(){var t;if(!this.xe){var e=null==(t=this.re)?void 0:t.masking;if(!Oe(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!Ie(r)&&r!==n});0!==r.length&&(this.xe=!0,Kl.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 hr(){var t;return Ze(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,On("canvas recording resolution scale"),1)}get cr(){var t,e,i,r,n,s,o,a=this._instance.config.session_recording.captureCanvas,l=null==(t=this.re)?void 0:t.canvasRecording,u=null!==(e=null!==(i=null==a?void 0:a.recordCanvas)&&void 0!==i?i:null==l?void 0:l.enabled)&&void 0!==e&&e,h=null!==(r=null!==(n=null==a?void 0:a.canvasFps)&&void 0!==n?n:null==l?void 0:l.fps)&&void 0!==r?r:4,d=null!==(s=null!==(o=null==a?void 0:a.canvasQuality)&&void 0!==o?o: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:Ze(h,0,12,On("canvas recording fps"),4),quality:Ze(d,0,1,On("canvas recording quality"),.4)}}get dr(){var t,e,i=!(null==(t=this.re)||!t.consoleLogRecordingEnabled);return null!==(e=this._instance.config.enable_recording_console_log)&&void 0!==e?e:i}get vr(){var t,e,i,r=null==(t=this.re)?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),o=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),a=Zl(this._instance.config.capture_performance),l=Zl(null==r?void 0:r.capturePerformance),u=!!(De(a)?a:l);return s||o||u?{recordHeaders:s,recordBody:o,recordPerformance:u}:void 0}pr(){var t,e,i=[],r=null==(t=b.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;r&&this.dr&&i.push(r());var n=null==(e=b.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.vr&&Te(n))if(!Vn.includes(v.hostname)||this._forceAllowLocalhostNetworkCapture){var o=Te(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(n(((t,e,i)=>{var r,n={payloadSizeLimitBytes:zs.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...zs.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...zs.payloadHostDenyList]},o=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,l=!1!==t.capture_performance&&e.recordPerformance,u=(r=Hs(n),t=>(null!=t&&t.requestBody&&(t.requestBody=Js(t.requestBody,t.requestHeaders,r,"Request")),null!=t&&t.responseBody&&(t.responseBody=Js(t.responseBody,t.responseHeaders,r,"Response")),t)),h=e=>{return u(((t,e,i)=>{var r;if(null==i||!i(t.name)){var n=Zn(t.name),s=0===e.indexOf("http")?null==(r=Zn(e))?void 0:r.pathname:e;"/"===s&&(s="");var o=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&o&&Qs.some(t=>0===o.indexOf(t))))return t}})((Zs((r=e).requestHeaders),Zs(r.responseHeaders),r),t.api_host,i));var r},d=Te(t.session_recording.maskNetworkRequestFn);return d&&Te(t.session_recording.maskCapturedNetworkRequestFn)&&Pn.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return!i&&e.isInitial?i:s({},e,{name:null==i?void 0:i.url})}),n.maskRequestFn=Te(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var i=h(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 Oe(n)&&r?(Ys.add(r),r):null!=n?n:void 0}}:t=>function(t){if(!Ie(t))return t.requestBody=Ks(t.requestBody,"Request"),t.responseBody=Ks(t.responseBody,"Response"),t}(h(t)),s({},zs,n,{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.vr,o)))}else Kl.info("NetworkCapture not started because we are on localhost.");return i}gr(t){return this._instance.config.disable_capture_url_hashes?lr(t):t}mr(t,e){void 0===e&&(e=!1);var i=e?lr(t):this.gr(t),r=this._instance.config.mask_personal_data_properties?[...hl,...this._instance.config.custom_personal_data_properties||[]]:[];return this.yr(Kn(i,r,vl))}yr(t){var e,i=this._instance.config.session_recording;if(i.maskCapturedNetworkRequestFn){var r,n=i.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==n?void 0:n.name)&&void 0!==r?r:null==n?void 0:n.url}return i.maskNetworkRequestFn?null==(e=i.maskNetworkRequestFn({url:t}))?void 0:e.url:t}br(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.he.length?this.he.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Kl.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.br(Xl(()=>eu().addCustomEvent(t,e)))}wr(){var t;return this.se&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.ce}kr(t){if(!this.wr())return!1;try{var e=eu();return!!e&&(e.addCustomEvent("$json_ld",t),this.wr())}catch(t){return!1}}_r(t){void 0===t&&(t=!1),Promise.resolve().then(()=>{var e;return null==(e=this.Sr)?void 0:e.scan(t)})}Cr(){try{if(this._instance.config.capture_pageview||!l)return;var t=new URL(l.location.href),e=this.mr(t.origin+t.pathname+t.search);this.Mr!==e&&(this.Mr=e,this.Vt("$url_changed",{href:e}))}catch(t){}}Tr(){if(this.he.length){var t=[...this.he];this.he=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.br(t)})}}Bt(){return this.br(Xl(()=>eu().takeFullSnapshot()))}get Ir(){var t,e,i;if(null!=(t=this.ne)&&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 Fe(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}Rr(){if(this.Ar&&clearInterval(this.Ar),!0!==this.ce){var t=this.Ir;t&&(this.Ar=setInterval(()=>{this.Bt()},t))}}Ht(t){"event"===t&&this.Er(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Rr()}Or(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null==(t=this.Sr)||t.scan(),clearInterval(this.Ar),Kl.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}Lr(){var t;this.Y.urlBlocked&&(null==(t=this.Sr)||t.scan(),this.Y.urlBlocked=!1,this.Bt(),this._r(),this.Rr(),this.Vt("recording resumed",{reason:"left blocked url"}),Kl.info("recording resumed"))}Dr(t,e){var i;if("event"===t&&this.Er(),!this.le&&null!=(i=this.ne)&&i.hasPendingTriggers(this.sessionId)){this.le=!0;try{var r,n,s="url"===t?K:Y;null==(r=this._instance.persistence)||r.register({[s]:this.sessionId}),null==(n=this.ne)||n.updateActiveTriggers(this.sessionId),this.Ht(),this.tr(),this.jt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.le=!1}}}get isStarted(){return!!this.ae}get re(){var t=this._instance.get_property(B);if(t){var e;try{e=Ee(t)?t:JSON.parse(t)}catch(t){return void Kl.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.We){var i,r,n=null!==(i=e.cache_timestamp)&&void 0!==i?i:Date.now();if(Date.now()-n>36e5)return Kl.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(B))}return e}}Pr(t,e,i){this._instance.get_property(t)&&(e(),i())}start(t){var e,i,r=this.re;if(r){if(!this.isStarted){var n=!1!==this.ce&&!this.be;this.Xe(n?"no_interaction_since_recording_started":void 0),this.be=!1,this.me=n,this.ye=!1}this.Pe&&(this.Nr(),this.er());var s=this.Yt.checkAndGetSessionAndWindowId(),o=s.windowId,a=s.sessionStartTimestamp;this.Xt=s.sessionId,this.He=o,this._sessionStartTimestamp=a,this.Fr(),null==(e=this._instance.persistence)||e.unregister(it),null!=r&&r.endpoint&&(this.oe=null==r?void 0:r.endpoint),this.ne=2===(null==r?void 0:r.version)&&null!=r&&r.triggerGroups&&r.triggerGroups.length>0?new ul(this._instance,this.Y,this.jt.bind(this),this.Vt.bind(this),this.Ht.bind(this)):new ll(this._instance,this.Y,this.tt,this.et,this.jt.bind(this),this.Bt.bind(this),this.Ht.bind(this)),this.ne.onRemoteConfig(r),null==(i=this.Wt)||i.call(this),this.Wt=this.ne.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.Dr(t,e)),this.Pr(z,()=>{this.overrideSampling()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(z)}),this.Pr(W,()=>{this.overrideLinkedFlag()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(W)}),this.Pr(G,()=>{this.overrideTrigger("event")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(G)}),this.Pr(V,()=>{this.overrideTrigger("url")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(V)}),this.ne.makeSamplingDecisions(this.sessionId),this.qr(),this.we||(zn(l,"beforeunload",this.Je),zn(l,"pagehide",this.rr),zn(l,"offline",this.ir),zn(l,"online",this.nr),zn(d,"visibilitychange",this.ar),!this.Fe&&Te(this.Yt.onSessionId)&&(this.Fe=this.Yt.onSessionId(this.Be)),!this.qe&&Te(this.Yt.on)?this.qe=this.Yt.on("forcedIdleReset",()=>{this.ze(),this.ce="unknown",this.stop(),this.je=this.Yt.onSessionId((t,e,i)=>{var r;null==(r=this.je)||r.call(this),this.je=void 0,this.Be(t,e,i)})}):Te(this.Yt.on)||Kl.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Oe(this.Ne)&&(this.Ne=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.mr(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){Kl.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.jt(t||"recording_initialized"))}else Kl.info("remote config must be stored in persistence before recording can start")}jr(){var t,e,i,r,n,s;null==l||l.removeEventListener("beforeunload",this.Je),null==l||l.removeEventListener("pagehide",this.rr),null==l||l.removeEventListener("offline",this.ir),null==l||l.removeEventListener("online",this.nr),null==d||d.removeEventListener("visibilitychange",this.ar),clearInterval(this.Ar),this.Br(),null==(t=this.Ne)||t.call(this),this.Ne=void 0,null==(e=this.Wt)||e.call(this),this.Wt=void 0,null==(i=this.Fe)||i.call(this),this.Fe=void 0,null==(r=this.qe)||r.call(this),this.qe=void 0,null==(n=this.je)||n.call(this),this.je=void 0,null==(s=this.ne)||s.stop(),this.Hr(),this.Nr()}Nr(){this.De+=1,this.Oe=[],this.Le=0,this.$r=void 0,this.Pe=!1}Hr(){var t,e;null==(t=this.zr)||t.stop(),this.he=[],null==(e=this.Sr)||e.stop(),this.Sr=void 0,this.se=!1;try{var i;null==(i=this.ae)||i.call(this)}catch(t){Kl.warn("could not stop rrweb",t)}this.ae=void 0}Ur(){if(!this.$r||0===this.Le)return!1;if(this.Pe)return!0;this.Pe=!0,this.Wr=void 0;var t=this.De;return this.Br(),this.Hr(),this.$r.catch(()=>{}).then(()=>{t===this.De&&(this.Pe=!1,this.tr(),this.er(),this.Vr(),this.jr(),Kl.info("stopped"))}).catch(()=>{this.Pe=!1,this.Vr(),this.jr(),Kl.info("stopped")}),!0}stop(){if(this.Hr(),this.We)this.Ye();else if(this.Ur())return;this.tr(),this.er(),this.Vr(),this.jr(),Kl.info("stopped")}Vr(){this.Xe(void 0,{preserveLogDedup:this.We}),this.me=!1}flushBeforeIdentityReset(){(this.isStarted||this.Pe)&&(this.Ye(),this.tr())}Ue(t){this.We=!0,this.ue=Date.now();try{var e;this.stop(),this.Zr=void 0,this.Gr=void 0,this.ve=0,this.fe=0,this.pe=0,null==(e=tu())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.We=!1}this.Xe(t?"no_interaction_since_session_rotated":void 0),this.me=!1}Xe(t,e){var i=(void 0===e?{}:e).preserveLogDedup,r=void 0!==i&&i;if(this.ge=!Ie(t),this.Wr=t,Ie(t))r||(this.Qr=void 0);else if(!this.We){var n=this.sessionId+":"+t;n!==this.Qr&&(this.Qr=n,Kl.info("holding buffer: "+t+". nothing is uploaded until the user interacts with the page"))}}Er(){this.isStarted||(this.be=!0),this.ge&&(this.Xe(void 0),this.me=!1,this.ye&&(this.ye=!1,this.Bt()),this.Jr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents,i=void 0!==e&&e;this.ge=!0,i&&(this.er(),this.Hr()),this.er(),this.jr(),this.er(),this.Vr(),Kl.info("discarded")}Kr(t,e,i,r,n){var s={$snapshot_bytes:i,$snapshot_data:e,$session_id:r,$window_id:n};"disabled"!==this.status?(this.Xr(t,r),this.Yr(s)):this.er()}ti(){try{this.ei()}catch(t){this.Se||(this.Se=!0,Kl.error("could not track full snapshot cost",t))}}ei(){var t,e=null==(t=tu())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Gr&&(this.Gr=e,this.Zr&&this.Zr.durationMs>=e.durationMs||(this.Zr=e),500>e.durationMs||Kl.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}))}Xr(t,e){2!==t.type?3===t.type&&(Ie(this.Re)||this.Re===e||this.Ae===e||(this.Ae=e,Kl.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Bt())):this.Re=e}ri(t){t.counted&&t.generation===this.De&&(this.Le=Math.max(0,this.Le-1)),t.counted=!1,this.Oe=this.Oe.filter(e=>e!==t)}ii(t,e,i){t.processed||t.generation!==this.De||(t.processed=!0,this.Kr(t.event,e,i,t.targetSessionId,t.targetWindowId))}ni(t){try{var e=t.event,i=Co(t.event);if(t.compressionEnabled)try{var r=pu(t.event);e=r.event,i=r.size}catch(t){Kl.error("could not process queued compression event - will use uncompressed event",t)}try{this.ii(t,e,i)}catch(t){Kl.error("could not capture queued compression event",t)}}finally{this.ri(t)}}Ye(){[...this.Oe].forEach(t=>{this.ni(t)})}oi(t,e,i,r){var n=this,s={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:r,generation:this.De,processed:!1,counted:!0};this.Oe.push(s),this.Le+=1;var o=function(){var i=a(function*(){try{if(s.processed)return;var i,r;try{var o=e?du(t)?yield function(t){return gu.apply(this,arguments)}(t):pu(t):{event:t,size:Co(t)};i=o.event,r=o.size}catch(e){Kl.error("could not process queued compression event - will use uncompressed event",e),i=t,r=Co(t)}n.ii(s,i,r)}finally{n.ri(s)}});return function(){return i.apply(this,arguments)}}();this.$r=this.$r?this.$r.catch(()=>{}).then(o):o()}onRRwebEmit(t){var e,i,r,n,s,o,a,l,u;if(this._instance.sessionManager&&(this.Tr(),t&&Ee(t))){if(4===t.type){var h=this.mr(t.data.href);if(this.Mr=h,!h)return;t.data.href=h}else this.Cr();if(null==(e=this.ne)||e.checkUrlTriggers(this.sessionId,()=>this.Or(),()=>this.Lr(),(t,e)=>this.Dr(t,e)),!this.Y.urlBlocked||function(t){return 5===t.type&&"recording paused"===t.data.tag}(t)){var d,v,c;2===t.type&&(null!=(d=tu())&&null!=d.wasMaxDepthReached&&d.wasMaxDepthReached()&&(this._e=!0),this.ti(),Promise.resolve().then(()=>this.ti()),this.Rr(),null==(v=this.zr)||v.reset(),null==(c=this._instance.persistence)||c.register_once({[it]:t.timestamp},void 0));var f=2===t.type&&(null==(i=this.ne)?void 0:i.hasPendingTriggers(this.sessionId));f&&this.ai();var p=this.zr?this.zr.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&Ee(e)&&6===e.type&&Ee(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),m=function(t){return _u(t)?t.data.payload:null}(g),y=function(t){return bu(t)?t.data.payload:null}(g),_=function(t){return yu(t)?t.data.payload:null}(g);m||y?null!=m&&m.lastActivityTimestamp&&(g.timestamp=m.lastActivityTimestamp):null!=_&&_.sessionId||this.si(g),2===t.type&&(this.Ie.push([this.Xt,t.timestamp]),this.Ie.length>6&&(this.Ie=this.Ie.slice(-6)));var b=null!==(r=null!==(n=null!==(s=null==m?void 0:m.currentSessionId)&&void 0!==s?s:null==y?void 0:y.nextSessionId)&&void 0!==n?n:null==_?void 0:_.sessionId)&&void 0!==r?r:this.Xt,w=null!==(o=null!==(a=null!==(l=null==m?void 0:m.currentWindowId)&&void 0!==l?l:null==y?void 0:y.nextWindowId)&&void 0!==a?a:null==_?void 0:_.windowId)&&void 0!==o?o:this.He;if(!0!==this.ce||function(t){return yu(t)||_u(t)||bu(t)}(g)){2===g.type&&(this.de=0),_&&(g.timestamp=_.lastActivityTimestamp+_.threshold);var k=this.se;this.se=!0,f?this._r(!0):k||this._r();var S=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u;if(this.Le>0||S&&du(g))this.oi(g,S,b,w);else{var x=S?pu(g):{event:g,size:Co(g)};this.Kr(g,x.event,x.size,b,w)}}else(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source})(g)&&this.de++}else!0===this.ce&&this.de++}}}get status(){return this.ne?this.ne.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ee,rrwebError:this.we,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.re}):Xs}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.et.linkedFlagSeen=!0,this.Bt(),this.Er(),this.jt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Q]:this.sessionId,[H]:null}),this.Bt(),this.Er(),this.jt("sampling_overridden")}overrideTrigger(t){this.Dr(t),this.Er()}ui(){try{var t,e=null==l||null==(t=l.location)?void 0:t.href;if(!e)return;var i=this.mr(e);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}Br(){this.li&&(clearTimeout(this.li),this.li=void 0)}Jr(){this.li||(this.li=setTimeout(()=>{this.tr()},2e3))}hi(){return this.Re!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!_u(t)&&!bu(t))}ci(){var t,e;return null!==(t=null==(e=this.ne)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}di(t){if("buffering"!==t)return Ie(this.fi)||this._instance.register_for_session({[Gt]:[]}),void(this.fi=void 0);var e=this.ci();if(0===e.length)return Ie(this.fi)||this._instance.register_for_session({[Gt]:[]}),void(this.fi=void 0);var i=e.join(", "),r=this.sessionId+":"+i;r!==this.fi&&(this.fi=r,this._instance.register_for_session({[Gt]:e}),Kl.info("buffering: "+i))}pi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null==(t=this._instance.persistence)?void 0:t.gi)&&La.Et()}mi(){0!==this.Rt.data.length&&this.Rt.size!==this.yi&&943718.4>=this.Rt.size&&this.pi()&&(this.yi=this.Rt.size,La.Ot(this.sr,this.Rt))}Fr(){if(!this.Ee&&this.pi()){this.Ee=!0;var t=La.Nt(this.sr);La.Dt(this.sr),Ee(t)&&Ce(t.data)&&0!==t.data.length&&Ce(t.sizes)&&t.sizes.length===t.data.length&&Fe(t.size)&&t.sessionId===this.Xt&&t.windowId===this.He&&(this.Rt.data.length>0||(this.Rt=t))}}tr(t){var e;if(void 0===t&&(t=!1),this.Br(),this.ge)return this.Rt;if(this.hi())return this.Rt.size>943718.4?this.er():(t&&this.mi(),this.Rt);var i=this.Rt;null==(e=this.ne)||e.ensureSamplingDecision(this.sessionId);var r=this.Ge(),n=this.status;if(this.di(n),"buffering"===n||"paused"===n||"disabled"===n||r)return!t||"active"!==n&&"sampled"!==n||this.mi(),this.Jr(),this.Rt;if(this.Rt!==i)return this.Rt;if(i.data.length>0){var s,o=this.ui();Eo(i).forEach(t=>{try{var e;null==(e=this.$e)||e.trackSize(t.sessionId,t.size),this.bi({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:Na.LIB_NAME,$lib_version:Na.LIB_VERSION,$snapshot_host:o})}catch(t){Kl.warn("could not capture snapshot chunk - skipping it",t)}}),Ie(this.yi)||(La.Dt(this.sr),this.yi=void 0),null==(s=this.ne)||s.onFlushComplete()}return this.er()}Yr(t){var e,i=2+((null==(e=this.Rt)?void 0:e.data.length)||0),r=t.$session_id,n=this.Rt.sessionId!==r;if(n||!0!==this.ce&&!this.ge&&this.Rt.size+t.$snapshot_bytes+i>943718.4){var s=this.Xt;if(this.Rt=this.tr(),this.Xt!==s)return;n&&this.Rt.data.length>0&&(this.Rt=this.er()),this.Rt.sessionId=r,this.Rt.windowId=t.$window_id}this.ge&&(this.ye||this.Rt.size+t.$snapshot_bytes+i>943718.4)?this.ye||(this.ye=!0,this.Rt=this.er()):(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.ce||this.ge||this.Jr())}bi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.oe),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Qe(){var t,e,i=null==(t=this.Rt)?void 0:t.data[(null==(e=this.Rt)?void 0:e.data.length)-1];return i?i.timestamp-this._sessionStartTimestamp:null}ai(){if(!this.Rt||0===this.Rt.data.length)return this.er();for(var t=-1,e=this.Rt.data.length-1;e>=0;e--)if(4===this.Rt.data[e].type){t=e;break}return 0>t?this.er():(this.Rt.data=this.Rt.data.slice(t),this.Rt.sizes=this.Rt.sizes.slice(t),this.Rt.size=this.Rt.sizes.reduce((t,e)=>t+e,0),this.Rt)}er(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.He},this.Rt}jt(t,e){this._instance.register_for_session({[Xt]:t}),Kl.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",s({reason:t},e))}wi(t){var e;return 3===t.type&&-1!==Yl.indexOf(null==(e=t.data)?void 0:e.source)}si(t){var e=this.wi(t);e||!0===this.ce||t.timestamp-this.ue>this.te&&(this.ce=!0,clearInterval(this.Ar),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.ue,threshold:this.te,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.He}),this.tr());var i=this.Yt.checkAndGetSessionAndWindowId(!e,t.timestamp),r=i.windowId,n=i.sessionId,s=!1;if(e&&(this.ue=t.timestamp,this.ce)){var o="unknown"===this.ce;this.ce=!1,o||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),s=!0)}var a=this.Xt!==n,l=this.He!==r;if(this.He=r,this.Xt=n,a||l){var u=a&&!1!==this.ce;u&&(this.ce="unknown"),this.Ue(u)}else if(e&&this.Er(),s){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.ne)?void 0:h.hasPendingTriggers(this.sessionId));this.de>0&&d&&this.Bt(),this._r(),this.Rr()}}ze(){var t;null==(t=this.ne)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,i,r,n,s,o,a,l,u=null==(t=tu())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Wr,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_current_session_duration:this.Qe,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null==(e=this.$e)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Ie,$snapshot_max_depth_exceeded:this._e,$sdk_debug_replay_slowest_full_snapshot_ms:Gl(null==(i=this.Zr)?void 0:i.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Gl(null==(r=this.Zr)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Zr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Zr)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(o=this.Zr)?void 0:o.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==u?void 0:u.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==u?void 0:u.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==u?void 0:u.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:Gl(null==u?void 0:u.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Gl(null==u?void 0:u.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Gl(null==(a=tu())||null==a.getMutationCost||null==(a=a.getMutationCost())?void 0:a.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(l=tu())||null==l.getDiscardedDurationSamples?void 0:l.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.ve,$sdk_debug_replay_oversized_mutations_dropped:this.fe,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.pe,$sdk_debug_replay_rrweb_error:this.we,[Kt]:!!this.ae,[Yt]:this.ke}}qr(){var t;if(!this.ae){this.ke=!0;var e,i,r,n,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},a=this._instance.config.session_recording;for(var u of Object.entries(a||{})){var h=u[0],v=u[1];if(h in o)if("maskInputOptions"===h)o.maskInputOptions=s({password:!0},v);else if("sampling"===h){var c=null!=v?v:{},f={};Ie(c.mousemove)||(f.mousemove=c.mousemove),Ie(c.mouseInteraction)||(f.mouseInteraction=c.mouseInteraction),o.sampling=f}else o[h]=v}!0===(null==a?void 0:a.captureJsonLd)&&!0!==o.slimDOMOptions&&"all"!==o.slimDOMOptions&&(o.slimDOMOptions=s({},o.slimDOMOptions,{script:!0})),this.cr&&this.cr.enabled&&(o.recordCanvas=!0,o.sampling=s({},o.sampling,{canvas:this.cr.fps}),o.dataURLOptions={type:"image/webp",quality:this.cr.quality},o.canvasResolutionScale=this.hr,o.canvasMasking={configured:()=>{var t;return Te(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(Te(i))try{var r;return null!==(r=i(t))&&void 0!==r?r:null}catch(t){return this.Me||(this.Me=!0,Kl.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.ur&&(o.maskAllInputs=null===(e=this.ur.maskAllInputs)||void 0===e||e,o.maskTextSelector=null!==(i=this.ur.maskTextSelector)&&void 0!==i?i:void 0,o.blockSelector=null!==(r=this.ur.blockSelector)&&void 0!==r?r:void 0,o.maskAllElementAttributes=null!==(n=this.ur.maskAllElementAttributes)&&void 0!==n&&n),o.maskAllElementAttributes&&o.maskAttributeFn&&(o.maskAttributeFn=void 0,this.Ce||(this.Ce=!0,Kl.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.lr();var p=eu();if(p){this.zr=null!==(t=this.zr)&&void 0!==t?t:new ua(p,{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";Kl.info(i,{node:e}),this.log("[SessionRecording] "+i,"warn")},onDroppedAttributeMutations:t=>this.ve+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.Ir,onDroppedOversizedMutation:t=>{0===this.fe&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.fe+=1,this.pe+=t},requestFullSnapshot:()=>this.Bt()});var g=this.pr();if(this.ae=p(s({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.Te||(this.Te=!0,Kl.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},o)),!this.ae)return this.we=!0,void Kl.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.we=!1,!0===(null==a?void 0:a.captureJsonLd)&&d&&null!=l&&l.MutationObserver&&!this.Sr&&(this.Sr=function(t,e,i){var r=new WeakMap,n=i.getCaptureState||(()=>!0),s=xl,o=function(t,e){var i=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||null!=i&&i.length&&!i.includes("id")?El:i=>{var r=t.getElementById(i);return!!r&&"SCRIPT"!==r.nodeName&&(!e.isRecordedElement||e.isRecordedElement(r))&&!Wl(r,e.blockClass,e.blockSelector)}}(t,i),a=e=>{try{var a=n();if(!s||!1===a||!e.isConnected||e.ownerDocument!==t||function(t,e){return Wl(t,e.blockClass,e.blockSelector)||Wl(t,e.maskTextClass,e.maskTextSelector)}(e,i))return;var l=function(t,e){if(void 0===e&&(e=El),!t||t.length>xl)return null;try{var i=JSON.parse(t),r={remainingNodes:2048,exceeded:!1},n=Ce(i)?i.map(t=>Ul(t,e,r)):Ul(i,e,r);if(r.exceeded||Pe(n)||Ce(n)&&(!n.length||n.some(Pe)))return null;var s=JSON.stringify(n);return s.length>2e4?null:[n,s]}catch(t){return null}}(e.text,o);if(!l)return void r.delete(e);var u=l[0],h=l[1];if(Pe(a))return void r.set(e,h);if(r.get(e)!==h){if(h.length>s)return void(s=0);i.emit(u)&&(r.set(e,h),s-=h.length)}}catch(t){return}};try{var l=new e(t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of Vl(t))a(e)};for(var i of t)if("childList"===i.type)Hl(i.target)&&a(i.target),i.addedNodes.forEach(e);else if("characterData"===i.type){var r=i.target.parentNode;r&&Hl(r)&&a(r)}else"attributes"===i.type&&Hl(i.target)&&a(i.target)}catch(t){return}});return l.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&Vl(t.documentElement).forEach(t=>{e&&r.delete(t),a(t)})},stop(){return l.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(d,l.MutationObserver,{attributeFilter:o.attributeFilter,blockClass:o.blockClass,blockSelector:o.blockSelector,isRecordedElement:t=>p.mirror.getId(t)>0,maskAllElementAttributes:o.maskAllElementAttributes,maskAttributeFn:o.maskAttributeFn,maskTextClass:o.maskTextClass,maskTextSelector:o.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.wr()},emit:t=>this.kr(t)}),this.Y.isCurrentUrlBlocked()&&this.Sr.scan()),this.ue=Date.now(),this.ce=De(this.ce)?this.ce:"unknown",this.tryAddCustomEvent("$remote_config_received",this.re),this.Vt("$session_options",{sessionRecordingOptions:o,activePlugins:g.map(t=>null==t?void 0:t.name)}),this.Vt("$posthog_config",{config:this._instance.config})}else Kl.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Vt(t,e)}},ku=function(t){return 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}({}),Su=function(t){return 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}({}),xu=function(t){return 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}({}),Cu=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),Tu=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),Eu=function(t){return 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}({}),Mu=function(t){return 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}({});function Iu(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Ru={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},Au={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},Pu={};function Ou(t){if(Pu[t])return Pu[t];var e=function(t){var e,i,r=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(i=e.__symbol__)||void 0===i?void 0:i.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],i=e.prototype,r=t in Ru?Ru[t]:void 0,n=Boolean(r&&r.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(i,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),s=t in Au?Au[t]:void 0,o=Boolean(s&&s.every(t=>{var e;return"function"==typeof i[t]&&(null===(e=i[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(n&&o)return Pu[t]=e.prototype,e.prototype;var a=document.createElement("iframe");a.style.display="none";var l=!1;try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return Iu(t,"AppleWebKit")&&!Iu(t,"Chrome")}(navigator.userAgent)&&(a.classList.add("rr-block","ph-no-capture"),a.setAttribute("__rrwebUntaintedPrototype",t),l=!0),Pu[t]=h):i}catch(t){return i}finally{!l&&a.parentNode&&document.body.removeChild(a)}}var Fu=Object.create(null);function $u(t,e,i){var r,n=Fu[t],s=n[i];if(s)return s.call(e);var o=Ou(t),a=null===(r=Object.getOwnPropertyDescriptor(o,i))||void 0===r?void 0:r.get;return a?(n[i]=a,a.call(e)):e[i]}Fu.Node=Object.create(null),Fu.ShadowRoot=Object.create(null),Fu.MutationObserver=Object.create(null),Fu.Element=Object.create(null);var Du,Lu={};function Nu(t,e,i){var r=t+"."+String(i);if(Lu[r])return Lu[r].bind(e);var n=Ou(t)[i];return"function"!=typeof n?e[i]:(Lu[r]=n,n.bind(e))}function qu(){return Ou("MutationObserver").constructor}function ju(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],o=i(r);o;){if(o.next===s)return void(o.next=n.next);o=i(r=o.next)}else t[e]=n.next}}catch(t){return()=>{}}}var Bu={childNodes:t=>$u("Node",t,"childNodes"),parentNode:t=>$u("Node",t,"parentNode"),parentElement:t=>$u("Node",t,"parentElement"),textContent:t=>$u("Node",t,"textContent"),isConnected(t){if(void 0===Du){var e,i=null===(e=Object.getOwnPropertyDescriptor(Ou("Node"),"isConnected"))||void 0===e?void 0:e.get;Du=(null==i?void 0:i.toString().includes("[native code]"))?i:null}return null==Du?void 0:Du.call(t)},contains:(t,e)=>Nu("Node",t,"contains")(e),getRootNode:t=>Nu("Node",t,"getRootNode")(),host:t=>t&&"host"in t?$u("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?$u("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Nu("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Nu("Element",t,"querySelectorAll")(e),mutationObserver:qu,patch:ju};function Uu(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var Hu=0;function zu(){Hu+=1}function Wu(){return Hu}function Vu(t,e){return(e!==Hu||t>6e4)&&!0}var Gu=0,Zu=0,Qu=0,Ju={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Ku=null,Yu=null,Xu=[],th=0,eh=0,ih={slowestBatchMs:0},rh={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function nh(t){(Gu+=1)>1||(Ju={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Xu=[],th=0,Yu=(t=>t&&t>0?t:null)(t),Zu=Uu(),Qu=Hu)}function sh(){return 0===Gu?Ku||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(Gu-=1)>0?Ju:(Ju.durationMs=Uu()-Zu,Ju.deferredStylesheetCount=th,rh.deferredCount+=th,Yu=null,Vu(Ju.durationMs,Qu)?Ju:Ku=Ju)}function oh(t,e,i){var r=t.length;if(i>=32)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var o=s.cssRules;if(o&&o.length)r+=oh(o,e,i+1);else if(e&&s.styleSheet){var a=s.styleSheet;if(!e.has(a)){e.add(a);var l=a.rules||a.cssRules;l&&(r+=oh(l,e,i+1))}}}catch(t){}}return r}function ah(t){if(0!==Gu){var e=oh(t,null,0);Ju.cssRuleCount+=e,eh>0&&(Ju.nonDeferrableCssRuleCount+=e)}}function lh(t){eh+=1;try{return t()}finally{eh-=1}}function uh(t){Gu>0&&(Ju.stylesheetMs+=t)}function hh(t){if(0===Gu||null===Yu)return!1;var e=Ju.cssRuleCount-Ju.nonDeferrableCssRuleCount;return e>=Yu||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),oh(e,i,0)}catch(t){return 0}}(t)>Yu}function dh(){rh.failedCount+=1}function vh(t){t>0&&(rh.abandonedCount+=t)}function ch(t){return ch="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ch(t)}function fh(t,e,i){return(e=function(t){var e=function(t){if("object"!=ch(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=ch(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ch(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ph(t){return t.nodeType===t.ELEMENT_NODE}function gh(t){var e=t&&"host"in t&&"mode"in t&&Bu.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Bu.shadowRoot(e)===t)}function mh(t){return"[object ShadowRoot]"==={}.toString.call(t)}function yh(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 _h(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 bh=0;function wh(t){var e=0===bh,i=e?Uu():0;bh+=1;try{var r=t.rules||t.cssRules;if(!r)return null;ah(r);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),yh(Array.from(r,t=>kh(t,n)).join(""))}catch(t){return null}finally{bh-=1,e&&uh(Uu()-i)}}function kh(t,e){if(xh(t)){var i;try{i=wh(t.styleSheet)||_h(t)}catch(e){i=t.cssText}try{var r;if(i&&(null===(r=t.styleSheet)||void 0===r?void 0:r.href))return jh(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return Ch(t)&&t.selectorText.includes(":")&&(n=Sh(n)),e?jh(n,e):n}function Sh(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function xh(t){return"styleSheet"in t}function Ch(t){return"selectorText"in t}var Th=/^-?[A-Za-z_][\w-]*$/,Eh=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function Mh(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 a=e[e.length-1];return a.parts.push(t),void(a.index+=1)}if(!n.importRule)return i=!0,void(r=t);o(e[e.length-1],n.importRule,t)}function o(t,e,i){try{var r;try{r=i||_h(e)}catch(t){r=e.cssText}try{var n;r&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(r=jh(r,e.styleSheet.href))}catch(t){}r&&t.parts.push(r),t.index+=1}catch(t){s(null)}}function a(t){var i=t.rules[t.index];if("sheet"===t.kind&&xh(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 o(t,i,null)}if(!function(t,i){try{var r=function(t){var e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return"@media "+e.media.mediaText+" {";if(Ch(t)){if("number"==typeof e.type&&1!==e.type)return null;var i=e.style?e.style.cssText:"";return t.selectorText+" {"+(i?" "+i:"")}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!Th.test(e.containerName)?null:"@container "+(e.containerName?e.containerName+" ":"")+e.containerQuery+" {";if("string"==typeof e.conditionText){var r="";try{var n;r=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===r||"Object"===r||"CSSSupportsRule"===r?"@supports "+e.conditionText+" {":null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?Th.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":Eh.test(e.name)?"@layer "+e.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?jh(r,n):r,fixColons:"sheet"===i.kind&&Ch(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(i,t)){var s=i.cssText;"sheet"===t.kind&&Ch(i)&&i.selectorText.includes(":")&&(s=Sh(s)),t.parts.push(t.sheetHref?jh(s,t.sheetHref):s),t.index+=1}}return function(t){try{var i=t.rules||t.cssRules;if(!i)return!1;ah(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,!xh(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;ah(s);var o=r.href;!o&&r.ownerNode&&(o=r.ownerNode.baseURI);var a=Array.from(s);n.set(e,{sheet:r,rules:a,sheetHref:o}),i.push({sheet:r,rules:a,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=Uu(),o=t>0?t:1;try{for(;!i&&o>0;){var l=e[e.length-1];if(l.rules.length>l.index){o-=1;try{a(l)}catch(t){s(null)}}else{var u=null;try{if("group"===l.kind){var h=l.prelude+l.parts.join("")+"}";u=l.fixColons?Sh(h):h}else u=yh(l.parts.join(""))}catch(t){}s(u)}}}catch(t){i=!0,r=null}finally{uh(Uu()-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}}}var Ih=class{constructor(){fh(this,"idNodeMap",new Map),fh(this,"nodeMetaMap",new WeakMap)}getId(t){var e,i;return t&&null!==(e=null===(i=this.getMeta(t))||void 0===i?void 0:i.id)&&void 0!==e?e:-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)),ph(t)){var i=Bu.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 Rh(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,o=t.value||"",a=n&&Ah(n);return(i[r.toLowerCase()]||a&&i[a])&&(o=s?s(o,e):"*".repeat(o.length)),o}function Ah(t){return t.toLowerCase()}var Ph=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 Oh(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&&Ph.has(Ah(i))?r:"*".repeat(r.length):n?n(i,r,e):r:r}var Fh="__rrweb_original__";function $h(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,Lh=/^(?:[a-z+]+:)?\/\//i,Nh=/^www\..*/i,qh=/^(data:)([^,]*),(.*)/i;function jh(t,e){return(t||"").replace(Dh,(t,i,r,n,s,o)=>{var a,l=r||s||o,u=i||n||"";if(!l)return t;if(Lh.test(l)||Nh.test(l))return"url("+u+l+u+")";if(qh.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.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 Bh,Uh,Hh=new Map,zh=1,Wh=new RegExp("[^a-z0-9-_:]");function Vh(){return zh++}var Gh=/^[^ \t\n\r\u000c]+/,Zh=/^[, \t\n\r\u000c]+/,Qh=new WeakMap;function Jh(t,e){return e&&""!==e.trim()?Kh(t,e):e}function Kh(t,e){var i=Qh.get(t);if(i||(i=t.createElement("a"),Qh.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function Yh(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function Xh(t,e,i,r,n,s){if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var o,a=null===(o=n.sheet)||void 0===o?void 0:o.href;if(a)return a}var l=Jh(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(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;var n=Hh.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 o=s.getContext("2d");if(!o)return e;o.drawImage(t,0,0);var a=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>a.length?a:e;if(Hh.size>=10){var u=Hh.keys().next().value;void 0!==u&&Hh.delete(u)}return Hh.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),Yh(u,s)}if("image"===e)return Yh(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=Jh(t,r);return"image"===e&&h.startsWith("data:")?Yh(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(Zh),e.length>i;){var s=r(Gh);if(","===s.slice(-1))s=Jh(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Jh(t,s);for(var a=!1;;){var l=e.charAt(i);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){i+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?jh(r,Kh(t)):"object"===e&&"data"===i?Jh(t,r):r:Jh(t,r)}function td(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function ed(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&ed(Bu.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&ed(Bu.parentNode(t),e,i)}function id(t,e,i,r){var n;if(ph(t)){if(!Bu.childNodes(n=t).length)return!1}else{if(null===Bu.parentElement(t))return!1;n=Bu.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(ed(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 rd(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var nd=new Map;function sd(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function od(t){return null==t?"":t.toLowerCase()}var ad=!1,ld=!1;function ud(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,o=e.maskTextClass,a=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,_=e.slimDOMOptions,b=e.dataURLOptions,w=void 0===b?{}:b,k=e.inlineImages,S=void 0!==k&&k,x=e.recordCanvas,C=void 0!==x&&x,T=e.canvasMaskingConfigured,E=e.onSerialize,M=e.onIframeLoad,I=e.iframeLoadTimeout,R=void 0===I?5e3:I,A=e.onIframeListenerRegistered,P=e.onStylesheetLoad,O=e.stylesheetLoadTimeout,F=void 0===O?5e3:O,D=e.keepIframeSrcFn,L=void 0===D?()=>!1:D,N=e.newlyAddedElement,q=void 0!==N&&N,j=e.depth,B=void 0===j?0:j,U=e.maxDepth,H=void 0===U?50:U,z=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=H)return ld=!0,ad||(ad=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+H+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;z||(z=id(t,o,a,void 0===z)),Gu>0&&(Ju.nodeCount+=1);var G,Z=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,o=e.inlineStylesheet,a=e.maskInputOptions,l=void 0===a?{}:a,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,_=e.keepIframeSrcFn,b=e.newlyAddedElement,w=void 0!==b&&b,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:Mu.Document,childNodes:[],compatMode:t.compatMode}:{type:Mu.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Mu.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:k};case t.ELEMENT_NODE:return function(t,e){for(var i=e.doc,r=e.inlineStylesheet,n=e.maskInputOptions,s=void 0===n?{}:n,o=e.maskInputFn,a=e.maskAllElementAttributes,l=void 0!==a&&a,u=e.maskAttributeFn,h=e.dataURLOptions,d=void 0===h?{}:h,v=e.inlineImages,c=e.recordCanvas,f=e.canvasMaskingConfigured,p=e.keepIframeSrcFn,g=e.newlyAddedElement,m=void 0!==g&&g,y=e.rootId,_=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),b=function(t){if(t instanceof HTMLFormElement)return"form";var e=Ah(t.tagName);return Wh.test(e)?"div":e}(t),w=new Set,k={},S=t.attributes.length,x=0;S>x;x++){var C=t.attributes[x];td(b,C.name)||(k[C.name]=Xh(i,b,Ah(C.name),C.value,t,d))}if("link"===b&&r&&!_){var T=t.sheet;if(!T){var E=function(t){return t.href}(t);E&&!(T=sd(i,E))&&E.includes(".css")&&(T=sd(i,window.location.origin+"/"+E.replace(window.location.href,"")))}var M=null;T&&(hh(T)?Gu>0&&(Xu.push(t),th+=1):M=wh(T)),M&&(delete k.rel,delete k.href,k._cssText=M)}if("style"===b&&t.sheet&&!(t.innerText||Bu.textContent(t)||"").trim().length){var I=lh(()=>wh(t.sheet));I&&(k._cssText=I)}if("input"===b||"textarea"===b||"select"===b){var R=t.value,A=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&R?k.value=Rh({element:t,type:$h(t),tagName:b,value:R,maskInputOptions:s,maskInputFn:o}):A&&(k.checked=A)}if("option"===b&&(t.selected&&!s.select?k.selected=!0:delete k.selected),"dialog"===b&&t.open){try{k.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}w.add("rr_open_mode")}if("canvas"===b&&c&&!(null==f?void 0:f()))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((Fh in n?n[Fh]: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)||(k.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){var P=t.toDataURL(d.type,d.quality),O=i.createElement("canvas");O.width=t.width,O.height=t.height,P!==O.toDataURL(d.type,d.quality)&&(k.rr_dataURL=P)}var F,D,L=!1;if("img"===b&&v){Bh||(Bh=i.createElement("canvas"),Uh=Bh.getContext("2d"));var N=t,q=N.currentSrc||N.getAttribute("src")||"<unknown-src>",j=N.crossOrigin,B=(e,i)=>L?Oh({element:t,name:e,value:i,maskAllElementAttributes:l,maskAttributeFn:u}):i,U=()=>{rd(N,"load",U);try{Bh.width=N.naturalWidth,Bh.height=N.naturalHeight,Uh.drawImage(N,0,0);var t=Bh.toDataURL(d.type,d.quality);k.rr_dataURL=B("rr_dataURL",t)}catch(t){if("anonymous"!==N.crossOrigin)return N.crossOrigin="anonymous",void(N.complete&&0!==N.naturalWidth?U():N.addEventListener("load",U));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===N.crossOrigin&&(j?k.crossOrigin=B("crossOrigin",j):N.removeAttribute("crossorigin"))};N.complete&&0!==N.naturalWidth?U():N.addEventListener("load",U)}if("audio"===b||"video"===b){var H=k;H.rr_mediaState=t.paused?"paused":"played",w.add("rr_mediaState"),H.rr_mediaCurrentTime=t.currentTime,H.rr_mediaPlaybackRate=t.playbackRate,H.rr_mediaMuted=t.muted,H.rr_mediaLoop=t.loop,H.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),_){var z,W,V,G=t.getBoundingClientRect(),Z=G.width,Q=G.height,J=G.left,K=G.top,Y=null===(z=i.defaultView)||void 0===z?void 0:z.getComputedStyle(t);k={class:k.class,rr_width:Z+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null===(W=i.defaultView)||void 0===W?void 0:W.scrollX)||0))+"px",rr_top:Math.floor(K+((null===(V=i.defaultView)||void 0===V?void 0:V.scrollY)||0))+"px"},w.add("rr_width"),w.add("rr_height"),w.add("rr_left"),w.add("rr_top"),Y&&(k.rr_position=Y.position||"static",w.add("rr_position"),Y.transform&&"none"!==Y.transform&&(k.rr_transform=Y.transform,w.add("rr_transform")),Y.display&&Y.display.startsWith("inline")&&(k.rr_display=Y.display,w.add("rr_display")))}if("iframe"!==b||p(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src),l||u)for(var X of Object.entries(k)){var tt=X[0],et=X[1];"string"!=typeof et&&null!==et||(k[tt]=Oh({element:t,name:tt,value:et,maskAllElementAttributes:l,maskAttributeFn:u,isGenerated:w.has(tt)}))}L=!0;try{customElements.get(b)&&(F=!0)}catch(t){}return{type:Mu.Element,tagName:b,attributes:k,childNodes:[],isSVG:(D=t,Boolean("svg"===D.tagName||D.ownerSVGElement)||void 0),needBlock:_,rootId:y,isCustom:F}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:l,maskInputFn:h,maskAllElementAttributes:v,maskAttributeFn:c,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:_,newlyAddedElement:w,rootId:k});case t.TEXT_NODE:return function(t,e){var i=e.needsMask,r=e.maskTextFn,n=e.rootId,s=Bu.parentNode(t),o=s&&s.tagName,a=Bu.textContent(t),l="STYLE"===o||void 0,u="SCRIPT"===o||void 0;if(l&&a){try{var h;if(t.nextSibling||t.previousSibling);else if(hh(s.sheet));else if(null===(h=s.sheet)||void 0===h?void 0:h.cssRules){var d=wh(s.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(a=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}a=jh(a,Kh(e.doc))}return u&&(a="SCRIPT_PLACEHOLDER"),!l&&!u&&a&&i&&(a=r?r(a,Bu.parentElement(t)):a.replace(/[\S]/g,"*")),{type:Mu.Text,textContent:a||"",isStyle:l,rootId:n}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:k});case t.CDATA_SECTION_NODE:return{type:Mu.CDATA,textContent:"",rootId:k};case t.COMMENT_NODE:return{type:Mu.Comment,textContent:Bu.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:L,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===Mu.Comment)return!0;if(t.type===Mu.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){var e,i;try{i=new URL(t,window.location.href)}catch(t){return null}var r=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==r?void 0:r[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(od(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===od(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(od(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&od(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(od(t.attributes.property).match(/^(og|twitter|fb):/)||od(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===od(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(od(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(od(t.attributes.name))||od(t.attributes.property).match(/^article:/)||od(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(od(t.attributes.name)))return!0}}return!1}(Z,_)||!V&&Z.type===Mu.Text&&!Z.isStyle&&!Z.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Vh();var Q=Object.assign(Z,{id:G});if(r.add(t,Q),-2===G)return null;E&&E(t);var J=!u;if(Q.type===Mu.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=Bu.shadowRoot(t);K&&mh(K)&&(Q.isShadowHost=!0)}if((Q.type===Mu.Document||Q.type===Mu.Element)&&J){_.headWhitespace&&Q.type===Mu.Element&&"head"===Q.tagName&&(V=!1);var Y={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:F,keepIframeSrcFn:L,depth:B+1,maxDepth:H};if(Q.type===Mu.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var X of Array.from(Bu.childNodes(t))){var tt=ud(X,Y);tt&&Q.childNodes.push(tt)}var et=null;if(ph(t)&&(et=Bu.shadowRoot(t)))for(var it of Array.from(Bu.childNodes(et))){var rt=ud(it,Y);rt&&(mh(et)&&(rt.isShadow=!0),Q.childNodes.push(rt))}}var nt=Bu.parentNode(t);if(nt&&gh(nt)&&mh(nt)&&(Q.isShadow=!0),Q.type===Mu.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 o=()=>e();if("complete"!==r){var a=!1,l=null,u=()=>{a||(a=!0,null!==l&&(clearTimeout(l),l=null),rd(t,"load",h),t.addEventListener("load",o),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),a?rd(t,"load",o):(a=!0,rd(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",o),()=>{clearTimeout(c),rd(t,"load",o)}}return t.addEventListener("load",o),()=>{rd(t,"load",o)}}(t,()=>{var e=t.contentDocument;if(e&&M){var i=ud(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onIframeListenerRegistered:A,onStylesheetLoad:P,stylesheetLoadTimeout:F,keepIframeSrcFn:L,depth:B+1,maxDepth:H});i&&M(t,i)}},R);null==A||A(t,st)}return Q.type===Mu.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,l,u){if(!nd.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var v=new AbortController,g=!1,b=()=>{if(!g){g=!0;try{(()=>{if(P){var e=ud(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:z,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:f,maskInputFn:p,maskAllElementAttributes:m,maskAttributeFn:y,slimDOMOptions:_,dataURLOptions:w,inlineImages:S,recordCanvas:C,canvasMaskingConfigured:T,preserveWhiteSpace:V,onSerialize:E,onIframeLoad:M,iframeLoadTimeout:R,onStylesheetLoad:P,stylesheetLoadTimeout:F,keepIframeSrcFn:L,depth:B,maxDepth:H});e&&P(t,e)}})()}finally{nd.delete(e),v.abort()}}},k=setTimeout(b,u);v.signal.addEventListener("abort",()=>clearTimeout(k),{once:!0}),e.addEventListener("load",b,{signal:v.signal,once:!0}),nd.set(e,v)}}}(t,0,F),Q}function hd(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}var dd=class t{constructor(){fh(this,"parentElement",null),fh(this,"parentNode",null),fh(this,"ownerDocument",void 0),fh(this,"firstChild",null),fh(this,"lastChild",null),fh(this,"previousSibling",null),fh(this,"nextSibling",null),fh(this,"ELEMENT_NODE",1),fh(this,"TEXT_NODE",3),fh(this,"nodeType",void 0),fh(this,"nodeName",void 0),fh(this,"RRNodeType",void 0)}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.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 vd(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>cd(i,t,e,r)}function cd(t,e,i,r){fd(()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))})}function fd(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function pd(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var gd="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.",md={map:{},getId(){return console.error(gd),-1},getNode(){return console.error(gd),null},removeNodeFromMap(){console.error(gd)},has(){return console.error(gd),!1},reset(){console.error(gd)}};function yd(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];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,o)):r||!1===i.trailing||(r=setTimeout(()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,o)},u))}}function _d(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)}}}),()=>_d(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(md=new Proxy(md,{get(t,e,i){return"map"===e&&console.error(gd),Reflect.get(t,e,i)}}));var bd=Date.now;function wd(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=Bu.parentElement(s.body))||void 0===e?void 0:e.scrollLeft)||(null==s||null===(i=s.body)||void 0===i?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=Bu.parentElement(s.body))||void 0===r?void 0:r.scrollTop)||(null==s||null===(n=s.body)||void 0===n?void 0:n.scrollTop)||0}}function kd(){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 xd(t){return t?t.nodeType===t.ELEMENT_NODE?t:Bu.parentElement(t):null}function Cd(t,e,i,r){if(!t)return!1;var n=xd(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(ed(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 Td(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||-2===e.getId(t)}function Ed(t,e){if(gh(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=Bu.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||Ed(r,e))}function Md(t){return Boolean(t.changedTouches)}function Id(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Rd(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Ad(t){return!!t&&(t instanceof dd&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Bu.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(bd=()=>(new Date).getTime());var Pd=class{constructor(){fh(this,"id",1),fh(this,"styleIDMap",new WeakMap),fh(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 Od(t){var e,i=null;return"getRootNode"in t&&(null===(e=Bu.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Bu.host(Bu.getRootNode(t))&&(i=Bu.host(Bu.getRootNode(t))),i}function Fd(t){var e=t.ownerDocument;if(!e)return!1;if(Bu.contains(e,t))return!0;var i=Bu.isConnected(t);return"boolean"==typeof i?i:function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Od(i);)i=e;return i}(t);return Bu.contains(e,i)}(t)}function $d(t){return"__ln"in t}var Dd,Ld=class{constructor(){fh(this,"length",0),fh(this,"head",null),fh(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&&$d(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&&$d(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--)}},Nd=(t,e)=>t+"@"+e,qd=class{constructor(){fh(this,"frozen",!1),fh(this,"locked",!1),fh(this,"texts",[]),fh(this,"attributes",[]),fh(this,"attributeMap",new WeakMap),fh(this,"generatedAttributes",new WeakMap),fh(this,"removes",[]),fh(this,"mapRemoves",new Set),fh(this,"movedMap",{}),fh(this,"addedSet",new Set),fh(this,"movedSet",new Set),fh(this,"droppedSet",new Set),fh(this,"removesSubTreeCache",new Set),fh(this,"mutationCb",void 0),fh(this,"blockClass",void 0),fh(this,"blockSelector",void 0),fh(this,"maskTextClass",void 0),fh(this,"maskTextSelector",void 0),fh(this,"inlineStylesheet",void 0),fh(this,"maskInputOptions",void 0),fh(this,"maskTextFn",void 0),fh(this,"maskInputFn",void 0),fh(this,"maskAllElementAttributes",void 0),fh(this,"maskAttributeFn",void 0),fh(this,"keepIframeSrcFn",void 0),fh(this,"recordCanvas",void 0),fh(this,"canvasMaskingConfigured",void 0),fh(this,"inlineImages",void 0),fh(this,"slimDOMOptions",void 0),fh(this,"dataURLOptions",void 0),fh(this,"doc",void 0),fh(this,"mirror",void 0),fh(this,"iframeManager",void 0),fh(this,"stylesheetManager",void 0),fh(this,"shadowDomManager",void 0),fh(this,"canvasManager",void 0),fh(this,"processedNodeManager",void 0),fh(this,"unattachedDoc",void 0),fh(this,"canvasManagerReleased",!1),fh(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),fh(this,"emit",()=>{if(!this.frozen&&!this.locked){var t,e,i=Uu(),r=Wu();try{this.processBufferedMutations()}finally{t=Uu()-i,e=r,Gu>0||Vu(t,null!=e?e:Hu)||t>ih.slowestBatchMs&&(ih.slowestBatchMs=t)}}}),fh(this,"processBufferedMutations",()=>{var t,e=[],i=new Set,r=new Ld,n=t=>{for(var e=t,i=-2;-2===i;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},s=s=>{var o=Bu.parentNode(s);if(o&&Fd(s)&&"TEXTAREA"!==o.tagName&&!this.isBlockedAtEmission(o)){var a=gh(o)?this.mirror.getId(Od(s)):this.mirror.getId(o),l=n(s);if(-1===a||-1===l)return r.addNode(s);null!=t||(t={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=>{Id(t,this.mirror)&&this.iframeManager.addIframe(t),Rd(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Ad(t)&&!Cd(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(Bu.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)}});var u=ud(s,t);u&&(e.push({parentId:a,nextId:l,node:u}),i.add(u.id))}};for(var o of this.mapRemoves)this.mapRemoves.delete(o),this.mirror.removeNodeFromMap(o);for(var a of this.movedSet)Bd(this.removesSubTreeCache,a)&&!this.movedSet.has(Bu.parentNode(a))||s(a);for(var l of this.addedSet)Ud(this.droppedSet,l)||Bd(this.removesSubTreeCache,l)?Ud(this.movedSet,l)?s(l):this.droppedSet.add(l):s(l);for(var u=null;r.length;){var h=null;if(u){var d=this.mirror.getId(Bu.parentNode(u.value)),v=n(u.value);-1!==d&&-1!==v&&(h=u)}if(!h)for(var c=r.tail;c;){var f=c;if(c=c.previous,f){var p=this.mirror.getId(Bu.parentNode(f.value));if(-1===n(f.value))continue;if(-1!==p){h=f;break}var g=Bu.parentNode(f.value);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var m=Bu.host(g);if(-1!==this.mirror.getId(m)){h=f;break}}}}if(!h){for(;r.head;)r.removeNode(r.head.value);break}u=h.previous,r.removeNode(h.value),s(h.value)}var y={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.node,i=Bu.parentNode(e);return i&&"TEXTAREA"===i.tagName&&this.genTextAreaValueMutation(i),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!i.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){var i=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);e.style.length>i.length&&(i+r).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var n of Object.entries(e)){var s,o=n[0],a=n[1];"string"!=typeof a&&null!==a||(e[o]=Oh({element:t.node,name:o,value:a,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(s=this.generatedAttributes.get(t.node))||void 0===s?void 0:s.has(o)}))}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!i.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:e};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={},(y.texts.length||y.attributes.length||y.removes.length||y.adds.length)&&this.mutationCb(y)}),fh(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),fh(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(Bu.childNodes(t),t=>Bu.textContent(t)||"").join("");e.attributes.value=Rh({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:$h(t),value:i,maskInputFn:this.maskInputFn})}),fh(this,"processMutation",t=>{if(!Td(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=Bu.textContent(t.target);Cd(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:id(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,xd(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var i,r=t.target,n=t.attributeName,s=null!==(i=t.attributeNamespace)&&void 0!==i?i: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}(r,n,s),a=s?r.getAttributeNS(s,n):t.target.getAttribute(n);if("value"===o){var l=r,u=$h(l);a=Rh({element:l,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:u,value:a,maskInputFn:this.maskInputFn})}if(Cd(t.target,this.blockClass,this.blockSelector,!1)||a===t.oldValue)return;var h=this.attributeMap.get(t.target),d="IFRAME"===r.tagName&&"src"===o;if(d&&!this.keepIframeSrcFn(a)&&r.contentDocument)return;if(h||(this.attributes.push(h={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,h)),"type"===o&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!td(r.tagName,o)){var v,c=Xh(this.doc,Ah(r.tagName),Ah(o),a,r,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(a)&&(o="rr_src"),h.attributes[o]=c,null===(v=this.generatedAttributes.get(t.target))||void 0===v||v.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=r.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)?h.styleDiff[g]=""===y?m:[m,y]:h._unchangedStyles[g]=[m,y]}for(var _ of Array.from(f.style))""===p.getPropertyValue(_)&&(h.styleDiff[_]=!1)}else if("open"===o&&"DIALOG"===r.tagName){h.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal";var b=this.generatedAttributes.get(t.target);b||this.generatedAttributes.set(t.target,b=new Set),b.add("rr_open_mode")}}break;case"childList":if(Cd(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=gh(t.target)?this.mirror.getId(Bu.host(t.target)):this.mirror.getId(t.target);Cd(t.target,this.blockClass,this.blockSelector,!1)||Td(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(jd(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||Ed(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Nd(i,r)]?jd(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!gh(t.target)||!mh(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),Bu.childNodes(r).forEach(t=>i.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),fh(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(Td(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[Nd(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!Cd(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;for(var r=Bu.childNodes(t),n=0,s=r.length;s>n;n++){var o=r[n];o&&this.genAdds(o)}if(Ad(t))for(var a=Bu.childNodes(Bu.shadowRoot(t)),l=0,u=a.length;u>l;l++){var h=a[l];h&&(this.processedNodeManager.add(h,this),this.genAdds(h,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(var t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t){for(var e=this.blockClass,i=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;t;){if(i&&(i.lastIndex=0),Cd(t,i||e,this.blockSelector,!0))return!0;var r="getRootNode"in t?Bu.getRootNode(t):null;t=(null==r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?Bu.host(r):null}return!1}};function jd(t,e){for(var i=[e];i.length;){var r=i.pop();if(t.delete(r),r.nodeType!==r.TEXT_NODE)for(var n=Bu.childNodes(r),s=0,o=n.length;o>s;s++){var a=n[s];a&&i.push(a)}}}function Bd(t,e,i){return 0!==t.size&&function(t,e){var i=Bu.parentNode(e);return!!i&&t.has(i)}(t,e)}function Ud(t,e){if(0===t.size)return!1;for(var i=Bu.parentNode(e);i;){if(t.has(i))return!0;i=Bu.parentNode(i)}return!1}var Hd=function(t,e){return void 0===e&&(e="rrweb"),Dd?function(){try{return t(...arguments)}catch(t){if(Dd&&!0===Dd(t,e))return;throw t}}:t},zd=[];function Wd(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 Vd(t,e){var i,r=new qd;r.init(t);try{i=new(qu())(Hd(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),zd.push(r),{observer:i,buffer:r}}catch(t){try{null==i||i.disconnect(),r.destroy(),r.reset()}catch(t){}throw t}}function Gd(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,o=t.sampling,a=new Map,l=t=>{var o=Wd(t);if(o&&!Cd(o,n,s,!0)){var l,u,h=r.getId(o);if(o===i&&i.defaultView){var d=wd(i.defaultView);l=d.left,u=d.top}else l=o.scrollLeft,u=o.scrollTop;var v=l+","+u;a.get(h)!==v&&(a.set(h,v),e({id:h,x:l,y:u}))}},u=[vd("scroll",Hd(yd(Hd(t=>l(t)),o.scroll||100)),i)];return"onscrollend"in i&&u.push(vd("scrollend",Hd(l),i)),()=>u.forEach(t=>t())}function Zd(t,e){for(var i=zd.length-1;i>=0;i--){var r=zd[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),zd.splice(i,1))}}}var Qd=["INPUT","TEXTAREA","SELECT"],Jd=new WeakMap;function Kd(t){return function t(e,i){if(ev("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ev("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ev("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ev("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 Yd(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}function Xd(t,e){var i,r,n,s=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:Bu.host(e));var o="#document"===e.nodeName?null===(i=e.defaultView)||void 0===i?void 0:i.Document:null===(r=e.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r?void 0:r.ShadowRoot,a=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&o&&a?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var t;return null===(t=a.get)||void 0===t?void 0:t.call(this)},set(t){var e;try{var i;e=null===(i=a.set)||void 0===i?void 0:i.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==n&&-1!==n)try{s.adoptStyleSheets(t,n)}catch(t){}return e}}),Hd(()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})})):()=>{}}function tv(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,o=t.viewportResizeCb,a=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),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...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 o=[],a=Hd(()=>{try{if(r)try{r.destroy(),r.reset()}finally{var e=zd.indexOf(r);-1!==e&&zd.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect()}finally{pd(o)}});try{if(t.recordDOM){var l=Vd(t,t.doc);i=l.observer,r=l.buffer}if(o.push(function(t){var e=t.mousemoveCb,i=t.sampling,r=t.doc,n=t.mirror;if(!1===i.mousemove)return()=>{};var s,o="number"==typeof i.mousemove?i.mousemove:50,a="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=yd(Hd(t=>{var i=Date.now()-s;e(l.map(t=>(t.timeOffset-=i,t)),t),l=[],s=null}),a),h=Hd(yd(Hd(t=>{var e=Wd(t),i=Md(t)?t.changedTouches[0]:t,r=i.clientX,o=i.clientY;s||(s=bd()),l.push({x:r,y:o,id:n.getId(e),timeOffset:bd()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Su.Drag:t instanceof MouseEvent?Su.MouseMove:Su.TouchMove)}),o,{trailing:!1})),d=[vd("mousemove",h,r),vd("touchmove",h,r),vd("drag",h,r)];return Hd(()=>{d.forEach(t=>t())})}(t)),o.push(function(t){var e=t.mouseInteractionCb,i=t.doc,r=t.mirror,n=t.blockClass,o=t.blockSelector,a=t.sampling;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(xu).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t]).forEach(t=>{var a=Ah(t),l=(t=>i=>{var a=Wd(i);if(!Cd(a,n,o,!0)){var l=null,u=t;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Cu.Mouse;break;case"touch":l=Cu.Touch;break;case"pen":l=Cu.Pen}l===Cu.Touch&&(xu[t]===xu.MouseDown?u="TouchStart":xu[t]===xu.MouseUp&&(u="TouchEnd"))}else Md(i)&&(l=Cu.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Cu.Touch||u.startsWith("Mouse")&&l===Cu.Mouse)&&(l=null)):xu[t]===xu.Click&&(l=h,h=null);var d=Md(i)?i.changedTouches[0]:i;if(d){var v=r.getId(a),c=d.clientX,f=d.clientY;Hd(e)(s({type:xu[u],id:v,x:c,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(xu[t]){case xu.MouseDown:case xu.MouseUp:a=a.replace("mouse","pointer");break;case xu.TouchStart:case xu.TouchEnd:return}u.push(vd(a,l,i))}),Hd(()=>{u.forEach(t=>t())})}(t)),o.push(Gd(t)),o.push(function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return vd("resize",Hd(yd(Hd(()=>{var t=kd(),e=Sd();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)}),200)),r)}(t,{win:n})),o.push(function(t){var e=t.inputCb,i=t.doc,r=t.mirror,n=t.blockClass,o=t.blockSelector,a=t.ignoreClass,l=t.ignoreSelector,u=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function v(t){var e=Wd(t),r=t.isTrusted,s=i.defaultView;if(!e||!s||e instanceof s.HTMLElement){var v=e&&e.tagName;if(e&&"OPTION"===v&&(e=Bu.parentElement(e)),e&&v&&Qd.indexOf(v)>=0&&!Cd(e,n,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var f=e.value,p=!1,g=$h(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[v.toLowerCase()]||u[g])&&(f=Rh({element:e,maskInputOptions:u,tagName:v,type:g,value:f,maskInputFn:h})),c(e,d?{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;c(t,d?{text:i,isChecked:!p,userTriggered:!1}:{text:i,isChecked:!p})}})}}}function c(t,i){var n=Jd.get(t);if(!n||n.text!==i.text||n.isChecked!==i.isChecked){Jd.set(t,i);var o=r.getId(t);Hd(e)(s({},i,{id:o}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map(t=>vd(t,Hd(v),i)),p=i.defaultView;if(!p)return()=>{f.forEach(t=>t())};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map(t=>_d(t[0],t[1],{set(){Hd(v)({target:this,isTrusted:!1})}},!1,p))),Hd(()=>{pd(f)})}(t)),o.push(function(t){var e=t.mediaInteractionCb,i=t.blockClass,r=t.blockSelector,n=t.mirror,s=t.sampling,o=t.doc,a=Hd(t=>yd(Hd(s=>{var o=Wd(s);if(o&&!Cd(o,i,r,!0)){var a=o.currentTime,l=o.volume,u=o.muted,h=o.playbackRate,d=o.loop;e({type:t,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:d})}}),s.media||500)),l=[vd("play",a(Eu.Play),o),vd("pause",a(Eu.Pause),o),vd("seeked",a(Eu.Seeked),o),vd("volumechange",a(Eu.VolumeChange),o),vd("ratechange",a(Eu.RateChange),o)];return Hd(()=>{l.forEach(t=>t())})}(t)),t.recordDOM){var u=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?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(o,a,l){if(!r)return()=>{};var u=e.get(o);u||e.set(o,u=[]);var h={emit:a,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(o))};try{d=t.setTimeout(f,5e3),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(o)))}},reset(){r=!1,i.forEach(e=>t.clearTimeout(e)),i.clear(),e.clear()}}}(n);o.push(u.reset),o.push(function(t,e){var i=t.styleSheetRuleCb,r=t.mirror,n=t.stylesheetManager,s=e.win,o=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var a=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Hd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Yd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,adds:[{rule:a,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:Hd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Yd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,removes:[{index:a}]})),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:Hd((t,e,s)=>{var a=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=Yd(e,r,n.styleMirror),d=h.id,v=h.styleId;if(!(d&&-1!==d||v&&-1!==v))return l;var c=o.queuePendingMutation(e,()=>i({id:d,styleId:v,replace:a}),()=>{var t=wh(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:Hd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e);var u=Yd(e,r,n.styleMirror),h=u.id,d=u.styleId;return(h&&-1!==h||d&&-1!==d)&&o.queueMutation(e,()=>i({id:h,styleId:d,replaceSync:a})),l},"host")}));var d={};iv("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:(iv("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),iv("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),iv("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:Hd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Yd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Kd(e),l];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,adds:[{rule:a,index:v}]}))}return l},"host")}),s.prototype.deleteRule=new Proxy(v[e].deleteRule,{apply:Hd((t,e,s)=>{var a=s[0],l=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var u=Yd(e.parentStyleSheet,r,n.styleMirror),h=u.id,d=u.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var v=[...Kd(e),a];o.queueMutation(e.parentStyleSheet,()=>i({id:h,styleId:d,removes:[{index:v}]}))}return l},"host")})}),Hd(()=>{s.CSSStyleSheet.prototype.insertRule=a,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:u})),o.push(Xd(t,t.doc)),o.push(function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,o=e.win,a=e.mutationQueue,l=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(l,{apply:Hd((t,e,o)=>{var l,u=o[0],h=o[1],d=o[2],v=t.apply(e,o);if(n.has(u))return v;var c=null===(l=e.parentRule)||void 0===l?void 0:l.parentStyleSheet;s.onCssomSheetMutation(c);var f=Yd(c,r,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=Kd(e.parentRule);a.queueMutation(c,()=>i({id:p,styleId:g,set:{property:u,value:h,priority:d},index:m}))}return v},"host")});var u=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Hd((t,e,o)=>{var l,u=o[0],h=t.apply(e,o);if(n.has(u))return h;var d=null===(l=e.parentRule)||void 0===l?void 0:l.parentStyleSheet;s.onCssomSheetMutation(d);var v=Yd(d,r,s.styleMirror),c=v.id,f=v.styleId;if(c&&-1!==c||f&&-1!==f){var p=Kd(e.parentRule);a.queueMutation(d,()=>i({id:c,styleId:f,remove:{property:u},index:p}))}return h},"host")}),Hd(()=>{o.CSSStyleDeclaration.prototype.setProperty=l,o.CSSStyleDeclaration.prototype.removeProperty=u})}(t,{win:n,mutationQueue:u})),t.collectFonts&&o.push(function(t){var e=t.fontCb,i=t.doc,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(t,e,i){var r=new o(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 a=ju(i.fonts,"add",function(t){return function(i){return setTimeout(Hd(()=>{var t=s.get(i);t&&(e(t),s.delete(i))}),0),t.apply(this,[i])}});return n.push(()=>{r.FontFace=o}),n.push(a),Hd(()=>{n.forEach(t=>t())})}(t))}for(var h of(o.push(function(t){var e=t.doc,i=t.mirror,r=t.blockClass,n=t.blockSelector,s=t.selectionCb,o=!0,a=Hd(()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),d=h.startContainer,v=h.startOffset,c=h.endContainer,f=h.endOffset;Cd(d,r,n,!0)||Cd(c,r,n,!0)||a.push({start:i.getId(d),startOffset:v,end:i.getId(c),endOffset:f})}s({ranges:a})}});return a(),vd("selectionchange",a)}(t)),o.push(function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?ju(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))o.push(h.observer(h.callback,n,h.options))}catch(t){try{a()}catch(t){}throw t}return a}function ev(t){return void 0!==window[t]}function iv(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var rv=class{constructor(t){fh(this,"generateIdFn",void 0),fh(this,"iframeRemoteIdToLocalIdMap",new WeakMap),fh(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),o=n.get(e);return void 0===o&&(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}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}},nv=class{constructor(t){fh(this,"iframes",new WeakMap),fh(this,"crossOriginIframeMap",new WeakMap),fh(this,"crossOriginIframeMirror",new rv(Vh)),fh(this,"crossOriginIframeStyleMirror",void 0),fh(this,"crossOriginIframeRootIdMap",new WeakMap),fh(this,"mirror",void 0),fh(this,"mutationCb",void 0),fh(this,"wrappedEmit",void 0),fh(this,"loadListener",void 0),fh(this,"pageHideListener",void 0),fh(this,"stylesheetManager",void 0),fh(this,"recordCrossOriginIframes",void 0),fh(this,"messageHandler",void 0),fh(this,"nestedIframeListeners",new Map),fh(this,"attachedWindows",new WeakMap),fh(this,"attachedDocuments",new WeakMap),fh(this,"attachedIframes",new Map),fh(this,"loadListenerDisposers",new WeakMap),fh(this,"iframeElementsById",new Map),fh(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new rv(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?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=>fd(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach(t=>{cd(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 o=this.handleMessage.bind(this);fd(()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)})}fd(()=>{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)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",n),i||this.pageHideHandlers.set(t,i=new Set),i.add({win:e,handler:n})}}),null===(i=this.loadListener)||void 0===i||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){switch(e.type){case ku.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:ku.IncrementalSnapshot,data:{source:Su.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case ku.Meta:case ku.Load:case ku.DomContentLoaded:return!1;case ku.Plugin:return e;case ku.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case ku.IncrementalSnapshot:switch(e.data.source){case Su.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 Su.Drag:case Su.TouchMove:case Su.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case Su.ViewportResize:return!1;case Su.MediaInteraction:case Su.MouseInteraction:case Su.Scroll:case Su.CanvasMutation:case Su.Input:return this.replaceIds(e.data,t,["id"]),e;case Su.StyleSheetRule:case Su.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Su.Font:return e;case Su.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case Su.AdoptedStyleSheet:var r;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(r=e.data.styles)||void 0===r||r.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===Mu.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&&(cd(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(cd(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=>{fd(()=>this.mirror.removeNodeFromMap(t))}),fd(()=>Zd(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&&cd(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{cd(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}},sv=class{constructor(t){fh(this,"shadowDoms",new WeakSet),fh(this,"mutationCb",void 0),fh(this,"scrollCb",void 0),fh(this,"bypassOptions",void 0),fh(this,"mirror",void 0),fh(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(mh(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var n=null!==(i=null===(r=Bu.host(t))||void 0===r?void 0:r.ownerDocument)&&void 0!==i?i:e,o=Vd(s({},this.bypassOptions,{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),a=o.observer,l=o.buffer;this.restoreHandlers.push({doc:n,handler(){a.disconnect(),l.destroy(),l.releaseCanvasManager();var t=zd.indexOf(l);-1!==t&&zd.splice(t,1)}}),this.restoreHandlers.push({doc:n,handler:Gd(s({},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(Bu.host(t))),this.restoreHandlers.push({doc:n,handler:Xd({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:ju(t.prototype,"attachShadow",function(t){return function(r){var n=t.call(this,r),s=Bu.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}},ov="skip-frame";function av(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 lv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uv="undefined"==typeof Uint8Array?[]:new Uint8Array(256),hv=0;64>hv;hv++)uv[lv.charCodeAt(hv)]=hv;var dv=function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=lv[i[e]>>2],n+=lv[(3&i[e])<<4|i[e+1]>>4],n+=lv[(15&i[e+1])<<2|i[e+2]>>6],n+=lv[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},vv=new Map,cv=(t,e,i)=>{if(t&&(gv(t,e)||"object"==typeof t)){var r=function(t,e){var i=vv.get(t);return i||vv.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 fv(t,e,i,r){return t instanceof Array?t.map(t=>fv(t,e,i,r)):null===t?t: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?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:dv(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[fv(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:[fv(t.data,e,i,r),t.width,t.height]}:gv(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:cv(t,e,i)}:t}var pv=(t,e,i,r)=>t.map(t=>fv(t,e,i,r)),gv=(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]))},mv=["webgl","webgl2"];function yv(t){return"nodeType"in t}function _v(t,e,i,r){var n=[];try{if(r){var o=function(t,e,i){var r=t.GPUCanvasContext;if((null==r?void 0:r.prototype)&&"function"==typeof r.prototype.configure)return ju(r.prototype,"configure",function(r){return function(n){var o=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!o||yv(o)&&Cd(o,e,i,!0))return r.call(this,n);yv(o)&&!("__context"in o)&&(o.__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?s({},n,{usage:"number"==typeof n.usage?n.usage|a:a}):n)}})}(t,e,i);o&&n.push(o)}var a=ju(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(n){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(n),o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];if(!Cd(this,e,i,!0)&&("__context"in this||(this.__context=s),r&&mv.includes(s)))if(a[0]&&"object"==typeof a[0]){var u=a[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[n,...a])}});n.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(t=>t())}}function bv(t,e,i,r,n,s,o){var a=[],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=ju(t,l,function(t){return function(){for(var a=arguments.length,u=new Array(a),h=0;a>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(cv(d,s,this),this.canvas&&"tagName"in this.canvas&&!Cd(this.canvas,r,n,!0)){var v={type:e,property:l,args:pv(u,s,this,o)};i(this.canvas,v)}return d}});a.push(u)}catch(s){var h=_d(t,l,{set(t){this.canvas&&"tagName"in this.canvas&&!Cd(this.canvas,r,n,!0)&&i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});a.push(h)}};for(var h of l)u(h);return a}var wv='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',kv="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",wv],{type:"text/javascript;charset=utf-8"});function Sv(t){var e;try{if(!(e=kv&&(self.URL||self.webkitURL).createObjectURL(kv)))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(wv),{name:null==t?void 0:t.name})}}var xv,Cv,Tv,Ev=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||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}constructor(t){fh(this,"pendingCanvasMutations",new Map),fh(this,"rafStamps",{latestId:0,invokeId:null}),fh(this,"mirror",void 0),fh(this,"mutationCb",void 0),fh(this,"resetObservers",void 0),fh(this,"frozen",!1),fh(this,"locked",!1),fh(this,"rafIdTimestamp",null),fh(this,"rafIdFlush",null),fh(this,"refCount",0),fh(this,"torndown",!1),fh(this,"resetFrameDedup",null),fh(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,o=t.recordCanvas,a=t.dataURLOptions,l=t.resolutionScale,u=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===i&&this.initCanvasMutationObserver(r,n,s,a),o&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:a,resolutionScale:l,canvasMasking:u})}initCanvasFPSObserver(t,e,i,r,n){var s=this;if("OffscreenCanvas"in e){var o,l="number"==typeof n.resolutionScale&&Number.isFinite(n.resolutionScale)?Math.min(1,Math.max(.1,n.resolutionScale)):1,u=_v(e,i,r,!0),h=new Map;try{o=new Sv}catch(t){return}var d=!1;o.onerror=()=>{var t;d=!0,cancelAnimationFrame(v),null===(t=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=t=>{var e=t.data.id;if(h.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 v,c=1e3/t,f=0,p=t=>{var u,g;d||(f&&c>t-f||(f=t,(u=[],g=t=>{try{t.querySelectorAll("canvas").forEach(t=>{Cd(t,i,r,!0)||u.push(t)}),t.querySelectorAll("*").forEach(t=>{t.shadowRoot&&g(t.shadowRoot)})}catch(t){}},g(e.document),u).forEach(function(){var t=a(function*(t){var e=s.mirror.getId(t);if(!h.get(e)&&0!==t.width&&0!==t.height){h.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var i,r,a=t.getContext(t.__context);if(null==a||null===(i=a.isContextLost)||void 0===i?void 0:i.call(a))return void h.set(e,!1);!1===(null==a||null===(r=a.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&a.clear(a.COLOR_BUFFER_BIT)}var u=t.clientWidth||t.width,d=t.clientHeight||t.height,v=Math.max(1,Math.round(u*l)),c=Math.max(1,Math.round(d*l)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var o;try{o=t.regionsFn(e)}catch(t){return ov}if(void 0!==o){if(!Array.isArray(o)||!o.every(av))return ov;var a=i/n,l=r/s;return o.filter(t=>t.width>0&&t.height>0).map(t=>{var e=Math.floor(t.x*a),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*a)-e,height:Math.ceil((t.y+t.height)*l)-i}})}}}(n.canvasMasking,t,v,c,u,d);if("skip-frame"===f)return void h.set(e,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});o.postMessage({id:e,bitmap:p,width:v,height:c,displayWidth:u,displayHeight:d,dataURLOptions:n.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(e,!1)}}});return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(p))};v=requestAnimationFrame(p),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(v),null===(t=o.terminate)||void 0===t||t.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=_v(t,e,i,!1),s=function(t,e,i,r,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=ju(e.CanvasRenderingContext2D.prototype,o,function(s){return function(){for(var a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];return Cd(this.canvas,i,r,!0)||setTimeout(()=>{var i=pv(l,e,this,n);t(this.canvas,{type:Tu["2D"],property:o,args:i})},0),s.apply(this,l)}});s.push(a)}catch(n){var l=_d(e.CanvasRenderingContext2D.prototype,o,{set(e){Cd(this.canvas,i,r,!0)||t(this.canvas,{type:Tu["2D"],property:o,args:[e],setter:!0})}});s.push(l)}};for(var l of o)if(a(l))continue;return()=>{s.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i,r),o=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...bv(e.WebGLRenderingContext.prototype,Tu.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...bv(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(),o()}}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,i){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==i){var s=r.map(t=>n(t,e));this.mutationCb({id:i,type:r[0].type,commands:s}),this.pendingCanvasMutations.delete(t)}}}},Mv=class{constructor(t){var e;fh(this,"trackedLinkElements",new WeakSet),fh(this,"pendingDeferredSheets",new Set),fh(this,"mutationCb",void 0),fh(this,"adoptedStyleSheetCb",void 0),fh(this,"maskAllElementAttributes",void 0),fh(this,"maskAttributeFn",void 0),fh(this,"styleMirror",new Pd),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=Mh(r))}catch(t){}if(!i||!r)return dh(),null;var n=i,s=!1,o={sheet:r,invalidate(){s=!0}};this.pendingDeferredSheets.add(o);var a=!1;return{advance:i=>{if(a)return!0;var l,u,h=Uu(),d=Wu(),v=!0;try{if(s)return a=!0,dh(),!0;if(!n.advance(i))return v=!1,!1;a=!0;var c=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==r?(dh(),!0):c?(this.emitCssTextMutation(t,e,c),!0):(dh(),!0)}finally{v&&this.pendingDeferredSheets.delete(o),Vu(l=Uu()-h,null!=(u=d)?u:Hu)||(rh.totalMs+=l,l>rh.slowestSliceMs&&(rh.slowestSliceMs=l))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(o)}}}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))||void 0===i||i.advance(1/0)}emitCssTextMutation(t,e,i){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:Oh({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 o=Uu();try{lh(()=>{try{var e=t.rules||t.cssRules;e&&ah(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,(e,i)=>({rule:kh(e,t.href),index:i}))})})}finally{uh(Uu()-o)}}r.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),nd.forEach(t=>t.abort()),nd.clear()}trackStylesheetInLinkElement(t){}},Iv=class{constructor(){fh(this,"nodeMap",new WeakMap),fh(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(){}},Rv=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var Av,Pv=document.createElement("iframe");document.body.appendChild(Pv),Array.from=(null===(Av=Pv.contentWindow)||void 0===Av?void 0:Av.Array.from)||Array.from,document.body.removeChild(Pv)}}catch(t){console.debug("Unable to override Array.from",t)}var Ov=new Ih,Fv=new Set([Su.Mutation,Su.MediaInteraction,Su.StyleSheetRule,Su.CanvasMutation,Su.Font,Su.Log,Su.StyleDeclaration,Su.AdoptedStyleSheet]);function $v(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?void 0:t.call(e,i)}}}var r=setTimeout(t,250);return{cancel:()=>clearTimeout(r)}}function Dv(t){var e;void 0===t&&(t={});var i=t,r=i.emit,n=i.checkoutEveryNms,o=i.checkoutEveryNth,a=i.blockClass,l=void 0===a?"rr-block":a,u=i.blockSelector,h=void 0===u?null:u,d=i.ignoreClass,v=void 0===d?"rr-ignore":d,c=i.ignoreSelector,f=void 0===c?null:c,p=i.maskTextClass,g=void 0===p?"rr-mask":p,m=i.maskTextSelector,y=void 0===m?null:m,_=i.inlineStylesheet,b=void 0===_||_,w=i.inlineStylesheetBudgetRules,k=i.maskAllInputs,S=i.maskInputOptions,x=i.slimDOMOptions,C=i.maskInputFn,T=i.maskTextFn,E=i.maskAllElementAttributes,M=void 0!==E&&E,I=i.maskAttributeFn,R=i.hooks,A=i.packFn,P=i.sampling,O=void 0===P?{}:P,F=i.dataURLOptions,D=void 0===F?{}:F,L=i.canvasResolutionScale,N=i.canvasMasking,q=i.mousemoveWait,j=i.recordDOM,B=void 0===j||j,U=i.recordCanvas,H=void 0!==U&&U,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;Dd=i.errorHandler;var ot=s({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},D),at=!W||window.parent===window,lt=!1;if(!at)try{window.parent.document&&(lt=!1)}catch(t){lt=!0}if(at&&!r)throw new Error("emit function is required");if(!at&&!lt)return()=>{};void 0!==q&&void 0===O.mousemove&&(O.mousemove=q),Ov.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=hd(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 A&&!lt&&(t=A(t)),t};xv=(t,e)=>{var i,s=t;if(s.timestamp=bd(),!(null===(i=zd[0])||void 0===i?void 0:i.isFrozen())||s.type===ku.FullSnapshot||s.type===ku.IncrementalSnapshot&&Fv.has(s.data.source)||zd.forEach(t=>t.unfreeze()),at)null==r||r(gt(s),e);else if(lt){var a={type:"rrweb",event:gt(s),origin:window.location.origin,isCheckout:e};window.parent.postMessage(a,"*")}if(s.type===ku.FullSnapshot)ut=s,ft=0;else if(s.type===ku.IncrementalSnapshot){if(s.data.source===Su.Mutation&&s.data.isAttachIframe)return;ft++,(o&&ft>=o||n&&s.timestamp-ut.timestamp>n)&&Cv(!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=Ov.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()}xv({type:ku.IncrementalSnapshot,data:s({source:Su.Mutation},t)})},yt=t=>xv({type:ku.IncrementalSnapshot,data:s({source:Su.Scroll},t)}),_t=t=>xv({type:ku.IncrementalSnapshot,data:s({source:Su.CanvasMutation},t)}),bt=new Mv({mutationCb:mt,adoptedStyleSheetCb:t=>xv({type:ku.IncrementalSnapshot,data:s({source:Su.AdoptedStyleSheet},t)}),maskAllElementAttributes:M,maskAttributeFn:I}),wt=new nv({mirror:Ov,mutationCb:mt,stylesheetManager:bt,recordCrossOriginIframes:W,wrappedEmit:xv});for(var kt of tt||[])kt.getMirror&&kt.getMirror({nodeMirror:Ov,crossOriginIframeMirror:wt.crossOriginIframeMirror,crossOriginIframeStyleMirror:wt.crossOriginIframeStyleMirror});var St=new Iv,xt=null==N?void 0:N.configured;Tv=new Ev({recordCanvas:H,mutationCb:_t,win:window,blockClass:l,blockSelector:h,mirror:Ov,sampling:O.canvas,dataURLOptions:ot,resolutionScale:L,canvasMasking:N});var Ct=new sv({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskInputOptions:ht,dataURLOptions:ot,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:M,maskAttributeFn:I,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,sampling:O,slimDOMOptions:dt,iframeManager:wt,stylesheetManager:bt,canvasManager:Tv,keepIframeSrcFn:it,processedNodeManager:St,attributeFilter:st},mirror:Ov});Cv=function(t){if(void 0===t&&(t=!1),B){nh(w);try{xv({type:ku.Meta,data:{href:window.location.href,width:Sd(),height:kd()}},t),null==e||e.cancel(),e=void 0,bt.reset(),Ct.init(),zd.forEach(t=>t.lock());var i,r=null;try{r=function(t,e){var i=e||{},r=i.mirror,n=void 0===r?new Ih:r,s=i.blockClass,o=void 0===s?"rr-block":s,a=i.blockSelector,l=void 0===a?null:a,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,_=i.canvasMaskingConfigured,b=i.maskAllInputs,w=void 0!==b&&b,k=i.maskTextFn,S=i.maskInputFn,x=i.maskAllElementAttributes,C=void 0!==x&&x,T=i.maskAttributeFn,E=i.slimDOM,M=i.dataURLOptions,I=i.preserveWhiteSpace,R=i.onSerialize,A=i.onIframeLoad,P=i.iframeLoadTimeout,O=i.onIframeListenerRegistered,F=i.onStylesheetLoad,D=i.stylesheetLoadTimeout,L=i.keepIframeSrcFn,N=void 0===L?()=>!1:L,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,U=hd(void 0!==E&&E);nh(j);try{return ud(t,{doc:t,mirror:n,blockClass:o,blockSelector:l,maskTextClass:h,maskTextSelector:v,skipChild:!1,inlineStylesheet:f,maskInputOptions:B,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:T,slimDOMOptions:U,dataURLOptions:M,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:_,preserveWhiteSpace:I,onSerialize:R,onIframeLoad:A,iframeLoadTimeout:P,onIframeListenerRegistered:O,onStylesheetLoad:F,stylesheetLoadTimeout:D,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{sh()}}(document,{mirror:Ov,blockClass:l,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:b,maskAllInputs:ht,inlineStylesheetBudgetRules:w,maskTextFn:T,maskInputFn:C,maskAllElementAttributes:M,maskAttributeFn:I,slimDOM:dt,dataURLOptions:ot,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,onSerialize(t){Id(t,Ov)&&wt.addIframe(t),Rd(t,Ov)&&bt.trackLinkElement(t),Ad(t)&&Ct.addShadowRoot(Bu.shadowRoot(t),document)},onIframeLoad(t,e){wt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){wt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){bt.attachLinkElement(t,e)},keepIframeSrcFn:it})}finally{s=Xu,Xu=[],i=s}if(!r)return console.warn("Failed to snapshot the document");if(xv({type:ku.FullSnapshot,data:{node:r,initialOffset:wd(window)}},t),zd.forEach(t=>t.unlock()),Tv.onFullSnapshot(),i.length){var n=function(t,e,i){var r=!1,n=null,s=0,o=null,a=()=>null!==o||t.length>s,l=()=>{var i=t[s];t[s]=null,s+=1,i&&fd(()=>{o=e.beginDeferredLinkInlining(i,Ov.getId(i))})},u=()=>{if(o){var t=o,e=!0;fd(()=>{e=t.advance(200)}),e&&(o=null)}},h=()=>{o||l(),u()},d=t=>{if(n=null,!r){var e=0;do{try{h()}catch(t){null==o||o.discard(),o=null,vh(1)}e+=1}while(!r&&a()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));r||(a()?n=$v(d):i())}};return n=$v(d),{cancel(){r=!0,null==o||o.discard(),o=null,null==n||n.cancel(),n=null},flush(){if(!r){r=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;a()&&50>e;){o||l();var d=o;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),o=null,h+=1;else{try{u()}catch(t){null==o||o.discard(),o=null,h+=1}e+=1}}if(a()||h>0){for(var v=h+(null!==o?1:0),c=s;t.length>c;c++)null!==t[c]&&(v+=1);vh(v),null==o||o.discard(),o=null}i()}}}}(i,bt,()=>{e===n&&(e=void 0)});e=n}W&&wt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&bt.adoptStyleSheets(document.adoptedStyleSheets,Ov.getId(document))}finally{sh()}var s}};try{var Tt=[];for(var Et of(Tt.push(vd("pagehide",()=>{try{null==e||e.flush()}catch(t){}e=void 0},window)),["visibilitychange","freeze","resume"]))Tt.push(vd(Et,zu,document));vt=t=>{var e=pt.get(t);e&&(e.forEach(t=>{fd(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=Ov.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 Mt=t=>{var e;return Hd(tv)({mutationCb:mt,mousemoveCb:(t,e)=>xv({type:ku.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>xv({type:ku.IncrementalSnapshot,data:s({source:Su.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>xv({type:ku.IncrementalSnapshot,data:s({source:Su.ViewportResize},t)}),inputCb:t=>xv({type:ku.IncrementalSnapshot,data:s({source:Su.Input},t)}),mediaInteractionCb:t=>xv({type:ku.IncrementalSnapshot,data:s({source:Su.MediaInteraction},t)}),styleSheetRuleCb:t=>xv({type:ku.IncrementalSnapshot,data:s({source:Su.StyleSheetRule},t)}),styleDeclarationCb:t=>xv({type:ku.IncrementalSnapshot,data:s({source:Su.StyleDeclaration},t)}),canvasMutationCb:_t,fontCb:t=>xv({type:ku.IncrementalSnapshot,data:s({source:Su.Font},t)}),selectionCb(t){xv({type:ku.IncrementalSnapshot,data:s({source:Su.Selection},t)})},customElementCb(t){xv({type:ku.IncrementalSnapshot,data:s({source:Su.CustomElement},t)})},blockClass:l,ignoreClass:v,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:b,sampling:O,recordDOM:B,recordCanvas:H,canvasMaskingConfigured:xt,inlineImages:X,userTriggeredOnInput:Q,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:T,maskAllElementAttributes:M,maskAttributeFn:I,keepIframeSrcFn:it,blockSelector:h,slimDOMOptions:dt,dataURLOptions:ot,mirror:Ov,iframeManager:wt,stylesheetManager:bt,shadowDomManager:Ct,processedNodeManager:St,canvasManager:Tv,ignoreCSSAttributes:nt,attributeFilter:st,plugins:(null==tt||null===(e=tt.filter(t=>t.observer))||void 0===e?void 0:e.map(t=>({observer:t.observer,options:t.options,callback:e=>xv({type:ku.Plugin,data:{plugin:t.name,payload:e}})})))||[]},R)};wt.addLoadListener(t=>{try{var e=Ov.getId(t),i=Mt(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=Ov.getId(t);null==vt||vt(e),Zd(t)});var It=-1,Rt=t=>xv({type:ku.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),At=()=>{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,o=s?Ov.getId(s):-1;o!==It&&(-1!==It&&Rt({id:It,enter:!1}),It=o,-1!==o&&Rt({id:o,enter:!0}))},Pt=()=>{Cv();var t=Mt(document);"function"==typeof t&&Tt.push(t),Tt.push(vd("fullscreenchange",At)),Tt.push(vd("webkitfullscreenchange",At)),Tt.push(vd("mozfullscreenchange",At)),Tt.push(vd("MSFullscreenChange",At)),Rv=!0};return["interactive","complete"].includes(document.readyState)?Pt():(Tt.push(vd("DOMContentLoaded",()=>{xv({type:ku.DomContentLoaded,data:{}}),"DOMContentLoaded"===G&&Pt()})),Tt.push(vd("load",()=>{xv({type:ku.Load,data:{}}),"load"===G&&Pt()},window))),()=>{try{null==e||e.flush()}catch(t){}e=void 0,pd(Tt),St.destroy(),wt.removeLoadListener(),wt.destroy(),pt.clear(),Ct.reset(),Ov.reset(),Rv=!1,Dd=void 0}}catch(t){console.warn(t)}}Dv.addCustomEvent=(t,e)=>{if(!Rv)throw new Error("please add custom event after start recording");xv({type:ku.Custom,data:{tag:t,payload:e}})},Dv.freezePage=()=>{zd.forEach(t=>t.freeze())},Dv.takeFullSnapshot=t=>{if(!Rv)throw new Error("please take full snapshot after start recording");Cv(t)},Dv.mirror=Ov,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Lv=Object.create(null);function Nv(t){return Nv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nv(t)}function qv(t,e,i){return(e=function(t){var e=function(t){if("object"!=Nv(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=Nv(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Nv(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}Lv.Node=Object.create(null),Lv.ShadowRoot=Object.create(null),Lv.MutationObserver=Object.create(null),Lv.Element=Object.create(null);var jv=class{constructor(t){qv(this,"fileName",void 0),qv(this,"functionName",void 0),qv(this,"lineNumber",void 0),qv(this,"columnNumber",void 0),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}},Bv=/(^|@)\S+:\d+/,Uv=/^\s*at .*(\S+:\d+|\(native\))/m,Hv=/^(eval@)?(\[native code])?$/,zv={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Uv)?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(Uv)},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());return new jv({functionName:r.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(Hv)},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 jv({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new jv({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 o=e.exec(i[n]);o&&r.push(new jv({fileName:o[2],lineNumber:parseFloat(o[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 o=e.exec(i[n]);o&&r.push(new jv({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[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());return new jv({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})},this)}};function Wv(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 o=r.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===i&&n.push(o)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function Vv(t){return Array.isArray(t)}function Gv(t){return"object"==typeof t&&null!==t&&!Vv(t)}function Zv(t,e){if(0===e)return!0;for(var i of Object.keys(t))if(Gv(t[i])&&Zv(t[i],e-1))return!0;return!1}function Qv(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(Gv(o=e)&&Object.keys(o).length>i.numOfKeysLimit||"function"==typeof o||Gv(o)&&Zv(o,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 o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var l in e){var u=e[l];a[l]=Vv(u)?Wv(u.length?u[0]:null):u}return a}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 Jv={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 Kv(t,e,i){var r,n=i?Object.assign({},Jv,i):Jv,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message;t({level:"error",trace:zv.parse(e.error).map(t=>t.toString()),payload:[Qv(i,n.stringifyOptions)]})};e.addEventListener("error",u),l.push(()=>{e.removeEventListener("error",u)});var h=e=>{var i,r;e.reason instanceof Error?r=[Qv("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[Qv("Uncaught (in promise)",n.stringifyOptions),Qv(e.reason,n.stringifyOptions)]),t({level:"error",trace:zv.parse(i).map(t=>t.toString()),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){try{if(!(s in e))return()=>{};var l=e[s],u={next:l},h=(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]||a)){a=!0;try{var h=zv.parse(new Error).map(t=>t.toString()).splice(1),d=("assert"===i?l.slice(1):l).map(t=>Qv(t,n.stringifyOptions));o++,n.lengthThreshold>o?t({level:i,trace:h,payload:d}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Qv("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})(function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return u.next.apply(this,e)});return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:u}})),e[s]=h,()=>{if(e[s]!==h)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===h)return void(r.next=u.next);r=t(i=r.next)}else e[s]=u.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var Yv=t=>({name:"rrweb/console@1",observer:Kv,options:t}),Xv=()=>{},tc=t=>{var e;if(Te(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function ec(t,e,i){try{if(!(e in t))return Xv;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 Te(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=tc(i);s;){if(s.next===n)return void(s.next=r.next);s=tc(i=s.next)}else t[e]=r.next}}catch(t){return Xv}}function ic(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 rc=On("[Recorder]"),nc=t=>"navigation"===t.entryType,sc=t=>"resource"===t.entryType;function oc(t,e){return!!e&&(De(e)||e[t])}function ac(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 lc=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function uc(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:!!ac(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(lc))return!1;if(De(i))return!0;if(Ce(i))return n(i);var s=i[e];return De(s)?s:n(s)}function hc(t,e,i,r,n,s){return dc.apply(this,arguments)}function dc(){return dc=a(function*(t,e,i,r,n,s){return void 0===s&&(s=0),s>10?(rc.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null):function(t,e){for(var i=t.length-1;i>=0;i-=1)if(e(t[i]))return t[i]}(t.performance.getEntriesByName(i),t=>sc(t)&&t.initiatorType===e&&(Ie(r)||t.startTime>=r)&&(Ie(n)||n>=t.startTime))||(yield new Promise(t=>setTimeout(t,50*s)),hc(t,e,i,r,n,s+1))}),dc.apply(this,arguments)}function vc(t){var e=t.body,i=t.options,r=t.url;if(Oe(e))return null;var n=ic(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Re(e))return e;if((t=>"u">typeof Document&&t instanceof Document)(e))return e.textContent;if(Le(e))return Qn(e);if(Ee(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 cc=t=>!Pe(t)&&("navigation"===t.entryType||"resource"===t.entryType);function fc(t){var e=t.entry,i=t.method,r=t.status,n=t.networkRequest,o=t.isInitial,a=t.start,l=t.end,u=t.url,h=t.initiatorType;a=e?e.startTime:a,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),v=Math.floor(d+(a||0)),c=[s({},e?e.toJSON():{name:u},{startTime:Ie(a)?void 0:Math.round(a),endTime:Ie(l)?void 0:Math.round(l),timeOrigin:d,timestamp:v,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:r,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:o})];if(cc(e))for(var f of e.serverTiming||[])c.push({timeOrigin:d,timestamp:v,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return c}var pc=["video/","audio/"];function gc(t){return Ee(t)&&Te(t.getReader)&&Te(t.tee)}var mc="[SessionReplay] Timeout while trying to read body",yc="[SessionReplay] Failed to read body";function _c(t){return yc+": "+t}function bc(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function wc(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{var i=setTimeout(()=>e(mc),500);try{t.clone().text().then(t=>e(t),t=>e(_c(t))).finally(()=>clearTimeout(i))}catch(t){clearTimeout(i),e(yc)}})}(t);var i=Hs(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(bc(i)):function(t,e){return new Promise(i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel().catch(()=>{})}catch(t){}}function o(t){n||(n=!0,clearTimeout(l),s(),i(t))}var a,l=setTimeout(()=>o(mc),500);try{a=t.clone()}catch(t){return void o(yc)}var u=a.body;if(gc(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void o(yc)}var h=[],d=0;!function t(){r.read().then(i=>{var r=i.done,a=i.value;if(n)s();else if(r)o((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(a){if(d+a.byteLength>e)return void o(bc(e));d+=a.byteLength,h.push(a)}t()}},t=>o(_c(t)))}()}else try{a.text().then(t=>o(t),t=>o(_c(t)))}catch(t){o(yc)}})}(t,i)}function kc(){return kc=a(function*(t){var e=t.r,i=t.options,r=ic(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):wc(e,i)}),kc.apply(this,arguments)}function Sc(){return Sc=a(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(),o=pc.some(t=>null==s?void 0:s.startsWith(t));if(s&&o)return"Content-Type "+s+" is not supported";var a=ic(n,r);return a.isHostDenied?a.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return Pe(r)?wc(e,i):Promise.resolve(r)}),Sc.apply(this,arguments)}var xc=null;function Cc(t,e,i){if(!("performance"in e))return()=>{};if(xc)return rc.warn("Network observer already initialised, doing nothing"),()=>{};var r=i?Object.assign({},zs,i):zs,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&&Ys.has(t))(s)),s&&i.push(s)}}),i.length>0&&t(s({},e,{requests:i}))},o=function(t,e,i){i.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>nc(t)||sc(t)&&i.initiatorTypes.includes(t.initiatorType)).flatMap(t=>fc({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0});var r=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>nc(t)||sc(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>fc({entry:t,method:void 0,status:void 0,networkRequest:{}}))})}),n=PerformanceObserver.supportedEntryTypes.filter(t=>i.performanceEntryTypeToObserve.includes(t));return r.observe({entryTypes:n}),()=>{r.disconnect()}}(n,e,r),l=()=>{},u=()=>{};return(r.recordHeaders||r.recordBody)&&(l=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=oc("request",i.recordHeaders),n=oc("response",i.recordHeaders),s=ec(e.XMLHttpRequest.prototype,"open",s=>function(o,a,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(a),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=>(uc({type:"request",headers:g,url:a,recordBody:i.recordBody})&&(p.requestBody=vc({body:t,options:i,url:a})),v=e.performance.now(),y(t));var _=()=>{d.removeEventListener("readystatechange",b),d.removeEventListener("error",_),d.removeEventListener("abort",_),d.removeEventListener("timeout",_)},b=()=>{if(d.readyState===d.DONE){_(),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),uc({type:"response",headers:r,url:a,recordBody:i.recordBody})&&(p.responseBody=vc({body:d.response,options:i,url:a})),hc(e,"xmlhttprequest",f.url,v,c).then(e=>{t({requests:fc({entry:e,method:o,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:a.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})}};d.addEventListener("readystatechange",b),d.addEventListener("error",_),d.addEventListener("abort",_),d.addEventListener("timeout",_)}catch(t){rc.error("Failed to instrument XHR for network capture",t)}s.call(d,o,a.toString(),l,u,h)});return()=>{s()}}(n,e,r),u=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var r=oc("request",i.recordHeaders),n=oc("response",i.recordHeaders),s=ec(e,"fetch",s=>function(){var o=a(function*(o,a){var l,u;try{l=new Request(o,a)}catch(t){return rc.error("Failed to instrument fetch for network capture",t),s(o,a)}var h,d,v={};try{try{var c={};l.headers.forEach((t,e)=>{c[e]=t}),r&&(v.requestHeaders=c),!gc(null==a?void 0:a.body)&&uc({type:"request",headers:c,url:o,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return kc.apply(this,arguments)}({r:l,options:i,url:o}))}catch(t){rc.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),u=ac(o)?yield s(l):yield s(o,a),d=e.performance.now();try{var f={};u.headers.forEach((t,e)=>{f[e]=t}),n&&(v.responseHeaders=f),uc({type:"response",headers:f,url:o,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return Sc.apply(this,arguments)}({r:u,options:i,url:o}))}catch(t){rc.error("Failed to record fetch response for network capture",t)}return u}finally{hc(e,"fetch",l.url,h,d).then(e=>{var i;t({requests:fc({entry:e,method:l.method,status:null==(i=u)?void 0:i.status,networkRequest:v,start:h,end:d,url:l.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return o.apply(this,arguments)}}());return()=>{s()}}(n,e,r)),xc=()=>{o(),l(),u(),xc=null}}var Tc,Ec,Mc,Ic,Rc,Ac,Pc,Oc,Fc,$c,Dc,Lc,Nc,qc,jc,Bc=t=>({name:"rrweb/network@1",observer:Cc,options:t});b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Yv,getRecordNetworkPlugin:Bc},b.__PosthogExtensions__.rrweb={record:Dv,version:"v2",wasMaxDepthReached:()=>ld,resetMaxDepthState(){ld=!1,ad=!1},getLastSnapshotCost:()=>Ku,getMutationCost:()=>s({},ih),resetSnapshotCostState(){Gu=0,Zu=0,Qu=0,Hu=0,Ju={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Ku=null,Yu=null,Xu=[],th=0,eh=0,ih={slowestBatchMs:0},rh={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},b.rrweb={record:Dv,version:"v2"},b.rrwebConsoleRecord={getRecordConsolePlugin:Yv},b.getRecordNetworkPlugin=Bc,b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initSessionRecording=(t,e)=>new wu(t,e);var Uc,Hc,zc,Wc,Vc={},Gc=[],Zc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Qc=Array.isArray;function Jc(t,e){for(var i in e)t[i]=e[i];return t}function Kc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Yc(t,e,i){var r,n,s,o={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Tc.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return Xc(t,o,r,n,null)}function Xc(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?++Mc:n,__i:-1,__u:0};return null==n&&null!=Ec.vnode&&Ec.vnode(s),s}function tf(t){return t.children}function ef(t,e){this.props=t,this.context=e}function rf(t,e){if(null==e)return t.__?rf(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?rf(t):null}function nf(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Jc({},e);s.__v=e.__v+1,Ec.vnode&&Ec.vnode(s),ff(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?rf(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,gf(r,s,n),e.__e=e.__=null,s.__e!=i&&sf(s)}}function sf(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}),sf(t)}function of(t){(!t.__d&&(t.__d=!0)&&Ic.push(t)&&!af.__r++||Rc!=Ec.debounceRendering)&&((Rc=Ec.debounceRendering)||Ac)(af)}function af(){try{for(var t,e=1;Ic.length;)Ic.length>e&&Ic.sort(Pc),t=Ic.shift(),e=Ic.length,nf(t)}finally{Ic.length=af.__r=0}}function lf(t,e,i,r,n,s,o,a,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||Gc,_=e.length;for(l=function(t,e,i,r,n){var s,o,a,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=Xc(null,o,null,null,null):Qc(o)?o=t.__k[s]=Xc(tf,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=Xc(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+v,o.__=t,o.__b=t.__b+1,a=null,-1!=(u=o.__i=hf(o,i,l,d))&&(d--,(a=i[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,o.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(a=i[s])&&!(2&a.__u)&&(a.__e==r&&(r=rf(a)),_f(a,a));return r}(i,e,y,l,_),d=0;_>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||Vc,c.__i=d,g=ff(t,c,v,n,s,o,a,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&yf(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=uf(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 uf(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=uf(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=rf(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function hf(t,e,i,r){var n,s,o,a=t.key,l=t.type,u=e[i],h=null!=u&&!(2&u.__u);if(null===u&&null==a||h&&a==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[o=0>n?s++:n--])&&!(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function df(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||Zc.test(e)?i:i+"px"}function vf(t,e,i,r,n){var s,o;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||df(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||df(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Dc,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[$c]=r[$c]:(i[$c]=Lc,t.addEventListener(e,s?qc:Nc,s)):t.removeEventListener(e,s?qc:Nc,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 cf(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[Fc])e[Fc]=Lc++;else if(i[$c]>e[Fc])return;return i(Ec.event?Ec.event(e):e)}}}function ff(t,e,i,r,n,s,o,a,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=[a=e.__e=i.__e]),(h=Ec.__b)&&h(e);t:if("function"==typeof C){d=o.length;try{if(y=e.props,_=C.prototype&&C.prototype.render,$=(h=C.contextType)&&r[h.__c],b=h?$?$.props.value:h.__:r,i.__c?m=(v=e.__c=i.__c).__=v.__E:(_?e.__c=v=new C(y,b):(e.__c=v=new ef(y,b),v.constructor=C,v.render=bf),$&&$.sub(v),v.state||(v.state={}),v.__n=r,c=v.__d=!0,v.__h=[],v._sb=[]),_&&null==v.__s&&(v.__s=v.state),_&&null!=C.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=Jc({},v.__s)),Jc(v.__s,C.getDerivedStateFromProps(y,v.__s))),f=v.props,p=v.state,v.__v=e,c)_&&null==C.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),_&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(_&&null==C.getDerivedStateFromProps&&y!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(y,b),e.__v==i.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(y,v.__s,b)){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)}),Gc.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&o.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=b,v.props=y,v.__P=t,v.__e=!1,w=Ec.__r,k=0,_)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),Gc.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=Jc(Jc({},r),v.getChildContext())),_&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===tf&&null==h.key?mf(h.props.children):h,a=lf(t,Qc(S)?S:[S],e,i,r,n,s,o,a,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&o.push(v),m&&(v.__E=v.__=null)}catch(t){if(o.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;null!=s&&(s[s.indexOf(a)]=null),e.__e=a}else{if(null!=s)for(x=s.length;x--;)Kc(s[x]);pf(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||pf(e);Ec.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):a=e.__e=function(t,e,i,r,n,s,o,a,l){var u,h,d,v,c,f,p,g=i.props||Vc,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),a&&(Ec.__m&&Ec.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&Tc.call(t.childNodes),!a&&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||vf(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:a&&"function"!=typeof c||g[u]===c||vf(t,u,c,g[u],n);if(h)a||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),lf("template"==e.type?t.content:t,Qc(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:i.__k&&rf(i,0),a,l),null!=s)for(u=s.length;u--;)Kc(s[u]);a&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&vf(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&vf(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,o,l,u);return(h=Ec.diffed)&&h(e),128&e.__u?void 0:a}function pf(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(pf))}function gf(t,e,i){for(var r=0;i.length>r;r++)yf(i[r],i[++r],i[++r]);Ec.__c&&Ec.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){Ec.__e(t,e.__v)}})}function mf(t){return"object"!=typeof t||null==t||t.__b>0?t:Qc(t)?t.map(mf):void 0!==t.constructor?null:Jc({},t)}function yf(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){Ec.__e(t,i)}}function _f(t,e,i){var r,n;if(Ec.unmount&&Ec.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||yf(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){Ec.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&_f(r[n],e,i||"function"!=typeof t.type);i||Kc(t.__e),t.__c=t.__=t.__e=void 0}function bf(t,e,i){return this.constructor(t,i)}function wf(t,e,i){var r,n,s,o;e==document&&(e=document.documentElement),Ec.__&&Ec.__(t,e),n=(r="function"==typeof i)?null:i&&i.__k||e.__k,s=[],o=[],ff(e,t=(!r&&i||e).__k=Yc(tf,null,[t]),n||Vc,Vc,e.namespaceURI,!r&&i?[i]:n?null:e.firstChild?Tc.call(e.childNodes):null,s,!r&&i?i:n?n.__e:e.firstChild,r,o),gf(s,t,o),t.props.children=null}Tc=Gc.slice,Ec={__e(t,e,i,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},Mc=0,ef.prototype.setState=function(t,e){var i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Jc({},this.state);"function"==typeof t&&(t=t(Jc({},i),this.props)),t&&Jc(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),of(this))},ef.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),of(this))},ef.prototype.render=tf,Ic=[],Ac="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Pc=function(t,e){return t.__v.__b-e.__v.__b},af.__r=0,Oc=Math.random().toString(8),Fc="__d"+Oc,$c="__a"+Oc,Dc=/(PointerCapture)$|Capture$/i,Lc=0,Nc=cf(!1),qc=cf(!0),jc=0;var kf=0,Sf=[],xf=Ec,Cf=xf.__b,Tf=xf.__r,Ef=xf.diffed,Mf=xf.__c,If=xf.unmount,Rf=xf.__;function Af(t,e){xf.__h&&xf.__h(Hc,t,kf||e),kf=0;var i=Hc.__H||(Hc.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Pf(t){return kf=1,function(t,e){var i=Af(Uc++,2);if(i.t=t,!i.__c&&(i.__=[Hf(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Hc,!Hc.__f)){var r=function(t,e,r){if(!i.__c.__H)return!0;var s=!1,o=i.__c.props!==t;if(i.__c.__H.__.some(function(t){if(t.__N){s=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}}),n){var a=n.call(this,t,e,r);return s?a||o:a}return!s||o};Hc.__f=!0;var n=Hc.shouldComponentUpdate,s=Hc.componentWillUpdate;Hc.componentWillUpdate=function(t,e,i){if(this.__e){var o=n;n=void 0,r(t,e,i),n=o}s&&s.call(this,t,e,i)},Hc.shouldComponentUpdate=r}return i.__N||i.__}(Hf,t)}function Of(t,e){var i=Af(Uc++,3);!xf.__s&&Uf(i.__H,e)&&(i.__=t,i.u=e,Hc.__H.__h.push(i))}function Ff(t){return kf=5,$f(function(){return{current:t}},[])}function $f(t,e){var i=Af(Uc++,7);return Uf(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function Df(t){var e,i=Hc.context[t.__c],r=Af(Uc++,9);return r.c=t,i?(null!==(e=r.__)&&void 0!==e||(r.__=!0,i.sub(Hc)),i.props.value):t.__}function Lf(){for(var t;t=Sf.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(jf),e.__h.some(Bf),e.__h=[]}catch(i){e.__h=[],xf.__e(i,t.__v)}}}xf.__b=function(t){Hc=null,Cf&&Cf(t)},xf.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Rf&&Rf(t,e)},xf.__r=function(t){Tf&&Tf(t),Uc=0;var e=(Hc=t.__c).__H;e&&(zc===Hc?(e.__h=[],Hc.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&Lf(),Uc=0)),zc=Hc},xf.diffed=function(t){Ef&&Ef(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Sf.push(e)&&Wc===xf.requestAnimationFrame||((Wc=xf.requestAnimationFrame)||qf)(Lf)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),zc=Hc=null},xf.__c=function(t,e){e.some(function(t){try{t.__h.some(jf),t.__h=t.__h.filter(function(t){return!t.__||Bf(t)})}catch(i){e.some(function(t){t.__h&&(t.__h=[])}),e=[],xf.__e(i,t.__v)}}),Mf&&Mf(t,e)},xf.unmount=function(t){If&&If(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some(function(t){try{jf(t)}catch(t){e=t}}),i.__H=void 0,e&&xf.__e(e,i.__v))};var Nf="function"==typeof requestAnimationFrame;function qf(t){var e,i=function(){clearTimeout(r),Nf&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);Nf&&(e=requestAnimationFrame(i))}function jf(t){var e=Hc,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),Hc=e}function Bf(t){var e=Hc;t.__c=t.__(),Hc=e}function Uf(t,e){return!t||t.length!==e.length||e.some(function(e,i){return e!==t[i]})}function Hf(t,e){return"function"==typeof e?e(t):e}var zf={GZipJS:"gzip-js",Base64:"base64"},Wf={Activation:"events",Cancellation:"cancelEvents"},Vf={Button:"button",Tab:"tab",Selector:"selector"},Gf={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"},Zf={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Qf={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Jf={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Kf={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Yf={Once:"once",Recurring:"recurring",Always:"always"},Xf={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},tp={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},ep={Popover:"popover",Inline:"inline"};function ip(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Te(i.then)&&i.then(void 0,()=>{})}}}}var rp=On("[Surveys]");function np(t){return!(!t.start_date||t.end_date)}function sp(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var op=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),ap=t=>op("seenSurvey_",t),lp=t=>{try{var e=ap(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){rp.error("Failed to persist survey seen state",t)}},up=[Qf.Popover,Qf.Widget,Qf.API],hp={ignoreConditions:!1,ignoreDelay:!1,displayType:ep.Popover},dp="logs",vp=On("[Stylesheet Loader]"),cp=l,fp=d,pp="#020617",gp={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:Gf.Right,widgetType:Vf.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:pp,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},mp=[Gf.Center,Gf.Left,Gf.Right];function yp(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 _p(t){var e;void 0===t&&(t=gp.backgroundColor),"#"===t[0]&&(e=yp(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=yp(i)),!e)return pp;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),o=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?pp:"white"}return pp}var bp=(t,e,i)=>{var r=qp(t),n=fp.querySelector("."+r);if(n&&n.shadowRoot)return{shadow:n.shadowRoot,isNewlyCreated:!1};var o=fp.createElement("div");((t,e,i)=>{var r=s({},gp,i),n=t.style,o=!mp.includes(r.position)||e===Qf.Widget&&(null==i?void 0:i.widgetType)===Vf.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),o?(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)||_p(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",_p(r.ratingButtonActiveColor)),n.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||_p(r.backgroundColor)),n.setProperty("--ph-survey-text-subtle-color",r.textSubtleColor),n.setProperty("--ph-widget-color",r.widgetColor),n.setProperty("--ph-widget-text-color",_p(r.widgetColor)),n.setProperty("--ph-widget-z-index",r.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||r.inputBackground;a||"white"!==r.backgroundColor||(l="#f8f8f8"),n.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||_p(l);n.setProperty("--ph-survey-input-text-color",u),n.setProperty("--ph-survey-rating-text-color",u),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)})(o,t.type,t.appearance),o.className=r;var a=o.attachShadow({mode:"open"}),l=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return Te(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(vp.error("prepare_external_dependency_stylesheet returned null"),null)})(fp,':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:calc(2147480000 + 3645);--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 #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.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){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{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);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.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{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}: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{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;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}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.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;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{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{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.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{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.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}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!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(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return(i||fp.body).appendChild(o),{shadow:a,isNewlyCreated:!0}},wp=t=>{var e=t.responses,i=t.survey,r=t.surveySubmissionId,n=t.posthog,o=t.isSurveyCompleted,a=t.properties,l=t.surveyLanguage,u=t.questionSnapshots;n?(lp(i),n.capture(Xf.SENT,s({[tp.SURVEY_NAME]:i.name,[tp.SURVEY_ID]:i.id,[tp.SURVEY_ITERATION]:i.current_iteration,[tp.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[tp.SURVEY_SUBMISSION_ID]:r,[tp.SURVEY_COMPLETED]:o},l&&{[tp.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==n.get_session_replay_url?void 0:n.get_session_replay_url()},Ha(e,i,u),a,{$set:{[za(i,"responded")]:!0}})),o&&(cp.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Np(i),n.reloadFeatureFlags())):rp.error("[survey sent] event not captured, PostHog instance not found.")},kp=(t,e,i)=>{return s({[tp.SURVEY_NAME]:t.name,[tp.SURVEY_ID]:t.id,[tp.SURVEY_ITERATION]:t.current_iteration,[tp.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[tp.SURVEY_PARTIALLY_COMPLETED]:(r=null==e?void 0:e.responses,void 0===r&&(r={}),Object.values(r).some(t=>!Oe(t)))},(null==e?void 0:e.surveyLanguage)&&{[tp.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[tp.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},Ha(null==e?void 0:e.responses,t,null==e?void 0:e.questionSnapshots));var r},Sp=(t,e,i,r)=>{if(e){if(!i){var n=Dp(t),o=n?n.surveyLanguage:r;e.capture(Xf.DISMISSED,s({},kp(t,n,e),o&&{[tp.SURVEY_LANGUAGE]:o},{$set:{[za(t,"dismissed")]:!0}})),Np(t),lp(t),cp.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else rp.error("[survey dismissed] event not captured, PostHog instance not found.")},xp=(t,e)=>{if(e){var i=(t=>op("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=Dp(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(Xf.ABANDONED,kp(t,r,e),{transport:"sendBeacon"})}}else rp.error("[survey abandoned] event not captured, PostHog instance not found.")},Cp=t=>t.map(t=>({sort:Math.floor(10*Math.random()),value:t})).sort((t,e)=>t.sort-e.sort).map(t=>t.value),Tp=(t,e)=>t.length===e.length&&t.every((t,i)=>t===e[i])?e.reverse():e,Ep=t=>{var e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},Mp=(t,e)=>{var i;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?Tp(t.questions,Cp(t.questions)):t.questions},Ip=t=>Ka(t)||Lp(t),Rp=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,of(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"+jc++,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}),Ap=()=>Df(Rp),Pp=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,o,a=Jc({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?Tc.call(arguments,2):i),Xc(t.type,a,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function Op(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n,s=is(e);return!!s&&tl[n=null==(r=t.conditions)?void 0:r.urlMatchType,null!=n?n:"icontains"]([t.conditions.url],[s])}var Fp=t=>op("inProgressSurvey_",t),$p=(t,e)=>{try{localStorage.setItem(Fp(t),JSON.stringify(e))}catch(t){rp.error("Error setting in-progress survey state in localStorage",t)}},Dp=t=>{try{var e=localStorage.getItem(Fp(t));if(e)return JSON.parse(e)}catch(t){rp.error("Error getting in-progress survey state from localStorage",t)}return null},Lp=t=>{var e=Dp(t);return!Oe(null==e?void 0:e.surveySubmissionId)},Np=t=>{try{localStorage.removeItem(Fp(t))}catch(t){rp.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=Gf.Right),t===Qf.ExternalSurvey)return{};switch(e){case Gf.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Gf.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Gf.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Gf.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Gf.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Gf.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Gf.Left:return{left:"30px"};case Gf.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Qf.Widget&&i===Vf.Tab?"60px":"30px"}}}var Bp=0;function Up(t,e,i,r,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Bp,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return Ec.vnode&&Ec.vnode(u),u}var Hp=Up("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Up("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"})}),zp=Up("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Up("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"})}),Wp=Up("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Up("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"})}),Vp=Up("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Up("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"})}),Gp=Up("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Up("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"})}),Zp=Up("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Up("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"})}),Qp=Up("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Up("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"})}),Jp=Up("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Up("g",{"clip-path":"url(#clip0_2415_6911)",children:[Up("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Up("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Up("g",{mask:"url(#mask0_2415_6911)",children:[Up("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"}),Up("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"}),Up("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"}),Up("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"}),Up("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"}),Up("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"})]})]}),Up("defs",{children:Up("clipPath",{id:"clip0_2415_6911",children:Up("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Kp(t){var e=t.urlParams,i=e?Object.entries(e).map(t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)}).join("&"):"";return Up("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Jp]})}function Yp(t){var e=t.text,i=t.submitDisabled,r=t.appearance,n=t.onSubmit,s=t.link,o=t.onPreviewSubmit,a=t.skipSubmitButton,u=t.canGoBack,h=t.onBack,d=Df(Rp).isPreviewMode,v=!!u&&!!h,c=!a&&Up("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==l||l.open(s)),d?null==o||o():n()},children:e});return Up("div",{className:"bottom-section",children:[v?Up("div",{className:"form-buttons form-buttons-with-back",children:[Up("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:r.backButtonText||"Back"}),c]}):c,!r.whiteLabel&&Up(Kp,{urlParams:{utm_source:"survey-footer"}})]})}function Xp(t){var e=t.question,i=t.forceDisableHtml;return Up("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Up(e.type===Jf.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&Pp({component:Yc("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function tg(t){var e,i,r;return Up("button",{className:"form-cancel",onClick:t.onClick,disabled:Df(Rp).isPreviewMode,"aria-label":"Close survey",type:"button",children:(e={fill:"black"},i=(void 0===e?{}:e).fill,r=void 0===i?"currentColor":i,Up("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:r,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Up("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Up("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:r})]}))})}var eg=l;function ig(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onClose,a=Df(Rp).isPopup;return Of(()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return zn(eg,"keydown",t),()=>{eg.removeEventListener("keydown",t)}},[o]),Up("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Up(tg,{onClick:()=>o()}),Up("h3",{className:"thank-you-message-header",children:e}),i&&Pp({component:Yc("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),a&&Up(Yp,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}function rg(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,o=t.onStart,a=Df(Rp),l=a.onPreviewSubmit,u=a.onPopupSurveyDismissed;return Up("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[a.isPopup&&!0!==s.hideCancelButton&&Up(tg,{onClick:()=>u()}),e&&Up("h3",{className:"intro-screen-header",children:e}),i&&Pp({component:Yc("p",{className:"intro-screen-body"}),children:i,renderAsHtml:!n&&"text"!==r}),Up(Yp,{text:s.introScreenButtonText||"Get started",submitDisabled:!1,appearance:s,onSubmit:o,onPreviewSubmit:()=>l(null)})]})}var ng=t=>Ce(t)&&t.every(t=>Re(t));function sg(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,o=t.displayQuestionIndex,a=t.initialValue,l=t.canGoBack,u=t.onBack,h=Ap().isPreviewMode,d=Ff(null),v=Pf(()=>Re(a)?a:""),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Of(()=>{p||setTimeout(()=>{var t;h||null==(t=d.current)||t.focus()},100)},[h,p]);var g="surveyQuestion"+o,m=$f(()=>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 o of e)switch(o.type){case ye:if(void 0!==o.value&&o.value>s.length)return null!==(r=o.errorMessage)&&void 0!==r?r:"Please enter at least "+o.value+" characters";break;case _e:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(c,e.validation,e.optional),[c,e.validation,e.optional]),y=Mn(e.validation,ye),_=Mn(e.validation,_e),b=$f(()=>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,_),[y,_]),w=()=>{m||n(c.trim())},k=()=>{m||s(c.trim())};return Up(tf,{children:[Up("div",{className:"question-container",children:[Up(Xp,{question:e,forceDisableHtml:i,htmlFor:g}),Up("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:_,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}),b&&Up("div",{className:"validation-hint",children:b})]}),Up(Yp,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:k,canGoBack:l,onBack:u})]})}function og(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,o=t.onBack;return Up(tf,{children:[Up("div",{className:"question-container",children:Up(Xp,{question:e,forceDisableHtml:t.forceDisableHtml})}),Up(Yp,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:o})]})}function ag(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=Pf(()=>Fe(l)?l:Ce(l)&&l.length>0&&Fe(parseInt(l[0]))?parseInt(l[0]):Re(l)&&Fe(parseInt(l))?parseInt(l):null),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=Ap().isPreviewMode,y=t=>m?a(t):o(t);return Up(tf,{children:[Up("div",{className:"question-container",children:[Up(Xp,{question:i,forceDisableHtml:r}),Up("div",{className:"rating-section",children:[Up("div",{className:"rating-options",children:["emoji"===i.display&&Up("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=cg[i.scale])?void 0:e.map((t,e)=>Up("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&&Up("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:fg(i.scale).map((t,e)=>Up(lg,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e))})]}),!g&&Up("div",{className:"rating-text",children:[Up("div",{children:i.lowerBoundLabel}),Up("div",{children:i.upperBoundLabel})]})]})]}),Up(Yp,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Pe(f)&&!i.optional,appearance:s,onSubmit:()=>o(f),onPreviewSubmit:()=>a(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function lg(t){var e=t.num,i=t.setActiveNumber;return Up("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 ug(t){var e=t.question,i=t.forceDisableHtml,r=t.displayQuestionIndex,n=t.appearance,o=t.onSubmit,a=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=Ff(null),v=$f(()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=Tp(e,Cp(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e),[e]),c=Pf(()=>((t,e)=>Re(t)||ng(t)?t:e===Jf.SingleChoice?null:[])(l,e.type)),f=c[0],p=c[1],g=Pf(()=>((t,e)=>{if(Re(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(ng(t)){var i=t.find(t=>!e.includes(t));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(l,v)),m=g[0],y=g[1],_=Ap().isPreviewMode,b=e.type===Jf.SingleChoice,w=e.type===Jf.MultipleChoice,k=e.skipSubmitButton&&b&&!e.hasOpenChoice,S=(t,e)=>{if(e){var i=!m.isSelected;return y(t=>s({},t,{isSelected:i,inputValue:i?t.inputValue:""})),b&&p(""),void(i&&setTimeout(()=>{var t;return null==(t=d.current)?void 0:t.focus()},75))}if(b)return p(t),y(t=>s({},t,{isSelected:!1,inputValue:""})),void(k&&(o(t),_&&a(t)));w&&Ce(f)&&(f.includes(t)?p(f.filter(e=>e!==t)):p([...f,t]))},x=t=>{t.stopPropagation();var e=t.currentTarget.value;y(t=>s({},t,{inputValue:e})),b&&p(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||T()||(t.preventDefault(),E()),"Escape"===t.key&&(t.preventDefault(),y(t=>s({},t,{isSelected:!1,inputValue:""})),b&&p(null))},T=()=>!(e.optional||!Pe(f)&&(!Ce(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),E=()=>{m.isSelected&&w?Ce(f)&&(_?a([...f,m.inputValue]):o([...f,m.inputValue])):_?a(f):o(f)};return Up(tf,{children:[Up("div",{className:"question-container",children:[Up(Xp,{question:e,forceDisableHtml:i}),Up("fieldset",{className:"multiple-choice-options limit-height",children:[Up("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),v.map((t,i)=>{var n=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+r+"Choice"+i,o=s+"Open",a=n?m.isSelected:b?f===t:Ce(f)&&f.includes(t);return Up("label",{className:n?"choice-option-open":"",children:[Up("div",{className:"response-choice",children:[Up("input",{type:b?"radio":"checkbox",name:s,checked:a,onChange:()=>S(t,n),id:s,"aria-controls":o}),Up("span",{children:n?t+":":t})]}),n&&Up("input",{type:"text",ref:d,id:o,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)})]})]}),Up(Yp,{text:e.buttonText||"Submit",submitDisabled:T(),appearance:n,onSubmit:E,onPreviewSubmit:E,skipSubmitButton:k,canGoBack:u,onBack:h})]})}var hg=[1,2,3,4,5],dg=[1,2,3,4,5,6,7],vg=[0,1,2,3,4,5,6,7,8,9,10],cg={2:[Zp,Qp],3:[Wp,zp,Hp],5:[Vp,Wp,zp,Hp,Gp]};function fg(t){switch(t){case 5:default:return hg;case 7:return dg;case 10:return vg}}var pg=On("[Surveys]");function gg(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?Kf.End:s;if(n.branching.type===Kf.End)return Kf.End;if(n.branching.type===Kf.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Kf.ResponseBased){if(n.type===Jf.SingleChoice){var o,a=n.choices.indexOf(""+i);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===Kf.End?Kf.End:s}}else if(n.type===Jf.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===Kf.End?Kf.End:s}}return s}return pg.warn("Falling back to next question index due to unexpected branching type"),s}var mg=On("[SurveyTranslations]");function yg(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=Wa(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?Wa(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var o=Wa(r);return o?(null==e||e.info("Using detected locale: "+o),o):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Te(t.get_property)?t.get_property(ct):void 0,locale:ml()},mg)}(e);if(!i)return mg.info("No user language detected"),{survey:t,language:null};var r=Qa(t,i,mg);return{survey:r.survey,language:r.matchedKey}}var _g=l,bg=d,wg="ph:show_survey_widget",kg="PHWidgetSurveyClickListener";function Sg(t,e){try{var i=t.getBoundingClientRect(),r=_g.innerHeight,n=_g.innerWidth,s=i.left+i.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=r-i.bottom,a=250>o&&i.top>o;return{position:"fixed",top:a?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:a?r-i.top+12+"px":"auto",zIndex:gp.zIndex}}catch(t){return rp.warn("Failed to calculate trigger position:",t),null}}var xg=class{constructor(t){var e=this;this.ki=new Map,this.Si=new Map,this.xi=new Map,this.Ci=new Set,this.Mi=null,this.Ti=!1,this.Ii=null,this.Ri=null,this.Ai=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(gt);if(t)for(var e of t)Lp(e)&&xp(e,this._posthog)},this.handlePopoverSurvey=function(t,i,r){var n,o,a,l,u,h=(void 0===r?{}:r).resumeDelayFromActivation,d=void 0!==h&&h,v=e.Ei(t),c=v.survey,f=v.language;e.Mi=f,e.Ai=null,e.Oi=i;var p=e.Li(c,i);e.Di(p.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,_=!(!y||0>=Object.keys(y).length)&&e.Pi(p,y,m,f);if(!_||null!=(n=p.appearance)&&n.displayThankYouMessage){e.Ni(p);var b={};if((null==(o=p.appearance)?void 0:o.position)===Gf.NextToTrigger&&null!=(a=p.appearance)&&a.widgetSelector){var w,k=bg.querySelector(p.appearance.widgetSelector);k&&(b=Sg(k,parseInt((null==(w=p.appearance)?void 0:w.maxWidth)||gp.maxWidth))||{})}var S=(null==(l=p.appearance)?void 0:l.surveyPopupDelaySeconds)||0,x=bp(p,e._posthog).shadow;e.xi.set(x,x.host);var C={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.Fi,properties:m,style:b,isSurveyCompleted:_,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:f};if(e.Ai=C,0>=S)return e.Ti=!0,wf(Up(Ig,s({},C)),x);var T=()=>{if(!e.qi(p))return rp.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),e.Fi(p);(()=>{e.Ti=!0;var r=e.Ei(t),n=r.survey,o=r.language;e.Mi=o;var a=e.Li(n,i),l=s({},C,{survey:a,surveyLanguage:o});e.Ai=l,wf(Up(Ig,s({},l,{survey:s({},a,{appearance:s({},a.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},E=d?null==(u=e._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,M=Fe(E)?Math.max(0,Date.now()-E):0,I=Math.max(0,1e3*S-M);if(0>=I)return T();var R=_g.setTimeout(()=>{e.ki.delete(p.id),T()},I);e.ki.set(p.id,R)}},this.ji=t=>{var e=this.Ei(t),i=e.survey,r=e.language,n=bp(i,this._posthog),s=n.shadow,o=n.isNewlyCreated;this.xi.set(s,s.host),o&&wf(Up(Ag,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.Bi=t=>{var e=this.Si.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(kg),this.Si.delete(t),rp.info("Removed click listener for survey "+t))},this.Hi=t=>{this.$i(t)||(this.zi(t),this.Bi(t.id))},this.$i=t=>{try{var e;return!(null==(e=bg.querySelector(qp(t,!0)))||null==(e=e.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Ui=(t,e)=>{var i=bg.querySelector(e),r=this.Si.get(t.id);if(i){if(this.ji(t),r){if(i===r.element)return;rp.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Bi(t.id)}if(!i.hasAttribute(kg)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===Gf.NextToTrigger?Sg(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||gp.maxWidth)):{};_g.dispatchEvent(new CustomEvent(wg,{detail:{surveyId:t.id,position:n}}))};zn(i,"click",n),i.setAttribute(kg,"true"),this.Si.set(t.id,{element:i,listener:n,survey:t}),rp.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.Hi(t)},this.renderPopover=t=>{var e=this.Ei(t),i=e.survey,r=e.language,n=bp(i,this._posthog).shadow;this.xi.set(n,n.host),wf(Up(Ig,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.Fi,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.Ei(t),s=n.survey,o=n.language,a=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(a=this.Wi(s,o,i)),wf(Up(Ig,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Fi,isPopup:!1,properties:i,isSurveyCompleted:a,surveyLanguage:o}),e)},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||null==(r=r.surveys)||r.getSurveys(i=>{t(i.filter(t=>e.qi(t)))},i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys(t=>{var i=t.filter(t=>t.type===Qf.Popover||t.type===Qf.Widget),r=new Set(i.map(t=>t.id));for(var n of Array.from(e.ki.keys()))r.has(n)||e.cancelSurvey(n);var s=e.Vi(i),o=new Set;s.forEach(t=>{if(t.type===Qf.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===Vf.Tab)return void e.ji(t);(null==(r=t.appearance)?void 0:r.widgetType)===Vf.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(o.add(t.id),e.Ui(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Pe(e.Zi)&&t.type===Qf.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),e.Si.forEach(t=>{var i=t.survey;o.has(i.id)||e.Hi(i)})},t)},this.Ni=t=>{Pe(this.Zi)||rp.error("Survey "+this.Zi+" already in focus. Cannot add survey "+t.id+"."),this.Zi=t.id},this.Fi=t=>{this.Zi!==t.id&&rp.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Di(t.id),this.Zi=null,this.Mi=null,this.Ti=!1,this.Ai=null,this.Oi=void 0,this.zi(t)},this._posthog=t,this.Zi=null,this.Ii=()=>this.Gi(),zn(_g,"languagechange",this.Ii),this.Ri=t.onFeatureFlags(()=>this.Gi())}Gi(){var t;if(!Pe(this.Zi)){var e=null==(t=this._posthog.get_property(gt))?void 0:t.find(t=>t.id===this.Zi);if(e){var i=this.Ei(e),r=i.survey,n=i.language;if(n!==this.Mi&&(this.Mi=n,this.Ti)){var o=this.Li(r,this.Oi),a=bp(o,this._posthog).shadow;wf(Up(Ig,s({},this.Ai,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.Fi,surveyLanguage:n})),a)}}}}get Qi(){var t,e,i;return null!==(t=null==(e=(i=this._posthog).getExtension)?void 0:e.call(i,"featureFlags"))&&void 0!==t?t:this._posthog.featureFlags}Li(t,e){return null!=e&&e.position||null!=e&&e.selector?s({},t,{appearance:s({},t.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):t}Di(t){var e=this.ki.get(t);e&&(clearTimeout(e),this.ki.delete(t))}cancelSurvey(t){this.ki.has(t)&&(rp.info("Cancelled pending survey "+t),this.Di(t),this.Zi===t&&(this.Zi=null,this.Mi=null,this.Ti=!1,this.Ai=null,this.Oi=void 0))}setAutomaticDisplayDispose(t){this.Ji=t}dispose(){var t;null==(t=this.Ji)||t.call(this),this.Ji=void 0,this.Ii&&(_g.removeEventListener("languagechange",this.Ii),this.Ii=null),this.Ri&&(this.Ri(),this.Ri=null),this.ki.forEach((t,e)=>this.Di(e)),this.Si.forEach((t,e)=>this.Bi(e)),this.xi.forEach((t,e)=>{wf(null,e),null==t||t.remove()}),this.xi.clear(),this.Zi=null}Vi(t){return t.sort((t,e)=>{var i,r,n=Lp(t),s=Lp(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===Yf.Always,a=e.schedule===Yf.Always;return o&&!a?1:!o&&a?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)})}Ei(t){return yg(t,this._posthog)}Wi(t,e,i){if(this.Ci.has(t.id))return!1;var r=function(){var t={},e=!1,i=_g.location.search.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:e};for(var r of i.split("&")){var n=r.split("="),s=n[0],o=n[1];if(s&&!Ie(o)){var a=decodeURIComponent(s),l=decodeURIComponent(o);if("auto_submit"!==a||"true"!==l){var u=a.match(/^q(\d+)$/);if(u){var h=parseInt(u[1],10);t[h]||(t[h]=[]),t[h].push(l)}}else e=!0}}return{params:t,autoSubmit:e}}().params;if(0===Object.keys(r).length)return!1;rp.info("[Survey Prefill] Detected URL prefill parameters");var n=this.Ki(t,r,e);return!!n&&(this.Xi(t,n,i,e),this.Ci.add(t.id),n.isSurveyCompleted)}Xi(t,e,i,r){var n=e.responses,s=e.submissionId,o=e.isSurveyCompleted,a=e.skippedResponses;(Object.keys(a).length>0&&t.enable_partial_responses||o)&&wp({responses:o?n:a,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,properties:i,surveyLanguage:r})}Pi(t,e,i,r){var n={};for(var s of Object.entries(e)){var o=s[1];n[parseInt(s[0])]=Ce(o)?o.map(String):[String(o)]}rp.info("[Survey] Processing initial responses");var a=this.Ki(t,n,r);return!!a&&(this.Xi(t,a,i,r),a.isSurveyCompleted)}Ki(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=Ba(t.id);try{switch(t.type){case Jf.SingleChoice:if(!t.choices||0===t.choices.length)return void Pn.warn("[Survey Prefill] Question "+r+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void Pn.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[o];break;case Jf.MultipleChoice:if(!t.choices||0===t.choices.length)return void Pn.warn("[Survey Prefill] Question "+r+" has no choices");var a=n.map(t=>parseInt(t,10)).filter(e=>!isNaN(e)&&e>=0&&t.choices.length>e);if(0===a.length)return void Pn.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(a.map(e=>t.choices[e]))];a.length>l.length&&Pn.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case Jf.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void Pn.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:Pn.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Pn.error("[Survey Prefill] Error converting q"+r+":",t)}}}),i}(t,e);if(0===Object.keys(r).length)return rp.warn("[Survey Prefill] No valid responses after conversion"),null;var n=ga(),s=function(t,e,i){for(var r=0,n={},s=[],o=t.questions.length+1,a=0;t.questions.length>r&&o>a&&(a++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=Ba(l.id);Ie(i[u])||(n[u]=i[u])}s.push(r);var h=gg(t,r,l.id?i[Ba(l.id)]:null);if(h===Kf.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};r=h}return{startQuestionIndex:r,skippedResponses:n,skippedIndices:s}}(t,Object.keys(e).map(t=>parseInt(t,10)),r),o=s.startQuestionIndex,a=s.skippedResponses,l=s.skippedIndices,u=o>=t.questions.length;return $p(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,questionOrder:Ep(t.questions),visitedIndices:l,surveyLanguage:i}),rp.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return rp.error("[Survey Prefill] Error handling prefill:",t),null}}Yi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=this.Qi,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}tn(t){return!t.conditions||Op(t,this._posthog)&&function(t){var e,i;return function(t,e){var i,r,n;if(!t||0===t.length)return!0;if(!m)return!1;var s=Ji(m,{userAgentDataPlatform:null==h||null==(i=h.userAgentData)?void 0:i.platform,maxTouchPoints:null==h?void 0:h.maxTouchPoints,screenWidth:null==l||null==(r=l.screen)?void 0:r.width,screenHeight:null==l||null==(n=l.screen)?void 0:n.height,devicePixelRatio:null==l?void 0:l.devicePixelRatio});return tl[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(i=t.conditions)?void 0:i.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==fp||!fp.querySelector(t.conditions.selector))}(t)}en(t){var e;return Ip(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.Qi)&&e.hasLoadedFlags?{satisfied:this.Yi(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(!np(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!up.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.Yi(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.Yi(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,o=this.en(t);return o.satisfied?function(t,e){if(!t||!e)return!0;var i="string"==typeof e?new Date(e):e,r=Math.abs((new Date).getTime()-i.getTime());return Math.ceil(r/864e5)>t}(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays,Sa.Lt("lastSeenSurveyDate"))?(t=>!!Sa.Lt(ap(t))&&!Ip(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=o.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.rn(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}rn(t){var e;return!Ja(t)&&!sp(t)||!(null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)||null==(e=e.getSurveys())||!e.includes(t.id))}nn(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.Yi(e)})}qi(t){return this.checkSurveyEligibility(t).eligible&&this.tn(t)&&this.rn(t)&&this.nn(t)}zi(t){try{var e=bg.querySelector(qp(t,!0));null!=e&&e.shadowRoot&&(wf(null,e.shadowRoot),this.xi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){rp.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Ni,removeSurveyFromFocus:this.Fi,surveyInFocus:this.Zi,surveyTimeouts:this.ki,handleWidget:this.ji,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Ui,sortSurveysByAppearanceDelay:this.Vi,checkFlags:this.nn.bind(this),isSurveyFeatureFlagEnabled:this.Yi.bind(this),onLanguageChange:this.Gi.bind(this),currentLanguage:this.Mi,surveyIsRendered:this.Ti}}};function Cg(t,e){if(bg&&_g){var i,r=new xg(t);if(t.config.disable_surveys_automatic_display)return rp.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return rp.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Ie(i)&&(i=setInterval(()=>{r.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},s=()=>{Ie(i)||(clearInterval(i),i=void 0)};n();var o=()=>{bg.hidden?s():(r.callSurveysAndEvaluateDisplayLogic(!1),n())};return zn(bg,"visibilitychange",o),r.setAutomaticDisplayDispose(()=>{s(),bg.removeEventListener("visibilitychange",o)}),r}}function Tg(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,o=void 0!==s&&s,a=t.posthog;Of(()=>{var t;if(!o&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===Qf.Widget,s=Op(e,a),o=(null==(t=e.appearance)?void 0:t.widgetType)===Vf.Tab&&i;if(!s)return rp.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);o&&(rp.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};zn(_g,"popstate",i),zn(_g,"hashchange",i);var s=_g.history.pushState,l=_g.history.replaceState;return _g.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()},_g.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()},()=>{_g.removeEventListener("popstate",i),_g.removeEventListener("hashchange",i),_g.history.pushState=s,_g.history.replaceState=l}}},[o,e,r,n,a])}var Eg=200;function Mg(t){switch(void 0===t&&(t=Zf.Right),t){case Zf.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Zf.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Zf.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Ig(t){var e,i,r,n,o,a,l,u,h,d,v,c,f=t.survey,p=t.forceDisableHtml,g=t.posthog,m=t.style,y=void 0===m?{}:m,_=t.previewPageIndex,b=t.removeSurveyFromFocus,w=void 0===b?()=>{}:b,k=t.isPopup,S=void 0===k||k,x=t.onPreviewSubmit,C=void 0===x?()=>{}:x,T=t.onPreviewBack,E=void 0===T?()=>{}:T,M=t.onPopupSurveyDismissed,I=void 0===M?()=>{}:M,R=t.onCloseConfirmationMessage,A=void 0===R?()=>{}:R,P=t.properties,O=t.isSurveyCompleted,F=t.skipShownEvent,D=t.surveyLanguage,L=Ff(null),N=Number.isInteger(_),q=function(t,e,i,r,n,o,a,l,u){var h=Pf(r||0===i||t.type===Qf.ExternalSurvey),d=h[0],v=h[1],c=Pf(!1),f=c[0],p=c[1],g=Ff(!1),m=()=>{var e=()=>{o&&n(t),v(!1)};if(!g.current){var i=null==a?void 0:a.current;i?(g.current=!0,i.style.transition="opacity "+Eg+"ms ease-out",i.style.opacity="0",setTimeout(()=>{g.current=!1,e()},250)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Of(()=>{if(e){if(!r){var n,o=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return m();p(!0),null!=(r=t.appearance)&&r.autoDisappear&&(n&&clearTimeout(n),n=setTimeout(m,5e3))}},a=()=>{if(Op(t,e)){v(!0),_g.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(Xf.SHOWN,s({[tp.SURVEY_NAME]:t.name,[tp.SURVEY_ID]:t.id,[tp.SURVEY_ITERATION]:t.current_iteration,[tp.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},u&&{[tp.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};zn(_g,"PHSurveyClosed",y),zn(_g,"PHSurveySent",o);var h=i>0?setTimeout(a,i):void 0;return Ie(h)&&a(),()=>{Ie(h)||clearTimeout(h),Ie(n)||clearTimeout(n),_g.removeEventListener("PHSurveyClosed",y),_g.removeEventListener("PHSurveySent",o)}}}else rp.error("usePopupVisibility hook called without a PostHog instance.")},[]),Tg({survey:t,removeSurveyFromFocus:n,setSurveyVisible:v,isPreviewMode:r,posthog:e}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:v,hidePopupWithAnimation:m}}(f,g,null!=(e=f.appearance)&&e.surveyPopupDelaySeconds?1e3*f.appearance.surveyPopupDelaySeconds:0,N,w,S,L,F,D),j=q.isPopupVisible,B=q.hidePopupWithAnimation,U=q.isSurveySent||_===f.questions.length||!0===O,H=Pf(!1),z=H[0],W=H[1],V=$f(()=>!!Dp(f),[f]),G=!!(null!=(i=f.appearance)&&i.introScreenHeader||null!=(r=f.appearance)&&r.introScreenDescription),Z=N?-1===_:!(null==(n=f.appearance)||!n.displayIntroScreen)&&G&&!z&&!V,Q=$f(()=>{var t,e=(null==(t=Dp(f))?void 0:t.surveySubmissionId)||ga();return{isPreviewMode:N,previewPageIndex:_,onPopupSurveyDismissed(){D?Sp(f,g,N,D):Sp(f,g,N),I()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:E,posthog:g,properties:P,surveyLanguage:D}},[N,_,S,g,f,I,C,E,P,D]);return j?Up(Rp.Provider,{value:Q,children:Up("div",{className:"ph-survey",style:s({},jp(f.type,null==(o=f.appearance)?void 0:o.position,null==(a=f.appearance)?void 0:a.widgetType),y),ref:L,children:U?Up(ig,{header:(null==(l=f.appearance)?void 0:l.thankYouMessageHeader)||"Thank you!",description:(null==(u=f.appearance)?void 0:u.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(h=f.appearance)?void 0:h.thankYouMessageDescriptionContentType,appearance:f.appearance||gp,onClose(){B(),A()}}):Z?Up(rg,{header:(null==(d=f.appearance)?void 0:d.introScreenHeader)||"",description:(null==(v=f.appearance)?void 0:v.introScreenDescription)||"",forceDisableHtml:!!p,contentType:null==(c=f.appearance)?void 0:c.introScreenDescriptionContentType,appearance:f.appearance||gp,onStart:()=>W(!0)}):Up(Rg,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function Rg(t){var e,i,r=t.survey,n=t.forceDisableHtml,o=t.posthog,a=$f(()=>{var t=Dp(r);if(!t)return null;var e=Fe(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&r.questions.length>t.lastQuestionIndex?t:(Np(r),null)},[r]),l=Pf(()=>(null!=a&&a.responses&&rp.info("Survey is already in progress, filling in initial responses"),(null==a?void 0:a.responses)||{})),u=l[0],h=l[1],d=Df(Rp),v=d.previewPageIndex,c=d.onPopupSurveyDismissed,f=d.isPopup,p=d.onPreviewSubmit,g=d.onPreviewBack,m=d.surveySubmissionId,y=d.isPreviewMode,_=d.properties,b=d.surveyLanguage,w=Pf(()=>{var t=null==a?void 0:a.lastQuestionIndex,e=Fe(t)&&t>=0&&r.questions.length>t?t:0;return Fe(v)&&v>=0?v:e}),k=w[0],S=w[1],x=Pf(()=>{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],E=Pf(()=>{var t,e;return null!==(t=null==(e=Dp(r))?void 0:e.questionSnapshots)&&void 0!==t?t:{}}),M=E[0],I=E[1],R=$f(()=>Ep(Mp(r,a)),[r.id,a]),A=$f(()=>{if(!R||new Set(R).size!==R.length)return Mp(r,a);var t=new Map(r.questions.map(t=>[t.id,t])),e=R.map(e=>t.get(e)).filter(t=>!!t);return e.length===R.length?e:r.questions},[R,r.questions,r,a]);Of(()=>{!y||Ie(v)||0>v||S(v)},[v,y]);var P=!(null==(e=r.appearance)||!e.allowGoBack)&&(y?(null!=v?v:0)>0:C.length>0),O=A.at(k);return O?Up("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(i=r.appearance)?void 0:i.hideCancelButton)&&Up(tg,{onClick(){c()}}),Up("div",{className:"survey-box","data-question-index":k,children:Pg({question:O,forceDisableHtml:n,displayQuestionIndex:k,appearance:r.appearance||gp,onSubmit:t=>(t=>{var e=t.res,i=t.displayQuestionIndex,n=t.questionId;if(o)if(n){var a=Ba(n),l=s({},u,{[a]:e});h(l);var d=A[i],v=null!=d&&d.id?s({},M,{[d.id]:d.question}):M;I(v);var c=gg(r,i,e),f=c===Kf.End,p=[...C,i];if(f||(T(p),S(c),$p(r,{surveySubmissionId:m,responses:l,lastQuestionIndex:c,questionOrder:Ep(A),visitedIndices:p,surveyLanguage:b,questionSnapshots:v})),r.enable_partial_responses||f){var g=new Set(p.map(t=>{var e;return null==(e=A[t])?void 0:e.id}).filter(t=>!!t).map(t=>Ba(t)));wp({responses:Object.fromEntries(Object.entries(l).filter(t=>g.has(t[0]))),survey:r,surveySubmissionId:m,isSurveyCompleted:f,posthog:o,properties:_,surveyLanguage:b,questionSnapshots:v})}}else rp.error("onNextButtonClick called without a questionId.");else rp.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:k,questionId:O.id}),onPreviewSubmit:p,initialValue:O.id?u[Ba(O.id)]:void 0,canGoBack:P,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);T(e),S(t),$p(r,{surveySubmissionId:m,responses:u,lastQuestionIndex:t,questionOrder:Ep(A),visitedIndices:e,surveyLanguage:b,questionSnapshots:M})}}})})]}):null}function Ag(t){var e,i,r,n,s,o,a,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=Pf(!0),f=c[0],p=c[1],g=Pf(!1),m=g[0],y=g[1],_=Pf({}),b=_[0],w=_[1],k=Ff(void 0),S=()=>{y(!m)};if(Of(()=>{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&&(rp.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),S())};return zn(_g,wg,e),()=>{Ie(k.current)||(clearTimeout(k.current),k.current=void 0),_g.removeEventListener(wg,e)}}}else rp.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]),Tg({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{l.schedule!==Yf.Always&&p(!1),Ie(k.current)||clearTimeout(k.current),k.current=setTimeout(()=>{k.current=void 0,y(!1)},200)};return Up(tf,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Up("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Zf.Top?"widget-tab-top":""),onClick:S,disabled:d,style:Mg(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),m&&Up(Ig,{posthog:h,survey:l,forceDisableHtml:u,style:b,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:v})]})}var Pg=t=>{var e=t.question,i=t.displayQuestionIndex,r=t.onSubmit,n=t.onPreviewSubmit,o={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){n(t)},onSubmit(t){r(t)},initialValue:t.initialValue,displayQuestionIndex:i,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case Jf.Open:return Yc(sg,s({},o,{question:e,key:e.id}));case Jf.Link:return Yc(og,s({},o,{question:e,key:e.id}));case Jf.Rating:return Yc(ag,s({},o,{question:e,key:e.id}));case Jf.SingleChoice:case Jf.MultipleChoice:return Yc(ug,s({},o,{question:e,key:e.id}));default:return rp.error("Unsupported question type: "+e.type),null}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.generateSurveys=Cg,b.extendPostHogWithSurveys=Cg;var Og=t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t},Fg=1e4,$g=(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),Dg=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return $g(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 o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>i.remaining?s=o-1:n=o}return $g(e,JSON.stringify(t.slice(0,n)),i)},Lg=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Ng=(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(Ee(t)){if(i.seen.has(t))return void Ng(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 Ng(e,t,i)},jg=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!Lg(t))return!n||$g(e,"null",i);if(Pe(t)||(t=>{try{return Fe(t)||De(t)}catch(t){return!1}})(t))return $g(e,JSON.stringify(t),i);if("string"==typeof t)return Dg(t,e,i);if(!Ee(t)&&!Ce(t))return $g(e,JSON.stringify(t),i);if(r.has(t))return Dg("[Circular]",e,i);r.add(t);try{var o=t.toJSON;if(Te(o))return jg(o.call(t),e,i,r,n)}catch(t){}try{var a={}.toString.call(t);if("[object String]"===a)return Dg(String(t.valueOf()),e,i);if("[object Number]"===a||"[object Boolean]"===a)return $g(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(Ce(t)){if(!$g(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!$g(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 $g(e,"]",i)}if(!$g(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(Lg(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(!$g(e,p,i))return!1;var _=e.length,b=jg(f,e,i,r,!1),w=i.truncated;if(e.length!==_){if(v=!1,!b)return!1}else if(e.length=g,i.remaining=m,i.truncated=b?y:w,!b)return!1}}}catch(t){}return $g(e,"}",i)},Bg=(t,e)=>{for(var i=[],r={remaining:e,truncated:!1},n=Ee(t[0])?{result:{},keysRemaining:50,sizeRemaining:Fg,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||$g(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)||{}}},Ug={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},Hg=t=>"canCapture"in t,zg=t=>Hg(t)?t.canCapture?t.getExtension(dp):void 0:t.is_capturing()?t.logs:void 0;b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.logs={initializeLogs(t){var e=t,i=[],r={host:b.location.host},n=!1,o=function(t){var o=b.console[t];i.push(ec(b.console,t,i=>{var a=(i=>function(){for(var o=!1,a=arguments.length,l=new Array(a),u=0;a>u;u++)l[u]=arguments[u];try{var h=e;if(l.length>0&&!n&&h){var d=zg(h);if(d){n=!0,o=!0;var v=Bg(l,Fg),c=v.body,f=v.attributes,p=s({},r,v.truncated?{body_truncated:"true"}:{});((t,e,i)=>{if(Hg(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;Te(n)&&n.call(e,i)}})(h,d,{level:Ug[t],body:c,attributes:s({"log.source":"console."+t},p,f)})}}}catch(t){}finally{o&&(n=!1),i.apply(b.console,l)}})(i);return a.__rrweb_original__=Og(o),a}))};for(var a of Object.keys(Ug))o(a);return()=>{e=void 0,i.forEach(t=>t())}},replayConsoleBuffer(t,e){var i=zg(t);if(i)for(var r of e)try{var n=Bg(r.args,Fg);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:Ug[r.level],body:n.body,attributes:s({"log.source":"console."+r.level,host:b.location.host},n.truncated?{body_truncated:"true"}:{},n.attributes)},r.context,r.occurredAtMs)}catch(t){}}};var Wg=t=>Ue(t)&&("RangeError"===t.name&&0===t.message.indexOf("Maximum call stack size exceeded")||"InternalError"===t.name&&"too much recursion"===t.message),Vg=On("[Error tracking]"),Gg="webkit-masked-url:",Zg=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],Qg=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",Gg],Jg=["__firefox__","__gCrWeb"];function Kg(){return new cr([new Ar,new Br,new Or,new Pr,new qr,new Nr,new $r,new jr],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=[],o=e.split("\n"),a=Math.min(o.length,r+1e3),l=[],u=r;a>u;u++){var h=o[u];if(1024>=h.length){var d=Sr.test(h)?h.replace(Sr,"$1"):h;if(!d.match(/\S*Error: /)){for(var v of i){var c=v(d,t);if(c){n.push(c);var f=Cr(n);if(f){for(var p=l.length-1;p>=0;p--){var g=l[p];if(f.start>=g.start+g.length)break;l.pop()}l.push(f)}break}}if(Ir(n,l)>=50)break}}}var m=[...l].sort((t,e)=>e.start-t.start),y=m[m.length-1];if(y){var _=Er(n,y);for(var b of(n.splice(y.start-_,_),m))b.start-=_}for(var w of m)Tr(n,w);return l.some(t=>0===t.start&&n.length===t.length)&&function(t){for(var e=t.map(t=>t.function+"|"+t.filename+"|"+t.lineno+"|"+t.colno+"|"+t.module),i=0,r=1;e.length>r;r++)Rr(e,r,i)&&(i=r);t.push(...t.splice(0,i))}(n),function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,50).map(t=>{return s({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||"?"});var i})}(n)}}("web:javascript",_r,kr))}var Yg=On("[ExceptionAutocapture]"),Xg=Kg(),tm=(t,e)=>{try{return t()}catch(t){return e}},em=(t,e)=>tm(()=>t(e()),void 0),im=t=>tm(()=>Te(t)&&Te(t.call),!1),rm=(t,e)=>tm(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),nm=(t,e,i)=>{tm(()=>{var i;null==(i=t[e])||delete i.__POSTHOG_INSTRUMENTED__},void 0),tm(()=>{t[e]=i},void 0)},sm=t=>{var e=l;e||Yg.info("window not available, cannot wrap onerror");var i=tm(()=>e.onerror,void 0);return e.onerror=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];return em(t,()=>Xg.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Re(e)&&Re(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}})),!!im(i)&&null!==(e=i(...n))&&void 0!==e&&e},rm(e,"onerror"),()=>nm(e,"onerror",i)},om=function(t,e){void 0===e&&(e=!1);var i=l;i||Yg.info("window not available, cannot wrap onUnhandledRejection");var r=tm(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(i){var n;return em(t,()=>Xg.buildFromUnknown(i,{mechanism:{handled:!1}})),im(r)?null!==(n=r(i))&&void 0!==n&&n:e},rm(i,"onunhandledrejection"),()=>nm(i,"onunhandledrejection",r)},am={wrapOnError:sm,wrapUnhandledRejection:om,wrapConsoleError(t){var e=console;e||Yg.info("console not available, cannot wrap console.error");var i=tm(()=>e.error,void 0);return e.error=function(){for(var e=arguments.length,r=new Array(e),n=0;e>n;n++)r[n]=arguments[n];em(t,()=>{var t;t=1==r.length?r[0]:r.join(" ");var e=r.find(t=>t instanceof Error);return Xg.buildFromUnknown(e||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),im(i)&&i(...r)},rm(e,"error"),()=>nm(e,"error",i)}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.errorWrappingFunctions=am,b.posthogErrorWrappingFunctions=am;var lm=(t,e)=>{if(Te(null==t?void 0:t.capture)){var i=null==e?void 0:e.autocaptureExceptions,r=!Pe(i)&&"object"==typeof i&&Ce(i.errors_to_ignore)?i.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){Yg.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){Yg.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)}),om(n,!0)}};b.extendPostHogWithExceptionAutoCapture=lm,b.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&&!Pe(t)||Te(t),gm=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),mm=t=>{try{var e;return gm(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==l||null==(e=l.location)?void 0:e.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(Ce(t)&&!t.includes(s))return!1;var o=!1;if(i){var a=i.checkAndGetSessionAndWindowId(!0),l=a.windowId;n.set(um,a.sessionId),n.set(hm,l),o=!0}var u=(t=>Te(t)?t():t)(e);return u&&"$posthog_cookieless"!==u&&(n.set(dm,u),o=!0),o};b.__PosthogExtensions__=b.__PosthogExtensions__||{};var _m={_patchFetch:(t,e,i)=>ec(l,"fetch",r=>function(n,o){var a=arguments.length>1?[n,o]:[n],l=a;try{var u=mm(n);if(u)if(gm(n)){var h=new Request(n,o);ym(t,e,i,h.url,h.headers),l=[h]}else{var d=new Headers(pm(o)?o.headers:void 0);if(ym(t,e,i,u,d)){var v=((t,e)=>{if(Ie(t)||Pe(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?s({},n,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,d);v&&(l=[n,v])}}}catch(t){l=a}return r.apply(this,l)}),_patchXHR:(t,e,i)=>ec(l.XMLHttpRequest.prototype,"open",r=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=this,h=new Headers,d=mm(s);d&&ym(t,e,i,d,h);var v=r.call(u,n,s,o,a,l);return vm.forEach(t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}}),v})};b.__PosthogExtensions__.tracingHeadersPatchFns=_m,b.postHogTracingHeadersPatchFns=_m,"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}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(var i=this.length-1;i>=0;i--){var r=this[i];if(t.call(e,r,i,this))return r}},writable:!0,enumerable:!1,configurable:!0});var bm=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)}}},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||Cm.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var Em,Mm=-1,Im=()=>Mm,Rm=t=>{addEventListener("pageshow",e=>{e.persisted&&(Mm=e.timeStamp,t(e))},!0)},Am=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||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()))},Om=()=>{var t,e;return null!==(t=null==(e=wm())?void 0:e.activationStart)&&void 0!==t?t:0},Fm=-1,$m=new Set,Dm=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Lm=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of $m)e();isFinite(Fm)||(Fm="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Lm,!0))}},Nm=function(t){if(void 0===t&&(t=!1),t&&(Fm=1/0),0>Fm){var e,i,r=Om();Fm=null!==(e=document.prerendering||null==(i=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=r))?void 0:i.startTime)&&void 0!==e?e:Dm(),addEventListener("visibilitychange",Lm,!0),addEventListener("prerenderingchange",Lm,!0),Rm(()=>{setTimeout(()=>{Fm=Dm()})})}return{get firstHiddenTime(){return Fm},onHidden(t){$m.add(t)}}},qm=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=wm(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>Im()?a&&(document.prerendering||Om()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.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==a?void 0:a.name),navigationStartTime:o||0}},jm=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 o of r)n.observe(s({type:o,buffered:!0},i));return n}}catch(t){}},Bm=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Um=(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)}},zm=class{constructor(){this.u=void 0}},Wm=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Vm=[1800,3e3],Gm=function(t,e){void 0===e&&(e={});var i=Bm(e);Wm(()=>{var r,n=Tm(e,zm),s=Nm(),o=qm("FCP"),a=jm(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-Om(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=Am(t,o,Vm,e.reportAllChanges),Rm(i=>{o=qm("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Im()),r=Am(t,o,Vm,e.reportAllChanges),Pm(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&jm(["soft-navigation"],i=>{i.forEach(i=>{n.u&&i.navigationId&&Um(n.u,i),o=qm("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=Am(t,o,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=function(t,e){void 0===e&&(e={});var i=Tm(e=Object.assign({},e),bm),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 o,a=null!==(o=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==o?o:xm(s);r.set(n,a)}}},function(t,e){void 0===e&&(e={});var i=Nm();Gm(Hm(()=>{var r,n=qm("CLS",0),s=Tm(e,bm),o=(i,o,a,l,u)=>{n=qm("CLS",0,i,o,a,l,u),s.o=0,r=Am(t,n,Zm,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{a(!0),o("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);a()},h=["layout-shift"];Bm(e)&&h.push("soft-navigation");var d=jm(h,u);d&&(r=Am(t,n,Zm,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),Rm(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Im()),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)},Km=function(t,e){void 0===e&&(e={});var i=Tm(e=Object.assign({},e),zm);Bm(e)&&(i.u=new Map),Gm(e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:km(Im())};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 o,a=null==(o=i.u)?void 0:o.get(t.navigationId);a&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:a})}return Object.assign(t,{attribution:e})})(e))},e)},Ym=0,Xm=1/0,ty=0,ey=t=>{for(var e of t)e.interactionId&&(Xm=Math.min(Xm,e.interactionId),ty=Math.max(ty,e.interactionId),Ym=ty?(ty-Xm)/7+1:0)},iy=()=>{var t;return Em?Ym:null!==(t=performance.interactionCount)&&void 0!==t?t:0},ry=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return iy()-this.h}D(){this.h=iy(),this.v.length=0,this.p.clear()}S(t){var e=this.T(),i=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[i]:{k:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId){var i=this.v.at(-1),r=this.p.get(t.interactionId);if(r||10>this.v.length||t.duration>i.k){var n;if(r?t.duration>r.k?(r.entries=[t],r.k=t.duration):t.duration===r.k&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.p.set((r={id:t.interactionId,entries:[t],k:t.duration}).id,r),this.v.push(r)),this.v.sort((t,e)=>e.k-t.k),this.v.length>10)for(var s of this.v.splice(10))this.p.delete(s.id);null==(n=this.M)||n.call(this,r)}}}},ny=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,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},sy=[200,500],oy=function(t,e){void 0===e&&(e={});var i=Tm(e=Object.assign({},e),ry),r=[],n=[],o=0,a=new WeakMap,l=new WeakMap,u=!1,h=()=>{u||(ny(d),u=!0)},d=()=>{var t=new Set(i.v.map(t=>a.get(t.entries[0]))),e=n.length-10;n=n.filter((i,r)=>r>=e||t.has(i));var s=new Set;for(var l of n)for(var h of v(l.startTime,l.processingEnd))s.add(h);r=r.filter(t=>t.startTime>o||s.has(t)),u=!1};i.m=t=>{var i,r=t.startTime+t.duration;o=Math.max(o,t.processingEnd);for(var s=n.length-1;s>=0;s--){var l=n[s];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&&a.set(t,i),h()},i.M=t=>{if(!l.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);l.set(t,s)}else{var o,a=null==(o=t.entries.find(t=>t.targetSelector))?void 0:o.targetSelector;a&&l.set(t,a)}}};var v=(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};jm(["long-animation-frame"],t=>{r=r.concat(t),h()},e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Nm();Wm(()=>{var r;"interactionCount"in performance||Em||(Em=jm(["event"],ey,{durationThreshold:0}));var n,o=qm("INP"),a=Tm(e,ry),l=(i,r,s,l,u)=>{a.D(),o=qm("INP",-1,i,r,s,l,u),n=Am(t,o,sy,e.reportAllChanges)},u=()=>{var t=a.S(o.navigationType);t&&t.k!==o.value&&(o.value=t.k,o.entries=t.entries,n())},h=t=>{u(),n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),ny(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.l(i):h(i);u(),e&&n(!0)})},v=["event","first-input"];Bm(e)&&v.push("soft-navigation");var c=jm(v,d,s({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=Am(t,o,sy,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),Rm(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Im())}))})}}(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=Math.max(n.processingStart,r.startTime),o=Math.max(r.startTime+r.duration,s),u=Math.min(n.processingEnd,o),h=n.entries.sort((t,e)=>t.processingStart-e.processingStart),d=v(r.startTime,u),c=i.p.get(r.interactionId),f={interactionTarget:l.get(c),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:o,processedEventEntries:h,longAnimationFrameEntries:d,inputDelay:s-r.startTime,processingDuration:u-s,presentationDelay:o-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,o=t.inputDelay,a=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+o>c.startTime?"input-delay":i+o+a>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+o+a&&(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)},ay=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}},$=[2500,4e3],ly=50,uy=[];jm(["resource"],t=>{for(var e of t)uy.push(e),uy.length>ly&&uy.shift()});var hy=function(t,e){void 0===e&&(e={}),null!=(e=Object.assign({},e)).resourceBufferSize&&(ly=e.resourceBufferSize);var i=Tm(e,ay),r=new WeakMap;Bm(e)&&(i.u=new Map),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: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=Bm(e);Wm(()=>{var n,s=Nm(),o=qm("LCP"),a=Tm(e,ay),l=(r,a,l,u,h)=>{o=qm("LCP",-1,r,a,l,u,h),n=Am(t,o,$,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Nm(!0))},u=t=>{a.u&&t.navigationId&&Um(a.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-Om(),0),a.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=jm(d,h);if(v){n=Am(t,o,$,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;ny(()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}})}};for(var p of c)addEventListener(p,f,{capture:!0});Rm(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,Im()),n=Am(t,o,$,e.reportAllChanges),Pm(()=>{o.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,o,a,l,u,h,d=t.entries.at(-1),v=d.url&&(uy.findLast(t=>t.name===d.url)||performance.getEntriesByType("resource").findLast(t=>t.name===d.url));e.target=r.get(d),e.lcpEntry=d,d.url&&(e.url=d.url),v&&(e.lcpResourceEntry=v);var c=0,f=0;if("soft-navigation"!==t.navigationType?(c=null!==(n=null==(o=h=wm())?void 0:o.activationStart)&&void 0!==n?n:0,f=null!==(a=null==(l=h)?void 0:l.responseStart)&&void 0!==a?a:0):(c=t.navigationStartTime||0,h=null==(u=i.u)?void 0:u.get(t.navigationId)),h){var p=Math.max(0,f-c),g=Math.max(p,v?(v.requestStart||v.startTime)-c:0),m=Math.min(t.value,Math.max(g,v?v.responseEnd-c:0));e=s({},e,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:h})}}return Object.assign(t,{attribution:e})})(e))},e)},dy=-1,vy=()=>dy,cy=t=>{addEventListener("pageshow",e=>{e.persisted&&(dy=e.timeStamp,t(e))},!0)},fy=(t,e,i,r)=>{var n,s;return o=>{e.value>=0&&(o||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))}},py=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},gy=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},my=()=>{var t,e;return null!==(t=null==(e=gy())?void 0:e.activationStart)&&void 0!==t?t:0},yy=-1,_y=new Set,by=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,wy=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of _y)e();isFinite(yy)||(yy="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",wy,!0))}},ky=function(t){if(void 0===t&&(t=!1),t&&(yy=1/0),0>yy){var e,i,r=my();yy=null!==(e=document.prerendering||null==(i=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=r))?void 0:i.startTime)&&void 0!==e?e:by(),addEventListener("visibilitychange",wy,!0),addEventListener("prerenderingchange",wy,!0),cy(()=>{setTimeout(()=>{yy=by()})})}return{get firstHiddenTime(){return yy},onHidden(t){_y.add(t)}}},Sy=function(t,e,i,r,n,s,o){void 0===e&&(e=-1),void 0===r&&(r=0);var a=gy(),l=(null==a?void 0:a.navigationId)||0,u="navigate";return i?u=i:0>vy()?a&&(document.prerendering||my()>0?u="prerender":document.wasDiscarded?u="restore":a.type&&(u=a.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==a?void 0:a.name),navigationStartTime:o||0}},xy=new WeakMap;function Cy(t,e){var i=xy.get(e);return i||xy.set(e,i=new WeakMap),i.get(t)||i.set(t,new e),i.get(t)}var Ty,Ey=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)}}},My=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 o of r)n.observe(s({type:o,buffered:!0},i));return n}}catch(t){}},Iy=t=>{var e,i;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(i=globalThis.PerformanceSoftNavigation)||null==(i=i.prototype)?void 0:i.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Ry=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Ay=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Py=class{constructor(){this.l=void 0}},Oy=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Fy=[1800,3e3],$y=function(t,e){void 0===e&&(e={});var i=Iy(e);Oy(()=>{var r,n=Cy(e,Py),s=ky(),o=Sy("FCP"),a=My(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(a.disconnect(),s.firstHiddenTime>e.startTime&&(o.value=Math.max(e.startTime-my(),0),o.entries.push(e),o.navigationId=e.navigationId||o.navigationId,r(!0)))});a&&(r=fy(t,o,Fy,e.reportAllChanges),cy(i=>{o=Sy("FCP",-1,"back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,vy()),r=fy(t,o,Fy,e.reportAllChanges),py(()=>{o.value=performance.now()-i.timeStamp,r(!0)})})),i&&My(["soft-navigation"],i=>{i.forEach(i=>{n.l&&i.navigationId&&Ry(n.l,i),o=Sy("FCP",Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0),"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=fy(t,o,Fy,e.reportAllChanges))(!0)})},e)})},Dy=[.1,.25],Ly=function(t,e){void 0===e&&(e={});var i=ky();$y(Ay(()=>{var r,n=Sy("CLS",0),s=Cy(e,Ey),o=(i,o,a,l,u)=>{n=Sy("CLS",0,i,o,a,l,u),s.i=0,r=fy(t,n,Dy,e.reportAllChanges)},a=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{a(!0),o("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);a()},h=["layout-shift"];Iy(e)&&h.push("soft-navigation");var d=My(h,u);d&&(r=fy(t,n,Dy,e.reportAllChanges),i.onHidden(()=>{u(d.takeRecords()),r(!0)}),cy(()=>{o("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,vy()),py(r)}),setTimeout(r))}))},Ny=0,qy=1/0,jy=0,By=t=>{for(var e of t)e.interactionId&&(qy=Math.min(qy,e.interactionId),jy=Math.max(jy,e.interactionId),Ny=jy?(jy-qy)/7+1:0)},Uy=()=>{var t;return Ty?Ny:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Hy=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return Uy()-this.u}M(){this.u=Uy(),this.v.length=0,this.m.clear()}L(t){var e=this._(),i=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[i]:{P:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId){var i=this.v.at(-1),r=this.m.get(t.interactionId);if(r||10>this.v.length||t.duration>i.P){var n;if(r?t.duration>r.P?(r.entries=[t],r.P=t.duration):t.duration===r.P&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.m.set((r={id:t.interactionId,entries:[t],P:t.duration}).id,r),this.v.push(r)),this.v.sort((t,e)=>e.P-t.P),this.v.length>10)for(var s of this.v.splice(10))this.m.delete(s.id);null==(n=this.T)||n.call(this,r)}}}},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=Ay(t),s=-1,o=()=>{r(s),n()};addEventListener("visibilitychange",o,{once:!0,capture:!0}),s=i(()=>{removeEventListener("visibilitychange",o,{capture:!0}),n()},{timeout:e})}},Wy=[200,500],Vy=function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=ky();Oy(()=>{var r;"interactionCount"in performance||Ty||(Ty=My(["event"],By,{durationThreshold:0}));var n,o=Sy("INP"),a=Cy(e,Hy),l=(i,r,s,l,u)=>{a.M(),o=Sy("INP",-1,i,r,s,l,u),n=fy(t,o,Wy,e.reportAllChanges)},u=()=>{var t=a.L(o.navigationType);t&&t.P!==o.value&&(o.value=t.P,o.entries=t.entries,n())},h=t=>{u(),n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),zy(()=>{for(var i of t)"soft-navigation"!==i.entryType?a.h(i):h(i);u(),e&&n(!0)})},v=["event","first-input"];Iy(e)&&v.push("soft-navigation");var c=My(v,d,s({},e,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40}));n=fy(t,o,Wy,e.reportAllChanges),c&&(i.onHidden(()=>{d(c.takeRecords(),!0)}),cy(()=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,vy())}))})}},Gy=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}},Zy=[2500,4e3],Qy=function(t,e){void 0===e&&(e={});var i=!1,r=Iy(e);Oy(()=>{var n,s=ky(),o=Sy("LCP"),a=Cy(e,Gy),l=(r,a,l,u,h)=>{o=Sy("LCP",-1,r,a,l,u,h),n=fy(t,o,Zy,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=ky(!0))},u=t=>{a.l&&t.navigationId&&Ry(a.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-my(),0),a.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!o.navigationId)continue;if("interactionId"in c&&c.interactionId!=o.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(a.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(o.value=l,o.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=My(d,h);if(v){n=fy(t,o,Zy,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=o.id;zy(()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===o.id&&(i=!0,n(!0))}})}};for(var p of c)addEventListener(p,f,{capture:!0});cy(r=>{l("back-forward-cache",o.navigationId,o.navigationInteractionId,o.navigationURL,vy()),n=fy(t,o,Zy,e.reportAllChanges),py(()=>{o.value=performance.now()-r.timeStamp,i=!0,n(!0)})})}})},Jy={onLCP:hy,onCLS:Jm,onFCP:Km,onINP:oy,withoutAttribution:{onLCP:Qy,onCLS:Ly,onFCP:$y,onINP:Vy}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Jy,b.__PosthogExtensions__.postHogWebVitalsCallbacks=Jy,b.postHogWebVitalsCallbacks=Jy;var Ky={onLCP:Qy,onCLS:Ly,onFCP:$y,onINP:Vy};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=Ky,b.__PosthogExtensions__.postHogWebVitalsCallbacks=Ky,b.postHogWebVitalsCallbacks=Ky,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Ky;var Yy={onLCP:hy,onCLS:Jm,onFCP:Km,onINP:oy,withoutAttribution:{onLCP:Qy,onCLS:Ly,onFCP:$y,onINP:Vy}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=Yy,b.__PosthogExtensions__.postHogWebVitalsCallbacks=Yy,b.postHogWebVitalsCallbacks=Yy;var Xy={onLCP:Qy,onCLS:Ly,onFCP:$y,onINP:Vy};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},b.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=Xy,b.__PosthogExtensions__.postHogWebVitalsCallbacks=Xy,b.postHogWebVitalsCallbacks=Xy,b.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Xy;var t_=class{constructor(t){this.disabled=!1===t;var e=Ee(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}},e_="$copy_autocapture",i_=On("[AutoCapture]");function r_(t,e){return e.length>t?e.slice(0,t)+"...":e}function n_(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!ns(e));return e}function s_(t,e){var i,r,n=e.e,o=e.maskAllElementAttributes,a=e.maskAllText,u=e.elementAttributeIgnoreList,h=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!ns(t))return{props:{}};for(var v=[t],c=new Set([t]),f=t;f.parentNode&&!ss(f,"body")&&1e3>v.length;)if(as(f.parentNode)){var p=f.parentNode.host;if(c.has(p))break;c.add(p),v.push(p),f=p}else{if(!ns(f.parentNode))break;if(c.has(f.parentNode))break;c.add(f.parentNode),v.push(f.parentNode),f=f.parentNode}var g="click"===n.type&&"http://www.w3.org/2000/svg"===t.namespaceURI?v.findIndex(t=>ss(t,"button")||ss(t,"a")):-1;g>0&&(a=a||v.slice(0,g+1).some(t=>!Ms(t)||Is(t)));var m,y,_,b=[],w={},k=!1,S=!1;if($n(v,t=>{var e=Ms(t);if(ss(t,"a")){var i=t.getAttribute("href");k=!!(e&&i&&Ls(i))&&(d?lr(i):i)}ve(hs(t),"ph-no-capture")&&(S=!0),b.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),o={tag_name:s};fs.indexOf(s)>-1&&!i&&(o.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?r_(1024,Ns(t)):r_(1024,vs(t)));var a=hs(t);a.length>0&&(o.classes=a.filter(function(t){return""!==t})),$n(t.attributes,function(i){var s;if((!Is(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Ls(i.value)&&(!Re(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=i.value;"class"===i.name&&(a=ls(a).join(" ")),o["attr__"+i.name]=r_(1024,"href"===i.name&&n?lr(a):a)}});for(var l=1,u=1,h=t;h=n_(h);)l++,h.tagName===t.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(t,o,a,u,d)),$n(function(t){if(!Ms(t))return{};var e={};return $n(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&&Ls(r)&&(e[i]=r)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(w,e)||(w[e]=t)})}),S)return{props:{},explicitNoCapture:S};if(g>0&&(t=v[g],b.splice(0,g)),a||(b[0].$el_text=ss(t,"a")||ss(t,"button")?Ns(t):vs(t)),k){var x,C;b[0].attr__href=k;var T=null==(x=Zn(k))?void 0:x.host,E=null==l||null==(C=l.location)?void 0:C.host;T&&E&&T!==E&&(m=k)}return{props:Dn((y=n.type,{$event_type:y,$ce_version:1}),h?{}:{$elements:b},{$elements_chain:(_=b,Ce(_)?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 o=s({},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 Ln(o).sort((t,e)=>function(t,e){return e>t?-1:t>e?1:0}(t[0],e[0])).forEach(t=>{var e=t[1];return a[js(t[0].toString())]=js(e.toString())}),(r+=":")+Ln(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:Bs(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Ln(t).filter(t=>0===t[0].indexOf("attr__")).forEach(t=>r.attributes[t[0]]=t[1]),r})}(_)):"")},null!=(i=b[0])&&i.$el_text?{$el_text:null==(r=b[0])?void 0:r.$el_text}:{},m&&"click"===n.type?{$external_click_url:m}:{},w),target:t}}var o_=class{zs(){this.Us=void 0,clearTimeout(this.Ws),this.Ws=void 0}Vs(t){var e;if(!Ms(t))return!0;for(var i,r=null!==(e=this.Gs().css_selector_ignorelist)&&void 0!==e?e:ys,n=new Set,s=t,o=function(){if(n.size>=1e3||n.has(s))return{v:!0};n.add(s);var t=s,e=hs(t);if(ve(e,"ph-no-capture")||ve(e,"ph-sensitive")||Is(t)||r.some(e=>ps(t,e)))return{v:!0};var i=s.parentNode;s=as(i)?i.host:i&&ns(i)?i:null};s;)if(i=o())return i.v;return!1}Zs(t){if(this.isEnabled&&"pointercancel"!==t.type)if("pointerdown"!==t.type){var e=this.Us;e&&(t.pointerId!==e.id||Math.abs(t.clientX-e.x)>5||Math.abs(t.clientY-e.y)>5?this.zs():"pointerup"===t.type&&(e.released=!0,this.Ws=setTimeout(()=>this.zs(),0)))}else{var i;this.zs();var r=cs(t);t.isPrimary&&0===t.button&&!t.ctrlKey&&r&&ns(r)&&(this.Us={target:r,excluded:this.Vs(r),id:t.pointerId,x:t.clientX,y:t.clientY,released:!1,distinctId:null==(i=this.Js)?void 0:i.distinctId})}else this.zs()}Qs(t){var e,i=this.Us;this.zs();var r=cs(t);if(null!=i&&i.released&&i.target.isConnected&&i.distinctId===(null==(e=this.Js)?void 0:e.distinctId)&&t.pointerId===i.id&&(t.detail>0||"touch"===t.pointerType||"pen"===t.pointerType)&&0===t.button&&5>=Math.abs(t.clientX-i.x)&&5>=Math.abs(t.clientY-i.y)&&r&&(ss(r,"html")||ss(r,"body"))){var n;if(i.excluded)return null;var s=null!==(n=this.Gs().css_selector_ignorelist)&&void 0!==n?n:ys;return[r,null==d?void 0:d.documentElement,null==d?void 0:d.body].some(t=>{if(!t)return!1;var e=hs(t);return ve(e,"ph-no-capture")||ve(e,"ph-sensitive")||!Ms(t)||Is(t)||s.some(e=>ps(t,e))})?null:i.target}}constructor(t){this.Ks=t,this.name="autocapture",this.Xs=!1,this.Ys=null,this.eo=!1,this.io=!1,this.Rn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.ro=!1,this.Ks.refresh(this.Rn),this.rageclicks=new t_(this.Rn.rageclick),this.no=null}setup(t){this.so(),this.Js=t;var e=t.onRemoteConfig(this.onRemoteConfig.bind(this));this.ro?e.dispose():(this.oo=e,this.startIfEnabled())}dispose(){var t;this.ro||(this.ro=!0,this.Js=void 0,null==(t=this.oo)||t.dispose(),this.oo=void 0,this.ao())}Gs(){return this.Ks.refresh(this.Rn),this.Rn}so(){var t,e;return this.Gs(),this.Rn.url_allowlist=null==(t=this.Rn.url_allowlist)?void 0:t.map(t=>new RegExp(t)),this.Rn.url_ignorelist=null==(e=this.Rn.url_ignorelist)?void 0:e.map(t=>new RegExp(t)),this.Rn}lo(){if(this.isBrowserSupported()){if(l&&d){var t=this.uo=t=>{t=t||(null==l?void 0:l.event);try{if("blur"===t.type)return void this.zs();if(0===t.type.indexOf("pointer"))return void this.Zs(t);var e="click"===t.type?this.Qs(t):void 0;if(Pe(e))return;this.ho(t,"$autocapture",e)}catch(t){i_.error("Failed to capture event",t)}};if(zn(l,"blur",t),zn(d,"submit",t,{capture:!0}),zn(d,"change",t,{capture:!0}),zn(d,"click",t,{capture:!0}),$n(["pointerdown","pointermove","pointerup","pointercancel"],e=>{zn(d,e,t,{capture:!0})}),this.Gs().capture_copied_text){var e=this.do=t=>{t=t||(null==l?void 0:l.event);try{this.ho(t,e_)}catch(t){i_.error("Failed to capture clipboard event",t)}};zn(d,"copy",e,{capture:!0}),zn(d,"cut",e,{capture:!0}),zn(d,"paste",e,{capture:!0})}}}else i_.info("Disabling Automatic Event Collection because this browser is not supported")}ao(){this.zs(),this.uo&&(null==l||l.removeEventListener("blur",this.uo),$n(["pointerdown","pointermove","pointerup","pointercancel"],t=>{null==d||d.removeEventListener(t,this.uo,!0)}),null==d||d.removeEventListener("submit",this.uo,!0),null==d||d.removeEventListener("change",this.uo,!0),null==d||d.removeEventListener("click",this.uo,!0),this.uo=void 0),this.do&&(null==d||d.removeEventListener("copy",this.do,!0),null==d||d.removeEventListener("cut",this.do,!0),null==d||d.removeEventListener("paste",this.do,!0),this.do=void 0),this.Xs=!1}startIfEnabled(){this.isEnabled||this.zs(),!this.ro&&this.Js&&this.isEnabled&&!this.Xs&&(this.lo(),this.Xs=!0)}onRemoteConfig(t){if(!this.ro)if(this.eo=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.io=e.elementsChainAsString);var i,r=e.autocapture_opt_out;De(r)&&(null==(i=this.Js)||i.kv.set(R,r),this.Ys=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.no=t}getElementSelectors(t,e){var i,r=[];return null==(i=this.no)||i.forEach(i=>{var n;null==d||null==(n=d.querySelectorAll(i))||n.forEach(n=>{t!==n&&e!==n||ve(r,i)||r.push(i)})}),r}get isEnabled(){var t,e;if(this.ro)return!1;var i=null==(t=this.Js)?void 0:t.kv.get(R),r=this.Ys,n=this.Gs();if(!n.remoteRequestsDisabled&&!this.eo)return!1;var s=n.remoteRequestsDisabled&&!this.eo;if(Pe(r)&&!De(i)&&!s)return!1;var o=null!==(e=this.Ys)&&void 0!==e?e:!!i;return!!n.enabled&&!o}ho(t,e,i){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r=i||cs(t);os(r)&&(r=r.parentNode||null);var n,o=this.so();"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&o.rageclick&&null!=(n=this.rageclicks)&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&Cs(r,o.rageclick)&&this.ho(t,"$rageclick",i);var a=e===e_,u=a?s({},o,{dom_event_allowlist:void 0}):o;if(r&&function(t,e,i,r,n,s){var o;if(!l||Ts(t))return!1;if(null!=i&&i.url_allowlist&&!us(i.url_allowlist,s))return!1;if(null!=i&&i.url_ignorelist&&us(i.url_ignorelist,s))return!1;if(null!=i&&i.dom_event_allowlist){var a=i.dom_event_allowlist;if(a&&!a.some(t=>e.type===t))return!1}var u=Es(t,r),h=u.parentIsUsefulElement,d=u.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(Ie(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,i))return!1;if(!gs(d,null==i?void 0:i.css_selector_allowlist))return!1;if(gs(d,null!==(o=null==i?void 0:i.css_selector_ignorelist)&&void 0!==o?o:ys))return!1;try{var v=l.getComputedStyle(t);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===e.type)return!0}catch(t){}var c=t.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return h?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(fs.indexOf(c)>-1||"true"===t.getAttribute("contenteditable"))}}(r,t,u,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:o.getCurrentUrl}})){var h,d=s_(r,{e:t,maskAllElementAttributes:o.maskAllElementAttributes,maskAllText:o.maskAllText,elementAttributeIgnoreList:o.element_attribute_ignorelist,elementsChainAsString:this.io,disableCaptureUrlHashes:o.disableCaptureUrlHashes}),v=d.props;if(d.explicitNoCapture)return!1;var c=this.getElementSelectors(r,d.target);if(c&&c.length>0&&(v.$element_selectors=c),e===e_){var f=t.type||"clipboard";if("paste"!==f){var p,g,m=null==l||null==(p=l.getSelection())?void 0:p.toString(),y=ds(m);if(!y)return!1;v.$selected_content=y,v.$clipboard_text_length=null!==(g=null==m?void 0:m.length)&&void 0!==g?g:0}v.$copy_type=f}return null==(h=this.Js)||h.capture(e,v).catch(t=>i_.error("Failed to capture event",t)),!0}}else this.zs()}isBrowserSupported(){return Te(null==d?void 0:d.querySelectorAll)}},a_={};function l_(t,e){var i=cs(t);return i?s({node:i,originalEvent:t,timestamp:Date.now()},e):null}function u_(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function h_(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var d_="canvas,video,audio,embed,object";function v_(t,e){return Fe(t)&&t>=e}function c_(t){return t>=0&&1e3>t?t:void 0}function f_(t,e){return e?c_(t-e):void 0}var p_=class{un(t){var e,i,r,n,s,o,a,l,u=this.ln((null==t?void 0:t.__onCapture)||this.hn.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!==(o=null==t?void 0:t.capture_dead_swipes)&&void 0!==o?o:u.capture_dead_swipes,swipe_threshold_px:null!==(a=null==t?void 0:t.swipe_threshold_px)&&void 0!==a?a: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.instance=t,this.cn=[],this.dn=0,this.ln=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.vn=t=>{var e=l_(t,{type:"click"});Pe(e)||this.fn(e)||this.pn(e),this.gn()},this.mn=()=>{var t=Date.now();this.yn=t,t%50==0&&this.cn.forEach(e=>{Ie(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.bn=()=>{this.wn=Date.now()},this.ar=()=>{var t=Date.now();this.kn=t,this._n("visibilityChangedDelayMs",t)},this.Sn=()=>{var t=Date.now();this.xn=t,this._n("focusChangedDelayMs",t)},this.Cn=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.Mn=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.Tn=()=>{this.Mn=void 0},this.In=t=>{var e,i=this.Mn;if(this.Mn=void 0,!Ie(i)&&this.Rn.max_dead_swipes_per_page_load>this.dn){var r=t,n=null==(e=r.changedTouches)?void 0:e[0];if(n){var s=n.clientX-i.x,o=n.clientY-i.y,a=s*s+o*o,l=this.Rn.swipe_threshold_px;if(a>=l*l&&![this.yn,this.An,this.wn].some(t=>Fe(t)&&t>=i.timestamp)){var u;if(this.En()&&(null!==(u=null==d||null==d.elementsFromPoint?void 0:d.elementsFromPoint(i.x,i.y))&&void 0!==u?u:[]).some(t=>null==t.matches?void 0:t.matches(d_)))return;var h=l_(r,{type:"swipe",swipeDirection:u_(s,o),swipeDistancePx:Math.round(Math.sqrt(a))});Pe(h)||this.fn(h)||this.pn(h),this.gn()}}}},this.Rn=this.un(e),this._onCapture=this.Rn.__onCapture}start(t){this.On(),this.Ln(),this.Dn(),this.Pn(),this.Nn(),this.Fn(t),this.Rn.capture_dead_swipes&&this.qn()}Fn(t){if(!this.jn){var e=function(t){return function(t,e){var i=a_[t];if(i)return i;var r=e[t];if((t=>Te(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&(null==l||!l.Zone))return a_[t]=r.bind(e);var n=e.document;if(n&&Te(n.createElement)){var s,o=!1;try{(s=n.createElement("iframe")).hidden=!0,n.head.appendChild(s);var a,u,h=s.contentWindow;h&&h[t]&&(r=h[t],"MutationObserver"===t&&function(t){return ve(t,"AppleWebKit")&&!ve(t,"Chrome")}(null!==(a=null==(u=e.navigator)?void 0:u.userAgent)&&void 0!==a?a:"")&&(s.classList.add("rr-block","ph-no-capture"),o=!0))}catch(e){Pn.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var d;!o&&null!=(d=s)&&d.parentNode&&s.parentNode.removeChild(s)}}return r&&Te(r)?a_[t]=r.bind(e):r}("MutationObserver",t)}(b);this.jn=new e(t=>{this.Bn(t)}),this.jn.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.jn)||t.disconnect(),this.jn=void 0,b.removeEventListener("click",this.vn),b.removeEventListener("scroll",this.mn,{capture:!0}),b.removeEventListener("selectionchange",this.bn),b.removeEventListener("touchstart",this.Cn,{capture:!0}),b.removeEventListener("touchend",this.In,{capture:!0}),b.removeEventListener("touchcancel",this.Tn,{capture:!0}),null==d||d.removeEventListener("visibilitychange",this.ar),b.removeEventListener("blur",this.Sn),b.removeEventListener("focus",this.Sn),this.Mn=void 0}Bn(t){this.An=Date.now()}On(){zn(b,"click",this.vn)}pn(t){t.visibilityChangedDelayMs=f_(t.timestamp,this.kn),t.focusChangedDelayMs=f_(t.timestamp,this.xn),this.cn.push(t)}gn(){this.cn.length&&Ie(this.Hn)&&(this.Hn=b.setTimeout(()=>{this.$n()},1e3))}Ln(){zn(b,"scroll",this.mn,{capture:!0})}Dn(){zn(b,"selectionchange",this.bn)}Pn(){zn(d,"visibilitychange",this.ar)}Nn(){zn(b,"blur",this.Sn),zn(b,"focus",this.Sn)}_n(t,e){this.cn.forEach(i=>{var r=c_(e-i.timestamp);Fe(r)&&(Ie(i[t])||i[t]>r)&&(i[t]=r)})}qn(){zn(b,"touchstart",this.Cn,{capture:!0,passive:!0}),zn(b,"touchend",this.In,{capture:!0,passive:!0}),zn(b,"touchcancel",this.Tn,{capture:!0,passive:!0})}En(){var t=Ie(this.zn)||Fe(this.An)&&this.An>this.zn;return(Ie(this.Un)||t)&&(this.zn=Date.now(),this.Un=!(null==d||!d.querySelector(d_))),!!this.Un}fn(t){return!t||("swipe"===t.type?this.Wn(t):this.Vn(t))}Wn(t){return!(!rs(t.node)&&!this.cn.some(e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp))&&!ss(t.node,"html")&&ns(t.node)&&function(t,e){var i;if(!l||Ts(t))return!1;var r=De(e)?ks:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:ks;return!gs(Es(t,!1).targetElementList,r)}(t.node,{css_selector_ignorelist:this.Rn.css_selector_ignorelist}))}Vn(t){return!(this.Rn.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.Wn(t)||(i=t.node,!(!l||Ts(i))&&Es(i,!1).targetElementList.some(t=>ss(t,"a")));var e,i}$n(){if(this.cn.length){clearTimeout(this.Hn),this.Hn=void 0;var t=this.cn;for(var e of(this.cn=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.An&&this.An>=e.timestamp?this.An-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.wn&&this.wn>=e.timestamp?this.wn-e.timestamp:void 0;var r=v_(e.scrollDelayMs,this.Rn.scroll_threshold_ms),n=v_(e.selectionChangedDelayMs,this.Rn.selection_change_threshold_ms),s=v_(e.mutationDelayMs,this.Rn.mutation_threshold_ms),o=v_(e.absoluteDelayMs,1.1*this.Rn.mutation_threshold_ms),a=Fe(e.scrollDelayMs)&&this.Rn.scroll_threshold_ms>e.scrollDelayMs,l=Fe(e.mutationDelayMs)&&this.Rn.mutation_threshold_ms>e.mutationDelayMs,u=Fe(e.selectionChangedDelayMs)&&this.Rn.selection_change_threshold_ms>e.selectionChangedDelayMs,h=Fe(e.visibilityChangedDelayMs),d=Fe(e.focusChangedDelayMs);if(!(a||l||u||h||d))if(r||s||o||n){var v=h_(e);if("$dead_swipe"===v){if(this.dn>=this.Rn.max_dead_swipes_per_page_load)continue;this.dn++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.An,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:o,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:!1})}else this.Rn.mutation_threshold_ms>e.absoluteDelayMs&&this.cn.push(e)}this.gn()}}hn(t,e){var i=h_(t);this.instance.capture(i,s({},e,s_(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Rn.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)})}};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new p_(t,e);var g_=On("[ExternalScriptsLoader]"),m_=t=>{var e=null==d?void 0:d.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]},y_=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return g_.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=m_(e);if(r){if(r.__posthog_loading_callback_fired)return i();var n=r.__posthog_loading_error;return n?i(n):(r.addEventListener("load",t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)}),void r.addEventListener("error",t=>{r.__posthog_loading_error=t,i(t)}))}var s=()=>{if(!d)return i("document not found");if(m_(e))return y_(t,e,i);var r=d.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=e,r.onload=t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)},r.onerror=t=>{r.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(r=t.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)d.head.appendChild(r);else{var n,s=d.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(r,s[0]):d.body.appendChild(r)}};null!=d&&d.body?s():null==d||d.addEventListener("DOMContentLoaded",s)},__={},b_=(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)};b.__PosthogExtensions__=b.__PosthogExtensions__||{},b.__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(m_(s))return void y_(t,s,i);delete __[n]}y_(t,n,"fallback"===r?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var o,a=b_(t,e);__[n]=a;var l=m_(n);null==l||null==(o=l.parentNode)||o.removeChild(l),y_(t,a,i)}else i(void 0,s)}:i)}else y_(t,b_(t,e),i)}else y_(t,t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js"),i)},b.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{y_(t,t.requestRouter.endpointFor("api",e),i)};var w_=class{constructor(t){this._instance=t}get Rn(){return this._instance.config}get consent(){return this.vo()?0:this.co}isOptedOut(){return"always"===this.Rn.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.Rn.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Rn.opt_out_capturing_by_default}optInOut(t){this.fo.Ot(this.po,t?1:0,this.Rn.cookie_expiration,this.Rn.cross_subdomain_cookie,this.Rn.secure_cookie)}reset(){this.fo.Dt(this.po,this.Rn.cross_subdomain_cookie)}get po(){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 co(){var t=this.fo.Lt(this.po);return Ve(t)?1:ve(Ge,t)?0:-1}get fo(){var t=this.Rn.opt_out_capturing_persistence_type,e="localStorage"===t?Sa:wa,i=e.Et()?e:$a;if(!this.mo||this.mo!==i){this.mo=i;var r="localStorage"===t?wa:Sa;r.Lt(this.po)&&(this.mo.Lt(this.po)||this.optInOut(Ve(r.Lt(this.po))),r.Dt(this.po,this.Rn.cross_subdomain_cookie))}return this.mo}vo(){return!!this.Rn.respect_dnt&&[null==h?void 0:h.doNotTrack,null==h?void 0:h.msDoNotTrack,b.doNotTrack,null==h?void 0:h.globalPrivacyControl].some(t=>Ve(t))}},k_=On("[Dead Clicks]"),S_=()=>!0,x_=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(L)),r=t.instance.config.capture_dead_clicks;return De(r)?r:!!Ee(r)||i},C_=class{get lazyLoadedDeadClicksAutocapture(){return this.yo}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({[L]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.bo(()=>{this._o()}):this.stop()}bo(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",e=>{e?k_.error("failed to load script",e):t()})}_o(){var t;if(d){if(!this.yo&&null!=(t=b.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Ee(this.instance.config.capture_dead_clicks)?s({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.yo=b.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.yo.start(d),k_.info("starting...")}}else k_.error("`document` not found. Cannot start.")}stop(){this.yo&&(this.yo.stop(),this.yo=void 0,k_.info("stopping..."))}},T_=On("[SegmentIntegration]");function E_(t,e,i){void 0===i&&(i=!0);var r=t.config.segment;if(!r)return e();!function(t,e,i){var r=t.config.segment;if(!r)return e();var n=r=>{var n=()=>r.anonymousId()||ga();t.config.get_device_id=n,i&&r.id()&&(t.register({distinct_id:r.id(),$device_id:n()}),t.persistence.set_property(Pt,ie)),e(i?void 0:r.anonymousId()||void 0)},s=r.user();"then"in s&&Te(s.then)?s.then(n):n(s)}(t,i=>{r.register(((t,e)=>{"undefined"!=typeof Promise&&Promise.resolve||T_.warn("This browser does not have Promise support, and can not use the segment integration");var i=(i,r)=>{if(!r)return i;var n=!!e&&i.event.anonymousId===e&&!i.event.userId;n||i.event.userId||i.event.anonymousId===t.get_distinct_id()||(T_.info("No userId set, resetting PostHog"),t.reset()),n||(e=void 0),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(T_.info("UserId set, identifying with PostHog"),t.identify(i.event.userId));var s=t.calculateEventProperties(r,i.event.properties);return i.event.properties=Object.assign({},s,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return i(t,t.event.event)},page(t){return i(t,oe)},identify(t){return i(t,le)},screen(t){return i(t,"$screen")}}})(t,i)).then(()=>{e()},t=>{T_.error("Failed to register the Segment integration",t),e()})},i)}var M_="posthog-js";function I_(t,e){var i=void 0===e?{}:e,r=i.organization,n=i.projectId,o=i.prefix,a=i.severityAllowList,l=void 0===a?["error"]:a,u=i.sendExceptionsToPostHog,h=void 0===u||u;return e=>{var i,a,u,d,v,c;if("*"!==l&&!l.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var f=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=f,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var p=(null==(i=e.exception)?void 0:i.values)||[],g=p.map(t=>s({},t,{stacktrace:t.stacktrace?s({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map(t=>s({},t,{platform:"web:javascript"}))}):void 0})),m={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(v=p[0])?void 0:v.type,$sentry_tags:e.tags};return r&&n&&(m.$sentry_url=(o||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+e.event_id),h&&(null==(c=t.exceptions)||c.sendExceptionEvent(m)),e}}var R_=class{constructor(t,e,i,r,n,s){this.name=M_,this.setupOnce=function(o){o(I_(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}},A_=class{constructor(t){this.wo=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Pn.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.ko=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.So()}So(){var t;this.xo=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.wo)}destroy(){var t;null==(t=this.xo)||t.call(this),this.xo=void 0}doPageView(t,e){var i,r=this.Co(t,e);return this.ko={pathname:null!==(i=null==l?void 0:l.location.pathname)&&void 0!==i?i:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.Co(t,null==(e=this.ko)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ko)?void 0:t.pageViewId}}Co(t,e){var i=this.ko;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,o=n.lastScrollY,a=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(Ie(s)||Ie(o)||Ie(a)||Ie(l)||Ie(u)||Ie(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?Ze(o/s,0,1,Pn):1,v=s>1?Ze(a/s,0,1,Pn):1,c=l>1?Ze(u/l,0,1,Pn):1,f=l>1?Ze(h/l,0,1,Pn):1;r=Dn(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$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}},P_=["flags","surveys"],O_={[w]:{exposure:"hidden"},[C]:{exposure:"hidden"},[T]:{exposure:"hidden"},[I]:{exposure:"hidden"},[M]:{exposure:"hidden"},[R]:{exposure:"event"},[A]:{exposure:"hidden"},[q]:{exposure:"hidden"},[P]:{exposure:"event"},[O]:{exposure:"hidden"},[F]:{exposure:"event"},[D]:{exposure:"event"},[L]:{exposure:"event"},[N]:{exposure:"hidden"},[j]:{exposure:"event"},[B]:{exposure:"hidden"},[U]:{exposure:"hidden"},[Z]:{exposure:"hidden"},[Q]:{exposure:"event"},[H]:{exposure:"event",shouldSkipFromEventProperties:t=>Pe(t)},[J]:{exposure:"event"},[K]:{exposure:"event"},[Y]:{exposure:"event"},[it]:{exposure:"event"},[rt]:{exposure:"hidden"},[nt]:{exposure:"hidden",storageGroup:"flags"},[st]:{exposure:"hidden",storageGroup:"flags"},[ot]:{exposure:"hidden"},[at]:{exposure:"hidden",storageGroup:"flags"},[lt]:{exposure:"hidden",storageGroup:"flags"},[ut]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ht]:{exposure:"hidden",storageGroup:"flags"},[dt]:{exposure:"hidden"},[vt]:{exposure:"hidden"},[ct]:{exposure:"hidden"},[ft]:{exposure:"hidden"},[gt]:{exposure:"hidden",storageGroup:"surveys"},[mt]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[yt]:{exposure:"event"},[_t]:{exposure:"hidden"},[bt]:{exposure:"hidden"},[wt]:{exposure:"hidden"},[kt]:{exposure:"hidden"},[St]:{exposure:"hidden"},[xt]:{exposure:"event"},[Ct]:{exposure:"event"},[Tt]:{exposure:"event"},[Et]:{exposure:"event"},[Mt]:{exposure:"hidden"},[It]:{exposure:"hidden"},[pt]:{exposure:"event"},[Rt]:{exposure:"hidden"},[At]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Pt]:{exposure:"hidden"},[Ot]:{exposure:"hidden"},[Ft]:{exposure:"hidden"},[$t]:{exposure:"hidden"},[Dt]:{exposure:"hidden"},[Lt]:{exposure:"hidden"},[Nt]:{exposure:"hidden"},[z]:{exposure:"event"},[W]:{exposure:"event"},[V]:{exposure:"event"},[G]:{exposure:"event"},[Bt]:{exposure:"event"},[Ut]:{exposure:"event"},[Ht]:{exposure:"event"},[zt]:{exposure:"event"},[Wt]:{exposure:"event"},[Vt]:{exposure:"event"},[Gt]:{exposure:"event"},[Zt]:{exposure:"event"},[Qt]:{exposure:"event"},[Jt]:{exposure:"event"},[Xt]:{exposure:"event"}},F_=[[X,{exposure:"hidden"}],[tt,{exposure:"hidden"}],[et,{exposure:"hidden"}]],$_=t=>{var e=O_[t];if(e)return e;for(var i of F_){var r=i[1];if(0===t.indexOf(i[0]))return r}},D_={flags:At,surveys:mt},L_=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],N_=t=>t+"_cookie_identity_change_pending",q_=t=>{var e="",i=0;for(var r of t){var n=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(i+n>1e3)break;e+=r,i+=n}return e},j_="main",B_=[nt,st,at,lt,ut,At,ht,ct],U_=t=>-1!==B_.indexOf(t),H_=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},z_=t=>{if(!t)return{};var e=JSON.parse(t);return Ee(e)?e:{}},W_=(t,e)=>{$n(t,(i,r)=>{var n=$_(r);n&&"event"!==n.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]})},V_=class{constructor(t,e,i){if(void 0===i&&(i=!0),this.To={},this.Mo=!1,this.Io=!1,this.Eo=!1,this.Ro=!1,this.Ao=!1,this.Po=new Map,this.Fo=!1,this.Oo=!1,this.$o=!1,this.Do=!1,this.Lo=new Set,this.Rn=t,this.No=i,this.props={},this.qo=void 0,this.jo=(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"})(t),this.fo=this.Bo(t),this.Eo=this.Ho(t),this.load(),this.zo(),t.debug&&Pn.info("Persistence loaded",t.persistence,s({},this.props)),this.update_config(t,t,e),this.save(),l){var r=()=>this.flush();zn(l,"beforeunload",r,{capture:!1}),zn(l,"pagehide",r,{capture:!1}),this.Uo=t=>{if(this.Mo&&(!t.storageArea||t.storageArea===(null==l?void 0:l.localStorage))&&t.key)if(t.key!==this.jo){if(this.Eo){var e=P_.find(e=>t.key===this.Wo(e));e&&this.Vo(t.key,e)}}else this.Vo(t.key,j_)},zn(l,"storage",this.Uo)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(t=>{var e=t[0],i=t[1],r=this.Po.get(e);if(U_(e)&&!0!==r)if(!0!==i){var n=new Set(r||[]);i.forEach(t=>n.add(t)),n.size&&this.Go(e,n)}else this.Go(e,!0)})}onCrossTabFeatureFlagChange(t){return this.Lo.add(t),()=>this.Lo.delete(t)}destroy(){this.Uo&&l&&(l.removeEventListener("storage",this.Uo),this.Uo=void 0),this.Lo.clear()}Vo(t,e,i){if(void 0===i&&(i=!0),this.gi)return!1;var r,n;try{if(n=Sa.Lt(t),Pe(n)){var s=this.Zo(e);return s.storageValue=null,e!==j_&&(s.persisted=!1),!1}r=z_(n)}catch(t){return!1}var o=e===j_?r:Sa.Nt(this.jo);if(o&&this.Jo(o))return!1;var a=this.Qo(r,e,i);return e===j_&&this.Eo&&!H_(this.Ko().main,r)||this.Xo(r,e,!0,n),a}Jo(t){var e=this.props[k],i=t[k];return!Ie(e)&&!Ie(i)&&e!==i}Xo(t,e,i,r){var n=this.Zo(e);n.storageValue=r,e!==j_&&(n.persisted=i);try{n.fingerprint=this.Yo(t,e)}catch(t){n.fingerprint=void 0}}Qo(t,e,i){var r=!1;return B_.forEach(i=>{var n,s=null==(n=$_(i))?void 0:n.storageGroup;if(!(e===j_&&this.Eo&&s||e!==j_&&s!==e)){var o=i in t,a=this.ta(i,o?t[i]:void 0),l=this.Po.has(i)?i in this.props:o;l===i in this.props&&H_(a,this.props[i])||(l?this.ea(i,a,!1):this.ia(i,!1),r=!0)}}),r&&i&&this.Lo.forEach(t=>t()),r}ra(){if(!this.Mo)return!1;try{this.$o=!1;var t,e=Sa.Lt(this.jo),i=this.Zo(j_),r=!1,n=!1;if(e!==i.storageValue)if(Pe(e))i.storageValue=null;else{if(t=z_(e),this.$o=!this.Oo&&this.Jo(t),this.$o)return!1;n=this.Qo(t,j_,!1),!this.Eo||H_(this.Ko().main,t)?this.Xo(t,j_,!0,e):i.storageValue=e,r=!0}return this.Eo&&P_.forEach(e=>{var i=Sa.Lt(this.Wo(e)),s=this.Zo(e),o=t||{},a=r&&B_.some(t=>{var i;return(null==(i=$_(t))?void 0:i.storageGroup)===e&&t in o});if(i!==s.storageValue||a){if(Pe(i))return s.storageValue=null,s.persisted=!1,void(a&&(n=this.Qo(o,e,!1)||n));var l=z_(i);n=this.Qo(l,e,!1)||n,this.Xo(l,e,!0,i)}}),n}catch(t){return!1}}Go(t,e){this.Po.set(t,e);var i=$_(t);null!=i&&i.volatile||(this.Zo((this.Eo?null==i?void 0:i.storageGroup:void 0)||j_).fingerprint=void 0,this.na(t))}sa(){B_.forEach(t=>this.Po.set(t,!0))}zo(){if(this.Mo)try{var t=Sa.Lt(this.jo),e=z_(t);this.Zo(j_).storageValue=t,B_.forEach(t=>{var i,r=this.Eo?null==(i=$_(t))?void 0:i.storageGroup:void 0,n=r?Sa.Lt(this.Wo(r)):null;if(r){var s=this.Zo(r);s.storageValue=n,s.persisted=!Pe(n)}var o=r&&!Pe(n)?z_(n):e;t in this.props?this.oa(t,o[t],this.props[t]):t in o&&this.Go(t,!0)})}catch(t){}}ta(t,e){var i=this.Po.get(t);if(!i)return e;if(!0===i)return this.props[t];if("$active_feature_flags"===t){var r=new Set(Ce(e)?e:[]),n=new Set(Ce(this.props[t])?this.props[t]:[]);return i.forEach(t=>n.has(t)?r.add(t):r.delete(t)),Array.from(r)}var o=Ee(e)?s({},e):{},a=Ee(this.props[t])?this.props[t]:{};return i.forEach(t=>{t in a?o[t]=a[t]:delete o[t]}),o}oa(t,e,i){if(U_(t)){var r=this.Po.get(t);if(!0!==r){var n=e;if(this.Mo)try{var s,o=this.Eo?null==(s=$_(t))?void 0:s.storageGroup:void 0,a=o?this.Wo(o):this.jo;n=z_(Sa.Lt(a))[t]}catch(t){}var l=new Set(r||[]);if("$active_feature_flags"===t){if(!Ie(e)&&!Ce(e)||!Ie(n)&&!Ce(n)||!Ce(i))return void this.Go(t,!0);var u=new Set(e||[]),h=new Set(n||[]),d=new Set(i);new Set([...u,...d]).forEach(t=>{u.has(t)!==d.has(t)&&l.add(t)}),l.forEach(t=>{h.has(t)===d.has(t)&&l.delete(t)})}else{if(!Ee(i))return void(H_(n,i)?this.Po.delete(t):this.Go(t,!0));if(!Ie(e)&&!Ee(e)||Ie(e)&&Me(i)&&Ie(n))return void this.Go(t,!0);var v=Ee(e)?e:{},c=Ee(n)?n:{};new Set([...Object.keys(v),...Object.keys(i)]).forEach(t=>{t in v==t in i&&H_(v[t],i[t])||l.add(t)}),l.forEach(t=>{t in c==t in i&&H_(c[t],i[t])&&l.delete(t)})}l.size?this.Go(t,l):this.Po.delete(t)}}}aa(){var t,e=null==(t=this.Rn)?void 0:t.persistence_save_debounce_ms;return Fe(e)&&e>0?e:0}la(t){if(this.Rn.cookieWinsOnConflict&&"localstorage+cookie"===this.Rn.persistence.toLowerCase())if(t)try{var e=Ia(t,this.Rn.cookie_persisted_properties||[]),i=Aa(e,this.Rn.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),n=wa.Lt(this.jo)||void 0;n&&Oa(this.jo,n)===r&&(this.ua=r,this.ha=n)}catch(t){}else try{var s=wa.Lt(this.jo)||void 0;this.ua=s?Oa(this.jo,s):void 0,this.ha=s}catch(t){}}syncCookieProperties(){return this.da(this.Rn)}da(t,e){if(void 0===e&&(e=!1),this.gi&&!e||this.Ao||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=wa.Lt(this.jo)||void 0}catch(t){}if(!i||i===this.ha)return!1;var r,n=Oa(this.jo,i);try{r=Ma(JSON.parse(i))}catch(t){return!1}if((wa.Lt(this.jo)||void 0)!==i)return!1;this.ua=n,this.ha=i;var s=Pa(this.jo,i),o=[...Ca,...s.properties],a={};if(Object.keys(r).forEach(t=>{var e=r[t];(Ie(e)||Pe(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e)&&(a[t]=!0,delete r[t])}),Me(r))return!1;var l="distinct_id"in r||"anonymous"===r.$user_state||"identified"===r.$user_state,u=this.props,h=u[k],d=u[Pt],v=Dn({},u);[...Ca,...t.cookie_persisted_properties||[]].forEach(t=>{if(-1!==o.indexOf(t)&&!(t in r)&&!a[t]&&(l||"distinct_id"!==t&&"$user_state"!==t)){var e=v[t];(s.isValid||-1===Ca.indexOf(t)||!1!==e&&0!==e)&&delete v[t]}}),this.props=Dn(v,r),B_.forEach(t=>{var e=t in this.props;t in u===e&&H_(u[t],this.props[t])||(e?this.oa(t,u[t],this.props[t]):this.Go(t,!0))}),!l||"$user_state"in r||"$user_state"in this.props||this.ea(Pt,ee);var c=this.props[k],f=this.props[Pt];return!l||c===h&&f===d||(this.Oo=!0,this.Ro=!0,La.Ot(N_(this.jo),!0),this.ia(ct),this.ia(st),this.ia(nt),this.ia(at),this.ia(lt),this.ia(ut),this.ia(At),this.ia(Rt),this.ia(Mt),"anonymous"!==f||"identified"!==d&&"anonymous"!==r.$user_state&&(Ie(h)||c===h)||(W_(this.props,r),this.ia(ft)),"identified"===f?this.props.$user_id=c:delete this.props.$user_id,this.ia(C)),!0}consumeCookieIdentityChange(){var t=N_(this.jo),e=this.Ro||!!La.Lt(t);return this.Ro=!1,e&&La.Dt(t),e}va(t){return void 0===t&&(t=!1),!(this.Ao||this.gi&&!t||!this.Rn.cookieWinsOnConflict||"localstorage+cookie"!==this.Rn.persistence.toLowerCase()||(this.Ao=!0,0))}ca(){this.Ao&&(Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0),delete this.To[j_],this.pa(!0))}ga(t){if(void 0===t&&(t=!0),this.Ao)try{t?this.ca():Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0)}finally{this.Ao=!1}}isDisabled(){return!!this.gi}Bo(t){-1===L_.indexOf(t.persistence.toLowerCase())&&(Pn.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,i=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var i=[...Ca,...t];return s({},Sa,{Nt(t){try{var r,n={};try{r=wa.Lt(t)||void 0,n=r?Ma(JSON.parse(r)):{}}catch(t){}var s,o=JSON.parse(Sa.Lt(t)||"{}");if(e){var a=Pa(t,r),l=[...Ca,...a.properties],u={};Object.keys(n).forEach(t=>{var e=n[t];Pe(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e||(u[t]=e)});var h="distinct_id"in u||"anonymous"===u.$user_state||"identified"===u.$user_state;if(Object.keys(u).length>0){var d,v=o[k],c=null!==(d=o.$user_state)&&void 0!==d?d:"anonymous";i.forEach(t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(h||"distinct_id"!==t&&"$user_state"!==t)){var e=o[t];(a.isValid||-1===Ca.indexOf(t)||!1!==e&&0!==e)&&delete o[t]}}),!h||"$user_state"in n||"$user_state"in o||(o[Pt]=ee),!h||("distinct_id"in u?u[k]:o[k])===v&&("$user_state"in u?u[Pt]:o[Pt])===c||(xa.forEach(t=>delete o[t]),"identified"===u.$user_state&&"distinct_id"in u?o.$user_id=u[k]:delete o.$user_id,"identified"!==u.$user_state&&(delete o[pt],delete o[ft]),delete o.__alias)}s=Dn(o,u)}else s=Dn(n,o);return Sa.Ot(t,s),s}catch(t){}return null},Ot(i,r,n,s,o,a){var l=Sa.Ot(i,r,void 0,void 0,a);try{var u=Ia(r,t);if(Object.keys(u).length){if(e){var h=Ta(i),d=Aa(u,t);if(wa.Ot(h,d,n,s,o,a),wa.Lt(h)!==JSON.stringify(d)){wa.Dt(h,s);var v=Ia(r);return wa.Ot(i,v,n,s,o,a),l}}wa.Ot(i,u,n,s,o,a)}}catch(t){Sa.Pt(t)}return l},Dt(t,e){try{null==l||l.localStorage.removeItem(t),wa.Dt(t,e),wa.Dt(Ta(t),e)}catch(t){Sa.Pt(t)}}})}(t.cookie_persisted_properties||[],t.cookieWinsOnConflict),r=!1,n=!1,o=t.persistence.toLowerCase();return"localstorage"===o&&Sa.Et()?(e=Sa,n=!0):"localstorage+cookie"===o&&i.Et()?(e=i,n=!0,r=!0):"sessionstorage"===o&&La.Et()?e=La:"memory"===o?e=$a:"cookie"===o&&wa.Et()?(e=wa,r=!0):i.Et()?(e=i,n=!0,r=!0):wa.Et()?(e=wa,r=!0):e=$a,this.Mo=n,this.Io=r,e}Wo(t){return this.jo+"__"+t}Ho(t){return this.Mo&&!!t.split_storage}properties(){var t={};return $n(this.props,(e,i)=>{var r=$_(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.gi||t){var e=this.Rn.cookieWinsOnConflict&&"localstorage+cookie"===this.Rn.persistence.toLowerCase(),i=e?Sa.Nt(this.jo):null,r={};if(e)try{$n(r=Ma(wa.Nt(this.jo)),(t,e)=>{(Ie(t)||Pe(t)||""===t)&&delete r[e]})}catch(t){}var n=this.fo.Nt(this.jo);if(n&&(this.props=Dn({},n)),this.Eo&&this.ma(),e&&n){var s,o,a=null==i?void 0:i[k],l=null!==(s=null==i?void 0:i.$user_state)&&void 0!==s?s:"anonymous",u=n[k],h=null!==(o=n.$user_state)&&void 0!==o?o:"anonymous";if(u!==a||h!==l){this.Ro=!0,La.Ot(N_(this.jo),!0);var d=Dn({},this.props);xa.forEach(t=>delete d[t]),"anonymous"!==h||"identified"!==l&&"anonymous"!==r.$user_state&&(Ie(a)||u===a)||(W_(d,r),delete d[ft]),this.props=d;var v=new Set;xa.forEach(t=>{var e,i=null==(e=$_(t))?void 0:e.storageGroup;i&&v.add(i)}),v.forEach(t=>{var e={};$n(this.props,(i,r)=>{var n;(null==(n=$_(r))?void 0:n.storageGroup)===t&&(e[r]=i)}),Me(e)?(Sa.Dt(this.Wo(t)),this.To[t]={}):Sa.Ot(this.Wo(t),e)&&(this.To[t]={persisted:!0,fingerprint:this.Yo(e,t)})})}}La.Lt(N_(this.jo))&&(this.Ro=!0)}}ma(){for(var t of P_){var e=Sa.Nt(this.Wo(t));if(e&&!Me(e)){var i=this.Zo(t);i.persisted=!0,this.ya(t)||(i.fingerprint=this.Yo(e,t)),this.ba(t,e)||Dn(this.props,e)}}}ya(t){return Object.keys(this.props).some(e=>{var i;return(null==(i=$_(e))?void 0:i.storageGroup)===t})}ba(t,e){var i=D_[t];if(!i)return!1;var r=e[i],n=this.props[i];return Fe(r)&&Fe(n)&&n>r}refreshKey(t){var e;if(!(this.gi||"$fbc_persistence"===t&&this.Do)){var i=this.Eo?null==(e=$_(t))?void 0:e.storageGroup:void 0,r=i?Sa.Nt(this.Wo(i)):this.fo.Nt(this.jo);if(r&&t in r)this.ea(t,r[t],!1);else{if(i){var n=this.fo.Nt(this.jo);if(n&&t in n)return void this.ea(t,n[t],!1)}this.ia(t,!1)}}}save(){if(!this.gi){var t=this.aa();t>0?Ie(this.fa)&&(this.fa=setTimeout(()=>{this.fa=void 0,this.pa()},t)):this.pa()}}flush(){Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0,this.pa())}pa(t){if(void 0===t&&(t=!1),!(this.gi||this.Ao&&!t)){t||(this.syncCookieProperties(),this.Do||this.Rn.cookieWinsOnConflict&&"localstorage+cookie"===this.Rn.persistence.toLowerCase()||this.refreshKey(M));var e=!t&&!this.Fo;e||(this.$o=!1);var i=!!e&&this.ra();if(this.$o)this.Rn.debug&&Pn.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.Eo)return this._a(),void(i&&this.Lo.forEach(t=>t()));var r=this.wa(this.fo,this.jo,this.props,j_);"written"===r&&this.la(this.props),"failed"!==r&&(this.Po.clear(),this.Oo=!1,this.Do=!1),i&&this.Lo.forEach(t=>t())}}}_a(){var t=this,e=this.Ko(),i=e.main,r=e.groups,n=this.wa(this.fo,this.jo,i,j_);"written"===n&&this.la(i),"failed"!==n&&(this.Oo=!1,this.Do=!1,B_.forEach(t=>{var e;null!=(e=$_(t))&&e.storageGroup||this.Po.delete(t)}));var s=function(e){var i,n=r[e];if(Me(n)&&(null==(i=t.To[e])||!i.persisted))return B_.forEach(i=>{var r;(null==(r=$_(i))?void 0:r.storageGroup)===e&&t.Po.delete(i)}),1;var s=t.wa(Sa,t.Wo(e),n,e);"failed"!==s&&B_.forEach(i=>{var r=$_(i);(null==r?void 0:r.storageGroup)!==e||"written"!==s&&r.volatile||t.Po.delete(i)})};for(var o of P_)if(s(o))continue}Ko(){var t={},e={flags:{},surveys:{}};return $n(this.props,(i,r)=>{var n,s=null==(n=$_(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i}),{main:t,groups:e}}Yo(t,e){if(e===j_)return JSON.stringify(t)+"|"+this.ka+"|"+this.Sa+"|"+this.xa;var i={};return $n(t,(t,e)=>{var r;i[e]=null!=(r=$_(e))&&r.volatile?"__volatile__":t}),JSON.stringify(i)}wa(t,e,i,r){var n,s=this.Zo(r);if(r!==j_&&!s.dirty&&!Ie(s.fingerprint))return"skipped";try{if((n=this.Yo(i,r))===s.fingerprint)return s.dirty=!1,"skipped"}catch(t){n=void 0}return t.Ot(e,i,this.ka,this.Sa,this.xa,this.Rn.debug)?(s.dirty=!1,r!==j_&&(s.persisted=!0),Ie(n)||(s.fingerprint=n),this.Mo&&(s.storageValue=Sa.Lt(e)),"written"):(this.Rn.debug&&Pn.warn('failed to persist storage entry "'+e+'"; will retry on next save'),"failed")}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(this.sa(),Ie(this.fa)||(clearTimeout(this.fa),this.fa=void 0),this.fo.Dt(this.jo,!1),this.fo.Dt(this.jo,!0),!i&&this.No)for(var r of P_)Sa.Dt(this.Wo(r));i?delete this.To[j_]:this.To={},this.ua=void 0,this.ha=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Ee(t)){this.syncCookieProperties(),Ie(e)&&(e="None"),this.ka=Ie(i)?this.Ca:i;var r=!1;if($n(t,(t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.ea(i,t),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(Ee(t)){this.syncCookieProperties(),this.ka=Ie(e)?this.Ca:e;var i=!1;if($n(t,(e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||Ee(e)||Ce(e))&&(this.ea(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.ia(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==d?void 0:d.URL;if(t!==this.qo){var e=fl(this.Rn.custom_campaign_params,this.Rn.mask_personal_data_properties,this.Rn.custom_personal_data_properties),i=!Me(jn(e));return i&&this.register(e),this.qo=t,i?e:void 0}}update_search_keyword(){var t;this.register((t=null==d?void 0:d.referrer)?gl(t):{})}update_referrer_info(){var t;this.register_once({$referrer:_l(),$referring_domain:null!=d&&d.referrer&&(null==(t=Zn(d.referrer))?void 0:t.host)||yl},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=bl(this.Rn.mask_personal_data_properties,this.Rn.custom_personal_data_properties,this.Rn.disable_capture_url_hashes);this.register_once({[Lt]:this.Io?{r:q_(t.r),u:t.u?q_(t.u):void 0}:t},void 0)}}get_initial_props(){var t={};$n([Dt,$t],e=>{var i=this.props[e];i&&$n(i,function(e,i){t["$initial_"+fe(i)]=e})});var e=this.props[Lt];return e&&Dn(t,function(t,e){void 0===e&&(e=!1);var i=wl(t,e),r={};return $n(i,function(t,e){r["$initial_"+fe(e)]=t}),r}(e,this.Rn.disable_capture_url_hashes)),t}safe_merge(t){return $n(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||[]),o=r||n,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,l=t.disable_persistence||!!i,u=!!this.gi&&!l;l||this.da(e,u),this.Rn=t,!l&&(r||n||a)&&(this.ua=void 0,this.ha=void 0,this.da(s({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),u));var h=o||a?this.Bo(t):this.fo;this.Ta();var d=this.Ho(t),v=o||d!==this.Eo,c=!l&&(v||t.cross_subdomain_cookie!==this.Sa||t.secure_cookie!==this.xa)&&this.va(u);this.Fo=v;try{if(this.Ca=this.ka=t.cookie_expiration,this.set_disabled(l),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),v){var f=this.props;this.clear(),this.fo=h,this.Eo=d,this.props=f,this.save()}else a&&(this.fo=h,l||(delete this.To[j_],this.pa()))}finally{this.Fo=!1,c&&this.ga()}}Ta(){var t=this.props[Lt];if(this.Io&&Ee(t)&&"string"==typeof t.r){var e=q_(t.r),i="string"==typeof t.u?q_(t.u):t.u;e===t.r&&i===t.u||this.ea(Lt,s({},t,{r:e,u:i}))}}set_disabled(t){this.gi=t,this.gi?this.remove():this.save()}set_cross_subdomain(t){t!==this.Sa&&(this.Sa=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.xa&&(this.xa=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props.__timers||{};i[t]=e,this.ea(I,i),this.save()}remove_event_timer(t){var e=this.props.__timers||{},i=e[t];return Ie(i)||(delete e[t],this.ea(I,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.ea(t,e),this.save()}ea(t,e,i){var r;void 0===i&&(i=!0);var n=this.props[t];this.props[t]=e,i&&("distinct_id"!==t&&"$user_state"!==t||n===e||(this.Oo=!0),"$fbc_persistence"!==t||H_(n,e)||(this.Do=!0),this.oa(t,n,e),null!=(r=$_(t))&&r.volatile||this.na(t))}ia(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(U_(t)&&this.Go(t,!0),"$fbc_persistence"===t&&(this.Do=!0),this.na(t))}na(t){var e,i=null==(e=$_(t))?void 0:e.storageGroup;i&&(this.Zo(i).dirty=!0)}Zo(t){return this.To[t]||(this.To[t]={})}},G_={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},Z_={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},Q_={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},J_=On("[RateLimiter]"),K_=class{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=>{J_.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4})}catch(t){return void J_.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,o=(new Date).getTime(),a=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property("$capture_rate_limit"))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;if(l||t||(a.tokens=Math.max(0,a.tokens-1)),l&&!t){var u=(Fe(a.dropped)?a.dropped:0)+1;a.dropped=u,!this.lastEventRateLimited&&this.Ma(u)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(Ft,a),{isRateLimited:l,remainingTokens:a.tokens}}Ia(t){var e=this.instance.config.property_denylist;return!Ce(e)||!e.includes(t)}Ea(){var t;if(this.Ia("$current_url")&&this.Ia("$pathname")&&null!=v&&v.pathname)return""+(null!==(t=v.origin)&&void 0!==t?t:"")+v.pathname}Ma(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.Ea(),o=this.Ia("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,a=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". 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}},Y_=On("[RemoteConfig]"),X_=class{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=b._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Ra(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>t(this.remoteConfig)):t()}Aa(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 Y_.info("Using preloaded remote config",this.remoteConfig),void this.Pa(this.remoteConfig);if(this._instance.Fa())return void Y_.warn("Remote config is disabled. Falling back to local config.");this.Ra(t=>{if(!t)return Y_.info("No config found after loading remote JS config. Falling back to JSON."),void this.Aa(t=>{this.Pa(t.json,t)});this.Pa(t)})}catch(t){Y_.error("Error loading remote config",t),this.Pa()}}Pa(t,e){!t&&e&&(0===e.statusCode?e.error||Y_.warn("Failed to fetch remote config from PostHog."):Y_.error("Failed to fetch remote config from PostHog."));try{this._instance.Pa(t?{ok:!0,config:t}:{ok:!1})}catch(t){Y_.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){Y_.error("Error loading feature flags",t)}}},tb=["fatal","error","warning","log","info","debug"],eb=!!f||!!c,ib="text/plain",rb=!1,nb=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],o=n[1];if(!o)return t;var a=o.split("&").filter(t=>t.split("=")[0]!==e).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")},sb=function(t,e,i){var r;void 0===i&&(i=!0);var n=t.split("?"),o=n[0],a=n[1],l=s({},e),u=null!==(r=null==a?void 0:a.split("&").map(t=>{var e,r=t.split("="),n=r[0],s=i&&null!==(e=l[n])&&void 0!==e?e:r[1];return delete l[n],n+"="+s}))&&void 0!==r?r:[],h=Qn(l);return h&&u.push(h),u.length>0?o+"?"+u.join("&"):o},ob=t=>{if(t.Oa)return t.Oa;var e=t.data,i=t.compression;if(e){if(i===zf.GZipJS){var r=oa(aa(Gn(e)),{mtime:0});return{contentType:ib,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===zf.Base64){var n=(t=>"data="+encodeURIComponent("string"==typeof t?t:Gn(t)))(function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(t,e)=>String.fromCharCode(parseInt(e,16)))):t}(Gn(e)));return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var s=Gn(e);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},ab=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:sb(t.url,{compression:zf.Base64}),encodedBody:ob(s({},t,{compression:zf.Base64,Oa:void 0}))}:{url:nb(t.url,"compression"),encodedBody:ob(s({},t,{compression:void 0,Oa:void 0}))};try{e=ob(t)}catch(e){if(rn(t.compression,Jn(t.url,"compression")))return Pn.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&rn(t.compression,Jn(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?en(new Uint8Array(i)):ArrayBuffer.isView(i)&&en(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(rb=!0,r()):{url:t.url,encodedBody:e}},lb=t=>{try{return ab(t)}catch(e){return Pn.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},ub=function(){var t=a(function*(t){var e=yield ln(Gn(t.data),Na.DEBUG,{rethrow:!0});if(!e)return t;var i=yield e.arrayBuffer();return s({},t,{Oa:{contentType:ib,body:i,estimatedSize:i.byteLength}})});return function(e){return t.apply(this,arguments)}}(),hb=/Failed to fetch|NetworkError|Load failed/i,db=t=>"TypeError"===(null==t?void 0:t.name)&&hb.test((null==t?void 0:t.message)||""),vb=t=>{var e=lb(t);if(e){var i=new f,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,o=n.body;$n(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)}},cb=t=>{var e=lb(t);if(e){var i=e.url,r=e.encodedBody,n=null!=r?r:{},o=n.contentType,a=n.body,l=n.estimatedSize,u=new Headers;$n(t.headers,function(t,e){u.append(e,t)}),o&&u.append("Content-Type",o);var h=null,d=!1;if(p){var v=new p;h={signal:v.signal,timeout:setTimeout(()=>{var e;d=!0,v.abort(ar("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))},t.timeout)}}var f=e=>{d&&"AbortError"===(null==e?void 0:e.name)||db(e)?Pn.warn(e):Pn.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var g;c(i,s({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.$a&&52428.8>(l||0),body:a,signal:null==(g=h)?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){Pn.error(t)}null==t.callback||t.callback(r)})).catch(f).finally(()=>h?clearTimeout(h.timeout):null)}catch(t){h&&clearTimeout(h.timeout),f(t)}}},fb=t=>{try{var e,i=ab(t),r=i.url,n=i.encodedBody,o=null!=n?n:{},a=o.body,l=o.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(h.sendBeacon(r,u))return;var d=Ce(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(Ce(d)&&d.length>1&&(null!=l?l:0)>16384){var v=Math.ceil(d.length/2),f=e=>Ce(t.data)?e:s({},t.data,{batch:e});return fb(s({},t,{data:f(d.slice(0,v))})),void fb(s({},t,{data:f(d.slice(v))}))}Pn.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to "+(c?"fetch":"XHR")),c?cb(s({},t,{$a:!0})):vb(t)}catch(t){Pn.warn("Beacon send failed",t)}},pb=(t,e,i,r)=>{var n="query"===r?"POST"===e?"sent_at":"_":void 0;return sb(i===zf.GZipJS?nb(t,"compression"):t,s({},n?{[n]:Date.now().toString()}:{},i===zf.GZipJS?{}:{compression:i}))},gb=[];c&&gb.push({transport:"fetch",method:cb}),f&&gb.push({transport:"XHR",method:vb}),null!=h&&h.sendBeacon&&gb.push({transport:"sendBeacon",method:fb});var mb=class{constructor(t,e){this.Da=!0,this.La=[],this.Na=Ze((null==e?void 0:e.flush_interval_ms)||3e3,250,5e3,Pn.createLogger("flush interval"),3e3),this.qa=t}enqueue(t){this.La.push(t),this.ja||this.Ba()}unload(){this.Ha();var t=this.La.length>0?this.za():{},e=Object.values(t);[...e.filter(t=>0===t.url.indexOf("/e")),...e.filter(t=>0!==t.url.indexOf("/e"))].map(t=>{this.Ua(s({},t,{transport:"sendBeacon"}))})}enable(){this.Da=!1,this.Ba()}Ba(){var t=this;this.Da||(this.ja=setTimeout(()=>{if(this.Ha(),this.La.length>0){var e=this.za(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&Ce(i.data)&&$n(i.data,t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp}),t.Ua(i)};for(var r in e)i()}},this.Na))}Ua(t){try{this.qa(t)}catch(t){Pn.error(t)}}Ha(){clearTimeout(this.ja),this.ja=void 0}za(){var t={};return $n(this.La,e=>{var i,r=e,n=(r?r.batchKey:null)||r.url;Ie(t[n])&&(t[n]=s({},r,{data:[]})),null==(i=t[n].data)||i.push(r.data)}),this.La=[],t}},yb=class{constructor(t){this._instance=t,this.Wa=!1,this.Va=3e3,this.La=[],this.La=[],this.Ga=!0,this.resume()}resume(){if(!Ie(l)&&"onLine"in l.navigator){if(this.Ga=l.navigator.onLine,this.Za)return;this.Za=()=>{this.Ga=!0,this.Ja()},this.Qa=()=>{this.Ga=!1},zn(l,"online",this.Za),zn(l,"offline",this.Qa)}}get length(){return this.La.length}retriableRequest(t){var e=t.retriesPerformedSoFar,r=n(t,i);$e(e)&&(r.url=sb(r.url,{retry_count:e})),this._instance._send_request(s({},r,{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.ws(s({retriesPerformedSoFar:e},r));0===t.statusCode&&Pn.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==r.callback||r.callback(t)}}))}ws(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)*(r-i);return Math.ceil(r+n)}(e),r=Date.now()+i;this.La.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),Pn.warn(n),this.Wa||(this.Wa=!0,this.Ka())}Ka(){if(this.Xa&&clearTimeout(this.Xa),0===this.La.length)return this.Wa=!1,void(this.Xa=void 0);this.Xa=setTimeout(()=>{this.Ga&&this.La.length>0&&this.Ja(),this.Ka()},this.Va)}Ja(){var t=Date.now(),e=[],i=this.La.filter(i=>t>i.retryAt||(e.push(i),!1));if(this.La=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var t of(this.Xa&&(clearTimeout(this.Xa),this.Xa=void 0),this.Wa=!1,Ie(l)||(this.Za&&(l.removeEventListener("online",this.Za),this.Za=void 0),this.Qa&&(l.removeEventListener("offline",this.Qa),this.Qa=void 0)),this.La)){var e=t.requestOptions;try{this._instance._send_request(s({},e,{transport:"sendBeacon"}))}catch(t){Pn.error(t)}}this.La=[]}},_b=class{constructor(t){this._instance=t,this.Ya=()=>{var t,e,i,r;this.tl||(this.tl={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.tl.lastScrollY=Math.ceil(s),this.tl.maxScrollY=Math.max(s,null!==(t=this.tl.maxScrollY)&&void 0!==t?t:0),this.tl.maxScrollHeight=Math.max(o,null!==(e=this.tl.maxScrollHeight)&&void 0!==e?e:0),this.tl.lastContentY=a,this.tl.maxContentY=Math.max(a,null!==(i=this.tl.maxContentY)&&void 0!==i?i:0),this.tl.maxContentHeight=Math.max(l,null!==(r=this.tl.maxContentHeight)&&void 0!==r?r:0)}}get el(){return this._instance.config.scroll_root_selector}getContext(){return this.tl}resetContext(){var t=this.tl;return setTimeout(this.Ya,0),t}startMeasuringScrollPosition(){zn(l,"scroll",this.Ya,{capture:!0}),zn(l,"scrollend",this.Ya,{capture:!0}),zn(l,"resize",this.Ya)}scrollElement(){var t;if(!this.el)return null==l||null==(t=l.document)?void 0:t.documentElement;for(var e of Ce(this.el)?this.el:[this.el]){var i,r=null==l||null==(i=l.document)?void 0:i.querySelector(e);if(r)return r}}il(t){var e,i,r="y"===t?"scrollTop":"scrollLeft";if(this.el){var n=this.scrollElement();return n&&n[r]||0}return l?"y"===t?l.scrollY||l.pageYOffset||(null==(e=l.document)||null==(e=e.documentElement)?void 0:e.scrollTop)||0:l.scrollX||l.pageXOffset||(null==(i=l.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.il("y")}scrollX(){return this.il("x")}},bb=t=>bl(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),wb=class{constructor(t,e,i,r){this.Be=t=>{var e=this.rl();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.nl(this._instance)};this.sl.register({[Ot]:i})}},this._instance=t,this.ol=e,this.sl=i,this.nl=r||bb,this.ol.onSessionId(this.Be)}rl(){return this.sl.props[Ot]}getSetOnceProps(){var t,e=null==(t=this.rl())?void 0:t.props;return e?"r"in e?wl(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 $n(jn(this.getSetOnceProps()),(e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+fe(i)]=e}),t}},kb=class{on(t,e){return this.al[t]||(this.al[t]=[]),this.al[t].push(e),()=>{this.al[t]=this.al[t].filter(t=>t!==e)}}emit(t,e){for(var i of this.al[t]||[])i(e);for(var r of this.al["*"]||[])r(t,e)}constructor(){this.al={}}},Sb=On("[SessionId]"),xb=864e5,Cb=class{on(t,e){return this.ll.on(t,e)}constructor(t,e,i){var r;if(this.ul=null,this.hl=null,this.dl=[],this.vl=void 0,this.cl=!1,this.ll=new kb,this.fl=(t,e)=>!(!$e(t)||!$e(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Rn=t.config,this.sl=t.persistence,this.He=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.pl=void 0,this._sessionActivityTimestamp=null,this.gl=e||ga,this.ml=i||ga;var n=this.Rn.persistence_name||this.Rn.token;if(this._sessionTimeoutMs=1e3*Ze(this.Rn.session_idle_timeout_seconds||1800,60,36e3,Sb.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.yl(),this.bl="ph_"+n+"_window_id",this._l="ph_"+n+"_primary_window_exists",this.wl()){var s=La.Nt(this.bl),o=La.Nt(this._l);s&&!o?this.He=s:La.Dt(this.bl),La.Ot(this._l,!0)}null!=(r=this.Rn.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.Rn.bootstrap.sessionID),this.kl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Ie(this.dl)&&(this.dl=[]),this.dl.push(t),this.Xt&&t(this.Xt,this.He),()=>{this.dl=this.dl.filter(e=>e!==t)}}wl(){return"memory"!==this.Rn.persistence&&!this.sl.gi&&La.Et()}Sl(t){t!==this.He&&(this.He=t,this.wl()&&La.Ot(this.bl,t))}xl(){return this.He?this.He:this.wl()?La.Nt(this.bl):null}Cl(t){var e=this.ul;return!Pe(e)&&!Pe(t)&&5e3>Math.abs(t-e)}Tl(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this.Xt||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Xt=t,n&&!r||n&&this.Cl(e)||(this.ul=e,this.sl.register({[Z]:[e,t,i]}))}Ml(){var t,e=null==(t=this.Rn)?void 0:t.persistence_save_debounce_ms;return $e(e)&&e>0}Il(){this.Ml()?this.sl.refreshKey(Z):(this.sl.flush(),this.sl.load())}El(){var t;if(!Pe(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.ul){this.Il();var e=this.Rl();e[1]===this.Xt&&e[2]===this._sessionStartTimestamp&&(this.ul=this._sessionActivityTimestamp,this.sl.register({[Z]:[this._sessionActivityTimestamp,null!==(t=this.Xt)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.sl.flush())}}Al(){var t=this.Rl()[0],e=$e(t)?t:0,i=$e(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}Pl(t){return this.Il(),this.fl(t,this.Al())}Rl(){var t=this.sl.props[Z];return Ce(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.ul=null,this.pl=void 0,clearTimeout(this.Fl),this.Fl=void 0,this.Tl(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 Sb.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void Sb.error("Invalid sessionID in bootstrap",t)}}(t);return!Ie(i)&&(e?this.pl={sessionId:t,sessionStartTimestamp:i}:this.Tl(t,(new Date).getTime(),i),!0)}destroy(){this.cl=!0,this.El(),clearTimeout(this.Fl),this.Fl=void 0,this.vl&&l&&(l.removeEventListener(se,this.vl,{capture:!1}),this.vl=void 0),this.dl=[]}kl(){this.vl=()=>{this.El(),this.wl()&&La.Dt(this._l)},zn(l,se,this.vl,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),"always"===this.Rn.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),n=this.Xt;if(i)this.hl=r;else if(Pe(this.hl)||this.hl>r||r-this.hl>=1e3){var s,o;null==(s=(o=this.sl).syncCookieProperties)||s.call(o),this.hl=r}var a=this.Rl(),l=a[1],u=a[2],h=!Ie(n)&&l!==n,d=this.Al(),v=this.xl(),c=this.pl,f=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>xb),p=c?f:$e(u)&&Math.abs(r-u)>xb,g=!1,m=h,y=!l||!!c,_=l,b=!y&&!t&&this.fl(r,d);if(b){(b=this.Pl(r))||Sb.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.Rl();l=w[1],u=w[2]}if(y||b||p){m=!1;var k=c&&!f;l=k?c.sessionId:this.gl(),v=this.ml(),Sb.info("new session ID assigned",{sessionId:l,windowId:v,bootstrapped:!!k,changeReason:{noSessionId:y,activityTimeout:b,sessionPastMaximumLength:p}}),u=k?c.sessionStartTimestamp:r,this.pl=void 0,g=!0}else v||(v=this.ml(),g=!0),(m=m||l!==_)&&(Sb.info("adopted cross-tab session id",{sessionId:l,windowId:v}),g=!0);var S=$e(d)&&t&&!p?d:r,x=$e(u)?u:(new Date).getTime();this.Sl(v),this.Tl(l,S,x),t||this.yl();var C={noSessionId:y,activityTimeout:b,sessionPastMaximumLength:p,crossTabAdoption:m};return g&&this.dl.forEach(t=>t(l,v,C)),{sessionId:l,windowId:v,sessionStartTimestamp:x,changeReason:g?C:void 0,lastActivityTimestamp:d}}yl(){this.cl||(clearTimeout(this.Fl),this.Fl=setTimeout(()=>{if(!this.cl)if(this.Pl((new Date).getTime())){var t=this.Xt;this.resetSessionId(),this.ll.emit("forcedIdleReset",{idleSessionId:t})}else this.yl()},1.1*this.sessionTimeoutMs))}},Tb=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&de(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some(t=>de(null==t?void 0:t.brand,e)))return!0}catch(t){}return!!t.webdriver};function Eb(){return Eb=a(function*(){var t=null==h?void 0:h.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e,i=null==(e=yield t.getHighEntropyValues(["model"]))?void 0:e.model;return Re(i)&&i.length>0?i:void 0}catch(t){return void Pn.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}}),Eb.apply(this,arguments)}var Mb="custom",Ib="i.posthog.com",Rb=/^\/static\//,Ab=["/s/","/e/","/i/"],Pb=class{constructor(t){this.Ol={},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("."+Ib,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Ol[this.apiHost]||(this.Ol[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":Mb),this.Ol[this.apiHost]}$l(t){if(Rb.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}Dl(t){var e=Zn(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Ll(t,e,i){if("ui"===t)return i;var r=i,n=this.instance.config.rewriteRequestPath;if(n){var s,o=(null==(s=Zn(i))?void 0:s.href)||i;r=n(new URL(o)).toString()}if(n&&"api"===t&&Ab.some(t=>0===e.indexOf(t))){var a=this.Dl(r);if(a){var l,u=this.apiHost,h=this.Nl;(null==(l=h)?void 0:l.apiHost)===u&&h.rewriteRequestPath===n||(this.Nl=h={apiHost:u,rewriteRequestPath:n,urls:new Set}),h.urls.add(a)}}return r}isIngestionEndpoint(t){var e=this.Nl,i=this.Dl(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.Ll(t,e,this.uiHost+e);if("flags"===t)return this.Ll(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.$l(e);if(i)return this.Ll(t,e,""+i+e)}if(this.region===Mb)return this.Ll(t,e,this.apiHost+e);var r=Ib+e;switch(t){case"assets":return this.Ll(t,e,"https://"+this.region+"-assets."+r);case"api":return this.Ll(t,e,"https://"+this.region+"."+r)}}},Ob=On("[PostHog ExternalIntegrations]"),Fb={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},$b=class{constructor(t){this._instance=t}bo(t,e){var i;null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,t=>{if(t)return Ob.error("failed to load script",t);e()})}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],o=i[1];!o||null!=(e=b.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.bo(Fb[s],()=>{var e;null==(e=b.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)}),!o&&null!=(r=b.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[s]&&(null==(n=b.__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()}}},Db=class{constructor(t,e){this.A=t,this.Js=e,this.ql=new Map,this.ro=!1}add(t){var e=this;return a(function*(){if(e.ro)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.ql.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.ql.set(t.name,t);try{var i=t.setup(e.Js);i&&(yield i)}catch(i){var r=e.ql.get(t.name)===t;r&&e.ql.delete(t.name),e.A.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.jl(t)}})()}getExtension(t){return this.ql.get(t)}dispose(){if(!this.ro){this.ro=!0;var t=Array.from(this.ql.values()).reverse();for(var e of(this.ql.clear(),t))this.jl(e)}}jl(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Te(e.then)&&e.then(void 0,e=>{this.A.error('Failed to dispose browser extension "'+t.name+'"',e)})}catch(e){this.A.error('Failed to dispose browser extension "'+t.name+'"',e)}}},Lb=class{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);Ie(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)}},Nb="extensionsRemoteConfig",qb=class{constructor(t){this.instance=t,this.ro=!1,this.A=Pn,this.Bl=t.Hl,this.kv=new Lb(t),this.onEvent=t=>ip(this.instance.on("eventCaptured",e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.A.error("Browser extension event listener failed",t)}})),this.onRemoteConfig=t=>{if(this.ro)return ip(()=>{});var e=e=>{try{t(e)}catch(t){this.A.error("Browser extension remote config listener failed",t)}},i=this.instance.zl.on(Nb,e);return this.Bl&&e(this.Bl),ip(i)},this.Ul=new Db(Pn.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property("$device_id"))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(S);return"string"==typeof t?t:void 0}get library(){return{name:Na.LIB_NAME,version:Na.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.Ul.add(t)}getExtension(t){return this.Ul.getExtension(t)}capture(t,e,i){var r=this;return a(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 ip(this.instance.Wl(t))}handleRemoteConfig(t){this.ro||(this.Bl=t,this.instance.zl.emit(Nb,t))}sendRequest(t,e){var i=this;return a(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?sb(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?me.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.ro||(this.ro=!0,this.Ul.dispose())}},jb={},Bb=0,Ub=()=>{},Hb='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',zb="Surveys module not available",Wb="sanitize_properties is deprecated. Use before_send instead",Vb="Invalid value for property_denylist config: ",Gb=/^[A-Za-z0-9_-]{1,400}$/,Zb=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,Qb=["token","distinct_id",jt],Jb="posthog",Kb=!eb&&-1===(null==m?void 0:m.indexOf("MSIE"))&&-1===(null==m?void 0:m.indexOf("Mozilla")),Yb=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},Xb=t=>{var e;return s({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Hn(null==d?void 0:d.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Ub,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:v&&Re(null==v?void 0:v.search)&&-1!==v.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,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==l||null==(e=l.location)?void 0:e.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){Pn.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:re,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Ub},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:bs,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:Yb(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)}))(t))},tw=[["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"]],ew=t=>{var e={};for(var i of tw){var r=i[0],n=i[1];Ie(t[r])||(e[n]=t[r])}var s=Dn({},e,t),o=t.__preview_external_dependency_versioned_paths;return Ie(o)||(Ie(t.strict_script_versioning)&&(s.strict_script_versioning=!!o),Re(o)&&Ie(t.asset_host)&&(s.asset_host=o)),Ce(t.property_blacklist)&&(Ie(t.property_denylist)?s.property_denylist=t.property_blacklist:Ce(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:Pn.error(Vb+t.property_denylist)),s},iw=class{constructor(){this.__forceAllowLocalhost=!1}get Vl(){return this.__forceAllowLocalhost}set Vl(t){Pn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},rw=(t=class t{Gl(t){if(t){var e=this.ql.indexOf(t);-1!==e&&this.ql.splice(e,1)}}Zl(t,e){return this.Gl(t),this.ql.push(e),null==e.initialize||e.initialize(),e}Jl(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}Ql(){if(!(this.Kl||this.config.reuseAnonymousId||this.config.segment||this.Jl())){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.Xl||(r?(t="persistence is set to '"+this.config.persistence+"'",e="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(t="persistence is disabled (disable_persistence is true)",e="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.Kl=!0,console.warn("[PostHog.js]",t+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+e+", so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. "+i)))}}Yl(){if(!this.Jl()&&"$posthog_cookieless"===this.get_distinct_id()){var t=this.persistence;if(t){this.tu()||t.load(!0);var e=this.get_distinct_id();if(!e||"$posthog_cookieless"===e){var i=this.config.get_device_id(ga());this.register({distinct_id:i,$device_id:i}),t.set_property(Pt,ee)}this.eu()}}}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 e;this.iu=!1,this.ru=!1,this.webPerformance=new iw,this.nu=!1,this.version=Na.LIB_VERSION,this.su=new Set,this.ou="",this.zl=new kb,this.ql=[],this.au=[],this.Xl=!1,this.Kl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Xb(),this.SentryIntegration=R_,this.sentryIntegration=t=>function(t,e){var i=I_(t,e);return{name:M_,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.lu=!1,this.uu=null,this.hu=null,this.du=null,this.scrollManager=new _b(this),this.pageViewManager=new A_(this),this.rateLimiter=new K_(this),this.requestRouter=new Pb(this),this.consent=new w_(this),this.externalIntegrations=new $b(this);var i=null!==(e=t.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:(t,e,i)=>{var r=Re(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Re(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",t=>Pn.info('send "'+(null==t?void 0:t.event)+'"',t))}init(e,i,r){if(r&&r!==Jb){var n,s=null!==(n=jb[r])&&void 0!==n?n:new t;return s._init(e,i,r),jb[r]=s,jb[Jb][r]=s,s}return this._init(e,i,r)}_init(t,e,i){var r,n,o;void 0===e&&(e={});var a,u=Re(t)?t.trim():"";if(!u)return Pn.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 u!==(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('"+u+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=Xb(e.defaults),e.debug=this.vu(e.debug),this.cu=e,this.fu=[],e.person_profiles?this.hu=e.person_profiles:e.process_person&&(this.hu=e.process_person);var h=Xb(e.defaults),d=ew(e),v=Dn({},h,d,{name:i,token:u});Ee(h.rageclick)&&Ee(d.rageclick)&&(v.rageclick=Dn({},h.rageclick,d.rageclick)),Ee(h.session_recording)&&Ee(d.session_recording)&&(v.session_recording=Dn({},h.session_recording,d.session_recording)),this.set_config(v),this.config.on_xhr_error&&Pn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:zf.GZipJS;var c=this.tu();if(this.persistence=new V_(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new V_(s({},this.config,{persistence:"sessionStorage"}),c,!1),this.ou="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&La.Et()){var f=La.Nt(this.ou);Ce(f)&&f.forEach(t=>{Re(t)&&this.su.add(t)})}else La.Dt(this.ou);var p=s({},this.persistence.props),g=s({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.pu=new mb(t=>this.gu(t),this.config.request_queue_config),this.mu=new yb(this),this.__request_queue=[];var m=this.Jl();m||(this.sessionManager=new Cb(this),this.sessionPropsManager=new wb(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.yu()})),this.bu(),this.config.__preview_deferred_init_extensions?(Pn.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this._u(m)},0)):(Pn.info("Initializing extensions synchronously"),this._u(m)),Na.DEBUG=Na.DEBUG||this.config.debug,Na.DEBUG&&Pn.info("Starting in debug mode",{this:this,config:e,thisC:s({},this.config),p:p,s:g}),!this.config.identity_distinct_id||null!=(r=e.bootstrap)&&r.distinctID||(e.bootstrap=s({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var y=null==(n=e.bootstrap)?void 0:n.distinctID;if(this.Xl=!!y&&!Ae(y),void 0!==(null==(o=e.bootstrap)?void 0:o.distinctID)){var _=e.bootstrap.distinctID,b=this.get_distinct_id(),w=this.persistence.get_property(Pt);if(e.bootstrap.isIdentifiedID&&null!=b&&b!==_&&"anonymous"===w)this.identify(_);else if(e.bootstrap.isIdentifiedID&&null!=b&&b!==_&&"identified"===w)Pn.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 k=this.config.get_device_id(ga()),S=e.bootstrap.isIdentifiedID?k:_;this.persistence.set_property(Pt,e.bootstrap.isIdentifiedID?ie:ee),this.register({distinct_id:_,$device_id:S})}}if(m)this.register_once({distinct_id:qt,$device_id:null},"");else if(!this.get_distinct_id()){var C=this.config.get_device_id(ga());this.register_once({distinct_id:C,$device_id:C},""),this.persistence.set_property(Pt,ee)}return zn(l,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),zn(l,"pageshow",()=>{var t;this.iu=!1,this.ru||null==(t=this.mu)||t.resume()}),e.segment?E_(this,()=>this.wu()):this.wu(),Te(this.config._onCapture)&&this.config._onCapture!==Ub&&(Pn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",t=>this.config._onCapture(t.event,t))),this.config.ip&&Pn.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 Eb.apply(this,arguments)}().then(t=>{t&&this.register({[x]:t})}).catch(Ub),this}ku(t){var e=t;return Re(e.name)&&Te(e.setup)}Su(t,e){this.ku(t)?e.push(()=>{this.xu().add(t).catch(()=>null==t.dispose?void 0:t.dispose()).catch(e=>{Pn.error('Failed to dispose browser extension "'+t.name+'"',e)})}):this.ql.push(t)}bu(){var e,i,r,n,s,o,a=null!==(e=null==(i=this.config.__extensionClasses)?void 0:i.featureFlags)&&void 0!==e?e:null==(r=t.__defaultExtensionClasses)?void 0:r.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(o=this.Cu)||o.call(this),this.Cu=void 0,this.featureFlags=new a(this)),Te(this.featureFlags.onReloading)&&Te(this.featureFlags.setup)?this.Cu||(this.Cu=this.featureFlags.onReloading(()=>{this.zl.emit("featureFlagsReloading",!0)}),this.xu().add(this.featureFlags)):null==(n=(s=this.featureFlags).initialize)||n.call(s))}_u(e){var i,r,n,o,a,l,u,h=performance.now(),d=s({},t.__defaultExtensionClasses,this.config.__extensionClasses),v=[];d.exceptions&&this.ql.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new d.exceptions(this)),d.historyAutocapture&&this.ql.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.ql.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.ql.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!e&&this.ql.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||v.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),d.autocapture&&this.Su(this.autocapture=new d.autocapture(this),v),d.surveys&&this.Su(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new d.surveys(this),v),d.logs&&this.Su(this.logs=null!==(n=this.logs)&&void 0!==n?n:new d.logs(this),v),d.metrics&&this.ql.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new d.metrics(this)),d.conversations&&this.ql.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new d.conversations(this)),d.productTours&&this.ql.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.ql.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.ql.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.ql.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.ql.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,x_)),d.toolbar&&this.ql.push(this.toolbar=null!==(l=this.toolbar)&&void 0!==l?l:new d.toolbar(this)),d.experiments&&this.ql.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this.ql.forEach(t=>{t.initialize&&v.push(()=>{null==t.initialize||t.initialize()})}),v.push(()=>{if(this.Tu){var t=this.Tu;this.Tu=void 0,this.ql.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}}),this.Mu(v,h)}Mu(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout(()=>{this.Mu(t,e)},0);var i=t.shift();if(i)try{i()}catch(t){Pn.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[Bt]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Ut]:r}),this.config.__preview_deferred_init_extensions&&Pn.info("PostHog extensions initialized ("+r+"ms)")}Pa(t){var e;if(!d||!d.body)return Pn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Pa(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.Tu=t),this.Hl=t,this.compression=void 0,t.ok){var i,r=t.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=ve(r.supportedCompression,zf.GZipJS)?zf.GZipJS:ve(r.supportedCompression,zf.Base64)?zf.Base64:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.hu?this.hu:re}),null==(e=this.Iu)||e.handleRemoteConfig(t),this.ql.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}wu(){try{this.config.loaded(this)}catch(t){Pn.critical("`loaded` function failed",t)}if(this.Eu(),this.config.internal_or_test_user_hostname&&null!=v&&v.hostname){var t=v.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.Jl())&&this.Ru()},1),this.Au=new X_(this),this.Au.load()}Eu(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.pu)||t.enable())}_dom_loaded(){this.is_capturing()&&Fn(this.__request_queue,t=>this.gu(t)),this.__request_queue=[],this.Eu()}_handle_unload(){var t,e,i,r,n;this.iu=!0,null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.Pu()&&this.capture(ae),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.pu)||r.unload(),null==(n=this.mu)||n.unload()):this.Pu()&&this.capture(ae,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?Kb?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=s({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?null!==(e=this.compression)&&void 0!==e?e:t.compressionFallback:t.compression,(Ie(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=s({},t);n.timeout=n.timeout||6e4;var o,a,l,u,h,d=null!==(e=n.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Ie(n.compression)&&n.data&&(n.compression=zf.Base64),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data={api_key:null!==(a=null==(h=(u=(Ce(o=n.data)?o:[o]).map(t=>s({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{})))[0])||null==(l=h.properties)?void 0:l.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()),Ce(t)?t.map(t=>s({},t,{sent_at:e})):s({},t,{sent_at:e})}(n.data))),n.url=pb(n.url,n.method,n.compression,n.timestampMode);var v=gb.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){db(t)?Pn.warn(t):Pn.error(t),null==n.callback||n.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&n.data&&n.compression===zf.GZipJS&&g&&"undefined"!=typeof Promise&&!rb?ub(n).then(t=>{f(t)}).catch(e=>{if(nn(e))return rb=!0,void f(s({},n,{compression:void 0,url:pb(t.url,t.method,void 0,t.timestampMode)}));sn(e)&&(rb=!0),f(n)}):c(n)})(s({},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}))}gu(t){this.mu?this.mu.retriableRequest(t):this._send_request(t)}_execute_array(t){Bb++;try{var e,i=[],r=[],n=[];Fn(t,t=>{if(t)if(Ce(e=t[0]))n.push(t);else if(Te(t))try{t.call(this)}catch(e){Pn.error("Error executing queued PostHog call",t,e)}else Ce(t)&&"alias"===e?i.push(t):Ce(t)&&-1!==e.indexOf("capture")&&Te(this[e])?n.push(t):r.push(t)});var s=function(t,e){Fn(t,function(t){try{if(Ce(t[0])){var i=e;$n(t,function(t){i=i[t[0]].apply(i,t.slice(1))})}else e[t[0]].apply(e,t.slice(1))}catch(e){Pn.error("Error executing queued PostHog call",t,e)}})};s(i,this),s(r,this),s(n,this)}finally{Bb--}}push(e){if(Bb>0&&Ce(e)&&Re(e[0])){var i=t.prototype[e[0]];Te(i)&&i.apply(this,e.slice(1))}else this._execute_array([e])}Fu(){var t,e=null==(t=this.persistence)?void 0:t.get_property(M);return Re(e)&&Zb.test(e)?{value:e,delivered:!1}:Ee(e)&&Re(e.value)&&Zb.test(e.value)?{value:e.value,delivered:!0===e.delivered}:void 0}Ou(t,e,i,r){if(this.persistence){this.persistence.refreshKey(M);var n=this.Fu();if(!r){if(i)return Re(e)&&Zb.test(e)?(e!==(null==n?void 0:n.value)&&this.persistence.register({[M]:{value:e,delivered:!1}}),{value:e,pending:e!==(null==n?void 0:n.value)||!n.delivered}):void this.persistence.unregister(M);if(Re(t)&&Gb.test(t)){if((null==n?void 0:n.value.split(".")[3])===t)return{value:n.value,pending:!n.delivered};var s="fb.1."+Date.now()+"."+t;return this.persistence.register({[M]:{value:s,delivered:!1}}),{value:s,pending:!0}}return n?{value:n.value,pending:!n.delivered}:void 0}this.persistence.unregister(M)}}$u(t){if(this.persistence){this.persistence.refreshKey(M);var e=this.Fu();(null==e?void 0:e.value)!==t||e.delivered||this.persistence.register({[M]:{value:t,delivered:!0}})}}capture(t,e,i){var r,n,o,a,l,u,h,d,v,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.pu){if(this.is_capturing())if(!Ie(t)&&Re(t)){this.Yl();var f=!this.config.opt_out_useragent_filter&&this._is_bot();if(!f||this.config.__preview_capture_bot_pageviews){var p=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==p||!p.isRateLimited){var g;null!=e&&e.$current_url&&!Re(null==e?void 0:e.$current_url)&&(Pn.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.Du||Pn.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&&(g=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 m=new Date,y=(null==i?void 0:i.timestamp)||m,_=or(null==i?void 0:i.uuid,ga),b={uuid:_,event:t,properties:this.calculateEventProperties(t,e||{},y,_)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&f&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),p&&(b.properties.$lib_rate_limit_remaining_tokens=p.remainingTokens);var w="$feature_flag_called"===t&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=i&&i.$set&&!w&&(b.$set=null==i?void 0:i.$set);var k=Ee(null==e?void 0:e.$set)?e.$set:void 0,S=!(null==i||!i.$set)&&"$fbc"in i.$set,x=S||!!k&&"$fbc"in k,C=S?null==i||null==(r=i.$set)?void 0:r[E]:null==k?void 0:k[E],T=Ce(null==e?void 0:e.$unset)?e.$unset:[],M=(null==i?void 0:i.$unset)||[],I=-1!==T.indexOf("$fbc")||-1!==M.indexOf("$fbc"),R=this.Ou(null==(n=g)?void 0:n.fbclid,C,x,I);R&&!0===b.properties.$process_person_profile&&R.pending&&!x&&!w&&(b.$set=s({[E]:R.value},b.$set));var A=null==i?void 0:i.$unset;A&&(b.$unset=A);var P=w?void 0:this.Lu(null==i?void 0:i.$set_once,t!==ue,t===le);if(P&&(b.$set_once=P),null!=i&&i._noTruncate||(h=this.config.properties_string_max_length,d=b,v=t=>Re(t)?t.slice(0,h):t,c=new Set,b=function t(e,i){if(e!==Object(e))return v?v(e):e;if(!c.has(e)){var r;if(c.add(e),Ce(e))r=[],Fn(e,e=>{r.push(t(e))});else{var n={};$n(Ue(e)?Bn(e):e,(e,i)=>{c.has(e)||(n[i]=t(e,i))}),r=n}return r}}(d)),b.timestamp=y,Ie(null==i?void 0:i.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=m),w&&(b.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return Xr.forEach(r),e.forEach(r),i}(b.properties,Qb)),t===Xf.DISMISSED||t===Xf.SENT){var O=null==e?void 0:e[tp.SURVEY_ID],F=null==e?void 0:e[tp.SURVEY_ITERATION];lp({id:O,current_iteration:F}),b.$set=s({},b.$set,{[za({id:O,current_iteration:F},t===Xf.SENT?"responded":"dismissed")]:!0})}else t===Xf.SHOWN&&(b.$set=s({},b.$set,{[tp.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===Z_.SHOWN){var D=null==e?void 0:e[Q_.TOUR_TYPE];D&&(b.$set=s({},b.$set,{[Q_.TOUR_LAST_SEEN_DATE+"/"+D]:(new Date).toISOString()}))}var L=s({},b.properties.$set,b.$set);if(Me(L)||this.setPersonPropertiesForFlags(L),!Oe(this.config.before_send)){var N=this.bs(b);if(!N)return;(b=N).uuid=or(b.uuid,ga)}var q=null!==(o=null==(a=b.$set)?void 0:a.$fbc)&&void 0!==o?o:Ee(null==(l=b.properties)?void 0:l.$set)?b.properties.$set.$fbc:void 0,j=null!=R&&R.pending&&q===R.value?R.value:void 0;this.zl.emit("eventCaptured",b);var B,U=null!==(u=null==i?void 0:i._url)&&void 0!==u?u:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),H=s({method:"POST",url:U,data:b,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(U)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},j?{fireCallbackOnDrop:!0,callback:t=>{t.statusCode>=200&&300>t.statusCode&&this.$u(j)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||j?(!H.transport&&!H.callback&&Me(null!==(B=this.config.request_headers)&&void 0!==B?B:{})&&this.iu&&(H.transport="sendBeacon"),this.gu(H)):this.pu.enqueue(H),b}Pn.critical("This capture call is ignored due to client rate limiting.")}}else Pn.error("No event name provided to posthog.capture")}else Pn.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",e=>t(e.event,e))}getExtension(t){var e;return null==(e=this.Iu)?void 0:e.getExtension(t)}xu(){var t;return null!==(t=this.Iu)&&void 0!==t?t:this.Iu=new qb(this)}Wl(t){this.au.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.au.indexOf(t);-1!==i&&this.au.splice(i,1)}}}Nu(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.du=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(r=this.sessionPersistence)||r.clear(),this.su.clear(),this.qu()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(t,e,i,r,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;this.persistence.syncCookieProperties(),this.Nu();var o=n?void 0:this.persistence.remove_event_timer(t),a=s({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Jl()&&(a[jt]=!0),"$snapshot"===t){var u=s({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!Re(a.distinct_id)&&!Fe(a.distinct_id)||Ae(a.distinct_id))&&Pn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var h,c=function(t,e,i,r){var n,s,o,a;if(void 0===r&&(r=!1),!m)return{};var u,h=t?[...hl,...e||[]]:[],d=Zi(m),c=d[0],f=d[1],p=function(t){for(var e=0;Yi.length>e;e++){var i,r=Yi[e],n=r[1],s=r[2],o=t.match(r[0]);if(o)return[n,(null==(i=s&&t.match(s)||o)?void 0:i[1])||""]}return["",""]}(m),g=p[0],y=p[1],_=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},b={};Ie(i)||(b.detectGoogleSearchApp=i);var w={},k=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,S=null==(s=navigator)?void 0:s.maxTouchPoints,x=null==l||null==(o=l.screen)?void 0:o.width,C=null==l||null==(a=l.screen)?void 0:a.height,T=null==l?void 0:l.devicePixelRatio;Ie(k)||(w.userAgentDataPlatform=k),Ie(S)||(w.maxTouchPoints=S),Ie(x)||(w.screenWidth=x),Ie(C)||(w.screenHeight=C),Ie(T)||(w.devicePixelRatio=T);var E,M=Dn(jn({$os:c,$os_version:f,$browser:zi(m,navigator.vendor,_,b),$webview_app:g,$webview_app_version:y,$device:Qi(m),$device_type:Ji(m,w),$timezone:kl(),$timezone_offset:Sl()}),{$current_url:Kn(r?lr(null==v?void 0:v.href):null==v?void 0:v.href,h,vl),$host:null==v?void 0:v.host,$pathname:null==v?void 0:v.pathname,$raw_user_agent:m.length>1e3?m.substring(0,997)+"...":m,$browser_version:Vi(m,navigator.vendor,_,b),$browser_language:ml(),$browser_language_prefix:(E=ml(),"string"==typeof E?E.split("-")[0]:void 0),$screen_height:null==l?void 0:l.screen.height,$screen_width:null==l?void 0:l.screen.width,$viewport_height:null==l?void 0:l.innerHeight,$viewport_width:null==l?void 0:l.innerWidth,$lib:Rn.LIB_NAME,$lib_version:Rn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Rn.SDK_DIST_CHANNEL&&(M.$sdk_dist_channel=Rn.SDK_DIST_CHANNEL),M}(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(n,i.getTime(),!0),p=f.windowId;a.$session_id=f.sessionId,a.$window_id=p}this.sessionPropsManager&&Dn(a,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&Dn(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(g=this.mu)?void 0:g.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===Mb&&(a.$lib_custom_api_host=this.config.api_host),h="$pageview"!==t||n?"$pageleave"!==t||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),a=Dn(a,h),"$pageview"===t&&d&&(a.title=d.title),!Ie(o)){var y=i.getTime()-o;a.$duration=parseFloat((y/1e3).toFixed(3))}m&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var _=this.persistence.properties(),b=this.sessionPersistence.properties(),w=a.$groups,k=_.$groups;Ee(w)&&!Me(w)&&(a.$groups=s({},Ee(k)?k:{},w)),$n(["$referrer","$referring_domain"],t=>{t in _&&delete b[t]});var S={};if(this.au.length>0)for(var x of this.au.slice())try{Dn(S,x())}catch(t){Pn.error("Failed to produce browser extension event properties",t)}(a=Dn({},c,_,b,s({},S,a))).$is_identified=this._isIdentified(),Ce(this.config.property_denylist)?$n(this.config.property_denylist,function(t){delete a[t]}):Pn.error(Vb+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var C=this.config.sanitize_properties;C&&(Pn.error(Wb),a=C(a,t));var T=this.ju();return a.$process_person_profile=T,T&&!n&&this.Bu("_calculate_event_properties"),a}Lu(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.ju())return t;if(this.nu&&!i)return t;var n=Dn({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},t||{}),s=this.config.sanitize_properties;return s&&(Pn.error(Wb),n=s(n,"$set_once")),e&&(this.nu=!0),Me(n)?void 0:n}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.Nu(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach(t=>this.su.add(t)),this.qu()}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.su.delete(t),this.qu()}Hu(t,e){this.register({[t]:e})}yu(){this.su.forEach(t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)}),this.su.clear(),this.qu()}qu(){var t;if(this.ou)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.gi||!La.Et())La.Dt(this.ou);else{var e=[];this.su.forEach(t=>e.push(t)),e.length>0?La.Ot(this.ou,e):La.Dt(this.ou)}}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.zl.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:zb}),()=>{})}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:zb})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:zb})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=hp),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:zb}}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:zb})}zu(t){return!t||Ae(t)?(Pn.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===t?(Pn.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())||(Pn.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 Pn.uninitializedWarning("posthog.identify");if(Fe(t)&&(t=t.toString(),Pn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.zu(t)&&this.Bu("posthog.identify")){this.Yl();var r=this.get_distinct_id(),n=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,s=this.Nu(!1),o=this.persistence.va(),a=!1;try{var l=this.get_distinct_id();this.register({$user_id:t}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),t!==l&&t!==this.get_property("__alias")&&(this.unregister(C),this.register({distinct_id:t}));var u=(this.persistence.get_property("$user_state")||"anonymous")===ee,h=t!==l,d=!h&&u;if(h&&u){var v,c=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:l};this.persistence.set_property(Pt,ie),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.ca(),this.capture(le,c,{$set:e||{},$set_once:i||{}}),this.du=il(t,e,i),null==(v=this.featureFlags)||v.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:l)}else if(d){this.persistence.set_property(Pt,ie);var f=e||{},p=i||{};this.setPersonPropertiesForFlags({$set:f,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.ca(),this.capture("$set",{$set:f,$set_once:p}),this.du=il(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);h||n||s?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Mt)):d&&(e||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.ga(a)}}}setPersonProperties(t,e){if((t||e)&&this.Bu("posthog.setPersonProperties")){var i=il(this.get_distinct_id(),t,e);this.du!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.du=i):Pn.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(Ce(t)?t:[t]).filter(t=>Re(t)&&t.length>0);0!==i.length&&this.Bu("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.du=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.Nu();var n=this.getGroups(),o=n[t]!==e;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:s({},n,{[t]:e})}),(o||i)&&this.ju()){var a={$group_type:t,$group_key:e};i&&(a.$group_set=i),this.capture(ue,a)}i&&this.setGroupPropertiesForFlags({[t]:i}),o&&!i&&this.reloadFeatureFlags()}else Pn.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.Bu("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=De(t)?t:null==t?void 0:t.resetDeviceID,i=De(t)||null==t?void 0:t.bootstrap;this.Uu(e,!1,i)}Uu(t,e,i){var r,n,o,a;if(void 0===e&&(e=!1),Pn.info("reset"),!this.__loaded)return Pn.uninitializedWarning("posthog.reset");var l=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.cu)?void 0:r.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this.Fa());var u=this.get_property(S),h=this.get_property(x),d=this.get_property(B);null==(o=this.sessionRecording)||o.flushBeforeIdentityReset();var v=this.is_capturing();this.consent.reset(),e||!v||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 c=null==(a=this.persistence)||null==a.va?void 0:a.va(),f=!1;try{var p,g,m,y,_,b,w,k,C,T,E,M,I;if(null==(p=this.persistence)||p.clear(),null==(g=this.sessionPersistence)||g.clear(),this.su.clear(),this.qu(),Ie(d)||null==(m=this.persistence)||m.register({[B]:d}),null==(y=this.surveys)||y.reset(),null==(_=this.featureFlags)||_.reset(),null==(b=this.conversations)||b.reset(),null==(w=this.logs)||w.reset(),null==(k=this.metrics)||k.reset(),null==(C=this.persistence)||C.set_property(Pt,ee),null==(T=this.sessionManager)||T.resetSessionId(),this.du=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:qt,$device_id:null},"");else{var R=this.config.get_device_id(ga());this.register_once({distinct_id:R,$device_id:t?R:u},""),t||Ie(h)||this.register({[x]:h})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.Jl()||(null==(I=this.persistence)||I.set_property(Pt,i.isIdentifiedID?ie:ee),this.register({distinct_id:i.distinctID})),null==(E=this.featureFlags)||E.initialize(),!(Ie(l)||null!=(M=this.sessionManager)&&M.setBootstrapSessionId(l,!0))){var A=s({},i);delete A.sessionID,this.config.bootstrap=A}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,f=!0}finally{var P;c&&(null==(P=this.persistence)||null==P.ga||P.ga(f))}this.reloadFeatureFlags()}shutdown(t){var e=this;return a(function*(){var t,i,r,n,s,o,a;if(e.__loaded){e.ru=!0,e.xu().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(n=e.pu)||n.unload(),null==(s=e.mu)||s.unload();try{var l;null==(l=e.featureFlags)||l.destroy()}catch(t){Pn.error("Error while destroying feature flags",t)}null==(o=e.persistence)||o.destroy(),null==(a=e.sessionPersistence)||a.destroy()}else Pn.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,e){var i;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.Wu()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(t=this.conversations)||t.Vu()}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("$people_distinct_id")?(Pn.critical("Attempting to create alias for existing People user - aborting."),-2):this.Bu("posthog.alias")?(Ie(e)&&(e=this.get_distinct_id()),t!==e?(this.Hu(C,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(Pn.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=s({},this.config);if(Ee(t)){var i,r,n,o,a,l,u,h,d,v,c,f,p;Dn(this.config,ew(t));var g=this.tu();null==(i=this.persistence)||i.update_config(this.config,e,g),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new V_(s({},this.config,{persistence:"sessionStorage"}),g,!1);var m=this.vu(this.config.debug);De(m)&&(this.config.debug=m),De(this.config.debug)&&(this.config.debug?(Na.DEBUG=!0,Sa.Et()&&Sa.Ot("ph_debug",!0),Pn.info("set_config",{config:t,oldConfig:e,newConfig:s({},this.config)})):(Na.DEBUG=!1,Sa.Et()&&Sa.Dt("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Fa()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(o=this.exceptions)||o.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(l=this.tracingHeaders)||l.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(h=this.heatmaps)||h.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(d=this.historyAutocapture)||d.startIfEnabledOrStop()),null==(v=this.exceptionObserver)||v.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||c.startIfEnabledOrStop(),null==(f=this.surveys)||f.loadIfEnabled(),this.eu(),null==(p=this.externalIntegrations)||p.startIfEnabledOrStop(),!e.segment&&this.config.segment&&this.persistence&&E_(this,Ub,!1)}}_overrideSDKInfo(t,e){Na.LIB_NAME=t,Na.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.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){try{if(!this.exceptions)return;var i=this.exceptions.buildProperties(t,{handled:!0,syntheticException:new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(s({},i,e))}catch(t){return}}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 e,i;return null!==(e=null==(i=this.logs)?void 0:i.logger)&&void 0!==e?e:t.Gu}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:Jb;return e!==Jb&&(e="posthog."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property("$user_state"))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property("$user_state"))}ju(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Me(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t.__alias)&&(null==(e=this.persistence)||null==(e=e.props)||!e.$epp))}Pu(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.ju()||this.Bu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Bu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Bu(t){return"never"===this.config.person_profiles?(Pn.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ql(),this.Hu(Nt,!0),!0)}tu(){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&&"on_reject"!==this.config.cookieless_mode)}eu(){var t,e,i,r,n,s=this.tu();return this.is_capturing()||null==(t=this.logs)||t.Zu(),(null==(e=this.persistence)?void 0:e.gi)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(r=this.sessionPersistence)?void 0:r.gi)!==s&&(null==(n=this.sessionPersistence)||n.set_disabled(s)),s&&(this.su.clear(),this.qu()),s}opt_in_capturing(e){var i,r,n;if("always"!==this.config.cookieless_mode){if(this.Jl()){var s,o,a,l,u,h;null==(s=this.sessionRecording)||s.dispose({discardBufferedEvents:!0}),this.Uu(!0,!0),null==(o=this.sessionManager)||o.destroy(),null==(a=this.pageViewManager)||a.destroy(),this.sessionManager=new Cb(this),this.pageViewManager=new A_(this),this.persistence&&(this.sessionPropsManager=new wb(this,this.sessionManager,this.persistence));var d,v=null!==(l=null==(u=this.config.__extensionClasses)?void 0:u.sessionRecording)&&void 0!==l?l:null==(h=t.__defaultExtensionClasses)?void 0:h.sessionRecording;v&&(this.sessionRecording=this.Zl(this.sessionRecording,new v(this)),this.Hl&&(null==(d=this.sessionRecording)||null==d.onRemoteConfig||d.onRemoteConfig(this.Hl)))}this.consent.optInOut(!0),this.eu(),this.Eu(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(r=this.surveys)||r.loadIfEnabled()),(Ie(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(n=null==e?void 0:e.captureEventName)&&void 0!==n?n:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ru()}else Pn.warn(Hb)}opt_out_capturing(){if("always"!==this.config.cookieless_mode){var t,e,i="on_reject"===this.config.cookieless_mode?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),"on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.Uu(!0,!0),this.consent.optInOut(!1),this.eu(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:qt,$device_id:null}),this.Gl(i),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Ru(),this.Eu())}else Pn.warn(Hb)}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"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.eu()}_is_bot(){return h?Tb(h,this.config.custom_blocked_useragents):void 0}Ru(){d&&("visible"===d.visibilityState?this.lu||(this.lu=!0,this.capture(oe,{title:d.title},{send_instantly:!0}),this.uu&&(d.removeEventListener(ne,this.uu),this.uu=null)):this.uu||(this.uu=this.Ru.bind(this),zn(d,ne,this.uu)))}debug(t){!1===t?(null==l||l.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==l||l.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}))}Fa(){var t=this.cu||{};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?(Pn.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&&!Oe(t[e]),o=i in t&&!Oe(t[i]);return s?t[e]:!!o&&(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,Pn)}bs(t){var e;if(Oe(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(qe),r=Ce(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r)try{if(n=s(n),Oe(n)){var o="Event '"+t.event+"' was rejected in beforeSend function";return Ne(t.event)?Pn.warn(o+". This can cause unexpected behavior."):Pn.info(o),null}n.properties&&!Me(n.properties)||Pn.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return Pn.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var a of i)if(n.properties&&Oe(n.properties[a]))return Pn.warn("Event '"+t.event+"' had its '"+a+"' 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.ko)?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)})}vu(t){var e=De(t)&&!t,i=Sa.Et()&&"true"===Sa.Lt("ph_debug");return!e&&(!!i||t)}},t.__defaultExtensionClasses={},t.Gu=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),t);!function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=qn(t.prototype[e[i]])}(rw,["identify"]);var nw=class{constructor(t){this._instance=t}refresh(t){var e=this._instance.config,i=Ee(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.Fa(),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}},sw=On("[ExceptionAutocapture]"),ow=On("[TracingHeaders]"),aw=On("[Web Vitals]"),lw=9e5,uw=["CLS","FCP","INP","LCP"],hw=["INP","LCP"],dw=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],vw=On("[SessionRecording]"),cw=On("[Heatmaps]");function fw(t){return Ee(t)&&"clientX"in t&&"clientY"in t&&Fe(t.clientX)&&Fe(t.clientY)}var pw=On("[Product Tours]"),gw=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(N))},mw=On("[SiteApps]"),yw="Error while initializing PostHog app with config id ",_w=(t,e)=>null!=t&&t.then?t.then(e):e(t),bw="SDK is not enabled or survey functionality is not yet loaded",ww="Disabled. Not loading surveys.",kw=class{constructor(t,e){this.Ks=t,this.Ju=e,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Qu=!1,this.Ku=[],this.Xu=null,this.Yu=null,this.ro=!1,this.th=new Set,this.onRemoteConfig=t=>{if(!this.ro&&!this.Rn.disableSurveys){if(!t.ok)return rp.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Oe(e))return rp.warn("Flags not loaded yet. Not loading surveys.");this.eh=De(e)?e:e.length>0,rp.info("flags response received, isSurveysEnabled: "+this.eh),this.loadIfEnabled()}}}setup(t){if(!this.ro)return this.ih=t,_w(t.kv.initialize(),()=>{if(this.ih===t&&!this.ro){this.ih=void 0,this.Js=t;var e=t.onRemoteConfig(this.onRemoteConfig);this.ro?e.dispose():(this.oo=e,this.loadIfEnabled())}})}dispose(){var t,e,i;this.ro||(this.ro=!0,this.ih=void 0,this.Js=void 0,null==(t=this.oo)||t.dispose(),this.oo=void 0,null==(e=this._surveyEventReceiver)||e.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Ku=[],this.Xu=null,this.th.forEach(t=>clearTimeout(t)),this.th.clear())}get Rn(){return this.Ks.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("seenSurvey_")||null!=r&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach(t=>localStorage.removeItem(t))}catch(t){}}loadIfEnabled(){if(!this.ro&&this.Js){var t=this.Rn;if(!this._surveyManager)if(this.Qu)rp.info("Already initializing surveys, skipping...");else if(t.disableSurveys)rp.info(ww);else if(t.cookielessMode&&this.Ks.isOptedOut())rp.info("Not loading surveys in cookieless mode without consent.");else{var e=this.Ks.getExtensions();if(e){if(!Ie(this.eh)||t.advancedEnableSurveys){var i=this.eh||t.advancedEnableSurveys;this.Qu=!0;try{var r=e.generateSurveys;if(r)return this.rh(r,i),void(this.Qu=!1);var n=e.loadExternalDependency;if(!n)return this.nh(te),void(this.Qu=!1);n(t=>{try{if(this.ro)return;var e=this.Ks.getExtensions();t||null==e||!e.generateSurveys?this.nh("Could not load surveys script",t):this.rh(e.generateSurveys,i)}finally{this.Qu=!1}})}catch(t){throw this.Qu=!1,this.nh("Error initializing surveys",t),t}}}else rp.error("PostHog Extensions not found.")}}}rh(t,e){this.ro||(this._surveyManager=t(e),this._surveyEventReceiver=this.Ks.createEventReceiver(),rp.info("Surveys loaded successfully"),this.sh({isLoaded:!0}))}nh(t,e){rp.error(t,e),this.sh({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ku.push(t),this._surveyManager&&this.sh({isLoaded:!0}),()=>{this.Ku=this.Ku.filter(e=>e!==t)}}getSurveys(t,e){var i;void 0===e&&(e=!1);var r=null!==(i=this.Js)&&void 0!==i?i:this.Ju;if(r&&!this.ro){if(this.Rn.disableSurveys)return rp.info(ww),t([]);var n=r.kv.get(gt);if(n&&!e)return t(n,{isLoaded:!0}),void(this.oh()&&this.getSurveys(()=>{},!0));if(this.Xu)this.Xu.then(e=>{this.ro||t(e.surveys,e.context)}).catch(t=>rp.error("Error in survey callback",t));else{var s=this.ah("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.Rn.requestTimeoutMs}).then(t=>{try{return this.uh(r,t)}catch(t){return rp.error("Error processing surveys response",t),this.uh(r,{statusCode:0,error:t})}},t=>this.uh(r,{statusCode:0,error:t}));this.Xu=s;var o=()=>{this.Xu===s&&(this.Xu=null)};s.then(e=>{o(),this.ro||t(e.surveys,e.context)},o).catch(t=>rp.error("Error in survey callback",t))}}}ah(t,e){var i=this.Js;return i?i.sendRequest(t,e):new Promise(t=>t({statusCode:0,error:new Error(bw)}))}uh(t,e){var i;if(this.ro)return{surveys:[],context:{isLoaded:!1,error:bw}};var r=e.statusCode;if(200!==r||!e.json){var n="Surveys API could not be loaded, status: "+r;return 0!==r?rp.error(n):e.error||rp.warn(n),this.Yu=Date.now(),{surveys:[],context:{isLoaded:!1,error:n}}}this.Yu=null;var s=e.json.surveys||[],o=s.filter(t=>np(t)&&(Ja(t)||sp(t)));return o.length>0&&(null==(i=this._surveyEventReceiver)||i.register(o)),t.kv.set({[gt]:s,[mt]:Date.now()}),{surveys:s,context:{isLoaded:!0}}}oh(){return this.hh()&&!this.Xu&&!this.dh()}hh(){var t,e,i=null==(t=null!==(e=this.Js)&&void 0!==e?e:this.Ju)?void 0:t.kv.get(mt);return Fe(i)&&Date.now()-i>3e5}dh(){return Fe(this.Yu)&&3e5>Date.now()-this.Yu}markSurveyAsSeen(t,e){var i;lp({id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}sh(t){for(var e of this.Ku)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){rp.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Oe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);rp.warn("init was not called")}fh(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}ph(t){if(Oe(this._surveyManager))return{eligible:!1,reason:bw};var e="string"==typeof t?this.fh(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}gh(t){if(Oe(this._surveyManager))return{eligible:!1,reason:bw};var e="string"==typeof t?this.fh(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Oe(this._surveyManager))return rp.warn("init was not called"),{visible:!1,disabledReason:bw};var e=this.gh(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Oe(this._surveyManager)?(rp.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:bw})):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.gh(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(t,e,i){var r;if(Oe(this._surveyManager))rp.warn("init was not called");else{var n="string"==typeof t?this.fh(t):t;if(null!=n&&n.id)if(up.includes(n.type)){var s=null==d?void 0:d.querySelector(e);if(s)if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds){rp.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds");var o=setTimeout(()=>{var t,e;this.th.delete(o),this.ro||(rp.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,i),rp.info("Survey "+n.id+" rendered"))},1e3*n.appearance.surveyPopupDelaySeconds);this.th.add(o)}else this._surveyManager.renderSurvey(n,s,i);else rp.warn("Survey element not found")}else rp.warn("Surveys of type "+n.type+" cannot be rendered in the app");else rp.warn("Survey not found")}}displaySurvey(t,e){var i;if(Oe(this._surveyManager))rp.warn("init was not called");else{var r=this.fh(t);if(r){var n=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(n=s({},r,{appearance:s({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==ep.Popover&&e.initialResponses&&rp.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.ph(r);if(!o.eligible)return void rp.warn("Survey is not eligible to be displayed: ",o.reason)}e.displayType!==ep.Inline?this._surveyManager.handlePopoverSurvey(n,e):this.renderSurvey(n,e.selector,e.properties)}else rp.warn("Survey not found")}}cancelPendingSurvey(t){Oe(this._surveyManager)?rp.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}};function Sw(t,e,i){if(Oe(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}}var xw=class{constructor(t){this._instance=t,this.mh=new Set,this.yh=new Set,this.bh=new kb,this._h=(t,e)=>this.wh(t,e)&&this.kh(t,e)&&this.Sh(t,e)&&this.xh(t,e),this.wh=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event)}init(){var t,e;Ie(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Ch=null==(e=this._instance)?void 0:e._addCaptureHook((t,e)=>{this.on(t,e)}))}dispose(){var t;null==(t=this.Ch)||t.call(this),this.Ch=void 0,this.bh=new kb}register(t){var e,i;if(!Ie(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach(t=>{var e;this.mh.add(t),null==(e=t.steps)||e.forEach(t=>{this.yh.add((null==t?void 0:t.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r=new Set;this.mh.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.mh.clear(),this.yh.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.yh.has(t)||this.yh.has(e.event))&&this.mh.forEach(t=>{this.Th(e,t)&&this.bh.emit("actionCaptured",t.name)})}Mh(t){this.onAction("actionCaptured",e=>t(e))}Th(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this._h(t,i))return!0;return!1}onAction(t,e){return this.bh.on(t,e)}kh(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(!Sw(r,e.url,e.url_matching||"contains"))return!1}return!0}Sh(t,e){return!!this.Ih(t,e)&&!!this.Eh(t,e)&&!!this.Rh(t,e)}Ih(t,e){var i;if(null==e||!e.href)return!0;var r=this.Ah(t);if(r.length>0)return r.some(t=>Sw(t.href,e.href,e.href_matching||"exact"));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&Sw((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Eh(t,e){var i;if(null==e||!e.text)return!0;var r=this.Ah(t);if(r.length>0)return r.some(t=>Sw(t.text,e.text,e.text_matching||"exact")||Sw(t.$el_text,e.text,e.text_matching||"exact"));var n,s,o,a=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!a&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!Oe(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(a),s=e.text,o=e.text_matching||"exact",n.some(t=>Sw(t,s,o)))}Rh(t,e){var i,r;if(null==e||!e.selector)return!0;if(null!=t&&null!=(i=t.properties)&&null!=(i=i.$element_selectors)&&i.includes(e.selector))return!0;var n=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&n)try{return new RegExp(e.selector_regex).test(n)}catch(t){return!1}return!1}Ah(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}xh(t,e){return null==e||!e.properties||0===e.properties.length||el(e.properties.reduce((t,e)=>{var i=Ce(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)}},Cw=class{constructor(t){var e;this.Ph=[],this._instance=t,this.Fh=new Map,this.Oh=new Map,this.$h=new Map,this.Dh=null==(e=this._instance)||null==e.onSessionId?void 0:e.onSessionId(t=>this.Lh(t))}Nh(t){return!1}qh(){return null}jh(t){}Bh(){}Hh(t,e){return!!t&&el(t.propertyFilters,null==e?void 0:e.properties)}zh(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}Uh(t,e,i){var r=(i===Wf.Activation?this.Fh:this.Oh).get(t),n=[];return this.Wh(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.Hh(s,e)})}register(t){this.Vh(t,!1)}replace(t){this.Vh(t,!0)}Vh(t,e){var i;Ie(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.Gh(t,e),this.Zh(t,e))}Zh(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.$h.clear(),0!==i.length){this.Jh||(this.Jh=new xw(this._instance),this.Jh.init(),this.Jh.Mh(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.$h.get(e.name))&&void 0!==i?i:[];n.includes(t.id)||n.push(t.id),this.$h.set(e.name,n)}})}),e?this.Jh.replace(r):this.Jh.register(r)}else{var n;e&&(null==(n=this.Jh)||n.replace([]))}}Qh(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)})}Gh(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}),o=this.zh(t,Wf.Activation),a=this.zh(t,Wf.Cancellation);e?(this.Fh=o,this.Oh=a):(this.Qh(this.Fh,o),this.Qh(this.Oh,a)),(0!==n.length||0!==s.length)&&(null!==(i=this.Ch)&&void 0!==i||(this.Ch=null==(r=this._instance)?void 0:r._addCaptureHook((t,e)=>{this.onEvent(t,e)})))}onEvent(t,e){var i,r,n=this.Kh(),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 o=this.Xh(t,s);if("consume"===o)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Yh([s]);if("persist"===o)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.td(s),void this.ed([s])}if(this.Oh.has(t)){var a=this.Uh(t,e,Wf.Cancellation);a.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:a.map(t=>t.id)}),this.Yh(a.map(t=>t.id)),a.forEach(t=>this.rd(t.id)))}if(this.Fh.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.Fh.get(t)});var l=this.Uh(t,e,Wf.Activation);this.nd(l.map(t=>t.id))}}onAction(t){this.$h.has(t)&&this.nd(this.$h.get(t)||[])}nd(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.Nh(n)?this.td(n)&&this.sd(n):r.push(n);r.length>0&&(this.Ph=[...new Set([...this.Ph,...r])]),this.Kh().info("updating activated items",{activatedItems:this.getActivatedIds()})}}td(t){this.Ph=this.Ph.filter(e=>e!==t);var e=this.od();return!e.includes(t)&&(this.ad([...e,t]),this.ld(),!0)}Yh(t){var e=new Set(t);this.Ph=this.Ph.filter(t=>!e.has(t));var i=this.ud(),r=i.filter(t=>!e.has(t));r.length!==i.length&&(this.ad(r),0===r.length&&this.hd()),this.ed(t)}dd(){var t,e=this.qh();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}sd(t){if(this.qh()){var e=this.dd();this.jh(s({},e,{[t]:Date.now()}))}}ed(t){if(this.qh()){var e=this.dd(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],o=n[1];t.includes(s)?r=!0:i[s]=o}r&&(Me(i)?this.Bh():this.jh(i))}}vd(){this.qh()&&this.Bh()}getActivationTimestamp(t){if(this.od().includes(t)){var e=this.dd()[t];return Fe(e)?e:void 0}}ud(){var t,e=this.fd();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}od(){var t,e,i=this.ud();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.pd()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}ld(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.gd(e)}hd(){this.md()}Lh(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.pd()];if(i&&i!==t){var r=this.ud(),n=this.dd();r.length>0&&(this.ad([]),r.filter(t=>Fe(n[t])).forEach(t=>this.rd(t))),this.hd(),this.vd()}}getActivatedIds(){return[...new Set([...this.od(),...this.Ph])].filter(t=>!this.yd(t))}dispose(){var t,e,i;null==(t=this.Dh)||t.call(this),this.Dh=void 0,null==(e=this.Ch)||e.call(this),this.Ch=void 0,null==(i=this.Jh)||i.dispose(),this.Jh=void 0}reset(){this.Ph=[],this.ud().length>0&&this.ad([]),this.hd(),this.vd()}getEventToItemsMap(){return this.Fh}bd(){return this.Jh}},Tw=class extends Cw{constructor(t){super(t)}fd(){return yt}pd(){return _t}qh(){return bt}jh(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[bt]:t})}Bh(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(bt)}Nh(t){var e,i;this.Wh(e=>{i=e.find(e=>e.id===t)});var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return Fe(r)&&r>0}_d(){return Xf.SHOWN}Wh(t){var e;null==(e=this._instance)||e.getSurveys(t)}rd(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Kh(){return rp}ad(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[yt]:t})}gd(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[_t]:t})}md(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(_t)}yd(){return!1}Xh(t,e){var i;return this.Wh(t=>{i=t.find(t=>t.id===e)}),!i||Ka(i)?t===Xf.SHOWN?"consume":"ignore":t===Xf.SHOWN?"persist":t===Xf.DISMISSED||t===Xf.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Ew=class{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);Ie(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)}},Mw=class{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==b?void 0:b.__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 Tw(this._instance)}},Iw=null!=l&&l.location?Yn(l.location.hash,"__posthog")||Yn(location.hash,"state"):null,Rw="_postHogToolbarParams",Aw=On("[Toolbar]"),Pw=On("[FeatureFlags]"),Ow=class{constructor(t,e){void 0===e&&(e=!1),this.wd=!1,this.update(t,e)}update(t,e){this.kd=((t,e)=>{var i,r,n,s,o;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!==(o=t.evaluation_contexts)&&void 0!==o?o:t.evaluation_environments)&&void 0!==s?s:[],flagKeys:Ce(t.flag_keys)?t.flag_keys:void 0}})(t,e),!t.evaluation_environments||t.evaluation_contexts||this.wd||(Pw.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.wd=!0),Ie(t.flag_keys)||Ce(t.flag_keys)||Pw.error("Invalid flag_keys found:",t.flag_keys,"Expected array of non-empty strings")}get(){return this.kd}},Fw=On("[FeatureFlags]"),$w=On("[FeatureFlags]",{debugEnabled:!0}),Dw="\" failed. Feature flags didn't load in time.",Lw="connection_error",Nw=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},qw=t=>{var e={};for(var i of Ln(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},jw="Refusing to render web experiment since the viewer is a likely bot",Bw={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>Ya(e,t),not_regex:(t,e)=>!Ya(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t},Uw=On("[Conversations]"),Hw="Conversations not available yet.";function zw(t,e){var i,r,n,o,a,l,u,d=null!==(i=null==t?void 0:t.flushIntervalMs)&&void 0!==i?i:3e3,v=null!==(r=null==t?void 0:t.maxBufferSize)&&void 0!==r?r:100,c=null!=e&&e.consoleCapture?void 0:null!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,f=Ie(c)?Math.max(v,2048):Math.max(v,c),p=s({},function(){var t="",e="";try{var i=null==h?void 0:h.userAgent;if(i){var r=Zi(i);t=r[0],e=r[1]}}catch(t){}return function(t,e){var i=function(t){if(t)return{}.hasOwnProperty.call(gn,t)?gn[t]:t}(t);return s({},i?{"os.name":i}:{},e?{"os.version":e}:{})}(t,e)}(),null==t?void 0:t.resourceAttributes);return{serviceName:null!==(o=null!==(a=null==p?void 0:p["service.name"])&&void 0!==a?a:null==t?void 0:t.serviceName)&&void 0!==o?o:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(l=null==p?void 0:p["service.version"])&&void 0!==l?l:null==t?void 0:t.serviceVersion,environment:null!==(u=null==p?void 0:p["deployment.environment"])&&void 0!==u?u:null==t?void 0:t.environment,resourceAttributes:p,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:d,maxBufferSize:v,maxQueueSize:f,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:c,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var Ww=["debug","log","warn","error","info"],Vw="console",Gw="__posthogHandledLogsRequestError",Zw=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[Gw]=!0,i},Qw=t=>!!t&&"object"==typeof t&&!0===t[Gw],Jw={featureFlags:class{constructor(t){this.name="featureFlags",this.Sd=!1,this.featureFlagEventHandlers=[],this.A=Fw,this.xd={},this.Cd={},this.Td=[],this.Md=!1,this.Id=!1,this.Ed=0,this.Rd=!1,this.Ad=!1,this.Pd=!1,this.Fd=!1,this.Od=0,this.nr=()=>{var t=this.$d();this.Od=0,t&&this.reloadFeatureFlags()},this.Dd=()=>{var t,e=this.Ld;Ie(e)||this.Rn.remoteRequestsDisabled||!d||"hidden"===d.visibilityState||Date.now()-(null!==(t=this.Nd)&&void 0!==t?t:0)<e||(this.reloadFeatureFlags(),this.qd())},this.ar=()=>{"visible"===(null==d?void 0:d.visibilityState)&&this.Dd()},"get"in t?this.Ks=t:(this._instance=t,this.jd=new Ow(t.config,t.Fa()),this.Ks=this.jd)}updateConfig(t,e){var i;null==(i=this.jd)||i.update(t,e),this.Js&&this.Bd()}setup(t){return this.ih=t,this.A=t.logger.createLogger("[FeatureFlags]"),_w(t.kv.initialize(),()=>{this.ih===t&&(this.ih=void 0,this.Js=t,this.Hd(t))})}Hd(t){var e;if(this.Js===t)return l&&zn(l,"online",this.nr),this.Bd(),this.zd=t.registerDynamicEventProperties(()=>this.Ud()?this.xd:this.Cd),this.Wd=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.onCrossTabFeatureFlagChange(()=>{this.Vd(),this.Gd(),this.Zd()}),this.Gd(),this.initialize()}Bd(){var t=this.Rn.refreshIntervalMs,e=!this.Rn.remoteRequestsDisabled&&d&&!Ie(t)&&t>0?t:void 0;e!==this.Ld&&(this.Jd(),Ie(e)||(this.Ld=e,this.qd(),null!=d&&d.addEventListener&&zn(d,ne,this.ar)))}qd(){Ie(this.Ld)||(Ie(this.Qd)||clearInterval(this.Qd),this.Nd=Date.now(),this.Qd=setInterval(this.Dd,this.Ld))}Jd(){Ie(this.Qd)||(clearInterval(this.Qd),this.Qd=void 0,null==d||null==d.removeEventListener||d.removeEventListener(ne,this.ar)),this.Ld=void 0,this.Nd=void 0}destroy(){this.Kd()}dispose(){this.Kd()}Kd(){var t,e;this.Jd(),this.Ed++,this.Ad=!1,this.ih=void 0,this.Js&&(this.Xd(),null==(t=this.zd)||t.dispose(),this.zd=void 0,null==(e=this.Wd)||e.call(this),this.Wd=void 0,this.Td=[],null==l||l.removeEventListener("online",this.nr),this.Js=void 0)}get Rn(){return this.Ks.get()}Yd(t){var e;return this.tv&&t in this.tv?this.tv[t]:null==(e=this.Js)?void 0:e.kv.get(t)}Vd(){return!!this.tv&&(this.tv=void 0,!0)}ev(){var t;return!Ie(null==(t=this.Js)?void 0:t.kv.get("$enabled_feature_flags"))&&this.Vd()}Ot(t){this.iv(()=>{var e;return null==(e=this.Js)?void 0:e.kv.set(t)})}rv(t,e,i){var r;if(null!=(r=this._instance)&&r.persistence&&t.$enabled_feature_flags){var n=this.Yd("$enabled_feature_flags")||{},s=t.$enabled_feature_flags||{},o=e.flags||e.featureFlags,a=e.flags?Object.entries(e.flags).filter(t=>{var e=t[1];return!(null!=e&&e.failed)}).map(t=>t[0]):[],l=!!e.errorsWhileComputingFlags&&!!e.flags,u=l?a:i&&!Ce(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(n),...Object.keys(s)])),h=this.Yd("$feature_flag_payloads")||{},d=t.$feature_flag_payloads||{},v=l||i?u:Array.from(new Set([...Object.keys(h),...Object.keys(d)])),c=!l&&!i,f=!!c||u,p=!!c||v,g={[st]:f,[nt]:f,[lt]:p};for(var m of(t.$feature_flag_details&&(g[at]=f),[ut,At,ht]))Ie(t[m])||(g[m]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(g)}}Dt(t){this.iv(()=>{var e;return null==(e=this.Js)?void 0:e.kv.remove(t)})}iv(t){try{t()}catch(t){this.A.error("Failed to update feature flag persistence",t)}}Gd(){var t={};for(var e of[st,lt,ut,dt]){var i=this.Yd(e);Ie(i)||(t[e]=i)}this.xd=t;var r=s({},t),n=this.Yd(nt);if(n)for(var o of Object.entries(n))r["$feature/"+o[0]]=o[1];this.Cd=r}Ud(){var t=this.Rn.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Yd(At);return"number"!=typeof e||Date.now()-e>t}nv(){return!!this.Ud()&&(this.Fd||this.Id||(this.Fd=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}sv(){var t=this.Rn.evaluationContexts;return null!=t&&t.length?t.filter(t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.A.error("Invalid evaluation context found:",t,"Expected non-empty string"),e}):[]}ov(){var t=this.Rn.flagKeys;if(!Ie(t))return t.filter(t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||this.A.error("Invalid flag key found:",t,"Expected non-empty string"),e})}initialize(){var t,e,i=this.Rn,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,o=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(r).filter(t=>!Ie(r[t])).reduce((t,e)=>(t[e]=r[e],t),{}),l=Object.keys(o).filter(t=>a[t]).reduce((t,e)=>(t[e]=o[e],t),{});return this.av({featureFlags:a,featureFlagPayloads:l},void 0,{persist:!1})}}updateFlags(t,e,i){var r,n,o=null!=i&&i.merge&&null!==(r=this.Yd("$enabled_feature_flags"))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(n=this.Yd("$feature_flag_payloads"))&&void 0!==n?n:{},l=s({},o,t),u=s({},a,e),h={};for(var d of Object.entries(l)){var v=d[0],c=d[1];h[v]={key:v,enabled:Jr(c),variant:Kr(c),reason:void 0,metadata:Ie(null==u?void 0:u[v])?void 0:{id:0,version:void 0,description:void 0,payload:u[v]}}}this.av({flags:h})}get hasLoadedFlags(){return this.Md}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Yd(at),e=this.Yd(dt),i=this.Yd(vt);if(!i&&!e)return t||{};var r=Dn({},t||{});for(var n of[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])]){var o,a,l=r[n],u=null==e?void 0:e[n],h=Ie(u)?null!==(o=null==l?void 0:l.enabled)&&void 0!==o&&o:!!u,d=Ie(u)?null==l?void 0:l.variant:"string"==typeof u?u:void 0,v=null==i?void 0:i[n],c=s({},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=s({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(a=l.metadata)?void 0:a.payload})),r[n]=c}return this.Sd||(this.A.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:r}),this.Sd=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map(i=>{var r=t[i];return{key:i,enabled:Jr(r),variant:Kr(r),payload:Qr(e[i])}})}getFlagVariants(){var t=this.Yd(nt),e=this.Yd(dt);if(!e)return t||{};for(var i=Dn({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.Sd||(this.A.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.Sd=!0),i}getFlagPayloads(){var t=this.Yd(lt),e=this.Yd(vt);if(!e)return t||{};for(var i=Dn({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.Sd||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.Sd=!0),i}reloadFeatureFlags(){this.Rd||this.Rn.featureFlagsDisabled||this.$d()||(this.Id&&(this.Ad=!0),this.lv||(this.Td.slice().forEach(t=>{try{t()}catch(t){this.A.error("Error while running feature flags reloading callback",t)}}),this.lv=setTimeout(()=>{this.uv()},5)))}Xd(){clearTimeout(this.lv),this.lv=void 0}onReloading(t){return this.Td.push(t),()=>{this.Td=this.Td.filter(e=>e!==t)}}ensureFlagsLoaded(){this.Md||this.Id||this.lv||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Rd=t}resetFlagCallReported(){this.Dt(Mt)}uv(t){this.Xd();var e=this.Js;if(e&&!this.Rn.remoteRequestsDisabled&&!this.$d())if(this.Id)this.Ad=!0;else{var i={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:s({},e.initialPersonProperties,this.Yd("$stored_person_properties")||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Yd(ft),timezone:kl()};Ie(e.deviceId)||(i.$device_id=e.deviceId),(null!=t&&t.disableFlags||this.Rn.featureFlagsDisabled)&&(i.disable_flags=!0);var r=this.sv();r.length&&(i.evaluation_contexts=r);var n=this.ov();Ie(n)||(i.flag_keys=n);var o=this.Rn.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),l=this.Ed;this.Id=!0;var u=()=>{this.Ad&&(this.Ad=!1,this.uv())},h=t=>{this.Id=!1,l===this.Ed?(this.Ot({[Rt]:[Lw]}),this.A.error("Feature flag request failed",t),this.ev()&&this.Zd(!0),u()):u()};try{e.sendRequest(a,{target:"flags",method:"POST",body:i,compression:this.Rn.compression,sentAt:"body",timeoutMs:this.Rn.requestTimeoutMs}).then(t=>{var e,r,n=null!==(e=t.json)&&void 0!==e?e:{},s=200!==t.statusCode;if(this.Id=!1,l===this.Ed){if(this.hv(t.statusCode),s||this.Ad||(this.$anon_distinct_id=void 0),!i.disable_flags||this.Ad){this.Pd=!s;var a=[];t.error?a.push(t.error instanceof Error&&"AbortError"===t.error.name?"timeout":t.error instanceof Error?Lw:"unknown_error"):200!==t.statusCode&&a.push("api_error_"+t.statusCode),n.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");var h=!(null==(r=n.quotaLimited)||!r.includes("feature_flags"));h&&a.push("quota_limited"),this.Ot({[Rt]:a}),h?this.A.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.av(n,s,{partialResponse:o}),u()}}else u()}).catch(h)}catch(t){h(t)}}}$d(){return Xn(this.Od,3)}hv(t){this.Od=ts(t,this.Od,3,()=>this.A.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.Pd)if(this.Md||this.getFlags()&&this.getFlags().length>0){if(!this.nv()){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.A.warn('getFeatureFlag for key "'+t+Dw)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e;return null==(e=this.getFeatureFlagResult(t,{send_event:!1}))?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.Pd)if(this.Md||this.getFlags()&&this.getFlags().length>0){if(!this.nv()){var i,r=this.getFlagVariants(),n=t in r,o=r[t],a=this.getFlagPayloads()[t],l=String(o),u=this.Yd("$feature_flag_request_id")||void 0,h=this.Yd("$feature_flag_evaluated_at")||void 0,d=this.Yd("$flag_call_reported")||{};if(this.Rn.deduplicateCallsPerSession){var v,c=null==(v=this.Js)?void 0:v.session.sessionId,f=this.Yd(It);c&&c!==f&&(d={},i=c)}if(e.send_event||!("send_event"in e))if(t in d&&d[t].includes(l))i&&this.Ot({[Mt]:d,[It]:i});else{var p,g,m,y,_,b,w,k,S,x,C,T,E;Ce(d[t])?d[t].push(l):d[t]=[l],this.Ot(s({[Mt]:d},i?{[It]:i}:{}));var M=this.getFeatureFlagDetails(t),I=[...null!==(p=this.Yd("$feature_flag_errors"))&&void 0!==p?p:[]];Ie(o)&&I.push("flag_missing");var R={$feature_flag:t,$feature_flag_response:o,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:u,$feature_flag_evaluated_at:h,$feature_flag_bootstrapped_response:null!==(g=null==(m=this.Rn.bootstrap)||null==(m=m.featureFlags)?void 0:m[t])&&void 0!==g?g:null,$feature_flag_bootstrapped_payload:null!==(y=null==(_=this.Rn.bootstrap)||null==(_=_.featureFlagPayloads)?void 0:_[t])&&void 0!==y?y:null,$used_bootstrap_value:!this.Pd};Ie(null==M||null==(b=M.metadata)?void 0:b.has_experiment)||(R.$feature_flag_has_experiment=M.metadata.has_experiment),Ie(null==M||null==(w=M.metadata)?void 0:w.version)||(R.$feature_flag_version=M.metadata.version);var A=null!==(k=null==M||null==(S=M.reason)?void 0:S.description)&&void 0!==k?k:null==M||null==(x=M.reason)?void 0:x.code;A&&(R.$feature_flag_reason=A),null!=M&&null!=(C=M.metadata)&&C.id&&(R.$feature_flag_id=M.metadata.id),Ie(null==M?void 0:M.original_variant)&&Ie(null==M?void 0:M.original_enabled)||(R.$feature_flag_original_response=Ie(M.original_variant)?M.original_enabled:M.original_variant),null!=M&&null!=(T=M.metadata)&&T.original_payload&&(R.$feature_flag_original_payload=null==M||null==(E=M.metadata)?void 0:E.original_payload),I.length&&(R.$feature_flag_error=I.join(",")),this.dv(R)}else i&&this.Ot({[Mt]:d,[It]:i});if(n)return{key:t,enabled:!!o,variant:"string"==typeof o?o:void 0,payload:Qr(a)}}}else this.A.warn('getFeatureFlagResult for key "'+t+Dw)}dv(t){try{var e;null==(e=this.Js)||e.capture("$feature_flag_called",t).catch(t=>{this.A.error("Failed to capture feature flag call",t)})}catch(t){this.A.error("Failed to capture feature flag call",t)}}getRemoteConfigPayload(t,e){this.vv(t,e)}vv(t,e){var i=this;return a(function*(){var r=i.Js;if(r){var n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},s=i.sv();s.length&&(n.evaluation_contexts=s);var o,a=i.ov();Ie(a)||(n.flag_keys=a);try{var l;o=(null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.Rn.compression,sentAt:"body",timeoutMs:i.Rn.requestTimeoutMs})).json)||null==(l=l.featureFlagPayloads)?void 0:l[t])||void 0}catch(t){return void i.A.error("Remote config feature flag request failed",t)}try{e(o)}catch(t){i.A.error("Remote config feature flag callback failed",t)}}})()}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.Pd)return e.defaultValue;if(!(this.Md||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+t+Dw),e.defaultValue;var i=this.getFeatureFlag(t,e);return Ie(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.av(t,e,i)}av(t,e,i){if(this.Js){this.Md=!0;var r=function(t,e,i,r,n,o){void 0===e&&(e={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===o&&(o=Fw);var a=((t,e)=>{var i=t.flags;return i?s({},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!Ie(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,o),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var d=t.requestId,v=t.evaluatedAt;if(Ce(u)){o.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var c={};if(u)for(var f=0;u.length>f;f++)c[u[f]]=!0;return{[st]:u,[nt]:c,[ht]:!1}}var p=u,g=h,m=l;if(null!=n&&n.partialResponse){var y=Object.keys(p),_=g||{};p=s({},e,p),g=s({},i,_),y.forEach(t=>{var e;t in _||null==(e=g)||delete e[t]}),m=s({},r,m)}else if(t.errorsWhileComputingFlags)if(l){var b=new Set(Object.keys(l).filter(t=>{var e;return!(null!=(e=l[t])&&e.failed)}));p=s({},e,Object.fromEntries(Object.entries(p).filter(t=>b.has(t[0]))));var w=Object.fromEntries(Object.entries(g||{}).filter(t=>b.has(t[0])));g=s({},i,w),b.forEach(t=>{var e;t in w||null==(e=g)||delete e[t]}),m=s({},r,Object.fromEntries(Object.entries(m||{}).filter(t=>b.has(t[0]))))}else p=s({},e,p),g=s({},i,g),m=s({},r,m);return s({[st]:Object.keys(qw(p)),[nt]:p||{},[lt]:g||{},[at]:m||{},[ht]:!0===t.minimalFlagCalledEvents},d?{[ut]:d}:{},v?{[At]:v}:{})}}(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);if(r)if(!1===(null==i?void 0:i.persist)){var n=!Ie(this.Js.kv.get(nt));this.tv=r,n||this.Ot(r)}else this.Vd(),this.rv(r,t,!(null==i||!i.partialResponse)),this.Ot(r);else e&&this.ev();e||(this.Fd=!1),this.Zd(e)}}override(t,e){void 0===e&&(e=!1),this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.fv(t)}fv(t){if(this.Js){if(!1===t)return this.Dt([dt,vt]),this.Zd(),void $w.info("All overrides cleared");if(Ce(t))return this.Ot({[dt]:Nw(t)}),this.Zd(),void $w.info("Flag overrides set",{flags:t});if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;this.Sd=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e);var r={},n=i.flags,s=i.payloads;return n&&(r[dt]=Ce(n)?Nw(n):n),s&&(r[vt]=s),Object.keys(r).length&&this.Ot(r),!1===n&&!1===s?this.Dt([dt,vt]):!1===n?this.Dt(dt):!1===s&&this.Dt(vt),this.Zd(),!1===n?$w.info("Flag overrides cleared"):n&&$w.info("Flag overrides set",{flags:n}),void(!1===s?$w.info("Payload overrides cleared"):s&&$w.info("Payload overrides set",{payloads:s}))}if(t&&"object"==typeof t)return this.Ot({[dt]:t}),this.Zd(),void $w.info("Flag overrides set",{flags:t});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Md){var e=this.pv(),i=e.flags,r=e.flagVariants;try{t(i,r)}catch(t){this.A.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var r,n=(this.Yd("$early_access_features")||[]).find(e=>e.flagKey===t),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};n&&(a.$early_access_feature_name=n.name),i&&(a.$feature_enrollment_stage=i);var l=s({},this.getFlagVariants(),{[t]:e});null==(r=this._instance)||null==(r=r.persistence)||r.markCrossTabFeatureFlagChanges({[st]:[t],[nt]:[t],[ct]:Object.keys(o)}),this.Ot({[st]:Object.keys(qw(l)),[nt]:l,[ct]:s({},this.Yd("$stored_person_properties")||{},o)}),this.Zd();try{var u;null==(u=this.Js)||u.capture("$feature_enrollment_update",a).catch(t=>{this.A.error("Failed to capture early access feature enrollment",t)})}catch(t){this.A.error("Failed to capture early access feature enrollment",t)}}getEarlyAccessFeatures(t,e,i){void 0===e&&(e=!1);var r=this.Yd(ot);!r||e?this.gv(t,i):t(r)}gv(t,e){var i=this;return a(function*(){var r=i.Js;if(r){var n,s=e?"&"+e.map(t=>"stage="+t).join("&"):"";try{var o=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+s,{target:"api",method:"GET",sentAt:"query"});if(!o.json)return;n=o.json.earlyAccessFeatures,i.Ot({[ot]:n})}catch(t){return void i.A.error("Early access feature request failed",t)}try{t(n)}catch(t){i.A.error("Early access feature callback failed",t)}}})()}pv(){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),{})}}Zd(t){this.Gd();var e=this.pv(),i=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach(e=>{try{e(i,r,{errorsLoading:t})}catch(t){this.A.error("Error while running feature flags callback",t)}})}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.mv(t,e)}mv(t,e){void 0===e&&(e=!0);var i=this.Yd("$stored_person_properties")||{},r=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),n=null==t?void 0:t.$set_once,o={};if(n)for(var a in n)({}).hasOwnProperty.call(n,a)&&(a in i||(o[a]=n[a]));this.Ot({[ct]:s({},i,o,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=s({},this.Yd("$stored_person_properties")||{});t.forEach(t=>{delete i[t]}),this.Ot({[ct]:i}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this.Dt(ct),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Yd("$stored_group_properties")||{},r=s({},i);for(var n of Object.keys(t))r[n]=s({},i[n],t[n]);this.Ot({[ft]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Yd("$stored_group_properties")||{};this.Ot({[ft]:s({},e,{[t]:{}})})}else this.Dt(ft)}reset(){this.Ed++,this.Ad=!1,this.xd={},this.Cd={},this.tv=void 0,this.Md=!1,this.Rd=!1,this.Pd=!1,this.$anon_distinct_id=void 0,this.Xd(),this.Sd=!1,this.Od=0}}},Kw={sessionRecording:class{get Rn(){return this._instance.config}get sl(){return this._instance.persistence}get started(){var t;return!(null==(t=this.yv)||!t.isStarted)}get status(){var t,e;return"awaiting_config"===this.bv||"missing_config"===this.bv?this.bv:null!==(t=null==(e=this.yv)?void 0:e.status)&&void 0!==t?t:this.bv}constructor(t){if(this._instance=t,this._forceAllowLocalhostNetworkCapture=!1,this.bv=Xs,this._v=void 0,this.wv=!1,this.Ke=(()=>{var t;if(null==d||!d.visibilityState||"visible"===d.visibilityState)return!0;var e=null==l||null==(t=l.performance)||null==t.getEntriesByType?void 0:t.getEntriesByType("visibility-state");return!(null!=e&&e.length)||e.some(t=>"visible"===t.name)})(),this.ar=()=>{var t;"visible"===(null==d?void 0:d.visibilityState)&&(this.Ke=!0,null==(t=this.yv)||null==t.setDocumentWasEverVisible||t.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw vw.error("started without valid sessionManager"),new Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this.Rn.cookieless_mode)throw new Error('[SessionRecording] cannot be used with cookieless_mode="always"');null!=d&&d.addEventListener&&zn(d,"visibilitychange",this.ar)}initialize(){this.startIfEnabledOrStop()}dispose(t){var e=(void 0===t?{}:t).discardBufferedEvents,i=void 0!==e&&e;this.wv=!0,null==d||null==d.removeEventListener||d.removeEventListener("visibilitychange",this.ar),i?this.Sv(!0):this.stopRecording()}get xv(){var t,e=!(null==(t=this._instance.get_property(B))||!t.enabled),i=!this.Rn.disable_session_recording,r=this.Rn.disable_session_recording||this._instance.consent.isOptedOut();return l&&e&&i&&!r}startIfEnabledOrStop(t){var e;if(!(this.wv||this.xv&&null!=(e=this.yv)&&e.isStarted)){var i=!Ie(Object.assign)&&!Ie(Array.from);this.xv&&i?(this.Cv(t),vw.info("starting")):(this.bv=Xs,this.stopRecording())}}Cv(t){var e,i;if(this.xv)if("awaiting_config"!==this.bv&&"missing_config"!==this.bv&&(this.bv=no),null!=b&&null!=(e=b.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=b.__PosthogExtensions__)&&i.initSessionRecording)this.Tv(t);else{var r,n=this._instance.sessionManager;null==(r=b.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Mv,e=>{if(!this.wv&&this.xv&&this._instance.sessionManager===n)return e?(this._instance.register_for_session({[Ht]:!0}),vw.error("could not load recorder",e)):void this.Tv(t);this.bv=Xs})}}stopRecording(){var t,e;null==(t=this._v)||t.call(this),this._v=void 0,null==(e=this.yv)||e.stop()}Sv(t){var e,i;void 0===t&&(t=!1),null==(e=this._v)||e.call(this),this._v=void 0,null==(i=this.yv)||i.discard({discardProducerEvents:t})}Iv(){var t,e;null==(t=this.sl)||t.unregister(Q),null==(e=this.sl)||e.unregister(H)}Ev(t,e){if(Oe(t))return null;var i,r=Fe(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(vw.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}Rv(t){if(this.sl){var e,i,r=this.sl,n=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,n=this.Ev(null==(e=this.Rn.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.Ev(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=n?n:o;Oe(a)&&this.Iv();var l=null==i?void 0:i.minimumDurationMilliseconds;r.register({[B]:s({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:s({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:Ie(l)?null:l,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};n(),null==(e=this._v)||e.call(this),this._v=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.Rv(e),void this.Sv()):(this.Rv(e),void this.startIfEnabledOrStop()):("awaiting_config"===this.bv&&(this.bv="missing_config",vw.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.yv)&&i.log?this.yv.log(t,e):vw.warn("log called before recorder was ready")}get Mv(){var t;return(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.get_property("$session_recording_remote_config"))||null==(t=t.scriptConfig)?void 0:t.script)||"lazy-recorder"}Av(){var t,e=this._instance.get_property(B);if(!e)return!1;try{t="object"==typeof e?e:JSON.parse(e)}catch(t){return vw.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}return!Oe(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}Tv(t){var e,i,r;if(!this.wv&&this.xv&&this._instance.sessionManager){if(null==(e=b.__PosthogExtensions__)||!e.initSessionRecording)return vw.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Ht]:!0});var n;if(this.yv||(this.yv=null==(n=b.__PosthogExtensions__)?void 0:n.initSessionRecording(this._instance,this.Ke),this.yv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Av()){if("missing_config"===this.bv||"awaiting_config"===this.bv)return;return this.bv="awaiting_config",vw.info("persisted remote config is stale, requesting fresh config before starting"),void new X_(this._instance).load()}this.bv=no,null==(i=(r=this.yv).setDocumentWasEverVisible)||i.call(r,this.Ke),this.yv.start(t)}else this.bv=Xs}onRRwebEmit(t){var e;null==(e=this.yv)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.yv||null==(t=this.sl)||t.register({[W]:!0}),null==(e=this.yv)||e.overrideLinkedFlag()}overrideSampling(){var t,e;this.yv||null==(t=this.sl)||t.register({[z]:!0}),null==(e=this.yv)||e.overrideSampling()}overrideTrigger(t){var e,i;this.yv||null==(e=this.sl)||e.register({["url"===t?V:G]:!0}),null==(i=this.yv)||i.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.yv)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.yv)||!i.tryAddCustomEvent(t,e))}flushBeforeIdentityReset(){var t;null==(t=this.yv)||null==t.flushBeforeIdentityReset||t.flushBeforeIdentityReset()}}},Yw={autocapture:class extends o_{constructor(t){super(new nw(t)),this.instance=t}},historyAutocapture:class{constructor(t){this._instance=t,this.Pv=this.Fv()}initialize(){this.startIfEnabled()}get isEnabled(){var t=this.Ov();return!!(t.path||t.search||this.$v(t))}startIfEnabled(){this.isEnabled&&(Pn.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Pv=this.Fv(),this.startIfEnabled()}stop(){this.Dv&&this.Dv(),this.Dv=void 0,this.Lv&&this.Lv(),this.Lv=void 0,Pn.info("History API monitoring stopped")}monitorHistoryChanges(){l&&l.history&&(this.Nv("pushState"),this.Nv("replaceState"),this.qv(),this.$v()&&this.jv())}Nv(t){var e;if(l&&(null==(e=l.history[t])||!e.__posthog_wrapped__)){var i=this;ec(l.history,t,e=>function(r,n,s){e.call(this,r,n,s),i.Bv(t)})}}Fv(){var t=null==l?void 0:l.location;if(null!=t&&t.pathname)return{pathname:t.pathname,search:t.search,hash:t.hash}}Ov(){var t=this._instance.config.capture_pageview;return"history_change"===t?{path:!0}:Ee(t)?t:{}}$v(t){return void 0===t&&(t=this.Ov()),!!t.hash&&!this._instance.config.disable_capture_url_hashes}Hv(t){var e=this.Ov(),i=this.Pv;return!(!i||!(e.path&&t.pathname!==i.pathname||e.search&&t.search!==i.search||this.$v(e)&&t.hash!==i.hash))}Bv(t){try{var e=this.Fv();if(!e)return;this.Hv(e)&&this._instance.capture(oe,{navigation_type:t}),this.Pv=e}catch(e){Pn.error("Error capturing "+t+" pageview",e)}}qv(){if(!this.Dv){var t=()=>{this.Bv("popstate")};zn(l,"popstate",t),this.Dv=()=>{l&&l.removeEventListener("popstate",t)}}}jv(){if(!this.Lv){var t=()=>{this.Bv("hashchange")};zn(l,"hashchange",t),this.Lv=()=>{l&&l.removeEventListener("hashchange",t)}}}},heatmaps:class{get Rn(){return this.instance.config}constructor(t){var e;this.zv=!1,this.Xs=!1,this.Uv=null,this.instance=t,this.zv=!(null==(e=this.instance.persistence)||!e.props[A]),this.rageclicks=new t_(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Ee(this.Rn.capture_heatmaps)&&this.Rn.capture_heatmaps.flush_interval_milliseconds&&(t=this.Rn.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Oe(this.Rn.capture_heatmaps)?Oe(this.Rn.enable_heatmaps)?this.zv:this.Rn.enable_heatmaps:!1!==this.Rn.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Xs)return;cw.info("starting..."),this.Wv(),this.ar()}else{var t;clearInterval(null!==(t=this.Uv)&&void 0!==t?t:void 0),this.Vv(),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({[A]:i}),this.zv=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.Rt;return this.Rt=void 0,t}Gv(t){fw(t.originalEvent)&&this.vn(t.originalEvent,"deadclick")}ar(){this.Uv&&clearInterval(this.Uv),this.Uv="visible"===(null==d?void 0:d.visibilityState)?setInterval(this.Ja.bind(this),this.flushIntervalMilliseconds):null}Wv(){l&&d&&(this.Zv=this.Ja.bind(this),zn(l,se,this.Zv),this.Jv=t=>this.vn(t||(null==l?void 0:l.event)),zn(d,"click",this.Jv,{capture:!0}),this.Qv=t=>this.Kv(t||(null==l?void 0:l.event)),zn(d,"mousemove",this.Qv,{capture:!0}),this.Xv=new C_(this.instance,S_,this.Gv.bind(this)),this.Xv.startIfEnabledOrStop(),this.Yv=this.ar.bind(this),zn(d,ne,this.Yv),this.Xs=!0)}Vv(){var t;l&&d&&(this.Zv&&l.removeEventListener(se,this.Zv),this.Jv&&d.removeEventListener("click",this.Jv,{capture:!0}),this.Qv&&d.removeEventListener("mousemove",this.Qv,{capture:!0}),this.Yv&&d.removeEventListener(ne,this.Yv),clearTimeout(this.tc),null==(t=this.Xv)||t.stop(),this.Xs=!1)}ec(t,e){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,i){for(var r=t;r&&ns(r)&&!ss(r,"body");){if(r===i)return!1;var n=void 0;try{var s,o,a;n=null==(s=null!==(o=null==(a=r.ownerDocument)?void 0:a.defaultView)&&void 0!==o?o:l)?void 0:s.getComputedStyle(r).position}catch(t){return!1}if(ve(e,n))return!0;r=ms(r)}return!1}(cs(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:r),y:t.clientY+(s?0:i),target_fixed:s,type:e}}vn(t,e){var i;if(void 0===e&&(e="click"),!rs(t.target)&&fw(t)){var r=this.ec(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&Cs(cs(t),this.instance.config.rageclick)&&this.$s(s({},r,{type:"rageclick"})),this.$s(r)}}Kv(t){!rs(t.target)&&fw(t)&&(clearTimeout(this.tc),this.tc=setTimeout(()=>{this.$s(this.ec(t,"mousemove"))},500))}$s(t){if(l){var e=this.Rn.disable_capture_url_hashes?lr(l.location.href):l.location.href,i=this.Rn.custom_personal_data_properties,r=Kn(e,this.Rn.mask_personal_data_properties?[...hl,...i||[]]:[],vl);this.Rt=this.Rt||{},this.Rt[r]||(this.Rt[r]=[]),this.Rt[r].push(t)}}Ja(){this.Rt&&!Me(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:C_,webVitalsAutocapture:class{constructor(t){var e;this._instance=t,this.zv=!1,this.Xs=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.rc=()=>{clearTimeout(this.nc),this.nc=void 0,0!==this.Rt.metrics.length&&(this._instance.capture("$web_vitals",s({$current_url:this.Rt.url},this.Rt.metrics.reduce((t,e)=>s({},t,{["$web_vitals_"+e.name+"_event"]:s({},e),["$web_vitals_"+e.name+"_value"]:e.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.sc=t=>{var e;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Oe(null==t?void 0:t.name)||Oe(null==t?void 0:t.value))aw.error("Invalid metric received",t);else{var i="string"==typeof t.navigationURL?t.navigationURL:void 0,r=this.oc(i);if(!Ie(r)){var n=Fe(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+r;if(!this.ac||this.ac>t.value){this.Rt.navigationKey!==n&&(this.rc(),this.nc=setTimeout(this.rc,this.flushToCaptureTimeoutMs)),Ie(this.Rt.navigationKey)&&(this.Rt.navigationKey=n,this.Rt.url=r),this.Rt.firstMetricTimestamp=Ie(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;var o=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),a=s({},t,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});if(delete a.entries,Ee(t.attribution)&&this.attributionMetrics.indexOf(t.name)>-1){var l={};for(var u of dw){var h="url"===u&&"string"==typeof t.attribution[u]?this.oc(t.attribution[u]):t.attribution[u];Ie(h)||(l[u]=h)}a.attribution=l}else delete a.attribution;Ie(o)||(a.$session_id=o.sessionId,a.$window_id=o.windowId),this.Rt.metrics.push(a),this.Rt.metrics.length===this.allowedMetrics.length&&this.rc()}else aw.error("Ignoring metric with value >= "+this.ac,t)}}},this.lc=()=>{if(!this.Xs){var t,e,i,r,n=!1,o=b.__PosthogExtensions__,a=null==o?void 0:o.postHogWebVitalsCallbacksByFlavor,l=(null==a?void 0:a[this.uc])||("web-vitals"===this.uc&&Ie(a)?null==o?void 0:o.postHogWebVitalsCallbacks:void 0);if(!Ie(l)){var u=l.withoutAttribution,h=this.attributionMetrics;n=!Ie(u),t=h.indexOf("LCP")>-1?l.onLCP:(null==u?void 0:u.onLCP)||l.onLCP,e=h.indexOf("CLS")>-1?l.onCLS:(null==u?void 0:u.onCLS)||l.onCLS,i=h.indexOf("FCP")>-1?l.onFCP:(null==u?void 0:u.onFCP)||l.onFCP,r=h.indexOf("INP")>-1?l.onINP:(null==u?void 0:u.onINP)||l.onINP}if(t&&e&&i&&r){var d={reportSoftNavs:this.useSoftNavs},v=n&&this.attributionMetrics.indexOf("INP")>-1?s({},d,{includeProcessedEventEntries:!1}):d;this.allowedMetrics.indexOf("LCP")>-1&&t(this.sc.bind(this),d),this.allowedMetrics.indexOf("CLS")>-1&&e(this.sc.bind(this),d),this.allowedMetrics.indexOf("FCP")>-1&&i(this.sc.bind(this),d),this.allowedMetrics.indexOf("INP")>-1&&r(this.sc.bind(this),v),this.Xs=!0}else aw.error("web vitals callbacks not loaded - not starting")}},this.zv=!(null==(e=this._instance.persistence)||!e.props[D]),this.startIfEnabled()}get hc(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Ee(this.hc)?null==(t=this.hc)?void 0:t.web_vitals_allowed_metrics:void 0;return Oe(i)?(null==(e=this._instance.persistence)?void 0:e.props.$web_vitals_allowed_metrics)||uw:i}get flushToCaptureTimeoutMs(){return(Ee(this.hc)?this.hc.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var t=Ee(this.hc)?this.hc.web_vitals_attribution:void 0;return De(t)?t?uw:[]:Ce(t)?t:hw}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var t;return null!==(t=Ee(this.hc)?this.hc.__preview_web_vitals_soft_navs:void 0)&&void 0!==t&&t}get ac(){var t=Ee(this.hc)&&Fe(this.hc.__web_vitals_max_value)?this.hc.__web_vitals_max_value:lw;return t>0&&6e4>=t?lw:t}get isEnabled(){var t=null==v?void 0:v.protocol;if("http:"!==t&&"https:"!==t)return aw.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Ee(this.hc)?this.hc.web_vitals:De(this.hc)?this.hc:void 0;return De(e)?e:this.zv}startIfEnabled(){this.isEnabled&&!this.Xs&&(aw.info("enabled, starting..."),this.bo(this.lc))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=Ee(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Ee(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[D]:i}),this._instance.persistence.register({[j]:r})),this.zv=i,this.startIfEnabled()}}}get uc(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}bo(t){var e=b.__PosthogExtensions__,i=this.uc,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&Ie(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,e=>{e?aw.error("failed to load script",e):t()})}oc(t){var e=t||(null==l?void 0:l.location.href);if(e){var i=this._instance.config.disable_capture_url_hashes?lr(e):e,r=this._instance.config.custom_personal_data_properties;return Kn(i,this._instance.config.mask_personal_data_properties?[...hl,...r||[]]:[],vl)}aw.error("Could not determine current URL")}}},Xw={exceptionObserver:class{constructor(t){var e;this.lc=()=>{var t;if(l&&this.isEnabled&&null!=(t=b.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=b.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=b.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=b.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.dc&&this.Rn.capture_unhandled_errors&&(this.dc=e(this.captureException.bind(this))),!this.vc&&this.Rn.capture_unhandled_rejections&&(this.vc=i(this.captureException.bind(this))),!this.cc&&this.Rn.capture_console_errors&&(this.cc=r(this.captureException.bind(this)))}catch(t){sw.error("failed to start",t),this.fc()}}},this._instance=t,this.gc=!(null==(e=this._instance.persistence)||!e.props[P]),this.wt=new Qe(s({},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,A:sw})),this.Rn=this.mc(),this.startIfEnabledOrStop()}mc(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ee(t)?e=s({},e,t):(Ie(t)?this.gc:t)&&(e=s({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Rn.capture_console_errors||this.Rn.capture_unhandled_errors||this.Rn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(sw.info("enabled"),this.fc(),this.bo(this.lc)):this.fc()}bo(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",e=>{if(e)return sw.error("failed to load script",e);t()})}fc(){var t,e,i;null==(t=this.dc)||t.call(this),this.dc=void 0,null==(e=this.vc)||e.call(this),this.vc=void 0,null==(i=this.cc)||i.call(this),this.cc=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.gc=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[P]:this.gc}),this.Rn=this.mc(),this.startIfEnabledOrStop())}}onConfigChange(){this.Rn=this.mc()}captureException(t){try{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";if(this.wt.consumeRateLimit(n))return void sw.info("Skipping exception capture because of client rate limiting.",{exception:n});null==(r=this._instance.exceptions)||r.sendExceptionEvent(t)}catch(t){}}},exceptions:class{constructor(t){var e,i;this.yc=[],this.bc=Kg(),this._instance=t,this.yc=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property("$error_tracking_suppression_rules"))&&void 0!==e?e:[],this._c=Vr(this.wc()),this.kc=new Gr(this._c)}onConfigChange(){this._c=Vr(this.wc()),this.kc.setConfig(this._c)}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:[],o=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this.yc=s,this._instance.persistence&&this._instance.persistence.register({[O]:this.yc,[F]:o})}}}get Sc(){var t,e,i=!!this._instance.get_property(F);return null!==(t=null!==(e=this._instance.config.error_tracking.captureExtensionExceptions)&&void 0!==e?e:i)&&void 0!==t&&t}buildProperties(t,e){return this.bc.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this._c.enabled)try{if(!Re(t)||0===t.trim().length)return void Vg.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)=>zr.has(r)?(e.push(r),i):(i[r]=t[r],i),{}),droppedKeys:e}}(this.xc(e)),r=i.sanitizedProperties,n=i.droppedKeys;n.length>0&&Vg.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.kc.add(s({[Ur]:t,[Hr]:(new Date).toISOString()},r))}catch(t){Vg.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Cc(e)){if(this.Tc(e))return this.Mc("Exception dropped: matched a suppression rule"),void Vg.info("Skipping exception capture because a suppression rule matched");if(!this.Sc&&this.Ic(e))return this.Mc("Exception dropped: thrown by a browser extension"),void Vg.info("Skipping exception capture because it was thrown by an extension");if(!this.Sc&&this.Ec(e))return this.Mc("Exception dropped: thrown by an injected browser script"),void Vg.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Rc(e))return this.Mc("Exception dropped: thrown by the PostHog SDK"),void Vg.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this._c.enabled&&Oe(t.$exception_steps)?this.Ac(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",Du:!0});return n&&this.kc.clear(),n}catch(t){return Wg(t)||Vg.error("Failed to capture exception event. Dropping this exception.",t),void this.kc.clear()}}catch(t){return void(Wg(t)||Vg.error("Failed to process exception event. Ignoring this exception.",t))}var s}Ac(t){try{var e=this.kc.getAttachable();return 0===e.length?t:s({},t,{$exception_steps:e})}catch(e){return Vg.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Mc(t){this._c.enabled&&this.kc.add({[Ur]:t,[Hr]:(new Date).toISOString()})}xc(t){return Ee(t)?s({},t):{}}wc(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}Tc(t){if(0===t.length)return!1;try{var e=t.reduce((t,e)=>{var i=e.type,r=e.value;return Re(i)&&i.length>0&&t.$exception_types.push(i),Re(r)&&r.length>0&&t.$exception_values.push(r),t},{$exception_types:[],$exception_values:[]});return this.yc.some(t=>{var i=t.values.map(t=>{var i=tl[t.operator],r=e[t.key];if(!i||!r)return!1;var n=Ce(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 Vg.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}Ic(t){var e=t.flatMap(t=>{var e,i;return null!==(e=null==(i=t.stacktrace)?void 0:i.frames)&&void 0!==e?e:[]}),i=e.filter(t=>{var e=t.filename;return!!e&&Qg.some(t=>e.startsWith(t))});return 0!==i.length&&(!i.every(t=>{var e=t.filename;return!!e&&e.startsWith(Gg)})||t.some(t=>{var e=t.value;return"NoResponse"===t.type||Re(e)&&Zg.some(t=>{var i=t.value;return t.exact?e===i:e.includes(i)})})&&!e.some(t=>{var e=t.filename;return t.in_app&&!(null!=e&&e.startsWith(Gg))}))}Ec(t){return t.some(t=>{var e=t.value;return Re(e)&&Jg.some(t=>e.includes(t))})}Rc(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:[];return null!==(r=null==(n=s[s.length-1])||null==(n=n.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Cc(t){return!Oe(t)&&Ce(t)}}},tk=s({productTours:class{get sl(){return this._instance.persistence}constructor(t){this.Pc=null,this.Fc=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.sl&&this.sl.register({[N]:!!e.productTours}),!gw(this._instance))return!this.Pc&&Oe(null==(i=this.sl)?void 0:i.props.ph_product_tours)||pw.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.Pc)||r.stop(),this.Pc=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Pc&&gw(this._instance)&&this.bo(()=>this.Oc())}bo(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",e=>{e?pw.error("Could not load product tours script",e):t()})}Oc(){var t;!this.Pc&&null!=(t=b.__PosthogExtensions__)&&t.generateProductTours&&(this.Pc=b.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Ce(this.Fc)||e){var i=this.sl;if(i){var r=i.props[wt];if(Ce(r)&&!e)return this.Fc=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(gw(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||pw.warn(n):pw.error(n),void t([],{isLoaded:!1,error:n})}var s=Ce(e.json.product_tours)?e.json.product_tours:[];this.Fc=s,i&&i.register({[wt]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Fc,{isLoaded:!0})}getActiveProductTours(t){Oe(this.Pc)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Pc.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Pc)||e.showTourById(t)}previewTour(t){this.Pc?this.Pc.previewTour(t):this.bo(()=>{var e;this.Oc(),null==(e=this.Pc)||e.previewTour(t)})}dismissProductTour(){var t;null==(t=this.Pc)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Pc)||t.nextStep()}previousStep(){var t;null==(t=this.Pc)||t.previousStep()}clearCache(){var t;this.Fc=null,null==(t=this.sl)||t.unregister(wt)}resetTour(t){var e;null==(e=this.Pc)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Pc)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Pc)||e.cancelPendingTour(t)}}},Jw),ek={siteApps:class{constructor(t){this._instance=t,this.$c=0,this.Dc=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Lc(t,e){if(e){var i=this.globalsForEvent(e);this.Dc.push(i),this.Dc.length>1e3&&(this.Dc=this.Dc.slice(10))}}get siteAppLoaders(){var t;return null==(t=b._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Lc.bind(this));this.Nc=()=>{t(),this.Dc=[],this.Nc=void 0}}}globalsForEvent(t){var e,i,o,a,l,u,h;if(!t)throw new Error("Event payload is required");var d={},v=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var f of Object.entries(c)){var p=f[0];d[p]={id:v[p],type:p,properties:f[1]}}var g=t.$set_once,m=t.$set;return{event:s({},n(t,r),{properties:s({},t.properties,m?{$set:s({},null!==(e=null==(i=t.properties)?void 0:i.$set)&&void 0!==e?e:{},m)}:{},g?{$set_once:s({},null!==(o=null==(a=t.properties)?void 0:a.$set_once)&&void 0!==o?o:{},g)}:{}),elements_chain:null!==(l=null==(u=t.properties)?void 0:u.$elements_chain)&&void 0!==l?l:"",distinct_id:null==(h=t.properties)?void 0:h.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:d}}qc(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)||(mw.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)||(mw.error("prepare_external_dependency_script returned null"),null):t}jc(){var t,e,i,r,n,s,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==d?void 0:d.defaultView,u=null==l||null==(t=l.Node)?void 0:t.prototype;if(!l||!u)return()=>{};if(this.$c++,this.Bc)return this.Hc();var h=[],v=this,c=new WeakSet,f=(t,e,i)=>{if(null!=t&&t[e]){var r=t[e];t[e]=i(r),h.push(()=>{t[e]=r})}},p=t=>{if(c.has(t))return t;var e=v.qc(t);return e&&c.add(e),e},g=t=>t.map(t=>"string"==typeof t?t:p(t)).filter(t=>!Pe(t));return f(u,"appendChild",t=>function(e){var i=p(e);return i?t.call(this,i):e}),f(u,"insertBefore",t=>function(e,i){var r=p(e);return r?t.call(this,r,i):e}),f(u,"replaceChild",t=>function(e,i){var r=p(e);return r?t.call(this,r,i):i}),[null==(e=l.Element)?void 0:e.prototype,null==(i=l.Document)?void 0:i.prototype,null==(r=l.DocumentFragment)?void 0:r.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==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(o=l.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==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",t=>function(e,i){var r=p(i);return r?t.call(this,e,r):null}),this.Bc=()=>{h.forEach(t=>t()),this.Bc=void 0},this.Hc()}Hc(){var t=!1;return()=>{var e;t||(t=!0,this.$c--,0===this.$c&&(null==(e=this.Bc)||e.call(this)))}}zc(t,e){void 0===e&&(e=!0);var i=this.jc();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.Dc.length&&(mw.info("Processing "+this.Dc.length+" events for site app with id "+t.id),this.Dc.forEach(t=>this.zc(()=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every(t=>t.processedBuffer||t.errored)&&(null==(i=this.Nc)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,mw.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.zc(e=>t.init({posthog:this._instance,callback(t){e(),n(t)}}),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){mw.error(yw+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){mw.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}Uc(){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)}Wc(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.zc(()=>null==r.processEvent?void 0:r.processEvent(i))}catch(e){mw.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.Uc(),void this._instance.on("eventCaptured",t=>this.Wc(t))):void mw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Nc)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var o=function(){var t,e=a.id,i=a.url;b["__$$ph_site_app_"+e]=n._instance,null==(t=b.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,t=>{if(t)return mw.error(yw+e,t)})};for(var a of s.siteApps)o()}else mw.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},ik={tracingHeaders:class{constructor(t){this._instance=t,this.Vc=void 0,this.Gc=void 0,this.Zc=void 0,this.lc=()=>{var t,e,i=this.Jc();i?(Ie(this.Vc)&&(this.Vc=null==(t=b.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Ie(this.Gc)&&(this.Gc=null==(e=b.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.fc()}}initialize(){this.startIfEnabledOrStop()}bo(t){var e,i;null!=(e=b.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(i=b.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",e=>{if(e)return ow.error("failed to load script",e);t()})}Qc(){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}Jc(){var t=this.Qc();return Ce(t)?(Ce(this.Zc)?this.Zc.splice(0,this.Zc.length,...t):this.Zc=[...t],t.length>0?this.Zc:void 0):(Ce(this.Zc)&&this.Zc.splice(0),this.Zc=t||void 0,this.Zc)}fc(){var t,e;null==(t=this.Vc)||t.call(this),null==(e=this.Gc)||e.call(this),this.Vc=void 0,this.Gc=void 0}startIfEnabledOrStop(){this.Jc()?this.bo(this.lc):this.fc()}}},rk=s({surveys:class extends kw{constructor(t){var e;super(new Mw(t),(e=t,{get projectToken(){return e.config.token},kv:new Ew(e)})),this._instance=t}ah(t,e){var i=e.query?sb(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})})}}},Jw),nk={toolbar:class{constructor(t){this.instance=t}Kc(t){b.ph_toolbar_state=t}Xc(){var t;return null!==(t=b.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,i){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),Wn(this.instance.config))return!1;if(!l||!d)return!1;t=null!=t?t:l.location,i=null!=i?i:l.history;try{if(!e){try{l.localStorage.setItem("test","test"),l.localStorage.removeItem("test")}catch(t){return!1}e=null==l?void 0:l.localStorage}var r,n=Iw||Yn(t.hash,"__posthog")||Yn(t.hash,"state"),s=n?Nn(()=>JSON.parse(atob(decodeURIComponent(n))))||Nn(()=>JSON.parse(decodeURIComponent(n))):null;return s&&"ph_authorize"===s.action?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?t.hash=s.desiredHash:i?i.replaceState(i.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(Rw)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(t){return!1}}Yc(t){var e=b.ph_load_toolbar||b.ph_load_editor;!Oe(e)&&Te(e)?e(t,this.instance):Aw.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==d||!d.getElementById("__POSTHOG_TOOLBAR__"));if(!l||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=s({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(l.localStorage.setItem(Rw,JSON.stringify(s({},r,{source:void 0}))),2===this.Xc())this.Yc(r);else if(0===this.Xc()){var n;this.Kc(1),null==(n=b.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"toolbar",t=>{if(t)return Aw.error("[Toolbar] Failed to load",t),void this.Kc(0);this.Kc(2),this.Yc(r)}),zn(l,"turbolinks:load",()=>{this.Kc(0),this.loadToolbar(r)})}return!0}tf(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)}}},sk=s({experiments:class t{get Rn(){return this._instance.config}constructor(e){var i=this;this._instance=e,this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),i.getWebExperiments(e=>{t.ef("retrieved web experiments from the server"),i.if=new Map,e.forEach(e=>{if(e.feature_flag_key){var r;i.if&&(t.ef("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=i.if)||r.set(e.feature_flag_key,e));var n=i._instance.getFeatureFlag(e.feature_flag_key);Re(n)&&e.variants[n]&&i.rf(e.name,n,e.variants[n].transforms)}else if(e.variants)for(var s in e.variants){var o=e.variants[s];t.nf(o,i._instance)&&i.rf(e.name,s,o.transforms)}})},e)},this._instance.onFeatureFlags(t=>{this.onFeatureFlags(t)})}initialize(){}onFeatureFlags(e){if(this._is_bot())t.ef(jw);else if(!this.Rn.disable_web_experiments){if(Oe(this.if))return this.if=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.ef("applying feature flags",e),e.forEach(t=>{var e;if(this.if&&null!=(e=this.if)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.if)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.rf(n.name,r,n.variants[r].transforms)}})}}previewWebExperiment(){var e=t.getWindowLocation();if(null!=e&&e.search){var i=Jn(null==e?void 0:e.search,"__experiment_id"),r=Jn(null==e?void 0:e.search,"__experiment_variant");i&&r&&(t.ef("previewing web experiments "+i+" && "+r),this.getWebExperiments(t=>{this.sf(parseInt(i),r,t)},!1,!0))}}loadIfEnabled(){this.Rn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.Rn.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.Rn.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}sf(e,i,r){var n=r.filter(t=>t.id===e);n&&n.length>0&&(t.ef("Previewing web experiment ["+n[0].name+"] with variant ["+i+"]"),this.rf(n[0].name,i,n[0].variants[i].transforms))}static nf(e,i){return!Oe(e.conditions)&&t.af(e,i)&&t.lf(e)}static af(e,i){var r;if(Oe(e.conditions)||Oe(null==(r=e.conditions)?void 0:r.url))return!0;var n=t.getWindowLocation();if(n){var s,o,a,l=es(i,n.href);return null==(s=e.conditions)||!s.url||Bw[null!==(o=null==(a=e.conditions)?void 0:a.urlMatchType)&&void 0!==o?o:"icontains"](e.conditions.url,l)}return!1}static getWindowLocation(){return null==l?void 0:l.location}static lf(t){var e;if(Oe(t.conditions)||Oe(null==(e=t.conditions)?void 0:e.utm))return!0;var i=fl();if(i.utm_source){var r,n,s,o,a,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==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.utm_source,c=null==(a=t.conditions)||null==(a=a.utm)||!a.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 ef(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];Pn.info("[WebExperiments] "+t,i)}rf(e,i,r){this._is_bot()?t.ef(jw):"control"!==i?r.forEach(r=>{var n;r.selector&&(t.ef("applying transform of variant "+i+" for experiment "+e+" ",r),null==(n=document)||null==(n=n.querySelectorAll(r.selector))||n.forEach(t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}):t.ef("Control variants leave the page unmodified.")}_is_bot(){return h&&this._instance?Tb(h,this.Rn.custom_blocked_useragents):void 0}}},Jw),ok=s({},Jw,Kw,Yw,Xw,tk,ek,rk,ik,nk,sk,{conversations:class{constructor(t){this._instance=t,this.uf=void 0,this._conversationsManager=null,this.hf=!1,this.re=null,this.df=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.vf=t.ok,t.ok)){var e=t.config.conversations;Oe(e)||(De(e)?this.uf=e:(this.uf=e.enabled,this.re=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.uf=void 0,this.re=null,this.vf=void 0,this.df=!1}loadIfEnabled(){if(!(this._conversationsManager||this.hf||this._instance.config.disable_conversations||Wn(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==b?void 0:b.__PosthogExtensions__;if(t&&!Ie(this.uf)&&this.uf)if(this.re&&this.re.token){this.hf=!0;try{var e=t.initConversations;if(e)return this.cf(e),void(this.hf=!1);var i=t.loadExternalDependency;if(!i)return void this.ff(te);i(this._instance,"conversations",e=>{e||!t.initConversations?this.ff("Could not load conversations script",e):this.cf(t.initConversations),this.hf=!1})}catch(t){this.ff("Error initializing conversations",t),this.hf=!1}}else Uw.error("Conversations enabled but missing token in remote config.")}}cf(t){if(this.re)try{this._conversationsManager=t(this.re,this._instance),this.df=!1,Uw.info("Conversations loaded successfully")}catch(t){this.ff("Error completing conversations initialization",t)}else Uw.error("Cannot complete initialization: remote config is null")}ff(t,e){Uw.error(t,e),this._conversationsManager=null,this.hf=!1,this.df=!0}show(){this._conversationsManager?this._conversationsManager.show():Uw.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.uf&&!Pe(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Wn(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.vf?"remote_config_failed":Ie(this.uf)?this.vf?"disabled_in_project":"remote_config_pending":this.uf?Oe(this.re)||!this.re.token?"missing_token":null!=b&&b.__PosthogExtensions__?this.hf?"initializing":this.df?"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 a(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,i):(Uw.warn(Hw),null)})()}getMessages(t,e){var i=this;return a(function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,e):(Uw.warn(Hw),null)})()}markAsRead(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Uw.warn(Hw),null)})()}getTickets(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Uw.warn(Hw),null)})()}requestRestoreLink(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Uw.warn(Hw),null)})()}restoreFromToken(t){var e=this;return a(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Uw.warn(Hw),null)})()}restoreFromUrlToken(){var t=this;return a(function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Uw.warn(Hw),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}Wu(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Vu(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},{logs:class{constructor(t){var e,i=this;this._instance=t,this.name=dp,this.pf=!1,this.gf=!1,this.mf=!1,this.A=On("[logs]"),this.yf=s({},this.A,{error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];e.some(Qw)||i.A.error(...e)}}),this.La=[],this.bf=[],this.Od=0,this.ro=!1,this._f=[],this.wf=[],this.kf=!1,this.Sf=!1,this.xf=()=>{var t,e;this.ro||(this.Od=0,null==(t=this.Cf)||t.onReconnect(),null==(e=this.Tf)||e.onReconnect())},this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.pf=!0),l&&zn(l,"online",this.xf)}Mf(t,e,i,r){var n,s=zw(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new Sn(this.If(t,e),s,this.yf,()=>this.Ef(),t=>t(),void 0,r),s]}Rf(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Cf||this.Af!==e){var i;null==(i=this.Cf)||i.reset(),this.Af=e;var r=this.Mf(()=>this.La,t=>{this.La=t});this.Cf=r[0],this.Pf=r[1]}return this.Cf}Ff(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Tf||this.Of!==e){var i;null==(i=this.Tf)||i.reset(),this.Of=e;var r=this.Mf(()=>this.bf,t=>{this.bf=t},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Vw);this.Tf=r[0],this.$f=r[1]}return this.Tf}setup(t){var e;if(!this.ro){this.Js=t,null!=(e=this._instance)&&null!=(e=e.config)&&null!=(e=e.logs)&&e.captureConsoleLogs&&(this.pf=!0),(this.pf||this.Df()&&this.Lf())&&this.Nf();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.ro?r.dispose():(this.oo=r,i||this.loadIfEnabled())}}dispose(){var t,e,i,r;this.ro||(this.ro=!0,this.qf(),null==(t=this.oo)||t.dispose(),this.oo=void 0,this.Js=void 0,this.mf=!1,null==l||l.removeEventListener("online",this.xf),null==(e=this.jf)||e.call(this),this.jf=void 0,null==(i=this.Cf)||i.reset(),null==(r=this.Tf)||r.reset())}onRemoteConfig(t){var e,i;if(!this.ro){var r=t.ok?null==(e=t.config.logs)?void 0:e.captureConsoleLogs:void 0;Oe(r)?this.Bf():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[q]:!!r}),r?(this.pf=!0,this.gf||this.Nf(),this.loadIfEnabled()):this.Bf())}}reset(){var t,e,i,r;this.qf(),null==(t=this.Cf)||t.clearQueue(),this.La=[],null==(e=this.Cf)||e.reset(),null==(i=this.Tf)||i.clearQueue(),this.bf=[],null==(r=this.Tf)||r.reset(),this.Od=0}captureLog(t){this.ro||this.Rf().captureLog(t)}captureConsoleLog(t){this.ro||this.Ff().captureLog(t)}captureBufferedConsoleLog(t,e,i){this.ro||this.Ff().captureLog(t,{context:e,occurredAtMs:i})}Lf(){var t;return!(null==(t=this._instance)||null==(t=t.persistence)||null==(t=t.props)||!t[q])}Df(){var t,e;return null==(t=this._instance)||null==t.Fa||!t.Fa()||!(null==(e=b._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])||!e.config)}Zu(){var t;this.qf(),null==(t=this.Tf)||t.clearQueue(),this.bf=[]}Bf(){this.pf||this.qf()}Nf(){var t,e=this;if(!this.kf&&null!=b&&b.console){var i=zw(null==(t=this._instance)||null==(t=t.config)?void 0:t.logs).maxBufferSize,r=function(t){var r;try{r=Og(b.console[t])}catch(t){return 0}if(!r)return 0;e.wf.push(ec(b.console,t,n=>{var s=function(){for(var r=arguments.length,s=new Array(r),o=0;r>o;o++)s[o]=arguments[o];try{e.Hf(t,s,i)}catch(t){}return n.apply(b.console,s)};return s.__rrweb_original__=r,s}))};for(var n of Ww)r(n);this.kf=!0,this.zf=setTimeout(()=>{this.qf()},3e4)}}Hf(t,e,i){var r;if(this.kf&&!this.Sf&&0!==e.length)if(null!=(r=this._instance)&&r.is_capturing()){if(i>this._f.length){this.Sf=!0;try{this._f.push({level:t,args:e,occurredAtMs:Date.now(),context:this.Ef()})}finally{this.Sf=!1}}}else this.qf()}qf(){if(this._f=[],this.kf){for(var t of(this.kf=!1,this.zf&&(clearTimeout(this.zf),this.zf=void 0),this.wf))t();this.wf=[]}}Uf(){var t=this._f;return this.qf(),t}get logger(){return this.Wf||(this.Wf={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.Wf}flushLogs(t){t?this.Vf(t):(this.Cf&&this.Cf.flush().catch(t=>this.Gf(t)),this.Tf&&this.Tf.flush().catch(t=>this.Gf(t)))}Gf(t){Qw(t)||this.A.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(!this.ro&&this.pf&&!this.gf&&!this.mf){var t=null==b?void 0:b.__PosthogExtensions__;if(!t)return this.A.error("PostHog Extensions not found."),void this.qf();var e=t.loadExternalDependency;if(!e)return this.A.error(te),void this.qf();this.mf=!0;try{e(this._instance,"logs",e=>{if(this.mf=!1,!this.ro&&this.pf){var i=t.logs;if(e||null==i||!i.initializeLogs)this.A.error("Could not load logs script",e),this.qf();else{var r,n,s=this.Uf();this.jf=i.initializeLogs(null!==(r=this.Js)&&void 0!==r?r:this._instance),this.gf=!0,s.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!==(n=this.Js)&&void 0!==n?n:this._instance,s))}}})}catch(t){throw this.mf=!1,t}}}If(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===ge.LogsQueue?t():void 0,setPersistedProperty(t,i){t===ge.LogsQueue&&e(null!=i?i:[])},xs:t=>this.xs(t),getLibraryId:()=>Na.LIB_NAME,getLibraryVersion:()=>Na.LIB_VERSION}}xs(t){return new Promise(e=>{if(Xn(this.Od,3))e({kind:"fatal",error:Zw(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=t=>{i||(i=!0,clearTimeout(n),e(t))},n=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:Zw(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Zf(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.Jf(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.A.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:Zw(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)})}}})}})}Jf(t){(0!==t||this._instance.__loaded)&&(this.Od=ts(t,this.Od,3,()=>this.A.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.")))}Vf(t){this.La.length>0&&this.Qf(t,this.La,this.Pf,Na.LIB_NAME,t=>{this.La=t}),this.bf.length>0&&this.Qf(t,this.bf,this.$f,Vw,t=>{this.bf=t})}Qf(t,e,i,r,n){if(0!==e.length){var s=e.map(t=>t.record);n([]);var o=kn(s,wn(i,Na.LIB_NAME,Na.LIB_VERSION),r,Na.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Zf(),data:o,compression:"best-available",batchKey:"logs",transport:t})}}Zf(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Ef(){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,Oe(n)||(e.sessionStartTimestamp=n),Oe(s)||(e.lastActivityTimestamp=s)}if(null!=b&&null!=(t=b.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?lr(b.location.href):b.location.href),this._instance.featureFlags){var o=this._instance.featureFlags.getFlags();o&&o.length>0&&(e.activeFeatureFlags=o)}return e}}},{metrics:class{constructor(t){this._instance=t,this.A=On("[metrics]")}initialize(){}Rf(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Cf&&this.Af===i||(null==(e=this.Cf)||e.reset(),this.Af=i,this.Cf=new En(this.If(),function(t){var e,i,r,n,s,o=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==o?void 0:o["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==o?void 0:o["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==o?void 0:o["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:o,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.A)),this.Cf}count(t,e,i){void 0===e&&(e=1),this.Rf().count(t,e,i)}gauge(t,e,i){this.Rf().gauge(t,e,i)}histogram(t,e,i){this.Rf().histogram(t,e,i)}flush(t){if(!this.Cf)return Promise.resolve();if(t){var e=this.Cf.drainWindow();return e&&this.js(e,t),Promise.resolve()}return this.Cf.flush().catch(t=>this.A.error("PostHog metrics flush failed:",t))}reset(){var t;null==(t=this.Cf)||t.reset()}If(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},js:t=>e.js(t),getLibraryId:()=>Na.LIB_NAME,getLibraryVersion:()=>Na.LIB_VERSION}}js(t,e){return new Promise(i=>{var r=!1,n=t=>{r||(r=!0,clearTimeout(o),i(t))},o=setTimeout(()=>n({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(s({method:"POST",url:this.Kf(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e,i=t.statusCode;n(i>=200&&300>i?{kind:"ok"}:413===i?{kind:"too-large"}:0!==i&&408!==i&&429!==i&&500>i?{kind:"fatal",error:new Error("metrics request failed with status "+i)}:{kind:"retry-later",error:null!==(e=t.error)&&void 0!==e?e:new Error("metrics request failed with status "+i)})}}))})}Kf(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});rw.__defaultExtensionClasses=s({},ok);var ak=function(){Na.SDK_DIST_CHANNEL="npm";var t=jb[Jb]=new rw;return function(){function t(){t.done||(t.done=!0,Kb=!1,$n(jb,function(t){t._dom_loaded()}))}null!=d&&d.addEventListener?"complete"===d.readyState?t():zn(d,"DOMContentLoaded",t,{capture:!1}):l&&Pn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}(),lk=ak;export{zf as Compression,G_ as DEFAULT_PRODUCT_TOUR_APPEARANCE,ep as DisplaySurveyType,rw as PostHog,Z_ as ProductTourEventName,Q_ as ProductTourEventProperties,Xf as SurveyEventName,tp as SurveyEventProperties,Wf as SurveyEventType,Gf as SurveyPosition,Kf as SurveyQuestionBranchingType,Jf as SurveyQuestionType,Yf as SurveySchedule,Zf as SurveyTabPosition,Qf as SurveyType,Vf as SurveyWidgetType,lk as default,ak as posthog,tb as severityLevels};
|
|
2
2
|
//# sourceMappingURL=module.full.js.map
|