-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrrweb-player.js
30 lines (26 loc) · 89.3 KB
/
rrweb-player.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var rrwebPlayer=function(){"use strict";function e(){}function t(e,t){for(const n in t)e[n]=t[n];return e}function n(e){return e()}function r(){return Object.create(null)}function i(e){e.forEach(n)}function o(e){return"function"==typeof e}function a(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function s(e){const t={};for(const n in e)"$"!==n[0]&&(t[n]=e[n]);return t}function l(e,t){e.appendChild(t)}function c(e,t,n){e.insertBefore(t,n||null)}function u(e){e.parentNode.removeChild(e)}function d(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function f(e){return document.createElement(e)}function p(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function h(e){return document.createTextNode(e)}function m(){return h(" ")}function v(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function y(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function g(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function b(e,t,n,r){e.style.setProperty(t,n,r?"important":"")}function w(e,t,n){e.classList[n?"add":"remove"](t)}let x;function S(e){x=e}function E(){if(!x)throw new Error("Function called outside component initialization");return x}function T(e){E().$$.on_mount.push(e)}function M(e){E().$$.on_destroy.push(e)}function k(){const e=E();return(t,n)=>{const r=e.$$.callbacks[t];if(r){const i=function(e,t,n=!1){const r=document.createEvent("CustomEvent");return r.initCustomEvent(e,n,!1,t),r}(t,n);r.slice().forEach((t=>{t.call(e,i)}))}}}const C=[],I=[],N=[],A=[],_=Promise.resolve();let $=!1;function D(e){N.push(e)}let R=!1;const L=new Set;function F(){if(!R){R=!0;do{for(let e=0;e<C.length;e+=1){const t=C[e];S(t),P(t.$$)}for(S(null),C.length=0;I.length;)I.pop()();for(let e=0;e<N.length;e+=1){const t=N[e];L.has(t)||(L.add(t),t())}N.length=0}while(C.length);for(;A.length;)A.pop()();$=!1,R=!1,L.clear()}}function P(e){if(null!==e.fragment){e.update(),i(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(D)}}const O=new Set;let j;function W(){j={r:0,c:[],p:j}}function B(){j.r||i(j.c),j=j.p}function z(e,t){e&&e.i&&(O.delete(e),e.i(t))}function U(e,t,n,r){if(e&&e.o){if(O.has(e))return;O.add(e),j.c.push((()=>{O.delete(e),r&&(n&&e.d(1),r())})),e.o(t)}}function q(e){e&&e.c()}function H(e,t,r,a){const{fragment:s,on_mount:l,on_destroy:c,after_update:u}=e.$$;s&&s.m(t,r),a||D((()=>{const t=l.map(n).filter(o);c?c.push(...t):i(t),e.$$.on_mount=[]})),u.forEach(D)}function V(e,t){const n=e.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function G(e,t){-1===e.$$.dirty[0]&&(C.push(e),$||($=!0,_.then(F)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function Y(t,n,o,a,s,l,c,d=[-1]){const f=x;S(t);const p=t.$$={fragment:null,ctx:null,props:l,update:e,not_equal:s,bound:r(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(f?f.$$.context:n.context||[]),callbacks:r(),dirty:d,skip_bound:!1,root:n.target||f.$$.root};c&&c(p.root);let h=!1;if(p.ctx=o?o(t,n.props||{},((e,n,...r)=>{const i=r.length?r[0]:n;return p.ctx&&s(p.ctx[e],p.ctx[e]=i)&&(!p.skip_bound&&p.bound[e]&&p.bound[e](i),h&&G(t,e)),n})):[],p.update(),h=!0,i(p.before_update),p.fragment=!!a&&a(p.ctx),n.target){if(n.hydrate){const e=function(e){return Array.from(e.childNodes)}(n.target);p.fragment&&p.fragment.l(e),e.forEach(u)}else p.fragment&&p.fragment.c();n.intro&&z(t.$$.fragment),H(t,n.target,n.anchor,n.customElement),F()}S(f)}class X{$destroy(){V(this,1),this.$destroy=e}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Q,J=function(){return(J=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function K(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Z(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function ee(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function te(e){return e.nodeType===e.ELEMENT_NODE}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(Q||(Q={}));var ne=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function re(e,t){void 0===t&&(t={});var n=1,r=1;function i(e){var t=e.match(/\n/g);t&&(n+=t.length);var i=e.lastIndexOf("\n");r=-1===i?r+e.length:e.length-i}function o(){var e={line:n,column:r};return function(t){return t.position=new a(e),p(),t}}var a=function(e){this.start=e,this.end={line:n,column:r},this.source=t.source};a.prototype.content=e;var s=[];function l(i){var o=new Error(t.source+":"+n+":"+r+": "+i);if(o.reason=i,o.filename=t.source,o.line=n,o.column=r,o.source=e,!t.silent)throw o;s.push(o)}function c(){return f(/^{\s*/)}function u(){return f(/^}/)}function d(){var t,n=[];for(p(),h(n);e.length&&"}"!==e.charAt(0)&&(t=M()||k());)!1!==t&&(n.push(t),h(n));return n}function f(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function p(){f(/^\s*/)}function h(e){var t;for(void 0===e&&(e=[]);t=m();)!1!==t&&e.push(t),t=m();return e}function m(){var t=o();if("/"===e.charAt(0)&&"*"===e.charAt(1)){for(var n=2;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return l("End of comment missing");var a=e.slice(2,n-2);return r+=2,i(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}}function v(){var e=f(/^([^{]+)/);if(e)return ie(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 y(){var e=o(),t=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var n=ie(t[0]);if(!f(/^:\s*/))return l("property missing ':'");var r=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:n.replace(ne,""),value:r?ie(r[0]).replace(ne,""):""});return f(/^[;\s]*/),i}}function g(){var e,t=[];if(!c())return l("missing '{'");for(h(t);e=y();)!1!==e&&(t.push(e),h(t)),e=y();return u()?t:l("missing '}'")}function b(){for(var e,t=[],n=o();e=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),f(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:g()})}var w,x=T("import"),S=T("charset"),E=T("namespace");function T(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=o(),r=f(t);if(r){var i={type:e};return i[e]=r[1].trim(),n(i)}}}function M(){if("@"===e[0])return function(){var e=o(),t=f(/^@([-\w]+)?keyframes\s*/);if(t){var n=t[1];if(!(t=f(/^([-\w]+)\s*/)))return l("@keyframes missing name");var r,i=t[1];if(!c())return l("@keyframes missing '{'");for(var a=h();r=b();)a.push(r),a=a.concat(h());return u()?e({type:"keyframes",name:i,vendor:n,keyframes:a}):l("@keyframes missing '}'")}}()||function(){var e=o(),t=f(/^@media *([^{]+)/);if(t){var n=ie(t[1]);if(!c())return l("@media missing '{'");var r=h().concat(d());return u()?e({type:"media",media:n,rules:r}):l("@media missing '}'")}}()||function(){var e=o(),t=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:ie(t[1]),media:ie(t[2])})}()||function(){var e=o(),t=f(/^@supports *([^{]+)/);if(t){var n=ie(t[1]);if(!c())return l("@supports missing '{'");var r=h().concat(d());return u()?e({type:"supports",supports:n,rules:r}):l("@supports missing '}'")}}()||x()||S()||E()||function(){var e=o(),t=f(/^@([-\w]+)?document *([^{]+)/);if(t){var n=ie(t[1]),r=ie(t[2]);if(!c())return l("@document missing '{'");var i=h().concat(d());return u()?e({type:"document",document:r,vendor:n,rules:i}):l("@document missing '}'")}}()||function(){var e=o();if(f(/^@page */)){var t=v()||[];if(!c())return l("@page missing '{'");for(var n,r=h();n=y();)r.push(n),r=r.concat(h());return u()?e({type:"page",selectors:t,declarations:r}):l("@page missing '}'")}}()||function(){var e=o();if(f(/^@host\s*/)){if(!c())return l("@host missing '{'");var t=h().concat(d());return u()?e({type:"host",rules:t}):l("@host missing '}'")}}()||function(){var e=o();if(f(/^@font-face\s*/)){if(!c())return l("@font-face missing '{'");for(var t,n=h();t=y();)n.push(t),n=n.concat(h());return u()?e({type:"font-face",declarations:n}):l("@font-face missing '}'")}}()}function k(){var e=o(),t=v();return t?(h(),e({type:"rule",selectors:t,declarations:g()})):l("selector missing")}return oe((w=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:w,parsingErrors:s}}))}function ie(e){return e?e.replace(/^\s+|\s+$/g,""):""}function oe(e,t){for(var n=e&&"string"==typeof e.type,r=n?e:t,i=0,o=Object.keys(e);i<o.length;i++){var a=e[o[i]];Array.isArray(a)?a.forEach((function(e){oe(e,r)})):a&&"object"==typeof a&&oe(a,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var ae={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 se,le,ce,ue,de,fe,pe=/([^\\]):hover/,he=new RegExp(pe.source,"g");function me(e,t){var n=null==t?void 0:t.stylesWithHoverClass.get(e);if(n)return n;var r=re(e,{silent:!0});if(!r.stylesheet)return e;var i=[];if(r.stylesheet.rules.forEach((function(e){"selectors"in e&&(e.selectors||[]).forEach((function(e){pe.test(e)&&i.push(e)}))})),0===i.length)return e;var o=new RegExp(i.filter((function(e,t){return i.indexOf(e)===t})).sort((function(e,t){return t.length-e.length})).map((function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})).join("|"),"g"),a=e.replace(o,(function(e){var t=e.replace(he,"$1.\\:hover");return e+", "+t}));return null==t||t.stylesWithHoverClass.set(e,a),a}function ve(){return{stylesWithHoverClass:new Map}}function ye(e,t){var n=t.doc,r=t.hackCss,i=t.cache;switch(e.type){case Q.Document:return n.implementation.createDocument(null,"",null);case Q.DocumentType:return n.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case Q.Element:var o,a=function(e){var t=ae[e.tagName]?ae[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}(e);o=e.isSVG?n.createElementNS("http://www.w3.org/2000/svg",a):n.createElement(a);var s=function(t){if(!e.attributes.hasOwnProperty(t))return"continue";var s=e.attributes[t];if("option"===a&&"selected"===t&&!1===s)return"continue";if(s="boolean"==typeof s||"number"==typeof s?"":s,t.startsWith("rr_")){if("canvas"===a&&"rr_dataURL"===t){var l=document.createElement("img");l.src=s,l.onload=function(){var e=o.getContext("2d");e&&e.drawImage(l,0,0,l.width,l.height)}}else if("img"===a&&"rr_dataURL"===t){var c=o;c.currentSrc.startsWith("data:")||(c.setAttribute("rrweb-original-src",e.attributes.src),c.src=s)}if("rr_width"===t)o.style.width=s;else if("rr_height"===t)o.style.height=s;else if("rr_mediaCurrentTime"===t)o.currentTime=e.attributes.rr_mediaCurrentTime;else if("rr_mediaState"===t)switch(s){case"played":o.play().catch((function(e){return console.warn("media playback error",e)}));break;case"paused":o.pause()}}else{var u="textarea"===a&&"value"===t,d="style"===a&&"_cssText"===t;if(d&&r&&(s=me(s,i)),u||d){for(var f=n.createTextNode(s),p=0,h=Array.from(o.childNodes);p<h.length;p++){var m=h[p];m.nodeType===o.TEXT_NODE&&o.removeChild(m)}return o.appendChild(f),"continue"}try{if(e.isSVG&&"xlink:href"===t)o.setAttributeNS("http://www.w3.org/1999/xlink",t,s);else if("onload"===t||"onclick"===t||"onmouse"===t.substring(0,7))o.setAttribute("_"+t,s);else{if("meta"===a&&"Content-Security-Policy"===e.attributes["http-equiv"]&&"content"===t)return o.setAttribute("csp-content",s),"continue";"link"===a&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===a&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")||("img"===a&&e.attributes.srcset&&e.attributes.rr_dataURL?o.setAttribute("rrweb-original-srcset",e.attributes.srcset):o.setAttribute(t,s))}}catch(e){}}};for(var l in e.attributes)s(l);if(e.isShadowHost)if(o.shadowRoot)for(;o.shadowRoot.firstChild;)o.shadowRoot.removeChild(o.shadowRoot.firstChild);else o.attachShadow({mode:"open"});return o;case Q.Text:return n.createTextNode(e.isStyle&&r?me(e.textContent,i):e.textContent);case Q.CDATA:return n.createCDATASection(e.textContent);case Q.Comment:return n.createComment(e.textContent);default:return null}}function ge(e,t){var n=t.doc,r=t.map,i=t.skipChild,o=void 0!==i&&i,a=t.hackCss,s=void 0===a||a,l=t.afterAppend,c=t.cache,u=ye(e,{doc:n,hackCss:s,cache:c});if(!u)return null;if(e.rootId&&console.assert(r[e.rootId]===n,"Target document should has the same root id."),e.type===Q.Document&&(n.close(),n.open(),"BackCompat"===e.compatMode&&e.childNodes&&e.childNodes[0].type!==Q.DocumentType&&(e.childNodes[0].type===Q.Element&&"xmlns"in e.childNodes[0].attributes&&"http://www.w3.org/1999/xhtml"===e.childNodes[0].attributes.xmlns?n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):n.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),u=n),u.__sn=e,r[e.id]=u,(e.type===Q.Document||e.type===Q.Element)&&!o)for(var d=0,f=e.childNodes;d<f.length;d++){var p=f[d],h=ge(p,{doc:n,map:r,skipChild:!1,hackCss:s,afterAppend:l,cache:c});h?(p.isShadow&&te(u)&&u.shadowRoot?u.shadowRoot.appendChild(h):u.appendChild(h),l&&l(h)):console.warn("Failed to rebuild",p)}return u}function be(e,t){var n=t.doc,r=t.onVisit,i=t.hackCss,o={},a=ge(e,{doc:n,map:o,skipChild:!1,hackCss:void 0===i||i,afterAppend:t.afterAppend,cache:t.cache});return function(e,t){for(var n in e)e[n]&&(r=e[n],t(r));var r}(o,(function(e){r&&r(e),function(e){var t=e.__sn;if(t.type===Q.Element){var n=e;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&r.startsWith("rr_")){var i=t.attributes[r];"rr_scrollLeft"===r&&(n.scrollLeft=i),"rr_scrollTop"===r&&(n.scrollTop=i)}}}(e)})),[a,o]}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin"}(se||(se={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration"}(le||(le={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel"}(ce||(ce={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(ue||(ue={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(de||(de={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(fe||(fe={}));var we="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",xe={map:{},getId:function(){return console.error(we),-1},getNode:function(){return console.error(we),null},removeNodeFromMap:function(){console.error(we)},has:function(){return console.error(we),!1},reset:function(){console.error(we)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(xe=new Proxy(xe,{get:function(e,t,n){return"map"===t&&console.error(we),Reflect.get(e,t,n)}}));var Se=function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e,t){var n=this,r=this.indexes.get(e.parentId),i=this.indexes.get(e.id),o=function(e){n.removeIdSet.add(e);var r=t.getNode(e);null==r||r.childNodes.forEach((function(e){"__sn"in e&&o(e.__sn.id)}))},a=function(t){n.removeIdSet.add(t.id),Object.values(t.children).forEach((function(e){return a(e)}));var r=n.indexes.get(t.id);if(r){var i=r.parent;i&&(delete r.parent,delete i.children[r.id],n.indexes.delete(e.id))}};i?r?(delete i.parent,delete r.children[i.id],this.indexes.delete(e.id),a(i)):(delete this.tree[i.id],this.indexes.delete(i.id),a(i)):(this.removeNodeMutations.push(e),o(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,i=this,o=this,a=o.tree,s=o.removeNodeMutations,l=o.textMutations,c=o.attributeMutations,u={source:le.Mutation,removes:s,texts:l,attributes:c,adds:[]},d=function(e,t){t&&i.removeIdSet.add(e.id),u.texts=u.texts.concat(t?[]:e.texts).filter((function(e){return!i.removeIdSet.has(e.id)})),u.attributes=u.attributes.concat(t?[]:e.attributes).filter((function(e){return!i.removeIdSet.has(e.id)})),i.removeIdSet.has(e.id)||i.removeIdSet.has(e.mutation.parentId)||t?Object.values(e.children).forEach((function(e){return d(e,!0)})):(u.adds.push(e.mutation),e.children&&Object.values(e.children).forEach((function(e){return d(e,!1)})))};Object.values(a).forEach((function(e){return d(e,!1)}));try{for(var f=K(this.scrollMap.keys()),p=f.next();!p.done;p=f.next()){var h=p.value;this.removeIdSet.has(h)&&this.scrollMap.delete(h)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}try{for(var m=K(this.inputMap.keys()),v=m.next();!v.done;v=m.next()){h=v.value;this.removeIdSet.has(h)&&this.inputMap.delete(h)}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}var y=new Map(this.scrollMap),g=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:y,inputMap:g}},e.prototype.reset=function(){this.tree=[],this.indexes=new Map,this.removeNodeMutations=[],this.textMutations=[],this.attributeMutations=[],this.removeIdSet=new Set,this.scrollMap=new Map,this.inputMap=new Map},e.prototype.idRemoved=function(e){return this.removeIdSet.has(e)},e}();function Ee(e){var t,n,r={},i=function(e,t){var n={value:e,parent:t,children:[]};return r[e.node.id]=n,n},o=[];try{for(var a=K(e),s=a.next();!s.done;s=a.next()){var l=s.value,c=l.nextId,u=l.parentId;if(c&&c in r){var d=r[c];if(d.parent){var f=d.parent.children.indexOf(d);d.parent.children.splice(f,0,i(l,d.parent))}else{f=o.indexOf(d);o.splice(f,0,i(l,null))}}else if(u in r){var p=r[u];p.children.push(i(l,p))}else o.push(i(l,null))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o}function Te(e,t){t(e.value);for(var n=e.children.length-1;n>=0;n--)Te(e.children[n],t)}function Me(e){return"__sn"in e&&(e.__sn.type===Q.Element&&"iframe"===e.__sn.tagName)}function ke(e,t){var n,r,i=null===(r=null===(n=e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===r?void 0:r.frameElement;if(!i||i===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=i.getBoundingClientRect(),a=ke(i,t),s=o.height/i.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:s,absoluteScale:a.absoluteScale*s}}function Ce(e){return Boolean(null==e?void 0:e.shadowRoot)}for(var Ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ne="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ae=0;Ae<Ie.length;Ae++)Ne[Ie.charCodeAt(Ae)]=Ae;function _e(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 $e=Object.freeze({__proto__:null,default:_e});function De(e,t){if(void 0===e&&(e=window),void 0===t&&(t=document),!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var n,r=e.HTMLElement||e.Element,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||s,scrollIntoView:r.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?h.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(l(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==l(arguments[0])){var e=arguments[0].left,t=arguments[0].top;h.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var n=f(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(h.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function l(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function u(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function d(e){var t=c(e,"Y")&&u(e,"Y"),n=c(e,"X")&&u(e,"X");return t||n}function f(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}function p(t){var n,r,i,a,s=(o()-t.startTime)/468;a=s=s>1?1:s,n=.5*(1-Math.cos(Math.PI*a)),r=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,i),r===t.x&&i===t.y||e.requestAnimationFrame(p.bind(e,t))}function h(n,r,a){var l,c,u,d,f=o();n===t.body?(l=e,c=e.scrollX||e.pageXOffset,u=e.scrollY||e.pageYOffset,d=i.scroll):(l=n,c=n.scrollLeft,u=n.scrollTop,d=s),p({scrollable:l,method:d,startTime:f,startX:c,startY:u,x:r,y:a})}}var Re,Le=function(){function e(e,t){void 0===e&&(e=[]),this.timeOffset=0,this.raf=null,this.actions=e,this.speed=t}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){this.actions=this.actions.concat(e)},e.prototype.start=function(){this.timeOffset=0;var e=performance.now(),t=this.actions,n=this;this.raf=requestAnimationFrame((function r(){var i=performance.now();for(n.timeOffset+=(i-e)*n.speed,e=i;t.length;){var o=t[0];if(!(n.timeOffset>=o.delay))break;t.shift(),o.doAction()}(t.length>0||n.liveMode)&&(n.raf=requestAnimationFrame(r))}))},e.prototype.clear=function(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0},e.prototype.setSpeed=function(e){this.speed=e},e.prototype.toggleLiveMode=function(e){this.liveMode=e},e.prototype.isActive=function(){return null!==this.raf},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r+1;n=r-1}}return t},e}();function Fe(e,t){if(e.type===se.IncrementalSnapshot&&e.data.source===le.MouseMove){var n=e.data.positions[0].timeOffset,r=e.timestamp+n;return e.delay=r-t,r-t}return e.delay=e.timestamp-t,e.delay}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function Pe(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Re||(Re={}));var Oe={type:"xstate.init"};function je(e){return void 0===e?[]:[].concat(e)}function We(e){return{type:"xstate.assign",assignment:e}}function Be(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 ze(e){return function(t){return e===t}}function Ue(e){return"string"==typeof e?{type:e}:e}function qe(e,t){return{value:e,context:t,actions:[],changed:!1,matches:ze(e)}}function He(e,t,n){var r=t,i=!1;return[e.filter((function(e){if("xstate.assign"===e.type){i=!0;var t=Object.assign({},r);return"function"==typeof e.assignment?t=e.assignment(r,n):Object.keys(e.assignment).forEach((function(i){t[i]="function"==typeof e.assignment[i]?e.assignment[i](r,n):e.assignment[i]})),r=t,!1}return!0})),r,i]}function Ve(e,t){void 0===t&&(t={});var n=Pe(He(je(e.states[e.initial].entry).map((function(e){return Be(e,t.actions)})),e.context,Oe),2),r=n[0],i=n[1],o={config:e,_options:t,initialState:{value:e.initial,actions:r,context:i,matches:ze(e.initial)},transition:function(t,n){var r,i,a="string"==typeof t?{value:t,context:e.context}:t,s=a.value,l=a.context,c=Ue(n),u=e.states[s];if(u.on){var d=je(u.on[c.type]);try{for(var f=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),p=f.next();!p.done;p=f.next()){var h=p.value;if(void 0===h)return qe(s,l);var m="string"==typeof h?{target:h}:h,v=m.target,y=m.actions,g=void 0===y?[]:y,b=m.cond,w=void 0===b?function(){return!0}:b,x=void 0===v,S=null!=v?v:s,E=e.states[S];if(w(l,c)){var T=Pe(He((x?je(g):[].concat(u.exit,g,E.entry).filter((function(e){return e}))).map((function(e){return Be(e,o._options.actions)})),l,c),3),M=T[0],k=T[1],C=T[2],I=null!=v?v:s;return{value:I,context:k,actions:M,changed:v!==s||M.length>0||C,matches:ze(I)}}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}return qe(s,l)}};return o}var Ge=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))};function Ye(e){var t=e.initialState,n=Re.NotStarted,r=new Set,i={_machine:e,send:function(i){n===Re.Running&&(t=e.transition(t,i),Ge(t,Ue(i)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(r){if(r){var o="object"==typeof r?r:{context:e.config.context,value:r};t={value:o.value,actions:[],context:o.context,matches:ze(o.value)}}return n=Re.Running,Ge(t,Oe),i},stop:function(){return n=Re.Stopped,r.clear(),i},get state(){return t},get status(){return n}};return i}function Xe(e,t){var n=t.getCastFn,r=t.applyEventsSynchronously,i=t.emitter;return Ye(Ve({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:We({lastPlayedEvent:function(e,t){return"CAST_EVENT"===t.type?t.payload.event:e.lastPlayedEvent}}),recordTimeOffset:We((function(e,t){var n=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(n=t.payload.timeOffset),J(J({},e),{timeOffset:n,baselineTime:e.events[0].timestamp+n})})),play:function(e){var t,o,a,s,l,c=e.timer,u=e.events,d=e.baselineTime,f=e.lastPlayedEvent;c.clear();try{for(var p=K(u),h=p.next();!h.done;h=p.next()){Fe(h.value,d)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(t)throw t.error}}var m=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.type===se.Meta&&r.timestamp<=t)return e.slice(n)}return e}(u,d),v=null==f?void 0:f.timestamp;(null==f?void 0:f.type)===se.IncrementalSnapshot&&f.data.source===le.MouseMove&&(v=f.timestamp+(null===(l=f.data.positions[0])||void 0===l?void 0:l.timeOffset)),d<(v||0)&&i.emit(fe.PlayBack);var y=new Array,g=new Array,b=function(e){if(v&&v<d&&(e.timestamp<=v||e===f))return"continue";if(e.timestamp<d)y.push(e);else{var t=n(e,!1);g.push({doAction:function(){t()},delay:e.delay})}};try{for(var w=K(m),x=w.next();!x.done;x=w.next()){b(x.value)}}catch(e){a={error:e}}finally{try{x&&!x.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}r(y),i.emit(fe.Flush),c.addActions(g),c.start()},pause:function(e){e.timer.clear()},resetLastPlayedEvent:We((function(e){return J(J({},e),{lastPlayedEvent:null})})),startLive:We({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:We((function(e,t){var r=e.baselineTime,i=e.timer,o=e.events;if("ADD_EVENT"===t.type){var a=t.payload.event;Fe(a,r);var s=o.length-1;if(!o[s]||o[s].timestamp<=a.timestamp)o.push(a);else{for(var l=-1,c=0;c<=s;){var u=Math.floor((c+s)/2);o[u].timestamp<=a.timestamp?c=u+1:s=u-1}-1===l&&(l=c),o.splice(l,0,a)}var d=a.timestamp<r,f=n(a,d);d?f():i.isActive()&&i.addAction({doAction:function(){f()},delay:a.delay})}return J(J({},e),{events:o})}))}}))}var Qe;function Je(e,t){var n=e[t[0]];return 1===t.length?n:Je(n.cssRules[t[1]].cssRules,t.slice(2))}function Ke(e){var t=ee([],Z(e),!1),n=t.pop();return{positions:t,index:n}}function Ze(e,t){var n=t.sheet;n&&e.forEach((function(e){if(e.type===Qe.Insert)try{if(Array.isArray(e.index)){var r=Ke(e.index),i=r.positions,o=r.index;Je(n.cssRules,i).insertRule(e.cssText,o)}else n.insertRule(e.cssText,e.index)}catch(e){}else if(e.type===Qe.Remove)try{if(Array.isArray(e.index)){var a=Ke(e.index);i=a.positions,o=a.index;Je(n.cssRules,i).deleteRule(o||0)}else n.deleteRule(e.index)}catch(e){}else if(e.type===Qe.Snapshot)!function(e,t){var n;try{var r=Array.from((null===(n=t.sheet)||void 0===n?void 0:n.cssRules)||[]).map((function(e){return e.cssText})),i=Object.entries(r).reverse(),o=r.length;i.forEach((function(n){var r,i=Z(n,2),a=i[0],s=i[1],l=e.indexOf(s);if(-1===l||l>o)try{null===(r=t.sheet)||void 0===r||r.deleteRule(Number(a))}catch(e){}o=l})),e.forEach((function(e,n){var r,i,o;try{(null===(i=null===(r=t.sheet)||void 0===r?void 0:r.cssRules[n])||void 0===i?void 0:i.cssText)!==e&&(null===(o=t.sheet)||void 0===o||o.insertRule(e,n))}catch(e){}}))}catch(e){}}(e.cssTexts,t);else if(e.type===Qe.SetProperty){Je(n.cssRules,e.index).style.setProperty(e.property,e.value,e.priority)}else if(e.type===Qe.RemoveProperty){Je(n.cssRules,e.index).style.removeProperty(e.property)}}))}!function(e){e[e.Insert=0]="Insert",e[e.Remove=1]="Remove",e[e.Snapshot=2]="Snapshot",e[e.SetProperty=3]="SetProperty",e[e.RemoveProperty=4]="RemoveProperty"}(Qe||(Qe={}));var et=new Map;function tt(e,t){var n=et.get(e);return n||(n=new Map,et.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var nt=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function rt(e,t){return function(n){if(n&&"object"==typeof n&&"rr_type"in n){if("index"in n){var r=n.rr_type,i=n.index;return tt(t,r)[i]}if("args"in n){var o=n.rr_type,a=n.args,s=window[o];return new(s.bind.apply(s,ee([void 0],Z(a.map(rt(e,t))),!1)))}if("base64"in n)return function(e){var t,n,r,i,o,a=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var c=new ArrayBuffer(a),u=new Uint8Array(c);for(t=0;t<s;t+=4)n=Ne[e.charCodeAt(t)],r=Ne[e.charCodeAt(t+1)],i=Ne[e.charCodeAt(t+2)],o=Ne[e.charCodeAt(t+3)],u[l++]=n<<2|r>>4,u[l++]=(15&r)<<4|i>>2,u[l++]=(3&i)<<6|63&o;return c}(n.base64);if("src"in n){var l=e.get(n.src);if(l)return l;var c=new Image;return c.src=n.src,e.set(n.src,c),c}}else if(Array.isArray(n))return n.map(rt(e,t));return n}}function it(e){var t=e.mutation,n=e.target,r=e.type,i=e.imageMap,o=e.errorHandler;try{var a=function(e,t){try{return t===ue.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(e){return null}}(n,r);if(!a)return;if(t.setter)return void(a[t.property]=t.args[0]);var s=a[t.property],l=t.args.map(rt(i,a));!function(e,t){if(null==t?void 0:t.constructor){var n=t.constructor.name;if(nt.includes(n)){var r=tt(e,n);r.includes(t)||r.push(t)}}}(a,s.apply(a,l))}catch(e){o(t,e)}}var ot=_e||$e,at="[replayer]",st={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function lt(e){return e.type==se.IncrementalSnapshot&&(e.data.source==le.TouchMove||e.data.source==le.MouseInteraction&&e.data.type==ce.TouchStart)}var ct=function(){function e(e,t){var n=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=ot(),this.legacy_missingNodeRetryMap={},this.cache=ve(),this.imageMap=new Map,this.mirror={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}},this.firstFullSnapshot=null,this.newDocumentQueue=[],this.mousePos=null,this.touchActive=null,!(null==t?void 0:t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");var r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:st};this.config=Object.assign({},r,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(fe.Resize,this.handleResize),this.setupDom(),this.treeIndex=new Se,this.fragmentParentMap=new Map,this.elementStateMap=new Map,this.virtualStyleRulesMap=new Map,this.emitter.on(fe.Flush,(function(){var e,t,r,i,o,a,s,l,c=n.treeIndex.flush(),u=c.scrollMap,d=c.inputMap,f=c.mutationData;n.fragmentParentMap.forEach((function(e,t){return n.restoreRealParent(t,e)}));try{for(var p=K(f.texts),h=p.next();!h.done;h=p.next()){var m=h.value;n.applyText(m,f)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=p.return)&&t.call(p)}finally{if(e)throw e.error}}try{for(var v=K(n.virtualStyleRulesMap.keys()),y=v.next();!y.done;y=v.next()){var g=y.value;n.restoreNodeSheet(g)}}catch(e){r={error:e}}finally{try{y&&!y.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}n.fragmentParentMap.clear(),n.elementStateMap.clear(),n.virtualStyleRulesMap.clear();try{for(var b=K(u.values()),w=b.next();!w.done;w=b.next()){m=w.value;n.applyScroll(m,!0)}}catch(e){o={error:e}}finally{try{w&&!w.done&&(a=b.return)&&a.call(b)}finally{if(o)throw o.error}}try{for(var x=K(d.values()),S=x.next();!S.done;S=x.next()){m=S.value;n.applyInput(m)}}catch(e){s={error:e}}finally{try{S&&!S.done&&(l=x.return)&&l.call(x)}finally{if(s)throw s.error}}})),this.emitter.on(fe.PlayBack,(function(){n.firstFullSnapshot=null,n.mirror.reset()}));var i=new Le([],(null==t?void 0:t.speed)||r.speed);this.service=Xe({events:e.map((function(e){return t&&t.unpackFn?t.unpackFn(e):e})).sort((function(e,t){return e.timestamp-t.timestamp})),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){n.emitter.emit(fe.StateChange,{player:e})})),this.speedService=Ye(Ve({id:"speed",context:{normalSpeed:-1,timer:i},initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:function(e,t){"payload"in t&&e.timer.setSpeed(t.payload.speed)},recordSpeed:We({normalSpeed:function(e){return e.timer.speed}}),restoreSpeed:function(e){e.timer.setSpeed(e.normalSpeed)}}})),this.speedService.start(),this.speedService.subscribe((function(e){n.emitter.emit(fe.StateChange,{speed:e})}));var o=this.service.state.context.events.find((function(e){return e.type===se.Meta})),a=this.service.state.context.events.find((function(e){return e.type===se.FullSnapshot}));if(o){var s=o.data,l=s.width,c=s.height;setTimeout((function(){n.emitter.emit(fe.Resize,{width:l,height:c})}),0)}a&&setTimeout((function(){n.firstFullSnapshot||(n.firstFullSnapshot=a,n.rebuildFullSnapshot(a),n.iframe.contentWindow.scrollTo(a.data.initialOffset))}),1),this.service.state.context.events.find(lt)&&this.mouse.classList.add("touch-device")}return Object.defineProperty(e.prototype,"timer",{get:function(){return this.service.state.context.timer},enumerable:!1,configurable:!0}),e.prototype.on=function(e,t){return this.emitter.on(e,t),this},e.prototype.off=function(e,t){return this.emitter.off(e,t),this},e.prototype.setConfig=function(e){var t=this;Object.keys(e).forEach((function(n){t.config[n]=e[n]})),this.config.skipInactive||this.backToNormal(),void 0!==e.speed&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),void 0!==e.mouseTail&&(!1===e.mouseTail?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))},e.prototype.getMetaData=function(){var e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}},e.prototype.getCurrentTime=function(){return this.timer.timeOffset+this.getTimeOffset()},e.prototype.getTimeOffset=function(){var e=this.service.state.context;return e.baselineTime-e.events[0].timestamp},e.prototype.getMirror=function(){return this.mirror},e.prototype.play=function(e){var t;void 0===e&&(e=0),this.service.state.matches("paused")||this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}}),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.remove("rrweb-paused"),this.emitter.emit(fe.Start)},e.prototype.pause=function(e){var t;void 0===e&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),"number"==typeof e&&(this.play(e),this.service.send({type:"PAUSE"})),null===(t=this.iframe.contentDocument)||void 0===t||t.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(fe.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(fe.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;lt(n)&&this.mouse.classList.add("touch-device"),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.resetCache=function(){this.cache=ve()},e.prototype.setupDom=function(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),!1!==this.config.mouseTail&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");var e,t=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&t.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",t.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(De(this.iframe.contentWindow,this.iframe.contentDocument),void 0===(e=this.iframe.contentWindow)&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1}))},e.prototype.handleResize=function(e){var t,n;this.iframe.style.display="inherit";try{for(var r=K([this.mouseTail,this.iframe]),i=r.next();!i.done;i=r.next()){var o=i.value;o&&(o.setAttribute("width",String(e.width)),o.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.applyEventsSynchronously=function(e){var t,n;try{for(var r=K(e),i=r.next();!i.done;i=r.next()){var o=i.value;switch(o.type){case se.DomContentLoaded:case se.Load:case se.Custom:continue;case se.FullSnapshot:case se.Meta:case se.Plugin:break;case se.IncrementalSnapshot:switch(o.data.source){case le.MediaInteraction:continue}}this.getCastFn(o,!0)()}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}this.mousePos&&this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null,!0===this.touchActive?this.mouse.classList.add("touch-active"):!1===this.touchActive&&this.mouse.classList.remove("touch-active"),this.touchActive=null},e.prototype.getCastFn=function(e,t){var n,r=this;switch(void 0===t&&(t=!1),e.type){case se.DomContentLoaded:case se.Load:break;case se.Custom:n=function(){r.emitter.emit(fe.CustomEvent,e)};break;case se.Meta:n=function(){return r.emitter.emit(fe.Resize,{width:e.data.width,height:e.data.height})};break;case se.FullSnapshot:n=function(){if(r.firstFullSnapshot){if(r.firstFullSnapshot===e)return void(r.firstFullSnapshot=!0)}else r.firstFullSnapshot=!0;r.rebuildFullSnapshot(e,t),r.iframe.contentWindow.scrollTo(e.data.initialOffset)};break;case se.IncrementalSnapshot:n=function(){var n,i;if(r.applyIncremental(e,t),!t&&(e===r.nextUserInteractionEvent&&(r.nextUserInteractionEvent=null,r.backToNormal()),r.config.skipInactive&&!r.nextUserInteractionEvent)){try{for(var o=K(r.service.state.context.events),a=o.next();!a.done;a=o.next()){var s=a.value;if(!(s.timestamp<=e.timestamp)&&r.isUserInteraction(s)){s.delay-e.delay>1e4*r.speedService.state.context.timer.speed&&(r.nextUserInteractionEvent=s);break}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}if(r.nextUserInteractionEvent){var l=r.nextUserInteractionEvent.delay-e.delay,c={speed:Math.min(Math.round(l/5e3),r.config.maxSpeed)};r.speedService.send({type:"FAST_FORWARD",payload:c}),r.emitter.emit(fe.SkipStart,c)}}}}return function(){var i,o;n&&n();try{for(var a=K(r.config.plugins||[]),s=a.next();!s.done;s=a.next()){s.value.handler(e,t,{replayer:r})}}catch(e){i={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}r.service.send({type:"CAST_EVENT",payload:{event:e}});var l=r.service.state.context.events.length-1;if(e===r.service.state.context.events[l]){var c=function(){l<r.service.state.context.events.length-1||(r.backToNormal(),r.service.send("END"),r.emitter.emit(fe.Finish))};e.type===se.IncrementalSnapshot&&e.data.source===le.MouseMove&&e.data.positions.length?setTimeout((function(){c()}),Math.max(0,50-e.data.positions[0].timeOffset)):c()}r.emitter.emit(fe.EventCast,e)}},e.prototype.rebuildFullSnapshot=function(e,t){var n,r,i=this;if(void 0===t&&(t=!1),!this.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&console.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};var o=[];this.mirror.map=be(e.data.node,{doc:this.iframe.contentDocument,afterAppend:function(e){i.collectIframeAndAttachDocument(o,e)},cache:this.cache})[1];var a=function(e,t){s.attachDocumentToIframe(e,t),s.newDocumentQueue=s.newDocumentQueue.filter((function(t){return t!==e}))},s=this;try{for(var l=K(o),c=l.next();!c.done;c=l.next()){var u=c.value;a(u.mutationInQueue,u.builtNode)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}var d=this.iframe.contentDocument,f=d.documentElement,p=d.head;this.insertStyleRules(f,p),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(fe.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},e.prototype.insertStyleRules=function(e,t){var n=document.createElement("style");e.insertBefore(n,t);var r,i=(r=this.config.blockClass,[".".concat(r," { background: currentColor }"),"noscript { display: none !important; }"]).concat(this.config.insertStyleRules);this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }");for(var o=0;o<i.length;o++)n.sheet.insertRule(i[o],o)},e.prototype.attachDocumentToIframe=function(e,t){var n,r,i=this,o=[];if(!t.contentDocument)for(var a=t.parentNode;a;){if(this.fragmentParentMap.has(a)){var s=a,l=this.fragmentParentMap.get(s);this.restoreRealParent(s,l);break}a=a.parentNode}ge(e.node,{doc:t.contentDocument,map:this.mirror.map,hackCss:!0,skipChild:!1,afterAppend:function(e){if(i.collectIframeAndAttachDocument(o,e),e.__sn.type===Q.Element&&"HTML"===e.__sn.tagName.toUpperCase()){var n=t.contentDocument,r=n.documentElement,a=n.head;i.insertStyleRules(r,a)}},cache:this.cache});var c=function(e,t){u.attachDocumentToIframe(e,t),u.newDocumentQueue=u.newDocumentQueue.filter((function(t){return t!==e}))},u=this;try{for(var d=K(o),f=d.next();!f.done;f=d.next()){var p=f.value;c(p.mutationInQueue,p.builtNode)}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}},e.prototype.collectIframeAndAttachDocument=function(e,t){if(Me(t)){var n=this.newDocumentQueue.find((function(e){return e.parentId===t.__sn.id}));n&&e.push({mutationInQueue:n,builtNode:t})}},e.prototype.waitForStylesheetLoad=function(){var e,t=this,n=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(n){var r,i=new Set,o=this.service.state,a=function(){o=t.service.state};this.emitter.on(fe.Start,a),this.emitter.on(fe.Pause,a);var s=function(){t.emitter.off(fe.Start,a),t.emitter.off(fe.Pause,a)};n.querySelectorAll('link[rel="stylesheet"]').forEach((function(e){e.sheet||(i.add(e),e.addEventListener("load",(function(){i.delete(e),0===i.size&&-1!==r&&(o.matches("playing")&&t.play(t.getCurrentTime()),t.emitter.emit(fe.LoadStylesheetEnd),r&&clearTimeout(r),s())})))})),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(fe.LoadStylesheetStart),r=setTimeout((function(){o.matches("playing")&&t.play(t.getCurrentTime()),r=-1,s()}),this.config.loadTimeout))}},e.prototype.hasImageArg=function(e){var t,n;try{for(var r=K(e),i=r.next();!i.done;i=r.next()){var o=i.value;if(o&&"object"==typeof o)if("rr_type"in o&&"args"in o){if(this.hasImageArg(o.args))return!0}else{if("rr_type"in o&&"HTMLImageElement"===o.rr_type)return!0;if(o instanceof Array&&this.hasImageArg(o))return!0}else;}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!1},e.prototype.getImageArgs=function(e){var t,n,r=[];try{for(var i=K(e),o=i.next();!o.done;o=i.next()){var a=o.value;a&&"object"==typeof a&&("rr_type"in a&&"args"in a?r.push.apply(r,ee([],Z(this.getImageArgs(a.args)),!1)):"rr_type"in a&&"HTMLImageElement"===a.rr_type?r.push(a.src):a instanceof Array&&r.push.apply(r,ee([],Z(this.getImageArgs(a)),!1)))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.prototype.preloadAllImages=function(){var e,t,n=this;this.service.state;var r=function(){n.service.state};this.emitter.on(fe.Start,r),this.emitter.on(fe.Pause,r);var i=function(e){e.type===se.IncrementalSnapshot&&e.data.source===le.CanvasMutation&&("commands"in e.data?e.data.commands.forEach((function(t){return n.preloadImages(t,e)})):o.preloadImages(e.data,e))},o=this;try{for(var a=K(this.service.state.context.events),s=a.next();!s.done;s=a.next()){i(s.value)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}},e.prototype.preloadImages=function(e,t){var n=this;if("drawImage"!==e.property||"string"!=typeof e.args[0]||this.imageMap.has(t))this.hasImageArg(e.args)&&this.getImageArgs(e.args).forEach((function(e){var t=new Image;t.src=e,n.imageMap.set(e,t)}));else{var r=document.createElement("canvas"),i=r.getContext("2d"),o=null==i?void 0:i.createImageData(r.width,r.height);null==o||o.data,JSON.parse(e.args[0]),null==i||i.putImageData(o,0,0)}},e.prototype.applyIncremental=function(e,t){var n,r,i=this,o=e.data;switch(o.source){case le.Mutation:t&&(o.adds.forEach((function(e){return i.treeIndex.add(e)})),o.texts.forEach((function(e){var t=i.mirror.getNode(e.id),n=null==t?void 0:t.parentNode;n&&i.virtualStyleRulesMap.has(n)&&i.virtualStyleRulesMap.delete(n),i.treeIndex.text(e)})),o.attributes.forEach((function(e){return i.treeIndex.attribute(e)})),o.removes.forEach((function(e){return i.treeIndex.remove(e,i.mirror)})));try{this.applyMutation(o,t)}catch(e){this.warn("Exception in mutation ".concat(e.message||e),o)}break;case le.Drag:case le.TouchMove:case le.MouseMove:if(t){var a=o.positions[o.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:o}}else o.positions.forEach((function(n){var r={doAction:function(){i.moveAndHover(n.x,n.y,n.id,t,o)},delay:n.timeOffset+e.timestamp-i.service.state.context.baselineTime};i.timer.addAction(r)})),this.timer.addAction({doAction:function(){},delay:e.delay-(null===(n=o.positions[0])||void 0===n?void 0:n.timeOffset)});break;case le.MouseInteraction:if(-1===o.id)break;var s=new Event(ce[o.type].toLowerCase());if(!(g=this.mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);this.emitter.emit(fe.MouseInteraction,{type:o.type,target:g});var l=this.config.triggerFocus;switch(o.type){case ce.Blur:"blur"in g&&g.blur();break;case ce.Focus:l&&g.focus&&g.focus({preventScroll:!0});break;case ce.Click:case ce.TouchStart:case ce.TouchEnd:t?(o.type===ce.TouchStart?this.touchActive=!0:o.type===ce.TouchEnd&&(this.touchActive=!1),this.mousePos={x:o.x,y:o.y,id:o.id,debugData:o}):(o.type===ce.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x,o.y,o.id,t,o),o.type===ce.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===ce.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===ce.TouchEnd&&this.mouse.classList.remove("touch-active"));break;case ce.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:g.dispatchEvent(s)}break;case le.Scroll:if(-1===o.id)break;if(t){this.treeIndex.scroll(o);break}this.applyScroll(o,!1);break;case le.ViewportResize:this.emitter.emit(fe.Resize,{width:o.width,height:o.height});break;case le.Input:if(-1===o.id)break;if(t){this.treeIndex.input(o);break}this.applyInput(o);break;case le.MediaInteraction:if(!(g=this.mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);var c=g;try{o.currentTime&&(c.currentTime=o.currentTime),o.volume&&(c.volume=o.volume),o.muted&&(c.muted=o.muted),1===o.type&&c.pause(),0===o.type&&c.play()}catch(e){this.config.showWarning&&console.warn("Failed to replay media interactions: ".concat(e.message||e))}break;case le.StyleSheetRule:if(!(g=this.mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);var u,d=g,f=g.parentNode,p=this.fragmentParentMap.has(f),h=p?null:d.sheet;h||(this.virtualStyleRulesMap.has(g)?u=this.virtualStyleRulesMap.get(g):(u=[],this.virtualStyleRulesMap.set(g,u))),o.adds&&o.adds.forEach((function(e){var t=e.rule,n=e.index;if(h)try{if(Array.isArray(n)){var r=Ke(n),i=r.positions,o=r.index;Je(h.cssRules,i).insertRule(t,o)}else{o=void 0===n?void 0:Math.min(n,h.cssRules.length);h.insertRule(t,o)}}catch(e){}else null==u||u.push({cssText:t,index:n,type:Qe.Insert})})),o.removes&&o.removes.forEach((function(e){var t=e.index;if(p)null==u||u.push({index:t,type:Qe.Remove});else try{if(Array.isArray(t)){var n=Ke(t),r=n.positions,i=n.index;Je(h.cssRules,r).deleteRule(i||0)}else null==h||h.deleteRule(t)}catch(e){}}));break;case le.StyleDeclaration:if(!(g=this.mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);d=g;var m=g.parentNode,v=this.fragmentParentMap.has(m)?null:d.sheet,y=[];if(v||(this.virtualStyleRulesMap.has(g)?y=this.virtualStyleRulesMap.get(g):(y=[],this.virtualStyleRulesMap.set(g,y))),o.set)if(v)Je(v.rules,o.index).style.setProperty(o.set.property,o.set.value,o.set.priority);else y.push(J({type:Qe.SetProperty,index:o.index},o.set));if(o.remove)if(v)Je(v.rules,o.index).style.removeProperty(o.remove.property);else y.push(J({type:Qe.RemoveProperty,index:o.index},o.remove));break;case le.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var g;if(!(g=this.mirror.getNode(o.id)))return this.debugNodeNotFound(o,o.id);!function(e){var t=e.event,n=e.mutation,r=e.target,i=e.imageMap,o=e.errorHandler;try{var a="commands"in n?n.commands:[n];[ue.WebGL,ue.WebGL2].includes(n.type)?a.forEach((function(e){it({mutation:e,type:n.type,target:r,imageMap:i,errorHandler:o})})):a.forEach((function(e){!function(e){var t=e.event,n=e.mutation,r=e.target,i=e.imageMap,o=e.errorHandler;try{var a=r.getContext("2d");if(n.setter)return void(a[n.property]=n.args[0]);var s=a[n.property];if("drawImage"===n.property&&"string"==typeof n.args[0]){var l=i.get(t);n.args[0]=l,s.apply(a,n.args)}else s.apply(a,n.args)}catch(e){o(n,e)}}({event:t,mutation:e,target:r,imageMap:i,errorHandler:o})}))}catch(e){o(n,e)}}({event:e,mutation:o,target:g,imageMap:this.imageMap,errorHandler:this.warnCanvasMutationFailed.bind(this)});break;case le.Font:try{var b=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);null===(r=this.iframe.contentDocument)||void 0===r||r.fonts.add(b)}catch(e){this.config.showWarning&&console.warn(e)}}},e.prototype.applyMutation=function(e,t){var n,r,i=this;e.removes.forEach((function(t){var n=i.mirror.getNode(t.id);if(!n){if(e.removes.find((function(e){return e.id===t.parentId})))return;return i.warnNodeNotFound(e,t.id)}i.virtualStyleRulesMap.has(n)&&i.virtualStyleRulesMap.delete(n);var r=i.mirror.getNode(t.parentId);if(!r)return i.warnNodeNotFound(e,t.parentId);if(t.isShadow&&Ce(r)&&(r=r.shadowRoot),i.mirror.removeNodeFromMap(n),r){var o=null,a="__sn"in r?i.fragmentParentMap.get(r):void 0;a&&a.contains(n)?r=a:i.fragmentParentMap.has(n)&&(o=i.fragmentParentMap.get(n),i.fragmentParentMap.delete(n),n=o);try{r.removeChild(n)}catch(t){if(!(t instanceof DOMException))throw t;i.warn("parent could not remove child in mutation",r,a,n,o,e)}}}));var o=J({},this.legacy_missingNodeRetryMap),a=[],s=function(e){var n,r,s,l;if(!i.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var c=i.mirror.getNode(e.parentId);if(!c)return e.node.type===Q.Document?i.newDocumentQueue.push(e):a.push(e);var u=null;i.iframe.contentDocument.contains?u=i.iframe.contentDocument.contains(c):i.iframe.contentDocument.body.contains&&(u=i.iframe.contentDocument.body.contains(c));var d=(null===(l=(s=c).getElementsByTagName)||void 0===l?void 0:l.call(s,"iframe").length)>0;if(t&&u&&!Me(c)&&!d){var f=document.createDocumentFragment();for(i.mirror.map[e.parentId]=f,i.fragmentParentMap.set(f,c),i.storeState(c);c.firstChild;)f.appendChild(c.firstChild);c=f}e.node.isShadow&&(Ce(c)||c.attachShadow({mode:"open"}),c=c.shadowRoot);var p=null,h=null;if(e.previousId&&(p=i.mirror.getNode(e.previousId)),e.nextId&&(h=i.mirror.getNode(e.nextId)),function(e){var t=null;return e.nextId&&(t=i.mirror.getNode(e.nextId)),null!==e.nextId&&void 0!==e.nextId&&-1!==e.nextId&&!t}(e))return a.push(e);if(!e.node.rootId||i.mirror.getNode(e.node.rootId)){var m=e.node.rootId?i.mirror.getNode(e.node.rootId):i.iframe.contentDocument;if(Me(c))i.attachDocumentToIframe(e,c);else{var v=ge(e.node,{doc:m,map:i.mirror.map,skipChild:!0,hackCss:!0,cache:i.cache});if(-1!==e.previousId&&-1!==e.nextId){if("__sn"in c&&c.__sn.type===Q.Element&&"textarea"===c.__sn.tagName&&e.node.type===Q.Text)try{for(var y=K(Array.from(c.childNodes)),g=y.next();!g.done;g=y.next()){var b=g.value;b.nodeType===c.TEXT_NODE&&c.removeChild(b)}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}if(p&&p.nextSibling&&p.nextSibling.parentNode)c.insertBefore(v,p.nextSibling);else if(h&&h.parentNode)c.contains(h)?c.insertBefore(v,h):c.insertBefore(v,null);else{if(c===m)for(;m.firstChild;)m.removeChild(m.firstChild);c.appendChild(v)}if(Me(v)){var w=i.newDocumentQueue.find((function(e){return e.parentId===v.__sn.id}));w&&(i.attachDocumentToIframe(w,v),i.newDocumentQueue=i.newDocumentQueue.filter((function(e){return e!==w})))}(e.previousId||e.nextId)&&i.legacy_resolveMissingNode(o,c,v,e)}else o[e.node.id]={node:v,mutation:e}}}};e.adds.forEach((function(e){s(e)}));for(var l=Date.now();a.length;){var c=Ee(a);if(a.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}try{for(var u=(n=void 0,K(c)),d=u.next();!d.done;d=u.next()){var f=d.value;this.mirror.getNode(f.value.parentId)?Te(f,(function(e){s(e)})):this.debug("Drop resolve tree since there is no parent for the root node.",f)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),e.texts.forEach((function(t){var n=i.mirror.getNode(t.id);if(!n){if(e.removes.find((function(e){return e.id===t.id})))return;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=i.mirror.getNode(t.id);if(!n){if(e.removes.find((function(e){return e.id===t.id})))return;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];if(null===o)n.removeAttribute(r);else if("string"==typeof o)try{n.setAttribute(r,o)}catch(e){i.config.showWarning&&console.warn("An error occurred may due to the checkout feature.",e)}else if("style"===r){var a=o,s=n;for(var l in a)if(!1===a[l])s.style.removeProperty(l);else if(a[l]instanceof Array){var c=a[l];s.style.setProperty(l,c[0],c[1])}else{var u=a[l];s.style.setProperty(l,u)}}}}))},e.prototype.applyScroll=function(e,t){var n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);if(n===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if(n.__sn.type===Q.Document)n.defaultView.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{n.scrollTop=e.y,n.scrollLeft=e.x}catch(e){}},e.prototype.applyInput=function(e){var t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(e){}},e.prototype.applyText=function(e,t){var n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(t,e.id);try{n.textContent=e.value}catch(e){}},e.prototype.legacy_resolveMissingNode=function(e,t,n,r){var i=r.previousId,o=r.nextId,a=i&&e[i],s=o&&e[o];if(a){var l=a,c=l.node,u=l.mutation;t.insertBefore(c,n),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(s){var d=s;c=d.node,u=d.mutation;t.insertBefore(c,n.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}},e.prototype.moveAndHover=function(e,t,n,r,i){var o=this.mirror.getNode(n);if(!o)return this.debugNodeNotFound(i,n);var a=ke(o,this.iframe),s=e*a.absoluteScale+a.x,l=t*a.absoluteScale+a.y;this.mouse.style.left="".concat(s,"px"),this.mouse.style.top="".concat(l,"px"),r||this.drawMouseTail({x:s,y:l}),this.hoverElements(o)},e.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var n=!0===this.config.mouseTail?st:Object.assign({},st,this.config.mouseTail),r=n.lineCap,i=n.lineWidth,o=n.strokeStyle,a=n.duration,s=function(){if(t.mouseTail){var e=t.mouseTail.getContext("2d");e&&t.tailPositions.length&&(e.clearRect(0,0,t.mouseTail.width,t.mouseTail.height),e.beginPath(),e.lineWidth=i,e.lineCap=r,e.strokeStyle=o,e.moveTo(t.tailPositions[0].x,t.tailPositions[0].y),t.tailPositions.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}};this.tailPositions.push(e),s(),setTimeout((function(){t.tailPositions=t.tailPositions.filter((function(t){return t!==e})),s()}),a/this.speedService.state.context.timer.speed)}},e.prototype.hoverElements=function(e){var t;null===(t=this.iframe.contentDocument)||void 0===t||t.querySelectorAll(".\\:hover").forEach((function(e){e.classList.remove(":hover")}));for(var n=e;n;)n.classList&&n.classList.add(":hover"),n=n.parentElement},e.prototype.isUserInteraction=function(e){return e.type===se.IncrementalSnapshot&&(e.data.source>le.Mutation&&e.data.source<=le.Input)},e.prototype.backToNormal=function(){this.nextUserInteractionEvent=null,this.speedService.state.matches("normal")||(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(fe.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))},e.prototype.restoreRealParent=function(e,t){this.mirror.map[t.__sn.id]=t,t.__sn.type===Q.Element&&"textarea"===t.__sn.tagName&&e.textContent&&(t.value=e.textContent),t.appendChild(e),this.restoreState(t)},e.prototype.storeState=function(e){var t,n;if(e&&e.nodeType===e.ELEMENT_NODE){var r=e;(r.scrollLeft||r.scrollTop)&&this.elementStateMap.set(e,{scroll:[r.scrollLeft,r.scrollTop]}),"STYLE"===r.tagName&&function(e,t){var n;try{var r=Array.from((null===(n=e.sheet)||void 0===n?void 0:n.cssRules)||[]).map((function(e){return e.cssText}));t.set(e,[{type:Qe.Snapshot,cssTexts:r}])}catch(e){}}(r,this.virtualStyleRulesMap);var i=r.children;try{for(var o=K(Array.from(i)),a=o.next();!a.done;a=o.next()){var s=a.value;this.storeState(s)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}}},e.prototype.restoreState=function(e){var t,n;if(e.nodeType===e.ELEMENT_NODE){var r=e;if(this.elementStateMap.has(e)){var i=this.elementStateMap.get(e);i.scroll&&(r.scrollLeft=i.scroll[0],r.scrollTop=i.scroll[1]),this.elementStateMap.delete(e)}var o=r.children;try{for(var a=K(Array.from(o)),s=a.next();!s.done;s=a.next()){var l=s.value;this.restoreState(l)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}}},e.prototype.restoreNodeSheet=function(e){var t=this.virtualStyleRulesMap.get(e);"STYLE"===e.nodeName&&(t&&Ze(t,e))},e.prototype.warnNodeNotFound=function(e,t){this.treeIndex.idRemoved(t)?this.warn("Node with id '".concat(t,"' was previously removed. "),e):this.warn("Node with id '".concat(t,"' not found. "),e)},e.prototype.warnCanvasMutationFailed=function(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)},e.prototype.debugNodeNotFound=function(e,t){this.treeIndex.idRemoved(t)?this.debug(at,"Node with id '".concat(t,"' was previously removed. "),e):this.debug(at,"Node with id '".concat(t,"' not found. "),e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showWarning&&console.warn.apply(console,ee([at],Z(e),!1))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.config.showDebug&&console.log.apply(console,ee([at],Z(e),!1))},e}(),ut=Uint8Array,dt=Uint16Array,ft=Uint32Array,pt=new ut([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ht=new ut([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),mt=new ut([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),vt=function(e,t){for(var n=new dt(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new ft(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},yt=vt(pt,2),gt=yt[0],bt=yt[1];gt[28]=258,bt[258]=28;for(var wt=vt(ht,0)[0],xt=new dt(32768),St=0;St<32768;++St){var Et=(43690&St)>>>1|(21845&St)<<1;Et=(61680&(Et=(52428&Et)>>>2|(13107&Et)<<2))>>>4|(3855&Et)<<4,xt[St]=((65280&Et)>>>8|(255&Et)<<8)>>>1}var Tt=function(e,t,n){for(var r=e.length,i=0,o=new dt(t);i<r;++i)++o[e[i]-1];var a,s=new dt(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(n){a=new dt(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,f=d|(1<<u)-1;d<=f;++d)a[xt[d]>>>l]=c}else for(a=new dt(r),i=0;i<r;++i)a[i]=xt[s[e[i]-1]++]>>>15-e[i];return a},Mt=new ut(288);for(St=0;St<144;++St)Mt[St]=8;for(St=144;St<256;++St)Mt[St]=9;for(St=256;St<280;++St)Mt[St]=7;for(St=280;St<288;++St)Mt[St]=8;var kt=new ut(32);for(St=0;St<32;++St)kt[St]=5;var Ct=Tt(Mt,9,1),It=Tt(kt,5,1),Nt=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},At=function(e,t,n){var r=t/8>>0;return(e[r]|e[r+1]<<8)>>>(7&t)&n},_t=function(e,t){var n=t/8>>0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>>(7&t)},$t=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof dt?dt:e instanceof ft?ft:ut)(n-t);return r.set(e.subarray(t,n)),r};function Dt(e,t){return function(e,t,n){var r=e.length,i=!t||n,o=!n||n.i;n||(n={}),t||(t=new ut(3*r));var a,s=function(e){var n=t.length;if(e>n){var r=new ut(Math.max(2*n,e));r.set(t),t=r}},l=n.f||0,c=n.p||0,u=n.b||0,d=n.l,f=n.d,p=n.m,h=n.n,m=8*r;do{if(!d){n.f=l=At(e,c,1);var v=At(e,c+1,3);if(c+=3,!v){var y=e[(I=((a=c)/8>>0)+(7&a&&1)+4)-4]|e[I-3]<<8,g=I+y;if(g>r){if(o)throw"unexpected EOF";break}i&&s(u+y),t.set(e.subarray(I,g),u),n.b=u+=y,n.p=c=8*g;continue}if(1==v)d=Ct,f=It,p=9,h=5;else{if(2!=v)throw"invalid block type";var b=At(e,c,31)+257,w=At(e,c+10,15)+4,x=b+At(e,c+5,31)+1;c+=14;for(var S=new ut(x),E=new ut(19),T=0;T<w;++T)E[mt[T]]=At(e,c+3*T,7);c+=3*w;var M=Nt(E),k=(1<<M)-1;if(!o&&c+x*(M+7)>m)break;var C=Tt(E,M,1);for(T=0;T<x;){var I,N=C[At(e,c,k)];if(c+=15&N,(I=N>>>4)<16)S[T++]=I;else{var A=0,_=0;for(16==I?(_=3+At(e,c,3),c+=2,A=S[T-1]):17==I?(_=3+At(e,c,7),c+=3):18==I&&(_=11+At(e,c,127),c+=7);_--;)S[T++]=A}}var $=S.subarray(0,b),D=S.subarray(b);p=Nt($),h=Nt(D),d=Tt($,p,1),f=Tt(D,h,1)}if(c>m)throw"unexpected EOF"}i&&s(u+131072);for(var R=(1<<p)-1,L=(1<<h)-1,F=p+h+18;o||c+F<m;){var P=(A=d[_t(e,c)&R])>>>4;if((c+=15&A)>m)throw"unexpected EOF";if(!A)throw"invalid length/literal";if(P<256)t[u++]=P;else{if(256==P){d=null;break}var O=P-254;if(P>264){var j=pt[T=P-257];O=At(e,c,(1<<j)-1)+gt[T],c+=j}var W=f[_t(e,c)&L],B=W>>>4;if(!W)throw"invalid distance";if(c+=15&W,D=wt[B],B>3&&(j=ht[B],D+=_t(e,c)&(1<<j)-1,c+=j),c>m)throw"unexpected EOF";i&&s(u+131072);for(var z=u+O;u<z;u+=4)t[u]=t[u-D],t[u+1]=t[u+1-D],t[u+2]=t[u+2-D],t[u+3]=t[u+3-D];u=z}}n.l=d,n.p=c,n.b=u,d&&(l=1,n.m=p,n.d=f,n.n=h)}while(!l);return u==t.length?t:$t(t,0,u)}((function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"}(e),e.subarray(2,-4)),t)}var Rt=function(e){if("string"!=typeof e)return e;try{if((t=JSON.parse(e)).timestamp)return t}catch(e){}try{var t;if("v1"===(t=JSON.parse(function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i))}return n}(Dt(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new ut(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},a=0;a<n;++a){if(i+5>r.length){var s=new ut(i+8+(n-a<<1));s.set(r),r=s}var l=e.charCodeAt(a);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++a))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return $t(r,0,i)}(e,!0))))).v)return t;throw new Error("These events were packed with packer ".concat(t.v," which is incompatible with current packer ").concat("v1","."))}catch(e){throw console.error(e),new Error("Unknown data format.")}};function Lt(e){let t="";return Object.keys(e).forEach((n=>{t+=`${n}: ${e[n]};`})),t}function Ft(e,t=2){let n=String(e);const r=Math.pow(10,t-1);if(e<r)for(;String(r).length>n.length;)n="0"+e;return n}const Pt=6e4,Ot=36e5;function jt(e){if(e<=0)return"00:00";const t=Math.floor(e/Ot);e%=Ot;const n=Math.floor(e/Pt);e%=Pt;const r=Math.floor(e/1e3);return t?`${Ft(t)}:${Ft(n)}:${Ft(r)}`:`${Ft(n)}:${Ft(r)}`}function Wt(){return document.fullscreen||document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement}function Bt(e){return{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"}[Object.prototype.toString.call(e)]}function zt(t){let n,r,i,o,a,s,d,p,b;return{c(){n=f("div"),r=f("input"),i=m(),o=f("label"),a=m(),s=f("span"),d=h(t[3]),y(r,"type","checkbox"),y(r,"id",t[2]),r.disabled=t[1],y(r,"class","svelte-9brlez"),y(o,"for",t[2]),y(o,"class","svelte-9brlez"),y(s,"class","label svelte-9brlez"),y(n,"class","switch svelte-9brlez"),w(n,"disabled",t[1])},m(e,u){c(e,n,u),l(n,r),r.checked=t[0],l(n,i),l(n,o),l(n,a),l(n,s),l(s,d),p||(b=v(r,"change",t[4]),p=!0)},p(e,[t]){4&t&&y(r,"id",e[2]),2&t&&(r.disabled=e[1]),1&t&&(r.checked=e[0]),4&t&&y(o,"for",e[2]),8&t&&g(d,e[3]),2&t&&w(n,"disabled",e[1])},i:e,o:e,d(e){e&&u(n),p=!1,b()}}}function Ut(e,t,n){let{disabled:r}=t,{checked:i}=t,{id:o}=t,{label:a}=t;return e.$$set=e=>{"disabled"in e&&n(1,r=e.disabled),"checked"in e&&n(0,i=e.checked),"id"in e&&n(2,o=e.id),"label"in e&&n(3,a=e.label)},[i,r,o,a,function(){i=this.checked,n(0,i)}]}class qt extends X{constructor(e){super(),Y(this,e,Ut,zt,a,{disabled:1,checked:0,id:2,label:3})}}function Ht(e,t,n){const r=e.slice();return r[34]=t[n],r}function Vt(e,t,n){const r=e.slice();return r[37]=t[n],r}function Gt(e){let t,n,r,o,a,s,p,x,S,E,T,M,k,C,N,_,$,D,R,L,F,P,O,j,W,B=jt(e[6])+"",G=jt(e[8].totalTime)+"",Y=e[9],X=[];for(let t=0;t<Y.length;t+=1)X[t]=Yt(Vt(e,Y,t));function Q(e,t){return"playing"===e[7]?Qt:Xt}let J=Q(e),K=J(e),Z=e[3],ee=[];for(let t=0;t<Z.length;t+=1)ee[t]=Jt(Ht(e,Z,t));function te(t){e[28](t)}let ne={id:"skip",disabled:"skipping"===e[10],label:"skip inactive"};return void 0!==e[0]&&(ne.checked=e[0]),R=new qt({props:ne}),I.push((()=>function(e,t,n){const r=e.$$.props[t];void 0!==r&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}(R,"checked",te))),{c(){t=f("div"),n=f("div"),r=f("span"),o=h(B),a=m(),s=f("div"),p=f("div"),x=m();for(let e=0;e<X.length;e+=1)X[e].c();S=m(),E=f("div"),T=m(),M=f("span"),k=h(G),C=m(),N=f("div"),_=f("button"),K.c(),$=m();for(let e=0;e<ee.length;e+=1)ee[e].c();D=m(),q(R.$$.fragment),F=m(),P=f("button"),P.innerHTML='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><defs><style type="text/css"></style></defs><path d="M916 380c-26.4 0-48-21.6-48-48L868 223.2 613.6 477.6c-18.4\n 18.4-48.8 18.4-68 0-18.4-18.4-18.4-48.8 0-68L800 156 692 156c-26.4\n 0-48-21.6-48-48 0-26.4 21.6-48 48-48l224 0c26.4 0 48 21.6 48 48l0\n 224C964 358.4 942.4 380 916 380zM231.2 860l108.8 0c26.4 0 48 21.6 48\n 48s-21.6 48-48 48l-224 0c-26.4 0-48-21.6-48-48l0-224c0-26.4 21.6-48\n 48-48 26.4 0 48 21.6 48 48L164 792l253.6-253.6c18.4-18.4 48.8-18.4\n 68 0 18.4 18.4 18.4 48.8 0 68L231.2 860z" p-id="1286"></path></svg>',y(r,"class","rr-timeline__time svelte-19ke1iv"),y(p,"class","rr-progress__step svelte-19ke1iv"),b(p,"width",e[13]),y(E,"class","rr-progress__handler svelte-19ke1iv"),b(E,"left",e[13]),y(s,"class","rr-progress svelte-19ke1iv"),w(s,"disabled","skipping"===e[10]),y(M,"class","rr-timeline__time svelte-19ke1iv"),y(n,"class","rr-timeline svelte-19ke1iv"),y(_,"class","svelte-19ke1iv"),y(P,"class","svelte-19ke1iv"),y(N,"class","rr-controller__btns svelte-19ke1iv"),y(t,"class","rr-controller svelte-19ke1iv")},m(i,u){c(i,t,u),l(t,n),l(n,r),l(r,o),l(n,a),l(n,s),l(s,p),e[24](p),l(s,x);for(let e=0;e<X.length;e+=1)X[e].m(s,null);l(s,S),l(s,E),e[25](s),l(n,T),l(n,M),l(M,k),l(t,C),l(t,N),l(N,_),K.m(_,null),l(N,$);for(let e=0;e<ee.length;e+=1)ee[e].m(N,null);l(N,D),H(R,N,null),l(N,F),l(N,P),O=!0,j||(W=[v(s,"click",e[26]),v(_,"click",e[4]),v(P,"click",e[29])],j=!0)},p(e,t){if((!O||64&t[0])&&B!==(B=jt(e[6])+"")&&g(o,B),(!O||8192&t[0])&&b(p,"width",e[13]),512&t[0]){let n;for(Y=e[9],n=0;n<Y.length;n+=1){const r=Vt(e,Y,n);X[n]?X[n].p(r,t):(X[n]=Yt(r),X[n].c(),X[n].m(s,S))}for(;n<X.length;n+=1)X[n].d(1);X.length=Y.length}if((!O||8192&t[0])&&b(E,"left",e[13]),1024&t[0]&&w(s,"disabled","skipping"===e[10]),(!O||256&t[0])&&G!==(G=jt(e[8].totalTime)+"")&&g(k,G),J!==(J=Q(e))&&(K.d(1),K=J(e),K&&(K.c(),K.m(_,null))),1066&t[0]){let n;for(Z=e[3],n=0;n<Z.length;n+=1){const r=Ht(e,Z,n);ee[n]?ee[n].p(r,t):(ee[n]=Jt(r),ee[n].c(),ee[n].m(N,D))}for(;n<ee.length;n+=1)ee[n].d(1);ee.length=Z.length}const n={};var r;1024&t[0]&&(n.disabled="skipping"===e[10]),!L&&1&t[0]&&(L=!0,n.checked=e[0],r=()=>L=!1,A.push(r)),R.$set(n)},i(e){O||(z(R.$$.fragment,e),O=!0)},o(e){U(R.$$.fragment,e),O=!1},d(n){n&&u(t),e[24](null),d(X,n),e[25](null),K.d(),d(ee,n),V(R),j=!1,i(W)}}}function Yt(e){let t,n;return{c(){t=f("div"),y(t,"title",n=e[37].name),b(t,"width","10px"),b(t,"height","5px"),b(t,"position","absolute"),b(t,"top","2px"),b(t,"transform","translate(-50%, -50%)"),b(t,"background",e[37].background),b(t,"left",e[37].position)},m(e,n){c(e,t,n)},p(e,r){512&r[0]&&n!==(n=e[37].name)&&y(t,"title",n),512&r[0]&&b(t,"background",e[37].background),512&r[0]&&b(t,"left",e[37].position)},d(e){e&&u(t)}}}function Xt(e){let t,n;return{c(){t=p("svg"),n=p("path"),y(n,"d","M170.65984 896l0-768 640 384zM644.66944\n 512l-388.66944-233.32864 0 466.65728z"),y(t,"class","icon"),y(t,"viewBox","0 0 1024 1024"),y(t,"version","1.1"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),y(t,"width","16"),y(t,"height","16")},m(e,r){c(e,t,r),l(t,n)},d(e){e&&u(t)}}}function Qt(e){let t,n;return{c(){t=p("svg"),n=p("path"),y(n,"d","M682.65984 128q53.00224 0 90.50112 37.49888t37.49888 90.50112l0\n 512q0 53.00224-37.49888 90.50112t-90.50112\n 37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224\n 37.49888-90.50112t90.50112-37.49888zM341.34016 128q53.00224 0\n 90.50112 37.49888t37.49888 90.50112l0 512q0 53.00224-37.49888\n 90.50112t-90.50112\n 37.49888-90.50112-37.49888-37.49888-90.50112l0-512q0-53.00224\n 37.49888-90.50112t90.50112-37.49888zM341.34016 213.34016q-17.67424\n 0-30.16704 12.4928t-12.4928 30.16704l0 512q0 17.67424 12.4928\n 30.16704t30.16704 12.4928 30.16704-12.4928\n 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928zM682.65984\n 213.34016q-17.67424 0-30.16704 12.4928t-12.4928 30.16704l0 512q0\n 17.67424 12.4928 30.16704t30.16704 12.4928 30.16704-12.4928\n 12.4928-30.16704l0-512q0-17.67424-12.4928-30.16704t-30.16704-12.4928z"),y(t,"class","icon"),y(t,"viewBox","0 0 1024 1024"),y(t,"version","1.1"),y(t,"xmlns","http://www.w3.org/2000/svg"),y(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),y(t,"width","16"),y(t,"height","16")},m(e,r){c(e,t,r),l(t,n)},d(e){e&&u(t)}}}function Jt(e){let t,n,r,i,o,a,s=e[34]+"";function d(){return e[27](e[34])}return{c(){t=f("button"),n=h(s),r=h("x"),t.disabled=i="skipping"===e[10],y(t,"class","svelte-19ke1iv"),w(t,"active",e[34]===e[1]&&"skipping"!==e[10])},m(e,i){c(e,t,i),l(t,n),l(t,r),o||(a=v(t,"click",d),o=!0)},p(r,o){e=r,8&o[0]&&s!==(s=e[34]+"")&&g(n,s),1024&o[0]&&i!==(i="skipping"===e[10])&&(t.disabled=i),1034&o[0]&&w(t,"active",e[34]===e[1]&&"skipping"!==e[10])},d(e){e&&u(t),o=!1,a()}}}function Kt(e){let t,n,r=e[2]&&Gt(e);return{c(){r&&r.c(),t=h("")},m(e,i){r&&r.m(e,i),c(e,t,i),n=!0},p(e,n){e[2]?r?(r.p(e,n),4&n[0]&&z(r,1)):(r=Gt(e),r.c(),z(r,1),r.m(t.parentNode,t)):r&&(W(),U(r,1,1,(()=>{r=null})),B())},i(e){n||(z(r),n=!0)},o(e){U(r),n=!1},d(e){r&&r.d(e),e&&u(t)}}}function Zt(e,t,n){const r=k();let i,o,a,s,l,c,u,d,{replayer:f}=t,{showController:p}=t,{autoPlay:h}=t,{skipInactive:m}=t,{speedOption:v}=t,{speed:y=(v.length?v[0]:1)}=t,{tags:g={}}=t,b=0,w=null;const x=()=>{w&&(cancelAnimationFrame(w),w=null)},S=()=>{"paused"===i&&(l?(f.play(),l=!1):f.play(b))},C=()=>{"playing"===i&&f.pause()},N=(e,t)=>{n(6,b=e);("boolean"==typeof t?t:"playing"===i)?f.play(e):f.pause(e)},A=e=>{if("skipping"===o)return;const t=a.getBoundingClientRect();let n=(e.clientX-t.left)/t.width;n<0?n=0:n>1&&(n=1);const r=c.totalTime*n;l=!1,N(r)},_=e=>{let t="playing"===i;n(1,y=e),t&&f.pause(),f.setConfig({speed:y}),t&&f.play(b)};var $;T((()=>{n(7,i=f.service.state.value),n(10,o=f.speedService.state.value),f.on("state-change",(e=>{const{player:t,speed:r}=e;if((null==t?void 0:t.value)&&i!==t.value)switch(n(7,i=t.value),i){case"playing":x(),w=requestAnimationFrame((function e(){n(6,b=f.getCurrentTime()),b<c.totalTime&&(w=requestAnimationFrame(e))}));break;case"paused":x()}(null==r?void 0:r.value)&&o!==r.value&&n(10,o=r.value)})),f.on("finish",(()=>{l=!0})),h&&f.play()})),$=()=>{m!==f.config.skipInactive&&f.setConfig({skipInactive:m})},E().$$.after_update.push($),M((()=>{f.pause(),x()}));return e.$$set=e=>{"replayer"in e&&n(16,f=e.replayer),"showController"in e&&n(2,p=e.showController),"autoPlay"in e&&n(17,h=e.autoPlay),"skipInactive"in e&&n(0,m=e.skipInactive),"speedOption"in e&&n(3,v=e.speedOption),"speed"in e&&n(1,y=e.speed),"tags"in e&&n(18,g=e.tags)},e.$$.update=()=>{if(64&e.$$.dirty[0]&&r("ui-update-current-time",{payload:b}),128&e.$$.dirty[0]&&r("ui-update-player-state",{payload:i}),65536&e.$$.dirty[0]&&n(8,c=f.getMetaData()),320&e.$$.dirty[0]){const e=Math.min(1,b/c.totalTime);n(13,u=100*e+"%"),r("ui-update-progress",{payload:e})}327680&e.$$.dirty[0]&&n(9,d=(()=>{const{context:e}=f.service.state,t=e.events.length,n=e.events[0].timestamp,r=e.events[t-1].timestamp,i=[];return e.events.forEach((e=>{if(e.type===se.Custom){const s={name:e.data.tag,background:g[e.data.tag]||"rgb(73, 80, 246)",position:`${t=n,o=r,a=e.timestamp,(100-(o-a)/(o-t)*100).toFixed(2)}%`};i.push(s)}var t,o,a})),i})())},[m,y,p,v,()=>{switch(i){case"playing":C();break;case"paused":S()}},_,b,i,c,d,o,a,s,u,r,A,f,h,g,S,C,N,()=>{n(0,m=!m)},()=>{Promise.resolve().then((()=>{n(8,c=f.getMetaData())}))},function(e){I[e?"unshift":"push"]((()=>{s=e,n(12,s)}))},function(e){I[e?"unshift":"push"]((()=>{a=e,n(11,a)}))},e=>A(e),e=>_(e),function(e){m=e,n(0,m)},()=>r("fullscreen")]}class en extends X{constructor(e){super(),Y(this,e,Zt,Kt,a,{replayer:16,showController:2,autoPlay:17,skipInactive:0,speedOption:3,speed:1,tags:18,toggle:4,play:19,pause:20,goto:21,setSpeed:5,toggleSkipInactive:22,triggerUpdateMeta:23},null,[-1,-1])}get toggle(){return this.$$.ctx[4]}get play(){return this.$$.ctx[19]}get pause(){return this.$$.ctx[20]}get goto(){return this.$$.ctx[21]}get setSpeed(){return this.$$.ctx[5]}get toggleSkipInactive(){return this.$$.ctx[22]}get triggerUpdateMeta(){return this.$$.ctx[23]}}function tn(e){let t,n,r={replayer:e[6],showController:e[3],autoPlay:e[1],speedOption:e[2],skipInactive:e[0],tags:e[4]};return t=new en({props:r}),e[29](t),t.$on("fullscreen",e[30]),{c(){q(t.$$.fragment)},m(e,r){H(t,e,r),n=!0},p(e,n){const r={};64&n[0]&&(r.replayer=e[6]),8&n[0]&&(r.showController=e[3]),2&n[0]&&(r.autoPlay=e[1]),4&n[0]&&(r.speedOption=e[2]),1&n[0]&&(r.skipInactive=e[0]),16&n[0]&&(r.tags=e[4]),t.$set(r)},i(e){n||(z(t.$$.fragment,e),n=!0)},o(e){U(t.$$.fragment,e),n=!1},d(n){e[29](null),V(t,n)}}}function nn(e){let t,n,r,i,o=e[6]&&tn(e);return{c(){t=f("div"),n=f("div"),r=m(),o&&o.c(),y(n,"class","rr-player__frame"),y(n,"style",e[10]),y(t,"class","rr-player"),y(t,"style",e[11])},m(a,s){c(a,t,s),l(t,n),e[28](n),l(t,r),o&&o.m(t,null),e[31](t),i=!0},p(e,r){(!i||1024&r[0])&&y(n,"style",e[10]),e[6]?o?(o.p(e,r),64&r[0]&&z(o,1)):(o=tn(e),o.c(),z(o,1),o.m(t,null)):o&&(W(),U(o,1,1,(()=>{o=null})),B()),(!i||2048&r[0])&&y(t,"style",e[11])},i(e){i||(z(o),i=!0)},o(e){U(o),i=!1},d(n){n&&u(t),e[28](null),o&&o.d(),e[31](null)}}}function rn(e,n,r){let i,{width:o=1024}=n,{height:a=576}=n,{events:l=[]}=n,{skipInactive:c=!0}=n,{autoPlay:u=!0}=n,{speedOption:d=[1,2,4,8]}=n,{speed:f=1}=n,{showController:p=!0}=n,{tags:h={}}=n;let m,v,y,g,b,w,x=o,S=a;const E=(e,t)=>{const n=o/t.width,r=a/t.height;e.style.transform=`scale(${Math.min(n,r,1)})translate(-50%, -50%)`},k=()=>{var e;m&&(Wt()?document.exitFullscreen?document.exitFullscreen():document.mozExitFullscreen?document.mozExitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen():(e=m).requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen())};T((()=>{if(void 0!==d&&"array"!==Bt(d))throw new Error("speedOption must be array");if(d.forEach((e=>{if("number"!==Bt(e))throw new Error("item of speedOption must be number")})),d.indexOf(f)<0)throw new Error(`speed must be one of speedOption,\n current config:\n {\n ...\n speed: ${f},\n speedOption: [${d.toString()}]\n ...\n }\n `);var e;r(6,i=new ct(l,Object.assign({speed:f,root:v,unpackFn:Rt},n))),i.on("resize",(e=>{E(i.wrapper,e)})),e=()=>{Wt()?setTimeout((()=>{x=o,S=a,r(12,o=m.offsetWidth),r(13,a=m.offsetHeight),E(i.wrapper,{width:i.iframe.offsetWidth,height:i.iframe.offsetHeight})}),0):(r(12,o=x),r(13,a=S),E(i.wrapper,{width:i.iframe.offsetWidth,height:i.iframe.offsetHeight}))},document.addEventListener("fullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),document.addEventListener("mozfullscreenchange",e),document.addEventListener("MSFullscreenChange",e),y=()=>{document.removeEventListener("fullscreenchange",e),document.removeEventListener("webkitfullscreenchange",e),document.removeEventListener("mozfullscreenchange",e),document.removeEventListener("MSFullscreenChange",e)}})),M((()=>{y&&y()}));return e.$$set=e=>{r(36,n=t(t({},n),s(e))),"width"in e&&r(12,o=e.width),"height"in e&&r(13,a=e.height),"events"in e&&r(14,l=e.events),"skipInactive"in e&&r(0,c=e.skipInactive),"autoPlay"in e&&r(1,u=e.autoPlay),"speedOption"in e&&r(2,d=e.speedOption),"speed"in e&&r(15,f=e.speed),"showController"in e&&r(3,p=e.showController),"tags"in e&&r(4,h=e.tags)},e.$$.update=()=>{12288&e.$$.dirty[0]&&r(10,b=Lt({width:`${o}px`,height:`${a}px`})),12296&e.$$.dirty[0]&&r(11,w=Lt({width:`${o}px`,height:`${a+(p?80:0)}px`}))},n=s(n),[c,u,d,p,h,k,i,m,v,g,b,w,o,a,l,f,()=>i.getMirror(),()=>{E(i.wrapper,{width:i.iframe.offsetWidth,height:i.iframe.offsetHeight})},(e,t)=>{switch(i.on(e,t),e){case"ui-update-current-time":case"ui-update-progress":case"ui-update-player-state":g.$on(e,(({detail:e})=>t(e)))}},e=>{i.addEvent(e),g.triggerUpdateMeta()},()=>i.getMetaData(),()=>i,()=>{g.toggle()},e=>{g.setSpeed(e)},()=>{g.toggleSkipInactive()},()=>{g.play()},()=>{g.pause()},(e,t)=>{g.goto(e,t)},function(e){I[e?"unshift":"push"]((()=>{v=e,r(8,v)}))},function(e){I[e?"unshift":"push"]((()=>{g=e,r(9,g)}))},()=>k(),function(e){I[e?"unshift":"push"]((()=>{m=e,r(7,m)}))}]}class on extends X{constructor(e){super(),Y(this,e,rn,nn,a,{width:12,height:13,events:14,skipInactive:0,autoPlay:1,speedOption:2,speed:15,showController:3,tags:4,getMirror:16,triggerResize:17,toggleFullscreen:5,addEventListener:18,addEvent:19,getMetaData:20,getReplayer:21,toggle:22,setSpeed:23,toggleSkipInactive:24,play:25,pause:26,goto:27},null,[-1,-1])}get getMirror(){return this.$$.ctx[16]}get triggerResize(){return this.$$.ctx[17]}get toggleFullscreen(){return this.$$.ctx[5]}get addEventListener(){return this.$$.ctx[18]}get addEvent(){return this.$$.ctx[19]}get getMetaData(){return this.$$.ctx[20]}get getReplayer(){return this.$$.ctx[21]}get toggle(){return this.$$.ctx[22]}get setSpeed(){return this.$$.ctx[23]}get toggleSkipInactive(){return this.$$.ctx[24]}get play(){return this.$$.ctx[25]}get pause(){return this.$$.ctx[26]}get goto(){return this.$$.ctx[27]}}return class extends on{constructor(e){super({target:e.target,props:e.data||e.props})}}}();
//# sourceMappingURL=index.js.map