/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@xysfe/memento-core@0.1.54/lib/memento-core.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
/*! *****************************************************************************
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 NodeType,__assign=function(){return __assign=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},__assign.apply(this,arguments)};function __rest(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function __awaiter(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))}function __generator(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function __values(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 __read(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function __spread(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(NodeType||(NodeType={}));var _id=1,symbolAndNumberRegex=RegExp("[^a-z1-6-]");function genId(){return _id++}function getValidTagName(e){var t=e.toLowerCase().trim();return symbolAndNumberRegex.test(t)?"div":t}function getCssRulesString(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).reduce((function(e,t){return e+getCssRuleString(t)}),""):null}catch(e){return null}}function getCssRuleString(e){return isCSSImportRule(e)?getCssRulesString(e.styleSheet)||"":e.cssText}function isCSSImportRule(e){return"styleSheet"in e}function extractOrigin(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}var URL_IN_CSS_REF=/url\((?:'([^']*)'|"([^"]*)"|([^)]*))\)/gm,RELATIVE_PATH=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/,DATA_URI=/^(data:)([\w\/\+\-]+);(charset=[\w-]+|base64).*,(.*)/i;function absoluteToStylesheet(e,t){return(e||"").replace(URL_IN_CSS_REF,(function(e,n,r,i){var a=n||r||i;if(!a)return e;if(!RELATIVE_PATH.test(a))return"url('"+a+"')";if(DATA_URI.test(a))return"url("+a+")";if("/"===a[0])return"url('"+(extractOrigin(t)+a)+"')";var o=t.split("/"),s=a.split("/");o.pop();for(var l=0,c=s;l<c.length;l++){var u=c[l];"."!==u&&(".."===u?o.pop():o.push(u))}return"url('"+o.join("/")+"')"}))}function getAbsoluteSrcsetString(e,t){return""===t.trim()?t:t.split(",").map((function(t){var n=t.trimLeft().trimRight().split(" ");return 2===n.length?absoluteToDoc(e,n[0])+" "+n[1]:1===n.length?""+absoluteToDoc(e,n[0]):""})).join(", ")}function absoluteToDoc(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function isSVGElement(e){return"svg"===e.tagName||e instanceof SVGElement}function transformAttribute(e,t,n){return"src"===t||"href"===t&&n?absoluteToDoc(e,n):"srcset"===t&&n?getAbsoluteSrcsetString(e,n):"style"===t&&n?absoluteToStylesheet(n,location.href):n}function serializeNode(e,t,n,r,i,a,o){switch(void 0===i&&(i={}),void 0===a&&(a=[]),void 0===o&&(o=!1),e.nodeType){case e.DOCUMENT_NODE:return{type:NodeType.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:NodeType.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId};case e.ELEMENT_NODE:var s=!1,l="";"string"==typeof n?s=e.classList.contains(n):e.classList&&e.classList.forEach&&e.classList.forEach((function(e){n.test(e)&&(s=!0)}));var c=getValidTagName(e.tagName);if(!s)for(var u=0,d=a;u<d.length;u++){var f=d[u];if(c===f.tagName){s=!0,f.placeholder&&(l=f.placeholder);break}}for(var p={},h=0,g=Array.from(e.attributes);h<g.length;h++){var m=g[h],v=m.name,y=m.value;p[v]=transformAttribute(t,v,y);var I="img"===c&&"src"===v||"link"===c&&"href"===v,C=e.rel;!I||("dns-prefetch"===C||"preload"===C)||/^data:image/i.test(p[v])||(p["_memimage_"+v]=p[v])}var b=e.rel;if("link"===c&&!("dns-prefetch"===b||"preload"===b||"prefetch"===b)&&r){var _,A=Array.from(t.styleSheets).find((function(t){return t.href===e.href}));(_=getCssRulesString(A))&&(delete p.rel,delete p.href,"_memimage_href"in p&&delete p._memimage_href,p._cssText=absoluteToStylesheet(_,A.href))}if("style"===c&&e.sheet&&!(e.innerText||e.textContent||"").trim().length)(_=getCssRulesString(e.sheet))&&(p._cssText=absoluteToStylesheet(_,location.href));if("input"===c||"textarea"===c||"select"===c){y=e.value;"radio"!==p.type&&"checkbox"!==p.type&&"submit"!==p.type&&"button"!==p.type&&y?p.value=i[p.type]||i[c]?"*".repeat(y.length):y:e.checked&&(p.checked=e.checked)}if("option"===c){var w=e.parentElement;p.value===w.value&&(p.selected=e.selected)}if("canvas"===c&&o&&(p.mem_dataURL=e.toDataURL()),e.scrollLeft&&(p.mem_scrollLeft=e.scrollLeft),e.scrollTop&&(p.mem_scrollTop=e.scrollTop),s){var S=e.getBoundingClientRect(),x=S.width,k=S.height;p.mem_width=x+"px",p.mem_height=k+"px",l&&(p.mem_placeholder=l)}return{type:NodeType.Element,tagName:c,attributes:p,childNodes:[],isSVG:isSVGElement(e)||void 0,needBlock:s};case e.TEXT_NODE:var E=e.parentNode&&e.parentNode.tagName,T=e.textContent,N="STYLE"===E||void 0;return N&&T&&(T=absoluteToStylesheet(T,location.href)),"SCRIPT"===E&&(T="SCRIPT_PLACEHOLDER"),{type:NodeType.Text,textContent:T||"",isStyle:N};case e.CDATA_SECTION_NODE:return{type:NodeType.CDATA,textContent:""};case e.COMMENT_NODE:return{type:NodeType.Comment,textContent:e.textContent||""};default:return!1}}function serializeNodeWithId(e,t,n,r,i,a,o,s,l){void 0===i&&(i=!1),void 0===a&&(a=!0),void 0===s&&(s=[]),void 0===l&&(l=!1);var c,u=serializeNode(e,t,r,a,o,s,l);if(!u)return console.warn(e,"not serialized"),null;c="__sn"in e?e.__sn.id:genId();var d=Object.assign(u,{id:c});e.__sn=d,n[c]=e;var f=!i;if(d.type===NodeType.Element&&(f=f&&!d.needBlock,delete d.needBlock),(d.type===NodeType.Document||d.type===NodeType.Element)&&f)for(var p=0,h=Array.from(e.childNodes);p<h.length;p++){var g=serializeNodeWithId(h[p],t,n,r,i,a,o,s,l);g&&d.childNodes.push(g)}return d}function snapshot(e,t,n,r,i,a){void 0===t&&(t="mem-block"),void 0===n&&(n=!0),void 0===i&&(i=[]),void 0===a&&(a=!1);var o={};return[serializeNodeWithId(e,e,o,t,!1,n,!0===r?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:!1===r?{}:r,i,a),o]}var commentre=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function parse(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 a(){var e={line:n,column:r};return function(t){return t.position=new o(e),p(),t}}var o=function(e){this.start=e,this.end={line:n,column:r},this.source=t.source};o.prototype.content=e;var s=[];function l(i){var a=new Error(t.source+":"+n+":"+r+": "+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a;s.push(a)}function c(){return f(/^{\s*/)}function u(){return f(/^}/)}function d(){var t,n=[];for(p(),h(n);e.length&&"}"!==e.charAt(0)&&(t=S()||x());)!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=g();)!1!==t&&e.push(t),t=g();return e}function g(){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 l("End of comment missing");var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:"comment",comment:o})}}function m(){var e=f(/^([^{]+)/);if(e)return trim(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 v(){var e=a(),t=f(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){var n=trim(t[0]);if(!f(/^:\s*/))return l("property missing ':'");var r=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:n.replace(commentre,""),value:r?trim(r[0]).replace(commentre,""):""});return f(/^[;\s]*/),i}}function y(){var e,t=[];if(!c())return l("missing '{'");for(h(t);e=v();)!1!==e&&(t.push(e),h(t)),e=v();return u()?t:l("missing '}'")}function I(){for(var e,t=[],n=a();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:y()})}var C,b=w("import"),_=w("charset"),A=w("namespace");function w(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=a(),r=f(t);if(r){var i={type:e};return i[e]=r[1].trim(),n(i)}}}function S(){if("@"===e[0])return function(){var e=a(),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 o=h();r=I();)o.push(r),o=o.concat(h());return u()?e({type:"keyframes",name:i,vendor:n,keyframes:o}):l("@keyframes missing '}'")}}()||function(){var e=a(),t=f(/^@media *([^{]+)/);if(t){var n=trim(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=a(),t=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:trim(t[1]),media:trim(t[2])})}()||function(){var e=a(),t=f(/^@supports *([^{]+)/);if(t){var n=trim(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 '}'")}}()||b()||_()||A()||function(){var e=a(),t=f(/^@([-\w]+)?document *([^{]+)/);if(t){var n=trim(t[1]),r=trim(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=a();if(f(/^@page */)){var t=m()||[];if(!c())return l("@page missing '{'");for(var n,r=h();n=v();)r.push(n),r=r.concat(h());return u()?e({type:"page",selectors:t,declarations:r}):l("@page missing '}'")}}()||function(){var e=a();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=a();if(f(/^@font-face\s*/)){if(!c())return l("@font-face missing '{'");for(var t,n=h();t=v();)n.push(t),n=n.concat(h());return u()?e({type:"font-face",declarations:n}):l("@font-face missing '}'")}}()}function x(){var e=a(),t=m();return t?(h(),e({type:"rule",selectors:t,declarations:y()})):l("selector missing")}return addParent((C=d(),{type:"stylesheet",stylesheet:{source:t.source,rules:C,parsingErrors:s}}))}function trim(e){return e?e.replace(/^\s+|\s+$/g,""):""}function addParent(e,t){for(var n=e&&"string"==typeof e.type,r=n?e:t,i=0,a=Object.keys(e);i<a.length;i++){var o=e[a[i]];Array.isArray(o)?o.forEach((function(e){addParent(e,r)})):o&&"object"==typeof o&&addParent(o,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var tagMap={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"};function getTagName(e){var t=tagMap[e.tagName]?tagMap[e.tagName]:e.tagName;return"link"===t&&e.attributes._cssText&&(t="style"),t}var HOVER_SELECTOR=/([^\\]):hover/g,WECHAT_DEVELOPER_INSET_BUG=/(\s|;|\{)inset\s*:([^;}]+)/gi;function addHoverClass(e){var t=parse(e,{silent:!0});return t.stylesheet&&t.stylesheet.rules?(t.stylesheet.rules.forEach((function(t){"selectors"in t&&(t.selectors||[]).forEach((function(t){if(HOVER_SELECTOR.test(t)){var n=t.replace(HOVER_SELECTOR,"$1.\\:hover");e=e.replace(t,t+", "+n)}}))})),e.replace(WECHAT_DEVELOPER_INSET_BUG,"$1top: $2; right: $2; bottom: $2; left: $2;")):e}var UserDefinedEvent,OtherSource,CanvasContext,MediaInteractions,DATA_SVG_URI=/url\((data:image\/svg\+xml;charset=[\w-].*?)\)\s*(;|\}|$)/gi;function addQuotationMarkForDataSvg(e){return e?e.replace(DATA_SVG_URI,(function(e,t,n){return'url("'+t+'")'+n})):e}function buildNode(e,t,n,r){switch(void 0===r&&(r=!0),e.type){case NodeType.Document:return t.implementation.createDocument(null,"",null);case NodeType.DocumentType:return t.implementation.createDocumentType(e.name,e.publicId,e.systemId);case NodeType.Element:var i,a=getTagName(e);i=e.isSVG?t.createElementNS("http://www.w3.org/2000/svg",a):t.createElement(a);var o=function(o){if(!e.attributes.hasOwnProperty(o))return"continue";if(e.attributes.hasOwnProperty("_memimage_"+o))return"continue";var s=e.attributes[o];s="boolean"==typeof s||"number"==typeof s?"":s;var l=o;if((o=o.replace("_memimage_","")).startsWith("mem_")){if("canvas"===a&&"mem_dataURL"===o){var c=document.createElement("img");c.src=s,c.onload=function(){var e=i.getContext("2d");e&&e.drawImage(c,0,0,c.width,c.height)}}"mem_imgwidth"===o||"mem_width"===o?i.style.width=s:"mem_imgheight"===o||"mem_height"===o?i.style.height=s:"video"===a&&"mem_placeholder"===l&&(i.style.background="center / cover no-repeat url("+s+") !important")}else{var u="textarea"===a&&"value"===o,d="style"===a&&"_cssText"===o;if(d&&n&&(s=addQuotationMarkForDataSvg(s=addHoverClass(s))),u||d){for(var f=t.createTextNode(s),p=0,h=Array.from(i.childNodes);p<h.length;p++){var g=h[p];g.nodeType===i.TEXT_NODE&&i.removeChild(g)}return i.appendChild(f),"continue"}if("iframe"===a&&"src"===o)return"continue";try{e.isSVG&&"xlink:href"===o?i.setAttributeNS("http://www.w3.org/1999/xlink",o,s):"onload"===o||"onclick"===o||"onmouse"===o.substring(0,7)?i.setAttribute("_"+o,s):(r&&"link"===a&&"_memimage_href"===l&&s&&s.match(/memento\.oss/)&&(s=s.replace(/^http\:\/\//,"https://")),i.setAttribute(o,s))}catch(e){}}};for(var s in e.attributes)o(s);return i;case NodeType.Text:var l=e.isStyle?addQuotationMarkForDataSvg(e.textContent):e.textContent;return t.createTextNode(e.isStyle&&n?addHoverClass(l):l);case NodeType.CDATA:return t.createCDATASection(e.textContent);case NodeType.Comment:return t.createComment(e.textContent);default:return null}}function buildNodeWithSN(e,t,n,r,i,a){void 0===r&&(r=!1),void 0===i&&(i=!0),void 0===a&&(a=!0);var o=buildNode(e,t,i,a);if(!o)return null;if(e.type===NodeType.Document&&(t.close(),t.open(),o=t),o.__sn=e,n[e.id]=o,(e.type===NodeType.Document||e.type===NodeType.Element)&&!r)for(var s=0,l=e.childNodes;s<l.length;s++){var c=l[s],u=buildNodeWithSN(c,t,n,!1,i,a);u?o.appendChild(u):console.warn("Failed to rebuild",c)}return o}function sideEffects(e){for(var t in e){var n=e[t],r=n.__sn;if(r.type===NodeType.Element){var i=n;for(var a in r.attributes)if(r.attributes.hasOwnProperty(a)&&a.startsWith("mem_")){var o=r.attributes[a];"mem_scrollLeft"===a&&(i.scrollLeft=o),"mem_scrollTop"===a&&(i.scrollTop=o)}}}}function rebuild(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=!0);var i={},a=buildNodeWithSN(e,t,i,!1,n,r);return sideEffects(i),[a,i]}function on(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}exports.EventType=void 0,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.PageChange=5]="PageChange",e[e.Custom=9]="Custom",e[e.Other=99]="Other"}(exports.EventType||(exports.EventType={})),exports.IncrementalSource=void 0,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.Drag=10]="Drag",e[e.UserDefinedEvent=11]="UserDefinedEvent"}(exports.IncrementalSource||(exports.IncrementalSource={})),function(e){e[e.LivePlay=0]="LivePlay"}(UserDefinedEvent||(UserDefinedEvent={})),function(e){e[e.Console=1]="Console",e[e.Network=2]="Network"}(OtherSource||(OtherSource={})),exports.MouseInteractions=void 0,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"}(exports.MouseInteractions||(exports.MouseInteractions={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(CanvasContext||(CanvasContext={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause"}(MediaInteractions||(MediaInteractions={})),exports.ReplayerEvents=void 0,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.AddEvents="add-events"}(exports.ReplayerEvents||(exports.ReplayerEvents={}));var mirror={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return mirror.map[e]||null},removeNodeFromMap:function(e){var t=e.__sn&&e.__sn.id;delete mirror.map[t],e.childNodes&&e.childNodes.forEach((function(e){return mirror.removeNodeFromMap(e)}))},has:function(e){return mirror.map.hasOwnProperty(e)}};function throttle(e,t,n){void 0===n&&(n={});var r=null,i=0;return function(a){var o=Date.now();i||!1!==n.leading||(i=o);var s=t-(o-i),l=this,c=arguments;s<=0||s>t?(r&&(window.clearTimeout(r),r=null),i=o,e.apply(l,c)):r||!1===n.trailing||(r=window.setTimeout((function(){i=!1===n.leading?0:Date.now(),r=null,e.apply(l,c)}),s))}}function hookSetter(e,t,n,r,i){void 0===i&&(i=window);var a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return hookSetter(e,t,a||{},!0)}}function patch(e,t,n){if(!(t in e))return function(){};var r=e[t],i=n(r);if("function"==typeof i)try{i.prototype=i.prototype||{},Object.defineProperties(i,{__memento_original__:{enumerable:!1,value:r}})}catch(e){}return e[t]=i,function(){e[t]=r}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function isBlocked(e,t,n){var r,i;if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var a=!1;if("string"==typeof t?a=e.classList.contains(t):e.classList&&e.classList&&e.classList.forEach((function(e){t.test(e)&&(a=!0)})),!a&&e.tagName&&n)try{for(var o=__values(n),s=o.next();!s.done;s=o.next()){if(s.value.tagName===e.tagName.toLowerCase()){a=!0;break}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a||isBlocked(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,isBlocked(e.parentNode,t,n)}function isAncestorRemoved(e){var t=mirror.getId(e);return!mirror.has(t)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||isAncestorRemoved(e.parentNode))}function isTouchEvent(e){return Boolean(e.changedTouches)}function polyfill(){"NodeList"in window&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach)}function dateFormat(e,t){var n={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};for(var r in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length))),n)new RegExp("("+r+")").test(t)&&(t=t.replace(RegExp.$1,1===RegExp.$1.length?n[r]:("00"+n[r]).substr((""+n[r]).length)));return t}function needCastInSyncMode(e){switch(e.type){case exports.EventType.DomContentLoaded:case exports.EventType.Load:case exports.EventType.PageChange:case exports.EventType.Custom:return!1;case exports.EventType.FullSnapshot:case exports.EventType.Meta:return!0}switch(e.data.source){case exports.IncrementalSource.MouseMove:case exports.IncrementalSource.MouseInteraction:case exports.IncrementalSource.TouchMove:case exports.IncrementalSource.MediaInteraction:return!1;case exports.IncrementalSource.ViewportResize:case exports.IncrementalSource.StyleSheetRule:case exports.IncrementalSource.Scroll:case exports.IncrementalSource.Input:return!0}return!0}var TreeIndex=function(){function e(){this.reset()}return e.prototype.add=function(e){var t=this.indexes.get(e.parentId),n={id:e.node.id,mutation:e,children:[],texts:[],attributes:[]};t?(n.parent=t,t.children[n.id]=n):this.tree[n.id]=n,this.indexes.set(n.id,n)},e.prototype.remove=function(e){var t=this,n=this.indexes.get(e.parentId),r=this.indexes.get(e.id),i=function(e){t.removeIdSet.add(e);var n=mirror.getNode(e);null==n||n.childNodes.forEach((function(e){return i(e.__sn.id)}))},a=function(n){t.removeIdSet.add(n.id),Object.values(n.children).forEach((function(e){return a(e)}));var r=t.indexes.get(n.id);if(r){var i=r.parent;i&&(delete r.parent,delete i.children[r.id],t.indexes.delete(e.id))}};r?n?(delete r.parent,delete n.children[r.id],this.indexes.delete(e.id),a(r)):(delete this.tree[r.id],this.indexes.delete(r.id),a(r)):(this.removeNodeMutations.push(e),i(e.id))},e.prototype.text=function(e){var t=this.indexes.get(e.id);t?t.texts.push(e):this.textMutations.push(e)},e.prototype.attribute=function(e){var t=this.indexes.get(e.id);t?t.attributes.push(e):this.attributeMutations.push(e)},e.prototype.scroll=function(e){this.scrollMap.set(e.id,e)},e.prototype.input=function(e){this.inputMap.set(e.id,e)},e.prototype.flush=function(){var e,t,n,r,i=this,a=this,o=a.tree,s=a.removeNodeMutations,l=a.textMutations,c=a.attributeMutations,u={source:exports.IncrementalSource.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(o).forEach((function(e){return d(e,!1)}));try{for(var f=__values(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 g=__values(this.inputMap.keys()),m=g.next();!m.done;m=g.next()){h=m.value;this.removeIdSet.has(h)&&this.inputMap.delete(h)}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=g.return)&&r.call(g)}finally{if(n)throw n.error}}var v=new Map(this.scrollMap),y=new Map(this.inputMap);return this.reset(),{mutationData:u,scrollMap:v,inputMap:y}},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 isNumber(e){return"[object Number]"==Object.prototype.toString.call(e)}function isString(e){return"[object String]"==Object.prototype.toString.call(e)}function isArray(e){return"[object Array]"==Object.prototype.toString.call(e)}function isBoolean(e){return"[object Boolean]"==Object.prototype.toString.call(e)}function isUndefined(e){return void 0===e}function isNull(e){return null===e}function isSymbol(e){return"[object Symbol]"==Object.prototype.toString.call(e)}function isObject(e){return!("[object Object]"!=Object.prototype.toString.call(e)&&(isNumber(e)||isString(e)||isBoolean(e)||isArray(e)||isNull(e)||isFunction(e)||isUndefined(e)||isSymbol(e)))}function isFunction(e){return"[object Function]"==Object.prototype.toString.call(e)}function isElement(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function isWindow(e){var t=Object.prototype.toString.call(e);return"[object global]"==t||"[object Window]"==t||"[object DOMWindow]"==t}function isPlainObject(e){var t,n=Object.prototype.hasOwnProperty;if(!e||"object"!=typeof e||e.nodeType||isWindow(e))return!1;try{if(e.constructor&&!n.call(e,"constructor")&&!n.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}for(t in e);return void 0===t||n.call(e,t)}function getBaseDimension(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 a=i.getBoundingClientRect(),o=getBaseDimension(i,t),s=a.height/i.clientHeight;return{x:a.x*o.relativeScale+o.x,y:a.y*o.relativeScale+o.y,relativeScale:s,absoluteScale:o.absoluteScale*s}}var utils=Object.freeze({__proto__:null,on:on,mirror:mirror,throttle:throttle,hookSetter:hookSetter,patch:patch,getWindowHeight:getWindowHeight,getWindowWidth:getWindowWidth,isBlocked:isBlocked,isAncestorRemoved:isAncestorRemoved,isTouchEvent:isTouchEvent,polyfill:polyfill,dateFormat:dateFormat,needCastInSyncMode:needCastInSyncMode,TreeIndex:TreeIndex,isNumber:isNumber,isString:isString,isArray:isArray,isBoolean:isBoolean,isUndefined:isUndefined,isNull:isNull,isSymbol:isSymbol,isObject:isObject,isFunction:isFunction,isElement:isElement,isWindow:isWindow,isPlainObject:isPlainObject,getBaseDimension:getBaseDimension}),moveKey=function(e,t){return e+"@"+t};function isINode(e){return"__sn"in e}function isNodeInLinkedList(e){return"__ln"in e}var DoubleLinkedList=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&isNodeInLinkedList(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&isNodeInLinkedList(e.nextSibling)&&e.nextSibling.__ln.previous){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),MutationBuffer=function(e,t,n,r,i,a){var o=this;void 0===i&&(i=[]),this.texts=[],this.attributes=[],this.removes=[],this.adds=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(e){var t,n,r,i,a,s,l,c;o.reset(),e.forEach(o.processMutation);var u=o.texts,d=o.attributes,f=o.removes,p=o.adds,h=o.addedSet,g=o.movedSet,m=o.droppedSet,v=__spread(h,g),y=[],I=new DoubleLinkedList,C=function(e){var t=e.nextSibling&&mirror.getId(e.nextSibling);return-1===t&&isBlocked(e.nextSibling,o.blockClass)&&(t=null),t},b=!1;if(o.asyncClass){try{for(var _=__values(v),A=_.next();!A.done;A=_.next())if(isBlocked(A.value.parentNode,o.asyncClass)){b=!0;break}}catch(e){t={error:e}}finally{try{A&&!A.done&&(n=_.return)&&n.call(_)}finally{if(t)throw t.error}}if(!b)try{for(var w=__values(d),S=w.next();!S.done;S=w.next())if(isBlocked(S.value.node.parentNode,o.asyncClass)){b=!0;break}}catch(e){r={error:e}}finally{try{S&&!S.done&&(i=w.return)&&i.call(w)}finally{if(r)throw r.error}}}var x=function(e){if(e.parentNode){var t=mirror.getId(e.parentNode),n=C(e);if(-1===t||-1===n)return I.addNode(e);p.push({parentId:t,nextId:n,node:serializeNodeWithId(e,document,mirror.map,o.blockClass,!0,o.inlineStylesheet,o.maskInputOptions,o.blockElements)})}},k=function(e){b?y.push(new Promise((function(t){o.requestIdleCallback((function(){x(e),t()}))}))):x(e)};try{for(var E=__values(g),T=E.next();!T.done;T=E.next())k(M=T.value)}catch(e){a={error:e}}finally{try{T&&!T.done&&(s=E.return)&&s.call(E)}finally{if(a)throw a.error}}try{for(var N=__values(h),B=N.next();!B.done;B=N.next()){var M;isAncestorInSet(m,M=B.value)||isParentRemoved(f,M)?isAncestorInSet(g,M)?k(M):m.add(M):k(M)}}catch(e){l={error:e}}finally{try{B&&!B.done&&(c=N.return)&&c.call(N)}finally{if(l)throw l.error}}var R=function(){for(var e=null;I.length;){var t=null;if(e){var n=mirror.getId(e.value.parentNode),r=C(e.value);-1!==n&&-1!==r&&(t=e)}if(!t)for(var i=I.length-1;i>=0;i--){var a=I.get(i);if(n=mirror.getId(a.value.parentNode),r=C(a.value),-1!==n&&-1!==r){t=a;break}}if(!t){for(;I.head;)I.removeNode(I.head.value);break}e=t.previous,I.removeNode(t.value),x(t.value)}};if(b){var O=Date.now();Promise.all(y).then((function(){R(),o.emit(u,d,f,p,O)}))}else R(),o.emit(u,d,f,p)},this.emit=function(e,t,n,r,i){var a={texts:e.map((function(e){return{id:mirror.getId(e.node),value:e.value}})).filter((function(e){return mirror.has(e.id)})),attributes:t.map((function(e){return{id:mirror.getId(e.node),attributes:e.attributes}})).filter((function(e){return mirror.has(e.id)})),removes:n,adds:r,timestamp:i};(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&o.emissionCallback(a)},this.processMutation=function(e){switch(e.type){case"characterData":var t=e.target.textContent;isBlocked(e.target,o.blockClass,o.blockElements)||t===e.oldValue||o.texts.push({value:t,node:e.target});break;case"attributes":if(t=e.target.getAttribute(e.attributeName),isBlocked(e.target,o.blockClass,o.blockElements)||t===e.oldValue)return;var n=o.attributes.find((function(t){return t.node===e.target}));n||(n={node:e.target,attributes:{}},o.attributes.push(n)),n.attributes[e.attributeName]=transformAttribute(document,e.attributeName,t);var r=e.target.tagName.toLowerCase().trim(),i="img"===r&&"src"===e.attributeName||"link"===r&&"href"===e.attributeName,a=e.target.rel;!i||"dns-prefetch"===a||"preload"===a||/^data:image/i.test(n.attributes[e.attributeName])||(n.attributes["_memimage_"+e.attributeName]=n.attributes[e.attributeName]);break;case"childList":e.addedNodes.forEach((function(t){return o.genAdds(t,e.target)})),e.removedNodes.forEach((function(t){var n=mirror.getId(t),r=mirror.getId(e.target);isBlocked(t,o.blockClass,o.blockElements)||isBlocked(e.target,o.blockClass,o.blockElements)||(o.addedSet.has(t)?(deepDelete(o.addedSet,t),o.droppedSet.add(t)):o.addedSet.has(e.target)&&-1===n||isAncestorRemoved(e.target)||(o.movedSet.has(t)&&o.movedMap[moveKey(n,r)]?deepDelete(o.movedSet,t):o.removes.push({parentId:r,id:n})),mirror.removeNodeFromMap(t))}))}},this.genAdds=function(e,t){if(!isBlocked(e.parentNode,o.blockClass,o.blockElements)){if(isINode(e)){o.movedSet.add(e);var n=null;t&&isINode(t)&&(n=t.__sn.id),n&&(o.movedMap[moveKey(e.__sn.id,n)]=!0)}else o.addedSet.add(e),o.droppedSet.delete(e);e.childNodes.forEach((function(e){return o.genAdds(e)}))}},this.reset=function(){o.texts=[],o.attributes=[],o.removes=[],o.adds=[],o.addedSet=new Set,o.movedSet=new Set,o.droppedSet=new Set,o.movedMap={}},this.requestIdleCallback=function(e,t){if(window.requestIdleCallback)window.requestIdleCallback(e,t);else{var n=(t||{timeout:0}).timeout;window.setTimeout(e,n)}},this.blockClass=t,this.blockElements=i,this.asyncClass=a,this.inlineStylesheet=n,this.maskInputOptions=r,this.emissionCallback=e};function deepDelete(e,t){e.delete(t),t.childNodes.forEach((function(t){return deepDelete(e,t)}))}function isParentRemoved(e,t){var n=t.parentNode;if(!n)return!1;var r=mirror.getId(n);return!!e.some((function(e){return e.id===r}))||isParentRemoved(e,n)}function isAncestorInSet(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||isAncestorInSet(e,n))}var mql=window.matchMedia("(orientation: portrait)"),isPortrait=mql.matches;function initMutationObserver(e,t,n,r,i,a){void 0===i&&(i=[]);var o=new MutationBuffer(e,t,n,r,i,a),s=new MutationObserver(o.processMutations);return s.observe(document,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function initMoveObserver(e,t){if(!1===t.mousemove)return function(){};var n,r="number"==typeof t.mousemove?t.mousemove:50,i=[],a=throttle((function(t){var r=Date.now()-n;e(i.map((function(e){return e.timeOffset-=r,e})),t?exports.IncrementalSource.TouchMove:exports.IncrementalSource.MouseMove),i=[],n=null}),500),o=throttle((function(e){var t=e.target,r=isTouchEvent(e)?e.changedTouches[0]:e,o=r.clientX,s=r.clientY;n||(n=Date.now()),i.push({x:o,y:s,id:mirror.getId(t),timeOffset:Date.now()-n}),a(isTouchEvent(e))}),r,{trailing:!1}),s=[on("mousemove",o),on("touchmove",o)];return function(){s.forEach((function(e){return e()}))}}function initMouseInteractionObserver(e,t,n,r){if(void 0===r&&(r=[]),!1===n.mouseInteraction)return function(){};var i=!0===n.mouseInteraction||void 0===n.mouseInteraction?{}:n.mouseInteraction,a=[];return Object.keys(exports.MouseInteractions).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]})).forEach((function(n){var i=n.toLowerCase(),o=function(n){return function(i){if(!isBlocked(i.target,t,r)){var a=mirror.getId(i.target),o=isTouchEvent(i)?i.changedTouches[0]:i,s=o.clientX,l=o.clientY;e({type:exports.MouseInteractions[n],id:a,x:s,y:l})}}}(n);a.push(on(i,o))})),function(){a.forEach((function(e){return e()}))}}function initScrollObserver(e,t,n,r){return void 0===r&&(r=[]),on("scroll",throttle((function(n){if(n.target&&!isBlocked(n.target,t,r)){var i=mirror.getId(n.target);if(n.target===document){var a=document.scrollingElement||document.documentElement;e({id:i,x:a.scrollLeft,y:a.scrollTop})}else e({id:i,x:n.target.scrollLeft,y:n.target.scrollTop})}}),n.scroll||100))}function initViewportResizeObserver(e){return on("resize",throttle((function(){var t=getWindowHeight(),n=getWindowWidth();e({width:Number(n),height:Number(t),rotate:isPortrait!==mql.matches?1:0}),isPortrait=mql.matches}),200),window)}var INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],lastInputValueMap=new WeakMap;function initInputObserver(e,t,n,r,i,a){function o(e){var i=e.target;if(i&&i.tagName&&!(INPUT_TAGS.indexOf(i.tagName)<0)&&!isBlocked(i,t,a)){var o=i.type;if("password"!==o&&!i.classList.contains(n)){var l=i.value,c=!1;"radio"===o||"checkbox"===o?c=i.checked:(r[i.tagName.toLowerCase()]||r[o])&&(l="*".repeat(l.length)),s(i,{text:l,isChecked:c});var u=i.name;"radio"===o&&u&&c&&document.querySelectorAll('input[type="radio"][name="'+u+'"]').forEach((function(e){e!==i&&s(e,{text:e.value,isChecked:!c})}))}}}function s(t,n){var r=lastInputValueMap.get(t);if(!r||r.text!==n.text||r.isChecked!==n.isChecked){lastInputValueMap.set(t,n);var i=mirror.getId(t);e(__assign(__assign({},n),{id:i}))}}void 0===a&&(a=[]);var l=("last"===i.input?["change"]:["input","change"]).map((function(e){return on(e,o)})),c=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),u=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"]];return c&&c.set&&l.push.apply(l,__spread(u.map((function(e){return hookSetter(e[0],e[1],{set:function(){o({target:this})}})})))),function(){l.forEach((function(e){return e()}))}}function initStyleSheetObserver(e){var t=CSSStyleSheet.prototype.insertRule;CSSStyleSheet.prototype.insertRule=function(n,r){var i=mirror.getId(this.ownerNode);return-1!==i&&e({id:i,adds:[{rule:n,index:r}]}),t.apply(this,arguments)};var n=CSSStyleSheet.prototype.deleteRule;return CSSStyleSheet.prototype.deleteRule=function(t){var r=mirror.getId(this.ownerNode);return-1!==r&&e({id:r,removes:[{index:t}]}),n.apply(this,arguments)},function(){CSSStyleSheet.prototype.insertRule=t,CSSStyleSheet.prototype.deleteRule=n}}function initMediaInteractionObserver(e,t,n){void 0===n&&(n=[]);var r=function(r){return function(i){var a=i.target;a&&!isBlocked(a,t,n)&&e({type:"play"===r?MediaInteractions.Play:MediaInteractions.Pause,id:mirror.getId(a)})}},i=[on("play",r("play")),on("pause",r("pause"))];return function(){i.forEach((function(e){return e()}))}}function initUserDefinedEventObserver(e){var t,n=[on("memento-live-play",(t=UserDefinedEvent.LivePlay,function(n){if("detail"in n&&n.detail){var r=n.detail;e(__assign({evt:t},r))}}))];return function(){n.forEach((function(e){return e()}))}}function initConsoleObserver(e){var t={},n=["script","img","link","video","audio"],r=["log","info","warn","error"],i=[];window.console?r.map((function(e){t[e]=window.console[e]})):window.console={},r.map((function(n){window.console[n]=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];t[n].apply(window.console,r);for(var a=r,o=0;o<a.length;o++)isArray(a[o])?a[o]="[Array]":isElement(a[o])?a[o]="[HTMLElement]":isFunction(a[o])?a[o]="[Function]":isWindow(a[o])?a[o]="[Window]":isObject(a[o])&&(a[o]="[Object]");"__memento__"!==r[0]&&e({logType:n,logs:a})}})),window.addEventListener("error",(function(t){var r=t.target||t.srcElement,a=r.attributes&&r.attributes.src&&r.attributes.src.value||"";if((r.nodeName&&n.indexOf(r.nodeName.toLowerCase())>=0||r.tagName&&n.indexOf(r.tagName.toLowerCase())>=0)&&a&&i.indexOf(a.toLowerCase())<0){i.push(a.toLowerCase());var o=(r.nodeName||r.tagName||"")+" "+(a||"unkonw")+" loaded fail";e({logType:"resourceError",logs:[o]})}}));var a=window.onerror;return window.onerror=function(t,n,r,i,o){return!t||t.indexOf("WeixinJSBridge")>=0||e({logType:"jsError",logs:["pageUrl => "+window.location.href,"errorMsg => "+(t||""),"scriptUrl => "+(n||""),"lineNo => "+r,"columnNo => "+i,"errorType => "+(o?o.name:""),"errorStack => "+(o?o.stack:"")]}),a.apply(this,arguments)},function(){window.console.log=t.log,window.console.info=t.info,window.console.warn=t.warn,window.console.error=t.error,window.onerror=a}}function initNetworkObserver(e){if(!window.XMLHttpRequest)return function(){};var t=window.XMLHttpRequest.prototype.open,n=window.XMLHttpRequest.prototype.send,r=window.XMLHttpRequest.prototype.setRequestHeader,i={};function a(t,n){var r=i[t]||{};for(var a in n)r[a]=n[a];if(i[t]=r,r.hasOwnProperty("getData")||r.hasOwnProperty("postData")||delete i[t],r&&r.requestSize&&r.requestSize>1e4&&(r.postData="Post Request => Too long has been blocked"),r&&r.getSize&&r.getSize>1e4&&(r.getData="Get Request => Too long has been blocked"),r&&r.responseSize&&r.responseSize>31457280)r.response="Post Request => Too long has been blocked";else if(r&&(""===r.responseType||"text"===r.responseType))if(isString(r.response)&&""!==r.response)try{r.response=JSON.parse(r.response)}catch(e){r.response=r.response}else void 0!==r.response&&(""===r.response?r.response="":r.response=Object.prototype.toString.call(r.response));r.readyState&&4===r.readyState&&(r&&0==+r.status?("timeout_error"===r.errorType?(r.errorMsg="request error => timeout ( responseTime > "+(r.timeOut||r.costTime)+"ms )",delete r.timeOut):(r.errorMsg="request error => cross_domain_error",r.errorType="cross_domain_error"),e(r)):e(r||{}))}return window.XMLHttpRequest.prototype.setRequestHeader=function(e,t){return"memento-ignore"===e.toLowerCase()&&(this._noMementoConsole=1==~~t),r.apply(this,arguments)},window.XMLHttpRequest.prototype.open=function(){var e=this,n=[].slice.call(arguments),r=n[0],o=n[1],s=function(){var e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}));return e}(),l=null;e._mockRequestID=s,e._mockMethod=r,e._mockUrl=o;var c=e.onreadystatechange||function(){},u=function(){var t=i[s]||{};if(t.readyState=e.readyState,t.status=0,e.readyState>1&&(t.status=e.status),t.responseType=e.responseType,0==e.readyState)t.startTime||(t.startTime=+new Date);else if(1==e.readyState)t.startTime||(t.startTime=+new Date);else if(2==e.readyState);else if(3==e.readyState);else if(4==e.readyState){clearInterval(l);var n=e._mockUrl.split("?");if(t.url=n.shift()||e._mockUrl,t.endTime=+new Date,t.costTime=t.endTime-(t.startTime||t.endTime),t.ua=window.navigator&&window.navigator.userAgent||"",t.response=e.response,"string"==typeof e.response)t.responseSize=e.response.length;else if(e.response&&"number"==typeof e.response.size)t.responseSize=e.response.size;else if(e.response&&"number"==typeof e.response.byteLength)t.responseSize=e.response.byteLength;else try{t.responseSize=JSON.stringify(e.response).length}catch(e){t.responseSize=0}}else clearInterval(l);return e._noMementoConsole||a(s,t),c.apply(e,arguments)};e.onreadystatechange=u;var d=-1;return l=setInterval((function(){d!=e.readyState&&(d=e.readyState,u.call(e))}),10),t.apply(e,n)},window.XMLHttpRequest.prototype.send=function(){var e,t,r,o,s=this,l=[].slice.call(arguments),c=l[0],u=i[s._mockRequestID]||{};u.method=s._mockMethod.toUpperCase(),u.ck=document.cookie;var d=s._mockUrl.split("?");if(d.shift()&&d.length>0){u.getData={},d=(d=d.join("?")).split("&");try{for(var f=__values(d),p=f.next();!p.done;p=f.next()){v=(v=p.value).split("="),u.getData[v[0]]=decodeURIComponent(v[1])}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}u.getData&&(u.getSize=JSON.stringify(u.getData).length)}if("POST"==u.method){if(isString(c)&&""!==c){var h=c.split("&");u.postData={};try{for(var g=__values(h),m=g.next();!m.done;m=g.next()){var v;v=(v=m.value).split("="),u.postData[decodeURIComponent(v[0])]=decodeURIComponent(v[1])}}catch(e){r={error:e}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(r)throw r.error}}}else isPlainObject(c)&&(u.postData=c);u.postData&&(u.requestSize=JSON.stringify(u.postData).length)}var y=s.ontimeout||function(){};return s.ontimeout=function(){var e=arguments[0].target||arguments[0].srcElement;return u.timeOut=e.timeout,u.errorType="timeout_error",a(s._mockRequestID,u),y.apply(s,arguments)},s._noMementoConsole||a(s._mockRequestID,u),n.apply(s,l)},function(){window.XMLHttpRequest.prototype.setRequestHeader=r,window.XMLHttpRequest.prototype.open=t,window.XMLHttpRequest.prototype.send=n}}function mergeHooks(e,t){var n=e.mutationCb,r=e.mousemoveCb,i=e.mouseInteractionCb,a=e.scrollCb,o=e.viewportResizeCb,s=e.inputCb,l=e.mediaInteractionCb,c=e.styleSheetRuleCb;e.mutationCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.mutation&&t.mutation.apply(t,__spread(e)),n.apply(void 0,__spread(e))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,__spread(e)),r.apply(void 0,__spread(e))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,__spread(e)),i.apply(void 0,__spread(e))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,__spread(e)),a.apply(void 0,__spread(e))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,__spread(e)),o.apply(void 0,__spread(e))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,__spread(e)),s.apply(void 0,__spread(e))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,__spread(e)),l.apply(void 0,__spread(e))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,__spread(e)),c.apply(void 0,__spread(e))}}function initObservers(e,t){void 0===t&&(t={}),mergeHooks(e,t);var n=initMutationObserver(e.mutationCb,e.blockClass,e.inlineStylesheet,e.maskInputOptions,e.blockElements,e.asyncClass),r=initMoveObserver(e.mousemoveCb,e.sampling),i=initMouseInteractionObserver(e.mouseInteractionCb,e.blockClass,e.sampling,e.blockElements),a=initScrollObserver(e.scrollCb,e.blockClass,e.sampling,e.blockElements),o=initViewportResizeObserver(e.viewportResizeCb),s=initInputObserver(e.inputCb,e.blockClass,e.ignoreClass,e.maskInputOptions,e.sampling);initMediaInteractionObserver(e.mediaInteractionCb,e.blockClass,e.blockElements);var l=initStyleSheetObserver(e.styleSheetRuleCb),c=initUserDefinedEventObserver(e.userDefinedEventCb);return function(){n.disconnect(),r(),i(),a(),o(),s(),l(),c()}}function mergeOtherHooks(e,t){void 0===t&&(t={});var n=e.consoleCb,r=e.networkCb;e.consoleCb=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.console&&t.console.apply(t,__spread(e)),n.apply(void 0,__spread(e))},e.networkCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.network&&t.network.apply(t,__spread(e)),r.apply(void 0,__spread(e))}}function initOtherObserver(e,t){mergeOtherHooks(e,t);var n=initConsoleObserver(e.consoleCb),r=initNetworkObserver(e.networkCb);return function(){n(),r()}}for(var CHANGE_STATE_EVENT="__changestate__",XFix=function(){function e(){this.handlerHistory()}return e.getInstance=function(){return this.instance=this.instance||new e,this.instance},e.prototype.handlerHistory=function(){var e=function(e){var t=window.history[e];return function(){var e=t.apply(this,arguments),n=function(){if(window.Event)return new window.Event(CHANGE_STATE_EVENT);if(document){var e=document.createEvent("HTMLEvents");return e.initEvent(CHANGE_STATE_EVENT,!1,!0),e}return null}();return n&&window.dispatchEvent(n),e}};window.history.pushState=e("pushState"),window.history.replaceState=e("replaceState")},e}(),chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup="undefined"==typeof Uint8Array?[]:new Uint8Array(256),i$1=0;i$1<chars.length;i$1++)lookup[chars.charCodeAt(i$1)]=i$1;var encode=function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=chars[n[t]>>2],i+=chars[(3&n[t])<<4|n[t+1]>>4],i+=chars[(15&n[t+1])<<2|n[t+2]>>6],i+=chars[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i},decode=function(e){var t,n,r,i,a,o=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var c=new ArrayBuffer(o),u=new Uint8Array(c);for(t=0;t<s;t+=4)n=lookup[e.charCodeAt(t)],r=lookup[e.charCodeAt(t+1)],i=lookup[e.charCodeAt(t+2)],a=lookup[e.charCodeAt(t+3)],u[l++]=n<<2|r>>4,u[l++]=(15&r)<<4|i>>2,u[l++]=(3&i)<<6|63&a;return c},canvasVarMap=new Map;function variableListFor$1(e,t){var n=canvasVarMap.get(e);return n||(n=new Map,canvasVarMap.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var saveWebGLVar=function(e,t,n){if(e&&(isInstanceOfWebGLObject(e,t)||"object"==typeof e)){var r=variableListFor$1(n,e.constructor.name),i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i}};function serializeArg(e,t,n){if(e instanceof Array)return e.map((function(e){return serializeArg(e,t,n)}));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){var r=e.constructor.name;return e instanceof Uint8ClampedArray?{rr_type:r,args:[]}:{rr_type:r,args:[Object.values(e)]}}return e instanceof ArrayBuffer?{rr_type:r=e.constructor.name,base64:encode(e)}:e instanceof DataView?{rr_type:r=e.constructor.name,args:[serializeArg(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:r=e.constructor.name,src:e.src}:e instanceof HTMLCanvasElement?{rr_type:r="HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:r=e.constructor.name,args:[serializeArg(e.data,t,n),e.width,e.height]}:isInstanceOfWebGLObject(e,t)||"object"==typeof e?{rr_type:r=e.constructor.name,index:saveWebGLVar(e,t,n)}:e}var serializeArgs=function(e,t,n){return __spread(e).map((function(e){return serializeArg(e,t,n)}))},isInstanceOfWebGLObject=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function initCanvas2DMutationObserver(e,t,n,r){var i,a,o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),l=function(r){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[r])return"continue";var i=patch(t.CanvasRenderingContext2D.prototype,r,(function(i){return function(){for(var a=this,o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];return isBlocked(this.canvas,n)||setTimeout((function(){var n=serializeArgs(__spread(o),t,a);e(a.canvas,{type:CanvasContext["2D"],property:r,args:n})}),0),i.apply(this,o)}}));o.push(i)}catch(n){var a=hookSetter(t.CanvasRenderingContext2D.prototype,r,{set:function(t){e(this.canvas,{type:CanvasContext["2D"],property:r,args:[t],setter:!0})}});o.push(a)}};try{for(var c=__values(s),u=c.next();!u.done;u=c.next()){l(u.value)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}return function(){o.forEach((function(e){return e()}))}}function initCanvasContextObserver(e,t){var n=[];try{var r=patch(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return isBlocked(this,t)||"__context"in this||(this.__context=n),e.apply(this,__spread([n],r))}}));n.push(r)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}function patchGLPrototype(e,t,n,r,i,a){var o,s,l=[],c=Object.getOwnPropertyNames(e),u=function(o){try{if("function"!=typeof e[o])return"continue";var s=patch(e,o,(function(s){return function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];var u=s.apply(this,l);if(saveWebGLVar(u,a,e),!isBlocked(this.canvas,r)){i.getId(this.canvas);var d=serializeArgs(__spread(l),a,e),f={type:t,property:o,args:d};n(this.canvas,f)}return u}}));l.push(s)}catch(r){var c=hookSetter(e,o,{set:function(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});l.push(c)}};try{for(var d=__values(c),f=d.next();!f.done;f=d.next()){u(f.value)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.error}}return l}function initCanvasWebGLMutationObserver(e,t,n,r){var i=[];return i.push.apply(i,__spread(patchGLPrototype(t.WebGLRenderingContext.prototype,CanvasContext.WebGL,e,n,r,t))),void 0!==t.WebGL2RenderingContext&&i.push.apply(i,__spread(patchGLPrototype(t.WebGL2RenderingContext.prototype,CanvasContext.WebGL2,e,n,r,t))),function(){i.forEach((function(e){return e()}))}}var WorkerClass=null;try{var WorkerThreads="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");WorkerClass=WorkerThreads.Worker}catch(e){}function decodeBase64$1(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}function createBase64WorkerFactory$2(e,t,n){var r=void 0===t?null:t,i=decodeBase64$1(e,void 0!==n&&n),a=i.indexOf("\n",10)+1,o=i.substring(a)+(r?"//# sourceMappingURL="+r:"");return function(e){return new WorkerClass(o,Object.assign({},e,{eval:!0}))}}function decodeBase64(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),i=0,a=n.length;i<a;++i)r[i]=n.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}function createURL(e,t,n){var r=void 0===t?null:t,i=decodeBase64(e,void 0!==n&&n),a=i.indexOf("\n",10)+1,o=i.substring(a)+(r?"//# sourceMappingURL="+r:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}function createBase64WorkerFactory$1(e,t,n){var r;return function(i){return r=r||createURL(e,t,n),new Worker(r,i)}}var kIsNodeJS="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);function isNodeJS(){return kIsNodeJS}function createBase64WorkerFactory(e,t,n){return isNodeJS()?createBase64WorkerFactory$2(e,t,n):createBase64WorkerFactory$1(e,t,n)}var wrappedEmit,WorkerFactory=createBase64WorkerFactory("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9DQoNCiAgICBmdW5jdGlvbiBfX2dlbmVyYXRvcih0aGlzQXJnLCBib2R5KSB7DQogICAgICAgIHZhciBfID0geyBsYWJlbDogMCwgc2VudDogZnVuY3Rpb24oKSB7IGlmICh0WzBdICYgMSkgdGhyb3cgdFsxXTsgcmV0dXJuIHRbMV07IH0sIHRyeXM6IFtdLCBvcHM6IFtdIH0sIGYsIHksIHQsIGc7DQogICAgICAgIHJldHVybiBnID0geyBuZXh0OiB2ZXJiKDApLCAidGhyb3ciOiB2ZXJiKDEpLCAicmV0dXJuIjogdmVyYigyKSB9LCB0eXBlb2YgU3ltYm9sID09PSAiZnVuY3Rpb24iICYmIChnW1N5bWJvbC5pdGVyYXRvcl0gPSBmdW5jdGlvbigpIHsgcmV0dXJuIHRoaXM7IH0pLCBnOw0KICAgICAgICBmdW5jdGlvbiB2ZXJiKG4pIHsgcmV0dXJuIGZ1bmN0aW9uICh2KSB7IHJldHVybiBzdGVwKFtuLCB2XSk7IH07IH0NCiAgICAgICAgZnVuY3Rpb24gc3RlcChvcCkgew0KICAgICAgICAgICAgaWYgKGYpIHRocm93IG5ldyBUeXBlRXJyb3IoIkdlbmVyYXRvciBpcyBhbHJlYWR5IGV4ZWN1dGluZy4iKTsNCiAgICAgICAgICAgIHdoaWxlIChfKSB0cnkgew0KICAgICAgICAgICAgICAgIGlmIChmID0gMSwgeSAmJiAodCA9IG9wWzBdICYgMiA/IHlbInJldHVybiJdIDogb3BbMF0gPyB5WyJ0aHJvdyJdIHx8ICgodCA9IHlbInJldHVybiJdKSAmJiB0LmNhbGwoeSksIDApIDogeS5uZXh0KSAmJiAhKHQgPSB0LmNhbGwoeSwgb3BbMV0pKS5kb25lKSByZXR1cm4gdDsNCiAgICAgICAgICAgICAgICBpZiAoeSA9IDAsIHQpIG9wID0gW29wWzBdICYgMiwgdC52YWx1ZV07DQogICAgICAgICAgICAgICAgc3dpdGNoIChvcFswXSkgew0KICAgICAgICAgICAgICAgICAgICBjYXNlIDA6IGNhc2UgMTogdCA9IG9wOyBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSA0OiBfLmxhYmVsKys7IHJldHVybiB7IHZhbHVlOiBvcFsxXSwgZG9uZTogZmFsc2UgfTsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSA1OiBfLmxhYmVsKys7IHkgPSBvcFsxXTsgb3AgPSBbMF07IGNvbnRpbnVlOw0KICAgICAgICAgICAgICAgICAgICBjYXNlIDc6IG9wID0gXy5vcHMucG9wKCk7IF8udHJ5cy5wb3AoKTsgY29udGludWU7DQogICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6DQogICAgICAgICAgICAgICAgICAgICAgICBpZiAoISh0ID0gXy50cnlzLCB0ID0gdC5sZW5ndGggPiAwICYmIHRbdC5sZW5ndGggLSAxXSkgJiYgKG9wWzBdID09PSA2IHx8IG9wWzBdID09PSAyKSkgeyBfID0gMDsgY29udGludWU7IH0NCiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcFswXSA9PT0gMyAmJiAoIXQgfHwgKG9wWzFdID4gdFswXSAmJiBvcFsxXSA8IHRbM10pKSkgeyBfLmxhYmVsID0gb3BbMV07IGJyZWFrOyB9DQogICAgICAgICAgICAgICAgICAgICAgICBpZiAob3BbMF0gPT09IDYgJiYgXy5sYWJlbCA8IHRbMV0pIHsgXy5sYWJlbCA9IHRbMV07IHQgPSBvcDsgYnJlYWs7IH0NCiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ICYmIF8ubGFiZWwgPCB0WzJdKSB7IF8ubGFiZWwgPSB0WzJdOyBfLm9wcy5wdXNoKG9wKTsgYnJlYWs7IH0NCiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0WzJdKSBfLm9wcy5wb3AoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIF8udHJ5cy5wb3AoKTsgY29udGludWU7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIG9wID0gYm9keS5jYWxsKHRoaXNBcmcsIF8pOw0KICAgICAgICAgICAgfSBjYXRjaCAoZSkgeyBvcCA9IFs2LCBlXTsgeSA9IDA7IH0gZmluYWxseSB7IGYgPSB0ID0gMDsgfQ0KICAgICAgICAgICAgaWYgKG9wWzBdICYgNSkgdGhyb3cgb3BbMV07IHJldHVybiB7IHZhbHVlOiBvcFswXSA/IG9wWzFdIDogdm9pZCAwLCBkb25lOiB0cnVlIH07DQogICAgICAgIH0NCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMiA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMiBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgdmFyIGxhc3RCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIHZhciB0cmFuc3BhcmVudEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgZnVuY3Rpb24gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIFByb21pc2UsIGZ1bmN0aW9uICgpIHsNCiAgICAgICAgICAgIHZhciBpZCwgb2Zmc2NyZWVuLCBibG9iLCBhcnJheUJ1ZmZlciwgYmFzZTY0Ow0KICAgICAgICAgICAgcmV0dXJuIF9fZ2VuZXJhdG9yKHRoaXMsIGZ1bmN0aW9uIChfYSkgew0KICAgICAgICAgICAgICAgIHN3aXRjaCAoX2EubGFiZWwpIHsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOg0KICAgICAgICAgICAgICAgICAgICAgICAgaWQgPSB3aWR0aCArICItIiArIGhlaWdodDsNCiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0cmFuc3BhcmVudEJsb2JNYXAuaGFzKGlkKSkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIsIHRyYW5zcGFyZW50QmxvYk1hcC5nZXQoaWQpXTsNCiAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNjcmVlbiA9IG5ldyBPZmZzY3JlZW5DYW52YXMod2lkdGgsIGhlaWdodCk7DQogICAgICAgICAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCwgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoKV07DQogICAgICAgICAgICAgICAgICAgIGNhc2UgMToNCiAgICAgICAgICAgICAgICAgICAgICAgIGJsb2IgPSBfYS5zZW50KCk7DQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQsIGJsb2IuYXJyYXlCdWZmZXIoKV07DQogICAgICAgICAgICAgICAgICAgIGNhc2UgMjoNCiAgICAgICAgICAgICAgICAgICAgICAgIGFycmF5QnVmZmVyID0gX2Euc2VudCgpOw0KICAgICAgICAgICAgICAgICAgICAgICAgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zcGFyZW50QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIsIGJhc2U2NF07DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfSk7DQogICAgICAgIH0pOw0KICAgIH0NCiAgICB2YXIgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24gKCkgew0KICAgICAgICAgICAgdmFyIF9hLCBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCB0cmFuc3BhcmVudEJhc2U2NCwgb2Zmc2NyZWVuLCBjdHgsIGJsb2IsIHR5cGUsIGFycmF5QnVmZmVyLCBiYXNlNjQsIF9iOw0KICAgICAgICAgICAgcmV0dXJuIF9fZ2VuZXJhdG9yKHRoaXMsIGZ1bmN0aW9uIChfYykgew0KICAgICAgICAgICAgICAgIHN3aXRjaCAoX2MubGFiZWwpIHsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOg0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEoJ09mZnNjcmVlbkNhbnZhcycgaW4gZ2xvYmFsVGhpcykpDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyLCB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZDogZS5kYXRhLmlkIH0pXTsNCiAgICAgICAgICAgICAgICAgICAgICAgIF9hID0gZS5kYXRhLCBpZCA9IF9hLmlkLCBiaXRtYXAgPSBfYS5iaXRtYXAsIHdpZHRoID0gX2Eud2lkdGgsIGhlaWdodCA9IF9hLmhlaWdodDsNCiAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICAgICAgICAgIGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOw0KICAgICAgICAgICAgICAgICAgICAgICAgYml0bWFwLmNsb3NlKCk7DQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQsIG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKCldOw0KICAgICAgICAgICAgICAgICAgICBjYXNlIDE6DQogICAgICAgICAgICAgICAgICAgICAgICBibG9iID0gX2Muc2VudCgpOw0KICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9IGJsb2IudHlwZTsNCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCwgYmxvYi5hcnJheUJ1ZmZlcigpXTsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOg0KICAgICAgICAgICAgICAgICAgICAgICAgYXJyYXlCdWZmZXIgPSBfYy5zZW50KCk7DQogICAgICAgICAgICAgICAgICAgICAgICBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOw0KICAgICAgICAgICAgICAgICAgICAgICAgX2IgPSAhbGFzdEJsb2JNYXAuaGFzKGlkKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghX2IpIHJldHVybiBbMywgNF07DQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQsIHRyYW5zcGFyZW50QmFzZTY0XTsNCiAgICAgICAgICAgICAgICAgICAgY2FzZSAzOg0KICAgICAgICAgICAgICAgICAgICAgICAgX2IgPSAoX2Muc2VudCgpKSA9PT0gYmFzZTY0Ow0KICAgICAgICAgICAgICAgICAgICAgICAgX2MubGFiZWwgPSA0Ow0KICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6DQogICAgICAgICAgICAgICAgICAgICAgICBpZiAoX2IpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyLCB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZDogaWQgfSldOw0KICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxhc3RCbG9iTWFwLmdldChpZCkgPT09IGJhc2U2NCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIsIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkOiBpZCB9KV07DQogICAgICAgICAgICAgICAgICAgICAgICB3b3JrZXIucG9zdE1lc3NhZ2Uoew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpZCwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiB0eXBlLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhc2U2NDogYmFzZTY0LA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiB3aWR0aCwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IGhlaWdodCwNCiAgICAgICAgICAgICAgICAgICAgICAgIH0pOw0KICAgICAgICAgICAgICAgICAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOw0KICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyXTsNCiAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9KTsNCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",null,!1),CanvasManager=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};var t=e.sampling,n=void 0===t?"all":t,r=e.win,i=e.blockClass,a=e.recordCanvas;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&"all"===n&&this.initCanvasMutationObserver(r,i),a&&"number"==typeof n&&this.initCanvasFPSObserver(n,r,i)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasFPSObserver=function(e,t,n){var r=this,i=initCanvasContextObserver(t,n),a=new Map,o=new WorkerFactory;o.onmessage=function(e){var t=e.data.id;if(a.set(t,!1),"base64"in e.data){var n=e.data,i=n.base64,o=n.type,s=n.width,l=n.height;r.mutationCb({id:t,type:CanvasContext["2D"],commands:[{property:"clearRect",args:[0,0,s,l]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i}],type:o}]},0,0]}]})}};var s,l=1e3/e,c=0,u=function(e){c&&e-c<l||(c=e,t.document.querySelectorAll("canvas:not(."+n+" *)").forEach((function(e){return __awaiter(r,void 0,void 0,(function(){var t,n,r,i;return __generator(this,(function(s){switch(s.label){case 0:return t=this.mirror.getId(e),a.get(t)?[2]:(a.set(t,!0),["webgl","webgl2"].includes(e.__context)&&(n=e.getContext(e.__context),!1===(null===(i=null==n?void 0:n.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))),[4,createImageBitmap(e)]);case 1:return r=s.sent(),o.postMessage({id:t,bitmap:r,width:e.width,height:e.height},[r]),[2]}}))}))}))),s=requestAnimationFrame(u)};s=requestAnimationFrame(u),this.resetObservers=function(){i(),cancelAnimationFrame(s)}},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=initCanvasContextObserver(e,t),r=initCanvas2DMutationObserver(this.processMutation.bind(this),e,t,this.mirror),i=initCanvasWebGLMutationObserver(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){n(),r(),i()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.startRAFTimestamping=function(){var e=this,t=function(n){e.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){return e.type,__rest(e,["type"])})),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}();function wrapEvent(e){return __assign(__assign({},e),{timestamp:e.timestamp||Date.now()})}function disposeMousemovePosition(e,t){return t?e.map((function(e){return __assign(__assign({},e),{x:-40,y:-40})})):e}function disposeMouseInteraction(e,t){return t&&(e.x=-40,e.y=-40),{type:exports.EventType.IncrementalSnapshot,data:__assign({source:exports.IncrementalSource.MouseInteraction},e)}}function takeFullSnapshot$1(e,t,n){var r,i,a,o;void 0===e&&(e={}),void 0===t&&(t=!1);var s=e.emit,l=e.blockClass,c=void 0===l?"mem-block":l;e.ignoreClass;var u=e.inlineStylesheet,d=void 0===u||u,f=e.maskAllInputs,p=void 0!==f&&f,h=e.blockElements,g=void 0===h?[]:h,m=e.recordCanvas,v=void 0!==m&&m;if(e.ignoreMousemove,!wrappedEmit)throw new Error("please take full snapshot after start recording");wrappedEmit(wrapEvent({type:exports.EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight(),ratio:window.devicePixelRatio||1}}),t);var y=__read(snapshot(document,c,d,p,g,v),2),I=y[0],C=y[1];if(!I)return console.warn("Failed to snapshot the document");mirror.map=C;var b={type:exports.EventType.FullSnapshot,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight(),ratio:window.devicePixelRatio||1,node:I,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(i=null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.parentElement)||void 0===i?void 0:i.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(o=null===(a=null===document||void 0===document?void 0:document.body)||void 0===a?void 0:a.parentElement)||void 0===o?void 0:o.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}};n&&(b.tag=n);var _=wrapEvent(b);wrappedEmit(_),s&&s(_,t)}function record(e){void 0===e&&(e={});var t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,a=void 0===i?"mem-block":i,o=e.ignoreClass,s=void 0===o?"mem-ignore":o,l=e.asyncClass,c=e.blockElements,u=void 0===c?[]:c,d=e.inlineStylesheet,f=void 0===d||d,p=e.maskAllInputs,h=e.maskInputOptions,g=e.hooks,m=e.packFn,v=e.sampling,y=void 0===v?{}:v,I=e.mousemoveWait,C=e.recordCanvas,b=void 0!==C&&C,_=e.ignoreMousemove,A=void 0!==_&&_,w=e.onlyRecordFullSnapshot,S=void 0!==w&&w;if(!t)throw new Error("emit function is required");void 0!==I&&void 0===y.mousemove&&(y.mousemove=I);var x,k=!0===p?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:void 0!==h?h:{};polyfill();var E=0,T=__assign(__assign({},e),{emit:function(){}});wrappedEmit=function(e,i){if(t(m?m(e):e,i),e.type===exports.EventType.FullSnapshot)x=e,E=0;else if(e.type===exports.EventType.IncrementalSnapshot){E++;var a=r&&E>=r,o=n&&e.timestamp-x.timestamp>n;(a||o)&&takeFullSnapshot$1(T,!0)}};var N=function(e){return wrappedEmit(wrapEvent({type:exports.EventType.IncrementalSnapshot,data:__assign({source:exports.IncrementalSource.CanvasMutation},e)}))},B=new CanvasManager({recordCanvas:b,mutationCb:N,win:window,blockClass:a,mirror:mirror,sampling:y.canvas});try{XFix.getInstance();var M=[],R=window.location.href,O=function(e){(e||R!==window.location.href)&&(R=window.location.href,wrappedEmit(wrapEvent({type:exports.EventType.PageChange,data:{url:R}})))},D=function(){O(!1)};S||(M.push(on(CHANGE_STATE_EVENT,D,window)),M.push(on("hashchange",D,window)),M.push(on("popstate",D,window)),M.push(on("pageshow",(function(e){e.persisted&&O(!0)}),window)));var F=[],L=!1;S||M.push(initOtherObserver({consoleCb:function(e){var t={type:exports.EventType.Other,data:{source:OtherSource.Console,sourceData:e}};L?wrappedEmit(wrapEvent(t)):F.push(t)},networkCb:function(e){var t={type:exports.EventType.Other,data:{source:OtherSource.Network,sourceData:e}};L?wrappedEmit(wrapEvent(t)):F.push(t)}},g)),M.push(on("DOMContentLoaded",(function(){wrappedEmit(wrapEvent({type:exports.EventType.DomContentLoaded,data:{}}))})));var z=function(){var e,t;takeFullSnapshot$1(T);try{for(var n=__values(F),r=n.next();!r.done;r=n.next()){var i=r.value;wrappedEmit(wrapEvent(i))}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}L=!0,F=[],S||M.push(initObservers({mutationCb:function(e){return wrappedEmit(wrapEvent({type:exports.EventType.IncrementalSnapshot,data:__assign({source:exports.IncrementalSource.Mutation},e)}))},mousemoveCb:function(e,t){return wrappedEmit(wrapEvent({type:exports.EventType.IncrementalSnapshot,data:{source:t,positions:disposeMousemovePosition(e,A)}}))},mouseInteractionCb:function(e){return wrappedEmit(wrapEvent(disposeMouseInteraction(e,A)))},scrollCb:function(e){return wrappedEmit(wrapEvent({type:exports.EventType.IncrementalSnapshot,data:__assign({source:exports.IncrementalSource.Scroll},e)}))},viewportResizeCb:function(e){return wrappedEmit(wrapEvent({type:exports.EventType.IncrementalSnapshot,data:__assign({source:exports.IncrementalSource.ViewportResize},e)}))},inputCb:function(e){return wrappedEmit(wrapEvent({type:exports.EventType.IncrementalSnapshot,data:__assign({source:exports.IncrementalSource.Input},e)}))},mediaInteractionCb:function(e){return wrappedEmit(wrapEvent({type:exports.EventType.IncrementalSnapshot,data:__assign({source:exports.IncrementalSource.MediaInteraction},e)}))},canvasMutationCb:N,styleSheetRuleCb:function(e){return wrappedEmit(wrapEvent({type:exports.EventType.IncrementalSnapshot,data:__assign({source:exports.IncrementalSource.StyleSheetRule},e)}))},userDefinedEventCb:function(e){return wrappedEmit(wrapEvent({type:exports.EventType.IncrementalSnapshot,data:__assign({source:exports.IncrementalSource.UserDefinedEvent},e)}))},blockClass:a,blockElements:u,ignoreClass:s,asyncClass:l,maskInputOptions:k,inlineStylesheet:f,sampling:y,recordCanvas:b,canvasManager:B},g))};return"interactive"===document.readyState||"complete"===document.readyState?z():M.push(on("load",(function(){wrappedEmit(wrapEvent({type:exports.EventType.Load,data:{}})),z()}),window)),function(){M.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}function mitt$1(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)}))}}}record.addCustomEvent=function(e,t){if(!wrappedEmit)throw new Error("please add custom event after start recording");wrappedEmit(wrapEvent({type:exports.EventType.Custom,data:{tag:e,payload:t}}))},record.takeFullSnapshot=function(e,t){void 0===e&&(e={}),wrappedEmit&&takeFullSnapshot$1(e,!1,t)};var mittProxy=Object.freeze({__proto__:null,default:mitt$1});function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var n,smoothscroll=createCommonjsModule((function(e,t){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var n,r=e.HTMLElement||e.Element,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||s,scrollIntoView:r.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,o=(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):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):p.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;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");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==l(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==l(arguments[0])){var n=function(e){for(;e!==t.body&&!1===d(e);)e=e.parentNode||e.host;return e}(this),r=n.getBoundingClientRect(),a=this.getBoundingClientRect();n!==t.body?(p.call(this,n,n.scrollLeft+a.left-r.left,n.scrollTop+a.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:a.left,top:a.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+o<e.scrollHeight:"X"===t?e.clientWidth+o<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(t){var n,r,i,o,s=(a()-t.startTime)/468;o=s=s>1?1:s,n=.5*(1-Math.cos(Math.PI*o)),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(f.bind(e,t))}function p(n,r,o){var l,c,u,d,p=a();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),f({scrollable:l,method:d,startTime:p,startX:c,startY:u,x:r,y:o})}}}})),smoothscroll_1=smoothscroll.polyfill,Timer=function(){function e(e,t){void 0===t&&(t=[]),this.timeOffset=0,this.actions=t,this.config=e}return e.prototype.addAction=function(e){var t=this.findActionIndex(e);this.actions.splice(t,0,e)},e.prototype.addActions=function(e){var t;(t=this.actions).push.apply(t,__spread(e))},e.prototype.start=function(){this.actions.sort((function(e,t){return e.delay-t.delay})),this.timeOffset=0;var e=performance.now(),t=this.actions,n=this.config,r=this;this.raf=requestAnimationFrame((function i(a){for(r.timeOffset+=(a-e)*n.speed,e=a;t.length;){var o=t[0];if(!(r.timeOffset>=o.delay))break;t.shift(),o.doAction()}(t.length>0||r.config.liveMode)&&(r.raf&&cancelAnimationFrame(r.raf),r.raf=requestAnimationFrame(i))}))},e.prototype.clear=function(){this.raf&&cancelAnimationFrame(this.raf),this.actions.length=0},e.prototype.findActionIndex=function(e){for(var t=0,n=this.actions.length-1;t<=n;){var r=Math.floor((t+n)/2);if(this.actions[r].delay<e.delay)t=r+1;else{if(!(this.actions[r].delay>e.delay))return r;n=r-1}}return t},e}();function getDelay(e,t){if(e.type===exports.EventType.IncrementalSnapshot&&e.data.source===exports.IncrementalSource.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.timestamp-t}
/*! *****************************************************************************
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 t(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(n||(n={}));var e={type:"xstate.init"};function r(e){return void 0===e?[]:[].concat(e)}function o(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 u(e){return"string"==typeof e?{type:e}:e}function c(e,t){return{value:e,context:t,actions:[],changed:!1,matches:a(e)}}function f(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 s(n,o){void 0===o&&(o={});var s=t(f(r(n.states[n.initial].entry).map((function(e){return i(e,o.actions)})),n.context,e),2),l=s[0],d=s[1],p={config:n,_options:o,initialState:{value:n.initial,actions:l,context:d,matches:a(n.initial)},transition:function(e,o){var s,l,d="string"==typeof e?{value:e,context:n.context}:e,h=d.value,g=d.context,m=u(o),v=n.states[h];if(v.on){var y=r(v.on[m.type]);try{for(var I=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.")}(y),C=I.next();!C.done;C=I.next()){var b=C.value;if(void 0===b)return c(h,g);var _="string"==typeof b?{target:b}:b,A=_.target,w=_.actions,S=void 0===w?[]:w,x=_.cond,k=void 0===x?function(){return!0}:x,E=void 0===A,T=null!=A?A:h,N=n.states[T];if(k(g,m)){var B=t(f((E?r(S):[].concat(v.exit,S,N.entry).filter((function(e){return e}))).map((function(e){return i(e,p._options.actions)})),g,m),3),M=B[0],R=B[1],O=B[2],D=null!=A?A:h;return{value:D,context:R,actions:M,changed:A!==h||M.length>0||O,matches:a(D)}}}}catch(e){s={error:e}}finally{try{C&&!C.done&&(l=I.return)&&l.call(I)}finally{if(s)throw s.error}}}return c(h,g)}};return p}var l=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))};function v(t){var r=t.initialState,i=n.NotStarted,o=new Set,s={_machine:t,send:function(e){i===n.Running&&(r=t.transition(r,e),l(r,u(e)),o.forEach((function(e){return e(r)})))},subscribe:function(e){return o.add(e),e(r),{unsubscribe:function(){return o.delete(e)}}},start:function(o){if(o){var c="object"==typeof o?o:{context:t.config.context,value:o};r={value:c.value,actions:[],context:c.context,matches:a(c.value)}}return i=n.Running,l(r,e),s},stop:function(){return i=n.Stopped,o.clear(),s},get state(){return r},get status(){return i}};return s}function discardPriorSnapshots(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.type===exports.EventType.Meta&&r.timestamp<=t)return e.slice(n)}return e}function createPlayerService(e,t){var n=t.getCastFn,r=t.emitter,i=s({id:"player",context:e,initial:"inited",states:{inited:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},TO_LIVE:{target:"live",actions:["startLive"]}}},playing:{on:{PAUSE:{target:"paused",actions:["pause"]},PLAY:{target:"playing",actions:["recordTimeOffset","play"]},FAST_FORWARD:"skipping",CAST_EVENT:{target:"playing",actions:"castEvent"},ADD_EVENTS:{target:"playing",actions:["addEvents","recordTimeOffset"]}}},paused:{on:{RESUME:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},ADD_EVENTS:{target:"paused",actions:["addEvents"]}}},skipping:{on:{BACK_TO_NORMAL:"playing"}},ended:{on:{REPLAY:{target:"playing",actions:["recordTimeOffset","play"]},ADD_EVENTS:{target:"playing",actions:["addEvents","recordTimeOffset","play"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]}}}}},{actions:{castEvent:o({lastPlayedEvent:function(t,n){return"CAST_EVENT"===n.type?n.payload.event:e.lastPlayedEvent}}),recordTimeOffset:o((function(e,t){var n=e.timeOffset;return"payload"in t&&"timeOffset"in t.payload&&(n=t.payload.timeOffset),__assign(__assign({},e),{timeOffset:n,baselineTime:e.events[0].timestamp+n})})),play:function(e){var t,i,a=e.timer,o=e.events,s=e.baselineTime;e.lastPlayedEvent,a.clear();var l=discardPriorSnapshots(o,s),c=new Array,u=function(e){var t=e.timestamp<s;if(t&&!needCastInSyncMode(e))return"continue";var i=n(e,t);t?i():c.push({doAction:function(){i(),r.emit(exports.ReplayerEvents.EventCast,e)},delay:getDelay(e,s)})};try{for(var d=__values(l),f=d.next();!f.done;f=d.next()){u(f.value)}}catch(e){t={error:e}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(t)throw t.error}}r.emit(exports.ReplayerEvents.Flush),a.addActions(c),a.start()},pause:function(e){e.timer.clear()},startLive:o({baselineTime:function(e,t){return e.timer.start(),"TO_LIVE"===t.type&&t.payload.baselineTime?t.payload.baselineTime:Date.now()}}),addEvent:o((function(e,t){var i=e.baselineTime,a=e.timer,o=e.events;if("ADD_EVENT"===t.type){var s=t.payload.event;o.push(s);var l=s.timestamp<i,c=n(s,l);l?c():a.addAction({doAction:function(){c(),r.emit(exports.ReplayerEvents.EventCast,s)},delay:getDelay(s,i)})}return __assign(__assign({},e),{events:o})})),addEvents:o((function(e,t){var i,a,o=e.timer,s=e.events,l=e.baselineTime,c=e.lastPlayedEvent;if("ADD_EVENTS"===t.type){var u=t.payload.events;if(Array.isArray(u)&&u.length){s=s.concat(u);var d=discardPriorSnapshots(u,l),f=new Array,p=function(e){if(c&&c.timestamp>l&&(e.timestamp<=c.timestamp||e===c))return"continue";var t=e.timestamp<l;if(t&&!needCastInSyncMode(e))return"continue";var i=n(e,t);t?i():f.push({doAction:function(){i(),r.emit(exports.ReplayerEvents.EventCast,e)},delay:getDelay(e,l)})};try{for(var h=__values(d),g=h.next();!g.done;g=h.next()){p(g.value)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}r.emit(exports.ReplayerEvents.AddEvents),o.addActions(f)}}return __assign(__assign({},e),{events:s})}))}});return v(i)}var rules=function(e){var t=["iframe, ."+e.blockClass+" { background: #ccc }","noscript { display: none !important; }"];return"page"===e.mode&&(t.push(".mem-replayer-show { display: block !important; }"),t.push(".mem-replayer-hide { display: none !important; }"),t.push("::-webkit-scrollbar { display: none; }")),t},webGLVarMap=new Map;function variableListFor(e,t){var n=webGLVarMap.get(e);return n||(n=new Map,webGLVarMap.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}function deserializeArg(e,t,n){var r=this;return function(i){return __awaiter(r,void 0,Promise,(function(){var r,a,o,s,l,c,u,d,f,p,h;return __generator(this,(function(g){switch(g.label){case 0:return i&&"object"==typeof i&&"rr_type"in i?(n&&(n.isUnchanged=!1),"ImageBitmap"===i.rr_type&&"args"in i?[4,deserializeArg(e,t,n)(i.args)]:[3,3]):[3,11];case 1:return o=g.sent(),[4,createImageBitmap.apply(null,o)];case 2:return[2,g.sent()];case 3:return"index"in i?n||null===t?[2,i]:(a=i.rr_type,r=i.index,[2,variableListFor(t,a)[r]]):[3,4];case 4:return"args"in i?(a=i.rr_type,o=i.args,s=window[a],c=(l=s.bind).apply,u=[s],d=[[void 0]],[4,Promise.all(o.map(deserializeArg(e,t,n)))]):[3,6];case 5:return[2,new(c.apply(l,u.concat([__spread.apply(void 0,d.concat([g.sent()]))])))];case 6:return"base64"in i?[2,decode(i.base64)]:[3,7];case 7:return"src"in i?(f=e.get(i.src))?[2,f]:((p=new Image).src=i.src,e.set(i.src,p),[2,p]):[3,8];case 8:return"data"in i&&"Blob"===i.rr_type?[4,Promise.all(i.data.map(deserializeArg(e,t,n)))]:[3,10];case 9:return h=g.sent(),[2,new Blob(h,{type:i.type})];case 10:return[3,13];case 11:return Array.isArray(i)?[4,Promise.all(i.map(deserializeArg(e,t,n)))]:[3,13];case 12:return[2,g.sent()];case 13:return[2,i]}}))}))}}function getContext(e,t){try{return t===CanvasContext.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(e){return null}}var WebGLVariableConstructorsNames=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function saveToWebGLVarMap(e,t){if(null==t?void 0:t.constructor){var n=t.constructor.name;if(WebGLVariableConstructorsNames.includes(n)){var r=variableListFor(e,n);r.includes(t)||r.push(t)}}}function webglMutation(e){var t=e.mutation,n=e.target,r=e.type,i=e.imageMap,a=e.errorHandler;return __awaiter(this,void 0,Promise,(function(){var e,o,s,l,c;return __generator(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),(e=getContext(n,r))?t.setter?(e[t.property]=t.args[0],[2]):(o=e[t.property],[4,Promise.all(t.args.map(deserializeArg(i,e)))]):[2];case 1:return s=u.sent(),l=o.apply(e,s),saveToWebGLVarMap(e,l),[3,3];case 2:return c=u.sent(),a(t,c),[3,3];case 3:return[2]}}))}))}function canvasMutation$1(e){var t=e.event,n=e.mutation,r=e.target,i=e.imageMap,a=e.errorHandler;return __awaiter(this,void 0,Promise,(function(){var e,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:return c.trys.push([0,4,,5]),e=r.getContext("2d"),n.setter?(e[n.property]=n.args[0],[2]):(o=e[n.property],"drawImage"!==n.property||"string"!=typeof n.args[0]?[3,1]:(i.get(t),o.apply(e,n.args),[3,3]));case 1:return[4,Promise.all(n.args.map(deserializeArg(i,e)))];case 2:s=c.sent(),o.apply(e,s),c.label=3;case 3:return[3,5];case 4:return l=c.sent(),a(n,l),[3,5];case 5:return[2]}}))}))}function canvasMutation(e){var t=e.event,n=e.mutation,r=e.target,i=e.imageMap,a=e.canvasEventMap,o=e.errorHandler;return __awaiter(this,void 0,Promise,(function(){var e,s,l,c,u;return __generator(this,(function(d){switch(d.label){case 0:if(d.trys.push([0,10,,11]),e=a.get(t)||n,s="commands"in e?e.commands:[e],![CanvasContext.WebGL,CanvasContext.WebGL2].includes(n.type))return[3,5];l=0,d.label=1;case 1:return l<s.length?[4,webglMutation({mutation:c=s[l],type:n.type,target:r,imageMap:i,errorHandler:o})]:[3,4];case 2:d.sent(),d.label=3;case 3:return l++,[3,1];case 4:return[2];case 5:l=0,d.label=6;case 6:return l<s.length?(c=s[l],[4,canvasMutation$1({event:t,mutation:c,target:r,imageMap:i,errorHandler:o})]):[3,9];case 7:d.sent(),d.label=8;case 8:return l++,[3,6];case 9:return[3,11];case 10:return u=d.sent(),o(n,u),[3,11];case 11:return[2]}}))}))}var SKIP_TIME_THRESHOLD=1e4,SKIP_TIME_INTERVAL=5e3,FORCE_SKIP_TIME_INTERVAL=3e5,mitt=mitt$1||mittProxy,REPLAY_CONSOLE_PREFIX="[replayer]",defaultMouseTailConfig={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"},defaultConfig={normalSpeed:1,speed:1,root:document.body,loadTimeout:0,skipInactive:!1,showWarning:!0,showDebug:!1,blockClass:"mem-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,mouseTail:defaultMouseTailConfig,forceSkipInactive:!1,mode:"player"},Replayer=function(){function e(e,t){var n=this;if(this.mouseTail=null,this.tailPositions=[],this.emitter=mitt(),this.normalSpeed=-1,this.legacy_missingNodeRetryMap={},this.unloadStylesheetMap={},this.imageMap=new Map,this.canvasEventMap=new Map,!(null==t?void 0:t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");this.config=Object.assign({},defaultConfig,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.emitter.on(exports.ReplayerEvents.Resize,this.handleResize),smoothscroll_1(),polyfill(),this.setupDom(),this.treeIndex=new TreeIndex,this.fragmentParentMap=new Map,this.emitter.on(exports.ReplayerEvents.Flush,(function(){var e,t,r,i,a,o,s=n.treeIndex.flush(),l=s.scrollMap,c=s.inputMap;try{for(var u=__values(l.values()),d=u.next();!d.done;d=u.next()){var f=d.value;n.applyScroll(f)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}try{for(var p=__values(c.values()),h=p.next();!h.done;h=p.next()){f=h.value;n.applyInput(f)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}try{for(var g=__values(n.fragmentParentMap.entries()),m=g.next();!m.done;m=g.next()){var v=__read(m.value,2),y=v[0],I=v[1];mirror.map[I.__sn.id]=I,I.__sn.type===NodeType.Element&&"textarea"===I.__sn.tagName&&y.textContent&&(I.value=y.textContent),I.appendChild(y)}}catch(e){a={error:e}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(a)throw a.error}}n.fragmentParentMap.clear()})),this.emitter.on(exports.ReplayerEvents.EventCast,(function(e){n.timeDisplayer&&(n.timeDisplayer.innerText=dateFormat(new Date(e.timestamp),"yyyy/M/d hh:mm:ss"))})),this.service=createPlayerService({events:e.map((function(e){return t&&t.unpackFn?t.unpackFn(e):e})),timer:new Timer(this.config),speed:(null==t?void 0:t.speed)||defaultConfig.speed,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,emitter:this.emitter}),this.service.start(),this.service.subscribe((function(e){e.changed}));var r=this.service.state.context.events,i=r.find((function(e){return e.type===exports.EventType.Meta})),a=r.find((function(e){return e.type===exports.EventType.FullSnapshot}));if(i){var o=i.data,s=o.width,l=o.height;this.emitter.emit(exports.ReplayerEvents.Resize,{width:s,height:l})}a&&this.rebuildFullSnapshot(a)}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.normalSpeed=-1),!("normalSpeed"in e)&&"speed"in e&&(this.config.normalSpeed=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,t=e[0],n=e[e.length-1];return{startTime:t.timestamp,endTime:n.timestamp,totalTime:n.timestamp-t.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.nextUserInteractionEvent=null,this.restoreSpeed(),"ended"===this.service.state.value&&(this.service.state.context.lastPlayedEvent=null,this.service.send({type:"REPLAY",payload:{timeOffset:e}})),"paused"===this.service.state.value?this.service.send({type:"RESUME",payload:{timeOffset:e}}):this.service.send({type:"PLAY",payload:{timeOffset:e}}),this.emitter.emit(exports.ReplayerEvents.Start)},e.prototype.pause=function(){this.service.send({type:"PAUSE"}),this.emitter.emit(exports.ReplayerEvents.Pause)},e.prototype.resume=function(e){void 0===e&&(e=0),this.service.send({type:"RESUME",payload:{timeOffset:e}}),this.emitter.emit(exports.ReplayerEvents.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.addEvents=function(e){var t=this,n=e.map((function(e){return t.config.unpackFn?t.config.unpackFn(e):e}));Promise.resolve().then((function(){return t.service.send({type:"ADD_EVENTS",payload:{events: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.timeDisplayer=document.createElement("span");var e=document.createElement("div");e.classList.add("replayer-time"),e.appendChild(this.timeDisplayer),this.wrapper.appendChild(e),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 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)},e.prototype.handleResize=function(e){var t,n;this.iframe.style.display="inherit";try{for(var r=__values([this.mouseTail,this.iframe]),i=r.next();!i.done;i=r.next()){var a=i.value;a&&(a.setAttribute("width",String(e.width)),a.setAttribute("height",String(e.height)))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.getCastFn=function(e,t){var n,r=this;void 0===t&&(t=!1);var i=function(){if(!t){for(var n=r.service.state.context.events,i=0,a=0,o=n.length;a<o;a++)if(n[a]===e){i=a;break}if(r.config.forceSkipInactive)if(n[i+1]&&n[i+1].timestamp-e.timestamp>FORCE_SKIP_TIME_INTERVAL)return void r.play(n[i+1].timestamp-n[0].timestamp);if(e===r.nextUserInteractionEvent&&(r.nextUserInteractionEvent=null,r.restoreSpeed()),r.config.skipInactive&&!r.nextUserInteractionEvent){var s=r.service.state.context.events;for(a=i+1,o=s.length;a<o;a++){var l=s[a];if(r.isUserInteraction(l)||l.type===exports.EventType.FullSnapshot){l.delay-e.delay>SKIP_TIME_THRESHOLD*r.config.speed&&(r.nextUserInteractionEvent=l);break}}if(r.nextUserInteractionEvent){r.normalSpeed=r.config.normalSpeed;var c=r.nextUserInteractionEvent.delay-e.delay,u={speed:Math.min(Math.round(c/SKIP_TIME_INTERVAL),3600),normalSpeed:r.normalSpeed};r.setConfig(u),r.emitter.emit(exports.ReplayerEvents.SkipStart,u)}}}};switch(e.type){case exports.EventType.DomContentLoaded:case exports.EventType.Load:case exports.EventType.PageChange:break;case exports.EventType.Custom:n=function(){r.emitter.emit(exports.ReplayerEvents.CustomEvent,e)};break;case exports.EventType.Meta:n=function(){return r.emitter.emit(exports.ReplayerEvents.Resize,{width:e.data.width,height:e.data.height})};break;case exports.EventType.FullSnapshot:n=function(){r.rebuildFullSnapshot(e),r.iframe.contentWindow.scrollTo(e.data.initialOffset),i()};break;case exports.EventType.IncrementalSnapshot:n=function(){try{r.applyIncremental(e,t)}catch(e){console.error(e)}i()}}return function(){var t=r.service.state.context.events;n&&n(),r.service.send({type:"CAST_EVENT",payload:{event:e}}),e===t[t.length-1]&&(r.restoreSpeed(),r.service.send("END"),r.emitter.emit(exports.ReplayerEvents.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={},mirror.map=rebuild(e.data.node,this.iframe.contentDocument,!0,this.config.cdnHttps)[1];var t=document.createElement("style"),n=this.iframe.contentDocument,r=n.documentElement,i=n.head;r.insertBefore(t,i);for(var a=rules({blockClass:this.config.blockClass,mode:this.config.mode}).concat(this.config.insertStyleRules),o=0;o<a.length;o++)t.sheet.insertRule(a[o],o);this.emitter.emit(exports.ReplayerEvents.FullsnapshotRebuilded,e),"page"!==this.config.mode&&this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()},e.prototype.waitForStylesheetLoad=function(){var e,t=this,n=null===(e=this.iframe.contentDocument)||void 0===e?void 0:e.head;if(n){var r,i=new Set,a=this.service.state,o=n.querySelectorAll('link[rel="stylesheet"]');(o=Array.prototype.filter.call(o,(function(e){return!!t.unloadStylesheetMap[e.href]}))).forEach((function(e){e.sheet||(i.add(e),t.unloadStylesheetMap[e.href]=1,e.addEventListener("load",(function(){i.delete(e),0===i.size&&-1!==r&&(a.matches("playing")&&t.resume(t.getCurrentTime()),t.emitter.emit(exports.ReplayerEvents.LoadStylesheetEnd),r&&window.clearTimeout(r))})))})),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(exports.ReplayerEvents.LoadStylesheetStart),r=window.setTimeout((function(){a.matches("playing")&&t.resume(t.getCurrentTime()),r=-1}),this.config.loadTimeout))}},e.prototype.preloadAllImages=function(){return __awaiter(this,void 0,Promise,(function(){var e,t,n,r,i,a,o,s,l,c=this;return __generator(this,(function(u){this.service.state,e=function(){c.service.state},this.emitter.on(exports.ReplayerEvents.Start,e),this.emitter.on(exports.ReplayerEvents.Pause,e),t=[],n=function(e){e.type===exports.EventType.IncrementalSnapshot&&e.data.source===exports.IncrementalSource.CanvasMutation&&(t.push(r.deserializeAndPreloadCanvasEvents(e.data,e)),("commands"in e.data?e.data.commands:[e.data]).forEach((function(t){c.preloadImages(t,e)})))},r=this;try{for(i=__values(this.service.state.context.events),a=i.next();!a.done;a=i.next())o=a.value,n(o)}catch(e){s={error:e}}finally{try{a&&!a.done&&(l=i.return)&&l.call(i)}finally{if(s)throw s.error}}return[2,Promise.all(t)]}))}))},e.prototype.preloadImages=function(e,t){if("drawImage"===e.property&&"string"==typeof e.args[0]&&!this.imageMap.has(t)){var n=document.createElement("canvas"),r=n.getContext("2d"),i=null==r?void 0:r.createImageData(n.width,n.height);null==i||i.data,JSON.parse(e.args[0]),null==r||r.putImageData(i,0,0)}},e.prototype.deserializeAndPreloadCanvasEvents=function(e,t){return __awaiter(this,void 0,void 0,(function(){var n,r,i,a=this;return __generator(this,(function(o){switch(o.label){case 0:return this.canvasEventMap.has(t)?[3,4]:(n={isUnchanged:!0},"commands"in e?[4,Promise.all(e.commands.map((function(e){return __awaiter(a,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return[4,Promise.all(e.args.map(deserializeArg(this.imageMap,null,n)))];case 1:return t=r.sent(),[2,__assign(__assign({},e),{args:t})]}}))}))})))]:[3,2]);case 1:return r=o.sent(),!1===n.isUnchanged&&this.canvasEventMap.set(t,__assign(__assign({},e),{commands:r})),[3,4];case 2:return[4,Promise.all(e.args.map(deserializeArg(this.imageMap,null,n)))];case 3:i=o.sent(),!1===n.isUnchanged&&this.canvasEventMap.set(t,__assign(__assign({},e),{args:i})),o.label=4;case 4:return[2]}}))}))},e.prototype.applyIncremental=function(e,t){var n=this,r=this.service.state.context.baselineTime,i=e.data;switch(i.source){case exports.IncrementalSource.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 exports.IncrementalSource.Drag:case exports.IncrementalSource.TouchMove:case exports.IncrementalSource.MouseMove:if(t){var a=i.positions[i.positions.length-1];this.moveAndHover(i,a.x,a.y,a.id,t)}else i.positions.forEach((function(a){var o={doAction:function(){n.moveAndHover(i,a.x,a.y,a.id,t)},delay:a.timeOffset+e.timestamp-r};n.timer.addAction(o)}));break;case exports.IncrementalSource.MouseInteraction:if(-1===i.id)break;var o=new Event(exports.MouseInteractions[i.type].toLowerCase());if(!(c=mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);this.emitter.emit(exports.ReplayerEvents.MouseInteraction,{type:i.type,target:c});var s=this.config.triggerFocus;switch(i.type){case exports.MouseInteractions.Blur:"blur"in c&&c.blur();break;case exports.MouseInteractions.Focus:s&&c.focus&&c.focus({preventScroll:!0});break;case exports.MouseInteractions.Click:case exports.MouseInteractions.TouchStart:case exports.MouseInteractions.TouchEnd:t||(this.moveAndHover(i,i.x,i.y,i.id,t),this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active"));break;default:c.dispatchEvent(o)}break;case exports.IncrementalSource.Scroll:if(-1===i.id)break;if(t){this.treeIndex.scroll(i);break}this.applyScroll(i);break;case exports.IncrementalSource.ViewportResize:i.rotate&&this.emitter.emit(exports.ReplayerEvents.Resize,{width:i.width,height:i.height});break;case exports.IncrementalSource.Input:if(-1===i.id)break;if(t){this.treeIndex.input(i);break}this.applyInput(i);break;case exports.IncrementalSource.StyleSheetRule:if(!(c=mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);var l=c.sheet;i.adds&&i.adds.forEach((function(e){var t=e.rule,n=e.index,r=void 0===n?void 0:Math.min(n,l.rules.length);try{l.insertRule(t,r)}catch(e){}})),i.removes&&i.removes.forEach((function(e){var t=e.index;l.deleteRule(t)}));break;case exports.IncrementalSource.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;var c;if(!(c=mirror.getNode(i.id)))return this.debugNodeNotFound(i,i.id);canvasMutation({event:e,mutation:i,target:c,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)});break;case exports.IncrementalSource.UserDefinedEvent:if(i.evt===UserDefinedEvent.LivePlay){var u=this.iframe.contentDocument;if(!u||!i.selector||!i.url)return;var d=u.querySelector(i.selector);if(d&&d.tagName&&"video"===d.tagName.toLowerCase()){d.setAttribute("src",i.url),d.play();var f=new CustomEvent("memento-player-live-play",{detail:{target:d},bubbles:!0,cancelable:!0});window.document.dispatchEvent(f)}}}},e.prototype.applyMutation=function(e,t){var n=this;e.removes.forEach((function(t){var r=mirror.getNode(t.id);if(!r)return n.warnNodeNotFound(e,t.id);var i=mirror.getNode(t.parentId);if(!i)return n.warnNodeNotFound(e,t.parentId);if(mirror.removeNodeFromMap(r),i){var a=n.fragmentParentMap.get(i)||i,o=n.fragmentParentMap.get(r)||r;a.contains(o)?a.removeChild(o):console.warn("=====target: "+t.id+" dont exist in parent: "+t.parentId+"======, ")}}));var r=__assign({},this.legacy_missingNodeRetryMap),i=[],a=function(e){if(!n.iframe.contentDocument)return console.warn("Looks like your replayer has been destroyed.");var a=mirror.getNode(e.parentId);if(!a)return i.push(e);var o=n.iframe.contentDocument.contains(a);if(t&&o){var s=document.createDocumentFragment();for(mirror.map[e.parentId]=s,n.fragmentParentMap.set(s,a);a.firstChild;)s.appendChild(a.firstChild);a=s}var l=null,c=null;if(e.previousId&&(l=mirror.getNode(e.previousId)),e.nextId&&(c=mirror.getNode(e.nextId)),null!==e.nextId&&-1!==e.nextId&&!c)return i.push(e);if(!mirror.has(e.node.id)){var u=buildNodeWithSN(e.node,n.iframe.contentDocument,mirror.map,!0,!0,n.config.cdnHttps);-1!==e.previousId&&-1!==e.nextId?(l&&l.nextSibling&&l.nextSibling.parentNode?a.insertBefore(u,l.nextSibling):c&&c.parentNode?a.contains(c)?a.insertBefore(u,c):a.insertBefore(u,null):a.appendChild(u),(e.previousId||e.nextId)&&n.legacy_resolveMissingNode(r,a,u,e)):r[e.node.id]={node:u,mutation:e}}};for(e.adds.forEach((function(e){a(e)}));i.length;){if(i.every((function(e){return!Boolean(mirror.getNode(e.parentId))})))return i.forEach((function(t){return n.warnNodeNotFound(e,t.node.id)}));var o=i.shift();a(o)}Object.keys(r).length&&Object.assign(this.legacy_missingNodeRetryMap,r),e.texts.forEach((function(t){var r=mirror.getNode(t.id);if(!r)return n.warnNodeNotFound(e,t.id);n.fragmentParentMap.has(r)&&(r=n.fragmentParentMap.get(r)),r.textContent=t.value})),e.attributes.forEach((function(t){var r=mirror.getNode(t.id);if(!r)return n.warnNodeNotFound(e,t.id);for(var i in n.fragmentParentMap.has(r)&&(r=n.fragmentParentMap.get(r)),t.attributes)if("string"==typeof i){if(t.attributes.hasOwnProperty("_memimage_"+i))continue;var a=t.attributes[i];i=i.replace("_memimage_",""),null!==a?"video"===r.tagName&&"mem_placeholder"===i?r.style.background="center / cover no-repeat url("+a+")":r.setAttribute(i,a):r.removeAttribute(i)}}))},e.prototype.applyScroll=function(e){var t=mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);if(t===this.iframe.contentDocument)this.iframe.contentWindow.scrollTo({top:e.y,left:e.x,behavior:"smooth"});else try{t.scrollTop=e.y,t.scrollLeft=e.x}catch(e){}},e.prototype.applyInput=function(e){var t=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.legacy_resolveMissingNode=function(e,t,n,r){var i=r.previousId,a=r.nextId,o=i&&e[i],s=a&&e[a];if(o){var l=o,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){this.mouse.style.left=t+"px",this.mouse.style.top=n+"px";var a=mirror.getNode(r);if(!a)return this.debugNodeNotFound(e,r);var o=getBaseDimension(a,this.iframe),s=t*o.absoluteScale+o.x,l=n*o.absoluteScale+o.y;this.mouse.style.left=s+"px",this.mouse.style.top=l+"px",i||this.drawMouseTail({x:s,y:l}),this.hoverElements(a)},e.prototype.drawMouseTail=function(e){var t=this;if(this.mouseTail){var n=!0===this.config.mouseTail?defaultMouseTailConfig:Object.assign({},defaultMouseTailConfig,this.config.mouseTail),r=n.lineCap,i=n.lineWidth,a=n.strokeStyle,o=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=a,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()}),o/this.config.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===exports.EventType.IncrementalSnapshot&&(e.data.source>exports.IncrementalSource.Mutation&&e.data.source<=exports.IncrementalSource.Input)},e.prototype.restoreSpeed=function(){if(-1!==this.normalSpeed){var e={speed:this.normalSpeed};this.setConfig(e),this.emitter.emit(exports.ReplayerEvents.SkipEnd,e),this.normalSpeed=-1}},e.prototype.warnNodeNotFound=function(e,t){this.config.showWarning&&console.warn(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e.prototype.warnCanvasMutationFailed=function(e,t){console.warn("Has error on canvas update",t,"canvas mutation:",e)},e.prototype.debugNodeNotFound=function(e,t){this.config.showDebug&&console.log(REPLAY_CONSOLE_PREFIX,"Node with id '"+t+"' not found in",e)},e}(),pako_deflate=createCommonjsModule((function(e,t){e.exports=function(){function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var l="function"==typeof commonjsRequire&&commonjsRequire;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[o]={exports:{}};t[o][0].call(u.exports,(function(e){return i(t[o][1][e]||e)}),u,u.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof commonjsRequire&&commonjsRequire,o=0;o<r.length;o++)i(r[o]);return i}return e}()({1:[function(e,t,n){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(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 r in n)i(n,r)&&(e[r]=n[r])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var a={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r,i,a,o;for(r=0,t=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o}},o={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,a)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(r)},{}],2:[function(e,t,n){var r=e("./common"),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var o=new r.Buf8(256),s=0;s<256;s++)o[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&&a||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",o=0;o<t;o++)n+=String.fromCharCode(e[o]);return n}o[254]=o[254]=1,n.string2buf=function(e){var t,n,i,a,o,s=e.length,l=0;for(a=0;a<s;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(l),o=0,a=0;o<l;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},n.buf2binstring=function(e){return l(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,i,a,s=t||e.length,c=new Array(2*s);for(r=0,n=0;n<s;)if((i=e[n++])<128)c[r++]=i;else if((a=o[i])>4)c[r++]=65533,n+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&n<s;)i=i<<6|63&e[n++],a--;a>1?c[r++]=65533:i<65536?c[r++]=i:(i-=65536,c[r++]=55296|i>>10&1023,c[r++]=56320|1023&i)}return l(c,r)},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+o[e[n]]>t?n:t}},{"./common":1}],3:[function(e,t,n){function r(e,t,n,r){for(var i=65535&e,a=e>>>16&65535,o=0;0!==n;){n-=o=n>2e3?2e3:n;do{a=a+(i=i+t[r++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16}t.exports=r},{}],4:[function(e,t,n){function r(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}var i=r();function a(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s<o;s++)e=e>>>8^a[255&(e^t[s])];return~e}t.exports=a},{}],5:[function(e,t,n){var r,i=e("../utils/common"),a=e("./trees"),o=e("./adler32"),s=e("./crc32"),l=e("./messages"),c=0,u=1,d=3,f=4,p=5,h=0,g=1,m=-2,v=-3,y=-5,I=-1,C=1,b=2,_=3,A=4,w=0,S=2,x=8,k=9,E=15,T=8,N=286,B=30,M=19,R=2*N+1,O=15,D=3,F=258,L=F+D+1,z=32,W=42,G=69,Z=73,V=91,U=103,H=113,P=666,K=1,X=2,Y=3,j=4,J=3;function q(e,t){return e.msg=l[t],t}function Q(e){return(e<<1)-(e>4?9:0)}function $(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function te(e,t){a._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function ne(e,t){e.pending_buf[e.pending++]=t}function re(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ie(e,t,n,r){var a=e.avail_in;return a>r&&(a=r),0===a?0:(e.avail_in-=a,i.arraySet(t,e.input,e.next_in,a,n),1===e.state.wrap?e.adler=o(e.adler,t,a,n):2===e.state.wrap&&(e.adler=s(e.adler,t,a,n)),e.next_in+=a,e.total_in+=a,a)}function ae(e,t){var n,r,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-L?e.strstart-(e.w_size-L):0,c=e.window,u=e.w_mask,d=e.prev,f=e.strstart+F,p=c[a+o-1],h=c[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(n=t)+o]===h&&c[n+o-1]===p&&c[n]===c[a]&&c[++n]===c[a+1]){a+=2,n++;do{}while(c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&c[++a]===c[++n]&&a<f);if(r=F-(f-a),a=f-F,r>o){if(e.match_start=t,o=r,r>=s)break;p=c[a+o-1],h=c[a+o]}}}while((t=d[t&u])>l&&0!=--i);return o<=e.lookahead?o:e.lookahead}function oe(e){var t,n,r,a,o,s=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=s+(s-L)){i.arraySet(e.window,e.window,s,s,0),e.match_start-=s,e.strstart-=s,e.block_start-=s,t=n=e.hash_size;do{r=e.head[--t],e.head[t]=r>=s?r-s:0}while(--n);t=n=s;do{r=e.prev[--t],e.prev[t]=r>=s?r-s:0}while(--n);a+=s}if(0===e.strm.avail_in)break;if(n=ie(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=n,e.lookahead+e.insert>=D)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+D-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<D)););}while(e.lookahead<L&&0!==e.strm.avail_in)}function se(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(oe(e),0===e.lookahead&&t===c)return K;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,te(e,!1),0===e.strm.avail_out))return K;if(e.strstart-e.block_start>=e.w_size-L&&(te(e,!1),0===e.strm.avail_out))return K}return e.insert=0,t===f?(te(e,!0),0===e.strm.avail_out?Y:j):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),K)}function le(e,t){for(var n,r;;){if(e.lookahead<L){if(oe(e),e.lookahead<L&&t===c)return K;if(0===e.lookahead)break}if(n=0,e.lookahead>=D&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+D-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-L&&(e.match_length=ae(e,n)),e.match_length>=D)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-D),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=D){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+D-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(te(e,!1),0===e.strm.avail_out))return K}return e.insert=e.strstart<D-1?e.strstart:D-1,t===f?(te(e,!0),0===e.strm.avail_out?Y:j):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?K:X}function ce(e,t){for(var n,r,i;;){if(e.lookahead<L){if(oe(e),e.lookahead<L&&t===c)return K;if(0===e.lookahead)break}if(n=0,e.lookahead>=D&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+D-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=D-1,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-L&&(e.match_length=ae(e,n),e.match_length<=5&&(e.strategy===C||e.match_length===D&&e.strstart-e.match_start>4096)&&(e.match_length=D-1)),e.prev_length>=D&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-D,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-D),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+D-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=D-1,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return K}else if(e.match_available){if((r=a._tr_tally(e,0,e.window[e.strstart-1]))&&te(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return K}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=a._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<D-1?e.strstart:D-1,t===f?(te(e,!0),0===e.strm.avail_out?Y:j):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?K:X}function ue(e,t){for(var n,r,i,o,s=e.window;;){if(e.lookahead<=F){if(oe(e),e.lookahead<=F&&t===c)return K;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=D&&e.strstart>0&&(r=s[i=e.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){o=e.strstart+F;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<o);e.match_length=F-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=D?(n=a._tr_tally(e,1,e.match_length-D),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(te(e,!1),0===e.strm.avail_out))return K}return e.insert=0,t===f?(te(e,!0),0===e.strm.avail_out?Y:j):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?K:X}function de(e,t){for(var n;;){if(0===e.lookahead&&(oe(e),0===e.lookahead)){if(t===c)return K;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(te(e,!1),0===e.strm.avail_out))return K}return e.insert=0,t===f?(te(e,!0),0===e.strm.avail_out?Y:j):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?K:X}function fe(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function pe(e){e.window_size=2*e.w_size,$(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=D-1,e.match_available=0,e.ins_h=0}function he(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=x,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*R),this.dyn_dtree=new i.Buf16(2*(2*B+1)),this.bl_tree=new i.Buf16(2*(2*M+1)),$(this.dyn_ltree),$(this.dyn_dtree),$(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(O+1),this.heap=new i.Buf16(2*N+1),$(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*N+1),$(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ge(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=S,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?W:H,e.adler=2===t.wrap?0:1,t.last_flush=c,a._tr_init(t),h):q(e,m)}function me(e){var t=ge(e);return t===h&&pe(e.state),t}function ve(e,t){return e&&e.state?2!==e.state.wrap?m:(e.state.gzhead=t,h):m}function ye(e,t,n,r,a,o){if(!e)return m;var s=1;if(t===I&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),a<1||a>k||n!==x||r<8||r>15||t<0||t>9||o<0||o>A)return q(e,m);8===r&&(r=9);var l=new he;return e.state=l,l.strm=e,l.wrap=s,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=a+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+D-1)/D),l.window=new i.Buf8(2*l.w_size),l.head=new i.Buf16(l.hash_size),l.prev=new i.Buf16(l.w_size),l.lit_bufsize=1<<a+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new i.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=o,l.method=n,me(e)}function Ie(e,t){return ye(e,t,x,E,T,w)}function Ce(e,t){var n,i,o,l;if(!e||!e.state||t>p||t<0)return e?q(e,m):m;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===P&&t!==f)return q(e,0===e.avail_out?y:m);if(i.strm=e,n=i.last_flush,i.last_flush=t,i.status===W)if(2===i.wrap)e.adler=0,ne(i,31),ne(i,139),ne(i,8),i.gzhead?(ne(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),ne(i,255&i.gzhead.time),ne(i,i.gzhead.time>>8&255),ne(i,i.gzhead.time>>16&255),ne(i,i.gzhead.time>>24&255),ne(i,9===i.level?2:i.strategy>=b||i.level<2?4:0),ne(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(ne(i,255&i.gzhead.extra.length),ne(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=G):(ne(i,0),ne(i,0),ne(i,0),ne(i,0),ne(i,0),ne(i,9===i.level?2:i.strategy>=b||i.level<2?4:0),ne(i,J),i.status=H);else{var v=x+(i.w_bits-8<<4)<<8;v|=(i.strategy>=b||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(v|=z),v+=31-v%31,i.status=H,re(i,v),0!==i.strstart&&(re(i,e.adler>>>16),re(i,65535&e.adler)),e.adler=1}if(i.status===G)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),ee(e),o=i.pending,i.pending!==i.pending_buf_size));)ne(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Z)}else i.status=Z;if(i.status===Z)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),ee(e),o=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,ne(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===l&&(i.gzindex=0,i.status=V)}else i.status=V;if(i.status===V)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),ee(e),o=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,ne(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===l&&(i.status=U)}else i.status=U;if(i.status===U&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&ee(e),i.pending+2<=i.pending_buf_size&&(ne(i,255&e.adler),ne(i,e.adler>>8&255),e.adler=0,i.status=H)):i.status=H),0!==i.pending){if(ee(e),0===e.avail_out)return i.last_flush=-1,h}else if(0===e.avail_in&&Q(t)<=Q(n)&&t!==f)return q(e,y);if(i.status===P&&0!==e.avail_in)return q(e,y);if(0!==e.avail_in||0!==i.lookahead||t!==c&&i.status!==P){var I=i.strategy===b?de(i,t):i.strategy===_?ue(i,t):r[i.level].func(i,t);if(I!==Y&&I!==j||(i.status=P),I===K||I===Y)return 0===e.avail_out&&(i.last_flush=-1),h;if(I===X&&(t===u?a._tr_align(i):t!==p&&(a._tr_stored_block(i,0,0,!1),t===d&&($(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),ee(e),0===e.avail_out))return i.last_flush=-1,h}return t!==f?h:i.wrap<=0?g:(2===i.wrap?(ne(i,255&e.adler),ne(i,e.adler>>8&255),ne(i,e.adler>>16&255),ne(i,e.adler>>24&255),ne(i,255&e.total_in),ne(i,e.total_in>>8&255),ne(i,e.total_in>>16&255),ne(i,e.total_in>>24&255)):(re(i,e.adler>>>16),re(i,65535&e.adler)),ee(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?h:g)}function be(e){var t;return e&&e.state?(t=e.state.status)!==W&&t!==G&&t!==Z&&t!==V&&t!==U&&t!==H&&t!==P?q(e,m):(e.state=null,t===H?q(e,v):h):m}function _e(e,t){var n,r,a,s,l,c,u,d,f=t.length;if(!e||!e.state)return m;if(2===(s=(n=e.state).wrap)||1===s&&n.status!==W||n.lookahead)return m;for(1===s&&(e.adler=o(e.adler,t,f,0)),n.wrap=0,f>=n.w_size&&(0===s&&($(n.head),n.strstart=0,n.block_start=0,n.insert=0),d=new i.Buf8(n.w_size),i.arraySet(d,t,f-n.w_size,n.w_size,0),t=d,f=n.w_size),l=e.avail_in,c=e.next_in,u=e.input,e.avail_in=f,e.next_in=0,e.input=t,oe(n);n.lookahead>=D;){r=n.strstart,a=n.lookahead-(D-1);do{n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+D-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++}while(--a);n.strstart=r,n.lookahead=D-1,oe(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=D-1,n.match_available=0,e.next_in=c,e.input=u,e.avail_in=l,n.wrap=s,h}r=[new fe(0,0,0,0,se),new fe(4,4,8,4,le),new fe(4,5,16,8,le),new fe(4,6,32,32,le),new fe(4,4,16,16,ce),new fe(8,16,32,32,ce),new fe(8,16,128,128,ce),new fe(8,32,128,256,ce),new fe(32,128,258,1024,ce),new fe(32,258,258,4096,ce)],n.deflateInit=Ie,n.deflateInit2=ye,n.deflateReset=me,n.deflateResetKeep=ge,n.deflateSetHeader=ve,n.deflate=Ce,n.deflateEnd=be,n.deflateSetDictionary=_e,n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":4,"./messages":6,"./trees":7}],6:[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"}},{}],7:[function(e,t,n){var r=e("../utils/common"),i=4,a=0,o=1,s=2;function l(e){for(var t=e.length;--t>=0;)e[t]=0}var c=0,u=1,d=2,f=3,p=258,h=29,g=256,m=g+1+h,v=30,y=19,I=2*m+1,C=15,b=16,_=7,A=256,w=16,S=17,x=18,k=[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],E=[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],T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],B=512,M=new Array(2*(m+2));l(M);var R=new Array(2*v);l(R);var O=new Array(B);l(O);var D=new Array(p-f+1);l(D);var F=new Array(h);l(F);var L,z,W,G=new Array(v);function Z(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function V(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function U(e){return e<256?O[e]:O[256+(e>>>7)]}function H(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function P(e,t,n){e.bi_valid>b-n?(e.bi_buf|=t<<e.bi_valid&65535,H(e,e.bi_buf),e.bi_buf=t>>b-e.bi_valid,e.bi_valid+=n-b):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function K(e,t,n){P(e,n[2*t],n[2*t+1])}function X(e,t){var n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}function Y(e){16===e.bi_valid?(H(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}function j(e,t){var n,r,i,a,o,s,l=t.dyn_tree,c=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,h=t.stat_desc.max_length,g=0;for(a=0;a<=C;a++)e.bl_count[a]=0;for(l[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<I;n++)(a=l[2*l[2*(r=e.heap[n])+1]+1]+1)>h&&(a=h,g++),l[2*r+1]=a,r>c||(e.bl_count[a]++,o=0,r>=p&&(o=f[r-p]),s=l[2*r],e.opt_len+=s*(a+o),d&&(e.static_len+=s*(u[2*r+1]+o)));if(0!==g){do{for(a=h-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[h]--,g-=2}while(g>0);for(a=h;0!==a;a--)for(r=e.bl_count[a];0!==r;)(i=e.heap[--n])>c||(l[2*i+1]!==a&&(e.opt_len+=(a-l[2*i+1])*l[2*i],l[2*i+1]=a),r--)}}function J(e,t,n){var r,i,a=new Array(C+1),o=0;for(r=1;r<=C;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=X(a[s]++,s))}}function q(){var e,t,n,r,i,a=new Array(C+1);for(n=0,r=0;r<h-1;r++)for(F[r]=n,e=0;e<1<<k[r];e++)D[n++]=r;for(D[n-1]=r,i=0,r=0;r<16;r++)for(G[r]=i,e=0;e<1<<E[r];e++)O[i++]=r;for(i>>=7;r<v;r++)for(G[r]=i<<7,e=0;e<1<<E[r]-7;e++)O[256+i++]=r;for(t=0;t<=C;t++)a[t]=0;for(e=0;e<=143;)M[2*e+1]=8,e++,a[8]++;for(;e<=255;)M[2*e+1]=9,e++,a[9]++;for(;e<=279;)M[2*e+1]=7,e++,a[7]++;for(;e<=287;)M[2*e+1]=8,e++,a[8]++;for(J(M,m+1,a),e=0;e<v;e++)R[2*e+1]=5,R[2*e]=X(e,5);L=new Z(M,k,g+1,m,C),z=new Z(R,E,0,v,C),W=new Z(new Array(0),T,0,y,_)}function Q(e){var t;for(t=0;t<m;t++)e.dyn_ltree[2*t]=0;for(t=0;t<v;t++)e.dyn_dtree[2*t]=0;for(t=0;t<y;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*A]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function $(e){e.bi_valid>8?H(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function ee(e,t,n,i){$(e),i&&(H(e,n),H(e,~n)),r.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function te(e,t,n,r){var i=2*t,a=2*n;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function ne(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&te(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!te(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function re(e,t,n){var r,i,a,o,s=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===r?K(e,i,t):(K(e,(a=D[i])+g+1,t),0!==(o=k[a])&&P(e,i-=F[a],o),K(e,a=U(--r),n),0!==(o=E[a])&&P(e,r-=G[a],o))}while(s<e.last_lit);K(e,A,t)}function ie(e,t){var n,r,i,a=t.dyn_tree,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,l=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=I,n=0;n<l;n++)0!==a[2*n]?(e.heap[++e.heap_len]=c=n,e.depth[n]=0):a[2*n+1]=0;for(;e.heap_len<2;)a[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=o[2*i+1]);for(t.max_code=c,n=e.heap_len>>1;n>=1;n--)ne(e,a,n);i=l;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ne(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,ne(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],j(e,t),J(a,c,e.bl_count)}function ae(e,t,n){var r,i,a=-1,o=t[1],s=0,l=7,c=4;for(0===o&&(l=138,c=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=o,o=t[2*(r+1)+1],++s<l&&i===o||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==a&&e.bl_tree[2*i]++,e.bl_tree[2*w]++):s<=10?e.bl_tree[2*S]++:e.bl_tree[2*x]++,s=0,a=i,0===o?(l=138,c=3):i===o?(l=6,c=3):(l=7,c=4))}function oe(e,t,n){var r,i,a=-1,o=t[1],s=0,l=7,c=4;for(0===o&&(l=138,c=3),r=0;r<=n;r++)if(i=o,o=t[2*(r+1)+1],!(++s<l&&i===o)){if(s<c)do{K(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==a&&(K(e,i,e.bl_tree),s--),K(e,w,e.bl_tree),P(e,s-3,2)):s<=10?(K(e,S,e.bl_tree),P(e,s-3,3)):(K(e,x,e.bl_tree),P(e,s-11,7));s=0,a=i,0===o?(l=138,c=3):i===o?(l=6,c=3):(l=7,c=4)}}function se(e){var t;for(ae(e,e.dyn_ltree,e.l_desc.max_code),ae(e,e.dyn_dtree,e.d_desc.max_code),ie(e,e.bl_desc),t=y-1;t>=3&&0===e.bl_tree[2*N[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}function le(e,t,n,r){var i;for(P(e,t-257,5),P(e,n-1,5),P(e,r-4,4),i=0;i<r;i++)P(e,e.bl_tree[2*N[i]+1],3);oe(e,e.dyn_ltree,t-1),oe(e,e.dyn_dtree,n-1)}function ce(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return a;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return o;for(t=32;t<g;t++)if(0!==e.dyn_ltree[2*t])return o;return a}l(G);var ue=!1;function de(e){ue||(q(),ue=!0),e.l_desc=new V(e.dyn_ltree,L),e.d_desc=new V(e.dyn_dtree,z),e.bl_desc=new V(e.bl_tree,W),e.bi_buf=0,e.bi_valid=0,Q(e)}function fe(e,t,n,r){P(e,(c<<1)+(r?1:0),3),ee(e,t,n,!0)}function pe(e){P(e,u<<1,3),K(e,A,M),Y(e)}function he(e,t,n,r){var a,o,l=0;e.level>0?(e.strm.data_type===s&&(e.strm.data_type=ce(e)),ie(e,e.l_desc),ie(e,e.d_desc),l=se(e),a=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=a&&(a=o)):a=o=n+5,n+4<=a&&-1!==t?fe(e,t,n,r):e.strategy===i||o===a?(P(e,(u<<1)+(r?1:0),3),re(e,M,R)):(P(e,(d<<1)+(r?1:0),3),le(e,e.l_desc.max_code+1,e.d_desc.max_code+1,l+1),re(e,e.dyn_ltree,e.dyn_dtree)),Q(e),r&&$(e)}function ge(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(D[n]+g+1)]++,e.dyn_dtree[2*U(t)]++),e.last_lit===e.lit_bufsize-1}n._tr_init=de,n._tr_stored_block=fe,n._tr_flush_block=he,n._tr_tally=ge,n._tr_align=pe},{"../utils/common":1}],8:[function(e,t,n){function r(){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}t.exports=r},{}],"/lib/deflate.js":[function(e,t,n){var r=e("./zlib/deflate"),i=e("./utils/common"),a=e("./utils/strings"),o=e("./zlib/messages"),s=e("./zlib/zstream"),l=Object.prototype.toString,c=0,u=4,d=0,f=1,p=2,h=-1,g=0,m=8;function v(e){if(!(this instanceof v))return new v(e);this.options=i.assign({level:h,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:g,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==d)throw new Error(o[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var c;if(c="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(n=r.deflateSetDictionary(this.strm,c))!==d)throw new Error(o[n]);this._dict_set=!0}}function y(e,t){var n=new v(t);if(n.push(e,!0),n.err)throw n.msg||o[n.err];return n.result}function I(e,t){return(t=t||{}).raw=!0,y(e,t)}function C(e,t){return(t=t||{}).gzip=!0,y(e,t)}v.prototype.push=function(e,t){var n,o,s=this.strm,h=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?u:c,"string"==typeof e?s.input=a.string2buf(e):"[object ArrayBuffer]"===l.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(h),s.next_out=0,s.avail_out=h),(n=r.deflate(s,o))!==f&&n!==d)return this.onEnd(n),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||o!==u&&o!==p)||("string"===this.options.to?this.onData(a.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&n!==f);return o===u?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===d):o!==p||(this.onEnd(d),s.avail_out=0,!0)},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===d&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=v,n.deflate=y,n.deflateRaw=I,n.gzip=C},{"./utils/common":1,"./utils/strings":2,"./zlib/deflate":5,"./zlib/messages":6,"./zlib/zstream":8}]},{},[])("/lib/deflate.js")})),pako_deflate_1=pako_deflate.deflate,MARK="v1",pack=function(e){var t=__assign(__assign({},e),{v:MARK});return pako_deflate_1(JSON.stringify(t),{to:"string"})},pako_inflate=createCommonjsModule((function(e,t){e.exports=function(){function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var l="function"==typeof commonjsRequire&&commonjsRequire;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[o]={exports:{}};t[o][0].call(u.exports,(function(e){return i(t[o][1][e]||e)}),u,u.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof commonjsRequire&&commonjsRequire,o=0;o<r.length;o++)i(r[o]);return i}return e}()({1:[function(e,t,n){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(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 r in n)i(n,r)&&(e[r]=n[r])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var a={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r,i,a,o;for(r=0,t=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o}},o={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,a)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(r)},{}],2:[function(e,t,n){var r=e("./common"),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var o=new r.Buf8(256),s=0;s<256;s++)o[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&&a||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",o=0;o<t;o++)n+=String.fromCharCode(e[o]);return n}o[254]=o[254]=1,n.string2buf=function(e){var t,n,i,a,o,s=e.length,l=0;for(a=0;a<s;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(l),o=0,a=0;o<l;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},n.buf2binstring=function(e){return l(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,i,a,s=t||e.length,c=new Array(2*s);for(r=0,n=0;n<s;)if((i=e[n++])<128)c[r++]=i;else if((a=o[i])>4)c[r++]=65533,n+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&n<s;)i=i<<6|63&e[n++],a--;a>1?c[r++]=65533:i<65536?c[r++]=i:(i-=65536,c[r++]=55296|i>>10&1023,c[r++]=56320|1023&i)}return l(c,r)},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+o[e[n]]>t?n:t}},{"./common":1}],3:[function(e,t,n){function r(e,t,n,r){for(var i=65535&e,a=e>>>16&65535,o=0;0!==n;){n-=o=n>2e3?2e3:n;do{a=a+(i=i+t[r++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16}t.exports=r},{}],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){function r(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}var i=r();function a(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s<o;s++)e=e>>>8^a[255&(e^t[s])];return~e}t.exports=a},{}],6:[function(e,t,n){function r(){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}t.exports=r},{}],7:[function(e,t,n){var r=30,i=12;t.exports=function(e,t){var n,a,o,s,l,c,u,d,f,p,h,g,m,v,y,I,C,b,_,A,w,S,x,k,E;n=e.state,a=e.next_in,k=e.input,o=a+(e.avail_in-5),s=e.next_out,E=e.output,l=s-(t-e.avail_out),c=s+(e.avail_out-257),u=n.dmax,d=n.wsize,f=n.whave,p=n.wnext,h=n.window,g=n.hold,m=n.bits,v=n.lencode,y=n.distcode,I=(1<<n.lenbits)-1,C=(1<<n.distbits)-1;e:do{m<15&&(g+=k[a++]<<m,m+=8,g+=k[a++]<<m,m+=8),b=v[g&I];t:for(;;){if(g>>>=_=b>>>24,m-=_,0==(_=b>>>16&255))E[s++]=65535&b;else{if(!(16&_)){if(64&_){if(32&_){n.mode=i;break e}e.msg="invalid literal/length code",n.mode=r;break e}b=v[(65535&b)+(g&(1<<_)-1)];continue t}for(A=65535&b,(_&=15)&&(m<_&&(g+=k[a++]<<m,m+=8),A+=g&(1<<_)-1,g>>>=_,m-=_),m<15&&(g+=k[a++]<<m,m+=8,g+=k[a++]<<m,m+=8),b=y[g&C];;){if(g>>>=_=b>>>24,m-=_,16&(_=b>>>16&255)){if(w=65535&b,m<(_&=15)&&(g+=k[a++]<<m,(m+=8)<_&&(g+=k[a++]<<m,m+=8)),(w+=g&(1<<_)-1)>u){e.msg="invalid distance too far back",n.mode=r;break e}if(g>>>=_,m-=_,w>(_=s-l)){if((_=w-_)>f&&n.sane){e.msg="invalid distance too far back",n.mode=r;break e}if(S=0,x=h,0===p){if(S+=d-_,_<A){A-=_;do{E[s++]=h[S++]}while(--_);S=s-w,x=E}}else if(p<_){if(S+=d+p-_,(_-=p)<A){A-=_;do{E[s++]=h[S++]}while(--_);if(S=0,p<A){A-=_=p;do{E[s++]=h[S++]}while(--_);S=s-w,x=E}}}else if(S+=p-_,_<A){A-=_;do{E[s++]=h[S++]}while(--_);S=s-w,x=E}for(;A>2;)E[s++]=x[S++],E[s++]=x[S++],E[s++]=x[S++],A-=3;A&&(E[s++]=x[S++],A>1&&(E[s++]=x[S++]))}else{S=s-w;do{E[s++]=E[S++],E[s++]=E[S++],E[s++]=E[S++],A-=3}while(A>2);A&&(E[s++]=E[S++],A>1&&(E[s++]=E[S++]))}break}if(64&_){e.msg="invalid distance code",n.mode=r;break e}b=y[(65535&b)+(g&(1<<_)-1)]}}break}}while(a<o&&s<c);a-=A=m>>3,g&=(1<<(m-=A<<3))-1,e.next_in=a,e.next_out=s,e.avail_in=a<o?o-a+5:5-(a-o),e.avail_out=s<c?c-s+257:257-(s-c),n.hold=g,n.bits=m}},{}],8:[function(e,t,n){var r=e("../utils/common"),i=e("./adler32"),a=e("./crc32"),o=e("./inffast"),s=e("./inftrees"),l=0,c=1,u=2,d=4,f=5,p=6,h=0,g=1,m=2,v=-2,y=-3,I=-4,C=-5,b=8,_=1,A=2,w=3,S=4,x=5,k=6,E=7,T=8,N=9,B=10,M=11,R=12,O=13,D=14,F=15,L=16,z=17,W=18,G=19,Z=20,V=21,U=22,H=23,P=24,K=25,X=26,Y=27,j=28,J=29,q=30,Q=31,$=852,ee=592,te=15;function ne(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function re(){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 r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ie(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=_,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32($),t.distcode=t.distdyn=new r.Buf32(ee),t.sane=1,t.back=-1,h):v}function ae(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):v}function oe(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?v:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,ae(e))):v}function se(e,t){var n,r;return e?(r=new re,e.state=r,r.window=null,(n=oe(e,t))!==h&&(e.state=null),n):v}function le(e){return se(e,te)}var ce,ue,de=!0;function fe(e){if(de){var t;for(ce=new r.Buf32(512),ue=new r.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(c,e.lens,0,288,ce,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(u,e.lens,0,32,ue,0,e.work,{bits:5}),de=!1}e.lencode=ce,e.lenbits=9,e.distcode=ue,e.distbits=5}function pe(e,t,n,i){var a,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new r.Buf8(o.wsize)),i>=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((a=o.wsize-o.wnext)>i&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}function he(e,t){var n,$,ee,te,re,ie,ae,oe,se,le,ce,ue,de,he,ge,me,ve,ye,Ie,Ce,be,_e,Ae,we,Se=0,xe=new r.Buf8(4),ke=[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 v;(n=e.state).mode===R&&(n.mode=O),re=e.next_out,ee=e.output,ae=e.avail_out,te=e.next_in,$=e.input,ie=e.avail_in,oe=n.hold,se=n.bits,le=ie,ce=ae,_e=h;e:for(;;)switch(n.mode){case _:if(0===n.wrap){n.mode=O;break}for(;se<16;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}if(2&n.wrap&&35615===oe){n.check=0,xe[0]=255&oe,xe[1]=oe>>>8&255,n.check=a(n.check,xe,2,0),oe=0,se=0,n.mode=A;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&oe)<<8)+(oe>>8))%31){e.msg="incorrect header check",n.mode=q;break}if((15&oe)!==b){e.msg="unknown compression method",n.mode=q;break}if(se-=4,be=8+(15&(oe>>>=4)),0===n.wbits)n.wbits=be;else if(be>n.wbits){e.msg="invalid window size",n.mode=q;break}n.dmax=1<<be,e.adler=n.check=1,n.mode=512&oe?B:R,oe=0,se=0;break;case A:for(;se<16;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}if(n.flags=oe,(255&n.flags)!==b){e.msg="unknown compression method",n.mode=q;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=q;break}n.head&&(n.head.text=oe>>8&1),512&n.flags&&(xe[0]=255&oe,xe[1]=oe>>>8&255,n.check=a(n.check,xe,2,0)),oe=0,se=0,n.mode=w;case w:for(;se<32;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}n.head&&(n.head.time=oe),512&n.flags&&(xe[0]=255&oe,xe[1]=oe>>>8&255,xe[2]=oe>>>16&255,xe[3]=oe>>>24&255,n.check=a(n.check,xe,4,0)),oe=0,se=0,n.mode=S;case S:for(;se<16;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}n.head&&(n.head.xflags=255&oe,n.head.os=oe>>8),512&n.flags&&(xe[0]=255&oe,xe[1]=oe>>>8&255,n.check=a(n.check,xe,2,0)),oe=0,se=0,n.mode=x;case x:if(1024&n.flags){for(;se<16;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}n.length=oe,n.head&&(n.head.extra_len=oe),512&n.flags&&(xe[0]=255&oe,xe[1]=oe>>>8&255,n.check=a(n.check,xe,2,0)),oe=0,se=0}else n.head&&(n.head.extra=null);n.mode=k;case k:if(1024&n.flags&&((ue=n.length)>ie&&(ue=ie),ue&&(n.head&&(be=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,$,te,ue,be)),512&n.flags&&(n.check=a(n.check,$,ue,te)),ie-=ue,te+=ue,n.length-=ue),n.length))break e;n.length=0,n.mode=E;case E:if(2048&n.flags){if(0===ie)break e;ue=0;do{be=$[te+ue++],n.head&&be&&n.length<65536&&(n.head.name+=String.fromCharCode(be))}while(be&&ue<ie);if(512&n.flags&&(n.check=a(n.check,$,ue,te)),ie-=ue,te+=ue,be)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=T;case T:if(4096&n.flags){if(0===ie)break e;ue=0;do{be=$[te+ue++],n.head&&be&&n.length<65536&&(n.head.comment+=String.fromCharCode(be))}while(be&&ue<ie);if(512&n.flags&&(n.check=a(n.check,$,ue,te)),ie-=ue,te+=ue,be)break e}else n.head&&(n.head.comment=null);n.mode=N;case N:if(512&n.flags){for(;se<16;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}if(oe!==(65535&n.check)){e.msg="header crc mismatch",n.mode=q;break}oe=0,se=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=R;break;case B:for(;se<32;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}e.adler=n.check=ne(oe),oe=0,se=0,n.mode=M;case M:if(0===n.havedict)return e.next_out=re,e.avail_out=ae,e.next_in=te,e.avail_in=ie,n.hold=oe,n.bits=se,m;e.adler=n.check=1,n.mode=R;case R:if(t===f||t===p)break e;case O:if(n.last){oe>>>=7&se,se-=7&se,n.mode=Y;break}for(;se<3;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}switch(n.last=1&oe,se-=1,3&(oe>>>=1)){case 0:n.mode=D;break;case 1:if(fe(n),n.mode=Z,t===p){oe>>>=2,se-=2;break e}break;case 2:n.mode=z;break;case 3:e.msg="invalid block type",n.mode=q}oe>>>=2,se-=2;break;case D:for(oe>>>=7&se,se-=7&se;se<32;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}if((65535&oe)!=(oe>>>16^65535)){e.msg="invalid stored block lengths",n.mode=q;break}if(n.length=65535&oe,oe=0,se=0,n.mode=F,t===p)break e;case F:n.mode=L;case L:if(ue=n.length){if(ue>ie&&(ue=ie),ue>ae&&(ue=ae),0===ue)break e;r.arraySet(ee,$,te,ue,re),ie-=ue,te+=ue,ae-=ue,re+=ue,n.length-=ue;break}n.mode=R;break;case z:for(;se<14;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}if(n.nlen=257+(31&oe),oe>>>=5,se-=5,n.ndist=1+(31&oe),oe>>>=5,se-=5,n.ncode=4+(15&oe),oe>>>=4,se-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=q;break}n.have=0,n.mode=W;case W:for(;n.have<n.ncode;){for(;se<3;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}n.lens[ke[n.have++]]=7&oe,oe>>>=3,se-=3}for(;n.have<19;)n.lens[ke[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,Ae={bits:n.lenbits},_e=s(l,n.lens,0,19,n.lencode,0,n.work,Ae),n.lenbits=Ae.bits,_e){e.msg="invalid code lengths set",n.mode=q;break}n.have=0,n.mode=G;case G:for(;n.have<n.nlen+n.ndist;){for(;me=(Se=n.lencode[oe&(1<<n.lenbits)-1])>>>16&255,ve=65535&Se,!((ge=Se>>>24)<=se);){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}if(ve<16)oe>>>=ge,se-=ge,n.lens[n.have++]=ve;else{if(16===ve){for(we=ge+2;se<we;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}if(oe>>>=ge,se-=ge,0===n.have){e.msg="invalid bit length repeat",n.mode=q;break}be=n.lens[n.have-1],ue=3+(3&oe),oe>>>=2,se-=2}else if(17===ve){for(we=ge+3;se<we;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}se-=ge,be=0,ue=3+(7&(oe>>>=ge)),oe>>>=3,se-=3}else{for(we=ge+7;se<we;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}se-=ge,be=0,ue=11+(127&(oe>>>=ge)),oe>>>=7,se-=7}if(n.have+ue>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=q;break}for(;ue--;)n.lens[n.have++]=be}}if(n.mode===q)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=q;break}if(n.lenbits=9,Ae={bits:n.lenbits},_e=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,Ae),n.lenbits=Ae.bits,_e){e.msg="invalid literal/lengths set",n.mode=q;break}if(n.distbits=6,n.distcode=n.distdyn,Ae={bits:n.distbits},_e=s(u,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,Ae),n.distbits=Ae.bits,_e){e.msg="invalid distances set",n.mode=q;break}if(n.mode=Z,t===p)break e;case Z:n.mode=V;case V:if(ie>=6&&ae>=258){e.next_out=re,e.avail_out=ae,e.next_in=te,e.avail_in=ie,n.hold=oe,n.bits=se,o(e,ce),re=e.next_out,ee=e.output,ae=e.avail_out,te=e.next_in,$=e.input,ie=e.avail_in,oe=n.hold,se=n.bits,n.mode===R&&(n.back=-1);break}for(n.back=0;me=(Se=n.lencode[oe&(1<<n.lenbits)-1])>>>16&255,ve=65535&Se,!((ge=Se>>>24)<=se);){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}if(me&&!(240&me)){for(ye=ge,Ie=me,Ce=ve;me=(Se=n.lencode[Ce+((oe&(1<<ye+Ie)-1)>>ye)])>>>16&255,ve=65535&Se,!(ye+(ge=Se>>>24)<=se);){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}oe>>>=ye,se-=ye,n.back+=ye}if(oe>>>=ge,se-=ge,n.back+=ge,n.length=ve,0===me){n.mode=X;break}if(32&me){n.back=-1,n.mode=R;break}if(64&me){e.msg="invalid literal/length code",n.mode=q;break}n.extra=15&me,n.mode=U;case U:if(n.extra){for(we=n.extra;se<we;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}n.length+=oe&(1<<n.extra)-1,oe>>>=n.extra,se-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=H;case H:for(;me=(Se=n.distcode[oe&(1<<n.distbits)-1])>>>16&255,ve=65535&Se,!((ge=Se>>>24)<=se);){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}if(!(240&me)){for(ye=ge,Ie=me,Ce=ve;me=(Se=n.distcode[Ce+((oe&(1<<ye+Ie)-1)>>ye)])>>>16&255,ve=65535&Se,!(ye+(ge=Se>>>24)<=se);){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}oe>>>=ye,se-=ye,n.back+=ye}if(oe>>>=ge,se-=ge,n.back+=ge,64&me){e.msg="invalid distance code",n.mode=q;break}n.offset=ve,n.extra=15&me,n.mode=P;case P:if(n.extra){for(we=n.extra;se<we;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}n.offset+=oe&(1<<n.extra)-1,oe>>>=n.extra,se-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=q;break}n.mode=K;case K:if(0===ae)break e;if(ue=ce-ae,n.offset>ue){if((ue=n.offset-ue)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=q;break}ue>n.wnext?(ue-=n.wnext,de=n.wsize-ue):de=n.wnext-ue,ue>n.length&&(ue=n.length),he=n.window}else he=ee,de=re-n.offset,ue=n.length;ue>ae&&(ue=ae),ae-=ue,n.length-=ue;do{ee[re++]=he[de++]}while(--ue);0===n.length&&(n.mode=V);break;case X:if(0===ae)break e;ee[re++]=n.length,ae--,n.mode=V;break;case Y:if(n.wrap){for(;se<32;){if(0===ie)break e;ie--,oe|=$[te++]<<se,se+=8}if(ce-=ae,e.total_out+=ce,n.total+=ce,ce&&(e.adler=n.check=n.flags?a(n.check,ee,ce,re-ce):i(n.check,ee,ce,re-ce)),ce=ae,(n.flags?oe:ne(oe))!==n.check){e.msg="incorrect data check",n.mode=q;break}oe=0,se=0}n.mode=j;case j:if(n.wrap&&n.flags){for(;se<32;){if(0===ie)break e;ie--,oe+=$[te++]<<se,se+=8}if(oe!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=q;break}oe=0,se=0}n.mode=J;case J:_e=g;break e;case q:_e=y;break e;case Q:return I;default:return v}return e.next_out=re,e.avail_out=ae,e.next_in=te,e.avail_in=ie,n.hold=oe,n.bits=se,(n.wsize||ce!==e.avail_out&&n.mode<q&&(n.mode<Y||t!==d))&&pe(e,e.output,e.next_out,ce-e.avail_out),le-=e.avail_in,ce-=e.avail_out,e.total_in+=le,e.total_out+=ce,n.total+=ce,n.wrap&&ce&&(e.adler=n.check=n.flags?a(n.check,ee,ce,e.next_out-ce):i(n.check,ee,ce,e.next_out-ce)),e.data_type=n.bits+(n.last?64:0)+(n.mode===R?128:0)+(n.mode===Z||n.mode===F?256:0),(0===le&&0===ce||t===d)&&_e===h&&(_e=C),_e}function ge(e){if(!e||!e.state)return v;var t=e.state;return t.window&&(t.window=null),e.state=null,h}function me(e,t){var n;return e&&e.state&&2&(n=e.state).wrap?(n.head=t,t.done=!1,h):v}function ve(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&n.mode!==M?v:n.mode===M&&i(1,t,r,0)!==n.check?y:pe(e,t,r,r)?(n.mode=Q,I):(n.havedict=1,h):v}n.inflateReset=ae,n.inflateReset2=oe,n.inflateResetKeep=ie,n.inflateInit=le,n.inflateInit2=se,n.inflate=he,n.inflateEnd=ge,n.inflateGetHeader=me,n.inflateSetDictionary=ve,n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,n){var r=e("../utils/common"),i=15,a=852,o=592,s=0,l=1,c=2,u=[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],d=[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],f=[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],p=[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,h,g,m,v,y){var I,C,b,_,A,w,S,x,k,E=y.bits,T=0,N=0,B=0,M=0,R=0,O=0,D=0,F=0,L=0,z=0,W=null,G=0,Z=new r.Buf16(i+1),V=new r.Buf16(i+1),U=null,H=0;for(T=0;T<=i;T++)Z[T]=0;for(N=0;N<h;N++)Z[t[n+N]]++;for(R=E,M=i;M>=1&&0===Z[M];M--);if(R>M&&(R=M),0===M)return g[m++]=20971520,g[m++]=20971520,y.bits=1,0;for(B=1;B<M&&0===Z[B];B++);for(R<B&&(R=B),F=1,T=1;T<=i;T++)if(F<<=1,(F-=Z[T])<0)return-1;if(F>0&&(e===s||1!==M))return-1;for(V[1]=0,T=1;T<i;T++)V[T+1]=V[T]+Z[T];for(N=0;N<h;N++)0!==t[n+N]&&(v[V[t[n+N]]++]=N);if(e===s?(W=U=v,w=19):e===l?(W=u,G-=257,U=d,H-=257,w=256):(W=f,U=p,w=-1),z=0,N=0,T=B,A=m,O=R,D=0,b=-1,_=(L=1<<R)-1,e===l&&L>a||e===c&&L>o)return 1;for(;;){S=T-D,v[N]<w?(x=0,k=v[N]):v[N]>w?(x=U[H+v[N]],k=W[G+v[N]]):(x=96,k=0),I=1<<T-D,B=C=1<<O;do{g[A+(z>>D)+(C-=I)]=S<<24|x<<16|k}while(0!==C);for(I=1<<T-1;z&I;)I>>=1;if(0!==I?(z&=I-1,z+=I):z=0,N++,0==--Z[T]){if(T===M)break;T=t[n+v[N]]}if(T>R&&(z&_)!==b){for(0===D&&(D=R),A+=B,F=1<<(O=T-D);O+D<M&&!((F-=Z[O+D])<=0);)O++,F<<=1;if(L+=1<<O,e===l&&L>a||e===c&&L>o)return 1;g[b=z&_]=R<<24|O<<16|A-m}}return 0!==z&&(g[A+z]=T-D<<24|64<<16),y.bits=R,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){function r(){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}t.exports=r},{}],"/lib/inflate.js":[function(e,t,n){var r=e("./zlib/inflate"),i=e("./utils/common"),a=e("./utils/strings"),o=e("./zlib/constants"),s=e("./zlib/messages"),l=e("./zlib/zstream"),c=e("./zlib/gzheader"),u=Object.prototype.toString;function d(e){if(!(this instanceof d))return new d(e);this.options=i.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&&(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=r.inflateInit2(this.strm,t.windowBits);if(n!==o.Z_OK)throw new Error(s[n]);if(this.header=new c,r.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=a.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=r.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[n])}function f(e,t){var n=new d(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}function p(e,t){return(t=t||{}).raw=!0,f(e,t)}d.prototype.push=function(e,t){var n,s,l,c,d,f=this.strm,p=this.options.chunkSize,h=this.options.dictionary,g=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?f.input=a.binstring2buf(e):"[object ArrayBuffer]"===u.call(e)?f.input=new Uint8Array(e):f.input=e,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new i.Buf8(p),f.next_out=0,f.avail_out=p),(n=r.inflate(f,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&h&&(n=r.inflateSetDictionary(this.strm,h)),n===o.Z_BUF_ERROR&&!0===g&&(n=o.Z_OK,g=!1),n!==o.Z_STREAM_END&&n!==o.Z_OK)return this.onEnd(n),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&n!==o.Z_STREAM_END&&(0!==f.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=a.utf8border(f.output,f.next_out),c=f.next_out-l,d=a.buf2string(f.output,l),f.next_out=c,f.avail_out=p-c,c&&i.arraySet(f.output,f.output,l,c,0),this.onData(d)):this.onData(i.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(g=!0)}while((f.avail_in>0||0===f.avail_out)&&n!==o.Z_STREAM_END);return n===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),f.avail_out=0,!0)},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=d,n.inflate=f,n.inflateRaw=p,n.ungzip=f},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")})),pako_inflate_1=pako_inflate.inflate,unpack=function(e){if("string"!=typeof e)return e;try{if((t=JSON.parse(e)).timestamp)return t}catch(e){}try{var t;if((t=JSON.parse(pako_inflate_1(e,{to:"string"}))).v===MARK)return t;throw new Error("These events were packed with packer "+t.v+" which is incompatible with current packer "+MARK+".")}catch(e){throw console.error(e),new Error("Unknown data format.")}},addCustomEvent=record.addCustomEvent,takeFullSnapshot=record.takeFullSnapshot;exports.Replayer=Replayer,exports.addCustomEvent=addCustomEvent,exports.mirror=mirror,exports.pack=pack,exports.record=record,exports.takeFullSnapshot=takeFullSnapshot,exports.unpack=unpack,exports.utils=utils;
//# sourceMappingURL=/sm/c7c37a12b2f4b43fa0b7d6e64ae88d3ba35093ca47d4c9dccee8ba30e8969ee4.map