@highlight-run/rrweb 1.2.1 → 2.0.0-lambda.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/CHANGELOG.md +359 -19
  2. package/README.md +147 -34
  3. package/dist/assets/image-bitmap-data-url-worker-DwtK8A0z.js.map +1 -0
  4. package/dist/rrweb.cjs +17806 -0
  5. package/dist/rrweb.cjs.map +1 -0
  6. package/dist/rrweb.d.cts +509 -0
  7. package/dist/rrweb.d.ts +509 -0
  8. package/dist/rrweb.js +17807 -0
  9. package/dist/rrweb.js.map +1 -0
  10. package/dist/rrweb.umd.cjs +17810 -0
  11. package/dist/rrweb.umd.cjs.map +7 -0
  12. package/dist/rrweb.umd.min.cjs +90 -0
  13. package/dist/rrweb.umd.min.cjs.map +7 -0
  14. package/dist/{index.css → style.css} +23 -14
  15. package/dist/style.min.css +2 -0
  16. package/dist/style.min.css.map +7 -0
  17. package/package.json +67 -61
  18. package/rrweb-record/package.json +4 -0
  19. package/rrweb-replay/package.json +4 -0
  20. package/README.zh_CN.md +0 -122
  21. package/dist/entries/all.d.ts +0 -4
  22. package/dist/entries/record-pack.d.ts +0 -2
  23. package/dist/entries/replay-unpack.d.ts +0 -2
  24. package/dist/index.css.map +0 -1
  25. package/dist/index.d.ts +0 -9
  26. package/dist/index.js +0 -3
  27. package/dist/index.js.LICENSE.txt +0 -14
  28. package/dist/index.js.map +0 -1
  29. package/dist/packer/base.d.ts +0 -7
  30. package/dist/packer/index.d.ts +0 -2
  31. package/dist/packer/pack.d.ts +0 -2
  32. package/dist/packer/unpack.d.ts +0 -2
  33. package/dist/plugins/console/record/error-stack-parser.d.ts +0 -37
  34. package/dist/plugins/console/record/index.d.ts +0 -41
  35. package/dist/plugins/console/record/stringify.d.ts +0 -2
  36. package/dist/plugins/console/replay/index.d.ts +0 -9
  37. package/dist/plugins/console-record.min.js +0 -16
  38. package/dist/plugins/console-record.min.js.map +0 -1
  39. package/dist/plugins/entries/all.d.ts +0 -4
  40. package/dist/plugins/entries/record-pack.d.ts +0 -2
  41. package/dist/plugins/entries/replay-unpack.d.ts +0 -2
  42. package/dist/plugins/index.d.ts +0 -9
  43. package/dist/plugins/packer/base.d.ts +0 -7
  44. package/dist/plugins/packer/index.d.ts +0 -2
  45. package/dist/plugins/packer/pack.d.ts +0 -2
  46. package/dist/plugins/packer/unpack.d.ts +0 -2
  47. package/dist/plugins/plugins/console/record/error-stack-parser.d.ts +0 -37
  48. package/dist/plugins/plugins/console/record/index.d.ts +0 -41
  49. package/dist/plugins/plugins/console/record/stringify.d.ts +0 -2
  50. package/dist/plugins/plugins/console/replay/index.d.ts +0 -9
  51. package/dist/plugins/plugins/sequential-id/record/index.d.ts +0 -6
  52. package/dist/plugins/plugins/sequential-id/replay/index.d.ts +0 -7
  53. package/dist/plugins/record/iframe-manager.d.ts +0 -13
  54. package/dist/plugins/record/index.d.ts +0 -9
  55. package/dist/plugins/record/mutation.d.ts +0 -45
  56. package/dist/plugins/record/observer.d.ts +0 -11
  57. package/dist/plugins/record/observers/canvas/2d.d.ts +0 -2
  58. package/dist/plugins/record/observers/canvas/canvas-manager.d.ts +0 -32
  59. package/dist/plugins/record/observers/canvas/canvas.d.ts +0 -2
  60. package/dist/plugins/record/observers/canvas/serialize-args.d.ts +0 -6
  61. package/dist/plugins/record/observers/canvas/webgl.d.ts +0 -2
  62. package/dist/plugins/record/shadow-dom-manager.d.ts +0 -34
  63. package/dist/plugins/replay/canvas/2d.d.ts +0 -9
  64. package/dist/plugins/replay/canvas/index.d.ts +0 -9
  65. package/dist/plugins/replay/canvas/webgl.d.ts +0 -11
  66. package/dist/plugins/replay/index.d.ts +0 -82
  67. package/dist/plugins/replay/machine.d.ts +0 -85
  68. package/dist/plugins/replay/smoothscroll.d.ts +0 -1
  69. package/dist/plugins/replay/styles/inject-style.d.ts +0 -2
  70. package/dist/plugins/replay/timer.d.ts +0 -19
  71. package/dist/plugins/replay/virtual-styles.d.ts +0 -43
  72. package/dist/plugins/rrdom/index.d.ts +0 -1
  73. package/dist/plugins/rrdom/tree-node.d.ts +0 -20
  74. package/dist/plugins/sequential-id/record/index.d.ts +0 -6
  75. package/dist/plugins/sequential-id/replay/index.d.ts +0 -7
  76. package/dist/plugins/snapshot/css.d.ts +0 -92
  77. package/dist/plugins/snapshot/index.d.ts +0 -5
  78. package/dist/plugins/snapshot/rebuild.d.ts +0 -19
  79. package/dist/plugins/snapshot/snapshot.d.ts +0 -49
  80. package/dist/plugins/snapshot/types.d.ts +0 -99
  81. package/dist/plugins/snapshot/utils.d.ts +0 -11
  82. package/dist/plugins/types.d.ts +0 -509
  83. package/dist/plugins/utils.d.ts +0 -71
  84. package/dist/record/iframe-manager.d.ts +0 -13
  85. package/dist/record/index.d.ts +0 -9
  86. package/dist/record/mutation.d.ts +0 -45
  87. package/dist/record/observer.d.ts +0 -11
  88. package/dist/record/observers/canvas/2d.d.ts +0 -2
  89. package/dist/record/observers/canvas/canvas-manager.d.ts +0 -32
  90. package/dist/record/observers/canvas/canvas.d.ts +0 -2
  91. package/dist/record/observers/canvas/serialize-args.d.ts +0 -6
  92. package/dist/record/observers/canvas/webgl.d.ts +0 -2
  93. package/dist/record/shadow-dom-manager.d.ts +0 -34
  94. package/dist/replay/canvas/2d.d.ts +0 -9
  95. package/dist/replay/canvas/index.d.ts +0 -9
  96. package/dist/replay/canvas/webgl.d.ts +0 -11
  97. package/dist/replay/index.d.ts +0 -82
  98. package/dist/replay/machine.d.ts +0 -85
  99. package/dist/replay/smoothscroll.d.ts +0 -1
  100. package/dist/replay/styles/inject-style.d.ts +0 -2
  101. package/dist/replay/timer.d.ts +0 -19
  102. package/dist/replay/virtual-styles.d.ts +0 -43
  103. package/dist/rrdom/index.d.ts +0 -1
  104. package/dist/rrdom/tree-node.d.ts +0 -20
  105. package/dist/rrweb.min.js +0 -30
  106. package/dist/rrweb.min.js.map +0 -1
  107. package/dist/snapshot/css.d.ts +0 -92
  108. package/dist/snapshot/index.d.ts +0 -5
  109. package/dist/snapshot/rebuild.d.ts +0 -19
  110. package/dist/snapshot/snapshot.d.ts +0 -49
  111. package/dist/snapshot/types.d.ts +0 -99
  112. package/dist/snapshot/utils.d.ts +0 -11
  113. package/dist/types.d.ts +0 -509
  114. package/dist/utils.d.ts +0 -71
