posthog-js 1.347.2 → 1.348.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/array.full.es5.js +1 -1
  2. package/dist/array.full.js +1 -1
  3. package/dist/array.full.no-external.js +1 -1
  4. package/dist/array.js +1 -1
  5. package/dist/array.no-external.js +1 -1
  6. package/dist/conversations.js +1 -1
  7. package/dist/conversations.js.map +1 -1
  8. package/dist/customizations.full.js +1 -1
  9. package/dist/lazy-recorder.js +1 -1
  10. package/dist/main.js +1 -1
  11. package/dist/main.js.map +1 -1
  12. package/dist/module.d.ts +43 -1
  13. package/dist/module.full.d.ts +43 -1
  14. package/dist/module.full.js +1 -1
  15. package/dist/module.full.js.map +1 -1
  16. package/dist/module.full.no-external.d.ts +43 -1
  17. package/dist/module.full.no-external.js +1 -1
  18. package/dist/module.full.no-external.js.map +1 -1
  19. package/dist/module.js +1 -1
  20. package/dist/module.js.map +1 -1
  21. package/dist/module.no-external.d.ts +43 -1
  22. package/dist/module.no-external.js +1 -1
  23. package/dist/module.no-external.js.map +1 -1
  24. package/dist/posthog-recorder.js +1 -1
  25. package/dist/product-tours-preview.d.ts +2 -0
  26. package/dist/product-tours-preview.js +1 -1
  27. package/dist/product-tours-preview.js.map +1 -1
  28. package/dist/product-tours.js +1 -1
  29. package/dist/product-tours.js.map +1 -1
  30. package/dist/src/extensions/conversations/external/components/ConversationsWidget.d.ts +43 -2
  31. package/dist/src/extensions/conversations/external/components/TicketListItem.d.ts +13 -0
  32. package/dist/src/extensions/conversations/external/components/TicketListView.d.ts +15 -0
  33. package/dist/src/extensions/conversations/external/components/styles.d.ts +184 -0
  34. package/dist/src/extensions/conversations/external/components/utils.d.ts +8 -0
  35. package/dist/src/extensions/conversations/external/index.d.ts +39 -1
  36. package/dist/src/extensions/product-tours/product-tours.d.ts +2 -0
  37. package/dist/src/posthog-product-tours-types.d.ts +42 -0
  38. package/dist/surveys-preview.d.ts +2 -0
  39. package/lib/package.json +1 -1
  40. package/lib/src/extensions/conversations/external/components/ConversationsWidget.d.ts +43 -2
  41. package/lib/src/extensions/conversations/external/components/ConversationsWidget.js +96 -28
  42. package/lib/src/extensions/conversations/external/components/ConversationsWidget.js.map +1 -1
  43. package/lib/src/extensions/conversations/external/components/TicketListItem.d.ts +13 -0
  44. package/lib/src/extensions/conversations/external/components/TicketListItem.js +47 -0
  45. package/lib/src/extensions/conversations/external/components/TicketListItem.js.map +1 -0
  46. package/lib/src/extensions/conversations/external/components/TicketListView.d.ts +15 -0
  47. package/lib/src/extensions/conversations/external/components/TicketListView.js +75 -0
  48. package/lib/src/extensions/conversations/external/components/TicketListView.js.map +1 -0
  49. package/lib/src/extensions/conversations/external/components/styles.d.ts +184 -0
  50. package/lib/src/extensions/conversations/external/components/styles.js +189 -0
  51. package/lib/src/extensions/conversations/external/components/styles.js.map +1 -1
  52. package/lib/src/extensions/conversations/external/components/utils.d.ts +8 -0
  53. package/lib/src/extensions/conversations/external/components/utils.js +49 -0
  54. package/lib/src/extensions/conversations/external/components/utils.js.map +1 -0
  55. package/lib/src/extensions/conversations/external/index.d.ts +39 -1
  56. package/lib/src/extensions/conversations/external/index.js +253 -31
  57. package/lib/src/extensions/conversations/external/index.js.map +1 -1
  58. package/lib/src/extensions/product-tours/components/ProductTourSurveyStepInner.js +1 -1
  59. package/lib/src/extensions/product-tours/components/ProductTourSurveyStepInner.js.map +1 -1
  60. package/lib/src/extensions/product-tours/product-tours.d.ts +2 -0
  61. package/lib/src/extensions/product-tours/product-tours.js +78 -71
  62. package/lib/src/extensions/product-tours/product-tours.js.map +1 -1
  63. package/lib/src/posthog-product-tours-types.d.ts +42 -0
  64. package/lib/src/posthog-product-tours-types.js +43 -1
  65. package/lib/src/posthog-product-tours-types.js.map +1 -1
  66. package/lib/src/utils/product-tour-event-receiver.js +2 -1
  67. package/lib/src/utils/product-tour-event-receiver.js.map +1 -1
  68. package/lib/tsconfig.tsbuildinfo +1 -1
  69. package/package.json +3 -3
  70. package/react/dist/esm/index.js +25 -1
  71. package/react/dist/esm/index.js.map +1 -1
  72. package/react/dist/types/index.d.ts +4 -2
  73. package/react/dist/umd/index.js +25 -0
  74. package/react/dist/umd/index.js.map +1 -1
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t;"undefined"==typeof self&&(e.self=e),"undefined"==typeof File&&(e.File=function(){});var r=Array.prototype.forEach,i=null==e?void 0:e.navigator,n=null==e?void 0:e.document;null==e||e.location,null==e||e.fetch,null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest&&e.XMLHttpRequest,null==e||e.AbortController,null==i||i.userAgent;var o=null!=t?t:{};function s(t,e,r,i,n,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(i,n)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(i,n){var o=t.apply(e,r);function a(t){s(o,i,n,a,u,"next",t)}function u(t){s(o,i,n,a,u,"throw",t)}a(void 0)}))}}function u(){return u=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},u.apply(null,arguments)}var l=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}({}),d=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}({});var c=function(t){return t.trim()},h=Array.isArray,v=Object.prototype,f=v.hasOwnProperty,m=v.toString,p=h||function(t){return"[object Array]"===m.call(t)},g=t=>"function"==typeof t,I=t=>t===Object(t)&&!p(t),y=t=>void 0===t,b=t=>"[object String]"==m.call(t),C=t=>null===t,w=t=>y(t)||C(t),S=t=>"[object Number]"==m.call(t)&&t==t,k=t=>"[object Boolean]"===m.call(t),A=t=>t instanceof FormData;function N(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),S(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),N(n||r,e,r,i))}class R{constructor(t){this.t={},this.i=t.i,this.o=N(t.bucketSize,0,100,t.u),this.h=N(t.refillRate,0,this.o,t.u),this.m=N(t.refillInterval,0,864e5,t.u)}I(t,e){var r=e-t.lastAccess,i=Math.floor(r/this.m);if(i>0){var n=i*this.h;t.tokens=Math.min(t.tokens+n,this.o),t.lastAccess=t.lastAccess+i*this.m}}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.t[i];return n?this.I(n,r):(n={tokens:this.o,lastAccess:r},this.t[i]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.i)||e.call(this,t)),0===n.tokens)}stop(){this.t={}}}var T={LIB_VERSION:"1.347.2"},_=function(e,r){var{debugEnabled:i}=void 0===r?{}:r,n={C:function(r){if(t&&(o.POSTHOG_DEBUG||i)&&!y(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[r]?t.console[r].__rrweb_original__:t.console[r]),s=arguments.length,a=new Array(s>1?s-1:0),u=1;u<s;u++)a[u-1]=arguments[u];n(e,...a)}},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];n.C("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];n.C("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];n.C("error",...e)},critical:function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning:t=>{n.error("You must initialize PostHog before calling "+t)},createLogger:(t,r)=>_(e+" "+t,r)};return n},M=_("[PostHog.js]"),F=M.createLogger,B={};function x(t,e,i){if(!w(t)){if(p(t))return function(t,e,i){if(p(t))if(r&&t.forEach===r)t.forEach(e,i);else if("length"in t&&t.length===+t.length)for(var n=0,o=t.length;n<o;n++)if(n in t&&e.call(i,t[n],n)===B)return}(t,e,i);if(A(t)){for(var n of t.entries())if(e.call(i,n[1],n[0])===B)return}else for(var o in t)if(f.call(t,o)&&e.call(i,t[o],o)===B)return}}function O(t,e,r,i){var{capture:n=!1,passive:o=!0}={};null==t||t.addEventListener(e,r,{capture:n,passive:o})}var Z=["localhost","127.0.0.1"],Y=t=>{var e=null==n?void 0:n.createElement("a");return y(e)?null:(e.href=t,e)},E=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return x(t,(function(t,e){y(t)||y(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},G="$session_recording_remote_config",L="$session_is_sampled",W="$session_past_minimum_duration",D="$session_recording_url_trigger_activated_session",V="$session_recording_event_trigger_activated_session",X="$debug_first_full_snapshot_timestamp",z=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})"),J=new RegExp("(\\d{3}-?\\d{2}-?\\d{4})");var K="[SessionRecording]",H="redacted",j={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:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},U=["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"],P=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],q=["/s/","/e/","/i/"];function Q(t,e,r,i){if(w(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return b(n)&&(n=parseInt(n)),n>r?K+" "+i+" body too large to record ("+n+" bytes)":t}function tt(t,e){if(w(t))return t;var r=t;return function(t,e){if(w(t))return!1;if(b(t)){if(t=c(t),z.test((t||"").replace(/[- ]/g,"")))return!1;if(J.test(t))return!1}return!0}(r)||(r=K+" "+e+" body "+H),x(P,(t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r=K+" "+e+" body "+H+" as might contain: "+t)})),r}var et=(t,e)=>{var r,i,n,o={payloadSizeLimitBytes:j.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...j.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...j.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,l=!1!==t.capture_performance&&e.recordPerformance,d=(r=o,n=Math.min(1e6,null!==(i=r.payloadSizeLimitBytes)&&void 0!==i?i:1e6),t=>(null!=t&&t.requestBody&&(t.requestBody=Q(t.requestBody,t.requestHeaders,n,"Request")),null!=t&&t.responseBody&&(t.responseBody=Q(t.responseBody,t.responseHeaders,n,"Response")),t)),c=e=>{return d(((t,e)=>{var r,i=Y(t.name),n=0===e.indexOf("http")?null==(r=Y(e))?void 0:r.pathname:e;"/"===n&&(n="");var o=null==i?void 0:i.pathname.replace(n||"","");if(!(i&&o&&q.some((t=>0===o.indexOf(t)))))return t})((i=(r=e).requestHeaders,w(i)||x(Object.keys(null!=i?i:{}),(t=>{U.includes(t.toLowerCase())&&(i[t]=H)})),r),t.api_host));var r,i},h=g(t.session_recording.maskNetworkRequestFn);return h&&g(t.session_recording.maskCapturedNetworkRequestFn)&&M.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var r=t.session_recording.maskNetworkRequestFn({url:e.name});return u({},e,{name:null==r?void 0:r.url})}),o.maskRequestFn=g(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r,i=c(e);return i&&null!==(r=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(i))&&void 0!==r?r:void 0}:t=>function(t){if(!y(t))return t.requestBody=tt(t.requestBody,"Request"),t.responseBody=tt(t.responseBody,"Response"),t}(c(t)),u({},j,o,{recordHeaders:s,recordBody:a,recordPerformance:l,recordInitialRequests:l})},rt="disabled",it="sampled",nt="active",ot="buffering",st="paused",at="trigger",ut=at+"_activated",lt=at+"_pending",dt=at+"_"+rt;function ct(t,e,r){return e.some((e=>{var i;return"regex"===e.matching&&(null!==(i=null==r?void 0:r.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)}))}class ht{constructor(t){this.S=t}triggerStatus(t){var e=this.S.map((e=>e.triggerStatus(t)));return e.includes(ut)?ut:e.includes(lt)?lt:dt}stop(){this.S.forEach((t=>t.stop()))}}class vt{constructor(t){this.S=t}triggerStatus(t){var e=new Set;for(var r of this.S)e.add(r.triggerStatus(t));switch(e.delete(dt),e.size){case 0:return dt;case 1:return Array.from(e)[0];default:return lt}}stop(){this.S.forEach((t=>t.stop()))}}class ft{triggerStatus(){return lt}stop(){}}var mt=t=>"sessionRecording"in t;class pt{constructor(t){this.k=[],this.A=[],this.N=new Map,this.R=new Map,this.T="",this.urlBlocked=!1,this._instance=t}onConfig(t){var e,r;this.k=(mt(t)?I(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.A=(mt(t)?I(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.M()}M(){for(var t of(this.N.clear(),this.R.clear(),this.k))if("regex"===t.matching&&!this.N.has(t.url))try{this.N.set(t.url,new RegExp(t.url))}catch(e){M.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.A)if("regex"===e.matching&&!this.R.has(e.url))try{this.R.set(e.url,new RegExp(e.url))}catch(t){M.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}F(t){var e;return 0===this.k.length?dt:(null==(e=this._instance)?void 0:e.get_property(D))===t?ut:lt}triggerStatus(t){var e=this.F(t),r=e===ut?ut:e===lt?lt:dt;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:r}),r}checkUrlTriggerConditions(e,r,i,n){if(void 0!==t&&t.location.href){var o=t.location.href;if(o!==this.T){this.T=o;var s=this.urlBlocked,a=ct(o,this.A,this.R);if(!s||!a){a&&!s?e():!a&&s&&r();var u=this.F(n)===ut,l=ct(o,this.k,this.N);!u&&l&&i("url")}}}}stop(){this.T=""}}class gt{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.B=()=>{},this._instance=t}triggerStatus(){var t=lt;return w(this.linkedFlag)&&(t=dt),this.linkedFlagSeen&&(t=ut),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}onConfig(t,e){var r;if(this.linkedFlag=(mt(t)?I(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!w(this.linkedFlag)&&!this.linkedFlagSeen){var i=b(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=b(this.linkedFlag)?null:this.linkedFlag.variant;this.B=this._instance.onFeatureFlags(((t,r)=>{var o=!1;if(I(r)&&i in r){var s=r[i];o=k(s)?!0===s:n?s===n:!!s}this.linkedFlagSeen=o,o&&e(i,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.B()}}class It{constructor(t){this.O=[],this._instance=t}onConfig(t){var e;this.O=(mt(t)?I(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}Z(t){var e;return 0===this.O.length?dt:(null==(e=this._instance)?void 0:e.get_property(V))===t?ut:lt}triggerStatus(t){var e=this.Z(t),r=e===ut?ut:e===lt?lt:dt;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:r}),r}stop(){}}function yt(t){return t.isRecordingEnabled?ot:rt}function bt(t){if(!t.receivedFlags)return ot;if(!t.isRecordingEnabled)return rt;if(t.urlTriggerMatching.urlBlocked)return st;var e=!0===t.isSampled,r=new ht([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?it:r===ut?nt:r===lt?ot:!1===t.isSampled?rt:nt}function Ct(t){if(!t.receivedFlags)return ot;if(!t.isRecordingEnabled)return rt;if(t.urlTriggerMatching.urlBlocked)return st;var e=new vt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==dt,i=k(t.isSampled);return r&&e===lt?ot:r&&e===dt||i&&!t.isSampled?rt:!0===t.isSampled?it:nt}function wt(t){var e,r;return(null==(e=JSON.stringify(t,(r=[],function(t,e){if(I(e)){for(;r.length>0&&r[r.length-1]!==this;)r.pop();return r.includes(e)?"[Circular]":(r.push(e),e)}return e})))?void 0:e.length)||0}var St=Uint8Array,kt=Uint16Array,At=Uint32Array,Nt=new St([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]),Rt=new St([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]),Tt=new St([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_t=function(t,e){for(var r=new kt(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new At(r[30]);for(i=1;i<30;++i)for(var o=r[i];o<r[i+1];++o)n[o]=o-r[i]<<5|i;return[r,n]},Mt=_t(Nt,2),Ft=Mt[0],Bt=Mt[1];Ft[28]=258,Bt[258]=28;for(var xt=_t(Rt,0)[1],Ot=new kt(32768),Zt=0;Zt<32768;++Zt){var Yt=(43690&Zt)>>>1|(21845&Zt)<<1;Yt=(61680&(Yt=(52428&Yt)>>>2|(13107&Yt)<<2))>>>4|(3855&Yt)<<4,Ot[Zt]=((65280&Yt)>>>8|(255&Yt)<<8)>>>1}var Et=function(t,e,r){for(var i=t.length,n=0,o=new kt(e);n<i;++n)++o[t[n]-1];var s,a=new kt(e);for(n=0;n<e;++n)a[n]=a[n-1]+o[n-1]<<1;if(r){s=new kt(1<<e);var u=15-e;for(n=0;n<i;++n)if(t[n])for(var l=n<<4|t[n],d=e-t[n],c=a[t[n]-1]++<<d,h=c|(1<<d)-1;c<=h;++c)s[Ot[c]>>>u]=l}else for(s=new kt(i),n=0;n<i;++n)s[n]=Ot[a[t[n]-1]++]>>>15-t[n];return s},Gt=new St(288);for(Zt=0;Zt<144;++Zt)Gt[Zt]=8;for(Zt=144;Zt<256;++Zt)Gt[Zt]=9;for(Zt=256;Zt<280;++Zt)Gt[Zt]=7;for(Zt=280;Zt<288;++Zt)Gt[Zt]=8;var Lt=new St(32);for(Zt=0;Zt<32;++Zt)Lt[Zt]=5;var Wt=Et(Gt,9,0),Dt=Et(Lt,5,0),Vt=function(t){return(t/8>>0)+(7&t&&1)},Xt=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof kt?kt:t instanceof At?At:St)(r-e);return i.set(t.subarray(e,r)),i},zt=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},Jt=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Kt=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,o=r.slice();if(!n)return[new St(0),0];if(1==n){var s=new St(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],u=r[1],l=0,d=1,c=2;for(r[0]={s:-1,f:a.f+u.f,l:a,r:u};d!=n-1;)a=r[r[l].f<r[c].f?l++:c++],u=r[l!=d&&r[l].f<r[c].f?l++:c++],r[d++]={s:-1,f:a.f+u.f,l:a,r:u};var h=o[0].s;for(i=1;i<n;++i)o[i].s>h&&(h=o[i].s);var v=new kt(h+1),f=Ht(r[d-1],v,0);if(f>e){i=0;var m=0,p=f-e,g=1<<p;for(o.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));i<n;++i){var I=o[i].s;if(!(v[I]>e))break;m+=g-(1<<f-v[I]),v[I]=e}for(m>>>=p;m>0;){var y=o[i].s;v[y]<e?m-=1<<e-v[y]++-1:++i}for(;i>=0&&m;--i){var b=o[i].s;v[b]==e&&(--v[b],++m)}f=e}return[new St(v),f]},Ht=function(t,e,r){return-1==t.s?Math.max(Ht(t.l,e,r+1),Ht(t.r,e,r+1)):e[t.s]=r},jt=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new kt(++e),i=0,n=t[0],o=1,s=function(t){r[i++]=t},a=1;a<=e;++a)if(t[a]==n&&a!=e)++o;else{if(!n&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(n),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(n);o=1,n=t[a]}return[r.subarray(0,i),e]},Ut=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},Pt=function(t,e,r){var i=r.length,n=Vt(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var o=0;o<i;++o)t[n+o+4]=r[o];return 8*(n+4+i)},qt=function(t,e,r,i,n,o,s,a,u,l,d){zt(e,d++,r),++n[256];for(var c=Kt(n,15),h=c[0],v=c[1],f=Kt(o,15),m=f[0],p=f[1],g=jt(h),I=g[0],y=g[1],b=jt(m),C=b[0],w=b[1],S=new kt(19),k=0;k<I.length;++k)S[31&I[k]]++;for(k=0;k<C.length;++k)S[31&C[k]]++;for(var A=Kt(S,7),N=A[0],R=A[1],T=19;T>4&&!N[Tt[T-1]];--T);var _,M,F,B,x=l+5<<3,O=Ut(n,Gt)+Ut(o,Lt)+s,Z=Ut(n,h)+Ut(o,m)+s+14+3*T+Ut(S,N)+(2*S[16]+3*S[17]+7*S[18]);if(x<=O&&x<=Z)return Pt(e,d,t.subarray(u,u+l));if(zt(e,d,1+(Z<O)),d+=2,Z<O){_=Et(h,v,0),M=h,F=Et(m,p,0),B=m;var Y=Et(N,R,0);zt(e,d,y-257),zt(e,d+5,w-1),zt(e,d+10,T-4),d+=14;for(k=0;k<T;++k)zt(e,d+3*k,N[Tt[k]]);d+=3*T;for(var E=[I,C],G=0;G<2;++G){var L=E[G];for(k=0;k<L.length;++k){var W=31&L[k];zt(e,d,Y[W]),d+=N[W],W>15&&(zt(e,d,L[k]>>>5&127),d+=L[k]>>>12)}}}else _=Wt,M=Gt,F=Dt,B=Lt;for(k=0;k<a;++k)if(i[k]>255){W=i[k]>>>18&31;Jt(e,d,_[W+257]),d+=M[W+257],W>7&&(zt(e,d,i[k]>>>23&31),d+=Nt[W]);var D=31&i[k];Jt(e,d,F[D]),d+=B[D],D>3&&(Jt(e,d,i[k]>>>5&8191),d+=Rt[D])}else Jt(e,d,_[i[k]]),d+=M[i[k]];return Jt(e,d,_[256]),d+M[256]},Qt=new At([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$t=function(){for(var t=new At(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),te=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=$t[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}},ee=function(t,e,r,i,n){return function(t,e,r,i,n,o){var s=t.length,a=new St(i+s+5*(1+Math.floor(s/7e3))+n),u=a.subarray(i,a.length-n),l=0;if(!e||s<8)for(var d=0;d<=s;d+=65535){var c=d+65535;c<s?l=Pt(u,l,t.subarray(d,c)):(u[d]=o,l=Pt(u,l,t.subarray(d,s)))}else{for(var h=Qt[e-1],v=h>>>13,f=8191&h,m=(1<<r)-1,p=new kt(32768),g=new kt(m+1),I=Math.ceil(r/3),y=2*I,b=function(e){return(t[e]^t[e+1]<<I^t[e+2]<<y)&m},C=new At(25e3),w=new kt(288),S=new kt(32),k=0,A=0,N=(d=0,0),R=0,T=0;d<s;++d){var _=b(d),M=32767&d,F=g[_];if(p[M]=F,g[_]=M,R<=d){var B=s-d;if((k>7e3||N>24576)&&B>423){l=qt(t,u,0,C,w,S,A,N,T,d-T,l),N=k=A=0,T=d;for(var x=0;x<286;++x)w[x]=0;for(x=0;x<30;++x)S[x]=0}var O=2,Z=0,Y=f,E=M-F&32767;if(B>2&&_==b(d-E))for(var G=Math.min(v,B)-1,L=Math.min(32767,d),W=Math.min(258,B);E<=L&&--Y&&M!=F;){if(t[d+O]==t[d+O-E]){for(var D=0;D<W&&t[d+D]==t[d+D-E];++D);if(D>O){if(O=D,Z=E,D>G)break;var V=Math.min(E,D-2),X=0;for(x=0;x<V;++x){var z=d-E+x+32768&32767,J=z-p[z]+32768&32767;J>X&&(X=J,F=z)}}}E+=(M=F)-(F=p[M])+32768&32767}if(Z){C[N++]=268435456|Bt[O]<<18|xt[Z];var K=31&Bt[O],H=31&xt[Z];A+=Nt[K]+Rt[H],++w[257+K],++S[H],R=d+O,++k}else C[N++]=t[d],++w[t[d]]}}l=qt(t,u,o,C,w,S,A,N,T,d-T,l)}return Xt(a,0,i+Vt(l)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!0)},re=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},ie=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&re(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}},ne=function(t){return 10+(t.filename&&t.filename.length+1||0)};class oe{constructor(t,e){var r,i;void 0===e&&(e={}),this.Y={},this.G=t=>{if(!this.Y[t]){var e,r;this.Y[t]=!0;var i=this.L(t);null==(e=(r=this.W).onBlockedNode)||e.call(r,t,i)}},this.D=t=>{var e=this.L(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var r=e.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[t,e]},this.L=t=>this._rrweb.mirror.getNode(t),this.V=t=>{var e,r,i,n,o,s,a,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(i=null==(n=t.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(o=null==(s=t.texts)?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null==(u=t.adds)?void 0:u.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,r=this.V(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var[e]=this.D(t.id);return!this.X.consumeRateLimit(e)&&t})));var i=this.V(e);return 0!==i||r===i?t:void 0},this._rrweb=t,this.W=e,this.X=new R({bucketSize:null!==(r=this.W.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.W.refillRate)&&void 0!==i?i:10,refillInterval:1e3,i:this.G,u:M})}reset(){this.Y={}}stop(){this.X.stop(),this.reset()}}function se(t,e){return function(t){for(var e=0,r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<N(100*e,0,100,M)}var ae="$sess_rec_flush_size";class ue{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.J=t.get_property.bind(t),this.K=t.persistence.set_property.bind(t.persistence)}trackSize(t){var e=(Number(this.J(ae))||0)+t;this.K(ae,e)}reset(){return this.K(ae,0)}get currentTrackedSize(){return Number(this.J(ae))||0}}var le=3e5;function de(t){return I(t)?t.network_timing:t}var ce="[SessionRecording]",he=F(ce),ve=[d.MouseMove,d.MouseInteraction,d.Scroll,d.ViewportResize,d.Input,d.TouchMove,d.MediaInteraction,d.Drag],fe=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function me(){var t;return null==o||null==(t=o.__PosthogExtensions__)?void 0:t.rrweb}function pe(){var t;return null==(t=me())?void 0:t.record}function ge(t){return function(t,e){for(var r="",i=0;i<t.length;){var n=t[i++];r+=String.fromCharCode(n)}return r}(function(t,e){void 0===e&&(e={});var r=te(),i=t.length;r.p(t);var n=ee(t,e,ne(e),8),o=n.length;return ie(n,e),re(n,o-8,r.d()),re(n,o-4,i),n}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new St(t.length+(t.length>>>1)),n=0,o=function(t){i[n++]=t},s=0;s<r;++s){if(n+5>i.length){var a=new St(n+8+(r-s<<1));a.set(i),i=a}var u=t.charCodeAt(s);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++s))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return Xt(i,0,n)}(JSON.stringify(t))))}function Ie(t,e){return t.type===l.Custom&&t.data.tag===e}function ye(t){return Ie(t,"sessionIdle")}function be(t){return Ie(t,"$session_ending")}function Ce(t){return Ie(t,"$session_starting")}function we(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),i=t.data.slice(0,r),n=t.data.slice(r);return[we({size:wt(i),data:i,sessionId:t.sessionId,windowId:t.windowId}),we({size:wt(n),data:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}class Se{get sessionId(){return this.H}get j(){if(!this._instance.sessionManager)throw new Error(ce+" must be started with a valid sessionManager.");return this._instance.sessionManager}get U(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get P(){var t=this._instance.get_property(L);return!0===t?null:!1!==t&&(b(t)?t===this.sessionId:null)}get q(){var t,e=null==(t=this.$)?void 0:t.sampleRate;return S(e)?e:null}get tt(){var t,e=null==(t=this.$)?void 0:t.minimumDurationMilliseconds;return S(e)?e:null}constructor(t){this.et="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.rt=void 0,this.it=Date.now(),this.nt=[],this.ot="unknown",this.st=!1,this.ut=new ft,this.lt=[],this.dt=void 0,this.ct=void 0,this.ht=yt,this.vt=void 0,this.ft=void 0,this.gt=void 0,this.It=void 0,this.yt=(t,e,r)=>{var i,n;if(r&&(t!==this.H||e!==this.bt)){var o,s=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),a=this.H,u=this.bt;if(s)this.Ct("$session_ending",{currentSessionId:a,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.it,flushed_size:null==(o=this.wt)?void 0:o.currentTrackedSize});this.wt&&this.wt.reset(),null==(i=this._instance.persistence)||i.unregister(X),this.st=!1,null==(n=me())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.Ct("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.St(),s&&this.Ct("$session_starting",{previousSessionId:a,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.it}),S(this.q)&&w(this.gt)&&this.kt(t)}},this.At=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[W])===this.H},this.Nt=()=>{var t,e;if(0===this.Rt.data.length)return null;var r=null==(t=this.Rt.data[0])?void 0:t.timestamp,i=null==(e=this.Rt.data[this.Rt.data.length-1])?void 0:e.timestamp;return S(r)&&S(i)?i-r:null},this.Tt=()=>{var t,e,r=this.tt;if(!S(r))return!1;if(!(null!==(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)&&void 0!==t&&t)){var i=this._t;return S(i)&&i>=0&&i<r}if(this.At())return!1;var n,o=this.Nt();return!!C(o)||(!(o>=r)||(null==(n=this._instance.persistence)||n.register({[W]:this.H}),!1))},this.Mt=()=>{this.Ft()},this.Bt=()=>{this.Ct("browser offline",{})},this.xt=()=>{this.Ct("browser online",{})},this.Ot=()=>{if(null!=n&&n.visibilityState){var t="window "+n.visibilityState;this.Ct(t,{})}},this._instance=t;var{sessionId:e,windowId:r}=this.j.checkAndGetSessionAndWindowId();this.H=e,this.bt=r,this.Zt=new gt(this._instance),this.Yt=new pt(this._instance),this.Et=new It(this._instance),this.Rt=this.Gt(),this.U>=this.j.sessionTimeoutMs&&he.warn("session_idle_threshold_ms ("+this.U+") is greater than the session timeout ("+this.j.sessionTimeoutMs+"). Session will never be detected as idle"),this.wt=new ue(this._instance)}get Lt(){var t,e,r,i,n,o,s,a=null==(t=this.$)?void 0:t.masking,u={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector},l=null!==(n=null==u?void 0:u.maskAllInputs)&&void 0!==n?n:null==a?void 0:a.maskAllInputs,d=null!==(o=null==u?void 0:u.maskTextSelector)&&void 0!==o?o:null==a?void 0:a.maskTextSelector,c=null!==(s=null==u?void 0:u.blockSelector)&&void 0!==s?s:null==a?void 0:a.blockSelector;return y(l)&&y(d)&&y(c)?void 0:{maskAllInputs:null==l||l,maskTextSelector:d,blockSelector:c}}get Wt(){var t,e,r,i,n,o,s,a=this._instance.config.session_recording.captureCanvas,u=null==(t=this.$)?void 0:t.canvasRecording,l=null!==(e=null!==(r=null==a?void 0:a.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==e&&e,d=null!==(i=null!==(n=null==a?void 0:a.canvasFps)&&void 0!==n?n:null==u?void 0:u.fps)&&void 0!==i?i:4,c=null!==(o=null!==(s=null==a?void 0:a.canvasQuality)&&void 0!==s?s:null==u?void 0:u.quality)&&void 0!==o?o:.4;if("string"==typeof c){var h=parseFloat(c);c=isNaN(h)?.4:h}return{enabled:l,fps:N(d,0,12,F("canvas recording fps"),4),quality:N(c,0,1,F("canvas recording quality"),.4)}}get Dt(){var t,e=!(null==(t=this.$)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Vt(){var t,e,r,i=null==(t=this.$)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},o=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),s=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),a=de(this._instance.config.capture_performance),u=de(null==i?void 0:i.capturePerformance),l=!!(k(a)?a:u);return o||s||l?{recordHeaders:o,recordBody:s,recordPerformance:l}:void 0}Xt(){var t,e,r=[],i=null==(t=o.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;i&&this.Dt&&r.push(i());var n=null==(e=o.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;this.Vt&&g(n)&&(!Z.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(n(et(this._instance.config,this.Vt))):he.info("NetworkCapture not started because we are on localhost."));return r}zt(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var r,i=e.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}Jt(t){try{return t.rrwebMethod(),!0}catch(e){return this.nt.length<10?this.nt.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):he.warn("could not emit queued rrweb event.",e,t),!1}}Ct(t,e){return this.Jt(fe((()=>pe().addCustomEvent(t,e))))}Kt(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),r=e.origin+e.pathname+e.search,i=this.zt(r);this.Ht!==i&&(this.Ht=i,this.Ct("$url_changed",{href:i}))}catch(t){}}jt(){if(this.nt.length){var t=[...this.nt];this.nt=[],t.forEach((t=>{Date.now()-t.enqueuedAt<=2e3&&this.Jt(t)}))}}Ut(){return this.Jt(fe((()=>pe().takeFullSnapshot())))}get Pt(){var t,e;return this.ut.triggerStatus(this.sessionId)!==lt||["sampled","active"].includes(this.status)?null!==(t=null==(e=this._instance.config.session_recording)?void 0:e.full_snapshot_interval_millis)&&void 0!==t?t:le:6e4}qt(){if(this.Qt&&clearInterval(this.Qt),!0!==this.ot){var t=this.Pt;t&&(this.Qt=setInterval((()=>{this.Ut()}),t))}}$t(){this.Yt.urlBlocked||(this.Yt.urlBlocked=!0,clearInterval(this.Qt),he.info("recording paused due to URL blocker"),this.Ct("recording paused",{reason:"url blocker"}))}te(){this.Yt.urlBlocked&&(this.Yt.urlBlocked=!1,this.Ut(),this.qt(),this.Ct("recording resumed",{reason:"left blocked url"}),he.info("recording resumed"))}ee(t){var e;this.ut.triggerStatus(this.sessionId)===lt&&(null==(e=this._instance)||null==(e=e.persistence)||e.register({["url"===t?D:V]:this.H}),this.Ft(),this.re(t+"_trigger_matched"))}get isStarted(){return!!this.rt}get $(){var t=this._instance.get_property(G);if(t){var e=I(t)?t:JSON.parse(t);if(!this.isStarted){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>3e5)return he.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(i=this._instance.persistence)||i.unregister(G))}return e}}ie(t,e){var r;this._instance.get_property(t)&&(e(),null==(r=this._instance.persistence)||r.unregister(t))}start(e){var r,i,n=this.$;if(n){var{sessionId:o,windowId:s}=this.j.checkAndGetSessionAndWindowId();this.H=o,this.bt=s,null==(r=this._instance.persistence)||r.unregister(X),null!=n&&n.endpoint&&(this.et=null==n?void 0:n.endpoint),"any"===(null==n?void 0:n.triggerMatchType)?(this.ht=bt,this.ut=new ht([this.Et,this.Yt])):(this.ht=Ct,this.ut=new vt([this.Et,this.Yt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==n?void 0:n.triggerMatchType}),this.Yt.onConfig(n),this.Et.onConfig(n),null==(i=this.ct)||i.call(this),this.ne(),this.Zt.onConfig(n,((t,e)=>{this.re("linked_flag_matched",{flag:t,variant:e})})),this.ie("$replay_override_sampling",(()=>{this.overrideSampling()})),this.ie("$replay_override_linked_flag",(()=>{this.overrideLinkedFlag()})),this.ie("$replay_override_event_trigger",(()=>{this.overrideTrigger("event")})),this.ie("$replay_override_url_trigger",(()=>{this.overrideTrigger("url")})),this.kt(this.sessionId),this.oe(),O(t,"beforeunload",this.Mt),O(t,"offline",this.Bt),O(t,"online",this.xt),O(t,"visibilitychange",this.Ot),this.vt||(this.vt=this.j.onSessionId(this.yt)),this.ft||(this.ft=this.j.on("forcedIdleReset",(()=>{this.St(),this.ot="unknown",this.stop(),this.It=this.j.onSessionId(((t,e,r)=>{var i;null==(i=this.It)||i.call(this),this.It=void 0,this.yt(t,e,r)}))}))),w(this.dt)&&(this.dt=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.zt(null==t?void 0:t.properties.$current_url):"";if(!e)return;this.Ct("$pageview",{href:e})}}catch(t){he.error("Could not add $pageview to rrweb session",t)}}))),this.status===nt&&this.re(e||"recording_initialized")}else he.info("remote config must be stored in persistence before recording can start")}stop(){var e,r,i,n,o,s,a,u;null==t||t.removeEventListener("beforeunload",this.Mt),null==t||t.removeEventListener("offline",this.Bt),null==t||t.removeEventListener("online",this.xt),null==t||t.removeEventListener("visibilitychange",this.Ot),this.Ft(),this.Gt(),clearInterval(this.Qt),this.se(),null==(e=this.dt)||e.call(this),this.dt=void 0,null==(r=this.ct)||r.call(this),this.ct=void 0,null==(i=this.vt)||i.call(this),this.vt=void 0,null==(n=this.ft)||n.call(this),this.ft=void 0,null==(o=this.gt)||o.call(this),this.gt=void 0,null==(s=this.It)||s.call(this),this.It=void 0,this.Et.stop(),this.Yt.stop(),this.Zt.stop(),null==(a=this.ae)||a.stop(),this.nt=[],null==(u=this.rt)||u.call(this),this.rt=void 0,he.info("stopped")}onRRwebEmit(t){var e,r,i,n,o,s;if(this.jt(),t&&I(t)){if(t.type===l.Meta){var a=this.zt(t.data.href);if(this.Ht=a,!a)return;t.data.href=a}else this.Kt();if(this.Yt.checkUrlTriggerConditions((()=>this.$t()),(()=>this.te()),(t=>this.ee(t)),this.sessionId),!this.Yt.urlBlocked||(c=t).type===l.Custom&&"recording paused"===c.data.tag){var c,h,v;if(t.type===l.FullSnapshot)this.qt(),null==(h=this.ae)||h.reset(),null==(v=this._instance.persistence)||v.register_once({[X]:t.timestamp},void 0);t.type===l.FullSnapshot&&this.ut.triggerStatus(this.sessionId)===lt&&this.ue();var f=this.ae?this.ae.throttleMutations(t):t;if(f){var m=function(t){var e=t;if(e&&I(e)&&6===e.type&&I(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 r=[],i=0;i<e.data.payload.payload.length;i++)e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?r.push(e.data.payload.payload[i].slice(0,2e3)+"...[truncated]"):r.push(e.data.payload.payload[i]);return e.data.payload.payload=r,t}return t}(f),p=function(t){return be(t)?t.data.payload:null}(m),g=function(t){return Ce(t)?t.data.payload:null}(m);if(p||g){var y=null!=p?p:g;null!=y&&y.lastActivityTimestamp&&(m.timestamp=y.lastActivityTimestamp)}else this.le(m);t.type===l.FullSnapshot&&(this.lt.push([this.H,t.timestamp]),this.lt.length>6&&(this.lt=this.lt.slice(-6)));var b=null!==(e=null!==(r=null==p?void 0:p.currentSessionId)&&void 0!==r?r:null==g?void 0:g.nextSessionId)&&void 0!==e?e:this.H,C=null!==(i=null!==(n=null==p?void 0:p.currentWindowId)&&void 0!==n?n:null==g?void 0:g.nextWindowId)&&void 0!==i?i:this.bt;if(!0!==this.ot||function(t){return ye(t)||be(t)||Ce(t)}(m)){if(ye(m)){var w=m.data.payload;if(w){var S=w.lastActivityTimestamp,k=w.threshold;m.timestamp=S+k}}var A=null===(o=this._instance.config.session_recording.compress_events)||void 0===o||o?function(t){try{if(t.type===l.FullSnapshot)return u({},t,{data:ge(t.data),cv:"2024-10"});if(t.type===l.IncrementalSnapshot&&t.data.source===d.Mutation)return u({},t,{cv:"2024-10",data:u({},t.data,{texts:ge(t.data.texts),attributes:ge(t.data.attributes),removes:ge(t.data.removes),adds:ge(t.data.adds)})});if(t.type===l.IncrementalSnapshot&&t.data.source===d.StyleSheetRule)return u({},t,{cv:"2024-10",data:u({},t.data,{adds:t.data.adds?ge(t.data.adds):void 0,removes:t.data.removes?ge(t.data.removes):void 0})})}catch(t){he.error("could not compress event - will use uncompressed event",t)}return t}(m):m,N={$snapshot_bytes:wt(A),$snapshot_data:A,$session_id:b,$window_id:C};m.type===l.FullSnapshot&&null!=(s=me())&&null!=s.wasMaxDepthReached&&s.wasMaxDepthReached()&&(this.st=!0),this.status!==rt?this.de(N):this.Gt()}}}}}get status(){return this.ht({receivedFlags:!0,isRecordingEnabled:!0,isSampled:this.P,urlTriggerMatching:this.Yt,eventTriggerMatching:this.Et,linkedFlagMatching:this.Zt,sessionId:this.sessionId})}log(t,e){var r;void 0===e&&(e="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.Zt.linkedFlagSeen=!0,this.Ut(),this.re("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[L]:this.sessionId}),this.Ut(),this.re("sampling_overridden")}overrideTrigger(t){this.ee(t)}se(){this.ce&&(clearTimeout(this.ce),this.ce=void 0)}Ft(){this.se();var t=this.Tt();if(this.status===ot||this.status===st||this.status===rt||t)return this.ce=setTimeout((()=>{this.Ft()}),2e3),this.Rt;this.Rt.data.length>0&&we(this.Rt).forEach((t=>{var e;null==(e=this.wt)||e.trackSize(t.size),this.he({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:"web",$lib_version:T.LIB_VERSION})}));return this.Gt()}de(t){var e,r=2+((null==(e=this.Rt)?void 0:e.data.length)||0),i=t.$session_id;!this.ot&&(this.Rt.size+t.$snapshot_bytes+r>943718.4||this.Rt.sessionId!==i)&&(this.Rt=this.Ft(),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id),this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.ce||this.ot||(this.ce=setTimeout((()=>{this.Ft()}),2e3))}he(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.et),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get _t(){var t,e,r=null==(t=this.Rt)?void 0:t.data[(null==(e=this.Rt)?void 0:e.data.length)-1],{sessionStartTimestamp:i}=this.j.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i:null}ue(){if(!this.Rt||0===this.Rt.data.length)return this.Gt();for(var t=-1,e=this.Rt.data.length-1;e>=0;e--)if(this.Rt.data[e].type===l.Meta){t=e;break}return t>=0?(this.Rt.data=this.Rt.data.slice(t),this.Rt.size=this.Rt.data.reduce(((t,e)=>t+wt(e)),0),this.Rt):this.Gt()}Gt(){return this.Rt={size:0,data:[],sessionId:this.H,windowId:this.bt},this.Rt}re(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),he.info(t.replace("_"," "),e),-1===["recording_initialized","session_id_changed"].indexOf(t)&&this.Ct(t,e)}ve(t){var e;return 3===t.type&&-1!==ve.indexOf(null==(e=t.data)?void 0:e.source)}le(t){var e=this.ve(t);e||this.ot||t.timestamp-this.it>this.U&&(this.ot=!0,clearInterval(this.Qt),this.Ct("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.it,threshold:this.U,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size}),this.Ft());var r=!1;if(e&&(this.it=t.timestamp,this.ot)){var i="unknown"===this.ot;this.ot=!1,i||(this.Ct("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}if(!this.ot){var{windowId:n,sessionId:o}=this.j.checkAndGetSessionAndWindowId(!e,t.timestamp),s=this.H!==o,a=this.bt!==n;this.bt=n,this.H=o,s||a?(this.stop(),this.start("session_id_changed")):r&&this.qt()}}St(){var t,e,r,i;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(V),null==(e=this._instance)||null==(e=e.persistence)||e.unregister(D),null==(r=this._instance)||null==(r=r.persistence)||r.unregister(L),null==(i=this._instance)||null==(i=i.persistence)||i.unregister(W)}kt(t){var e,r=this.H!==t,i=this.q;if(S(i)){var n=this.P,o=r||!k(n),s=o?se(t,i):n;o&&(s?this.re(it):he.warn("Sample rate ("+i+") has determined that this sessionId ("+t+") will not be sent to the server."),this.Ct("samplingDecisionMade",{sampleRate:i,isSampled:s})),null==(e=this._instance.persistence)||e.register({[L]:!!s&&t})}else{var a;null==(a=this._instance.persistence)||a.unregister(L)}}ne(){0!==this.Et.O.length&&w(this.ct)&&(this.ct=this._instance.on("eventCaptured",(t=>{try{this.Et.O.includes(t.event)&&this.ee("event")}catch(t){he.error("Could not activate event trigger",t)}})))}get sdkDebugProperties(){var t,{sessionStartTimestamp:e}=this.j.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$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._t,$sdk_debug_session_start:e,$sdk_debug_replay_flushed_size:null==(t=this.wt)?void 0:t.currentTrackedSize,$sdk_debug_replay_full_snapshots:this.lt,$snapshot_max_depth_exceeded:this.st}}oe(){var t;if(!this.rt){var e,r,i,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},o=this._instance.config.session_recording;for(var[s,a]of Object.entries(o||{}))s in n&&("maskInputOptions"===s?n.maskInputOptions=u({password:!0},a):n[s]=a);if(this.Wt&&this.Wt.enabled&&(n.recordCanvas=!0,n.sampling={canvas:this.Wt.fps},n.dataURLOptions={type:"image/webp",quality:this.Wt.quality}),this.Lt)n.maskAllInputs=null===(e=this.Lt.maskAllInputs)||void 0===e||e,n.maskTextSelector=null!==(r=this.Lt.maskTextSelector)&&void 0!==r?r:void 0,n.blockSelector=null!==(i=this.Lt.blockSelector)&&void 0!==i?i:void 0;var l=pe();if(l){this.ae=null!==(t=this.ae)&&void 0!==t?t:new oe(l,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var r="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";he.info(r,{node:e}),this.log(ce+" "+r,"warn")}});var d=this.Xt();this.rt=l(u({emit:t=>{this.onRRwebEmit(t)},plugins:d},n)),this.it=Date.now(),this.ot=k(this.ot)?this.ot:"unknown",this.tryAddCustomEvent("$remote_config_received",this.$),this.Ct("$session_options",{sessionRecordingOptions:n,activePlugins:d.map((t=>null==t?void 0:t.name))}),this.Ct("$posthog_config",{config:this._instance.config})}else he.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Ct(t,e)}}var ke,Ae=["type"],Ne=Object.defineProperty,Re=(t,e,r)=>((t,e,r)=>e in t?Ne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Te=Object.defineProperty,_e=(t,e,r)=>((t,e,r)=>e in t?Te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Me=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(Me||{}),Fe={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Be={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var xe={};function Oe(t){if(xe[t])return xe[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in Fe?Fe[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in Be?Be[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return xe[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?xe[t]=l:e.prototype}catch(t){return e.prototype}}var Ze={};function Ye(t,e,r){var i,n=t+"."+String(r);if(Ze[n])return Ze[n].call(e);var o=Oe(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(Ze[n]=s,s.call(e)):e[r]}var Ee={};function Ge(t,e,r){var i=t+"."+String(r);if(Ee[i])return Ee[i].bind(e);var n=Oe(t)[r];return"function"!=typeof n?e[r]:(Ee[i]=n,n.bind(e))}var Le={childNodes:function(t){return Ye("Node",t,"childNodes")},parentNode:function(t){return Ye("Node",t,"parentNode")},parentElement:function(t){return Ye("Node",t,"parentElement")},textContent:function(t){return Ye("Node",t,"textContent")},contains:function(t,e){return Ge("Node",t,"contains")(e)},getRootNode:function(t){return Ge("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ye("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ye("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ye("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ye("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Oe("MutationObserver").constructor}};function We(t){return t.nodeType===t.ELEMENT_NODE}function De(t){var e=t&&"host"in t&&"mode"in t&&Le.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Le.shadowRoot(e)===t)}function Ve(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function Xe(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>ze(e,t.href))).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function ze(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=Xe(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){r=t.cssText}return t.styleSheet.href?rr(r,t.styleSheet.href):r}var i,n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),e?rr(n,e):n}function Je(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let Ke=class{constructor(){_e(this,"idNodeMap",new Map),_e(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-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);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function He(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:o,maskInputFn:s}=t,a=o||"",u=n&&je(n);return(r[i.toLowerCase()]||u&&r[u])&&(a=s?s(a,e):"*".repeat(a.length)),a}function je(t){return t.toLowerCase()}var Ue="__rrweb_original__";function Pe(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?je(e):null}function qe(t,e){var r,i;try{i=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}var Qe=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,$e=/^(?:[a-z+]+:)?\/\//i,tr=/^www\..*/i,er=/^(data:)([^,]*),(.*)/i;function rr(t,e){return(t||"").replace(Qe,((t,r,i,n,o,s)=>{var a,u=i||o||s,l=r||n||"";if(!u)return t;if($e.test(u)||tr.test(u))return"url("+l+u+l+")";if(er.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+u)+l+")";var d=e.split("/"),c=u.split("/");for(var h of(d.pop(),c))"."!==h&&(".."===h?d.pop():d.push(h));return"url("+l+d.join("/")+l+")"}))}var ir,nr,or=1,sr=new RegExp("[^a-z0-9-_:]"),ar=-2;function ur(){return or++}var lr=/^[^ \t\n\r\u000c]+/,dr=/^[, \t\n\r\u000c]+/;var cr=new WeakMap;function hr(t,e){return e&&""!==e.trim()?fr(t,e):e}function vr(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function fr(t,e){var r=cr.get(t);if(r||(r=t.createElement("a"),cr.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function mr(t,e,r,i){return i?"src"===r||"href"===r&&("use"!==e||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?hr(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(dr),!(r>=e.length);){var o=i(lr);if(","===o.slice(-1))o=hr(t,o.substring(0,o.length-1)),n.push(o);else{var s="";o=hr(t,o);for(var a=!1;;){var u=e.charAt(r);if(""===u){n.push((o+s).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,n.push((o+s).trim());break}"("===u&&(a=!0)}s+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?rr(i,fr(t)):"object"===e&&"data"===r?hr(t,i):i:hr(t,i):i}function pr(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function gr(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&gr(Le.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&gr(Le.parentNode(t),e,r)}function Ir(t,e,r,i){var n;if(We(t)){if(n=t,!Le.childNodes(n).length)return!1}else{if(null===Le.parentElement(t))return!1;n=Le.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(gr(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function yr(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:u={},maskTextFn:l,maskInputFn:d,dataURLOptions:c={},inlineImages:h,recordCanvas:v,keepIframeSrcFn:f,newlyAddedElement:m=!1}=e,p=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:Me.Document,childNodes:[],compatMode:t.compatMode}:{type:Me.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Me.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:p};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:i,blockClass:n,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:u,dataURLOptions:l={},inlineImages:d,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:v=!1,rootId:f}=e,m=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,n,o),p=function(t){if(t instanceof HTMLFormElement)return"form";var e=je(t.tagName);return sr.test(e)?"div":e}(t),g={},I=t.attributes.length,y=0;y<I;y++){var b=t.attributes[y];pr(p,b.name,b.value)||(g[b.name]=mr(i,p,je(b.name),b.value))}if("link"===p&&s){var C=function(t){return null==t?void 0:t.href}(t);if(C){var w=Je(i,C);if(!w&&C.includes(".css"))w=Je(i,window.location.origin+"/"+C.replace(window.location.href,""));var S=null;w&&(S=Xe(w)),S&&(delete g.rel,delete g.href,g._cssText=S)}}if("style"===p&&t.sheet&&!(t.innerText||Le.textContent(t)||"").trim().length){var k=Xe(t.sheet);k&&(g._cssText=k)}if("input"===p||"textarea"===p||"select"===p){var A=t.value,N=t.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&A?g.value=He({element:t,type:Pe(t),tagName:p,value:A,maskInputOptions:a,maskInputFn:u}):N&&(g.checked=N)}"option"===p&&(t.selected&&!a.select?g.selected=!0:delete g.selected);if("dialog"===p&&t.open)try{g.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){g.rr_open_mode="modal",g.ph_rr_could_not_detect_modal=!0}if("canvas"===p&&c)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;r<t.width;r+=50)for(var i=0;i<t.height;i+=50){var n=e.getImageData,o=Ue in n?n[Ue]:n;if(new Uint32Array(o.call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(g.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){var R=t.toDataURL(l.type,l.quality),T=i.createElement("canvas");T.width=t.width,T.height=t.height,R!==T.toDataURL(l.type,l.quality)&&(g.rr_dataURL=R)}if("img"===p&&d){ir||(ir=i.createElement("canvas"),nr=ir.getContext("2d"));var _=t,M=_.currentSrc||_.getAttribute("src")||"<unknown-src>",F=_.crossOrigin,B=()=>{_.removeEventListener("load",B);try{ir.width=_.naturalWidth,ir.height=_.naturalHeight,nr.drawImage(_,0,0),g.rr_dataURL=ir.toDataURL(l.type,l.quality)}catch(t){if("anonymous"!==_.crossOrigin)return _.crossOrigin="anonymous",void(_.complete&&0!==_.naturalWidth?B():_.addEventListener("load",B));console.warn("Cannot inline img src="+M+"! Error: "+t)}"anonymous"===_.crossOrigin&&(F?g.crossOrigin=F:_.removeAttribute("crossorigin"))};_.complete&&0!==_.naturalWidth?B():_.addEventListener("load",B)}if("audio"===p||"video"===p){var x=g;x.rr_mediaState=t.paused?"paused":"played",x.rr_mediaCurrentTime=t.currentTime,x.rr_mediaPlaybackRate=t.playbackRate,x.rr_mediaMuted=t.muted,x.rr_mediaLoop=t.loop,x.rr_mediaVolume=t.volume}v||(t.scrollLeft&&(g.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(g.rr_scrollTop=t.scrollTop));if(m){var{width:O,height:Z}=t.getBoundingClientRect();g={class:g.class,rr_width:O+"px",rr_height:Z+"px"}}"iframe"!==p||h(g.src)||(t.contentDocument||(g.rr_src=g.src),delete g.src);try{customElements.get(p)&&(r=!0)}catch(t){}return{type:Me.Element,tagName:p,attributes:g,childNodes:[],isSVG:vr(t)||void 0,needBlock:m,rootId:f,isCustom:r}}(t,{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:u,maskInputFn:d,dataURLOptions:c,inlineImages:h,recordCanvas:v,keepIframeSrcFn:f,newlyAddedElement:m,rootId:p});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:o}=e,s=Le.parentNode(t),a=s&&s.tagName,u=Le.textContent(t),l="STYLE"===a||void 0,d="SCRIPT"===a||void 0;if(l&&u){try{t.nextSibling||t.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(u=Xe(s.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=rr(u,fr(e.doc))}d&&(u="SCRIPT_PLACEHOLDER");!l&&!d&&u&&i&&(u=n?n(u,Le.parentElement(t)):u.replace(/[\S]/g,"*"));return{type:Me.Text,textContent:u||"",isStyle:l,rootId:o}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:p});case t.CDATA_SECTION_NODE:return{type:Me.CDATA,textContent:"",rootId:p};case t.COMMENT_NODE:return{type:Me.Comment,textContent:Le.textContent(t)||"",rootId:p};default:return!1}}function br(t){return null==t?"":t.toLowerCase()}function Cr(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:d={},maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:p=!1,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:w=(()=>!1),newlyAddedElement:S=!1}=e,{needsMask:k}=e,{preserveWhiteSpace:A=!0}=e;k||(k=Ir(t,s,a,void 0===k));var N,R=yr(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:k,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,dataURLOptions:f,inlineImages:m,recordCanvas:p,keepIframeSrcFn:w,newlyAddedElement:S});if(!R)return console.warn(t,"not serialized"),null;N=i.hasNode(t)?i.getId(t):!function(t,e){if(e.comment&&t.type===Me.Comment)return!0;if(t.type===Me.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===qe(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(br(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===br(t.attributes.name)||"icon"===br(t.attributes.rel)||"apple-touch-icon"===br(t.attributes.rel)||"shortcut icon"===br(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&br(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(br(t.attributes.property).match(/^(og|twitter|fb):/)||br(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===br(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===br(t.attributes.name)||"googlebot"===br(t.attributes.name)||"bingbot"===br(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===br(t.attributes.name)||"generator"===br(t.attributes.name)||"framework"===br(t.attributes.name)||"publisher"===br(t.attributes.name)||"progid"===br(t.attributes.name)||br(t.attributes.property).match(/^article:/)||br(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===br(t.attributes.name)||"yandex-verification"===br(t.attributes.name)||"csrf-token"===br(t.attributes.name)||"p:domain_verify"===br(t.attributes.name)||"verify-v1"===br(t.attributes.name)||"verification"===br(t.attributes.name)||"shopify-checkout-api-token"===br(t.attributes.name)))return!0}}return!1}(R,v)&&(A||R.type!==Me.Text||R.isStyle||R.textContent.replace(/^\s+|\s+$/gm,"").length)?ur():ar;var T=Object.assign(R,{id:N});if(i.add(t,T),N===ar)return null;g&&g(t);var _=!u;if(T.type===Me.Element){_=_&&!T.needBlock,delete T.needBlock;var M=Le.shadowRoot(t);M&&Ve(M)&&(T.isShadowHost=!0)}if((T.type===Me.Document||T.type===Me.Element)&&_){v.headWhitespace&&T.type===Me.Element&&"head"===T.tagName&&(A=!1);var F={doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:k,maskTextClass:s,maskTextSelector:a,skipChild:u,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:A,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w};if(T.type===Me.Element&&"textarea"===T.tagName&&void 0!==T.attributes.value);else for(var B of Array.from(Le.childNodes(t))){var x=Cr(B,F);x&&T.childNodes.push(x)}var O=null;if(We(t)&&(O=Le.shadowRoot(t)))for(var Z of Array.from(Le.childNodes(O))){var Y=Cr(Z,F);Y&&(Ve(O)&&(Y.isShadow=!0),T.childNodes.push(Y))}}var E=Le.parentNode(t);return E&&De(E)&&Ve(E)&&(T.isShadow=!0),T.type===Me.Element&&"iframe"===T.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,o=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var s="about:blank";if(i.location.href!==s||t.src===s||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{o||(e(),o=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),o=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=Cr(e,{doc:e,mirror:i,blockClass:n,blockSelector:o,needsMask:k,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:A,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w});r&&I(t,r)}}),y),T.type===Me.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===qe(T.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var o=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),n=!0,e()}))}}(t,(()=>{if(b){var e=Cr(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:k,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:A,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w});e&&b(t,e)}}),C),T}let wr=class t{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}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"}};var Sr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},kr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var Ar={};function Nr(t){if(Ar[t])return Ar[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in Sr?Sr[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in kr?kr[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return Ar[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?Ar[t]=l:r}catch(t){return r}}var Rr={};function Tr(t,e,r){var i,n=t+"."+String(r);if(Rr[n])return Rr[n].call(e);var o=Nr(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(Rr[n]=s,s.call(e)):e[r]}var _r={};function Mr(t,e,r){var i=t+"."+String(r);if(_r[i])return _r[i].bind(e);var n=Nr(t)[r];return"function"!=typeof n?e[r]:(_r[i]=n,n.bind(e))}function Fr(){return Nr("MutationObserver").constructor}var Br={childNodes:function(t){return Tr("Node",t,"childNodes")},parentNode:function(t){return Tr("Node",t,"parentNode")},parentElement:function(t){return Tr("Node",t,"parentElement")},textContent:function(t){return Tr("Node",t,"textContent")},contains:function(t,e){return Mr("Node",t,"contains")(e)},getRootNode:function(t){return Mr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Tr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Tr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Tr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Tr("Element",t,"querySelectorAll")(e)},mutationObserver:Fr};function xr(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var Or="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.",Zr={map:{},getId:()=>(console.error(Or),-1),getNode:()=>(console.error(Or),null),removeNodeFromMap(){console.error(Or)},has:()=>(console.error(Or),!1),reset(){console.error(Or)}};function Yr(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),d=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(d,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(d,s)}),l))}}function Er(t,e,r,i,n){void 0===n&&(n=window);var o=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>Er(t,e,o||{},!0)}function Gr(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Zr=new Proxy(Zr,{get:(t,e,r)=>("map"===e&&console.error(Or),Reflect.get(t,e,r))}));var Lr=Date.now;function Wr(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=Br.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=Br.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function Dr(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Vr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Xr(t){return t?t.nodeType===t.ELEMENT_NODE?t:Br.parentElement(t):null}function zr(t,e,r,i){if(!t)return!1;var n=Xr(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(gr(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Jr(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===ar}function Kr(t,e){if(De(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=Br.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Kr(i,e))}function Hr(t){return Boolean(t.changedTouches)}function jr(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Ur(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Pr(t){return!!t&&(t instanceof wr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Br.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Lr=()=>(new Date).getTime());let qr=class{constructor(){Re(this,"id",1),Re(this,"styleIDMap",new WeakMap),Re(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):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}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 Qr(t){var e,r=null;return"getRootNode"in t&&(null==(e=Br.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Br.host(Br.getRootNode(t))&&(r=Br.host(Br.getRootNode(t))),r}function $r(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Qr(r);)r=e;return r}(t);return Br.contains(e,r)}function ti(t){var e=t.ownerDocument;return!!e&&(Br.contains(e,t)||$r(t))}var ei=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(ei||{}),ri=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(ri||{}),ii=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(ii||{}),ni=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(ni||{}),oi=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(oi||{}),si=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(si||{});function ai(t){return"__ln"in t}class ui{constructor(){Re(this,"length",0),Re(this,"head",null),Re(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;r<t;r++)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&&ai(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&ai(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var li,di=(t,e)=>t+"@"+e;class ci{constructor(){Re(this,"frozen",!1),Re(this,"locked",!1),Re(this,"texts",[]),Re(this,"attributes",[]),Re(this,"attributeMap",new WeakMap),Re(this,"removes",[]),Re(this,"mapRemoves",[]),Re(this,"movedMap",{}),Re(this,"addedSet",new Set),Re(this,"movedSet",new Set),Re(this,"droppedSet",new Set),Re(this,"mutationCb"),Re(this,"blockClass"),Re(this,"blockSelector"),Re(this,"maskTextClass"),Re(this,"maskTextSelector"),Re(this,"inlineStylesheet"),Re(this,"maskInputOptions"),Re(this,"maskTextFn"),Re(this,"maskInputFn"),Re(this,"keepIframeSrcFn"),Re(this,"recordCanvas"),Re(this,"inlineImages"),Re(this,"slimDOMOptions"),Re(this,"dataURLOptions"),Re(this,"doc"),Re(this,"mirror"),Re(this,"iframeManager"),Re(this,"stylesheetManager"),Re(this,"shadowDomManager"),Re(this,"canvasManager"),Re(this,"processedNodeManager"),Re(this,"unattachedDoc"),Re(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),Re(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new ui,i=t=>{for(var e=t,r=ar;r===ar;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var o=Br.parentNode(n);if(o&&ti(n)&&"TEXTAREA"!==o.tagName){var s=De(o)?this.mirror.getId(Qr(n)):this.mirror.getId(o),a=i(n);if(-1===s||-1===a)return r.addNode(n);var u=Cr(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{jr(t,this.mirror)&&this.iframeManager.addIframe(t),Ur(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Pr(n)&&this.shadowDomManager.addShadowRoot(Br.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:s,nextId:a,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)vi(this.removes,o,this.mirror)&&!this.movedSet.has(Br.parentNode(o))||n(o);for(var s of this.addedSet)fi(this.droppedSet,s)||vi(this.removes,s,this.mirror)?fi(this.movedSet,s)?n(s):this.droppedSet.add(s):n(s);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(Br.parentNode(a.value)),d=i(a.value);-1!==l&&-1!==d&&(u=a)}if(!u)for(var c=r.tail;c;){var h=c;if(c=c.previous,h){var v=this.mirror.getId(Br.parentNode(h.value));if(-1===i(h.value))continue;if(-1!==v){u=h;break}var f=h.value,m=Br.parentNode(f);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=Br.host(m);if(-1!==this.mirror.getId(p)){u=h;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),n(u.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=Br.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(g))}})),Re(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(Br.childNodes(t),(t=>Br.textContent(t)||"")).join("")})),Re(this,"processMutation",(t=>{if(!Jr(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=Br.textContent(t.target);zr(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Ir(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Xr(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var o=Pe(r);n=He({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:n,maskInputFn:this.maskInputFn})}if(zr(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var s=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!pr(r.tagName,i))if(s.attributes[i]=mr(this.doc,je(r.tagName),je(i),n),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),d=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||d!==a.style.getPropertyPriority(u)?s.styleDiff[u]=""===d?l:[l,d]:s._unchangedStyles[u]=[l,d]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(s.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(zr(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 r=this.mirror.getId(e),i=De(t.target)?this.mirror.getId(Br.host(t.target)):this.mirror.getId(t.target);zr(t.target,this.blockClass,this.blockSelector,!1)||Jr(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(hi(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Kr(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[di(r,i)]?hi(this.movedSet,e):this.removes.push({parentId:i,id:r,isShadow:!(!De(t.target)||!Ve(t.target))||void 0})),this.mapRemoves.push(e))}))}})),Re(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Jr(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[di(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);zr(t,this.blockClass,this.blockSelector,!1)||(Br.childNodes(t).forEach((t=>this.genAdds(t))),Pr(t)&&Br.childNodes(Br.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}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.shadowDomManager.reset(),this.canvasManager.reset()}}function hi(t,e){t.delete(e),Br.childNodes(e).forEach((e=>hi(t,e)))}function vi(t,e,r){return 0!==t.length&&function(t,e,r){var i,n=Br.parentNode(e),o=function(){var e=r.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=Br.parentNode(n)};for(;n;)if(i=o())return i.v;return!1}(t,e,r)}function fi(t,e){return 0!==t.size&&mi(t,e)}function mi(t,e){var r=Br.parentNode(e);return!!r&&(!!t.has(r)||mi(t,r))}var pi=t=>{if(!li)return t;return function(){try{return t(...arguments)}catch(t){if(li&&!0===li(t))return;throw t}}},gi=[];function Ii(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 yi(t,e){var r=new ci;gi.push(r),r.init(t);var i=new(Fr())(pi(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function bi(t){var{mouseInteractionCb:e,doc:r,mirror:i,blockClass:n,blockSelector:o,sampling:s}=t;if(!1===s.mouseInteraction)return()=>{};var a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[],d=null;return Object.keys(ii).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t])).forEach((t=>{var s=je(t),a=(t=>r=>{var s=Ii(r);if(!zr(s,n,o,!0)){var a=null,l=t;if("pointerType"in r){switch(r.pointerType){case"mouse":a=ni.Mouse;break;case"touch":a=ni.Touch;break;case"pen":a=ni.Pen}a===ni.Touch?ii[t]===ii.MouseDown?l="TouchStart":ii[t]===ii.MouseUp&&(l="TouchEnd"):ni.Pen}else Hr(r)&&(a=ni.Touch);null!==a?(d=a,(l.startsWith("Touch")&&a===ni.Touch||l.startsWith("Mouse")&&a===ni.Mouse)&&(a=null)):ii[t]===ii.Click&&(a=d,d=null);var c=Hr(r)?r.changedTouches[0]:r;if(c){var h=i.getId(s),{clientX:v,clientY:f}=c;pi(e)(u({type:ii[l],id:h,x:v,y:f},null!==a&&{pointerType:a}))}}})(t);if(window.PointerEvent)switch(ii[t]){case ii.MouseDown:case ii.MouseUp:s=s.replace("mouse","pointer");break;case ii.TouchStart:case ii.TouchEnd:return}l.push(xr(s,a,r))})),pi((()=>{l.forEach((t=>t()))}))}function Ci(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:o,sampling:s}=t;return xr("scroll",pi(Yr(pi((t=>{var s=Ii(t);if(s&&!zr(s,n,o,!0)){var a=i.getId(s);if(s===r&&r.defaultView){var u=Wr(r.defaultView);e({id:a,x:u.left,y:u.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var wi=["INPUT","TEXTAREA","SELECT"],Si=new WeakMap;function ki(t){return function(t,e){if(Ti("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Ti("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Ti("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Ti("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(i)}return e}(t,[])}function Ai(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function Ni(t,e){var r,i,n,{mirror:o,stylesheetManager:s}=t,a=null;a="#document"===e.nodeName?o.getId(e):o.getId(Br.host(e));var u="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&u&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r=null==(e=l.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{s.adoptStyleSheets(t,a)}catch(t){}return r}}),pi((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function Ri(t,e){void 0===e&&(e={});var r,i=t.doc.defaultView;if(!i)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:d,canvasMutationCb:c,fontCb:h,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),o(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),s(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),d(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),h(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(r=yi(t,t.doc));var n=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;if(!1===r.mousemove)return()=>{};var o,s="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=Yr(pi((t=>{var r=Date.now()-o;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],o=null})),a),d=pi(Yr(pi((t=>{var e=Ii(t),{clientX:r,clientY:i}=Hr(t)?t.changedTouches[0]:t;o||(o=Lr()),u.push({x:r,y:i,id:n.getId(e),timeOffset:Lr()-o}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?ri.Drag:t instanceof MouseEvent?ri.MouseMove:ri.TouchMove)})),s,{trailing:!1})),c=[xr("mousemove",d,i),xr("touchmove",d,i),xr("drag",d,i)];return pi((()=>{c.forEach((t=>t()))}))}(t),o=bi(t),s=Ci(t),a=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,o=-1;return xr("resize",pi(Yr(pi((()=>{var t=Dr(),e=Vr();n===t&&o===e||(r({width:Number(e),height:Number(t)}),n=t,o=e)})),200)),i)}(t,{win:i}),l=function(t){var{inputCb:e,doc:r,mirror:i,blockClass:n,blockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:d,sampling:c,userTriggeredOnInput:h}=t;function v(t){var e=Ii(t),i=t.isTrusted,u=e&&e.tagName;if(e&&"OPTION"===u&&(e=Br.parentElement(e)),e&&u&&!(wi.indexOf(u)<0)&&!zr(e,n,o,!0)&&!(e.classList.contains(s)||a&&e.matches(a))){var c=e.value,v=!1,m=Pe(e)||"";"radio"===m||"checkbox"===m?v=e.checked:(l[u.toLowerCase()]||l[m])&&(c=He({element:e,maskInputOptions:l,tagName:u,type:m,value:c,maskInputFn:d})),f(e,h?{text:c,isChecked:v,userTriggered:i}:{text:c,isChecked:v});var p=e.name;"radio"===m&&p&&v&&r.querySelectorAll('input[type="radio"][name="'+p+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,h?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,r){var n=Si.get(t);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){Si.set(t,r);var o=i.getId(t);pi(e)(u({},r,{id:o}))}}var m=("last"===c.input?["change"]:["input","change"]).map((t=>xr(t,pi(v),r))),p=r.defaultView;if(!p)return()=>{m.forEach((t=>t()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),I=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...I.map((t=>Er(t[0],t[1],{set(){pi(v)({target:this,isTrusted:!1})}},!1,p)))),pi((()=>{m.forEach((t=>t()))}))}(t),d=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:o,doc:s}=t,a=pi((t=>Yr(pi((o=>{var s=Ii(o);if(s&&!zr(s,r,i,!0)){var{currentTime:a,volume:u,muted:l,playbackRate:d,loop:c}=s;e({type:t,id:n.getId(s),currentTime:a,volume:u,muted:l,playbackRate:d,loop:c})}})),o.media||500))),u=[xr("play",a(si.Play),s),xr("pause",a(si.Pause),s),xr("seeked",a(si.Seeked),s),xr("volumechange",a(si.VolumeChange),s),xr("ratechange",a(si.RateChange),s)];return pi((()=>{u.forEach((t=>t()))}))}(t),c=()=>{},h=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:o}=e;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:pi(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=Ai(e,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:a}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.addRule=function(t,e,r){void 0===r&&(r=this.cssRules.length);var i=t+" { "+e+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:pi(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=Ai(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:s}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(t){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:pi(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=Ai(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replace:s}),t.apply(e,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(u=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:pi(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=Ai(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:s}),t.apply(e,o)}))}));var d={};_i("CSSGroupingRule")?d.CSSGroupingRule=o.CSSGroupingRule:(_i("CSSMediaRule")&&(d.CSSMediaRule=o.CSSMediaRule),_i("CSSConditionRule")&&(d.CSSConditionRule=o.CSSConditionRule),_i("CSSSupportsRule")&&(d.CSSSupportsRule=o.CSSSupportsRule));var c={};return Object.entries(d).forEach((t=>{var[e,o]=t;c[e]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[e].insertRule,{apply:pi(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=Ai(e.parentStyleSheet,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:[...ki(e),a||0]}]}),t.apply(e,o)}))}),o.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:pi(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=Ai(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...ki(e),s]}]}),t.apply(e,o)}))})})),pi((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=l,a&&(o.CSSStyleSheet.prototype.replace=a),u&&(o.CSSStyleSheet.prototype.replaceSync=u),Object.entries(d).forEach((t=>{var[e,r]=t;r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:i}),h=Ni(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:o}=t,{win:s}=e,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:pi(((t,e,s)=>{var u,[l,d,c]=s;if(n.has(l))return a.apply(e,[l,d,c]);var{id:h,styleId:v}=Ai(null==(u=e.parentRule)?void 0:u.parentStyleSheet,i,o.styleMirror);return(h&&-1!==h||v&&-1!==v)&&r({id:h,styleId:v,set:{property:l,value:d,priority:c},index:ki(e.parentRule)}),t.apply(e,s)}))});var u=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:pi(((t,e,s)=>{var a,[l]=s;if(n.has(l))return u.apply(e,[l]);var{id:d,styleId:c}=Ai(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror);return(d&&-1!==d||c&&-1!==c)&&r({id:d,styleId:c,remove:{property:l},index:ki(e.parentRule)}),t.apply(e,s)}))}),pi((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:i}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(t,e,r){var i=new s(t,e,r);return o.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=Gr(r.fonts,"add",(function(t){return function(r){return setTimeout(pi((()=>{var t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=s})),n.push(a),pi((()=>{n.forEach((t=>t()))}))}(t)));var m=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:o}=t,s=!0,a=pi((()=>{var t=e.getSelection();if(!(!t||s&&(null==t?void 0:t.isCollapsed))){s=t.isCollapsed||!1;for(var a=[],u=t.rangeCount||0,l=0;l<u;l++){var d=t.getRangeAt(l),{startContainer:c,startOffset:h,endContainer:v,endOffset:f}=d;zr(c,i,n,!0)||zr(v,i,n,!0)||a.push({start:r.getId(c),startOffset:h,end:r.getId(v),endOffset:f})}o({ranges:a})}}));return a(),xr("selectionchange",a)}(t),p=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?Gr(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),g=[];for(var I of t.plugins)g.push(I.observer(I.callback,i,I.options));return pi((()=>{gi.forEach((t=>t.reset())),null==r||r.disconnect(),n(),o(),s(),a(),l(),d(),c(),h(),v(),f(),m(),p(),g.forEach((t=>t()))}))}function Ti(t){return void 0!==window[t]}function _i(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Mi{constructor(t){Re(this,"iframeIdToRemoteIdMap",new WeakMap),Re(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),o=i||this.getRemoteIdToIdMap(t),s=n.get(e);return s||(s=this.generateIdFn(),n.set(e,s),o.set(s,e)),s}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var n=i.get(e);return n||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class Fi{constructor(t){Re(this,"iframes",new WeakMap),Re(this,"crossOriginIframeMap",new WeakMap),Re(this,"crossOriginIframeMirror",new Mi(ur)),Re(this,"crossOriginIframeStyleMirror"),Re(this,"crossOriginIframeRootIdMap",new WeakMap),Re(this,"mirror"),Re(this,"mutationCb"),Re(this,"wrappedEmit"),Re(this,"loadListener"),Re(this,"stylesheetManager"),Re(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Mi(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=t.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case ei.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),{timestamp:e.timestamp,type:ei.IncrementalSnapshot,data:{source:ri.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case ei.Meta:case ei.Load:case ei.DomContentLoaded:return!1;case ei.Plugin:return e;case ei.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case ei.IncrementalSnapshot:switch(e.data.source){case ri.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),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 ri.Drag:case ri.TouchMove:case ri.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case ri.ViewportResize:return!1;case ri.MediaInteraction:case ri.MouseInteraction:case ri.Scroll:case ri.CanvasMutation:case ri.Input:return this.replaceIds(e.data,t,["id"]),e;case ri.StyleSheetRule:case ri.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case ri.Font:return e;case ri.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case ri.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(Array.isArray(e[n])?e[n]=t.getIds(r,e[n]):e[n]=t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}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===Me.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class Bi{constructor(t){Re(this,"shadowDoms",new WeakSet),Re(this,"mutationCb"),Re(this,"scrollCb"),Re(this,"bypassOptions"),Re(this,"mirror"),Re(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){if(Ve(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var r=yi(u({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(Ci(u({},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(Br.host(t))),this.restoreHandlers.push(Ni({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 r=this;this.restoreHandlers.push(Gr(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),o=Br.shadowRoot(this);return o&&ti(this)&&r.addShadowRoot(o,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var xi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Oi="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Zi=0;Zi<64;Zi++)Oi[xi.charCodeAt(Zi)]=Zi;var Yi=new Map;var Ei=(t,e,r)=>{if(t&&(Wi(t,e)||"object"==typeof t)){var i=function(t,e){var r=Yi.get(t);return r||(r=new Map,Yi.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function Gi(t,e,r){if(t instanceof Array)return t.map((t=>Gi(t,e,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;e<i;e+=3)n+=xi[r[e]>>2],n+=xi[(3&r[e])<<4|r[e+1]>>4],n+=xi[(15&r[e+1])<<2|r[e+2]>>6],n+=xi[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Gi(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[Gi(t.data,e,r),t.width,t.height]}:Wi(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Ei(t,e,r)}:t}var Li=(t,e,r)=>t.map((t=>Gi(t,e,r))),Wi=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))};function Di(t,e,r,i){var n=[];try{var o=Gr(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!zr(this,e,r,!0)){var u=function(t){return"experimental-webgl"===t?"webgl":t}(n);if("__context"in this||(this.__context=u),i&&["webgl","webgl2"].includes(u))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[n,...s])}}));n.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Vi(t,e,r,i,n,o){var s=[],a=Object.getOwnPropertyNames(t),u=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var u=Gr(t,a,(function(t){return function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];var d=t.apply(this,u);if(Ei(d,o,this),"tagName"in this.canvas&&!zr(this.canvas,i,n,!0)){var c=Li(u,o,this),h={type:e,property:a,args:c};r(this.canvas,h)}return d}}));s.push(u)}catch(i){var l=Er(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});s.push(l)}};for(var l of a)u(l);return s}var Xi,zi,Ji,Ki,Hi="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",ji="undefined"!=typeof window&&window.Blob&&new Blob([(Xi=Hi,Uint8Array.from(atob(Xi),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Ui(t){var e;try{if(!(e=ji&&(window.URL||window.webkitURL).createObjectURL(ji)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;base64,"+Hi,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Pi{constructor(t){Re(this,"pendingCanvasMutations",new Map),Re(this,"rafStamps",{latestId:0,invokeId:null}),Re(this,"mirror"),Re(this,"mutationCb"),Re(this,"resetObservers"),Re(this,"frozen",!1),Re(this,"locked",!1),Re(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{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(r,i,n),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,e,r,i,n){var o=this,s=Di(e,r,i,!0),u=new Map,l=new Ui;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:o}=t.data;this.mutationCb({id:e,type:oi["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var d,c=1e3/t,h=0,v=t=>{var s,f;h&&t-h<c?d=requestAnimationFrame(v):(h=t,(s=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{zr(t,r,i,!0)||s.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(e.document),s).forEach(function(){var t=a((function*(t){var e,r=o.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){if(u.set(r,!0),["webgl","webgl2"].includes(t.__context)){var i=t.getContext(t.__context);!1===(null==(e=null==i?void 0:i.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var s=t.clientWidth||t.width,a=t.clientHeight||t.height,d=yield createImageBitmap(t,{resizeWidth:s,resizeHeight:a});l.postMessage({id:r,bitmap:d,width:s,height:a,dataURLOptions:n.dataURLOptions},[d])}}));return function(e){return t.apply(this,arguments)}}()),d=requestAnimationFrame(v))};d=requestAnimationFrame(v),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Di(t,e,r,!1),n=function(t,e,r,i){var n=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=Gr(e.CanvasRenderingContext2D.prototype,o,(function(n){return function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return zr(this.canvas,r,i,!0)||setTimeout((()=>{var r=Li(a,e,this);t(this.canvas,{type:oi["2D"],property:o,args:r})}),0),n.apply(this,a)}}));n.push(s)}catch(r){var a=Er(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:oi["2D"],property:o,args:[e],setter:!0})}});n.push(a)}};for(var a of o)s(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),o=function(t,e,r,i){var n=[];return n.push(...Vi(e.WebGLRenderingContext.prototype,oi.WebGL,t,r,i,e)),void 0!==e.WebGL2RenderingContext&&n.push(...Vi(e.WebGL2RenderingContext.prototype,oi.WebGL2,t,r,i,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var i=r.map((t=>{var e=function(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}(t,Ae);return e})),{type:n}=r[0];this.mutationCb({id:e,type:n,commands:i}),this.pendingCanvasMutations.delete(t)}}}}class qi{constructor(t){Re(this,"trackedLinkElements",new WeakSet),Re(this,"mutationCb"),Re(this,"adoptedStyleSheetCb"),Re(this,"styleMirror",new qr),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],o=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:ze(e,t.href),index:r})))})),i.styleIds.push(e)};for(var s of t)o(s);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Qi{constructor(){Re(this,"nodeMap",new WeakMap),Re(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var $i=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var tn=document.createElement("iframe");document.body.appendChild(tn),Array.from=(null==(ke=tn.contentWindow)?void 0:ke.Array.from)||Array.from,document.body.removeChild(tn)}}catch(t){console.debug("Unable to override Array.from",t)}var en,rn,nn=new Ke;function on(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:r,checkoutEveryNth:i,blockClass:n="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:d=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:v,slimDOMOptions:f,maskInputFn:m,maskTextFn:p,hooks:g,packFn:I,sampling:y={},dataURLOptions:b={},mousemoveWait:C,recordDOM:w=!0,recordCanvas:S=!1,recordCrossOriginIframes:k=!1,recordAfter:A=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:N=!1,collectFonts:R=!1,inlineImages:T=!1,plugins:_,keepIframeSrcFn:M=(()=>!1),ignoreCSSAttributes:F=new Set([]),errorHandler:B}=t;li=B;var x=!k||window.parent===window,O=!1;if(!x)try{window.parent.document&&(O=!1)}catch(t){O=!0}if(x&&!e)throw new Error("emit function is required");if(!x&&!O)return()=>{};void 0!==C&&void 0===y.mousemove&&(y.mousemove=C),nn.reset();var Z,Y=!0===h?{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!==v?v:{password:!0},E=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var G=0,L=t=>{for(var e of _||[])e.eventProcessor&&(t=e.eventProcessor(t));return I&&!O&&(t=I(t)),t};zi=(t,n)=>{var o,s=t;if(s.timestamp=Lr(),!(null==(o=gi[0])?void 0:o.isFrozen())||s.type===ei.FullSnapshot||s.type===ei.IncrementalSnapshot&&s.data.source===ri.Mutation||gi.forEach((t=>t.unfreeze())),x)null==e||e(L(s),n);else if(O){var a={type:"rrweb",event:L(s),origin:window.location.origin,isCheckout:n};window.parent.postMessage(a,"*")}if(s.type===ei.FullSnapshot)Z=s,G=0;else if(s.type===ei.IncrementalSnapshot){if(s.data.source===ri.Mutation&&s.data.isAttachIframe)return;G++;var u=i&&G>=i,l=r&&s.timestamp-Z.timestamp>r;(u||l)&&Ji(!0)}};var W=t=>{zi({type:ei.IncrementalSnapshot,data:u({source:ri.Mutation},t)})},D=t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.Scroll},t)}),V=t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.CanvasMutation},t)}),X=new qi({mutationCb:W,adoptedStyleSheetCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.AdoptedStyleSheet},t)})}),z=new Fi({mirror:nn,mutationCb:W,stylesheetManager:X,recordCrossOriginIframes:k,wrappedEmit:zi});for(var J of _||[])J.getMirror&&J.getMirror({nodeMirror:nn,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});var K=new Qi;Ki=new Pi({recordCanvas:S,mutationCb:V,win:window,blockClass:n,blockSelector:o,mirror:nn,sampling:y.canvas,dataURLOptions:b});var H=new Bi({mutationCb:W,scrollCb:D,bypassOptions:{blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:d,inlineStylesheet:c,maskInputOptions:Y,dataURLOptions:b,maskTextFn:p,maskInputFn:m,recordCanvas:S,inlineImages:T,sampling:y,slimDOMOptions:E,iframeManager:z,stylesheetManager:X,canvasManager:Ki,keepIframeSrcFn:M,processedNodeManager:K},mirror:nn});Ji=function(t){if(void 0===t&&(t=!1),w){zi({type:ei.Meta,data:{href:window.location.href,width:Vr(),height:Dr()}},t),X.reset(),H.init(),gi.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new Ke,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:d=!1,maskTextFn:c,maskInputFn:h,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:p,onIframeLoad:g,iframeLoadTimeout:I,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:C=(()=>!1)}=e||{};return Cr(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===d?{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===d?{password:!0}:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:u,recordCanvas:l,preserveWhiteSpace:m,onSerialize:p,onIframeLoad:g,iframeLoadTimeout:I,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:C,newlyAddedElement:!1})}(document,{mirror:nn,blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:d,inlineStylesheet:c,maskAllInputs:Y,maskTextFn:p,maskInputFn:m,slimDOM:E,dataURLOptions:b,recordCanvas:S,inlineImages:T,onSerialize:t=>{jr(t,nn)&&z.addIframe(t),Ur(t,nn)&&X.trackLinkElement(t),Pr(t)&&H.addShadowRoot(Br.shadowRoot(t),document)},onIframeLoad:(t,e)=>{z.attachIframe(t,e),H.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{X.attachLinkElement(t,e)},keepIframeSrcFn:M});if(!e)return console.warn("Failed to snapshot the document");zi({type:ei.FullSnapshot,data:{node:e,initialOffset:Wr(window)}},t),gi.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&X.adoptStyleSheets(document.adoptedStyleSheets,nn.getId(document))}};try{var j=[],U=t=>{var e;return pi(Ri)({mutationCb:W,mousemoveCb:(t,e)=>zi({type:ei.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.MouseInteraction},t)}),scrollCb:D,viewportResizeCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.ViewportResize},t)}),inputCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.Input},t)}),mediaInteractionCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.MediaInteraction},t)}),styleSheetRuleCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.StyleSheetRule},t)}),styleDeclarationCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.Font},t)}),selectionCb:t=>{zi({type:ei.IncrementalSnapshot,data:u({source:ri.Selection},t)})},customElementCb:t=>{zi({type:ei.IncrementalSnapshot,data:u({source:ri.CustomElement},t)})},blockClass:n,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:d,maskInputOptions:Y,inlineStylesheet:c,sampling:y,recordDOM:w,recordCanvas:S,inlineImages:T,userTriggeredOnInput:N,collectFonts:R,doc:t,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:M,blockSelector:o,slimDOMOptions:E,dataURLOptions:b,mirror:nn,iframeManager:z,stylesheetManager:X,shadowDomManager:H,processedNodeManager:K,canvasManager:Ki,ignoreCSSAttributes:F,plugins:(null==(e=null==_?void 0:_.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>zi({type:ei.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},g)};z.addLoadListener((t=>{try{j.push(U(t.contentDocument))}catch(t){console.warn(t)}}));var P=()=>{Ji(),j.push(U(document)),$i=!0};return"interactive"===document.readyState||"complete"===document.readyState?P():(j.push(xr("DOMContentLoaded",(()=>{zi({type:ei.DomContentLoaded,data:{}}),"DOMContentLoaded"===A&&P()}))),j.push(xr("load",(()=>{zi({type:ei.Load,data:{}}),"load"===A&&P()}),window))),()=>{j.forEach((t=>t())),K.destroy(),$i=!1,li=void 0}}catch(t){console.warn(t)}}on.addCustomEvent=(t,e)=>{if(!$i)throw new Error("please add custom event after start recording");zi({type:ei.Custom,data:{tag:t,payload:e}})},on.freezePage=()=>{gi.forEach((t=>t.freeze()))},on.takeFullSnapshot=t=>{if(!$i)throw new Error("please take full snapshot after start recording");Ji(t)},on.mirror=nn,(rn=en||(en={}))[rn.NotStarted=0]="NotStarted",rn[rn.Running=1]="Running",rn[rn.Stopped=2]="Stopped";var sn,an=Object.defineProperty,un=(t,e,r)=>((t,e,r)=>e in t?an(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ln=Object.defineProperty,dn=(t,e,r)=>((t,e,r)=>e in t?ln(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),cn=Object.defineProperty,hn=(t,e,r)=>((t,e,r)=>e in t?cn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),vn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},fn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},mn={};function pn(t){if(mn[t])return mn[t];var e=globalThis[t],r=e.prototype,i=t in vn?vn[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in fn?fn[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return mn[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?mn[t]=l:r}catch(t){return r}}var gn={};function In(t,e,r){var i,n=t+"."+String(r);if(gn[n])return gn[n].call(e);var o=pn(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(gn[n]=s,s.call(e)):e[r]}var yn={};function bn(t,e,r){var i=t+"."+String(r);if(yn[i])return yn[i].bind(e);var n=pn(t)[r];return"function"!=typeof n?e[r]:(yn[i]=n,n.bind(e))}var Cn={childNodes:function(t){return In("Node",t,"childNodes")},parentNode:function(t){return In("Node",t,"parentNode")},parentElement:function(t){return In("Node",t,"parentElement")},textContent:function(t){return In("Node",t,"textContent")},contains:function(t,e){return bn("Node",t,"contains")(e)},getRootNode:function(t){return bn("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?In("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?In("Element",t,"shadowRoot"):null},querySelector:function(t,e){return In("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return In("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return pn("MutationObserver").constructor}};class wn{constructor(){hn(this,"idNodeMap",new Map),hn(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-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);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Sn(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&Sn(Cn.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&Sn(Cn.parentNode(t),e,r)}class kn{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof kn))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var An={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Nn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Rn={};function Tn(t){if(Rn[t])return Rn[t];var e=globalThis[t],r=e.prototype,i=t in An?An[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in Nn?Nn[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return Rn[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?Rn[t]=l:r}catch(t){return r}}var _n={};function Mn(t,e,r){var i,n=t+"."+String(r);if(_n[n])return _n[n].call(e);var o=Tn(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(_n[n]=s,s.call(e)):e[r]}var Fn={};function Bn(t,e,r){var i=t+"."+String(r);if(Fn[i])return Fn[i].bind(e);var n=Tn(t)[r];return"function"!=typeof n?e[r]:(Fn[i]=n,n.bind(e))}var xn={childNodes:function(t){return Mn("Node",t,"childNodes")},parentNode:function(t){return Mn("Node",t,"parentNode")},parentElement:function(t){return Mn("Node",t,"parentElement")},textContent:function(t){return Mn("Node",t,"textContent")},contains:function(t,e){return Bn("Node",t,"contains")(e)},getRootNode:function(t){return Bn("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Mn("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Mn("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Mn("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Mn("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Tn("MutationObserver").constructor}};var On="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.",Zn={map:{},getId:()=>(console.error(On),-1),getNode:()=>(console.error(On),null),removeNodeFromMap(){console.error(On)},has:()=>(console.error(On),!1),reset(){console.error(On)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Zn=new Proxy(Zn,{get:(t,e,r)=>("map"===e&&console.error(On),Reflect.get(t,e,r))}));var Yn=Date.now;function En(t){return t?t.nodeType===t.ELEMENT_NODE?t:xn.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(Yn=()=>(new Date).getTime());function Gn(t){var e,r=null;return"getRootNode"in t&&(null==(e=xn.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&xn.host(xn.getRootNode(t))&&(r=xn.host(xn.getRootNode(t))),r}function Ln(t){for(var e,r=t;e=Gn(r);)r=e;return r}function Wn(t){var e=t.ownerDocument;if(!e)return!1;var r=Ln(t);return xn.contains(e,r)}for(var Dn=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){dn(this,"id",1),dn(this,"styleIDMap",new WeakMap),dn(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):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return Zn},closestElementOfNode:En,getBaseDimension:function t(e,r){var i,n,o=null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=t(o,r),u=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}},getNestedRule:function t(e,r){var i=e[r[0]];return 1===r.length?i:t(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:Ln,getShadowHost:Gn,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=xn.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=xn.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof kn&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(xn.shadowRoot(t)))},hookSetter:function t(e,r,i,n,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(e,r);return o.Object.defineProperty(e,r,n?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>t(e,r,s||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(xn.contains(e,t)||Wn(t))},isAncestorRemoved:function t(e,r){if(n=(i=e)&&"host"in i&&"mode"in i&&Cn.host(i)||null,Boolean(n&&"shadowRoot"in n&&Cn.shadowRoot(n)===i))return!1;var i,n,o=r.getId(e);if(!r.has(o))return!0;var s=xn.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||t(s,r))},isBlocked:function(t,e,r,i){if(!t)return!1;var n=En(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(Sn(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))},iterateResolveTree:function t(e,r){r(e.value);for(var i=e.children.length-1;i>=0;i--)t(e.children[i],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return Yn},on:function(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},r=(t,r)=>{var i={value:t,parent:r,children:[]};return e[t.node.id]=i,i},i=[];for(var n of t){var{nextId:o,parentId:s}=n;if(o&&o in e){var a=e[o];if(a.parent){var u=a.parent.children.indexOf(a);a.parent.children.splice(u,0,r(n,a.parent))}else{var l=i.indexOf(a);i.splice(l,0,r(n,null))}}else if(s in e){var d=e[s];d.children.push(r(n,d))}else i.push(r(n,null))}return i},shadowHostInDom:Wn,throttle:function(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),d=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(d,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(d,s)}),l))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],i=t.length;i--;){var n=t[i];e.has(n.id)||(r.push(n),e.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),Vn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),zn=0;zn<64;zn++)Xn[Vn.charCodeAt(zn)]=zn;var Jn;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var Kn=document.createElement("iframe");document.body.appendChild(Kn),Array.from=(null==(sn=Kn.contentWindow)?void 0:sn.Array.from)||Array.from,document.body.removeChild(Kn)}}catch(t){console.debug("Unable to override Array.from",t)}new wn,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(Jn||(Jn={}));class Hn{constructor(t){un(this,"fileName"),un(this,"functionName"),un(this,"lineNumber"),un(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var jn=/(^|@)\S+:\d+/,Un=/^\s*at .*(\S+:\d+|\(native\))/m,Pn=/^(eval@)?(\[native code])?$/,qn={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Un)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(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:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Un)}),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,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),o=i.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Hn({functionName:o,fileName:s,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Pn)}),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 Hn({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Hn({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(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:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Hn({fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Hn({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(jn)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Hn({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Qn(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var o=0;o<i.children.length;o++){var s=i.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&n.push(s)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function $n(t){return"[object Object]"===Object.prototype.toString.call(t)}function to(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if($n(t[i])&&to(t[i],e-1))return!0;return!1}function eo(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if($n(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if($n(t)&&to(t,r.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var a in e){var u=e[a];Array.isArray(u)?s[a]=Qn(u.length?u[0]:null):s[a]=u}return s}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 ro={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 io(t,e,r){var i,n=r?Object.assign({},ro,r):ro,o=n.logger;if(!o)return()=>{};i="string"==typeof o?e[o]:o;var s=0,a=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message,i=e.error,o=qn.parse(i).map((t=>t.toString())),s=[eo(r,n.stringifyOptions)];t({level:"error",trace:o,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var d=e=>{var r,i;e.reason instanceof Error?i=[eo("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[eo("Uncaught (in promise)",n.stringifyOptions),eo(e.reason,n.stringifyOptions)]);var o=qn.parse(r).map((t=>t.toString()));t({level:"error",trace:o,payload:i})};e.addEventListener("unhandledrejection",d),u.push((()=>{e.removeEventListener("unhandledrejection",d)}))}for(var c of n.level)u.push(h(i,c));return()=>{u.forEach((t=>t()))};function h(e,r){var i=this;return e[r]?Dn.patch(e,r,(e=>function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||a)){a=!0;try{var d=qn.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>eo(t,n.stringifyOptions)));++s<n.lengthThreshold?t({level:r,trace:d,payload:c}):s===n.lengthThreshold&&t({level:"warn",trace:[],payload:[eo("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{a=!1}}})):()=>{}}}var no=t=>({name:"rrweb/console@1",observer:io,options:t}),oo=t=>t instanceof Document;function so(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return g(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function ao(t,e){var r,i=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:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var o of e.payloadHostDenyList)if(i.endsWith(o))return{hostname:i,isHostDenied:!0};return n}var uo=F("[Recorder]"),lo=t=>"navigation"===t.entryType,co=t=>"resource"===t.entryType;function ho(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>lo(t)||co(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>yo({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>lo(t)||co(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>yo({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:o}),()=>{n.disconnect()}}function vo(t,e){return!!e&&(k(e)||e[t])}function fo(t){var{type:e,recordBody:r,headers:i,url:n}=t;function o(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(k(r))return!0;if(p(r))return o(r);var s=r[e];return k(s)?s:o(s)}function mo(t,e,r,i,n,o){return po.apply(this,arguments)}function po(){return po=a((function*(t,e,r,i,n,o){if(void 0===o&&(o=0),o>10)return uo.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var s=function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),(t=>co(t)&&t.initiatorType===e&&(y(i)||t.startTime>=i)&&(y(n)||t.startTime<=n)));return s||(yield new Promise((t=>setTimeout(t,50*o))),mo(t,e,r,i,n,o+1))})),po.apply(this,arguments)}function go(t){var{body:e,options:r,url:i}=t;if(w(e))return null;var{hostname:n,isHostDenied:o}=ao(i,r);if(o)return n+" is in deny list";if(b(e))return e;if(oo(e))return e.textContent;if(A(e))return E(e);if(I(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 Io=t=>!C(t)&&("navigation"===t.entryType||"resource"===t.entryType);function yo(t){var{entry:e,method:r,status:i,networkRequest:n,isInitial:o,start:s,end:a,url:l,initiatorType:d}=t;s=e?e.startTime:s,a=e?e.responseEnd:a;var c=Math.floor(Date.now()-performance.now()),h=Math.floor(c+(s||0)),v=[u({},e?e.toJSON():{name:l},{startTime:y(s)?void 0:Math.round(s),endTime:y(a)?void 0:Math.round(a),timeOrigin:c,timestamp:h,method:r,initiatorType:d||(e?e.initiatorType:void 0),status:i,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:o})];if(Io(e))for(var f of e.serverTiming||[])v.push({timeOrigin:c,timestamp:h,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var bo=["video/","audio/"];function Co(t){return new Promise(((e,r)=>{var i=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e("[SessionReplay] Failed to read body")}}))}function wo(){return(wo=a((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:o}=ao(i,r);return o?Promise.resolve(n+" is in deny list"):Co(e)}))).apply(this,arguments)}function So(){return(So=a((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),s=bo.some((t=>null==o?void 0:o.startsWith(t)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:u}=ao(n,i);return u?a+" is in deny list":null}({r:e,options:r,url:i});return C(n)?Co(e):Promise.resolve(n)}))).apply(this,arguments)}function ko(t,e,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=vo("request",r.recordHeaders),n=vo("response",r.recordHeaders),o=so(e,"fetch",(o=>function(){var s=a((function*(s,a){var u,l,d,c=new Request(s,a),h={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),i&&(h.requestHeaders=v),fo({type:"request",headers:v,url:s,recordBody:r.recordBody})&&(h.requestBody=yield function(t){return wo.apply(this,arguments)}({r:c,options:r,url:s})),l=e.performance.now(),u=yield o(c),d=e.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),n&&(h.responseHeaders=f),fo({type:"response",headers:f,url:s,recordBody:r.recordBody})&&(h.responseBody=yield function(t){return So.apply(this,arguments)}({r:u,options:r,url:s})),u}finally{mo(e,"fetch",c.url,l,d).then((e=>{var r,i=yo({entry:e,method:c.method,status:null==(r=u)?void 0:r.status,networkRequest:h,start:l,end:d,url:c.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return s.apply(this,arguments)}}()));return()=>{o()}}var Ao=null;function No(t,e,r){if(!("performance"in e))return()=>{};if(Ao)return uo.warn("Network observer already initialised, doing nothing"),()=>{};var i=r?Object.assign({},j,r):j,n=e=>{var r=[];e.requests.forEach((t=>{var e=i.maskRequestFn(t);e&&r.push(e)})),r.length>0&&t(u({},e,{requests:r}))},o=ho(n,e,i),s=()=>{},a=()=>{};return(i.recordHeaders||i.recordBody)&&(s=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=vo("request",r.recordHeaders),n=vo("response",r.recordHeaders),o=so(e.XMLHttpRequest.prototype,"open",(o=>function(s,a,u,l,d){void 0===u&&(u=!0);var c,h,v=this,f=new Request(a),m={},p={},g=v.setRequestHeader.bind(v);v.setRequestHeader=(t,e)=>(p[t]=e,g(t,e)),i&&(m.requestHeaders=p);var I=v.send.bind(v);v.send=t=>(fo({type:"request",headers:p,url:a,recordBody:r.recordBody})&&(m.requestBody=go({body:t,options:r,url:a})),c=e.performance.now(),I(t));var y=()=>{v.removeEventListener("readystatechange",b),v.removeEventListener("error",y),v.removeEventListener("abort",y),v.removeEventListener("timeout",y)},b=()=>{if(v.readyState===v.DONE){y(),h=e.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(m.responseHeaders=i),fo({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(m.responseBody=go({body:v.response,options:r,url:a})),mo(e,"xmlhttprequest",f.url,c,h).then((e=>{var r=yo({entry:e,method:s,status:null==v?void 0:v.status,networkRequest:m,start:c,end:h,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",b),v.addEventListener("error",y),v.addEventListener("abort",y),v.addEventListener("timeout",y),o.call(v,s,a.toString(),u,l,d)}));return()=>{o()}}(n,e,i),a=ko(n,e,i)),Ao=()=>{o(),s(),a(),Ao=null}}var Ro=t=>({name:"rrweb/network@1",observer:No,options:t});o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:no,getRecordNetworkPlugin:Ro},o.__PosthogExtensions__.rrweb={record:on,version:"v2"},o.rrweb={record:on,version:"v2"},o.rrwebConsoleRecord={getRecordConsolePlugin:no},o.getRecordNetworkPlugin=Ro,o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.initSessionRecording=t=>new Se(t)}();
1
+ !function(){"use strict";var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t;"undefined"==typeof self&&(e.self=e),"undefined"==typeof File&&(e.File=function(){});var r=Array.prototype.forEach,i=null==e?void 0:e.navigator,n=null==e?void 0:e.document;null==e||e.location,null==e||e.fetch,null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest&&e.XMLHttpRequest,null==e||e.AbortController,null==i||i.userAgent;var o=null!=t?t:{};function s(t,e,r,i,n,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(i,n)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(i,n){var o=t.apply(e,r);function a(t){s(o,i,n,a,u,"next",t)}function u(t){s(o,i,n,a,u,"throw",t)}a(void 0)}))}}function u(){return u=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},u.apply(null,arguments)}var l=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}({}),d=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}({});var c=function(t){return t.trim()},h=Array.isArray,v=Object.prototype,f=v.hasOwnProperty,m=v.toString,p=h||function(t){return"[object Array]"===m.call(t)},g=t=>"function"==typeof t,I=t=>t===Object(t)&&!p(t),y=t=>void 0===t,b=t=>"[object String]"==m.call(t),C=t=>null===t,w=t=>y(t)||C(t),S=t=>"[object Number]"==m.call(t)&&t==t,k=t=>"[object Boolean]"===m.call(t),A=t=>t instanceof FormData;function N(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),S(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),N(n||r,e,r,i))}class R{constructor(t){this.t={},this.i=t.i,this.o=N(t.bucketSize,0,100,t.u),this.h=N(t.refillRate,0,this.o,t.u),this.m=N(t.refillInterval,0,864e5,t.u)}I(t,e){var r=e-t.lastAccess,i=Math.floor(r/this.m);if(i>0){var n=i*this.h;t.tokens=Math.min(t.tokens+n,this.o),t.lastAccess=t.lastAccess+i*this.m}}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.t[i];return n?this.I(n,r):(n={tokens:this.o,lastAccess:r},this.t[i]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.i)||e.call(this,t)),0===n.tokens)}stop(){this.t={}}}var T={LIB_VERSION:"1.348.0"},_=function(e,r){var{debugEnabled:i}=void 0===r?{}:r,n={C:function(r){if(t&&(o.POSTHOG_DEBUG||i)&&!y(t.console)&&t.console){for(var n=("__rrweb_original__"in t.console[r]?t.console[r].__rrweb_original__:t.console[r]),s=arguments.length,a=new Array(s>1?s-1:0),u=1;u<s;u++)a[u-1]=arguments[u];n(e,...a)}},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];n.C("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];n.C("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];n.C("error",...e)},critical:function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning:t=>{n.error("You must initialize PostHog before calling "+t)},createLogger:(t,r)=>_(e+" "+t,r)};return n},M=_("[PostHog.js]"),F=M.createLogger,B={};function x(t,e,i){if(!w(t)){if(p(t))return function(t,e,i){if(p(t))if(r&&t.forEach===r)t.forEach(e,i);else if("length"in t&&t.length===+t.length)for(var n=0,o=t.length;n<o;n++)if(n in t&&e.call(i,t[n],n)===B)return}(t,e,i);if(A(t)){for(var n of t.entries())if(e.call(i,n[1],n[0])===B)return}else for(var o in t)if(f.call(t,o)&&e.call(i,t[o],o)===B)return}}function O(t,e,r,i){var{capture:n=!1,passive:o=!0}={};null==t||t.addEventListener(e,r,{capture:n,passive:o})}var Z=["localhost","127.0.0.1"],Y=t=>{var e=null==n?void 0:n.createElement("a");return y(e)?null:(e.href=t,e)},E=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return x(t,(function(t,e){y(t)||y(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},G="$session_recording_remote_config",L="$session_is_sampled",W="$session_past_minimum_duration",D="$session_recording_url_trigger_activated_session",V="$session_recording_event_trigger_activated_session",X="$debug_first_full_snapshot_timestamp",z=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})"),J=new RegExp("(\\d{3}-?\\d{2}-?\\d{4})");var K="[SessionRecording]",H="redacted",j={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:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},U=["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"],P=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],q=["/s/","/e/","/i/"];function Q(t,e,r,i){if(w(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return b(n)&&(n=parseInt(n)),n>r?K+" "+i+" body too large to record ("+n+" bytes)":t}function tt(t,e){if(w(t))return t;var r=t;return function(t,e){if(w(t))return!1;if(b(t)){if(t=c(t),z.test((t||"").replace(/[- ]/g,"")))return!1;if(J.test(t))return!1}return!0}(r)||(r=K+" "+e+" body "+H),x(P,(t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r=K+" "+e+" body "+H+" as might contain: "+t)})),r}var et=(t,e)=>{var r,i,n,o={payloadSizeLimitBytes:j.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...j.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...j.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,l=!1!==t.capture_performance&&e.recordPerformance,d=(r=o,n=Math.min(1e6,null!==(i=r.payloadSizeLimitBytes)&&void 0!==i?i:1e6),t=>(null!=t&&t.requestBody&&(t.requestBody=Q(t.requestBody,t.requestHeaders,n,"Request")),null!=t&&t.responseBody&&(t.responseBody=Q(t.responseBody,t.responseHeaders,n,"Response")),t)),c=e=>{return d(((t,e)=>{var r,i=Y(t.name),n=0===e.indexOf("http")?null==(r=Y(e))?void 0:r.pathname:e;"/"===n&&(n="");var o=null==i?void 0:i.pathname.replace(n||"","");if(!(i&&o&&q.some((t=>0===o.indexOf(t)))))return t})((i=(r=e).requestHeaders,w(i)||x(Object.keys(null!=i?i:{}),(t=>{U.includes(t.toLowerCase())&&(i[t]=H)})),r),t.api_host));var r,i},h=g(t.session_recording.maskNetworkRequestFn);return h&&g(t.session_recording.maskCapturedNetworkRequestFn)&&M.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var r=t.session_recording.maskNetworkRequestFn({url:e.name});return u({},e,{name:null==r?void 0:r.url})}),o.maskRequestFn=g(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r,i=c(e);return i&&null!==(r=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(i))&&void 0!==r?r:void 0}:t=>function(t){if(!y(t))return t.requestBody=tt(t.requestBody,"Request"),t.responseBody=tt(t.responseBody,"Response"),t}(c(t)),u({},j,o,{recordHeaders:s,recordBody:a,recordPerformance:l,recordInitialRequests:l})},rt="disabled",it="sampled",nt="active",ot="buffering",st="paused",at="trigger",ut=at+"_activated",lt=at+"_pending",dt=at+"_"+rt;function ct(t,e,r){return e.some((e=>{var i;return"regex"===e.matching&&(null!==(i=null==r?void 0:r.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)}))}class ht{constructor(t){this.S=t}triggerStatus(t){var e=this.S.map((e=>e.triggerStatus(t)));return e.includes(ut)?ut:e.includes(lt)?lt:dt}stop(){this.S.forEach((t=>t.stop()))}}class vt{constructor(t){this.S=t}triggerStatus(t){var e=new Set;for(var r of this.S)e.add(r.triggerStatus(t));switch(e.delete(dt),e.size){case 0:return dt;case 1:return Array.from(e)[0];default:return lt}}stop(){this.S.forEach((t=>t.stop()))}}class ft{triggerStatus(){return lt}stop(){}}var mt=t=>"sessionRecording"in t;class pt{constructor(t){this.k=[],this.A=[],this.N=new Map,this.R=new Map,this.T="",this.urlBlocked=!1,this._instance=t}onConfig(t){var e,r;this.k=(mt(t)?I(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.A=(mt(t)?I(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.M()}M(){for(var t of(this.N.clear(),this.R.clear(),this.k))if("regex"===t.matching&&!this.N.has(t.url))try{this.N.set(t.url,new RegExp(t.url))}catch(e){M.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.A)if("regex"===e.matching&&!this.R.has(e.url))try{this.R.set(e.url,new RegExp(e.url))}catch(t){M.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}F(t){var e;return 0===this.k.length?dt:(null==(e=this._instance)?void 0:e.get_property(D))===t?ut:lt}triggerStatus(t){var e=this.F(t),r=e===ut?ut:e===lt?lt:dt;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:r}),r}checkUrlTriggerConditions(e,r,i,n){if(void 0!==t&&t.location.href){var o=t.location.href;if(o!==this.T){this.T=o;var s=this.urlBlocked,a=ct(o,this.A,this.R);if(!s||!a){a&&!s?e():!a&&s&&r();var u=this.F(n)===ut,l=ct(o,this.k,this.N);!u&&l&&i("url")}}}}stop(){this.T=""}}class gt{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.B=()=>{},this._instance=t}triggerStatus(){var t=lt;return w(this.linkedFlag)&&(t=dt),this.linkedFlagSeen&&(t=ut),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}onConfig(t,e){var r;if(this.linkedFlag=(mt(t)?I(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!w(this.linkedFlag)&&!this.linkedFlagSeen){var i=b(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=b(this.linkedFlag)?null:this.linkedFlag.variant;this.B=this._instance.onFeatureFlags(((t,r)=>{var o=!1;if(I(r)&&i in r){var s=r[i];o=k(s)?!0===s:n?s===n:!!s}this.linkedFlagSeen=o,o&&e(i,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.B()}}class It{constructor(t){this.O=[],this._instance=t}onConfig(t){var e;this.O=(mt(t)?I(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}Z(t){var e;return 0===this.O.length?dt:(null==(e=this._instance)?void 0:e.get_property(V))===t?ut:lt}triggerStatus(t){var e=this.Z(t),r=e===ut?ut:e===lt?lt:dt;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:r}),r}stop(){}}function yt(t){return t.isRecordingEnabled?ot:rt}function bt(t){if(!t.receivedFlags)return ot;if(!t.isRecordingEnabled)return rt;if(t.urlTriggerMatching.urlBlocked)return st;var e=!0===t.isSampled,r=new ht([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?it:r===ut?nt:r===lt?ot:!1===t.isSampled?rt:nt}function Ct(t){if(!t.receivedFlags)return ot;if(!t.isRecordingEnabled)return rt;if(t.urlTriggerMatching.urlBlocked)return st;var e=new vt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==dt,i=k(t.isSampled);return r&&e===lt?ot:r&&e===dt||i&&!t.isSampled?rt:!0===t.isSampled?it:nt}function wt(t){var e,r;return(null==(e=JSON.stringify(t,(r=[],function(t,e){if(I(e)){for(;r.length>0&&r[r.length-1]!==this;)r.pop();return r.includes(e)?"[Circular]":(r.push(e),e)}return e})))?void 0:e.length)||0}var St=Uint8Array,kt=Uint16Array,At=Uint32Array,Nt=new St([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]),Rt=new St([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]),Tt=new St([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_t=function(t,e){for(var r=new kt(31),i=0;i<31;++i)r[i]=e+=1<<t[i-1];var n=new At(r[30]);for(i=1;i<30;++i)for(var o=r[i];o<r[i+1];++o)n[o]=o-r[i]<<5|i;return[r,n]},Mt=_t(Nt,2),Ft=Mt[0],Bt=Mt[1];Ft[28]=258,Bt[258]=28;for(var xt=_t(Rt,0)[1],Ot=new kt(32768),Zt=0;Zt<32768;++Zt){var Yt=(43690&Zt)>>>1|(21845&Zt)<<1;Yt=(61680&(Yt=(52428&Yt)>>>2|(13107&Yt)<<2))>>>4|(3855&Yt)<<4,Ot[Zt]=((65280&Yt)>>>8|(255&Yt)<<8)>>>1}var Et=function(t,e,r){for(var i=t.length,n=0,o=new kt(e);n<i;++n)++o[t[n]-1];var s,a=new kt(e);for(n=0;n<e;++n)a[n]=a[n-1]+o[n-1]<<1;if(r){s=new kt(1<<e);var u=15-e;for(n=0;n<i;++n)if(t[n])for(var l=n<<4|t[n],d=e-t[n],c=a[t[n]-1]++<<d,h=c|(1<<d)-1;c<=h;++c)s[Ot[c]>>>u]=l}else for(s=new kt(i),n=0;n<i;++n)s[n]=Ot[a[t[n]-1]++]>>>15-t[n];return s},Gt=new St(288);for(Zt=0;Zt<144;++Zt)Gt[Zt]=8;for(Zt=144;Zt<256;++Zt)Gt[Zt]=9;for(Zt=256;Zt<280;++Zt)Gt[Zt]=7;for(Zt=280;Zt<288;++Zt)Gt[Zt]=8;var Lt=new St(32);for(Zt=0;Zt<32;++Zt)Lt[Zt]=5;var Wt=Et(Gt,9,0),Dt=Et(Lt,5,0),Vt=function(t){return(t/8>>0)+(7&t&&1)},Xt=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof kt?kt:t instanceof At?At:St)(r-e);return i.set(t.subarray(e,r)),i},zt=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8},Jt=function(t,e,r){r<<=7&e;var i=e/8>>0;t[i]|=r,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Kt=function(t,e){for(var r=[],i=0;i<t.length;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,o=r.slice();if(!n)return[new St(0),0];if(1==n){var s=new St(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],u=r[1],l=0,d=1,c=2;for(r[0]={s:-1,f:a.f+u.f,l:a,r:u};d!=n-1;)a=r[r[l].f<r[c].f?l++:c++],u=r[l!=d&&r[l].f<r[c].f?l++:c++],r[d++]={s:-1,f:a.f+u.f,l:a,r:u};var h=o[0].s;for(i=1;i<n;++i)o[i].s>h&&(h=o[i].s);var v=new kt(h+1),f=Ht(r[d-1],v,0);if(f>e){i=0;var m=0,p=f-e,g=1<<p;for(o.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));i<n;++i){var I=o[i].s;if(!(v[I]>e))break;m+=g-(1<<f-v[I]),v[I]=e}for(m>>>=p;m>0;){var y=o[i].s;v[y]<e?m-=1<<e-v[y]++-1:++i}for(;i>=0&&m;--i){var b=o[i].s;v[b]==e&&(--v[b],++m)}f=e}return[new St(v),f]},Ht=function(t,e,r){return-1==t.s?Math.max(Ht(t.l,e,r+1),Ht(t.r,e,r+1)):e[t.s]=r},jt=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new kt(++e),i=0,n=t[0],o=1,s=function(t){r[i++]=t},a=1;a<=e;++a)if(t[a]==n&&a!=e)++o;else{if(!n&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(n),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(n);o=1,n=t[a]}return[r.subarray(0,i),e]},Ut=function(t,e){for(var r=0,i=0;i<e.length;++i)r+=t[i]*e[i];return r},Pt=function(t,e,r){var i=r.length,n=Vt(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var o=0;o<i;++o)t[n+o+4]=r[o];return 8*(n+4+i)},qt=function(t,e,r,i,n,o,s,a,u,l,d){zt(e,d++,r),++n[256];for(var c=Kt(n,15),h=c[0],v=c[1],f=Kt(o,15),m=f[0],p=f[1],g=jt(h),I=g[0],y=g[1],b=jt(m),C=b[0],w=b[1],S=new kt(19),k=0;k<I.length;++k)S[31&I[k]]++;for(k=0;k<C.length;++k)S[31&C[k]]++;for(var A=Kt(S,7),N=A[0],R=A[1],T=19;T>4&&!N[Tt[T-1]];--T);var _,M,F,B,x=l+5<<3,O=Ut(n,Gt)+Ut(o,Lt)+s,Z=Ut(n,h)+Ut(o,m)+s+14+3*T+Ut(S,N)+(2*S[16]+3*S[17]+7*S[18]);if(x<=O&&x<=Z)return Pt(e,d,t.subarray(u,u+l));if(zt(e,d,1+(Z<O)),d+=2,Z<O){_=Et(h,v,0),M=h,F=Et(m,p,0),B=m;var Y=Et(N,R,0);zt(e,d,y-257),zt(e,d+5,w-1),zt(e,d+10,T-4),d+=14;for(k=0;k<T;++k)zt(e,d+3*k,N[Tt[k]]);d+=3*T;for(var E=[I,C],G=0;G<2;++G){var L=E[G];for(k=0;k<L.length;++k){var W=31&L[k];zt(e,d,Y[W]),d+=N[W],W>15&&(zt(e,d,L[k]>>>5&127),d+=L[k]>>>12)}}}else _=Wt,M=Gt,F=Dt,B=Lt;for(k=0;k<a;++k)if(i[k]>255){W=i[k]>>>18&31;Jt(e,d,_[W+257]),d+=M[W+257],W>7&&(zt(e,d,i[k]>>>23&31),d+=Nt[W]);var D=31&i[k];Jt(e,d,F[D]),d+=B[D],D>3&&(Jt(e,d,i[k]>>>5&8191),d+=Rt[D])}else Jt(e,d,_[i[k]]),d+=M[i[k]];return Jt(e,d,_[256]),d+M[256]},Qt=new At([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$t=function(){for(var t=new At(256),e=0;e<256;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),te=function(){var t=4294967295;return{p:function(e){for(var r=t,i=0;i<e.length;++i)r=$t[255&r^e[i]]^r>>>8;t=r},d:function(){return 4294967295^t}}},ee=function(t,e,r,i,n){return function(t,e,r,i,n,o){var s=t.length,a=new St(i+s+5*(1+Math.floor(s/7e3))+n),u=a.subarray(i,a.length-n),l=0;if(!e||s<8)for(var d=0;d<=s;d+=65535){var c=d+65535;c<s?l=Pt(u,l,t.subarray(d,c)):(u[d]=o,l=Pt(u,l,t.subarray(d,s)))}else{for(var h=Qt[e-1],v=h>>>13,f=8191&h,m=(1<<r)-1,p=new kt(32768),g=new kt(m+1),I=Math.ceil(r/3),y=2*I,b=function(e){return(t[e]^t[e+1]<<I^t[e+2]<<y)&m},C=new At(25e3),w=new kt(288),S=new kt(32),k=0,A=0,N=(d=0,0),R=0,T=0;d<s;++d){var _=b(d),M=32767&d,F=g[_];if(p[M]=F,g[_]=M,R<=d){var B=s-d;if((k>7e3||N>24576)&&B>423){l=qt(t,u,0,C,w,S,A,N,T,d-T,l),N=k=A=0,T=d;for(var x=0;x<286;++x)w[x]=0;for(x=0;x<30;++x)S[x]=0}var O=2,Z=0,Y=f,E=M-F&32767;if(B>2&&_==b(d-E))for(var G=Math.min(v,B)-1,L=Math.min(32767,d),W=Math.min(258,B);E<=L&&--Y&&M!=F;){if(t[d+O]==t[d+O-E]){for(var D=0;D<W&&t[d+D]==t[d+D-E];++D);if(D>O){if(O=D,Z=E,D>G)break;var V=Math.min(E,D-2),X=0;for(x=0;x<V;++x){var z=d-E+x+32768&32767,J=z-p[z]+32768&32767;J>X&&(X=J,F=z)}}}E+=(M=F)-(F=p[M])+32768&32767}if(Z){C[N++]=268435456|Bt[O]<<18|xt[Z];var K=31&Bt[O],H=31&xt[Z];A+=Nt[K]+Rt[H],++w[257+K],++S[H],R=d+O,++k}else C[N++]=t[d],++w[t[d]]}}l=qt(t,u,o,C,w,S,A,N,T,d-T,l)}return Xt(a,0,i+Vt(l)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i,!0)},re=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},ie=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&re(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;i<=r.length;++i)t[i+10]=r.charCodeAt(i)}},ne=function(t){return 10+(t.filename&&t.filename.length+1||0)};class oe{constructor(t,e){var r,i;void 0===e&&(e={}),this.Y={},this.G=t=>{if(!this.Y[t]){var e,r;this.Y[t]=!0;var i=this.L(t);null==(e=(r=this.W).onBlockedNode)||e.call(r,t,i)}},this.D=t=>{var e=this.L(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var r=e.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[t,e]},this.L=t=>this._rrweb.mirror.getNode(t),this.V=t=>{var e,r,i,n,o,s,a,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(i=null==(n=t.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(o=null==(s=t.texts)?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null==(u=t.adds)?void 0:u.length)&&void 0!==a?a:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,r=this.V(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var[e]=this.D(t.id);return!this.X.consumeRateLimit(e)&&t})));var i=this.V(e);return 0!==i||r===i?t:void 0},this._rrweb=t,this.W=e,this.X=new R({bucketSize:null!==(r=this.W.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.W.refillRate)&&void 0!==i?i:10,refillInterval:1e3,i:this.G,u:M})}reset(){this.Y={}}stop(){this.X.stop(),this.reset()}}function se(t,e){return function(t){for(var e=0,r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<N(100*e,0,100,M)}var ae="$sess_rec_flush_size";class ue{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.J=t.get_property.bind(t),this.K=t.persistence.set_property.bind(t.persistence)}trackSize(t){var e=(Number(this.J(ae))||0)+t;this.K(ae,e)}reset(){return this.K(ae,0)}get currentTrackedSize(){return Number(this.J(ae))||0}}var le=3e5;function de(t){return I(t)?t.network_timing:t}var ce="[SessionRecording]",he=F(ce),ve=[d.MouseMove,d.MouseInteraction,d.Scroll,d.ViewportResize,d.Input,d.TouchMove,d.MediaInteraction,d.Drag],fe=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function me(){var t;return null==o||null==(t=o.__PosthogExtensions__)?void 0:t.rrweb}function pe(){var t;return null==(t=me())?void 0:t.record}function ge(t){return function(t,e){for(var r="",i=0;i<t.length;){var n=t[i++];r+=String.fromCharCode(n)}return r}(function(t,e){void 0===e&&(e={});var r=te(),i=t.length;r.p(t);var n=ee(t,e,ne(e),8),o=n.length;return ie(n,e),re(n,o-8,r.d()),re(n,o-4,i),n}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new St(t.length+(t.length>>>1)),n=0,o=function(t){i[n++]=t},s=0;s<r;++s){if(n+5>i.length){var a=new St(n+8+(r-s<<1));a.set(i),i=a}var u=t.charCodeAt(s);u<128||e?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++s))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return Xt(i,0,n)}(JSON.stringify(t))))}function Ie(t,e){return t.type===l.Custom&&t.data.tag===e}function ye(t){return Ie(t,"sessionIdle")}function be(t){return Ie(t,"$session_ending")}function Ce(t){return Ie(t,"$session_starting")}function we(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),i=t.data.slice(0,r),n=t.data.slice(r);return[we({size:wt(i),data:i,sessionId:t.sessionId,windowId:t.windowId}),we({size:wt(n),data:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}class Se{get sessionId(){return this.H}get j(){if(!this._instance.sessionManager)throw new Error(ce+" must be started with a valid sessionManager.");return this._instance.sessionManager}get U(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get P(){var t=this._instance.get_property(L);return!0===t?null:!1!==t&&(b(t)?t===this.sessionId:null)}get q(){var t,e=null==(t=this.$)?void 0:t.sampleRate;return S(e)?e:null}get tt(){var t,e=null==(t=this.$)?void 0:t.minimumDurationMilliseconds;return S(e)?e:null}constructor(t){this.et="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.rt=void 0,this.it=Date.now(),this.nt=[],this.ot="unknown",this.st=!1,this.ut=new ft,this.lt=[],this.dt=void 0,this.ct=void 0,this.ht=yt,this.vt=void 0,this.ft=void 0,this.gt=void 0,this.It=void 0,this.yt=(t,e,r)=>{var i,n;if(r&&(t!==this.H||e!==this.bt)){var o,s=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),a=this.H,u=this.bt;if(s)this.Ct("$session_ending",{currentSessionId:a,currentWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.it,flushed_size:null==(o=this.wt)?void 0:o.currentTrackedSize});this.wt&&this.wt.reset(),null==(i=this._instance.persistence)||i.unregister(X),this.st=!1,null==(n=me())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.Ct("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.St(),s&&this.Ct("$session_starting",{previousSessionId:a,previousWindowId:u,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.it}),S(this.q)&&w(this.gt)&&this.kt(t)}},this.At=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[W])===this.H},this.Nt=()=>{var t,e;if(0===this.Rt.data.length)return null;var r=null==(t=this.Rt.data[0])?void 0:t.timestamp,i=null==(e=this.Rt.data[this.Rt.data.length-1])?void 0:e.timestamp;return S(r)&&S(i)?i-r:null},this.Tt=()=>{var t,e,r=this.tt;if(!S(r))return!1;if(!(null!==(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)&&void 0!==t&&t)){var i=this._t;return S(i)&&i>=0&&i<r}if(this.At())return!1;var n,o=this.Nt();return!!C(o)||(!(o>=r)||(null==(n=this._instance.persistence)||n.register({[W]:this.H}),!1))},this.Mt=()=>{this.Ft()},this.Bt=()=>{this.Ct("browser offline",{})},this.xt=()=>{this.Ct("browser online",{})},this.Ot=()=>{if(null!=n&&n.visibilityState){var t="window "+n.visibilityState;this.Ct(t,{})}},this._instance=t;var{sessionId:e,windowId:r}=this.j.checkAndGetSessionAndWindowId();this.H=e,this.bt=r,this.Zt=new gt(this._instance),this.Yt=new pt(this._instance),this.Et=new It(this._instance),this.Rt=this.Gt(),this.U>=this.j.sessionTimeoutMs&&he.warn("session_idle_threshold_ms ("+this.U+") is greater than the session timeout ("+this.j.sessionTimeoutMs+"). Session will never be detected as idle"),this.wt=new ue(this._instance)}get Lt(){var t,e,r,i,n,o,s,a=null==(t=this.$)?void 0:t.masking,u={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector},l=null!==(n=null==u?void 0:u.maskAllInputs)&&void 0!==n?n:null==a?void 0:a.maskAllInputs,d=null!==(o=null==u?void 0:u.maskTextSelector)&&void 0!==o?o:null==a?void 0:a.maskTextSelector,c=null!==(s=null==u?void 0:u.blockSelector)&&void 0!==s?s:null==a?void 0:a.blockSelector;return y(l)&&y(d)&&y(c)?void 0:{maskAllInputs:null==l||l,maskTextSelector:d,blockSelector:c}}get Wt(){var t,e,r,i,n,o,s,a=this._instance.config.session_recording.captureCanvas,u=null==(t=this.$)?void 0:t.canvasRecording,l=null!==(e=null!==(r=null==a?void 0:a.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==e&&e,d=null!==(i=null!==(n=null==a?void 0:a.canvasFps)&&void 0!==n?n:null==u?void 0:u.fps)&&void 0!==i?i:4,c=null!==(o=null!==(s=null==a?void 0:a.canvasQuality)&&void 0!==s?s:null==u?void 0:u.quality)&&void 0!==o?o:.4;if("string"==typeof c){var h=parseFloat(c);c=isNaN(h)?.4:h}return{enabled:l,fps:N(d,0,12,F("canvas recording fps"),4),quality:N(c,0,1,F("canvas recording quality"),.4)}}get Dt(){var t,e=!(null==(t=this.$)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Vt(){var t,e,r,i=null==(t=this.$)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},o=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),s=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),a=de(this._instance.config.capture_performance),u=de(null==i?void 0:i.capturePerformance),l=!!(k(a)?a:u);return o||s||l?{recordHeaders:o,recordBody:s,recordPerformance:l}:void 0}Xt(){var t,e,r=[],i=null==(t=o.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;i&&this.Dt&&r.push(i());var n=null==(e=o.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;this.Vt&&g(n)&&(!Z.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(n(et(this._instance.config,this.Vt))):he.info("NetworkCapture not started because we are on localhost."));return r}zt(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var r,i=e.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}Jt(t){try{return t.rrwebMethod(),!0}catch(e){return this.nt.length<10?this.nt.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):he.warn("could not emit queued rrweb event.",e,t),!1}}Ct(t,e){return this.Jt(fe((()=>pe().addCustomEvent(t,e))))}Kt(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),r=e.origin+e.pathname+e.search,i=this.zt(r);this.Ht!==i&&(this.Ht=i,this.Ct("$url_changed",{href:i}))}catch(t){}}jt(){if(this.nt.length){var t=[...this.nt];this.nt=[],t.forEach((t=>{Date.now()-t.enqueuedAt<=2e3&&this.Jt(t)}))}}Ut(){return this.Jt(fe((()=>pe().takeFullSnapshot())))}get Pt(){var t,e;return this.ut.triggerStatus(this.sessionId)!==lt||["sampled","active"].includes(this.status)?null!==(t=null==(e=this._instance.config.session_recording)?void 0:e.full_snapshot_interval_millis)&&void 0!==t?t:le:6e4}qt(){if(this.Qt&&clearInterval(this.Qt),!0!==this.ot){var t=this.Pt;t&&(this.Qt=setInterval((()=>{this.Ut()}),t))}}$t(){this.Yt.urlBlocked||(this.Yt.urlBlocked=!0,clearInterval(this.Qt),he.info("recording paused due to URL blocker"),this.Ct("recording paused",{reason:"url blocker"}))}te(){this.Yt.urlBlocked&&(this.Yt.urlBlocked=!1,this.Ut(),this.qt(),this.Ct("recording resumed",{reason:"left blocked url"}),he.info("recording resumed"))}ee(t){var e;this.ut.triggerStatus(this.sessionId)===lt&&(null==(e=this._instance)||null==(e=e.persistence)||e.register({["url"===t?D:V]:this.H}),this.Ft(),this.re(t+"_trigger_matched"))}get isStarted(){return!!this.rt}get $(){var t=this._instance.get_property(G);if(t){var e=I(t)?t:JSON.parse(t);if(!this.isStarted){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>3e5)return he.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(i=this._instance.persistence)||i.unregister(G))}return e}}ie(t,e){var r;this._instance.get_property(t)&&(e(),null==(r=this._instance.persistence)||r.unregister(t))}start(e){var r,i,n=this.$;if(n){var{sessionId:o,windowId:s}=this.j.checkAndGetSessionAndWindowId();this.H=o,this.bt=s,null==(r=this._instance.persistence)||r.unregister(X),null!=n&&n.endpoint&&(this.et=null==n?void 0:n.endpoint),"any"===(null==n?void 0:n.triggerMatchType)?(this.ht=bt,this.ut=new ht([this.Et,this.Yt])):(this.ht=Ct,this.ut=new vt([this.Et,this.Yt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==n?void 0:n.triggerMatchType}),this.Yt.onConfig(n),this.Et.onConfig(n),null==(i=this.ct)||i.call(this),this.ne(),this.Zt.onConfig(n,((t,e)=>{this.re("linked_flag_matched",{flag:t,variant:e})})),this.ie("$replay_override_sampling",(()=>{this.overrideSampling()})),this.ie("$replay_override_linked_flag",(()=>{this.overrideLinkedFlag()})),this.ie("$replay_override_event_trigger",(()=>{this.overrideTrigger("event")})),this.ie("$replay_override_url_trigger",(()=>{this.overrideTrigger("url")})),this.kt(this.sessionId),this.oe(),O(t,"beforeunload",this.Mt),O(t,"offline",this.Bt),O(t,"online",this.xt),O(t,"visibilitychange",this.Ot),this.vt||(this.vt=this.j.onSessionId(this.yt)),this.ft||(this.ft=this.j.on("forcedIdleReset",(()=>{this.St(),this.ot="unknown",this.stop(),this.It=this.j.onSessionId(((t,e,r)=>{var i;null==(i=this.It)||i.call(this),this.It=void 0,this.yt(t,e,r)}))}))),w(this.dt)&&(this.dt=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.zt(null==t?void 0:t.properties.$current_url):"";if(!e)return;this.Ct("$pageview",{href:e})}}catch(t){he.error("Could not add $pageview to rrweb session",t)}}))),this.status===nt&&this.re(e||"recording_initialized")}else he.info("remote config must be stored in persistence before recording can start")}stop(){var e,r,i,n,o,s,a,u;null==t||t.removeEventListener("beforeunload",this.Mt),null==t||t.removeEventListener("offline",this.Bt),null==t||t.removeEventListener("online",this.xt),null==t||t.removeEventListener("visibilitychange",this.Ot),this.Ft(),this.Gt(),clearInterval(this.Qt),this.se(),null==(e=this.dt)||e.call(this),this.dt=void 0,null==(r=this.ct)||r.call(this),this.ct=void 0,null==(i=this.vt)||i.call(this),this.vt=void 0,null==(n=this.ft)||n.call(this),this.ft=void 0,null==(o=this.gt)||o.call(this),this.gt=void 0,null==(s=this.It)||s.call(this),this.It=void 0,this.Et.stop(),this.Yt.stop(),this.Zt.stop(),null==(a=this.ae)||a.stop(),this.nt=[],null==(u=this.rt)||u.call(this),this.rt=void 0,he.info("stopped")}onRRwebEmit(t){var e,r,i,n,o,s;if(this.jt(),t&&I(t)){if(t.type===l.Meta){var a=this.zt(t.data.href);if(this.Ht=a,!a)return;t.data.href=a}else this.Kt();if(this.Yt.checkUrlTriggerConditions((()=>this.$t()),(()=>this.te()),(t=>this.ee(t)),this.sessionId),!this.Yt.urlBlocked||(c=t).type===l.Custom&&"recording paused"===c.data.tag){var c,h,v;if(t.type===l.FullSnapshot)this.qt(),null==(h=this.ae)||h.reset(),null==(v=this._instance.persistence)||v.register_once({[X]:t.timestamp},void 0);t.type===l.FullSnapshot&&this.ut.triggerStatus(this.sessionId)===lt&&this.ue();var f=this.ae?this.ae.throttleMutations(t):t;if(f){var m=function(t){var e=t;if(e&&I(e)&&6===e.type&&I(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 r=[],i=0;i<e.data.payload.payload.length;i++)e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?r.push(e.data.payload.payload[i].slice(0,2e3)+"...[truncated]"):r.push(e.data.payload.payload[i]);return e.data.payload.payload=r,t}return t}(f),p=function(t){return be(t)?t.data.payload:null}(m),g=function(t){return Ce(t)?t.data.payload:null}(m);if(p||g){var y=null!=p?p:g;null!=y&&y.lastActivityTimestamp&&(m.timestamp=y.lastActivityTimestamp)}else this.le(m);t.type===l.FullSnapshot&&(this.lt.push([this.H,t.timestamp]),this.lt.length>6&&(this.lt=this.lt.slice(-6)));var b=null!==(e=null!==(r=null==p?void 0:p.currentSessionId)&&void 0!==r?r:null==g?void 0:g.nextSessionId)&&void 0!==e?e:this.H,C=null!==(i=null!==(n=null==p?void 0:p.currentWindowId)&&void 0!==n?n:null==g?void 0:g.nextWindowId)&&void 0!==i?i:this.bt;if(!0!==this.ot||function(t){return ye(t)||be(t)||Ce(t)}(m)){if(ye(m)){var w=m.data.payload;if(w){var S=w.lastActivityTimestamp,k=w.threshold;m.timestamp=S+k}}var A=null===(o=this._instance.config.session_recording.compress_events)||void 0===o||o?function(t){try{if(t.type===l.FullSnapshot)return u({},t,{data:ge(t.data),cv:"2024-10"});if(t.type===l.IncrementalSnapshot&&t.data.source===d.Mutation)return u({},t,{cv:"2024-10",data:u({},t.data,{texts:ge(t.data.texts),attributes:ge(t.data.attributes),removes:ge(t.data.removes),adds:ge(t.data.adds)})});if(t.type===l.IncrementalSnapshot&&t.data.source===d.StyleSheetRule)return u({},t,{cv:"2024-10",data:u({},t.data,{adds:t.data.adds?ge(t.data.adds):void 0,removes:t.data.removes?ge(t.data.removes):void 0})})}catch(t){he.error("could not compress event - will use uncompressed event",t)}return t}(m):m,N={$snapshot_bytes:wt(A),$snapshot_data:A,$session_id:b,$window_id:C};m.type===l.FullSnapshot&&null!=(s=me())&&null!=s.wasMaxDepthReached&&s.wasMaxDepthReached()&&(this.st=!0),this.status!==rt?this.de(N):this.Gt()}}}}}get status(){return this.ht({receivedFlags:!0,isRecordingEnabled:!0,isSampled:this.P,urlTriggerMatching:this.Yt,eventTriggerMatching:this.Et,linkedFlagMatching:this.Zt,sessionId:this.sessionId})}log(t,e){var r;void 0===e&&(e="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.Zt.linkedFlagSeen=!0,this.Ut(),this.re("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[L]:this.sessionId}),this.Ut(),this.re("sampling_overridden")}overrideTrigger(t){this.ee(t)}se(){this.ce&&(clearTimeout(this.ce),this.ce=void 0)}Ft(){this.se();var t=this.Tt();if(this.status===ot||this.status===st||this.status===rt||t)return this.ce=setTimeout((()=>{this.Ft()}),2e3),this.Rt;this.Rt.data.length>0&&we(this.Rt).forEach((t=>{var e;null==(e=this.wt)||e.trackSize(t.size),this.he({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:"web",$lib_version:T.LIB_VERSION})}));return this.Gt()}de(t){var e,r=2+((null==(e=this.Rt)?void 0:e.data.length)||0),i=t.$session_id;!this.ot&&(this.Rt.size+t.$snapshot_bytes+r>943718.4||this.Rt.sessionId!==i)&&(this.Rt=this.Ft(),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id),this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.ce||this.ot||(this.ce=setTimeout((()=>{this.Ft()}),2e3))}he(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.et),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get _t(){var t,e,r=null==(t=this.Rt)?void 0:t.data[(null==(e=this.Rt)?void 0:e.data.length)-1],{sessionStartTimestamp:i}=this.j.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i:null}ue(){if(!this.Rt||0===this.Rt.data.length)return this.Gt();for(var t=-1,e=this.Rt.data.length-1;e>=0;e--)if(this.Rt.data[e].type===l.Meta){t=e;break}return t>=0?(this.Rt.data=this.Rt.data.slice(t),this.Rt.size=this.Rt.data.reduce(((t,e)=>t+wt(e)),0),this.Rt):this.Gt()}Gt(){return this.Rt={size:0,data:[],sessionId:this.H,windowId:this.bt},this.Rt}re(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),he.info(t.replace("_"," "),e),-1===["recording_initialized","session_id_changed"].indexOf(t)&&this.Ct(t,e)}ve(t){var e;return 3===t.type&&-1!==ve.indexOf(null==(e=t.data)?void 0:e.source)}le(t){var e=this.ve(t);e||this.ot||t.timestamp-this.it>this.U&&(this.ot=!0,clearInterval(this.Qt),this.Ct("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.it,threshold:this.U,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size}),this.Ft());var r=!1;if(e&&(this.it=t.timestamp,this.ot)){var i="unknown"===this.ot;this.ot=!1,i||(this.Ct("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}if(!this.ot){var{windowId:n,sessionId:o}=this.j.checkAndGetSessionAndWindowId(!e,t.timestamp),s=this.H!==o,a=this.bt!==n;this.bt=n,this.H=o,s||a?(this.stop(),this.start("session_id_changed")):r&&this.qt()}}St(){var t,e,r,i;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(V),null==(e=this._instance)||null==(e=e.persistence)||e.unregister(D),null==(r=this._instance)||null==(r=r.persistence)||r.unregister(L),null==(i=this._instance)||null==(i=i.persistence)||i.unregister(W)}kt(t){var e,r=this.H!==t,i=this.q;if(S(i)){var n=this.P,o=r||!k(n),s=o?se(t,i):n;o&&(s?this.re(it):he.warn("Sample rate ("+i+") has determined that this sessionId ("+t+") will not be sent to the server."),this.Ct("samplingDecisionMade",{sampleRate:i,isSampled:s})),null==(e=this._instance.persistence)||e.register({[L]:!!s&&t})}else{var a;null==(a=this._instance.persistence)||a.unregister(L)}}ne(){0!==this.Et.O.length&&w(this.ct)&&(this.ct=this._instance.on("eventCaptured",(t=>{try{this.Et.O.includes(t.event)&&this.ee("event")}catch(t){he.error("Could not activate event trigger",t)}})))}get sdkDebugProperties(){var t,{sessionStartTimestamp:e}=this.j.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$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._t,$sdk_debug_session_start:e,$sdk_debug_replay_flushed_size:null==(t=this.wt)?void 0:t.currentTrackedSize,$sdk_debug_replay_full_snapshots:this.lt,$snapshot_max_depth_exceeded:this.st}}oe(){var t;if(!this.rt){var e,r,i,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},o=this._instance.config.session_recording;for(var[s,a]of Object.entries(o||{}))s in n&&("maskInputOptions"===s?n.maskInputOptions=u({password:!0},a):n[s]=a);if(this.Wt&&this.Wt.enabled&&(n.recordCanvas=!0,n.sampling={canvas:this.Wt.fps},n.dataURLOptions={type:"image/webp",quality:this.Wt.quality}),this.Lt)n.maskAllInputs=null===(e=this.Lt.maskAllInputs)||void 0===e||e,n.maskTextSelector=null!==(r=this.Lt.maskTextSelector)&&void 0!==r?r:void 0,n.blockSelector=null!==(i=this.Lt.blockSelector)&&void 0!==i?i:void 0;var l=pe();if(l){this.ae=null!==(t=this.ae)&&void 0!==t?t:new oe(l,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var r="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";he.info(r,{node:e}),this.log(ce+" "+r,"warn")}});var d=this.Xt();this.rt=l(u({emit:t=>{this.onRRwebEmit(t)},plugins:d},n)),this.it=Date.now(),this.ot=k(this.ot)?this.ot:"unknown",this.tryAddCustomEvent("$remote_config_received",this.$),this.Ct("$session_options",{sessionRecordingOptions:n,activePlugins:d.map((t=>null==t?void 0:t.name))}),this.Ct("$posthog_config",{config:this._instance.config})}else he.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Ct(t,e)}}var ke,Ae=["type"],Ne=Object.defineProperty,Re=(t,e,r)=>((t,e,r)=>e in t?Ne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Te=Object.defineProperty,_e=(t,e,r)=>((t,e,r)=>e in t?Te(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Me=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(Me||{}),Fe={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Be={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var xe={};function Oe(t){if(xe[t])return xe[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in Fe?Fe[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in Be?Be[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return xe[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?xe[t]=l:e.prototype}catch(t){return e.prototype}}var Ze={};function Ye(t,e,r){var i,n=t+"."+String(r);if(Ze[n])return Ze[n].call(e);var o=Oe(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(Ze[n]=s,s.call(e)):e[r]}var Ee={};function Ge(t,e,r){var i=t+"."+String(r);if(Ee[i])return Ee[i].bind(e);var n=Oe(t)[r];return"function"!=typeof n?e[r]:(Ee[i]=n,n.bind(e))}var Le={childNodes:function(t){return Ye("Node",t,"childNodes")},parentNode:function(t){return Ye("Node",t,"parentNode")},parentElement:function(t){return Ye("Node",t,"parentElement")},textContent:function(t){return Ye("Node",t,"textContent")},contains:function(t,e){return Ge("Node",t,"contains")(e)},getRootNode:function(t){return Ge("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ye("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ye("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ye("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ye("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Oe("MutationObserver").constructor}};function We(t){return t.nodeType===t.ELEMENT_NODE}function De(t){var e=t&&"host"in t&&"mode"in t&&Le.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Le.shadowRoot(e)===t)}function Ve(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function Xe(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>ze(e,t.href))).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function ze(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=Xe(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){r=t.cssText}return t.styleSheet.href?rr(r,t.styleSheet.href):r}var i,n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(i,"$1\\$2")),e?rr(n,e):n}function Je(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let Ke=class{constructor(){_e(this,"idNodeMap",new Map),_e(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-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);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function He(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:o,maskInputFn:s}=t,a=o||"",u=n&&je(n);return(r[i.toLowerCase()]||u&&r[u])&&(a=s?s(a,e):"*".repeat(a.length)),a}function je(t){return t.toLowerCase()}var Ue="__rrweb_original__";function Pe(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?je(e):null}function qe(t,e){var r,i;try{i=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}var Qe=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,$e=/^(?:[a-z+]+:)?\/\//i,tr=/^www\..*/i,er=/^(data:)([^,]*),(.*)/i;function rr(t,e){return(t||"").replace(Qe,((t,r,i,n,o,s)=>{var a,u=i||o||s,l=r||n||"";if(!u)return t;if($e.test(u)||tr.test(u))return"url("+l+u+l+")";if(er.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+u)+l+")";var d=e.split("/"),c=u.split("/");for(var h of(d.pop(),c))"."!==h&&(".."===h?d.pop():d.push(h));return"url("+l+d.join("/")+l+")"}))}var ir,nr,or=1,sr=new RegExp("[^a-z0-9-_:]"),ar=-2;function ur(){return or++}var lr=/^[^ \t\n\r\u000c]+/,dr=/^[, \t\n\r\u000c]+/;var cr=new WeakMap;function hr(t,e){return e&&""!==e.trim()?fr(t,e):e}function vr(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function fr(t,e){var r=cr.get(t);if(r||(r=t.createElement("a"),cr.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function mr(t,e,r,i){return i?"src"===r||"href"===r&&("use"!==e||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?hr(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(i=n[0],r+=i.length,i):""}for(var n=[];i(dr),!(r>=e.length);){var o=i(lr);if(","===o.slice(-1))o=hr(t,o.substring(0,o.length-1)),n.push(o);else{var s="";o=hr(t,o);for(var a=!1;;){var u=e.charAt(r);if(""===u){n.push((o+s).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,n.push((o+s).trim());break}"("===u&&(a=!0)}s+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?rr(i,fr(t)):"object"===e&&"data"===r?hr(t,i):i:hr(t,i):i}function pr(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function gr(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&gr(Le.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&gr(Le.parentNode(t),e,r)}function Ir(t,e,r,i){var n;if(We(t)){if(n=t,!Le.childNodes(n).length)return!1}else{if(null===Le.parentElement(t))return!1;n=Le.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(gr(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function yr(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:u={},maskTextFn:l,maskInputFn:d,dataURLOptions:c={},inlineImages:h,recordCanvas:v,keepIframeSrcFn:f,newlyAddedElement:m=!1}=e,p=function(t,e){if(!e.hasNode(t))return;var r=e.getId(t);return 1===r?void 0:r}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:Me.Document,childNodes:[],compatMode:t.compatMode}:{type:Me.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Me.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:p};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:i,blockClass:n,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:u,dataURLOptions:l={},inlineImages:d,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:v=!1,rootId:f}=e,m=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,n,o),p=function(t){if(t instanceof HTMLFormElement)return"form";var e=je(t.tagName);return sr.test(e)?"div":e}(t),g={},I=t.attributes.length,y=0;y<I;y++){var b=t.attributes[y];pr(p,b.name,b.value)||(g[b.name]=mr(i,p,je(b.name),b.value))}if("link"===p&&s){var C=function(t){return null==t?void 0:t.href}(t);if(C){var w=Je(i,C);if(!w&&C.includes(".css"))w=Je(i,window.location.origin+"/"+C.replace(window.location.href,""));var S=null;w&&(S=Xe(w)),S&&(delete g.rel,delete g.href,g._cssText=S)}}if("style"===p&&t.sheet&&!(t.innerText||Le.textContent(t)||"").trim().length){var k=Xe(t.sheet);k&&(g._cssText=k)}if("input"===p||"textarea"===p||"select"===p){var A=t.value,N=t.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&A?g.value=He({element:t,type:Pe(t),tagName:p,value:A,maskInputOptions:a,maskInputFn:u}):N&&(g.checked=N)}"option"===p&&(t.selected&&!a.select?g.selected=!0:delete g.selected);if("dialog"===p&&t.open)try{g.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){g.rr_open_mode="modal",g.ph_rr_could_not_detect_modal=!0}if("canvas"===p&&c)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;r<t.width;r+=50)for(var i=0;i<t.height;i+=50){var n=e.getImageData,o=Ue in n?n[Ue]:n;if(new Uint32Array(o.call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(g.rr_dataURL=t.toDataURL(l.type,l.quality));else if(!("__context"in t)){var R=t.toDataURL(l.type,l.quality),T=i.createElement("canvas");T.width=t.width,T.height=t.height,R!==T.toDataURL(l.type,l.quality)&&(g.rr_dataURL=R)}if("img"===p&&d){ir||(ir=i.createElement("canvas"),nr=ir.getContext("2d"));var _=t,M=_.currentSrc||_.getAttribute("src")||"<unknown-src>",F=_.crossOrigin,B=()=>{_.removeEventListener("load",B);try{ir.width=_.naturalWidth,ir.height=_.naturalHeight,nr.drawImage(_,0,0),g.rr_dataURL=ir.toDataURL(l.type,l.quality)}catch(t){if("anonymous"!==_.crossOrigin)return _.crossOrigin="anonymous",void(_.complete&&0!==_.naturalWidth?B():_.addEventListener("load",B));console.warn("Cannot inline img src="+M+"! Error: "+t)}"anonymous"===_.crossOrigin&&(F?g.crossOrigin=F:_.removeAttribute("crossorigin"))};_.complete&&0!==_.naturalWidth?B():_.addEventListener("load",B)}if("audio"===p||"video"===p){var x=g;x.rr_mediaState=t.paused?"paused":"played",x.rr_mediaCurrentTime=t.currentTime,x.rr_mediaPlaybackRate=t.playbackRate,x.rr_mediaMuted=t.muted,x.rr_mediaLoop=t.loop,x.rr_mediaVolume=t.volume}v||(t.scrollLeft&&(g.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(g.rr_scrollTop=t.scrollTop));if(m){var{width:O,height:Z}=t.getBoundingClientRect();g={class:g.class,rr_width:O+"px",rr_height:Z+"px"}}"iframe"!==p||h(g.src)||(t.contentDocument||(g.rr_src=g.src),delete g.src);try{customElements.get(p)&&(r=!0)}catch(t){}return{type:Me.Element,tagName:p,attributes:g,childNodes:[],isSVG:vr(t)||void 0,needBlock:m,rootId:f,isCustom:r}}(t,{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:u,maskInputFn:d,dataURLOptions:c,inlineImages:h,recordCanvas:v,keepIframeSrcFn:f,newlyAddedElement:m,rootId:p});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:o}=e,s=Le.parentNode(t),a=s&&s.tagName,u=Le.textContent(t),l="STYLE"===a||void 0,d="SCRIPT"===a||void 0;if(l&&u){try{t.nextSibling||t.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(u=Xe(s.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=rr(u,fr(e.doc))}d&&(u="SCRIPT_PLACEHOLDER");!l&&!d&&u&&i&&(u=n?n(u,Le.parentElement(t)):u.replace(/[\S]/g,"*"));return{type:Me.Text,textContent:u||"",isStyle:l,rootId:o}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:p});case t.CDATA_SECTION_NODE:return{type:Me.CDATA,textContent:"",rootId:p};case t.COMMENT_NODE:return{type:Me.Comment,textContent:Le.textContent(t)||"",rootId:p};default:return!1}}function br(t){return null==t?"":t.toLowerCase()}function Cr(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:d={},maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:p=!1,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:w=(()=>!1),newlyAddedElement:S=!1}=e,{needsMask:k}=e,{preserveWhiteSpace:A=!0}=e;k||(k=Ir(t,s,a,void 0===k));var N,R=yr(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:k,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,dataURLOptions:f,inlineImages:m,recordCanvas:p,keepIframeSrcFn:w,newlyAddedElement:S});if(!R)return console.warn(t,"not serialized"),null;N=i.hasNode(t)?i.getId(t):!function(t,e){if(e.comment&&t.type===Me.Comment)return!0;if(t.type===Me.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===qe(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(br(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===br(t.attributes.name)||"icon"===br(t.attributes.rel)||"apple-touch-icon"===br(t.attributes.rel)||"shortcut icon"===br(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&br(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(br(t.attributes.property).match(/^(og|twitter|fb):/)||br(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===br(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===br(t.attributes.name)||"googlebot"===br(t.attributes.name)||"bingbot"===br(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===br(t.attributes.name)||"generator"===br(t.attributes.name)||"framework"===br(t.attributes.name)||"publisher"===br(t.attributes.name)||"progid"===br(t.attributes.name)||br(t.attributes.property).match(/^article:/)||br(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===br(t.attributes.name)||"yandex-verification"===br(t.attributes.name)||"csrf-token"===br(t.attributes.name)||"p:domain_verify"===br(t.attributes.name)||"verify-v1"===br(t.attributes.name)||"verification"===br(t.attributes.name)||"shopify-checkout-api-token"===br(t.attributes.name)))return!0}}return!1}(R,v)&&(A||R.type!==Me.Text||R.isStyle||R.textContent.replace(/^\s+|\s+$/gm,"").length)?ur():ar;var T=Object.assign(R,{id:N});if(i.add(t,T),N===ar)return null;g&&g(t);var _=!u;if(T.type===Me.Element){_=_&&!T.needBlock,delete T.needBlock;var M=Le.shadowRoot(t);M&&Ve(M)&&(T.isShadowHost=!0)}if((T.type===Me.Document||T.type===Me.Element)&&_){v.headWhitespace&&T.type===Me.Element&&"head"===T.tagName&&(A=!1);var F={doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:k,maskTextClass:s,maskTextSelector:a,skipChild:u,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:A,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w};if(T.type===Me.Element&&"textarea"===T.tagName&&void 0!==T.attributes.value);else for(var B of Array.from(Le.childNodes(t))){var x=Cr(B,F);x&&T.childNodes.push(x)}var O=null;if(We(t)&&(O=Le.shadowRoot(t)))for(var Z of Array.from(Le.childNodes(O))){var Y=Cr(Z,F);Y&&(Ve(O)&&(Y.isShadow=!0),T.childNodes.push(Y))}}var E=Le.parentNode(t);return E&&De(E)&&Ve(E)&&(T.isShadow=!0),T.type===Me.Element&&"iframe"===T.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,o=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var s="about:blank";if(i.location.href!==s||t.src===s||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{o||(e(),o=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(a),o=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&I){var r=Cr(e,{doc:e,mirror:i,blockClass:n,blockSelector:o,needsMask:k,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:A,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w});r&&I(t,r)}}),y),T.type===Me.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===qe(T.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var o=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),n=!0,e()}))}}(t,(()=>{if(b){var e=Cr(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:k,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:v,dataURLOptions:f,inlineImages:m,recordCanvas:p,preserveWhiteSpace:A,onSerialize:g,onIframeLoad:I,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:C,keepIframeSrcFn:w});e&&b(t,e)}}),C),T}let wr=class t{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}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"}};var Sr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},kr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var Ar={};function Nr(t){if(Ar[t])return Ar[t];var e=function(t){var e,r=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],r=e.prototype,i=t in Sr?Sr[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in kr?kr[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return Ar[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?Ar[t]=l:r}catch(t){return r}}var Rr={};function Tr(t,e,r){var i,n=t+"."+String(r);if(Rr[n])return Rr[n].call(e);var o=Nr(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(Rr[n]=s,s.call(e)):e[r]}var _r={};function Mr(t,e,r){var i=t+"."+String(r);if(_r[i])return _r[i].bind(e);var n=Nr(t)[r];return"function"!=typeof n?e[r]:(_r[i]=n,n.bind(e))}function Fr(){return Nr("MutationObserver").constructor}var Br={childNodes:function(t){return Tr("Node",t,"childNodes")},parentNode:function(t){return Tr("Node",t,"parentNode")},parentElement:function(t){return Tr("Node",t,"parentElement")},textContent:function(t){return Tr("Node",t,"textContent")},contains:function(t,e){return Mr("Node",t,"contains")(e)},getRootNode:function(t){return Mr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Tr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Tr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Tr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Tr("Element",t,"querySelectorAll")(e)},mutationObserver:Fr};function xr(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}var Or="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.",Zr={map:{},getId:()=>(console.error(Or),-1),getNode:()=>(console.error(Or),null),removeNodeFromMap(){console.error(Or)},has:()=>(console.error(Or),!1),reset(){console.error(Or)}};function Yr(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),d=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(d,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(d,s)}),l))}}function Er(t,e,r,i,n){void 0===n&&(n=window);var o=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>Er(t,e,o||{},!0)}function Gr(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Zr=new Proxy(Zr,{get:(t,e,r)=>("map"===e&&console.error(Or),Reflect.get(t,e,r))}));var Lr=Date.now;function Wr(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=Br.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=Br.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function Dr(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Vr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Xr(t){return t?t.nodeType===t.ELEMENT_NODE?t:Br.parentElement(t):null}function zr(t,e,r,i){if(!t)return!1;var n=Xr(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(gr(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Jr(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===ar}function Kr(t,e){if(De(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=Br.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Kr(i,e))}function Hr(t){return Boolean(t.changedTouches)}function jr(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Ur(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Pr(t){return!!t&&(t instanceof wr&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Br.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Lr=()=>(new Date).getTime());let qr=class{constructor(){Re(this,"id",1),Re(this,"styleIDMap",new WeakMap),Re(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):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}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 Qr(t){var e,r=null;return"getRootNode"in t&&(null==(e=Br.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Br.host(Br.getRootNode(t))&&(r=Br.host(Br.getRootNode(t))),r}function $r(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Qr(r);)r=e;return r}(t);return Br.contains(e,r)}function ti(t){var e=t.ownerDocument;return!!e&&(Br.contains(e,t)||$r(t))}var ei=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(ei||{}),ri=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(ri||{}),ii=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(ii||{}),ni=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(ni||{}),oi=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(oi||{}),si=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(si||{});function ai(t){return"__ln"in t}class ui{constructor(){Re(this,"length",0),Re(this,"head",null),Re(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;r<t;r++)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&&ai(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&ai(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var li,di=(t,e)=>t+"@"+e;class ci{constructor(){Re(this,"frozen",!1),Re(this,"locked",!1),Re(this,"texts",[]),Re(this,"attributes",[]),Re(this,"attributeMap",new WeakMap),Re(this,"removes",[]),Re(this,"mapRemoves",[]),Re(this,"movedMap",{}),Re(this,"addedSet",new Set),Re(this,"movedSet",new Set),Re(this,"droppedSet",new Set),Re(this,"mutationCb"),Re(this,"blockClass"),Re(this,"blockSelector"),Re(this,"maskTextClass"),Re(this,"maskTextSelector"),Re(this,"inlineStylesheet"),Re(this,"maskInputOptions"),Re(this,"maskTextFn"),Re(this,"maskInputFn"),Re(this,"keepIframeSrcFn"),Re(this,"recordCanvas"),Re(this,"inlineImages"),Re(this,"slimDOMOptions"),Re(this,"dataURLOptions"),Re(this,"doc"),Re(this,"mirror"),Re(this,"iframeManager"),Re(this,"stylesheetManager"),Re(this,"shadowDomManager"),Re(this,"canvasManager"),Re(this,"processedNodeManager"),Re(this,"unattachedDoc"),Re(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),Re(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new ui,i=t=>{for(var e=t,r=ar;r===ar;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var o=Br.parentNode(n);if(o&&ti(n)&&"TEXTAREA"!==o.tagName){var s=De(o)?this.mirror.getId(Qr(n)):this.mirror.getId(o),a=i(n);if(-1===s||-1===a)return r.addNode(n);var u=Cr(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{jr(t,this.mirror)&&this.iframeManager.addIframe(t),Ur(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Pr(n)&&this.shadowDomManager.addShadowRoot(Br.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:s,nextId:a,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)vi(this.removes,o,this.mirror)&&!this.movedSet.has(Br.parentNode(o))||n(o);for(var s of this.addedSet)fi(this.droppedSet,s)||vi(this.removes,s,this.mirror)?fi(this.movedSet,s)?n(s):this.droppedSet.add(s):n(s);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(Br.parentNode(a.value)),d=i(a.value);-1!==l&&-1!==d&&(u=a)}if(!u)for(var c=r.tail;c;){var h=c;if(c=c.previous,h){var v=this.mirror.getId(Br.parentNode(h.value));if(-1===i(h.value))continue;if(-1!==v){u=h;break}var f=h.value,m=Br.parentNode(f);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=Br.host(m);if(-1!==this.mirror.getId(p)){u=h;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),n(u.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=Br.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(g))}})),Re(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(Br.childNodes(t),(t=>Br.textContent(t)||"")).join("")})),Re(this,"processMutation",(t=>{if(!Jr(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=Br.textContent(t.target);zr(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Ir(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Xr(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var o=Pe(r);n=He({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:n,maskInputFn:this.maskInputFn})}if(zr(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var s=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!pr(r.tagName,i))if(s.attributes[i]=mr(this.doc,je(r.tagName),je(i),n),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),d=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||d!==a.style.getPropertyPriority(u)?s.styleDiff[u]=""===d?l:[l,d]:s._unchangedStyles[u]=[l,d]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(s.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(zr(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 r=this.mirror.getId(e),i=De(t.target)?this.mirror.getId(Br.host(t.target)):this.mirror.getId(t.target);zr(t.target,this.blockClass,this.blockSelector,!1)||Jr(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(hi(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Kr(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[di(r,i)]?hi(this.movedSet,e):this.removes.push({parentId:i,id:r,isShadow:!(!De(t.target)||!Ve(t.target))||void 0})),this.mapRemoves.push(e))}))}})),Re(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Jr(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[di(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);zr(t,this.blockClass,this.blockSelector,!1)||(Br.childNodes(t).forEach((t=>this.genAdds(t))),Pr(t)&&Br.childNodes(Br.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}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.shadowDomManager.reset(),this.canvasManager.reset()}}function hi(t,e){t.delete(e),Br.childNodes(e).forEach((e=>hi(t,e)))}function vi(t,e,r){return 0!==t.length&&function(t,e,r){var i,n=Br.parentNode(e),o=function(){var e=r.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=Br.parentNode(n)};for(;n;)if(i=o())return i.v;return!1}(t,e,r)}function fi(t,e){return 0!==t.size&&mi(t,e)}function mi(t,e){var r=Br.parentNode(e);return!!r&&(!!t.has(r)||mi(t,r))}var pi=t=>{if(!li)return t;return function(){try{return t(...arguments)}catch(t){if(li&&!0===li(t))return;throw t}}},gi=[];function Ii(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 yi(t,e){var r=new ci;gi.push(r),r.init(t);var i=new(Fr())(pi(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function bi(t){var{mouseInteractionCb:e,doc:r,mirror:i,blockClass:n,blockSelector:o,sampling:s}=t;if(!1===s.mouseInteraction)return()=>{};var a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[],d=null;return Object.keys(ii).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t])).forEach((t=>{var s=je(t),a=(t=>r=>{var s=Ii(r);if(!zr(s,n,o,!0)){var a=null,l=t;if("pointerType"in r){switch(r.pointerType){case"mouse":a=ni.Mouse;break;case"touch":a=ni.Touch;break;case"pen":a=ni.Pen}a===ni.Touch?ii[t]===ii.MouseDown?l="TouchStart":ii[t]===ii.MouseUp&&(l="TouchEnd"):ni.Pen}else Hr(r)&&(a=ni.Touch);null!==a?(d=a,(l.startsWith("Touch")&&a===ni.Touch||l.startsWith("Mouse")&&a===ni.Mouse)&&(a=null)):ii[t]===ii.Click&&(a=d,d=null);var c=Hr(r)?r.changedTouches[0]:r;if(c){var h=i.getId(s),{clientX:v,clientY:f}=c;pi(e)(u({type:ii[l],id:h,x:v,y:f},null!==a&&{pointerType:a}))}}})(t);if(window.PointerEvent)switch(ii[t]){case ii.MouseDown:case ii.MouseUp:s=s.replace("mouse","pointer");break;case ii.TouchStart:case ii.TouchEnd:return}l.push(xr(s,a,r))})),pi((()=>{l.forEach((t=>t()))}))}function Ci(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:o,sampling:s}=t;return xr("scroll",pi(Yr(pi((t=>{var s=Ii(t);if(s&&!zr(s,n,o,!0)){var a=i.getId(s);if(s===r&&r.defaultView){var u=Wr(r.defaultView);e({id:a,x:u.left,y:u.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var wi=["INPUT","TEXTAREA","SELECT"],Si=new WeakMap;function ki(t){return function(t,e){if(Ti("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Ti("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Ti("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Ti("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(i)}return e}(t,[])}function Ai(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function Ni(t,e){var r,i,n,{mirror:o,stylesheetManager:s}=t,a=null;a="#document"===e.nodeName?o.getId(e):o.getId(Br.host(e));var u="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&u&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r=null==(e=l.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{s.adoptStyleSheets(t,a)}catch(t){}return r}}),pi((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function Ri(t,e){void 0===e&&(e={});var r,i=t.doc.defaultView;if(!i)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:d,canvasMutationCb:c,fontCb:h,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),o(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),s(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),d(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),h(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(r=yi(t,t.doc));var n=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;if(!1===r.mousemove)return()=>{};var o,s="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=Yr(pi((t=>{var r=Date.now()-o;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],o=null})),a),d=pi(Yr(pi((t=>{var e=Ii(t),{clientX:r,clientY:i}=Hr(t)?t.changedTouches[0]:t;o||(o=Lr()),u.push({x:r,y:i,id:n.getId(e),timeOffset:Lr()-o}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?ri.Drag:t instanceof MouseEvent?ri.MouseMove:ri.TouchMove)})),s,{trailing:!1})),c=[xr("mousemove",d,i),xr("touchmove",d,i),xr("drag",d,i)];return pi((()=>{c.forEach((t=>t()))}))}(t),o=bi(t),s=Ci(t),a=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,o=-1;return xr("resize",pi(Yr(pi((()=>{var t=Dr(),e=Vr();n===t&&o===e||(r({width:Number(e),height:Number(t)}),n=t,o=e)})),200)),i)}(t,{win:i}),l=function(t){var{inputCb:e,doc:r,mirror:i,blockClass:n,blockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:d,sampling:c,userTriggeredOnInput:h}=t;function v(t){var e=Ii(t),i=t.isTrusted,u=e&&e.tagName;if(e&&"OPTION"===u&&(e=Br.parentElement(e)),e&&u&&!(wi.indexOf(u)<0)&&!zr(e,n,o,!0)&&!(e.classList.contains(s)||a&&e.matches(a))){var c=e.value,v=!1,m=Pe(e)||"";"radio"===m||"checkbox"===m?v=e.checked:(l[u.toLowerCase()]||l[m])&&(c=He({element:e,maskInputOptions:l,tagName:u,type:m,value:c,maskInputFn:d})),f(e,h?{text:c,isChecked:v,userTriggered:i}:{text:c,isChecked:v});var p=e.name;"radio"===m&&p&&v&&r.querySelectorAll('input[type="radio"][name="'+p+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,h?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,r){var n=Si.get(t);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){Si.set(t,r);var o=i.getId(t);pi(e)(u({},r,{id:o}))}}var m=("last"===c.input?["change"]:["input","change"]).map((t=>xr(t,pi(v),r))),p=r.defaultView;if(!p)return()=>{m.forEach((t=>t()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),I=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...I.map((t=>Er(t[0],t[1],{set(){pi(v)({target:this,isTrusted:!1})}},!1,p)))),pi((()=>{m.forEach((t=>t()))}))}(t),d=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:o,doc:s}=t,a=pi((t=>Yr(pi((o=>{var s=Ii(o);if(s&&!zr(s,r,i,!0)){var{currentTime:a,volume:u,muted:l,playbackRate:d,loop:c}=s;e({type:t,id:n.getId(s),currentTime:a,volume:u,muted:l,playbackRate:d,loop:c})}})),o.media||500))),u=[xr("play",a(si.Play),s),xr("pause",a(si.Pause),s),xr("seeked",a(si.Seeked),s),xr("volumechange",a(si.VolumeChange),s),xr("ratechange",a(si.RateChange),s)];return pi((()=>{u.forEach((t=>t()))}))}(t),c=()=>{},h=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:o}=e;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:pi(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=Ai(e,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:a}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.addRule=function(t,e,r){void 0===r&&(r=this.cssRules.length);var i=t+" { "+e+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[i,r])};var a,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:pi(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=Ai(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:s}]}),t.apply(e,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(t){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:pi(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=Ai(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replace:s}),t.apply(e,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(u=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:pi(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=Ai(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:s}),t.apply(e,o)}))}));var d={};_i("CSSGroupingRule")?d.CSSGroupingRule=o.CSSGroupingRule:(_i("CSSMediaRule")&&(d.CSSMediaRule=o.CSSMediaRule),_i("CSSConditionRule")&&(d.CSSConditionRule=o.CSSConditionRule),_i("CSSSupportsRule")&&(d.CSSSupportsRule=o.CSSSupportsRule));var c={};return Object.entries(d).forEach((t=>{var[e,o]=t;c[e]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(c[e].insertRule,{apply:pi(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=Ai(e.parentStyleSheet,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:[...ki(e),a||0]}]}),t.apply(e,o)}))}),o.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:pi(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=Ai(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...ki(e),s]}]}),t.apply(e,o)}))})})),pi((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=l,a&&(o.CSSStyleSheet.prototype.replace=a),u&&(o.CSSStyleSheet.prototype.replaceSync=u),Object.entries(d).forEach((t=>{var[e,r]=t;r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:i}),h=Ni(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:o}=t,{win:s}=e,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:pi(((t,e,s)=>{var u,[l,d,c]=s;if(n.has(l))return a.apply(e,[l,d,c]);var{id:h,styleId:v}=Ai(null==(u=e.parentRule)?void 0:u.parentStyleSheet,i,o.styleMirror);return(h&&-1!==h||v&&-1!==v)&&r({id:h,styleId:v,set:{property:l,value:d,priority:c},index:ki(e.parentRule)}),t.apply(e,s)}))});var u=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:pi(((t,e,s)=>{var a,[l]=s;if(n.has(l))return u.apply(e,[l]);var{id:d,styleId:c}=Ai(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,o.styleMirror);return(d&&-1!==d||c&&-1!==c)&&r({id:d,styleId:c,remove:{property:l},index:ki(e.parentRule)}),t.apply(e,s)}))}),pi((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:i}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(t,e,r){var i=new s(t,e,r);return o.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=Gr(r.fonts,"add",(function(t){return function(r){return setTimeout(pi((()=>{var t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=s})),n.push(a),pi((()=>{n.forEach((t=>t()))}))}(t)));var m=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:o}=t,s=!0,a=pi((()=>{var t=e.getSelection();if(!(!t||s&&(null==t?void 0:t.isCollapsed))){s=t.isCollapsed||!1;for(var a=[],u=t.rangeCount||0,l=0;l<u;l++){var d=t.getRangeAt(l),{startContainer:c,startOffset:h,endContainer:v,endOffset:f}=d;zr(c,i,n,!0)||zr(v,i,n,!0)||a.push({start:r.getId(c),startOffset:h,end:r.getId(v),endOffset:f})}o({ranges:a})}}));return a(),xr("selectionchange",a)}(t),p=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?Gr(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),g=[];for(var I of t.plugins)g.push(I.observer(I.callback,i,I.options));return pi((()=>{gi.forEach((t=>t.reset())),null==r||r.disconnect(),n(),o(),s(),a(),l(),d(),c(),h(),v(),f(),m(),p(),g.forEach((t=>t()))}))}function Ti(t){return void 0!==window[t]}function _i(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Mi{constructor(t){Re(this,"iframeIdToRemoteIdMap",new WeakMap),Re(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),o=i||this.getRemoteIdToIdMap(t),s=n.get(e);return s||(s=this.generateIdFn(),n.set(e,s),o.set(s,e)),s}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var n=i.get(e);return n||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class Fi{constructor(t){Re(this,"iframes",new WeakMap),Re(this,"crossOriginIframeMap",new WeakMap),Re(this,"crossOriginIframeMirror",new Mi(ur)),Re(this,"crossOriginIframeStyleMirror"),Re(this,"crossOriginIframeRootIdMap",new WeakMap),Re(this,"mirror"),Re(this,"mutationCb"),Re(this,"wrappedEmit"),Re(this,"loadListener"),Re(this,"stylesheetManager"),Re(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Mi(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=t.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case ei.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),{timestamp:e.timestamp,type:ei.IncrementalSnapshot,data:{source:ri.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case ei.Meta:case ei.Load:case ei.DomContentLoaded:return!1;case ei.Plugin:return e;case ei.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case ei.IncrementalSnapshot:switch(e.data.source){case ri.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),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 ri.Drag:case ri.TouchMove:case ri.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case ri.ViewportResize:return!1;case ri.MediaInteraction:case ri.MouseInteraction:case ri.Scroll:case ri.CanvasMutation:case ri.Input:return this.replaceIds(e.data,t,["id"]),e;case ri.StyleSheetRule:case ri.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case ri.Font:return e;case ri.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case ri.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(Array.isArray(e[n])?e[n]=t.getIds(r,e[n]):e[n]=t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}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===Me.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class Bi{constructor(t){Re(this,"shadowDoms",new WeakSet),Re(this,"mutationCb"),Re(this,"scrollCb"),Re(this,"bypassOptions"),Re(this,"mirror"),Re(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){if(Ve(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var r=yi(u({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(Ci(u({},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(Br.host(t))),this.restoreHandlers.push(Ni({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 r=this;this.restoreHandlers.push(Gr(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),o=Br.shadowRoot(this);return o&&ti(this)&&r.addShadowRoot(o,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var xi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Oi="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Zi=0;Zi<64;Zi++)Oi[xi.charCodeAt(Zi)]=Zi;var Yi=new Map;var Ei=(t,e,r)=>{if(t&&(Wi(t,e)||"object"==typeof t)){var i=function(t,e){var r=Yi.get(t);return r||(r=new Map,Yi.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function Gi(t,e,r){if(t instanceof Array)return t.map((t=>Gi(t,e,r)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;e<i;e+=3)n+=xi[r[e]>>2],n+=xi[(3&r[e])<<4|r[e+1]>>4],n+=xi[(15&r[e+1])<<2|r[e+2]>>6],n+=xi[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Gi(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var i=t.constructor.name,{src:n}=t;return{rr_type:i,src:n}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[Gi(t.data,e,r),t.width,t.height]}:Wi(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Ei(t,e,r)}:t}var Li=(t,e,r)=>t.map((t=>Gi(t,e,r))),Wi=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))};function Di(t,e,r,i){var n=[];try{var o=Gr(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!zr(this,e,r,!0)){var u=function(t){return"experimental-webgl"===t?"webgl":t}(n);if("__context"in this||(this.__context=u),i&&["webgl","webgl2"].includes(u))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[n,...s])}}));n.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Vi(t,e,r,i,n,o){var s=[],a=Object.getOwnPropertyNames(t),u=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var u=Gr(t,a,(function(t){return function(){for(var s=arguments.length,u=new Array(s),l=0;l<s;l++)u[l]=arguments[l];var d=t.apply(this,u);if(Ei(d,o,this),"tagName"in this.canvas&&!zr(this.canvas,i,n,!0)){var c=Li(u,o,this),h={type:e,property:a,args:c};r(this.canvas,h)}return d}}));s.push(u)}catch(i){var l=Er(t,a,{set(t){r(this.canvas,{type:e,property:a,args:[t],setter:!0})}});s.push(l)}};for(var l of a)u(l);return s}var Xi,zi,Ji,Ki,Hi="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",ji="undefined"!=typeof window&&window.Blob&&new Blob([(Xi=Hi,Uint8Array.from(atob(Xi),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Ui(t){var e;try{if(!(e=ji&&(window.URL||window.webkitURL).createObjectURL(ji)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;base64,"+Hi,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Pi{constructor(t){Re(this,"pendingCanvasMutations",new Map),Re(this,"rafStamps",{latestId:0,invokeId:null}),Re(this,"mirror"),Re(this,"mutationCb"),Re(this,"resetObservers"),Re(this,"frozen",!1),Re(this,"locked",!1),Re(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{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(r,i,n),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,e,r,i,n){var o=this,s=Di(e,r,i,!0),u=new Map,l=new Ui;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:o}=t.data;this.mutationCb({id:e,type:oi["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var d,c=1e3/t,h=0,v=t=>{var s,f;h&&t-h<c?d=requestAnimationFrame(v):(h=t,(s=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{zr(t,r,i,!0)||s.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(e.document),s).forEach(function(){var t=a((function*(t){var e,r=o.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){if(u.set(r,!0),["webgl","webgl2"].includes(t.__context)){var i=t.getContext(t.__context);!1===(null==(e=null==i?void 0:i.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var s=t.clientWidth||t.width,a=t.clientHeight||t.height,d=yield createImageBitmap(t,{resizeWidth:s,resizeHeight:a});l.postMessage({id:r,bitmap:d,width:s,height:a,dataURLOptions:n.dataURLOptions},[d])}}));return function(e){return t.apply(this,arguments)}}()),d=requestAnimationFrame(v))};d=requestAnimationFrame(v),this.resetObservers=()=>{s(),cancelAnimationFrame(d)}}initCanvasMutationObserver(t,e,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=Di(t,e,r,!1),n=function(t,e,r,i){var n=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=Gr(e.CanvasRenderingContext2D.prototype,o,(function(n){return function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return zr(this.canvas,r,i,!0)||setTimeout((()=>{var r=Li(a,e,this);t(this.canvas,{type:oi["2D"],property:o,args:r})}),0),n.apply(this,a)}}));n.push(s)}catch(r){var a=Er(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:oi["2D"],property:o,args:[e],setter:!0})}});n.push(a)}};for(var a of o)s(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),o=function(t,e,r,i){var n=[];return n.push(...Vi(e.WebGLRenderingContext.prototype,oi.WebGL,t,r,i,e)),void 0!==e.WebGL2RenderingContext&&n.push(...Vi(e.WebGL2RenderingContext.prototype,oi.WebGL2,t,r,i,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var i=r.map((t=>{var e=function(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}(t,Ae);return e})),{type:n}=r[0];this.mutationCb({id:e,type:n,commands:i}),this.pendingCanvasMutations.delete(t)}}}}class qi{constructor(t){Re(this,"trackedLinkElements",new WeakSet),Re(this,"mutationCb"),Re(this,"adoptedStyleSheetCb"),Re(this,"styleMirror",new qr),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],o=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:ze(e,t.href),index:r})))})),i.styleIds.push(e)};for(var s of t)o(s);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Qi{constructor(){Re(this,"nodeMap",new WeakMap),Re(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var $i=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var tn=document.createElement("iframe");document.body.appendChild(tn),Array.from=(null==(ke=tn.contentWindow)?void 0:ke.Array.from)||Array.from,document.body.removeChild(tn)}}catch(t){console.debug("Unable to override Array.from",t)}var en,rn,nn=new Ke;function on(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:r,checkoutEveryNth:i,blockClass:n="rr-block",blockSelector:o=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:d=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:v,slimDOMOptions:f,maskInputFn:m,maskTextFn:p,hooks:g,packFn:I,sampling:y={},dataURLOptions:b={},mousemoveWait:C,recordDOM:w=!0,recordCanvas:S=!1,recordCrossOriginIframes:k=!1,recordAfter:A=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:N=!1,collectFonts:R=!1,inlineImages:T=!1,plugins:_,keepIframeSrcFn:M=(()=>!1),ignoreCSSAttributes:F=new Set([]),errorHandler:B}=t;li=B;var x=!k||window.parent===window,O=!1;if(!x)try{window.parent.document&&(O=!1)}catch(t){O=!0}if(x&&!e)throw new Error("emit function is required");if(!x&&!O)return()=>{};void 0!==C&&void 0===y.mousemove&&(y.mousemove=C),nn.reset();var Z,Y=!0===h?{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!==v?v:{password:!0},E=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var G=0,L=t=>{for(var e of _||[])e.eventProcessor&&(t=e.eventProcessor(t));return I&&!O&&(t=I(t)),t};zi=(t,n)=>{var o,s=t;if(s.timestamp=Lr(),!(null==(o=gi[0])?void 0:o.isFrozen())||s.type===ei.FullSnapshot||s.type===ei.IncrementalSnapshot&&s.data.source===ri.Mutation||gi.forEach((t=>t.unfreeze())),x)null==e||e(L(s),n);else if(O){var a={type:"rrweb",event:L(s),origin:window.location.origin,isCheckout:n};window.parent.postMessage(a,"*")}if(s.type===ei.FullSnapshot)Z=s,G=0;else if(s.type===ei.IncrementalSnapshot){if(s.data.source===ri.Mutation&&s.data.isAttachIframe)return;G++;var u=i&&G>=i,l=r&&s.timestamp-Z.timestamp>r;(u||l)&&Ji(!0)}};var W=t=>{zi({type:ei.IncrementalSnapshot,data:u({source:ri.Mutation},t)})},D=t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.Scroll},t)}),V=t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.CanvasMutation},t)}),X=new qi({mutationCb:W,adoptedStyleSheetCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.AdoptedStyleSheet},t)})}),z=new Fi({mirror:nn,mutationCb:W,stylesheetManager:X,recordCrossOriginIframes:k,wrappedEmit:zi});for(var J of _||[])J.getMirror&&J.getMirror({nodeMirror:nn,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});var K=new Qi;Ki=new Pi({recordCanvas:S,mutationCb:V,win:window,blockClass:n,blockSelector:o,mirror:nn,sampling:y.canvas,dataURLOptions:b});var H=new Bi({mutationCb:W,scrollCb:D,bypassOptions:{blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:d,inlineStylesheet:c,maskInputOptions:Y,dataURLOptions:b,maskTextFn:p,maskInputFn:m,recordCanvas:S,inlineImages:T,sampling:y,slimDOMOptions:E,iframeManager:z,stylesheetManager:X,canvasManager:Ki,keepIframeSrcFn:M,processedNodeManager:K},mirror:nn});Ji=function(t){if(void 0===t&&(t=!1),w){zi({type:ei.Meta,data:{href:window.location.href,width:Vr(),height:Dr()}},t),X.reset(),H.init(),gi.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new Ke,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:d=!1,maskTextFn:c,maskInputFn:h,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:p,onIframeLoad:g,iframeLoadTimeout:I,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:C=(()=>!1)}=e||{};return Cr(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===d?{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===d?{password:!0}:d,maskTextFn:c,maskInputFn:h,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:u,recordCanvas:l,preserveWhiteSpace:m,onSerialize:p,onIframeLoad:g,iframeLoadTimeout:I,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:C,newlyAddedElement:!1})}(document,{mirror:nn,blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:d,inlineStylesheet:c,maskAllInputs:Y,maskTextFn:p,maskInputFn:m,slimDOM:E,dataURLOptions:b,recordCanvas:S,inlineImages:T,onSerialize:t=>{jr(t,nn)&&z.addIframe(t),Ur(t,nn)&&X.trackLinkElement(t),Pr(t)&&H.addShadowRoot(Br.shadowRoot(t),document)},onIframeLoad:(t,e)=>{z.attachIframe(t,e),H.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{X.attachLinkElement(t,e)},keepIframeSrcFn:M});if(!e)return console.warn("Failed to snapshot the document");zi({type:ei.FullSnapshot,data:{node:e,initialOffset:Wr(window)}},t),gi.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&X.adoptStyleSheets(document.adoptedStyleSheets,nn.getId(document))}};try{var j=[],U=t=>{var e;return pi(Ri)({mutationCb:W,mousemoveCb:(t,e)=>zi({type:ei.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.MouseInteraction},t)}),scrollCb:D,viewportResizeCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.ViewportResize},t)}),inputCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.Input},t)}),mediaInteractionCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.MediaInteraction},t)}),styleSheetRuleCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.StyleSheetRule},t)}),styleDeclarationCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>zi({type:ei.IncrementalSnapshot,data:u({source:ri.Font},t)}),selectionCb:t=>{zi({type:ei.IncrementalSnapshot,data:u({source:ri.Selection},t)})},customElementCb:t=>{zi({type:ei.IncrementalSnapshot,data:u({source:ri.CustomElement},t)})},blockClass:n,ignoreClass:s,ignoreSelector:a,maskTextClass:l,maskTextSelector:d,maskInputOptions:Y,inlineStylesheet:c,sampling:y,recordDOM:w,recordCanvas:S,inlineImages:T,userTriggeredOnInput:N,collectFonts:R,doc:t,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:M,blockSelector:o,slimDOMOptions:E,dataURLOptions:b,mirror:nn,iframeManager:z,stylesheetManager:X,shadowDomManager:H,processedNodeManager:K,canvasManager:Ki,ignoreCSSAttributes:F,plugins:(null==(e=null==_?void 0:_.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>zi({type:ei.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},g)};z.addLoadListener((t=>{try{j.push(U(t.contentDocument))}catch(t){console.warn(t)}}));var P=()=>{Ji(),j.push(U(document)),$i=!0};return"interactive"===document.readyState||"complete"===document.readyState?P():(j.push(xr("DOMContentLoaded",(()=>{zi({type:ei.DomContentLoaded,data:{}}),"DOMContentLoaded"===A&&P()}))),j.push(xr("load",(()=>{zi({type:ei.Load,data:{}}),"load"===A&&P()}),window))),()=>{j.forEach((t=>t())),K.destroy(),$i=!1,li=void 0}}catch(t){console.warn(t)}}on.addCustomEvent=(t,e)=>{if(!$i)throw new Error("please add custom event after start recording");zi({type:ei.Custom,data:{tag:t,payload:e}})},on.freezePage=()=>{gi.forEach((t=>t.freeze()))},on.takeFullSnapshot=t=>{if(!$i)throw new Error("please take full snapshot after start recording");Ji(t)},on.mirror=nn,(rn=en||(en={}))[rn.NotStarted=0]="NotStarted",rn[rn.Running=1]="Running",rn[rn.Stopped=2]="Stopped";var sn,an=Object.defineProperty,un=(t,e,r)=>((t,e,r)=>e in t?an(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ln=Object.defineProperty,dn=(t,e,r)=>((t,e,r)=>e in t?ln(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),cn=Object.defineProperty,hn=(t,e,r)=>((t,e,r)=>e in t?cn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),vn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},fn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},mn={};function pn(t){if(mn[t])return mn[t];var e=globalThis[t],r=e.prototype,i=t in vn?vn[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in fn?fn[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return mn[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?mn[t]=l:r}catch(t){return r}}var gn={};function In(t,e,r){var i,n=t+"."+String(r);if(gn[n])return gn[n].call(e);var o=pn(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(gn[n]=s,s.call(e)):e[r]}var yn={};function bn(t,e,r){var i=t+"."+String(r);if(yn[i])return yn[i].bind(e);var n=pn(t)[r];return"function"!=typeof n?e[r]:(yn[i]=n,n.bind(e))}var Cn={childNodes:function(t){return In("Node",t,"childNodes")},parentNode:function(t){return In("Node",t,"parentNode")},parentElement:function(t){return In("Node",t,"parentElement")},textContent:function(t){return In("Node",t,"textContent")},contains:function(t,e){return bn("Node",t,"contains")(e)},getRootNode:function(t){return bn("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?In("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?In("Element",t,"shadowRoot"):null},querySelector:function(t,e){return In("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return In("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return pn("MutationObserver").constructor}};class wn{constructor(){hn(this,"idNodeMap",new Map),hn(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-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);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var r=e.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Sn(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&Sn(Cn.parentNode(t),e,r);for(var i=t.classList.length;i--;){var n=t.classList[i];if(e.test(n))return!0}return!!r&&Sn(Cn.parentNode(t),e,r)}class kn{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof kn))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var An={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Nn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Rn={};function Tn(t){if(Rn[t])return Rn[t];var e=globalThis[t],r=e.prototype,i=t in An?An[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),o=t in Nn?Nn[t]:void 0,s=Boolean(o&&o.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&s)return Rn[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return document.body.removeChild(a),l?Rn[t]=l:r}catch(t){return r}}var _n={};function Mn(t,e,r){var i,n=t+"."+String(r);if(_n[n])return _n[n].call(e);var o=Tn(t),s=null==(i=Object.getOwnPropertyDescriptor(o,r))?void 0:i.get;return s?(_n[n]=s,s.call(e)):e[r]}var Fn={};function Bn(t,e,r){var i=t+"."+String(r);if(Fn[i])return Fn[i].bind(e);var n=Tn(t)[r];return"function"!=typeof n?e[r]:(Fn[i]=n,n.bind(e))}var xn={childNodes:function(t){return Mn("Node",t,"childNodes")},parentNode:function(t){return Mn("Node",t,"parentNode")},parentElement:function(t){return Mn("Node",t,"parentElement")},textContent:function(t){return Mn("Node",t,"textContent")},contains:function(t,e){return Bn("Node",t,"contains")(e)},getRootNode:function(t){return Bn("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Mn("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Mn("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Mn("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Mn("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Tn("MutationObserver").constructor}};var On="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.",Zn={map:{},getId:()=>(console.error(On),-1),getNode:()=>(console.error(On),null),removeNodeFromMap(){console.error(On)},has:()=>(console.error(On),!1),reset(){console.error(On)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Zn=new Proxy(Zn,{get:(t,e,r)=>("map"===e&&console.error(On),Reflect.get(t,e,r))}));var Yn=Date.now;function En(t){return t?t.nodeType===t.ELEMENT_NODE?t:xn.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(Yn=()=>(new Date).getTime());function Gn(t){var e,r=null;return"getRootNode"in t&&(null==(e=xn.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&xn.host(xn.getRootNode(t))&&(r=xn.host(xn.getRootNode(t))),r}function Ln(t){for(var e,r=t;e=Gn(r);)r=e;return r}function Wn(t){var e=t.ownerDocument;if(!e)return!1;var r=Ln(t);return xn.contains(e,r)}for(var Dn=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){dn(this,"id",1),dn(this,"styleIDMap",new WeakMap),dn(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):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return Zn},closestElementOfNode:En,getBaseDimension:function t(e,r){var i,n,o=null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=t(o,r),u=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:u,absoluteScale:a.absoluteScale*u}},getNestedRule:function t(e,r){var i=e[r[0]];return 1===r.length?i:t(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:Ln,getShadowHost:Gn,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(e=xn.parentElement(o.body))?void 0:e.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(i=xn.parentElement(o.body))?void 0:i.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof kn&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(xn.shadowRoot(t)))},hookSetter:function t(e,r,i,n,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(e,r);return o.Object.defineProperty(e,r,n?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>t(e,r,s||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(xn.contains(e,t)||Wn(t))},isAncestorRemoved:function t(e,r){if(n=(i=e)&&"host"in i&&"mode"in i&&Cn.host(i)||null,Boolean(n&&"shadowRoot"in n&&Cn.shadowRoot(n)===i))return!1;var i,n,o=r.getId(e);if(!r.has(o))return!0;var s=xn.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||t(s,r))},isBlocked:function(t,e,r,i){if(!t)return!1;var n=En(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(Sn(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:function(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))},iterateResolveTree:function t(e,r){r(e.value);for(var i=e.children.length-1;i>=0;i--)t(e.children[i],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return Yn},on:function(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},r=(t,r)=>{var i={value:t,parent:r,children:[]};return e[t.node.id]=i,i},i=[];for(var n of t){var{nextId:o,parentId:s}=n;if(o&&o in e){var a=e[o];if(a.parent){var u=a.parent.children.indexOf(a);a.parent.children.splice(u,0,r(n,a.parent))}else{var l=i.indexOf(a);i.splice(l,0,r(n,null))}}else if(s in e){var d=e[s];d.children.push(r(n,d))}else i.push(r(n,null))}return i},shadowHostInDom:Wn,throttle:function(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),d=this;l<=0||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(d,s)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(d,s)}),l))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],i=t.length;i--;){var n=t[i];e.has(n.id)||(r.push(n),e.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"})),Vn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),zn=0;zn<64;zn++)Xn[Vn.charCodeAt(zn)]=zn;var Jn;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var Kn=document.createElement("iframe");document.body.appendChild(Kn),Array.from=(null==(sn=Kn.contentWindow)?void 0:sn.Array.from)||Array.from,document.body.removeChild(Kn)}}catch(t){console.debug("Unable to override Array.from",t)}new wn,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(Jn||(Jn={}));class Hn{constructor(t){un(this,"fileName"),un(this,"functionName"),un(this,"lineNumber"),un(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var jn=/(^|@)\S+:\d+/,Un=/^\s*at .*(\S+:\d+|\(native\))/m,Pn=/^(eval@)?(\[native code])?$/,qn={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Un)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(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:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Un)}),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,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),o=i.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Hn({functionName:o,fileName:s,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Pn)}),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 Hn({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Hn({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(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:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Hn({fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,o=r.length;n<o;n+=2){var s=e.exec(r[n]);s&&i.push(new Hn({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return i},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(jn)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Hn({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Qn(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var o=0;o<i.children.length;o++){var s=i.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&n.push(s)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function $n(t){return"[object Object]"===Object.prototype.toString.call(t)}function to(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if($n(t[i])&&to(t[i],e-1))return!0;return!1}function eo(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if($n(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if($n(t)&&to(t,r.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var a in e){var u=e[a];Array.isArray(u)?s[a]=Qn(u.length?u[0]:null):s[a]=u}return s}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 ro={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 io(t,e,r){var i,n=r?Object.assign({},ro,r):ro,o=n.logger;if(!o)return()=>{};i="string"==typeof o?e[o]:o;var s=0,a=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message,i=e.error,o=qn.parse(i).map((t=>t.toString())),s=[eo(r,n.stringifyOptions)];t({level:"error",trace:o,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var d=e=>{var r,i;e.reason instanceof Error?i=[eo("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[eo("Uncaught (in promise)",n.stringifyOptions),eo(e.reason,n.stringifyOptions)]);var o=qn.parse(r).map((t=>t.toString()));t({level:"error",trace:o,payload:i})};e.addEventListener("unhandledrejection",d),u.push((()=>{e.removeEventListener("unhandledrejection",d)}))}for(var c of n.level)u.push(h(i,c));return()=>{u.forEach((t=>t()))};function h(e,r){var i=this;return e[r]?Dn.patch(e,r,(e=>function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||a)){a=!0;try{var d=qn.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>eo(t,n.stringifyOptions)));++s<n.lengthThreshold?t({level:r,trace:d,payload:c}):s===n.lengthThreshold&&t({level:"warn",trace:[],payload:[eo("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{a=!1}}})):()=>{}}}var no=t=>({name:"rrweb/console@1",observer:io,options:t}),oo=t=>t instanceof Document;function so(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return g(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function ao(t,e){var r,i=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:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var o of e.payloadHostDenyList)if(i.endsWith(o))return{hostname:i,isHostDenied:!0};return n}var uo=F("[Recorder]"),lo=t=>"navigation"===t.entryType,co=t=>"resource"===t.entryType;function ho(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>lo(t)||co(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>yo({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>lo(t)||co(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>yo({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:o}),()=>{n.disconnect()}}function vo(t,e){return!!e&&(k(e)||e[t])}function fo(t){var{type:e,recordBody:r,headers:i,url:n}=t;function o(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(k(r))return!0;if(p(r))return o(r);var s=r[e];return k(s)?s:o(s)}function mo(t,e,r,i,n,o){return po.apply(this,arguments)}function po(){return po=a((function*(t,e,r,i,n,o){if(void 0===o&&(o=0),o>10)return uo.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var s=function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),(t=>co(t)&&t.initiatorType===e&&(y(i)||t.startTime>=i)&&(y(n)||t.startTime<=n)));return s||(yield new Promise((t=>setTimeout(t,50*o))),mo(t,e,r,i,n,o+1))})),po.apply(this,arguments)}function go(t){var{body:e,options:r,url:i}=t;if(w(e))return null;var{hostname:n,isHostDenied:o}=ao(i,r);if(o)return n+" is in deny list";if(b(e))return e;if(oo(e))return e.textContent;if(A(e))return E(e);if(I(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 Io=t=>!C(t)&&("navigation"===t.entryType||"resource"===t.entryType);function yo(t){var{entry:e,method:r,status:i,networkRequest:n,isInitial:o,start:s,end:a,url:l,initiatorType:d}=t;s=e?e.startTime:s,a=e?e.responseEnd:a;var c=Math.floor(Date.now()-performance.now()),h=Math.floor(c+(s||0)),v=[u({},e?e.toJSON():{name:l},{startTime:y(s)?void 0:Math.round(s),endTime:y(a)?void 0:Math.round(a),timeOrigin:c,timestamp:h,method:r,initiatorType:d||(e?e.initiatorType:void 0),status:i,requestHeaders:n.requestHeaders,requestBody:n.requestBody,responseHeaders:n.responseHeaders,responseBody:n.responseBody,isInitial:o})];if(Io(e))for(var f of e.serverTiming||[])v.push({timeOrigin:c,timestamp:h,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var bo=["video/","audio/"];function Co(t){return new Promise(((e,r)=>{var i=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e("[SessionReplay] Failed to read body")}}))}function wo(){return(wo=a((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:o}=ao(i,r);return o?Promise.resolve(n+" is in deny list"):Co(e)}))).apply(this,arguments)}function So(){return(So=a((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),s=bo.some((t=>null==o?void 0:o.startsWith(t)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:u}=ao(n,i);return u?a+" is in deny list":null}({r:e,options:r,url:i});return C(n)?Co(e):Promise.resolve(n)}))).apply(this,arguments)}function ko(t,e,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=vo("request",r.recordHeaders),n=vo("response",r.recordHeaders),o=so(e,"fetch",(o=>function(){var s=a((function*(s,a){var u,l,d,c=new Request(s,a),h={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),i&&(h.requestHeaders=v),fo({type:"request",headers:v,url:s,recordBody:r.recordBody})&&(h.requestBody=yield function(t){return wo.apply(this,arguments)}({r:c,options:r,url:s})),l=e.performance.now(),u=yield o(c),d=e.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),n&&(h.responseHeaders=f),fo({type:"response",headers:f,url:s,recordBody:r.recordBody})&&(h.responseBody=yield function(t){return So.apply(this,arguments)}({r:u,options:r,url:s})),u}finally{mo(e,"fetch",c.url,l,d).then((e=>{var r,i=yo({entry:e,method:c.method,status:null==(r=u)?void 0:r.status,networkRequest:h,start:l,end:d,url:c.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return s.apply(this,arguments)}}()));return()=>{o()}}var Ao=null;function No(t,e,r){if(!("performance"in e))return()=>{};if(Ao)return uo.warn("Network observer already initialised, doing nothing"),()=>{};var i=r?Object.assign({},j,r):j,n=e=>{var r=[];e.requests.forEach((t=>{var e=i.maskRequestFn(t);e&&r.push(e)})),r.length>0&&t(u({},e,{requests:r}))},o=ho(n,e,i),s=()=>{},a=()=>{};return(i.recordHeaders||i.recordBody)&&(s=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=vo("request",r.recordHeaders),n=vo("response",r.recordHeaders),o=so(e.XMLHttpRequest.prototype,"open",(o=>function(s,a,u,l,d){void 0===u&&(u=!0);var c,h,v=this,f=new Request(a),m={},p={},g=v.setRequestHeader.bind(v);v.setRequestHeader=(t,e)=>(p[t]=e,g(t,e)),i&&(m.requestHeaders=p);var I=v.send.bind(v);v.send=t=>(fo({type:"request",headers:p,url:a,recordBody:r.recordBody})&&(m.requestBody=go({body:t,options:r,url:a})),c=e.performance.now(),I(t));var y=()=>{v.removeEventListener("readystatechange",b),v.removeEventListener("error",y),v.removeEventListener("abort",y),v.removeEventListener("timeout",y)},b=()=>{if(v.readyState===v.DONE){y(),h=e.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(m.responseHeaders=i),fo({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(m.responseBody=go({body:v.response,options:r,url:a})),mo(e,"xmlhttprequest",f.url,c,h).then((e=>{var r=yo({entry:e,method:s,status:null==v?void 0:v.status,networkRequest:m,start:c,end:h,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",b),v.addEventListener("error",y),v.addEventListener("abort",y),v.addEventListener("timeout",y),o.call(v,s,a.toString(),u,l,d)}));return()=>{o()}}(n,e,i),a=ko(n,e,i)),Ao=()=>{o(),s(),a(),Ao=null}}var Ro=t=>({name:"rrweb/network@1",observer:No,options:t});o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:no,getRecordNetworkPlugin:Ro},o.__PosthogExtensions__.rrweb={record:on,version:"v2"},o.rrweb={record:on,version:"v2"},o.rrwebConsoleRecord={getRecordConsolePlugin:no},o.getRecordNetworkPlugin=Ro,o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.initSessionRecording=t=>new Se(t)}();
2
2
  //# sourceMappingURL=lazy-recorder.js.map