| 123 |
- var rrweb=function(e){"use strict";var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(t||(t={}));var r=1;function o(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce(function(e,t){return e+(function(e){return"styleSheet"in e}(n=t)?o(n.styleSheet)||"":n.cssText);var n},""):null}catch(e){return null}}var i=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,a=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,s=/^(data:)([\w\/\+\-]+);(charset=[\w-]+|base64).*,(.*)/i;function c(e,t){return e.replace(i,function(e,n,r,o){var i,c=n||r||o;if(!c)return e;if(!a.test(c))return"url('"+c+"')";if(s.test(c))return"url("+c+")";if("/"===c[0])return"url('"+(((i=t).indexOf("//")>-1?i.split("/").slice(0,3).join("/"):i.split("/")[0]).split("?")[0]+c)+"')";var l=t.split("/"),u=c.split("/");l.pop();for(var f=0,d=u;f<d.length;f++){var p=d[f];"."!==p&&(".."===p?l.pop():l.push(p))}return"url('"+l.join("/")+"')"})}function l(e,t){var n=e.createElement("a");return n.href=t,n.href}function u(e,n,i,a,s,f,d){void 0===s&&(s=!1),void 0===f&&(f=!0),void 0===d&&(d=!1);var p,h=function(e,n,r,i,a){switch(e.nodeType){case e.DOCUMENT_NODE:return{type:t.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:t.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:var s=!1;"string"==typeof r?s=e.classList.contains(r):e.classList.forEach(function(e){r.test(e)&&(s=!0)});for(var u=e.tagName.toLowerCase(),f={},d=0,p=Array.from(e.attributes);d<p.length;d++){var h=p[d],m=h.name,v=h.value;f[m]="src"===m||"href"===m?l(n,v):"style"===m?c(v,location.href):v}if("link"===u&&i){var y,g=Array.from(n.styleSheets).find(function(t){return t.href===e.href});(y=o(g))&&(delete f.rel,delete f.href,f._cssText=c(y,g.href))}if("style"===u&&e.sheet&&!(e.innerText||e.textContent||"").trim().length&&(y=o(e.sheet))&&(f._cssText=c(y,location.href)),"input"!==u&&"textarea"!==u&&"select"!==u||(v=e.value,"radio"!==f.type&&"checkbox"!==f.type&&v?f.value=a?"*".repeat(v.length):v:e.checked&&(f.checked=e.checked)),"option"===u){var b=e.parentElement;f.value===b.value&&(f.selected=e.selected)}if(s){var E=e.getBoundingClientRect(),w=E.width,T=E.height;f.rr_width=w+"px",f.rr_height=T+"px"}return{type:t.Element,tagName:u,attributes:f,childNodes:[],isSVG:(C=e,"svg"===C.tagName||C instanceof SVGElement||void 0),needBlock:s};case e.TEXT_NODE:var I=e.parentNode&&e.parentNode.tagName,S=e.textContent,N="STYLE"===I||void 0;return N&&S&&(S=c(S,location.href)),"SCRIPT"===I&&(S="SCRIPT_PLACEHOLDER"),{type:t.Text,textContent:S||"",isStyle:N};case e.CDATA_SECTION_NODE:return{type:t.CDATA,textContent:""};case e.COMMENT_NODE:return{type:t.Comment,textContent:e.textContent||""};default:return!1}var C}(e,n,a,f,d);if(!h)return console.warn(e,"not serialized"),null;p="__sn"in e?e.__sn.id:r++;var m=Object.assign(h,{id:p});e.__sn=m,i[p]=e;var v=!s;if(m.type===t.Element&&(v=v&&!m.needBlock,delete m.needBlock),(m.type===t.Document||m.type===t.Element)&&v)for(var y=0,g=Array.from(e.childNodes);y<g.length;y++){var b=u(g[y],n,i,a,s,f,d);b&&m.childNodes.push(b)}return m}var f=/\/\*[^*]*\*+([^\/*][^*]*\*+)*\//g;function d(e,t){void 0===t&&(t={});var n=1,r=1;function o(e){var t=e.match(/\n/g);t&&(n+=t.length);var o=e.lastIndexOf("\n");r=-1===o?r+e.length:e.length-o}function i(){var e={line:n,column:r};return function(t){return t.position=new a(e),m(),t}}var a=function(){return function(e){this.start=e,this.end={line:n,column:r},this.source=t.source}}();a.prototype.content=e;var s=[];function c(o){var i=new Error(t.source+":"+n+":"+r+": "+o);if(i.reason=o,i.filename=t.source,i.line=n,i.column=r,i.source=e,!t.silent)throw i;s.push(i)}function l(){return h(/^{\s*/)}function u(){return h(/^}/)}function d(){var t,n=[];for(m(),v(n);e.length&&"}"!==e.charAt(0)&&(t=x()||M());)!1!==t&&(n.push(t),v(n));return n}function h(t){var n=t.exec(e);if(n){var r=n[0];return o(r),e=e.slice(r.length),n}}function m(){h(/^\s*/)}function v(e){var t;for(void 0===e&&(e=[]);t=y();)!1!==t&&e.push(t),t=y();return e}function y(){var t=i();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var n=2;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return c("End of comment missing");var a=e.slice(2,n-2);return r+=2,o(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}}function g(){var e=h(/^([^{]+)/);if(e)return p(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(e){return e.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(e){return e.replace(/\u200C/g,",")})}function b(){var e=i(),t=h(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var n=p(t[0]);if(!h(/^:\s*/))return c("property missing ':'");var r=h(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:n.replace(f,""),value:r?p(r[0]).replace(f,""):""});return h(/^[;\s]*/),o}}function E(){var e,t=[];if(!l())return c("missing '{'");for(v(t);e=b();)!1!==e&&(t.push(e),v(t)),e=b();return u()?t:c("missing '}'")}function w(){for(var e,t=[],n=i();e=h(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),h(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:E()})}var T,I=C("import"),S=C("charset"),N=C("namespace");function C(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=i(),r=h(t);if(r){var o={type:e};return o[e]=r[1].trim(),n(o)}}}function x(){if("@"===e[0])return function(){var e=i(),t=h(/^@([-\w]+)?keyframes\s*/);if(t){var n=t[1];if(!(t=h(/^([-\w]+)\s*/)))return c("@keyframes missing name");var r,o=t[1];if(!l())return c("@keyframes missing '{'");for(var a=v();r=w();)a.push(r),a=a.concat(v());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:a}):c("@keyframes missing '}'")}}()||function(){var e=i(),t=h(/^@media *([^{]+)/);if(t){var n=p(t[1]);if(!l())return c("@media missing '{'");var r=v().concat(d());return u()?e({type:"media",media:n,rules:r}):c("@media missing '}'")}}()||function(){var e=i(),t=h(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:p(t[1]),media:p(t[2])})}()||function(){var e=i(),t=h(/^@supports *([^{]+)/);if(t){var n=p(t[1]);if(!l())return c("@supports missing '{'");var r=v().concat(d());return u()?e({type:"supports",supports:n,rules:r}):c("@supports missing '}'")}}()||I()||S()||N()||function(){var e=i(),t=h(/^@([-\w]+)?document *([^{]+)/);if(t){var n=p(t[1]),r=p(t[2]);if(!l())return c("@document missing '{'");var o=v().concat(d());return u()?e({type:"document",document:r,vendor:n,rules:o}):c("@document missing '}'")}}()||function(){var e=i();if(h(/^@page */)){var t=g()||[];if(!l())return c("@page missing '{'");for(var n,r=v();n=b();)r.push(n),r=r.concat(v());return u()?e({type:"page",selectors:t,declarations:r}):c("@page missing '}'")}}()||function(){var e=i();if(h(/^@host\s*/)){if(!l())return c("@host missing '{'");var t=v().concat(d());return u()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=i();if(h(/^@font-face\s*/)){if(!l())return c("@font-face missing '{'");for(var t,n=v();t=b();)n.push(t),n=n.concat(v());return u()?e({type:"font-face",declarations:n}):c("@font-face missing '}'")}}()}function M(){var e=i(),t=g();return t?(v(),e({type:"rule",selectors:t,declarations:E()})):c("selector missing")}return function e(t,n){var r=t&&"string"==typeof t.type;var o=r?t:n;for(var i=0,a=Object.keys(t);i<a.length;i++){var s=a[i],c=t[s];Array.isArray(c)?c.forEach(function(t){e(t,o)}):c&&"object"==typeof c&&e(c,o)}r&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null});return t}((T=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:T,parsingErrors:s}}))}function p(e){return e?e.replace(/^\s+|\s+$/g,""):""}var h={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};var m=/([^\\]):hover/g;function v(e){var t=d(e,{silent:!0});return t.stylesheet?(t.stylesheet.rules.forEach(function(t){"selectors"in t&&(t.selectors||[]).forEach(function(t){if(m.test(t)){var n=t.replace(m,"$1.\\:hover");e=e.replace(t,t+", "+n)}})}),e):e}function y(e,n,r){switch(e.type){case t.Document:return n.implementation.createDocument(null,"",null);case t.DocumentType:return n.implementation.createDocumentType(e.name,e.publicId,e.systemId);case t.Element:var o=function(e){var t=h[e.tagName]?h[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e),i=void 0;for(var a in i=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",o):n.createElement(o),e.attributes)if(e.attributes.hasOwnProperty(a)&&!a.startsWith("rr_")){var s=e.attributes[a];s="boolean"==typeof s?"":s;var c="textarea"===o&&"value"===a,l="style"===o&&"_cssText"===a;if(l&&r&&(s=v(s)),c||l){for(var u=n.createTextNode(s),f=0,d=Array.from(i.childNodes);f<d.length;f++){var p=d[f];p.nodeType===i.TEXT_NODE&&i.removeChild(p)}i.appendChild(u);continue}if("iframe"===o&&"src"===a)continue;try{e.isSVG&&"xlink:href"===a?i.setAttributeNS("http://www.w3.org/1999/xlink",a,s):i.setAttribute(a,s)}catch(e){}}else e.attributes.rr_width&&(i.style.width=e.attributes.rr_width),e.attributes.rr_height&&(i.style.height=e.attributes.rr_height);return i;case t.Text:return n.createTextNode(e.isStyle&&r?v(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function g(e,n,r,o,i){void 0===o&&(o=!1),void 0===i&&(i=!0);var a=y(e,n,i);if(!a)return null;if(e.type===t.Document&&(n.close(),n.open(),a=n),a.__sn=e,r[e.id]=a,(e.type===t.Document||e.type===t.Element)&&!o)for(var s=0,c=e.childNodes;s<c.length;s++){var l=c[s],u=g(l,n,r,!1,i);u?a.appendChild(u):console.warn("Failed to rebuild",l)}return a}function b(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var E,w,T,I,S={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return S.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete S.map[t],e.childNodes&&e.childNodes.forEach(function(e){return S.removeNodeFromMap(e)})},has:function(e){return S.map.hasOwnProperty(e)}};function N(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(i){var a=Date.now();o||!1!==n.leading||(o=a);var s=t-(a-o),c=this,l=arguments;s<=0||s>t?(r&&(window.clearTimeout(r),r=null),o=a,e.apply(c,l)):r||!1===n.trailing||(r=window.setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(c,l)},s))}}function C(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function x(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function M(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;return"string"==typeof t?n=e.classList.contains(t):e.classList.forEach(function(e){t.test(e)&&(n=!0)}),n||M(e.parentNode,t)}return M(e.parentNode,t)}function k(e){return Boolean(e.changedTouches)}function D(){"NodeList"in window&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach)}function A(e,t){e.delete(t),t.childNodes.forEach(function(t){return A(e,t)})}function O(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||O(e,n))}(E=e.EventType||(e.EventType={}))[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",(w=e.IncrementalSource||(e.IncrementalSource={}))[w.Mutation=0]="Mutation",w[w.MouseMove=1]="MouseMove",w[w.MouseInteraction=2]="MouseInteraction",w[w.Scroll=3]="Scroll",w[w.ViewportResize=4]="ViewportResize",w[w.Input=5]="Input",w[w.TouchMove=6]="TouchMove",(T=e.MouseInteractions||(e.MouseInteractions={}))[T.MouseUp=0]="MouseUp",T[T.MouseDown=1]="MouseDown",T[T.Click=2]="Click",T[T.ContextMenu=3]="ContextMenu",T[T.DblClick=4]="DblClick",T[T.Focus=5]="Focus",T[T.Blur=6]="Blur",T[T.TouchStart=7]="TouchStart",T[T.TouchMove_Departed=8]="TouchMove_Departed",T[T.TouchEnd=9]="TouchEnd",(I=e.ReplayerEvents||(e.ReplayerEvents={})).Start="start",I.Pause="pause",I.Resume="resume",I.Resize="resize",I.Finish="finish",I.FullsnapshotRebuilded="fullsnapshot-rebuilded",I.LoadStylesheetStart="load-stylesheet-start",I.LoadStylesheetEnd="load-stylesheet-end",I.SkipStart="skip-start",I.SkipEnd="skip-end",I.MouseInteraction="mouse-interaction";var L=function(e,t){return e+"@"+t};function R(e){return"__sn"in e}function _(e,t,n,r){var o=new MutationObserver(function(o){var i=[],a=[],s=[],c=[],l=new Set,f=new Set,d=new Set,p={},h=function(e,n){if(!M(e,t)){if(R(e)){f.add(e);var r=null;n&&R(n)&&(r=n.__sn.id),r&&(p[L(e.__sn.id,r)]=!0)}else l.add(e),d.delete(e);e.childNodes.forEach(function(e){return h(e)})}};o.forEach(function(e){var n=e.type,r=e.target,o=e.oldValue,c=e.addedNodes,u=e.removedNodes,m=e.attributeName;switch(n){case"characterData":var v=r.textContent;M(r,t)||v===o||i.push({value:v,node:r});break;case"attributes":v=r.getAttribute(m);if(M(r,t)||v===o)return;var y=a.find(function(e){return e.node===r});y||(y={node:r,attributes:{}},a.push(y)),y.attributes[m]=v;break;case"childList":c.forEach(function(e){return h(e,r)}),u.forEach(function(e){var n=S.getId(e),o=S.getId(r);M(e,t)||(l.has(e)?(A(l,e),d.add(e)):l.has(r)&&-1===n||function e(t){var n=S.getId(t);return!S.has(n)||(!t.parentNode||t.parentNode.nodeType!==t.DOCUMENT_NODE)&&(!t.parentNode||e(t.parentNode))}(r)||(f.has(e)&&p[L(n,o)]?A(f,e):s.push({parentId:o,id:n})),S.removeNodeFromMap(e))})}});var m=[],v=function(e){var o=S.getId(e.parentNode);if(-1===o)return m.push(e);c.push({parentId:o,previousId:e.previousSibling?S.getId(e.previousSibling):e.previousSibling,nextId:e.nextSibling?S.getId(e.nextSibling):e.nextSibling,node:u(e,document,S.map,t,!0,n,r)})};for(Array.from(f).forEach(v),Array.from(l).forEach(function(e){O(d,e)||function e(t,n){var r=n.parentNode;if(!r)return!1;var o=S.getId(r);return!!t.some(function(e){return e.id===o})||e(t,r)}(s,e)?O(f,e)?v(e):d.add(e):v(e)});m.length&&!m.every(function(e){return-1===S.getId(e.parentNode)});)v(m.shift());var y={texts:i.map(function(e){return{id:S.getId(e.node),value:e.value}}).filter(function(e){return S.has(e.id)}),attributes:a.map(function(e){return{id:S.getId(e.node),attributes:e.attributes}}).filter(function(e){return S.has(e.id)}),removes:s,adds:c};(y.texts.length||y.attributes.length||y.removes.length||y.adds.length)&&e(y)});return o.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),o}function F(t,n){var r=[];return Object.keys(e.MouseInteractions).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")}).forEach(function(o){var i=o.toLowerCase(),a=function(r){return function(o){if(!M(o.target,n)){var i=S.getId(o.target),a=k(o)?o.changedTouches[0]:o,s=a.clientX,c=a.clientY;t({type:e.MouseInteractions[r],id:i,x:s,y:c})}}}(o);r.push(b(i,a))}),function(){r.forEach(function(e){return e()})}}var B,j=["INPUT","TEXTAREA","SELECT"],z=["color","date","datetime-local","email","month","number","range","search","tel","text","time","url","week"],P=new WeakMap;function X(e,t,r,o){function i(e){var n=e.target;if(n&&n.tagName&&!(j.indexOf(n.tagName)<0)&&!M(n,t)){var i=n.type;if("password"!==i&&!n.classList.contains(r)){var s=n.value,c=!1,l=z.includes(i)||"TEXTAREA"===n.tagName;"radio"===i||"checkbox"===i?c=n.checked:l&&o&&(s="*".repeat(s.length)),a(n,{text:s,isChecked:c});var u=n.name;"radio"===i&&u&&c&&document.querySelectorAll('input[type="radio"][name="'+u+'"]').forEach(function(e){e!==n&&a(e,{text:e.value,isChecked:!c})})}}}function a(t,r){var o=P.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){P.set(t,r);var i=S.getId(t);e(n({},r,{id:i}))}}var s=["input","change"].map(function(e){return b(e,i)}),c=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),l=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]];return c&&c.set&&s.push.apply(s,l.map(function(e){return function e(t,n,r,o){var i=Object.getOwnPropertyDescriptor(t,n);return Object.defineProperty(t,n,o?r:{set:function(e){var t=this;setTimeout(function(){r.set.call(t,e)},0),i&&i.set&&i.set.call(this,e)}}),function(){return e(t,n,i||{},!0)}}(e[0],e[1],{set:function(){i({target:this})}})})),function(){s.forEach(function(e){return e()})}}function Y(t,n){void 0===n&&(n={}),function(e,t){var n=e.mutationCb,r=e.mousemoveCb,o=e.mouseInteractionCb,i=e.scrollCb,a=e.viewportResizeCb,s=e.inputCb;e.mutationCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mutation&&t.mutation.apply(t,e),n.apply(void 0,e)},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,e),r.apply(void 0,e)},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,e),o.apply(void 0,e)},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,e),i.apply(void 0,e)},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,e),a.apply(void 0,e)},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,e),s.apply(void 0,e)}}(t,n);var r,o,i,a,s,c,l=_(t.mutationCb,t.blockClass,t.inlineStylesheet,t.maskAllInputs),u=(r=t.mousemoveCb,i=[],a=N(function(t){var n=Date.now()-o;r(i.map(function(e){return e.timeOffset-=n,e}),t?e.IncrementalSource.TouchMove:e.IncrementalSource.MouseMove),i=[],o=null},500),s=N(function(e){var t=e.target,n=k(e)?e.changedTouches[0]:e,r=n.clientX,s=n.clientY;o||(o=Date.now()),i.push({x:r,y:s,id:S.getId(t),timeOffset:Date.now()-o}),a(k(e))},50,{trailing:!1}),c=[b("mousemove",s),b("touchmove",s)],function(){c.forEach(function(e){return e()})}),f=F(t.mouseInteractionCb,t.blockClass),d=function(e,t){return b("scroll",N(function(n){if(n.target&&!M(n.target,t)){var r=S.getId(n.target);if(n.target===document){var o=document.scrollingElement||document.documentElement;e({id:r,x:o.scrollLeft,y:o.scrollTop})}else e({id:r,x:n.target.scrollLeft,y:n.target.scrollTop})}},100))}(t.scrollCb,t.blockClass),p=function(e){return b("resize",N(function(){var t=C(),n=x();e({width:Number(n),height:Number(t)})},200),window)}(t.viewportResizeCb),h=X(t.inputCb,t.blockClass,t.ignoreClass,t.maskAllInputs);return function(){l.disconnect(),u(),f(),d(),p(),h()}}function H(e){return n({},e,{timestamp:Date.now()})}function V(t){void 0===t&&(t={});var r,o=t.emit,i=t.checkoutEveryNms,a=t.checkoutEveryNth,s=t.blockClass,c=void 0===s?"rr-block":s,l=t.ignoreClass,f=void 0===l?"rr-ignore":l,d=t.inlineStylesheet,p=void 0===d||d,h=t.maskAllInputs,m=void 0!==h&&h,v=t.hooks;if(!o)throw new Error("emit function is required");D();var y=0;function g(t){void 0===t&&(t=!1),B(H({type:e.EventType.Meta,data:{href:window.location.href,width:x(),height:C()}}),t);var n=function(e,t,n,r){void 0===t&&(t="rr-block"),void 0===n&&(n=!0),void 0===r&&(r=!1);var o={};return[u(e,e,o,t,!1,n,r),o]}(document,c,p,m),r=n[0],o=n[1];if(!r)return console.warn("Failed to snapshot the document");S.map=o,B(H({type:e.EventType.FullSnapshot,data:{node:r,initialOffset:{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}}}))}B=function(t,n){if(o(t,n),t.type===e.EventType.FullSnapshot)r=t,y=0;else if(t.type===e.EventType.IncrementalSnapshot){y++;var s=a&&y>=a,c=i&&t.timestamp-r.timestamp>i;(s||c)&&g(!0)}};try{var E=[];E.push(b("DOMContentLoaded",function(){B(H({type:e.EventType.DomContentLoaded,data:{}}))}));var w=function(){g(),E.push(Y({mutationCb:function(t){return B(H({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Mutation},t)}))},mousemoveCb:function(t,n){return B(H({type:e.EventType.IncrementalSnapshot,data:{source:n,positions:t}}))},mouseInteractionCb:function(t){return B(H({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.MouseInteraction},t)}))},scrollCb:function(t){return B(H({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Scroll},t)}))},viewportResizeCb:function(t){return B(H({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.ViewportResize},t)}))},inputCb:function(t){return B(H({type:e.EventType.IncrementalSnapshot,data:n({source:e.IncrementalSource.Input},t)}))},blockClass:c,ignoreClass:f,maskAllInputs:m,inlineStylesheet:p},v))};return"interactive"===document.readyState||"complete"===document.readyState?w():E.push(b("load",function(){B(H({type:e.EventType.Load,data:{}})),w()},window)),function(){E.forEach(function(e){return e()})}}catch(e){console.warn(e)}}function U(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map(function(e){e(n)}),(e["*"]||[]).slice().map(function(e){e(t,n)})}}}V.addCustomEvent=function(t,n){if(!B)throw new Error("please add custom event after start recording");B(H({type:e.EventType.Custom,data:{tag:t,payload:n}}))};var W=Object.freeze({default:U});var G,q=(function(e,t){!function(){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style&&!0!==e.__forceSmoothScrollPolyfill__)){var n,r=e.HTMLElement||e.Element,o=468,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||c,scrollIntoView:r.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,s=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var n=function(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function c(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(e,t){return"Y"===t?e.clientHeight+s<e.scrollHeight:"X"===t?e.clientWidth+s<e.scrollWidth:void 0}function f(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function d(e){var t=u(e,"Y")&&f(e,"Y"),n=u(e,"X")&&f(e,"X");return t||n}function p(t){var n,r,i,s,c=(a()-t.startTime)/o;s=c=c>1?1:c,n=.5*(1-Math.cos(Math.PI*s)),r=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,i),r===t.x&&i===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,r,o){var s,l,u,f,d=a();n===t.body?(s=e,l=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,f=i.scroll):(s=n,l=n.scrollLeft,u=n.scrollTop,f=c),p({scrollable:s,method:f,startTime:d,startX:l,startY:u,x:r,y:o})}}}}()}(G={exports:{}},G.exports),G.exports).polyfill,$=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,e)},e.prototype.start=function(){this.actions.sort(function(e,t){return e.delay-t.delay}),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,r=this;this.raf=requestAnimationFrame(function o(i){for(r.timeOffset+=(i-e)*n.speed,e=i;t.length;){var a=t[0];if(!(r.timeOffset>=a.delay))break;t.shift(),a.doAction()}(t.length>0||r.config.liveMode)&&(r.raf=requestAnimationFrame(o))})},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r;n=r-1}}return t},e}(),Z=U||W,J=function(){function t(e,t){if(this.events=[],this.emitter=Z(),this.baselineTime=0,this.noramlSpeed=-1,this.missingNodeRetryMap={},e.length<2)throw new Error("Replayer need at least 2 events.");this.events=e,this.handleResize=this.handleResize.bind(this);var n={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[]};this.config=Object.assign({},n,t),this.timer=new $(this.config),q(),D(),this.setupDom(),this.emitter.on("resize",this.handleResize)}return t.prototype.on=function(e,t){this.emitter.on(e,t)},t.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach(function(n){t.config[n]=e[n]}),this.config.skipInactive||(this.noramlSpeed=-1)},t.prototype.getMetaData=function(){var e=this.events[0];return{totalTime:this.events[this.events.length-1].timestamp-e.timestamp}},t.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},t.prototype.getTimeOffset=function(){return this.baselineTime-this.events[0].timestamp},t.prototype.play=function(t){void 0===t&&(t=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+t;for(var n=new Array,r=0,o=this.events;r<o.length;r++){var i=o[r],a=i.timestamp<this.baselineTime,s=this.getCastFn(i,a);a?s():n.push({doAction:s,delay:this.getDelay(i)})}this.timer.addActions(n),this.timer.start(),this.emitter.emit(e.ReplayerEvents.Start)},t.prototype.pause=function(){this.timer.clear(),this.emitter.emit(e.ReplayerEvents.Pause)},t.prototype.resume=function(t){void 0===t&&(t=0),this.timer.clear(),this.baselineTime=this.events[0].timestamp+t;for(var n=new Array,r=0,o=this.events;r<o.length;r++){var i=o[r];if(!(i.timestamp<=this.lastPlayedEvent.timestamp||i===this.lastPlayedEvent)){var a=this.getCastFn(i);n.push({doAction:a,delay:this.getDelay(i)})}}this.timer.addActions(n),this.timer.start(),this.emitter.emit(e.ReplayerEvents.Resume)},t.prototype.addEvent=function(e){this.getCastFn(e,!0)()},t.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.iframe.setAttribute("scrolling","no"),this.iframe.setAttribute("style","pointer-events: none"),this.wrapper.appendChild(this.iframe)},t.prototype.handleResize=function(e){this.iframe.width=e.width+"px",this.iframe.height=e.height+"px"},t.prototype.getDelay=function(t){if(t.type===e.EventType.IncrementalSnapshot&&t.data.source===e.IncrementalSource.MouseMove){var n=t.data.positions[0].timeOffset,r=t.timestamp+n;return t.delay=r-this.baselineTime,r-this.baselineTime}return t.delay=t.timestamp-this.baselineTime,t.timestamp-this.baselineTime},t.prototype.getCastFn=function(t,n){var r,o=this;switch(void 0===n&&(n=!1),t.type){case e.EventType.DomContentLoaded:case e.EventType.Load:break;case e.EventType.Meta:r=function(){return o.emitter.emit(e.ReplayerEvents.Resize,{width:t.data.width,height:t.data.height})};break;case e.EventType.FullSnapshot:r=function(){o.rebuildFullSnapshot(t),o.iframe.contentWindow.scrollTo(t.data.initialOffset)};break;case e.EventType.IncrementalSnapshot:r=function(){if(o.applyIncremental(t,n),t===o.nextUserInteractionEvent&&(o.nextUserInteractionEvent=null,o.restoreSpeed()),o.config.skipInactive&&!o.nextUserInteractionEvent){for(var r=0,i=o.events;r<i.length;r++){var a=i[r];if(!(a.timestamp<=t.timestamp)&&o.isUserInteraction(a)){a.delay-t.delay>1e4*o.config.speed&&(o.nextUserInteractionEvent=a);break}}if(o.nextUserInteractionEvent){o.noramlSpeed=o.config.speed;var s=o.nextUserInteractionEvent.delay-t.delay,c={speed:Math.min(Math.round(s/5e3),360)};o.setConfig(c),o.emitter.emit(e.ReplayerEvents.SkipStart,c)}}}}return function(){r&&r(),o.lastPlayedEvent=t,t===o.events[o.events.length-1]&&(o.restoreSpeed(),o.emitter.emit(e.ReplayerEvents.Finish))}},t.prototype.rebuildFullSnapshot=function(t){Object.keys(this.missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.missingNodeRetryMap),this.missingNodeRetryMap={},S.map=function(e,t,n){void 0===n&&(n=!0);var r={};return[g(e,t,r,!1,n),r]}(t.data.node,this.iframe.contentDocument)[1];var n=document.createElement("style"),r=this.iframe.contentDocument,o=r.documentElement,i=r.head;o.insertBefore(n,i);for(var a,s=(a=this.config.blockClass,["iframe, ."+a+" { background: #ccc }","noscript { display: none !important; }"]).concat(this.config.insertStyleRules),c=0;c<s.length;c++)n.sheet.insertRule(s[c],c);this.emitter.emit(e.ReplayerEvents.FullsnapshotRebuilded),this.waitForStylesheetLoad()},t.prototype.waitForStylesheetLoad=function(){var t=this,n=this.iframe.contentDocument.head;if(n){var r,o=new Set;n.querySelectorAll('link[rel="stylesheet"]').forEach(function(n){n.sheet||(0===o.size&&(t.pause(),t.emitter.emit(e.ReplayerEvents.LoadStylesheetStart),r=window.setTimeout(function(){t.resume(t.getCurrentTime()),r=-1},t.config.loadTimeout)),o.add(n),n.addEventListener("load",function(){o.delete(n),0===o.size&&-1!==r&&(t.resume(t.getCurrentTime()),t.emitter.emit(e.ReplayerEvents.LoadStylesheetEnd),r&&window.clearTimeout(r))}))})}},t.prototype.applyIncremental=function(t,r){var o=this,i=t.data;switch(i.source){case e.IncrementalSource.Mutation:i.removes.forEach(function(e){var t=S.getNode(e.id);if(!t)return o.warnNodeNotFound(i,e.id);var n=S.getNode(e.parentId);if(!n)return o.warnNodeNotFound(i,e.parentId);S.removeNodeFromMap(t),n&&n.removeChild(t)});var a=n({},this.missingNodeRetryMap),s=[],c=function(e){var t=S.getNode(e.parentId);if(!t)return s.push(e);var n=g(e.node,o.iframe.contentDocument,S.map,!0),r=null,i=null;e.previousId&&(r=S.getNode(e.previousId)),e.nextId&&(i=S.getNode(e.nextId)),-1!==e.previousId&&-1!==e.nextId?(r&&r.nextSibling&&r.nextSibling.parentNode?t.insertBefore(n,r.nextSibling):i&&i.parentNode?t.insertBefore(n,i):t.appendChild(n),(e.previousId||e.nextId)&&o.resolveMissingNode(a,t,n,e)):a[e.node.id]={node:n,mutation:e}};for(i.adds.forEach(function(e){c(e)});s.length;){if(s.every(function(e){return!Boolean(S.getNode(e.parentId))}))return s.forEach(function(e){return o.warnNodeNotFound(i,e.node.id)});var l=s.shift();c(l)}Object.keys(a).length&&Object.assign(this.missingNodeRetryMap,a),i.texts.forEach(function(e){var t=S.getNode(e.id);if(!t)return o.warnNodeNotFound(i,e.id);t.textContent=e.value}),i.attributes.forEach(function(e){var t=S.getNode(e.id);if(!t)return o.warnNodeNotFound(i,e.id);for(var n in e.attributes)if("string"==typeof n){var r=e.attributes[n];null!==r?t.setAttribute(n,r):t.removeAttribute(n)}});break;case e.IncrementalSource.MouseMove:if(r){var u=i.positions[i.positions.length-1];this.moveAndHover(i,u.x,u.y,u.id)}else i.positions.forEach(function(e){var n={doAction:function(){o.moveAndHover(i,e.x,e.y,e.id)},delay:e.timeOffset+t.timestamp-o.baselineTime};o.timer.addAction(n)});break;case e.IncrementalSource.MouseInteraction:if(-1===i.id)break;var f=new Event(e.MouseInteractions[i.type].toLowerCase());if(!(d=S.getNode(i.id)))return this.debugNodeNotFound(i,i.id);switch(this.emitter.emit(e.ReplayerEvents.MouseInteraction,{type:i.type,target:d}),i.type){case e.MouseInteractions.Blur:d.blur&&d.blur();break;case e.MouseInteractions.Focus:d.focus&&d.focus({preventScroll:!0});break;case e.MouseInteractions.Click:case e.MouseInteractions.TouchStart:case e.MouseInteractions.TouchEnd:r||(this.moveAndHover(i,i.x,i.y,i.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:d.dispatchEvent(f)}break;case e.IncrementalSource.Scroll:if(-1===i.id)break;if(!(d=S.getNode(i.id)))return this.debugNodeNotFound(i,i.id);if(d===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:i.y,left:i.x,behavior:r?"auto":"smooth"});else try{d.scrollTop=i.y,d.scrollLeft=i.x}catch(e){}break;case e.IncrementalSource.ViewportResize:this.emitter.emit(e.ReplayerEvents.Resize,{width:i.width,height:i.height});break;case e.IncrementalSource.Input:if(-1===i.id)break;var d;if(!(d=S.getNode(i.id)))return this.debugNodeNotFound(i,i.id);try{d.checked=i.isChecked,d.value=i.text}catch(e){}}},t.prototype.resolveMissingNode=function(e,t,n,r){var o=r.previousId,i=r.nextId,a=o&&e[o],s=i&&e[i];if(a){var c=a,l=c.node,u=c.mutation;t.insertBefore(l,n),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,l,u)}if(s){var f=s;l=f.node,u=f.mutation;t.insertBefore(l,n.nextSibling),delete e[u.node.id],delete this.missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.resolveMissingNode(e,t,l,u)}},t.prototype.moveAndHover=function(e,t,n,r){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var o=S.getNode(r);if(!o)return this.debugNodeNotFound(e,r);this.hoverElements(o)},t.prototype.hoverElements=function(e){this.iframe.contentDocument.querySelectorAll(".\\:hover").forEach(function(e){e.classList.remove(":hover")});for(var t=e;t;)t.classList.add(":hover"),t=t.parentElement},t.prototype.isUserInteraction=function(t){return t.type===e.EventType.IncrementalSnapshot&&(t.data.source>e.IncrementalSource.Mutation&&t.data.source<=e.IncrementalSource.Input)},t.prototype.restoreSpeed=function(){if(-1!==this.noramlSpeed){var t={speed:this.noramlSpeed};this.setConfig(t),this.emitter.emit(e.ReplayerEvents.SkipEnd,t),this.noramlSpeed=-1}},t.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn("[replayer]","Node with id '"+t+"' not found in",e)},t.prototype.debugNodeNotFound=function(e,t){this.config.showDebug&&console.log("[replayer]","Node with id '"+t+"' not found in",e)},t}(),K=V.addCustomEvent;return e.record=V,e.addCustomEvent=K,e.Replayer=J,e.mirror=S,e}({});
- //# sourceMappingURL=rrweb.min.js.map
|