@@ -1,7 +0,0 @@
1
- import { eventWithTime } from '../types';
2
- export declare type PackFn = (event: eventWithTime) => string;
3
- export declare type UnpackFn = (raw: string) => eventWithTime;
4
- export declare type eventWithTimeAndPacker = eventWithTime & {
5
- v: string;
6
- };
7
- export declare const MARK = "v1";
@@ -1,2 +0,0 @@
1
- export { pack } from './pack';
2
- export { unpack } from './unpack';
@@ -1,2 +0,0 @@
1
- import { PackFn } from './base';
2
- export declare const pack: PackFn;
@@ -1,2 +0,0 @@
1
- import { UnpackFn } from './base';
2
- export declare const unpack: UnpackFn;
@@ -1,37 +0,0 @@
1
- export declare class StackFrame {
2
- private fileName;
3
- private functionName;
4
- private lineNumber?;
5
- private columnNumber?;
6
- constructor(obj: {
7
- fileName?: string;
8
- functionName?: string;
9
- lineNumber?: number;
10
- columnNumber?: number;
11
- });
12
- toString(): string;
13
- }
14
- export declare const ErrorStackParser: {
15
- parse: (error: Error) => StackFrame[];
16
- extractLocation: (urlLike: string) => (string | undefined)[];
17
- parseV8OrIE: (error: {
18
- stack: string;
19
- }) => StackFrame[];
20
- parseFFOrSafari: (error: {
21
- stack: string;
22
- }) => StackFrame[];
23
- parseOpera: (e: {
24
- stacktrace?: string;
25
- message: string;
26
- stack?: string;
27
- }) => StackFrame[];
28
- parseOpera9: (e: {
29
- message: string;
30
- }) => StackFrame[];
31
- parseOpera10: (e: {
32
- stacktrace: string;
33
- }) => StackFrame[];
34
- parseOpera11: (error: {
35
- stack: string;
36
- }) => StackFrame[];
37
- };
@@ -1,41 +0,0 @@
1
- import { RecordPlugin } from '../../../types';
2
- export declare type StringifyOptions = {
3
- stringLengthLimit?: number;
4
- numOfKeysLimit: number;
5
- };
6
- declare type LogRecordOptions = {
7
- level?: LogLevel[] | undefined;
8
- lengthThreshold?: number;
9
- stringifyOptions?: StringifyOptions;
10
- logger?: Logger | string;
11
- };
12
- export declare type LogData = {
13
- level: LogLevel;
14
- trace: string[];
15
- payload: string[];
16
- };
17
- export declare type LogLevel = 'assert' | 'clear' | 'count' | 'countReset' | 'debug' | 'dir' | 'dirxml' | 'error' | 'group' | 'groupCollapsed' | 'groupEnd' | 'info' | 'log' | 'table' | 'time' | 'timeEnd' | 'timeLog' | 'trace' | 'warn';
18
- export declare type Logger = {
19
- assert?: typeof console.assert;
20
- clear?: typeof console.clear;
21
- count?: typeof console.count;
22
- countReset?: typeof console.countReset;
23
- debug?: typeof console.debug;
24
- dir?: typeof console.dir;
25
- dirxml?: typeof console.dirxml;
26
- error?: typeof console.error;
27
- group?: typeof console.group;
28
- groupCollapsed?: typeof console.groupCollapsed;
29
- groupEnd?: () => void;
30
- info?: typeof console.info;
31
- log?: typeof console.log;
32
- table?: typeof console.table;
33
- time?: typeof console.time;
34
- timeEnd?: typeof console.timeEnd;
35
- timeLog?: typeof console.timeLog;
36
- trace?: typeof console.trace;
37
- warn?: typeof console.warn;
38
- };
39
- export declare const PLUGIN_NAME = "rrweb/console@1";
40
- export declare const getRecordConsolePlugin: (options?: LogRecordOptions) => RecordPlugin;
41
- export {};
@@ -1,2 +0,0 @@
1
- import { StringifyOptions } from './index';
2
- export declare function stringify(obj: any, stringifyOptions?: StringifyOptions): string;
@@ -1,9 +0,0 @@
1
- import { LogLevel, LogData } from '../record';
2
- import { ReplayPlugin } from '../../../types';
3
- declare type ReplayLogger = Partial<Record<LogLevel, (data: LogData) => void>>;
4
- declare type LogReplayConfig = {
5
- level?: LogLevel[] | undefined;
6
- replayLogger: ReplayLogger | undefined;
7
- };
8
- export declare const getReplayConsolePlugin: (options?: LogReplayConfig) => ReplayPlugin;
9
- export {};
@@ -1,16 +0,0 @@
1
- var rrwebConsoleRecord=function(e){"use strict";
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function n(e,n){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var t,o,i=r.call(e),a=[];try{for(;(void 0===n||n-- >0)&&!(t=i.next()).done;)a.push(t.value)}catch(e){o={error:e}}finally{try{t&&!t.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function r(){for(var e=[],r=0;r<arguments.length;r++)e=e.concat(n(arguments[r]));return e}function t(e){if(!e||!e.outerHTML)return"";for(var n="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var t=e.parentElement,o=[];if(t.children&&t.children.length>0)for(var i=0;i<t.children.length;i++){var a=t.children[i];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===r&&o.push(a)}o.length>1&&(r+=":eq("+o.indexOf(e)+")"),n=r+(n?">"+n:""),e=t}return n}function o(e,n){var r={numOfKeysLimit:50};Object.assign(r,n);var o=[],i=[];return JSON.stringify(e,(function(e,n){if(o.length>0){var a=o.indexOf(this);~a?o.splice(a+1):o.push(this),~a?i.splice(a,1/0,e):i.push(e),~o.indexOf(n)&&(n=o[0]===n?"[Circular ~]":"[Circular ~."+i.slice(0,o.indexOf(n)).join(".")+"]")}else o.push(n);if(null==n)return n;if(function(e){if("object"==typeof e&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;return!1}(n))return function(e){var n=e.toString();r.stringLengthLimit&&n.length>r.stringLengthLimit&&(n=n.slice(0,r.stringLengthLimit)+"...");return n}(n);if(n instanceof Event){var u={};for(var c in n){var l=n[c];Array.isArray(l)?u[c]=t(l.length?l[0]:null):u[c]=l}return u}return n instanceof Node?n instanceof HTMLElement?n?n.outerHTML:"":n.nodeName:n}))}var i,a,u,c,l,s,f,p=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||"",n=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+n+")":this.fileName+":"+e+":"+n},e}(),h=/(^|@)\S+:\d+/,m=/^\s*at .*(\S+:\d+|\(native\))/m,d=/^(eval@)?(\[native code])?$/,v={parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(m))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 n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!n)throw new Error("Cannot parse given url: "+e);return[n[1],n[2]||void 0,n[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(m)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var n=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=n.match(/ (\((.+):(\d+):(\d+)\)$)/),t=(n=r?n.replace(r[0],""):n).split(/\s+/).slice(1),o=this.extractLocation(r?r[1]:t.pop()),i=t.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new p({functionName:i,fileName:a,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(d)}),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 p({functionName:e});var n=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(n),t=r&&r[1]?r[1]:void 0,o=this.extractLocation(e.replace(n,""));return new p({functionName:t,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 n=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),t=[],o=2,i=r.length;o<i;o+=2){var a=n.exec(r[o]);a&&t.push(new p({fileName:a[2],lineNumber:parseFloat(a[1])}))}return t},parseOpera10:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),t=[],o=0,i=r.length;o<i;o+=2){var a=n.exec(r[o]);a&&t.push(new p({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return t},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(h)&&!e.match(/^Error created at/)}),this).map((function(e){var n=e.split("@"),r=this.extractLocation(n.pop()),t=(n.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new p({functionName:t,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};!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",e[e.Plugin=6]="Plugin"}(i||(i={})),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",e[e.StyleDeclaration=13]="StyleDeclaration"}(a||(a={})),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",e[e.TouchCancel=10]="TouchCancel"}(u||(u={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(c||(c={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(l||(l={})),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"}(s||(s={})),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"}(f||(f={}));var g="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.",y={map:{},getId:function(){return console.error(g),-1},getNode:function(){return console.error(g),null},removeNodeFromMap:function(){console.error(g)},has:function(){return console.error(g),!1},reset:function(){console.error(g)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(y=new Proxy(y,{get:function(e,n,r){return"map"===n&&console.error(g),Reflect.get(e,n,r)}}));var b={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function w(e,n,t){var i,a,u,c=this,l=t.logger;if(!l)return function(){};u="string"==typeof l?n[l]:l;var s=0,f=[];if(t.level.includes("error")&&window){var p=window.onerror;window.onerror=function(n,r,i,a,u){p&&p.apply(c,[n,r,i,a,u]);var l=v.parse(u).map((function(e){return e.toString()})),s=[o(n,t.stringifyOptions)];e({level:"error",trace:l,payload:s})},f.push((function(){window.onerror=p}))}try{for(var h=function(e){var n="function"==typeof Symbol&&Symbol.iterator,r=n&&e[n],t=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}(t.level),m=h.next();!m.done;m=h.next()){var d=m.value;f.push(g(u,d))}}catch(e){i={error:e}}finally{try{m&&!m.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}return function(){f.forEach((function(e){return e()}))};function g(n,i){var a=this;return n[i]?function(e,n,r){try{if(!(n in e))return function(){};var t=e[n],o=r(t);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:t}})),e[n]=o,function(){e[n]=t}}catch(e){return function(){}}}(n,i,(function(n){return function(){for(var u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];n.apply(a,u);try{var l=v.parse(new Error).map((function(e){return e.toString()})).splice(1),f=u.map((function(e){return o(e,t.stringifyOptions)}));++s<t.lengthThreshold?e({level:i,trace:l,payload:f}):s===t.lengthThreshold&&e({level:"warn",trace:[],payload:[o("The number of log records reached the threshold.")]})}catch(e){n.apply(void 0,r(["rrweb logger error:",e],u))}}})):function(){}}}return e.PLUGIN_NAME="rrweb/console@1",e.getRecordConsolePlugin=function(e){return{name:"rrweb/console@1",observer:w,options:e?Object.assign({},b,e):b}},Object.defineProperty(e,"__esModule",{value:!0}),e}({});
16
- //# sourceMappingURL=console-record.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"console-record.min.js","sources":["../../node_modules/tslib/tslib.es6.js","../../src/plugins/console/record/stringify.ts","../../src/plugins/console/record/error-stack-parser.ts","../../src/types.ts","../../src/snapshot/types.ts","../../src/utils.ts","../../src/plugins/console/record/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","// tslint:disable:no-any no-bitwise forin\n/**\n * this file is used to serialize log message to string\n *\n */\n\nimport { StringifyOptions } from './index';\n\n/**\n * transfer the node path in Event to string\n * @param node the first node in a node path array\n */\nfunction pathToSelector(node: HTMLElement): string | '' {\n if (!node || !node.outerHTML) {\n return '';\n }\n\n let path = '';\n while (node.parentElement) {\n let name = node.localName;\n if (!name) {\n break;\n }\n name = name.toLowerCase();\n let parent = node.parentElement;\n\n let domSiblings = [];\n\n if (parent.children && parent.children.length > 0) {\n // tslint:disable-next-line:prefer-for-of\n for (let i = 0; i < parent.children.length; i++) {\n let sibling = parent.children[i];\n if (sibling.localName && sibling.localName.toLowerCase) {\n if (sibling.localName.toLowerCase() === name) {\n domSiblings.push(sibling);\n }\n }\n }\n }\n\n if (domSiblings.length > 1) {\n name += ':eq(' + domSiblings.indexOf(node) + ')';\n }\n path = name + (path ? '>' + path : '');\n node = parent;\n }\n\n return path;\n}\n\n/**\n * stringify any js object\n * @param obj the object to stringify\n */\nexport function stringify(\n obj: any,\n stringifyOptions?: StringifyOptions,\n): string {\n const options: StringifyOptions = {\n numOfKeysLimit: 50,\n };\n Object.assign(options, stringifyOptions);\n const stack: any[] = [];\n const keys: any[] = [];\n return JSON.stringify(obj, function (key, value) {\n /**\n * forked from https://github.com/moll/json-stringify-safe/blob/master/stringify.js\n * to deCycle the object\n */\n if (stack.length > 0) {\n const thisPos = stack.indexOf(this);\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);\n if (~stack.indexOf(value)) {\n if (stack[0] === value) {\n value = '[Circular ~]';\n } else {\n value =\n '[Circular ~.' +\n keys.slice(0, stack.indexOf(value)).join('.') +\n ']';\n }\n }\n } else {\n stack.push(value);\n }\n /* END of the FORK */\n\n if (value === null || value === undefined) {\n return value;\n }\n if (shouldToString(value)) {\n return toString(value);\n }\n if (value instanceof Event) {\n const eventResult: any = {};\n for (const eventKey in value) {\n const eventValue = (value as any)[eventKey];\n if (Array.isArray(eventValue)) {\n eventResult[eventKey] = pathToSelector(\n eventValue.length ? eventValue[0] : null,\n );\n } else {\n eventResult[eventKey] = eventValue;\n }\n }\n return eventResult;\n } else if (value instanceof Node) {\n if (value instanceof HTMLElement) {\n return value ? value.outerHTML : '';\n }\n return value.nodeName;\n }\n return value;\n });\n\n /**\n * whether we should call toString function of this object\n */\n function shouldToString(_obj: object): boolean {\n if (\n typeof _obj === 'object' &&\n Object.keys(_obj).length > options.numOfKeysLimit\n ) {\n return true;\n }\n if (typeof _obj === 'function') {\n return true;\n }\n return false;\n }\n\n /**\n * limit the toString() result according to option\n */\n function toString(_obj: object): string {\n let str = _obj.toString();\n if (options.stringLengthLimit && str.length > options.stringLengthLimit) {\n str = `${str.slice(0, options.stringLengthLimit)}...`;\n }\n return str;\n }\n}\n","// tslint:disable\n/**\n * Class StackFrame is a fork of https://github.com/stacktracejs/stackframe/blob/master/stackframe.js\n * I fork it because:\n * 1. There are some build issues when importing this package.\n * 2. Rewrites into typescript give us a better type interface.\n * 3. StackFrame contains some functions we don't need.\n */\nexport class StackFrame {\n private fileName: string;\n private functionName: string;\n private lineNumber?: number;\n private columnNumber?: number;\n\n constructor(obj: {\n fileName?: string;\n functionName?: string;\n lineNumber?: number;\n columnNumber?: number;\n }) {\n this.fileName = obj.fileName || '';\n this.functionName = obj.functionName || '';\n this.lineNumber = obj.lineNumber;\n this.columnNumber = obj.columnNumber;\n }\n\n toString() {\n const lineNumber = this.lineNumber || '';\n const columnNumber = this.columnNumber || '';\n if (this.functionName) {\n return (\n this.functionName +\n ' (' +\n this.fileName +\n ':' +\n lineNumber +\n ':' +\n columnNumber +\n ')'\n );\n }\n return this.fileName + ':' + lineNumber + ':' + columnNumber;\n }\n}\n\n/**\n * ErrorStackParser is a fork of https://github.com/stacktracejs/error-stack-parser/blob/master/error-stack-parser.js\n * I fork it because:\n * 1. There are some build issues when importing this package.\n * 2. Rewrites into typescript give us a better type interface.\n */\nconst FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+:\\d+/;\nconst CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+:\\d+|\\(native\\))/m;\nconst SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code])?$/;\nexport const ErrorStackParser = {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function (error: Error): StackFrame[] {\n if (\n // @ts-ignore\n typeof error.stacktrace !== 'undefined' ||\n // @ts-ignore\n typeof error['opera#sourceloc'] !== 'undefined'\n ) {\n return this.parseOpera(\n error as {\n stacktrace?: string;\n message: string;\n stack?: string;\n },\n );\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error as { stack: string });\n } else if (error.stack) {\n return this.parseFFOrSafari(error as { stack: string });\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function (urlLike: string) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n const regExp = /(.+?)(?::(\\d+))?(?::(\\d+))?$/;\n const parts = regExp.exec(urlLike.replace(/[()]/g, ''));\n if (!parts) throw new Error(`Cannot parse given url: ${urlLike}`);\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n parseV8OrIE: function (error: { stack: string }) {\n const filtered = error.stack.split('\\n').filter(function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return filtered.map(function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line\n .replace(/eval code/g, 'eval')\n .replace(/(\\(eval at [^()]*)|(\\),.*$)/g, '');\n }\n let sanitizedLine = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(');\n\n // capture and preseve the parenthesized location \"(/foo/my bar.js:12:87)\" in\n // case it has spaces in it, as the string is split on \\s+ later on\n const location = sanitizedLine.match(/ (\\((.+):(\\d+):(\\d+)\\)$)/);\n\n // remove the parenthesized location from the line, if it was matched\n sanitizedLine = location\n ? sanitizedLine.replace(location[0], '')\n : sanitizedLine;\n\n const tokens = sanitizedLine.split(/\\s+/).slice(1);\n // if a location was matched, pass it to extractLocation() otherwise pop the last token\n const locationParts = this.extractLocation(\n location ? location[1] : tokens.pop(),\n );\n const functionName = tokens.join(' ') || undefined;\n const fileName =\n ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1\n ? undefined\n : locationParts[0];\n\n return new StackFrame({\n functionName,\n fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n });\n }, this);\n },\n parseFFOrSafari: function (error: { stack: string }) {\n const filtered = error.stack.split('\\n').filter(function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return filtered.map(function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(\n / line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g,\n ':$1',\n );\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line,\n });\n } else {\n const functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n const matches = line.match(functionNameRegex);\n const functionName = matches && matches[1] ? matches[1] : undefined;\n const locationParts = this.extractLocation(\n line.replace(functionNameRegex, ''),\n );\n\n return new StackFrame({\n functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n });\n }\n }, this);\n },\n parseOpera: function (e: {\n stacktrace?: string;\n message: string;\n stack?: string;\n }): StackFrame[] {\n if (\n !e.stacktrace ||\n (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)\n ) {\n return this.parseOpera9(e as { message: string });\n } else if (!e.stack) {\n return this.parseOpera10(e as { stacktrace: string });\n } else {\n return this.parseOpera11(e as { stack: string });\n }\n },\n parseOpera9: function (e: { message: string }) {\n const lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n const lines = e.message.split('\\n');\n const result = [];\n\n for (let i = 2, len = lines.length; i < len; i += 2) {\n const match = lineRE.exec(lines[i]);\n if (match) {\n result.push(\n new StackFrame({\n fileName: match[2],\n lineNumber: parseFloat(match[1]),\n }),\n );\n }\n }\n\n return result;\n },\n parseOpera10: function (e: { stacktrace: string }) {\n const lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n const lines = e.stacktrace.split('\\n');\n const result = [];\n\n for (let i = 0, len = lines.length; i < len; i += 2) {\n const match = lineRE.exec(lines[i]);\n if (match) {\n result.push(\n new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: parseFloat(match[1]),\n }),\n );\n }\n }\n\n return result;\n },\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function (error: { stack: string }) {\n const filtered = error.stack.split('\\n').filter(function (line) {\n return (\n !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/)\n );\n }, this);\n\n return filtered.map(function (line: string) {\n const tokens = line.split('@');\n const locationParts = this.extractLocation(tokens.pop());\n const functionCall = tokens.shift() || '';\n const functionName =\n functionCall\n .replace(/<anonymous function(: (\\w+))?>/, '$2')\n .replace(/\\([^)]*\\)/g, '') || undefined;\n return new StackFrame({\n functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n });\n }, this);\n },\n};\n","import {\n serializedNodeWithId,\n idNodeMap,\n INode,\n MaskInputOptions,\n SlimDOMOptions,\n MaskInputFn,\n MaskTextFn,\n} from './snapshot';\nimport { PackFn, UnpackFn } from './packer/base';\nimport { FontFaceDescriptors } from 'css-font-loading-module';\nimport { IframeManager } from './record/iframe-manager';\nimport { ShadowDomManager } from './record/shadow-dom-manager';\nimport type { Replayer } from './replay';\nimport { CanvasManager } from './record/observers/canvas/canvas-manager';\n\nexport enum EventType {\n DomContentLoaded,\n Load,\n FullSnapshot,\n IncrementalSnapshot,\n Meta,\n Custom,\n Plugin,\n}\n\nexport type SessionInterval = {\n startTime: number;\n endTime: number;\n duration: number;\n active: boolean;\n};\n\nexport type domContentLoadedEvent = {\n type: EventType.DomContentLoaded;\n data: {};\n};\n\nexport type loadedEvent = {\n type: EventType.Load;\n data: {};\n};\n\nexport type fullSnapshotEvent = {\n type: EventType.FullSnapshot;\n data: {\n node: serializedNodeWithId;\n initialOffset: {\n top: number;\n left: number;\n };\n };\n};\n\nexport type incrementalSnapshotEvent = {\n type: EventType.IncrementalSnapshot;\n data: incrementalData;\n};\n\nexport type metaEvent = {\n type: EventType.Meta;\n data: {\n href: string;\n width: number;\n height: number;\n };\n};\n\nexport type customEvent<T = unknown> = {\n type: EventType.Custom;\n data: {\n tag: string;\n payload: T;\n };\n};\n\nexport type pluginEvent<T = unknown> = {\n type: EventType.Plugin;\n data: {\n plugin: string;\n payload: T;\n };\n};\n\nexport type styleSheetEvent = {};\n\nexport enum IncrementalSource {\n Mutation,\n MouseMove,\n MouseInteraction,\n Scroll,\n ViewportResize,\n Input,\n TouchMove,\n MediaInteraction,\n StyleSheetRule,\n CanvasMutation,\n Font,\n Log,\n Drag,\n StyleDeclaration,\n}\n\nexport type mutationData = {\n source: IncrementalSource.Mutation;\n} & mutationCallbackParam;\n\nexport type mousemoveData = {\n source:\n | IncrementalSource.MouseMove\n | IncrementalSource.TouchMove\n | IncrementalSource.Drag;\n positions: mousePosition[];\n};\n\nexport type mouseInteractionData = {\n source: IncrementalSource.MouseInteraction;\n} & mouseInteractionParam;\n\nexport type scrollData = {\n source: IncrementalSource.Scroll;\n} & scrollPosition;\n\nexport type viewportResizeData = {\n source: IncrementalSource.ViewportResize;\n} & viewportResizeDimension;\n\nexport type inputData = {\n source: IncrementalSource.Input;\n id: number;\n} & inputValue;\n\nexport type mediaInteractionData = {\n source: IncrementalSource.MediaInteraction;\n} & mediaInteractionParam;\n\nexport type styleSheetRuleData = {\n source: IncrementalSource.StyleSheetRule;\n} & styleSheetRuleParam;\n\nexport type styleDeclarationData = {\n source: IncrementalSource.StyleDeclaration;\n} & styleDeclarationParam;\n\nexport type canvasMutationData = {\n source: IncrementalSource.CanvasMutation;\n} & canvasMutationParam;\n\nexport type fontData = {\n source: IncrementalSource.Font;\n} & fontParam;\n\nexport type incrementalData =\n | mutationData\n | mousemoveData\n | mouseInteractionData\n | scrollData\n | viewportResizeData\n | inputData\n | mediaInteractionData\n | styleSheetRuleData\n | canvasMutationData\n | fontData\n | styleDeclarationData;\n\nexport type event =\n | domContentLoadedEvent\n | loadedEvent\n | fullSnapshotEvent\n | incrementalSnapshotEvent\n | metaEvent\n | customEvent\n | pluginEvent;\n\nexport type eventWithTime = event & {\n timestamp: number;\n delay?: number;\n};\n\nexport type blockClass = string | RegExp;\n\nexport type maskTextClass = string | RegExp;\n\nexport type SamplingStrategy = Partial<{\n /**\n * false means not to record mouse/touch move events\n * number is the throttle threshold of recording mouse/touch move\n */\n mousemove: boolean | number;\n /**\n * number is the throttle threshold of mouse/touch move callback\n */\n mousemoveCallback: number;\n /**\n * false means not to record mouse interaction events\n * can also specify record some kinds of mouse interactions\n */\n mouseInteraction: boolean | Record<string, boolean | undefined>;\n /**\n * number is the throttle threshold of recording scroll\n */\n scroll: number;\n /**\n * number is the throttle threshold of recording media interactions\n */\n media: number;\n /**\n * 'all' will record all the input events\n * 'last' will only record the last input value while input a sequence of chars\n */\n input: 'all' | 'last';\n}>;\n\nexport type RecordPlugin<TOptions = unknown> = {\n name: string;\n observer?: (cb: Function, win: IWindow, options: TOptions) => listenerHandler;\n eventProcessor?: <TExtend>(event: eventWithTime) => eventWithTime & TExtend;\n options: TOptions;\n};\n\nexport type recordOptions<T> = {\n emit?: (e: T, isCheckout?: boolean) => void;\n checkoutEveryNth?: number;\n checkoutEveryNms?: number;\n blockClass?: blockClass;\n blockSelector?: string;\n ignoreClass?: string;\n maskTextClass?: maskTextClass;\n maskTextSelector?: string;\n maskAllInputs?: boolean;\n maskInputOptions?: MaskInputOptions;\n maskInputFn?: MaskInputFn;\n maskTextFn?: MaskTextFn;\n slimDOMOptions?: SlimDOMOptions | 'all' | true;\n inlineStylesheet?: boolean;\n hooks?: hooksParam;\n packFn?: PackFn;\n sampling?: SamplingStrategy;\n recordCanvas?: boolean;\n userTriggeredOnInput?: boolean;\n collectFonts?: boolean;\n plugins?: RecordPlugin[];\n // departed, please use sampling options\n mousemoveWait?: number;\n keepIframeSrcFn?: KeepIframeSrcFn;\n enableStrictPrivacy?: boolean;\n};\n\nexport type observerParam = {\n mutationCb: mutationCallBack;\n mousemoveCb: mousemoveCallBack;\n mouseInteractionCb: mouseInteractionCallBack;\n scrollCb: scrollCallback;\n viewportResizeCb: viewportResizeCallback;\n inputCb: inputCallback;\n mediaInteractionCb: mediaInteractionCallback;\n blockClass: blockClass;\n blockSelector: string | null;\n ignoreClass: string;\n maskTextClass: maskTextClass;\n maskTextSelector: string | null;\n maskInputOptions: MaskInputOptions;\n maskInputFn?: MaskInputFn;\n maskTextFn?: MaskTextFn;\n inlineStylesheet: boolean;\n styleSheetRuleCb: styleSheetRuleCallback;\n styleDeclarationCb: styleDeclarationCallback;\n canvasMutationCb: canvasMutationCallback;\n fontCb: fontCallback;\n sampling: SamplingStrategy;\n recordCanvas: boolean;\n userTriggeredOnInput: boolean;\n collectFonts: boolean;\n slimDOMOptions: SlimDOMOptions;\n doc: Document;\n mirror: Mirror;\n iframeManager: IframeManager;\n shadowDomManager: ShadowDomManager;\n canvasManager: CanvasManager;\n plugins: Array<{\n observer: Function;\n callback: Function;\n options: unknown;\n }>;\n enableStrictPrivacy: boolean;\n};\n\nexport type hooksParam = {\n mutation?: mutationCallBack;\n mousemove?: mousemoveCallBack;\n mouseInteraction?: mouseInteractionCallBack;\n scroll?: scrollCallback;\n viewportResize?: viewportResizeCallback;\n input?: inputCallback;\n mediaInteaction?: mediaInteractionCallback;\n styleSheetRule?: styleSheetRuleCallback;\n styleDeclaration?: styleDeclarationCallback;\n canvasMutation?: canvasMutationCallback;\n font?: fontCallback;\n};\n\n// https://dom.spec.whatwg.org/#interface-mutationrecord\nexport type mutationRecord = {\n type: string;\n target: Node;\n oldValue: string | null;\n addedNodes: NodeList;\n removedNodes: NodeList;\n attributeName: string | null;\n};\n\nexport type textCursor = {\n node: Node;\n value: string | null;\n};\nexport type textMutation = {\n id: number;\n value: string | null;\n};\n\nexport type styleAttributeValue = {\n [key: string]: styleValueWithPriority | string | false;\n};\n\nexport type styleValueWithPriority = [string, string];\n\nexport type attributeCursor = {\n node: Node;\n attributes: {\n [key: string]: string | styleAttributeValue | null;\n };\n};\nexport type attributeMutation = {\n id: number;\n attributes: {\n [key: string]: string | styleAttributeValue | null;\n };\n};\n\nexport type removedNodeMutation = {\n parentId: number;\n id: number;\n isShadow?: boolean;\n};\n\nexport type addedNodeMutation = {\n parentId: number;\n // Newly recorded mutations will not have previousId any more, just for compatibility\n previousId?: number | null;\n nextId: number | null;\n node: serializedNodeWithId;\n};\n\nexport type mutationCallbackParam = {\n texts: textMutation[];\n attributes: attributeMutation[];\n removes: removedNodeMutation[];\n adds: addedNodeMutation[];\n isAttachIframe?: true;\n};\n\nexport type mutationCallBack = (m: mutationCallbackParam) => void;\n\nexport type mousemoveCallBack = (\n p: mousePosition[],\n source:\n | IncrementalSource.MouseMove\n | IncrementalSource.TouchMove\n | IncrementalSource.Drag,\n) => void;\n\nexport type mousePosition = {\n x: number;\n y: number;\n id: number;\n timeOffset: number;\n};\n\nexport type mouseMovePos = {\n x: number;\n y: number;\n id: number;\n debugData: incrementalData;\n};\n\nexport enum MouseInteractions {\n MouseUp,\n MouseDown,\n Click,\n ContextMenu,\n DblClick,\n Focus,\n Blur,\n TouchStart,\n TouchMove_Departed, // we will start a separate observer for touch move event\n TouchEnd,\n TouchCancel,\n}\n\nexport enum CanvasContext {\n '2D',\n WebGL,\n WebGL2,\n}\n\nexport type SerializedWebGlArg =\n | {\n rr_type: 'ArrayBuffer';\n base64: string; // base64\n }\n | {\n rr_type: string;\n src: string; // url of image\n }\n | {\n rr_type: string;\n args: Array<SerializedWebGlArg>;\n }\n | {\n rr_type: string;\n index: number;\n }\n | string\n | number\n | boolean\n | null\n | SerializedWebGlArg[];\n\ntype mouseInteractionParam = {\n type: MouseInteractions;\n id: number;\n x: number;\n y: number;\n};\n\nexport type mouseInteractionCallBack = (d: mouseInteractionParam) => void;\n\nexport type scrollPosition = {\n id: number;\n x: number;\n y: number;\n};\n\nexport type scrollCallback = (p: scrollPosition) => void;\n\nexport type styleSheetAddRule = {\n rule: string;\n index?: number | number[];\n};\n\nexport type styleSheetDeleteRule = {\n index: number | number[];\n};\n\nexport type styleSheetRuleParam = {\n id: number;\n removes?: styleSheetDeleteRule[];\n adds?: styleSheetAddRule[];\n};\n\nexport type styleSheetRuleCallback = (s: styleSheetRuleParam) => void;\n\nexport type styleDeclarationParam = {\n id: number;\n index: number[];\n set?: {\n property: string;\n value: string | null;\n priority: string | undefined;\n };\n remove?: {\n property: string;\n };\n};\n\nexport type styleDeclarationCallback = (s: styleDeclarationParam) => void;\n\nexport type canvasMutationCommand = {\n property: string;\n args: Array<unknown>;\n setter?: true;\n};\n\nexport type canvasMutationParam =\n | {\n id: number;\n type: CanvasContext;\n commands: canvasMutationCommand[];\n }\n | ({\n id: number;\n type: CanvasContext;\n } & canvasMutationCommand);\n\nexport type canvasMutationWithType = {\n type: CanvasContext;\n} & canvasMutationCommand;\n\nexport type canvasMutationCallback = (p: canvasMutationParam) => void;\n\nexport type canvasManagerMutationCallback = (\n target: HTMLCanvasElement,\n p: canvasMutationWithType,\n) => void;\n\nexport type fontParam = {\n family: string;\n fontSource: string;\n buffer: boolean;\n descriptors?: FontFaceDescriptors;\n};\n\nexport type fontCallback = (p: fontParam) => void;\n\nexport type viewportResizeDimension = {\n width: number;\n height: number;\n};\n\nexport type viewportResizeCallback = (d: viewportResizeDimension) => void;\n\nexport type inputValue = {\n text: string;\n isChecked: boolean;\n\n // `userTriggered` indicates if this event was triggered directly by user (userTriggered: true)\n // or was triggered indirectly (userTriggered: false)\n // Example of `userTriggered` in action:\n // User clicks on radio element (userTriggered: true) which triggers the other radio element to change (userTriggered: false)\n userTriggered?: boolean;\n};\n\nexport type inputCallback = (v: inputValue & { id: number }) => void;\n\nexport const enum MediaInteractions {\n Play,\n Pause,\n Seeked,\n VolumeChange,\n}\n\nexport type mediaInteractionParam = {\n type: MediaInteractions;\n id: number;\n currentTime?: number;\n volume?: number;\n muted?: boolean;\n};\n\nexport type mediaInteractionCallback = (p: mediaInteractionParam) => void;\n\nexport type DocumentDimension = {\n x: number;\n y: number;\n // scale value relative to its parent iframe\n relativeScale: number;\n // scale value relative to the root iframe\n absoluteScale: number;\n};\n\nexport type Mirror = {\n map: idNodeMap;\n getId: (n: INode) => number;\n getNode: (id: number) => INode | null;\n removeNodeFromMap: (n: INode) => void;\n has: (id: number) => boolean;\n reset: () => void;\n};\n\nexport type throttleOptions = {\n leading?: boolean;\n trailing?: boolean;\n};\n\nexport type listenerHandler = () => void;\nexport type hookResetter = () => void;\n\nexport type ReplayPlugin = {\n handler: (\n event: eventWithTime,\n isSync: boolean,\n context: { replayer: Replayer },\n ) => void;\n};\nexport type playerConfig = {\n speed: number;\n maxSpeed: number;\n root: Element;\n loadTimeout: number;\n skipInactive: boolean;\n showWarning: boolean;\n showDebug: boolean;\n blockClass: string;\n liveMode: boolean;\n insertStyleRules: string[];\n triggerFocus: boolean;\n UNSAFE_replayCanvas: boolean;\n pauseAnimation?: boolean;\n mouseTail:\n | boolean\n | {\n duration?: number;\n lineCap?: string;\n lineWidth?: number;\n strokeStyle?: string;\n };\n unpackFn?: UnpackFn;\n plugins?: ReplayPlugin[];\n inactiveThreshold: number;\n inactiveSkipTime: number;\n};\n\nexport type playerMetaData = {\n startTime: number;\n endTime: number;\n totalTime: number;\n};\n\nexport type missingNode = {\n node: Node;\n mutation: addedNodeMutation;\n};\nexport type missingNodeMap = {\n [id: number]: missingNode;\n};\n\nexport type actionWithDelay = {\n doAction: () => void;\n delay: number;\n};\n\nexport type Handler = (event?: unknown) => void;\n\nexport type Emitter = {\n on(type: string, handler: Handler): void;\n emit(type: string, event?: unknown): void;\n off(type: string, handler: Handler): void;\n};\n\nexport type Arguments<T> = T extends (...payload: infer U) => unknown\n ? U\n : unknown;\n\nexport enum ReplayerEvents {\n Start = 'start',\n Pause = 'pause',\n Resume = 'resume',\n Resize = 'resize',\n Finish = 'finish',\n FullsnapshotRebuilded = 'fullsnapshot-rebuilded',\n LoadStylesheetStart = 'load-stylesheet-start',\n LoadStylesheetEnd = 'load-stylesheet-end',\n SkipStart = 'skip-start',\n SkipEnd = 'skip-end',\n MouseInteraction = 'mouse-interaction',\n EventCast = 'event-cast',\n CustomEvent = 'custom-event',\n Flush = 'flush',\n StateChange = 'state-change',\n PlayBack = 'play-back',\n}\n\n// store the state that would be changed during the process(unmount from dom and mount again)\nexport type ElementState = {\n // [scrollLeft,scrollTop]\n scroll?: [number, number];\n};\n\nexport type KeepIframeSrcFn = (src: string) => boolean;\n\nexport interface HighlightConfiguration {\n enableOnHoverClass?: boolean;\n}\n\ndeclare global {\n interface Window {\n HIG_CONFIGURATION: HighlightConfiguration;\n FontFace: typeof FontFace;\n }\n}\n\nexport type IWindow = Window & typeof globalThis;\n","export enum NodeType {\n Document,\n DocumentType,\n Element,\n Text,\n CDATA,\n Comment,\n}\n\nexport type documentNode = {\n type: NodeType.Document;\n childNodes: serializedNodeWithId[];\n compatMode?: string;\n};\n\nexport type documentTypeNode = {\n type: NodeType.DocumentType;\n name: string;\n publicId: string;\n systemId: string;\n};\n\nexport type attributes = {\n [key: string]: string | number | boolean;\n};\nexport type elementNode = {\n type: NodeType.Element;\n tagName: string;\n attributes: attributes;\n childNodes: serializedNodeWithId[];\n isSVG?: true;\n needBlock?: boolean;\n};\n\nexport type textNode = {\n type: NodeType.Text;\n textContent: string;\n isStyle?: true;\n};\n\nexport type cdataNode = {\n type: NodeType.CDATA;\n textContent: '';\n};\n\nexport type commentNode = {\n type: NodeType.Comment;\n textContent: string;\n};\n\nexport type serializedNode = (\n | documentNode\n | documentTypeNode\n | elementNode\n | textNode\n | cdataNode\n | commentNode\n) & {\n rootId?: number;\n isShadowHost?: boolean;\n isShadow?: boolean;\n};\n\nexport type serializedNodeWithId = serializedNode & { id: number };\n\nexport type tagMap = {\n [key: string]: string;\n};\n\nexport interface INode extends Node {\n __sn: serializedNodeWithId;\n}\n\nexport interface ICanvas extends HTMLCanvasElement {\n __context: string;\n}\n\nexport type idNodeMap = {\n [key: number]: INode;\n};\n\nexport type MaskInputOptions = Partial<{\n color: boolean;\n date: boolean;\n 'datetime-local': boolean;\n email: boolean;\n month: boolean;\n number: boolean;\n range: boolean;\n search: boolean;\n tel: boolean;\n text: boolean;\n time: boolean;\n url: boolean;\n week: boolean;\n // unify textarea and select element with text input\n textarea: boolean;\n select: boolean;\n password: boolean;\n}>;\n\nexport type SlimDOMOptions = Partial<{\n script: boolean;\n comment: boolean;\n headFavicon: boolean;\n headWhitespace: boolean;\n headMetaDescKeywords: boolean;\n headMetaSocial: boolean;\n headMetaRobots: boolean;\n headMetaHttpEquiv: boolean;\n headMetaAuthorship: boolean;\n headMetaVerification: boolean;\n}>;\n\nexport type MaskTextFn = (text: string) => string;\nexport type MaskInputFn = (text: string) => string;\n\nexport type KeepIframeSrcFn = (src: string) => boolean;\n\nexport type BuildCache = {\n stylesWithHoverClass: Map<string, string>;\n};\n","import {\n Mirror,\n throttleOptions,\n listenerHandler,\n hookResetter,\n blockClass,\n eventWithTime,\n EventType,\n IncrementalSource,\n addedNodeMutation,\n removedNodeMutation,\n textMutation,\n attributeMutation,\n mutationData,\n scrollData,\n inputData,\n DocumentDimension,\n IWindow,\n} from './types';\nimport {\n INode,\n IGNORED_NODE,\n serializedNodeWithId,\n NodeType,\n isShadowRoot,\n} from './snapshot';\n\nexport function on(\n type: string,\n fn: EventListenerOrEventListenerObject,\n target: Document | IWindow = document,\n): listenerHandler {\n const options = { capture: true, passive: true };\n target.addEventListener(type, fn, options);\n return () => target.removeEventListener(type, fn, options);\n}\n\nexport function createMirror(): Mirror {\n return {\n map: {},\n getId(n) {\n // if n is not a serialized INode, use -1 as its id.\n if (!n || !n.__sn) {\n return -1;\n }\n return n.__sn.id;\n },\n getNode(id) {\n return this.map[id] || null;\n },\n // TODO: use a weakmap to get rid of manually memory management\n removeNodeFromMap(n) {\n const id = n.__sn && n.__sn.id;\n delete this.map[id];\n if (n.childNodes) {\n n.childNodes.forEach((child) =>\n this.removeNodeFromMap((child as Node) as INode),\n );\n }\n },\n has(id) {\n return this.map.hasOwnProperty(id);\n },\n reset() {\n this.map = {};\n },\n };\n}\n\n// https://github.com/rrweb-io/rrweb/pull/407\nconst DEPARTED_MIRROR_ACCESS_WARNING =\n 'Please stop import mirror directly. Instead of that,' +\n '\\r\\n' +\n 'now you can use replayer.getMirror() to access the mirror instance of a replayer,' +\n '\\r\\n' +\n 'or you can use record.mirror to access the mirror instance during recording.';\nexport let _mirror: Mirror = {\n map: {},\n getId() {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n return -1;\n },\n getNode() {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n return null;\n },\n removeNodeFromMap() {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n },\n has() {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n return false;\n },\n reset() {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n },\n};\nif (typeof window !== 'undefined' && window.Proxy && window.Reflect) {\n _mirror = new Proxy(_mirror, {\n get(target, prop, receiver) {\n if (prop === 'map') {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n }\n return Reflect.get(target, prop, receiver);\n },\n });\n}\n\n// copy from underscore and modified\nexport function throttle<T>(\n func: (arg: T) => void,\n wait: number,\n options: throttleOptions = {},\n) {\n let timeout: ReturnType<typeof setTimeout> | null = null;\n let previous = 0;\n // tslint:disable-next-line: only-arrow-functions\n return function (arg: T) {\n let now = Date.now();\n if (!previous && options.leading === false) {\n previous = now;\n }\n let remaining = wait - (now - previous);\n let context = this;\n let args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = now;\n func.apply(context, args);\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(() => {\n previous = options.leading === false ? 0 : Date.now();\n timeout = null;\n func.apply(context, args);\n }, remaining);\n }\n };\n}\n\nexport function hookSetter<T>(\n target: T,\n key: string | number | symbol,\n d: PropertyDescriptor,\n isRevoked?: boolean,\n win = window,\n): hookResetter {\n const original = win.Object.getOwnPropertyDescriptor(target, key);\n win.Object.defineProperty(\n target,\n key,\n isRevoked\n ? d\n : {\n set(value) {\n // put hooked setter into event loop to avoid of set latency\n setTimeout(() => {\n d.set!.call(this, value);\n }, 0);\n if (original && original.set) {\n original.set.call(this, value);\n }\n },\n },\n );\n return () => hookSetter(target, key, original || {}, true);\n}\n\n// copy from https://github.com/getsentry/sentry-javascript/blob/b2109071975af8bf0316d3b5b38f519bdaf5dc15/packages/utils/src/object.ts\nexport function patch(\n // tslint:disable-next-line:no-any\n source: { [key: string]: any },\n name: string,\n // tslint:disable-next-line:no-any\n replacement: (...args: any[]) => any,\n): () => void {\n try {\n if (!(name in source)) {\n return () => {};\n }\n\n const original = source[name] as () => unknown;\n const wrapped = replacement(original);\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n // tslint:disable-next-line:strict-type-predicates\n if (typeof wrapped === 'function') {\n wrapped.prototype = wrapped.prototype || {};\n Object.defineProperties(wrapped, {\n __rrweb_original__: {\n enumerable: false,\n value: original,\n },\n });\n }\n\n source[name] = wrapped;\n\n return () => {\n source[name] = original;\n };\n } catch {\n return () => {};\n // This can throw if multiple fill happens on a global object like XMLHttpRequest\n // Fixes https://github.com/getsentry/sentry-javascript/issues/2043\n }\n}\n\nexport function getWindowHeight(): number {\n return (\n window.innerHeight ||\n (document.documentElement && document.documentElement.clientHeight) ||\n (document.body && document.body.clientHeight)\n );\n}\n\nexport function getWindowWidth(): number {\n return (\n window.innerWidth ||\n (document.documentElement && document.documentElement.clientWidth) ||\n (document.body && document.body.clientWidth)\n );\n}\n\n/**\n * Start of Highlight Code\n */\nexport const isCanvasNode = (node: Node | null): boolean => {\n try {\n if (node instanceof HTMLElement) {\n return node.tagName === 'CANVAS';\n }\n } catch {\n return false;\n }\n return false;\n};\n/**\n * End of Highlight Code\n */\n\nexport function isBlocked(node: Node | null, blockClass: blockClass): boolean {\n if (!node) {\n return false;\n }\n if (node.nodeType === node.ELEMENT_NODE) {\n let needBlock = false;\n if (typeof blockClass === 'string') {\n if ((node as HTMLElement).closest !== undefined) {\n return (node as HTMLElement).closest('.' + blockClass) !== null;\n } else {\n needBlock = (node as HTMLElement).classList.contains(blockClass);\n }\n } else {\n (node as HTMLElement).classList.forEach((className) => {\n if (blockClass.test(className)) {\n needBlock = true;\n }\n });\n }\n return needBlock || isBlocked(node.parentNode, blockClass);\n }\n if (node.nodeType === node.TEXT_NODE) {\n // check parent node since text node do not have class name\n return isBlocked(node.parentNode, blockClass);\n }\n return isBlocked(node.parentNode, blockClass);\n}\n\nexport function isIgnored(n: Node | INode): boolean {\n if ('__sn' in n) {\n return (n as INode).__sn.id === IGNORED_NODE;\n }\n // The main part of the slimDOM check happens in\n // rrweb-snapshot::serializeNodeWithId\n return false;\n}\n\nexport function isAncestorRemoved(target: INode, mirror: Mirror): boolean {\n if (isShadowRoot(target)) {\n return false;\n }\n const id = mirror.getId(target);\n if (!mirror.has(id)) {\n return true;\n }\n if (\n target.parentNode &&\n target.parentNode.nodeType === target.DOCUMENT_NODE\n ) {\n return false;\n }\n // if the root is not document, it means the node is not in the DOM tree anymore\n if (!target.parentNode) {\n return true;\n }\n return isAncestorRemoved((target.parentNode as unknown) as INode, mirror);\n}\n\nexport function isTouchEvent(\n event: MouseEvent | TouchEvent,\n): event is TouchEvent {\n return Boolean((event as TouchEvent).changedTouches);\n}\n\nexport function polyfill(win = window) {\n if ('NodeList' in win && !win.NodeList.prototype.forEach) {\n win.NodeList.prototype.forEach = (Array.prototype\n .forEach as unknown) as NodeList['forEach'];\n }\n\n if ('DOMTokenList' in win && !win.DOMTokenList.prototype.forEach) {\n win.DOMTokenList.prototype.forEach = (Array.prototype\n .forEach as unknown) as DOMTokenList['forEach'];\n }\n\n // https://github.com/Financial-Times/polyfill-service/pull/183\n if (!Node.prototype.contains) {\n Node.prototype.contains = function contains(node) {\n if (!(0 in arguments)) {\n throw new TypeError('1 argument is required');\n }\n\n do {\n if (this === node) {\n return true;\n }\n // tslint:disable-next-line: no-conditional-assignment\n } while ((node = node && node.parentNode));\n\n return false;\n };\n }\n}\n\nexport type TreeNode = {\n id: number;\n mutation: addedNodeMutation;\n parent?: TreeNode;\n children: Record<number, TreeNode>;\n texts: textMutation[];\n attributes: attributeMutation[];\n};\nexport class TreeIndex {\n public tree!: Record<number, TreeNode>;\n\n private removeNodeMutations!: removedNodeMutation[];\n private textMutations!: textMutation[];\n private attributeMutations!: attributeMutation[];\n private indexes!: Map<number, TreeNode>;\n private removeIdSet!: Set<number>;\n private scrollMap!: Map<number, scrollData>;\n private inputMap!: Map<number, inputData>;\n\n constructor() {\n this.reset();\n }\n\n public add(mutation: addedNodeMutation) {\n const parentTreeNode = this.indexes.get(mutation.parentId);\n const treeNode: TreeNode = {\n id: mutation.node.id,\n mutation,\n children: [],\n texts: [],\n attributes: [],\n };\n if (!parentTreeNode) {\n this.tree[treeNode.id] = treeNode;\n } else {\n treeNode.parent = parentTreeNode;\n parentTreeNode.children[treeNode.id] = treeNode;\n }\n this.indexes.set(treeNode.id, treeNode);\n }\n\n public remove(mutation: removedNodeMutation, mirror: Mirror) {\n const parentTreeNode = this.indexes.get(mutation.parentId);\n const treeNode = this.indexes.get(mutation.id);\n\n const deepRemoveFromMirror = (id: number) => {\n this.removeIdSet.add(id);\n const node = mirror.getNode(id);\n node?.childNodes.forEach((childNode) => {\n if ('__sn' in childNode) {\n deepRemoveFromMirror(((childNode as unknown) as INode).__sn.id);\n }\n });\n };\n const deepRemoveFromTreeIndex = (node: TreeNode) => {\n this.removeIdSet.add(node.id);\n Object.values(node.children).forEach((n) => deepRemoveFromTreeIndex(n));\n const _treeNode = this.indexes.get(node.id);\n if (_treeNode) {\n const _parentTreeNode = _treeNode.parent;\n if (_parentTreeNode) {\n delete _treeNode.parent;\n delete _parentTreeNode.children[_treeNode.id];\n this.indexes.delete(mutation.id);\n }\n }\n };\n\n if (!treeNode) {\n this.removeNodeMutations.push(mutation);\n deepRemoveFromMirror(mutation.id);\n } else if (!parentTreeNode) {\n delete this.tree[treeNode.id];\n this.indexes.delete(treeNode.id);\n deepRemoveFromTreeIndex(treeNode);\n } else {\n delete treeNode.parent;\n delete parentTreeNode.children[treeNode.id];\n this.indexes.delete(mutation.id);\n deepRemoveFromTreeIndex(treeNode);\n }\n }\n\n public text(mutation: textMutation) {\n const treeNode = this.indexes.get(mutation.id);\n if (treeNode) {\n treeNode.texts.push(mutation);\n } else {\n this.textMutations.push(mutation);\n }\n }\n\n public attribute(mutation: attributeMutation) {\n const treeNode = this.indexes.get(mutation.id);\n if (treeNode) {\n treeNode.attributes.push(mutation);\n } else {\n this.attributeMutations.push(mutation);\n }\n }\n\n public scroll(d: scrollData) {\n this.scrollMap.set(d.id, d);\n }\n\n public input(d: inputData) {\n this.inputMap.set(d.id, d);\n }\n\n public flush(): {\n mutationData: mutationData;\n scrollMap: TreeIndex['scrollMap'];\n inputMap: TreeIndex['inputMap'];\n } {\n const {\n tree,\n removeNodeMutations,\n textMutations,\n attributeMutations,\n } = this;\n\n const batchMutationData: mutationData = {\n source: IncrementalSource.Mutation,\n removes: removeNodeMutations,\n texts: textMutations,\n attributes: attributeMutations,\n adds: [],\n };\n\n const walk = (treeNode: TreeNode, removed: boolean) => {\n if (removed) {\n this.removeIdSet.add(treeNode.id);\n }\n batchMutationData.texts = batchMutationData.texts\n .concat(removed ? [] : treeNode.texts)\n .filter((m) => !this.removeIdSet.has(m.id));\n batchMutationData.attributes = batchMutationData.attributes\n .concat(removed ? [] : treeNode.attributes)\n .filter((m) => !this.removeIdSet.has(m.id));\n if (\n !this.removeIdSet.has(treeNode.id) &&\n !this.removeIdSet.has(treeNode.mutation.parentId) &&\n !removed\n ) {\n batchMutationData.adds.push(treeNode.mutation);\n if (treeNode.children) {\n Object.values(treeNode.children).forEach((n) => walk(n, false));\n }\n } else {\n Object.values(treeNode.children).forEach((n) => walk(n, true));\n }\n };\n\n Object.values(tree).forEach((n) => walk(n, false));\n\n for (const id of this.scrollMap.keys()) {\n if (this.removeIdSet.has(id)) {\n this.scrollMap.delete(id);\n }\n }\n for (const id of this.inputMap.keys()) {\n if (this.removeIdSet.has(id)) {\n this.inputMap.delete(id);\n }\n }\n\n const scrollMap = new Map(this.scrollMap);\n const inputMap = new Map(this.inputMap);\n\n this.reset();\n\n return {\n mutationData: batchMutationData,\n scrollMap,\n inputMap,\n };\n }\n\n private reset() {\n this.tree = [];\n this.indexes = new Map();\n this.removeNodeMutations = [];\n this.textMutations = [];\n this.attributeMutations = [];\n this.removeIdSet = new Set();\n this.scrollMap = new Map();\n this.inputMap = new Map();\n }\n\n public idRemoved(id: number): boolean {\n return this.removeIdSet.has(id);\n }\n}\n\ntype ResolveTree = {\n value: addedNodeMutation;\n children: ResolveTree[];\n parent: ResolveTree | null;\n};\n\nexport function queueToResolveTrees(queue: addedNodeMutation[]): ResolveTree[] {\n const queueNodeMap: Record<number, ResolveTree> = {};\n const putIntoMap = (\n m: addedNodeMutation,\n parent: ResolveTree | null,\n ): ResolveTree => {\n const nodeInTree: ResolveTree = {\n value: m,\n parent,\n children: [],\n };\n queueNodeMap[m.node.id] = nodeInTree;\n return nodeInTree;\n };\n\n const queueNodeTrees: ResolveTree[] = [];\n for (const mutation of queue) {\n const { nextId, parentId } = mutation;\n if (nextId && nextId in queueNodeMap) {\n const nextInTree = queueNodeMap[nextId];\n if (nextInTree.parent) {\n const idx = nextInTree.parent.children.indexOf(nextInTree);\n nextInTree.parent.children.splice(\n idx,\n 0,\n putIntoMap(mutation, nextInTree.parent),\n );\n } else {\n const idx = queueNodeTrees.indexOf(nextInTree);\n queueNodeTrees.splice(idx, 0, putIntoMap(mutation, null));\n }\n continue;\n }\n if (parentId in queueNodeMap) {\n const parentInTree = queueNodeMap[parentId];\n parentInTree.children.push(putIntoMap(mutation, parentInTree));\n continue;\n }\n queueNodeTrees.push(putIntoMap(mutation, null));\n }\n\n return queueNodeTrees;\n}\n\nexport function iterateResolveTree(\n tree: ResolveTree,\n cb: (mutation: addedNodeMutation) => unknown,\n) {\n cb(tree.value);\n /**\n * The resolve tree was designed to reflect the DOM layout,\n * but we need append next sibling first, so we do a reverse\n * loop here.\n */\n for (let i = tree.children.length - 1; i >= 0; i--) {\n iterateResolveTree(tree.children[i], cb);\n }\n}\n\ntype HTMLIFrameINode = HTMLIFrameElement & {\n __sn: serializedNodeWithId;\n};\nexport type AppendedIframe = {\n mutationInQueue: addedNodeMutation;\n builtNode: HTMLIFrameINode;\n};\n\nexport function isIframeINode(\n node: INode | ShadowRoot,\n): node is HTMLIFrameINode {\n if ('__sn' in node) {\n return (\n node.__sn.type === NodeType.Element && node.__sn.tagName === 'iframe'\n );\n }\n // node can be document fragment when using the virtual parent feature\n return false;\n}\n\nexport function getBaseDimension(\n node: Node,\n rootIframe: Node,\n): DocumentDimension {\n const frameElement = node.ownerDocument?.defaultView?.frameElement;\n if (!frameElement || frameElement === rootIframe) {\n return {\n x: 0,\n y: 0,\n relativeScale: 1,\n absoluteScale: 1,\n };\n }\n\n const frameDimension = frameElement.getBoundingClientRect();\n const frameBaseDimension = getBaseDimension(frameElement, rootIframe);\n // the iframe element may have a scale transform\n const relativeScale = frameDimension.height / frameElement.clientHeight;\n return {\n x:\n frameDimension.x * frameBaseDimension.relativeScale +\n frameBaseDimension.x,\n y:\n frameDimension.y * frameBaseDimension.relativeScale +\n frameBaseDimension.y,\n relativeScale,\n absoluteScale: frameBaseDimension.absoluteScale * relativeScale,\n };\n}\n\nexport function hasShadowRoot<T extends Node>(\n n: T,\n): n is T & { shadowRoot: ShadowRoot } {\n return Boolean(((n as unknown) as Element)?.shadowRoot);\n}\n\n/**\n * Returns a string of the same length that has been obfuscated.\n */\nexport function obfuscateText(text: string): string {\n // We remove non-printing characters.\n // For example: '&zwnj;' is a character that isn't shown visibly or takes up layout space on the screen. However if you take the length of the string, it's counted as 1.\n // For example: \"&zwnj;1\"'s length is 2 but visually it's only taking up 1 character width.\n // If we don't filter does out, our string obfuscation could have more characters than what was originally presented.\n text = text.replace(/[^ -~]+/g, '');\n text =\n text\n ?.split(' ')\n .map((word) => Math.random().toString(20).substr(2, word.length))\n .join(' ') || '';\n return text;\n}\n","import { listenerHandler, RecordPlugin } from '../../../types';\nimport { stringify } from './stringify';\nimport { StackFrame, ErrorStackParser } from './error-stack-parser';\nimport { patch } from '../../../utils';\n\nexport type StringifyOptions = {\n // limit of string length\n stringLengthLimit?: number;\n /**\n * limit of number of keys in an object\n * if an object contains more keys than this limit, we would call its toString function directly\n */\n numOfKeysLimit: number;\n};\n\ntype LogRecordOptions = {\n level?: LogLevel[] | undefined;\n lengthThreshold?: number;\n stringifyOptions?: StringifyOptions;\n logger?: Logger | string;\n};\n\nconst defaultLogOptions: LogRecordOptions = {\n level: [\n 'assert',\n 'clear',\n 'count',\n 'countReset',\n 'debug',\n 'dir',\n 'dirxml',\n 'error',\n 'group',\n 'groupCollapsed',\n 'groupEnd',\n 'info',\n 'log',\n 'table',\n 'time',\n 'timeEnd',\n 'timeLog',\n 'trace',\n 'warn',\n ],\n lengthThreshold: 1000,\n logger: 'console',\n};\n\nexport type LogData = {\n level: LogLevel;\n trace: string[];\n payload: string[];\n};\n\ntype logCallback = (p: LogData) => void;\n\nexport type LogLevel =\n | 'assert'\n | 'clear'\n | 'count'\n | 'countReset'\n | 'debug'\n | 'dir'\n | 'dirxml'\n | 'error'\n | 'group'\n | 'groupCollapsed'\n | 'groupEnd'\n | 'info'\n | 'log'\n | 'table'\n | 'time'\n | 'timeEnd'\n | 'timeLog'\n | 'trace'\n | 'warn';\n\n/* fork from interface Console */\n// all kinds of console functions\nexport type Logger = {\n assert?: typeof console.assert;\n clear?: typeof console.clear;\n count?: typeof console.count;\n countReset?: typeof console.countReset;\n debug?: typeof console.debug;\n dir?: typeof console.dir;\n dirxml?: typeof console.dirxml;\n error?: typeof console.error;\n group?: typeof console.group;\n groupCollapsed?: typeof console.groupCollapsed;\n groupEnd?: () => void;\n info?: typeof console.info;\n log?: typeof console.log;\n table?: typeof console.table;\n time?: typeof console.time;\n timeEnd?: typeof console.timeEnd;\n timeLog?: typeof console.timeLog;\n trace?: typeof console.trace;\n warn?: typeof console.warn;\n};\n\nfunction initLogObserver(\n cb: logCallback,\n win: Window, // top window or in an iframe\n logOptions: LogRecordOptions,\n): listenerHandler {\n const loggerType = logOptions.logger;\n if (!loggerType) {\n return () => {};\n }\n let logger: Logger;\n if (typeof loggerType === 'string') {\n logger = (win as any)[loggerType];\n } else {\n logger = loggerType;\n }\n let logCount = 0;\n const cancelHandlers: listenerHandler[] = [];\n // add listener to thrown errors\n if (logOptions.level!.includes('error')) {\n if (window) {\n const originalOnError = window.onerror;\n window.onerror = (\n msg: Event | string,\n file: string,\n line: number,\n col: number,\n error: Error,\n ) => {\n if (originalOnError) {\n originalOnError.apply(this, [msg, file, line, col, error]);\n }\n const trace: string[] = ErrorStackParser.parse(\n error,\n ).map((stackFrame: StackFrame) => stackFrame.toString());\n const payload = [stringify(msg, logOptions.stringifyOptions)];\n cb({\n level: 'error',\n trace,\n payload,\n });\n };\n cancelHandlers.push(() => {\n window.onerror = originalOnError;\n });\n }\n }\n for (const levelType of logOptions.level!) {\n cancelHandlers.push(replace(logger, levelType));\n }\n return () => {\n cancelHandlers.forEach((h) => h());\n };\n\n /**\n * replace the original console function and record logs\n * @param logger the logger object such as Console\n * @param level the name of log function to be replaced\n */\n function replace(_logger: Logger, level: LogLevel) {\n if (!_logger[level]) {\n return () => {};\n }\n // replace the logger.{level}. return a restore function\n return patch(_logger, level, (original) => {\n return (...args: Array<unknown>) => {\n original.apply(this, args);\n try {\n const trace = ErrorStackParser.parse(new Error())\n .map((stackFrame: StackFrame) => stackFrame.toString())\n .splice(1); // splice(1) to omit the hijacked log function\n const payload = args.map((s) =>\n stringify(s, logOptions.stringifyOptions),\n );\n logCount++;\n if (logCount < logOptions.lengthThreshold!) {\n cb({\n level,\n trace,\n payload,\n });\n } else if (logCount === logOptions.lengthThreshold) {\n // notify the user\n cb({\n level: 'warn',\n trace: [],\n payload: [\n stringify('The number of log records reached the threshold.'),\n ],\n });\n }\n } catch (error) {\n original('rrweb logger error:', error, ...args);\n }\n };\n });\n }\n}\n\nexport const PLUGIN_NAME = 'rrweb/console@1';\n\nexport const getRecordConsolePlugin: (\n options?: LogRecordOptions,\n) => RecordPlugin = (options) => ({\n name: PLUGIN_NAME,\n observer: initLogObserver,\n options: options\n ? Object.assign({}, defaultLogOptions, options)\n : defaultLogOptions,\n});\n"],"names":["__read","o","n","m","Symbol","iterator","r","e","i","call","ar","next","done","push","value","error","__spread","arguments","length","concat","pathToSelector","node","outerHTML","path","parentElement","name_1","localName","toLowerCase","parent_1","domSiblings","children","sibling","indexOf","stringify","obj","stringifyOptions","options","numOfKeysLimit","Object","assign","stack","keys","JSON","key","thisPos","this","splice","Infinity","slice","join","_obj","shouldToString","str","toString","stringLengthLimit","Event","eventResult","eventKey","eventValue","Array","isArray","Node","HTMLElement","nodeName","EventType","IncrementalSource","MouseInteractions","CanvasContext","MediaInteractions","ReplayerEvents","NodeType","fileName","functionName","lineNumber","columnNumber","StackFrame","FIREFOX_SAFARI_STACK_REGEXP","CHROME_IE_STACK_REGEXP","SAFARI_NATIVE_CODE_REGEXP","ErrorStackParser","parse","stacktrace","parseOpera","match","parseV8OrIE","parseFFOrSafari","Error","extractLocation","urlLike","parts","exec","replace","undefined","split","filter","line","map","sanitizedLine","location","tokens","locationParts","pop","functionNameRegex","matches","message","parseOpera9","parseOpera11","parseOpera10","lineRE","lines","result","len","parseFloat","shift","DEPARTED_MIRROR_ACCESS_WARNING","_mirror","getId","console","getNode","removeNodeFromMap","has","reset","window","Proxy","Reflect","get","target","prop","receiver","defaultLogOptions","level","lengthThreshold","logger","initLogObserver","cb","win","logOptions","loggerType","logCount","cancelHandlers","includes","originalOnError_1","onerror","msg","file","col","apply","_this","trace","stackFrame","payload","_b","s","TypeError","__values","levelType","forEach","h","_logger","source","name","replacement","original_1","wrapped","prototype","defineProperties","__rrweb_original__","enumerable","patch","original","_i","args","observer"],"mappings":";;;;;;;;;;;;;;oFA8HO,SAASA,EAAOC,EAAGC,GACtB,IAAIC,EAAsB,mBAAXC,QAAyBH,EAAEG,OAAOC,UACjD,IAAKF,EAAG,OAAOF,EACf,IAAmBK,EAAYC,EAA3BC,EAAIL,EAAEM,KAAKR,GAAOS,EAAK,GAC3B,IACI,WAAc,IAANR,GAAgBA,KAAM,MAAQI,EAAIE,EAAEG,QAAQC,MAAMF,EAAGG,KAAKP,EAAEQ,OAExE,MAAOC,GAASR,EAAI,CAAEQ,MAAOA,WAEzB,IACQT,IAAMA,EAAEM,OAAST,EAAIK,EAAU,SAAIL,EAAEM,KAAKD,WAExC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AiBC,MAAM,IAAIM,OACtCU,KAAI,SAACqD,GAA2B,OAAAA,EAAWhG,cAC3CP,OAAO,GACJwG,EAAUqB,EAAK3E,KAAI,SAACwD,GACxB,OAAAvH,EAAUuH,EAAGhB,EAAWrG,uBAE1BuG,EACeF,EAAWL,gBACxBG,EAAG,CACDJ,QACAkB,QACAE,YAEOZ,IAAaF,EAAWL,iBAEjCG,EAAG,CACDJ,MAAO,OACPkB,MAAO,GACPE,QAAS,CACPrH,EAAU,uDAIhB,MAAOlB,GACP0J,kBAAS,sBAAuB1J,GAAU4J,SA/BvC,mCAsCc,2CAIP,SAACvI,GAAY,OAC/B4H,KALyB,kBAMzBY,SAAUvC,EACVjG,QAASA,EACLE,OAAOC,OAAO,GAAI0F,EAAmB7F,GACrC6F"}
@@ -1,4 +0,0 @@
1
- export * from '../index';
2
- export * from '../packer';
3
- export * from '../plugins/console/record';
4
- export * from '../plugins/console/replay';
@@ -1,2 +0,0 @@
1
- export * from '../record/index';
2
- export * from '../packer/pack';
@@ -1,2 +0,0 @@
1
- export * from '../replay';
2
- export * from '../packer/unpack';
@@ -1,9 +0,0 @@
1
- import record from './record';
2
- import { Replayer } from './replay';
3
- import { _mirror } from './utils';
4
- import * as utils from './utils';
5
- export { EventType, IncrementalSource, MouseInteractions, ReplayerEvents, HighlightConfiguration, } from './types';
6
- declare const addCustomEvent: <T>(tag: string, payload: T) => void;
7
- declare const freezePage: () => void;
8
- export { record, addCustomEvent, freezePage, Replayer, _mirror as mirror, utils, };
9
- export { getRecordSequentialIdPlugin } from './plugins/sequential-id/record';
@@ -1,7 +0,0 @@
1
- import { eventWithTime } from '../types';
2
- export declare type PackFn = (event: eventWithTime) => string;
3
- export declare type UnpackFn = (raw: string) => eventWithTime;
4
- export declare type eventWithTimeAndPacker = eventWithTime & {
5
- v: string;
6
- };
7
- export declare const MARK = "v1";
@@ -1,2 +0,0 @@
1
- export { pack } from './pack';
2
- export { unpack } from './unpack';
@@ -1,2 +0,0 @@
1
- import { PackFn } from './base';
2
- export declare const pack: PackFn;
@@ -1,2 +0,0 @@
1
- import { UnpackFn } from './base';
2
- export declare const unpack: UnpackFn;
@@ -1,37 +0,0 @@
1
- export declare class StackFrame {
2
- private fileName;
3
- private functionName;
4
- private lineNumber?;
5
- private columnNumber?;
6
- constructor(obj: {
7
- fileName?: string;
8
- functionName?: string;
9
- lineNumber?: number;
10
- columnNumber?: number;
11
- });
12
- toString(): string;
13
- }
14
- export declare const ErrorStackParser: {
15
- parse: (error: Error) => StackFrame[];
16
- extractLocation: (urlLike: string) => (string | undefined)[];
17
- parseV8OrIE: (error: {
18
- stack: string;
19
- }) => StackFrame[];
20
- parseFFOrSafari: (error: {
21
- stack: string;
22
- }) => StackFrame[];
23
- parseOpera: (e: {
24
- stacktrace?: string;
25
- message: string;
26
- stack?: string;
27
- }) => StackFrame[];
28
- parseOpera9: (e: {
29
- message: string;
30
- }) => StackFrame[];
31
- parseOpera10: (e: {
32
- stacktrace: string;
33
- }) => StackFrame[];
34
- parseOpera11: (error: {
35
- stack: string;
36
- }) => StackFrame[];
37
- };
@@ -1,41 +0,0 @@
1
- import { RecordPlugin } from '../../../types';
2
- export declare type StringifyOptions = {
3
- stringLengthLimit?: number;
4
- numOfKeysLimit: number;
5
- };
6
- declare type LogRecordOptions = {
7
- level?: LogLevel[] | undefined;
8
- lengthThreshold?: number;
9
- stringifyOptions?: StringifyOptions;
10
- logger?: Logger | string;
11
- };
12
- export declare type LogData = {
13
- level: LogLevel;
14
- trace: string[];
15
- payload: string[];
16
- };
17
- export declare type LogLevel = 'assert' | 'clear' | 'count' | 'countReset' | 'debug' | 'dir' | 'dirxml' | 'error' | 'group' | 'groupCollapsed' | 'groupEnd' | 'info' | 'log' | 'table' | 'time' | 'timeEnd' | 'timeLog' | 'trace' | 'warn';
18
- export declare type Logger = {
19
- assert?: typeof console.assert;
20
- clear?: typeof console.clear;
21
- count?: typeof console.count;
22
- countReset?: typeof console.countReset;
23
- debug?: typeof console.debug;
24
- dir?: typeof console.dir;
25
- dirxml?: typeof console.dirxml;
26
- error?: typeof console.error;
27
- group?: typeof console.group;
28
- groupCollapsed?: typeof console.groupCollapsed;
29
- groupEnd?: () => void;
30
- info?: typeof console.info;
31
- log?: typeof console.log;
32
- table?: typeof console.table;
33
- time?: typeof console.time;
34
- timeEnd?: typeof console.timeEnd;
35
- timeLog?: typeof console.timeLog;
36
- trace?: typeof console.trace;
37
- warn?: typeof console.warn;
38
- };
39
- export declare const PLUGIN_NAME = "rrweb/console@1";
40
- export declare const getRecordConsolePlugin: (options?: LogRecordOptions) => RecordPlugin;
41
- export {};
@@ -1,2 +0,0 @@
1
- import { StringifyOptions } from './index';
2
- export declare function stringify(obj: any, stringifyOptions?: StringifyOptions): string;
@@ -1,9 +0,0 @@
1
- import { LogLevel, LogData } from '../record';
2
- import { ReplayPlugin } from '../../../types';
3
- declare type ReplayLogger = Partial<Record<LogLevel, (data: LogData) => void>>;
4
- declare type LogReplayConfig = {
5
- level?: LogLevel[] | undefined;
6
- replayLogger: ReplayLogger | undefined;
7
- };
8
- export declare const getReplayConsolePlugin: (options?: LogReplayConfig) => ReplayPlugin;
9
- export {};
@@ -1,6 +0,0 @@
1
- import { RecordPlugin } from '../../../types';
2
- export declare type SequentialIdOptions = {
3
- key: string;
4
- };
5
- export declare const PLUGIN_NAME = "rrweb/sequential-id@1";
6
- export declare const getRecordSequentialIdPlugin: (options?: Partial<SequentialIdOptions>) => RecordPlugin;
@@ -1,7 +0,0 @@
1
- import type { SequentialIdOptions } from '../record';
2
- import { ReplayPlugin } from '../../../types';
3
- declare type Options = SequentialIdOptions & {
4
- warnOnMissingId: boolean;
5
- };
6
- export declare const getReplaySequentialIdPlugin: (options?: Partial<Options>) => ReplayPlugin;
7
- export {};
@@ -1,13 +0,0 @@
1
- import { serializedNodeWithId, INode } from '../snapshot';
2
- import { mutationCallBack } from '../types';
3
- export declare class IframeManager {
4
- private iframes;
5
- private mutationCb;
6
- private loadListener?;
7
- constructor(options: {
8
- mutationCb: mutationCallBack;
9
- });
10
- addIframe(iframeEl: HTMLIFrameElement): void;
11
- addLoadListener(cb: (iframeEl: HTMLIFrameElement) => unknown): void;
12
- attachIframe(iframeEl: INode, childSn: serializedNodeWithId): void;
13
- }
@@ -1,9 +0,0 @@
1
- import { eventWithTime, recordOptions, listenerHandler } from '../types';
2
- declare function record<T = eventWithTime>(options?: recordOptions<T>): listenerHandler | undefined;
3
- declare namespace record {
4
- var addCustomEvent: <T>(tag: string, payload: T) => void;
5
- var freezePage: () => void;
6
- var takeFullSnapshot: (isCheckout?: boolean | undefined) => void;
7
- var mirror: import("../types").Mirror;
8
- }
9
- export default record;
@@ -1,45 +0,0 @@
1
- import { MaskInputOptions, SlimDOMOptions, MaskTextFn, MaskInputFn } from '../snapshot';
2
- import { mutationRecord, blockClass, maskTextClass, mutationCallBack, Mirror } from '../types';
3
- import { IframeManager } from './iframe-manager';
4
- import { CanvasManager } from './observers/canvas/canvas-manager';
5
- import { ShadowDomManager } from './shadow-dom-manager';
6
- export default class MutationBuffer {
7
- private frozen;
8
- private locked;
9
- private texts;
10
- private attributes;
11
- private removes;
12
- private mapRemoves;
13
- private movedMap;
14
- private addedSet;
15
- private movedSet;
16
- private droppedSet;
17
- private emissionCallback;
18
- private blockClass;
19
- private blockSelector;
20
- private maskTextClass;
21
- private maskTextSelector;
22
- private inlineStylesheet;
23
- private maskInputOptions;
24
- private maskTextFn;
25
- private maskInputFn;
26
- private recordCanvas;
27
- private enableStrictPrivacy;
28
- private slimDOMOptions;
29
- private doc;
30
- private mirror;
31
- private iframeManager;
32
- private shadowDomManager;
33
- private canvasManager;
34
- init(cb: mutationCallBack, blockClass: blockClass, blockSelector: string | null, maskTextClass: maskTextClass, maskTextSelector: string | null, inlineStylesheet: boolean, maskInputOptions: MaskInputOptions, maskTextFn: MaskTextFn | undefined, maskInputFn: MaskInputFn | undefined, recordCanvas: boolean, slimDOMOptions: SlimDOMOptions, doc: Document, mirror: Mirror, iframeManager: IframeManager, shadowDomManager: ShadowDomManager, canvasManager: CanvasManager, enableStrictPrivacy: boolean): void;
35
- freeze(): void;
36
- unfreeze(): void;
37
- isFrozen(): boolean;
38
- lock(): void;
39
- unlock(): void;
40
- reset(): void;
41
- processMutations: (mutations: mutationRecord[]) => void;
42
- emit: () => void;
43
- private processMutation;
44
- private genAdds;
45
- }
@@ -1,11 +0,0 @@
1
- import { MaskInputOptions, SlimDOMOptions, MaskInputFn, MaskTextFn } from '../snapshot';
2
- import { mutationCallBack, observerParam, listenerHandler, scrollCallback, blockClass, maskTextClass, hooksParam, SamplingStrategy, Mirror } from '../types';
3
- import MutationBuffer from './mutation';
4
- import { IframeManager } from './iframe-manager';
5
- import { ShadowDomManager } from './shadow-dom-manager';
6
- import { CanvasManager } from './observers/canvas/canvas-manager';
7
- export declare const mutationBuffers: MutationBuffer[];
8
- 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, maskInputFn: MaskInputFn | undefined, recordCanvas: boolean, slimDOMOptions: SlimDOMOptions, mirror: Mirror, iframeManager: IframeManager, shadowDomManager: ShadowDomManager, canvasManager: CanvasManager, rootEl: Node, enableStrictPrivacy: boolean): MutationObserver;
9
- export declare function initScrollObserver(cb: scrollCallback, doc: Document, mirror: Mirror, blockClass: blockClass, sampling: SamplingStrategy): listenerHandler;
10
- export declare const INPUT_TAGS: string[];
11
- export declare function initObservers(o: observerParam, hooks?: hooksParam): listenerHandler;
@@ -1,2 +0,0 @@
1
- import { blockClass, canvasManagerMutationCallback, IWindow, listenerHandler, Mirror } from '../../../types';
2
- export default function initCanvas2DMutationObserver(cb: canvasManagerMutationCallback, win: IWindow, blockClass: blockClass, mirror: Mirror): listenerHandler;