rrweb
Version:
record and replay the web
31 lines • 62.7 kB
JavaScript
var rrwebReplay=function(e){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var t,n=function(){return(n=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function i(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}!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 o=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function a(e,t){void 0===t&&(t={});var n=1,i=1;function r(e){var t=e.match(/\n/g);t&&(n+=t.length);var r=e.lastIndexOf("\n");i=-1===r?i+e.length:e.length-r}function a(){var e={line:n,column:i};return function(t){return t.position=new l(e),m(),t}}var l=function(e){this.start=e,this.end={line:n,column:i},this.source=t.source};l.prototype.content=e;var c=[];function u(r){var o=new Error(t.source+":"+n+":"+i+": "+r);if(o.reason=r,o.filename=t.source,o.line=n,o.column=i,o.source=e,!t.silent)throw o;c.push(o)}function f(){return p(/^{\s*/)}function d(){return p(/^}/)}function h(){var t,n=[];for(m(),v(n);e.length&&"}"!==e.charAt(0)&&(t=M()||T());)!1!==t&&(n.push(t),v(n));return n}function p(t){var n=t.exec(e);if(n){var i=n[0];return r(i),e=e.slice(i.length),n}}function m(){p(/^\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=a();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var n=2;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return u("End of comment missing");var o=e.slice(2,n-2);return i+=2,r(o),e=e.slice(n),i+=2,t({type:"comment",comment:o})}}function g(){var e=p(/^([^{]+)/);if(e)return s(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=a(),t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var n=s(t[0]);if(!p(/^:\s*/))return u("property missing ':'");var i=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),r=e({type:"declaration",property:n.replace(o,""),value:i?s(i[0]).replace(o,""):""});return p(/^[;\s]*/),r}}function w(){var e,t=[];if(!f())return u("missing '{'");for(v(t);e=b();)!1!==e&&(t.push(e),v(t)),e=b();return d()?t:u("missing '}'")}function x(){for(var e,t=[],n=a();e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:w()})}var k,_=N("import"),S=N("charset"),E=N("namespace");function N(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=a(),i=p(t);if(i){var r={type:e};return r[e]=i[1].trim(),n(r)}}}function M(){if("@"===e[0])return function(){var e=a(),t=p(/^@([-\w]+)?keyframes\s*/);if(t){var n=t[1];if(!(t=p(/^([-\w]+)\s*/)))return u("@keyframes missing name");var i,r=t[1];if(!f())return u("@keyframes missing '{'");for(var o=v();i=x();)o.push(i),o=o.concat(v());return d()?e({type:"keyframes",name:r,vendor:n,keyframes:o}):u("@keyframes missing '}'")}}()||function(){var e=a(),t=p(/^@media *([^{]+)/);if(t){var n=s(t[1]);if(!f())return u("@media missing '{'");var i=v().concat(h());return d()?e({type:"media",media:n,rules:i}):u("@media missing '}'")}}()||function(){var e=a(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:s(t[1]),media:s(t[2])})}()||function(){var e=a(),t=p(/^@supports *([^{]+)/);if(t){var n=s(t[1]);if(!f())return u("@supports missing '{'");var i=v().concat(h());return d()?e({type:"supports",supports:n,rules:i}):u("@supports missing '}'")}}()||_()||S()||E()||function(){var e=a(),t=p(/^@([-\w]+)?document *([^{]+)/);if(t){var n=s(t[1]),i=s(t[2]);if(!f())return u("@document missing '{'");var r=v().concat(h());return d()?e({type:"document",document:i,vendor:n,rules:r}):u("@document missing '}'")}}()||function(){var e=a();if(p(/^@page */)){var t=g()||[];if(!f())return u("@page missing '{'");for(var n,i=v();n=b();)i.push(n),i=i.concat(v());return d()?e({type:"page",selectors:t,declarations:i}):u("@page missing '}'")}}()||function(){var e=a();if(p(/^@host\s*/)){if(!f())return u("@host missing '{'");var t=v().concat(h());return d()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=a();if(p(/^@font-face\s*/)){if(!f())return u("@font-face missing '{'");for(var t,n=v();t=b();)n.push(t),n=n.concat(v());return d()?e({type:"font-face",declarations:n}):u("@font-face missing '}'")}}()}function T(){var e=a(),t=g();return t?(v(),e({type:"rule",selectors:t,declarations:w()})):u("selector missing")}return function e(t,n){for(var i=t&&"string"==typeof t.type,r=i?t:n,o=0,a=Object.keys(t);o<a.length;o++){var s=a[o],l=t[s];Array.isArray(l)?l.forEach((function(t){e(t,r)})):l&&"object"==typeof l&&e(l,r)}i&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null});return t}((k=h(),{type:"stylesheet",stylesheet:{source:t.source,rules:k,parsingErrors:c}}))}function s(e){return e?e.replace(/^\s+|\s+$/g,""):""}var l={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 c=/([^\\]):hover/g;function u(e){var t=a(e,{silent:!0});return t.stylesheet?(t.stylesheet.rules.forEach((function(t){"selectors"in t&&(t.selectors||[]).forEach((function(t){if(c.test(t)){var n=t.replace(c,"$1.\\:hover");e=e.replace(t,t+", "+n)}}))})),e):e}function f(e,n,i){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 r,o=function(e){var t=l[e.tagName]?l[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);r=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",o):n.createElement(o);var a=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var a=e.attributes[t];if(a="boolean"==typeof a?"":a,t.startsWith("rr_")){if("canvas"===o&&"rr_dataURL"===t){var s=document.createElement("img");s.src=a,s.onload=function(){var e=r.getContext("2d");e&&e.drawImage(s,0,0,s.width,s.height)}}if("rr_width"===t&&(r.style.width=a),"rr_height"===t&&(r.style.height=a),"rr_mediaState"===t)switch(a){case"played":r.play();case"paused":r.pause()}}else{var l="textarea"===o&&"value"===t,c="style"===o&&"_cssText"===t;if(c&&i&&(a=u(a)),l||c){for(var f=n.createTextNode(a),d=0,h=Array.from(r.childNodes);d<h.length;d++){var p=h[d];p.nodeType===r.TEXT_NODE&&r.removeChild(p)}return r.appendChild(f),"continue"}if("iframe"===o&&"src"===t)return"continue";try{e.isSVG&&"xlink:href"===t?r.setAttributeNS("http://www.w3.org/1999/xlink",t,a):"onload"==t||"onclick"==t||"onmouse"==t.substring(0,7)?r.setAttribute("_"+t,a):r.setAttribute(t,a)}catch(e){}}};for(var s in e.attributes)a(s);return r;case t.Text:return n.createTextNode(e.isStyle&&i?u(e.textContent):e.textContent);case t.CDATA:return n.createCDATASection(e.textContent);case t.Comment:return n.createComment(e.textContent);default:return null}}function d(e,n,i,r,o){void 0===r&&(r=!1),void 0===o&&(o=!0);var a=f(e,n,o);if(!a)return null;if(e.type===t.Document&&(n.close(),n.open(),a=n),a.__sn=e,i[e.id]=a,(e.type===t.Document||e.type===t.Element)&&!r)for(var s=0,l=e.childNodes;s<l.length;s++){var c=l[s],u=d(c,n,i,!1,o);u?a.appendChild(u):console.warn("Failed to rebuild",c)}return a}function h(e){return e=e||Object.create(null),{on:function(t,n){(e[t]||(e[t]=[])).push(n)},off:function(t,n){e[t]&&e[t].splice(e[t].indexOf(n)>>>0,1)},emit:function(t,n){(e[t]||[]).slice().map((function(e){e(n)})),(e["*"]||[]).slice().map((function(e){e(t,n)}))}}}var p=Object.freeze({__proto__:null,default:h});function m(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function v(e,t){return e(t={exports:{}},t.exports),t.exports}var y,g,b,w,x,k=v((function(e,t){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var n,i=e.HTMLElement||e.Element,r={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:i.prototype.scroll||s,scrollIntoView:i.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?p.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):r.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])?r.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):p.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},i.prototype.scroll=i.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;p.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");r.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)}},i.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}):r.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))},i.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var n=d(this),i=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(p.call(this,n,n.scrollLeft+o.left-i.left,n.scrollTop+o.top-i.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:i.left,top:i.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else r.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,n){var i=e.getComputedStyle(t,null)["overflow"+n];return"auto"===i||"scroll"===i}function f(e){var t=c(e,"Y")&&u(e,"Y"),n=c(e,"X")&&u(e,"X");return t||n}function d(e){for(;e!==t.body&&!1===f(e);)e=e.parentNode||e.host;return e}function h(t){var n,i,r,a,s=(o()-t.startTime)/468;a=s=s>1?1:s,n=.5*(1-Math.cos(Math.PI*a)),i=t.startX+(t.x-t.startX)*n,r=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,i,r),i===t.x&&r===t.y||e.requestAnimationFrame(h.bind(e,t))}function p(n,i,a){var l,c,u,f,d=o();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,f=r.scroll):(l=n,c=n.scrollLeft,u=n.scrollTop,f=s),h({scrollable:l,method:f,startTime:d,startX:c,startY:u,x:i,y:a})}}}})).polyfill;!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"}(y||(y={})),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"}(g||(g={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd"}(b||(b={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(w||(w={})),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"}(x||(x={}));var _,S=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e}(e))},e.prototype.start=function(){this.actions.sort((function(e,t){return e.delay-t.delay})),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this;this.raf=requestAnimationFrame((function i(r){for(n.timeOffset+=(r-e)*n.speed,e=r;t.length;){var o=t[0];if(!(n.timeOffset>=o.delay))break;t.shift(),o.doAction()}(t.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(i))}))},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var i=Math.floor((t+n)/2);if(this.actions[i].delay<e.delay)t=i+1;else{if(!(this.actions[i].delay>e.delay))return i;n=i-1}}return t},e}();function E(e,t){if(e.type===y.IncrementalSnapshot&&e.data.source===g.MouseMove){var n=e.data.positions[0].timeOffset,i=e.timestamp+n;return e.delay=i-t,i-t}return e.delay=e.timestamp-t,e.delay}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(_||(_={}));var N={type:"xstate.init"};function M(e){return void 0===e?[]:[].concat(e)}function T(e){return{type:"xstate.assign",assignment:e}}function I(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function A(e){return function(t){return e===t}}function C(e){return"string"==typeof e?{type:e}:e}function O(e,t){return{value:e,context:t,actions:[],changed:!1,matches:A(e)}}function R(e,t){void 0===t&&(t={});var n={config:e,_options:t,initialState:{value:e.initial,actions:M(e.states[e.initial].entry).map((function(e){return I(e,t.actions)})),context:e.context,matches:A(e.initial)},transition:function(t,i){var r,o,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,l=a.context,c=C(i),u=e.states[s];if(u.on){var f=M(u.on[c.type]),d=function(t){if(void 0===t)return{value:O(s,l)};var i="string"==typeof t?{target:t}:t,r=i.target,o=void 0===r?s:r,a=i.actions,f=void 0===a?[]:a,d=i.cond,h=l;if((void 0===d?function(){return!0}:d)(l,c)){var p=e.states[o],m=!1,v=[].concat(u.exit,f,p.entry).filter((function(e){return e})).map((function(e){return I(e,n._options.actions)})).filter((function(e){if("xstate.assign"===e.type){m=!0;var t=Object.assign({},h);return"function"==typeof e.assignment?t=e.assignment(h,c):Object.keys(e.assignment).forEach((function(n){t[n]="function"==typeof e.assignment[n]?e.assignment[n](h,c):e.assignment[n]})),h=t,!1}return!0}));return{value:{value:o,context:h,actions:v,changed:o!==s||v.length>0||m,matches:A(o)}}}};try{for(var h=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(f),p=h.next();!p.done;p=h.next()){var m=d(p.value);if("object"==typeof m)return m.value}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}}return O(s,l)}};return n}var F=function(e,t){return e.actions.forEach((function(n){var i=n.exec;return i&&i(e.context,t)}))};function D(e){var t=e.initialState,n=_.NotStarted,i=new Set,r={_machine:e,send:function(r){n===_.Running&&(t=e.transition(t,r),F(t,C(r)),i.forEach((function(e){return e(t)})))},subscribe:function(e){return i.add(e),e(t),{unsubscribe:function(){return i.delete(e)}}},start:function(){return n=_.Running,F(t,N),r},stop:function(){return n=_.Stopped,i.clear(),r},get state(){return t},get status(){return n}};return r}var L={map:{},getId:function(e){return e.__sn?e.__sn.id:-1},getNode:function(e){return L.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete L.map[t],e.childNodes&&e.childNodes.forEach((function(e){return L.removeNodeFromMap(e)}))},has:function(e){return L.map.hasOwnProperty(e)}};var B=function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e){var t=this,n=this.indexes.get(e.parentId),i=this.indexes.get(e.id),r=function(e){t.removeIdSet.add(e);var n=L.getNode(e);null==n||n.childNodes.forEach((function(e){return r(e.__sn.id)}))},o=function(n){t.removeIdSet.add(n.id),Object.values(n.children).forEach((function(e){return o(e)}));var i=t.indexes.get(n.id);if(i){var r=i.parent;r&&(delete i.parent,delete r.children[i.id],t.indexes.delete(e.id))}};i?n?(delete i.parent,delete n.children[i.id],this.indexes.delete(e.id),o(i)):(delete this.tree[i.id],this.indexes.delete(i.id),o(i)):(this.removeNodeMutations.push(e),r(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,n,r,o=this,a=this.tree,s=this.removeNodeMutations,l=this.textMutations,c=this.attributeMutations,u={source:g.Mutation,removes:s,texts:l,attributes:c,adds:[]},f=function(e,t){t&&o.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter((function(e){return!o.removeIdSet.has(e.id)})),u.attributes=u.attributes.concat(t?[]:e.attributes).filter((function(e){return!o.removeIdSet.has(e.id)})),o.removeIdSet.has(e.id)||o.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return f(e,!0)})):(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return f(e,!1)})))};Object.values(a).forEach((function(e){return f(e,!1)}));try{for(var d=i(this.scrollMap.keys()),h=d.next();!h.done;h=d.next()){var p=h.value;this.removeIdSet.has(p)&&this.scrollMap.delete(p)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}try{for(var m=i(this.inputMap.keys()),v=m.next();!v.done;v=m.next()){p=v.value;this.removeIdSet.has(p)&&this.inputMap.delete(p)}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}var y=new Map(this.scrollMap),b=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:y,inputMap:b}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e}();function z(e,t){var r=t.getCastFn,o=t.emitter;return D(R({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]}}}}},{actions:{castEvent:T({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:T((function(e,t){var i=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(i=t.payload.timeOffset),n(n({},e),{timeOffset:i,baselineTime:e.events[0].timestamp+i})})),play:function(e){var t,n,a,s,l=e.timer,c=e.events,u=e.baselineTime,f=e.lastPlayedEvent;l.clear();try{for(var d=i(c),h=d.next();!h.done;h=d.next()){E(h.value,u)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}var p=function(e,t){for(var n=e.length-1;n>=0;n--){var i=e[n];if(i.type===y.Meta&&i.timestamp<=t)return e.slice(n)}return e}(c,u),m=new Array,v=function(e){if(f&&f.timestamp<u&&(e.timestamp<=f.timestamp||e===f))return"continue";var t=e.timestamp<u;if(t&&!function(e){switch(e.type){case y.DomContentLoaded:case y.Load:case y.Custom:return!1;case y.FullSnapshot:case y.Meta:return!0}switch(e.data.source){case g.MouseMove:case g.MouseInteraction:case g.TouchMove:case g.MediaInteraction:return!1;case g.ViewportResize:case g.StyleSheetRule:case g.Scroll:case g.Input:return!0}return!0}(e))return"continue";var n=r(e,t);t?n():m.push({doAction:function(){n(),o.emit(x.EventCast,e)},delay:e.delay})};try{for(var b=i(p),w=b.next();!w.done;w=b.next()){v(w.value)}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}o.emit(x.Flush),l.addActions(m),l.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:T((function(e){return n(n({},e),{lastPlayedEvent:null})})),startLive:T({baselineTime:function(e,t){return e.timer.toggleLiveMode(!0),e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),addEvent:T((function(e,t){var i=e.baselineTime,a=e.timer,s=e.events;if("ADD_EVENT"===t.type){var l=t.payload.event;E(l,i),s.push(l);var c=l.timestamp<i,u=r(l,c);c?u():a.addAction({doAction:function(){u(),o.emit(x.EventCast,l)},delay:l.delay})}return n(n({},e),{events:s})}))}}))}var P=h||p,Z={speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0},U=function(){function e(e,n){var o=this;if(this.emitter=P(),this.legacy_missingNodeRetryMap={},!(null==n?void 0:n.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");this.config=Object.assign({},Z,n),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.emitter.on(x.Resize,this.handleResize),k(),"NodeList"in window&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),this.setupDom(),this.treeIndex=new B,this.fragmentParentMap=new Map,this.emitter.on(x.Flush,(function(){var e,n,a,s,l,c,u=o.treeIndex.flush(),f=u.scrollMap,d=u.inputMap;try{for(var h=i(f.values()),p=h.next();!p.done;p=h.next()){var m=p.value;o.applyScroll(m)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(n=h.return)&&n.call(h)}finally{if(e)throw e.error}}try{for(var v=i(d.values()),y=v.next();!y.done;y=v.next()){m=y.value;o.applyInput(m)}}catch(e){a={error:e}}finally{try{y&&!y.done&&(s=v.return)&&s.call(v)}finally{if(a)throw a.error}}try{for(var g=i(o.fragmentParentMap.entries()),b=g.next();!b.done;b=g.next()){var w=r(b.value,2),x=w[0],k=w[1];L.map[k.__sn.id]=k,k.__sn.type===t.Element&&"textarea"===k.__sn.tagName&&x.textContent&&(k.value=x.textContent),k.appendChild(x)}}catch(e){l={error:e}}finally{try{b&&!b.done&&(c=g.return)&&c.call(g)}finally{if(l)throw l.error}}o.fragmentParentMap.clear()}));var a=new S([],(null==n?void 0:n.speed)||Z.speed);this.service=z({events:e.map((function(e){return n&&n.unpackFn?n.unpackFn(e):e})),timer:a,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){o.emitter.emit(x.StateChange,{player:e})})),this.speedService=D(R({id:"speed",context:{normalSpeed:-1,timer:a},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:T({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(e){o.emitter.emit(x.StateChange,{speed:e})}));var s=this.service.state.context.events.find((function(e){return e.type===y.Meta})),l=this.service.state.context.events.find((function(e){return e.type===y.FullSnapshot}));if(s){var c=s.data,u=c.width,f=c.height;setTimeout((function(){o.emitter.emit(x.Resize,{width:u,height:f})}),0)}l&&this.rebuildFullSnapshot(l)}return Object.defineProperty(e.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){this.emitter.on(e,t)},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach((function(n){t.config[n]=e[n]})),this.config.skipInactive||this.backToNormal()},e.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},e.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},e.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},e.prototype.play=function(e){void 0===e&&(e=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),this.emitter.emit(x.Start)},e.prototype.pause=function(e){void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),this.emitter.emit(x.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),console.warn("The 'resume' will be departed in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(x.Resume)},e.prototype.startLive=function(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})},e.prototype.addEvent=function(e){var t=this,n=this.config.unpackFn?this.config.unpackFn(e):e;Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENT",payload:{event:n}})}))},e.prototype.enableInteract=function(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"},e.prototype.disableInteract=function(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"},e.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin"),this.disableInteract(),this.wrapper.appendChild(this.iframe)},e.prototype.handleResize=function(e){this.iframe.setAttribute("width",String(e.width)),this.iframe.setAttribute("height",String(e.height))},e.prototype.getCastFn=function(e,t){var n,r=this;switch(void 0===t&&(t=!1),e.type){case y.DomContentLoaded:case y.Load:break;case y.Custom:n=function(){r.emitter.emit(x.CustomEvent,e)};break;case y.Meta:n=function(){return r.emitter.emit(x.Resize,{width:e.data.width,height:e.data.height})};break;case y.FullSnapshot:n=function(){r.rebuildFullSnapshot(e),r.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case y.IncrementalSnapshot:n=function(){var n,o;if(r.applyIncremental(e,t),!t&&(e===r.nextUserInteractionEvent&&(r.nextUserInteractionEvent=null,r.backToNormal()),r.config.skipInactive&&!r.nextUserInteractionEvent)){try{for(var a=i(r.service.state.context.events),s=a.next();!s.done;s=a.next()){var l=s.value;if(!(l.timestamp<=e.timestamp)&&r.isUserInteraction(l)){l.delay-e.delay>1e4*r.speedService.state.context.timer.speed&&(r.nextUserInteractionEvent=l);break}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}if(r.nextUserInteractionEvent){var c=r.nextUserInteractionEvent.delay-e.delay,u={speed:Math.min(Math.round(c/5e3),360)};r.speedService.send({type:"FAST_FORWARD",payload:u}),r.emitter.emit(x.SkipStart,u)}}}}return function(){n&&n(),r.service.send({type:"CAST_EVENT",payload:{event:e}}),e===r.service.state.context.events[r.service.state.context.events.length-1]&&(r.backToNormal(),r.service.send("END"),r.emitter.emit(x.Finish))}},e.prototype.rebuildFullSnapshot=function(e){if(!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={},L.map=function(e,t,n){void 0===n&&(n=!0);var i={};return[d(e,t,i,!1,n),i]}(e.data.node,this.iframe.contentDocument)[1];var t=document.createElement("style"),n=this.iframe.contentDocument,i=n.documentElement,r=n.head;i.insertBefore(t,r);for(var o,a=(o=this.config.blockClass,["iframe, ."+o+" { background: #ccc }","noscript { display: none !important; }"]).concat(this.config.insertStyleRules),s=0;s<a.length;s++)t.sheet.insertRule(a[s],s);this.emitter.emit(x.FullsnapshotRebuilded,e),this.waitForStylesheetLoad()},e.prototype.waitForStylesheetLoad=function(){var e,t=this,n=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(n){var i,r=new Set,o=this.service.state,a=this.service.subscribe((function(e){o=e})).unsubscribe;n.querySelectorAll('link[rel="stylesheet"]').forEach((function(e){e.sheet||(r.add(e),e.addEventListener("load",(function(){r.delete(e),0===r.size&&-1!==i&&(o.matches("playing")&&t.play(t.getCurrentTime()),t.emitter.emit(x.LoadStylesheetEnd),i&&window.clearTimeout(i),a())})))})),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(x.LoadStylesheetStart),i=window.setTimeout((function(){o.matches("playing")&&t.play(t.getCurrentTime()),i=-1,a()}),this.config.loadTimeout))}},e.prototype.applyIncremental=function(e,t){var n=this,i=e.data;switch(i.source){case g.Mutation:t&&(i.adds.forEach((function(e){return n.treeIndex.add(e)})),i.texts.forEach((function(e){return n.treeIndex.text(e)})),i.attributes.forEach((function(e){return n.treeIndex.attribute(e)})),i.removes.forEach((function(e){return n.treeIndex.remove(e)}))),this.applyMutation(i,t);break;case g.MouseMove:if(t){var r=i.positions[i.positions.length-1];this.moveAndHover(i,r.x,r.y,r.id)}else i.positions.forEach((function(t){var r={doAction:function(){n.moveAndHover(i,t.x,t.y,t.id)},delay:t.timeOffset+e.timestamp-n.service.state.context.baselineTime};n.timer.addAction(r)}));break;case g.MouseInteraction:if(-1===i.id)break;var o=new Event(b[i.type].toLowerCase());if(!(l=L.getNode(i.id)))return this.debugNodeNotFound(i,i.id);this.emitter.emit(x.MouseInteraction,{type:i.type,target:l});var a=this.config.triggerFocus;switch(i.type){case b.Blur:"blur"in l&&l.blur();break;case b.Focus:a&&l.focus&&l.focus({preventScroll:!0});break;case b.Click:case b.TouchStart:case b.TouchEnd:t||(this.moveAndHover(i,i.x,i.y,i.id),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:l.dispatchEvent(o)}break;case g.Scroll:if(-1===i.id)break;if(t){this.treeIndex.scroll(i);break}this.applyScroll(i);break;case g.ViewportResize:this.emitter.emit(x.Resize,{width:i.width,height:i.height});break;case g.Input:if(-1===i.id)break;if(t){this.treeIndex.input(i);break}this.applyInput(i);break;case g.MediaInteraction:if(!(l=L.getNode(i.id)))return this.debugNodeNotFound(i,i.id);var s=l;i.type===w.Pause&&s.pause(),i.type===w.Play&&(s.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?s.play():s.addEventListener("canplay",(function(){s.play()})));break;case g.StyleSheetRule:var l;if(!(l=L.getNode(i.id)))return this.debugNodeNotFound(i,i.id);var c=l.sheet;i.adds&&i.adds.forEach((function(e){var t=e.rule,n=e.index,i=void 0===n?void 0:Math.min(n,c.rules.length);try{c.insertRule(t,i)}catch(e){}})),i.removes&&i.removes.forEach((function(e){var t=e.index;c.deleteRule(t)}))}},e.prototype.applyMutation=function(e,t){var i=this;e.removes.forEach((function(t){var n=L.getNode(t.id);if(!n)return i.warnNodeNotFound(e,t.id);var r=L.getNode(t.parentId);if(!r)return i.warnNodeNotFound(e,t.parentId);if(L.removeNodeFromMap(n),r){var o=i.fragmentParentMap.get(r);o&&o.contains(n)?o.removeChild(n):r.removeChild(n)}}));var r=n({},this.legacy_missingNodeRetryMap),o=[],a=function(e){if(!i.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var n=L.getNode(e.parentId);if(!n)return o.push(e);var a=i.iframe.contentDocument.contains(n);if(t&&a){var s=document.createDocumentFragment();for(L.map[e.parentId]=s,i.fragmentParentMap.set(s,n);n.firstChild;)s.appendChild(n.firstChild);n=s}var l=null,c=null;if(e.previousId&&(l=L.getNode(e.previousId)),e.nextId&&(c=L.getNode(e.nextId)),null!==e.nextId&&-1!==e.nextId&&!c)return o.push(e);var u=d(e.node,i.iframe.contentDocument,L.map,!0);-1!==e.previousId&&-1!==e.nextId?(l&&l.nextSibling&&l.nextSibling.parentNode?n.insertBefore(u,l.nextSibling):c&&c.parentNode?n.contains(c)?n.insertBefore(u,c):n.insertBefore(u,null):n.appendChild(u),(e.previousId||e.nextId)&&i.legacy_resolveMissingNode(r,n,u,e)):r[e.node.id]={node:u,mutation:e}};for(e.adds.forEach((function(e){a(e)}));o.length;){if(o.every((function(e){return!Boolean(L.getNode(e.parentId))})))return o.forEach((function(t){return i.warnNodeNotFound(e,t.node.id)}));var s=o.shift();a(s)}Object.keys(r).length&&Object.assign(this.legacy_missingNodeRetryMap,r),e.texts.forEach((function(t){var n=L.getNode(t.id);if(!n)return i.warnNodeNotFound(e,t.id);i.fragmentParentMap.has(n)&&(n=i.fragmentParentMap.get(n)),n.textContent=t.value})),e.attributes.forEach((function(t){var n=L.getNode(t.id);if(!n)return i.warnNodeNotFound(e,t.id);for(var r in i.fragmentParentMap.has(n)&&(n=i.fragmentParentMap.get(n)),t.attributes)if("string"==typeof r){var o=t.attributes[r];null!==o?n.setAttribute(r,o):n.removeAttribute(r)}}))},e.prototype.applyScroll=function(e){var t=L.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);if(t===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else try{t.scrollTop=e.y,t.scrollLeft=e.x}catch(e){}},e.prototype.applyInput=function(e){var t=L.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},e.prototype.legacy_resolveMissingNode=function(e,t,n,i){var r=i.previousId,o=i.nextId,a=r&&e[r],s=o&&e[o];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(s){var f=s;c=f.node,u=f.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,i){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var r=L.getNode(i);if(!r)return this.debugNodeNotFound(e,i);this.hoverElements(r)},e.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var n=e;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement},e.prototype.isUserInteraction=function(e){return e.type===y.IncrementalSnapshot&&(e.data.source>g.Mutation&&e.data.source<=g.Input)},e.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(x.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},e.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn("[replayer]","Node with id '"+t+"' not found in",e)},e.prototype.debugNodeNotFound=function(e,t){this.config.showDebug&&console.log("[replayer]","Node with id '"+t+"' not found in",e)},e}(),j=v((function(e,t){e.exports=function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){if(!s&&m)return m();if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,(function(e){return r(t[a][1][e]||e)}),c,c.exports,e,t,n,i)}return n[a].exports}for(var o=m,a=0;a<i.length;a++)r(i[a]);return r}({1:[function(e,t,n){var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)r(n,i)&&(e[i]=n[i])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,n,i,r){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+i),r);else for(var o=0;o<i;o++)e[r+o]=t[n+o]},flattenChunks:function(e){var t,n,i,r,o,a;for(i=0,t=0,n=e.length;t<n;t++)i+=e[t].length;for(a=new Uint8Array(i),r=0,t=0,n=e.length;t<n;t++)o=e[t],a.set(o,r),r+=o.length;return a}},a={arraySet:function(e,t,n,i,r){for(var o=0;o<i;o++)e[r+o]=t[n+o]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,o)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,a))},n.setTyped(i)},{}],2:[function(e,t,n){var i=e("./common"),r=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new i.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&r))return String.fromCharCode.apply(null,i.shrinkBuf(e,t));for(var n="",a=0;a<t;a++)n+=String.fromCharCode(e[a]);return n}a[254]=a[254]=1,n.string2buf=function(e){var t,n,r,o,a,s=e.length,l=0;for(o=0;o<s;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(r=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=new i.Buf8(l),a=0,o=0;a<l;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(r=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|63&n):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|63&n):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|63&n);return t},n.buf2binstring=function(e){return l(e,e.length)},n.binstring2buf=function(e){for(var t=new i.Buf8(e.length),n=0,r=t.length;n<r;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,i,r,o,s=t||e.length,c=new Array(2*s);for(i=0,n=0;n<s;)if((r=e[n++])<128)c[i++]=r;else if((o=a[r])>4)c[i++]=65533,n+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&n<s;)r=r<<6|63&e[n++],o--;o>1?c[i++]=65533:r<65536?c[i++]=r:(r-=65536,c[i++]=55296|r>>10&1023,c[i++]=56320|1023&r)}return l(c,i)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}},{"./common":1}],3:[function(e,t,n){t.exports=function(e,t,n,i){for(var r=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{o=o+(r=r+t[i++]|0)|0}while(--a);r%=65521,o%=65521}return r|o<<16|0}},{}],4:[function(e,t,n){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,n){var i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,r){var o=i,a=r+n;e^=-1;for(var s=r;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},{}],6:[function(e,t,n){t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],7:[function(e,t,n){t.exports=function(e,t){var n,i,r,o,a,s,l,c,u,f,d,h,p,m,v,y,g,b,w,x,k,_,S,E,N;n=e.state,i=e.next_in,E=e.input,r=i+(e.avail_in-5),o=e.next_out,N=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),l=n.dmax,c=n.wsize,u=n.whave,f=n.wnext,d=n.window,h=n.hold,p=n.bits,m=n.lencode,v=n.distcode,y=(1<<n.lenbits)-1,g=(1<<n.distbits)-1;e:do{p<15&&(h+=E[i++]<<p,p+=8,h+=E[i++]<<p,p+=8),b=m[h&y];t:for(;;){if(h>>>=w=b>>>24,p-=w,0==(w=b>>>16&255))N[o++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(h&(1<<w)-1)];continue t}if(32&w){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}x=65535&b,(w&=15)&&(p<w&&(h+=E[i++]<<p,p+=8),x+=h&(1<<w)-1,h>>>=w,p-=w),p<15&&(h+=E[i++]<<p,p+=8,h+=E[i++]<<p,p+=8),b=v[h&g];n:for(;;){if(h>>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=v[(65535&b)+(h&(1<<w)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(k=65535&b,p<(w&=15)&&(h+=E[i++]<<p,(p+=8)<w&&(h+=E[i++]<<p,p+=8)),(k+=h&(1<<w)-1)>l){e.msg="invalid distance too far back",n.mode=30;break e}if(h>>>=w,p-=w,k>(w=o-a)){if((w=k-w)>u&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(_=0,S=d,0===f){if(_+=c-w,w<x){x-=w;do{N[o++]=d[_++]}while(--w);_=o-k,S=N}}else if(f<w){if(_+=c+f-w,(w-=f)<x){x-=w;do{N[o++]=d[_++]}while(--w);if(_=0,f<x){x-=w=f;do{N[o++]=d[_++]}while(--w);_=o-k,S=N}}}else if(_+=f-w,w<x){x-=w;do{N[o++]=d[_++]}while(--w);_=o-k,S=N}for(;x>2;)N[o++]=S[_++],N[o++]=S[_++],N[o++]=S[_++],x-=3;x&&(N[o++]=S[_++],x>1&&(N[o++]=S[_++]))}else{_=o-k;do{N[o++]=N[_++],N[o++]=N[_++],N[o++]=N[_++],x-=3}while(x>2);x&&(N[o++]=N[_++],x>1&&(N[o++]=N[_++]))}break}}break}}while(i<r&&o<s);i-=x=p>>3,h&=(1<<(p-=x<<3))-1,e.next_in=i,e.next_out=o,e.avail_in=i<r?r-i+5:5-(i-r),e.avail_out=o<s?s-o+257:257-(o-s),n.hold=h,n.bits=p}},{}],8:[function(e,t,n){var i=e("../utils/common"),r=e("./adler32"),o=e("./crc32"),a=e("./inffast"),s=e("./inftrees");function l(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new i.Buf32(852),t.distcode=t.distdyn=new i.Buf32(592),t.sane=1,t.back=-1,0):-2}function f(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,u(e)):-2}function d(e,t){var n,i;return e&&e.state?(i=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?-2:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,f(e))):-2}function h(e,t){var n,i;return e?(i=new c,e.state=i,i.window=null,0!==(n=d(e,t))&&(e.state=null),n):-2}var p,m,v=!0;function y(e){if(v){var t;for(p=new i.Buf32(512),m=new i.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,p,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,m,0,e.work,{bits:5}),v=!1}e.lencode=p,e.lenbits=9,e.distcode=m,e.distbits=5}function g(e,t,n,r){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new i.Buf8(a.wsize)),r>=a.wsize?(i.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>r&&(o=r),i.arraySet(a.window,t,n-r,o,a.wnext),(r-=o)?(i.arraySet(a.window,t,n-r,r,0),a.wnext=r,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}n.inflateReset=f,n.inflateReset2=d,n.inflateResetKeep=u,n.inflateInit=function(e){return h(e,15)},n.inflateInit2=h,n.inflate=function(e,t){var n,c,u,f,d,h,p,m,v,b,w,x,k,_,S,E,N,M,T,I,A,C,O,R,F=0,D=new i.Buf8(4),L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return-2;12===(n=e.state).mode&&(n.mode=13),d=e.next_out,u=e.output,p=e.avail_out,f=e.next_in,c=e.input,h=e.avail_in,m=n.hold,v=n.bits,b=h,w=p,C=0;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;v<16;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}if(2&n.wrap&&35615===m){n.check=0,D[0]=255&m,D[1]=m>>>8&255,n.check=o(n.check,D,2,0),m=0,v=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&m)){e.msg="unknown compression method",n.mode=30;break}if(v-=4,A=8+(15&(m>>>=4)),0===n.wbits)n.wbits=A;else if(A>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<A,e.adler=n.check=1,n.mode=512&m?10:12,m=0,v=0;break;case 2:for(;v<16;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}if(n.flags=m,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=m>>8&1),512&n.flags&&(D[0]=255&m,D[1]=m>>>8&255,n.check=o(n.check,D,2,0)),m=0,v=0,n.mode=3;case 3:for(;v<32;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}n.head&&(n.head.time=m),512&n.flags&&(D[0]=255&m,D[1]=m>>>8&255,D[2]=m>>>16&255,D[3]=m>>>24&255,n.check=o(n.check,D,4,0)),m=0,v=0,n.mode=4;case 4:for(;v<16;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}n.head&&(n.head.xflags=255&m,n.head.os=m>>8),512&n.flags&&(D[0]=255&m,D[1]=m>>>8&255,n.check=o(n.check,D,2,0)),m=0,v=0,n.mode=5;case 5:if(1024&n.flags){for(;v<16;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}n.length=m,n.head&&(n.head.extra_len=m),512&n.flags&&(D[0]=255&m,D[1]=m>>>8&255,n.check=o(n.check,D,2,0)),m=0,v=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((x=n.length)>h&&(x=h),x&&(n.head&&(A=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),i.arraySet(n.head.extra,c,f,x,A)),512&n.flags&&(n.check=o(n.check,c,x,f)),h-=x,f+=x,n.length-=x),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===h)break e;x=0;do{A=c[f+x++],n.head&&A&&n.length<65536&&(n.head.name+=String.fromCharCode(A))}while(A&&x<h);if(512&n.flags&&(n.check=o(n.check,c,x,f)),h-=x,f+=x,A)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===h)break e;x=0;do{A=c[f+x++],n.head&&A&&n.length<65536&&(n.head.comment+=String.fromCharCode(A))}while(A&&x<h);if(512&n.flags&&(n.check=o(n.check,c,x,f)),h-=x,f+=x,A)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;v<16;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}if(m!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}m=0,v=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;v<32;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}e.adler=n.check=l(m),m=0,v=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=d,e.avail_out=p,e.next_in=f,e.avail_in=h,n.hold=m,n.bits=v,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last){m>>>=7&v,v-=7&v,n.mode=27;break}for(;v<3;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}switch(n.last=1&m,v-=1,3&(m>>>=1)){case 0:n.mode=14;break;case 1:if(y(n),n.mode=20,6===t){m>>>=2,v-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}m>>>=2,v-=2;break;case 14:for(m>>>=7&v,v-=7&v;v<32;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}if((65535&m)!=(m>>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&m,m=0,v=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(x=n.length){if(x>h&&(x=h),x>p&&(x=p),0===x)break e;i.arraySet(u,c,f,x,d),h-=x,f+=x,p-=x,d+=x,n.length-=x;break}n.mode=12;break;case 17:for(;v<14;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}if(n.nlen=257+(31&m),m>>>=5,v-=5,n.ndist=1+(31&m),m>>>=5,v-=5,n.ncode=4+(15&m),m>>>=4,v-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;v<3;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}n.lens[L[n.have++]]=7&m,m>>>=3,v-=3}for(;n.have<19;)n.lens[L[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,O={bits:n.lenbits},C=s(0,n.lens,0,19,n.lencode,0,n.work,O),n.lenbits=O.bits,C){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;E=(F=n.lencode[m&(1<<n.lenbits)-1])>>>16&255,N=65535&F,!((S=F>>>24)<=v);){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}if(N<16)m>>>=S,v-=S,n.lens[n.have++]=N;else{if(16===N){for(R=S+2;v<R;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}if(m>>>=S,v-=S,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}A=n.lens[n.have-1],x=3+(3&m),m>>>=2,v-=2}else if(17===N){for(R=S+3;v<R;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}v-=S,A=0,x=3+(7&(m>>>=S)),m>>>=3,v-=3}else{for(R=S+7;v<R;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}v-=S,A=0,x=11+(127&(m>>>=S)),m>>>=7,v-=7}if(n.have+x>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;x--;)n.lens[n.have++]=A}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,O={bits:n.lenbits},C=s(1,n.lens,0,n.nlen,n.lencode,0,n.work,O),n.lenbits=O.bits,C){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,O={bits:n.distbits},C=s(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,O),n.distbits=O.bits,C){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(h>=6&&p>=258){e.next_out=d,e.avail_out=p,e.next_in=f,e.avail_in=h,n.hold=m,n.bits=v,a(e,w),d=e.next_out,u=e.output,p=e.avail_out,f=e.next_in,c=e.input,h=e.avail_in,m=n.hold,v=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;E=(F=n.lencode[m&(1<<n.lenbits)-1])>>>16&255,N=65535&F,!((S=F>>>24)<=v);){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}if(E&&0==(240&E)){for(M=S,T=E,I=N;E=(F=n.lencode[I+((m&(1<<M+T)-1)>>M)])>>>16&255,N=65535&F,!(M+(S=F>>>24)<=v);){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}m>>>=M,v-=M,n.back+=M}if(m>>>=S,v-=S,n.back+=S,n.length=N,0===E){n.mode=26;break}if(32&E){n.back=-1,n.mode=12;break}if(64&E){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&E,n.mode=22;case 22:if(n.extra){for(R=n.extra;v<R;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}n.length+=m&(1<<n.extra)-1,m>>>=n.extra,v-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;E=(F=n.distcode[m&(1<<n.distbits)-1])>>>16&255,N=65535&F,!((S=F>>>24)<=v);){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}if(0==(240&E)){for(M=S,T=E,I=N;E=(F=n.distcode[I+((m&(1<<M+T)-1)>>M)])>>>16&255,N=65535&F,!(M+(S=F>>>24)<=v);){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}m>>>=M,v-=M,n.back+=M}if(m>>>=S,v-=S,n.back+=S,64&E){e.msg="invalid distance code",n.mode=30;break}n.offset=N,n.extra=15&E,n.mode=24;case 24:if(n.extra){for(R=n.extra;v<R;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}n.offset+=m&(1<<n.extra)-1,m>>>=n.extra,v-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===p)break e;if(x=w-p,n.offset>x){if((x=n.offset-x)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}x>n.wnext?(x-=n.wnext,k=n.wsize-x):k=n.wnext-x,x>n.length&&(x=n.length),_=n.window}else _=u,k=d-n.offset,x=n.length;x>p&&(x=p),p-=x,n.length-=x;do{u[d++]=_[k++]}while(--x);0===n.length&&(n.mode=21);break;case 26:if(0===p)break e;u[d++]=n.length,p--,n.mode=21;break;case 27:if(n.wrap){for(;v<32;){if(0===h)break e;h--,m|=c[f++]<<v,v+=8}if(w-=p,e.total_out+=w,n.total+=w,w&&(e.adler=n.check=n.flags?o(n.check,u,w,d-w):r(n.check,u,w,d-w)),w=p,(n.flags?m:l(m))!==n.check){e.msg="incorrect data check",n.mode=30;break}m=0,v=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;v<32;){if(0===h)break e;h--,m+=c[f++]<<v,v+=8}if(m!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}m=0,v=0}n.mode=29;case 29:C=1;break e;case 30:C=-3;break e;case 31:return-4;case 32:default:return-2}return e.next_out=d,e.avail_out=p,e.next_in=f,e.avail_in=h,n.hold=m,n.bits=v,(n.wsize||w!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&g(e,e.output,e.next_out,w-e.avail_out),b-=e.avail_in,w-=e.avail_out,e.total_in+=b,e.total_out+=w,n.total+=w,n.wrap&&w&&(e.adler=n.check=n.flags?o(n.check,u,w,e.next_out-w):r(n.check,u,w,e.next_out-w)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0===b&&0===w||4===t)&&0===C&&(C=-5),C},n.inflateEnd=function(e){if(!e||!e.state)return-2;var t=e.state;return t.window&&(t.window=null),e.state=null,0},n.inflateGetHeader=function(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?-2:(n.head=t,t.done=!1,0):-2},n.inflateSetDictionary=function(e,t){var n,i=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?-2:11===n.mode&&r(1,t,i,0)!==n.check?-3:g(e,t,i,i)?(n.mode=31,-4):(n.havedict=1,0):-2},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,n){var i=e("../utils/common"),r=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,n,l,c,u,f,d){var h,p,m,v,y,g,b,w,x,k=d.bits,_=0,S=0,E=0,N=0,M=0,T=0,I=0,A=0,C=0,O=0,R=null,F=0,D=new i.Buf16(16),L=new i.Buf16(16),B=null,z=0;for(_=0;_<=15;_++)D[_]=0;for(S=0;S<l;S++)D[t[n+S]]++;for(M=k,N=15;N>=1&&0===D[N];N--);if(M>N&&(M=N),0===N)return c[u++]=20971520,c[u++]=20971520,d.bits=1,0;for(E=1;E<N&&0===D[E];E++);for(M<E&&(M=E),A=1,_=1;_<=15;_++)if(A<<=1,(A-=D[_])<0)return-1;if(A>0&&(0===e||1!==N))return-1;for(L[1]=0,_=1;_<15;_++)L[_+1]=L[_]+D[_];for(S=0;S<l;S++)0!==t[n+S]&&(f[L[t[n+S]]++]=S);if(0===e?(R=B=f,g=19):1===e?(R=r,F-=257,B=o,z-=257,g=256):(R=a,B=s,g=-1),O=0,S=0,_=E,y=u,T=M,I=0,m=-1,v=(C=1<<M)-1,1===e&&C>852||2===e&&C>592)return 1;for(;;){b=_-I,f[S]<g?(w=0,x=f[S]):f[S]>g?(w=B[z+f[S]],x=R[F+f[S]]):(w=96,x=0),h=1<<_-I,E=p=1<<T;do{c[y+(O>>I)+(p-=h)]=b<<24|w<<16|x|0}while(0!==p);for(h=1<<_-1;O&h;)h>>=1;if(0!==h?(O&=h-1,O+=h):O=0,S++,0==--D[_]){if(_===N)break;_=t[n+f[S]]}if(_>M&&(O&v)!==m){for(0===I&&(I=M),y+=E,A=1<<(T=_-I);T+I<N&&!((A-=D[T+I])<=0);)T++,A<<=1;if(C+=1<<T,1===e&&C>852||2===e&&C>592)return 1;c[m=O&v]=M<<24|T<<16|y-u|0}}return 0!==O&&(c[y+O]=_-I<<24|64<<16|0),d.bits=M,0}},{"../utils/common":1}],10:[function(e,t,n){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,n){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/inflate.js":[function(e,t,n){var i=e("./zlib/inflate"),r=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/constants"),s=e("./zlib/messages"),l=e("./zlib/zstream"),c=e("./zlib/gzheader"),u=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=i.inflateInit2(this.strm,t.windowBits);if(n!==a.Z_OK)throw new Error(s[n]);if(this.header=new c,i.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=i.inflateSetDictionary(this.strm,t.dictionary))!==a.Z_OK))throw new Error(s[n])}function d(e,t){var n=new f(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}f.prototype.push=function(e,t){var n,s,l,c,f,d=this.strm,h=this.options.chunkSize,p=this.options.dictionary,m=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?d.input=o.binstring2buf(e):"[object ArrayBuffer]"===u.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new r.Buf8(h),d.next_out=0,d.avail_out=h),(n=i.inflate(d,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(n=i.inflateSetDictionary(this.strm,p)),n===a.Z_BUF_ERROR&&!0===m&&(n=a.Z_OK,m=!1),n!==a.Z_STREAM_END&&n!==a.Z_OK)return this.onEnd(n),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&n!==a.Z_STREAM_END&&(0!==d.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(l=o.utf8border(d.output,d.next_out),c=d.next_out-l,f=o.buf2string(d.output,l),d.next_out=c,d.avail_out=h-c,c&&r.arraySet(d.output,d.output,l,c,0),this.onData(f)):this.onData(r.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((d.avail_in>0||0===d.avail_out)&&n!==a.Z_STREAM_END);return n===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(n=i.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),d.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=f,n.inflate=d,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},n.ungzip=d},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")})).inflate;return e.Replayer=U,e.unpack=function(e){if("string"!=typeof e)return e;try{if((t=JSON.parse(e)).timestamp)return t}catch(e){}try{var t;if("v1"===(t=JSON.parse(j(e,{to:"string"}))).v)return t;throw new Error("These events were packed with packer "+t.v+" which is incompatible with current packer v1.")}catch(e){throw console.error(e),new Error("Unknown data format.")}},e}({});
//# sourceMappingURL=rrweb-replay-unpack.min.js.map