Socket
Socket
Sign inDemoInstall

rrweb

Package Overview
Dependencies
5
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.9.14 to 1.0.0-beta.0

es/rrweb/ext/@xstate/fsm/es/index.js

39

dist/record/rrweb-record-pack.js

@@ -63,2 +63,3 @@ var rrwebRecord = (function (exports) {

IncrementalSource[IncrementalSource["Log"] = 11] = "Log";
IncrementalSource[IncrementalSource["Drag"] = 12] = "Drag";
})(IncrementalSource || (IncrementalSource = {}));

@@ -100,4 +101,42 @@ var MouseInteractions;

ReplayerEvents["StateChange"] = "state-change";
ReplayerEvents["PlayBack"] = "play-back";
})(ReplayerEvents || (ReplayerEvents = {}));
var DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' +
'\r\n' +
'now you can use replayer.getMirror() to access the mirror instance of a replayer,' +
'\r\n' +
'or you can use record.mirror to access the mirror instance during recording.';
var _mirror = {
map: {},
getId: function () {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
return -1;
},
getNode: function () {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
return null;
},
removeNodeFromMap: function () {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
},
has: function () {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
return false;
},
reset: function () {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
},
};
if (typeof window !== 'undefined' && window.Proxy && window.Reflect) {
_mirror = new Proxy(_mirror, {
get: function (target, prop, receiver) {
if (prop === 'map') {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
}
return Reflect.get(target, prop, receiver);
},
});
}
// DEFLATE is a complex format; to read this code, you should probably check the RFC first:

@@ -104,0 +143,0 @@

4

dist/record/rrweb-record-pack.min.js

@@ -1,2 +0,2 @@

var rrwebRecord=function(e){"use strict";
var rrwebRecord=function(r){"use strict";
/*! *****************************************************************************

@@ -15,3 +15,3 @@ Copyright (c) Microsoft Corporation.

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var r,n,t,o,a,f,u=function(){return(u=Object.assign||function(e){for(var r,n=1,t=arguments.length;n<t;n++)for(var o in r=arguments[n])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e}).apply(this,arguments)};!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(r||(r={})),function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom"}(n||(n={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log"}(t||(t={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd"}(o||(o={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(a||(a={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change"}(f||(f={}));var i=Uint8Array,s=Uint16Array,l=Uint32Array,v=new i([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]),c=new i([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]),h=new i([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=function(e,r){for(var n=new s(31),t=0;t<31;++t)n[t]=r+=1<<e[t-1];var o=new l(n[30]);for(t=1;t<30;++t)for(var a=n[t];a<n[t+1];++a)o[a]=a-n[t]<<5|t;return[n,o]},w=d(v,2),M=w[0],m=w[1];M[28]=258,m[258]=28;for(var p=d(c,0)[1],g=new s(32768),C=0;C<32768;++C){var y=(43690&C)>>>1|(21845&C)<<1;y=(61680&(y=(52428&y)>>>2|(13107&y)<<2))>>>4|(3855&y)<<4,g[C]=((65280&y)>>>8|(255&y)<<8)>>>1}var S=function(e,r,n){for(var t=e.length,o=0,a=new s(r);o<t;++o)++a[e[o]-1];var f,u=new s(r);for(o=0;o<r;++o)u[o]=u[o-1]+a[o-1]<<1;if(n){f=new s(1<<r);var i=15-r;for(o=0;o<t;++o)if(e[o])for(var l=o<<4|e[o],v=r-e[o],c=u[e[o]-1]++<<v,h=c|(1<<v)-1;c<=h;++c)f[g[c]>>>i]=l}else for(f=new s(t),o=0;o<t;++o)f[o]=g[u[e[o]-1]++]>>>15-e[o];return f},T=new i(288);for(C=0;C<144;++C)T[C]=8;for(C=144;C<256;++C)T[C]=9;for(C=256;C<280;++C)T[C]=7;for(C=280;C<288;++C)T[C]=8;var b=new i(32);for(C=0;C<32;++C)b[C]=5;var D=S(T,9,0),k=(S(T,9,1),S(b,5,0)),x=(S(b,5,1),function(e){return(e/8>>0)+(7&e&&1)}),E=function(e,r,n){(null==r||r<0)&&(r=0),(null==n||n>e.length)&&(n=e.length);var t=new(e instanceof s?s:e instanceof l?l:i)(n-r);return t.set(e.subarray(r,n)),t},A=function(e,r,n){n<<=7&r;var t=r/8>>0;e[t]|=n,e[t+1]|=n>>>8},F=function(e,r,n){n<<=7&r;var t=r/8>>0;e[t]|=n,e[t+1]|=n>>>8,e[t+2]|=n>>>16},I=function(e,r){for(var n=[],t=0;t<e.length;++t)e[t]&&n.push({s:t,f:e[t]});var o=n.length,a=n.slice();if(!o)return[new i(0),0];if(1==o){var f=new i(n[0].s+1);return f[n[0].s]=1,[f,1]}n.sort((function(e,r){return e.f-r.f})),n.push({s:-1,f:25001});var u=n[0],l=n[1],v=0,c=1,h=2;for(n[0]={s:-1,f:u.f+l.f,l:u,r:l};c!=o-1;)u=n[n[v].f<n[h].f?v++:h++],l=n[v!=c&&n[v].f<n[h].f?v++:h++],n[c++]={s:-1,f:u.f+l.f,l:u,r:l};var d=a[0].s;for(t=1;t<o;++t)a[t].s>d&&(d=a[t].s);var w=new s(d+1),M=L(n[c-1],w,0);if(M>r){t=0;var m=0,p=M-r,g=1<<p;for(a.sort((function(e,r){return w[r.s]-w[e.s]||e.f-r.f}));t<o;++t){var C=a[t].s;if(!(w[C]>r))break;m+=g-(1<<M-w[C]),w[C]=r}for(m>>>=p;m>0;){var y=a[t].s;w[y]<r?m-=1<<r-w[y]++-1:++t}for(;t>=0&&m;--t){var S=a[t].s;w[S]==r&&(--w[S],++m)}M=r}return[new i(w),M]},L=function(e,r,n){return-1==e.s?Math.max(L(e.l,r,n+1),L(e.r,r,n+1)):r[e.s]=n},R=function(e){for(var r=e.length;r&&!e[--r];);for(var n=new s(++r),t=0,o=e[0],a=1,f=function(e){n[t++]=e},u=1;u<=r;++u)if(e[u]==o&&u!=r)++a;else{if(!o&&a>2){for(;a>138;a-=138)f(32754);a>2&&(f(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(f(o),--a;a>6;a-=6)f(8304);a>2&&(f(a-3<<5|8208),a=0)}for(;a--;)f(o);a=1,o=e[u]}return[n.subarray(0,t),r]},P=function(e,r){for(var n=0,t=0;t<r.length;++t)n+=e[t]*r[t];return n},O=function(e,r,n){var t=n.length,o=x(r+2);e[o]=255&t,e[o+1]=t>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var a=0;a<t;++a)e[o+a+4]=n[a];return 8*(o+4+t)},U=function(e,r,n,t,o,a,f,u,i,l,d){A(r,d++,n),++o[256];for(var w=I(o,15),M=w[0],m=w[1],p=I(a,15),g=p[0],C=p[1],y=R(M),x=y[0],E=y[1],L=R(g),U=L[0],z=L[1],_=new s(19),j=0;j<x.length;++j)_[31&x[j]]++;for(j=0;j<U.length;++j)_[31&U[j]]++;for(var B=I(_,7),V=B[0],J=B[1],N=19;N>4&&!V[h[N-1]];--N);var q,G,H,K,Q=l+5<<3,W=P(o,T)+P(a,b)+f,X=P(o,M)+P(a,g)+f+14+3*N+P(_,V)+(2*_[16]+3*_[17]+7*_[18]);if(Q<=W&&Q<=X)return O(r,d,e.subarray(i,i+l));if(A(r,d,1+(X<W)),d+=2,X<W){q=S(M,m,0),G=M,H=S(g,C,0),K=g;var Y=S(V,J,0);A(r,d,E-257),A(r,d+5,z-1),A(r,d+10,N-4),d+=14;for(j=0;j<N;++j)A(r,d+3*j,V[h[j]]);d+=3*N;for(var Z=[x,U],$=0;$<2;++$){var ee=Z[$];for(j=0;j<ee.length;++j){var re=31&ee[j];A(r,d,Y[re]),d+=V[re],re>15&&(A(r,d,ee[j]>>>5&127),d+=ee[j]>>>12)}}}else q=D,G=T,H=k,K=b;for(j=0;j<u;++j)if(t[j]>255){re=t[j]>>>18&31;F(r,d,q[re+257]),d+=G[re+257],re>7&&(A(r,d,t[j]>>>23&31),d+=v[re]);var ne=31&t[j];F(r,d,H[ne]),d+=K[ne],ne>3&&(F(r,d,t[j]>>>5&8191),d+=c[ne])}else F(r,d,q[t[j]]),d+=G[t[j]];return F(r,d,q[256]),d+G[256]},z=new l([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),_=new i(0),j=new l(256);for(C=0;C<256;++C){for(var B=C,V=9;--V;)B=(1&B&&3988292384)^B>>>1;j[C]=B}var J=function(e,r,n,t,o){return function(e,r,n,t,o,a){var f=e.length,u=new i(t+f+5*(1+Math.floor(f/7e3))+o),h=u.subarray(t,u.length-o),d=0;if(!r||f<8)for(var w=0;w<=f;w+=65535){var M=w+65535;M<f?d=O(h,d,e.subarray(w,M)):(h[w]=a,d=O(h,d,e.subarray(w,f)))}else{for(var g=z[r-1],C=g>>>13,y=8191&g,S=(1<<n)-1,T=new s(32768),b=new s(S+1),D=Math.ceil(n/3),k=2*D,A=function(r){return(e[r]^e[r+1]<<D^e[r+2]<<k)&S},F=new l(25e3),I=new s(288),L=new s(32),R=0,P=0,j=(w=0,0),B=0,V=0;w<f;++w){var J=A(w),N=32767&w,q=b[J];if(T[N]=q,b[J]=N,B<=w){var G=f-w;if((R>7e3||j>24576)&&G>423){d=U(e,h,0,F,I,L,P,j,V,w-V,d),j=R=P=0,V=w;for(var H=0;H<286;++H)I[H]=0;for(H=0;H<30;++H)L[H]=0}var K=2,Q=0,W=y,X=N-q&32767;if(G>2&&J==A(w-X))for(var Y=Math.min(C,G)-1,Z=Math.min(32767,w),$=Math.min(258,G);X<=Z&&--W&&N!=q;){if(e[w+K]==e[w+K-X]){for(var ee=0;ee<$&&e[w+ee]==e[w+ee-X];++ee);if(ee>K){if(K=ee,Q=X,ee>Y)break;var re=Math.min(X,ee-2),ne=0;for(H=0;H<re;++H){var te=w-X+H+32768&32767,oe=te-T[te]+32768&32767;oe>ne&&(ne=oe,q=te)}}}X+=(N=q)-(q=T[N])+32768&32767}if(Q){F[j++]=268435456|m[K]<<18|p[Q];var ae=31&m[K],fe=31&p[Q];P+=v[ae]+c[fe],++I[257+ae],++L[fe],B=w+K,++R}else F[j++]=e[w],++I[e[w]]}}d=U(e,h,a,F,I,L,P,j,V,w-V,d),a||(d=O(h,d,_))}return E(u,0,t+x(d)+o)}(e,null==r.level?6:r.level,null==r.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+r.mem,n,t,!o)};function N(e,r){void 0===r&&(r={});var n=function(){var e=1,r=0;return{p:function(n){for(var t=e,o=r,a=n.length,f=0;f!=a;){for(var u=Math.min(f+5552,a);f<u;++f)o+=t+=n[f];t%=65521,o%=65521}e=t,r=o},d:function(){return(e>>>8<<16|(255&r)<<8|r>>>8)+2*((255&e)<<23)}}}();n.p(e);var t=J(e,r,2,4);return function(e,r){var n=r.level,t=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=t<<6|(t?32-2*t:1)}(t,r),function(e,r,n){for(;n;++r)e[r]=n,n>>>=8}(t,t.length-4,n.d()),t}return e.pack=function(e){var r=u(u({},e),{v:"v1"});return function(e,r){var n="";if(!r&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t=0;t<e.length;){var o=e[t++];o<128||r?n+=String.fromCharCode(o):o<224?n+=String.fromCharCode((31&o)<<6|63&e[t++]):o<240?n+=String.fromCharCode((15&o)<<12|(63&e[t++])<<6|63&e[t++]):(o=((15&o)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o))}return n}(N(function(e,r){var n=e.length;if(!r&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var t=new i(e.length+(e.length>>>1)),o=0,a=function(e){t[o++]=e},f=0;f<n;++f){if(o+5>t.length){var u=new i(o+8+(n-f<<1));u.set(t),t=u}var s=e.charCodeAt(f);s<128||r?a(s):s<2048?(a(192|s>>>6),a(128|63&s)):s>55295&&s<57344?(a(240|(s=65536+(1047552&s)|1023&e.charCodeAt(++f))>>>18),a(128|s>>>12&63),a(128|s>>>6&63),a(128|63&s)):(a(224|s>>>12),a(128|s>>>6&63),a(128|63&s))}return E(t,0,o)}(JSON.stringify(r))),!0)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
***************************************************************************** */var e,n,t,o,a,f,u=function(){return(u=Object.assign||function(r){for(var e,n=1,t=arguments.length;n<t;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}).apply(this,arguments)};!function(r){r[r.Document=0]="Document",r[r.DocumentType=1]="DocumentType",r[r.Element=2]="Element",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.Comment=5]="Comment"}(e||(e={})),function(r){r[r.DomContentLoaded=0]="DomContentLoaded",r[r.Load=1]="Load",r[r.FullSnapshot=2]="FullSnapshot",r[r.IncrementalSnapshot=3]="IncrementalSnapshot",r[r.Meta=4]="Meta",r[r.Custom=5]="Custom"}(n||(n={})),function(r){r[r.Mutation=0]="Mutation",r[r.MouseMove=1]="MouseMove",r[r.MouseInteraction=2]="MouseInteraction",r[r.Scroll=3]="Scroll",r[r.ViewportResize=4]="ViewportResize",r[r.Input=5]="Input",r[r.TouchMove=6]="TouchMove",r[r.MediaInteraction=7]="MediaInteraction",r[r.StyleSheetRule=8]="StyleSheetRule",r[r.CanvasMutation=9]="CanvasMutation",r[r.Font=10]="Font",r[r.Log=11]="Log",r[r.Drag=12]="Drag"}(t||(t={})),function(r){r[r.MouseUp=0]="MouseUp",r[r.MouseDown=1]="MouseDown",r[r.Click=2]="Click",r[r.ContextMenu=3]="ContextMenu",r[r.DblClick=4]="DblClick",r[r.Focus=5]="Focus",r[r.Blur=6]="Blur",r[r.TouchStart=7]="TouchStart",r[r.TouchMove_Departed=8]="TouchMove_Departed",r[r.TouchEnd=9]="TouchEnd"}(o||(o={})),function(r){r[r.Play=0]="Play",r[r.Pause=1]="Pause"}(a||(a={})),function(r){r.Start="start",r.Pause="pause",r.Resume="resume",r.Resize="resize",r.Finish="finish",r.FullsnapshotRebuilded="fullsnapshot-rebuilded",r.LoadStylesheetStart="load-stylesheet-start",r.LoadStylesheetEnd="load-stylesheet-end",r.SkipStart="skip-start",r.SkipEnd="skip-end",r.MouseInteraction="mouse-interaction",r.EventCast="event-cast",r.CustomEvent="custom-event",r.Flush="flush",r.StateChange="state-change",r.PlayBack="play-back"}(f||(f={}));var i="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.",s={map:{},getId:function(){return console.error(i),-1},getNode:function(){return console.error(i),null},removeNodeFromMap:function(){console.error(i)},has:function(){return console.error(i),!1},reset:function(){console.error(i)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(s=new Proxy(s,{get:function(r,e,n){return"map"===e&&console.error(i),Reflect.get(r,e,n)}}));var c=Uint8Array,l=Uint16Array,v=Uint32Array,h=new c([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]),d=new c([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]),m=new c([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),w=function(r,e){for(var n=new l(31),t=0;t<31;++t)n[t]=e+=1<<r[t-1];var o=new v(n[30]);for(t=1;t<30;++t)for(var a=n[t];a<n[t+1];++a)o[a]=a-n[t]<<5|t;return[n,o]},p=w(h,2),g=p[0],M=p[1];g[28]=258,M[258]=28;for(var y=w(d,0)[1],C=new l(32768),S=0;S<32768;++S){var D=(43690&S)>>>1|(21845&S)<<1;D=(61680&(D=(52428&D)>>>2|(13107&D)<<2))>>>4|(3855&D)<<4,C[S]=((65280&D)>>>8|(255&D)<<8)>>>1}var T=function(r,e,n){for(var t=r.length,o=0,a=new l(e);o<t;++o)++a[r[o]-1];var f,u=new l(e);for(o=0;o<e;++o)u[o]=u[o-1]+a[o-1]<<1;if(n){f=new l(1<<e);var i=15-e;for(o=0;o<t;++o)if(r[o])for(var s=o<<4|r[o],c=e-r[o],v=u[r[o]-1]++<<c,h=v|(1<<c)-1;v<=h;++v)f[C[v]>>>i]=s}else for(f=new l(t),o=0;o<t;++o)f[o]=C[u[r[o]-1]++]>>>15-r[o];return f},b=new c(288);for(S=0;S<144;++S)b[S]=8;for(S=144;S<256;++S)b[S]=9;for(S=256;S<280;++S)b[S]=7;for(S=280;S<288;++S)b[S]=8;var k=new c(32);for(S=0;S<32;++S)k[S]=5;var x=T(b,9,0),I=(T(b,9,1),T(k,5,0)),P=(T(k,5,1),function(r){return(r/8>>0)+(7&r&&1)}),E=function(r,e,n){(null==e||e<0)&&(e=0),(null==n||n>r.length)&&(n=r.length);var t=new(r instanceof l?l:r instanceof v?v:c)(n-e);return t.set(r.subarray(e,n)),t},F=function(r,e,n){n<<=7&e;var t=e/8>>0;r[t]|=n,r[t+1]|=n>>>8},R=function(r,e,n){n<<=7&e;var t=e/8>>0;r[t]|=n,r[t+1]|=n>>>8,r[t+2]|=n>>>16},A=function(r,e){for(var n=[],t=0;t<r.length;++t)r[t]&&n.push({s:t,f:r[t]});var o=n.length,a=n.slice();if(!o)return[new c(0),0];if(1==o){var f=new c(n[0].s+1);return f[n[0].s]=1,[f,1]}n.sort((function(r,e){return r.f-e.f})),n.push({s:-1,f:25001});var u=n[0],i=n[1],s=0,v=1,h=2;for(n[0]={s:-1,f:u.f+i.f,l:u,r:i};v!=o-1;)u=n[n[s].f<n[h].f?s++:h++],i=n[s!=v&&n[s].f<n[h].f?s++:h++],n[v++]={s:-1,f:u.f+i.f,l:u,r:i};var d=a[0].s;for(t=1;t<o;++t)a[t].s>d&&(d=a[t].s);var m=new l(d+1),w=L(n[v-1],m,0);if(w>e){t=0;var p=0,g=w-e,M=1<<g;for(a.sort((function(r,e){return m[e.s]-m[r.s]||r.f-e.f}));t<o;++t){var y=a[t].s;if(!(m[y]>e))break;p+=M-(1<<w-m[y]),m[y]=e}for(p>>>=g;p>0;){var C=a[t].s;m[C]<e?p-=1<<e-m[C]++-1:++t}for(;t>=0&&p;--t){var S=a[t].s;m[S]==e&&(--m[S],++p)}w=e}return[new c(m),w]},L=function(r,e,n){return-1==r.s?Math.max(L(r.l,e,n+1),L(r.r,e,n+1)):e[r.s]=n},O=function(r){for(var e=r.length;e&&!r[--e];);for(var n=new l(++e),t=0,o=r[0],a=1,f=function(r){n[t++]=r},u=1;u<=e;++u)if(r[u]==o&&u!=e)++a;else{if(!o&&a>2){for(;a>138;a-=138)f(32754);a>2&&(f(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(f(o),--a;a>6;a-=6)f(8304);a>2&&(f(a-3<<5|8208),a=0)}for(;a--;)f(o);a=1,o=r[u]}return[n.subarray(0,t),e]},U=function(r,e){for(var n=0,t=0;t<e.length;++t)n+=r[t]*e[t];return n},z=function(r,e,n){var t=n.length,o=P(e+2);r[o]=255&t,r[o+1]=t>>>8,r[o+2]=255^r[o],r[o+3]=255^r[o+1];for(var a=0;a<t;++a)r[o+a+4]=n[a];return 8*(o+4+t)},_=function(r,e,n,t,o,a,f,u,i,s,c){F(e,c++,n),++o[256];for(var v=A(o,15),w=v[0],p=v[1],g=A(a,15),M=g[0],y=g[1],C=O(w),S=C[0],D=C[1],P=O(M),E=P[0],L=P[1],_=new l(19),j=0;j<S.length;++j)_[31&S[j]]++;for(j=0;j<E.length;++j)_[31&E[j]]++;for(var B=A(_,7),N=B[0],V=B[1],J=19;J>4&&!N[m[J-1]];--J);var q,G,H,K,Q=s+5<<3,W=U(o,b)+U(a,k)+f,X=U(o,w)+U(a,M)+f+14+3*J+U(_,N)+(2*_[16]+3*_[17]+7*_[18]);if(Q<=W&&Q<=X)return z(e,c,r.subarray(i,i+s));if(F(e,c,1+(X<W)),c+=2,X<W){q=T(w,p,0),G=w,H=T(M,y,0),K=M;var Y=T(N,V,0);F(e,c,D-257),F(e,c+5,L-1),F(e,c+10,J-4),c+=14;for(j=0;j<J;++j)F(e,c+3*j,N[m[j]]);c+=3*J;for(var Z=[S,E],$=0;$<2;++$){var rr=Z[$];for(j=0;j<rr.length;++j){var er=31&rr[j];F(e,c,Y[er]),c+=N[er],er>15&&(F(e,c,rr[j]>>>5&127),c+=rr[j]>>>12)}}}else q=x,G=b,H=I,K=k;for(j=0;j<u;++j)if(t[j]>255){er=t[j]>>>18&31;R(e,c,q[er+257]),c+=G[er+257],er>7&&(F(e,c,t[j]>>>23&31),c+=h[er]);var nr=31&t[j];R(e,c,H[nr]),c+=K[nr],nr>3&&(R(e,c,t[j]>>>5&8191),c+=d[nr])}else R(e,c,q[t[j]]),c+=G[t[j]];return R(e,c,q[256]),c+G[256]},j=new v([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),B=new c(0),N=new v(256);for(S=0;S<256;++S){for(var V=S,J=9;--J;)V=(1&V&&3988292384)^V>>>1;N[S]=V}var q=function(r,e,n,t,o){return function(r,e,n,t,o,a){var f=r.length,u=new c(t+f+5*(1+Math.floor(f/7e3))+o),i=u.subarray(t,u.length-o),s=0;if(!e||f<8)for(var m=0;m<=f;m+=65535){var w=m+65535;w<f?s=z(i,s,r.subarray(m,w)):(i[m]=a,s=z(i,s,r.subarray(m,f)))}else{for(var p=j[e-1],g=p>>>13,C=8191&p,S=(1<<n)-1,D=new l(32768),T=new l(S+1),b=Math.ceil(n/3),k=2*b,x=function(e){return(r[e]^r[e+1]<<b^r[e+2]<<k)&S},I=new v(25e3),F=new l(288),R=new l(32),A=0,L=0,O=(m=0,0),U=0,N=0;m<f;++m){var V=x(m),J=32767&m,q=T[V];if(D[J]=q,T[V]=J,U<=m){var G=f-m;if((A>7e3||O>24576)&&G>423){s=_(r,i,0,I,F,R,L,O,N,m-N,s),O=A=L=0,N=m;for(var H=0;H<286;++H)F[H]=0;for(H=0;H<30;++H)R[H]=0}var K=2,Q=0,W=C,X=J-q&32767;if(G>2&&V==x(m-X))for(var Y=Math.min(g,G)-1,Z=Math.min(32767,m),$=Math.min(258,G);X<=Z&&--W&&J!=q;){if(r[m+K]==r[m+K-X]){for(var rr=0;rr<$&&r[m+rr]==r[m+rr-X];++rr);if(rr>K){if(K=rr,Q=X,rr>Y)break;var er=Math.min(X,rr-2),nr=0;for(H=0;H<er;++H){var tr=m-X+H+32768&32767,or=tr-D[tr]+32768&32767;or>nr&&(nr=or,q=tr)}}}X+=(J=q)-(q=D[J])+32768&32767}if(Q){I[O++]=268435456|M[K]<<18|y[Q];var ar=31&M[K],fr=31&y[Q];L+=h[ar]+d[fr],++F[257+ar],++R[fr],U=m+K,++A}else I[O++]=r[m],++F[r[m]]}}s=_(r,i,a,I,F,R,L,O,N,m-N,s),a||(s=z(i,s,B))}return E(u,0,t+P(s)+o)}(r,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+e.mem,n,t,!o)};function G(r,e){void 0===e&&(e={});var n=function(){var r=1,e=0;return{p:function(n){for(var t=r,o=e,a=n.length,f=0;f!=a;){for(var u=Math.min(f+5552,a);f<u;++f)o+=t+=n[f];t%=65521,o%=65521}r=t,e=o},d:function(){return(r>>>8<<16|(255&e)<<8|e>>>8)+2*((255&r)<<23)}}}();n.p(r);var t=q(r,e,2,4);return function(r,e){var n=e.level,t=0==n?0:n<6?1:9==n?3:2;r[0]=120,r[1]=t<<6|(t?32-2*t:1)}(t,e),function(r,e,n){for(;n;++e)r[e]=n,n>>>=8}(t,t.length-4,n.d()),t}return r.pack=function(r){var e=u(u({},r),{v:"v1"});return function(r,e){var n="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(r);for(var t=0;t<r.length;){var o=r[t++];o<128||e?n+=String.fromCharCode(o):o<224?n+=String.fromCharCode((31&o)<<6|63&r[t++]):o<240?n+=String.fromCharCode((15&o)<<12|(63&r[t++])<<6|63&r[t++]):(o=((15&o)<<18|(63&r[t++])<<12|(63&r[t++])<<6|63&r[t++])-65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o))}return n}(G(function(r,e){var n=r.length;if(!e&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(r);for(var t=new c(r.length+(r.length>>>1)),o=0,a=function(r){t[o++]=r},f=0;f<n;++f){if(o+5>t.length){var u=new c(o+8+(n-f<<1));u.set(t),t=u}var i=r.charCodeAt(f);i<128||e?a(i):i<2048?(a(192|i>>>6),a(128|63&i)):i>55295&&i<57344?(a(240|(i=65536+(1047552&i)|1023&r.charCodeAt(++f))>>>18),a(128|i>>>12&63),a(128|i>>>6&63),a(128|63&i)):(a(224|i>>>12),a(128|i>>>6&63),a(128|63&i))}return E(t,0,o)}(JSON.stringify(e))),!0)},Object.defineProperty(r,"__esModule",{value:!0}),r}({});
//# sourceMappingURL=rrweb-record-pack.min.js.map

@@ -15,3 +15,3 @@ var rrwebRecord=function(){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var e,t=function(){return(t=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function n(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function r(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(e||(e={}));var a=1,i=RegExp("[^a-z1-6-_]");function u(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(s).join(""):null}catch(e){return null}}function s(e){return function(e){return"styleSheet"in e}(e)?u(e.styleSheet)||"":e.cssText}var l,c,d,p,f,h=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,m=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,v=/^(data:)([^,]*),(.*)/i;function y(e,t){return(e||"").replace(h,(function(e,n,o,r,a,i){var u,s=o||a||i,l=n||r||"";if(!s)return e;if(!m.test(s))return"url("+l+s+l+")";if(v.test(s))return"url("+l+s+l+")";if("/"===s[0])return"url("+l+(((u=t).indexOf("//")>-1?u.split("/").slice(0,3).join("/"):u.split("/")[0]).split("?")[0]+s)+l+")";var c=t.split("/"),d=s.split("/");c.pop();for(var p=0,f=d;p<f.length;p++){var h=f[p];"."!==h&&(".."===h?c.pop():c.push(h))}return"url("+l+c.join("/")+l+")"}))}function g(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function b(e,t,n){return"src"===t||("href"===t||"xlink:href"===t)&&n?g(e,n):"srcset"===t&&n?function(e,t){return""===t.trim()?t:t.split(",").map((function(t){var n=t.trimLeft().trimRight().split(" ");return 2===n.length?g(e,n[0])+" "+n[1]:1===n.length?""+g(e,n[0]):""})).join(", ")}(e,n):"style"===t&&n?y(n,location.href):n}function C(t,n){var o,r=n.doc,a=n.blockClass,s=n.blockSelector,l=n.inlineStylesheet,c=n.maskInputOptions,d=void 0===c?{}:c,p=n.recordCanvas;switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId};case t.ELEMENT_NODE:for(var f=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach((function(e){if(t.test(e))return!0}));return!!n&&e.matches(n)}(t,a,s),h=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return i.test(t)?"div":t}(t),m={},v=0,g=Array.from(t.attributes);v<g.length;v++){var C=g[v],S=C.name,w=C.value;m[S]=b(r,S,w)}if("link"===h&&l){var k,E=Array.from(r.styleSheets).find((function(e){return e.href===t.href}));(k=u(E))&&(delete m.rel,delete m.href,m._cssText=y(k,E.href))}if("style"===h&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(k=u(t.sheet))&&(m._cssText=y(k,location.href));if("input"===h||"textarea"===h||"select"===h){w=t.value;"radio"!==m.type&&"checkbox"!==m.type&&"submit"!==m.type&&"button"!==m.type&&w?m.value=d[m.type]||d[h]?"*".repeat(w.length):w:t.checked&&(m.checked=t.checked)}if("option"===h){var M=t.parentElement;m.value===M.value&&(m.selected=t.selected)}if("canvas"===h&&p&&(m.rr_dataURL=t.toDataURL()),"audio"!==h&&"video"!==h||(m.rr_mediaState=t.paused?"paused":"played"),t.scrollLeft&&(m.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(m.rr_scrollTop=t.scrollTop),f){var I=t.getBoundingClientRect(),O=I.width,x=I.height;m={class:m.class,rr_width:O+"px",rr_height:x+"px"}}return{type:e.Element,tagName:h,attributes:m,childNodes:[],isSVG:(o=t,"svg"===o.tagName||o instanceof SVGElement||void 0),needBlock:f};case t.TEXT_NODE:var N=t.parentNode&&t.parentNode.tagName,T=t.textContent,_="STYLE"===N||void 0;return _&&T&&(T=y(T,location.href)),"SCRIPT"===N&&(T="SCRIPT_PLACEHOLDER"),{type:e.Text,textContent:T||"",isStyle:_};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:""};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||""};default:return!1}}function S(e){return void 0===e?"":e.toLowerCase()}function w(t,n){var o,r=n.doc,i=n.map,u=n.blockClass,s=n.blockSelector,l=n.skipChild,c=void 0!==l&&l,d=n.inlineStylesheet,p=void 0===d||d,f=n.maskInputOptions,h=void 0===f?{}:f,m=n.slimDOMOptions,v=n.recordCanvas,y=void 0!==v&&v,g=n.preserveWhiteSpace,b=void 0===g||g,k=C(t,{doc:r,blockClass:u,blockSelector:s,inlineStylesheet:p,maskInputOptions:h,recordCanvas:y});if(!k)return console.warn(t,"not serialized"),null;o="__sn"in t?t.__sn.id:!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(S(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===S(t.attributes.name)||"icon"===S(t.attributes.rel)||"apple-touch-icon"===S(t.attributes.rel)||"shortcut icon"===S(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&S(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(S(t.attributes.property).match(/^(og|twitter|fb):/)||S(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===S(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===S(t.attributes.name)||"googlebot"===S(t.attributes.name)||"bingbot"===S(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===S(t.attributes.name)||"generator"===S(t.attributes.name)||"framework"===S(t.attributes.name)||"publisher"===S(t.attributes.name)||"progid"===S(t.attributes.name)||S(t.attributes.property).match(/^article:/)||S(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===S(t.attributes.name)||"yandex-verification"===S(t.attributes.name)||"csrf-token"===S(t.attributes.name)||"p:domain_verify"===S(t.attributes.name)||"verify-v1"===S(t.attributes.name)||"verification"===S(t.attributes.name)||"shopify-checkout-api-token"===S(t.attributes.name)))return!0}}return!1}(k,m)&&(b||k.type!==e.Text||k.isStyle||k.textContent.replace(/^\s+|\s+$/gm,"").length)?a++:-2;var E=Object.assign(k,{id:o});if(t.__sn=E,-2===o)return null;i[o]=t;var M=!c;if(E.type===e.Element&&(M=M&&!E.needBlock,delete E.needBlock),(E.type===e.Document||E.type===e.Element)&&M){m.headWhitespace&&k.type===e.Element&&"head"===k.tagName&&(b=!1);for(var I=0,O=Array.from(t.childNodes);I<O.length;I++){var x=w(O[I],{doc:r,map:i,blockClass:u,blockSelector:s,skipChild:c,inlineStylesheet:p,maskInputOptions:h,slimDOMOptions:m,recordCanvas:y,preserveWhiteSpace:b});x&&E.childNodes.push(x)}}return E}function k(e,t,n){void 0===n&&(n=document);var o={capture:!0,passive:!0};return n.addEventListener(e,t,o),function(){return n.removeEventListener(e,t,o)}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom"}(l||(l={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log"}(c||(c={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd"}(d||(d={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(p||(p={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change"}(f||(f={}));var E={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return E.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete E.map[t],e.childNodes&&e.childNodes.forEach((function(e){return E.removeNodeFromMap(e)}))},has:function(e){return E.map.hasOwnProperty(e)}};function M(e,t,n){void 0===n&&(n={});var o=null,r=0;return function(a){var i=Date.now();r||!1!==n.leading||(r=i);var u=t-(i-r),s=this,l=arguments;u<=0||u>t?(o&&(window.clearTimeout(o),o=null),r=i,e.apply(s,l)):o||!1===n.trailing||(o=window.setTimeout((function(){r=!1===n.leading?0:Date.now(),o=null,e.apply(s,l)}),u))}}function I(e,t,n,o,r){void 0===r&&(r=window);var a=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,o?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return I(e,t,a||{},!0)}}function O(e,t,n){try{if(!(t in e))return function(){};var o=e[t],r=n(o);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=r,function(){e[t]=o}}catch(e){return function(){}}}function x(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function N(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function T(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;return"string"==typeof t?n=e.classList.contains(t):e.classList.forEach((function(e){t.test(e)&&(n=!0)})),n||T(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,T(e.parentNode,t)}function _(e){return"__sn"in e&&-2===e.__sn.id}function L(e){return Boolean(e.changedTouches)}function D(e){return"__ln"in e}var R=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&D(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&D(e.nextSibling)){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),F=function(e,t){return e+"@"+t};function A(e){return"__sn"in e}function z(e,t){e.delete(t),t.childNodes.forEach((function(t){return z(e,t)}))}function P(e,t){var n=t.parentNode;if(!n)return!1;var o=E.getId(n);return!!e.some((function(e){return e.id===o}))||P(e,n)}function j(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||j(e,n))}function H(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var o=e.parentElement,r=[];if(o.children&&o.children.length>0)for(var a=0;a<o.children.length;a++){var i=o.children[a];i.localName&&i.localName.toLowerCase&&i.localName.toLowerCase()===n&&r.push(i)}r.length>1&&(n+=":eq("+r.indexOf(e)+")"),t=n+(t?">"+t:""),e=o}return t}function V(e,t){var n={numOfKeysLimit:50};Object.assign(n,t);var o=[],r=[];return JSON.stringify(e,(function(e,t){if(o.length>0){var a=o.indexOf(this);~a?o.splice(a+1):o.push(this),~a?r.splice(a,1/0,e):r.push(e),~o.indexOf(t)&&(t=o[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,o.indexOf(t)).join(".")+"]")}else o.push(t);if(null==t)return t;if(function(e){return"object"==typeof e&&Object.keys(e).length>n.numOfKeysLimit||"function"==typeof e}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=t.slice(0,n.stringLengthLimit)+"...");return t}(t);if(t instanceof Event){var i={};for(var u in t){var s=t[u];Array.isArray(s)?i[u]=H(s.length?s[0]:null):i[u]=s}return i}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t}))}var W=new(function(){function e(){var e=this;this.frozen=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.frozen||e.emit()},this.emit=function(){for(var t,o,r,a,i=[],u=new R,s=function(t){for(var n=t,o=-2;-2===o;)o=(n=n&&n.nextSibling)&&E.getId(n);return-1===o&&T(t.nextSibling,e.blockClass)&&(o=null),o},l=function(t){if(t.parentNode&&document.contains(t)){var n=E.getId(t.parentNode),o=s(t);if(-1===n||-1===o)return u.addNode(t);var r=w(t,{doc:document,map:E.map,blockClass:e.blockClass,blockSelector:e.blockSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas});r&&i.push({parentId:n,nextId:o,node:r})}};e.mapRemoves.length;)E.removeNodeFromMap(e.mapRemoves.shift());try{for(var c=n(e.movedSet),d=c.next();!d.done;d=c.next()){var p=d.value;P(e.removes,p)&&!e.movedSet.has(p.parentNode)||l(p)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(t)throw t.error}}try{for(var f=n(e.addedSet),h=f.next();!h.done;h=f.next()){p=h.value;j(e.droppedSet,p)||P(e.removes,p)?j(e.movedSet,p)?l(p):e.droppedSet.add(p):l(p)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}for(var m=null;u.length;){var v=null;if(m){var y=E.getId(m.value.parentNode),g=s(m.value);-1!==y&&-1!==g&&(v=m)}if(!v)for(var b=u.length-1;b>=0;b--){var C=u.get(b);y=E.getId(C.value.parentNode),g=s(C.value);if(-1!==y&&-1!==g){v=C;break}}if(!v){for(;u.head;)u.removeNode(u.head.value);break}m=v.previous,u.removeNode(v.value),l(v.value)}var S={texts:e.texts.map((function(e){return{id:E.getId(e.node),value:e.value}})).filter((function(e){return E.has(e.id)})),attributes:e.attributes.map((function(e){return{id:E.getId(e.node),attributes:e.attributes}})).filter((function(e){return E.has(e.id)})),removes:e.removes,adds:i};(S.texts.length||S.attributes.length||S.removes.length||S.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.emissionCallback(S))},this.processMutation=function(t){if(!_(t.target))switch(t.type){case"characterData":var n=t.target.textContent;T(t.target,e.blockClass)||n===t.oldValue||e.texts.push({value:n,node:t.target});break;case"attributes":n=t.target.getAttribute(t.attributeName);if(T(t.target,e.blockClass)||n===t.oldValue)return;var o=e.attributes.find((function(e){return e.node===t.target}));o||(o={node:t.target,attributes:{}},e.attributes.push(o)),o.attributes[t.attributeName]=b(document,t.attributeName,n);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var o=E.getId(n),r=E.getId(t.target);T(n,e.blockClass)||T(t.target,e.blockClass)||_(n)||(e.addedSet.has(n)?(z(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===o||function e(t){var n=E.getId(t);return!E.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(t.target)||(e.movedSet.has(n)&&e.movedMap[F(o,r)]?z(e.movedSet,n):e.removes.push({parentId:r,id:o})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!(T(t,e.blockClass)||n&&T(n,e.blockClass))){if(A(t)){if(_(t))return;e.movedSet.add(t);var o=null;n&&A(n)&&(o=n.__sn.id),o&&(e.movedMap[F(t.__sn.id,o)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e,t,n,o,r,a,i){this.blockClass=t,this.blockSelector=n,this.inlineStylesheet=o,this.maskInputOptions=r,this.recordCanvas=a,this.slimDOMOptions=i,this.emissionCallback=e},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.isFrozen=function(){return this.frozen},e}());function U(e,t,n){if(!1===n.mouseInteraction)return function(){};var o=!0===n.mouseInteraction||void 0===n.mouseInteraction?{}:n.mouseInteraction,r=[];return Object.keys(d).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==o[e]})).forEach((function(n){var o=n.toLowerCase(),a=function(n){return function(o){if(!T(o.target,t)){var r=E.getId(o.target),a=L(o)?o.changedTouches[0]:o,i=a.clientX,u=a.clientY;e({type:d[n],id:r,x:i,y:u})}}}(n);r.push(k(o,a))})),function(){r.forEach((function(e){return e()}))}}var q,B=["INPUT","TEXTAREA","SELECT"],X=new WeakMap;function Y(e,o){void 0===o&&(o={}),function(e,t){var n=e.mutationCb,o=e.mousemoveCb,a=e.mouseInteractionCb,i=e.scrollCb,u=e.viewportResizeCb,s=e.inputCb,l=e.mediaInteractionCb,c=e.styleSheetRuleCb,d=e.canvasMutationCb,p=e.fontCb,f=e.logCb;e.mutationCb=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];t.mutation&&t.mutation.apply(t,r(e)),n.apply(void 0,r(e))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,r(e)),o.apply(void 0,r(e))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,r(e)),a.apply(void 0,r(e))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,r(e)),i.apply(void 0,r(e))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,r(e)),u.apply(void 0,r(e))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,r(e)),s.apply(void 0,r(e))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,r(e)),l.apply(void 0,r(e))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,r(e)),c.apply(void 0,r(e))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,r(e)),d.apply(void 0,r(e))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,r(e)),p.apply(void 0,r(e))},e.logCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.log&&t.log.apply(t,r(e)),f.apply(void 0,r(e))}}(e,o);var a,i,u=function(e,t,n,o,r,a,i){W.init(e,t,n,o,r,a,i);var u=new MutationObserver(W.processMutations.bind(W));return u.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),u}(e.mutationCb,e.blockClass,e.blockSelector,e.inlineStylesheet,e.maskInputOptions,e.recordCanvas,e.slimDOMOptions),s=function(e,t){if(!1===t.mousemove)return function(){};var n,o="number"==typeof t.mousemove?t.mousemove:50,r=[],a=M((function(t){var o=Date.now()-n;e(r.map((function(e){return e.timeOffset-=o,e})),t?c.TouchMove:c.MouseMove),r=[],n=null}),500),i=M((function(e){var t=e.target,o=L(e)?e.changedTouches[0]:e,i=o.clientX,u=o.clientY;n||(n=Date.now()),r.push({x:i,y:u,id:E.getId(t),timeOffset:Date.now()-n}),a(L(e))}),o,{trailing:!1}),u=[k("mousemove",i),k("touchmove",i)];return function(){u.forEach((function(e){return e()}))}}(e.mousemoveCb,e.sampling),l=U(e.mouseInteractionCb,e.blockClass,e.sampling),d=(a=e.scrollCb,i=e.blockClass,k("scroll",M((function(e){if(e.target&&!T(e.target,i)){var t=E.getId(e.target);if(e.target===document){var n=document.scrollingElement||document.documentElement;a({id:t,x:n.scrollLeft,y:n.scrollTop})}else a({id:t,x:e.target.scrollLeft,y:e.target.scrollTop})}}),e.sampling.scroll||100))),f=function(e){var t=-1,n=-1;return k("resize",M((function(){var o=x(),r=N();t===o&&n==r||(e({width:Number(r),height:Number(o)}),t=o,n=r)}),200),window)}(e.viewportResizeCb),h=function(e,n,o,a,i,u){function s(e){var t=e.target;if(t&&t.tagName&&!(B.indexOf(t.tagName)<0)&&!T(t,n)){var r=t.type;if("password"!==r&&!t.classList.contains(o)){var u=t.value,s=!1;"radio"===r||"checkbox"===r?s=t.checked:(a[t.tagName.toLowerCase()]||a[r])&&(u=i?i(u):"*".repeat(u.length)),l(t,{text:u,isChecked:s});var c=t.name;"radio"===r&&c&&s&&document.querySelectorAll('input[type="radio"][name="'+c+'"]').forEach((function(e){e!==t&&l(e,{text:e.value,isChecked:!s})}))}}}function l(n,o){var r=X.get(n);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){X.set(n,o);var a=E.getId(n);e(t(t({},o),{id:a}))}}var c=("last"===u.input?["change"]:["input","change"]).map((function(e){return k(e,s)})),d=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),p=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"]];return d&&d.set&&c.push.apply(c,r(p.map((function(e){return I(e[0],e[1],{set:function(){s({target:this})}})})))),function(){c.forEach((function(e){return e()}))}}(e.inputCb,e.blockClass,e.ignoreClass,e.maskInputOptions,e.maskInputFn,e.sampling),m=function(e,t){var n=function(n){return function(o){var r=o.target;r&&!T(r,t)&&e({type:"play"===n?p.Play:p.Pause,id:E.getId(r)})}},o=[k("play",n("play")),k("pause",n("pause"))];return function(){o.forEach((function(e){return e()}))}}(e.mediaInteractionCb,e.blockClass),v=function(e){var t=CSSStyleSheet.prototype.insertRule;CSSStyleSheet.prototype.insertRule=function(n,o){var r=E.getId(this.ownerNode);return-1!==r&&e({id:r,adds:[{rule:n,index:o}]}),t.apply(this,arguments)};var n=CSSStyleSheet.prototype.deleteRule;return CSSStyleSheet.prototype.deleteRule=function(t){var o=E.getId(this.ownerNode);return-1!==o&&e({id:o,removes:[{index:t}]}),n.apply(this,arguments)},function(){CSSStyleSheet.prototype.insertRule=t,CSSStyleSheet.prototype.deleteRule=n}}(e.styleSheetRuleCb),y=e.recordCanvas?function(e,t){var o,a,i=Object.getOwnPropertyNames(CanvasRenderingContext2D.prototype),u=[],s=function(n){try{if("function"!=typeof CanvasRenderingContext2D.prototype[n])return"continue";var o=O(CanvasRenderingContext2D.prototype,n,(function(o){return function(){for(var a=this,i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];return T(this.canvas,t)||setTimeout((function(){var t=r(i);"drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement&&(t[0]=t[0].toDataURL()),e({id:E.getId(a.canvas),property:n,args:t})}),0),o.apply(this,i)}}));u.push(o)}catch(t){var a=I(CanvasRenderingContext2D.prototype,n,{set:function(t){e({id:E.getId(this.canvas),property:n,args:[t],setter:!0})}});u.push(a)}};try{for(var l=n(i),c=l.next();!c.done;c=l.next()){s(c.value)}}catch(e){o={error:e}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}return function(){u.forEach((function(e){return e()}))}}(e.canvasMutationCb,e.blockClass):function(){},g=e.collectFonts?function(e){var t=[],n=new WeakMap,o=FontFace;window.FontFace=function(e,t,r){var a=new o(e,t,r);return n.set(a,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),a};var r=O(document.fonts,"add",(function(t){return function(o){return setTimeout((function(){var t=n.get(o);t&&(e(t),n.delete(o))}),0),t.apply(this,[o])}}));return t.push((function(){window.FonFace=o})),t.push(r),function(){t.forEach((function(e){return e()}))}}(e.fontCb):function(){},b=e.logOptions?function(e,t){var o,a,i=this,u=t.logger;if(!u)return function(){};var s=0,l=[];if(t.level.includes("error")&&window){var c=window.onerror;window.onerror=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];c&&c.apply(i,n);var r=[];n[n.length-1]instanceof Error&&(r=m(n[n.length-1].stack,0));var a=[V(n[0],t.stringifyOptions)];e({level:"error",trace:r,payload:a})},l.push((function(){window.onerror=c}))}try{for(var d=n(t.level),p=d.next();!p.done;p=d.next()){var f=p.value;l.push(h(u,f))}}catch(e){o={error:e}}finally{try{p&&!p.done&&(a=d.return)&&a.call(d)}finally{if(o)throw o.error}}return function(){l.forEach((function(e){return e()}))};function h(n,o){var a=this;return n[o]?O(n,o,(function(n){return function(){for(var i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];n.apply(a,i);try{var l=m((new Error).stack),c=i.map((function(e){return V(e,t.stringifyOptions)}));++s<t.lengthThreshold?e({level:o,trace:l,payload:c}):s===t.lengthThreshold&&e({level:"warn",trace:[],payload:[V("The number of log records reached the threshold.")]})}catch(e){n.apply(void 0,r(["rrweb logger error:",e],i))}}})):function(){}}function m(e,t){void 0===t&&(t=1);var n=[];return e&&(n=e.split("at").splice(1+t).map((function(e){return e.trim()}))),n}}(e.logCb,e.logOptions):function(){};return function(){u.disconnect(),s(),l(),d(),f(),h(),m(),v(),y(),g(),b()}}function K(e){return t(t({},e),{timestamp:Date.now()})}function $(e){void 0===e&&(e={});var n=e.emit,r=e.checkoutEveryNms,a=e.checkoutEveryNth,i=e.blockClass,u=void 0===i?"rr-block":i,s=e.blockSelector,d=void 0===s?null:s,p=e.ignoreClass,f=void 0===p?"rr-ignore":p,h=e.inlineStylesheet,m=void 0===h||h,v=e.maskAllInputs,y=e.maskInputOptions,g=e.slimDOMOptions,b=e.maskInputFn,C=e.hooks,S=e.packFn,M=e.sampling,I=void 0===M?{}:M,O=e.mousemoveWait,T=e.recordCanvas,_=void 0!==T&&T,L=e.collectFonts,D=void 0!==L&&L,R=e.recordLog,F=void 0!==R&&R;if(!n)throw new Error("emit function is required");void 0!==O&&void 0===I.mousemove&&(I.mousemove=O);var A,z,P=!0===v?{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}:void 0!==y?y:{},j=!0===g||"all"===g?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===g,headMetaDescKeywords:"all"===g}:g||{},H={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:console},V=F?!0===F?H:Object.assign({},H,F):{};void 0===A&&(A=window),"NodeList"in A&&!A.NodeList.prototype.forEach&&(A.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in A&&!A.DOMTokenList.prototype.forEach&&(A.DOMTokenList.prototype.forEach=Array.prototype.forEach);var U=0;function B(e){var t,n,r,a;void 0===e&&(e=!1),q(K({type:l.Meta,data:{href:window.location.href,width:N(),height:x()}}),e);var i=W.isFrozen();W.freeze();var s=o(function(e,t){var n=t||{},o=n.blockClass,r=void 0===o?"rr-block":o,a=n.inlineStylesheet,i=void 0===a||a,u=n.recordCanvas,s=void 0!==u&&u,l=n.blockSelector,c=void 0===l?null:l,d=n.maskAllInputs,p=void 0!==d&&d,f=n.slimDOM,h=void 0!==f&&f,m={};return[w(e,{doc:e,map:m,blockClass:r,blockSelector:c,skipChild:!1,inlineStylesheet:i,maskInputOptions:!0===p?{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}:!1===p?{}:p,slimDOMOptions:!0===h||"all"===h?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===h,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===h?{}:h,recordCanvas:s}),m]}(document,{blockClass:u,blockSelector:d,inlineStylesheet:m,maskAllInputs:P,slimDOM:j,recordCanvas:_}),2),c=s[0],p=s[1];if(!c)return console.warn("Failed to snapshot the document");E.map=p,q(K({type:l.FullSnapshot,data:{node:c,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(a=null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.parentElement)||void 0===a?void 0:a.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),i||(W.emit(),W.unfreeze())}q=function(e,t){if(!W.isFrozen()||e.type===l.FullSnapshot||e.type===l.IncrementalSnapshot&&e.data.source===c.Mutation||(W.emit(),W.unfreeze()),n(S?S(e):e,t),e.type===l.FullSnapshot)z=e,U=0;else if(e.type===l.IncrementalSnapshot){U++;var o=a&&U>=a,i=r&&e.timestamp-z.timestamp>r;(o||i)&&B(!0)}};try{var X=[];X.push(k("DOMContentLoaded",(function(){q(K({type:l.DomContentLoaded,data:{}}))})));var $=function(){B(),X.push(Y({mutationCb:function(e){return q(K({type:l.IncrementalSnapshot,data:t({source:c.Mutation},e)}))},mousemoveCb:function(e,t){return q(K({type:l.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return q(K({type:l.IncrementalSnapshot,data:t({source:c.MouseInteraction},e)}))},scrollCb:function(e){return q(K({type:l.IncrementalSnapshot,data:t({source:c.Scroll},e)}))},viewportResizeCb:function(e){return q(K({type:l.IncrementalSnapshot,data:t({source:c.ViewportResize},e)}))},inputCb:function(e){return q(K({type:l.IncrementalSnapshot,data:t({source:c.Input},e)}))},mediaInteractionCb:function(e){return q(K({type:l.IncrementalSnapshot,data:t({source:c.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return q(K({type:l.IncrementalSnapshot,data:t({source:c.StyleSheetRule},e)}))},canvasMutationCb:function(e){return q(K({type:l.IncrementalSnapshot,data:t({source:c.CanvasMutation},e)}))},fontCb:function(e){return q(K({type:l.IncrementalSnapshot,data:t({source:c.Font},e)}))},logCb:function(e){return q(K({type:l.IncrementalSnapshot,data:t({source:c.Log},e)}))},blockClass:u,blockSelector:d,ignoreClass:f,maskInputOptions:P,maskInputFn:b,inlineStylesheet:m,sampling:I,recordCanvas:_,collectFonts:D,slimDOMOptions:j,logOptions:V},C))};return"interactive"===document.readyState||"complete"===document.readyState?$():X.push(k("load",(function(){q(K({type:l.Load,data:{}})),$()}),window)),function(){X.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}return $.addCustomEvent=function(e,t){if(!q)throw new Error("please add custom event after start recording");q(K({type:l.Custom,data:{tag:e,payload:t}}))},$.freezePage=function(){W.freeze()},$}();
***************************************************************************** */var e,t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function n(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i}function o(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e}function a(e){var t,n=null===(t=e)||void 0===t?void 0:t.host;return Boolean(n&&n.shadowRoot&&n.shadowRoot===e)}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(e||(e={}));var i=1,s=RegExp("[^a-z0-9-_]");function u(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(l).join(""):null}catch(e){return null}}function l(e){return function(e){return"styleSheet"in e}(e)?u(e.styleSheet)||"":e.cssText}var c,d,p,f,m,h=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,v=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,y=/^(data:)([^,]*),(.*)/i;function g(e,t){return(e||"").replace(h,(function(e,n,r,o,a,i){var s,u=r||a||i,l=n||o||"";if(!u)return e;if(!v.test(u))return"url("+l+u+l+")";if(y.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),d=u.split("/");c.pop();for(var p=0,f=d;p<f.length;p++){var m=f[p];"."!==m&&(".."===m?c.pop():c.push(m))}return"url("+l+c.join("/")+l+")"}))}function b(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function S(){var e=document.createElement("a");return e.href="",e.href}function C(e,t,n,r){return"src"===n||("href"===n||"xlink:href"===n)&&r?b(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){return""===t.trim()?t:t.split(",").map((function(t){var n=t.trimLeft().trimRight().split(" ");return 2===n.length?b(e,n[0])+" "+n[1]:1===n.length?""+b(e,n[0]):""})).join(", ")}(e,r):"style"===n&&r?g(r,S()):r:b(e,r)}function k(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach((function(e){if(t.test(e))return!0}));return!(!n||!e.matches(n))||k(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,k(e.parentNode,t,n)}function w(t,n){var r,o,a=n.doc,i=n.blockClass,l=n.blockSelector,c=n.maskTextClass,d=n.maskTextSelector,p=n.inlineStylesheet,f=n.maskInputOptions,m=void 0===f?{}:f,h=n.maskTextFn,v=n.recordCanvas;if(a.__sn){var y=a.__sn.id;r=1===y?void 0:y}switch(t.nodeType){case t.DOCUMENT_NODE:return{type:e.Document,childNodes:[],rootId:r};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:r};case t.ELEMENT_NODE:for(var b=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var o=e.classList[r];if(t.test(o))return!0}return!!n&&e.matches(n)}(t,i,l),w=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return s.test(t)?"div":t}(t),x={},T=0,N=Array.from(t.attributes);T<N.length;T++){var O=N[T],E=O.name,I=O.value;x[E]=C(a,w,E,I)}if("link"===w&&p){var M,L=Array.from(a.styleSheets).find((function(e){return e.href===t.href}));(M=u(L))&&(delete x.rel,delete x.href,x._cssText=g(M,L.href))}if("style"===w&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(M=u(t.sheet))&&(x._cssText=g(M,S()));if("input"===w||"textarea"===w||"select"===w){I=t.value;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&I?x.value=m[x.type]||m[w]?"*".repeat(I.length):I:t.checked&&(x.checked=t.checked)}if("option"===w){var _=t.parentElement;x.value===_.value&&(x.selected=t.selected)}if("canvas"===w&&v&&(x.rr_dataURL=t.toDataURL()),"audio"!==w&&"video"!==w||(x.rr_mediaState=t.paused?"paused":"played"),t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop),b){var D=t.getBoundingClientRect(),R=D.width,F=D.height;x={class:x.class,rr_width:R+"px",rr_height:F+"px"}}return"iframe"===w&&delete x.src,{type:e.Element,tagName:w,attributes:x,childNodes:[],isSVG:(o=t,"svg"===o.tagName||o instanceof SVGElement||void 0),needBlock:b,rootId:r};case t.TEXT_NODE:var A=t.parentNode&&t.parentNode.tagName,z=t.textContent,P="STYLE"===A||void 0,j="SCRIPT"===A||void 0;return P&&z&&(z=g(z,S())),j&&(z="SCRIPT_PLACEHOLDER"),!P&&!j&&k(t,c,d)&&z&&(z=h?h(z):z.replace(/[\S]/g,"*")),{type:e.Text,textContent:z||"",isStyle:P,rootId:r};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:r};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:r};default:return!1}}function x(e){return void 0===e?"":e.toLowerCase()}function T(t,n){var r,o=n.doc,s=n.map,u=n.blockClass,l=n.blockSelector,c=n.maskTextClass,d=n.maskTextSelector,p=n.skipChild,f=void 0!==p&&p,m=n.inlineStylesheet,h=void 0===m||m,v=n.maskInputOptions,y=void 0===v?{}:v,g=n.maskTextFn,b=n.slimDOMOptions,S=n.recordCanvas,C=void 0!==S&&S,k=n.onSerialize,N=n.onIframeLoad,O=n.iframeLoadTimeout,E=void 0===O?5e3:O,I=n.preserveWhiteSpace,M=void 0===I||I,L=w(t,{doc:o,blockClass:u,blockSelector:l,maskTextClass:c,maskTextSelector:d,inlineStylesheet:h,maskInputOptions:y,maskTextFn:g,recordCanvas:C});if(!L)return console.warn(t,"not serialized"),null;r="__sn"in t?t.__sn.id:!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(x(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===x(t.attributes.name)||"icon"===x(t.attributes.rel)||"apple-touch-icon"===x(t.attributes.rel)||"shortcut icon"===x(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&x(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(x(t.attributes.property).match(/^(og|twitter|fb):/)||x(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===x(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===x(t.attributes.name)||"googlebot"===x(t.attributes.name)||"bingbot"===x(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===x(t.attributes.name)||"generator"===x(t.attributes.name)||"framework"===x(t.attributes.name)||"publisher"===x(t.attributes.name)||"progid"===x(t.attributes.name)||x(t.attributes.property).match(/^article:/)||x(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===x(t.attributes.name)||"yandex-verification"===x(t.attributes.name)||"csrf-token"===x(t.attributes.name)||"p:domain_verify"===x(t.attributes.name)||"verify-v1"===x(t.attributes.name)||"verification"===x(t.attributes.name)||"shopify-checkout-api-token"===x(t.attributes.name)))return!0}}return!1}(L,b)&&(M||L.type!==e.Text||L.isStyle||L.textContent.replace(/^\s+|\s+$/gm,"").length)?i++:-2;var _=Object.assign(L,{id:r});if(t.__sn=_,-2===r)return null;s[r]=t,k&&k(t);var D=!f;if(_.type===e.Element&&(D=D&&!_.needBlock,delete _.needBlock),(_.type===e.Document||_.type===e.Element)&&D){b.headWhitespace&&L.type===e.Element&&"head"===L.tagName&&(M=!1);for(var R={doc:o,map:s,blockClass:u,blockSelector:l,maskTextClass:c,maskTextSelector:d,skipChild:f,inlineStylesheet:h,maskInputOptions:y,maskTextFn:g,slimDOMOptions:b,recordCanvas:C,preserveWhiteSpace:M,onSerialize:k,onIframeLoad:N,iframeLoadTimeout:E},F=0,A=Array.from(t.childNodes);F<A.length;F++){(j=T(A[F],R))&&_.childNodes.push(j)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot){_.isShadowHost=!0;for(var z=0,P=Array.from(t.shadowRoot.childNodes);z<P.length;z++){var j;(j=T(P[z],R))&&(j.isShadow=!0,_.childNodes.push(j))}}}return t.parentNode&&a(t.parentNode)&&(_.isShadow=!0),_.type===e.Element&&"iframe"===_.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,a=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){"about:blank"===r.location.href&&"about:blank"!==e.src&&""!==e.src?e.addEventListener("load",t):t()}else{var i=setTimeout((function(){a||(t(),a=!0)}),n);e.addEventListener("load",(function(){clearTimeout(i),a=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&N){var n=T(e,{doc:e,map:s,blockClass:u,blockSelector:l,maskTextClass:c,maskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:y,maskTextFn:g,slimDOMOptions:b,recordCanvas:C,preserveWhiteSpace:M,onSerialize:k,onIframeLoad:N,iframeLoadTimeout:E});n&&N(t,n)}}),E),_}function N(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom"}(c||(c={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag"}(d||(d={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd"}(p||(p={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(f||(f={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(m||(m={}));var O="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.",E={map:{},getId:function(){return console.error(O),-1},getNode:function(){return console.error(O),null},removeNodeFromMap:function(){console.error(O)},has:function(){return console.error(O),!1},reset:function(){console.error(O)}};function I(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(a){var i=Date.now();o||!1!==n.leading||(o=i);var s=t-(i-o),u=this,l=arguments;s<=0||s>t?(r&&(window.clearTimeout(r),r=null),o=i,e.apply(u,l)):r||!1===n.trailing||(r=window.setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,l)}),s))}}function M(e,t,n,r,o){void 0===o&&(o=window);var a=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return M(e,t,a||{},!0)}}function L(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}function _(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function D(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function R(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;return"string"==typeof t?n=e.classList.contains(t):e.classList.forEach((function(e){t.test(e)&&(n=!0)})),n||R(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,R(e.parentNode,t)}function F(e){return"__sn"in e&&-2===e.__sn.id}function A(e){return Boolean(e.changedTouches)}function z(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function P(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}function j(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(E=new Proxy(E,{get:function(e,t,n){return"map"===t&&console.error(O),Reflect.get(e,t,n)}}));var H=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&j(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&j(e.nextSibling)&&e.nextSibling.__ln.previous){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),W=function(e,t){return e+"@"+t};function V(e){return"__sn"in e}var B=function(){function e(){var e=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,r,o,i;if(!e.frozen&&!e.locked){for(var s=[],u=new H,l=function(t){for(var n=t,r=-2;-2===r;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return-1===r&&R(t.nextSibling,e.blockClass)&&(r=null),r},c=function(t){var n,r=t.getRootNode?null===(n=t.getRootNode())||void 0===n?void 0:n.host:null,o=!e.doc.contains(t)&&!e.doc.contains(r);if(t.parentNode&&!o){var i=a(t.parentNode)?e.mirror.getId(r):e.mirror.getId(t.parentNode),c=l(t);if(-1===i||-1===c)return u.addNode(t);var d=T(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,onSerialize:function(n){z(n)&&e.iframeManager.addIframe(n),P(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n)}});d&&s.push({parentId:i,nextId:c,node:d})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var d=n(e.movedSet),p=d.next();!p.done;p=d.next()){var f=p.value;U(e.removes,f,e.mirror)&&!e.movedSet.has(f.parentNode)||c(f)}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}try{for(var m=n(e.addedSet),h=m.next();!h.done;h=m.next()){f=h.value;q(e.droppedSet,f)||U(e.removes,f,e.mirror)?q(e.movedSet,f)?c(f):e.droppedSet.add(f):c(f)}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=m.return)&&i.call(m)}finally{if(o)throw o.error}}for(var v=null;u.length;){var y=null;if(v){var g=e.mirror.getId(v.value.parentNode),b=l(v.value);-1!==g&&-1!==b&&(y=v)}if(!y)for(var S=u.length-1;S>=0;S--){var C=u.get(S);g=e.mirror.getId(C.value.parentNode),b=l(C.value);if(-1!==g&&-1!==b){y=C;break}}if(!y){for(;u.head;)u.removeNode(u.head.value);break}v=y.previous,u.removeNode(y.value),c(y.value)}var k={texts:e.texts.map((function(t){return{id:e.mirror.getId(t.node),value:t.value}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:s};(k.texts.length||k.attributes.length||k.removes.length||k.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.emissionCallback(k))}},this.processMutation=function(t){if(!F(t.target))switch(t.type){case"characterData":var n=t.target.textContent;R(t.target,e.blockClass)||n===t.oldValue||e.texts.push({value:k(t.target,e.maskTextClass,e.maskTextSelector)&&n?e.maskTextFn?e.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:t.target});break;case"attributes":n=t.target.getAttribute(t.attributeName);if(R(t.target,e.blockClass)||n===t.oldValue)return;var r=e.attributes.find((function(e){return e.node===t.target}));r||(r={node:t.target,attributes:{}},e.attributes.push(r)),r.attributes[t.attributeName]=C(e.doc,t.target.tagName,t.attributeName,n);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var r=e.mirror.getId(n),o=a(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);R(n,e.blockClass)||R(t.target,e.blockClass)||F(n)||(e.addedSet.has(n)?($(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||function e(t,n){if(a(t))return!1;var r=n.getId(t);return!n.has(r)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode,n))}(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[W(r,o)]?$(e.movedSet,n):e.removes.push({parentId:o,id:r,isShadow:!!a(t.target)||void 0})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!(R(t,e.blockClass)||n&&R(n,e.blockClass))){if(V(t)){if(F(t))return;e.movedSet.add(t);var r=null;n&&V(n)&&(r=n.__sn.id),r&&(e.movedMap[W(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e,t,n,r,o,a,i,s,u,l,c,d,p,f){this.blockClass=t,this.blockSelector=n,this.maskTextClass=r,this.maskTextSelector=o,this.inlineStylesheet=a,this.maskInputOptions=i,this.maskTextFn=s,this.recordCanvas=u,this.slimDOMOptions=l,this.emissionCallback=e,this.doc=c,this.mirror=d,this.iframeManager=p,this.shadowDomManager=f},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1,this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1,this.emit()},e}();function $(e,t){e.delete(t),t.childNodes.forEach((function(t){return $(e,t)}))}function U(e,t,n){var r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||U(e,r,n)}function q(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||q(e,n))}function X(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(var a=0;a<r.children.length;a++){var i=r.children[a];i.localName&&i.localName.toLowerCase&&i.localName.toLowerCase()===n&&o.push(i)}o.length>1&&(n+=":eq("+o.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function Y(e,t){var n={numOfKeysLimit:50};Object.assign(n,t);var r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var a=r.indexOf(this);~a?r.splice(a+1):r.push(this),~a?o.splice(a,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null==t)return t;if(function(e){if("object"==typeof e&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=t.slice(0,n.stringLengthLimit)+"...");return t}(t);if(t instanceof Event){var i={};for(var s in t){var u=t[s];Array.isArray(u)?i[s]=X(u.length?u[0]:null):i[s]=u}return i}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t}))}var K=function(){function e(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),J=/(^|@)\S+:\d+/,G=/^\s*at .*(\S+:\d+|\(native\))/m,Z=/^(eval@)?(\[native code])?$/,Q={parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(G))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(G)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),a=r.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new K({functionName:a,fileName:i,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Z)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new K({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new K({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],o=2,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new K({fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],o=0,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new K({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(J)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new K({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}},ee=[];function te(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function ne(e,t,n,r,o,a,i,s,u,l,c,d,p,f,m){var h,v,y,g=new B;ee.push(g),g.init(e,n,r,o,a,i,s,u,l,c,t,d,p,f);var b=window.MutationObserver||window.__rrMutationObserver,S=null===(y=null===(v=null===(h=window)||void 0===h?void 0:h.Zone)||void 0===v?void 0:v.__symbol__)||void 0===y?void 0:y.call(v,"MutationObserver");S&&window[S]&&(b=window[S]);var C=new b(g.processMutations.bind(g));return C.observe(m,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),C}function re(e,t,n,r,o){if(!1===o.mouseInteraction)return function(){};var a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,i=[];return Object.keys(p).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(o){var a=o.toLowerCase(),s=function(t){return function(o){var a=te(o);if(!R(a,r)){var i=A(o)?o.changedTouches[0]:o;if(i){var s=n.getId(a),u=i.clientX,l=i.clientY;e({type:p[t],id:s,x:u,y:l})}}}}(o);i.push(N(a,s,t))})),function(){i.forEach((function(e){return e()}))}}function oe(e,t,n,r,o){return N("scroll",I((function(o){var a=te(o);if(a&&!R(a,r)){var i=n.getId(a);if(a===t){var s=t.scrollingElement||t.documentElement;e({id:i,x:s.scrollLeft,y:s.scrollTop})}else e({id:i,x:a.scrollLeft,y:a.scrollTop})}}),o.scroll||100),t)}var ae=["INPUT","TEXTAREA","SELECT"],ie=new WeakMap;function se(e,r){void 0===r&&(r={}),function(e,t){var n=e.mutationCb,r=e.mousemoveCb,a=e.mouseInteractionCb,i=e.scrollCb,s=e.viewportResizeCb,u=e.inputCb,l=e.mediaInteractionCb,c=e.styleSheetRuleCb,d=e.canvasMutationCb,p=e.fontCb,f=e.logCb;e.mutationCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mutation&&t.mutation.apply(t,o(e)),n.apply(void 0,o(e))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,o(e)),r.apply(void 0,o(e))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,o(e)),a.apply(void 0,o(e))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,o(e)),i.apply(void 0,o(e))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,o(e)),s.apply(void 0,o(e))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,o(e)),u.apply(void 0,o(e))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,o(e)),l.apply(void 0,o(e))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,o(e)),c.apply(void 0,o(e))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,o(e)),d.apply(void 0,o(e))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,o(e)),p.apply(void 0,o(e))},e.logCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.log&&t.log.apply(t,o(e)),f.apply(void 0,o(e))}}(e,r);var a,i,s,u=ne(e.mutationCb,e.doc,e.blockClass,e.blockSelector,e.maskTextClass,e.maskTextSelector,e.inlineStylesheet,e.maskInputOptions,e.maskTextFn,e.recordCanvas,e.slimDOMOptions,e.mirror,e.iframeManager,e.shadowDomManager,e.doc),l=function(e,t,n,r){if(!1===t.mousemove)return function(){};var o,a="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500,s=[],u=I((function(t){var n=Date.now()-o;e(s.map((function(e){return e.timeOffset-=n,e})),t),s=[],o=null}),i),l=I((function(e){var t=te(e),n=A(e)?e.changedTouches[0]:e,a=n.clientX,i=n.clientY;o||(o=Date.now()),s.push({x:a,y:i,id:r.getId(t),timeOffset:Date.now()-o}),u(e instanceof DragEvent?d.Drag:e instanceof MouseEvent?d.MouseMove:d.TouchMove)}),a,{trailing:!1}),c=[N("mousemove",l,n),N("touchmove",l,n),N("drag",l,n)];return function(){c.forEach((function(e){return e()}))}}(e.mousemoveCb,e.sampling,e.doc,e.mirror),c=re(e.mouseInteractionCb,e.doc,e.mirror,e.blockClass,e.sampling),p=oe(e.scrollCb,e.doc,e.mirror,e.blockClass,e.sampling),m=(a=e.viewportResizeCb,i=-1,s=-1,N("resize",I((function(){var e=_(),t=D();i===e&&s===t||(a({width:Number(t),height:Number(e)}),i=e,s=t)}),200),window)),h=function(e,n,r,a,i,s,u,l){function c(e){var t=te(e);if(t&&t.tagName&&!(ae.indexOf(t.tagName)<0)&&!R(t,a)){var r=t.type;if("password"!==r&&!t.classList.contains(i)){var o=t.value,l=!1;"radio"===r||"checkbox"===r?l=t.checked:(s[t.tagName.toLowerCase()]||s[r])&&(o=u?u(o):"*".repeat(o.length)),d(t,{text:o,isChecked:l});var c=t.name;"radio"===r&&c&&l&&n.querySelectorAll('input[type="radio"][name="'+c+'"]').forEach((function(e){e!==t&&d(e,{text:e.value,isChecked:!l})}))}}}function d(n,o){var a=ie.get(n);if(!a||a.text!==o.text||a.isChecked!==o.isChecked){ie.set(n,o);var i=r.getId(n);e(t(t({},o),{id:i}))}}var p=("last"===l.input?["change"]:["input","change"]).map((function(e){return N(e,c,n)})),f=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"]];return f&&f.set&&p.push.apply(p,o(m.map((function(e){return M(e[0],e[1],{set:function(){c({target:this})}})})))),function(){p.forEach((function(e){return e()}))}}(e.inputCb,e.doc,e.mirror,e.blockClass,e.ignoreClass,e.maskInputOptions,e.maskInputFn,e.sampling),v=function(e,t,n){var r=function(r){return function(o){var a=te(o);a&&!R(a,t)&&e({type:"play"===r?f.Play:f.Pause,id:n.getId(a)})}},o=[N("play",r("play")),N("pause",r("pause"))];return function(){o.forEach((function(e){return e()}))}}(e.mediaInteractionCb,e.blockClass,e.mirror),y=function(e,t){var n=CSSStyleSheet.prototype.insertRule;CSSStyleSheet.prototype.insertRule=function(r,o){var a=t.getId(this.ownerNode);return-1!==a&&e({id:a,adds:[{rule:r,index:o}]}),n.apply(this,arguments)};var r=CSSStyleSheet.prototype.deleteRule;return CSSStyleSheet.prototype.deleteRule=function(n){var o=t.getId(this.ownerNode);return-1!==o&&e({id:o,removes:[{index:n}]}),r.apply(this,arguments)},function(){CSSStyleSheet.prototype.insertRule=n,CSSStyleSheet.prototype.deleteRule=r}}(e.styleSheetRuleCb,e.mirror),g=e.recordCanvas?function(e,t,r){var a,i,s=Object.getOwnPropertyNames(CanvasRenderingContext2D.prototype),u=[],l=function(n){try{if("function"!=typeof CanvasRenderingContext2D.prototype[n])return"continue";var a=L(CanvasRenderingContext2D.prototype,n,(function(a){return function(){for(var i=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return R(this.canvas,t)||setTimeout((function(){var t=o(s);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var a=t[0],u=a.getContext("2d"),l=null==u?void 0:u.getImageData(0,0,a.width,a.height),c=null==l?void 0:l.data;t[0]=JSON.stringify(c)}e({id:r.getId(i.canvas),property:n,args:t})}),0),a.apply(this,s)}}));u.push(a)}catch(t){var i=M(CanvasRenderingContext2D.prototype,n,{set:function(t){e({id:r.getId(this.canvas),property:n,args:[t],setter:!0})}});u.push(i)}};try{for(var c=n(s),d=c.next();!d.done;d=c.next()){l(d.value)}}catch(e){a={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(a)throw a.error}}return function(){u.forEach((function(e){return e()}))}}(e.canvasMutationCb,e.blockClass,e.mirror):function(){},b=e.collectFonts?function(e){var t=[],n=new WeakMap,r=FontFace;window.FontFace=function(e,t,o){var a=new r(e,t,o);return n.set(a,{family:e,buffer:"string"!=typeof t,descriptors:o,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),a};var o=L(document.fonts,"add",(function(t){return function(r){return setTimeout((function(){var t=n.get(r);t&&(e(t),n.delete(r))}),0),t.apply(this,[r])}}));return t.push((function(){window.FonFace=r})),t.push(o),function(){t.forEach((function(e){return e()}))}}(e.fontCb):function(){},S=e.logOptions?function(e,t){var r,a,i=this,s=t.logger;if(!s)return function(){};var u=0,l=[];if(t.level.includes("error")&&window){var c=window.onerror;window.onerror=function(n,r,o,a,s){c&&c.apply(i,[n,r,o,a,s]);var u=Q.parse(s).map((function(e){return e.toString()})),l=[Y(n,t.stringifyOptions)];e({level:"error",trace:u,payload:l})},l.push((function(){window.onerror=c}))}try{for(var d=n(t.level),p=d.next();!p.done;p=d.next()){var f=p.value;l.push(m(s,f))}}catch(e){r={error:e}}finally{try{p&&!p.done&&(a=d.return)&&a.call(d)}finally{if(r)throw r.error}}return function(){l.forEach((function(e){return e()}))};function m(n,r){var a=this;return n[r]?L(n,r,(function(n){return function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];n.apply(a,i);try{var l=Q.parse(new Error).map((function(e){return e.toString()})).splice(1),c=i.map((function(e){return Y(e,t.stringifyOptions)}));++u<t.lengthThreshold?e({level:r,trace:l,payload:c}):u===t.lengthThreshold&&e({level:"warn",trace:[],payload:[Y("The number of log records reached the threshold.")]})}catch(e){n.apply(void 0,o(["rrweb logger error:",e],i))}}})):function(){}}}(e.logCb,e.logOptions):function(){};return function(){u.disconnect(),l(),c(),p(),m(),h(),v(),y(),g(),b(),S()}}var ue,le,ce=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e)},e}(),de=function(){function e(e){this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror}return e.prototype.addShadowRoot=function(e,t){ne(this.mutationCb,t,this.bypassOptions.blockClass,this.bypassOptions.blockSelector,this.bypassOptions.maskTextClass,this.bypassOptions.maskTextSelector,this.bypassOptions.inlineStylesheet,this.bypassOptions.maskInputOptions,this.bypassOptions.maskTextFn,this.bypassOptions.recordCanvas,this.bypassOptions.slimDOMOptions,this.mirror,this.bypassOptions.iframeManager,this,e),oe(this.scrollCb,e,this.mirror,this.bypassOptions.blockClass,this.bypassOptions.sampling)},e}();function pe(e){return t(t({},e),{timestamp:Date.now()})}var fe={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}};function me(e){void 0===e&&(e={});var n=e.emit,o=e.checkoutEveryNms,a=e.checkoutEveryNth,i=e.blockClass,s=void 0===i?"rr-block":i,u=e.blockSelector,l=void 0===u?null:u,p=e.ignoreClass,f=void 0===p?"rr-ignore":p,m=e.maskTextClass,h=void 0===m?"rr-mask":m,v=e.maskTextSelector,y=void 0===v?null:v,g=e.inlineStylesheet,b=void 0===g||g,S=e.maskAllInputs,C=e.maskInputOptions,k=e.slimDOMOptions,w=e.maskInputFn,x=e.maskTextFn,O=e.hooks,E=e.packFn,I=e.sampling,M=void 0===I?{}:I,L=e.mousemoveWait,R=e.recordCanvas,F=void 0!==R&&R,A=e.collectFonts,j=void 0!==A&&A,H=e.recordLog,W=void 0!==H&&H;if(!n)throw new Error("emit function is required");void 0!==L&&void 0===M.mousemove&&(M.mousemove=L);var V,B,$=!0===S?{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}:void 0!==C?C:{},U=!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===k,headMetaDescKeywords:"all"===k}:k||{},q={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:console},X=W?!0===W?q:Object.assign({},q,W):{};void 0===V&&(V=window),"NodeList"in V&&!V.NodeList.prototype.forEach&&(V.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in V&&!V.DOMTokenList.prototype.forEach&&(V.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1});var Y=0;ue=function(e,t){var r;if(!(null===(r=ee[0])||void 0===r?void 0:r.isFrozen())||e.type===c.FullSnapshot||e.type===c.IncrementalSnapshot&&e.data.source===d.Mutation||ee.forEach((function(e){return e.unfreeze()})),n(E?E(e):e,t),e.type===c.FullSnapshot)B=e,Y=0;else if(e.type===c.IncrementalSnapshot){if(e.data.source===d.Mutation&&e.data.isAttachIframe)return;Y++;var i=a&&Y>=a,s=o&&e.timestamp-B.timestamp>o;(i||s)&&le(!0)}};var K=function(e){ue(pe({type:c.IncrementalSnapshot,data:t({source:d.Mutation},e)}))},J=function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.Scroll},e)}))},G=new ce({mutationCb:K}),Z=new de({mutationCb:K,scrollCb:J,bypassOptions:{blockClass:s,blockSelector:l,maskTextClass:h,maskTextSelector:y,inlineStylesheet:b,maskInputOptions:$,maskTextFn:x,recordCanvas:F,sampling:M,slimDOMOptions:U,iframeManager:G},mirror:fe});le=function(e){var t,n,o,a;void 0===e&&(e=!1),ue(pe({type:c.Meta,data:{href:window.location.href,width:D(),height:_()}}),e),ee.forEach((function(e){return e.lock()}));var i=r(function(e,t){var n=t||{},r=n.blockClass,o=void 0===r?"rr-block":r,a=n.blockSelector,i=void 0===a?null:a,s=n.maskTextClass,u=void 0===s?"rr-mask":s,l=n.maskTextSelector,c=void 0===l?null:l,d=n.inlineStylesheet,p=void 0===d||d,f=n.recordCanvas,m=void 0!==f&&f,h=n.maskAllInputs,v=void 0!==h&&h,y=n.maskTextFn,g=n.slimDOM,b=void 0!==g&&g,S={};return[T(e,{doc:e,map:S,blockClass:o,blockSelector:i,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===v?{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}:!1===v?{}:v,maskTextFn:y,slimDOMOptions:!0===b||"all"===b?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===b,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===b?{}:b,recordCanvas:m,preserveWhiteSpace:n.preserveWhiteSpace,onSerialize:n.onSerialize,onIframeLoad:n.onIframeLoad,iframeLoadTimeout:n.iframeLoadTimeout}),S]}(document,{blockClass:s,blockSelector:l,maskTextClass:h,maskTextSelector:y,inlineStylesheet:b,maskAllInputs:$,maskTextFn:x,slimDOM:U,recordCanvas:F,onSerialize:function(e){z(e)&&G.addIframe(e),P(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){G.attachIframe(e,t)}}),2),u=i[0],d=i[1];if(!u)return console.warn("Failed to snapshot the document");fe.map=d,ue(pe({type:c.FullSnapshot,data:{node:u,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(a=null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.parentElement)||void 0===a?void 0:a.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),ee.forEach((function(e){return e.unlock()}))};try{var Q=[];Q.push(N("DOMContentLoaded",(function(){ue(pe({type:c.DomContentLoaded,data:{}}))})));var te=function(e){return se({mutationCb:K,mousemoveCb:function(e,t){return ue(pe({type:c.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.MouseInteraction},e)}))},scrollCb:J,viewportResizeCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.ViewportResize},e)}))},inputCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.Input},e)}))},mediaInteractionCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.StyleSheetRule},e)}))},canvasMutationCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.CanvasMutation},e)}))},fontCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.Font},e)}))},logCb:function(e){return ue(pe({type:c.IncrementalSnapshot,data:t({source:d.Log},e)}))},blockClass:s,ignoreClass:f,maskTextClass:h,maskTextSelector:y,maskInputOptions:$,inlineStylesheet:b,sampling:M,recordCanvas:F,collectFonts:j,doc:e,maskInputFn:w,maskTextFn:x,logOptions:X,blockSelector:l,slimDOMOptions:U,mirror:fe,iframeManager:G,shadowDomManager:Z},O)};G.addLoadListener((function(e){Q.push(te(e.contentDocument))}));var ne=function(){le(),Q.push(te(document))};return"interactive"===document.readyState||"complete"===document.readyState?ne():Q.push(N("load",(function(){ue(pe({type:c.Load,data:{}})),ne()}),window)),function(){Q.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}return me.addCustomEvent=function(e,t){if(!ue)throw new Error("please add custom event after start recording");ue(pe({type:c.Custom,data:{tag:e,payload:t}}))},me.freezePage=function(){ee.forEach((function(e){return e.freeze()}))},me.takeFullSnapshot=function(e){if(!le)throw new Error("please take full snapshot after start recording");le(e)},me.mirror=fe,me}();
//# sourceMappingURL=rrweb-record.min.js.map

@@ -15,3 +15,3 @@ var rrwebReplay=function(e){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function r(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function o(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(i(arguments[t]));return e}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(t||(t={}));var a=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function s(e,t){void 0===t&&(t={});var n=1,r=1;function i(e){var t=e.match(/\n/g);t&&(n+=t.length);var i=e.lastIndexOf("\n");r=-1===i?r+e.length:e.length-i}function o(){var e={line:n,column:r};return function(t){return t.position=new s(e),v(),t}}var s=function(e){this.start=e,this.end={line:n,column:r},this.source=t.source};s.prototype.content=e;var c=[];function u(i){var o=new Error(t.source+":"+n+":"+r+": "+i);if(o.reason=i,o.filename=t.source,o.line=n,o.column=r,o.source=e,!t.silent)throw o;c.push(o)}function f(){return h(/^{\s*/)}function d(){return h(/^}/)}function p(){var t,n=[];for(v(),m(n);e.length&&"}"!==e.charAt(0)&&(t=N()||I());)!1!==t&&(n.push(t),m(n));return n}function h(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function v(){h(/^\s*/)}function m(e){var t;for(void 0===e&&(e=[]);t=y();)!1!==t&&e.push(t),t=y();return e}function y(){var t=o();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var n=2;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return u("End of comment missing");var a=e.slice(2,n-2);return r+=2,i(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}}function g(){var e=h(/^([^{]+)/);if(e)return l(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function b(){var e=o(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var n=l(t[0]);if(!h(/^:\s*/))return u("property missing ':'");var r=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:n.replace(a,""),value:r?l(r[0]).replace(a,""):""});return h(/^[;\s]*/),i}}function w(){var e,t=[];if(!f())return u("missing '{'");for(m(t);e=b();)!1!==e&&(t.push(e),m(t)),e=b();return d()?t:u("missing '}'")}function x(){for(var e,t=[],n=o();e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:w()})}var S,E=C("import"),T=C("charset"),M=C("namespace");function C(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=o(),r=h(t);if(r){var i={type:e};return i[e]=r[1].trim(),n(i)}}}function N(){if("@"===e[0])return function(){var e=o(),t=h(/^@([-\w]+)?keyframes\s*/);if(t){var n=t[1];if(!(t=h(/^([-\w]+)\s*/)))return u("@keyframes missing name");var r,i=t[1];if(!f())return u("@keyframes missing '{'");for(var a=m();r=x();)a.push(r),a=a.concat(m());return d()?e({type:"keyframes",name:i,vendor:n,keyframes:a}):u("@keyframes missing '}'")}}()||function(){var e=o(),t=h(/^@media *([^{]+)/);if(t){var n=l(t[1]);if(!f())return u("@media missing '{'");var r=m().concat(p());return d()?e({type:"media",media:n,rules:r}):u("@media missing '}'")}}()||function(){var e=o(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:l(t[1]),media:l(t[2])})}()||function(){var e=o(),t=h(/^@supports *([^{]+)/);if(t){var n=l(t[1]);if(!f())return u("@supports missing '{'");var r=m().concat(p());return d()?e({type:"supports",supports:n,rules:r}):u("@supports missing '}'")}}()||E()||T()||M()||function(){var e=o(),t=h(/^@([-\w]+)?document *([^{]+)/);if(t){var n=l(t[1]),r=l(t[2]);if(!f())return u("@document missing '{'");var i=m().concat(p());return d()?e({type:"document",document:r,vendor:n,rules:i}):u("@document missing '}'")}}()||function(){var e=o();if(h(/^@page */)){var t=g()||[];if(!f())return u("@page missing '{'");for(var n,r=m();n=b();)r.push(n),r=r.concat(m());return d()?e({type:"page",selectors:t,declarations:r}):u("@page missing '}'")}}()||function(){var e=o();if(h(/^@host\s*/)){if(!f())return u("@host missing '{'");var t=m().concat(p());return d()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=o();if(h(/^@font-face\s*/)){if(!f())return u("@font-face missing '{'");for(var t,n=m();t=b();)n.push(t),n=n.concat(m());return d()?e({type:"font-face",declarations:n}):u("@font-face missing '}'")}}()}function I(){var e=o(),t=g();return t?(m(),e({type:"rule",selectors:t,declarations:w()})):u("selector missing")}return function e(t,n){for(var r=t&&"string"==typeof t.type,i=r?t:n,o=0,a=Object.keys(t);o<a.length;o++){var s=a[o],l=t[s];Array.isArray(l)?l.forEach((function(t){e(t,i)})):l&&"object"==typeof l&&e(l,i)}r&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null});return t}((S=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:S,parsingErrors:c}}))}function l(e){return e?e.replace(/^\s+|\s+$/g,""):""}var c={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var u=/([^\\]):hover/g;function f(e){var t=s(e,{silent:!0});return t.stylesheet?(t.stylesheet.rules.forEach((function(t){"selectors"in t&&(t.selectors||[]).forEach((function(t){if(u.test(t)){var n=t.replace(u,"$1.\\:hover");e=e.replace(t,t+", "+n)}}))})),e):e}function d(e,n){var r=n.doc,i=n.hackCss;switch(e.type){case t.Document:return r.implementation.createDocument(null,"",null);case t.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case t.Element:var o,a=function(e){var t=c[e.tagName]?c[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);o=e.isSVG?r.createElementNS("http://www.w3.org/2000/svg",a):r.createElement(a);var s=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var n=e.attributes[t];if(n="boolean"==typeof n||"number"==typeof n?"":n,t.startsWith("rr_")){if("canvas"===a&&"rr_dataURL"===t){var s=document.createElement("img");s.src=n,s.onload=function(){var e=o.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(o.style.width=n),"rr_height"===t&&(o.style.height=n),"rr_mediaState"===t)switch(n){case"played":o.play();case"paused":o.pause()}}else{var l="textarea"===a&&"value"===t,c="style"===a&&"_cssText"===t;if(c&&i&&(n=f(n)),l||c){for(var u=r.createTextNode(n),d=0,p=Array.from(o.childNodes);d<p.length;d++){var h=p[d];h.nodeType===o.TEXT_NODE&&o.removeChild(h)}return o.appendChild(u),"continue"}if("iframe"===a&&"src"===t)return"continue";try{e.isSVG&&"xlink:href"===t?o.setAttributeNS("http://www.w3.org/1999/xlink",t,n):"onload"===t||"onclick"===t||"onmouse"===t.substring(0,7)?o.setAttribute("_"+t,n):o.setAttribute(t,n)}catch(e){}}};for(var l in e.attributes)s(l);return o;case t.Text:return r.createTextNode(e.isStyle&&i?f(e.textContent):e.textContent);case t.CDATA:return r.createCDATASection(e.textContent);case t.Comment:return r.createComment(e.textContent);default:return null}}function p(e,n){var r=n.doc,i=n.map,o=n.skipChild,a=void 0!==o&&o,s=n.hackCss,l=void 0===s||s,c=d(e,{doc:r,hackCss:l});if(!c)return null;if(e.type===t.Document&&(r.close(),r.open(),c=r),c.__sn=e,i[e.id]=c,(e.type===t.Document||e.type===t.Element)&&!a)for(var u=0,f=e.childNodes;u<f.length;u++){var h=f[u],v=p(h,{doc:r,map:i,skipChild:!1,hackCss:l});v?c.appendChild(v):console.warn("Failed to rebuild",h)}return c}function h(e,n){var r=n.doc,i=n.onVisit,o=n.hackCss,a={},s=p(e,{doc:r,map:a,skipChild:!1,hackCss:void 0===o||o});return function(e,t){for(var n in e)e[n]&&(r=e[n],t(r));var r}(a,(function(e){i&&i(e),function(e){var n=e.__sn;if(n.type===t.Element){var r=e;for(var i in n.attributes)if(n.attributes.hasOwnProperty(i)&&i.startsWith("rr_")){var o=n.attributes[i];"rr_scrollLeft"===i&&(r.scrollLeft=o),"rr_scrollTop"===i&&(r.scrollTop=o)}}}(e)})),[s,a]}function v(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map((function(e){e(n)})),(e["*"]||[]).slice().map((function(e){e(t,n)}))}}}var m,y,g,b,w,x=Object.freeze({__proto__:null,default:v});function S(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var n,r=e.HTMLElement||e.Element,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||s,scrollIntoView:r.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var n=d(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function f(e){var t=c(e,"Y")&&u(e,"Y"),n=c(e,"X")&&u(e,"X");return t||n}function d(e){for(;e!==t.body&&!1===f(e);)e=e.parentNode||e.host;return e}function p(t){var n,r,i,a=(o()-t.startTime)/468;n=function(e){return.5*(1-Math.cos(Math.PI*e))}(a=a>1?1:a),r=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,i),r===t.x&&i===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,r,a){var l,c,u,f,d=o();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,f=i.scroll):(l=n,c=n.scrollLeft,u=n.scrollTop,f=s),p({scrollable:l,method:f,startTime:d,startX:c,startY:u,x:r,y:a})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom"}(m||(m={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log"}(y||(y={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd"}(g||(g={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(b||(b={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change"}(w||(w={}));var E,T=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,o(e))},e.prototype.start=function(){this.actions.sort((function(e,t){return e.delay-t.delay})),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this;this.raf=requestAnimationFrame((function r(){var i=performance.now();for(n.timeOffset+=(i-e)*n.speed,e=i;t.length;){var o=t[0];if(!(n.timeOffset>=o.delay))break;t.shift(),o.doAction()}(t.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(r))}))},e.prototype.clear=function(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.isActive=function(){return null!==this.raf},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r;n=r-1}}return t},e}();function M(e,t){if(e.type===m.IncrementalSnapshot&&e.data.source===y.MouseMove){var n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}
***************************************************************************** */var t,r=function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function n(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function i(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}function a(e){return e.nodeType===e.ELEMENT_NODE}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(t||(t={}));var s=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function l(e,t){void 0===t&&(t={});var r=1,n=1;function o(e){var t=e.match(/\n/g);t&&(r+=t.length);var o=e.lastIndexOf("\n");n=-1===o?n+e.length:e.length-o}function i(){var e={line:r,column:n};return function(t){return t.position=new a(e),m(),t}}var a=function(e){this.start=e,this.end={line:r,column:n},this.source=t.source};a.prototype.content=e;var l=[];function u(o){var i=new Error(t.source+":"+r+":"+n+": "+o);if(i.reason=o,i.filename=t.source,i.line=r,i.column=n,i.source=e,!t.silent)throw i;l.push(i)}function f(){return h(/^{\s*/)}function d(){return h(/^}/)}function p(){var t,r=[];for(m(),v(r);e.length&&"}"!==e.charAt(0)&&(t=C()||I());)!1!==t&&(r.push(t),v(r));return r}function h(t){var r=t.exec(e);if(r){var n=r[0];return o(n),e=e.slice(n.length),r}}function m(){h(/^\s*/)}function v(e){var t;for(void 0===e&&(e=[]);t=y();)!1!==t&&e.push(t),t=y();return e}function y(){var t=i();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var r=2;""!==e.charAt(r)&&("*"!==e.charAt(r)||"/"!==e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return u("End of comment missing");var a=e.slice(2,r-2);return n+=2,o(a),e=e.slice(r),n+=2,t({type:"comment",comment:a})}}function g(){var e=h(/^([^{]+)/);if(e)return c(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function w(){var e=i(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var r=c(t[0]);if(!h(/^:\s*/))return u("property missing ':'");var n=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:r.replace(s,""),value:n?c(n[0]).replace(s,""):""});return h(/^[;\s]*/),o}}function b(){var e,t=[];if(!f())return u("missing '{'");for(v(t);e=w();)!1!==e&&(t.push(e),v(t)),e=w();return d()?t:u("missing '}'")}function S(){for(var e,t=[],r=i();e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:b()})}var x,E=N("import"),T=N("charset"),M=N("namespace");function N(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=i(),n=h(t);if(n){var o={type:e};return o[e]=n[1].trim(),r(o)}}}function C(){if("@"===e[0])return function(){var e=i(),t=h(/^@([-\w]+)?keyframes\s*/);if(t){var r=t[1];if(!(t=h(/^([-\w]+)\s*/)))return u("@keyframes missing name");var n,o=t[1];if(!f())return u("@keyframes missing '{'");for(var a=v();n=S();)a.push(n),a=a.concat(v());return d()?e({type:"keyframes",name:o,vendor:r,keyframes:a}):u("@keyframes missing '}'")}}()||function(){var e=i(),t=h(/^@media *([^{]+)/);if(t){var r=c(t[1]);if(!f())return u("@media missing '{'");var n=v().concat(p());return d()?e({type:"media",media:r,rules:n}):u("@media missing '}'")}}()||function(){var e=i(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:c(t[1]),media:c(t[2])})}()||function(){var e=i(),t=h(/^@supports *([^{]+)/);if(t){var r=c(t[1]);if(!f())return u("@supports missing '{'");var n=v().concat(p());return d()?e({type:"supports",supports:r,rules:n}):u("@supports missing '}'")}}()||E()||T()||M()||function(){var e=i(),t=h(/^@([-\w]+)?document *([^{]+)/);if(t){var r=c(t[1]),n=c(t[2]);if(!f())return u("@document missing '{'");var o=v().concat(p());return d()?e({type:"document",document:n,vendor:r,rules:o}):u("@document missing '}'")}}()||function(){var e=i();if(h(/^@page */)){var t=g()||[];if(!f())return u("@page missing '{'");for(var r,n=v();r=w();)n.push(r),n=n.concat(v());return d()?e({type:"page",selectors:t,declarations:n}):u("@page missing '}'")}}()||function(){var e=i();if(h(/^@host\s*/)){if(!f())return u("@host missing '{'");var t=v().concat(p());return d()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=i();if(h(/^@font-face\s*/)){if(!f())return u("@font-face missing '{'");for(var t,r=v();t=w();)r.push(t),r=r.concat(v());return d()?e({type:"font-face",declarations:r}):u("@font-face missing '}'")}}()}function I(){var e=i(),t=g();return t?(v(),e({type:"rule",selectors:t,declarations:b()})):u("selector missing")}return function e(t,r){for(var n=t&&"string"==typeof t.type,o=n?t:r,i=0,a=Object.keys(t);i<a.length;i++){var s=a[i],l=t[s];Array.isArray(l)?l.forEach((function(t){e(t,o)})):l&&"object"==typeof l&&e(l,o)}n&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:r||null});return t}((x=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:x,parsingErrors:l}}))}function c(e){return e?e.replace(/^\s+|\s+$/g,""):""}var u={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var f=/([^\\]):hover/,d=new RegExp(f,"g");function p(e){var t=l(e,{silent:!0});if(!t.stylesheet)return e;var r=[];if(t.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){f.test(e)&&r.push(e)}))})),0===r.length)return e;var n=new RegExp(r.filter((function(e,t){return r.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g");return e.replace(n,(function(e){var t=e.replace(d,"$1.\\:hover");return e+", "+t}))}function h(e,r){var n=r.doc,o=r.hackCss;switch(e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case t.Element:var i,a=function(e){var t=u[e.tagName]?u[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);i=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",a):n.createElement(a);var s=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var r=e.attributes[t];if(r="boolean"==typeof r||"number"==typeof r?"":r,t.startsWith("rr_")){if("canvas"===a&&"rr_dataURL"===t){var s=document.createElement("img");s.src=r,s.onload=function(){var e=i.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(i.style.width=r),"rr_height"===t&&(i.style.height=r),"rr_mediaState"===t)switch(r){case"played":i.play();case"paused":i.pause()}}else{var l="textarea"===a&&"value"===t,c="style"===a&&"_cssText"===t;if(c&&o&&(r=p(r)),l||c){for(var u=n.createTextNode(r),f=0,d=Array.from(i.childNodes);f<d.length;f++){var h=d[f];h.nodeType===i.TEXT_NODE&&i.removeChild(h)}return i.appendChild(u),"continue"}if("iframe"===a&&"src"===t)return"continue";try{e.isSVG&&"xlink:href"===t?i.setAttributeNS("http://www.w3.org/1999/xlink",t,r):"onload"===t||"onclick"===t||"onmouse"===t.substring(0,7)?i.setAttribute("_"+t,r):i.setAttribute(t,r)}catch(e){}}};for(var l in e.attributes)s(l);if(e.isShadowHost)if(i.shadowRoot)for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);else i.attachShadow({mode:"open"});return i;case t.Text:return n.createTextNode(e.isStyle&&o?p(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function m(e,r){var n=r.doc,o=r.map,i=r.skipChild,s=void 0!==i&&i,l=r.hackCss,c=void 0===l||l,u=r.afterAppend,f=h(e,{doc:n,hackCss:c});if(!f)return null;if(e.rootId&&console.assert(o[e.rootId]===n,"Target document should has the same root id."),e.type===t.Document&&(n.close(),n.open(),f=n),f.__sn=e,o[e.id]=f,(e.type===t.Document||e.type===t.Element)&&!s)for(var d=0,p=e.childNodes;d<p.length;d++){var v=p[d],y=m(v,{doc:n,map:o,skipChild:!1,hackCss:c,afterAppend:u});y?(v.isShadow&&a(f)&&f.shadowRoot?f.shadowRoot.appendChild(y):f.appendChild(y),u&&u(y)):console.warn("Failed to rebuild",v)}return f}function v(e,r){var n=r.doc,o=r.onVisit,i=r.hackCss,a={},s=m(e,{doc:n,map:a,skipChild:!1,hackCss:void 0===i||i,afterAppend:r.afterAppend});return function(e,t){for(var r in e)e[r]&&(n=e[r],t(n));var n}(a,(function(e){o&&o(e),function(e){var r=e.__sn;if(r.type===t.Element){var n=e;for(var o in r.attributes)if(r.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var i=r.attributes[o];"rr_scrollLeft"===o&&(n.scrollLeft=i),"rr_scrollTop"===o&&(n.scrollTop=i)}}}(e)})),[s,a]}function y(e){return e=e||Object.create(null),{on:function(t,r){(e[t]||(e[t]=[])).push(r)},off:function(t,r){e[t]&&e[t].splice(e[t].indexOf(r)>>>0,1)},emit:function(t,r){(e[t]||[]).slice().map((function(e){e(r)})),(e["*"]||[]).slice().map((function(e){e(t,r)}))}}}var g,w,b,S,x,E=Object.freeze({__proto__:null,default:y});function T(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var r,n=e.HTMLElement||e.Element,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:n.prototype.scroll||s,scrollIntoView:n.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(r=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(r)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):o.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?o.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},n.prototype.scroll=n.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},n.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},n.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var r=d(this),n=r.getBoundingClientRect(),i=this.getBoundingClientRect();r!==t.body?(h.call(this,r,r.scrollLeft+i.left-n.left,r.scrollTop+i.top-n.top),"fixed"!==e.getComputedStyle(r).position&&e.scrollBy({left:n.left,top:n.top,behavior:"smooth"})):e.scrollBy({left:i.left,top:i.top,behavior:"smooth"})}else o.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,r){var n=e.getComputedStyle(t,null)["overflow"+r];return"auto"===n||"scroll"===n}function f(e){var t=c(e,"Y")&&u(e,"Y"),r=c(e,"X")&&u(e,"X");return t||r}function d(e){for(;e!==t.body&&!1===f(e);)e=e.parentNode||e.host;return e}function p(t){var r,n,o,a=(i()-t.startTime)/468;r=function(e){return.5*(1-Math.cos(Math.PI*e))}(a=a>1?1:a),n=t.startX+(t.x-t.startX)*r,o=t.startY+(t.y-t.startY)*r,t.method.call(t.scrollable,n,o),n===t.x&&o===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(r,n,a){var l,c,u,f,d=i();r===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,f=o.scroll):(l=r,c=r.scrollLeft,u=r.scrollTop,f=s),p({scrollable:l,method:f,startTime:d,startX:c,startY:u,x:n,y:a})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom"}(g||(g={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag"}(w||(w={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd"}(b||(b={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(S||(S={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(x||(x={}));var M,N=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){this.actions=this.actions.concat(e)},e.prototype.start=function(){this.timeOffset=0;var e=performance.now(),t=this.actions,r=this;this.raf=requestAnimationFrame((function n(){var o=performance.now();for(r.timeOffset+=(o-e)*r.speed,e=o;t.length;){var i=t[0];if(!(r.timeOffset>=i.delay))break;t.shift(),i.doAction()}(t.length>0||r.liveMode)&&(r.raf=requestAnimationFrame(n))}))},e.prototype.clear=function(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.isActive=function(){return null!==this.raf},e.prototype.findActionIndex=function(e){for(var t=0,r=this.actions.length-1;t<=r;){var n=Math.floor((t+r)/2);if(this.actions[n].delay<e.delay)t=n+1;else{if(!(this.actions[n].delay>e.delay))return n;r=n-1}}return t},e}();function C(e,t){if(e.type===g.IncrementalSnapshot&&e.data.source===w.MouseMove){var r=e.data.positions[0].timeOffset,n=e.timestamp+r;return e.delay=n-t,n-t}return e.delay=e.timestamp-t,e.delay}
/*! *****************************************************************************

@@ -30,3 +30,3 @@ Copyright (c) Microsoft Corporation. All rights reserved.

and limitations under the License.
***************************************************************************** */!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(E||(E={}));var C={type:"xstate.init"};function N(e){return void 0===e?[]:[].concat(e)}function I(e){return{type:"xstate.assign",assignment:e}}function _(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function k(e){return function(t){return e===t}}function A(e){return"string"==typeof e?{type:e}:e}function O(e,t){return{value:e,context:t,actions:[],changed:!1,matches:k(e)}}function D(e,t){void 0===t&&(t={});var n={config:e,_options:t,initialState:{value:e.initial,actions:N(e.states[e.initial].entry).map((function(e){return _(e,t.actions)})),context:e.context,matches:k(e.initial)},transition:function(t,r){var i,o,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,l=a.context,c=A(r),u=e.states[s];if(u.on){var f=N(u.on[c.type]),d=function(t){if(void 0===t)return{value:O(s,l)};var r="string"==typeof t?{target:t}:t,i=r.target,o=void 0===i?s:i,a=r.actions,f=void 0===a?[]:a,d=r.cond,p=l;if((void 0===d?function(){return!0}:d)(l,c)){var h=e.states[o],v=!1,m=[].concat(u.exit,f,h.entry).filter((function(e){return e})).map((function(e){return _(e,n._options.actions)})).filter((function(e){if("xstate.assign"===e.type){v=!0;var t=Object.assign({},p);return"function"==typeof e.assignment?t=e.assignment(p,c):Object.keys(e.assignment).forEach((function(n){t[n]="function"==typeof e.assignment[n]?e.assignment[n](p,c):e.assignment[n]})),p=t,!1}return!0}));return{value:{value:o,context:p,actions:m,changed:o!==s||m.length>0||v,matches:k(o)}}}};try{for(var p=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(f),h=p.next();!h.done;h=p.next()){var v=d(h.value);if("object"==typeof v)return v.value}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}}return O(s,l)}};return n}var L=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))};function F(e){var t=e.initialState,n=E.NotStarted,r=new Set,i={_machine:e,send:function(i){n===E.Running&&(t=e.transition(t,i),L(t,A(i)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(r){if(r){var o="object"==typeof r?r:{context:e.config.context,value:r};t={value:o.value,actions:[],context:o.context,matches:k(o.value)}}return n=E.Running,L(t,C),i},stop:function(){return n=E.Stopped,r.clear(),i},get state(){return t},get status(){return n}};return i}var P={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return P.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete P.map[t],e.childNodes&&e.childNodes.forEach((function(e){return P.removeNodeFromMap(e)}))},has:function(e){return P.map.hasOwnProperty(e)}};var R=function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e){var t=this,n=this.indexes.get(e.parentId),r=this.indexes.get(e.id),i=function(e){t.removeIdSet.add(e);var n=P.getNode(e);null==n||n.childNodes.forEach((function(e){"__sn"in e&&i(e.__sn.id)}))},o=function(n){t.removeIdSet.add(n.id),Object.values(n.children).forEach((function(e){return o(e)}));var r=t.indexes.get(n.id);if(r){var i=r.parent;i&&(delete r.parent,delete i.children[r.id],t.indexes.delete(e.id))}};r?n?(delete r.parent,delete n.children[r.id],this.indexes.delete(e.id),o(r)):(delete this.tree[r.id],this.indexes.delete(r.id),o(r)):(this.removeNodeMutations.push(e),i(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,n,i,o=this,a=this.tree,s=this.removeNodeMutations,l=this.textMutations,c=this.attributeMutations,u={source:y.Mutation,removes:s,texts:l,attributes:c,adds:[]},f=function(e,t){t&&o.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter((function(e){return!o.removeIdSet.has(e.id)})),u.attributes=u.attributes.concat(t?[]:e.attributes).filter((function(e){return!o.removeIdSet.has(e.id)})),o.removeIdSet.has(e.id)||o.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return f(e,!0)})):(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return f(e,!1)})))};Object.values(a).forEach((function(e){return f(e,!1)}));try{for(var d=r(this.scrollMap.keys()),p=d.next();!p.done;p=d.next()){var h=p.value;this.removeIdSet.has(h)&&this.scrollMap.delete(h)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}try{for(var v=r(this.inputMap.keys()),m=v.next();!m.done;m=v.next()){h=m.value;this.removeIdSet.has(h)&&this.inputMap.delete(h)}}catch(e){n={error:e}}finally{try{m&&!m.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}var g=new Map(this.scrollMap),b=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:g,inputMap:b}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e}();function j(e){var t,n,i={},o=function(e,t){var n={value:e,parent:t,children:[]};return i[e.node.id]=n,n},a=[];try{for(var s=r(e),l=s.next();!l.done;l=s.next()){var c=l.value,u=c.nextId,f=c.parentId;if(u&&u in i){var d=i[u];if(d.parent){var p=d.parent.children.indexOf(d);d.parent.children.splice(p,0,o(c,d.parent))}else{p=a.indexOf(d);a.splice(p,0,o(c,null))}}else if(f in i){var h=i[f];h.children.push(o(c,h))}else a.push(o(c,null))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}function B(e,t){t(e.value);for(var n=e.children.length-1;n>=0;n--)B(e.children[n],t)}function U(e,t){var i=t.getCastFn,o=t.emitter;return F(D({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:I({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:I((function(e,t){var r=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(r=t.payload.timeOffset),n(n({},e),{timeOffset:r,baselineTime:e.events[0].timestamp+r})})),play:function(e){var t,n,a,s,l;console.warn("play");var c=e.timer,u=e.events,f=e.baselineTime,d=e.lastPlayedEvent;c.clear();try{for(var p=r(u),h=p.next();!h.done;h=p.next()){M(h.value,f)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}var v=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.type===m.Meta&&r.timestamp<=t)return e.slice(n)}return e}(u,f),g=new Array,b=function(e){var t=null==d?void 0:d.timestamp;if((null==d?void 0:d.type)===m.IncrementalSnapshot&&d.data.source===y.MouseMove&&(t=d.timestamp+(null===(l=d.data.positions[0])||void 0===l?void 0:l.timeOffset)),t&&t<f&&(e.timestamp<=t||e===d))return"continue";var n=e.timestamp<f;if(n&&!function(e){switch(e.type){case m.DomContentLoaded:case m.Load:case m.Custom:return!1;case m.FullSnapshot:case m.Meta:return!0}switch(e.data.source){case y.MouseMove:case y.MouseInteraction:case y.TouchMove:case y.MediaInteraction:return!1;case y.ViewportResize:case y.StyleSheetRule:case y.Scroll:case y.Input:return!0}return!0}(e))return"continue";var r=i(e,n);n?r():g.push({doAction:function(){r(),o.emit(w.EventCast,e)},delay:e.delay})};try{for(var x=r(v),S=x.next();!S.done;S=x.next()){b(S.value)}}catch(e){a={error:e}}finally{try{S&&!S.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}o.emit(w.Flush),c.addActions(g),c.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:I((function(e){return n(n({},e),{lastPlayedEvent:null})})),startLive:I({baselineTime:function(e,t){return e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),addEvent:I((function(e,t){var r=e.baselineTime,a=e.timer,s=e.events;if("ADD_EVENT"===t.type){var l=t.payload.event;M(l,r),s.push(l);var c=l.timestamp<r,u=i(l,c);c?u():(a.addAction({doAction:function(){u(),o.emit(w.EventCast,l)},delay:l.delay}),a.isActive()||a.start())}return n(n({},e),{events:s})}))}}))}var V=v||x,W={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"},z={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0},Y=function(){function e(e,n){var o=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=V(),this.legacy_missingNodeRetryMap={},this.imageMap=new Map,!(null==n?void 0:n.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");var a={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:W,logConfig:z};this.config=Object.assign({},a,n),this.config.logConfig.replayLogger||(this.config.logConfig.replayLogger=this.getConsoleLogger()),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.emitter.on(w.Resize,this.handleResize),this.setupDom(),this.treeIndex=new R,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.emitter.on(w.Flush,(function(){var e,n,a,s,l,c,u=o.treeIndex.flush(),f=u.scrollMap,d=u.inputMap;try{for(var p=r(o.fragmentParentMap.entries()),h=p.next();!h.done;h=p.next()){var v=i(h.value,2),m=v[0],y=v[1];P.map[y.__sn.id]=y,y.__sn.type===t.Element&&"textarea"===y.__sn.tagName&&m.textContent&&(y.value=m.textContent),y.appendChild(m),o.restoreState(y)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(e)throw e.error}}o.fragmentParentMap.clear(),o.elementStateMap.clear();try{for(var g=r(f.values()),b=g.next();!b.done;b=g.next()){var w=b.value;o.applyScroll(w)}}catch(e){a={error:e}}finally{try{b&&!b.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}try{for(var x=r(d.values()),S=x.next();!S.done;S=x.next()){w=S.value;o.applyInput(w)}}catch(e){l={error:e}}finally{try{S&&!S.done&&(c=x.return)&&c.call(x)}finally{if(l)throw l.error}}}));var s=new T([],(null==n?void 0:n.speed)||a.speed);this.service=U({events:e.map((function(e){return n&&n.unpackFn?n.unpackFn(e):e})),timer:s,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){o.emitter.emit(w.StateChange,{player:e})})),this.speedService=F(D({id:"speed",context:{normalSpeed:-1,timer:s},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:I({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(e){o.emitter.emit(w.StateChange,{speed:e})}));var l=this.service.state.context.events.find((function(e){return e.type===m.Meta})),c=this.service.state.context.events.find((function(e){return e.type===m.FullSnapshot}));if(l){var u=l.data,f=u.width,d=u.height;setTimeout((function(){o.emitter.emit(w.Resize,{width:f,height:d})}),0)}c&&setTimeout((function(){o.rebuildFullSnapshot(c),o.iframe.contentWindow.scrollTo(c.data.initialOffset)}),1)}return Object.defineProperty(e.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){return this.emitter.on(e,t),this},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach((function(n){t.config[n]=e[n]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))},e.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},e.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},e.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},e.prototype.play=function(e){var t;void 0===e&&(e=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.remove("rrweb-paused"),this.emitter.emit(w.Start)},e.prototype.pause=function(e){var t;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(w.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(w.Resume)},e.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},e.prototype.addEvent=function(e){var t=this,n=this.config.unpackFn?this.config.unpackFn(e):e;Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:n}})}))},e.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},e.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},e.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),!1!==this.config.mouseTail&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");var e,t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(S(this.iframe.contentWindow,this.iframe.contentDocument),void 0===(e=this.iframe.contentWindow)&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach))},e.prototype.handleResize=function(e){var t,n;this.iframe.style.display="inherit";try{for(var i=r([this.mouseTail,this.iframe]),o=i.next();!o.done;o=i.next()){var a=o.value;a&&(a.setAttribute("width",String(e.width)),a.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.getCastFn=function(e,t){var n,i=this;switch(void 0===t&&(t=!1),e.type){case m.DomContentLoaded:case m.Load:break;case m.Custom:n=function(){i.emitter.emit(w.CustomEvent,e)};break;case m.Meta:n=function(){return i.emitter.emit(w.Resize,{width:e.data.width,height:e.data.height})};break;case m.FullSnapshot:n=function(){i.rebuildFullSnapshot(e,t),i.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case m.IncrementalSnapshot:n=function(){var n,o;if(i.applyIncremental(e,t),!t&&(e===i.nextUserInteractionEvent&&(i.nextUserInteractionEvent=null,i.backToNormal()),i.config.skipInactive&&!i.nextUserInteractionEvent)){try{for(var a=r(i.service.state.context.events),s=a.next();!s.done;s=a.next()){var l=s.value;if(!(l.timestamp<=e.timestamp)&&i.isUserInteraction(l)){l.delay-e.delay>1e4*i.speedService.state.context.timer.speed&&(i.nextUserInteractionEvent=l);break}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}if(i.nextUserInteractionEvent){var c=i.nextUserInteractionEvent.delay-e.delay,u={speed:Math.min(Math.round(c/5e3),360)};i.speedService.send({type:"FAST_FORWARD",payload:u}),i.emitter.emit(w.SkipStart,u)}}}}return function(){if(n&&n(),i.service.send({type:"CAST_EVENT",payload:{event:e}}),e===i.service.state.context.events[i.service.state.context.events.length-1]){var t=function(){i.backToNormal(),i.service.send("END"),i.emitter.emit(w.Finish)};e.type===m.IncrementalSnapshot&&e.data.source===y.MouseMove&&e.data.positions.length?setTimeout((function(){t()}),Math.max(0,50-e.data.positions[0].timeOffset)):t()}}},e.prototype.rebuildFullSnapshot=function(e,t){if(void 0===t&&(t=!1),!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={},P.map=h(e.data.node,{doc:this.iframe.contentDocument})[1];var n=document.createElement("style"),r=this.iframe.contentDocument,i=r.documentElement,o=r.head;i.insertBefore(n,o);var a,s=(a=this.config.blockClass,["iframe, ."+a+" { background: #ccc }","noscript { display: none !important; }"]).concat(this.config.insertStyleRules);this.config.pauseAnimation&&s.push("html.rrweb-paused * { animation-play-state: paused !important; }"),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused");for(var l=0;l<s.length;l++)n.sheet.insertRule(s[l],l);this.emitter.emit(w.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},e.prototype.waitForStylesheetLoad=function(){var e,t=this,n=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(n){var r,i=new Set,o=this.service.state,a=function(){o=t.service.state};this.emitter.on(w.Start,a),this.emitter.on(w.Pause,a);var s=function(){t.emitter.off(w.Start,a),t.emitter.off(w.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach((function(e){e.sheet||(i.add(e),e.addEventListener("load",(function(){i.delete(e),0===i.size&&-1!==r&&(o.matches("playing")&&t.play(t.getCurrentTime()),t.emitter.emit(w.LoadStylesheetEnd),r&&window.clearTimeout(r),s())})))})),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(w.LoadStylesheetStart),r=window.setTimeout((function(){o.matches("playing")&&t.play(t.getCurrentTime()),r=-1,s()}),this.config.loadTimeout))}},e.prototype.preloadAllImages=function(){var e,t,n=this,i=this.service.state,o=function(){i=n.service.state};this.emitter.on(w.Start,o),this.emitter.on(w.Pause,o);var a=0,s=0;try{for(var l=r(this.service.state.context.events),c=l.next();!c.done;c=l.next()){var u=c.value;if(u.type===m.IncrementalSnapshot&&u.data.source===y.CanvasMutation&&"drawImage"===u.data.property&&"string"==typeof u.data.args[0]&&!this.imageMap.has(u)){a++;var f=document.createElement("img");f.src=u.data.args[0],this.imageMap.set(u,f),f.onload=function(){++s===a&&(i.matches("playing")&&n.play(n.getCurrentTime()),n.emitter.off(w.Start,o),n.emitter.off(w.Pause,o))}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}a!==s&&this.service.send({type:"PAUSE"})},e.prototype.applyIncremental=function(e,t){var n,r,i=this,o=e.data;switch(o.source){case y.Mutation:t&&(o.adds.forEach((function(e){return i.treeIndex.add(e)})),o.texts.forEach((function(e){return i.treeIndex.text(e)})),o.attributes.forEach((function(e){return i.treeIndex.attribute(e)})),o.removes.forEach((function(e){return i.treeIndex.remove(e)}))),this.applyMutation(o,t);break;case y.MouseMove:if(t){var a=o.positions[o.positions.length-1];this.moveAndHover(o,a.x,a.y,a.id)}else o.positions.forEach((function(t){var n={doAction:function(){i.moveAndHover(o,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-i.service.state.context.baselineTime};i.timer.addAction(n)})),this.timer.addAction({doAction:function(){},delay:e.delay-(null===(n=o.positions[0])||void 0===n?void 0:n.timeOffset)});break;case y.MouseInteraction:if(-1===o.id)break;var s=new Event(g[o.type].toLowerCase());if(!(m=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);this.emitter.emit(w.MouseInteraction,{type:o.type,target:m});var l=this.config.triggerFocus;switch(o.type){case g.Blur:"blur"in m&&m.blur();break;case g.Focus:l&&m.focus&&m.focus({preventScroll:!0});break;case g.Click:case g.TouchStart:case g.TouchEnd:t||(this.moveAndHover(o,o.x,o.y,o.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:m.dispatchEvent(s)}break;case y.Scroll:if(-1===o.id)break;if(t){this.treeIndex.scroll(o);break}this.applyScroll(o);break;case y.ViewportResize:this.emitter.emit(w.Resize,{width:o.width,height:o.height});break;case y.Input:if(-1===o.id)break;if(t){this.treeIndex.input(o);break}this.applyInput(o);break;case y.MediaInteraction:if(!(m=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);var c=m;try{o.type===b.Pause&&c.pause(),o.type===b.Play&&(c.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?c.play():c.addEventListener("canplay",(function(){c.play()})))}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: "+(e.message||e))}break;case y.StyleSheetRule:if(!(m=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);var u=m,f=m.parentNode,d=this.fragmentParentMap.has(f),p=void 0;if(d){var h=this.fragmentParentMap.get(m.parentNode);p=document.createTextNode(""),f.replaceChild(p,m),h.appendChild(m)}var v=u.sheet;o.adds&&o.adds.forEach((function(e){var t=e.rule,n=e.index;try{var r=void 0===n?void 0:Math.min(n,v.rules.length);try{v.insertRule(t,r)}catch(e){}}catch(e){}})),o.removes&&o.removes.forEach((function(e){var t=e.index;try{v.deleteRule(t)}catch(e){}})),d&&p&&f.replaceChild(m,p);break;case y.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var m;if(!(m=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);try{var x=m.getContext("2d");if(o.setter)return void(x[o.property]=o.args[0]);var S=x[o.property];if("drawImage"===o.property&&"string"==typeof o.args[0]){var E=this.imageMap.get(e);o.args[0]=E,S.apply(x,o.args)}else S.apply(x,o.args)}catch(e){this.warnCanvasMutationFailed(o,o.id,e)}break;case y.Font:try{var T=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);null===(r=this.iframe.contentDocument)||void 0===r||r.fonts.add(T)}catch(e){this.config.showWarning&&console.warn(e)}break;case y.Log:try{var M=e.data,C=this.config.logConfig.replayLogger;"function"==typeof C[M.level]&&C[M.level](M)}catch(e){this.config.showWarning&&console.warn(e)}}},e.prototype.applyMutation=function(e,t){var i,o,a=this;e.removes.forEach((function(t){var n=P.getNode(t.id);if(!n)return a.warnNodeNotFound(e,t.id);var r=P.getNode(t.parentId);if(!r)return a.warnNodeNotFound(e,t.parentId);if(P.removeNodeFromMap(n),r){var i=a.fragmentParentMap.get(r);if(i&&i.contains(n))i.removeChild(n);else if(a.fragmentParentMap.has(n)){var o=a.fragmentParentMap.get(n);r.removeChild(o),a.fragmentParentMap.delete(n)}else r.removeChild(n)}}));var s=n({},this.legacy_missingNodeRetryMap),l=[];var c=function(e){if(!a.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var n=P.getNode(e.parentId);if(!n)return l.push(e);var r=null;if(a.iframe.contentDocument.contains?r=a.iframe.contentDocument.contains(n):a.iframe.contentDocument.body.contains&&(r=a.iframe.contentDocument.body.contains(n)),t&&r){var i=document.createDocumentFragment();for(P.map[e.parentId]=i,a.fragmentParentMap.set(i,n),a.storeState(n);n.firstChild;)i.appendChild(n.firstChild);n=i}var o=null,c=null;if(e.previousId&&(o=P.getNode(e.previousId)),e.nextId&&(c=P.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=P.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return l.push(e);var u=p(e.node,{doc:a.iframe.contentDocument,map:P.map,skipChild:!0,hackCss:!0});-1!==e.previousId&&-1!==e.nextId?(o&&o.nextSibling&&o.nextSibling.parentNode?n.insertBefore(u,o.nextSibling):c&&c.parentNode?n.contains(c)?n.insertBefore(u,c):n.insertBefore(u,null):n.appendChild(u),(e.previousId||e.nextId)&&a.legacy_resolveMissingNode(s,n,u,e)):s[e.node.id]={node:u,mutation:e}};e.adds.forEach((function(e){c(e)}));for(var u=Date.now();l.length;){var f=j(l);if(l.length=0,Date.now()-u>500){this.warn("Timeout in the loop, please check the resolve tree data:",f);break}try{for(var d=(i=void 0,r(f)),h=d.next();!h.done;h=d.next()){var v=h.value;P.getNode(v.value.parentId)?B(v,(function(e){c(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",v)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}Object.keys(s).length&&Object.assign(this.legacy_missingNodeRetryMap,s),e.texts.forEach((function(t){var n=P.getNode(t.id);if(!n)return a.warnNodeNotFound(e,t.id);a.fragmentParentMap.has(n)&&(n=a.fragmentParentMap.get(n)),n.textContent=t.value})),e.attributes.forEach((function(t){var n=P.getNode(t.id);if(!n)return a.warnNodeNotFound(e,t.id);for(var r in a.fragmentParentMap.has(n)&&(n=a.fragmentParentMap.get(n)),t.attributes)if("string"==typeof r){var i=t.attributes[r];try{null!==i?n.setAttribute(r,i):n.removeAttribute(r)}catch(e){a.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}}}))},e.prototype.applyScroll=function(e){var t=P.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);if(t===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else try{t.scrollTop=e.y,t.scrollLeft=e.x}catch(e){}},e.prototype.applyInput=function(e){var t=P.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},e.prototype.formatMessage=function(e){if(0===e.trace.length)return"";var t="\n\tat ";return t+=e.trace.join("\n\tat ")},e.prototype.getConsoleLogger=function(){var e,t,n=this,i={},a=function(e){i[e]="trace"===e?function(e){(console.log.__rrweb_original__?console.log.__rrweb_original__:console.log).apply(void 0,o(e.payload.map((function(e){return JSON.parse(e)})),[n.formatMessage(e)]))}:function(t){(console[e].__rrweb_original__?console[e].__rrweb_original__:console[e]).apply(void 0,o(t.payload.map((function(e){return JSON.parse(e)})),[n.formatMessage(t)]))}};try{for(var s=r(this.config.logConfig.level),l=s.next();!l.done;l=s.next()){a(l.value)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return i},e.prototype.legacy_resolveMissingNode=function(e,t,n,r){var i=r.previousId,o=r.nextId,a=i&&e[i],s=o&&e[o];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(s){var f=s;c=f.node,u=f.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,r){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px",this.drawMouseTail({x:t,y:n});var i=P.getNode(r);if(!i)return this.debugNodeNotFound(e,r);this.hoverElements(i)},e.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var n=!0===this.config.mouseTail?W:Object.assign({},W,this.config.mouseTail),r=n.lineCap,i=n.lineWidth,o=n.strokeStyle,a=n.duration,s=function(){if(t.mouseTail){var e=t.mouseTail.getContext("2d");e&&t.tailPositions.length&&(e.clearRect(0,0,t.mouseTail.width,t.mouseTail.height),e.beginPath(),e.lineWidth=i,e.lineCap=r,e.strokeStyle=o,e.moveTo(t.tailPositions[0].x,t.tailPositions[0].y),t.tailPositions.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}};this.tailPositions.push(e),s(),setTimeout((function(){t.tailPositions=t.tailPositions.filter((function(t){return t!==e})),s()}),a/this.speedService.state.context.timer.speed)}},e.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var n=e;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement},e.prototype.isUserInteraction=function(e){return e.type===m.IncrementalSnapshot&&(e.data.source>y.Mutation&&e.data.source<=y.Input)},e.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(w.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},e.prototype.storeState=function(e){var t,n;if(e&&e.nodeType===e.ELEMENT_NODE){var i=e;(i.scrollLeft||i.scrollTop)&&this.elementStateMap.set(e,{scroll:[i.scrollLeft,i.scrollTop]});var o=i.children;try{for(var a=r(Array.from(o)),s=a.next();!s.done;s=a.next()){var l=s.value;this.storeState(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}}},e.prototype.restoreState=function(e){var t,n;if(e.nodeType===e.ELEMENT_NODE){var i=e;if(this.elementStateMap.has(e)){var o=this.elementStateMap.get(e);o.scroll&&(i.scrollLeft=o.scroll[0],i.scrollTop=o.scroll[1]),this.elementStateMap.delete(e)}var a=i.children;try{for(var s=r(Array.from(a)),l=s.next();!l.done;l=s.next()){var c=l.value;this.restoreState(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}},e.prototype.warnNodeNotFound=function(e,t){this.warn("Node with id '"+t+"' not found in",e)},e.prototype.warnCanvasMutationFailed=function(e,t,n){this.warn("Has error on update canvas '"+t+"'",e,n)},e.prototype.debugNodeNotFound=function(e,t){this.debug("[replayer]","Node with id '"+t+"' not found in",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,o(["[replayer]"],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,o(["[replayer]"],e))},e}(),X=Uint8Array,H=Uint16Array,G=Uint32Array,q=new X([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]),J=new X([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]),K=new X([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$=function(e,t){for(var n=new H(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new G(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},Q=$(q,2),Z=Q[0],ee=Q[1];Z[28]=258,ee[258]=28;for(var te=$(J,0)[0],ne=new H(32768),re=0;re<32768;++re){var ie=(43690&re)>>>1|(21845&re)<<1;ie=(61680&(ie=(52428&ie)>>>2|(13107&ie)<<2))>>>4|(3855&ie)<<4,ne[re]=((65280&ie)>>>8|(255&ie)<<8)>>>1}var oe=function(e,t,n){for(var r=e.length,i=0,o=new H(t);i<r;++i)++o[e[i]-1];var a,s=new H(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(n){a=new H(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],f=s[e[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[ne[f]>>>l]=c}else for(a=new H(r),i=0;i<r;++i)a[i]=ne[s[e[i]-1]++]>>>15-e[i];return a},ae=new X(288);for(re=0;re<144;++re)ae[re]=8;for(re=144;re<256;++re)ae[re]=9;for(re=256;re<280;++re)ae[re]=7;for(re=280;re<288;++re)ae[re]=8;var se=new X(32);for(re=0;re<32;++re)se[re]=5;oe(ae,9,0);var le=oe(ae,9,1),ce=(oe(se,5,0),oe(se,5,1)),ue=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},fe=function(e,t,n){var r=t/8>>0;return(e[r]|e[r+1]<<8)>>>(7&t)&n},de=function(e,t){var n=t/8>>0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>>(7&t)},pe=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof H?H:e instanceof G?G:X)(n-t);return r.set(e.subarray(t,n)),r},he=new G(256);for(re=0;re<256;++re){for(var ve=re,me=9;--me;)ve=(1&ve&&3988292384)^ve>>>1;he[re]=ve}function ye(e,t){return function(e,t,n){var r=e.length,i=!t||n,o=!n||n.i;n||(n={}),t||(t=new X(3*r));var a=function(e){var n=t.length;if(e>n){var r=new X(Math.max(2*n,e));r.set(t),t=r}},s=n.f||0,l=n.p||0,c=n.b||0,u=n.l,f=n.d,d=n.m,p=n.n;if(s&&!u)return t;var h,v=8*r;do{if(!u){n.f=s=fe(e,l,1);var m=fe(e,l+1,3);if(l+=3,!m){var y=e[(I=((h=l)/8>>0)+(7&h&&1)+4)-4]|e[I-3]<<8,g=I+y;if(g>r){if(o)throw"unexpected EOF";break}i&&a(c+y),t.set(e.subarray(I,g),c),n.b=c+=y,n.p=l=8*g;continue}if(1==m)u=le,f=ce,d=9,p=5;else{if(2!=m)throw"invalid block type";var b=fe(e,l,31)+257,w=fe(e,l+10,15)+4,x=b+fe(e,l+5,31)+1;l+=14;for(var S=new X(x),E=new X(19),T=0;T<w;++T)E[K[T]]=fe(e,l+3*T,7);l+=3*w;var M=ue(E),C=(1<<M)-1;if(!o&&l+x*(M+7)>v)break;var N=oe(E,M,1);for(T=0;T<x;){var I,_=N[fe(e,l,C)];if(l+=15&_,(I=_>>>4)<16)S[T++]=I;else{var k=0,A=0;for(16==I?(A=3+fe(e,l,3),l+=2,k=S[T-1]):17==I?(A=3+fe(e,l,7),l+=3):18==I&&(A=11+fe(e,l,127),l+=7);A--;)S[T++]=k}}var O=S.subarray(0,b),D=S.subarray(b);d=ue(O),p=ue(D),u=oe(O,d,1),f=oe(D,p,1)}if(l>v)throw"unexpected EOF"}i&&a(c+131072);for(var L=(1<<d)-1,F=(1<<p)-1,P=d+p+18;o||l+P<v;){var R=(k=u[de(e,l)&L])>>>4;if((l+=15&k)>v)throw"unexpected EOF";if(!k)throw"invalid length/literal";if(R<256)t[c++]=R;else{if(256==R){u=null;break}var j=R-254;if(R>264){var B=q[T=R-257];j=fe(e,l,(1<<B)-1)+Z[T],l+=B}var U=f[de(e,l)&F],V=U>>>4;if(!U)throw"invalid distance";l+=15&U;D=te[V];if(V>3){B=J[V];D+=de(e,l)&(1<<B)-1,l+=B}if(l>v)throw"unexpected EOF";i&&a(c+131072);for(var W=c+j;c<W;c+=4)t[c]=t[c-D],t[c+1]=t[c+1-D],t[c+2]=t[c+2-D],t[c+3]=t[c+3-D];c=W}}n.l=u,n.p=l,n.b=c,u&&(s=1,n.m=d,n.d=f,n.n=p)}while(!s);return c==t.length?t:pe(t,0,c)}((function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"}(e),e.subarray(2,-4)),t)}return e.Replayer=Y,e.unpack=function(e){if("string"!=typeof e)return e;try{if((t=JSON.parse(e)).timestamp)return t}catch(e){}try{var t;if("v1"===(t=JSON.parse(function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i))}return n}(ye(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new X(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},a=0;a<n;++a){if(i+5>r.length){var s=new X(i+8+(n-a<<1));s.set(r),r=s}var l=e.charCodeAt(a);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++a))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return pe(r,0,i)}(e,!0))))).v)return t;throw new Error("These events were packed with packer "+t.v+" which is incompatible with current packer v1.")}catch(e){throw console.error(e),new Error("Unknown data format.")}},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
***************************************************************************** */!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(M||(M={}));var I={type:"xstate.init"};function _(e){return void 0===e?[]:[].concat(e)}function D(e){return{type:"xstate.assign",assignment:e}}function A(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function k(e){return function(t){return e===t}}function O(e){return"string"==typeof e?{type:e}:e}function L(e,t){return{value:e,context:t,actions:[],changed:!1,matches:k(e)}}function F(e,t){void 0===t&&(t={});var r={config:e,_options:t,initialState:{value:e.initial,actions:_(e.states[e.initial].entry).map((function(e){return A(e,t.actions)})),context:e.context,matches:k(e.initial)},transition:function(t,n){var o,i,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,l=a.context,c=O(n),u=e.states[s];if(u.on){var f=_(u.on[c.type]),d=function(t){if(void 0===t)return{value:L(s,l)};var n="string"==typeof t?{target:t}:t,o=n.target,i=void 0===o?s:o,a=n.actions,f=void 0===a?[]:a,d=n.cond,p=l;if((void 0===d?function(){return!0}:d)(l,c)){var h=e.states[i],m=!1,v=[].concat(u.exit,f,h.entry).filter((function(e){return e})).map((function(e){return A(e,r._options.actions)})).filter((function(e){if("xstate.assign"===e.type){m=!0;var t=Object.assign({},p);return"function"==typeof e.assignment?t=e.assignment(p,c):Object.keys(e.assignment).forEach((function(r){t[r]="function"==typeof e.assignment[r]?e.assignment[r](p,c):e.assignment[r]})),p=t,!1}return!0}));return{value:{value:i,context:p,actions:v,changed:i!==s||v.length>0||m,matches:k(i)}}}};try{for(var p=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}(f),h=p.next();!h.done;h=p.next()){var m=d(h.value);if("object"==typeof m)return m.value}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}}return L(s,l)}};return r}var P=function(e,t){return e.actions.forEach((function(r){var n=r.exec;return n&&n(e.context,t)}))};function R(e){var t=e.initialState,r=M.NotStarted,n=new Set,o={_machine:e,send:function(o){r===M.Running&&(t=e.transition(t,o),P(t,O(o)),n.forEach((function(e){return e(t)})))},subscribe:function(e){return n.add(e),e(t),{unsubscribe:function(){return n.delete(e)}}},start:function(n){if(n){var i="object"==typeof n?n:{context:e.config.context,value:n};t={value:i.value,actions:[],context:i.context,matches:k(i.value)}}return r=M.Running,P(t,I),o},stop:function(){return r=M.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}var j="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.",B={map:{},getId:function(){return console.error(j),-1},getNode:function(){return console.error(j),null},removeNodeFromMap:function(){console.error(j)},has:function(){return console.error(j),!1},reset:function(){console.error(j)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(B=new Proxy(B,{get:function(e,t,r){return"map"===t&&console.error(j),Reflect.get(e,t,r)}}));var U=function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),r={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(r.parent=t,t.children[r.id]=r):this.tree[r.id]=r,this.indexes.set(r.id,r)},e.prototype.remove=function(e,t){var r=this,n=this.indexes.get(e.parentId),o=this.indexes.get(e.id),i=function(e){r.removeIdSet.add(e);var n=t.getNode(e);null==n||n.childNodes.forEach((function(e){"__sn"in e&&i(e.__sn.id)}))},a=function(t){r.removeIdSet.add(t.id),Object.values(t.children).forEach((function(e){return a(e)}));var n=r.indexes.get(t.id);if(n){var o=n.parent;o&&(delete n.parent,delete o.children[n.id],r.indexes.delete(e.id))}};o?n?(delete o.parent,delete n.children[o.id],this.indexes.delete(e.id),a(o)):(delete this.tree[o.id],this.indexes.delete(o.id),a(o)):(this.removeNodeMutations.push(e),i(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,r,o,i=this,a=this.tree,s=this.removeNodeMutations,l=this.textMutations,c=this.attributeMutations,u={source:w.Mutation,removes:s,texts:l,attributes:c,adds:[]},f=function(e,t){t&&i.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter((function(e){return!i.removeIdSet.has(e.id)})),u.attributes=u.attributes.concat(t?[]:e.attributes).filter((function(e){return!i.removeIdSet.has(e.id)})),i.removeIdSet.has(e.id)||i.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return f(e,!0)})):(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return f(e,!1)})))};Object.values(a).forEach((function(e){return f(e,!1)}));try{for(var d=n(this.scrollMap.keys()),p=d.next();!p.done;p=d.next()){var h=p.value;this.removeIdSet.has(h)&&this.scrollMap.delete(h)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}try{for(var m=n(this.inputMap.keys()),v=m.next();!v.done;v=m.next()){h=v.value;this.removeIdSet.has(h)&&this.inputMap.delete(h)}}catch(e){r={error:e}}finally{try{v&&!v.done&&(o=m.return)&&o.call(m)}finally{if(r)throw r.error}}var y=new Map(this.scrollMap),g=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:y,inputMap:g}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e}();function V(e){var t,r,o={},i=function(e,t){var r={value:e,parent:t,children:[]};return o[e.node.id]=r,r},a=[];try{for(var s=n(e),l=s.next();!l.done;l=s.next()){var c=l.value,u=c.nextId,f=c.parentId;if(u&&u in o){var d=o[u];if(d.parent){var p=d.parent.children.indexOf(d);d.parent.children.splice(p,0,i(c,d.parent))}else{p=a.indexOf(d);a.splice(p,0,i(c,null))}}else if(f in o){var h=o[f];h.children.push(i(c,h))}else a.push(i(c,null))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return a}function W(e,t){t(e.value);for(var r=e.children.length-1;r>=0;r--)W(e.children[r],t)}function z(e){return"__sn"in e&&(e.__sn.type===t.Element&&"iframe"===e.__sn.tagName)}function Y(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}function X(e,t){var o=t.getCastFn,i=t.emitter;return R(F({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:D({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:D((function(e,t){var n=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(n=t.payload.timeOffset),r(r({},e),{timeOffset:n,baselineTime:e.events[0].timestamp+n})})),play:function(e){var t,r,a,s,l,c=e.timer,u=e.events,f=e.baselineTime,d=e.lastPlayedEvent;c.clear();try{for(var p=n(u),h=p.next();!h.done;h=p.next()){C(h.value,f)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}var m=function(e,t){for(var r=e.length-1;r>=0;r--){var n=e[r];if(n.type===g.Meta&&n.timestamp<=t)return e.slice(r)}return e}(u,f),v=null==d?void 0:d.timestamp;(null==d?void 0:d.type)===g.IncrementalSnapshot&&d.data.source===w.MouseMove&&(v=d.timestamp+(null===(l=d.data.positions[0])||void 0===l?void 0:l.timeOffset)),f<(v||0)&&i.emit(x.PlayBack);var y=new Array,b=function(e){if(v&&v<f&&(e.timestamp<=v||e===d))return"continue";var t=e.timestamp<f;if(t&&!function(e){switch(e.type){case g.DomContentLoaded:case g.Load:case g.Custom:return!1;case g.FullSnapshot:case g.Meta:return!0}switch(e.data.source){case w.MouseMove:case w.MouseInteraction:case w.TouchMove:case w.MediaInteraction:return!1;case w.ViewportResize:case w.StyleSheetRule:case w.Scroll:case w.Input:return!0}return!0}(e))return"continue";var r=o(e,t);t?r():y.push({doAction:function(){r(),i.emit(x.EventCast,e)},delay:e.delay})};try{for(var S=n(m),E=S.next();!E.done;E=S.next()){b(E.value)}}catch(e){a={error:e}}finally{try{E&&!E.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}i.emit(x.Flush),c.addActions(y),c.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:D((function(e){return r(r({},e),{lastPlayedEvent:null})})),startLive:D({baselineTime:function(e,t){return e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),addEvent:D((function(e,t){var n=e.baselineTime,a=e.timer,s=e.events;if("ADD_EVENT"===t.type){var l=t.payload.event;C(l,n);var c=s.length-1;if(!s[c]||s[c].timestamp<=l.timestamp)s.push(l);else{for(var u=-1,f=0;f<=c;){var d=Math.floor((f+c)/2);s[d].timestamp<=l.timestamp?f=d+1:c=d-1}-1===u&&(u=f),s.splice(u,0,l)}var p=l.timestamp<n,h=o(l,p);p?h():a.isActive()&&a.addAction({doAction:function(){h(),i.emit(x.EventCast,l)},delay:l.delay})}return r(r({},e),{events:s})}))}}))}var Q=y||E,H={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"},G={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0},q=function(){function e(e,t){var r=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=Q(),this.legacy_missingNodeRetryMap={},this.imageMap=new Map,this.mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,r=e.__sn&&e.__sn.id;delete this.map[r],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}},this.firstPlayedEvent=null,this.newDocumentQueue=[],!(null==t?void 0:t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");var o={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:H,logConfig:G};this.config=Object.assign({},o,t),this.config.logConfig.replayLogger||(this.config.logConfig.replayLogger=this.getConsoleLogger()),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.emitter.on(x.Resize,this.handleResize),this.setupDom(),this.treeIndex=new U,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.emitter.on(x.Flush,(function(){var e,t,o,i,a=r.treeIndex.flush(),s=a.scrollMap,l=a.inputMap;r.fragmentParentMap.forEach((function(e,t){return r.restoreRealParent(t,e)})),r.fragmentParentMap.clear(),r.elementStateMap.clear();try{for(var c=n(s.values()),u=c.next();!u.done;u=c.next()){var f=u.value;r.applyScroll(f)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}try{for(var d=n(l.values()),p=d.next();!p.done;p=d.next()){f=p.value;r.applyInput(f)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}})),this.emitter.on(x.PlayBack,(function(){r.firstPlayedEvent=null,r.mirror.reset()}));var i=new N([],(null==t?void 0:t.speed)||o.speed);this.service=X({events:e.map((function(e){return t&&t.unpackFn?t.unpackFn(e):e})).sort((function(e,t){return e.timestamp-t.timestamp})),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){r.emitter.emit(x.StateChange,{player:e})})),this.speedService=R(F({id:"speed",context:{normalSpeed:-1,timer:i},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:D({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(e){r.emitter.emit(x.StateChange,{speed:e})}));var a=this.service.state.context.events.find((function(e){return e.type===g.Meta})),s=this.service.state.context.events.find((function(e){return e.type===g.FullSnapshot}));if(a){var l=a.data,c=l.width,u=l.height;setTimeout((function(){r.emitter.emit(x.Resize,{width:c,height:u})}),0)}s&&setTimeout((function(){r.firstPlayedEvent||(r.firstPlayedEvent=s,r.rebuildFullSnapshot(s),r.iframe.contentWindow.scrollTo(s.data.initialOffset))}),1)}return Object.defineProperty(e.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){return this.emitter.on(e,t),this},e.prototype.off=function(e,t){return this.emitter.off(e,t),this},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach((function(r){t.config[r]=e[r]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))},e.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},e.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},e.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},e.prototype.getMirror=function(){return this.mirror},e.prototype.play=function(e){var t;void 0===e&&(e=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.remove("rrweb-paused"),this.emitter.emit(x.Start)},e.prototype.pause=function(e){var t;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(x.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(x.Resume)},e.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},e.prototype.addEvent=function(e){var t=this,r=this.config.unpackFn?this.config.unpackFn(e):e;Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:r}})}))},e.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},e.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},e.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),!1!==this.config.mouseTail&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");var e,t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(T(this.iframe.contentWindow,this.iframe.contentDocument),void 0===(e=this.iframe.contentWindow)&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1}))},e.prototype.handleResize=function(e){var t,r;this.iframe.style.display="inherit";try{for(var o=n([this.mouseTail,this.iframe]),i=o.next();!i.done;i=o.next()){var a=i.value;a&&(a.setAttribute("width",String(e.width)),a.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},e.prototype.getCastFn=function(e,t){var r,o=this;switch(void 0===t&&(t=!1),e.type){case g.DomContentLoaded:case g.Load:break;case g.Custom:r=function(){o.emitter.emit(x.CustomEvent,e)};break;case g.Meta:r=function(){return o.emitter.emit(x.Resize,{width:e.data.width,height:e.data.height})};break;case g.FullSnapshot:r=function(){o.firstPlayedEvent&&o.firstPlayedEvent===e||(o.rebuildFullSnapshot(e,t),o.iframe.contentWindow.scrollTo(e.data.initialOffset))};break;case g.IncrementalSnapshot:r=function(){var r,i;if(o.applyIncremental(e,t),!t&&(e===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.backToNormal()),o.config.skipInactive&&!o.nextUserInteractionEvent)){try{for(var a=n(o.service.state.context.events),s=a.next();!s.done;s=a.next()){var l=s.value;if(!(l.timestamp<=e.timestamp)&&o.isUserInteraction(l)){l.delay-e.delay>1e4*o.speedService.state.context.timer.speed&&(o.nextUserInteractionEvent=l);break}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}if(o.nextUserInteractionEvent){var c=o.nextUserInteractionEvent.delay-e.delay,u={speed:Math.min(Math.round(c/5e3),o.config.maxSpeed)};o.speedService.send({type:"FAST_FORWARD",payload:u}),o.emitter.emit(x.SkipStart,u)}}}}return function(){if(r&&r(),o.service.send({type:"CAST_EVENT",payload:{event:e}}),e===o.service.state.context.events[o.service.state.context.events.length-1]){var t=function(){o.backToNormal(),o.service.send("END"),o.emitter.emit(x.Finish)};e.type===g.IncrementalSnapshot&&e.data.source===w.MouseMove&&e.data.positions.length?setTimeout((function(){t()}),Math.max(0,50-e.data.positions[0].timeOffset)):t()}}},e.prototype.rebuildFullSnapshot=function(e,t){var r,o,i=this;if(void 0===t&&(t=!1),!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};var a=[];this.mirror.map=v(e.data.node,{doc:this.iframe.contentDocument,afterAppend:function(e){i.collectIframeAndAttachDocument(a,e)}})[1];var s=function(e,t){if(l.attachDocumentToIframe(e,t),l.newDocumentQueue=l.newDocumentQueue.filter((function(t){return t!==e})),t.contentDocument){var r=t.contentDocument,n=r.documentElement,o=r.head;l.insertStyleRules(n,o)}},l=this;try{for(var c=n(a),u=c.next();!u.done;u=c.next()){var f=u.value;s(f.mutationInQueue,f.builtNode)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}var d=this.iframe.contentDocument,p=d.documentElement,h=d.head;this.insertStyleRules(p,h),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(x.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},e.prototype.insertStyleRules=function(e,t){var r=document.createElement("style");e.insertBefore(r,t);var n,o=(n=this.config.blockClass,["."+n+" { background: #ccc }","noscript { display: none !important; }"]).concat(this.config.insertStyleRules);this.config.pauseAnimation&&o.push("html.rrweb-paused * { animation-play-state: paused !important; }");for(var i=0;i<o.length;i++)r.sheet.insertRule(o[i],i)},e.prototype.attachDocumentToIframe=function(e,t){var r,o,i=this,a=[];if(!t.contentDocument)for(var s=t.parentNode;s;){if(this.fragmentParentMap.has(s)){var l=s,c=this.fragmentParentMap.get(l);this.restoreRealParent(l,c);break}s=s.parentNode}m(e.node,{doc:t.contentDocument,map:this.mirror.map,hackCss:!0,skipChild:!1,afterAppend:function(e){i.collectIframeAndAttachDocument(a,e)}});var u=function(e,t){if(f.attachDocumentToIframe(e,t),f.newDocumentQueue=f.newDocumentQueue.filter((function(t){return t!==e})),t.contentDocument){var r=t.contentDocument,n=r.documentElement,o=r.head;f.insertStyleRules(n,o)}},f=this;try{for(var d=n(a),p=d.next();!p.done;p=d.next()){var h=p.value;u(h.mutationInQueue,h.builtNode)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}},e.prototype.collectIframeAndAttachDocument=function(e,t){if(z(t)){var r=this.newDocumentQueue.find((function(e){return e.parentId===t.__sn.id}));r&&e.push({mutationInQueue:r,builtNode:t})}},e.prototype.waitForStylesheetLoad=function(){var e,t=this,r=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(r){var n,o=new Set,i=this.service.state,a=function(){i=t.service.state};this.emitter.on(x.Start,a),this.emitter.on(x.Pause,a);var s=function(){t.emitter.off(x.Start,a),t.emitter.off(x.Pause,a)};r.querySelectorAll('link[rel="stylesheet"]').forEach((function(e){e.sheet||(o.add(e),e.addEventListener("load",(function(){o.delete(e),0===o.size&&-1!==n&&(i.matches("playing")&&t.play(t.getCurrentTime()),t.emitter.emit(x.LoadStylesheetEnd),n&&window.clearTimeout(n),s())})))})),o.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(x.LoadStylesheetStart),n=window.setTimeout((function(){i.matches("playing")&&t.play(t.getCurrentTime()),n=-1,s()}),this.config.loadTimeout))}},e.prototype.preloadAllImages=function(){var e,t,r=this,o=(this.service.state,function(){r.service.state});this.emitter.on(x.Start,o),this.emitter.on(x.Pause,o);var i=0;try{for(var a=n(this.service.state.context.events),s=a.next();!s.done;s=a.next()){var l=s.value;if(l.type===g.IncrementalSnapshot&&l.data.source===w.CanvasMutation&&"drawImage"===l.data.property&&"string"==typeof l.data.args[0]&&!this.imageMap.has(l)){i++;var c=document.createElement("canvas"),u=c.getContext("2d"),f=null==u?void 0:u.createImageData(c.width,c.height);null==f||f.data;JSON.parse(l.data.args[0]),null==u||u.putImageData(f,0,0)}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}0!==i&&this.service.send({type:"PAUSE"})},e.prototype.applyIncremental=function(e,t){var r,n,o=this,i=e.data;switch(i.source){case w.Mutation:t&&(i.adds.forEach((function(e){return o.treeIndex.add(e)})),i.texts.forEach((function(e){return o.treeIndex.text(e)})),i.attributes.forEach((function(e){return o.treeIndex.attribute(e)})),i.removes.forEach((function(e){return o.treeIndex.remove(e,o.mirror)}))),this.applyMutation(i,t);break;case w.Drag:case w.TouchMove:case w.MouseMove:if(t){var a=i.positions[i.positions.length-1];this.moveAndHover(i,a.x,a.y,a.id)}else i.positions.forEach((function(t){var r={doAction:function(){o.moveAndHover(i,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-o.service.state.context.baselineTime};o.timer.addAction(r)})),this.timer.addAction({doAction:function(){},delay:e.delay-(null===(r=i.positions[0])||void 0===r?void 0:r.timeOffset)});break;case w.MouseInteraction:if(-1===i.id)break;var s=new Event(b[i.type].toLowerCase());if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);this.emitter.emit(x.MouseInteraction,{type:i.type,target:v});var l=this.config.triggerFocus;switch(i.type){case b.Blur:"blur"in v&&v.blur();break;case b.Focus:l&&v.focus&&v.focus({preventScroll:!0});break;case b.Click:case b.TouchStart:case b.TouchEnd:t||(this.moveAndHover(i,i.x,i.y,i.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:v.dispatchEvent(s)}break;case w.Scroll:if(-1===i.id)break;if(t){this.treeIndex.scroll(i);break}this.applyScroll(i);break;case w.ViewportResize:this.emitter.emit(x.Resize,{width:i.width,height:i.height});break;case w.Input:if(-1===i.id)break;if(t){this.treeIndex.input(i);break}this.applyInput(i);break;case w.MediaInteraction:if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);var c=v;try{i.type===S.Pause&&c.pause(),i.type===S.Play&&(c.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?c.play():c.addEventListener("canplay",(function(){c.play()})))}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: "+(e.message||e))}break;case w.StyleSheetRule:if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);var u=v,f=v.parentNode,d=this.fragmentParentMap.has(f),p=void 0;if(d){var h=this.fragmentParentMap.get(v.parentNode);p=document.createTextNode(""),f.replaceChild(p,v),h.appendChild(v)}var m=u.sheet;i.adds&&i.adds.forEach((function(e){var t=e.rule,r=e.index;try{var n=void 0===r?void 0:Math.min(r,m.rules.length);try{m.insertRule(t,n)}catch(e){}}catch(e){}})),i.removes&&i.removes.forEach((function(e){var t=e.index;try{m.deleteRule(t)}catch(e){}})),d&&p&&f.replaceChild(v,p);break;case w.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var v;if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);try{var y=v.getContext("2d");if(i.setter)return void(y[i.property]=i.args[0]);var g=y[i.property];if("drawImage"===i.property&&"string"==typeof i.args[0]){var E=this.imageMap.get(e);i.args[0]=E,g.apply(y,i.args)}else g.apply(y,i.args)}catch(e){this.warnCanvasMutationFailed(i,i.id,e)}break;case w.Font:try{var T=new FontFace(i.family,i.buffer?new Uint8Array(JSON.parse(i.fontSource)):i.fontSource,i.descriptors);null===(n=this.iframe.contentDocument)||void 0===n||n.fonts.add(T)}catch(e){this.config.showWarning&&console.warn(e)}break;case w.Log:try{var M=e.data,N=this.config.logConfig.replayLogger;"function"==typeof N[M.level]&&N[M.level](M)}catch(e){this.config.showWarning&&console.warn(e)}}},e.prototype.applyMutation=function(e,o){var i,a,s=this;e.removes.forEach((function(t){var r=s.mirror.getNode(t.id);if(!r)return s.warnNodeNotFound(e,t.id);var n=s.mirror.getNode(t.parentId);if(!n)return s.warnNodeNotFound(e,t.parentId);if(t.isShadow&&Y(n)&&(n=n.shadowRoot),s.mirror.removeNodeFromMap(r),n){var o="__sn"in n?s.fragmentParentMap.get(n):void 0;if(o&&o.contains(r))o.removeChild(r);else if(s.fragmentParentMap.has(r)){var i=s.fragmentParentMap.get(r);n.removeChild(i),s.fragmentParentMap.delete(r)}else n.removeChild(r)}}));var l=r({},this.legacy_missingNodeRetryMap),c=[],u=function(e){var r,n;if(!s.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var i=s.mirror.getNode(e.parentId);if(!i)return e.node.type===t.Document?s.newDocumentQueue.push(e):c.push(e);var a=null;s.iframe.contentDocument.contains?a=s.iframe.contentDocument.contains(i):s.iframe.contentDocument.body.contains&&(a=s.iframe.contentDocument.body.contains(i));var u=(null===(n=(r=i).getElementsByTagName)||void 0===n?void 0:n.call(r,"iframe").length)>0;if(o&&a&&!z(i)&&!u){var f=document.createDocumentFragment();for(s.mirror.map[e.parentId]=f,s.fragmentParentMap.set(f,i),s.storeState(i);i.firstChild;)f.appendChild(i.firstChild);i=f}e.node.isShadow&&Y(i)&&(i=i.shadowRoot);var d=null,p=null;if(e.previousId&&(d=s.mirror.getNode(e.previousId)),e.nextId&&(p=s.mirror.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=s.mirror.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return c.push(e);if(!e.node.rootId||s.mirror.getNode(e.node.rootId)){var h=e.node.rootId?s.mirror.getNode(e.node.rootId):s.iframe.contentDocument;if(z(i))s.attachDocumentToIframe(e,i);else{var v=m(e.node,{doc:h,map:s.mirror.map,skipChild:!0,hackCss:!0});if(-1!==e.previousId&&-1!==e.nextId){if(d&&d.nextSibling&&d.nextSibling.parentNode)i.insertBefore(v,d.nextSibling);else if(p&&p.parentNode)i.contains(p)?i.insertBefore(v,p):i.insertBefore(v,null);else{if(i===h)for(;h.firstChild;)h.removeChild(h.firstChild);i.appendChild(v)}if(z(v)){var y=s.newDocumentQueue.find((function(e){return e.parentId===v.__sn.id}));if(y&&(s.attachDocumentToIframe(y,v),s.newDocumentQueue=s.newDocumentQueue.filter((function(e){return e!==y}))),v.contentDocument){var g=v.contentDocument,w=g.documentElement,b=g.head;s.insertStyleRules(w,b)}}(e.previousId||e.nextId)&&s.legacy_resolveMissingNode(l,i,v,e)}else l[e.node.id]={node:v,mutation:e}}}};e.adds.forEach((function(e){u(e)}));for(var f=Date.now();c.length;){var d=V(c);if(c.length=0,Date.now()-f>500){this.warn("Timeout in the loop, please check the resolve tree data:",d);break}try{for(var p=(i=void 0,n(d)),h=p.next();!h.done;h=p.next()){var v=h.value;this.mirror.getNode(v.value.parentId)?W(v,(function(e){u(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",v)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}}Object.keys(l).length&&Object.assign(this.legacy_missingNodeRetryMap,l),e.texts.forEach((function(t){var r=s.mirror.getNode(t.id);if(!r)return s.warnNodeNotFound(e,t.id);s.fragmentParentMap.has(r)&&(r=s.fragmentParentMap.get(r)),r.textContent=t.value})),e.attributes.forEach((function(t){var r=s.mirror.getNode(t.id);if(!r)return s.warnNodeNotFound(e,t.id);for(var n in s.fragmentParentMap.has(r)&&(r=s.fragmentParentMap.get(r)),t.attributes)if("string"==typeof n){var o=t.attributes[n];try{null!==o?r.setAttribute(n,o):r.removeAttribute(n)}catch(e){s.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}}}))},e.prototype.applyScroll=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);if(t===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else try{t.scrollTop=e.y,t.scrollLeft=e.x}catch(e){}},e.prototype.applyInput=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},e.prototype.formatMessage=function(e){if(0===e.trace.length)return"";var t="\n\tat ";return t+=e.trace.join("\n\tat ")},e.prototype.getConsoleLogger=function(){var e,t,r=this,o={},a=function(e){o[e]="trace"===e?function(e){(console.log.__rrweb_original__?console.log.__rrweb_original__:console.log).apply(void 0,i(e.payload.map((function(e){return JSON.parse(e)})),[r.formatMessage(e)]))}:function(t){(console[e].__rrweb_original__?console[e].__rrweb_original__:console[e]).apply(void 0,i(t.payload.map((function(e){return JSON.parse(e)})),[r.formatMessage(t)]))}};try{for(var s=n(this.config.logConfig.level),l=s.next();!l.done;l=s.next()){a(l.value)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return o},e.prototype.legacy_resolveMissingNode=function(e,t,r,n){var o=n.previousId,i=n.nextId,a=o&&e[o],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,r),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(s){var f=s;c=f.node,u=f.mutation;t.insertBefore(c,r.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,r,n){var o=this.mirror.getNode(n);if(!o)return this.debugNodeNotFound(e,n);var i=function e(t,r){var n,o,i=null===(o=null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===o?void 0:o.frameElement;if(!i||i===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var a=i.getBoundingClientRect(),s=e(i,r),l=a.height/i.clientHeight;return{x:a.x*s.relativeScale+s.x,y:a.y*s.relativeScale+s.y,relativeScale:l,absoluteScale:s.absoluteScale*l}}(o,this.iframe),a=t*i.absoluteScale+i.x,s=r*i.absoluteScale+i.y;this.mouse.style.left=a+"px",this.mouse.style.top=s+"px",this.drawMouseTail({x:a,y:s}),this.hoverElements(o)},e.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var r=!0===this.config.mouseTail?H:Object.assign({},H,this.config.mouseTail),n=r.lineCap,o=r.lineWidth,i=r.strokeStyle,a=r.duration,s=function(){if(t.mouseTail){var e=t.mouseTail.getContext("2d");e&&t.tailPositions.length&&(e.clearRect(0,0,t.mouseTail.width,t.mouseTail.height),e.beginPath(),e.lineWidth=o,e.lineCap=n,e.strokeStyle=i,e.moveTo(t.tailPositions[0].x,t.tailPositions[0].y),t.tailPositions.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}};this.tailPositions.push(e),s(),setTimeout((function(){t.tailPositions=t.tailPositions.filter((function(t){return t!==e})),s()}),a/this.speedService.state.context.timer.speed)}},e.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var r=e;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement},e.prototype.isUserInteraction=function(e){return e.type===g.IncrementalSnapshot&&(e.data.source>w.Mutation&&e.data.source<=w.Input)},e.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(x.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},e.prototype.restoreRealParent=function(e,r){this.mirror.map[r.__sn.id]=r,r.__sn.type===t.Element&&"textarea"===r.__sn.tagName&&e.textContent&&(r.value=e.textContent),r.appendChild(e),this.restoreState(r)},e.prototype.storeState=function(e){var t,r;if(e&&e.nodeType===e.ELEMENT_NODE){var o=e;(o.scrollLeft||o.scrollTop)&&this.elementStateMap.set(e,{scroll:[o.scrollLeft,o.scrollTop]});var i=o.children;try{for(var a=n(Array.from(i)),s=a.next();!s.done;s=a.next()){var l=s.value;this.storeState(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}},e.prototype.restoreState=function(e){var t,r;if(e.nodeType===e.ELEMENT_NODE){var o=e;if(this.elementStateMap.has(e)){var i=this.elementStateMap.get(e);i.scroll&&(o.scrollLeft=i.scroll[0],o.scrollTop=i.scroll[1]),this.elementStateMap.delete(e)}var a=o.children;try{for(var s=n(Array.from(a)),l=s.next();!l.done;l=s.next()){var c=l.value;this.restoreState(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}},e.prototype.warnNodeNotFound=function(e,t){this.warn("Node with id '"+t+"' not found in",e)},e.prototype.warnCanvasMutationFailed=function(e,t,r){this.warn("Has error on update canvas '"+t+"'",e,r)},e.prototype.debugNodeNotFound=function(e,t){this.debug("[replayer]","Node with id '"+t+"' not found in",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,i(["[replayer]"],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,i(["[replayer]"],e))},e}(),J=Uint8Array,$=Uint16Array,K=Uint32Array,Z=new J([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]),ee=new J([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]),te=new J([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),re=function(e,t){for(var r=new $(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var o=new K(r[30]);for(n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return[r,o]},ne=re(Z,2),oe=ne[0],ie=ne[1];oe[28]=258,ie[258]=28;for(var ae=re(ee,0)[0],se=new $(32768),le=0;le<32768;++le){var ce=(43690&le)>>>1|(21845&le)<<1;ce=(61680&(ce=(52428&ce)>>>2|(13107&ce)<<2))>>>4|(3855&ce)<<4,se[le]=((65280&ce)>>>8|(255&ce)<<8)>>>1}var ue=function(e,t,r){for(var n=e.length,o=0,i=new $(t);o<n;++o)++i[e[o]-1];var a,s=new $(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(r){a=new $(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],u=t-e[o],f=s[e[o]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[se[f]>>>l]=c}else for(a=new $(n),o=0;o<n;++o)a[o]=se[s[e[o]-1]++]>>>15-e[o];return a},fe=new J(288);for(le=0;le<144;++le)fe[le]=8;for(le=144;le<256;++le)fe[le]=9;for(le=256;le<280;++le)fe[le]=7;for(le=280;le<288;++le)fe[le]=8;var de=new J(32);for(le=0;le<32;++le)de[le]=5;ue(fe,9,0);var pe=ue(fe,9,1),he=(ue(de,5,0),ue(de,5,1)),me=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},ve=function(e,t,r){var n=t/8>>0;return(e[n]|e[n+1]<<8)>>>(7&t)&r},ye=function(e,t){var r=t/8>>0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(7&t)},ge=function(e,t,r){(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof $?$:e instanceof K?K:J)(r-t);return n.set(e.subarray(t,r)),n},we=new K(256);for(le=0;le<256;++le){for(var be=le,Se=9;--Se;)be=(1&be&&3988292384)^be>>>1;we[le]=be}function xe(e,t){return function(e,t,r){var n=e.length,o=!t||r,i=!r||r.i;r||(r={}),t||(t=new J(3*n));var a=function(e){var r=t.length;if(e>r){var n=new J(Math.max(2*r,e));n.set(t),t=n}},s=r.f||0,l=r.p||0,c=r.b||0,u=r.l,f=r.d,d=r.m,p=r.n;if(s&&!u)return t;var h,m=8*n;do{if(!u){r.f=s=ve(e,l,1);var v=ve(e,l+1,3);if(l+=3,!v){var y=e[(I=((h=l)/8>>0)+(7&h&&1)+4)-4]|e[I-3]<<8,g=I+y;if(g>n){if(i)throw"unexpected EOF";break}o&&a(c+y),t.set(e.subarray(I,g),c),r.b=c+=y,r.p=l=8*g;continue}if(1==v)u=pe,f=he,d=9,p=5;else{if(2!=v)throw"invalid block type";var w=ve(e,l,31)+257,b=ve(e,l+10,15)+4,S=w+ve(e,l+5,31)+1;l+=14;for(var x=new J(S),E=new J(19),T=0;T<b;++T)E[te[T]]=ve(e,l+3*T,7);l+=3*b;var M=me(E),N=(1<<M)-1;if(!i&&l+S*(M+7)>m)break;var C=ue(E,M,1);for(T=0;T<S;){var I,_=C[ve(e,l,N)];if(l+=15&_,(I=_>>>4)<16)x[T++]=I;else{var D=0,A=0;for(16==I?(A=3+ve(e,l,3),l+=2,D=x[T-1]):17==I?(A=3+ve(e,l,7),l+=3):18==I&&(A=11+ve(e,l,127),l+=7);A--;)x[T++]=D}}var k=x.subarray(0,w),O=x.subarray(w);d=me(k),p=me(O),u=ue(k,d,1),f=ue(O,p,1)}if(l>m)throw"unexpected EOF"}o&&a(c+131072);for(var L=(1<<d)-1,F=(1<<p)-1,P=d+p+18;i||l+P<m;){var R=(D=u[ye(e,l)&L])>>>4;if((l+=15&D)>m)throw"unexpected EOF";if(!D)throw"invalid length/literal";if(R<256)t[c++]=R;else{if(256==R){u=null;break}var j=R-254;if(R>264){var B=Z[T=R-257];j=ve(e,l,(1<<B)-1)+oe[T],l+=B}var U=f[ye(e,l)&F],V=U>>>4;if(!U)throw"invalid distance";l+=15&U;O=ae[V];if(V>3){B=ee[V];O+=ye(e,l)&(1<<B)-1,l+=B}if(l>m)throw"unexpected EOF";o&&a(c+131072);for(var W=c+j;c<W;c+=4)t[c]=t[c-O],t[c+1]=t[c+1-O],t[c+2]=t[c+2-O],t[c+3]=t[c+3-O];c=W}}r.l=u,r.p=l,r.b=c,u&&(s=1,r.m=d,r.d=f,r.n=p)}while(!s);return c==t.length?t:ge(t,0,c)}((function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"}(e),e.subarray(2,-4)),t)}return e.Replayer=q,e.unpack=function(e){if("string"!=typeof e)return e;try{if((t=JSON.parse(e)).timestamp)return t}catch(e){}try{var t;if("v1"===(t=JSON.parse(function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var n=0;n<e.length;){var o=e[n++];o<128||t?r+=String.fromCharCode(o):o<224?r+=String.fromCharCode((31&o)<<6|63&e[n++]):o<240?r+=String.fromCharCode((15&o)<<12|(63&e[n++])<<6|63&e[n++]):(o=((15&o)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}return r}(xe(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new J(e.length+(e.length>>>1)),o=0,i=function(e){n[o++]=e},a=0;a<r;++a){if(o+5>n.length){var s=new J(o+8+(r-a<<1));s.set(n),n=s}var l=e.charCodeAt(a);l<128||t?i(l):l<2048?(i(192|l>>>6),i(128|63&l)):l>55295&&l<57344?(i(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++a))>>>18),i(128|l>>>12&63),i(128|l>>>6&63),i(128|63&l)):(i(224|l>>>12),i(128|l>>>6&63),i(128|63&l))}return ge(n,0,o)}(e,!0))))).v)return t;throw new Error("These events were packed with packer "+t.v+" which is incompatible with current packer v1.")}catch(e){throw console.error(e),new Error("Unknown data format.")}},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=rrweb-replay-unpack.min.js.map

@@ -15,3 +15,3 @@ var rrwebReplay=function(e){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function r(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function o(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(i(arguments[t]));return e}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(t||(t={}));var a=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function s(e,t){void 0===t&&(t={});var n=1,r=1;function i(e){var t=e.match(/\n/g);t&&(n+=t.length);var i=e.lastIndexOf("\n");r=-1===i?r+e.length:e.length-i}function o(){var e={line:n,column:r};return function(t){return t.position=new s(e),m(),t}}var s=function(e){this.start=e,this.end={line:n,column:r},this.source=t.source};s.prototype.content=e;var c=[];function u(i){var o=new Error(t.source+":"+n+":"+r+": "+i);if(o.reason=i,o.filename=t.source,o.line=n,o.column=r,o.source=e,!t.silent)throw o;c.push(o)}function d(){return h(/^{\s*/)}function f(){return h(/^}/)}function p(){var t,n=[];for(m(),v(n);e.length&&"}"!==e.charAt(0)&&(t=C()||I());)!1!==t&&(n.push(t),v(n));return n}function h(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function m(){h(/^\s*/)}function v(e){var t;for(void 0===e&&(e=[]);t=y();)!1!==t&&e.push(t),t=y();return e}function y(){var t=o();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var n=2;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return u("End of comment missing");var a=e.slice(2,n-2);return r+=2,i(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}}function g(){var e=h(/^([^{]+)/);if(e)return l(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function b(){var e=o(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var n=l(t[0]);if(!h(/^:\s*/))return u("property missing ':'");var r=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:n.replace(a,""),value:r?l(r[0]).replace(a,""):""});return h(/^[;\s]*/),i}}function S(){var e,t=[];if(!d())return u("missing '{'");for(v(t);e=b();)!1!==e&&(t.push(e),v(t)),e=b();return f()?t:u("missing '}'")}function x(){for(var e,t=[],n=o();e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:S()})}var w,E=N("import"),T=N("charset"),M=N("namespace");function N(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=o(),r=h(t);if(r){var i={type:e};return i[e]=r[1].trim(),n(i)}}}function C(){if("@"===e[0])return function(){var e=o(),t=h(/^@([-\w]+)?keyframes\s*/);if(t){var n=t[1];if(!(t=h(/^([-\w]+)\s*/)))return u("@keyframes missing name");var r,i=t[1];if(!d())return u("@keyframes missing '{'");for(var a=v();r=x();)a.push(r),a=a.concat(v());return f()?e({type:"keyframes",name:i,vendor:n,keyframes:a}):u("@keyframes missing '}'")}}()||function(){var e=o(),t=h(/^@media *([^{]+)/);if(t){var n=l(t[1]);if(!d())return u("@media missing '{'");var r=v().concat(p());return f()?e({type:"media",media:n,rules:r}):u("@media missing '}'")}}()||function(){var e=o(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:l(t[1]),media:l(t[2])})}()||function(){var e=o(),t=h(/^@supports *([^{]+)/);if(t){var n=l(t[1]);if(!d())return u("@supports missing '{'");var r=v().concat(p());return f()?e({type:"supports",supports:n,rules:r}):u("@supports missing '}'")}}()||E()||T()||M()||function(){var e=o(),t=h(/^@([-\w]+)?document *([^{]+)/);if(t){var n=l(t[1]),r=l(t[2]);if(!d())return u("@document missing '{'");var i=v().concat(p());return f()?e({type:"document",document:r,vendor:n,rules:i}):u("@document missing '}'")}}()||function(){var e=o();if(h(/^@page */)){var t=g()||[];if(!d())return u("@page missing '{'");for(var n,r=v();n=b();)r.push(n),r=r.concat(v());return f()?e({type:"page",selectors:t,declarations:r}):u("@page missing '}'")}}()||function(){var e=o();if(h(/^@host\s*/)){if(!d())return u("@host missing '{'");var t=v().concat(p());return f()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=o();if(h(/^@font-face\s*/)){if(!d())return u("@font-face missing '{'");for(var t,n=v();t=b();)n.push(t),n=n.concat(v());return f()?e({type:"font-face",declarations:n}):u("@font-face missing '}'")}}()}function I(){var e=o(),t=g();return t?(v(),e({type:"rule",selectors:t,declarations:S()})):u("selector missing")}return function e(t,n){for(var r=t&&"string"==typeof t.type,i=r?t:n,o=0,a=Object.keys(t);o<a.length;o++){var s=a[o],l=t[s];Array.isArray(l)?l.forEach((function(t){e(t,i)})):l&&"object"==typeof l&&e(l,i)}r&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null});return t}((w=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:w,parsingErrors:c}}))}function l(e){return e?e.replace(/^\s+|\s+$/g,""):""}var c={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var u=/([^\\]):hover/g;function d(e){var t=s(e,{silent:!0});return t.stylesheet?(t.stylesheet.rules.forEach((function(t){"selectors"in t&&(t.selectors||[]).forEach((function(t){if(u.test(t)){var n=t.replace(u,"$1.\\:hover");e=e.replace(t,t+", "+n)}}))})),e):e}function f(e,n){var r=n.doc,i=n.hackCss;switch(e.type){case t.Document:return r.implementation.createDocument(null,"",null);case t.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case t.Element:var o,a=function(e){var t=c[e.tagName]?c[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);o=e.isSVG?r.createElementNS("http://www.w3.org/2000/svg",a):r.createElement(a);var s=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var n=e.attributes[t];if(n="boolean"==typeof n||"number"==typeof n?"":n,t.startsWith("rr_")){if("canvas"===a&&"rr_dataURL"===t){var s=document.createElement("img");s.src=n,s.onload=function(){var e=o.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(o.style.width=n),"rr_height"===t&&(o.style.height=n),"rr_mediaState"===t)switch(n){case"played":o.play();case"paused":o.pause()}}else{var l="textarea"===a&&"value"===t,c="style"===a&&"_cssText"===t;if(c&&i&&(n=d(n)),l||c){for(var u=r.createTextNode(n),f=0,p=Array.from(o.childNodes);f<p.length;f++){var h=p[f];h.nodeType===o.TEXT_NODE&&o.removeChild(h)}return o.appendChild(u),"continue"}if("iframe"===a&&"src"===t)return"continue";try{e.isSVG&&"xlink:href"===t?o.setAttributeNS("http://www.w3.org/1999/xlink",t,n):"onload"===t||"onclick"===t||"onmouse"===t.substring(0,7)?o.setAttribute("_"+t,n):o.setAttribute(t,n)}catch(e){}}};for(var l in e.attributes)s(l);return o;case t.Text:return r.createTextNode(e.isStyle&&i?d(e.textContent):e.textContent);case t.CDATA:return r.createCDATASection(e.textContent);case t.Comment:return r.createComment(e.textContent);default:return null}}function p(e,n){var r=n.doc,i=n.map,o=n.skipChild,a=void 0!==o&&o,s=n.hackCss,l=void 0===s||s,c=f(e,{doc:r,hackCss:l});if(!c)return null;if(e.type===t.Document&&(r.close(),r.open(),c=r),c.__sn=e,i[e.id]=c,(e.type===t.Document||e.type===t.Element)&&!a)for(var u=0,d=e.childNodes;u<d.length;u++){var h=d[u],m=p(h,{doc:r,map:i,skipChild:!1,hackCss:l});m?c.appendChild(m):console.warn("Failed to rebuild",h)}return c}function h(e,n){var r=n.doc,i=n.onVisit,o=n.hackCss,a={},s=p(e,{doc:r,map:a,skipChild:!1,hackCss:void 0===o||o});return function(e,t){for(var n in e)e[n]&&(r=e[n],t(r));var r}(a,(function(e){i&&i(e),function(e){var n=e.__sn;if(n.type===t.Element){var r=e;for(var i in n.attributes)if(n.attributes.hasOwnProperty(i)&&i.startsWith("rr_")){var o=n.attributes[i];"rr_scrollLeft"===i&&(r.scrollLeft=o),"rr_scrollTop"===i&&(r.scrollTop=o)}}}(e)})),[s,a]}function m(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map((function(e){e(n)})),(e["*"]||[]).slice().map((function(e){e(t,n)}))}}}var v,y,g,b,S,x=Object.freeze({__proto__:null,default:m});function w(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var n,r=e.HTMLElement||e.Element,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||s,scrollIntoView:r.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var n=f(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function d(e){var t=c(e,"Y")&&u(e,"Y"),n=c(e,"X")&&u(e,"X");return t||n}function f(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function p(t){var n,r,i,a,s=(o()-t.startTime)/468;a=s=s>1?1:s,n=.5*(1-Math.cos(Math.PI*a)),r=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,i),r===t.x&&i===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,r,a){var l,c,u,d,f=o();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(l=n,c=n.scrollLeft,u=n.scrollTop,d=s),p({scrollable:l,method:d,startTime:f,startX:c,startY:u,x:r,y:a})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom"}(v||(v={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log"}(y||(y={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd"}(g||(g={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(b||(b={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change"}(S||(S={}));var E,T=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,o(e))},e.prototype.start=function(){this.actions.sort((function(e,t){return e.delay-t.delay})),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this;this.raf=requestAnimationFrame((function r(){var i=performance.now();for(n.timeOffset+=(i-e)*n.speed,e=i;t.length;){var o=t[0];if(!(n.timeOffset>=o.delay))break;t.shift(),o.doAction()}(t.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(r))}))},e.prototype.clear=function(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.isActive=function(){return null!==this.raf},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r;n=r-1}}return t},e}();function M(e,t){if(e.type===v.IncrementalSnapshot&&e.data.source===y.MouseMove){var n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}
***************************************************************************** */var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function r(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function i(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}function a(e){return e.nodeType===e.ELEMENT_NODE}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(t||(t={}));var s=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function l(e,t){void 0===t&&(t={});var n=1,r=1;function o(e){var t=e.match(/\n/g);t&&(n+=t.length);var o=e.lastIndexOf("\n");r=-1===o?r+e.length:e.length-o}function i(){var e={line:n,column:r};return function(t){return t.position=new a(e),m(),t}}var a=function(e){this.start=e,this.end={line:n,column:r},this.source=t.source};a.prototype.content=e;var l=[];function u(o){var i=new Error(t.source+":"+n+":"+r+": "+o);if(i.reason=o,i.filename=t.source,i.line=n,i.column=r,i.source=e,!t.silent)throw i;l.push(i)}function d(){return h(/^{\s*/)}function f(){return h(/^}/)}function p(){var t,n=[];for(m(),v(n);e.length&&"}"!==e.charAt(0)&&(t=I()||C());)!1!==t&&(n.push(t),v(n));return n}function h(t){var n=t.exec(e);if(n){var r=n[0];return o(r),e=e.slice(r.length),n}}function m(){h(/^\s*/)}function v(e){var t;for(void 0===e&&(e=[]);t=y();)!1!==t&&e.push(t),t=y();return e}function y(){var t=i();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var n=2;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return u("End of comment missing");var a=e.slice(2,n-2);return r+=2,o(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}}function g(){var e=h(/^([^{]+)/);if(e)return c(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function b(){var e=i(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var n=c(t[0]);if(!h(/^:\s*/))return u("property missing ':'");var r=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(s,""),value:r?c(r[0]).replace(s,""):""});return h(/^[;\s]*/),o}}function w(){var e,t=[];if(!d())return u("missing '{'");for(v(t);e=b();)!1!==e&&(t.push(e),v(t)),e=b();return f()?t:u("missing '}'")}function S(){for(var e,t=[],n=i();e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:w()})}var x,E=N("import"),T=N("charset"),M=N("namespace");function N(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=i(),r=h(t);if(r){var o={type:e};return o[e]=r[1].trim(),n(o)}}}function I(){if("@"===e[0])return function(){var e=i(),t=h(/^@([-\w]+)?keyframes\s*/);if(t){var n=t[1];if(!(t=h(/^([-\w]+)\s*/)))return u("@keyframes missing name");var r,o=t[1];if(!d())return u("@keyframes missing '{'");for(var a=v();r=S();)a.push(r),a=a.concat(v());return f()?e({type:"keyframes",name:o,vendor:n,keyframes:a}):u("@keyframes missing '}'")}}()||function(){var e=i(),t=h(/^@media *([^{]+)/);if(t){var n=c(t[1]);if(!d())return u("@media missing '{'");var r=v().concat(p());return f()?e({type:"media",media:n,rules:r}):u("@media missing '}'")}}()||function(){var e=i(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:c(t[1]),media:c(t[2])})}()||function(){var e=i(),t=h(/^@supports *([^{]+)/);if(t){var n=c(t[1]);if(!d())return u("@supports missing '{'");var r=v().concat(p());return f()?e({type:"supports",supports:n,rules:r}):u("@supports missing '}'")}}()||E()||T()||M()||function(){var e=i(),t=h(/^@([-\w]+)?document *([^{]+)/);if(t){var n=c(t[1]),r=c(t[2]);if(!d())return u("@document missing '{'");var o=v().concat(p());return f()?e({type:"document",document:r,vendor:n,rules:o}):u("@document missing '}'")}}()||function(){var e=i();if(h(/^@page */)){var t=g()||[];if(!d())return u("@page missing '{'");for(var n,r=v();n=b();)r.push(n),r=r.concat(v());return f()?e({type:"page",selectors:t,declarations:r}):u("@page missing '}'")}}()||function(){var e=i();if(h(/^@host\s*/)){if(!d())return u("@host missing '{'");var t=v().concat(p());return f()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=i();if(h(/^@font-face\s*/)){if(!d())return u("@font-face missing '{'");for(var t,n=v();t=b();)n.push(t),n=n.concat(v());return f()?e({type:"font-face",declarations:n}):u("@font-face missing '}'")}}()}function C(){var e=i(),t=g();return t?(v(),e({type:"rule",selectors:t,declarations:w()})):u("selector missing")}return function e(t,n){for(var r=t&&"string"==typeof t.type,o=r?t:n,i=0,a=Object.keys(t);i<a.length;i++){var s=a[i],l=t[s];Array.isArray(l)?l.forEach((function(t){e(t,o)})):l&&"object"==typeof l&&e(l,o)}r&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null});return t}((x=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:x,parsingErrors:l}}))}function c(e){return e?e.replace(/^\s+|\s+$/g,""):""}var u={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var d=/([^\\]):hover/,f=new RegExp(d,"g");function p(e){var t=l(e,{silent:!0});if(!t.stylesheet)return e;var n=[];if(t.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){d.test(e)&&n.push(e)}))})),0===n.length)return e;var r=new RegExp(n.filter((function(e,t){return n.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g");return e.replace(r,(function(e){var t=e.replace(f,"$1.\\:hover");return e+", "+t}))}function h(e,n){var r=n.doc,o=n.hackCss;switch(e.type){case t.Document:return r.implementation.createDocument(null,"",null);case t.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case t.Element:var i,a=function(e){var t=u[e.tagName]?u[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);i=e.isSVG?r.createElementNS("http://www.w3.org/2000/svg",a):r.createElement(a);var s=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var n=e.attributes[t];if(n="boolean"==typeof n||"number"==typeof n?"":n,t.startsWith("rr_")){if("canvas"===a&&"rr_dataURL"===t){var s=document.createElement("img");s.src=n,s.onload=function(){var e=i.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(i.style.width=n),"rr_height"===t&&(i.style.height=n),"rr_mediaState"===t)switch(n){case"played":i.play();case"paused":i.pause()}}else{var l="textarea"===a&&"value"===t,c="style"===a&&"_cssText"===t;if(c&&o&&(n=p(n)),l||c){for(var u=r.createTextNode(n),d=0,f=Array.from(i.childNodes);d<f.length;d++){var h=f[d];h.nodeType===i.TEXT_NODE&&i.removeChild(h)}return i.appendChild(u),"continue"}if("iframe"===a&&"src"===t)return"continue";try{e.isSVG&&"xlink:href"===t?i.setAttributeNS("http://www.w3.org/1999/xlink",t,n):"onload"===t||"onclick"===t||"onmouse"===t.substring(0,7)?i.setAttribute("_"+t,n):i.setAttribute(t,n)}catch(e){}}};for(var l in e.attributes)s(l);if(e.isShadowHost)if(i.shadowRoot)for(;i.shadowRoot.firstChild;)i.shadowRoot.removeChild(i.shadowRoot.firstChild);else i.attachShadow({mode:"open"});return i;case t.Text:return r.createTextNode(e.isStyle&&o?p(e.textContent):e.textContent);case t.CDATA:return r.createCDATASection(e.textContent);case t.Comment:return r.createComment(e.textContent);default:return null}}function m(e,n){var r=n.doc,o=n.map,i=n.skipChild,s=void 0!==i&&i,l=n.hackCss,c=void 0===l||l,u=n.afterAppend,d=h(e,{doc:r,hackCss:c});if(!d)return null;if(e.rootId&&console.assert(o[e.rootId]===r,"Target document should has the same root id."),e.type===t.Document&&(r.close(),r.open(),d=r),d.__sn=e,o[e.id]=d,(e.type===t.Document||e.type===t.Element)&&!s)for(var f=0,p=e.childNodes;f<p.length;f++){var v=p[f],y=m(v,{doc:r,map:o,skipChild:!1,hackCss:c,afterAppend:u});y?(v.isShadow&&a(d)&&d.shadowRoot?d.shadowRoot.appendChild(y):d.appendChild(y),u&&u(y)):console.warn("Failed to rebuild",v)}return d}function v(e,n){var r=n.doc,o=n.onVisit,i=n.hackCss,a={},s=m(e,{doc:r,map:a,skipChild:!1,hackCss:void 0===i||i,afterAppend:n.afterAppend});return function(e,t){for(var n in e)e[n]&&(r=e[n],t(r));var r}(a,(function(e){o&&o(e),function(e){var n=e.__sn;if(n.type===t.Element){var r=e;for(var o in n.attributes)if(n.attributes.hasOwnProperty(o)&&o.startsWith("rr_")){var i=n.attributes[o];"rr_scrollLeft"===o&&(r.scrollLeft=i),"rr_scrollTop"===o&&(r.scrollTop=i)}}}(e)})),[s,a]}function y(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map((function(e){e(n)})),(e["*"]||[]).slice().map((function(e){e(t,n)}))}}}var g,b,w,S,x,E=Object.freeze({__proto__:null,default:y});function T(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var n,r=e.HTMLElement||e.Element,o={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||s,scrollIntoView:r.prototype.scrollIntoView},i=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):o.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?o.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var n=f(this),r=n.getBoundingClientRect(),i=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+i.left-r.left,n.scrollTop+i.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:i.left,top:i.top,behavior:"smooth"})}else o.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function d(e){var t=c(e,"Y")&&u(e,"Y"),n=c(e,"X")&&u(e,"X");return t||n}function f(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function p(t){var n,r,o,a,s=(i()-t.startTime)/468;a=s=s>1?1:s,n=.5*(1-Math.cos(Math.PI*a)),r=t.startX+(t.x-t.startX)*n,o=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,o),r===t.x&&o===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,r,a){var l,c,u,d,f=i();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=o.scroll):(l=n,c=n.scrollLeft,u=n.scrollTop,d=s),p({scrollable:l,method:d,startTime:f,startX:c,startY:u,x:r,y:a})}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom"}(g||(g={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag"}(b||(b={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd"}(w||(w={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(S||(S={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(x||(x={}));var M,N=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){this.actions=this.actions.concat(e)},e.prototype.start=function(){this.timeOffset=0;var e=performance.now(),t=this.actions,n=this;this.raf=requestAnimationFrame((function r(){var o=performance.now();for(n.timeOffset+=(o-e)*n.speed,e=o;t.length;){var i=t[0];if(!(n.timeOffset>=i.delay))break;t.shift(),i.doAction()}(t.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(r))}))},e.prototype.clear=function(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.isActive=function(){return null!==this.raf},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r;n=r-1}}return t},e}();function I(e,t){if(e.type===g.IncrementalSnapshot&&e.data.source===b.MouseMove){var n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}
/*! *****************************************************************************

@@ -30,3 +30,3 @@ Copyright (c) Microsoft Corporation. All rights reserved.

and limitations under the License.
***************************************************************************** */!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(E||(E={}));var N={type:"xstate.init"};function C(e){return void 0===e?[]:[].concat(e)}function I(e){return{type:"xstate.assign",assignment:e}}function _(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function A(e){return function(t){return e===t}}function k(e){return"string"==typeof e?{type:e}:e}function L(e,t){return{value:e,context:t,actions:[],changed:!1,matches:A(e)}}function D(e,t){void 0===t&&(t={});var n={config:e,_options:t,initialState:{value:e.initial,actions:C(e.states[e.initial].entry).map((function(e){return _(e,t.actions)})),context:e.context,matches:A(e.initial)},transition:function(t,r){var i,o,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,l=a.context,c=k(r),u=e.states[s];if(u.on){var d=C(u.on[c.type]),f=function(t){if(void 0===t)return{value:L(s,l)};var r="string"==typeof t?{target:t}:t,i=r.target,o=void 0===i?s:i,a=r.actions,d=void 0===a?[]:a,f=r.cond,p=l;if((void 0===f?function(){return!0}:f)(l,c)){var h=e.states[o],m=!1,v=[].concat(u.exit,d,h.entry).filter((function(e){return e})).map((function(e){return _(e,n._options.actions)})).filter((function(e){if("xstate.assign"===e.type){m=!0;var t=Object.assign({},p);return"function"==typeof e.assignment?t=e.assignment(p,c):Object.keys(e.assignment).forEach((function(n){t[n]="function"==typeof e.assignment[n]?e.assignment[n](p,c):e.assignment[n]})),p=t,!1}return!0}));return{value:{value:o,context:p,actions:v,changed:o!==s||v.length>0||m,matches:A(o)}}}};try{for(var p=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(d),h=p.next();!h.done;h=p.next()){var m=f(h.value);if("object"==typeof m)return m.value}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}}return L(s,l)}};return n}var O=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))};function F(e){var t=e.initialState,n=E.NotStarted,r=new Set,i={_machine:e,send:function(i){n===E.Running&&(t=e.transition(t,i),O(t,k(i)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(r){if(r){var o="object"==typeof r?r:{context:e.config.context,value:r};t={value:o.value,actions:[],context:o.context,matches:A(o.value)}}return n=E.Running,O(t,N),i},stop:function(){return n=E.Stopped,r.clear(),i},get state(){return t},get status(){return n}};return i}var P={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return P.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete P.map[t],e.childNodes&&e.childNodes.forEach((function(e){return P.removeNodeFromMap(e)}))},has:function(e){return P.map.hasOwnProperty(e)}};var R=function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e){var t=this,n=this.indexes.get(e.parentId),r=this.indexes.get(e.id),i=function(e){t.removeIdSet.add(e);var n=P.getNode(e);null==n||n.childNodes.forEach((function(e){"__sn"in e&&i(e.__sn.id)}))},o=function(n){t.removeIdSet.add(n.id),Object.values(n.children).forEach((function(e){return o(e)}));var r=t.indexes.get(n.id);if(r){var i=r.parent;i&&(delete r.parent,delete i.children[r.id],t.indexes.delete(e.id))}};r?n?(delete r.parent,delete n.children[r.id],this.indexes.delete(e.id),o(r)):(delete this.tree[r.id],this.indexes.delete(r.id),o(r)):(this.removeNodeMutations.push(e),i(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,n,i,o=this,a=this.tree,s=this.removeNodeMutations,l=this.textMutations,c=this.attributeMutations,u={source:y.Mutation,removes:s,texts:l,attributes:c,adds:[]},d=function(e,t){t&&o.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter((function(e){return!o.removeIdSet.has(e.id)})),u.attributes=u.attributes.concat(t?[]:e.attributes).filter((function(e){return!o.removeIdSet.has(e.id)})),o.removeIdSet.has(e.id)||o.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return d(e,!0)})):(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return d(e,!1)})))};Object.values(a).forEach((function(e){return d(e,!1)}));try{for(var f=r(this.scrollMap.keys()),p=f.next();!p.done;p=f.next()){var h=p.value;this.removeIdSet.has(h)&&this.scrollMap.delete(h)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var m=r(this.inputMap.keys()),v=m.next();!v.done;v=m.next()){h=v.value;this.removeIdSet.has(h)&&this.inputMap.delete(h)}}catch(e){n={error:e}}finally{try{v&&!v.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}var g=new Map(this.scrollMap),b=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:g,inputMap:b}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e}();function j(e){var t,n,i={},o=function(e,t){var n={value:e,parent:t,children:[]};return i[e.node.id]=n,n},a=[];try{for(var s=r(e),l=s.next();!l.done;l=s.next()){var c=l.value,u=c.nextId,d=c.parentId;if(u&&u in i){var f=i[u];if(f.parent){var p=f.parent.children.indexOf(f);f.parent.children.splice(p,0,o(c,f.parent))}else{p=a.indexOf(f);a.splice(p,0,o(c,null))}}else if(d in i){var h=i[d];h.children.push(o(c,h))}else a.push(o(c,null))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}function B(e,t){t(e.value);for(var n=e.children.length-1;n>=0;n--)B(e.children[n],t)}function V(e,t){var i=t.getCastFn,o=t.emitter;return F(D({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:I({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:I((function(e,t){var r=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(r=t.payload.timeOffset),n(n({},e),{timeOffset:r,baselineTime:e.events[0].timestamp+r})})),play:function(e){var t,n,a,s,l;console.warn("play");var c=e.timer,u=e.events,d=e.baselineTime,f=e.lastPlayedEvent;c.clear();try{for(var p=r(u),h=p.next();!h.done;h=p.next()){M(h.value,d)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}var m=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.type===v.Meta&&r.timestamp<=t)return e.slice(n)}return e}(u,d),g=new Array,b=function(e){var t=null==f?void 0:f.timestamp;if((null==f?void 0:f.type)===v.IncrementalSnapshot&&f.data.source===y.MouseMove&&(t=f.timestamp+(null===(l=f.data.positions[0])||void 0===l?void 0:l.timeOffset)),t&&t<d&&(e.timestamp<=t||e===f))return"continue";var n=e.timestamp<d;if(n&&!function(e){switch(e.type){case v.DomContentLoaded:case v.Load:case v.Custom:return!1;case v.FullSnapshot:case v.Meta:return!0}switch(e.data.source){case y.MouseMove:case y.MouseInteraction:case y.TouchMove:case y.MediaInteraction:return!1;case y.ViewportResize:case y.StyleSheetRule:case y.Scroll:case y.Input:return!0}return!0}(e))return"continue";var r=i(e,n);n?r():g.push({doAction:function(){r(),o.emit(S.EventCast,e)},delay:e.delay})};try{for(var x=r(m),w=x.next();!w.done;w=x.next()){b(w.value)}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}o.emit(S.Flush),c.addActions(g),c.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:I((function(e){return n(n({},e),{lastPlayedEvent:null})})),startLive:I({baselineTime:function(e,t){return e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),addEvent:I((function(e,t){var r=e.baselineTime,a=e.timer,s=e.events;if("ADD_EVENT"===t.type){var l=t.payload.event;M(l,r),s.push(l);var c=l.timestamp<r,u=i(l,c);c?u():(a.addAction({doAction:function(){u(),o.emit(S.EventCast,l)},delay:l.delay}),a.isActive()||a.start())}return n(n({},e),{events:s})}))}}))}var U=m||x,W={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"},z={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0},Y=function(){function e(e,n){var o=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=U(),this.legacy_missingNodeRetryMap={},this.imageMap=new Map,!(null==n?void 0:n.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");var a={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:W,logConfig:z};this.config=Object.assign({},a,n),this.config.logConfig.replayLogger||(this.config.logConfig.replayLogger=this.getConsoleLogger()),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.emitter.on(S.Resize,this.handleResize),this.setupDom(),this.treeIndex=new R,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.emitter.on(S.Flush,(function(){var e,n,a,s,l,c,u=o.treeIndex.flush(),d=u.scrollMap,f=u.inputMap;try{for(var p=r(o.fragmentParentMap.entries()),h=p.next();!h.done;h=p.next()){var m=i(h.value,2),v=m[0],y=m[1];P.map[y.__sn.id]=y,y.__sn.type===t.Element&&"textarea"===y.__sn.tagName&&v.textContent&&(y.value=v.textContent),y.appendChild(v),o.restoreState(y)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(e)throw e.error}}o.fragmentParentMap.clear(),o.elementStateMap.clear();try{for(var g=r(d.values()),b=g.next();!b.done;b=g.next()){var S=b.value;o.applyScroll(S)}}catch(e){a={error:e}}finally{try{b&&!b.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}try{for(var x=r(f.values()),w=x.next();!w.done;w=x.next()){S=w.value;o.applyInput(S)}}catch(e){l={error:e}}finally{try{w&&!w.done&&(c=x.return)&&c.call(x)}finally{if(l)throw l.error}}}));var s=new T([],(null==n?void 0:n.speed)||a.speed);this.service=V({events:e.map((function(e){return n&&n.unpackFn?n.unpackFn(e):e})),timer:s,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){o.emitter.emit(S.StateChange,{player:e})})),this.speedService=F(D({id:"speed",context:{normalSpeed:-1,timer:s},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:I({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(e){o.emitter.emit(S.StateChange,{speed:e})}));var l=this.service.state.context.events.find((function(e){return e.type===v.Meta})),c=this.service.state.context.events.find((function(e){return e.type===v.FullSnapshot}));if(l){var u=l.data,d=u.width,f=u.height;setTimeout((function(){o.emitter.emit(S.Resize,{width:d,height:f})}),0)}c&&setTimeout((function(){o.rebuildFullSnapshot(c),o.iframe.contentWindow.scrollTo(c.data.initialOffset)}),1)}return Object.defineProperty(e.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){return this.emitter.on(e,t),this},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach((function(n){t.config[n]=e[n]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))},e.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},e.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},e.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},e.prototype.play=function(e){var t;void 0===e&&(e=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.remove("rrweb-paused"),this.emitter.emit(S.Start)},e.prototype.pause=function(e){var t;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(S.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(S.Resume)},e.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},e.prototype.addEvent=function(e){var t=this,n=this.config.unpackFn?this.config.unpackFn(e):e;Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:n}})}))},e.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},e.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},e.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),!1!==this.config.mouseTail&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");var e,t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(w(this.iframe.contentWindow,this.iframe.contentDocument),void 0===(e=this.iframe.contentWindow)&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach))},e.prototype.handleResize=function(e){var t,n;this.iframe.style.display="inherit";try{for(var i=r([this.mouseTail,this.iframe]),o=i.next();!o.done;o=i.next()){var a=o.value;a&&(a.setAttribute("width",String(e.width)),a.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.getCastFn=function(e,t){var n,i=this;switch(void 0===t&&(t=!1),e.type){case v.DomContentLoaded:case v.Load:break;case v.Custom:n=function(){i.emitter.emit(S.CustomEvent,e)};break;case v.Meta:n=function(){return i.emitter.emit(S.Resize,{width:e.data.width,height:e.data.height})};break;case v.FullSnapshot:n=function(){i.rebuildFullSnapshot(e,t),i.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case v.IncrementalSnapshot:n=function(){var n,o;if(i.applyIncremental(e,t),!t&&(e===i.nextUserInteractionEvent&&(i.nextUserInteractionEvent=null,i.backToNormal()),i.config.skipInactive&&!i.nextUserInteractionEvent)){try{for(var a=r(i.service.state.context.events),s=a.next();!s.done;s=a.next()){var l=s.value;if(!(l.timestamp<=e.timestamp)&&i.isUserInteraction(l)){l.delay-e.delay>1e4*i.speedService.state.context.timer.speed&&(i.nextUserInteractionEvent=l);break}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}if(i.nextUserInteractionEvent){var c=i.nextUserInteractionEvent.delay-e.delay,u={speed:Math.min(Math.round(c/5e3),360)};i.speedService.send({type:"FAST_FORWARD",payload:u}),i.emitter.emit(S.SkipStart,u)}}}}return function(){if(n&&n(),i.service.send({type:"CAST_EVENT",payload:{event:e}}),e===i.service.state.context.events[i.service.state.context.events.length-1]){var t=function(){i.backToNormal(),i.service.send("END"),i.emitter.emit(S.Finish)};e.type===v.IncrementalSnapshot&&e.data.source===y.MouseMove&&e.data.positions.length?setTimeout((function(){t()}),Math.max(0,50-e.data.positions[0].timeOffset)):t()}}},e.prototype.rebuildFullSnapshot=function(e,t){if(void 0===t&&(t=!1),!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={},P.map=h(e.data.node,{doc:this.iframe.contentDocument})[1];var n=document.createElement("style"),r=this.iframe.contentDocument,i=r.documentElement,o=r.head;i.insertBefore(n,o);var a,s=(a=this.config.blockClass,["iframe, ."+a+" { background: #ccc }","noscript { display: none !important; }"]).concat(this.config.insertStyleRules);this.config.pauseAnimation&&s.push("html.rrweb-paused * { animation-play-state: paused !important; }"),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused");for(var l=0;l<s.length;l++)n.sheet.insertRule(s[l],l);this.emitter.emit(S.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},e.prototype.waitForStylesheetLoad=function(){var e,t=this,n=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(n){var r,i=new Set,o=this.service.state,a=function(){o=t.service.state};this.emitter.on(S.Start,a),this.emitter.on(S.Pause,a);var s=function(){t.emitter.off(S.Start,a),t.emitter.off(S.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach((function(e){e.sheet||(i.add(e),e.addEventListener("load",(function(){i.delete(e),0===i.size&&-1!==r&&(o.matches("playing")&&t.play(t.getCurrentTime()),t.emitter.emit(S.LoadStylesheetEnd),r&&window.clearTimeout(r),s())})))})),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(S.LoadStylesheetStart),r=window.setTimeout((function(){o.matches("playing")&&t.play(t.getCurrentTime()),r=-1,s()}),this.config.loadTimeout))}},e.prototype.preloadAllImages=function(){var e,t,n=this,i=this.service.state,o=function(){i=n.service.state};this.emitter.on(S.Start,o),this.emitter.on(S.Pause,o);var a=0,s=0;try{for(var l=r(this.service.state.context.events),c=l.next();!c.done;c=l.next()){var u=c.value;if(u.type===v.IncrementalSnapshot&&u.data.source===y.CanvasMutation&&"drawImage"===u.data.property&&"string"==typeof u.data.args[0]&&!this.imageMap.has(u)){a++;var d=document.createElement("img");d.src=u.data.args[0],this.imageMap.set(u,d),d.onload=function(){++s===a&&(i.matches("playing")&&n.play(n.getCurrentTime()),n.emitter.off(S.Start,o),n.emitter.off(S.Pause,o))}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}a!==s&&this.service.send({type:"PAUSE"})},e.prototype.applyIncremental=function(e,t){var n,r,i=this,o=e.data;switch(o.source){case y.Mutation:t&&(o.adds.forEach((function(e){return i.treeIndex.add(e)})),o.texts.forEach((function(e){return i.treeIndex.text(e)})),o.attributes.forEach((function(e){return i.treeIndex.attribute(e)})),o.removes.forEach((function(e){return i.treeIndex.remove(e)}))),this.applyMutation(o,t);break;case y.MouseMove:if(t){var a=o.positions[o.positions.length-1];this.moveAndHover(o,a.x,a.y,a.id)}else o.positions.forEach((function(t){var n={doAction:function(){i.moveAndHover(o,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-i.service.state.context.baselineTime};i.timer.addAction(n)})),this.timer.addAction({doAction:function(){},delay:e.delay-(null===(n=o.positions[0])||void 0===n?void 0:n.timeOffset)});break;case y.MouseInteraction:if(-1===o.id)break;var s=new Event(g[o.type].toLowerCase());if(!(v=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);this.emitter.emit(S.MouseInteraction,{type:o.type,target:v});var l=this.config.triggerFocus;switch(o.type){case g.Blur:"blur"in v&&v.blur();break;case g.Focus:l&&v.focus&&v.focus({preventScroll:!0});break;case g.Click:case g.TouchStart:case g.TouchEnd:t||(this.moveAndHover(o,o.x,o.y,o.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:v.dispatchEvent(s)}break;case y.Scroll:if(-1===o.id)break;if(t){this.treeIndex.scroll(o);break}this.applyScroll(o);break;case y.ViewportResize:this.emitter.emit(S.Resize,{width:o.width,height:o.height});break;case y.Input:if(-1===o.id)break;if(t){this.treeIndex.input(o);break}this.applyInput(o);break;case y.MediaInteraction:if(!(v=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);var c=v;try{o.type===b.Pause&&c.pause(),o.type===b.Play&&(c.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?c.play():c.addEventListener("canplay",(function(){c.play()})))}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: "+(e.message||e))}break;case y.StyleSheetRule:if(!(v=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);var u=v,d=v.parentNode,f=this.fragmentParentMap.has(d),p=void 0;if(f){var h=this.fragmentParentMap.get(v.parentNode);p=document.createTextNode(""),d.replaceChild(p,v),h.appendChild(v)}var m=u.sheet;o.adds&&o.adds.forEach((function(e){var t=e.rule,n=e.index;try{var r=void 0===n?void 0:Math.min(n,m.rules.length);try{m.insertRule(t,r)}catch(e){}}catch(e){}})),o.removes&&o.removes.forEach((function(e){var t=e.index;try{m.deleteRule(t)}catch(e){}})),f&&p&&d.replaceChild(v,p);break;case y.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var v;if(!(v=P.getNode(o.id)))return this.debugNodeNotFound(o,o.id);try{var x=v.getContext("2d");if(o.setter)return void(x[o.property]=o.args[0]);var w=x[o.property];if("drawImage"===o.property&&"string"==typeof o.args[0]){var E=this.imageMap.get(e);o.args[0]=E,w.apply(x,o.args)}else w.apply(x,o.args)}catch(e){this.warnCanvasMutationFailed(o,o.id,e)}break;case y.Font:try{var T=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);null===(r=this.iframe.contentDocument)||void 0===r||r.fonts.add(T)}catch(e){this.config.showWarning&&console.warn(e)}break;case y.Log:try{var M=e.data,N=this.config.logConfig.replayLogger;"function"==typeof N[M.level]&&N[M.level](M)}catch(e){this.config.showWarning&&console.warn(e)}}},e.prototype.applyMutation=function(e,t){var i,o,a=this;e.removes.forEach((function(t){var n=P.getNode(t.id);if(!n)return a.warnNodeNotFound(e,t.id);var r=P.getNode(t.parentId);if(!r)return a.warnNodeNotFound(e,t.parentId);if(P.removeNodeFromMap(n),r){var i=a.fragmentParentMap.get(r);if(i&&i.contains(n))i.removeChild(n);else if(a.fragmentParentMap.has(n)){var o=a.fragmentParentMap.get(n);r.removeChild(o),a.fragmentParentMap.delete(n)}else r.removeChild(n)}}));var s=n({},this.legacy_missingNodeRetryMap),l=[];var c=function(e){if(!a.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var n=P.getNode(e.parentId);if(!n)return l.push(e);var r=null;if(a.iframe.contentDocument.contains?r=a.iframe.contentDocument.contains(n):a.iframe.contentDocument.body.contains&&(r=a.iframe.contentDocument.body.contains(n)),t&&r){var i=document.createDocumentFragment();for(P.map[e.parentId]=i,a.fragmentParentMap.set(i,n),a.storeState(n);n.firstChild;)i.appendChild(n.firstChild);n=i}var o=null,c=null;if(e.previousId&&(o=P.getNode(e.previousId)),e.nextId&&(c=P.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=P.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return l.push(e);var u=p(e.node,{doc:a.iframe.contentDocument,map:P.map,skipChild:!0,hackCss:!0});-1!==e.previousId&&-1!==e.nextId?(o&&o.nextSibling&&o.nextSibling.parentNode?n.insertBefore(u,o.nextSibling):c&&c.parentNode?n.contains(c)?n.insertBefore(u,c):n.insertBefore(u,null):n.appendChild(u),(e.previousId||e.nextId)&&a.legacy_resolveMissingNode(s,n,u,e)):s[e.node.id]={node:u,mutation:e}};e.adds.forEach((function(e){c(e)}));for(var u=Date.now();l.length;){var d=j(l);if(l.length=0,Date.now()-u>500){this.warn("Timeout in the loop, please check the resolve tree data:",d);break}try{for(var f=(i=void 0,r(d)),h=f.next();!h.done;h=f.next()){var m=h.value;P.getNode(m.value.parentId)?B(m,(function(e){c(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",m)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}}Object.keys(s).length&&Object.assign(this.legacy_missingNodeRetryMap,s),e.texts.forEach((function(t){var n=P.getNode(t.id);if(!n)return a.warnNodeNotFound(e,t.id);a.fragmentParentMap.has(n)&&(n=a.fragmentParentMap.get(n)),n.textContent=t.value})),e.attributes.forEach((function(t){var n=P.getNode(t.id);if(!n)return a.warnNodeNotFound(e,t.id);for(var r in a.fragmentParentMap.has(n)&&(n=a.fragmentParentMap.get(n)),t.attributes)if("string"==typeof r){var i=t.attributes[r];try{null!==i?n.setAttribute(r,i):n.removeAttribute(r)}catch(e){a.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}}}))},e.prototype.applyScroll=function(e){var t=P.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);if(t===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else try{t.scrollTop=e.y,t.scrollLeft=e.x}catch(e){}},e.prototype.applyInput=function(e){var t=P.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},e.prototype.formatMessage=function(e){if(0===e.trace.length)return"";var t="\n\tat ";return t+=e.trace.join("\n\tat ")},e.prototype.getConsoleLogger=function(){var e,t,n=this,i={},a=function(e){i[e]="trace"===e?function(e){(console.log.__rrweb_original__?console.log.__rrweb_original__:console.log).apply(void 0,o(e.payload.map((function(e){return JSON.parse(e)})),[n.formatMessage(e)]))}:function(t){(console[e].__rrweb_original__?console[e].__rrweb_original__:console[e]).apply(void 0,o(t.payload.map((function(e){return JSON.parse(e)})),[n.formatMessage(t)]))}};try{for(var s=r(this.config.logConfig.level),l=s.next();!l.done;l=s.next()){a(l.value)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return i},e.prototype.legacy_resolveMissingNode=function(e,t,n,r){var i=r.previousId,o=r.nextId,a=i&&e[i],s=o&&e[o];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,r){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px",this.drawMouseTail({x:t,y:n});var i=P.getNode(r);if(!i)return this.debugNodeNotFound(e,r);this.hoverElements(i)},e.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var n=!0===this.config.mouseTail?W:Object.assign({},W,this.config.mouseTail),r=n.lineCap,i=n.lineWidth,o=n.strokeStyle,a=n.duration,s=function(){if(t.mouseTail){var e=t.mouseTail.getContext("2d");e&&t.tailPositions.length&&(e.clearRect(0,0,t.mouseTail.width,t.mouseTail.height),e.beginPath(),e.lineWidth=i,e.lineCap=r,e.strokeStyle=o,e.moveTo(t.tailPositions[0].x,t.tailPositions[0].y),t.tailPositions.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}};this.tailPositions.push(e),s(),setTimeout((function(){t.tailPositions=t.tailPositions.filter((function(t){return t!==e})),s()}),a/this.speedService.state.context.timer.speed)}},e.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var n=e;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement},e.prototype.isUserInteraction=function(e){return e.type===v.IncrementalSnapshot&&(e.data.source>y.Mutation&&e.data.source<=y.Input)},e.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(S.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},e.prototype.storeState=function(e){var t,n;if(e&&e.nodeType===e.ELEMENT_NODE){var i=e;(i.scrollLeft||i.scrollTop)&&this.elementStateMap.set(e,{scroll:[i.scrollLeft,i.scrollTop]});var o=i.children;try{for(var a=r(Array.from(o)),s=a.next();!s.done;s=a.next()){var l=s.value;this.storeState(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}}},e.prototype.restoreState=function(e){var t,n;if(e.nodeType===e.ELEMENT_NODE){var i=e;if(this.elementStateMap.has(e)){var o=this.elementStateMap.get(e);o.scroll&&(i.scrollLeft=o.scroll[0],i.scrollTop=o.scroll[1]),this.elementStateMap.delete(e)}var a=i.children;try{for(var s=r(Array.from(a)),l=s.next();!l.done;l=s.next()){var c=l.value;this.restoreState(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}},e.prototype.warnNodeNotFound=function(e,t){this.warn("Node with id '"+t+"' not found in",e)},e.prototype.warnCanvasMutationFailed=function(e,t,n){this.warn("Has error on update canvas '"+t+"'",e,n)},e.prototype.debugNodeNotFound=function(e,t){this.debug("[replayer]","Node with id '"+t+"' not found in",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,o(["[replayer]"],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,o(["[replayer]"],e))},e}();return e.Replayer=Y,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
***************************************************************************** */!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(M||(M={}));var C={type:"xstate.init"};function _(e){return void 0===e?[]:[].concat(e)}function D(e){return{type:"xstate.assign",assignment:e}}function A(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function k(e){return function(t){return e===t}}function L(e){return"string"==typeof e?{type:e}:e}function O(e,t){return{value:e,context:t,actions:[],changed:!1,matches:k(e)}}function P(e,t){void 0===t&&(t={});var n={config:e,_options:t,initialState:{value:e.initial,actions:_(e.states[e.initial].entry).map((function(e){return A(e,t.actions)})),context:e.context,matches:k(e.initial)},transition:function(t,r){var o,i,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,l=a.context,c=L(r),u=e.states[s];if(u.on){var d=_(u.on[c.type]),f=function(t){if(void 0===t)return{value:O(s,l)};var r="string"==typeof t?{target:t}:t,o=r.target,i=void 0===o?s:o,a=r.actions,d=void 0===a?[]:a,f=r.cond,p=l;if((void 0===f?function(){return!0}:f)(l,c)){var h=e.states[i],m=!1,v=[].concat(u.exit,d,h.entry).filter((function(e){return e})).map((function(e){return A(e,n._options.actions)})).filter((function(e){if("xstate.assign"===e.type){m=!0;var t=Object.assign({},p);return"function"==typeof e.assignment?t=e.assignment(p,c):Object.keys(e.assignment).forEach((function(n){t[n]="function"==typeof e.assignment[n]?e.assignment[n](p,c):e.assignment[n]})),p=t,!1}return!0}));return{value:{value:i,context:p,actions:v,changed:i!==s||v.length>0||m,matches:k(i)}}}};try{for(var p=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(d),h=p.next();!h.done;h=p.next()){var m=f(h.value);if("object"==typeof m)return m.value}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}}return O(s,l)}};return n}var R=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))};function F(e){var t=e.initialState,n=M.NotStarted,r=new Set,o={_machine:e,send:function(o){n===M.Running&&(t=e.transition(t,o),R(t,L(o)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(r){if(r){var i="object"==typeof r?r:{context:e.config.context,value:r};t={value:i.value,actions:[],context:i.context,matches:k(i.value)}}return n=M.Running,R(t,C),o},stop:function(){return n=M.Stopped,r.clear(),o},get state(){return t},get status(){return n}};return o}var j="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.",B={map:{},getId:function(){return console.error(j),-1},getNode:function(){return console.error(j),null},removeNodeFromMap:function(){console.error(j)},has:function(){return console.error(j),!1},reset:function(){console.error(j)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(B=new Proxy(B,{get:function(e,t,n){return"map"===t&&console.error(j),Reflect.get(e,t,n)}}));var V=function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e,t){var n=this,r=this.indexes.get(e.parentId),o=this.indexes.get(e.id),i=function(e){n.removeIdSet.add(e);var r=t.getNode(e);null==r||r.childNodes.forEach((function(e){"__sn"in e&&i(e.__sn.id)}))},a=function(t){n.removeIdSet.add(t.id),Object.values(t.children).forEach((function(e){return a(e)}));var r=n.indexes.get(t.id);if(r){var o=r.parent;o&&(delete r.parent,delete o.children[r.id],n.indexes.delete(e.id))}};o?r?(delete o.parent,delete r.children[o.id],this.indexes.delete(e.id),a(o)):(delete this.tree[o.id],this.indexes.delete(o.id),a(o)):(this.removeNodeMutations.push(e),i(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,n,o,i=this,a=this.tree,s=this.removeNodeMutations,l=this.textMutations,c=this.attributeMutations,u={source:b.Mutation,removes:s,texts:l,attributes:c,adds:[]},d=function(e,t){t&&i.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter((function(e){return!i.removeIdSet.has(e.id)})),u.attributes=u.attributes.concat(t?[]:e.attributes).filter((function(e){return!i.removeIdSet.has(e.id)})),i.removeIdSet.has(e.id)||i.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return d(e,!0)})):(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return d(e,!1)})))};Object.values(a).forEach((function(e){return d(e,!1)}));try{for(var f=r(this.scrollMap.keys()),p=f.next();!p.done;p=f.next()){var h=p.value;this.removeIdSet.has(h)&&this.scrollMap.delete(h)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var m=r(this.inputMap.keys()),v=m.next();!v.done;v=m.next()){h=v.value;this.removeIdSet.has(h)&&this.inputMap.delete(h)}}catch(e){n={error:e}}finally{try{v&&!v.done&&(o=m.return)&&o.call(m)}finally{if(n)throw n.error}}var y=new Map(this.scrollMap),g=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:y,inputMap:g}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e}();function U(e){var t,n,o={},i=function(e,t){var n={value:e,parent:t,children:[]};return o[e.node.id]=n,n},a=[];try{for(var s=r(e),l=s.next();!l.done;l=s.next()){var c=l.value,u=c.nextId,d=c.parentId;if(u&&u in o){var f=o[u];if(f.parent){var p=f.parent.children.indexOf(f);f.parent.children.splice(p,0,i(c,f.parent))}else{p=a.indexOf(f);a.splice(p,0,i(c,null))}}else if(d in o){var h=o[d];h.children.push(i(c,h))}else a.push(i(c,null))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}function W(e,t){t(e.value);for(var n=e.children.length-1;n>=0;n--)W(e.children[n],t)}function z(e){return"__sn"in e&&(e.__sn.type===t.Element&&"iframe"===e.__sn.tagName)}function Y(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}function X(e,t){var o=t.getCastFn,i=t.emitter;return F(P({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:D({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:D((function(e,t){var r=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(r=t.payload.timeOffset),n(n({},e),{timeOffset:r,baselineTime:e.events[0].timestamp+r})})),play:function(e){var t,n,a,s,l,c=e.timer,u=e.events,d=e.baselineTime,f=e.lastPlayedEvent;c.clear();try{for(var p=r(u),h=p.next();!h.done;h=p.next()){I(h.value,d)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}var m=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.type===g.Meta&&r.timestamp<=t)return e.slice(n)}return e}(u,d),v=null==f?void 0:f.timestamp;(null==f?void 0:f.type)===g.IncrementalSnapshot&&f.data.source===b.MouseMove&&(v=f.timestamp+(null===(l=f.data.positions[0])||void 0===l?void 0:l.timeOffset)),d<(v||0)&&i.emit(x.PlayBack);var y=new Array,w=function(e){if(v&&v<d&&(e.timestamp<=v||e===f))return"continue";var t=e.timestamp<d;if(t&&!function(e){switch(e.type){case g.DomContentLoaded:case g.Load:case g.Custom:return!1;case g.FullSnapshot:case g.Meta:return!0}switch(e.data.source){case b.MouseMove:case b.MouseInteraction:case b.TouchMove:case b.MediaInteraction:return!1;case b.ViewportResize:case b.StyleSheetRule:case b.Scroll:case b.Input:return!0}return!0}(e))return"continue";var n=o(e,t);t?n():y.push({doAction:function(){n(),i.emit(x.EventCast,e)},delay:e.delay})};try{for(var S=r(m),E=S.next();!E.done;E=S.next()){w(E.value)}}catch(e){a={error:e}}finally{try{E&&!E.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}i.emit(x.Flush),c.addActions(y),c.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:D((function(e){return n(n({},e),{lastPlayedEvent:null})})),startLive:D({baselineTime:function(e,t){return e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),addEvent:D((function(e,t){var r=e.baselineTime,a=e.timer,s=e.events;if("ADD_EVENT"===t.type){var l=t.payload.event;I(l,r);var c=s.length-1;if(!s[c]||s[c].timestamp<=l.timestamp)s.push(l);else{for(var u=-1,d=0;d<=c;){var f=Math.floor((d+c)/2);s[f].timestamp<=l.timestamp?d=f+1:c=f-1}-1===u&&(u=d),s.splice(u,0,l)}var p=l.timestamp<r,h=o(l,p);p?h():a.isActive()&&a.addAction({doAction:function(){h(),i.emit(x.EventCast,l)},delay:l.delay})}return n(n({},e),{events:s})}))}}))}var Q=y||E,H={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"},G={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],replayLogger:void 0},q=function(){function e(e,t){var n=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=Q(),this.legacy_missingNodeRetryMap={},this.imageMap=new Map,this.mirror={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}},this.firstPlayedEvent=null,this.newDocumentQueue=[],!(null==t?void 0:t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");var o={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:H,logConfig:G};this.config=Object.assign({},o,t),this.config.logConfig.replayLogger||(this.config.logConfig.replayLogger=this.getConsoleLogger()),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.emitter.on(x.Resize,this.handleResize),this.setupDom(),this.treeIndex=new V,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.emitter.on(x.Flush,(function(){var e,t,o,i,a=n.treeIndex.flush(),s=a.scrollMap,l=a.inputMap;n.fragmentParentMap.forEach((function(e,t){return n.restoreRealParent(t,e)})),n.fragmentParentMap.clear(),n.elementStateMap.clear();try{for(var c=r(s.values()),u=c.next();!u.done;u=c.next()){var d=u.value;n.applyScroll(d)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}try{for(var f=r(l.values()),p=f.next();!p.done;p=f.next()){d=p.value;n.applyInput(d)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}})),this.emitter.on(x.PlayBack,(function(){n.firstPlayedEvent=null,n.mirror.reset()}));var i=new N([],(null==t?void 0:t.speed)||o.speed);this.service=X({events:e.map((function(e){return t&&t.unpackFn?t.unpackFn(e):e})).sort((function(e,t){return e.timestamp-t.timestamp})),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){n.emitter.emit(x.StateChange,{player:e})})),this.speedService=F(P({id:"speed",context:{normalSpeed:-1,timer:i},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:D({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(e){n.emitter.emit(x.StateChange,{speed:e})}));var a=this.service.state.context.events.find((function(e){return e.type===g.Meta})),s=this.service.state.context.events.find((function(e){return e.type===g.FullSnapshot}));if(a){var l=a.data,c=l.width,u=l.height;setTimeout((function(){n.emitter.emit(x.Resize,{width:c,height:u})}),0)}s&&setTimeout((function(){n.firstPlayedEvent||(n.firstPlayedEvent=s,n.rebuildFullSnapshot(s),n.iframe.contentWindow.scrollTo(s.data.initialOffset))}),1)}return Object.defineProperty(e.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){return this.emitter.on(e,t),this},e.prototype.off=function(e,t){return this.emitter.off(e,t),this},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach((function(n){t.config[n]=e[n]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))},e.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},e.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},e.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},e.prototype.getMirror=function(){return this.mirror},e.prototype.play=function(e){var t;void 0===e&&(e=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.remove("rrweb-paused"),this.emitter.emit(x.Start)},e.prototype.pause=function(e){var t;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(x.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(x.Resume)},e.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},e.prototype.addEvent=function(e){var t=this,n=this.config.unpackFn?this.config.unpackFn(e):e;Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:n}})}))},e.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},e.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},e.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),!1!==this.config.mouseTail&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");var e,t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(T(this.iframe.contentWindow,this.iframe.contentDocument),void 0===(e=this.iframe.contentWindow)&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1}))},e.prototype.handleResize=function(e){var t,n;this.iframe.style.display="inherit";try{for(var o=r([this.mouseTail,this.iframe]),i=o.next();!i.done;i=o.next()){var a=i.value;a&&(a.setAttribute("width",String(e.width)),a.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},e.prototype.getCastFn=function(e,t){var n,o=this;switch(void 0===t&&(t=!1),e.type){case g.DomContentLoaded:case g.Load:break;case g.Custom:n=function(){o.emitter.emit(x.CustomEvent,e)};break;case g.Meta:n=function(){return o.emitter.emit(x.Resize,{width:e.data.width,height:e.data.height})};break;case g.FullSnapshot:n=function(){o.firstPlayedEvent&&o.firstPlayedEvent===e||(o.rebuildFullSnapshot(e,t),o.iframe.contentWindow.scrollTo(e.data.initialOffset))};break;case g.IncrementalSnapshot:n=function(){var n,i;if(o.applyIncremental(e,t),!t&&(e===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.backToNormal()),o.config.skipInactive&&!o.nextUserInteractionEvent)){try{for(var a=r(o.service.state.context.events),s=a.next();!s.done;s=a.next()){var l=s.value;if(!(l.timestamp<=e.timestamp)&&o.isUserInteraction(l)){l.delay-e.delay>1e4*o.speedService.state.context.timer.speed&&(o.nextUserInteractionEvent=l);break}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}if(o.nextUserInteractionEvent){var c=o.nextUserInteractionEvent.delay-e.delay,u={speed:Math.min(Math.round(c/5e3),o.config.maxSpeed)};o.speedService.send({type:"FAST_FORWARD",payload:u}),o.emitter.emit(x.SkipStart,u)}}}}return function(){if(n&&n(),o.service.send({type:"CAST_EVENT",payload:{event:e}}),e===o.service.state.context.events[o.service.state.context.events.length-1]){var t=function(){o.backToNormal(),o.service.send("END"),o.emitter.emit(x.Finish)};e.type===g.IncrementalSnapshot&&e.data.source===b.MouseMove&&e.data.positions.length?setTimeout((function(){t()}),Math.max(0,50-e.data.positions[0].timeOffset)):t()}}},e.prototype.rebuildFullSnapshot=function(e,t){var n,o,i=this;if(void 0===t&&(t=!1),!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};var a=[];this.mirror.map=v(e.data.node,{doc:this.iframe.contentDocument,afterAppend:function(e){i.collectIframeAndAttachDocument(a,e)}})[1];var s=function(e,t){if(l.attachDocumentToIframe(e,t),l.newDocumentQueue=l.newDocumentQueue.filter((function(t){return t!==e})),t.contentDocument){var n=t.contentDocument,r=n.documentElement,o=n.head;l.insertStyleRules(r,o)}},l=this;try{for(var c=r(a),u=c.next();!u.done;u=c.next()){var d=u.value;s(d.mutationInQueue,d.builtNode)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}var f=this.iframe.contentDocument,p=f.documentElement,h=f.head;this.insertStyleRules(p,h),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(x.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},e.prototype.insertStyleRules=function(e,t){var n=document.createElement("style");e.insertBefore(n,t);var r,o=(r=this.config.blockClass,["."+r+" { background: #ccc }","noscript { display: none !important; }"]).concat(this.config.insertStyleRules);this.config.pauseAnimation&&o.push("html.rrweb-paused * { animation-play-state: paused !important; }");for(var i=0;i<o.length;i++)n.sheet.insertRule(o[i],i)},e.prototype.attachDocumentToIframe=function(e,t){var n,o,i=this,a=[];if(!t.contentDocument)for(var s=t.parentNode;s;){if(this.fragmentParentMap.has(s)){var l=s,c=this.fragmentParentMap.get(l);this.restoreRealParent(l,c);break}s=s.parentNode}m(e.node,{doc:t.contentDocument,map:this.mirror.map,hackCss:!0,skipChild:!1,afterAppend:function(e){i.collectIframeAndAttachDocument(a,e)}});var u=function(e,t){if(d.attachDocumentToIframe(e,t),d.newDocumentQueue=d.newDocumentQueue.filter((function(t){return t!==e})),t.contentDocument){var n=t.contentDocument,r=n.documentElement,o=n.head;d.insertStyleRules(r,o)}},d=this;try{for(var f=r(a),p=f.next();!p.done;p=f.next()){var h=p.value;u(h.mutationInQueue,h.builtNode)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}},e.prototype.collectIframeAndAttachDocument=function(e,t){if(z(t)){var n=this.newDocumentQueue.find((function(e){return e.parentId===t.__sn.id}));n&&e.push({mutationInQueue:n,builtNode:t})}},e.prototype.waitForStylesheetLoad=function(){var e,t=this,n=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(n){var r,o=new Set,i=this.service.state,a=function(){i=t.service.state};this.emitter.on(x.Start,a),this.emitter.on(x.Pause,a);var s=function(){t.emitter.off(x.Start,a),t.emitter.off(x.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach((function(e){e.sheet||(o.add(e),e.addEventListener("load",(function(){o.delete(e),0===o.size&&-1!==r&&(i.matches("playing")&&t.play(t.getCurrentTime()),t.emitter.emit(x.LoadStylesheetEnd),r&&window.clearTimeout(r),s())})))})),o.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(x.LoadStylesheetStart),r=window.setTimeout((function(){i.matches("playing")&&t.play(t.getCurrentTime()),r=-1,s()}),this.config.loadTimeout))}},e.prototype.preloadAllImages=function(){var e,t,n=this,o=(this.service.state,function(){n.service.state});this.emitter.on(x.Start,o),this.emitter.on(x.Pause,o);var i=0;try{for(var a=r(this.service.state.context.events),s=a.next();!s.done;s=a.next()){var l=s.value;if(l.type===g.IncrementalSnapshot&&l.data.source===b.CanvasMutation&&"drawImage"===l.data.property&&"string"==typeof l.data.args[0]&&!this.imageMap.has(l)){i++;var c=document.createElement("canvas"),u=c.getContext("2d"),d=null==u?void 0:u.createImageData(c.width,c.height);null==d||d.data;JSON.parse(l.data.args[0]),null==u||u.putImageData(d,0,0)}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}0!==i&&this.service.send({type:"PAUSE"})},e.prototype.applyIncremental=function(e,t){var n,r,o=this,i=e.data;switch(i.source){case b.Mutation:t&&(i.adds.forEach((function(e){return o.treeIndex.add(e)})),i.texts.forEach((function(e){return o.treeIndex.text(e)})),i.attributes.forEach((function(e){return o.treeIndex.attribute(e)})),i.removes.forEach((function(e){return o.treeIndex.remove(e,o.mirror)}))),this.applyMutation(i,t);break;case b.Drag:case b.TouchMove:case b.MouseMove:if(t){var a=i.positions[i.positions.length-1];this.moveAndHover(i,a.x,a.y,a.id)}else i.positions.forEach((function(t){var n={doAction:function(){o.moveAndHover(i,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-o.service.state.context.baselineTime};o.timer.addAction(n)})),this.timer.addAction({doAction:function(){},delay:e.delay-(null===(n=i.positions[0])||void 0===n?void 0:n.timeOffset)});break;case b.MouseInteraction:if(-1===i.id)break;var s=new Event(w[i.type].toLowerCase());if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);this.emitter.emit(x.MouseInteraction,{type:i.type,target:v});var l=this.config.triggerFocus;switch(i.type){case w.Blur:"blur"in v&&v.blur();break;case w.Focus:l&&v.focus&&v.focus({preventScroll:!0});break;case w.Click:case w.TouchStart:case w.TouchEnd:t||(this.moveAndHover(i,i.x,i.y,i.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:v.dispatchEvent(s)}break;case b.Scroll:if(-1===i.id)break;if(t){this.treeIndex.scroll(i);break}this.applyScroll(i);break;case b.ViewportResize:this.emitter.emit(x.Resize,{width:i.width,height:i.height});break;case b.Input:if(-1===i.id)break;if(t){this.treeIndex.input(i);break}this.applyInput(i);break;case b.MediaInteraction:if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);var c=v;try{i.type===S.Pause&&c.pause(),i.type===S.Play&&(c.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?c.play():c.addEventListener("canplay",(function(){c.play()})))}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: "+(e.message||e))}break;case b.StyleSheetRule:if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);var u=v,d=v.parentNode,f=this.fragmentParentMap.has(d),p=void 0;if(f){var h=this.fragmentParentMap.get(v.parentNode);p=document.createTextNode(""),d.replaceChild(p,v),h.appendChild(v)}var m=u.sheet;i.adds&&i.adds.forEach((function(e){var t=e.rule,n=e.index;try{var r=void 0===n?void 0:Math.min(n,m.rules.length);try{m.insertRule(t,r)}catch(e){}}catch(e){}})),i.removes&&i.removes.forEach((function(e){var t=e.index;try{m.deleteRule(t)}catch(e){}})),f&&p&&d.replaceChild(v,p);break;case b.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var v;if(!(v=this.mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);try{var y=v.getContext("2d");if(i.setter)return void(y[i.property]=i.args[0]);var g=y[i.property];if("drawImage"===i.property&&"string"==typeof i.args[0]){var E=this.imageMap.get(e);i.args[0]=E,g.apply(y,i.args)}else g.apply(y,i.args)}catch(e){this.warnCanvasMutationFailed(i,i.id,e)}break;case b.Font:try{var T=new FontFace(i.family,i.buffer?new Uint8Array(JSON.parse(i.fontSource)):i.fontSource,i.descriptors);null===(r=this.iframe.contentDocument)||void 0===r||r.fonts.add(T)}catch(e){this.config.showWarning&&console.warn(e)}break;case b.Log:try{var M=e.data,N=this.config.logConfig.replayLogger;"function"==typeof N[M.level]&&N[M.level](M)}catch(e){this.config.showWarning&&console.warn(e)}}},e.prototype.applyMutation=function(e,o){var i,a,s=this;e.removes.forEach((function(t){var n=s.mirror.getNode(t.id);if(!n)return s.warnNodeNotFound(e,t.id);var r=s.mirror.getNode(t.parentId);if(!r)return s.warnNodeNotFound(e,t.parentId);if(t.isShadow&&Y(r)&&(r=r.shadowRoot),s.mirror.removeNodeFromMap(n),r){var o="__sn"in r?s.fragmentParentMap.get(r):void 0;if(o&&o.contains(n))o.removeChild(n);else if(s.fragmentParentMap.has(n)){var i=s.fragmentParentMap.get(n);r.removeChild(i),s.fragmentParentMap.delete(n)}else r.removeChild(n)}}));var l=n({},this.legacy_missingNodeRetryMap),c=[],u=function(e){var n,r;if(!s.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var i=s.mirror.getNode(e.parentId);if(!i)return e.node.type===t.Document?s.newDocumentQueue.push(e):c.push(e);var a=null;s.iframe.contentDocument.contains?a=s.iframe.contentDocument.contains(i):s.iframe.contentDocument.body.contains&&(a=s.iframe.contentDocument.body.contains(i));var u=(null===(r=(n=i).getElementsByTagName)||void 0===r?void 0:r.call(n,"iframe").length)>0;if(o&&a&&!z(i)&&!u){var d=document.createDocumentFragment();for(s.mirror.map[e.parentId]=d,s.fragmentParentMap.set(d,i),s.storeState(i);i.firstChild;)d.appendChild(i.firstChild);i=d}e.node.isShadow&&Y(i)&&(i=i.shadowRoot);var f=null,p=null;if(e.previousId&&(f=s.mirror.getNode(e.previousId)),e.nextId&&(p=s.mirror.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=s.mirror.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return c.push(e);if(!e.node.rootId||s.mirror.getNode(e.node.rootId)){var h=e.node.rootId?s.mirror.getNode(e.node.rootId):s.iframe.contentDocument;if(z(i))s.attachDocumentToIframe(e,i);else{var v=m(e.node,{doc:h,map:s.mirror.map,skipChild:!0,hackCss:!0});if(-1!==e.previousId&&-1!==e.nextId){if(f&&f.nextSibling&&f.nextSibling.parentNode)i.insertBefore(v,f.nextSibling);else if(p&&p.parentNode)i.contains(p)?i.insertBefore(v,p):i.insertBefore(v,null);else{if(i===h)for(;h.firstChild;)h.removeChild(h.firstChild);i.appendChild(v)}if(z(v)){var y=s.newDocumentQueue.find((function(e){return e.parentId===v.__sn.id}));if(y&&(s.attachDocumentToIframe(y,v),s.newDocumentQueue=s.newDocumentQueue.filter((function(e){return e!==y}))),v.contentDocument){var g=v.contentDocument,b=g.documentElement,w=g.head;s.insertStyleRules(b,w)}}(e.previousId||e.nextId)&&s.legacy_resolveMissingNode(l,i,v,e)}else l[e.node.id]={node:v,mutation:e}}}};e.adds.forEach((function(e){u(e)}));for(var d=Date.now();c.length;){var f=U(c);if(c.length=0,Date.now()-d>500){this.warn("Timeout in the loop, please check the resolve tree data:",f);break}try{for(var p=(i=void 0,r(f)),h=p.next();!h.done;h=p.next()){var v=h.value;this.mirror.getNode(v.value.parentId)?W(v,(function(e){u(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",v)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}}Object.keys(l).length&&Object.assign(this.legacy_missingNodeRetryMap,l),e.texts.forEach((function(t){var n=s.mirror.getNode(t.id);if(!n)return s.warnNodeNotFound(e,t.id);s.fragmentParentMap.has(n)&&(n=s.fragmentParentMap.get(n)),n.textContent=t.value})),e.attributes.forEach((function(t){var n=s.mirror.getNode(t.id);if(!n)return s.warnNodeNotFound(e,t.id);for(var r in s.fragmentParentMap.has(n)&&(n=s.fragmentParentMap.get(n)),t.attributes)if("string"==typeof r){var o=t.attributes[r];try{null!==o?n.setAttribute(r,o):n.removeAttribute(r)}catch(e){s.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}}}))},e.prototype.applyScroll=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);if(t===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else try{t.scrollTop=e.y,t.scrollLeft=e.x}catch(e){}},e.prototype.applyInput=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},e.prototype.formatMessage=function(e){if(0===e.trace.length)return"";var t="\n\tat ";return t+=e.trace.join("\n\tat ")},e.prototype.getConsoleLogger=function(){var e,t,n=this,o={},a=function(e){o[e]="trace"===e?function(e){(console.log.__rrweb_original__?console.log.__rrweb_original__:console.log).apply(void 0,i(e.payload.map((function(e){return JSON.parse(e)})),[n.formatMessage(e)]))}:function(t){(console[e].__rrweb_original__?console[e].__rrweb_original__:console[e]).apply(void 0,i(t.payload.map((function(e){return JSON.parse(e)})),[n.formatMessage(t)]))}};try{for(var s=r(this.config.logConfig.level),l=s.next();!l.done;l=s.next()){a(l.value)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return o},e.prototype.legacy_resolveMissingNode=function(e,t,n,r){var o=r.previousId,i=r.nextId,a=o&&e[o],s=i&&e[i];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,r){var o=this.mirror.getNode(r);if(!o)return this.debugNodeNotFound(e,r);var i=function e(t,n){var r,o,i=null===(o=null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===o?void 0:o.frameElement;if(!i||i===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};var a=i.getBoundingClientRect(),s=e(i,n),l=a.height/i.clientHeight;return{x:a.x*s.relativeScale+s.x,y:a.y*s.relativeScale+s.y,relativeScale:l,absoluteScale:s.absoluteScale*l}}(o,this.iframe),a=t*i.absoluteScale+i.x,s=n*i.absoluteScale+i.y;this.mouse.style.left=a+"px",this.mouse.style.top=s+"px",this.drawMouseTail({x:a,y:s}),this.hoverElements(o)},e.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var n=!0===this.config.mouseTail?H:Object.assign({},H,this.config.mouseTail),r=n.lineCap,o=n.lineWidth,i=n.strokeStyle,a=n.duration,s=function(){if(t.mouseTail){var e=t.mouseTail.getContext("2d");e&&t.tailPositions.length&&(e.clearRect(0,0,t.mouseTail.width,t.mouseTail.height),e.beginPath(),e.lineWidth=o,e.lineCap=r,e.strokeStyle=i,e.moveTo(t.tailPositions[0].x,t.tailPositions[0].y),t.tailPositions.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}};this.tailPositions.push(e),s(),setTimeout((function(){t.tailPositions=t.tailPositions.filter((function(t){return t!==e})),s()}),a/this.speedService.state.context.timer.speed)}},e.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var n=e;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement},e.prototype.isUserInteraction=function(e){return e.type===g.IncrementalSnapshot&&(e.data.source>b.Mutation&&e.data.source<=b.Input)},e.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(x.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},e.prototype.restoreRealParent=function(e,n){this.mirror.map[n.__sn.id]=n,n.__sn.type===t.Element&&"textarea"===n.__sn.tagName&&e.textContent&&(n.value=e.textContent),n.appendChild(e),this.restoreState(n)},e.prototype.storeState=function(e){var t,n;if(e&&e.nodeType===e.ELEMENT_NODE){var o=e;(o.scrollLeft||o.scrollTop)&&this.elementStateMap.set(e,{scroll:[o.scrollLeft,o.scrollTop]});var i=o.children;try{for(var a=r(Array.from(i)),s=a.next();!s.done;s=a.next()){var l=s.value;this.storeState(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}}},e.prototype.restoreState=function(e){var t,n;if(e.nodeType===e.ELEMENT_NODE){var o=e;if(this.elementStateMap.has(e)){var i=this.elementStateMap.get(e);i.scroll&&(o.scrollLeft=i.scroll[0],o.scrollTop=i.scroll[1]),this.elementStateMap.delete(e)}var a=o.children;try{for(var s=r(Array.from(a)),l=s.next();!l.done;l=s.next()){var c=l.value;this.restoreState(c)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}},e.prototype.warnNodeNotFound=function(e,t){this.warn("Node with id '"+t+"' not found in",e)},e.prototype.warnCanvasMutationFailed=function(e,t,n){this.warn("Has error on update canvas '"+t+"'",e,n)},e.prototype.debugNodeNotFound=function(e,t){this.debug("[replayer]","Node with id '"+t+"' not found in",e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,i(["[replayer]"],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,i(["[replayer]"],e))},e}();return e.Replayer=q,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
//# sourceMappingURL=rrweb-replay.min.js.map
export { EventType, IncrementalSource, MouseInteractions, ReplayerEvents } from '../types.js';
import * as utils from '../utils.js';
export { utils };
export { mirror } from '../utils.js';
export { _mirror as mirror } from '../utils.js';
export { default as record } from '../record/index.js';

@@ -6,0 +6,0 @@ export { Replayer } from '../replay/index.js';

@@ -1,3 +0,4 @@

import '../../node_modules/rrweb-snapshot/es/rrweb-snapshot.js';
import '../../ext/rrweb-snapshot/es/rrweb-snapshot.js';
import '../types.js';
import '../utils.js';
export { pack } from '../packer/pack.js';
export { EventType, IncrementalSource, MouseInteractions, ReplayerEvents } from './types.js';
import * as utils from './utils.js';
export { utils };
export { mirror } from './utils.js';
export { _mirror as mirror } from './utils.js';
import record from './record/index.js';

@@ -6,0 +6,0 @@ export { default as record } from './record/index.js';

@@ -1,3 +0,3 @@

import { __assign } from '../../node_modules/tslib/tslib.es6.js';
import { strFromU8, zlibSync, strToU8 } from '../../node_modules/fflate/esm/browser.js';
import { __assign } from '../../ext/tslib/tslib.es6.js';
import { strFromU8, zlibSync, strToU8 } from '../../ext/fflate/esm/browser.js';
import { MARK } from './base.js';

@@ -4,0 +4,0 @@

@@ -1,2 +0,2 @@

import { strFromU8, unzlibSync, strToU8 } from '../../node_modules/fflate/esm/browser.js';
import { strFromU8, unzlibSync, strToU8 } from '../../ext/fflate/esm/browser.js';
import { MARK } from './base.js';

@@ -3,0 +3,0 @@

@@ -1,6 +0,8 @@

import { __assign, __read } from '../../node_modules/tslib/tslib.es6.js';
import { snapshot } from '../../node_modules/rrweb-snapshot/es/rrweb-snapshot.js';
import { __assign, __read } from '../../ext/tslib/tslib.es6.js';
import { snapshot } from '../../ext/rrweb-snapshot/es/rrweb-snapshot.js';
import { EventType, IncrementalSource } from '../types.js';
import { polyfill, on, getWindowWidth, getWindowHeight, mirror } from '../utils.js';
import { initObservers, mutationBuffer } from './observer.js';
import { polyfill, on, createMirror, getWindowWidth, getWindowHeight, isIframeINode, hasShadowRoot } from '../utils.js';
import { initObservers, mutationBuffers } from './observer.js';
import { IframeManager } from './iframe-manager.js';
import { ShadowDomManager } from './shadow-dom-manager.js';

@@ -11,5 +13,7 @@ function wrapEvent(e) {

var wrappedEmit;
var takeFullSnapshot;
var mirror = createMirror();
function record(options) {
if (options === void 0) { options = {}; }
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth, _a = options.blockClass, blockClass = _a === void 0 ? 'rr-block' : _a, _b = options.blockSelector, blockSelector = _b === void 0 ? null : _b, _c = options.ignoreClass, ignoreClass = _c === void 0 ? 'rr-ignore' : _c, _d = options.inlineStylesheet, inlineStylesheet = _d === void 0 ? true : _d, maskAllInputs = options.maskAllInputs, _maskInputOptions = options.maskInputOptions, _slimDOMOptions = options.slimDOMOptions, maskInputFn = options.maskInputFn, hooks = options.hooks, packFn = options.packFn, _e = options.sampling, sampling = _e === void 0 ? {} : _e, mousemoveWait = options.mousemoveWait, _f = options.recordCanvas, recordCanvas = _f === void 0 ? false : _f, _g = options.collectFonts, collectFonts = _g === void 0 ? false : _g, _h = options.recordLog, recordLog = _h === void 0 ? false : _h;
var emit = options.emit, checkoutEveryNms = options.checkoutEveryNms, checkoutEveryNth = options.checkoutEveryNth, _a = options.blockClass, blockClass = _a === void 0 ? 'rr-block' : _a, _b = options.blockSelector, blockSelector = _b === void 0 ? null : _b, _c = options.ignoreClass, ignoreClass = _c === void 0 ? 'rr-ignore' : _c, _d = options.maskTextClass, maskTextClass = _d === void 0 ? 'rr-mask' : _d, _e = options.maskTextSelector, maskTextSelector = _e === void 0 ? null : _e, _f = options.inlineStylesheet, inlineStylesheet = _f === void 0 ? true : _f, maskAllInputs = options.maskAllInputs, _maskInputOptions = options.maskInputOptions, _slimDOMOptions = options.slimDOMOptions, maskInputFn = options.maskInputFn, maskTextFn = options.maskTextFn, hooks = options.hooks, packFn = options.packFn, _g = options.sampling, sampling = _g === void 0 ? {} : _g, mousemoveWait = options.mousemoveWait, _h = options.recordCanvas, recordCanvas = _h === void 0 ? false : _h, _j = options.collectFonts, collectFonts = _j === void 0 ? false : _j, _k = options.recordLog, recordLog = _k === void 0 ? false : _k;
if (!emit) {

@@ -92,8 +96,8 @@ throw new Error('emit function is required');

wrappedEmit = function (e, isCheckout) {
if (mutationBuffer.isFrozen() &&
var _a;
if (((_a = mutationBuffers[0]) === null || _a === void 0 ? void 0 : _a.isFrozen()) &&
e.type !== EventType.FullSnapshot &&
!(e.type === EventType.IncrementalSnapshot &&
e.data.source === IncrementalSource.Mutation)) {
mutationBuffer.emit();
mutationBuffer.unfreeze();
mutationBuffers.forEach(function (buf) { return buf.unfreeze(); });
}

@@ -106,2 +110,6 @@ emit((packFn ? packFn(e) : e), isCheckout);

else if (e.type === EventType.IncrementalSnapshot) {
if (e.data.source === IncrementalSource.Mutation &&
e.data.isAttachIframe) {
return;
}
incrementalSnapshotCount++;

@@ -116,3 +124,36 @@ var exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;

};
function takeFullSnapshot(isCheckout) {
var wrappedMutationEmit = function (m) {
wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,
data: __assign({ source: IncrementalSource.Mutation }, m),
}));
};
var wrappedScrollEmit = function (p) {
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,
data: __assign({ source: IncrementalSource.Scroll }, p),
}));
};
var iframeManager = new IframeManager({
mutationCb: wrappedMutationEmit,
});
var shadowDomManager = new ShadowDomManager({
mutationCb: wrappedMutationEmit,
scrollCb: wrappedScrollEmit,
bypassOptions: {
blockClass: blockClass,
blockSelector: blockSelector,
maskTextClass: maskTextClass,
maskTextSelector: maskTextSelector,
inlineStylesheet: inlineStylesheet,
maskInputOptions: maskInputOptions,
maskTextFn: maskTextFn,
recordCanvas: recordCanvas,
sampling: sampling,
slimDOMOptions: slimDOMOptions,
iframeManager: iframeManager,
},
mirror: mirror,
});
takeFullSnapshot = function (isCheckout) {
var _a, _b, _c, _d;

@@ -128,11 +169,24 @@ if (isCheckout === void 0) { isCheckout = false; }

}), isCheckout);
var wasFrozen = mutationBuffer.isFrozen();
mutationBuffer.freeze();
mutationBuffers.forEach(function (buf) { return buf.lock(); });
var _e = __read(snapshot(document, {
blockClass: blockClass,
blockSelector: blockSelector,
maskTextClass: maskTextClass,
maskTextSelector: maskTextSelector,
inlineStylesheet: inlineStylesheet,
maskAllInputs: maskInputOptions,
maskTextFn: maskTextFn,
slimDOM: slimDOMOptions,
recordCanvas: recordCanvas,
onSerialize: function (n) {
if (isIframeINode(n)) {
iframeManager.addIframe(n);
}
if (hasShadowRoot(n)) {
shadowDomManager.addShadowRoot(n.shadowRoot, document);
}
},
onIframeLoad: function (iframe, childSn) {
iframeManager.attachIframe(iframe, childSn);
},
}), 2), node = _e[0], idNodeMap = _e[1];

@@ -159,7 +213,4 @@ if (!node) {

}));
if (!wasFrozen) {
mutationBuffer.emit();
mutationBuffer.unfreeze();
}
}
mutationBuffers.forEach(function (buf) { return buf.unlock(); });
};
try {

@@ -173,11 +224,5 @@ var handlers_1 = [];

}));
var init_1 = function () {
takeFullSnapshot();
handlers_1.push(initObservers({
mutationCb: function (m) {
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,
data: __assign({ source: IncrementalSource.Mutation }, m),
}));
},
var observe_1 = function (doc) {
return initObservers({
mutationCb: wrappedMutationEmit,
mousemoveCb: function (positions, source) {

@@ -198,8 +243,3 @@ return wrappedEmit(wrapEvent({

},
scrollCb: function (p) {
return wrappedEmit(wrapEvent({
type: EventType.IncrementalSnapshot,
data: __assign({ source: IncrementalSource.Scroll }, p),
}));
},
scrollCb: wrappedScrollEmit,
viewportResizeCb: function (d) {

@@ -248,6 +288,6 @@ return wrappedEmit(wrapEvent({

blockClass: blockClass,
blockSelector: blockSelector,
ignoreClass: ignoreClass,
maskTextClass: maskTextClass,
maskTextSelector: maskTextSelector,
maskInputOptions: maskInputOptions,
maskInputFn: maskInputFn,
inlineStylesheet: inlineStylesheet,

@@ -257,6 +297,20 @@ sampling: sampling,

collectFonts: collectFonts,
doc: doc,
maskInputFn: maskInputFn,
maskTextFn: maskTextFn,
logOptions: logOptions,
blockSelector: blockSelector,
slimDOMOptions: slimDOMOptions,
logOptions: logOptions,
}, hooks));
mirror: mirror,
iframeManager: iframeManager,
shadowDomManager: shadowDomManager,
}, hooks);
};
iframeManager.addLoadListener(function (iframeEl) {
handlers_1.push(observe_1(iframeEl.contentDocument));
});
var init_1 = function () {
takeFullSnapshot();
handlers_1.push(observe_1(document));
};
if (document.readyState === 'interactive' ||

@@ -296,5 +350,12 @@ document.readyState === 'complete') {

record.freezePage = function () {
mutationBuffer.freeze();
mutationBuffers.forEach(function (buf) { return buf.freeze(); });
};
record.takeFullSnapshot = function (isCheckout) {
if (!takeFullSnapshot) {
throw new Error('please take full snapshot after start recording');
}
takeFullSnapshot(isCheckout);
};
record.mirror = mirror;
export default record;

@@ -1,4 +0,4 @@

import { __values } from '../../node_modules/tslib/tslib.es6.js';
import { transformAttribute, IGNORED_NODE, serializeNodeWithId } from '../../node_modules/rrweb-snapshot/es/rrweb-snapshot.js';
import { mirror, isIgnored, isBlocked, isAncestorRemoved } from '../utils.js';
import { __values } from '../../ext/tslib/tslib.es6.js';
import { isShadowRoot, transformAttribute, needMaskingText, IGNORED_NODE, serializeNodeWithId } from '../../ext/rrweb-snapshot/es/rrweb-snapshot.js';
import { isIgnored, isBlocked, isAncestorRemoved, isIframeINode, hasShadowRoot } from '../utils.js';

@@ -39,3 +39,5 @@ function isNodeInLinkedList(n) {

}
else if (n.nextSibling && isNodeInLinkedList(n.nextSibling)) {
else if (n.nextSibling &&
isNodeInLinkedList(n.nextSibling) &&
n.nextSibling.__ln.previous) {
var current = n.nextSibling.__ln.previous;

@@ -90,2 +92,3 @@ node.previous = current;

this.frozen = false;
this.locked = false;
this.texts = [];

@@ -101,8 +104,9 @@ this.attributes = [];

mutations.forEach(_this.processMutation);
if (!_this.frozen) {
_this.emit();
}
_this.emit();
};
this.emit = function () {
var e_1, _a, e_2, _b;
if (_this.frozen || _this.locked) {
return;
}
var adds = [];

@@ -115,3 +119,3 @@ var addList = new DoubleLinkedList();

ns = ns && ns.nextSibling;
nextId = ns && mirror.getId(ns);
nextId = ns && _this.mirror.getId(ns);
}

@@ -124,6 +128,12 @@ if (nextId === -1 && isBlocked(n.nextSibling, _this.blockClass)) {

var pushAdd = function (n) {
if (!n.parentNode || !document.contains(n)) {
var _a;
var shadowHost = n.getRootNode
? (_a = n.getRootNode()) === null || _a === void 0 ? void 0 : _a.host : null;
var notInDoc = !_this.doc.contains(n) && !_this.doc.contains(shadowHost);
if (!n.parentNode || notInDoc) {
return;
}
var parentId = mirror.getId(n.parentNode);
var parentId = isShadowRoot(n.parentNode)
? _this.mirror.getId(shadowHost)
: _this.mirror.getId(n.parentNode);
var nextId = getNextId(n);

@@ -134,11 +144,25 @@ if (parentId === -1 || nextId === -1) {

var sn = serializeNodeWithId(n, {
doc: document,
map: mirror.map,
doc: _this.doc,
map: _this.mirror.map,
blockClass: _this.blockClass,
blockSelector: _this.blockSelector,
maskTextClass: _this.maskTextClass,
maskTextSelector: _this.maskTextSelector,
skipChild: true,
inlineStylesheet: _this.inlineStylesheet,
maskInputOptions: _this.maskInputOptions,
maskTextFn: _this.maskTextFn,
slimDOMOptions: _this.slimDOMOptions,
recordCanvas: _this.recordCanvas,
onSerialize: function (currentN) {
if (isIframeINode(currentN)) {
_this.iframeManager.addIframe(currentN);
}
if (hasShadowRoot(n)) {
_this.shadowDomManager.addShadowRoot(n.shadowRoot, document);
}
},
onIframeLoad: function (iframe, childSn) {
_this.iframeManager.attachIframe(iframe, childSn);
},
});

@@ -154,3 +178,3 @@ if (sn) {

while (_this.mapRemoves.length) {
mirror.removeNodeFromMap(_this.mapRemoves.shift());
_this.mirror.removeNodeFromMap(_this.mapRemoves.shift());
}

@@ -160,3 +184,3 @@ try {

var n = _d.value;
if (isParentRemoved(_this.removes, n) &&
if (isParentRemoved(_this.removes, n, _this.mirror) &&
!_this.movedSet.has(n.parentNode)) {

@@ -179,3 +203,3 @@ continue;

if (!isAncestorInSet(_this.droppedSet, n) &&
!isParentRemoved(_this.removes, n)) {
!isParentRemoved(_this.removes, n, _this.mirror)) {
pushAdd(n);

@@ -202,3 +226,3 @@ }

if (candidate) {
var parentId = mirror.getId(candidate.value.parentNode);
var parentId = _this.mirror.getId(candidate.value.parentNode);
var nextId = getNextId(candidate.value);

@@ -212,3 +236,3 @@ if (parentId !== -1 && nextId !== -1) {

var _node = addList.get(index);
var parentId = mirror.getId(_node.value.parentNode);
var parentId = _this.mirror.getId(_node.value.parentNode);
var nextId = getNextId(_node.value);

@@ -234,12 +258,12 @@ if (parentId !== -1 && nextId !== -1) {

.map(function (text) { return ({
id: mirror.getId(text.node),
id: _this.mirror.getId(text.node),
value: text.value,
}); })
.filter(function (text) { return mirror.has(text.id); }),
.filter(function (text) { return _this.mirror.has(text.id); }),
attributes: _this.attributes
.map(function (attribute) { return ({
id: mirror.getId(attribute.node),
id: _this.mirror.getId(attribute.node),
attributes: attribute.attributes,
}); })
.filter(function (attribute) { return mirror.has(attribute.id); }),
.filter(function (attribute) { return _this.mirror.has(attribute.id); }),
removes: _this.removes,

@@ -272,3 +296,7 @@ adds: adds,

_this.texts.push({
value: value,
value: needMaskingText(m.target, _this.maskTextClass, _this.maskTextSelector) && value
? _this.maskTextFn
? _this.maskTextFn(value)
: value.replace(/[\S]/g, '*')
: value,
node: m.target,

@@ -292,3 +320,3 @@ });

}
item.attributes[m.attributeName] = transformAttribute(document, m.attributeName, value);
item.attributes[m.attributeName] = transformAttribute(_this.doc, m.target.tagName, m.attributeName, value);
break;

@@ -299,4 +327,6 @@ }

m.removedNodes.forEach(function (n) {
var nodeId = mirror.getId(n);
var parentId = mirror.getId(m.target);
var nodeId = _this.mirror.getId(n);
var parentId = isShadowRoot(m.target)
? _this.mirror.getId(m.target.host)
: _this.mirror.getId(m.target);
if (isBlocked(n, _this.blockClass) ||

@@ -312,3 +342,3 @@ isBlocked(m.target, _this.blockClass) ||

else if (_this.addedSet.has(m.target) && nodeId === -1) ;
else if (isAncestorRemoved(m.target)) ;
else if (isAncestorRemoved(m.target, _this.mirror)) ;
else if (_this.movedSet.has(n) &&

@@ -322,2 +352,3 @@ _this.movedMap[moveKey(nodeId, parentId)]) {

id: nodeId,
isShadow: isShadowRoot(m.target) ? true : undefined,
});

@@ -358,10 +389,17 @@ }

}
MutationBuffer.prototype.init = function (cb, blockClass, blockSelector, inlineStylesheet, maskInputOptions, recordCanvas, slimDOMOptions) {
MutationBuffer.prototype.init = function (cb, blockClass, blockSelector, maskTextClass, maskTextSelector, inlineStylesheet, maskInputOptions, maskTextFn, recordCanvas, slimDOMOptions, doc, mirror, iframeManager, shadowDomManager) {
this.blockClass = blockClass;
this.blockSelector = blockSelector;
this.maskTextClass = maskTextClass;
this.maskTextSelector = maskTextSelector;
this.inlineStylesheet = inlineStylesheet;
this.maskInputOptions = maskInputOptions;
this.maskTextFn = maskTextFn;
this.recordCanvas = recordCanvas;
this.slimDOMOptions = slimDOMOptions;
this.emissionCallback = cb;
this.doc = doc;
this.mirror = mirror;
this.iframeManager = iframeManager;
this.shadowDomManager = shadowDomManager;
};

@@ -373,2 +411,3 @@ MutationBuffer.prototype.freeze = function () {

this.frozen = false;
this.emit();
};

@@ -378,2 +417,9 @@ MutationBuffer.prototype.isFrozen = function () {

};
MutationBuffer.prototype.lock = function () {
this.locked = true;
};
MutationBuffer.prototype.unlock = function () {
this.locked = false;
this.emit();
};
return MutationBuffer;

@@ -385,3 +431,3 @@ }());

}
function isParentRemoved(removes, n) {
function isParentRemoved(removes, n, mirror) {
var parentNode = n.parentNode;

@@ -395,3 +441,3 @@ if (!parentNode) {

}
return isParentRemoved(removes, parentNode);
return isParentRemoved(removes, parentNode, mirror);
}

@@ -398,0 +444,0 @@ function isAncestorInSet(set, n) {

@@ -1,12 +0,41 @@

import { __spread, __values, __assign } from '../../node_modules/tslib/tslib.es6.js';
import { __spread, __values, __assign } from '../../ext/tslib/tslib.es6.js';
import { IncrementalSource, MouseInteractions, MediaInteractions } from '../types.js';
import { on, throttle, isTouchEvent, mirror, isBlocked, getWindowHeight, getWindowWidth, hookSetter, patch } from '../utils.js';
import { on, throttle, isTouchEvent, isBlocked, getWindowHeight, getWindowWidth, hookSetter, patch } from '../utils.js';
import MutationBuffer from './mutation.js';
import { stringify } from './stringify.js';
import { ErrorStackParser } from './error-stack-parser.js';
var mutationBuffer = new MutationBuffer();
function initMutationObserver(cb, blockClass, blockSelector, inlineStylesheet, maskInputOptions, recordCanvas, slimDOMOptions) {
mutationBuffer.init(cb, blockClass, blockSelector, inlineStylesheet, maskInputOptions, recordCanvas, slimDOMOptions);
var observer = new MutationObserver(mutationBuffer.processMutations.bind(mutationBuffer));
observer.observe(document, {
var mutationBuffers = [];
function getEventTarget(event) {
try {
if ('composedPath' in event) {
var path = event.composedPath();
if (path.length) {
return path[0];
}
}
else if ('path' in event &&
event.path.length) {
return event.path[0];
}
return event.target;
}
catch (_a) {
return event.target;
}
}
function initMutationObserver(cb, doc, blockClass, blockSelector, maskTextClass, maskTextSelector, inlineStylesheet, maskInputOptions, maskTextFn, recordCanvas, slimDOMOptions, mirror, iframeManager, shadowDomManager, rootEl) {
var _a, _b, _c;
var mutationBuffer = new MutationBuffer();
mutationBuffers.push(mutationBuffer);
mutationBuffer.init(cb, blockClass, blockSelector, maskTextClass, maskTextSelector, inlineStylesheet, maskInputOptions, maskTextFn, recordCanvas, slimDOMOptions, doc, mirror, iframeManager, shadowDomManager);
var mutationObserverCtor = window.MutationObserver ||
window.__rrMutationObserver;
var angularZoneSymbol = (_c = (_b = (_a = window) === null || _a === void 0 ? void 0 : _a.Zone) === null || _b === void 0 ? void 0 : _b.__symbol__) === null || _c === void 0 ? void 0 : _c.call(_b, 'MutationObserver');
if (angularZoneSymbol &&
window[angularZoneSymbol]) {
mutationObserverCtor = window[angularZoneSymbol];
}
var observer = new mutationObserverCtor(mutationBuffer.processMutations.bind(mutationBuffer));
observer.observe(rootEl, {
attributes: true,

@@ -21,3 +50,3 @@ attributeOldValue: true,

}
function initMoveObserver(cb, sampling) {
function initMoveObserver(cb, sampling, doc, mirror) {
if (sampling.mousemove === false) {

@@ -27,5 +56,8 @@ return function () { };

var threshold = typeof sampling.mousemove === 'number' ? sampling.mousemove : 50;
var callbackThreshold = typeof sampling.mousemoveCallback === 'number'
? sampling.mousemoveCallback
: 500;
var positions = [];
var timeBaseline;
var wrappedCb = throttle(function (isTouch) {
var wrappedCb = throttle(function (source) {
var totalOffset = Date.now() - timeBaseline;

@@ -35,8 +67,8 @@ cb(positions.map(function (p) {

return p;
}), isTouch ? IncrementalSource.TouchMove : IncrementalSource.MouseMove);
}), source);
positions = [];
timeBaseline = null;
}, 500);
}, callbackThreshold);
var updatePosition = throttle(function (evt) {
var target = evt.target;
var target = getEventTarget(evt);
var _a = isTouchEvent(evt)

@@ -54,3 +86,7 @@ ? evt.changedTouches[0]

});
wrappedCb(isTouchEvent(evt));
wrappedCb(evt instanceof DragEvent
? IncrementalSource.Drag
: evt instanceof MouseEvent
? IncrementalSource.MouseMove
: IncrementalSource.TouchMove);
}, threshold, {

@@ -60,4 +96,5 @@ trailing: false,

var handlers = [
on('mousemove', updatePosition),
on('touchmove', updatePosition),
on('mousemove', updatePosition, doc),
on('touchmove', updatePosition, doc),
on('drag', updatePosition, doc),
];

@@ -68,3 +105,3 @@ return function () {

}
function initMouseInteractionObserver(cb, blockClass, sampling) {
function initMouseInteractionObserver(cb, doc, mirror, blockClass, sampling) {
if (sampling.mouseInteraction === false) {

@@ -80,9 +117,12 @@ return function () { };

return function (event) {
if (isBlocked(event.target, blockClass)) {
var target = getEventTarget(event);
if (isBlocked(target, blockClass)) {
return;
}
var id = mirror.getId(event.target);
var _a = isTouchEvent(event)
? event.changedTouches[0]
: event, clientX = _a.clientX, clientY = _a.clientY;
var e = isTouchEvent(event) ? event.changedTouches[0] : event;
if (!e) {
return;
}
var id = mirror.getId(target);
var clientX = e.clientX, clientY = e.clientY;
cb({

@@ -105,3 +145,3 @@ type: MouseInteractions[eventKey],

var handler = getHandler(eventKey);
handlers.push(on(eventName, handler));
handlers.push(on(eventName, handler, doc));
});

@@ -112,10 +152,11 @@ return function () {

}
function initScrollObserver(cb, blockClass, sampling) {
function initScrollObserver(cb, doc, mirror, blockClass, sampling) {
var updatePosition = throttle(function (evt) {
if (!evt.target || isBlocked(evt.target, blockClass)) {
var target = getEventTarget(evt);
if (!target || isBlocked(target, blockClass)) {
return;
}
var id = mirror.getId(evt.target);
if (evt.target === document) {
var scrollEl = (document.scrollingElement || document.documentElement);
var id = mirror.getId(target);
if (target === doc) {
var scrollEl = (doc.scrollingElement || doc.documentElement);
cb({

@@ -130,16 +171,16 @@ id: id,

id: id,
x: evt.target.scrollLeft,
y: evt.target.scrollTop,
x: target.scrollLeft,
y: target.scrollTop,
});
}
}, sampling.scroll || 100);
return on('scroll', updatePosition);
return on('scroll', updatePosition, doc);
}
function initViewportResizeObserver(cb) {
var last_h = -1;
var last_w = -1;
var lastH = -1;
var lastW = -1;
var updateDimension = throttle(function () {
var height = getWindowHeight();
var width = getWindowWidth();
if (last_h !== height || last_w != width) {
if (lastH !== height || lastW !== width) {
cb({

@@ -149,4 +190,4 @@ width: Number(width),

});
last_h = height;
last_w = width;
lastH = height;
lastW = width;
}

@@ -158,5 +199,5 @@ }, 200);

var lastInputValueMap = new WeakMap();
function initInputObserver(cb, blockClass, ignoreClass, maskInputOptions, maskInputFn, sampling) {
function initInputObserver(cb, doc, mirror, blockClass, ignoreClass, maskInputOptions, maskInputFn, sampling) {
function eventHandler(event) {
var target = event.target;
var target = getEventTarget(event);
if (!target ||

@@ -190,3 +231,3 @@ !target.tagName ||

if (type === 'radio' && name && isChecked) {
document
doc
.querySelectorAll("input[type=\"radio\"][name=\"" + name + "\"]")

@@ -214,3 +255,3 @@ .forEach(function (el) {

var events = sampling.input === 'last' ? ['change'] : ['input', 'change'];
var handlers = events.map(function (eventName) { return on(eventName, eventHandler); });
var handlers = events.map(function (eventName) { return on(eventName, eventHandler, doc); });
var propertyDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');

@@ -237,3 +278,3 @@ var hookProperties = [

}
function initStyleSheetObserver(cb) {
function initStyleSheetObserver(cb, mirror) {
var insertRule = CSSStyleSheet.prototype.insertRule;

@@ -266,5 +307,5 @@ CSSStyleSheet.prototype.insertRule = function (rule, index) {

}
function initMediaInteractionObserver(mediaInteractionCb, blockClass) {
function initMediaInteractionObserver(mediaInteractionCb, blockClass, mirror) {
var handler = function (type) { return function (event) {
var target = event.target;
var target = getEventTarget(event);
if (!target || isBlocked(target, blockClass)) {

@@ -283,3 +324,3 @@ return;

}
function initCanvasMutationObserver(cb, blockClass) {
function initCanvasMutationObserver(cb, blockClass, mirror) {
var e_1, _a;

@@ -306,3 +347,7 @@ var props = Object.getOwnPropertyNames(CanvasRenderingContext2D.prototype);

recordArgs[0] instanceof HTMLCanvasElement) {
recordArgs[0] = recordArgs[0].toDataURL();
var canvas = recordArgs[0];
var ctx = canvas.getContext('2d');
var imgd = ctx === null || ctx === void 0 ? void 0 : ctx.getImageData(0, 0, canvas.width, canvas.height);
var pix = imgd === null || imgd === void 0 ? void 0 : imgd.data;
recordArgs[0] = JSON.stringify(pix);
}

@@ -394,4 +439,5 @@ }

var logger = logOptions.logger;
if (!logger)
if (!logger) {
return function () { };
}
var logCount = 0;

@@ -402,15 +448,11 @@ var cancelHandlers = [];

var originalOnError_1 = window.onerror;
window.onerror = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
window.onerror = function (msg, file, line, col, error) {
if (originalOnError_1) {
originalOnError_1.apply(_this, [msg, file, line, col, error]);
}
originalOnError_1 && originalOnError_1.apply(_this, args);
var stack = [];
if (args[args.length - 1] instanceof Error)
stack = parseStack(args[args.length - 1].stack, 0);
var payload = [stringify(args[0], logOptions.stringifyOptions)];
var trace = ErrorStackParser.parse(error).map(function (stackFrame) { return stackFrame.toString(); });
var payload = [stringify(msg, logOptions.stringifyOptions)];
cb({
level: 'error',
trace: stack,
trace: trace,
payload: payload,

@@ -440,7 +482,8 @@ });

};
function replace(logger, level) {
function replace(_logger, level) {
var _this = this;
if (!logger[level])
if (!_logger[level]) {
return function () { };
return patch(logger, level, function (original) {
}
return patch(_logger, level, function (original) {
return function () {

@@ -453,3 +496,5 @@ var args = [];

try {
var stack = parseStack(new Error().stack);
var trace = ErrorStackParser.parse(new Error())
.map(function (stackFrame) { return stackFrame.toString(); })
.splice(1);
var payload = args.map(function (s) {

@@ -459,9 +504,10 @@ return stringify(s, logOptions.stringifyOptions);

logCount++;
if (logCount < logOptions.lengthThreshold)
if (logCount < logOptions.lengthThreshold) {
cb({
level: level,
trace: stack,
trace: trace,
payload: payload,
});
else if (logCount === logOptions.lengthThreshold)
}
else if (logCount === logOptions.lengthThreshold) {
cb({

@@ -474,2 +520,3 @@ level: 'warn',

});
}
}

@@ -482,13 +529,2 @@ catch (error) {

}
function parseStack(stack, omitDepth) {
if (omitDepth === void 0) { omitDepth = 1; }
var stacks = [];
if (stack) {
stacks = stack
.split('at')
.splice(1 + omitDepth)
.map(function (s) { return s.trim(); });
}
return stacks;
}
}

@@ -611,12 +647,12 @@ function mergeHooks(o, hooks) {

mergeHooks(o, hooks);
var mutationObserver = initMutationObserver(o.mutationCb, o.blockClass, o.blockSelector, o.inlineStylesheet, o.maskInputOptions, o.recordCanvas, o.slimDOMOptions);
var mousemoveHandler = initMoveObserver(o.mousemoveCb, o.sampling);
var mouseInteractionHandler = initMouseInteractionObserver(o.mouseInteractionCb, o.blockClass, o.sampling);
var scrollHandler = initScrollObserver(o.scrollCb, o.blockClass, o.sampling);
var mutationObserver = initMutationObserver(o.mutationCb, o.doc, o.blockClass, o.blockSelector, o.maskTextClass, o.maskTextSelector, o.inlineStylesheet, o.maskInputOptions, o.maskTextFn, o.recordCanvas, o.slimDOMOptions, o.mirror, o.iframeManager, o.shadowDomManager, o.doc);
var mousemoveHandler = initMoveObserver(o.mousemoveCb, o.sampling, o.doc, o.mirror);
var mouseInteractionHandler = initMouseInteractionObserver(o.mouseInteractionCb, o.doc, o.mirror, o.blockClass, o.sampling);
var scrollHandler = initScrollObserver(o.scrollCb, o.doc, o.mirror, o.blockClass, o.sampling);
var viewportResizeHandler = initViewportResizeObserver(o.viewportResizeCb);
var inputHandler = initInputObserver(o.inputCb, o.blockClass, o.ignoreClass, o.maskInputOptions, o.maskInputFn, o.sampling);
var mediaInteractionHandler = initMediaInteractionObserver(o.mediaInteractionCb, o.blockClass);
var styleSheetObserver = initStyleSheetObserver(o.styleSheetRuleCb);
var inputHandler = initInputObserver(o.inputCb, o.doc, o.mirror, o.blockClass, o.ignoreClass, o.maskInputOptions, o.maskInputFn, o.sampling);
var mediaInteractionHandler = initMediaInteractionObserver(o.mediaInteractionCb, o.blockClass, o.mirror);
var styleSheetObserver = initStyleSheetObserver(o.styleSheetRuleCb, o.mirror);
var canvasMutationObserver = o.recordCanvas
? initCanvasMutationObserver(o.canvasMutationCb, o.blockClass)
? initCanvasMutationObserver(o.canvasMutationCb, o.blockClass, o.mirror)
: function () { };

@@ -642,2 +678,2 @@ var fontObserver = o.collectFonts ? initFontObserver(o.fontCb) : function () { };

export { INPUT_TAGS, initObservers, mutationBuffer };
export { INPUT_TAGS, initMutationObserver, initObservers, initScrollObserver, mutationBuffers };

@@ -8,4 +8,5 @@ function pathToSelector(node) {

var name = node.localName;
if (!name)
if (!name) {
break;
}
name = name.toLowerCase();

@@ -37,3 +38,4 @@ var parent = node.parentElement;

Object.assign(options, stringifyOptions);
var stack = [], keys = [];
var stack = [];
var keys = [];
return JSON.stringify(obj, function (key, value) {

@@ -45,5 +47,6 @@ if (stack.length > 0) {

if (~stack.indexOf(value)) {
if (stack[0] === value)
if (stack[0] === value) {
value = '[Circular ~]';
else
}
else {
value =

@@ -53,8 +56,11 @@ '[Circular ~.' +

']';
}
}
}
else
else {
stack.push(value);
if (value === null || value === undefined)
}
if (value === null || value === undefined) {
return value;
}
if (shouldToString(value)) {

@@ -65,8 +71,10 @@ return toString(value);

var eventResult = {};
for (var key_1 in value) {
var eventValue = value[key_1];
if (Array.isArray(eventValue))
eventResult[key_1] = pathToSelector(eventValue.length ? eventValue[0] : null);
else
eventResult[key_1] = eventValue;
for (var eventKey in value) {
var eventValue = value[eventKey];
if (Array.isArray(eventValue)) {
eventResult[eventKey] = pathToSelector(eventValue.length ? eventValue[0] : null);
}
else {
eventResult[eventKey] = eventValue;
}
}

@@ -76,4 +84,5 @@ return eventResult;

else if (value instanceof Node) {
if (value instanceof HTMLElement)
if (value instanceof HTMLElement) {
return value ? value.outerHTML : '';
}
return value.nodeName;

@@ -83,12 +92,14 @@ }

});
function shouldToString(obj) {
if (typeof obj === 'object' &&
Object.keys(obj).length > options.numOfKeysLimit)
function shouldToString(_obj) {
if (typeof _obj === 'object' &&
Object.keys(_obj).length > options.numOfKeysLimit) {
return true;
if (typeof obj === 'function')
}
if (typeof _obj === 'function') {
return true;
}
return false;
}
function toString(obj) {
var str = obj.toString();
function toString(_obj) {
var str = _obj.toString();
if (options.stringLengthLimit && str.length > options.stringLengthLimit) {

@@ -95,0 +106,0 @@ str = str.slice(0, options.stringLengthLimit) + "...";

@@ -1,7 +0,7 @@

import { __values, __assign, __spread, __read } from '../../node_modules/tslib/tslib.es6.js';
import { rebuild, NodeType, buildNodeWithSN } from '../../node_modules/rrweb-snapshot/es/rrweb-snapshot.js';
import { __values, __assign, __spread } from '../../ext/tslib/tslib.es6.js';
import { rebuild, buildNodeWithSN, NodeType } from '../../ext/rrweb-snapshot/es/rrweb-snapshot.js';
import { ReplayerEvents, EventType, IncrementalSource, MediaInteractions, MouseInteractions } from '../types.js';
import { polyfill as polyfill$1, mirror, queueToResolveTrees, iterateResolveTree, TreeIndex } from '../utils.js';
import * as mitt_es from '../../node_modules/mitt/dist/mitt.es.js';
import mitt$1 from '../../node_modules/mitt/dist/mitt.es.js';
import { polyfill as polyfill$1, isIframeINode, hasShadowRoot, queueToResolveTrees, iterateResolveTree, getBaseDimension, createMirror, TreeIndex } from '../utils.js';
import * as mitt_es from '../../ext/mitt/dist/mitt.es.js';
import mitt$1 from '../../ext/mitt/dist/mitt.es.js';
import { polyfill } from './smoothscroll.js';

@@ -16,2 +16,3 @@ import { Timer } from './timer.js';

var REPLAY_CONSOLE_PREFIX = '[replayer]';
var ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';
var defaultMouseTailConfig = {

@@ -55,2 +56,5 @@ duration: 500,

this.imageMap = new Map();
this.mirror = createMirror();
this.firstPlayedEvent = null;
this.newDocumentQueue = [];
if (!(config === null || config === void 0 ? void 0 : config.liveMode) && events.length < 2) {

@@ -61,2 +65,3 @@ throw new Error('Replayer need at least 2 events.');

speed: 1,
maxSpeed: 360,
root: document.body,

@@ -77,4 +82,5 @@ loadTimeout: 0,

this.config = Object.assign({}, defaultConfig, config);
if (!this.config.logConfig.replayLogger)
if (!this.config.logConfig.replayLogger) {
this.config.logConfig.replayLogger = this.getConsoleLogger();
}
this.handleResize = this.handleResize.bind(this);

@@ -88,15 +94,13 @@ this.getCastFn = this.getCastFn.bind(this);

this.emitter.on(ReplayerEvents.Flush, function () {
var e_1, _a, e_2, _b, e_3, _c;
var _d = _this.treeIndex.flush(), scrollMap = _d.scrollMap, inputMap = _d.inputMap;
var e_1, _a, e_2, _b;
var _c = _this.treeIndex.flush(), scrollMap = _c.scrollMap, inputMap = _c.inputMap;
_this.fragmentParentMap.forEach(function (parent, frag) {
return _this.restoreRealParent(frag, parent);
});
_this.fragmentParentMap.clear();
_this.elementStateMap.clear();
try {
for (var _e = __values(_this.fragmentParentMap.entries()), _f = _e.next(); !_f.done; _f = _e.next()) {
var _g = __read(_f.value, 2), frag = _g[0], parent = _g[1];
mirror.map[parent.__sn.id] = parent;
if (parent.__sn.type === NodeType.Element &&
parent.__sn.tagName === 'textarea' &&
frag.textContent) {
parent.value = frag.textContent;
}
parent.appendChild(frag);
_this.restoreState(parent);
for (var _d = __values(scrollMap.values()), _e = _d.next(); !_e.done; _e = _d.next()) {
var d = _e.value;
_this.applyScroll(d);
}

@@ -107,12 +111,10 @@ }

try {
if (_f && !_f.done && (_a = _e.return)) _a.call(_e);
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
}
finally { if (e_1) throw e_1.error; }
}
_this.fragmentParentMap.clear();
_this.elementStateMap.clear();
try {
for (var _h = __values(scrollMap.values()), _j = _h.next(); !_j.done; _j = _h.next()) {
var d = _j.value;
_this.applyScroll(d);
for (var _f = __values(inputMap.values()), _g = _f.next(); !_g.done; _g = _f.next()) {
var d = _g.value;
_this.applyInput(d);
}

@@ -123,23 +125,15 @@ }

try {
if (_j && !_j.done && (_b = _h.return)) _b.call(_h);
if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
}
finally { if (e_2) throw e_2.error; }
}
try {
for (var _k = __values(inputMap.values()), _l = _k.next(); !_l.done; _l = _k.next()) {
var d = _l.value;
_this.applyInput(d);
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (_l && !_l.done && (_c = _k.return)) _c.call(_k);
}
finally { if (e_3) throw e_3.error; }
}
});
this.emitter.on(ReplayerEvents.PlayBack, function () {
_this.firstPlayedEvent = null;
_this.mirror.reset();
});
var timer = new Timer([], (config === null || config === void 0 ? void 0 : config.speed) || defaultConfig.speed);
this.service = createPlayerService({
events: events.map(function (e) {
events: events
.map(function (e) {
if (config && config.unpackFn) {

@@ -149,3 +143,4 @@ return config.unpackFn(e);

return e;
}),
})
.sort(function (a1, a2) { return a1.timestamp - a2.timestamp; }),
timer: timer,

@@ -188,2 +183,6 @@ timeOffset: 0,

setTimeout(function () {
if (_this.firstPlayedEvent) {
return;
}
_this.firstPlayedEvent = firstFullsnapshot;
_this.rebuildFullSnapshot(firstFullsnapshot);

@@ -205,2 +204,6 @@ _this.iframe.contentWindow.scrollTo(firstFullsnapshot.data.initialOffset);

};
Replayer.prototype.off = function (event, handler) {
this.emitter.off(event, handler);
return this;
};
Replayer.prototype.setConfig = function (config) {

@@ -256,2 +259,5 @@ var _this = this;

};
Replayer.prototype.getMirror = function () {
return this.mirror;
};
Replayer.prototype.play = function (timeOffset) {

@@ -336,3 +342,3 @@ var _a;

Replayer.prototype.handleResize = function (dimension) {
var e_4, _a;
var e_3, _a;
this.iframe.style.display = 'inherit';

@@ -349,3 +355,3 @@ try {

}
catch (e_4_1) { e_4 = { error: e_4_1 }; }
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {

@@ -355,3 +361,3 @@ try {

}
finally { if (e_4) throw e_4.error; }
finally { if (e_3) throw e_3.error; }
}

@@ -382,2 +388,5 @@ };

castFn = function () {
if (_this.firstPlayedEvent && _this.firstPlayedEvent === event) {
return;
}
_this.rebuildFullSnapshot(event, isSync);

@@ -389,3 +398,3 @@ _this.iframe.contentWindow.scrollTo(event.data.initialOffset);

castFn = function () {
var e_5, _a;
var e_4, _a;
_this.applyIncremental(event, isSync);

@@ -416,3 +425,3 @@ if (isSync) {

}
catch (e_5_1) { e_5 = { error: e_5_1 }; }
catch (e_4_1) { e_4 = { error: e_4_1 }; }
finally {

@@ -422,3 +431,3 @@ try {

}
finally { if (e_5) throw e_5.error; }
finally { if (e_4) throw e_4.error; }
}

@@ -428,3 +437,3 @@ if (_this.nextUserInteractionEvent) {

var payload = {
speed: Math.min(Math.round(skipTime / SKIP_TIME_INTERVAL), 360),
speed: Math.min(Math.round(skipTime / SKIP_TIME_INTERVAL), _this.config.maxSpeed),
};

@@ -465,2 +474,4 @@ _this.speedService.send({ type: 'FAST_FORWARD', payload: payload });

Replayer.prototype.rebuildFullSnapshot = function (event, isSync) {
var e_5, _a;
var _this = this;
if (isSync === void 0) { isSync = false; }

@@ -474,12 +485,33 @@ if (!this.iframe.contentDocument) {

this.legacy_missingNodeRetryMap = {};
mirror.map = rebuild(event.data.node, {
var collected = [];
this.mirror.map = rebuild(event.data.node, {
doc: this.iframe.contentDocument,
afterAppend: function (builtNode) {
_this.collectIframeAndAttachDocument(collected, builtNode);
},
})[1];
var styleEl = document.createElement('style');
var _a = this.iframe.contentDocument, documentElement = _a.documentElement, head = _a.head;
documentElement.insertBefore(styleEl, head);
var injectStylesRules = rules(this.config.blockClass).concat(this.config.insertStyleRules);
if (this.config.pauseAnimation) {
injectStylesRules.push('html.rrweb-paused * { animation-play-state: paused !important; }');
var _loop_1 = function (mutationInQueue, builtNode) {
this_1.attachDocumentToIframe(mutationInQueue, builtNode);
this_1.newDocumentQueue = this_1.newDocumentQueue.filter(function (m) { return m !== mutationInQueue; });
if (builtNode.contentDocument) {
var _a = builtNode.contentDocument, documentElement_1 = _a.documentElement, head_1 = _a.head;
this_1.insertStyleRules(documentElement_1, head_1);
}
};
var this_1 = this;
try {
for (var collected_1 = __values(collected), collected_1_1 = collected_1.next(); !collected_1_1.done; collected_1_1 = collected_1.next()) {
var _b = collected_1_1.value, mutationInQueue = _b.mutationInQueue, builtNode = _b.builtNode;
_loop_1(mutationInQueue, builtNode);
}
}
catch (e_5_1) { e_5 = { error: e_5_1 }; }
finally {
try {
if (collected_1_1 && !collected_1_1.done && (_a = collected_1.return)) _a.call(collected_1);
}
finally { if (e_5) throw e_5.error; }
}
var _c = this.iframe.contentDocument, documentElement = _c.documentElement, head = _c.head;
this.insertStyleRules(documentElement, head);
if (!this.service.state.matches('playing')) {

@@ -490,5 +522,2 @@ this.iframe.contentDocument

}
for (var idx = 0; idx < injectStylesRules.length; idx++) {
styleEl.sheet.insertRule(injectStylesRules[idx], idx);
}
this.emitter.emit(ReplayerEvents.FullsnapshotRebuilded, event);

@@ -502,2 +531,69 @@ if (!isSync) {

};
Replayer.prototype.insertStyleRules = function (documentElement, head) {
var styleEl = document.createElement('style');
documentElement.insertBefore(styleEl, head);
var injectStylesRules = rules(this.config.blockClass).concat(this.config.insertStyleRules);
if (this.config.pauseAnimation) {
injectStylesRules.push('html.rrweb-paused * { animation-play-state: paused !important; }');
}
for (var idx = 0; idx < injectStylesRules.length; idx++) {
styleEl.sheet.insertRule(injectStylesRules[idx], idx);
}
};
Replayer.prototype.attachDocumentToIframe = function (mutation, iframeEl) {
var e_6, _a;
var _this = this;
var collected = [];
if (!iframeEl.contentDocument) {
var parent = iframeEl.parentNode;
while (parent) {
if (this.fragmentParentMap.has(parent)) {
var frag = parent;
var realParent = this.fragmentParentMap.get(frag);
this.restoreRealParent(frag, realParent);
break;
}
parent = parent.parentNode;
}
}
buildNodeWithSN(mutation.node, {
doc: iframeEl.contentDocument,
map: this.mirror.map,
hackCss: true,
skipChild: false,
afterAppend: function (builtNode) {
_this.collectIframeAndAttachDocument(collected, builtNode);
},
});
var _loop_2 = function (mutationInQueue, builtNode) {
this_2.attachDocumentToIframe(mutationInQueue, builtNode);
this_2.newDocumentQueue = this_2.newDocumentQueue.filter(function (m) { return m !== mutationInQueue; });
if (builtNode.contentDocument) {
var _a = builtNode.contentDocument, documentElement = _a.documentElement, head = _a.head;
this_2.insertStyleRules(documentElement, head);
}
};
var this_2 = this;
try {
for (var collected_2 = __values(collected), collected_2_1 = collected_2.next(); !collected_2_1.done; collected_2_1 = collected_2.next()) {
var _b = collected_2_1.value, mutationInQueue = _b.mutationInQueue, builtNode = _b.builtNode;
_loop_2(mutationInQueue, builtNode);
}
}
catch (e_6_1) { e_6 = { error: e_6_1 }; }
finally {
try {
if (collected_2_1 && !collected_2_1.done && (_a = collected_2.return)) _a.call(collected_2);
}
finally { if (e_6) throw e_6.error; }
}
};
Replayer.prototype.collectIframeAndAttachDocument = function (collected, builtNode) {
if (isIframeINode(builtNode)) {
var mutationInQueue = this.newDocumentQueue.find(function (m) { return m.parentId === builtNode.__sn.id; });
if (mutationInQueue) {
collected.push({ mutationInQueue: mutationInQueue, builtNode: builtNode });
}
}
};
Replayer.prototype.waitForStylesheetLoad = function () {

@@ -554,3 +650,3 @@ var _this = this;

Replayer.prototype.preloadAllImages = function () {
var e_6, _a;
var e_7, _a;
var _this = this;

@@ -563,6 +659,2 @@ var beforeLoadState = this.service.state;

this.emitter.on(ReplayerEvents.Pause, stateHandler);
var unsubscribe = function () {
_this.emitter.off(ReplayerEvents.Start, stateHandler);
_this.emitter.off(ReplayerEvents.Pause, stateHandler);
};
var count = 0;

@@ -579,18 +671,12 @@ var resolved = 0;

count++;
var image = document.createElement('img');
image.src = event.data.args[0];
this.imageMap.set(event, image);
image.onload = function () {
resolved++;
if (resolved === count) {
if (beforeLoadState.matches('playing')) {
_this.play(_this.getCurrentTime());
}
unsubscribe();
}
};
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
var imgd = ctx === null || ctx === void 0 ? void 0 : ctx.createImageData(canvas.width, canvas.height);
var d = imgd === null || imgd === void 0 ? void 0 : imgd.data;
d = JSON.parse(event.data.args[0]);
ctx === null || ctx === void 0 ? void 0 : ctx.putImageData(imgd, 0, 0);
}
}
}
catch (e_6_1) { e_6 = { error: e_6_1 }; }
catch (e_7_1) { e_7 = { error: e_7_1 }; }
finally {

@@ -600,3 +686,3 @@ try {

}
finally { if (e_6) throw e_6.error; }
finally { if (e_7) throw e_7.error; }
}

@@ -617,3 +703,3 @@ if (count !== resolved) {

d.attributes.forEach(function (m) { return _this.treeIndex.attribute(m); });
d.removes.forEach(function (m) { return _this.treeIndex.remove(m); });
d.removes.forEach(function (m) { return _this.treeIndex.remove(m, _this.mirror); });
}

@@ -623,2 +709,4 @@ this.applyMutation(d, isSync);

}
case IncrementalSource.Drag:
case IncrementalSource.TouchMove:
case IncrementalSource.MouseMove:

@@ -652,3 +740,3 @@ if (isSync) {

var event = new Event(MouseInteractions[d.type].toLowerCase());
var target = mirror.getNode(d.id);
var target = this.mirror.getNode(d.id);
if (!target) {

@@ -719,3 +807,3 @@ return this.debugNodeNotFound(d, d.id);

case IncrementalSource.MediaInteraction: {
var target = mirror.getNode(d.id);
var target = this.mirror.getNode(d.id);
if (!target) {

@@ -748,3 +836,3 @@ return this.debugNodeNotFound(d, d.id);

case IncrementalSource.StyleSheetRule: {
var target = mirror.getNode(d.id);
var target = this.mirror.getNode(d.id);
if (!target) {

@@ -800,3 +888,3 @@ return this.debugNodeNotFound(d, d.id);

}
var target = mirror.getNode(d.id);
var target = this.mirror.getNode(d.id);
if (!target) {

@@ -842,4 +930,5 @@ return this.debugNodeNotFound(d, d.id);

var replayLogger = this.config.logConfig.replayLogger;
if (typeof replayLogger[logData_1.level] === 'function')
if (typeof replayLogger[logData_1.level] === 'function') {
replayLogger[logData_1.level](logData_1);
}
}

@@ -855,16 +944,19 @@ catch (error) {

Replayer.prototype.applyMutation = function (d, useVirtualParent) {
var e_7, _a;
var e_8, _a;
var _this = this;
d.removes.forEach(function (mutation) {
var target = mirror.getNode(mutation.id);
var target = _this.mirror.getNode(mutation.id);
if (!target) {
return _this.warnNodeNotFound(d, mutation.id);
}
var parent = mirror.getNode(mutation.parentId);
var parent = _this.mirror.getNode(mutation.parentId);
if (!parent) {
return _this.warnNodeNotFound(d, mutation.parentId);
}
mirror.removeNodeFromMap(target);
if (mutation.isShadow && hasShadowRoot(parent)) {
parent = parent.shadowRoot;
}
_this.mirror.removeNodeFromMap(target);
if (parent) {
var realParent = _this.fragmentParentMap.get(parent);
var realParent = '__sn' in parent ? _this.fragmentParentMap.get(parent) : undefined;
if (realParent && realParent.contains(target)) {

@@ -885,6 +977,6 @@ realParent.removeChild(target);

var queue = [];
function nextNotInDOM(mutation) {
var nextNotInDOM = function (mutation) {
var next = null;
if (mutation.nextId) {
next = mirror.getNode(mutation.nextId);
next = _this.mirror.getNode(mutation.nextId);
}

@@ -898,9 +990,13 @@ if (mutation.nextId !== null &&

return false;
}
};
var appendNode = function (mutation) {
var _a, _b;
if (!_this.iframe.contentDocument) {
return console.warn('Looks like your replayer has been destroyed.');
}
var parent = mirror.getNode(mutation.parentId);
var parent = _this.mirror.getNode(mutation.parentId);
if (!parent) {
if (mutation.node.type === NodeType.Document) {
return _this.newDocumentQueue.push(mutation);
}
return queue.push(mutation);

@@ -915,5 +1011,9 @@ }

}
if (useVirtualParent && parentInDocument) {
var hasIframeChild = ((_b = (_a = parent).getElementsByTagName) === null || _b === void 0 ? void 0 : _b.call(_a, 'iframe').length) > 0;
if (useVirtualParent &&
parentInDocument &&
!isIframeINode(parent) &&
!hasIframeChild) {
var virtualParent = document.createDocumentFragment();
mirror.map[mutation.parentId] = virtualParent;
_this.mirror.map[mutation.parentId] = virtualParent;
_this.fragmentParentMap.set(virtualParent, parent);

@@ -926,9 +1026,12 @@ _this.storeState(parent);

}
if (mutation.node.isShadow && hasShadowRoot(parent)) {
parent = parent.shadowRoot;
}
var previous = null;
var next = null;
if (mutation.previousId) {
previous = mirror.getNode(mutation.previousId);
previous = _this.mirror.getNode(mutation.previousId);
}
if (mutation.nextId) {
next = mirror.getNode(mutation.nextId);
next = _this.mirror.getNode(mutation.nextId);
}

@@ -938,5 +1041,15 @@ if (nextNotInDOM(mutation)) {

}
if (mutation.node.rootId && !_this.mirror.getNode(mutation.node.rootId)) {
return;
}
var targetDoc = mutation.node.rootId
? _this.mirror.getNode(mutation.node.rootId)
: _this.iframe.contentDocument;
if (isIframeINode(parent)) {
_this.attachDocumentToIframe(mutation, parent);
return;
}
var target = buildNodeWithSN(mutation.node, {
doc: _this.iframe.contentDocument,
map: mirror.map,
doc: targetDoc,
map: _this.mirror.map,
skipChild: true,

@@ -961,4 +1074,20 @@ hackCss: true,

else {
if (parent === targetDoc) {
while (targetDoc.firstChild) {
targetDoc.removeChild(targetDoc.firstChild);
}
}
parent.appendChild(target);
}
if (isIframeINode(target)) {
var mutationInQueue_1 = _this.newDocumentQueue.find(function (m) { return m.parentId === target.__sn.id; });
if (mutationInQueue_1) {
_this.attachDocumentToIframe(mutationInQueue_1, target);
_this.newDocumentQueue = _this.newDocumentQueue.filter(function (m) { return m !== mutationInQueue_1; });
}
if (target.contentDocument) {
var _c = target.contentDocument, documentElement = _c.documentElement, head = _c.head;
_this.insertStyleRules(documentElement, head);
}
}
if (mutation.previousId || mutation.nextId) {

@@ -980,5 +1109,5 @@ _this.legacy_resolveMissingNode(legacy_missingNodeMap, parent, target, mutation);

try {
for (var resolveTrees_1 = (e_7 = void 0, __values(resolveTrees)), resolveTrees_1_1 = resolveTrees_1.next(); !resolveTrees_1_1.done; resolveTrees_1_1 = resolveTrees_1.next()) {
for (var resolveTrees_1 = (e_8 = void 0, __values(resolveTrees)), resolveTrees_1_1 = resolveTrees_1.next(); !resolveTrees_1_1.done; resolveTrees_1_1 = resolveTrees_1.next()) {
var tree = resolveTrees_1_1.value;
var parent = mirror.getNode(tree.value.parentId);
var parent = this.mirror.getNode(tree.value.parentId);
if (!parent) {

@@ -994,3 +1123,3 @@ this.debug('Drop resolve tree since there is no parent for the root node.', tree);

}
catch (e_7_1) { e_7 = { error: e_7_1 }; }
catch (e_8_1) { e_8 = { error: e_8_1 }; }
finally {

@@ -1000,3 +1129,3 @@ try {

}
finally { if (e_7) throw e_7.error; }
finally { if (e_8) throw e_8.error; }
}

@@ -1008,3 +1137,3 @@ }

d.texts.forEach(function (mutation) {
var target = mirror.getNode(mutation.id);
var target = _this.mirror.getNode(mutation.id);
if (!target) {

@@ -1019,3 +1148,3 @@ return _this.warnNodeNotFound(d, mutation.id);

d.attributes.forEach(function (mutation) {
var target = mirror.getNode(mutation.id);
var target = _this.mirror.getNode(mutation.id);
if (!target) {

@@ -1048,3 +1177,3 @@ return _this.warnNodeNotFound(d, mutation.id);

Replayer.prototype.applyScroll = function (d) {
var target = mirror.getNode(d.id);
var target = this.mirror.getNode(d.id);
if (!target) {

@@ -1070,3 +1199,3 @@ return this.debugNodeNotFound(d, d.id);

Replayer.prototype.applyInput = function (d) {
var target = mirror.getNode(d.id);
var target = this.mirror.getNode(d.id);
if (!target) {

@@ -1083,4 +1212,5 @@ return this.debugNodeNotFound(d, d.id);

Replayer.prototype.formatMessage = function (data) {
if (data.trace.length === 0)
if (data.trace.length === 0) {
return '';
}
var stackPrefix = '\n\tat ';

@@ -1092,21 +1222,22 @@ var result = stackPrefix;

Replayer.prototype.getConsoleLogger = function () {
var e_8, _a;
var e_9, _a;
var _this = this;
var rrwebOriginal = '__rrweb_original__';
var replayLogger = {};
var _loop_1 = function (level) {
if (level === 'trace')
var _loop_3 = function (level) {
if (level === 'trace') {
replayLogger[level] = function (data) {
var logger = console.log[rrwebOriginal]
? console.log[rrwebOriginal]
var logger = console.log[ORIGINAL_ATTRIBUTE_NAME]
? console.log[ORIGINAL_ATTRIBUTE_NAME]
: console.log;
logger.apply(void 0, __spread(data.payload.map(function (s) { return JSON.parse(s); }), [_this.formatMessage(data)]));
};
else
}
else {
replayLogger[level] = function (data) {
var logger = console[level][rrwebOriginal]
? console[level][rrwebOriginal]
var logger = console[level][ORIGINAL_ATTRIBUTE_NAME]
? console[level][ORIGINAL_ATTRIBUTE_NAME]
: console[level];
logger.apply(void 0, __spread(data.payload.map(function (s) { return JSON.parse(s); }), [_this.formatMessage(data)]));
};
}
};

@@ -1116,6 +1247,6 @@ try {

var level = _c.value;
_loop_1(level);
_loop_3(level);
}
}
catch (e_8_1) { e_8 = { error: e_8_1 }; }
catch (e_9_1) { e_9 = { error: e_9_1 }; }
finally {

@@ -1125,3 +1256,3 @@ try {

}
finally { if (e_8) throw e_8.error; }
finally { if (e_9) throw e_9.error; }
}

@@ -1154,9 +1285,12 @@ return replayLogger;

Replayer.prototype.moveAndHover = function (d, x, y, id) {
this.mouse.style.left = x + "px";
this.mouse.style.top = y + "px";
this.drawMouseTail({ x: x, y: y });
var target = mirror.getNode(id);
var target = this.mirror.getNode(id);
if (!target) {
return this.debugNodeNotFound(d, id);
}
var base = getBaseDimension(target, this.iframe);
var _x = x * base.absoluteScale + base.x;
var _y = y * base.absoluteScale + base.y;
this.mouse.style.left = _x + "px";
this.mouse.style.top = _y + "px";
this.drawMouseTail({ x: _x, y: _y });
this.hoverElements(target);

@@ -1226,4 +1360,14 @@ };

};
Replayer.prototype.restoreRealParent = function (frag, parent) {
this.mirror.map[parent.__sn.id] = parent;
if (parent.__sn.type === NodeType.Element &&
parent.__sn.tagName === 'textarea' &&
frag.textContent) {
parent.value = frag.textContent;
}
parent.appendChild(frag);
this.restoreState(parent);
};
Replayer.prototype.storeState = function (parent) {
var e_9, _a;
var e_10, _a;
if (parent) {

@@ -1244,3 +1388,3 @@ if (parent.nodeType === parent.ELEMENT_NODE) {

}
catch (e_9_1) { e_9 = { error: e_9_1 }; }
catch (e_10_1) { e_10 = { error: e_10_1 }; }
finally {

@@ -1250,3 +1394,3 @@ try {

}
finally { if (e_9) throw e_9.error; }
finally { if (e_10) throw e_10.error; }
}

@@ -1257,3 +1401,3 @@ }

Replayer.prototype.restoreState = function (parent) {
var e_10, _a;
var e_11, _a;
if (parent.nodeType === parent.ELEMENT_NODE) {

@@ -1276,3 +1420,3 @@ var parentElement = parent;

}
catch (e_10_1) { e_10 = { error: e_10_1 }; }
catch (e_11_1) { e_11 = { error: e_11_1 }; }
finally {

@@ -1282,3 +1426,3 @@ try {

}
finally { if (e_10) throw e_10.error; }
finally { if (e_11) throw e_11.error; }
}

@@ -1285,0 +1429,0 @@ }

@@ -1,6 +0,6 @@

import { __assign, __values } from '../../node_modules/tslib/tslib.es6.js';
import { ReplayerEvents, EventType, IncrementalSource } from '../types.js';
import { __assign, __values } from '../../ext/tslib/tslib.es6.js';
import { EventType, IncrementalSource, ReplayerEvents } from '../types.js';
import { needCastInSyncMode } from '../utils.js';
import { addDelay } from './timer.js';
import { interpret as f, createMachine as c, assign as r } from '../../node_modules/@xstate/fsm/es/index.js';
import { interpret as f, createMachine as c, assign as r } from '../../ext/@xstate/fsm/es/index.js';

@@ -98,3 +98,2 @@ function discardPriorSnapshots(events, baselineTime) {

var _c;
console.warn('play');
var timer = ctx.timer, events = ctx.events, baselineTime = ctx.baselineTime, lastPlayedEvent = ctx.lastPlayedEvent;

@@ -116,10 +115,13 @@ timer.clear();

var neededEvents = discardPriorSnapshots(events, baselineTime);
var lastPlayedTimestamp = lastPlayedEvent === null || lastPlayedEvent === void 0 ? void 0 : lastPlayedEvent.timestamp;
if ((lastPlayedEvent === null || lastPlayedEvent === void 0 ? void 0 : lastPlayedEvent.type) === EventType.IncrementalSnapshot &&
lastPlayedEvent.data.source === IncrementalSource.MouseMove) {
lastPlayedTimestamp =
lastPlayedEvent.timestamp + ((_c = lastPlayedEvent.data.positions[0]) === null || _c === void 0 ? void 0 : _c.timeOffset);
}
if (baselineTime < (lastPlayedTimestamp || 0)) {
emitter.emit(ReplayerEvents.PlayBack);
}
var actions = new Array();
var _loop_1 = function (event) {
var lastPlayedTimestamp = lastPlayedEvent === null || lastPlayedEvent === void 0 ? void 0 : lastPlayedEvent.timestamp;
if ((lastPlayedEvent === null || lastPlayedEvent === void 0 ? void 0 : lastPlayedEvent.type) === EventType.IncrementalSnapshot &&
lastPlayedEvent.data.source === IncrementalSource.MouseMove) {
lastPlayedTimestamp =
lastPlayedEvent.timestamp + ((_c = lastPlayedEvent.data.positions[0]) === null || _c === void 0 ? void 0 : _c.timeOffset);
}
if (lastPlayedTimestamp &&

@@ -187,3 +189,23 @@ lastPlayedTimestamp < baselineTime &&

addDelay(event_1, baselineTime);
events.push(event_1);
var end = events.length - 1;
if (!events[end] || events[end].timestamp <= event_1.timestamp) {
events.push(event_1);
}
else {
var insertionIndex = -1;
var start = 0;
while (start <= end) {
var mid = Math.floor((start + end) / 2);
if (events[mid].timestamp <= event_1.timestamp) {
start = mid + 1;
}
else {
end = mid - 1;
}
}
if (insertionIndex === -1) {
insertionIndex = start;
}
events.splice(insertionIndex, 0, event_1);
}
var isSync = event_1.timestamp < baselineTime;

@@ -194,3 +216,3 @@ var castFn_1 = getCastFn(event_1, isSync);

}
else {
else if (timer.isActive()) {
timer.addAction({

@@ -203,5 +225,2 @@ doAction: function () {

});
if (!timer.isActive()) {
timer.start();
}
}

@@ -208,0 +227,0 @@ }

var rules = function (blockClass) { return [
"iframe, ." + blockClass + " { background: #ccc }",
"." + blockClass + " { background: #ccc }",
'noscript { display: none !important; }',

@@ -4,0 +4,0 @@ ]; };

@@ -1,2 +0,1 @@

import { __spread } from '../../node_modules/tslib/tslib.es6.js';
import { EventType, IncrementalSource } from '../types.js';

@@ -17,7 +16,5 @@

Timer.prototype.addActions = function (actions) {
var _a;
(_a = this.actions).push.apply(_a, __spread(actions));
this.actions = this.actions.concat(actions);
};
Timer.prototype.start = function () {
this.actions.sort(function (a1, a2) { return a1.delay - a2.delay; });
this.timeOffset = 0;

@@ -24,0 +21,0 @@ var lastTimestamp = performance.now();

@@ -24,2 +24,3 @@ var EventType;

IncrementalSource[IncrementalSource["Log"] = 11] = "Log";
IncrementalSource[IncrementalSource["Drag"] = 12] = "Drag";
})(IncrementalSource || (IncrementalSource = {}));

@@ -61,4 +62,5 @@ var MouseInteractions;

ReplayerEvents["StateChange"] = "state-change";
ReplayerEvents["PlayBack"] = "play-back";
})(ReplayerEvents || (ReplayerEvents = {}));
export { EventType, IncrementalSource, MediaInteractions, MouseInteractions, ReplayerEvents };

@@ -1,3 +0,3 @@

import { __values } from '../node_modules/tslib/tslib.es6.js';
import { IGNORED_NODE } from '../node_modules/rrweb-snapshot/es/rrweb-snapshot.js';
import { __values } from '../ext/tslib/tslib.es6.js';
import { IGNORED_NODE, isShadowRoot, NodeType } from '../ext/rrweb-snapshot/es/rrweb-snapshot.js';
import { EventType, IncrementalSource } from './types.js';

@@ -11,26 +11,68 @@

}
var mirror = {
function createMirror() {
return {
map: {},
getId: function (n) {
if (!n.__sn) {
return -1;
}
return n.__sn.id;
},
getNode: function (id) {
return this.map[id] || null;
},
removeNodeFromMap: function (n) {
var _this = this;
var id = n.__sn && n.__sn.id;
delete this.map[id];
if (n.childNodes) {
n.childNodes.forEach(function (child) {
return _this.removeNodeFromMap(child);
});
}
},
has: function (id) {
return this.map.hasOwnProperty(id);
},
reset: function () {
this.map = {};
},
};
}
var DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' +
'\r\n' +
'now you can use replayer.getMirror() to access the mirror instance of a replayer,' +
'\r\n' +
'or you can use record.mirror to access the mirror instance during recording.';
var _mirror = {
map: {},
getId: function (n) {
if (!n.__sn) {
return -1;
}
return n.__sn.id;
getId: function () {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
return -1;
},
getNode: function (id) {
return mirror.map[id] || null;
getNode: function () {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
return null;
},
removeNodeFromMap: function (n) {
var id = n.__sn && n.__sn.id;
delete mirror.map[id];
if (n.childNodes) {
n.childNodes.forEach(function (child) {
return mirror.removeNodeFromMap(child);
});
}
removeNodeFromMap: function () {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
},
has: function (id) {
return mirror.map.hasOwnProperty(id);
has: function () {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
return false;
},
reset: function () {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
},
};
if (typeof window !== 'undefined' && window.Proxy && window.Reflect) {
_mirror = new Proxy(_mirror, {
get: function (target, prop, receiver) {
if (prop === 'map') {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
}
return Reflect.get(target, prop, receiver);
},
});
}
function throttle(func, wait, options) {

@@ -147,3 +189,6 @@ if (options === void 0) { options = {}; }

}
function isAncestorRemoved(target) {
function isAncestorRemoved(target, mirror) {
if (isShadowRoot(target)) {
return false;
}
var id = mirror.getId(target);

@@ -160,3 +205,3 @@ if (!mirror.has(id)) {

}
return isAncestorRemoved(target.parentNode);
return isAncestorRemoved(target.parentNode, mirror);
}

@@ -176,2 +221,15 @@ function isTouchEvent(event) {

}
if (!Node.prototype.contains) {
Node.prototype.contains = function contains(node) {
if (!(0 in arguments)) {
throw new TypeError('1 argument is required');
}
do {
if (this === node) {
return true;
}
} while ((node = node && node.parentNode));
return false;
};
}
}

@@ -224,3 +282,3 @@ function needCastInSyncMode(event) {

};
TreeIndex.prototype.remove = function (mutation) {
TreeIndex.prototype.remove = function (mutation, mirror) {
var _this = this;

@@ -428,3 +486,36 @@ var parentTreeNode = this.indexes.get(mutation.parentId);

}
function isIframeINode(node) {
if ('__sn' in node) {
return (node.__sn.type === NodeType.Element && node.__sn.tagName === 'iframe');
}
return false;
}
function getBaseDimension(node, rootIframe) {
var _a, _b;
var frameElement = (_b = (_a = node.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) === null || _b === void 0 ? void 0 : _b.frameElement;
if (!frameElement || frameElement === rootIframe) {
return {
x: 0,
y: 0,
relativeScale: 1,
absoluteScale: 1,
};
}
var frameDimension = frameElement.getBoundingClientRect();
var frameBaseDimension = getBaseDimension(frameElement, rootIframe);
var relativeScale = frameDimension.height / frameElement.clientHeight;
return {
x: frameDimension.x * frameBaseDimension.relativeScale +
frameBaseDimension.x,
y: frameDimension.y * frameBaseDimension.relativeScale +
frameBaseDimension.y,
relativeScale: relativeScale,
absoluteScale: frameBaseDimension.absoluteScale * relativeScale,
};
}
function hasShadowRoot(n) {
var _a;
return Boolean((_a = n) === null || _a === void 0 ? void 0 : _a.shadowRoot);
}
export { TreeIndex, getWindowHeight, getWindowWidth, hookSetter, isAncestorRemoved, isBlocked, isIgnored, isTouchEvent, iterateResolveTree, mirror, needCastInSyncMode, on, patch, polyfill, queueToResolveTrees, throttle };
export { TreeIndex, _mirror, createMirror, getBaseDimension, getWindowHeight, getWindowWidth, hasShadowRoot, hookSetter, isAncestorRemoved, isBlocked, isIframeINode, isIgnored, isTouchEvent, iterateResolveTree, needCastInSyncMode, on, patch, polyfill, queueToResolveTrees, throttle };

@@ -64,2 +64,3 @@ 'use strict';

IncrementalSource[IncrementalSource["Log"] = 11] = "Log";
IncrementalSource[IncrementalSource["Drag"] = 12] = "Drag";
})(IncrementalSource || (IncrementalSource = {}));

@@ -101,4 +102,42 @@ var MouseInteractions;

ReplayerEvents["StateChange"] = "state-change";
ReplayerEvents["PlayBack"] = "play-back";
})(ReplayerEvents || (ReplayerEvents = {}));
var DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' +
'\r\n' +
'now you can use replayer.getMirror() to access the mirror instance of a replayer,' +
'\r\n' +
'or you can use record.mirror to access the mirror instance during recording.';
var _mirror = {
map: {},
getId: function () {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
return -1;
},
getNode: function () {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
return null;
},
removeNodeFromMap: function () {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
},
has: function () {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
return false;
},
reset: function () {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
},
};
if (typeof window !== 'undefined' && window.Proxy && window.Reflect) {
_mirror = new Proxy(_mirror, {
get: function (target, prop, receiver) {
if (prop === 'map') {
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
}
return Reflect.get(target, prop, receiver);
},
});
}
// DEFLATE is a complex format; to read this code, you should probably check the RFC first:

@@ -105,0 +144,0 @@

{
"name": "rrweb",
"version": "0.9.14",
"version": "1.0.0-beta.0",
"description": "record and replay the web",
"scripts": {
"prepare": "npm run prepack",
"prepack": "npm run bundle",
"test": "npm run bundle:browser && cross-env TS_NODE_CACHE=false TS_NODE_FILES=true mocha -r ts-node/register test/**/*.test.ts",

@@ -42,3 +44,3 @@ "test:watch": "PUPPETEER_HEADLESS=true npm run test -- --watch --watch-extensions js,ts",

"@types/node": "^10.11.7",
"@types/puppeteer": "^1.11.1",
"@types/puppeteer": "^5.4.3",
"chai": "^4.2.0",

@@ -49,3 +51,4 @@ "cross-env": "^5.2.0",

"mocha": "^5.2.0",
"puppeteer": "^1.11.0",
"prettier": "2.2.1",
"puppeteer": "^9.1.1",
"rollup": "^2.3.3",

@@ -55,2 +58,3 @@ "rollup-plugin-commonjs": "^9.2.0",

"rollup-plugin-postcss": "^3.1.1",
"rollup-plugin-rename-node-modules": "^1.1.0",
"rollup-plugin-terser": "^5.3.0",

@@ -68,4 +72,4 @@ "rollup-plugin-typescript": "^1.0.0",

"mitt": "^1.1.3",
"rrweb-snapshot": "^1.0.3"
"rrweb-snapshot": "^1.1.4"
}
}

@@ -10,2 +10,4 @@ <p align="center">

**[🚀 Try storyteller, a no-code interactive tutorial builder build with rrweb](https://storyteller.webzard.io/?utm_source=rrweb&utm_medium=github)**
**[The new adventure of the rrweb community](http://www.myriptide.com/rrweb-community/)**

@@ -12,0 +14,0 @@

@@ -10,2 +10,4 @@ <p align="center">

**[🚀 Storyteller, 基于 rrweb 开发的无代码交互式教程编辑器](https://storyteller.webzard.io/?utm_source=rrweb&utm_medium=github)**
**[rrweb 社区新的征程](http://www.myriptide.com/rrweb-community-cn/)**

@@ -12,0 +14,0 @@

import record from './record';
import { Replayer } from './replay';
import { mirror } from './utils';
import { _mirror } from './utils';
import * as utils from './utils';

@@ -8,2 +8,2 @@ export { EventType, IncrementalSource, MouseInteractions, ReplayerEvents, } from './types';

declare const freezePage: () => void;
export { record, addCustomEvent, freezePage, Replayer, mirror, utils };
export { record, addCustomEvent, freezePage, Replayer, _mirror as mirror, utils, };

@@ -6,3 +6,5 @@ import { eventWithTime, recordOptions, listenerHandler } from '../types';

var freezePage: () => void;
var takeFullSnapshot: (isCheckout?: boolean | undefined) => void;
var mirror: import("../types").Mirror;
}
export default record;
import { MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot';
import { mutationRecord, blockClass, mutationCallBack } from '../types';
import { mutationRecord, blockClass, maskTextClass, mutationCallBack, MaskTextFn, Mirror } from '../types';
import { IframeManager } from './iframe-manager';
import { ShadowDomManager } from './shadow-dom-manager';
export default class MutationBuffer {
private frozen;
private locked;
private texts;

@@ -16,10 +19,19 @@ private attributes;

private blockSelector;
private maskTextClass;
private maskTextSelector;
private inlineStylesheet;
private maskInputOptions;
private maskTextFn;
private recordCanvas;
private slimDOMOptions;
init(cb: mutationCallBack, blockClass: blockClass, blockSelector: string | null, inlineStylesheet: boolean, maskInputOptions: MaskInputOptions, recordCanvas: boolean, slimDOMOptions: SlimDOMOptions): void;
private doc;
private mirror;
private iframeManager;
private shadowDomManager;
init(cb: mutationCallBack, blockClass: blockClass, blockSelector: string | null, maskTextClass: maskTextClass, maskTextSelector: string | null, inlineStylesheet: boolean, maskInputOptions: MaskInputOptions, maskTextFn: MaskTextFn | undefined, recordCanvas: boolean, slimDOMOptions: SlimDOMOptions, doc: Document, mirror: Mirror, iframeManager: IframeManager, shadowDomManager: ShadowDomManager): void;
freeze(): void;
unfreeze(): void;
isFrozen(): boolean;
lock(): void;
unlock(): void;
processMutations: (mutations: mutationRecord[]) => void;

@@ -26,0 +38,0 @@ emit: () => void;

@@ -1,5 +0,10 @@

import { observerParam, listenerHandler, hooksParam } from '../types';
import { MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot';
import { mutationCallBack, observerParam, listenerHandler, scrollCallback, blockClass, maskTextClass, hooksParam, SamplingStrategy, MaskTextFn, Mirror } from '../types';
import MutationBuffer from './mutation';
export declare const mutationBuffer: MutationBuffer;
import { IframeManager } from './iframe-manager';
import { ShadowDomManager } from './shadow-dom-manager';
export declare const mutationBuffers: MutationBuffer[];
export declare function initMutationObserver(cb: mutationCallBack, doc: Document, blockClass: blockClass, blockSelector: string | null, maskTextClass: maskTextClass, maskTextSelector: string | null, inlineStylesheet: boolean, maskInputOptions: MaskInputOptions, maskTextFn: MaskTextFn | undefined, recordCanvas: boolean, slimDOMOptions: SlimDOMOptions, mirror: Mirror, iframeManager: IframeManager, shadowDomManager: ShadowDomManager, rootEl: Node): MutationObserver;
export declare function initScrollObserver(cb: scrollCallback, doc: Document, mirror: Mirror, blockClass: blockClass, sampling: SamplingStrategy): listenerHandler;
export declare const INPUT_TAGS: string[];
export declare function initObservers(o: observerParam, hooks?: hooksParam): listenerHandler;
import { Timer } from './timer';
import { createPlayerService, createSpeedService } from './machine';
import { eventWithTime, playerConfig, playerMetaData, Handler } from '../types';
import { eventWithTime, playerConfig, playerMetaData, Handler, Mirror } from '../types';
import './styles/style.css';

@@ -22,4 +22,8 @@ export declare class Replayer {

private imageMap;
private mirror;
private firstPlayedEvent;
private newDocumentQueue;
constructor(events: Array<eventWithTime | string>, config?: Partial<playerConfig>);
on(event: string, handler: Handler): this;
off(event: string, handler: Handler): this;
setConfig(config: Partial<playerConfig>): void;

@@ -29,2 +33,3 @@ getMetaData(): playerMetaData;

getTimeOffset(): number;
getMirror(): Mirror;
play(timeOffset?: number): void;

@@ -41,2 +46,5 @@ pause(timeOffset?: number): void;

private rebuildFullSnapshot;
private insertStyleRules;
private attachDocumentToIframe;
private collectIframeAndAttachDocument;
private waitForStylesheetLoad;

@@ -56,2 +64,3 @@ private preloadAllImages;

private backToNormal;
private restoreRealParent;
private storeState;

@@ -58,0 +67,0 @@ private restoreState;

@@ -1,5 +0,6 @@

/// <reference types="node" />
import { serializedNodeWithId, idNodeMap, INode, MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot';
import { PackFn, UnpackFn } from './packer/base';
import { FontFaceDescriptors } from 'css-font-loading-module';
import { IframeManager } from './record/iframe-manager';
import { ShadowDomManager } from './record/shadow-dom-manager';
export declare enum EventType {

@@ -67,3 +68,4 @@ DomContentLoaded = 0,

Font = 10,
Log = 11
Log = 11,
Drag = 12
}

@@ -74,3 +76,3 @@ export declare type mutationData = {

export declare type mousemoveData = {
source: IncrementalSource.MouseMove | IncrementalSource.TouchMove;
source: IncrementalSource.MouseMove | IncrementalSource.TouchMove | IncrementalSource.Drag;
positions: mousePosition[];

@@ -86,3 +88,3 @@ };

source: IncrementalSource.ViewportResize;
} & viewportResizeDimention;
} & viewportResizeDimension;
export declare type inputData = {

@@ -114,4 +116,6 @@ source: IncrementalSource.Input;

export declare type blockClass = string | RegExp;
export declare type maskTextClass = string | RegExp;
export declare type SamplingStrategy = Partial<{
mousemove: boolean | number;
mousemoveCallback: number;
mouseInteraction: boolean | Record<string, boolean | undefined>;

@@ -128,5 +132,8 @@ scroll: number;

ignoreClass?: string;
maskTextClass?: maskTextClass;
maskTextSelector?: string;
maskAllInputs?: boolean;
maskInputOptions?: MaskInputOptions;
maskInputFn?: MaskInputFn;
maskTextFn?: MaskTextFn;
slimDOMOptions?: SlimDOMOptions | 'all' | true;

@@ -153,4 +160,7 @@ inlineStylesheet?: boolean;

ignoreClass: string;
maskTextClass: maskTextClass;
maskTextSelector: string | null;
maskInputOptions: MaskInputOptions;
maskInputFn?: MaskInputFn;
maskTextFn?: MaskTextFn;
inlineStylesheet: boolean;

@@ -166,2 +176,6 @@ styleSheetRuleCb: styleSheetRuleCallback;

slimDOMOptions: SlimDOMOptions;
doc: Document;
mirror: Mirror;
iframeManager: IframeManager;
shadowDomManager: ShadowDomManager;
};

@@ -212,2 +226,3 @@ export declare type hooksParam = {

id: number;
isShadow?: boolean;
};

@@ -220,3 +235,3 @@ export declare type addedNodeMutation = {

};
declare type mutationCallbackParam = {
export declare type mutationCallbackParam = {
texts: textMutation[];

@@ -226,5 +241,6 @@ attributes: attributeMutation[];

adds: addedNodeMutation[];
isAttachIframe?: true;
};
export declare type mutationCallBack = (m: mutationCallbackParam) => void;
export declare type mousemoveCallBack = (p: mousePosition[], source: IncrementalSource.MouseMove | IncrementalSource.TouchMove) => void;
export declare type mousemoveCallBack = (p: mousePosition[], source: IncrementalSource.MouseMove | IncrementalSource.TouchMove | IncrementalSource.Drag) => void;
export declare type mousePosition = {

@@ -289,21 +305,21 @@ x: number;

export declare type Logger = {
assert?: (value: any, message?: string, ...optionalParams: any[]) => void;
clear?: () => void;
count?: (label?: string) => void;
countReset?: (label?: string) => void;
debug?: (message?: any, ...optionalParams: any[]) => void;
dir?: (obj: any, options?: NodeJS.InspectOptions) => void;
dirxml?: (...data: any[]) => void;
error?: (message?: any, ...optionalParams: any[]) => void;
group?: (...label: any[]) => void;
groupCollapsed?: (label?: any[]) => void;
assert?: typeof console.assert;
clear?: typeof console.clear;
count?: typeof console.count;
countReset?: typeof console.countReset;
debug?: typeof console.debug;
dir?: typeof console.dir;
dirxml?: typeof console.dirxml;
error?: typeof console.error;
group?: typeof console.group;
groupCollapsed?: typeof console.groupCollapsed;
groupEnd?: () => void;
info?: (message?: any, ...optionalParams: any[]) => void;
log?: (message?: any, ...optionalParams: any[]) => void;
table?: (tabularData: any, properties?: ReadonlyArray<string>) => void;
time?: (label?: string) => void;
timeEnd?: (label?: string) => void;
timeLog?: (label?: string, ...data: any[]) => void;
trace?: (message?: any, ...optionalParams: any[]) => void;
warn?: (message?: any, ...optionalParams: any[]) => void;
info?: typeof console.info;
log?: typeof console.log;
table?: typeof console.table;
time?: typeof console.time;
timeEnd?: typeof console.timeEnd;
timeLog?: typeof console.timeLog;
trace?: typeof console.trace;
warn?: typeof console.warn;
};

@@ -313,12 +329,12 @@ export declare type ReplayLogger = Partial<Record<LogLevel, (data: logData) => void>>;

level: LogLevel;
trace: Array<string>;
payload: Array<string>;
trace: string[];
payload: string[];
};
export declare type fontCallback = (p: fontParam) => void;
export declare type logCallback = (p: LogParam) => void;
export declare type viewportResizeDimention = {
export declare type viewportResizeDimension = {
width: number;
height: number;
};
export declare type viewportResizeCallback = (d: viewportResizeDimention) => void;
export declare type viewportResizeCallback = (d: viewportResizeDimension) => void;
export declare type inputValue = {

@@ -340,2 +356,8 @@ text: string;

export declare type mediaInteractionCallback = (p: mediaInteractionParam) => void;
export declare type DocumentDimension = {
x: number;
y: number;
relativeScale: number;
absoluteScale: number;
};
export declare type Mirror = {

@@ -347,2 +369,3 @@ map: idNodeMap;

has: (id: number) => boolean;
reset: () => void;
};

@@ -357,2 +380,3 @@ export declare type throttleOptions = {

speed: number;
maxSpeed: number;
root: Element;

@@ -379,3 +403,3 @@ loadTimeout: number;

export declare type LogReplayConfig = {
level?: Array<LogLevel> | undefined;
level?: LogLevel[] | undefined;
replayLogger: ReplayLogger | undefined;

@@ -421,5 +445,7 @@ };

Flush = "flush",
StateChange = "state-change"
StateChange = "state-change",
PlayBack = "play-back"
}
export declare type MaskInputFn = (text: string) => string;
export declare type MaskTextFn = (text: string) => string;
export declare type ElementState = {

@@ -433,3 +459,3 @@ scroll?: [number, number];

export declare type LogRecordOptions = {
level?: Array<LogLevel> | undefined;
level?: LogLevel[] | undefined;
lengthThreshold?: number;

@@ -436,0 +462,0 @@ stringifyOptions?: StringifyOptions;

@@ -1,5 +0,6 @@

import { Mirror, throttleOptions, listenerHandler, hookResetter, blockClass, eventWithTime, addedNodeMutation, removedNodeMutation, textMutation, attributeMutation, mutationData, scrollData, inputData } from './types';
import { INode } from 'rrweb-snapshot';
import { Mirror, throttleOptions, listenerHandler, hookResetter, blockClass, eventWithTime, addedNodeMutation, removedNodeMutation, textMutation, attributeMutation, mutationData, scrollData, inputData, DocumentDimension } from './types';
import { INode, serializedNodeWithId } from 'rrweb-snapshot';
export declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | Window): listenerHandler;
export declare const mirror: Mirror;
export declare function createMirror(): Mirror;
export declare let _mirror: Mirror;
export declare function throttle<T>(func: (arg: T) => void, wait: number, options?: throttleOptions): (arg: T) => void;

@@ -14,3 +15,3 @@ export declare function hookSetter<T>(target: T, key: string | number | symbol, d: PropertyDescriptor, isRevoked?: boolean, win?: Window & typeof globalThis): hookResetter;

export declare function isIgnored(n: Node | INode): boolean;
export declare function isAncestorRemoved(target: INode): boolean;
export declare function isAncestorRemoved(target: INode, mirror: Mirror): boolean;
export declare function isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent;

@@ -38,3 +39,3 @@ export declare function polyfill(win?: Window & typeof globalThis): void;

add(mutation: addedNodeMutation): void;
remove(mutation: removedNodeMutation): void;
remove(mutation: removedNodeMutation, mirror: Mirror): void;
text(mutation: textMutation): void;

@@ -58,2 +59,14 @@ attribute(mutation: attributeMutation): void;

export declare function iterateResolveTree(tree: ResolveTree, cb: (mutation: addedNodeMutation) => unknown): void;
declare type HTMLIFrameINode = HTMLIFrameElement & {
__sn: serializedNodeWithId;
};
export declare type AppendedIframe = {
mutationInQueue: addedNodeMutation;
builtNode: HTMLIFrameINode;
};
export declare function isIframeINode(node: INode | ShadowRoot): node is HTMLIFrameINode;
export declare function getBaseDimension(node: Node, rootIframe: Node): DocumentDimension;
export declare function hasShadowRoot<T extends Node>(n: T): n is T & {
shadowRoot: ShadowRoot;
};
export {};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc