posthog-js 1.316.0 → 1.317.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.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/element-inference.d.ts +21 -0
- package/dist/element-inference.js +2 -0
- package/dist/element-inference.js.map +1 -0
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +12 -0
- package/dist/module.full.d.ts +12 -0
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.d.ts +12 -0
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +12 -0
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/product-tours-preview.d.ts +12 -0
- package/dist/product-tours-preview.js +1 -1
- package/dist/product-tours-preview.js.map +1 -1
- package/dist/product-tours.js +1 -1
- package/dist/product-tours.js.map +1 -1
- package/dist/src/entrypoints/element-inference.es.d.ts +1 -0
- package/dist/src/entrypoints/product-tours.d.ts +2 -0
- package/dist/src/extensions/product-tours/element-inference.d.ts +30 -0
- package/dist/src/extensions/product-tours/index.d.ts +2 -0
- package/dist/src/extensions/product-tours/product-tours-utils.d.ts +2 -1
- package/dist/src/extensions/surveys.d.ts +2 -2
- package/dist/src/posthog-product-tours-types.d.ts +7 -0
- package/dist/src/utils/survey-branching.d.ts +11 -0
- package/dist/src/utils/survey-url-prefill.d.ts +7 -5
- package/dist/surveys-preview.d.ts +18 -1
- package/dist/surveys-preview.js +1 -1
- package/dist/surveys-preview.js.map +1 -1
- package/dist/surveys.js +1 -1
- package/dist/surveys.js.map +1 -1
- package/lib/package.json +5 -1
- package/lib/src/entrypoints/element-inference.es.d.ts +1 -0
- package/lib/src/entrypoints/element-inference.es.js +8 -0
- package/lib/src/entrypoints/element-inference.es.js.map +1 -0
- package/lib/src/entrypoints/product-tours.d.ts +2 -0
- package/lib/src/entrypoints/product-tours.js +5 -0
- package/lib/src/entrypoints/product-tours.js.map +1 -1
- package/lib/src/extensions/product-tours/components/ProductTourTooltip.js +5 -2
- package/lib/src/extensions/product-tours/components/ProductTourTooltip.js.map +1 -1
- package/lib/src/extensions/product-tours/components/ProductTourTooltipInner.js +1 -1
- package/lib/src/extensions/product-tours/components/ProductTourTooltipInner.js.map +1 -1
- package/lib/src/extensions/product-tours/element-inference.d.ts +30 -0
- package/lib/src/extensions/product-tours/element-inference.js +296 -0
- package/lib/src/extensions/product-tours/element-inference.js.map +1 -0
- package/lib/src/extensions/product-tours/index.d.ts +2 -0
- package/lib/src/extensions/product-tours/index.js +4 -1
- package/lib/src/extensions/product-tours/index.js.map +1 -1
- package/lib/src/extensions/product-tours/preview.js +1 -1
- package/lib/src/extensions/product-tours/preview.js.map +1 -1
- package/lib/src/extensions/product-tours/product-tours-utils.d.ts +2 -1
- package/lib/src/extensions/product-tours/product-tours-utils.js +12 -0
- package/lib/src/extensions/product-tours/product-tours-utils.js.map +1 -1
- package/lib/src/extensions/product-tours/product-tours.js +15 -31
- package/lib/src/extensions/product-tours/product-tours.js.map +1 -1
- package/lib/src/extensions/surveys.d.ts +2 -2
- package/lib/src/extensions/surveys.js +5 -94
- package/lib/src/extensions/surveys.js.map +1 -1
- package/lib/src/posthog-product-tours-types.d.ts +7 -0
- package/lib/src/posthog-product-tours-types.js.map +1 -1
- package/lib/src/utils/survey-branching.d.ts +11 -0
- package/lib/src/utils/survey-branching.js +106 -0
- package/lib/src/utils/survey-branching.js.map +1 -0
- package/lib/src/utils/survey-url-prefill.d.ts +7 -5
- package/lib/src/utils/survey-url-prefill.js +30 -18
- package/lib/src/utils/survey-url-prefill.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -3
package/dist/lazy-recorder.js
CHANGED
|
@@ -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,n=null==e?void 0:e.navigator,i=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==n||n.userAgent;var o=null!=t?t:{};function s(t,e,r,n,i,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(n,i)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){s(o,n,i,a,u,"next",t)}function u(t){s(o,n,i,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 n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}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),k=t=>"[object Boolean]"===m.call(t),A=t=>t instanceof FormData;function N(t,e,r,n,i){return e>r&&(n.warn("min cannot be greater than max."),e=r),S(t)?t>r?(n.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(n.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(n.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+i),N(i||r,e,r,n))}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,n=Math.floor(r/this.m);if(n>0){var i=n*this.h;t.tokens=Math.min(t.tokens+i,this.o),t.lastAccess=t.lastAccess+n*this.m}}consumeRateLimit(t){var e,r=Date.now(),n=String(t),i=this.t[n];return i?this.I(i,r):(i={tokens:this.o,lastAccess:r},this.t[n]=i),0===i.tokens||(i.tokens--,0===i.tokens&&(null==(e=this.i)||e.call(this,t)),0===i.tokens)}stop(){this.t={}}}var T={LIB_VERSION:"1.316.0"},_=function(e,r){var{debugEnabled:n}=void 0===r?{}:r,i={C:function(r){if(t&&(o.POSTHOG_DEBUG||n)&&!y(t.console)&&t.console){for(var i=("__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];i(e,...a)}},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.C("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.C("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.C("error",...e)},critical:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning:t=>{i.error("You must initialize PostHog before calling "+t)},createLogger:(t,r)=>_(e+" "+t,r)};return i},M=_("[PostHog.js]"),F=M.createLogger,B={};function O(t,e,n){if(!w(t)){if(p(t))return function(t,e,n){if(p(t))if(r&&t.forEach===r)t.forEach(e,n);else if("length"in t&&t.length===+t.length)for(var i=0,o=t.length;i<o;i++)if(i in t&&e.call(n,t[i],i)===B)return}(t,e,n);if(A(t)){for(var i of t.entries())if(e.call(n,i[1],i[0])===B)return}else for(var o in t)if(f.call(t,o)&&e.call(n,t[o],o)===B)return}}function x(t,e,r,n){var{capture:i=!1,passive:o=!0}={};null==t||t.addEventListener(e,r,{capture:i,passive:o})}var Z=["localhost","127.0.0.1"],Y=t=>{var e=null==i?void 0:i.createElement("a");return y(e)?null:(e.href=t,e)},E=function(t,e){var r,n;void 0===e&&(e="&");var i=[];return O(t,(function(t,e){y(t)||y(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),n=encodeURIComponent(e),i[i.length]=n+"="+r)})),i.join(e)},G="$session_is_sampled",L="$session_past_minimum_duration",W="$session_recording_url_trigger_activated_session",D="$session_recording_event_trigger_activated_session",V=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})"),X=new RegExp("(\\d{3}-?\\d{2}-?\\d{4})");var z="[SessionRecording]",J="redacted",K={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"]},H=["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"],j=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],U=["/s/","/e/","/i/"];function P(t,e,r,n){if(w(t))return t;var i=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return b(i)&&(i=parseInt(i)),i>r?z+" "+n+" body too large to record ("+i+" bytes)":t}function q(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),V.test((t||"").replace(/[- ]/g,"")))return!1;if(X.test(t))return!1}return!0}(r)||(r=z+" "+e+" body "+J),O(j,(t=>{var n,i;null!=(n=r)&&n.length&&-1!==(null==(i=r)?void 0:i.indexOf(t))&&(r=z+" "+e+" body "+J+" as might contain: "+t)})),r}var Q=(t,e)=>{var r,n,i,o={payloadSizeLimitBytes:K.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...K.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...K.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,i=Math.min(1e6,null!==(n=r.payloadSizeLimitBytes)&&void 0!==n?n:1e6),t=>(null!=t&&t.requestBody&&(t.requestBody=P(t.requestBody,t.requestHeaders,i,"Request")),null!=t&&t.responseBody&&(t.responseBody=P(t.responseBody,t.responseHeaders,i,"Response")),t)),c=e=>{return d(((t,e)=>{var r,n=Y(t.name),i=0===e.indexOf("http")?null==(r=Y(e))?void 0:r.pathname:e;"/"===i&&(i="");var o=null==n?void 0:n.pathname.replace(i||"","");if(!(n&&o&&U.some((t=>0===o.indexOf(t)))))return t})((n=(r=e).requestHeaders,w(n)||O(Object.keys(null!=n?n:{}),(t=>{H.includes(t.toLowerCase())&&(n[t]=J)})),r),t.api_host));var r,n},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,n=c(e);return n&&null!==(r=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(n))&&void 0!==r?r:void 0}:t=>function(t){if(!y(t))return t.requestBody=q(t.requestBody,"Request"),t.responseBody=q(t.responseBody,"Response"),t}(c(t)),u({},K,o,{recordHeaders:s,recordBody:a,recordPerformance:l,recordInitialRequests:l})},tt="disabled",et="sampled",rt="active",nt="buffering",it="paused",ot="trigger",st=ot+"_activated",at=ot+"_pending",ut=ot+"_"+tt;function lt(t,e){return e.some((e=>"regex"===e.matching&&new RegExp(e.url).test(t)))}class dt{constructor(t){this.S=t}triggerStatus(t){var e=this.S.map((e=>e.triggerStatus(t)));return e.includes(st)?st:e.includes(at)?at:ut}stop(){this.S.forEach((t=>t.stop()))}}class ct{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(ut),e.size){case 0:return ut;case 1:return Array.from(e)[0];default:return at}}stop(){this.S.forEach((t=>t.stop()))}}class ht{triggerStatus(){return at}stop(){}}var vt=t=>"sessionRecording"in t;class ft{constructor(t){this.k=[],this.A=[],this.urlBlocked=!1,this._instance=t}onConfig(t){var e,r;this.k=(vt(t)?I(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.A=(vt(t)?I(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[]}onRemoteConfig(t){this.onConfig(t)}N(t){var e;return 0===this.k.length?ut:(null==(e=this._instance)?void 0:e.get_property(W))===t?st:at}triggerStatus(t){var e=this.N(t),r=e===st?st:e===at?at:ut;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:r}),r}checkUrlTriggerConditions(e,r,n,i){if(void 0!==t&&t.location.href){var o=t.location.href,s=this.urlBlocked,a=lt(o,this.A);if(!s||!a){a&&!s?e():!a&&s&&r();var u=this.N(i)===st,l=lt(o,this.k);!u&&l&&n("url")}}}stop(){}}class mt{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.R=()=>{},this._instance=t}triggerStatus(){var t=at;return w(this.linkedFlag)&&(t=ut),this.linkedFlagSeen&&(t=st),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}onConfig(t,e){var r;if(this.linkedFlag=(vt(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 n=b(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,i=b(this.linkedFlag)?null:this.linkedFlag.variant;this.R=this._instance.onFeatureFlags(((t,r)=>{var o=!1;if(I(r)&&n in r){var s=r[n];o=k(s)?!0===s:i?s===i:!!s}this.linkedFlagSeen=o,o&&e(n,i)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.R()}}class pt{constructor(t){this.T=[],this._instance=t}onConfig(t){var e;this.T=(vt(t)?I(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}M(t){var e;return 0===this.T.length?ut:(null==(e=this._instance)?void 0:e.get_property(D))===t?st:at}triggerStatus(t){var e=this.M(t),r=e===st?st:e===at?at:ut;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:r}),r}stop(){}}function gt(t){return t.isRecordingEnabled?nt:tt}function It(t){if(!t.receivedFlags)return nt;if(!t.isRecordingEnabled)return tt;if(t.urlTriggerMatching.urlBlocked)return it;var e=!0===t.isSampled,r=new dt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?et:r===st?rt:r===at?nt:!1===t.isSampled?tt:rt}function yt(t){if(!t.receivedFlags)return nt;if(!t.isRecordingEnabled)return tt;if(t.urlTriggerMatching.urlBlocked)return it;var e=new ct([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==ut,n=k(t.isSampled);return r&&e===at?nt:r&&e===ut||n&&!t.isSampled?tt:!0===t.isSampled?et:rt}function bt(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 Ct=Uint8Array,wt=Uint16Array,St=Uint32Array,kt=new Ct([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]),At=new Ct([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]),Nt=new Ct([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Rt=function(t,e){for(var r=new wt(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];var i=new St(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},Tt=Rt(kt,2),_t=Tt[0],Mt=Tt[1];_t[28]=258,Mt[258]=28;for(var Ft=Rt(At,0)[1],Bt=new wt(32768),Ot=0;Ot<32768;++Ot){var xt=(43690&Ot)>>>1|(21845&Ot)<<1;xt=(61680&(xt=(52428&xt)>>>2|(13107&xt)<<2))>>>4|(3855&xt)<<4,Bt[Ot]=((65280&xt)>>>8|(255&xt)<<8)>>>1}var Zt=function(t,e,r){for(var n=t.length,i=0,o=new wt(e);i<n;++i)++o[t[i]-1];var s,a=new wt(e);for(i=0;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new wt(1<<e);var u=15-e;for(i=0;i<n;++i)if(t[i])for(var l=i<<4|t[i],d=e-t[i],c=a[t[i]-1]++<<d,h=c|(1<<d)-1;c<=h;++c)s[Bt[c]>>>u]=l}else for(s=new wt(n),i=0;i<n;++i)s[i]=Bt[a[t[i]-1]++]>>>15-t[i];return s},Yt=new Ct(288);for(Ot=0;Ot<144;++Ot)Yt[Ot]=8;for(Ot=144;Ot<256;++Ot)Yt[Ot]=9;for(Ot=256;Ot<280;++Ot)Yt[Ot]=7;for(Ot=280;Ot<288;++Ot)Yt[Ot]=8;var Et=new Ct(32);for(Ot=0;Ot<32;++Ot)Et[Ot]=5;var Gt=Zt(Yt,9,0),Lt=Zt(Et,5,0),Wt=function(t){return(t/8>>0)+(7&t&&1)},Dt=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var n=new(t instanceof wt?wt:t instanceof St?St:Ct)(r-e);return n.set(t.subarray(e,r)),n},Vt=function(t,e,r){r<<=7&e;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8},Xt=function(t,e,r){r<<=7&e;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8,t[n+2]|=r>>>16},zt=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,o=r.slice();if(!i)return[new Ct(0),0];if(1==i){var s=new Ct(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!=i-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(n=1;n<i;++n)o[n].s>h&&(h=o[n].s);var v=new wt(h+1),f=Jt(r[d-1],v,0);if(f>e){n=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}));n<i;++n){var I=o[n].s;if(!(v[I]>e))break;m+=g-(1<<f-v[I]),v[I]=e}for(m>>>=p;m>0;){var y=o[n].s;v[y]<e?m-=1<<e-v[y]++-1:++n}for(;n>=0&&m;--n){var b=o[n].s;v[b]==e&&(--v[b],++m)}f=e}return[new Ct(v),f]},Jt=function(t,e,r){return-1==t.s?Math.max(Jt(t.l,e,r+1),Jt(t.r,e,r+1)):e[t.s]=r},Kt=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new wt(++e),n=0,i=t[0],o=1,s=function(t){r[n++]=t},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&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(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return[r.subarray(0,n),e]},Ht=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},jt=function(t,e,r){var n=r.length,i=Wt(e+2);t[i]=255&n,t[i+1]=n>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var o=0;o<n;++o)t[i+o+4]=r[o];return 8*(i+4+n)},Ut=function(t,e,r,n,i,o,s,a,u,l,d){Vt(e,d++,r),++i[256];for(var c=zt(i,15),h=c[0],v=c[1],f=zt(o,15),m=f[0],p=f[1],g=Kt(h),I=g[0],y=g[1],b=Kt(m),C=b[0],w=b[1],S=new wt(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=zt(S,7),N=A[0],R=A[1],T=19;T>4&&!N[Nt[T-1]];--T);var _,M,F,B,O=l+5<<3,x=Ht(i,Yt)+Ht(o,Et)+s,Z=Ht(i,h)+Ht(o,m)+s+14+3*T+Ht(S,N)+(2*S[16]+3*S[17]+7*S[18]);if(O<=x&&O<=Z)return jt(e,d,t.subarray(u,u+l));if(Vt(e,d,1+(Z<x)),d+=2,Z<x){_=Zt(h,v,0),M=h,F=Zt(m,p,0),B=m;var Y=Zt(N,R,0);Vt(e,d,y-257),Vt(e,d+5,w-1),Vt(e,d+10,T-4),d+=14;for(k=0;k<T;++k)Vt(e,d+3*k,N[Nt[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];Vt(e,d,Y[W]),d+=N[W],W>15&&(Vt(e,d,L[k]>>>5&127),d+=L[k]>>>12)}}}else _=Gt,M=Yt,F=Lt,B=Et;for(k=0;k<a;++k)if(n[k]>255){W=n[k]>>>18&31;Xt(e,d,_[W+257]),d+=M[W+257],W>7&&(Vt(e,d,n[k]>>>23&31),d+=kt[W]);var D=31&n[k];Xt(e,d,F[D]),d+=B[D],D>3&&(Xt(e,d,n[k]>>>5&8191),d+=At[D])}else Xt(e,d,_[n[k]]),d+=M[n[k]];return Xt(e,d,_[256]),d+M[256]},Pt=new St([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),qt=function(){for(var t=new St(256),e=0;e<256;++e){for(var r=e,n=9;--n;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Qt=function(){var t=4294967295;return{p:function(e){for(var r=t,n=0;n<e.length;++n)r=qt[255&r^e[n]]^r>>>8;t=r},d:function(){return 4294967295^t}}},$t=function(t,e,r,n,i){return function(t,e,r,n,i,o){var s=t.length,a=new Ct(n+s+5*(1+Math.floor(s/7e3))+i),u=a.subarray(n,a.length-i),l=0;if(!e||s<8)for(var d=0;d<=s;d+=65535){var c=d+65535;c<s?l=jt(u,l,t.subarray(d,c)):(u[d]=o,l=jt(u,l,t.subarray(d,s)))}else{for(var h=Pt[e-1],v=h>>>13,f=8191&h,m=(1<<r)-1,p=new wt(32768),g=new wt(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 St(25e3),w=new wt(288),S=new wt(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=Ut(t,u,0,C,w,S,A,N,T,d-T,l),N=k=A=0,T=d;for(var O=0;O<286;++O)w[O]=0;for(O=0;O<30;++O)S[O]=0}var x=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+x]==t[d+x-E]){for(var D=0;D<W&&t[d+D]==t[d+D-E];++D);if(D>x){if(x=D,Z=E,D>G)break;var V=Math.min(E,D-2),X=0;for(O=0;O<V;++O){var z=d-E+O+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|Mt[x]<<18|Ft[Z];var K=31&Mt[x],H=31&Ft[Z];A+=kt[K]+At[H],++w[257+K],++S[H],R=d+x,++k}else C[N++]=t[d],++w[t[d]]}}l=Ut(t,u,o,C,w,S,A,N,T,d-T,l)}return Dt(a,0,n+Wt(l)+i)}(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,n,!0)},te=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},ee=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&&te(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var n=0;n<=r.length;++n)t[n+10]=r.charCodeAt(n)}},re=function(t){return 10+(t.filename&&t.filename.length+1||0)};class ne{constructor(t,e){var r,n;void 0===e&&(e={}),this.F={},this.B=t=>{if(!this.F[t]){var e,r;this.F[t]=!0;var n=this.O(t);null==(e=(r=this.Z).onBlockedNode)||e.call(r,t,n)}},this.Y=t=>{var e=this.O(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.O=t=>this._rrweb.mirror.getNode(t),this.G=t=>{var e,r,n,i,o,s,a,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(n=null==(i=t.attributes)?void 0:i.length)&&void 0!==n?n: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.G(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var[e]=this.Y(t.id);return!this.L.consumeRateLimit(e)&&t})));var n=this.G(e);return 0!==n||r===n?t:void 0},this._rrweb=t,this.Z=e,this.L=new R({bucketSize:null!==(r=this.Z.bucketSize)&&void 0!==r?r:100,refillRate:null!==(n=this.Z.refillRate)&&void 0!==n?n:10,refillInterval:1e3,i:this.B,u:M})}reset(){this.F={}}stop(){this.L.stop(),this.reset()}}function ie(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 oe="$sess_rec_flush_size";class se{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.W=t.get_property.bind(t),this.D=t.persistence.set_property.bind(t.persistence)}trackSize(t){var e=(Number(this.W(oe))||0)+t;this.D(oe,e)}reset(){return this.D(oe,0)}get currentTrackedSize(){return Number(this.W(oe))||0}}var ae=3e5,ue="[SessionRecording]",le=F(ue),de=[d.MouseMove,d.MouseInteraction,d.Scroll,d.ViewportResize,d.Input,d.TouchMove,d.MediaInteraction,d.Drag],ce=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function he(){var t;return null==o||null==(t=o.__PosthogExtensions__)||null==(t=t.rrweb)?void 0:t.record}function ve(t){return function(t,e){for(var r="",n=0;n<t.length;){var i=t[n++];r+=String.fromCharCode(i)}return r}(function(t,e){void 0===e&&(e={});var r=Qt(),n=t.length;r.p(t);var i=$t(t,e,re(e),8),o=i.length;return ee(i,e),te(i,o-8,r.d()),te(i,o-4,n),i}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new Ct(t.length+(t.length>>>1)),i=0,o=function(t){n[i++]=t},s=0;s<r;++s){if(i+5>n.length){var a=new Ct(i+8+(r-s<<1));a.set(n),n=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 Dt(n,0,i)}(JSON.stringify(t))))}function fe(t,e){return t.type===l.Custom&&t.data.tag===e}function me(t){return fe(t,"sessionIdle")}function pe(t){return fe(t,"$session_ending")}function ge(t){return fe(t,"$session_starting")}function Ie(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),n=t.data.slice(0,r),i=t.data.slice(r);return[Ie({size:bt(n),data:n,sessionId:t.sessionId,windowId:t.windowId}),Ie({size:bt(i),data:i,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}class ye{get sessionId(){return this.V}get X(){if(!this._instance.sessionManager)throw new Error(ue+" must be started with a valid sessionManager.");return this._instance.sessionManager}get J(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get K(){var t=this._instance.get_property(G);return k(t)?t:b(t)?t===this.sessionId:null}get H(){var t,e=null==(t=this.j)?void 0:t.sampleRate;return S(e)?e:null}get U(){var t,e=null==(t=this.j)?void 0:t.minimumDurationMilliseconds;return S(e)?e:null}constructor(t){this.P="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.q=void 0,this.$=Date.now(),this.tt=[],this.et="unknown",this.rt=new ht,this.nt=void 0,this.it=void 0,this.ot=gt,this.st=void 0,this.ut=void 0,this.lt=void 0,this.dt=void 0,this.ct=(t,e,r)=>{if(r&&(t!==this.V||e!==this.ht)){var n,i=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),o=this.V,s=this.ht;if(i)this.vt("$session_ending",{currentSessionId:o,currentWindowId:s,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.$,flushed_size:null==(n=this.ft)?void 0:n.currentTrackedSize});this.ft&&this.ft.reset(),this.vt("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.gt(),i&&this.vt("$session_starting",{previousSessionId:o,previousWindowId:s,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.$}),S(this.H)&&w(this.lt)&&this.It(t)}},this.yt=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[L])===this.V},this.bt=()=>{var t,e;if(0===this.Ct.data.length)return null;var r=null==(t=this.Ct.data[0])?void 0:t.timestamp,n=null==(e=this.Ct.data[this.Ct.data.length-1])?void 0:e.timestamp;return S(r)&&S(n)?n-r:null},this.wt=()=>{var t,e,r=this.U;if(!S(r))return!1;if(!(null!==(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)&&void 0!==t&&t)){var n=this.St;return S(n)&&n>=0&&n<r}if(this.yt())return!1;var i,o=this.bt();return!!C(o)||(!(o>=r)||(null==(i=this._instance.persistence)||i.register({[L]:this.V}),!1))},this.kt=()=>{this.At()},this.Nt=()=>{this.vt("browser offline",{})},this.Rt=()=>{this.vt("browser online",{})},this.Tt=()=>{if(null!=i&&i.visibilityState){var t="window "+i.visibilityState;this.vt(t,{})}},this._instance=t;var{sessionId:e,windowId:r}=this.X.checkAndGetSessionAndWindowId();this.V=e,this.ht=r,this._t=new mt(this._instance),this.Mt=new ft(this._instance),this.Ft=new pt(this._instance),this.Ct=this.Bt(),this.J>=this.X.sessionTimeoutMs&&le.warn("session_idle_threshold_ms ("+this.J+") is greater than the session timeout ("+this.X.sessionTimeoutMs+"). Session will never be detected as idle"),this.ft=new se(this._instance)}get Ot(){var t,e,r,n,i,o,s,a=null==(t=this.j)?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==(n=this._instance.config.session_recording)?void 0:n.blockSelector},l=null!==(i=null==u?void 0:u.maskAllInputs)&&void 0!==i?i: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 xt(){var t,e,r,n,i,o,s,a=this._instance.config.session_recording.captureCanvas,u=null==(t=this.j)?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!==(n=null!==(i=null==a?void 0:a.canvasFps)&&void 0!==i?i:null==u?void 0:u.fps)&&void 0!==n?n: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 Zt(){var t,e=!(null==(t=this.j)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Yt(){var t,e,r,n=null==(t=this.j)?void 0:t.networkPayloadCapture,i={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==i?void 0:i.recordHeaders)||(null==n?void 0:n.recordHeaders),s=(null==i?void 0:i.recordBody)||(null==n?void 0:n.recordBody),a=I(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,u=!!(k(a)?a:null==n?void 0:n.capturePerformance);return o||s||u?{recordHeaders:o,recordBody:s,recordPerformance:u}:void 0}Et(){var t,e,r=[],n=null==(t=o.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.Zt&&r.push(n());var i=null==(e=o.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;this.Yt&&g(i)&&(!Z.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(i(Q(this._instance.config,this.Yt))):le.info("NetworkCapture not started because we are on localhost."));return r}Gt(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var r,n=e.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==n?void 0:n.name)&&void 0!==r?r:null==n?void 0:n.url}if(e.maskNetworkRequestFn){var i=e.maskNetworkRequestFn({url:t});return null==i?void 0:i.url}return t}Lt(t){try{return t.rrwebMethod(),!0}catch(e){return this.tt.length<10?this.tt.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):le.warn("could not emit queued rrweb event.",e,t),!1}}vt(t,e){return this.Lt(ce((()=>he().addCustomEvent(t,e))))}Wt(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),r=e.origin+e.pathname+e.search,n=this.Gt(r);this.Dt!==n&&(this.Dt=n,this.vt("$url_changed",{href:n}))}catch(t){}}Vt(){if(this.tt.length){var t=[...this.tt];this.tt=[],t.forEach((t=>{Date.now()-t.enqueuedAt<=2e3&&this.Lt(t)}))}}Xt(){return this.Lt(ce((()=>he().takeFullSnapshot())))}get zt(){var t,e;return this.rt.triggerStatus(this.sessionId)!==at||["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:ae:6e4}Jt(){if(this.Kt&&clearInterval(this.Kt),!0!==this.et){var t=this.zt;t&&(this.Kt=setInterval((()=>{this.Xt()}),t))}}Ht(){this.Mt.urlBlocked||(this.Mt.urlBlocked=!0,clearInterval(this.Kt),le.info("recording paused due to URL blocker"),this.vt("recording paused",{reason:"url blocker"}))}jt(){this.Mt.urlBlocked&&(this.Mt.urlBlocked=!1,this.Xt(),this.Jt(),this.vt("recording resumed",{reason:"left blocked url"}),le.info("recording resumed"))}Ut(t){var e;this.rt.triggerStatus(this.sessionId)===at&&(null==(e=this._instance)||null==(e=e.persistence)||e.register({["url"===t?W:D]:this.V}),this.At(),this.Pt(t+"_trigger_matched"))}get isStarted(){return!!this.q}get j(){var t=this._instance.get_property("$session_recording_remote_config");if(t)return I(t)?t:JSON.parse(t)}qt(t,e){var r;this._instance.get_property(t)&&(e(),null==(r=this._instance.persistence)||r.unregister(t))}start(e){var r,n=this.j;if(n){var{sessionId:i,windowId:o}=this.X.checkAndGetSessionAndWindowId();this.V=i,this.ht=o,null!=n&&n.endpoint&&(this.P=null==n?void 0:n.endpoint),"any"===(null==n?void 0:n.triggerMatchType)?(this.ot=It,this.rt=new dt([this.Ft,this.Mt])):(this.ot=yt,this.rt=new ct([this.Ft,this.Mt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==n?void 0:n.triggerMatchType}),this.Mt.onConfig(n),this.Ft.onConfig(n),null==(r=this.it)||r.call(this),this.Qt(),this._t.onConfig(n,((t,e)=>{this.Pt("linked_flag_matched",{flag:t,variant:e})})),this.qt("$replay_override_sampling",(()=>{this.overrideSampling()})),this.qt("$replay_override_linked_flag",(()=>{this.overrideLinkedFlag()})),this.qt("$replay_override_event_trigger",(()=>{this.overrideTrigger("event")})),this.qt("$replay_override_url_trigger",(()=>{this.overrideTrigger("url")})),this.It(this.sessionId),this.$t(),x(t,"beforeunload",this.kt),x(t,"offline",this.Nt),x(t,"online",this.Rt),x(t,"visibilitychange",this.Tt),this.st||(this.st=this.X.onSessionId(this.ct)),this.ut||(this.ut=this.X.on("forcedIdleReset",(()=>{this.gt(),this.et="unknown",this.stop(),this.dt=this.X.onSessionId(((t,e,r)=>{var n;null==(n=this.dt)||n.call(this),this.dt=void 0,this.ct(t,e,r)}))}))),w(this.nt)&&(this.nt=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.Gt(null==t?void 0:t.properties.$current_url):"";if(!e)return;this.vt("$pageview",{href:e})}}catch(t){le.error("Could not add $pageview to rrweb session",t)}}))),this.status===rt&&this.Pt(e||"recording_initialized")}else le.info("remote config must be stored in persistence before recording can start")}stop(){var e,r,n,i,o,s,a,u;null==t||t.removeEventListener("beforeunload",this.kt),null==t||t.removeEventListener("offline",this.Nt),null==t||t.removeEventListener("online",this.Rt),null==t||t.removeEventListener("visibilitychange",this.Tt),this.At(),this.Bt(),clearInterval(this.Kt),this.te(),null==(e=this.nt)||e.call(this),this.nt=void 0,null==(r=this.it)||r.call(this),this.it=void 0,null==(n=this.st)||n.call(this),this.st=void 0,null==(i=this.ut)||i.call(this),this.ut=void 0,null==(o=this.lt)||o.call(this),this.lt=void 0,null==(s=this.dt)||s.call(this),this.dt=void 0,this.Ft.stop(),this.Mt.stop(),this._t.stop(),null==(a=this.ee)||a.stop(),this.tt=[],null==(u=this.q)||u.call(this),this.q=void 0,le.info("stopped")}onRRwebEmit(t){var e,r,n,i,o;if(this.Vt(),t&&I(t)){if(t.type===l.Meta){var s=this.Gt(t.data.href);if(this.Dt=s,!s)return;t.data.href=s}else this.Wt();if(this.Mt.checkUrlTriggerConditions((()=>this.Ht()),(()=>this.jt()),(t=>this.Ut(t)),this.sessionId),!this.Mt.urlBlocked||(a=t).type===l.Custom&&"recording paused"===a.data.tag){var a,c;if(t.type===l.FullSnapshot)this.Jt(),null==(c=this.ee)||c.reset();t.type===l.FullSnapshot&&this.rt.triggerStatus(this.sessionId)===at&&this.re();var h=this.ee?this.ee.throttleMutations(t):t;if(h){var v=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=[],n=0;n<e.data.payload.payload.length;n++)e.data.payload.payload[n]&&e.data.payload.payload[n].length>2e3?r.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):r.push(e.data.payload.payload[n]);return e.data.payload.payload=r,t}return t}(h),f=function(t){return pe(t)?t.data.payload:null}(v),m=function(t){return ge(t)?t.data.payload:null}(v);if(f||m){var p=null!=f?f:m;null!=p&&p.lastActivityTimestamp&&(v.timestamp=p.lastActivityTimestamp)}else this.ne(v);var g=null!==(e=null!==(r=null==f?void 0:f.currentSessionId)&&void 0!==r?r:null==m?void 0:m.nextSessionId)&&void 0!==e?e:this.V,y=null!==(n=null!==(i=null==f?void 0:f.currentWindowId)&&void 0!==i?i:null==m?void 0:m.nextWindowId)&&void 0!==n?n:this.ht;if(!0!==this.et||function(t){return me(t)||pe(t)||ge(t)}(v)){if(me(v)){var b=v.data.payload;if(b){var C=b.lastActivityTimestamp,w=b.threshold;v.timestamp=C+w}}var S=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:ve(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:ve(t.data.texts),attributes:ve(t.data.attributes),removes:ve(t.data.removes),adds:ve(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?ve(t.data.adds):void 0,removes:t.data.removes?ve(t.data.removes):void 0})})}catch(t){le.error("could not compress event - will use uncompressed event",t)}return t}(v):v,k={$snapshot_bytes:bt(S),$snapshot_data:S,$session_id:g,$window_id:y};this.status!==tt?this.ie(k):this.Bt()}}}}}get status(){return this.ot({receivedFlags:!0,isRecordingEnabled:!0,isSampled:this.K,urlTriggerMatching:this.Mt,eventTriggerMatching:this.Ft,linkedFlagMatching:this._t,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._t.linkedFlagSeen=!0,this.Xt(),this.Pt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[G]:this.sessionId}),this.Xt(),this.Pt("sampling_overridden")}overrideTrigger(t){this.Ut(t)}te(){this.oe&&(clearTimeout(this.oe),this.oe=void 0)}At(){this.te();var t=this.wt();if(this.status===nt||this.status===it||this.status===tt||t)return this.oe=setTimeout((()=>{this.At()}),2e3),this.Ct;this.Ct.data.length>0&&Ie(this.Ct).forEach((t=>{var e;null==(e=this.ft)||e.trackSize(t.size),this.se({$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.Bt()}ie(t){var e,r=2+((null==(e=this.Ct)?void 0:e.data.length)||0),n=t.$session_id;!this.et&&(this.Ct.size+t.$snapshot_bytes+r>943718.4||this.Ct.sessionId!==n)&&(this.Ct=this.At(),this.Ct.sessionId=n,this.Ct.windowId=t.$window_id),this.Ct.size+=t.$snapshot_bytes,this.Ct.data.push(t.$snapshot_data),this.oe||this.et||(this.oe=setTimeout((()=>{this.At()}),2e3))}se(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.P),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get St(){var t,e,r=null==(t=this.Ct)?void 0:t.data[(null==(e=this.Ct)?void 0:e.data.length)-1],{sessionStartTimestamp:n}=this.X.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-n:null}re(){if(!this.Ct||0===this.Ct.data.length)return this.Bt();for(var t=-1,e=this.Ct.data.length-1;e>=0;e--)if(this.Ct.data[e].type===l.Meta){t=e;break}return t>=0?(this.Ct.data=this.Ct.data.slice(t),this.Ct.size=this.Ct.data.reduce(((t,e)=>t+bt(e)),0),this.Ct):this.Bt()}Bt(){return this.Ct={size:0,data:[],sessionId:this.V,windowId:this.ht},this.Ct}Pt(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),le.info(t.replace("_"," "),e),-1===["recording_initialized","session_id_changed"].indexOf(t)&&this.vt(t,e)}ae(t){var e;return 3===t.type&&-1!==de.indexOf(null==(e=t.data)?void 0:e.source)}ne(t){var e=this.ae(t);e||this.et||t.timestamp-this.$>this.J&&(this.et=!0,clearInterval(this.Kt),this.vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.$,threshold:this.J,bufferLength:this.Ct.data.length,bufferSize:this.Ct.size}),this.At());var r=!1;if(e&&(this.$=t.timestamp,this.et)){var n="unknown"===this.et;this.et=!1,n||(this.vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}if(!this.et){var{windowId:i,sessionId:o}=this.X.checkAndGetSessionAndWindowId(!e,t.timestamp),s=this.V!==o,a=this.ht!==i;this.ht=i,this.V=o,s||a?(this.stop(),this.start("session_id_changed")):r&&this.Jt()}}gt(){var t,e,r,n;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(D),null==(e=this._instance)||null==(e=e.persistence)||e.unregister(W),null==(r=this._instance)||null==(r=r.persistence)||r.unregister(G),null==(n=this._instance)||null==(n=n.persistence)||n.unregister(L)}It(t){var e,r=this.V!==t,n=this.H;if(S(n)){var i=this.K,o=r||!k(i),s=o?ie(t,n):i;o&&(s?this.Pt(et):le.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server."),this.vt("samplingDecisionMade",{sampleRate:n,isSampled:s})),null==(e=this._instance.persistence)||e.register({[G]:!!s&&t})}else{var a;null==(a=this._instance.persistence)||a.unregister(G)}}Qt(){0!==this.Ft.T.length&&w(this.it)&&(this.it=this._instance.on("eventCaptured",(t=>{try{this.Ft.T.includes(t.event)&&this.Ut("event")}catch(t){le.error("Could not activate event trigger",t)}})))}get sdkDebugProperties(){var t,{sessionStartTimestamp:e}=this.X.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.Ct.data.length,$sdk_debug_replay_internal_buffer_size:this.Ct.size,$sdk_debug_current_session_duration:this.St,$sdk_debug_session_start:e,$sdk_debug_replay_flushed_size:null==(t=this.ft)?void 0:t.currentTrackedSize}}$t(){var t;if(!this.q){var e,r,n,i={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 i&&("maskInputOptions"===s?i.maskInputOptions=u({password:!0},a):i[s]=a);if(this.xt&&this.xt.enabled&&(i.recordCanvas=!0,i.sampling={canvas:this.xt.fps},i.dataURLOptions={type:"image/webp",quality:this.xt.quality}),this.Ot)i.maskAllInputs=null===(e=this.Ot.maskAllInputs)||void 0===e||e,i.maskTextSelector=null!==(r=this.Ot.maskTextSelector)&&void 0!==r?r:void 0,i.blockSelector=null!==(n=this.Ot.blockSelector)&&void 0!==n?n:void 0;var l=he();if(l){this.ee=null!==(t=this.ee)&&void 0!==t?t:new ne(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";le.info(r,{node:e}),this.log(ue+" "+r,"warn")}});var d=this.Et();this.q=l(u({emit:t=>{this.onRRwebEmit(t)},plugins:d},i)),this.$=Date.now(),this.et=k(this.et)?this.et:"unknown",this.tryAddCustomEvent("$remote_config_received",this.j),this.vt("$session_options",{sessionRecordingOptions:i,activePlugins:d.map((t=>null==t?void 0:t.name))}),this.vt("$posthog_config",{config:this._instance.config})}else le.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.vt(t,e)}}var be,Ce=["type"],we=Object.defineProperty,Se=(t,e,r)=>((t,e,r)=>e in t?we(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ke=Object.defineProperty,Ae=(t,e,r)=>((t,e,r)=>e in t?ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ne=(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))(Ne||{}),Re={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Te={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var _e={};function Me(t){if(_e[t])return _e[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,n=t in Re?Re[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in Te?Te[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(i&&s)return _e[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?_e[t]=l:e.prototype}catch(t){return e.prototype}}var Fe={};function Be(t,e,r){var n,i=t+"."+String(r);if(Fe[i])return Fe[i].call(e);var o=Me(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Fe[i]=s,s.call(e)):e[r]}var Oe={};function xe(t,e,r){var n=t+"."+String(r);if(Oe[n])return Oe[n].bind(e);var i=Me(t)[r];return"function"!=typeof i?e[r]:(Oe[n]=i,i.bind(e))}var Ze={childNodes:function(t){return Be("Node",t,"childNodes")},parentNode:function(t){return Be("Node",t,"parentNode")},parentElement:function(t){return Be("Node",t,"parentElement")},textContent:function(t){return Be("Node",t,"textContent")},contains:function(t,e){return xe("Node",t,"contains")(e)},getRootNode:function(t){return xe("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Be("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Be("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Be("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Be("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Me("MutationObserver").constructor}};function Ye(t){return t.nodeType===t.ELEMENT_NODE}function Ee(t){var e=t&&"host"in t&&"mode"in t&&Ze.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Ze.shadowRoot(e)===t)}function Ge(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function Le(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>We(e,t.href))).join("");return(n=r).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}catch(t){return null}var n}function We(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=Le(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?Qe(r,t.styleSheet.href):r}var n,i=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(n,"$1\\$2")),e?Qe(i,e):i}function De(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let Ve=class{constructor(){Ae(this,"idNodeMap",new Map),Ae(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 n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(e,n)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Xe(t){var{element:e,maskInputOptions:r,tagName:n,type:i,value:o,maskInputFn:s}=t,a=o||"",u=i&&ze(i);return(r[n.toLowerCase()]||u&&r[u])&&(a=s?s(a,e):"*".repeat(a.length)),a}function ze(t){return t.toLowerCase()}var Je="__rrweb_original__";function Ke(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ze(e):null}function He(t,e){var r,n;try{n=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}var je=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ue=/^(?:[a-z+]+:)?\/\//i,Pe=/^www\..*/i,qe=/^(data:)([^,]*),(.*)/i;function Qe(t,e){return(t||"").replace(je,((t,r,n,i,o,s)=>{var a,u=n||o||s,l=r||i||"";if(!u)return t;if(Ue.test(u)||Pe.test(u))return"url("+l+u+l+")";if(qe.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 $e,tr,er=1,rr=new RegExp("[^a-z0-9-_:]"),nr=-2;function ir(){return er++}var or=/^[^ \t\n\r\u000c]+/,sr=/^[, \t\n\r\u000c]+/;var ar=new WeakMap;function ur(t,e){return e&&""!==e.trim()?dr(t,e):e}function lr(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function dr(t,e){var r=ar.get(t);if(r||(r=t.createElement("a"),ar.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function cr(t,e,r,n){return n?"src"===r||"href"===r&&("use"!==e||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?ur(t,n):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function n(t){var n,i=t.exec(e.substring(r));return i?(n=i[0],r+=n.length,n):""}for(var i=[];n(sr),!(r>=e.length);){var o=n(or);if(","===o.slice(-1))o=ur(t,o.substring(0,o.length-1)),i.push(o);else{var s="";o=ur(t,o);for(var a=!1;;){var u=e.charAt(r);if(""===u){i.push((o+s).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,i.push((o+s).trim());break}"("===u&&(a=!0)}s+=u,r+=1}}}return i.join(", ")}(t,n):"style"===r?Qe(n,dr(t)):"object"===e&&"data"===r?ur(t,n):n:ur(t,n):n}function hr(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function vr(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&vr(Ze.parentNode(t),e,r);for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}return!!r&&vr(Ze.parentNode(t),e,r)}function fr(t,e,r,n){var i;if(Ye(t)){if(i=t,!Ze.childNodes(i).length)return!1}else{if(null===Ze.parentElement(t))return!1;i=Ze.parentElement(t)}try{if("string"==typeof e){if(n){if(i.closest("."+e))return!0}else if(i.classList.contains(e))return!0}else if(vr(i,e,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(t){}return!1}function mr(t,e){var{doc:r,mirror:n,blockClass:i,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,n);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:Ne.Document,childNodes:[],compatMode:t.compatMode}:{type:Ne.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Ne.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:p};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:n,blockClass:i,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 n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,i,o),p=function(t){if(t instanceof HTMLFormElement)return"form";var e=ze(t.tagName);return rr.test(e)?"div":e}(t),g={},I=t.attributes.length,y=0;y<I;y++){var b=t.attributes[y];hr(p,b.name,b.value)||(g[b.name]=cr(n,p,ze(b.name),b.value))}if("link"===p&&s){var C=function(t){return null==t?void 0:t.href}(t);if(C){var w=De(n,C);if(!w&&C.includes(".css"))w=De(n,window.location.origin+"/"+C.replace(window.location.href,""));var S=null;w&&(S=Le(w)),S&&(delete g.rel,delete g.href,g._cssText=S)}}if("style"===p&&t.sheet&&!(t.innerText||Ze.textContent(t)||"").trim().length){var k=Le(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=Xe({element:t,type:Ke(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 n=0;n<t.height;n+=50){var i=e.getImageData,o=Je in i?i[Je]:i;if(new Uint32Array(o.call(e,r,n,Math.min(50,t.width-r),Math.min(50,t.height-n)).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=n.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){$e||($e=n.createElement("canvas"),tr=$e.getContext("2d"));var _=t,M=_.currentSrc||_.getAttribute("src")||"<unknown-src>",F=_.crossOrigin,B=()=>{_.removeEventListener("load",B);try{$e.width=_.naturalWidth,$e.height=_.naturalHeight,tr.drawImage(_,0,0),g.rr_dataURL=$e.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 O=g;O.rr_mediaState=t.paused?"paused":"played",O.rr_mediaCurrentTime=t.currentTime,O.rr_mediaPlaybackRate=t.playbackRate,O.rr_mediaMuted=t.muted,O.rr_mediaLoop=t.loop,O.rr_mediaVolume=t.volume}v||(t.scrollLeft&&(g.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(g.rr_scrollTop=t.scrollTop));if(m){var{width:x,height:Z}=t.getBoundingClientRect();g={class:g.class,rr_width:x+"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:Ne.Element,tagName:p,attributes:g,childNodes:[],isSVG:lr(t)||void 0,needBlock:m,rootId:f,isCustom:r}}(t,{doc:r,blockClass:i,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:n,maskTextFn:i,rootId:o}=e,s=Ze.parentNode(t),a=s&&s.tagName,u=Ze.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=Le(s.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=Qe(u,dr(e.doc))}d&&(u="SCRIPT_PLACEHOLDER");!l&&!d&&u&&n&&(u=i?i(u,Ze.parentElement(t)):u.replace(/[\S]/g,"*"));return{type:Ne.Text,textContent:u||"",isStyle:l,rootId:o}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:p});case t.CDATA_SECTION_NODE:return{type:Ne.CDATA,textContent:"",rootId:p};case t.COMMENT_NODE:return{type:Ne.Comment,textContent:Ze.textContent(t)||"",rootId:p};default:return!1}}function pr(t){return null==t?"":t.toLowerCase()}function gr(t,e){var{doc:r,mirror:n,blockClass:i,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=fr(t,s,a,void 0===k));var N,R=mr(t,{doc:r,mirror:n,blockClass:i,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=n.hasNode(t)?n.getId(t):!function(t,e){if(e.comment&&t.type===Ne.Comment)return!0;if(t.type===Ne.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"===He(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(pr(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===pr(t.attributes.name)||"icon"===pr(t.attributes.rel)||"apple-touch-icon"===pr(t.attributes.rel)||"shortcut icon"===pr(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&pr(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(pr(t.attributes.property).match(/^(og|twitter|fb):/)||pr(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===pr(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===pr(t.attributes.name)||"googlebot"===pr(t.attributes.name)||"bingbot"===pr(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===pr(t.attributes.name)||"generator"===pr(t.attributes.name)||"framework"===pr(t.attributes.name)||"publisher"===pr(t.attributes.name)||"progid"===pr(t.attributes.name)||pr(t.attributes.property).match(/^article:/)||pr(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===pr(t.attributes.name)||"yandex-verification"===pr(t.attributes.name)||"csrf-token"===pr(t.attributes.name)||"p:domain_verify"===pr(t.attributes.name)||"verify-v1"===pr(t.attributes.name)||"verification"===pr(t.attributes.name)||"shopify-checkout-api-token"===pr(t.attributes.name)))return!0}}return!1}(R,v)&&(A||R.type!==Ne.Text||R.isStyle||R.textContent.replace(/^\s+|\s+$/gm,"").length)?ir():nr;var T=Object.assign(R,{id:N});if(n.add(t,T),N===nr)return null;g&&g(t);var _=!u;if(T.type===Ne.Element){_=_&&!T.needBlock,delete T.needBlock;var M=Ze.shadowRoot(t);M&&Ge(M)&&(T.isShadowHost=!0)}if((T.type===Ne.Document||T.type===Ne.Element)&&_){v.headWhitespace&&T.type===Ne.Element&&"head"===T.tagName&&(A=!1);var F={doc:r,mirror:n,blockClass:i,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===Ne.Element&&"textarea"===T.tagName&&void 0!==T.attributes.value);else for(var B of Array.from(Ze.childNodes(t))){var O=gr(B,F);O&&T.childNodes.push(O)}var x=null;if(Ye(t)&&(x=Ze.shadowRoot(t)))for(var Z of Array.from(Ze.childNodes(x))){var Y=gr(Z,F);Y&&(Ge(x)&&(Y.isShadow=!0),T.childNodes.push(Y))}}var E=Ze.parentNode(t);return E&&Ee(E)&&Ge(E)&&(T.isShadow=!0),T.type===Ne.Element&&"iframe"===T.tagName&&function(t,e,r){var n=t.contentWindow;if(n){var i,o=!1;try{i=n.document.readyState}catch(t){return}if("complete"===i){var s="about:blank";if(n.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=gr(e,{doc:e,mirror:n,blockClass:i,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===Ne.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===He(T.attributes.href))&&function(t,e,r){var n,i=!1;try{n=t.sheet}catch(t){return}if(!n){var o=setTimeout((()=>{i||(e(),i=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),i=!0,e()}))}}(t,(()=>{if(b){var e=gr(t,{doc:r,mirror:n,blockClass:i,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 Ir=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 yr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},br={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var Cr={};function wr(t){if(Cr[t])return Cr[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,n=t in yr?yr[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in br?br[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(i&&s)return Cr[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?Cr[t]=l:r}catch(t){return r}}var Sr={};function kr(t,e,r){var n,i=t+"."+String(r);if(Sr[i])return Sr[i].call(e);var o=wr(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Sr[i]=s,s.call(e)):e[r]}var Ar={};function Nr(t,e,r){var n=t+"."+String(r);if(Ar[n])return Ar[n].bind(e);var i=wr(t)[r];return"function"!=typeof i?e[r]:(Ar[n]=i,i.bind(e))}function Rr(){return wr("MutationObserver").constructor}var Tr={childNodes:function(t){return kr("Node",t,"childNodes")},parentNode:function(t){return kr("Node",t,"parentNode")},parentElement:function(t){return kr("Node",t,"parentElement")},textContent:function(t){return kr("Node",t,"textContent")},contains:function(t,e){return Nr("Node",t,"contains")(e)},getRootNode:function(t){return Nr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?kr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?kr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return kr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return kr("Element",t,"querySelectorAll")(e)},mutationObserver:Rr};function _r(t,e,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)}var Mr="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.",Fr={map:{},getId:()=>(console.error(Mr),-1),getNode:()=>(console.error(Mr),null),removeNodeFromMap(){console.error(Mr)},has:()=>(console.error(Mr),!1),reset(){console.error(Mr)}};function Br(t,e,r){void 0===r&&(r={});var n=null,i=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();i||!1!==r.leading||(i=u);var l=e-(u-i),d=this;l<=0||l>e?(n&&(clearTimeout(n),n=null),i=u,t.apply(d,s)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,t.apply(d,s)}),l))}}function Or(t,e,r,n,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,n?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>Or(t,e,o||{},!0)}function xr(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),t[e]=i,()=>{t[e]=n}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Fr=new Proxy(Fr,{get:(t,e,r)=>("map"===e&&console.error(Mr),Reflect.get(t,e,r))}));var Zr=Date.now;function Yr(t){var e,r,n,i,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=Tr.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==(n=Tr.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function Er(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Gr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Lr(t){return t?t.nodeType===t.ELEMENT_NODE?t:Tr.parentElement(t):null}function Wr(t,e,r,n){if(!t)return!1;var i=Lr(t);if(!i)return!1;try{if("string"==typeof e){if(i.classList.contains(e))return!0;if(n&&null!==i.closest("."+e))return!0}else if(vr(i,e,n))return!0}catch(t){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function Dr(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===nr}function Vr(t,e){if(Ee(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var n=Tr.parentNode(t);return(!n||n.nodeType!==t.DOCUMENT_NODE)&&(!n||Vr(n,e))}function Xr(t){return Boolean(t.changedTouches)}function zr(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Jr(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Kr(t){return!!t&&(t instanceof Ir&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Tr.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Zr=()=>(new Date).getTime());let Hr=class{constructor(){Se(this,"id",1),Se(this,"styleIDMap",new WeakMap),Se(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 jr(t){var e,r=null;return"getRootNode"in t&&(null==(e=Tr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Tr.host(Tr.getRootNode(t))&&(r=Tr.host(Tr.getRootNode(t))),r}function Ur(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=jr(r);)r=e;return r}(t);return Tr.contains(e,r)}function Pr(t){var e=t.ownerDocument;return!!e&&(Tr.contains(e,t)||Ur(t))}var qr=(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))(qr||{}),Qr=(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))(Qr||{}),$r=(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))($r||{}),tn=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(tn||{}),en=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(en||{}),rn=(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))(rn||{});function nn(t){return"__ln"in t}class on{constructor(){Se(this,"length",0),Se(this,"head",null),Se(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&&nn(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&&nn(t.nextSibling)&&t.nextSibling.__ln.previous){var n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.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 sn,an=(t,e)=>t+"@"+e;class un{constructor(){Se(this,"frozen",!1),Se(this,"locked",!1),Se(this,"texts",[]),Se(this,"attributes",[]),Se(this,"attributeMap",new WeakMap),Se(this,"removes",[]),Se(this,"mapRemoves",[]),Se(this,"movedMap",{}),Se(this,"addedSet",new Set),Se(this,"movedSet",new Set),Se(this,"droppedSet",new Set),Se(this,"mutationCb"),Se(this,"blockClass"),Se(this,"blockSelector"),Se(this,"maskTextClass"),Se(this,"maskTextSelector"),Se(this,"inlineStylesheet"),Se(this,"maskInputOptions"),Se(this,"maskTextFn"),Se(this,"maskInputFn"),Se(this,"keepIframeSrcFn"),Se(this,"recordCanvas"),Se(this,"inlineImages"),Se(this,"slimDOMOptions"),Se(this,"dataURLOptions"),Se(this,"doc"),Se(this,"mirror"),Se(this,"iframeManager"),Se(this,"stylesheetManager"),Se(this,"shadowDomManager"),Se(this,"canvasManager"),Se(this,"processedNodeManager"),Se(this,"unattachedDoc"),Se(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),Se(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new on,n=t=>{for(var e=t,r=nr;r===nr;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},i=i=>{var o=Tr.parentNode(i);if(o&&Pr(i)&&"TEXTAREA"!==o.tagName){var s=Ee(o)?this.mirror.getId(jr(i)):this.mirror.getId(o),a=n(i);if(-1===s||-1===a)return r.addNode(i);var u=gr(i,{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=>{zr(t,this.mirror)&&this.iframeManager.addIframe(t),Jr(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Kr(i)&&this.shadowDomManager.addShadowRoot(Tr.shadowRoot(i),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)dn(this.removes,o,this.mirror)&&!this.movedSet.has(Tr.parentNode(o))||i(o);for(var s of this.addedSet)cn(this.droppedSet,s)||dn(this.removes,s,this.mirror)?cn(this.movedSet,s)?i(s):this.droppedSet.add(s):i(s);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(Tr.parentNode(a.value)),d=n(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(Tr.parentNode(h.value));if(-1===n(h.value))continue;if(-1!==v){u=h;break}var f=h.value,m=Tr.parentNode(f);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=Tr.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),i(u.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=Tr.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),n=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+n).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))}})),Se(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(Tr.childNodes(t),(t=>Tr.textContent(t)||"")).join("")})),Se(this,"processMutation",(t=>{if(!Dr(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=Tr.textContent(t.target);Wr(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:fr(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Lr(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,n=t.attributeName,i=t.target.getAttribute(n);if("value"===n){var o=Ke(r);i=Xe({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(Wr(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;var s=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(r.contentDocument)return;n="rr_src"}if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),"type"===n&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!hr(r.tagName,n))if(s.attributes[n]=cr(this.doc,ze(r.tagName),ze(n),i),"style"===n){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"===n&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(Wr(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),n=Ee(t.target)?this.mirror.getId(Tr.host(t.target)):this.mirror.getId(t.target);Wr(t.target,this.blockClass,this.blockSelector,!1)||Dr(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(ln(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Vr(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[an(r,n)]?ln(this.movedSet,e):this.removes.push({parentId:n,id:r,isShadow:!(!Ee(t.target)||!Ge(t.target))||void 0})),this.mapRemoves.push(e))}))}})),Se(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Dr(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[an(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Wr(t,this.blockClass,this.blockSelector,!1)||(Tr.childNodes(t).forEach((t=>this.genAdds(t))),Kr(t)&&Tr.childNodes(Tr.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 ln(t,e){t.delete(e),Tr.childNodes(e).forEach((e=>ln(t,e)))}function dn(t,e,r){return 0!==t.length&&function(t,e,r){var n,i=Tr.parentNode(e),o=function(){var e=r.getId(i);if(t.some((t=>t.id===e)))return{v:!0};i=Tr.parentNode(i)};for(;i;)if(n=o())return n.v;return!1}(t,e,r)}function cn(t,e){return 0!==t.size&&hn(t,e)}function hn(t,e){var r=Tr.parentNode(e);return!!r&&(!!t.has(r)||hn(t,r))}var vn=t=>{if(!sn)return t;return function(){try{return t(...arguments)}catch(t){if(sn&&!0===sn(t))return;throw t}}},fn=[];function mn(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 pn(t,e){var r=new un;fn.push(r),r.init(t);var n=new(Rr())(vn(r.processMutations.bind(r)));return n.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function gn(t){var{mouseInteractionCb:e,doc:r,mirror:n,blockClass:i,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($r).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t])).forEach((t=>{var s=ze(t),a=(t=>r=>{var s=mn(r);if(!Wr(s,i,o,!0)){var a=null,l=t;if("pointerType"in r){switch(r.pointerType){case"mouse":a=tn.Mouse;break;case"touch":a=tn.Touch;break;case"pen":a=tn.Pen}a===tn.Touch?$r[t]===$r.MouseDown?l="TouchStart":$r[t]===$r.MouseUp&&(l="TouchEnd"):tn.Pen}else Xr(r)&&(a=tn.Touch);null!==a?(d=a,(l.startsWith("Touch")&&a===tn.Touch||l.startsWith("Mouse")&&a===tn.Mouse)&&(a=null)):$r[t]===$r.Click&&(a=d,d=null);var c=Xr(r)?r.changedTouches[0]:r;if(c){var h=n.getId(s),{clientX:v,clientY:f}=c;vn(e)(u({type:$r[l],id:h,x:v,y:f},null!==a&&{pointerType:a}))}}})(t);if(window.PointerEvent)switch($r[t]){case $r.MouseDown:case $r.MouseUp:s=s.replace("mouse","pointer");break;case $r.TouchStart:case $r.TouchEnd:return}l.push(_r(s,a,r))})),vn((()=>{l.forEach((t=>t()))}))}function In(t){var{scrollCb:e,doc:r,mirror:n,blockClass:i,blockSelector:o,sampling:s}=t;return _r("scroll",vn(Br(vn((t=>{var s=mn(t);if(s&&!Wr(s,i,o,!0)){var a=n.getId(s);if(s===r&&r.defaultView){var u=Yr(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 yn=["INPUT","TEXTAREA","SELECT"],bn=new WeakMap;function Cn(t){return function(t,e){if(An("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||An("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||An("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||An("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(n)}return e}(t,[])}function wn(t,e,r){var n,i;return t?(t.ownerNode?n=e.getId(t.ownerNode):i=r.getId(t),{styleId:i,id:n}):{}}function Sn(t,e){var r,n,i,{mirror:o,stylesheetManager:s}=t,a=null;a="#document"===e.nodeName?o.getId(e):o.getId(Tr.host(e));var u="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(i=null==(n=e.ownerDocument)?void 0:n.defaultView)?void 0:i.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}}),vn((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function kn(t,e){void 0===e&&(e={});var r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,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),n(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),i(...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=pn(t,t.doc));var i=function(t){var{mousemoveCb:e,sampling:r,doc:n,mirror:i}=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=Br(vn((t=>{var r=Date.now()-o;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],o=null})),a),d=vn(Br(vn((t=>{var e=mn(t),{clientX:r,clientY:n}=Xr(t)?t.changedTouches[0]:t;o||(o=Zr()),u.push({x:r,y:n,id:i.getId(e),timeOffset:Zr()-o}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Qr.Drag:t instanceof MouseEvent?Qr.MouseMove:Qr.TouchMove)})),s,{trailing:!1})),c=[_r("mousemove",d,n),_r("touchmove",d,n),_r("drag",d,n)];return vn((()=>{c.forEach((t=>t()))}))}(t),o=gn(t),s=In(t),a=function(t,e){var{viewportResizeCb:r}=t,{win:n}=e,i=-1,o=-1;return _r("resize",vn(Br(vn((()=>{var t=Er(),e=Gr();i===t&&o===e||(r({width:Number(e),height:Number(t)}),i=t,o=e)})),200)),n)}(t,{win:n}),l=function(t){var{inputCb:e,doc:r,mirror:n,blockClass:i,blockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:d,sampling:c,userTriggeredOnInput:h}=t;function v(t){var e=mn(t),n=t.isTrusted,u=e&&e.tagName;if(e&&"OPTION"===u&&(e=Tr.parentElement(e)),e&&u&&!(yn.indexOf(u)<0)&&!Wr(e,i,o,!0)&&!(e.classList.contains(s)||a&&e.matches(a))){var c=e.value,v=!1,m=Ke(e)||"";"radio"===m||"checkbox"===m?v=e.checked:(l[u.toLowerCase()]||l[m])&&(c=Xe({element:e,maskInputOptions:l,tagName:u,type:m,value:c,maskInputFn:d})),f(e,h?{text:c,isChecked:v,userTriggered:n}:{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 i=bn.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){bn.set(t,r);var o=n.getId(t);vn(e)(u({},r,{id:o}))}}var m=("last"===c.input?["change"]:["input","change"]).map((t=>_r(t,vn(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=>Or(t[0],t[1],{set(){vn(v)({target:this,isTrusted:!1})}},!1,p)))),vn((()=>{m.forEach((t=>t()))}))}(t),d=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:n,mirror:i,sampling:o,doc:s}=t,a=vn((t=>Br(vn((o=>{var s=mn(o);if(s&&!Wr(s,r,n,!0)){var{currentTime:a,volume:u,muted:l,playbackRate:d,loop:c}=s;e({type:t,id:i.getId(s),currentTime:a,volume:u,muted:l,playbackRate:d,loop:c})}})),o.media||500))),u=[_r("play",a(rn.Play),s),_r("pause",a(rn.Pause),s),_r("seeked",a(rn.Seeked),s),_r("volumechange",a(rn.VolumeChange),s),_r("ratechange",a(rn.RateChange),s)];return vn((()=>{u.forEach((t=>t()))}))}(t),c=()=>{},h=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:n,stylesheetManager:i}=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:vn(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=wn(e,n,i.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 n=t+" { "+e+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};var a,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:vn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=wn(e,n,i.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:vn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=wn(e,n,i.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:vn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=wn(e,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:s}),t.apply(e,o)}))}));var d={};Nn("CSSGroupingRule")?d.CSSGroupingRule=o.CSSGroupingRule:(Nn("CSSMediaRule")&&(d.CSSMediaRule=o.CSSMediaRule),Nn("CSSConditionRule")&&(d.CSSConditionRule=o.CSSConditionRule),Nn("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:vn(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=wn(e.parentStyleSheet,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:[...Cn(e),a||0]}]}),t.apply(e,o)}))}),o.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:vn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=wn(e.parentStyleSheet,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...Cn(e),s]}]}),t.apply(e,o)}))})})),vn((()=>{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:n}),h=Sn(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:n,ignoreCSSAttributes:i,stylesheetManager:o}=t,{win:s}=e,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:vn(((t,e,s)=>{var u,[l,d,c]=s;if(i.has(l))return a.apply(e,[l,d,c]);var{id:h,styleId:v}=wn(null==(u=e.parentRule)?void 0:u.parentStyleSheet,n,o.styleMirror);return(h&&-1!==h||v&&-1!==v)&&r({id:h,styleId:v,set:{property:l,value:d,priority:c},index:Cn(e.parentRule)}),t.apply(e,s)}))});var u=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:vn(((t,e,s)=>{var a,[l]=s;if(i.has(l))return u.apply(e,[l]);var{id:d,styleId:c}=wn(null==(a=e.parentRule)?void 0:a.parentStyleSheet,n,o.styleMirror);return(d&&-1!==d||c&&-1!==c)&&r({id:d,styleId:c,remove:{property:l},index:Cn(e.parentRule)}),t.apply(e,s)}))}),vn((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,n=r.defaultView;if(!n)return()=>{};var i=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(t,e,r){var n=new s(t,e,r);return o.set(n,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),n};var a=xr(r.fonts,"add",(function(t){return function(r){return setTimeout(vn((()=>{var t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return i.push((()=>{n.FontFace=s})),i.push(a),vn((()=>{i.forEach((t=>t()))}))}(t)));var m=function(t){var{doc:e,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=t,s=!0,a=vn((()=>{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;Wr(c,n,i,!0)||Wr(v,n,i,!0)||a.push({start:r.getId(c),startOffset:h,end:r.getId(v),endOffset:f})}o({ranges:a})}}));return a(),_r("selectionchange",a)}(t),p=function(t){var{doc:e,customElementCb:r}=t,n=e.defaultView;return n&&n.customElements?xr(n.customElements,"define",(function(t){return function(e,n,i){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,n,i])}})):()=>{}}(t),g=[];for(var I of t.plugins)g.push(I.observer(I.callback,n,I.options));return vn((()=>{fn.forEach((t=>t.reset())),null==r||r.disconnect(),i(),o(),s(),a(),l(),d(),c(),h(),v(),f(),m(),p(),g.forEach((t=>t()))}))}function An(t){return void 0!==window[t]}function Nn(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Rn{constructor(t){Se(this,"iframeIdToRemoteIdMap",new WeakMap),Se(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,n){var i=r||this.getIdToRemoteIdMap(t),o=n||this.getRemoteIdToIdMap(t),s=i.get(e);return s||(s=this.generateIdFn(),i.set(e,s),o.set(s,e)),s}getIds(t,e){var r=this.getIdToRemoteIdMap(t),n=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,n)))}getRemoteId(t,e,r){var n=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var i=n.get(e);return i||-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 Tn{constructor(t){Se(this,"iframes",new WeakMap),Se(this,"crossOriginIframeMap",new WeakMap),Se(this,"crossOriginIframeMirror",new Rn(ir)),Se(this,"crossOriginIframeStyleMirror"),Se(this,"crossOriginIframeRootIdMap",new WeakMap),Se(this,"mirror"),Se(this,"mutationCb"),Se(this,"wrappedEmit"),Se(this,"loadListener"),Se(this,"stylesheetManager"),Se(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Rn(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,n;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==(n=this.loadListener)||n.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 n=this.transformCrossOriginEvent(r,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case qr.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),{timestamp:e.timestamp,type:qr.IncrementalSnapshot,data:{source:Qr.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case qr.Meta:case qr.Load:case qr.DomContentLoaded:return!1;case qr.Plugin:return e;case qr.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case qr.IncrementalSnapshot:switch(e.data.source){case Qr.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 Qr.Drag:case Qr.TouchMove:case Qr.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Qr.ViewportResize:return!1;case Qr.MediaInteraction:case Qr.MouseInteraction:case Qr.Scroll:case Qr.CanvasMutation:case Qr.Input:return this.replaceIds(e.data,t,["id"]),e;case Qr.StyleSheetRule:case Qr.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Qr.Font:return e;case Qr.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Qr.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,n){for(var i of n)(Array.isArray(e[i])||"number"==typeof e[i])&&(Array.isArray(e[i])?e[i]=t.getIds(r,e[i]):e[i]=t.getId(r,e[i]));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===Ne.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class _n{constructor(t){Se(this,"shadowDoms",new WeakSet),Se(this,"mutationCb"),Se(this,"scrollCb"),Se(this,"bypassOptions"),Se(this,"mirror"),Se(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(Ge(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var r=pn(u({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(In(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(Tr.host(t))),this.restoreHandlers.push(Sn({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(xr(t.prototype,"attachShadow",(function(t){return function(n){var i=t.call(this,n),o=Tr.shadowRoot(this);return o&&Pr(this)&&r.addShadowRoot(o,e),i}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Mn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Bn=0;Bn<64;Bn++)Fn[Mn.charCodeAt(Bn)]=Bn;var On=new Map;var xn=(t,e,r)=>{if(t&&(En(t,e)||"object"==typeof t)){var n=function(t,e){var r=On.get(t);return r||(r=new Map,On.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),i=n.indexOf(t);return-1===i&&(i=n.length,n.push(t)),i}};function Zn(t,e,r){if(t instanceof Array)return t.map((t=>Zn(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),n=r.length,i="";for(e=0;e<n;e+=3)i+=Mn[r[e]>>2],i+=Mn[(3&r[e])<<4|r[e+1]>>4],i+=Mn[(15&r[e+1])<<2|r[e+2]>>6],i+=Mn[63&r[e+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Zn(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var n=t.constructor.name,{src:i}=t;return{rr_type:n,src:i}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[Zn(t.data,e,r),t.width,t.height]}:En(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:xn(t,e,r)}:t}var Yn=(t,e,r)=>t.map((t=>Zn(t,e,r))),En=(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 Gn(t,e,r,n){var i=[];try{var o=xr(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!Wr(this,e,r,!0)){var u=function(t){return"experimental-webgl"===t?"webgl":t}(i);if("__context"in this||(this.__context=u),n&&["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,[i,...s])}}));i.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((t=>t()))}}function Ln(t,e,r,n,i,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=xr(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(xn(d,o,this),"tagName"in this.canvas&&!Wr(this.canvas,n,i,!0)){var c=Yn(u,o,this),h={type:e,property:a,args:c};r(this.canvas,h)}return d}}));s.push(u)}catch(n){var l=Or(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 Wn,Dn,Vn,Xn,zn="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Jn="undefined"!=typeof window&&window.Blob&&new Blob([(Wn=zn,Uint8Array.from(atob(Wn),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Kn(t){var e;try{if(!(e=Jn&&(window.URL||window.webkitURL).createObjectURL(Jn)))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,"+zn,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Hn{constructor(t){Se(this,"pendingCanvasMutations",new Map),Se(this,"rafStamps",{latestId:0,invokeId:null}),Se(this,"mirror"),Se(this,"mutationCb"),Se(this,"resetObservers"),Se(this,"frozen",!1),Se(this,"locked",!1),Se(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:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,n,i,{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,n,i){var o=this,s=Gn(e,r,n,!0),u=new Map,l=new Kn;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:n,width:i,height:o}=t.data;this.mutationCb({id:e,type:en["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},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=>{Wr(t,r,n,!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 n=t.getContext(t.__context);!1===(null==(e=null==n?void 0:n.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&n.clear(n.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:i.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 n=Gn(t,e,r,!1),i=function(t,e,r,n){var i=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=xr(e.CanvasRenderingContext2D.prototype,o,(function(i){return function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return Wr(this.canvas,r,n,!0)||setTimeout((()=>{var r=Yn(a,e,this);t(this.canvas,{type:en["2D"],property:o,args:r})}),0),i.apply(this,a)}}));i.push(s)}catch(r){var a=Or(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:en["2D"],property:o,args:[e],setter:!0})}});i.push(a)}};for(var a of o)s(a);return()=>{i.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),o=function(t,e,r,n){var i=[];return i.push(...Ln(e.WebGLRenderingContext.prototype,en.WebGL,t,r,n,e)),void 0!==e.WebGL2RenderingContext&&i.push(...Ln(e.WebGL2RenderingContext.prototype,en.WebGL2,t,r,n,e)),()=>{i.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{n(),i(),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 n=r.map((t=>{var e=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,Ce);return e})),{type:i}=r[0];this.mutationCb({id:e,type:i,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class jn{constructor(t){Se(this,"trackedLinkElements",new WeakSet),Se(this,"mutationCb"),Se(this,"adoptedStyleSheetCb"),Se(this,"styleMirror",new Hr),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 n={id:e,styleIds:[]},i=[],o=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),i.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:We(e,t.href),index:r})))})),n.styleIds.push(e)};for(var s of t)o(s);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Un{constructor(){Se(this,"nodeMap",new WeakMap),Se(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 Pn=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var qn=document.createElement("iframe");document.body.appendChild(qn),Array.from=(null==(be=qn.contentWindow)?void 0:be.Array.from)||Array.from,document.body.removeChild(qn)}}catch(t){console.debug("Unable to override Array.from",t)}var Qn,$n,ti=new Ve;function ei(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="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;sn=B;var O=!k||window.parent===window,x=!1;if(!O)try{window.parent.document&&(x=!1)}catch(t){x=!0}if(O&&!e)throw new Error("emit function is required");if(!O&&!x)return()=>{};void 0!==C&&void 0===y.mousemove&&(y.mousemove=C),ti.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&&!x&&(t=I(t)),t};Dn=(t,i)=>{var o,s=t;if(s.timestamp=Zr(),!(null==(o=fn[0])?void 0:o.isFrozen())||s.type===qr.FullSnapshot||s.type===qr.IncrementalSnapshot&&s.data.source===Qr.Mutation||fn.forEach((t=>t.unfreeze())),O)null==e||e(L(s),i);else if(x){var a={type:"rrweb",event:L(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(s.type===qr.FullSnapshot)Z=s,G=0;else if(s.type===qr.IncrementalSnapshot){if(s.data.source===Qr.Mutation&&s.data.isAttachIframe)return;G++;var u=n&&G>=n,l=r&&s.timestamp-Z.timestamp>r;(u||l)&&Vn(!0)}};var W=t=>{Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.Mutation},t)})},D=t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.Scroll},t)}),V=t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.CanvasMutation},t)}),X=new jn({mutationCb:W,adoptedStyleSheetCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.AdoptedStyleSheet},t)})}),z=new Tn({mirror:ti,mutationCb:W,stylesheetManager:X,recordCrossOriginIframes:k,wrappedEmit:Dn});for(var J of _||[])J.getMirror&&J.getMirror({nodeMirror:ti,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});var K=new Un;Xn=new Hn({recordCanvas:S,mutationCb:V,win:window,blockClass:i,blockSelector:o,mirror:ti,sampling:y.canvas,dataURLOptions:b});var H=new _n({mutationCb:W,scrollCb:D,bypassOptions:{blockClass:i,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:Xn,keepIframeSrcFn:M,processedNodeManager:K},mirror:ti});Vn=function(t){if(void 0===t&&(t=!1),w){Dn({type:qr.Meta,data:{href:window.location.href,width:Gr(),height:Er()}},t),X.reset(),H.init(),fn.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new Ve,blockClass:n="rr-block",blockSelector:i=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 gr(t,{doc:t,mirror:r,blockClass:n,blockSelector:i,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:ti,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:d,inlineStylesheet:c,maskAllInputs:Y,maskTextFn:p,maskInputFn:m,slimDOM:E,dataURLOptions:b,recordCanvas:S,inlineImages:T,onSerialize:t=>{zr(t,ti)&&z.addIframe(t),Jr(t,ti)&&X.trackLinkElement(t),Kr(t)&&H.addShadowRoot(Tr.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");Dn({type:qr.FullSnapshot,data:{node:e,initialOffset:Yr(window)}},t),fn.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&X.adoptStyleSheets(document.adoptedStyleSheets,ti.getId(document))}};try{var j=[],U=t=>{var e;return vn(kn)({mutationCb:W,mousemoveCb:(t,e)=>Dn({type:qr.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.MouseInteraction},t)}),scrollCb:D,viewportResizeCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.ViewportResize},t)}),inputCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.Input},t)}),mediaInteractionCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.MediaInteraction},t)}),styleSheetRuleCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.StyleSheetRule},t)}),styleDeclarationCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.Font},t)}),selectionCb:t=>{Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.Selection},t)})},customElementCb:t=>{Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.CustomElement},t)})},blockClass:i,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:ti,iframeManager:z,stylesheetManager:X,shadowDomManager:H,processedNodeManager:K,canvasManager:Xn,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=>Dn({type:qr.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},g)};z.addLoadListener((t=>{try{j.push(U(t.contentDocument))}catch(t){console.warn(t)}}));var P=()=>{Vn(),j.push(U(document)),Pn=!0};return"interactive"===document.readyState||"complete"===document.readyState?P():(j.push(_r("DOMContentLoaded",(()=>{Dn({type:qr.DomContentLoaded,data:{}}),"DOMContentLoaded"===A&&P()}))),j.push(_r("load",(()=>{Dn({type:qr.Load,data:{}}),"load"===A&&P()}),window))),()=>{j.forEach((t=>t())),K.destroy(),Pn=!1,sn=void 0}}catch(t){console.warn(t)}}ei.addCustomEvent=(t,e)=>{if(!Pn)throw new Error("please add custom event after start recording");Dn({type:qr.Custom,data:{tag:t,payload:e}})},ei.freezePage=()=>{fn.forEach((t=>t.freeze()))},ei.takeFullSnapshot=t=>{if(!Pn)throw new Error("please take full snapshot after start recording");Vn(t)},ei.mirror=ti,($n=Qn||(Qn={}))[$n.NotStarted=0]="NotStarted",$n[$n.Running=1]="Running",$n[$n.Stopped=2]="Stopped";var ri,ni=Object.defineProperty,ii=(t,e,r)=>((t,e,r)=>e in t?ni(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),oi=Object.defineProperty,si=(t,e,r)=>((t,e,r)=>e in t?oi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ai=Object.defineProperty,ui=(t,e,r)=>((t,e,r)=>e in t?ai(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),li={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},di={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ci={};function hi(t){if(ci[t])return ci[t];var e=globalThis[t],r=e.prototype,n=t in li?li[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in di?di[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(i&&s)return ci[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?ci[t]=l:r}catch(t){return r}}var vi={};function fi(t,e,r){var n,i=t+"."+String(r);if(vi[i])return vi[i].call(e);var o=hi(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(vi[i]=s,s.call(e)):e[r]}var mi={};function pi(t,e,r){var n=t+"."+String(r);if(mi[n])return mi[n].bind(e);var i=hi(t)[r];return"function"!=typeof i?e[r]:(mi[n]=i,i.bind(e))}var gi={childNodes:function(t){return fi("Node",t,"childNodes")},parentNode:function(t){return fi("Node",t,"parentNode")},parentElement:function(t){return fi("Node",t,"parentElement")},textContent:function(t){return fi("Node",t,"textContent")},contains:function(t,e){return pi("Node",t,"contains")(e)},getRootNode:function(t){return pi("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?fi("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?fi("Element",t,"shadowRoot"):null},querySelector:function(t,e){return fi("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return fi("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return hi("MutationObserver").constructor}};class Ii{constructor(){ui(this,"idNodeMap",new Map),ui(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 n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(e,n)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function yi(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&yi(gi.parentNode(t),e,r);for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}return!!r&&yi(gi.parentNode(t),e,r)}class bi{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 bi))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 Ci={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},wi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Si={};function ki(t){if(Si[t])return Si[t];var e=globalThis[t],r=e.prototype,n=t in Ci?Ci[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in wi?wi[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(i&&s)return Si[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?Si[t]=l:r}catch(t){return r}}var Ai={};function Ni(t,e,r){var n,i=t+"."+String(r);if(Ai[i])return Ai[i].call(e);var o=ki(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Ai[i]=s,s.call(e)):e[r]}var Ri={};function Ti(t,e,r){var n=t+"."+String(r);if(Ri[n])return Ri[n].bind(e);var i=ki(t)[r];return"function"!=typeof i?e[r]:(Ri[n]=i,i.bind(e))}var _i={childNodes:function(t){return Ni("Node",t,"childNodes")},parentNode:function(t){return Ni("Node",t,"parentNode")},parentElement:function(t){return Ni("Node",t,"parentElement")},textContent:function(t){return Ni("Node",t,"textContent")},contains:function(t,e){return Ti("Node",t,"contains")(e)},getRootNode:function(t){return Ti("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ni("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ni("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ni("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ni("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return ki("MutationObserver").constructor}};var Mi="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.",Fi={map:{},getId:()=>(console.error(Mi),-1),getNode:()=>(console.error(Mi),null),removeNodeFromMap(){console.error(Mi)},has:()=>(console.error(Mi),!1),reset(){console.error(Mi)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Fi=new Proxy(Fi,{get:(t,e,r)=>("map"===e&&console.error(Mi),Reflect.get(t,e,r))}));var Bi=Date.now;function Oi(t){return t?t.nodeType===t.ELEMENT_NODE?t:_i.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(Bi=()=>(new Date).getTime());function xi(t){var e,r=null;return"getRootNode"in t&&(null==(e=_i.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&_i.host(_i.getRootNode(t))&&(r=_i.host(_i.getRootNode(t))),r}function Zi(t){for(var e,r=t;e=xi(r);)r=e;return r}function Yi(t){var e=t.ownerDocument;if(!e)return!1;var r=Zi(t);return _i.contains(e,r)}for(var Ei=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){si(this,"id",1),si(this,"styleIDMap",new WeakMap),si(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 Fi},closestElementOfNode:Oi,getBaseDimension:function t(e,r){var n,i,o=null==(i=null==(n=e.ownerDocument)?void 0:n.defaultView)?void 0:i.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 n=e[r[0]];return 1===r.length?n:t(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:Zi,getShadowHost:xi,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,n,i,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=_i.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==(n=_i.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof bi&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(_i.shadowRoot(t)))},hookSetter:function t(e,r,n,i,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(e,r);return o.Object.defineProperty(e,r,i?n:{set(t){setTimeout((()=>{n.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&&(_i.contains(e,t)||Yi(t))},isAncestorRemoved:function t(e,r){if(i=(n=e)&&"host"in n&&"mode"in n&&gi.host(n)||null,Boolean(i&&"shadowRoot"in i&&gi.shadowRoot(i)===n))return!1;var n,i,o=r.getId(e);if(!r.has(o))return!0;var s=_i.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||t(s,r))},isBlocked:function(t,e,r,n){if(!t)return!1;var i=Oi(t);if(!i)return!1;try{if("string"==typeof e){if(i.classList.contains(e))return!0;if(n&&null!==i.closest("."+e))return!0}else if(yi(i,e,n))return!0}catch(t){}if(r){if(i.matches(r))return!0;if(n&&null!==i.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 n=e.children.length-1;n>=0;n--)t(e.children[n],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return Bi},on:function(t,e,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),t[e]=i,()=>{t[e]=n}}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 n={value:t,parent:r,children:[]};return e[t.node.id]=n,n},n=[];for(var i of t){var{nextId:o,parentId:s}=i;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(i,a.parent))}else{var l=n.indexOf(a);n.splice(l,0,r(i,null))}}else if(s in e){var d=e[s];d.children.push(r(i,d))}else n.push(r(i,null))}return n},shadowHostInDom:Yi,throttle:function(t,e,r){void 0===r&&(r={});var n=null,i=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();i||!1!==r.leading||(i=u);var l=e-(u-i),d=this;l<=0||l>e?(n&&(clearTimeout(n),n=null),i=u,t.apply(d,s)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,t.apply(d,s)}),l))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],n=t.length;n--;){var i=t[n];e.has(i.id)||(r.push(i),e.add(i.id))}return r}},Symbol.toStringTag,{value:"Module"})),Gi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Li="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Wi=0;Wi<64;Wi++)Li[Gi.charCodeAt(Wi)]=Wi;var Di;"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 Vi=document.createElement("iframe");document.body.appendChild(Vi),Array.from=(null==(ri=Vi.contentWindow)?void 0:ri.Array.from)||Array.from,document.body.removeChild(Vi)}}catch(t){console.debug("Unable to override Array.from",t)}new Ii,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(Di||(Di={}));class Xi{constructor(t){ii(this,"fileName"),ii(this,"functionName"),ii(this,"lineNumber"),ii(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 zi=/(^|@)\S+:\d+/,Ji=/^\s*at .*(\S+:\d+|\(native\))/m,Ki=/^(eval@)?(\[native code])?$/,Hi={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Ji)?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(Ji)}),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+)\)$)/),n=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Xi({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Ki)}),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 Xi({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(t.replace(e,""));return new Xi({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[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"),n=[],i=2,o=r.length;i<o;i+=2){var s=e.exec(r[i]);s&&n.push(new Xi({fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),n=[],i=0,o=r.length;i<o;i+=2){var s=e.exec(r[i]);s&&n.push(new Xi({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(zi)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),n=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Xi({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function ji(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var n=t.parentElement,i=[];if(n.children&&n.children.length>0)for(var o=0;o<n.children.length;o++){var s=n.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&i.push(s)}i.length>1&&(r+=":eq("+i.indexOf(t)+")"),e=r+(e?">"+e:""),t=n}return e}function Ui(t){return"[object Object]"===Object.prototype.toString.call(t)}function Pi(t,e){if(0===e)return!0;var r=Object.keys(t);for(var n of r)if(Ui(t[n])&&Pi(t[n],e-1))return!0;return!1}function qi(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var n=[],i=[];return JSON.stringify(t,(function(t,e){if(n.length>0){var o=n.indexOf(this);~o?n.splice(o+1):n.push(this),~o?i.splice(o,1/0,t):i.push(t),~n.indexOf(e)&&(e=n[0]===e?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(e)).join(".")+"]")}else n.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Ui(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Ui(t)&&Pi(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]=ji(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 Qi={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 $i(t,e,r){var n,i=r?Object.assign({},Qi,r):Qi,o=i.logger;if(!o)return()=>{};n="string"==typeof o?e[o]:o;var s=0,a=!1,u=[];if(i.level.includes("error")){var l=e=>{var r=e.message,n=e.error,o=Hi.parse(n).map((t=>t.toString())),s=[qi(r,i.stringifyOptions)];t({level:"error",trace:o,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var d=e=>{var r,n;e.reason instanceof Error?n=[qi("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,i.stringifyOptions)]:(r=new Error,n=[qi("Uncaught (in promise)",i.stringifyOptions),qi(e.reason,i.stringifyOptions)]);var o=Hi.parse(r).map((t=>t.toString()));t({level:"error",trace:o,payload:n})};e.addEventListener("unhandledrejection",d),u.push((()=>{e.removeEventListener("unhandledrejection",d)}))}for(var c of i.level)u.push(h(n,c));return()=>{u.forEach((t=>t()))};function h(e,r){var n=this;return e[r]?Ei.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(n,u),!("assert"===r&&u[0]||a)){a=!0;try{var d=Hi.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>qi(t,i.stringifyOptions)));++s<i.lengthThreshold?t({level:r,trace:d,payload:c}):s===i.lengthThreshold&&t({level:"warn",trace:[],payload:[qi("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{a=!1}}})):()=>{}}}var to=t=>({name:"rrweb/console@1",observer:$i,options:t}),eo=t=>t instanceof Document;function ro(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i=r(n);return g(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=i,()=>{t[e]=n}}catch(t){return()=>{}}}function no(t,e){var r,n=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),i={hostname:n,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==n||!n.trim().length)return i;for(var o of e.payloadHostDenyList)if(n.endsWith(o))return{hostname:n,isHostDenied:!0};return i}var io=F("[Recorder]"),oo=t=>"navigation"===t.entryType,so=t=>"resource"===t.entryType;function ao(t,e,r){if(r.recordInitialRequests){var n=e.performance.getEntries().filter((t=>oo(t)||so(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:n.flatMap((t=>mo({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new e.PerformanceObserver((e=>{var n=e.getEntries().filter((t=>oo(t)||so(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:n.flatMap((t=>mo({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return i.observe({entryTypes:o}),()=>{i.disconnect()}}function uo(t,e){return!!e&&(k(e)||e[t])}function lo(t){var{type:e,recordBody:r,headers:n,url:i}=t;function o(t){var e=Object.keys(n).find((t=>"content-type"===t.toLowerCase())),r=e&&n[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}}(i))return!1;if(k(r))return!0;if(p(r))return o(r);var s=r[e];return k(s)?s:o(s)}function co(t,e,r,n,i,o){return ho.apply(this,arguments)}function ho(){return ho=a((function*(t,e,r,n,i,o){if(void 0===o&&(o=0),o>10)return io.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=>so(t)&&t.initiatorType===e&&(y(n)||t.startTime>=n)&&(y(i)||t.startTime<=i)));return s||(yield new Promise((t=>setTimeout(t,50*o))),co(t,e,r,n,i,o+1))})),ho.apply(this,arguments)}function vo(t){var{body:e,options:r,url:n}=t;if(w(e))return null;var{hostname:i,isHostDenied:o}=no(n,r);if(o)return i+" is in deny list";if(b(e))return e;if(eo(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 fo=t=>!C(t)&&("navigation"===t.entryType||"resource"===t.entryType);function mo(t){var{entry:e,method:r,status:n,networkRequest:i,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:n,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:o})];if(fo(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 po=["video/","audio/"];function go(t){return new Promise(((e,r)=>{var n=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(n)))}catch(t){clearTimeout(n),e("[SessionReplay] Failed to read body")}}))}function Io(){return(Io=a((function*(t){var{r:e,options:r,url:n}=t,{hostname:i,isHostDenied:o}=no(n,r);return o?Promise.resolve(i+" is in deny list"):go(e)}))).apply(this,arguments)}function yo(){return(yo=a((function*(t){var{r:e,options:r,url:n}=t,i=function(t){var e,{r:r,options:n,url:i}=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=po.some((t=>null==o?void 0:o.startsWith(t)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:u}=no(i,n);return u?a+" is in deny list":null}({r:e,options:r,url:n});return C(i)?go(e):Promise.resolve(i)}))).apply(this,arguments)}function bo(t,e,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var n=uo("request",r.recordHeaders),i=uo("response",r.recordHeaders),o=ro(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})),n&&(h.requestHeaders=v),lo({type:"request",headers:v,url:s,recordBody:r.recordBody})&&(h.requestBody=yield function(t){return Io.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})),i&&(h.responseHeaders=f),lo({type:"response",headers:f,url:s,recordBody:r.recordBody})&&(h.responseBody=yield function(t){return yo.apply(this,arguments)}({r:u,options:r,url:s})),u}finally{co(e,"fetch",c.url,l,d).then((e=>{var r,n=mo({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:n})})).catch((()=>{}))}}));return function(t,e){return s.apply(this,arguments)}}()));return()=>{o()}}var Co=null;function wo(t,e,r){if(!("performance"in e))return()=>{};if(Co)return io.warn("Network observer already initialised, doing nothing"),()=>{};var n=r?Object.assign({},K,r):K,i=e=>{var r=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&r.push(e)})),r.length>0&&t(u({},e,{requests:r}))},o=ao(i,e,n),s=()=>{},a=()=>{};return(n.recordHeaders||n.recordBody)&&(s=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=uo("request",r.recordHeaders),i=uo("response",r.recordHeaders),o=ro(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)),n&&(m.requestHeaders=p);var I=v.send.bind(v);v.send=t=>(lo({type:"request",headers:p,url:a,recordBody:r.recordBody})&&(m.requestBody=vo({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 n={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),i=e.join(": ");r&&(n[r]=i)})),i&&(m.responseHeaders=n),lo({type:"response",headers:n,url:a,recordBody:r.recordBody})&&(m.responseBody=vo({body:v.response,options:r,url:a})),co(e,"xmlhttprequest",f.url,c,h).then((e=>{var r=mo({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()}}(i,e,n),a=bo(i,e,n)),Co=()=>{o(),s(),a(),Co=null}}var So=t=>({name:"rrweb/network@1",observer:wo,options:t});o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:to,getRecordNetworkPlugin:So},o.__PosthogExtensions__.rrweb={record:ei,version:"v2"},o.rrweb={record:ei,version:"v2"},o.rrwebConsoleRecord={getRecordConsolePlugin:to},o.getRecordNetworkPlugin=So,o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.initSessionRecording=t=>new ye(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,n=null==e?void 0:e.navigator,i=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==n||n.userAgent;var o=null!=t?t:{};function s(t,e,r,n,i,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(n,i)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){s(o,n,i,a,u,"next",t)}function u(t){s(o,n,i,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 n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}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),k=t=>"[object Boolean]"===m.call(t),A=t=>t instanceof FormData;function N(t,e,r,n,i){return e>r&&(n.warn("min cannot be greater than max."),e=r),S(t)?t>r?(n.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t<e?(n.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(n.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+i),N(i||r,e,r,n))}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,n=Math.floor(r/this.m);if(n>0){var i=n*this.h;t.tokens=Math.min(t.tokens+i,this.o),t.lastAccess=t.lastAccess+n*this.m}}consumeRateLimit(t){var e,r=Date.now(),n=String(t),i=this.t[n];return i?this.I(i,r):(i={tokens:this.o,lastAccess:r},this.t[n]=i),0===i.tokens||(i.tokens--,0===i.tokens&&(null==(e=this.i)||e.call(this,t)),0===i.tokens)}stop(){this.t={}}}var T={LIB_VERSION:"1.317.0"},_=function(e,r){var{debugEnabled:n}=void 0===r?{}:r,i={C:function(r){if(t&&(o.POSTHOG_DEBUG||n)&&!y(t.console)&&t.console){for(var i=("__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];i(e,...a)}},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.C("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.C("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];i.C("error",...e)},critical:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning:t=>{i.error("You must initialize PostHog before calling "+t)},createLogger:(t,r)=>_(e+" "+t,r)};return i},M=_("[PostHog.js]"),F=M.createLogger,B={};function O(t,e,n){if(!w(t)){if(p(t))return function(t,e,n){if(p(t))if(r&&t.forEach===r)t.forEach(e,n);else if("length"in t&&t.length===+t.length)for(var i=0,o=t.length;i<o;i++)if(i in t&&e.call(n,t[i],i)===B)return}(t,e,n);if(A(t)){for(var i of t.entries())if(e.call(n,i[1],i[0])===B)return}else for(var o in t)if(f.call(t,o)&&e.call(n,t[o],o)===B)return}}function x(t,e,r,n){var{capture:i=!1,passive:o=!0}={};null==t||t.addEventListener(e,r,{capture:i,passive:o})}var Z=["localhost","127.0.0.1"],Y=t=>{var e=null==i?void 0:i.createElement("a");return y(e)?null:(e.href=t,e)},E=function(t,e){var r,n;void 0===e&&(e="&");var i=[];return O(t,(function(t,e){y(t)||y(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),n=encodeURIComponent(e),i[i.length]=n+"="+r)})),i.join(e)},G="$session_is_sampled",L="$session_past_minimum_duration",W="$session_recording_url_trigger_activated_session",D="$session_recording_event_trigger_activated_session",V=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})"),X=new RegExp("(\\d{3}-?\\d{2}-?\\d{4})");var z="[SessionRecording]",J="redacted",K={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"]},H=["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"],j=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],U=["/s/","/e/","/i/"];function P(t,e,r,n){if(w(t))return t;var i=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return b(i)&&(i=parseInt(i)),i>r?z+" "+n+" body too large to record ("+i+" bytes)":t}function q(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),V.test((t||"").replace(/[- ]/g,"")))return!1;if(X.test(t))return!1}return!0}(r)||(r=z+" "+e+" body "+J),O(j,(t=>{var n,i;null!=(n=r)&&n.length&&-1!==(null==(i=r)?void 0:i.indexOf(t))&&(r=z+" "+e+" body "+J+" as might contain: "+t)})),r}var Q=(t,e)=>{var r,n,i,o={payloadSizeLimitBytes:K.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...K.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...K.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,i=Math.min(1e6,null!==(n=r.payloadSizeLimitBytes)&&void 0!==n?n:1e6),t=>(null!=t&&t.requestBody&&(t.requestBody=P(t.requestBody,t.requestHeaders,i,"Request")),null!=t&&t.responseBody&&(t.responseBody=P(t.responseBody,t.responseHeaders,i,"Response")),t)),c=e=>{return d(((t,e)=>{var r,n=Y(t.name),i=0===e.indexOf("http")?null==(r=Y(e))?void 0:r.pathname:e;"/"===i&&(i="");var o=null==n?void 0:n.pathname.replace(i||"","");if(!(n&&o&&U.some((t=>0===o.indexOf(t)))))return t})((n=(r=e).requestHeaders,w(n)||O(Object.keys(null!=n?n:{}),(t=>{H.includes(t.toLowerCase())&&(n[t]=J)})),r),t.api_host));var r,n},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,n=c(e);return n&&null!==(r=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(n))&&void 0!==r?r:void 0}:t=>function(t){if(!y(t))return t.requestBody=q(t.requestBody,"Request"),t.responseBody=q(t.responseBody,"Response"),t}(c(t)),u({},K,o,{recordHeaders:s,recordBody:a,recordPerformance:l,recordInitialRequests:l})},tt="disabled",et="sampled",rt="active",nt="buffering",it="paused",ot="trigger",st=ot+"_activated",at=ot+"_pending",ut=ot+"_"+tt;function lt(t,e){return e.some((e=>"regex"===e.matching&&new RegExp(e.url).test(t)))}class dt{constructor(t){this.S=t}triggerStatus(t){var e=this.S.map((e=>e.triggerStatus(t)));return e.includes(st)?st:e.includes(at)?at:ut}stop(){this.S.forEach((t=>t.stop()))}}class ct{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(ut),e.size){case 0:return ut;case 1:return Array.from(e)[0];default:return at}}stop(){this.S.forEach((t=>t.stop()))}}class ht{triggerStatus(){return at}stop(){}}var vt=t=>"sessionRecording"in t;class ft{constructor(t){this.k=[],this.A=[],this.urlBlocked=!1,this._instance=t}onConfig(t){var e,r;this.k=(vt(t)?I(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.A=(vt(t)?I(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[]}onRemoteConfig(t){this.onConfig(t)}N(t){var e;return 0===this.k.length?ut:(null==(e=this._instance)?void 0:e.get_property(W))===t?st:at}triggerStatus(t){var e=this.N(t),r=e===st?st:e===at?at:ut;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:r}),r}checkUrlTriggerConditions(e,r,n,i){if(void 0!==t&&t.location.href){var o=t.location.href,s=this.urlBlocked,a=lt(o,this.A);if(!s||!a){a&&!s?e():!a&&s&&r();var u=this.N(i)===st,l=lt(o,this.k);!u&&l&&n("url")}}}stop(){}}class mt{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.R=()=>{},this._instance=t}triggerStatus(){var t=at;return w(this.linkedFlag)&&(t=ut),this.linkedFlagSeen&&(t=st),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}onConfig(t,e){var r;if(this.linkedFlag=(vt(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 n=b(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,i=b(this.linkedFlag)?null:this.linkedFlag.variant;this.R=this._instance.onFeatureFlags(((t,r)=>{var o=!1;if(I(r)&&n in r){var s=r[n];o=k(s)?!0===s:i?s===i:!!s}this.linkedFlagSeen=o,o&&e(n,i)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.R()}}class pt{constructor(t){this.T=[],this._instance=t}onConfig(t){var e;this.T=(vt(t)?I(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}M(t){var e;return 0===this.T.length?ut:(null==(e=this._instance)?void 0:e.get_property(D))===t?st:at}triggerStatus(t){var e=this.M(t),r=e===st?st:e===at?at:ut;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:r}),r}stop(){}}function gt(t){return t.isRecordingEnabled?nt:tt}function It(t){if(!t.receivedFlags)return nt;if(!t.isRecordingEnabled)return tt;if(t.urlTriggerMatching.urlBlocked)return it;var e=!0===t.isSampled,r=new dt([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?et:r===st?rt:r===at?nt:!1===t.isSampled?tt:rt}function yt(t){if(!t.receivedFlags)return nt;if(!t.isRecordingEnabled)return tt;if(t.urlTriggerMatching.urlBlocked)return it;var e=new ct([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==ut,n=k(t.isSampled);return r&&e===at?nt:r&&e===ut||n&&!t.isSampled?tt:!0===t.isSampled?et:rt}function bt(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 Ct=Uint8Array,wt=Uint16Array,St=Uint32Array,kt=new Ct([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]),At=new Ct([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]),Nt=new Ct([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Rt=function(t,e){for(var r=new wt(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];var i=new St(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},Tt=Rt(kt,2),_t=Tt[0],Mt=Tt[1];_t[28]=258,Mt[258]=28;for(var Ft=Rt(At,0)[1],Bt=new wt(32768),Ot=0;Ot<32768;++Ot){var xt=(43690&Ot)>>>1|(21845&Ot)<<1;xt=(61680&(xt=(52428&xt)>>>2|(13107&xt)<<2))>>>4|(3855&xt)<<4,Bt[Ot]=((65280&xt)>>>8|(255&xt)<<8)>>>1}var Zt=function(t,e,r){for(var n=t.length,i=0,o=new wt(e);i<n;++i)++o[t[i]-1];var s,a=new wt(e);for(i=0;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new wt(1<<e);var u=15-e;for(i=0;i<n;++i)if(t[i])for(var l=i<<4|t[i],d=e-t[i],c=a[t[i]-1]++<<d,h=c|(1<<d)-1;c<=h;++c)s[Bt[c]>>>u]=l}else for(s=new wt(n),i=0;i<n;++i)s[i]=Bt[a[t[i]-1]++]>>>15-t[i];return s},Yt=new Ct(288);for(Ot=0;Ot<144;++Ot)Yt[Ot]=8;for(Ot=144;Ot<256;++Ot)Yt[Ot]=9;for(Ot=256;Ot<280;++Ot)Yt[Ot]=7;for(Ot=280;Ot<288;++Ot)Yt[Ot]=8;var Et=new Ct(32);for(Ot=0;Ot<32;++Ot)Et[Ot]=5;var Gt=Zt(Yt,9,0),Lt=Zt(Et,5,0),Wt=function(t){return(t/8>>0)+(7&t&&1)},Dt=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var n=new(t instanceof wt?wt:t instanceof St?St:Ct)(r-e);return n.set(t.subarray(e,r)),n},Vt=function(t,e,r){r<<=7&e;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8},Xt=function(t,e,r){r<<=7&e;var n=e/8>>0;t[n]|=r,t[n+1]|=r>>>8,t[n+2]|=r>>>16},zt=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,o=r.slice();if(!i)return[new Ct(0),0];if(1==i){var s=new Ct(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!=i-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(n=1;n<i;++n)o[n].s>h&&(h=o[n].s);var v=new wt(h+1),f=Jt(r[d-1],v,0);if(f>e){n=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}));n<i;++n){var I=o[n].s;if(!(v[I]>e))break;m+=g-(1<<f-v[I]),v[I]=e}for(m>>>=p;m>0;){var y=o[n].s;v[y]<e?m-=1<<e-v[y]++-1:++n}for(;n>=0&&m;--n){var b=o[n].s;v[b]==e&&(--v[b],++m)}f=e}return[new Ct(v),f]},Jt=function(t,e,r){return-1==t.s?Math.max(Jt(t.l,e,r+1),Jt(t.r,e,r+1)):e[t.s]=r},Kt=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new wt(++e),n=0,i=t[0],o=1,s=function(t){r[n++]=t},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&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(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return[r.subarray(0,n),e]},Ht=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},jt=function(t,e,r){var n=r.length,i=Wt(e+2);t[i]=255&n,t[i+1]=n>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var o=0;o<n;++o)t[i+o+4]=r[o];return 8*(i+4+n)},Ut=function(t,e,r,n,i,o,s,a,u,l,d){Vt(e,d++,r),++i[256];for(var c=zt(i,15),h=c[0],v=c[1],f=zt(o,15),m=f[0],p=f[1],g=Kt(h),I=g[0],y=g[1],b=Kt(m),C=b[0],w=b[1],S=new wt(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=zt(S,7),N=A[0],R=A[1],T=19;T>4&&!N[Nt[T-1]];--T);var _,M,F,B,O=l+5<<3,x=Ht(i,Yt)+Ht(o,Et)+s,Z=Ht(i,h)+Ht(o,m)+s+14+3*T+Ht(S,N)+(2*S[16]+3*S[17]+7*S[18]);if(O<=x&&O<=Z)return jt(e,d,t.subarray(u,u+l));if(Vt(e,d,1+(Z<x)),d+=2,Z<x){_=Zt(h,v,0),M=h,F=Zt(m,p,0),B=m;var Y=Zt(N,R,0);Vt(e,d,y-257),Vt(e,d+5,w-1),Vt(e,d+10,T-4),d+=14;for(k=0;k<T;++k)Vt(e,d+3*k,N[Nt[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];Vt(e,d,Y[W]),d+=N[W],W>15&&(Vt(e,d,L[k]>>>5&127),d+=L[k]>>>12)}}}else _=Gt,M=Yt,F=Lt,B=Et;for(k=0;k<a;++k)if(n[k]>255){W=n[k]>>>18&31;Xt(e,d,_[W+257]),d+=M[W+257],W>7&&(Vt(e,d,n[k]>>>23&31),d+=kt[W]);var D=31&n[k];Xt(e,d,F[D]),d+=B[D],D>3&&(Xt(e,d,n[k]>>>5&8191),d+=At[D])}else Xt(e,d,_[n[k]]),d+=M[n[k]];return Xt(e,d,_[256]),d+M[256]},Pt=new St([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),qt=function(){for(var t=new St(256),e=0;e<256;++e){for(var r=e,n=9;--n;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Qt=function(){var t=4294967295;return{p:function(e){for(var r=t,n=0;n<e.length;++n)r=qt[255&r^e[n]]^r>>>8;t=r},d:function(){return 4294967295^t}}},$t=function(t,e,r,n,i){return function(t,e,r,n,i,o){var s=t.length,a=new Ct(n+s+5*(1+Math.floor(s/7e3))+i),u=a.subarray(n,a.length-i),l=0;if(!e||s<8)for(var d=0;d<=s;d+=65535){var c=d+65535;c<s?l=jt(u,l,t.subarray(d,c)):(u[d]=o,l=jt(u,l,t.subarray(d,s)))}else{for(var h=Pt[e-1],v=h>>>13,f=8191&h,m=(1<<r)-1,p=new wt(32768),g=new wt(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 St(25e3),w=new wt(288),S=new wt(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=Ut(t,u,0,C,w,S,A,N,T,d-T,l),N=k=A=0,T=d;for(var O=0;O<286;++O)w[O]=0;for(O=0;O<30;++O)S[O]=0}var x=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+x]==t[d+x-E]){for(var D=0;D<W&&t[d+D]==t[d+D-E];++D);if(D>x){if(x=D,Z=E,D>G)break;var V=Math.min(E,D-2),X=0;for(O=0;O<V;++O){var z=d-E+O+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|Mt[x]<<18|Ft[Z];var K=31&Mt[x],H=31&Ft[Z];A+=kt[K]+At[H],++w[257+K],++S[H],R=d+x,++k}else C[N++]=t[d],++w[t[d]]}}l=Ut(t,u,o,C,w,S,A,N,T,d-T,l)}return Dt(a,0,n+Wt(l)+i)}(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,n,!0)},te=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},ee=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&&te(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var n=0;n<=r.length;++n)t[n+10]=r.charCodeAt(n)}},re=function(t){return 10+(t.filename&&t.filename.length+1||0)};class ne{constructor(t,e){var r,n;void 0===e&&(e={}),this.F={},this.B=t=>{if(!this.F[t]){var e,r;this.F[t]=!0;var n=this.O(t);null==(e=(r=this.Z).onBlockedNode)||e.call(r,t,n)}},this.Y=t=>{var e=this.O(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.O=t=>this._rrweb.mirror.getNode(t),this.G=t=>{var e,r,n,i,o,s,a,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(n=null==(i=t.attributes)?void 0:i.length)&&void 0!==n?n: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.G(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var[e]=this.Y(t.id);return!this.L.consumeRateLimit(e)&&t})));var n=this.G(e);return 0!==n||r===n?t:void 0},this._rrweb=t,this.Z=e,this.L=new R({bucketSize:null!==(r=this.Z.bucketSize)&&void 0!==r?r:100,refillRate:null!==(n=this.Z.refillRate)&&void 0!==n?n:10,refillInterval:1e3,i:this.B,u:M})}reset(){this.F={}}stop(){this.L.stop(),this.reset()}}function ie(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 oe="$sess_rec_flush_size";class se{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.W=t.get_property.bind(t),this.D=t.persistence.set_property.bind(t.persistence)}trackSize(t){var e=(Number(this.W(oe))||0)+t;this.D(oe,e)}reset(){return this.D(oe,0)}get currentTrackedSize(){return Number(this.W(oe))||0}}var ae=3e5,ue="[SessionRecording]",le=F(ue),de=[d.MouseMove,d.MouseInteraction,d.Scroll,d.ViewportResize,d.Input,d.TouchMove,d.MediaInteraction,d.Drag],ce=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function he(){var t;return null==o||null==(t=o.__PosthogExtensions__)||null==(t=t.rrweb)?void 0:t.record}function ve(t){return function(t,e){for(var r="",n=0;n<t.length;){var i=t[n++];r+=String.fromCharCode(i)}return r}(function(t,e){void 0===e&&(e={});var r=Qt(),n=t.length;r.p(t);var i=$t(t,e,re(e),8),o=i.length;return ee(i,e),te(i,o-8,r.d()),te(i,o-4,n),i}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var n=new Ct(t.length+(t.length>>>1)),i=0,o=function(t){n[i++]=t},s=0;s<r;++s){if(i+5>n.length){var a=new Ct(i+8+(r-s<<1));a.set(n),n=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 Dt(n,0,i)}(JSON.stringify(t))))}function fe(t,e){return t.type===l.Custom&&t.data.tag===e}function me(t){return fe(t,"sessionIdle")}function pe(t){return fe(t,"$session_ending")}function ge(t){return fe(t,"$session_starting")}function Ie(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),n=t.data.slice(0,r),i=t.data.slice(r);return[Ie({size:bt(n),data:n,sessionId:t.sessionId,windowId:t.windowId}),Ie({size:bt(i),data:i,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}class ye{get sessionId(){return this.V}get X(){if(!this._instance.sessionManager)throw new Error(ue+" must be started with a valid sessionManager.");return this._instance.sessionManager}get J(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get K(){var t=this._instance.get_property(G);return k(t)?t:b(t)?t===this.sessionId:null}get H(){var t,e=null==(t=this.j)?void 0:t.sampleRate;return S(e)?e:null}get U(){var t,e=null==(t=this.j)?void 0:t.minimumDurationMilliseconds;return S(e)?e:null}constructor(t){this.P="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.q=void 0,this.$=Date.now(),this.tt=[],this.et="unknown",this.rt=new ht,this.nt=void 0,this.it=void 0,this.ot=gt,this.st=void 0,this.ut=void 0,this.lt=void 0,this.dt=void 0,this.ct=(t,e,r)=>{if(r&&(t!==this.V||e!==this.ht)){var n,i=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),o=this.V,s=this.ht;if(i)this.vt("$session_ending",{currentSessionId:o,currentWindowId:s,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.$,flushed_size:null==(n=this.ft)?void 0:n.currentTrackedSize});this.ft&&this.ft.reset(),this.vt("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.gt(),i&&this.vt("$session_starting",{previousSessionId:o,previousWindowId:s,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.$}),S(this.H)&&w(this.lt)&&this.It(t)}},this.yt=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[L])===this.V},this.bt=()=>{var t,e;if(0===this.Ct.data.length)return null;var r=null==(t=this.Ct.data[0])?void 0:t.timestamp,n=null==(e=this.Ct.data[this.Ct.data.length-1])?void 0:e.timestamp;return S(r)&&S(n)?n-r:null},this.wt=()=>{var t,e,r=this.U;if(!S(r))return!1;if(!(null!==(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)&&void 0!==t&&t)){var n=this.St;return S(n)&&n>=0&&n<r}if(this.yt())return!1;var i,o=this.bt();return!!C(o)||(!(o>=r)||(null==(i=this._instance.persistence)||i.register({[L]:this.V}),!1))},this.kt=()=>{this.At()},this.Nt=()=>{this.vt("browser offline",{})},this.Rt=()=>{this.vt("browser online",{})},this.Tt=()=>{if(null!=i&&i.visibilityState){var t="window "+i.visibilityState;this.vt(t,{})}},this._instance=t;var{sessionId:e,windowId:r}=this.X.checkAndGetSessionAndWindowId();this.V=e,this.ht=r,this._t=new mt(this._instance),this.Mt=new ft(this._instance),this.Ft=new pt(this._instance),this.Ct=this.Bt(),this.J>=this.X.sessionTimeoutMs&&le.warn("session_idle_threshold_ms ("+this.J+") is greater than the session timeout ("+this.X.sessionTimeoutMs+"). Session will never be detected as idle"),this.ft=new se(this._instance)}get Ot(){var t,e,r,n,i,o,s,a=null==(t=this.j)?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==(n=this._instance.config.session_recording)?void 0:n.blockSelector},l=null!==(i=null==u?void 0:u.maskAllInputs)&&void 0!==i?i: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 xt(){var t,e,r,n,i,o,s,a=this._instance.config.session_recording.captureCanvas,u=null==(t=this.j)?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!==(n=null!==(i=null==a?void 0:a.canvasFps)&&void 0!==i?i:null==u?void 0:u.fps)&&void 0!==n?n: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 Zt(){var t,e=!(null==(t=this.j)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Yt(){var t,e,r,n=null==(t=this.j)?void 0:t.networkPayloadCapture,i={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==i?void 0:i.recordHeaders)||(null==n?void 0:n.recordHeaders),s=(null==i?void 0:i.recordBody)||(null==n?void 0:n.recordBody),a=I(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,u=!!(k(a)?a:null==n?void 0:n.capturePerformance);return o||s||u?{recordHeaders:o,recordBody:s,recordPerformance:u}:void 0}Et(){var t,e,r=[],n=null==(t=o.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.Zt&&r.push(n());var i=null==(e=o.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;this.Yt&&g(i)&&(!Z.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(i(Q(this._instance.config,this.Yt))):le.info("NetworkCapture not started because we are on localhost."));return r}Gt(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var r,n=e.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==n?void 0:n.name)&&void 0!==r?r:null==n?void 0:n.url}if(e.maskNetworkRequestFn){var i=e.maskNetworkRequestFn({url:t});return null==i?void 0:i.url}return t}Lt(t){try{return t.rrwebMethod(),!0}catch(e){return this.tt.length<10?this.tt.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):le.warn("could not emit queued rrweb event.",e,t),!1}}vt(t,e){return this.Lt(ce((()=>he().addCustomEvent(t,e))))}Wt(){try{if(this._instance.config.capture_pageview||!t)return;var e=new URL(t.location.href),r=e.origin+e.pathname+e.search,n=this.Gt(r);this.Dt!==n&&(this.Dt=n,this.vt("$url_changed",{href:n}))}catch(t){}}Vt(){if(this.tt.length){var t=[...this.tt];this.tt=[],t.forEach((t=>{Date.now()-t.enqueuedAt<=2e3&&this.Lt(t)}))}}Xt(){return this.Lt(ce((()=>he().takeFullSnapshot())))}get zt(){var t,e;return this.rt.triggerStatus(this.sessionId)!==at||["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:ae:6e4}Jt(){if(this.Kt&&clearInterval(this.Kt),!0!==this.et){var t=this.zt;t&&(this.Kt=setInterval((()=>{this.Xt()}),t))}}Ht(){this.Mt.urlBlocked||(this.Mt.urlBlocked=!0,clearInterval(this.Kt),le.info("recording paused due to URL blocker"),this.vt("recording paused",{reason:"url blocker"}))}jt(){this.Mt.urlBlocked&&(this.Mt.urlBlocked=!1,this.Xt(),this.Jt(),this.vt("recording resumed",{reason:"left blocked url"}),le.info("recording resumed"))}Ut(t){var e;this.rt.triggerStatus(this.sessionId)===at&&(null==(e=this._instance)||null==(e=e.persistence)||e.register({["url"===t?W:D]:this.V}),this.At(),this.Pt(t+"_trigger_matched"))}get isStarted(){return!!this.q}get j(){var t=this._instance.get_property("$session_recording_remote_config");if(t)return I(t)?t:JSON.parse(t)}qt(t,e){var r;this._instance.get_property(t)&&(e(),null==(r=this._instance.persistence)||r.unregister(t))}start(e){var r,n=this.j;if(n){var{sessionId:i,windowId:o}=this.X.checkAndGetSessionAndWindowId();this.V=i,this.ht=o,null!=n&&n.endpoint&&(this.P=null==n?void 0:n.endpoint),"any"===(null==n?void 0:n.triggerMatchType)?(this.ot=It,this.rt=new dt([this.Ft,this.Mt])):(this.ot=yt,this.rt=new ct([this.Ft,this.Mt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:null==n?void 0:n.triggerMatchType}),this.Mt.onConfig(n),this.Ft.onConfig(n),null==(r=this.it)||r.call(this),this.Qt(),this._t.onConfig(n,((t,e)=>{this.Pt("linked_flag_matched",{flag:t,variant:e})})),this.qt("$replay_override_sampling",(()=>{this.overrideSampling()})),this.qt("$replay_override_linked_flag",(()=>{this.overrideLinkedFlag()})),this.qt("$replay_override_event_trigger",(()=>{this.overrideTrigger("event")})),this.qt("$replay_override_url_trigger",(()=>{this.overrideTrigger("url")})),this.It(this.sessionId),this.$t(),x(t,"beforeunload",this.kt),x(t,"offline",this.Nt),x(t,"online",this.Rt),x(t,"visibilitychange",this.Tt),this.st||(this.st=this.X.onSessionId(this.ct)),this.ut||(this.ut=this.X.on("forcedIdleReset",(()=>{this.gt(),this.et="unknown",this.stop(),this.dt=this.X.onSessionId(((t,e,r)=>{var n;null==(n=this.dt)||n.call(this),this.dt=void 0,this.ct(t,e,r)}))}))),w(this.nt)&&(this.nt=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.Gt(null==t?void 0:t.properties.$current_url):"";if(!e)return;this.vt("$pageview",{href:e})}}catch(t){le.error("Could not add $pageview to rrweb session",t)}}))),this.status===rt&&this.Pt(e||"recording_initialized")}else le.info("remote config must be stored in persistence before recording can start")}stop(){var e,r,n,i,o,s,a,u;null==t||t.removeEventListener("beforeunload",this.kt),null==t||t.removeEventListener("offline",this.Nt),null==t||t.removeEventListener("online",this.Rt),null==t||t.removeEventListener("visibilitychange",this.Tt),this.At(),this.Bt(),clearInterval(this.Kt),this.te(),null==(e=this.nt)||e.call(this),this.nt=void 0,null==(r=this.it)||r.call(this),this.it=void 0,null==(n=this.st)||n.call(this),this.st=void 0,null==(i=this.ut)||i.call(this),this.ut=void 0,null==(o=this.lt)||o.call(this),this.lt=void 0,null==(s=this.dt)||s.call(this),this.dt=void 0,this.Ft.stop(),this.Mt.stop(),this._t.stop(),null==(a=this.ee)||a.stop(),this.tt=[],null==(u=this.q)||u.call(this),this.q=void 0,le.info("stopped")}onRRwebEmit(t){var e,r,n,i,o;if(this.Vt(),t&&I(t)){if(t.type===l.Meta){var s=this.Gt(t.data.href);if(this.Dt=s,!s)return;t.data.href=s}else this.Wt();if(this.Mt.checkUrlTriggerConditions((()=>this.Ht()),(()=>this.jt()),(t=>this.Ut(t)),this.sessionId),!this.Mt.urlBlocked||(a=t).type===l.Custom&&"recording paused"===a.data.tag){var a,c;if(t.type===l.FullSnapshot)this.Jt(),null==(c=this.ee)||c.reset();t.type===l.FullSnapshot&&this.rt.triggerStatus(this.sessionId)===at&&this.re();var h=this.ee?this.ee.throttleMutations(t):t;if(h){var v=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=[],n=0;n<e.data.payload.payload.length;n++)e.data.payload.payload[n]&&e.data.payload.payload[n].length>2e3?r.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):r.push(e.data.payload.payload[n]);return e.data.payload.payload=r,t}return t}(h),f=function(t){return pe(t)?t.data.payload:null}(v),m=function(t){return ge(t)?t.data.payload:null}(v);if(f||m){var p=null!=f?f:m;null!=p&&p.lastActivityTimestamp&&(v.timestamp=p.lastActivityTimestamp)}else this.ne(v);var g=null!==(e=null!==(r=null==f?void 0:f.currentSessionId)&&void 0!==r?r:null==m?void 0:m.nextSessionId)&&void 0!==e?e:this.V,y=null!==(n=null!==(i=null==f?void 0:f.currentWindowId)&&void 0!==i?i:null==m?void 0:m.nextWindowId)&&void 0!==n?n:this.ht;if(!0!==this.et||function(t){return me(t)||pe(t)||ge(t)}(v)){if(me(v)){var b=v.data.payload;if(b){var C=b.lastActivityTimestamp,w=b.threshold;v.timestamp=C+w}}var S=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:ve(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:ve(t.data.texts),attributes:ve(t.data.attributes),removes:ve(t.data.removes),adds:ve(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?ve(t.data.adds):void 0,removes:t.data.removes?ve(t.data.removes):void 0})})}catch(t){le.error("could not compress event - will use uncompressed event",t)}return t}(v):v,k={$snapshot_bytes:bt(S),$snapshot_data:S,$session_id:g,$window_id:y};this.status!==tt?this.ie(k):this.Bt()}}}}}get status(){return this.ot({receivedFlags:!0,isRecordingEnabled:!0,isSampled:this.K,urlTriggerMatching:this.Mt,eventTriggerMatching:this.Ft,linkedFlagMatching:this._t,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._t.linkedFlagSeen=!0,this.Xt(),this.Pt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[G]:this.sessionId}),this.Xt(),this.Pt("sampling_overridden")}overrideTrigger(t){this.Ut(t)}te(){this.oe&&(clearTimeout(this.oe),this.oe=void 0)}At(){this.te();var t=this.wt();if(this.status===nt||this.status===it||this.status===tt||t)return this.oe=setTimeout((()=>{this.At()}),2e3),this.Ct;this.Ct.data.length>0&&Ie(this.Ct).forEach((t=>{var e;null==(e=this.ft)||e.trackSize(t.size),this.se({$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.Bt()}ie(t){var e,r=2+((null==(e=this.Ct)?void 0:e.data.length)||0),n=t.$session_id;!this.et&&(this.Ct.size+t.$snapshot_bytes+r>943718.4||this.Ct.sessionId!==n)&&(this.Ct=this.At(),this.Ct.sessionId=n,this.Ct.windowId=t.$window_id),this.Ct.size+=t.$snapshot_bytes,this.Ct.data.push(t.$snapshot_data),this.oe||this.et||(this.oe=setTimeout((()=>{this.At()}),2e3))}se(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.P),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get St(){var t,e,r=null==(t=this.Ct)?void 0:t.data[(null==(e=this.Ct)?void 0:e.data.length)-1],{sessionStartTimestamp:n}=this.X.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-n:null}re(){if(!this.Ct||0===this.Ct.data.length)return this.Bt();for(var t=-1,e=this.Ct.data.length-1;e>=0;e--)if(this.Ct.data[e].type===l.Meta){t=e;break}return t>=0?(this.Ct.data=this.Ct.data.slice(t),this.Ct.size=this.Ct.data.reduce(((t,e)=>t+bt(e)),0),this.Ct):this.Bt()}Bt(){return this.Ct={size:0,data:[],sessionId:this.V,windowId:this.ht},this.Ct}Pt(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),le.info(t.replace("_"," "),e),-1===["recording_initialized","session_id_changed"].indexOf(t)&&this.vt(t,e)}ae(t){var e;return 3===t.type&&-1!==de.indexOf(null==(e=t.data)?void 0:e.source)}ne(t){var e=this.ae(t);e||this.et||t.timestamp-this.$>this.J&&(this.et=!0,clearInterval(this.Kt),this.vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.$,threshold:this.J,bufferLength:this.Ct.data.length,bufferSize:this.Ct.size}),this.At());var r=!1;if(e&&(this.$=t.timestamp,this.et)){var n="unknown"===this.et;this.et=!1,n||(this.vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}if(!this.et){var{windowId:i,sessionId:o}=this.X.checkAndGetSessionAndWindowId(!e,t.timestamp),s=this.V!==o,a=this.ht!==i;this.ht=i,this.V=o,s||a?(this.stop(),this.start("session_id_changed")):r&&this.Jt()}}gt(){var t,e,r,n;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(D),null==(e=this._instance)||null==(e=e.persistence)||e.unregister(W),null==(r=this._instance)||null==(r=r.persistence)||r.unregister(G),null==(n=this._instance)||null==(n=n.persistence)||n.unregister(L)}It(t){var e,r=this.V!==t,n=this.H;if(S(n)){var i=this.K,o=r||!k(i),s=o?ie(t,n):i;o&&(s?this.Pt(et):le.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server."),this.vt("samplingDecisionMade",{sampleRate:n,isSampled:s})),null==(e=this._instance.persistence)||e.register({[G]:!!s&&t})}else{var a;null==(a=this._instance.persistence)||a.unregister(G)}}Qt(){0!==this.Ft.T.length&&w(this.it)&&(this.it=this._instance.on("eventCaptured",(t=>{try{this.Ft.T.includes(t.event)&&this.Ut("event")}catch(t){le.error("Could not activate event trigger",t)}})))}get sdkDebugProperties(){var t,{sessionStartTimestamp:e}=this.X.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.Ct.data.length,$sdk_debug_replay_internal_buffer_size:this.Ct.size,$sdk_debug_current_session_duration:this.St,$sdk_debug_session_start:e,$sdk_debug_replay_flushed_size:null==(t=this.ft)?void 0:t.currentTrackedSize}}$t(){var t;if(!this.q){var e,r,n,i={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 i&&("maskInputOptions"===s?i.maskInputOptions=u({password:!0},a):i[s]=a);if(this.xt&&this.xt.enabled&&(i.recordCanvas=!0,i.sampling={canvas:this.xt.fps},i.dataURLOptions={type:"image/webp",quality:this.xt.quality}),this.Ot)i.maskAllInputs=null===(e=this.Ot.maskAllInputs)||void 0===e||e,i.maskTextSelector=null!==(r=this.Ot.maskTextSelector)&&void 0!==r?r:void 0,i.blockSelector=null!==(n=this.Ot.blockSelector)&&void 0!==n?n:void 0;var l=he();if(l){this.ee=null!==(t=this.ee)&&void 0!==t?t:new ne(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";le.info(r,{node:e}),this.log(ue+" "+r,"warn")}});var d=this.Et();this.q=l(u({emit:t=>{this.onRRwebEmit(t)},plugins:d},i)),this.$=Date.now(),this.et=k(this.et)?this.et:"unknown",this.tryAddCustomEvent("$remote_config_received",this.j),this.vt("$session_options",{sessionRecordingOptions:i,activePlugins:d.map((t=>null==t?void 0:t.name))}),this.vt("$posthog_config",{config:this._instance.config})}else le.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.vt(t,e)}}var be,Ce=["type"],we=Object.defineProperty,Se=(t,e,r)=>((t,e,r)=>e in t?we(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ke=Object.defineProperty,Ae=(t,e,r)=>((t,e,r)=>e in t?ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),Ne=(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))(Ne||{}),Re={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Te={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var _e={};function Me(t){if(_e[t])return _e[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,n=t in Re?Re[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in Te?Te[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(i&&s)return _e[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?_e[t]=l:e.prototype}catch(t){return e.prototype}}var Fe={};function Be(t,e,r){var n,i=t+"."+String(r);if(Fe[i])return Fe[i].call(e);var o=Me(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Fe[i]=s,s.call(e)):e[r]}var Oe={};function xe(t,e,r){var n=t+"."+String(r);if(Oe[n])return Oe[n].bind(e);var i=Me(t)[r];return"function"!=typeof i?e[r]:(Oe[n]=i,i.bind(e))}var Ze={childNodes:function(t){return Be("Node",t,"childNodes")},parentNode:function(t){return Be("Node",t,"parentNode")},parentElement:function(t){return Be("Node",t,"parentElement")},textContent:function(t){return Be("Node",t,"textContent")},contains:function(t,e){return xe("Node",t,"contains")(e)},getRootNode:function(t){return xe("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Be("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Be("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Be("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Be("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Me("MutationObserver").constructor}};function Ye(t){return t.nodeType===t.ELEMENT_NODE}function Ee(t){var e=t&&"host"in t&&"mode"in t&&Ze.host(t)||null;return Boolean(e&&"shadowRoot"in e&&Ze.shadowRoot(e)===t)}function Ge(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function Le(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=Array.from(e,(e=>We(e,t.href))).join("");return(n=r).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}catch(t){return null}var n}function We(t,e){if(function(t){return"styleSheet"in t}(t)){var r;try{r=Le(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?Qe(r,t.styleSheet.href):r}var n,i=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(n,"$1\\$2")),e?Qe(i,e):i}function De(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let Ve=class{constructor(){Ae(this,"idNodeMap",new Map),Ae(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 n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(e,n)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Xe(t){var{element:e,maskInputOptions:r,tagName:n,type:i,value:o,maskInputFn:s}=t,a=o||"",u=i&&ze(i);return(r[n.toLowerCase()]||u&&r[u])&&(a=s?s(a,e):"*".repeat(a.length)),a}function ze(t){return t.toLowerCase()}var Je="__rrweb_original__";function Ke(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ze(e):null}function He(t,e){var r,n;try{n=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}var je=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ue=/^(?:[a-z+]+:)?\/\//i,Pe=/^www\..*/i,qe=/^(data:)([^,]*),(.*)/i;function Qe(t,e){return(t||"").replace(je,((t,r,n,i,o,s)=>{var a,u=n||o||s,l=r||i||"";if(!u)return t;if(Ue.test(u)||Pe.test(u))return"url("+l+u+l+")";if(qe.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 $e,tr,er=1,rr=new RegExp("[^a-z0-9-_:]"),nr=-2;function ir(){return er++}var or=/^[^ \t\n\r\u000c]+/,sr=/^[, \t\n\r\u000c]+/;var ar=new WeakMap;function ur(t,e){return e&&""!==e.trim()?dr(t,e):e}function lr(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function dr(t,e){var r=ar.get(t);if(r||(r=t.createElement("a"),ar.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function cr(t,e,r,n){return n?"src"===r||"href"===r&&("use"!==e||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?ur(t,n):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function n(t){var n,i=t.exec(e.substring(r));return i?(n=i[0],r+=n.length,n):""}for(var i=[];n(sr),!(r>=e.length);){var o=n(or);if(","===o.slice(-1))o=ur(t,o.substring(0,o.length-1)),i.push(o);else{var s="";o=ur(t,o);for(var a=!1;;){var u=e.charAt(r);if(""===u){i.push((o+s).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,i.push((o+s).trim());break}"("===u&&(a=!0)}s+=u,r+=1}}}return i.join(", ")}(t,n):"style"===r?Qe(n,dr(t)):"object"===e&&"data"===r?ur(t,n):n:ur(t,n):n}function hr(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function vr(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&vr(Ze.parentNode(t),e,r);for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}return!!r&&vr(Ze.parentNode(t),e,r)}function fr(t,e,r,n){var i;if(Ye(t)){if(i=t,!Ze.childNodes(i).length)return!1}else{if(null===Ze.parentElement(t))return!1;i=Ze.parentElement(t)}try{if("string"==typeof e){if(n){if(i.closest("."+e))return!0}else if(i.classList.contains(e))return!0}else if(vr(i,e,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(t){}return!1}function mr(t,e){var{doc:r,mirror:n,blockClass:i,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,n);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:Ne.Document,childNodes:[],compatMode:t.compatMode}:{type:Ne.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Ne.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:p};case t.ELEMENT_NODE:return function(t,e){for(var r,{doc:n,blockClass:i,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 n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}if(r)return t.matches(r)}catch(t){}return!1}(t,i,o),p=function(t){if(t instanceof HTMLFormElement)return"form";var e=ze(t.tagName);return rr.test(e)?"div":e}(t),g={},I=t.attributes.length,y=0;y<I;y++){var b=t.attributes[y];hr(p,b.name,b.value)||(g[b.name]=cr(n,p,ze(b.name),b.value))}if("link"===p&&s){var C=function(t){return null==t?void 0:t.href}(t);if(C){var w=De(n,C);if(!w&&C.includes(".css"))w=De(n,window.location.origin+"/"+C.replace(window.location.href,""));var S=null;w&&(S=Le(w)),S&&(delete g.rel,delete g.href,g._cssText=S)}}if("style"===p&&t.sheet&&!(t.innerText||Ze.textContent(t)||"").trim().length){var k=Le(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=Xe({element:t,type:Ke(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 n=0;n<t.height;n+=50){var i=e.getImageData,o=Je in i?i[Je]:i;if(new Uint32Array(o.call(e,r,n,Math.min(50,t.width-r),Math.min(50,t.height-n)).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=n.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){$e||($e=n.createElement("canvas"),tr=$e.getContext("2d"));var _=t,M=_.currentSrc||_.getAttribute("src")||"<unknown-src>",F=_.crossOrigin,B=()=>{_.removeEventListener("load",B);try{$e.width=_.naturalWidth,$e.height=_.naturalHeight,tr.drawImage(_,0,0),g.rr_dataURL=$e.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 O=g;O.rr_mediaState=t.paused?"paused":"played",O.rr_mediaCurrentTime=t.currentTime,O.rr_mediaPlaybackRate=t.playbackRate,O.rr_mediaMuted=t.muted,O.rr_mediaLoop=t.loop,O.rr_mediaVolume=t.volume}v||(t.scrollLeft&&(g.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(g.rr_scrollTop=t.scrollTop));if(m){var{width:x,height:Z}=t.getBoundingClientRect();g={class:g.class,rr_width:x+"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:Ne.Element,tagName:p,attributes:g,childNodes:[],isSVG:lr(t)||void 0,needBlock:m,rootId:f,isCustom:r}}(t,{doc:r,blockClass:i,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:n,maskTextFn:i,rootId:o}=e,s=Ze.parentNode(t),a=s&&s.tagName,u=Ze.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=Le(s.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=Qe(u,dr(e.doc))}d&&(u="SCRIPT_PLACEHOLDER");!l&&!d&&u&&n&&(u=i?i(u,Ze.parentElement(t)):u.replace(/[\S]/g,"*"));return{type:Ne.Text,textContent:u||"",isStyle:l,rootId:o}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:p});case t.CDATA_SECTION_NODE:return{type:Ne.CDATA,textContent:"",rootId:p};case t.COMMENT_NODE:return{type:Ne.Comment,textContent:Ze.textContent(t)||"",rootId:p};default:return!1}}function pr(t){return null==t?"":t.toLowerCase()}function gr(t,e){var{doc:r,mirror:n,blockClass:i,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=fr(t,s,a,void 0===k));var N,R=mr(t,{doc:r,mirror:n,blockClass:i,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=n.hasNode(t)?n.getId(t):!function(t,e){if(e.comment&&t.type===Ne.Comment)return!0;if(t.type===Ne.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"===He(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(pr(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===pr(t.attributes.name)||"icon"===pr(t.attributes.rel)||"apple-touch-icon"===pr(t.attributes.rel)||"shortcut icon"===pr(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&pr(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(pr(t.attributes.property).match(/^(og|twitter|fb):/)||pr(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===pr(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===pr(t.attributes.name)||"googlebot"===pr(t.attributes.name)||"bingbot"===pr(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===pr(t.attributes.name)||"generator"===pr(t.attributes.name)||"framework"===pr(t.attributes.name)||"publisher"===pr(t.attributes.name)||"progid"===pr(t.attributes.name)||pr(t.attributes.property).match(/^article:/)||pr(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===pr(t.attributes.name)||"yandex-verification"===pr(t.attributes.name)||"csrf-token"===pr(t.attributes.name)||"p:domain_verify"===pr(t.attributes.name)||"verify-v1"===pr(t.attributes.name)||"verification"===pr(t.attributes.name)||"shopify-checkout-api-token"===pr(t.attributes.name)))return!0}}return!1}(R,v)&&(A||R.type!==Ne.Text||R.isStyle||R.textContent.replace(/^\s+|\s+$/gm,"").length)?ir():nr;var T=Object.assign(R,{id:N});if(n.add(t,T),N===nr)return null;g&&g(t);var _=!u;if(T.type===Ne.Element){_=_&&!T.needBlock,delete T.needBlock;var M=Ze.shadowRoot(t);M&&Ge(M)&&(T.isShadowHost=!0)}if((T.type===Ne.Document||T.type===Ne.Element)&&_){v.headWhitespace&&T.type===Ne.Element&&"head"===T.tagName&&(A=!1);var F={doc:r,mirror:n,blockClass:i,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===Ne.Element&&"textarea"===T.tagName&&void 0!==T.attributes.value);else for(var B of Array.from(Ze.childNodes(t))){var O=gr(B,F);O&&T.childNodes.push(O)}var x=null;if(Ye(t)&&(x=Ze.shadowRoot(t)))for(var Z of Array.from(Ze.childNodes(x))){var Y=gr(Z,F);Y&&(Ge(x)&&(Y.isShadow=!0),T.childNodes.push(Y))}}var E=Ze.parentNode(t);return E&&Ee(E)&&Ge(E)&&(T.isShadow=!0),T.type===Ne.Element&&"iframe"===T.tagName&&function(t,e,r){var n=t.contentWindow;if(n){var i,o=!1;try{i=n.document.readyState}catch(t){return}if("complete"===i){var s="about:blank";if(n.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=gr(e,{doc:e,mirror:n,blockClass:i,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===Ne.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===He(T.attributes.href))&&function(t,e,r){var n,i=!1;try{n=t.sheet}catch(t){return}if(!n){var o=setTimeout((()=>{i||(e(),i=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),i=!0,e()}))}}(t,(()=>{if(b){var e=gr(t,{doc:r,mirror:n,blockClass:i,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 Ir=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 yr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},br={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var Cr={};function wr(t){if(Cr[t])return Cr[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,n=t in yr?yr[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in br?br[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(i&&s)return Cr[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?Cr[t]=l:r}catch(t){return r}}var Sr={};function kr(t,e,r){var n,i=t+"."+String(r);if(Sr[i])return Sr[i].call(e);var o=wr(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Sr[i]=s,s.call(e)):e[r]}var Ar={};function Nr(t,e,r){var n=t+"."+String(r);if(Ar[n])return Ar[n].bind(e);var i=wr(t)[r];return"function"!=typeof i?e[r]:(Ar[n]=i,i.bind(e))}function Rr(){return wr("MutationObserver").constructor}var Tr={childNodes:function(t){return kr("Node",t,"childNodes")},parentNode:function(t){return kr("Node",t,"parentNode")},parentElement:function(t){return kr("Node",t,"parentElement")},textContent:function(t){return kr("Node",t,"textContent")},contains:function(t,e){return Nr("Node",t,"contains")(e)},getRootNode:function(t){return Nr("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?kr("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?kr("Element",t,"shadowRoot"):null},querySelector:function(t,e){return kr("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return kr("Element",t,"querySelectorAll")(e)},mutationObserver:Rr};function _r(t,e,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)}var Mr="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.",Fr={map:{},getId:()=>(console.error(Mr),-1),getNode:()=>(console.error(Mr),null),removeNodeFromMap(){console.error(Mr)},has:()=>(console.error(Mr),!1),reset(){console.error(Mr)}};function Br(t,e,r){void 0===r&&(r={});var n=null,i=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();i||!1!==r.leading||(i=u);var l=e-(u-i),d=this;l<=0||l>e?(n&&(clearTimeout(n),n=null),i=u,t.apply(d,s)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,t.apply(d,s)}),l))}}function Or(t,e,r,n,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(t,e);return i.Object.defineProperty(t,e,n?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>Or(t,e,o||{},!0)}function xr(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),t[e]=i,()=>{t[e]=n}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Fr=new Proxy(Fr,{get:(t,e,r)=>("map"===e&&console.error(Mr),Reflect.get(t,e,r))}));var Zr=Date.now;function Yr(t){var e,r,n,i,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=Tr.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==(n=Tr.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function Er(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Gr(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Lr(t){return t?t.nodeType===t.ELEMENT_NODE?t:Tr.parentElement(t):null}function Wr(t,e,r,n){if(!t)return!1;var i=Lr(t);if(!i)return!1;try{if("string"==typeof e){if(i.classList.contains(e))return!0;if(n&&null!==i.closest("."+e))return!0}else if(vr(i,e,n))return!0}catch(t){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function Dr(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===nr}function Vr(t,e){if(Ee(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var n=Tr.parentNode(t);return(!n||n.nodeType!==t.DOCUMENT_NODE)&&(!n||Vr(n,e))}function Xr(t){return Boolean(t.changedTouches)}function zr(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Jr(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Kr(t){return!!t&&(t instanceof Ir&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Tr.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Zr=()=>(new Date).getTime());let Hr=class{constructor(){Se(this,"id",1),Se(this,"styleIDMap",new WeakMap),Se(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 jr(t){var e,r=null;return"getRootNode"in t&&(null==(e=Tr.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Tr.host(Tr.getRootNode(t))&&(r=Tr.host(Tr.getRootNode(t))),r}function Ur(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=jr(r);)r=e;return r}(t);return Tr.contains(e,r)}function Pr(t){var e=t.ownerDocument;return!!e&&(Tr.contains(e,t)||Ur(t))}var qr=(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))(qr||{}),Qr=(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))(Qr||{}),$r=(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))($r||{}),tn=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(tn||{}),en=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(en||{}),rn=(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))(rn||{});function nn(t){return"__ln"in t}class on{constructor(){Se(this,"length",0),Se(this,"head",null),Se(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&&nn(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&&nn(t.nextSibling)&&t.nextSibling.__ln.previous){var n=t.nextSibling.__ln.previous;e.previous=n,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,n&&(n.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 sn,an=(t,e)=>t+"@"+e;class un{constructor(){Se(this,"frozen",!1),Se(this,"locked",!1),Se(this,"texts",[]),Se(this,"attributes",[]),Se(this,"attributeMap",new WeakMap),Se(this,"removes",[]),Se(this,"mapRemoves",[]),Se(this,"movedMap",{}),Se(this,"addedSet",new Set),Se(this,"movedSet",new Set),Se(this,"droppedSet",new Set),Se(this,"mutationCb"),Se(this,"blockClass"),Se(this,"blockSelector"),Se(this,"maskTextClass"),Se(this,"maskTextSelector"),Se(this,"inlineStylesheet"),Se(this,"maskInputOptions"),Se(this,"maskTextFn"),Se(this,"maskInputFn"),Se(this,"keepIframeSrcFn"),Se(this,"recordCanvas"),Se(this,"inlineImages"),Se(this,"slimDOMOptions"),Se(this,"dataURLOptions"),Se(this,"doc"),Se(this,"mirror"),Se(this,"iframeManager"),Se(this,"stylesheetManager"),Se(this,"shadowDomManager"),Se(this,"canvasManager"),Se(this,"processedNodeManager"),Se(this,"unattachedDoc"),Se(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),Se(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new on,n=t=>{for(var e=t,r=nr;r===nr;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},i=i=>{var o=Tr.parentNode(i);if(o&&Pr(i)&&"TEXTAREA"!==o.tagName){var s=Ee(o)?this.mirror.getId(jr(i)):this.mirror.getId(o),a=n(i);if(-1===s||-1===a)return r.addNode(i);var u=gr(i,{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=>{zr(t,this.mirror)&&this.iframeManager.addIframe(t),Jr(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Kr(i)&&this.shadowDomManager.addShadowRoot(Tr.shadowRoot(i),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)dn(this.removes,o,this.mirror)&&!this.movedSet.has(Tr.parentNode(o))||i(o);for(var s of this.addedSet)cn(this.droppedSet,s)||dn(this.removes,s,this.mirror)?cn(this.movedSet,s)?i(s):this.droppedSet.add(s):i(s);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(Tr.parentNode(a.value)),d=n(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(Tr.parentNode(h.value));if(-1===n(h.value))continue;if(-1!==v){u=h;break}var f=h.value,m=Tr.parentNode(f);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=Tr.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),i(u.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=Tr.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),n=JSON.stringify(t._unchangedStyles);r.length<e.style.length&&(r+n).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))}})),Se(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(Tr.childNodes(t),(t=>Tr.textContent(t)||"")).join("")})),Se(this,"processMutation",(t=>{if(!Dr(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=Tr.textContent(t.target);Wr(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:fr(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Lr(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,n=t.attributeName,i=t.target.getAttribute(n);if("value"===n){var o=Ke(r);i=Xe({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(Wr(t.target,this.blockClass,this.blockSelector,!1)||i===t.oldValue)return;var s=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(r.contentDocument)return;n="rr_src"}if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(t.target,s)),"type"===n&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!hr(r.tagName,n))if(s.attributes[n]=cr(this.doc,ze(r.tagName),ze(n),i),"style"===n){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"===n&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(Wr(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),n=Ee(t.target)?this.mirror.getId(Tr.host(t.target)):this.mirror.getId(t.target);Wr(t.target,this.blockClass,this.blockSelector,!1)||Dr(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(ln(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Vr(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[an(r,n)]?ln(this.movedSet,e):this.removes.push({parentId:n,id:r,isShadow:!(!Ee(t.target)||!Ge(t.target))||void 0})),this.mapRemoves.push(e))}))}})),Se(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Dr(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[an(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Wr(t,this.blockClass,this.blockSelector,!1)||(Tr.childNodes(t).forEach((t=>this.genAdds(t))),Kr(t)&&Tr.childNodes(Tr.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 ln(t,e){t.delete(e),Tr.childNodes(e).forEach((e=>ln(t,e)))}function dn(t,e,r){return 0!==t.length&&function(t,e,r){var n,i=Tr.parentNode(e),o=function(){var e=r.getId(i);if(t.some((t=>t.id===e)))return{v:!0};i=Tr.parentNode(i)};for(;i;)if(n=o())return n.v;return!1}(t,e,r)}function cn(t,e){return 0!==t.size&&hn(t,e)}function hn(t,e){var r=Tr.parentNode(e);return!!r&&(!!t.has(r)||hn(t,r))}var vn=t=>{if(!sn)return t;return function(){try{return t(...arguments)}catch(t){if(sn&&!0===sn(t))return;throw t}}},fn=[];function mn(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 pn(t,e){var r=new un;fn.push(r),r.init(t);var n=new(Rr())(vn(r.processMutations.bind(r)));return n.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function gn(t){var{mouseInteractionCb:e,doc:r,mirror:n,blockClass:i,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($r).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==a[t])).forEach((t=>{var s=ze(t),a=(t=>r=>{var s=mn(r);if(!Wr(s,i,o,!0)){var a=null,l=t;if("pointerType"in r){switch(r.pointerType){case"mouse":a=tn.Mouse;break;case"touch":a=tn.Touch;break;case"pen":a=tn.Pen}a===tn.Touch?$r[t]===$r.MouseDown?l="TouchStart":$r[t]===$r.MouseUp&&(l="TouchEnd"):tn.Pen}else Xr(r)&&(a=tn.Touch);null!==a?(d=a,(l.startsWith("Touch")&&a===tn.Touch||l.startsWith("Mouse")&&a===tn.Mouse)&&(a=null)):$r[t]===$r.Click&&(a=d,d=null);var c=Xr(r)?r.changedTouches[0]:r;if(c){var h=n.getId(s),{clientX:v,clientY:f}=c;vn(e)(u({type:$r[l],id:h,x:v,y:f},null!==a&&{pointerType:a}))}}})(t);if(window.PointerEvent)switch($r[t]){case $r.MouseDown:case $r.MouseUp:s=s.replace("mouse","pointer");break;case $r.TouchStart:case $r.TouchEnd:return}l.push(_r(s,a,r))})),vn((()=>{l.forEach((t=>t()))}))}function In(t){var{scrollCb:e,doc:r,mirror:n,blockClass:i,blockSelector:o,sampling:s}=t;return _r("scroll",vn(Br(vn((t=>{var s=mn(t);if(s&&!Wr(s,i,o,!0)){var a=n.getId(s);if(s===r&&r.defaultView){var u=Yr(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 yn=["INPUT","TEXTAREA","SELECT"],bn=new WeakMap;function Cn(t){return function(t,e){if(An("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||An("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||An("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||An("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var r=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(r)}else if(t.parentStyleSheet){var n=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(n)}return e}(t,[])}function wn(t,e,r){var n,i;return t?(t.ownerNode?n=e.getId(t.ownerNode):i=r.getId(t),{styleId:i,id:n}):{}}function Sn(t,e){var r,n,i,{mirror:o,stylesheetManager:s}=t,a=null;a="#document"===e.nodeName?o.getId(e):o.getId(Tr.host(e));var u="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(i=null==(n=e.ownerDocument)?void 0:n.defaultView)?void 0:i.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}}),vn((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function kn(t,e){void 0===e&&(e={});var r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,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),n(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),i(...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=pn(t,t.doc));var i=function(t){var{mousemoveCb:e,sampling:r,doc:n,mirror:i}=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=Br(vn((t=>{var r=Date.now()-o;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],o=null})),a),d=vn(Br(vn((t=>{var e=mn(t),{clientX:r,clientY:n}=Xr(t)?t.changedTouches[0]:t;o||(o=Zr()),u.push({x:r,y:n,id:i.getId(e),timeOffset:Zr()-o}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?Qr.Drag:t instanceof MouseEvent?Qr.MouseMove:Qr.TouchMove)})),s,{trailing:!1})),c=[_r("mousemove",d,n),_r("touchmove",d,n),_r("drag",d,n)];return vn((()=>{c.forEach((t=>t()))}))}(t),o=gn(t),s=In(t),a=function(t,e){var{viewportResizeCb:r}=t,{win:n}=e,i=-1,o=-1;return _r("resize",vn(Br(vn((()=>{var t=Er(),e=Gr();i===t&&o===e||(r({width:Number(e),height:Number(t)}),i=t,o=e)})),200)),n)}(t,{win:n}),l=function(t){var{inputCb:e,doc:r,mirror:n,blockClass:i,blockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:d,sampling:c,userTriggeredOnInput:h}=t;function v(t){var e=mn(t),n=t.isTrusted,u=e&&e.tagName;if(e&&"OPTION"===u&&(e=Tr.parentElement(e)),e&&u&&!(yn.indexOf(u)<0)&&!Wr(e,i,o,!0)&&!(e.classList.contains(s)||a&&e.matches(a))){var c=e.value,v=!1,m=Ke(e)||"";"radio"===m||"checkbox"===m?v=e.checked:(l[u.toLowerCase()]||l[m])&&(c=Xe({element:e,maskInputOptions:l,tagName:u,type:m,value:c,maskInputFn:d})),f(e,h?{text:c,isChecked:v,userTriggered:n}:{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 i=bn.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){bn.set(t,r);var o=n.getId(t);vn(e)(u({},r,{id:o}))}}var m=("last"===c.input?["change"]:["input","change"]).map((t=>_r(t,vn(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=>Or(t[0],t[1],{set(){vn(v)({target:this,isTrusted:!1})}},!1,p)))),vn((()=>{m.forEach((t=>t()))}))}(t),d=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:n,mirror:i,sampling:o,doc:s}=t,a=vn((t=>Br(vn((o=>{var s=mn(o);if(s&&!Wr(s,r,n,!0)){var{currentTime:a,volume:u,muted:l,playbackRate:d,loop:c}=s;e({type:t,id:i.getId(s),currentTime:a,volume:u,muted:l,playbackRate:d,loop:c})}})),o.media||500))),u=[_r("play",a(rn.Play),s),_r("pause",a(rn.Pause),s),_r("seeked",a(rn.Seeked),s),_r("volumechange",a(rn.VolumeChange),s),_r("ratechange",a(rn.RateChange),s)];return vn((()=>{u.forEach((t=>t()))}))}(t),c=()=>{},h=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:r,mirror:n,stylesheetManager:i}=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:vn(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=wn(e,n,i.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 n=t+" { "+e+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};var a,u,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:vn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=wn(e,n,i.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:vn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=wn(e,n,i.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:vn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=wn(e,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:s}),t.apply(e,o)}))}));var d={};Nn("CSSGroupingRule")?d.CSSGroupingRule=o.CSSGroupingRule:(Nn("CSSMediaRule")&&(d.CSSMediaRule=o.CSSMediaRule),Nn("CSSConditionRule")&&(d.CSSConditionRule=o.CSSConditionRule),Nn("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:vn(((t,e,o)=>{var[s,a]=o,{id:u,styleId:l}=wn(e.parentStyleSheet,n,i.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:s,index:[...Cn(e),a||0]}]}),t.apply(e,o)}))}),o.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:vn(((t,e,o)=>{var[s]=o,{id:a,styleId:u}=wn(e.parentStyleSheet,n,i.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...Cn(e),s]}]}),t.apply(e,o)}))})})),vn((()=>{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:n}),h=Sn(t,t.doc),v=function(t,e){var{styleDeclarationCb:r,mirror:n,ignoreCSSAttributes:i,stylesheetManager:o}=t,{win:s}=e,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:vn(((t,e,s)=>{var u,[l,d,c]=s;if(i.has(l))return a.apply(e,[l,d,c]);var{id:h,styleId:v}=wn(null==(u=e.parentRule)?void 0:u.parentStyleSheet,n,o.styleMirror);return(h&&-1!==h||v&&-1!==v)&&r({id:h,styleId:v,set:{property:l,value:d,priority:c},index:Cn(e.parentRule)}),t.apply(e,s)}))});var u=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:vn(((t,e,s)=>{var a,[l]=s;if(i.has(l))return u.apply(e,[l]);var{id:d,styleId:c}=wn(null==(a=e.parentRule)?void 0:a.parentStyleSheet,n,o.styleMirror);return(d&&-1!==d||c&&-1!==c)&&r({id:d,styleId:c,remove:{property:l},index:Cn(e.parentRule)}),t.apply(e,s)}))}),vn((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:r}=t,n=r.defaultView;if(!n)return()=>{};var i=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(t,e,r){var n=new s(t,e,r);return o.set(n,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),n};var a=xr(r.fonts,"add",(function(t){return function(r){return setTimeout(vn((()=>{var t=o.get(r);t&&(e(t),o.delete(r))})),0),t.apply(this,[r])}}));return i.push((()=>{n.FontFace=s})),i.push(a),vn((()=>{i.forEach((t=>t()))}))}(t)));var m=function(t){var{doc:e,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=t,s=!0,a=vn((()=>{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;Wr(c,n,i,!0)||Wr(v,n,i,!0)||a.push({start:r.getId(c),startOffset:h,end:r.getId(v),endOffset:f})}o({ranges:a})}}));return a(),_r("selectionchange",a)}(t),p=function(t){var{doc:e,customElementCb:r}=t,n=e.defaultView;return n&&n.customElements?xr(n.customElements,"define",(function(t){return function(e,n,i){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,n,i])}})):()=>{}}(t),g=[];for(var I of t.plugins)g.push(I.observer(I.callback,n,I.options));return vn((()=>{fn.forEach((t=>t.reset())),null==r||r.disconnect(),i(),o(),s(),a(),l(),d(),c(),h(),v(),f(),m(),p(),g.forEach((t=>t()))}))}function An(t){return void 0!==window[t]}function Nn(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Rn{constructor(t){Se(this,"iframeIdToRemoteIdMap",new WeakMap),Se(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,n){var i=r||this.getIdToRemoteIdMap(t),o=n||this.getRemoteIdToIdMap(t),s=i.get(e);return s||(s=this.generateIdFn(),i.set(e,s),o.set(s,e)),s}getIds(t,e){var r=this.getIdToRemoteIdMap(t),n=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,n)))}getRemoteId(t,e,r){var n=r||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var i=n.get(e);return i||-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 Tn{constructor(t){Se(this,"iframes",new WeakMap),Se(this,"crossOriginIframeMap",new WeakMap),Se(this,"crossOriginIframeMirror",new Rn(ir)),Se(this,"crossOriginIframeStyleMirror"),Se(this,"crossOriginIframeRootIdMap",new WeakMap),Se(this,"mirror"),Se(this,"mutationCb"),Se(this,"wrappedEmit"),Se(this,"loadListener"),Se(this,"stylesheetManager"),Se(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Rn(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,n;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==(n=this.loadListener)||n.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 n=this.transformCrossOriginEvent(r,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case qr.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var n=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,n),this.patchRootIdOnNode(e.data.node,n),{timestamp:e.timestamp,type:qr.IncrementalSnapshot,data:{source:Qr.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case qr.Meta:case qr.Load:case qr.DomContentLoaded:return!1;case qr.Plugin:return e;case qr.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case qr.IncrementalSnapshot:switch(e.data.source){case Qr.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 Qr.Drag:case Qr.TouchMove:case Qr.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Qr.ViewportResize:return!1;case Qr.MediaInteraction:case Qr.MouseInteraction:case Qr.Scroll:case Qr.CanvasMutation:case Qr.Input:return this.replaceIds(e.data,t,["id"]),e;case Qr.StyleSheetRule:case Qr.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Qr.Font:return e;case Qr.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Qr.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,n){for(var i of n)(Array.isArray(e[i])||"number"==typeof e[i])&&(Array.isArray(e[i])?e[i]=t.getIds(r,e[i]):e[i]=t.getId(r,e[i]));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===Ne.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class _n{constructor(t){Se(this,"shadowDoms",new WeakSet),Se(this,"mutationCb"),Se(this,"scrollCb"),Se(this,"bypassOptions"),Se(this,"mirror"),Se(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(Ge(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var r=pn(u({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(In(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(Tr.host(t))),this.restoreHandlers.push(Sn({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(xr(t.prototype,"attachShadow",(function(t){return function(n){var i=t.call(this,n),o=Tr.shadowRoot(this);return o&&Pr(this)&&r.addShadowRoot(o,e),i}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Mn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Bn=0;Bn<64;Bn++)Fn[Mn.charCodeAt(Bn)]=Bn;var On=new Map;var xn=(t,e,r)=>{if(t&&(En(t,e)||"object"==typeof t)){var n=function(t,e){var r=On.get(t);return r||(r=new Map,On.set(t,r)),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),i=n.indexOf(t);return-1===i&&(i=n.length,n.push(t)),i}};function Zn(t,e,r){if(t instanceof Array)return t.map((t=>Zn(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),n=r.length,i="";for(e=0;e<n;e+=3)i+=Mn[r[e]>>2],i+=Mn[(3&r[e])<<4|r[e+1]>>4],i+=Mn[(15&r[e+1])<<2|r[e+2]>>6],i+=Mn[63&r[e+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[Zn(t.buffer,e,r),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var n=t.constructor.name,{src:i}=t;return{rr_type:n,src:i}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[Zn(t.data,e,r),t.width,t.height]}:En(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:xn(t,e,r)}:t}var Yn=(t,e,r)=>t.map((t=>Zn(t,e,r))),En=(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 Gn(t,e,r,n){var i=[];try{var o=xr(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!Wr(this,e,r,!0)){var u=function(t){return"experimental-webgl"===t?"webgl":t}(i);if("__context"in this||(this.__context=u),n&&["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,[i,...s])}}));i.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((t=>t()))}}function Ln(t,e,r,n,i,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=xr(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(xn(d,o,this),"tagName"in this.canvas&&!Wr(this.canvas,n,i,!0)){var c=Yn(u,o,this),h={type:e,property:a,args:c};r(this.canvas,h)}return d}}));s.push(u)}catch(n){var l=Or(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 Wn,Dn,Vn,Xn,zn="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Jn="undefined"!=typeof window&&window.Blob&&new Blob([(Wn=zn,Uint8Array.from(atob(Wn),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Kn(t){var e;try{if(!(e=Jn&&(window.URL||window.webkitURL).createObjectURL(Jn)))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,"+zn,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Hn{constructor(t){Se(this,"pendingCanvasMutations",new Map),Se(this,"rafStamps",{latestId:0,invokeId:null}),Se(this,"mirror"),Se(this,"mutationCb"),Se(this,"resetObservers"),Se(this,"frozen",!1),Se(this,"locked",!1),Se(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:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,n,i,{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,n,i){var o=this,s=Gn(e,r,n,!0),u=new Map,l=new Kn;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:n,width:i,height:o}=t.data;this.mutationCb({id:e,type:en["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},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=>{Wr(t,r,n,!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 n=t.getContext(t.__context);!1===(null==(e=null==n?void 0:n.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&n.clear(n.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:i.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 n=Gn(t,e,r,!1),i=function(t,e,r,n){var i=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var s=xr(e.CanvasRenderingContext2D.prototype,o,(function(i){return function(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];return Wr(this.canvas,r,n,!0)||setTimeout((()=>{var r=Yn(a,e,this);t(this.canvas,{type:en["2D"],property:o,args:r})}),0),i.apply(this,a)}}));i.push(s)}catch(r){var a=Or(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:en["2D"],property:o,args:[e],setter:!0})}});i.push(a)}};for(var a of o)s(a);return()=>{i.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r),o=function(t,e,r,n){var i=[];return i.push(...Ln(e.WebGLRenderingContext.prototype,en.WebGL,t,r,n,e)),void 0!==e.WebGL2RenderingContext&&i.push(...Ln(e.WebGL2RenderingContext.prototype,en.WebGL2,t,r,n,e)),()=>{i.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r);this.resetObservers=()=>{n(),i(),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 n=r.map((t=>{var e=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,Ce);return e})),{type:i}=r[0];this.mutationCb({id:e,type:i,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class jn{constructor(t){Se(this,"trackedLinkElements",new WeakSet),Se(this,"mutationCb"),Se(this,"adoptedStyleSheetCb"),Se(this,"styleMirror",new Hr),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 n={id:e,styleIds:[]},i=[],o=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),i.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:We(e,t.href),index:r})))})),n.styleIds.push(e)};for(var s of t)o(s);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Un{constructor(){Se(this,"nodeMap",new WeakMap),Se(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 Pn=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var qn=document.createElement("iframe");document.body.appendChild(qn),Array.from=(null==(be=qn.contentWindow)?void 0:be.Array.from)||Array.from,document.body.removeChild(qn)}}catch(t){console.debug("Unable to override Array.from",t)}var Qn,$n,ti=new Ve;function ei(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="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;sn=B;var O=!k||window.parent===window,x=!1;if(!O)try{window.parent.document&&(x=!1)}catch(t){x=!0}if(O&&!e)throw new Error("emit function is required");if(!O&&!x)return()=>{};void 0!==C&&void 0===y.mousemove&&(y.mousemove=C),ti.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&&!x&&(t=I(t)),t};Dn=(t,i)=>{var o,s=t;if(s.timestamp=Zr(),!(null==(o=fn[0])?void 0:o.isFrozen())||s.type===qr.FullSnapshot||s.type===qr.IncrementalSnapshot&&s.data.source===Qr.Mutation||fn.forEach((t=>t.unfreeze())),O)null==e||e(L(s),i);else if(x){var a={type:"rrweb",event:L(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(s.type===qr.FullSnapshot)Z=s,G=0;else if(s.type===qr.IncrementalSnapshot){if(s.data.source===Qr.Mutation&&s.data.isAttachIframe)return;G++;var u=n&&G>=n,l=r&&s.timestamp-Z.timestamp>r;(u||l)&&Vn(!0)}};var W=t=>{Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.Mutation},t)})},D=t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.Scroll},t)}),V=t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.CanvasMutation},t)}),X=new jn({mutationCb:W,adoptedStyleSheetCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.AdoptedStyleSheet},t)})}),z=new Tn({mirror:ti,mutationCb:W,stylesheetManager:X,recordCrossOriginIframes:k,wrappedEmit:Dn});for(var J of _||[])J.getMirror&&J.getMirror({nodeMirror:ti,crossOriginIframeMirror:z.crossOriginIframeMirror,crossOriginIframeStyleMirror:z.crossOriginIframeStyleMirror});var K=new Un;Xn=new Hn({recordCanvas:S,mutationCb:V,win:window,blockClass:i,blockSelector:o,mirror:ti,sampling:y.canvas,dataURLOptions:b});var H=new _n({mutationCb:W,scrollCb:D,bypassOptions:{blockClass:i,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:Xn,keepIframeSrcFn:M,processedNodeManager:K},mirror:ti});Vn=function(t){if(void 0===t&&(t=!1),w){Dn({type:qr.Meta,data:{href:window.location.href,width:Gr(),height:Er()}},t),X.reset(),H.init(),fn.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new Ve,blockClass:n="rr-block",blockSelector:i=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 gr(t,{doc:t,mirror:r,blockClass:n,blockSelector:i,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:ti,blockClass:i,blockSelector:o,maskTextClass:l,maskTextSelector:d,inlineStylesheet:c,maskAllInputs:Y,maskTextFn:p,maskInputFn:m,slimDOM:E,dataURLOptions:b,recordCanvas:S,inlineImages:T,onSerialize:t=>{zr(t,ti)&&z.addIframe(t),Jr(t,ti)&&X.trackLinkElement(t),Kr(t)&&H.addShadowRoot(Tr.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");Dn({type:qr.FullSnapshot,data:{node:e,initialOffset:Yr(window)}},t),fn.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&X.adoptStyleSheets(document.adoptedStyleSheets,ti.getId(document))}};try{var j=[],U=t=>{var e;return vn(kn)({mutationCb:W,mousemoveCb:(t,e)=>Dn({type:qr.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.MouseInteraction},t)}),scrollCb:D,viewportResizeCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.ViewportResize},t)}),inputCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.Input},t)}),mediaInteractionCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.MediaInteraction},t)}),styleSheetRuleCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.StyleSheetRule},t)}),styleDeclarationCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.StyleDeclaration},t)}),canvasMutationCb:V,fontCb:t=>Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.Font},t)}),selectionCb:t=>{Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.Selection},t)})},customElementCb:t=>{Dn({type:qr.IncrementalSnapshot,data:u({source:Qr.CustomElement},t)})},blockClass:i,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:ti,iframeManager:z,stylesheetManager:X,shadowDomManager:H,processedNodeManager:K,canvasManager:Xn,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=>Dn({type:qr.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},g)};z.addLoadListener((t=>{try{j.push(U(t.contentDocument))}catch(t){console.warn(t)}}));var P=()=>{Vn(),j.push(U(document)),Pn=!0};return"interactive"===document.readyState||"complete"===document.readyState?P():(j.push(_r("DOMContentLoaded",(()=>{Dn({type:qr.DomContentLoaded,data:{}}),"DOMContentLoaded"===A&&P()}))),j.push(_r("load",(()=>{Dn({type:qr.Load,data:{}}),"load"===A&&P()}),window))),()=>{j.forEach((t=>t())),K.destroy(),Pn=!1,sn=void 0}}catch(t){console.warn(t)}}ei.addCustomEvent=(t,e)=>{if(!Pn)throw new Error("please add custom event after start recording");Dn({type:qr.Custom,data:{tag:t,payload:e}})},ei.freezePage=()=>{fn.forEach((t=>t.freeze()))},ei.takeFullSnapshot=t=>{if(!Pn)throw new Error("please take full snapshot after start recording");Vn(t)},ei.mirror=ti,($n=Qn||(Qn={}))[$n.NotStarted=0]="NotStarted",$n[$n.Running=1]="Running",$n[$n.Stopped=2]="Stopped";var ri,ni=Object.defineProperty,ii=(t,e,r)=>((t,e,r)=>e in t?ni(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),oi=Object.defineProperty,si=(t,e,r)=>((t,e,r)=>e in t?oi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),ai=Object.defineProperty,ui=(t,e,r)=>((t,e,r)=>e in t?ai(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),li={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},di={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ci={};function hi(t){if(ci[t])return ci[t];var e=globalThis[t],r=e.prototype,n=t in li?li[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in di?di[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(i&&s)return ci[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?ci[t]=l:r}catch(t){return r}}var vi={};function fi(t,e,r){var n,i=t+"."+String(r);if(vi[i])return vi[i].call(e);var o=hi(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(vi[i]=s,s.call(e)):e[r]}var mi={};function pi(t,e,r){var n=t+"."+String(r);if(mi[n])return mi[n].bind(e);var i=hi(t)[r];return"function"!=typeof i?e[r]:(mi[n]=i,i.bind(e))}var gi={childNodes:function(t){return fi("Node",t,"childNodes")},parentNode:function(t){return fi("Node",t,"parentNode")},parentElement:function(t){return fi("Node",t,"parentElement")},textContent:function(t){return fi("Node",t,"textContent")},contains:function(t,e){return pi("Node",t,"contains")(e)},getRootNode:function(t){return pi("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?fi("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?fi("Element",t,"shadowRoot"):null},querySelector:function(t,e){return fi("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return fi("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return hi("MutationObserver").constructor}};class Ii{constructor(){ui(this,"idNodeMap",new Map),ui(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 n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(e,n)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function yi(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&yi(gi.parentNode(t),e,r);for(var n=t.classList.length;n--;){var i=t.classList[n];if(e.test(i))return!0}return!!r&&yi(gi.parentNode(t),e,r)}class bi{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 bi))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 Ci={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},wi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Si={};function ki(t){if(Si[t])return Si[t];var e=globalThis[t],r=e.prototype,n=t in Ci?Ci[t]:void 0,i=Boolean(n&&n.every((t=>{var e,n;return Boolean(null==(n=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:n.toString().includes("[native code]"))}))),o=t in wi?wi[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(i&&s)return Si[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?Si[t]=l:r}catch(t){return r}}var Ai={};function Ni(t,e,r){var n,i=t+"."+String(r);if(Ai[i])return Ai[i].call(e);var o=ki(t),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Ai[i]=s,s.call(e)):e[r]}var Ri={};function Ti(t,e,r){var n=t+"."+String(r);if(Ri[n])return Ri[n].bind(e);var i=ki(t)[r];return"function"!=typeof i?e[r]:(Ri[n]=i,i.bind(e))}var _i={childNodes:function(t){return Ni("Node",t,"childNodes")},parentNode:function(t){return Ni("Node",t,"parentNode")},parentElement:function(t){return Ni("Node",t,"parentElement")},textContent:function(t){return Ni("Node",t,"textContent")},contains:function(t,e){return Ti("Node",t,"contains")(e)},getRootNode:function(t){return Ti("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ni("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ni("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ni("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ni("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return ki("MutationObserver").constructor}};var Mi="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.",Fi={map:{},getId:()=>(console.error(Mi),-1),getNode:()=>(console.error(Mi),null),removeNodeFromMap(){console.error(Mi)},has:()=>(console.error(Mi),!1),reset(){console.error(Mi)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Fi=new Proxy(Fi,{get:(t,e,r)=>("map"===e&&console.error(Mi),Reflect.get(t,e,r))}));var Bi=Date.now;function Oi(t){return t?t.nodeType===t.ELEMENT_NODE?t:_i.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(Bi=()=>(new Date).getTime());function xi(t){var e,r=null;return"getRootNode"in t&&(null==(e=_i.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&_i.host(_i.getRootNode(t))&&(r=_i.host(_i.getRootNode(t))),r}function Zi(t){for(var e,r=t;e=xi(r);)r=e;return r}function Yi(t){var e=t.ownerDocument;if(!e)return!1;var r=Zi(t);return _i.contains(e,r)}for(var Ei=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){si(this,"id",1),si(this,"styleIDMap",new WeakMap),si(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 Fi},closestElementOfNode:Oi,getBaseDimension:function t(e,r){var n,i,o=null==(i=null==(n=e.ownerDocument)?void 0:n.defaultView)?void 0:i.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 n=e[r[0]];return 1===r.length?n:t(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(t){var e=[...t],r=e.pop();return{positions:e,index:r}},getRootShadowHost:Zi,getShadowHost:xi,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,r,n,i,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=_i.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==(n=_i.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof bi&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(_i.shadowRoot(t)))},hookSetter:function t(e,r,n,i,o){void 0===o&&(o=window);var s=o.Object.getOwnPropertyDescriptor(e,r);return o.Object.defineProperty(e,r,i?n:{set(t){setTimeout((()=>{n.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&&(_i.contains(e,t)||Yi(t))},isAncestorRemoved:function t(e,r){if(i=(n=e)&&"host"in n&&"mode"in n&&gi.host(n)||null,Boolean(i&&"shadowRoot"in i&&gi.shadowRoot(i)===n))return!1;var n,i,o=r.getId(e);if(!r.has(o))return!0;var s=_i.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||t(s,r))},isBlocked:function(t,e,r,n){if(!t)return!1;var i=Oi(t);if(!i)return!1;try{if("string"==typeof e){if(i.classList.contains(e))return!0;if(n&&null!==i.closest("."+e))return!0}else if(yi(i,e,n))return!0}catch(t){}if(r){if(i.matches(r))return!0;if(n&&null!==i.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 n=e.children.length-1;n>=0;n--)t(e.children[n],r)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return Bi},on:function(t,e,r){void 0===r&&(r=document);var n={capture:!0,passive:!0};return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)},patch:function(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),t[e]=i,()=>{t[e]=n}}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 n={value:t,parent:r,children:[]};return e[t.node.id]=n,n},n=[];for(var i of t){var{nextId:o,parentId:s}=i;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(i,a.parent))}else{var l=n.indexOf(a);n.splice(l,0,r(i,null))}}else if(s in e){var d=e[s];d.children.push(r(i,d))}else n.push(r(i,null))}return n},shadowHostInDom:Yi,throttle:function(t,e,r){void 0===r&&(r={});var n=null,i=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();i||!1!==r.leading||(i=u);var l=e-(u-i),d=this;l<=0||l>e?(n&&(clearTimeout(n),n=null),i=u,t.apply(d,s)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,t.apply(d,s)}),l))}},uniqueTextMutations:function(t){for(var e=new Set,r=[],n=t.length;n--;){var i=t[n];e.has(i.id)||(r.push(i),e.add(i.id))}return r}},Symbol.toStringTag,{value:"Module"})),Gi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Li="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Wi=0;Wi<64;Wi++)Li[Gi.charCodeAt(Wi)]=Wi;var Di;"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 Vi=document.createElement("iframe");document.body.appendChild(Vi),Array.from=(null==(ri=Vi.contentWindow)?void 0:ri.Array.from)||Array.from,document.body.removeChild(Vi)}}catch(t){console.debug("Unable to override Array.from",t)}new Ii,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(Di||(Di={}));class Xi{constructor(t){ii(this,"fileName"),ii(this,"functionName"),ii(this,"lineNumber"),ii(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 zi=/(^|@)\S+:\d+/,Ji=/^\s*at .*(\S+:\d+|\(native\))/m,Ki=/^(eval@)?(\[native code])?$/,Hi={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Ji)?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(Ji)}),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+)\)$)/),n=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Xi({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Ki)}),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 Xi({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(t.replace(e,""));return new Xi({functionName:n,fileName:i[0],lineNumber:i[1],columnNumber:i[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"),n=[],i=2,o=r.length;i<o;i+=2){var s=e.exec(r[i]);s&&n.push(new Xi({fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),n=[],i=0,o=r.length;i<o;i+=2){var s=e.exec(r[i]);s&&n.push(new Xi({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(zi)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),n=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Xi({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function ji(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var n=t.parentElement,i=[];if(n.children&&n.children.length>0)for(var o=0;o<n.children.length;o++){var s=n.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&i.push(s)}i.length>1&&(r+=":eq("+i.indexOf(t)+")"),e=r+(e?">"+e:""),t=n}return e}function Ui(t){return"[object Object]"===Object.prototype.toString.call(t)}function Pi(t,e){if(0===e)return!0;var r=Object.keys(t);for(var n of r)if(Ui(t[n])&&Pi(t[n],e-1))return!0;return!1}function qi(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var n=[],i=[];return JSON.stringify(t,(function(t,e){if(n.length>0){var o=n.indexOf(this);~o?n.splice(o+1):n.push(this),~o?i.splice(o,1/0,t):i.push(t),~n.indexOf(e)&&(e=n[0]===e?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(e)).join(".")+"]")}else n.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Ui(t)&&Object.keys(t).length>r.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Ui(t)&&Pi(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]=ji(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 Qi={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 $i(t,e,r){var n,i=r?Object.assign({},Qi,r):Qi,o=i.logger;if(!o)return()=>{};n="string"==typeof o?e[o]:o;var s=0,a=!1,u=[];if(i.level.includes("error")){var l=e=>{var r=e.message,n=e.error,o=Hi.parse(n).map((t=>t.toString())),s=[qi(r,i.stringifyOptions)];t({level:"error",trace:o,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var d=e=>{var r,n;e.reason instanceof Error?n=[qi("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,i.stringifyOptions)]:(r=new Error,n=[qi("Uncaught (in promise)",i.stringifyOptions),qi(e.reason,i.stringifyOptions)]);var o=Hi.parse(r).map((t=>t.toString()));t({level:"error",trace:o,payload:n})};e.addEventListener("unhandledrejection",d),u.push((()=>{e.removeEventListener("unhandledrejection",d)}))}for(var c of i.level)u.push(h(n,c));return()=>{u.forEach((t=>t()))};function h(e,r){var n=this;return e[r]?Ei.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(n,u),!("assert"===r&&u[0]||a)){a=!0;try{var d=Hi.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>qi(t,i.stringifyOptions)));++s<i.lengthThreshold?t({level:r,trace:d,payload:c}):s===i.lengthThreshold&&t({level:"warn",trace:[],payload:[qi("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{a=!1}}})):()=>{}}}var to=t=>({name:"rrweb/console@1",observer:$i,options:t}),eo=t=>t instanceof Document;function ro(t,e,r){try{if(!(e in t))return()=>{};var n=t[e],i=r(n);return g(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=i,()=>{t[e]=n}}catch(t){return()=>{}}}function no(t,e){var r,n=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),i={hostname:n,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==n||!n.trim().length)return i;for(var o of e.payloadHostDenyList)if(n.endsWith(o))return{hostname:n,isHostDenied:!0};return i}var io=F("[Recorder]"),oo=t=>"navigation"===t.entryType,so=t=>"resource"===t.entryType;function ao(t,e,r){if(r.recordInitialRequests){var n=e.performance.getEntries().filter((t=>oo(t)||so(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:n.flatMap((t=>mo({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new e.PerformanceObserver((e=>{var n=e.getEntries().filter((t=>oo(t)||so(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:n.flatMap((t=>mo({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return i.observe({entryTypes:o}),()=>{i.disconnect()}}function uo(t,e){return!!e&&(k(e)||e[t])}function lo(t){var{type:e,recordBody:r,headers:n,url:i}=t;function o(t){var e=Object.keys(n).find((t=>"content-type"===t.toLowerCase())),r=e&&n[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}}(i))return!1;if(k(r))return!0;if(p(r))return o(r);var s=r[e];return k(s)?s:o(s)}function co(t,e,r,n,i,o){return ho.apply(this,arguments)}function ho(){return ho=a((function*(t,e,r,n,i,o){if(void 0===o&&(o=0),o>10)return io.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=>so(t)&&t.initiatorType===e&&(y(n)||t.startTime>=n)&&(y(i)||t.startTime<=i)));return s||(yield new Promise((t=>setTimeout(t,50*o))),co(t,e,r,n,i,o+1))})),ho.apply(this,arguments)}function vo(t){var{body:e,options:r,url:n}=t;if(w(e))return null;var{hostname:i,isHostDenied:o}=no(n,r);if(o)return i+" is in deny list";if(b(e))return e;if(eo(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 fo=t=>!C(t)&&("navigation"===t.entryType||"resource"===t.entryType);function mo(t){var{entry:e,method:r,status:n,networkRequest:i,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:n,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:o})];if(fo(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 po=["video/","audio/"];function go(t){return new Promise(((e,r)=>{var n=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>r(t))).finally((()=>clearTimeout(n)))}catch(t){clearTimeout(n),e("[SessionReplay] Failed to read body")}}))}function Io(){return(Io=a((function*(t){var{r:e,options:r,url:n}=t,{hostname:i,isHostDenied:o}=no(n,r);return o?Promise.resolve(i+" is in deny list"):go(e)}))).apply(this,arguments)}function yo(){return(yo=a((function*(t){var{r:e,options:r,url:n}=t,i=function(t){var e,{r:r,options:n,url:i}=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=po.some((t=>null==o?void 0:o.startsWith(t)));if(o&&s)return"Content-Type "+o+" is not supported";var{hostname:a,isHostDenied:u}=no(i,n);return u?a+" is in deny list":null}({r:e,options:r,url:n});return C(i)?go(e):Promise.resolve(i)}))).apply(this,arguments)}function bo(t,e,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var n=uo("request",r.recordHeaders),i=uo("response",r.recordHeaders),o=ro(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})),n&&(h.requestHeaders=v),lo({type:"request",headers:v,url:s,recordBody:r.recordBody})&&(h.requestBody=yield function(t){return Io.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})),i&&(h.responseHeaders=f),lo({type:"response",headers:f,url:s,recordBody:r.recordBody})&&(h.responseBody=yield function(t){return yo.apply(this,arguments)}({r:u,options:r,url:s})),u}finally{co(e,"fetch",c.url,l,d).then((e=>{var r,n=mo({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:n})})).catch((()=>{}))}}));return function(t,e){return s.apply(this,arguments)}}()));return()=>{o()}}var Co=null;function wo(t,e,r){if(!("performance"in e))return()=>{};if(Co)return io.warn("Network observer already initialised, doing nothing"),()=>{};var n=r?Object.assign({},K,r):K,i=e=>{var r=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&r.push(e)})),r.length>0&&t(u({},e,{requests:r}))},o=ao(i,e,n),s=()=>{},a=()=>{};return(n.recordHeaders||n.recordBody)&&(s=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=uo("request",r.recordHeaders),i=uo("response",r.recordHeaders),o=ro(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)),n&&(m.requestHeaders=p);var I=v.send.bind(v);v.send=t=>(lo({type:"request",headers:p,url:a,recordBody:r.recordBody})&&(m.requestBody=vo({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 n={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),i=e.join(": ");r&&(n[r]=i)})),i&&(m.responseHeaders=n),lo({type:"response",headers:n,url:a,recordBody:r.recordBody})&&(m.responseBody=vo({body:v.response,options:r,url:a})),co(e,"xmlhttprequest",f.url,c,h).then((e=>{var r=mo({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()}}(i,e,n),a=bo(i,e,n)),Co=()=>{o(),s(),a(),Co=null}}var So=t=>({name:"rrweb/network@1",observer:wo,options:t});o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:to,getRecordNetworkPlugin:So},o.__PosthogExtensions__.rrweb={record:ei,version:"v2"},o.rrweb={record:ei,version:"v2"},o.rrwebConsoleRecord={getRecordConsolePlugin:to},o.getRecordNetworkPlugin=So,o.__PosthogExtensions__=o.__PosthogExtensions__||{},o.__PosthogExtensions__.initSessionRecording=t=>new ye(t)}();
|
|
2
2
|
//# sourceMappingURL=lazy-recorder.js.map
|