@deepsure/page-replay-sdk 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -15
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -15
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).PageRecorder=t()}(this,function(){"use strict";var e;function t(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function n(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function s(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(r).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function r(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=s(e.styleSheet)||t}catch(e){}return t}!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"}(e||(e={}));var i=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var s=this.nodeMetaMap.get(n);s&&this.nodeMetaMap.set(t,s)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function a(e){var t=e.maskInputOptions,n=e.tagName,s=e.type,r=e.value,i=e.maskInputFn,a=r||"";return(t[n.toLowerCase()]||t[s])&&(a=i?i(a):"*".repeat(a.length)),a}var o="__rrweb_original__";var l,d,c=1,h=new RegExp("[^a-z0-9-_:]");function u(){return c++}var p=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,g=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,m=/^(data:)([^,]*),(.*)/i;function f(e,t){return(e||"").replace(p,function(e,n,s,r,i,a){var o,l=s||i||a,d=n||r||"";if(!l)return e;if(!g.test(l))return"url(".concat(d).concat(l).concat(d,")");if(m.test(l))return"url(".concat(d).concat(l).concat(d,")");if("/"===l[0])return"url(".concat(d).concat((o=t,(o.indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+l)).concat(d,")");var c=t.split("/"),h=l.split("/");c.pop();for(var u=0,p=h;u<p.length;u++){var f=p[u];"."!==f&&(".."===f?c.pop():c.push(f))}return"url(".concat(d).concat(c.join("/")).concat(d,")")})}var y=/^[^ \t\n\r\u000c]+/,I=/^[, \t\n\r\u000c]+/;function b(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function _(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function C(){var e=document.createElement("a");return e.href="",e.href}function w(e,t,n,s){return"src"===n||"href"===n&&s&&("use"!==t||"#"!==s[0])||"xlink:href"===n&&s&&"#"!==s[0]?b(e,s):"background"!==n||!s||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&s?function(e,t){if(""===t.trim())return t;var n=0;function s(e){var s,r=e.exec(t.substring(n));return r?(s=r[0],n+=s.length,s):""}for(var r=[];s(I),!(n>=t.length);){var i=s(y);if(","===i.slice(-1))i=b(e,i.substring(0,i.length-1)),r.push(i);else{var a="";i=b(e,i);for(var o=!1;;){var l=t.charAt(n);if(""===l){r.push((i+a).trim());break}if(o)")"===l&&(o=!1);else{if(","===l){n+=1,r.push((i+a).trim());break}"("===l&&(o=!0)}a+=l,n+=1}}}return r.join(", ")}(e,s):"style"===n&&s?f(s,C()):"object"===t&&"data"===n&&s?b(e,s):s:b(e,s)}function v(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&v(e.parentNode,t,n);for(var s=e.classList.length;s--;){var r=e.classList[s];if(t.test(r))return!0}return!!n&&v(e.parentNode,t,n)}function S(e,t,n){var s=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===s)return!1;if("string"==typeof t){if(s.classList.contains(t))return!0;if(s.closest(".".concat(t)))return!0}else if(v(s,t,!0))return!0;if(n){if(s.matches(n))return!0;if(s.closest(n))return!0}return!1}function k(t,n){var r=n.doc,i=n.mirror,c=n.blockClass,u=n.blockSelector,p=n.maskTextClass,g=n.maskTextSelector,m=n.inlineStylesheet,y=n.maskInputOptions,I=void 0===y?{}:y,b=n.maskTextFn,v=n.maskInputFn,k=n.dataURLOptions,A=void 0===k?{}:k,x=n.inlineImages,E=n.recordCanvas,R=n.keepIframeSrcFn,T=n.newlyAddedElement,M=void 0!==T&&T,N=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode}:{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:N};case t.ELEMENT_NODE:return function(t,n){for(var r=n.doc,i=n.blockClass,c=n.blockSelector,u=n.inlineStylesheet,p=n.maskInputOptions,g=void 0===p?{}:p,m=n.maskInputFn,y=n.dataURLOptions,I=void 0===y?{}:y,b=n.inlineImages,v=n.recordCanvas,S=n.keepIframeSrcFn,k=n.newlyAddedElement,A=void 0!==k&&k,x=n.rootId,E=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var s=e.classList.length;s--;){var r=e.classList[s];if(t.test(r))return!0}return!!n&&e.matches(n)}(t,i,c),R=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return h.test(t)?"div":t}(t),T={},M=t.attributes.length,N=0;N<M;N++){var O=t.attributes[N];T[O.name]=w(r,R,O.name,O.value)}if("link"===R&&u){var F=Array.from(r.styleSheets).find(function(e){return e.href===t.href}),z=null;F&&(z=s(F)),z&&(delete T.rel,delete T.href,T._cssText=f(z,F.href))}if("style"===R&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){(z=s(t.sheet))&&(T._cssText=f(z,C()))}if("input"===R||"textarea"===R||"select"===R){var D=t.value,L=t.checked;"radio"!==T.type&&"checkbox"!==T.type&&"submit"!==T.type&&"button"!==T.type&&D?T.value=a({type:T.type,tagName:R,value:D,maskInputOptions:g,maskInputFn:m}):L&&(T.checked=L)}"option"===R&&(t.selected&&!g.select?T.selected=!0:delete T.selected);if("canvas"===R&&v)if("2d"===t.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var s=0;s<e.height;s+=50){var r=t.getImageData,i=o in r?r[o]:r;if(new Uint32Array(i.call(t,n,s,Math.min(50,e.width-n),Math.min(50,e.height-s)).data.buffer).some(function(e){return 0!==e}))return!1}return!0})(t)||(T.rr_dataURL=t.toDataURL(I.type,I.quality));else if(!("__context"in t)){var Z=t.toDataURL(I.type,I.quality),U=document.createElement("canvas");U.width=t.width,U.height=t.height,Z!==U.toDataURL(I.type,I.quality)&&(T.rr_dataURL=Z)}if("img"===R&&b){l||(l=r.createElement("canvas"),d=l.getContext("2d"));var B=t,W=B.crossOrigin;B.crossOrigin="anonymous";var G=function(){try{l.width=B.naturalWidth,l.height=B.naturalHeight,d.drawImage(B,0,0),T.rr_dataURL=l.toDataURL(I.type,I.quality)}catch(e){console.warn("Cannot inline img src=".concat(B.currentSrc,"! Error: ").concat(e))}W?T.crossOrigin=W:B.removeAttribute("crossorigin")};B.complete&&0!==B.naturalWidth?G():B.onload=G}"audio"!==R&&"video"!==R||(T.rr_mediaState=t.paused?"paused":"played",T.rr_mediaCurrentTime=t.currentTime);A||(t.scrollLeft&&(T.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(T.rr_scrollTop=t.scrollTop));if(E){var V=t.getBoundingClientRect(),K=V.width,Y=V.height;T={class:T.class,rr_width:"".concat(K,"px"),rr_height:"".concat(Y,"px")}}"iframe"!==R||S(T.src)||(t.contentDocument||(T.rr_src=T.src),delete T.src);return{type:e.Element,tagName:R,attributes:T,childNodes:[],isSVG:_(t)||void 0,needBlock:E,rootId:x}}(t,{doc:r,blockClass:c,blockSelector:u,inlineStylesheet:m,maskInputOptions:I,maskInputFn:v,dataURLOptions:A,inlineImages:x,recordCanvas:E,keepIframeSrcFn:R,newlyAddedElement:M,rootId:N});case t.TEXT_NODE:return function(t,n){var s,r=n.maskTextClass,i=n.maskTextSelector,a=n.maskTextFn,o=n.rootId,l=t.parentNode&&t.parentNode.tagName,d=t.textContent,c="STYLE"===l||void 0,h="SCRIPT"===l||void 0;if(c&&d){try{t.nextSibling||t.previousSibling||(null===(s=t.parentNode.sheet)||void 0===s?void 0:s.cssRules)&&(d=(u=t.parentNode.sheet).cssRules?Array.from(u.cssRules).map(function(e){return e.cssText||""}).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(e),t)}d=f(d,C())}var u;h&&(d="SCRIPT_PLACEHOLDER");!c&&!h&&d&&S(t,r,i)&&(d=a?a(d):d.replace(/[\S]/g,"*"));return{type:e.Text,textContent:d||"",isStyle:c,rootId:o}}(t,{maskTextClass:p,maskTextSelector:g,maskTextFn:b,rootId:N});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:N};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:N};default:return!1}}function A(e){return void 0===e?"":e.toLowerCase()}function x(s,r){var i,a=r.doc,o=r.mirror,l=r.blockClass,d=r.blockSelector,c=r.maskTextClass,h=r.maskTextSelector,p=r.skipChild,g=void 0!==p&&p,m=r.inlineStylesheet,f=void 0===m||m,y=r.maskInputOptions,I=void 0===y?{}:y,b=r.maskTextFn,_=r.maskInputFn,C=r.slimDOMOptions,w=r.dataURLOptions,v=void 0===w?{}:w,S=r.inlineImages,E=void 0!==S&&S,R=r.recordCanvas,T=void 0!==R&&R,M=r.onSerialize,N=r.onIframeLoad,O=r.iframeLoadTimeout,F=void 0===O?5e3:O,z=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,L=void 0===D?5e3:D,Z=r.keepIframeSrcFn,U=void 0===Z?function(){return!1}:Z,B=r.newlyAddedElement,W=void 0!==B&&B,G=r.preserveWhiteSpace,V=void 0===G||G,K=k(s,{doc:a,mirror:o,blockClass:l,blockSelector:d,maskTextClass:c,maskTextSelector:h,inlineStylesheet:f,maskInputOptions:I,maskTextFn:b,maskInputFn:_,dataURLOptions:v,inlineImages:E,recordCanvas:T,keepIframeSrcFn:U,newlyAddedElement:W});if(!K)return console.warn(s,"not serialized"),null;i=o.hasNode(s)?o.getId(s):!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(A(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===A(t.attributes.name)||"icon"===A(t.attributes.rel)||"apple-touch-icon"===A(t.attributes.rel)||"shortcut icon"===A(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&A(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(A(t.attributes.property).match(/^(og|twitter|fb):/)||A(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===A(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===A(t.attributes.name)||"googlebot"===A(t.attributes.name)||"bingbot"===A(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===A(t.attributes.name)||"generator"===A(t.attributes.name)||"framework"===A(t.attributes.name)||"publisher"===A(t.attributes.name)||"progid"===A(t.attributes.name)||A(t.attributes.property).match(/^article:/)||A(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===A(t.attributes.name)||"yandex-verification"===A(t.attributes.name)||"csrf-token"===A(t.attributes.name)||"p:domain_verify"===A(t.attributes.name)||"verify-v1"===A(t.attributes.name)||"verification"===A(t.attributes.name)||"shopify-checkout-api-token"===A(t.attributes.name)))return!0}}return!1}(K,C)&&(V||K.type!==e.Text||K.isStyle||K.textContent.replace(/^\s+|\s+$/gm,"").length)?u():-2;var Y=Object.assign(K,{id:i});if(o.add(s,Y),-2===i)return null;M&&M(s);var H=!g;if(Y.type===e.Element){H=H&&!Y.needBlock,delete Y.needBlock;var J=s.shadowRoot;J&&n(J)&&(Y.isShadowHost=!0)}if((Y.type===e.Document||Y.type===e.Element)&&H){C.headWhitespace&&Y.type===e.Element&&"head"===Y.tagName&&(V=!1);for(var P={doc:a,mirror:o,blockClass:l,blockSelector:d,maskTextClass:c,maskTextSelector:h,skipChild:g,inlineStylesheet:f,maskInputOptions:I,maskTextFn:b,maskInputFn:_,slimDOMOptions:C,dataURLOptions:v,inlineImages:E,recordCanvas:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:N,iframeLoadTimeout:F,onStylesheetLoad:z,stylesheetLoadTimeout:L,keepIframeSrcFn:U},q=0,Q=Array.from(s.childNodes);q<Q.length;q++){($=x(Q[q],P))&&Y.childNodes.push($)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(s)&&s.shadowRoot)for(var j=0,X=Array.from(s.shadowRoot.childNodes);j<X.length;j++){var $;($=x(X[j],P))&&(n(s.shadowRoot)&&($.isShadow=!0),Y.childNodes.push($))}}return s.parentNode&&t(s.parentNode)&&n(s.parentNode)&&(Y.isShadow=!0),Y.type===e.Element&&"iframe"===Y.tagName&&function(e,t,n){var s=e.contentWindow;if(s){var r,i=!1;try{r=s.document.readyState}catch(e){return}if("complete"===r){var a="about:blank";if(s.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var o=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener("load",function(){clearTimeout(o),i=!0,t()})}}}(s,function(){var e=s.contentDocument;if(e&&N){var t=x(e,{doc:e,mirror:o,blockClass:l,blockSelector:d,maskTextClass:c,maskTextSelector:h,skipChild:!1,inlineStylesheet:f,maskInputOptions:I,maskTextFn:b,maskInputFn:_,slimDOMOptions:C,dataURLOptions:v,inlineImages:E,recordCanvas:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:N,iframeLoadTimeout:F,onStylesheetLoad:z,stylesheetLoadTimeout:L,keepIframeSrcFn:U});t&&N(s,t)}},F),Y.type===e.Element&&"link"===Y.tagName&&"stylesheet"===Y.attributes.rel&&function(e,t,n){var s,r=!1;try{s=e.sheet}catch(e){return}if(!s){var i=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(i),r=!0,t()})}}(s,function(){if(z){var e=x(s,{doc:a,mirror:o,blockClass:l,blockSelector:d,maskTextClass:c,maskTextSelector:h,skipChild:!1,inlineStylesheet:f,maskInputOptions:I,maskTextFn:b,maskInputFn:_,slimDOMOptions:C,dataURLOptions:v,inlineImages:E,recordCanvas:T,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:N,iframeLoadTimeout:F,onStylesheetLoad:z,stylesheetLoadTimeout:L,keepIframeSrcFn:U});e&&z(s,e)}},L),Y}function E(e,t,n=document){const s={capture:!0,passive:!0};return n.addEventListener(e,t,s),()=>n.removeEventListener(e,t,s)}const R="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let T={map:{},getId:()=>(console.error(R),-1),getNode:()=>(console.error(R),null),removeNodeFromMap(){console.error(R)},has:()=>(console.error(R),!1),reset(){console.error(R)}};function M(e,t,n={}){let s=null,r=0;return function(...i){const a=Date.now();r||!1!==n.leading||(r=a);const o=t-(a-r),l=this;o<=0||o>t?(s&&(clearTimeout(s),s=null),r=a,e.apply(l,i)):s||!1===n.trailing||(s=setTimeout(()=>{r=!1===n.leading?0:Date.now(),s=null,e.apply(l,i)},o))}}function N(e,t,n,s,r=window){const i=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,s?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>N(e,t,i||{},!0)}function O(e,t,n){try{if(!(t in e))return()=>{};const s=e[t],r=n(s);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:s}})),e[t]=r,()=>{e[t]=s}}catch(e){return()=>{}}}function F(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function z(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function D(e,t,n,s){if(!e)return!1;const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(s&&null!==r.closest("."+t))return!0}else if(v(r,t,s))return!0;if(n){if(e.matches(n))return!0;if(s&&null!==r.closest(n))return!0}return!1}function L(e,t){return-2===t.getId(e)}function Z(e,n){if(t(e))return!1;const s=n.getId(e);return!n.has(s)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||Z(e.parentNode,n))}function U(e){return Boolean(e.changedTouches)}function B(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function W(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function G(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(T=new Proxy(T,{get:(e,t,n)=>("map"===t&&console.error(R),Reflect.get(e,t,n))}));class V{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var K=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(K||{}),Y=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(Y||{}),H=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(H||{}),J=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(J||{});function P(e){return"__ln"in e}class q{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&P(e.previousSibling)){const 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&&P(e.nextSibling)&&e.nextSibling.__ln.previous){const 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++}removeNode(e){const 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--)}}const Q=(e,t)=>`${e}@${t}`;class j{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],n=new q,s=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},r=r=>{var i,a,o,l;let d=null;(null===(a=null===(i=r.getRootNode)||void 0===i?void 0:i.call(r))||void 0===a?void 0:a.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&r.getRootNode().host&&(d=r.getRootNode().host);let c=d;for(;(null===(l=null===(o=null==c?void 0:c.getRootNode)||void 0===o?void 0:o.call(c))||void 0===l?void 0:l.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&c.getRootNode().host;)c=c.getRootNode().host;const h=!(this.doc.contains(r)||c&&this.doc.contains(c));if(!r.parentNode||h)return;const u=t(r.parentNode)?this.mirror.getId(d):this.mirror.getId(r.parentNode),p=s(r);if(-1===u||-1===p)return n.addNode(r);const g=x(r,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{B(e,this.mirror)&&this.iframeManager.addIframe(e),W(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),G(r)&&this.shadowDomManager.addShadowRoot(r.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});g&&e.push({parentId:u,nextId:p,node:g})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))$(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||r(e);for(const e of Array.from(this.addedSet.values()))te(this.droppedSet,e)||$(this.removes,e,this.mirror)?te(this.movedSet,e)?r(e):this.droppedSet.add(e):r(e);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(i.value.parentNode),n=s(i.value);-1!==t&&-1!==n&&(e=i)}if(!e)for(let t=n.length-1;t>=0;t--){const r=n.get(t);if(r){const t=this.mirror.getId(r.value.parentNode);if(-1===s(r.value))continue;if(-1!==t){e=r;break}{const t=r.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const n=t.parentNode.host;if(-1!==this.mirror.getId(n)){e=r;break}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}i=e.previous,n.removeNode(e.value),r(e.value)}const a={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>({id:this.mirror.getId(e.node),attributes:e.attributes})).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(a.texts.length||a.attributes.length||a.removes.length||a.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(a))},this.processMutation=e=>{if(!L(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;D(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:S(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(n=a({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),D(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let s=this.attributes.find(t=>t.node===e.target);if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;e.attributeName="rr_src"}if(s||(s={node:e.target,attributes:{}},this.attributes.push(s)),"style"===e.attributeName){const n=this.doc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue),void 0!==s.attributes.style&&null!==s.attributes.style||(s.attributes.style={});const r=s.attributes.style;for(const e of Array.from(t.style)){const s=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);s===n.style.getPropertyValue(e)&&i===n.style.getPropertyPriority(e)||(r[e]=""===i?s:[s,i])}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(r[e]=!1)}else s.attributes[e.attributeName]=w(this.doc,t.tagName,e.attributeName,n);break}case"childList":if(D(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(s=>{const r=this.mirror.getId(s),i=t(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);D(e.target,this.blockClass,this.blockSelector,!1)||L(s,this.mirror)||!function(e,t){return-1!==t.getId(e)}(s,this.mirror)||(this.addedSet.has(s)?(X(this.addedSet,s),this.droppedSet.add(s)):this.addedSet.has(e.target)&&-1===r||Z(e.target,this.mirror)||(this.movedSet.has(s)&&this.movedMap[Q(r,i)]?X(this.movedSet,s):this.removes.push({parentId:i,id:r,isShadow:!(!t(e.target)||!n(e.target))||void 0})),this.mapRemoves.push(s))})}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(L(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Q(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);D(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach(e=>this.genAdds(e))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function X(e,t){e.delete(t),t.childNodes.forEach(t=>X(e,t))}function $(e,t,n){return 0!==e.length&&ee(e,t,n)}function ee(e,t,n){const{parentNode:s}=t;if(!s)return!1;const r=n.getId(s);return!!e.some(e=>e.id===r)||ee(e,s,n)}function te(e,t){return 0!==e.size&&ne(e,t)}function ne(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||ne(e,n))}const se=[],re="undefined"!=typeof CSSGroupingRule,ie="undefined"!=typeof CSSMediaRule,ae="undefined"!=typeof CSSSupportsRule,oe="undefined"!=typeof CSSConditionRule;function le(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function de(e,t){var n,s;const r=new j;se.push(r),r.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const a=null===(s=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===s?void 0:s.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);const o=new i(r.processMutations.bind(r));return o.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),o}function ce({mouseInteractionCb:e,doc:t,mirror:n,blockClass:s,blockSelector:r,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,o=[];return Object.keys(H).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]).forEach(i=>{const a=i.toLowerCase(),l=(t=>i=>{const a=le(i);if(D(a,s,r,!0))return;const o=U(i)?i.changedTouches[0]:i;if(!o)return;const l=n.getId(a),{clientX:d,clientY:c}=o;e({type:H[t],id:l,x:d,y:c})})(i);o.push(E(a,l,t))}),()=>{o.forEach(e=>e())}}function he({scrollCb:e,doc:t,mirror:n,blockClass:s,blockSelector:r,sampling:i}){return E("scroll",M(i=>{const a=le(i);if(!a||D(a,s,r,!0))return;const o=n.getId(a);if(a===t){const n=t.scrollingElement||t.documentElement;e({id:o,x:n.scrollLeft,y:n.scrollTop})}else e({id:o,x:a.scrollLeft,y:a.scrollTop})},i.scroll||100),t)}function ue(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const pe=["INPUT","TEXTAREA","SELECT"],ge=new WeakMap;function me(e){return function(e,t){if(re&&e.parentRule instanceof CSSGroupingRule||ie&&e.parentRule instanceof CSSMediaRule||ae&&e.parentRule instanceof CSSSupportsRule||oe&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function fe(e,t,n){let s,r;return e?(e.ownerNode?s=t.getId(e.ownerNode):r=n.getId(e),{styleId:r,id:s}):{}}function ye({mirror:e,stylesheetManager:t},n){var s,r,i;let a=null;a="#document"===n.nodeName?e.getId(n):e.getId(n.host);const o="#document"===n.nodeName?null===(s=n.defaultView)||void 0===s?void 0:s.Document:null===(i=null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===i?void 0:i.ShadowRoot,l=Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets");return null!==a&&-1!==a&&o&&l?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null===(e=l.get)||void 0===e?void 0:e.call(this)},set(e){var n;const s=null===(n=l.set)||void 0===n?void 0:n.call(this,e);if(null!==a&&-1!==a)try{t.adoptStyleSheets(e,a)}catch(e){}return s}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}):()=>{}}function Ie(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:s,mouseInteractionCb:r,scrollCb:i,viewportResizeCb:a,inputCb:o,mediaInteractionCb:l,styleSheetRuleCb:d,styleDeclarationCb:c,canvasMutationCb:h,fontCb:u,selectionCb:p}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),s(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),r(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),a(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),o(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),d(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),c(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),u(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)}}(e,t);const s=de(e,e.doc),r=function({mousemoveCb:e,sampling:t,doc:n,mirror:s}){if(!1===t.mousemove)return()=>{};const r="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let a,o=[];const l=M(t=>{const n=Date.now()-a;e(o.map(e=>(e.timeOffset-=n,e)),t),o=[],a=null},i),d=M(e=>{const t=le(e),{clientX:n,clientY:r}=U(e)?e.changedTouches[0]:e;a||(a=Date.now()),o.push({x:n,y:r,id:s.getId(t),timeOffset:Date.now()-a}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Y.Drag:e instanceof MouseEvent?Y.MouseMove:Y.TouchMove)},r,{trailing:!1}),c=[E("mousemove",d,n),E("touchmove",d,n),E("drag",d,n)];return()=>{c.forEach(e=>e())}}(e),i=ce(e),o=he(e),l=function({viewportResizeCb:e}){let t=-1,n=-1;return E("resize",M(()=>{const s=F(),r=z();t===s&&n===r||(e({width:Number(r),height:Number(s)}),t=s,n=r)},200),window)}(e),d=function({inputCb:e,doc:t,mirror:n,blockClass:s,blockSelector:r,ignoreClass:i,maskInputOptions:o,maskInputFn:l,sampling:d,userTriggeredOnInput:c}){function h(e){let n=le(e);const d=e.isTrusted;if(n&&"OPTION"===n.tagName&&(n=n.parentElement),!n||!n.tagName||pe.indexOf(n.tagName)<0||D(n,s,r,!0))return;const h=n.type;if(n.classList.contains(i))return;let p=n.value,g=!1;"radio"===h||"checkbox"===h?g=n.checked:(o[n.tagName.toLowerCase()]||o[h])&&(p=a({maskInputOptions:o,tagName:n.tagName,type:h,value:p,maskInputFn:l})),u(n,ue({text:p,isChecked:g,userTriggered:d},c));const m=n.name;"radio"===h&&m&&g&&t.querySelectorAll(`input[type="radio"][name="${m}"]`).forEach(e=>{e!==n&&u(e,ue({text:e.value,isChecked:!g,userTriggered:!1},c))})}function u(t,s){const r=ge.get(t);if(!r||r.text!==s.text||r.isChecked!==s.isChecked){ge.set(t,s);const r=n.getId(t);e(Object.assign(Object.assign({},s),{id:r}))}}const p=("last"===d.input?["change"]:["input","change"]).map(e=>E(e,h,t)),g=t.defaultView;if(!g)return()=>{p.forEach(e=>e())};const m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),f=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...f.map(e=>N(e[0],e[1],{set(){h({target:this})}},!1,g))),()=>{p.forEach(e=>e())}}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:s,sampling:r}){const i=i=>M(r=>{const a=le(r);if(!a||D(a,t,n,!0))return;const{currentTime:o,volume:l,muted:d,playbackRate:c}=a;e({type:i,id:s.getId(a),currentTime:o,volume:l,muted:d,playbackRate:c})},r.media||500),a=[E("play",i(0)),E("pause",i(1)),E("seeked",i(2)),E("volumechange",i(3)),E("ratechange",i(4))];return()=>{a.forEach(e=>e())}}(e),h=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:s}){const r=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=function(s,i){const{id:a,styleId:o}=fe(this,t,n.styleMirror);return(a&&-1!==a||o&&-1!==o)&&e({id:a,styleId:o,adds:[{rule:s,index:i}]}),r.apply(this,[s,i])};const i=s.CSSStyleSheet.prototype.deleteRule;let a,o;s.CSSStyleSheet.prototype.deleteRule=function(s){const{id:r,styleId:a}=fe(this,t,n.styleMirror);return(r&&-1!==r||a&&-1!==a)&&e({id:r,styleId:a,removes:[{index:s}]}),i.apply(this,[s])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=function(s){const{id:r,styleId:i}=fe(this,t,n.styleMirror);return(r&&-1!==r||i&&-1!==i)&&e({id:r,styleId:i,replace:s}),a.apply(this,[s])}),s.CSSStyleSheet.prototype.replaceSync&&(o=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=function(s){const{id:r,styleId:i}=fe(this,t,n.styleMirror);return(r&&-1!==r||i&&-1!==i)&&e({id:r,styleId:i,replaceSync:s}),o.apply(this,[s])});const l={};re?l.CSSGroupingRule=s.CSSGroupingRule:(ie&&(l.CSSMediaRule=s.CSSMediaRule),oe&&(l.CSSConditionRule=s.CSSConditionRule),ae&&(l.CSSSupportsRule=s.CSSSupportsRule));const d={};return Object.entries(l).forEach(([s,r])=>{d[s]={insertRule:r.prototype.insertRule,deleteRule:r.prototype.deleteRule},r.prototype.insertRule=function(r,i){const{id:a,styleId:o}=fe(this.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||o&&-1!==o)&&e({id:a,styleId:o,adds:[{rule:r,index:[...me(this),i||0]}]}),d[s].insertRule.apply(this,[r,i])},r.prototype.deleteRule=function(r){const{id:i,styleId:a}=fe(this.parentStyleSheet,t,n.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,removes:[{index:[...me(this),r]}]}),d[s].deleteRule.apply(this,[r])}}),()=>{s.CSSStyleSheet.prototype.insertRule=r,s.CSSStyleSheet.prototype.deleteRule=i,a&&(s.CSSStyleSheet.prototype.replace=a),o&&(s.CSSStyleSheet.prototype.replaceSync=o),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=d[e].insertRule,t.prototype.deleteRule=d[e].deleteRule})}}(e,{win:n}),u=ye(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:s},{win:r}){const i=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(r,a,o){var l;if(n.has(r))return i.apply(this,[r,a,o]);const{id:d,styleId:c}=fe(null===(l=this.parentRule)||void 0===l?void 0:l.parentStyleSheet,t,s.styleMirror);return(d&&-1!==d||c&&-1!==c)&&e({id:d,styleId:c,set:{property:r,value:a,priority:o},index:me(this.parentRule)}),i.apply(this,[r,a,o])};const a=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(r){var i;if(n.has(r))return a.apply(this,[r]);const{id:o,styleId:l}=fe(null===(i=this.parentRule)||void 0===i?void 0:i.parentStyleSheet,t,s.styleMirror);return(o&&-1!==o||l&&-1!==l)&&e({id:o,styleId:l,remove:{property:r},index:me(this.parentRule)}),a.apply(this,[r])},()=>{r.CSSStyleDeclaration.prototype.setProperty=i,r.CSSStyleDeclaration.prototype.removeProperty=a}}(e,{win:n}),g=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const s=[],r=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const s=new i(e,t,n);return r.set(s,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),s};const a=O(t.fonts,"add",function(t){return function(n){return setTimeout(()=>{const t=r.get(n);t&&(e(t),r.delete(n))},0),t.apply(this,[n])}});return s.push(()=>{n.FontFace=i}),s.push(a),()=>{s.forEach(e=>e())}}(e):()=>{},m=function(e){const{doc:t,mirror:n,blockClass:s,blockSelector:r,selectionCb:i}=e;let a=!0;const o=()=>{const e=t.getSelection();if(!e||a&&(null==e?void 0:e.isCollapsed))return;a=e.isCollapsed||!1;const o=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const i=e.getRangeAt(t),{startContainer:a,startOffset:l,endContainer:d,endOffset:c}=i;D(a,s,r,!0)||D(d,s,r,!0)||o.push({start:n.getId(a),startOffset:l,end:n.getId(d),endOffset:c})}i({ranges:o})};return o(),E("selectionchange",o)}(e),f=[];for(const t of e.plugins)f.push(t.observer(t.callback,n,t.options));return()=>{se.forEach(e=>e.reset()),s.disconnect(),r(),i(),o(),l(),d(),c(),h(),u(),p(),g(),m(),f.forEach(e=>e())}}class be{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,s){const r=n||this.getIdToRemoteIdMap(e),i=s||this.getRemoteIdToIdMap(e);let a=r.get(t);return a||(a=this.generateIdFn(),r.set(t,a),i.set(a,t)),a}getIds(e,t){const n=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,s))}getRemoteId(e,t,n){const s=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const r=s.get(t);return r||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class _e{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new be(u),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new be(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if("rrweb"===e.data.type){if(!e.source)return;const t=this.crossOriginIframeMap.get(e.source);if(!t)return;const n=this.transformCrossOriginEvent(t,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var n;switch(t.type){case K.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:K.IncrementalSnapshot,data:{source:Y.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case K.Meta:case K.Load:case K.DomContentLoaded:return!1;case K.Plugin:return t;case K.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case K.IncrementalSnapshot:switch(t.data.source){case Y.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Y.Drag:case Y.TouchMove:case Y.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Y.ViewportResize:return!1;case Y.MediaInteraction:case Y.MouseInteraction:case Y.Scroll:case Y.CanvasMutation:case Y.Input:return this.replaceIds(t.data,e,["id"]),t;case Y.StyleSheetRule:case Y.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Y.Font:return t;case Y.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Y.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}}replace(e,t,n,s){for(const r of s)(Array.isArray(t[r])||"number"==typeof t[r])&&(Array.isArray(t[r])?t[r]=e.getIds(n,t[r]):t[r]=e.getId(n,t[r]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}}class Ce{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(O(Element.prototype,"attachShadow",function(e){return function(n){const s=e.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),s}}))}addShadowRoot(e,t){n(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),de(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),he(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),ye({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)},0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(O(e.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(s){const r=n.call(this,s);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}}))}}reset(){this.restorePatches.forEach(e=>e()),this.shadowDoms=new WeakSet}}
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function we(e,t,n,s){return new(n||(n=Promise))(function(t,r){function i(e){try{o(s.next(e))}catch(e){r(e)}}function a(e){try{o(s.throw(e))}catch(e){r(e)}}function o(e){var s;e.done?t(e.value):(s=e.value,s instanceof n?s:new n(function(e){e(s)})).then(i,a)}o((s=s.apply(e,[])).next())})}for(var ve="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Se="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ke=0;ke<64;ke++)Se[ve.charCodeAt(ke)]=ke;const Ae=new Map;const xe=(e,t,n)=>{if(!e||!Te(e,t)&&"object"!=typeof e)return;const s=function(e,t){let n=Ae.get(e);return n||(n=new Map,Ae.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let r=s.indexOf(e);return-1===r&&(r=s.length,s.push(e)),r};function Ee(e,t,n){if(e instanceof Array)return e.map(e=>Ee(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){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),s=n.length,r="";for(t=0;t<s;t+=3)r+=ve[n[t]>>2],r+=ve[(3&n[t])<<4|n[t+1]>>4],r+=ve[(15&n[t+1])<<2|n[t+2]>>6],r+=ve[63&n[t+2]];return s%3==2?r=r.substring(0,r.length-1)+"=":s%3==1&&(r=r.substring(0,r.length-2)+"=="),r}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Ee(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Ee(e.data,t,n),e.width,e.height]}}if(Te(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:xe(e,t,n)}}return e}const Re=(e,t,n)=>[...e].map(e=>Ee(e,t,n)),Te=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function Me(e,t,n){const s=[];try{const r=O(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(s,...r){return D(this,t,n,!0)||"__context"in this||(this.__context=s),e.apply(this,[s,...r])}});s.push(r)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(e=>e())}}function Ne(e,t,n,s,r,i,a){const o=[],l=Object.getOwnPropertyNames(e);for(const i of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if("function"!=typeof e[i])continue;const l=O(e,i,function(e){return function(...o){const l=e.apply(this,o);if(xe(l,a,this),!D(this.canvas,s,r,!0)){const e=Re([...o],a,this),s={type:t,property:i,args:e};n(this.canvas,s)}return l}});o.push(l)}catch(s){const r=N(e,i,{set(e){n(this.canvas,{type:t,property:i,args:[e],setter:!0})}});o.push(r)}return o}var Oe=null;try{var Fe="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");Oe=Fe.Worker}catch(e){}function ze(e,t,n){var s=function(e){return Buffer.from(e,"base64").toString("utf8")}(e),r=s.indexOf("\n",10)+1,i=s.substring(r)+"";return function(e){return new Oe(i,Object.assign({},e,{eval:!0}))}}function De(e,t,n){var s=function(e){return atob(e)}(e),r=s.indexOf("\n",10)+1,i=s.substring(r)+"",a=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(a)}var Le="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var Ze,Ue=(Ze="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",Le?ze(Ze):function(e){var t;return function(n){return t=t||De(e),new Worker(t,n)}}(Ze));class Be{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(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)};const{sampling:t="all",win:n,blockClass:s,blockSelector:r,recordCanvas:i,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,s,r),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,s,r,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,s,r){const i=Me(t,n,s),a=new Map,o=new Ue;o.onmessage=e=>{const{id:t}=e.data;if(a.set(t,!1),!("base64"in e.data))return;const{base64:n,type:s,width:r,height:i}=e.data;this.mutationCb({id:t,type:J["2D"],commands:[{property:"clearRect",args:[0,0,r,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:s}]},0,0]}]})};const l=1e3/e;let d,c=0;const h=e=>{c&&e-c<l||(c=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{D(t,n,s,!0)||e.push(t)}),e})().forEach(e=>we(this,0,void 0,function*(){var t;const n=this.mirror.getId(e);if(a.get(n))return;if(a.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const s=yield createImageBitmap(e);o.postMessage({id:n,bitmap:s,width:e.width,height:e.height,dataURLOptions:r.dataURLOptions},[s])}))),d=requestAnimationFrame(h)};d=requestAnimationFrame(h),this.resetObservers=()=>{i(),cancelAnimationFrame(d)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=Me(e,t,n),r=function(e,t,n,s){const r=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])continue;const i=O(t.CanvasRenderingContext2D.prototype,a,function(r){return function(...i){return D(this.canvas,n,s,!0)||setTimeout(()=>{const n=Re([...i],t,this);e(this.canvas,{type:J["2D"],property:a,args:n})},0),r.apply(this,i)}});r.push(i)}catch(n){const s=N(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:J["2D"],property:a,args:[t],setter:!0})}});r.push(s)}return()=>{r.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,s){const r=[];return r.push(...Ne(t.WebGLRenderingContext.prototype,J.WebGL,e,n,s,0,t)),void 0!==t.WebGL2RenderingContext&&r.push(...Ne(t.WebGL2RenderingContext.prototype,J.WebGL2,e,n,s,0,t)),()=>{r.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{s(),r(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const s=n.map(e=>{const t=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]])}return n}(e,["type"]);return t}),{type:r}=n[0];this.mutationCb({id:t,type:r,commands:s}),this.pendingCanvasMutations.delete(e)}}class We{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new V,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},s=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);s.push({styleId:e,rules:n.map((e,t)=>({rule:r(e),index:t}))})}n.styleIds.push(e)}s.length>0&&(n.styles=s),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function Ge(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let Ve,Ke,Ye,He=!1;const Je=new i;function Pe(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:s,blockClass:r="rr-block",blockSelector:a=null,ignoreClass:o="rr-ignore",maskTextClass:l="rr-mask",maskTextSelector:d=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:u,slimDOMOptions:p,maskInputFn:g,maskTextFn:m,hooks:f,packFn:y,sampling:I={},dataURLOptions:b={},mousemoveWait:_,recordCanvas:C=!1,recordCrossOriginIframes:w=!1,userTriggeredOnInput:v=!1,collectFonts:S=!1,inlineImages:k=!1,plugins:A,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:T=new Set([])}=e,M=!w||window.parent===window;let N=!1;if(!M)try{window.parent.document,N=!1}catch(e){N=!0}if(M&&!t)throw new Error("emit function is required");void 0!==_&&void 0===I.mousemove&&(I.mousemove=_),Je.reset();const O=!0===h?{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,password:!0}:void 0!==u?u:{password:!0},D=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p}:p||{};let L;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let Z=0;const U=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&(e=y(e)),e};Ve=(e,r)=>{var i;if(!(null===(i=se[0])||void 0===i?void 0:i.isFrozen())||e.type===K.FullSnapshot||e.type===K.IncrementalSnapshot&&e.data.source===Y.Mutation||se.forEach(e=>e.unfreeze()),M)null==t||t(U(e),r);else if(N){const t={type:"rrweb",event:U(e),isCheckout:r};window.parent.postMessage(t,"*")}if(e.type===K.FullSnapshot)L=e,Z=0;else if(e.type===K.IncrementalSnapshot){if(e.data.source===Y.Mutation&&e.data.isAttachIframe)return;Z++;const t=s&&Z>=s,r=n&&e.timestamp-L.timestamp>n;(t||r)&&Ke(!0)}};const V=e=>{Ve(Ge({type:K.IncrementalSnapshot,data:Object.assign({source:Y.Mutation},e)}))},H=e=>Ve(Ge({type:K.IncrementalSnapshot,data:Object.assign({source:Y.Scroll},e)})),J=e=>Ve(Ge({type:K.IncrementalSnapshot,data:Object.assign({source:Y.CanvasMutation},e)})),P=new We({mutationCb:V,adoptedStyleSheetCb:e=>Ve(Ge({type:K.IncrementalSnapshot,data:Object.assign({source:Y.AdoptedStyleSheet},e)}))}),q=new _e({mirror:Je,mutationCb:V,stylesheetManager:P,recordCrossOriginIframes:w,wrappedEmit:Ve});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:Je,crossOriginIframeMirror:q.crossOriginIframeMirror,crossOriginIframeStyleMirror:q.crossOriginIframeStyleMirror});Ye=new Be({recordCanvas:C,mutationCb:J,win:window,blockClass:r,blockSelector:a,mirror:Je,sampling:I.canvas,dataURLOptions:b});const Q=new Ce({mutationCb:V,scrollCb:H,bypassOptions:{blockClass:r,blockSelector:a,maskTextClass:l,maskTextSelector:d,inlineStylesheet:c,maskInputOptions:O,dataURLOptions:b,maskTextFn:m,maskInputFn:g,recordCanvas:C,inlineImages:k,sampling:I,slimDOMOptions:D,iframeManager:q,stylesheetManager:P,canvasManager:Ye,keepIframeSrcFn:R},mirror:Je});Ke=(e=!1)=>{var t,n,s,o,h,u;Ve(Ge({type:K.Meta,data:{href:window.location.href,width:z(),height:F()}}),e),P.reset(),se.forEach(e=>e.lock());const p=function(e,t){var n=t||{},s=n.mirror,r=void 0===s?new i:s,a=n.blockClass,o=void 0===a?"rr-block":a,l=n.blockSelector,d=void 0===l?null:l,c=n.maskTextClass,h=void 0===c?"rr-mask":c,u=n.maskTextSelector,p=void 0===u?null:u,g=n.inlineStylesheet,m=void 0===g||g,f=n.inlineImages,y=void 0!==f&&f,I=n.recordCanvas,b=void 0!==I&&I,_=n.maskAllInputs,C=void 0!==_&&_,w=n.maskTextFn,v=n.maskInputFn,S=n.slimDOM,k=void 0!==S&&S,A=n.dataURLOptions,E=n.preserveWhiteSpace,R=n.onSerialize,T=n.onIframeLoad,M=n.iframeLoadTimeout,N=n.onStylesheetLoad,O=n.stylesheetLoadTimeout,F=n.keepIframeSrcFn;return x(e,{doc:e,mirror:r,blockClass:o,blockSelector:d,maskTextClass:h,maskTextSelector:p,skipChild:!1,inlineStylesheet:m,maskInputOptions:!0===C?{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,password:!0}:!1===C?{password:!0}:C,maskTextFn:w,maskInputFn:v,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:A,inlineImages:y,recordCanvas:b,preserveWhiteSpace:E,onSerialize:R,onIframeLoad:T,iframeLoadTimeout:M,onStylesheetLoad:N,stylesheetLoadTimeout:O,keepIframeSrcFn:void 0===F?function(){return!1}:F,newlyAddedElement:!1})}(document,{mirror:Je,blockClass:r,blockSelector:a,maskTextClass:l,maskTextSelector:d,inlineStylesheet:c,maskAllInputs:O,maskTextFn:m,slimDOM:D,dataURLOptions:b,recordCanvas:C,inlineImages:k,onSerialize:e=>{B(e,Je)&&q.addIframe(e),W(e,Je)&&P.trackLinkElement(e),G(e)&&Q.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{q.attachIframe(e,t),Q.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{P.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!p)return console.warn("Failed to snapshot the document");Ve(Ge({type:K.FullSnapshot,data:{node:p,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(s=null===document||void 0===document?void 0:document.body)||void 0===s?void 0:s.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(h=null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.parentElement)||void 0===h?void 0:h.scrollTop)||(null===(u=null===document||void 0===document?void 0:document.body)||void 0===u?void 0:u.scrollTop)||0}}})),se.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&P.adoptStyleSheets(document.adoptedStyleSheets,Je.getId(document))};try{const e=[];e.push(E("DOMContentLoaded",()=>{Ve(Ge({type:K.DomContentLoaded,data:{}}))}));const t=e=>{var t;return Ie({mutationCb:V,mousemoveCb:(e,t)=>Ve(Ge({type:K.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Ve(Ge({type:K.IncrementalSnapshot,data:Object.assign({source:Y.MouseInteraction},e)})),scrollCb:H,viewportResizeCb:e=>Ve(Ge({type:K.IncrementalSnapshot,data:Object.assign({source:Y.ViewportResize},e)})),inputCb:e=>Ve(Ge({type:K.IncrementalSnapshot,data:Object.assign({source:Y.Input},e)})),mediaInteractionCb:e=>Ve(Ge({type:K.IncrementalSnapshot,data:Object.assign({source:Y.MediaInteraction},e)})),styleSheetRuleCb:e=>Ve(Ge({type:K.IncrementalSnapshot,data:Object.assign({source:Y.StyleSheetRule},e)})),styleDeclarationCb:e=>Ve(Ge({type:K.IncrementalSnapshot,data:Object.assign({source:Y.StyleDeclaration},e)})),canvasMutationCb:J,fontCb:e=>Ve(Ge({type:K.IncrementalSnapshot,data:Object.assign({source:Y.Font},e)})),selectionCb:e=>{Ve(Ge({type:K.IncrementalSnapshot,data:Object.assign({source:Y.Selection},e)}))},blockClass:r,ignoreClass:o,maskTextClass:l,maskTextSelector:d,maskInputOptions:O,inlineStylesheet:c,sampling:I,recordCanvas:C,inlineImages:k,userTriggeredOnInput:v,collectFonts:S,doc:e,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:R,blockSelector:a,slimDOMOptions:D,dataURLOptions:b,mirror:Je,iframeManager:q,stylesheetManager:P,shadowDomManager:Q,canvasManager:Ye,ignoreCSSAttributes:T,plugins:(null===(t=null==A?void 0:A.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Ve(Ge({type:K.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},f)};q.addLoadListener(n=>{e.push(t(n.contentDocument))});const n=()=>{Ke(),e.push(t(document)),He=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(E("load",()=>{Ve(Ge({type:K.Load,data:{}})),n()},window)),()=>{e.forEach(e=>e()),He=!1}}catch(e){console.warn(e)}}Pe.addCustomEvent=(e,t)=>{if(!He)throw new Error("please add custom event after start recording");Ve(Ge({type:K.Custom,data:{tag:e,payload:t}}))},Pe.freezePage=()=>{se.forEach(e=>e.freeze())},Pe.takeFullSnapshot=e=>{if(!He)throw new Error("please take full snapshot after start recording");Ke(e)},Pe.mirror=Je;function qe(e){let t=e.length;for(;--t>=0;)e[t]=0}const Qe=256,je=286,Xe=30,$e=15,et=new Uint8Array([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]),tt=new Uint8Array([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]),nt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),st=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rt=new Array(576);qe(rt);const it=new Array(60);qe(it);const at=new Array(512);qe(at);const ot=new Array(256);qe(ot);const lt=new Array(29);qe(lt);const dt=new Array(Xe);function ct(e,t,n,s,r){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=s,this.max_length=r,this.has_stree=e&&e.length}let ht,ut,pt;function gt(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}qe(dt);const mt=e=>e<256?at[e]:at[256+(e>>>7)],ft=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},yt=(e,t,n)=>{e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,ft(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},It=(e,t,n)=>{yt(e,n[2*t],n[2*t+1])},bt=(e,t)=>{let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1},_t=(e,t,n)=>{const s=new Array(16);let r,i,a=0;for(r=1;r<=$e;r++)a=a+n[r-1]<<1,s[r]=a;for(i=0;i<=t;i++){let t=e[2*i+1];0!==t&&(e[2*i]=bt(s[t]++,t))}},Ct=e=>{let t;for(t=0;t<je;t++)e.dyn_ltree[2*t]=0;for(t=0;t<Xe;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},wt=e=>{e.bi_valid>8?ft(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},vt=(e,t,n,s)=>{const r=2*t,i=2*n;return e[r]<e[i]||e[r]===e[i]&&s[t]<=s[n]},St=(e,t,n)=>{const s=e.heap[n];let r=n<<1;for(;r<=e.heap_len&&(r<e.heap_len&&vt(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!vt(t,s,e.heap[r],e.depth));)e.heap[n]=e.heap[r],n=r,r<<=1;e.heap[n]=s},kt=(e,t,n)=>{let s,r,i,a,o=0;if(0!==e.sym_next)do{s=255&e.pending_buf[e.sym_buf+o++],s+=(255&e.pending_buf[e.sym_buf+o++])<<8,r=e.pending_buf[e.sym_buf+o++],0===s?It(e,r,t):(i=ot[r],It(e,i+Qe+1,t),a=et[i],0!==a&&(r-=lt[i],yt(e,r,a)),s--,i=mt(s),It(e,i,n),a=tt[i],0!==a&&(s-=dt[i],yt(e,s,a)))}while(o<e.sym_next);It(e,256,t)},At=(e,t)=>{const n=t.dyn_tree,s=t.stat_desc.static_tree,r=t.stat_desc.has_stree,i=t.stat_desc.elems;let a,o,l,d=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<i;a++)0!==n[2*a]?(e.heap[++e.heap_len]=d=a,e.depth[a]=0):n[2*a+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=d<2?++d:0,n[2*l]=1,e.depth[l]=0,e.opt_len--,r&&(e.static_len-=s[2*l+1]);for(t.max_code=d,a=e.heap_len>>1;a>=1;a--)St(e,n,a);l=i;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],St(e,n,1),o=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=o,n[2*l]=n[2*a]+n[2*o],e.depth[l]=(e.depth[a]>=e.depth[o]?e.depth[a]:e.depth[o])+1,n[2*a+1]=n[2*o+1]=l,e.heap[1]=l++,St(e,n,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const n=t.dyn_tree,s=t.max_code,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,l=t.stat_desc.max_length;let d,c,h,u,p,g,m=0;for(u=0;u<=$e;u++)e.bl_count[u]=0;for(n[2*e.heap[e.heap_max]+1]=0,d=e.heap_max+1;d<573;d++)c=e.heap[d],u=n[2*n[2*c+1]+1]+1,u>l&&(u=l,m++),n[2*c+1]=u,c>s||(e.bl_count[u]++,p=0,c>=o&&(p=a[c-o]),g=n[2*c],e.opt_len+=g*(u+p),i&&(e.static_len+=g*(r[2*c+1]+p)));if(0!==m){do{for(u=l-1;0===e.bl_count[u];)u--;e.bl_count[u]--,e.bl_count[u+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(u=l;0!==u;u--)for(c=e.bl_count[u];0!==c;)h=e.heap[--d],h>s||(n[2*h+1]!==u&&(e.opt_len+=(u-n[2*h+1])*n[2*h],n[2*h+1]=u),c--)}})(e,t),_t(n,d,e.bl_count)},xt=(e,t,n)=>{let s,r,i=-1,a=t[1],o=0,l=7,d=4;for(0===a&&(l=138,d=3),t[2*(n+1)+1]=65535,s=0;s<=n;s++)r=a,a=t[2*(s+1)+1],++o<l&&r===a||(o<d?e.bl_tree[2*r]+=o:0!==r?(r!==i&&e.bl_tree[2*r]++,e.bl_tree[32]++):o<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=0,i=r,0===a?(l=138,d=3):r===a?(l=6,d=3):(l=7,d=4))},Et=(e,t,n)=>{let s,r,i=-1,a=t[1],o=0,l=7,d=4;for(0===a&&(l=138,d=3),s=0;s<=n;s++)if(r=a,a=t[2*(s+1)+1],!(++o<l&&r===a)){if(o<d)do{It(e,r,e.bl_tree)}while(0!==--o);else 0!==r?(r!==i&&(It(e,r,e.bl_tree),o--),It(e,16,e.bl_tree),yt(e,o-3,2)):o<=10?(It(e,17,e.bl_tree),yt(e,o-3,3)):(It(e,18,e.bl_tree),yt(e,o-11,7));o=0,i=r,0===a?(l=138,d=3):r===a?(l=6,d=3):(l=7,d=4)}};let Rt=!1;const Tt=(e,t,n,s)=>{yt(e,0+(s?1:0),3),wt(e),ft(e,n),ft(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n};var Mt=(e,t,n,s)=>{let r,i,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<Qe;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),At(e,e.l_desc),At(e,e.d_desc),a=(e=>{let t;for(xt(e,e.dyn_ltree,e.l_desc.max_code),xt(e,e.dyn_dtree,e.d_desc.max_code),At(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*st[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),r=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=r&&(r=i)):r=i=n+5,n+4<=r&&-1!==t?Tt(e,t,n,s):4===e.strategy||i===r?(yt(e,2+(s?1:0),3),kt(e,rt,it)):(yt(e,4+(s?1:0),3),((e,t,n,s)=>{let r;for(yt(e,t-257,5),yt(e,n-1,5),yt(e,s-4,4),r=0;r<s;r++)yt(e,e.bl_tree[2*st[r]+1],3);Et(e,e.dyn_ltree,t-1),Et(e,e.dyn_dtree,n-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),kt(e,e.dyn_ltree,e.dyn_dtree)),Ct(e),s&&wt(e)},Nt={_tr_init:e=>{Rt||((()=>{let e,t,n,s,r;const i=new Array(16);for(n=0,s=0;s<28;s++)for(lt[s]=n,e=0;e<1<<et[s];e++)ot[n++]=s;for(ot[n-1]=s,r=0,s=0;s<16;s++)for(dt[s]=r,e=0;e<1<<tt[s];e++)at[r++]=s;for(r>>=7;s<Xe;s++)for(dt[s]=r<<7,e=0;e<1<<tt[s]-7;e++)at[256+r++]=s;for(t=0;t<=$e;t++)i[t]=0;for(e=0;e<=143;)rt[2*e+1]=8,e++,i[8]++;for(;e<=255;)rt[2*e+1]=9,e++,i[9]++;for(;e<=279;)rt[2*e+1]=7,e++,i[7]++;for(;e<=287;)rt[2*e+1]=8,e++,i[8]++;for(_t(rt,287,i),e=0;e<Xe;e++)it[2*e+1]=5,it[2*e]=bt(e,5);ht=new ct(rt,et,257,je,$e),ut=new ct(it,tt,0,Xe,$e),pt=new ct(new Array(0),nt,0,19,7)})(),Rt=!0),e.l_desc=new gt(e.dyn_ltree,ht),e.d_desc=new gt(e.dyn_dtree,ut),e.bl_desc=new gt(e.bl_tree,pt),e.bi_buf=0,e.bi_valid=0,Ct(e)},_tr_stored_block:Tt,_tr_flush_block:Mt,_tr_tally:(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(ot[n]+Qe+1)]++,e.dyn_dtree[2*mt(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{yt(e,2,3),It(e,256,rt),(e=>{16===e.bi_valid?(ft(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)})(e)}};var Ot=(e,t,n,s)=>{let r=65535&e,i=e>>>16&65535,a=0;for(;0!==n;){a=n>2e3?2e3:n,n-=a;do{r=r+t[s++]|0,i=i+r|0}while(--a);r%=65521,i%=65521}return r|i<<16};const Ft=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var s=0;s<8;s++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var zt=(e,t,n,s)=>{const r=Ft,i=s+n;e^=-1;for(let n=s;n<i;n++)e=e>>>8^r[255&(e^t[n])];return-1^e},Dt={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"},Lt={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_MEM_ERROR:-4,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};const{_tr_init:Zt,_tr_stored_block:Ut,_tr_flush_block:Bt,_tr_tally:Wt,_tr_align:Gt}=Nt,{Z_NO_FLUSH:Vt,Z_PARTIAL_FLUSH:Kt,Z_FULL_FLUSH:Yt,Z_FINISH:Ht,Z_BLOCK:Jt,Z_OK:Pt,Z_STREAM_END:qt,Z_STREAM_ERROR:Qt,Z_DATA_ERROR:jt,Z_BUF_ERROR:Xt,Z_DEFAULT_COMPRESSION:$t,Z_FILTERED:en,Z_HUFFMAN_ONLY:tn,Z_RLE:nn,Z_FIXED:sn,Z_DEFAULT_STRATEGY:rn,Z_UNKNOWN:an,Z_DEFLATED:on}=Lt,ln=258,dn=262,cn=42,hn=113,un=666,pn=(e,t)=>(e.msg=Dt[t],t),gn=e=>2*e-(e>4?9:0),mn=e=>{let t=e.length;for(;--t>=0;)e[t]=0},fn=e=>{let t,n,s,r=e.w_size;t=e.hash_size,s=t;do{n=e.head[--s],e.head[s]=n>=r?n-r:0}while(--t);t=r,s=t;do{n=e.prev[--s],e.prev[s]=n>=r?n-r:0}while(--t)};let yn=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const In=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(e.output.set(t.pending_buf.subarray(t.pending_out,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))},bn=(e,t)=>{Bt(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,In(e.strm)},_n=(e,t)=>{e.pending_buf[e.pending++]=t},Cn=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},wn=(e,t,n,s)=>{let r=e.avail_in;return r>s&&(r=s),0===r?0:(e.avail_in-=r,t.set(e.input.subarray(e.next_in,e.next_in+r),n),1===e.state.wrap?e.adler=Ot(e.adler,t,r,n):2===e.state.wrap&&(e.adler=zt(e.adler,t,r,n)),e.next_in+=r,e.total_in+=r,r)},vn=(e,t)=>{let n,s,r=e.max_chain_length,i=e.strstart,a=e.prev_length,o=e.nice_match;const l=e.strstart>e.w_size-dn?e.strstart-(e.w_size-dn):0,d=e.window,c=e.w_mask,h=e.prev,u=e.strstart+ln;let p=d[i+a-1],g=d[i+a];e.prev_length>=e.good_match&&(r>>=2),o>e.lookahead&&(o=e.lookahead);do{if(n=t,d[n+a]===g&&d[n+a-1]===p&&d[n]===d[i]&&d[++n]===d[i+1]){i+=2,n++;do{}while(d[++i]===d[++n]&&d[++i]===d[++n]&&d[++i]===d[++n]&&d[++i]===d[++n]&&d[++i]===d[++n]&&d[++i]===d[++n]&&d[++i]===d[++n]&&d[++i]===d[++n]&&i<u);if(s=ln-(u-i),i=u-ln,s>a){if(e.match_start=t,a=s,s>=o)break;p=d[i+a-1],g=d[i+a]}}}while((t=h[t&c])>l&&0!==--r);return a<=e.lookahead?a:e.lookahead},Sn=e=>{const t=e.w_size;let n,s,r;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-dn)&&(e.window.set(e.window.subarray(t,t+t-s),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),fn(e),s+=t),0===e.strm.avail_in)break;if(n=wn(e.strm,e.window,e.strstart+e.lookahead,s),e.lookahead+=n,e.lookahead+e.insert>=3)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=yn(e,e.ins_h,e.window[r+1]);e.insert&&(e.ins_h=yn(e,e.ins_h,e.window[r+3-1]),e.prev[r&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=r,r++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<dn&&0!==e.strm.avail_in)},kn=(e,t)=>{let n,s,r,i=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,o=e.strm.avail_in;do{if(n=65535,r=e.bi_valid+42>>3,e.strm.avail_out<r)break;if(r=e.strm.avail_out-r,s=e.strstart-e.block_start,n>s+e.strm.avail_in&&(n=s+e.strm.avail_in),n>r&&(n=r),n<i&&(0===n&&t!==Ht||t===Vt||n!==s+e.strm.avail_in))break;a=t===Ht&&n===s+e.strm.avail_in?1:0,Ut(e,0,0,a),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,In(e.strm),s&&(s>n&&(s=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+s),e.strm.next_out),e.strm.next_out+=s,e.strm.avail_out-=s,e.strm.total_out+=s,e.block_start+=s,n-=s),n&&(wn(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(0===a);return o-=e.strm.avail_in,o&&(o>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=o&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-o,e.strm.next_in),e.strstart),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?4:t!==Vt&&t!==Ht&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(r=e.window_size-e.strstart,e.strm.avail_in>r&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,r+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),r>e.strm.avail_in&&(r=e.strm.avail_in),r&&(wn(e.strm,e.window,e.strstart,r),e.strstart+=r,e.insert+=r>e.w_size-e.insert?e.w_size-e.insert:r),e.high_water<e.strstart&&(e.high_water=e.strstart),r=e.bi_valid+42>>3,r=e.pending_buf_size-r>65535?65535:e.pending_buf_size-r,i=r>e.w_size?e.w_size:r,s=e.strstart-e.block_start,(s>=i||(s||t===Ht)&&t!==Vt&&0===e.strm.avail_in&&s<=r)&&(n=s>r?r:s,a=t===Ht&&0===e.strm.avail_in&&n===s?1:0,Ut(e,e.block_start,n,a),e.block_start+=n,In(e.strm)),a?3:1)},An=(e,t)=>{let n,s;for(;;){if(e.lookahead<dn){if(Sn(e),e.lookahead<dn&&t===Vt)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=yn(e,e.ins_h,e.window[e.strstart+3-1]),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-dn&&(e.match_length=vn(e,n)),e.match_length>=3)if(s=Wt(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=yn(e,e.ins_h,e.window[e.strstart+3-1]),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=yn(e,e.ins_h,e.window[e.strstart+1]);else s=Wt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(s&&(bn(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Ht?(bn(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(bn(e,!1),0===e.strm.avail_out)?1:2},xn=(e,t)=>{let n,s,r;for(;;){if(e.lookahead<dn){if(Sn(e),e.lookahead<dn&&t===Vt)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=yn(e,e.ins_h,e.window[e.strstart+3-1]),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=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-dn&&(e.match_length=vn(e,n),e.match_length<=5&&(e.strategy===en||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-3,s=Wt(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=r&&(e.ins_h=yn(e,e.ins_h,e.window[e.strstart+3-1]),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=2,e.strstart++,s&&(bn(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(s=Wt(e,0,e.window[e.strstart-1]),s&&bn(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(s=Wt(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Ht?(bn(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(bn(e,!1),0===e.strm.avail_out)?1:2};function En(e,t,n,s,r){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=s,this.func=r}const Rn=[new En(0,0,0,0,kn),new En(4,4,8,4,An),new En(4,5,16,8,An),new En(4,6,32,32,An),new En(4,4,16,16,xn),new En(8,16,32,32,xn),new En(8,16,128,128,xn),new En(8,32,128,256,xn),new En(32,128,258,1024,xn),new En(32,258,258,4096,xn)];function Tn(){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=on,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 Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),mn(this.dyn_ltree),mn(this.dyn_dtree),mn(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),mn(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mn(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Mn=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==cn&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==hn&&t.status!==un?1:0},Nn=e=>{if(Mn(e))return pn(e,Qt);e.total_in=e.total_out=0,e.data_type=an;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?cn:hn,e.adler=2===t.wrap?0:1,t.last_flush=-2,Zt(t),Pt},On=e=>{const t=Nn(e);var n;return t===Pt&&((n=e.state).window_size=2*n.w_size,mn(n.head),n.max_lazy_match=Rn[n.level].max_lazy,n.good_match=Rn[n.level].good_length,n.nice_match=Rn[n.level].nice_length,n.max_chain_length=Rn[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),t},Fn=(e,t,n,s,r,i)=>{if(!e)return Qt;let a=1;if(t===$t&&(t=6),s<0?(a=0,s=-s):s>15&&(a=2,s-=16),r<1||r>9||n!==on||s<8||s>15||t<0||t>9||i<0||i>sn||8===s&&1!==a)return pn(e,Qt);8===s&&(s=9);const o=new Tn;return e.state=o,o.strm=e,o.status=cn,o.wrap=a,o.gzhead=null,o.w_bits=s,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=r+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<r+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=t,o.strategy=i,o.method=n,On(e)};var zn={deflateInit:(e,t)=>Fn(e,t,on,15,8,rn),deflateInit2:Fn,deflateReset:On,deflateResetKeep:Nn,deflateSetHeader:(e,t)=>Mn(e)||2!==e.state.wrap?Qt:(e.state.gzhead=t,Pt),deflate:(e,t)=>{if(Mn(e)||t>Jt||t<0)return e?pn(e,Qt):Qt;const n=e.state;if(!e.output||0!==e.avail_in&&!e.input||n.status===un&&t!==Ht)return pn(e,0===e.avail_out?Xt:Qt);const s=n.last_flush;if(n.last_flush=t,0!==n.pending){if(In(e),0===e.avail_out)return n.last_flush=-1,Pt}else if(0===e.avail_in&&gn(t)<=gn(s)&&t!==Ht)return pn(e,Xt);if(n.status===un&&0!==e.avail_in)return pn(e,Xt);if(n.status===cn&&0===n.wrap&&(n.status=hn),n.status===cn){let t=on+(n.w_bits-8<<4)<<8,s=-1;if(s=n.strategy>=tn||n.level<2?0:n.level<6?1:6===n.level?2:3,t|=s<<6,0!==n.strstart&&(t|=32),t+=31-t%31,Cn(n,t),0!==n.strstart&&(Cn(n,e.adler>>>16),Cn(n,65535&e.adler)),e.adler=1,n.status=hn,In(e),0!==n.pending)return n.last_flush=-1,Pt}if(57===n.status)if(e.adler=0,_n(n,31),_n(n,139),_n(n,8),n.gzhead)_n(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),_n(n,255&n.gzhead.time),_n(n,n.gzhead.time>>8&255),_n(n,n.gzhead.time>>16&255),_n(n,n.gzhead.time>>24&255),_n(n,9===n.level?2:n.strategy>=tn||n.level<2?4:0),_n(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(_n(n,255&n.gzhead.extra.length),_n(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=zt(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(_n(n,0),_n(n,0),_n(n,0),_n(n,0),_n(n,0),_n(n,9===n.level?2:n.strategy>=tn||n.level<2?4:0),_n(n,3),n.status=hn,In(e),0!==n.pending)return n.last_flush=-1,Pt;if(69===n.status){if(n.gzhead.extra){let t=n.pending,s=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+s>n.pending_buf_size;){let r=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>t&&(e.adler=zt(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex+=r,In(e),0!==n.pending)return n.last_flush=-1,Pt;t=0,s-=r}let r=new Uint8Array(n.gzhead.extra);n.pending_buf.set(r.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending+=s,n.gzhead.hcrc&&n.pending>t&&(e.adler=zt(e.adler,n.pending_buf,n.pending-t,t)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let t,s=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>s&&(e.adler=zt(e.adler,n.pending_buf,n.pending-s,s)),In(e),0!==n.pending)return n.last_flush=-1,Pt;s=0}t=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,_n(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>s&&(e.adler=zt(e.adler,n.pending_buf,n.pending-s,s)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let t,s=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>s&&(e.adler=zt(e.adler,n.pending_buf,n.pending-s,s)),In(e),0!==n.pending)return n.last_flush=-1,Pt;s=0}t=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,_n(n,t)}while(0!==t);n.gzhead.hcrc&&n.pending>s&&(e.adler=zt(e.adler,n.pending_buf,n.pending-s,s))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(In(e),0!==n.pending))return n.last_flush=-1,Pt;_n(n,255&e.adler),_n(n,e.adler>>8&255),e.adler=0}if(n.status=hn,In(e),0!==n.pending)return n.last_flush=-1,Pt}if(0!==e.avail_in||0!==n.lookahead||t!==Vt&&n.status!==un){let s=0===n.level?kn(n,t):n.strategy===tn?((e,t)=>{let n;for(;;){if(0===e.lookahead&&(Sn(e),0===e.lookahead)){if(t===Vt)return 1;break}if(e.match_length=0,n=Wt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(bn(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Ht?(bn(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(bn(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===nn?((e,t)=>{let n,s,r,i;const a=e.window;for(;;){if(e.lookahead<=ln){if(Sn(e),e.lookahead<=ln&&t===Vt)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(r=e.strstart-1,s=a[r],s===a[++r]&&s===a[++r]&&s===a[++r])){i=e.strstart+ln;do{}while(s===a[++r]&&s===a[++r]&&s===a[++r]&&s===a[++r]&&s===a[++r]&&s===a[++r]&&s===a[++r]&&s===a[++r]&&r<i);e.match_length=ln-(i-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=Wt(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Wt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(bn(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Ht?(bn(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(bn(e,!1),0===e.strm.avail_out)?1:2})(n,t):Rn[n.level].func(n,t);if(3!==s&&4!==s||(n.status=un),1===s||3===s)return 0===e.avail_out&&(n.last_flush=-1),Pt;if(2===s&&(t===Kt?Gt(n):t!==Jt&&(Ut(n,0,0,!1),t===Yt&&(mn(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),In(e),0===e.avail_out))return n.last_flush=-1,Pt}return t!==Ht?Pt:n.wrap<=0?qt:(2===n.wrap?(_n(n,255&e.adler),_n(n,e.adler>>8&255),_n(n,e.adler>>16&255),_n(n,e.adler>>24&255),_n(n,255&e.total_in),_n(n,e.total_in>>8&255),_n(n,e.total_in>>16&255),_n(n,e.total_in>>24&255)):(Cn(n,e.adler>>>16),Cn(n,65535&e.adler)),In(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?Pt:qt)},deflateEnd:e=>{if(Mn(e))return Qt;const t=e.state.status;return e.state=null,t===hn?pn(e,jt):Pt},deflateSetDictionary:(e,t)=>{let n=t.length;if(Mn(e))return Qt;const s=e.state,r=s.wrap;if(2===r||1===r&&s.status!==cn||s.lookahead)return Qt;if(1===r&&(e.adler=Ot(e.adler,t,n,0)),s.wrap=0,n>=s.w_size){0===r&&(mn(s.head),s.strstart=0,s.block_start=0,s.insert=0);let e=new Uint8Array(s.w_size);e.set(t.subarray(n-s.w_size,n),0),t=e,n=s.w_size}const i=e.avail_in,a=e.next_in,o=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Sn(s);s.lookahead>=3;){let e=s.strstart,t=s.lookahead-2;do{s.ins_h=yn(s,s.ins_h,s.window[e+3-1]),s.prev[e&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=e,e++}while(--t);s.strstart=e,s.lookahead=2,Sn(s)}return s.strstart+=s.lookahead,s.block_start=s.strstart,s.insert=s.lookahead,s.lookahead=0,s.match_length=s.prev_length=2,s.match_available=0,e.next_in=a,e.input=o,e.avail_in=i,s.wrap=r,Pt},deflateInfo:"pako deflate (from Nodeca project)"};const Dn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Ln=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)Dn(n,t)&&(e[t]=n[t])}}return e},Zn=e=>{let t=0;for(let n=0,s=e.length;n<s;n++)t+=e[n].length;const n=new Uint8Array(t);for(let t=0,s=0,r=e.length;t<r;t++){let r=e[t];n.set(r,s),s+=r.length}return n};let Un=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Un=!1}const Bn=new Uint8Array(256);for(let e=0;e<256;e++)Bn[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Bn[254]=Bn[254]=1;var Wn=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,s,r,i,a=e.length,o=0;for(r=0;r<a;r++)n=e.charCodeAt(r),55296==(64512&n)&&r+1<a&&(s=e.charCodeAt(r+1),56320==(64512&s)&&(n=65536+(n-55296<<10)+(s-56320),r++)),o+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(o),i=0,r=0;i<o;r++)n=e.charCodeAt(r),55296==(64512&n)&&r+1<a&&(s=e.charCodeAt(r+1),56320==(64512&s)&&(n=65536+(n-55296<<10)+(s-56320),r++)),n<128?t[i++]=n:n<2048?(t[i++]=192|n>>>6,t[i++]=128|63&n):n<65536?(t[i++]=224|n>>>12,t[i++]=128|n>>>6&63,t[i++]=128|63&n):(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63,t[i++]=128|n>>>6&63,t[i++]=128|63&n);return t},Gn=(e,t)=>{const n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let s,r;const i=new Array(2*n);for(r=0,s=0;s<n;){let t=e[s++];if(t<128){i[r++]=t;continue}let a=Bn[t];if(a>4)i[r++]=65533,s+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&s<n;)t=t<<6|63&e[s++],a--;a>1?i[r++]=65533:t<65536?i[r++]=t:(t-=65536,i[r++]=55296|t>>10&1023,i[r++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Un)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let s=0;s<t;s++)n+=String.fromCharCode(e[s]);return n})(i,r)},Vn=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+Bn[e[n]]>t?n:t};var Kn=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Yn=Object.prototype.toString,{Z_NO_FLUSH:Hn,Z_SYNC_FLUSH:Jn,Z_FULL_FLUSH:Pn,Z_FINISH:qn,Z_OK:Qn,Z_STREAM_END:jn,Z_DEFAULT_COMPRESSION:Xn,Z_DEFAULT_STRATEGY:$n,Z_DEFLATED:es}=Lt;function ts(e){this.options=Ln({level:Xn,method:es,chunkSize:16384,windowBits:15,memLevel:8,strategy:$n},e||{});let 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 Kn,this.strm.avail_out=0;let n=zn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Qn)throw new Error(Dt[n]);if(t.header&&zn.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Wn(t.dictionary):"[object ArrayBuffer]"===Yn.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,n=zn.deflateSetDictionary(this.strm,e),n!==Qn)throw new Error(Dt[n]);this._dict_set=!0}}function ns(e,t){const n=new ts(t);if(n.push(e,!0),n.err)throw n.msg||Dt[n.err];return n.result}ts.prototype.push=function(e,t){const n=this.strm,s=this.options.chunkSize;let r,i;if(this.ended)return!1;for(i=t===~~t?t:!0===t?qn:Hn,"string"==typeof e?n.input=Wn(e):"[object ArrayBuffer]"===Yn.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(s),n.next_out=0,n.avail_out=s),(i===Jn||i===Pn)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(r=zn.deflate(n,i),r===jn)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=zn.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Qn;if(0!==n.avail_out){if(i>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},ts.prototype.onData=function(e){this.chunks.push(e)},ts.prototype.onEnd=function(e){e===Qn&&(this.result=Zn(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ss={Deflate:ts,deflate:ns,deflateRaw:function(e,t){return(t=t||{}).raw=!0,ns(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,ns(e,t)}};const rs=16209;var is=function(e,t){let n,s,r,i,a,o,l,d,c,h,u,p,g,m,f,y,I,b,_,C,w,v,S,k;const A=e.state;n=e.next_in,S=e.input,s=n+(e.avail_in-5),r=e.next_out,k=e.output,i=r-(t-e.avail_out),a=r+(e.avail_out-257),o=A.dmax,l=A.wsize,d=A.whave,c=A.wnext,h=A.window,u=A.hold,p=A.bits,g=A.lencode,m=A.distcode,f=(1<<A.lenbits)-1,y=(1<<A.distbits)-1;e:do{p<15&&(u+=S[n++]<<p,p+=8,u+=S[n++]<<p,p+=8),I=g[u&f];t:for(;;){if(b=I>>>24,u>>>=b,p-=b,b=I>>>16&255,0===b)k[r++]=65535&I;else{if(!(16&b)){if(64&b){if(32&b){A.mode=16191;break e}e.msg="invalid literal/length code",A.mode=rs;break e}I=g[(65535&I)+(u&(1<<b)-1)];continue t}for(_=65535&I,b&=15,b&&(p<b&&(u+=S[n++]<<p,p+=8),_+=u&(1<<b)-1,u>>>=b,p-=b),p<15&&(u+=S[n++]<<p,p+=8,u+=S[n++]<<p,p+=8),I=m[u&y];;){if(b=I>>>24,u>>>=b,p-=b,b=I>>>16&255,16&b){if(C=65535&I,b&=15,p<b&&(u+=S[n++]<<p,p+=8,p<b&&(u+=S[n++]<<p,p+=8)),C+=u&(1<<b)-1,C>o){e.msg="invalid distance too far back",A.mode=rs;break e}if(u>>>=b,p-=b,b=r-i,C>b){if(b=C-b,b>d&&A.sane){e.msg="invalid distance too far back",A.mode=rs;break e}if(w=0,v=h,0===c){if(w+=l-b,b<_){_-=b;do{k[r++]=h[w++]}while(--b);w=r-C,v=k}}else if(c<b){if(w+=l+c-b,b-=c,b<_){_-=b;do{k[r++]=h[w++]}while(--b);if(w=0,c<_){b=c,_-=b;do{k[r++]=h[w++]}while(--b);w=r-C,v=k}}}else if(w+=c-b,b<_){_-=b;do{k[r++]=h[w++]}while(--b);w=r-C,v=k}for(;_>2;)k[r++]=v[w++],k[r++]=v[w++],k[r++]=v[w++],_-=3;_&&(k[r++]=v[w++],_>1&&(k[r++]=v[w++]))}else{w=r-C;do{k[r++]=k[w++],k[r++]=k[w++],k[r++]=k[w++],_-=3}while(_>2);_&&(k[r++]=k[w++],_>1&&(k[r++]=k[w++]))}break}if(64&b){e.msg="invalid distance code",A.mode=rs;break e}I=m[(65535&I)+(u&(1<<b)-1)]}}break}}while(n<s&&r<a);_=p>>3,n-=_,p-=_<<3,u&=(1<<p)-1,e.next_in=n,e.next_out=r,e.avail_in=n<s?s-n+5:5-(n-s),e.avail_out=r<a?a-r+257:257-(r-a),A.hold=u,A.bits=p};const as=15,os=new Uint16Array([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]),ls=new Uint8Array([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]),ds=new Uint16Array([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]),cs=new Uint8Array([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]);var hs=(e,t,n,s,r,i,a,o)=>{const l=o.bits;let d,c,h,u,p,g,m=0,f=0,y=0,I=0,b=0,_=0,C=0,w=0,v=0,S=0,k=null;const A=new Uint16Array(16),x=new Uint16Array(16);let E,R,T,M=null;for(m=0;m<=as;m++)A[m]=0;for(f=0;f<s;f++)A[t[n+f]]++;for(b=l,I=as;I>=1&&0===A[I];I--);if(b>I&&(b=I),0===I)return r[i++]=20971520,r[i++]=20971520,o.bits=1,0;for(y=1;y<I&&0===A[y];y++);for(b<y&&(b=y),w=1,m=1;m<=as;m++)if(w<<=1,w-=A[m],w<0)return-1;if(w>0&&(0===e||1!==I))return-1;for(x[1]=0,m=1;m<as;m++)x[m+1]=x[m]+A[m];for(f=0;f<s;f++)0!==t[n+f]&&(a[x[t[n+f]]++]=f);if(0===e?(k=M=a,g=20):1===e?(k=os,M=ls,g=257):(k=ds,M=cs,g=0),S=0,f=0,m=y,p=i,_=b,C=0,h=-1,v=1<<b,u=v-1,1===e&&v>852||2===e&&v>592)return 1;for(;;){E=m-C,a[f]+1<g?(R=0,T=a[f]):a[f]>=g?(R=M[a[f]-g],T=k[a[f]-g]):(R=96,T=0),d=1<<m-C,c=1<<_,y=c;do{c-=d,r[p+(S>>C)+c]=E<<24|R<<16|T}while(0!==c);for(d=1<<m-1;S&d;)d>>=1;if(0!==d?(S&=d-1,S+=d):S=0,f++,0===--A[m]){if(m===I)break;m=t[n+a[f]]}if(m>b&&(S&u)!==h){for(0===C&&(C=b),p+=y,_=m-C,w=1<<_;_+C<I&&(w-=A[_+C],!(w<=0));)_++,w<<=1;if(v+=1<<_,1===e&&v>852||2===e&&v>592)return 1;h=S&u,r[h]=b<<24|_<<16|p-i}}return 0!==S&&(r[p+S]=m-C<<24|64<<16),o.bits=b,0};const{Z_FINISH:us,Z_BLOCK:ps,Z_TREES:gs,Z_OK:ms,Z_STREAM_END:fs,Z_NEED_DICT:ys,Z_STREAM_ERROR:Is,Z_DATA_ERROR:bs,Z_MEM_ERROR:_s,Z_BUF_ERROR:Cs,Z_DEFLATED:ws}=Lt,vs=16180,Ss=16190,ks=16191,As=16192,xs=16194,Es=16199,Rs=16200,Ts=16206,Ms=16209,Ns=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Os(){this.strm=null,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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Fs=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<vs||t.mode>16211?1:0},zs=e=>{if(Fs(e))return Is;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=vs,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,ms},Ds=e=>{if(Fs(e))return Is;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,zs(e)},Ls=(e,t)=>{let n;if(Fs(e))return Is;const s=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Is:(null!==s.window&&s.wbits!==t&&(s.window=null),s.wrap=n,s.wbits=t,Ds(e))},Zs=(e,t)=>{if(!e)return Is;const n=new Os;e.state=n,n.strm=e,n.window=null,n.mode=vs;const s=Ls(e,t);return s!==ms&&(e.state=null),s};let Us,Bs,Ws=!0;const Gs=e=>{if(Ws){Us=new Int32Array(512),Bs=new Int32Array(32);let t=0;for(;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(hs(1,e.lens,0,288,Us,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;hs(2,e.lens,0,32,Bs,0,e.work,{bits:5}),Ws=!1}e.lencode=Us,e.lenbits=9,e.distcode=Bs,e.distbits=5},Vs=(e,t,n,s)=>{let r;const i=e.state;return null===i.window&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),s>=i.wsize?(i.window.set(t.subarray(n-i.wsize,n),0),i.wnext=0,i.whave=i.wsize):(r=i.wsize-i.wnext,r>s&&(r=s),i.window.set(t.subarray(n-s,n-s+r),i.wnext),(s-=r)?(i.window.set(t.subarray(n-s,n),0),i.wnext=s,i.whave=i.wsize):(i.wnext+=r,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=r))),0};var Ks={inflateReset:Ds,inflateReset2:Ls,inflateResetKeep:zs,inflateInit:e=>Zs(e,15),inflateInit2:Zs,inflate:(e,t)=>{let n,s,r,i,a,o,l,d,c,h,u,p,g,m,f,y,I,b,_,C,w,v,S=0;const k=new Uint8Array(4);let A,x;const E=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Fs(e)||!e.output||!e.input&&0!==e.avail_in)return Is;n=e.state,n.mode===ks&&(n.mode=As),a=e.next_out,r=e.output,l=e.avail_out,i=e.next_in,s=e.input,o=e.avail_in,d=n.hold,c=n.bits,h=o,u=l,v=ms;e:for(;;)switch(n.mode){case vs:if(0===n.wrap){n.mode=As;break}for(;c<16;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}if(2&n.wrap&&35615===d){0===n.wbits&&(n.wbits=15),n.check=0,k[0]=255&d,k[1]=d>>>8&255,n.check=zt(n.check,k,2,0),d=0,c=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&d)<<8)+(d>>8))%31){e.msg="incorrect header check",n.mode=Ms;break}if((15&d)!==ws){e.msg="unknown compression method",n.mode=Ms;break}if(d>>>=4,c-=4,w=8+(15&d),0===n.wbits&&(n.wbits=w),w>15||w>n.wbits){e.msg="invalid window size",n.mode=Ms;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=512&d?16189:ks,d=0,c=0;break;case 16181:for(;c<16;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}if(n.flags=d,(255&n.flags)!==ws){e.msg="unknown compression method",n.mode=Ms;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=Ms;break}n.head&&(n.head.text=d>>8&1),512&n.flags&&4&n.wrap&&(k[0]=255&d,k[1]=d>>>8&255,n.check=zt(n.check,k,2,0)),d=0,c=0,n.mode=16182;case 16182:for(;c<32;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}n.head&&(n.head.time=d),512&n.flags&&4&n.wrap&&(k[0]=255&d,k[1]=d>>>8&255,k[2]=d>>>16&255,k[3]=d>>>24&255,n.check=zt(n.check,k,4,0)),d=0,c=0,n.mode=16183;case 16183:for(;c<16;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}n.head&&(n.head.xflags=255&d,n.head.os=d>>8),512&n.flags&&4&n.wrap&&(k[0]=255&d,k[1]=d>>>8&255,n.check=zt(n.check,k,2,0)),d=0,c=0,n.mode=16184;case 16184:if(1024&n.flags){for(;c<16;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}n.length=d,n.head&&(n.head.extra_len=d),512&n.flags&&4&n.wrap&&(k[0]=255&d,k[1]=d>>>8&255,n.check=zt(n.check,k,2,0)),d=0,c=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(p=n.length,p>o&&(p=o),p&&(n.head&&(w=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(s.subarray(i,i+p),w)),512&n.flags&&4&n.wrap&&(n.check=zt(n.check,s,p,i)),o-=p,i+=p,n.length-=p),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===o)break e;p=0;do{w=s[i+p++],n.head&&w&&n.length<65536&&(n.head.name+=String.fromCharCode(w))}while(w&&p<o);if(512&n.flags&&4&n.wrap&&(n.check=zt(n.check,s,p,i)),o-=p,i+=p,w)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===o)break e;p=0;do{w=s[i+p++],n.head&&w&&n.length<65536&&(n.head.comment+=String.fromCharCode(w))}while(w&&p<o);if(512&n.flags&&4&n.wrap&&(n.check=zt(n.check,s,p,i)),o-=p,i+=p,w)break e}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;c<16;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}if(4&n.wrap&&d!==(65535&n.check)){e.msg="header crc mismatch",n.mode=Ms;break}d=0,c=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=ks;break;case 16189:for(;c<32;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}e.adler=n.check=Ns(d),d=0,c=0,n.mode=Ss;case Ss:if(0===n.havedict)return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=o,n.hold=d,n.bits=c,ys;e.adler=n.check=1,n.mode=ks;case ks:if(t===ps||t===gs)break e;case As:if(n.last){d>>>=7&c,c-=7&c,n.mode=Ts;break}for(;c<3;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}switch(n.last=1&d,d>>>=1,c-=1,3&d){case 0:n.mode=16193;break;case 1:if(Gs(n),n.mode=Es,t===gs){d>>>=2,c-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=Ms}d>>>=2,c-=2;break;case 16193:for(d>>>=7&c,c-=7&c;c<32;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}if((65535&d)!=(d>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Ms;break}if(n.length=65535&d,d=0,c=0,n.mode=xs,t===gs)break e;case xs:n.mode=16195;case 16195:if(p=n.length,p){if(p>o&&(p=o),p>l&&(p=l),0===p)break e;r.set(s.subarray(i,i+p),a),o-=p,i+=p,l-=p,a+=p,n.length-=p;break}n.mode=ks;break;case 16196:for(;c<14;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}if(n.nlen=257+(31&d),d>>>=5,c-=5,n.ndist=1+(31&d),d>>>=5,c-=5,n.ncode=4+(15&d),d>>>=4,c-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Ms;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;c<3;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}n.lens[E[n.have++]]=7&d,d>>>=3,c-=3}for(;n.have<19;)n.lens[E[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,A={bits:n.lenbits},v=hs(0,n.lens,0,19,n.lencode,0,n.work,A),n.lenbits=A.bits,v){e.msg="invalid code lengths set",n.mode=Ms;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;S=n.lencode[d&(1<<n.lenbits)-1],f=S>>>24,y=S>>>16&255,I=65535&S,!(f<=c);){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}if(I<16)d>>>=f,c-=f,n.lens[n.have++]=I;else{if(16===I){for(x=f+2;c<x;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}if(d>>>=f,c-=f,0===n.have){e.msg="invalid bit length repeat",n.mode=Ms;break}w=n.lens[n.have-1],p=3+(3&d),d>>>=2,c-=2}else if(17===I){for(x=f+3;c<x;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}d>>>=f,c-=f,w=0,p=3+(7&d),d>>>=3,c-=3}else{for(x=f+7;c<x;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}d>>>=f,c-=f,w=0,p=11+(127&d),d>>>=7,c-=7}if(n.have+p>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Ms;break}for(;p--;)n.lens[n.have++]=w}}if(n.mode===Ms)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=Ms;break}if(n.lenbits=9,A={bits:n.lenbits},v=hs(1,n.lens,0,n.nlen,n.lencode,0,n.work,A),n.lenbits=A.bits,v){e.msg="invalid literal/lengths set",n.mode=Ms;break}if(n.distbits=6,n.distcode=n.distdyn,A={bits:n.distbits},v=hs(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,A),n.distbits=A.bits,v){e.msg="invalid distances set",n.mode=Ms;break}if(n.mode=Es,t===gs)break e;case Es:n.mode=Rs;case Rs:if(o>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=o,n.hold=d,n.bits=c,is(e,u),a=e.next_out,r=e.output,l=e.avail_out,i=e.next_in,s=e.input,o=e.avail_in,d=n.hold,c=n.bits,n.mode===ks&&(n.back=-1);break}for(n.back=0;S=n.lencode[d&(1<<n.lenbits)-1],f=S>>>24,y=S>>>16&255,I=65535&S,!(f<=c);){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}if(y&&!(240&y)){for(b=f,_=y,C=I;S=n.lencode[C+((d&(1<<b+_)-1)>>b)],f=S>>>24,y=S>>>16&255,I=65535&S,!(b+f<=c);){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}d>>>=b,c-=b,n.back+=b}if(d>>>=f,c-=f,n.back+=f,n.length=I,0===y){n.mode=16205;break}if(32&y){n.back=-1,n.mode=ks;break}if(64&y){e.msg="invalid literal/length code",n.mode=Ms;break}n.extra=15&y,n.mode=16201;case 16201:if(n.extra){for(x=n.extra;c<x;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}n.length+=d&(1<<n.extra)-1,d>>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;S=n.distcode[d&(1<<n.distbits)-1],f=S>>>24,y=S>>>16&255,I=65535&S,!(f<=c);){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}if(!(240&y)){for(b=f,_=y,C=I;S=n.distcode[C+((d&(1<<b+_)-1)>>b)],f=S>>>24,y=S>>>16&255,I=65535&S,!(b+f<=c);){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}d>>>=b,c-=b,n.back+=b}if(d>>>=f,c-=f,n.back+=f,64&y){e.msg="invalid distance code",n.mode=Ms;break}n.offset=I,n.extra=15&y,n.mode=16203;case 16203:if(n.extra){for(x=n.extra;c<x;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}n.offset+=d&(1<<n.extra)-1,d>>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Ms;break}n.mode=16204;case 16204:if(0===l)break e;if(p=u-l,n.offset>p){if(p=n.offset-p,p>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Ms;break}p>n.wnext?(p-=n.wnext,g=n.wsize-p):g=n.wnext-p,p>n.length&&(p=n.length),m=n.window}else m=r,g=a-n.offset,p=n.length;p>l&&(p=l),l-=p,n.length-=p;do{r[a++]=m[g++]}while(--p);0===n.length&&(n.mode=Rs);break;case 16205:if(0===l)break e;r[a++]=n.length,l--,n.mode=Rs;break;case Ts:if(n.wrap){for(;c<32;){if(0===o)break e;o--,d|=s[i++]<<c,c+=8}if(u-=l,e.total_out+=u,n.total+=u,4&n.wrap&&u&&(e.adler=n.check=n.flags?zt(n.check,r,u,a-u):Ot(n.check,r,u,a-u)),u=l,4&n.wrap&&(n.flags?d:Ns(d))!==n.check){e.msg="incorrect data check",n.mode=Ms;break}d=0,c=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;c<32;){if(0===o)break e;o--,d+=s[i++]<<c,c+=8}if(4&n.wrap&&d!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=Ms;break}d=0,c=0}n.mode=16208;case 16208:v=fs;break e;case Ms:v=bs;break e;case 16210:return _s;default:return Is}return e.next_out=a,e.avail_out=l,e.next_in=i,e.avail_in=o,n.hold=d,n.bits=c,(n.wsize||u!==e.avail_out&&n.mode<Ms&&(n.mode<Ts||t!==us))&&Vs(e,e.output,e.next_out,u-e.avail_out),h-=e.avail_in,u-=e.avail_out,e.total_in+=h,e.total_out+=u,n.total+=u,4&n.wrap&&u&&(e.adler=n.check=n.flags?zt(n.check,r,u,e.next_out-u):Ot(n.check,r,u,e.next_out-u)),e.data_type=n.bits+(n.last?64:0)+(n.mode===ks?128:0)+(n.mode===Es||n.mode===xs?256:0),(0===h&&0===u||t===us)&&v===ms&&(v=Cs),v},inflateEnd:e=>{if(Fs(e))return Is;let t=e.state;return t.window&&(t.window=null),e.state=null,ms},inflateGetHeader:(e,t)=>{if(Fs(e))return Is;const n=e.state;return 2&n.wrap?(n.head=t,t.done=!1,ms):Is},inflateSetDictionary:(e,t)=>{const n=t.length;let s,r,i;return Fs(e)?Is:(s=e.state,0!==s.wrap&&s.mode!==Ss?Is:s.mode===Ss&&(r=1,r=Ot(r,t,n,0),r!==s.check)?bs:(i=Vs(e,t,n,n),i?(s.mode=16210,_s):(s.havedict=1,ms)))},inflateInfo:"pako inflate (from Nodeca project)"};var Ys=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Hs=Object.prototype.toString,{Z_NO_FLUSH:Js,Z_FINISH:Ps,Z_OK:qs,Z_STREAM_END:Qs,Z_NEED_DICT:js,Z_STREAM_ERROR:Xs,Z_DATA_ERROR:$s,Z_MEM_ERROR:er}=Lt;function tr(e){this.options=Ln({chunkSize:65536,windowBits:15,to:""},e||{});const 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 Kn,this.strm.avail_out=0;let n=Ks.inflateInit2(this.strm,t.windowBits);if(n!==qs)throw new Error(Dt[n]);if(this.header=new Ys,Ks.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Wn(t.dictionary):"[object ArrayBuffer]"===Hs.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Ks.inflateSetDictionary(this.strm,t.dictionary),n!==qs)))throw new Error(Dt[n])}function nr(e,t){const n=new tr(t);if(n.push(e),n.err)throw n.msg||Dt[n.err];return n.result}tr.prototype.push=function(e,t){const n=this.strm,s=this.options.chunkSize,r=this.options.dictionary;let i,a,o;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Ps:Js,"[object ArrayBuffer]"===Hs.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(s),n.next_out=0,n.avail_out=s),i=Ks.inflate(n,a),i===js&&r&&(i=Ks.inflateSetDictionary(n,r),i===qs?i=Ks.inflate(n,a):i===$s&&(i=js));n.avail_in>0&&i===Qs&&n.state.wrap>0&&0!==e[n.next_in];)Ks.inflateReset(n),i=Ks.inflate(n,a);switch(i){case Xs:case $s:case js:case er:return this.onEnd(i),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(0===n.avail_out||i===Qs))if("string"===this.options.to){let e=Vn(n.output,n.next_out),t=n.next_out-e,r=Gn(n.output,e);n.next_out=t,n.avail_out=s-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(r)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(i!==qs||0!==o){if(i===Qs)return i=Ks.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},tr.prototype.onData=function(e){this.chunks.push(e)},tr.prototype.onEnd=function(e){e===qs&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Zn(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var sr={Inflate:tr,inflate:nr,inflateRaw:function(e,t){return(t=t||{}).raw=!0,nr(e,t)},ungzip:nr};const{Deflate:rr,deflate:ir,deflateRaw:ar,gzip:or}=ss,{Inflate:lr,inflate:dr,inflateRaw:cr,ungzip:hr}=sr;var ur={Deflate:rr,deflate:ir,deflateRaw:ar,gzip:or,Inflate:lr,inflate:dr,inflateRaw:cr,ungzip:hr,constants:Lt};class pr{constructor(e,t){this.baseUrl=e,this.apiKey=t}async request(e,t={}){const n=`${this.baseUrl}${e}`,s={"Content-Type":"application/json","X-API-Key":this.apiKey,...t.headers},r=await fetch(n,{...t,headers:s});if(!r.ok){const e=await r.json().catch(()=>({})),t=new Error(e.message||`HTTP ${r.status}`);throw t.code=e.code,t.status=r.status,t}return await r.json()}async createSession(e){return(await this.request("/api/v1/sessions",{method:"POST",body:JSON.stringify(e)})).data}async appendEvents(e,t,n){try{return await this.request(`/api/v1/sessions/${e}/append`,{method:"PATCH",body:JSON.stringify({events:t,compressed:!0,sequence:n})})}catch(e){if("SESSION_FINALIZING"===e.code||"SESSION_NOT_RECORDING"===e.code)return console.warn("Session is finalizing or not recording, skipping append"),null;throw e}}async finalizeSession(e,t){try{return await this.request(`/api/v1/sessions/${e}/finalize`,{method:"POST",body:JSON.stringify(t)})}catch(t){if("SESSION_ALREADY_FINALIZING"===t.code)return console.log("Session already finalizing, waiting..."),await new Promise(e=>setTimeout(e,2e3)),await this.getSessionStatus(e);if("SESSION_ALREADY_COMPLETED"===t.code)return console.log("Session already completed"),await this.getSessionStatus(e);throw t}}async getSessionStatus(e){try{return await this.request(`/api/v1/sessions/${e}`,{method:"GET"})}catch(e){return console.error("Failed to get session status:",e),null}}}const gr=new class{constructor(){this.config=null,this.sessionId=null,this.recording=!1,this.stopFn=null,this.events=[],this.uploadQueue=[],this.uploadTimer=null,this.apiClient=null,this.appendSequence=0,this.failedAppends=new Map,this.totalEvents=0}async init(e){return this.config={apiKey:e.apiKey,projectId:e.projectId,apiBaseUrl:e.apiBaseUrl||"https://api.yourplatform.com",autoStart:!1!==e.autoStart,chunkSize:e.chunkSize||100,uploadInterval:e.uploadInterval||3e4,privacy:{maskAllInputs:!1,maskInputOptions:{idCard:!0,phone:!0,bankCard:!0,...e.privacy?.maskInputOptions},...e.privacy},metadata:e.metadata||{},onError:e.onError||console.error,onSessionCreated:e.onSessionCreated||(()=>{}),onUploadProgress:e.onUploadProgress||(()=>{})},this.apiClient=new pr(this.config.apiBaseUrl,this.config.apiKey),this.config.autoStart&&await this.start(),this}async start(e={}){if(this.recording)console.warn("Recording already in progress");else try{const t=await this.apiClient.createSession({projectId:this.config.projectId,metadata:{...this.config.metadata,...e,url:window.location.href,userAgent:navigator.userAgent,screenResolution:`${window.screen.width}x${window.screen.height}`,startTime:(new Date).toISOString()}});this.sessionId=t.sessionId,this.recording=!0,this.events=[],this.totalEvents=0,this.config.onSessionCreated(t),this.stopFn=Pe({emit:e=>{this.handleEvent(e)},checkoutEveryNms:3e5,...this.getPrivacyConfig(),sampling:{mousemove:!0,mouseInteraction:!0,scroll:150,input:"last"},recordCanvas:!1,inlineImages:!1,collectFonts:!1}),this.startUploadTimer(),console.log("Recording started:",this.sessionId)}catch(e){throw this.config.onError("Failed to start recording",e),e}}async stop(){if(!this.recording)return;this.recording=!1,this.stopFn&&(this.stopFn(),this.stopFn=null),this.stopUploadTimer(),await this.flushEvents(),this.failedAppends.size>0&&(console.warn(`Retrying ${this.failedAppends.size} failed appends before finalize...`),await this.retryFailedAppends(),await new Promise(e=>setTimeout(e,1e3)),this.failedAppends.size>0&&console.error(`Still have ${this.failedAppends.size} failed appends after retry`)),this.events.length>0&&(console.warn("Some events failed to upload, trying one more time..."),await this.flushEvents());try{await this.apiClient.finalizeSession(this.sessionId,{endTime:(new Date).toISOString(),eventCount:this.totalEvents}),console.log("Recording stopped:",this.sessionId)}catch(e){console.error("Failed to finalize session:",e),this.config.onError("Failed to finalize session",e)}const e=this.sessionId;return this.sessionId=null,this.events=[],this.totalEvents=0,e}handleEvent(e){this.events.push(e),this.events.length>=this.config.chunkSize&&this.flushEvents()}async flushEvents(){if(0===this.events.length||!this.sessionId)return;const e=[...this.events];this.totalEvents+=e.length,this.events=[],this.appendSequence++;const t=this.appendSequence;try{const n=this.compressEvents(e),s=await this.apiClient.appendEvents(this.sessionId,n,t);s?.missingSequences&&s.missingSequences.length>0&&(console.warn("Server detected missing sequences:",s.missingSequences),await this.retryMissingSequences(s.missingSequences)),this.config.onUploadProgress({sessionId:this.sessionId,sequence:t,uploaded:e.length,status:s?.status||"success"})}catch(n){this.failedAppends.set(t,{events:e,retries:0,error:n.message}),console.error(`Failed to upload sequence ${t}:`,n),this.config.onError("Failed to upload events",n),"SESSION_NOT_FOUND"!==n.code&&"SESSION_NOT_RECORDING"!==n.code&&setTimeout(()=>this.retryFailedAppends(),2e3)}}async retryFailedAppends(){if(0===this.failedAppends.size||!this.sessionId)return;const e=[];for(const[t,n]of this.failedAppends.entries())n.retries<3?e.push({sequence:t,failedAppend:n}):(console.warn(`Sequence ${t} failed after 3 retries, giving up`),this.failedAppends.delete(t));for(const{sequence:t,failedAppend:n}of e)try{const e=this.compressEvents(n.events);await this.apiClient.appendEvents(this.sessionId,e,t),console.log(`Successfully retried sequence ${t}`),this.failedAppends.delete(t)}catch(e){n.retries++,console.error(`Retry failed for sequence ${t} (attempt ${n.retries}):`,e)}}async retryMissingSequences(e){for(const t of e){const e=this.failedAppends.get(t);if(e)try{const n=this.compressEvents(e.events);await this.apiClient.appendEvents(this.sessionId,n,t),console.log(`Successfully re-sent missing sequence ${t}`),this.failedAppends.delete(t)}catch(e){console.error(`Failed to re-send missing sequence ${t}:`,e)}else console.warn(`Server requested missing sequence ${t}, but no record found`)}}compressEvents(e){const t=JSON.stringify(e),n=ur.gzip(t);return btoa(String.fromCharCode(...n))}getPrivacyConfig(){return{blockClass:"rr-block",maskAllInputs:this.config.privacy.maskAllInputs,maskInputOptions:this.config.privacy.maskInputOptions,maskTextFn:(e,t)=>this.maskSensitiveData(e,t)}}maskSensitiveData(e,t){if(!e)return e;const n=e.trim();return this.config.privacy.maskInputOptions.idCard&&/^\d{15}|\d{17}[\dXx]$/.test(n)?n.replace(/(\d{6})\d{8}(\d{4})/,"$1********$2"):this.config.privacy.maskInputOptions.phone&&/^1[3-9]\d{9}$/.test(n)?n.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2"):this.config.privacy.maskInputOptions.bankCard&&/^\d{16,19}$/.test(n)?n.replace(/(\d{6})\d+(\d{3})/,"$1******$2"):e}startUploadTimer(){this.uploadTimer=setInterval(()=>{this.flushEvents()},this.config.uploadInterval)}stopUploadTimer(){this.uploadTimer&&(clearInterval(this.uploadTimer),this.uploadTimer=null)}setMetadata(e){this.config.metadata={...this.config.metadata,...e}}getSessionId(){return this.sessionId}isRecording(){return this.recording}};return"undefined"!=typeof window&&(window.PageRecorder=gr),gr});
|
|
1
|
+
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s(require("rrweb"),require("pako")):"function"==typeof define&&define.amd?define(["rrweb","pako"],s):(e="undefined"!=typeof globalThis?globalThis:e||self).PageRecorder=s(e.rrweb,e.pako)}(this,function(e,s){"use strict";class t{constructor(e,s){this.baseUrl=e,this.apiKey=s}async request(e,s={}){const t=`${this.baseUrl}${e}`,i={"Content-Type":"application/json","X-API-Key":this.apiKey,...s.headers},n=await fetch(t,{...s,headers:i});if(!n.ok){const e=await n.json().catch(()=>({})),s=new Error(e.message||`HTTP ${n.status}`);throw s.code=e.code,s.status=n.status,s}return await n.json()}async createSession(e){return(await this.request("/api/v1/sessions",{method:"POST",body:JSON.stringify(e)})).data}async appendEvents(e,s,t){try{return await this.request(`/api/v1/sessions/${e}/append`,{method:"PATCH",body:JSON.stringify({events:s,compressed:!0,sequence:t})})}catch(e){if("SESSION_FINALIZING"===e.code||"SESSION_NOT_RECORDING"===e.code)return console.warn("Session is finalizing or not recording, skipping append"),null;throw e}}async finalizeSession(e,s){try{return await this.request(`/api/v1/sessions/${e}/finalize`,{method:"POST",body:JSON.stringify(s)})}catch(s){if("SESSION_ALREADY_FINALIZING"===s.code)return console.log("Session already finalizing, waiting..."),await new Promise(e=>setTimeout(e,2e3)),await this.getSessionStatus(e);if("SESSION_ALREADY_COMPLETED"===s.code)return console.log("Session already completed"),await this.getSessionStatus(e);throw s}}async getSessionStatus(e){try{return await this.request(`/api/v1/sessions/${e}`,{method:"GET"})}catch(e){return console.error("Failed to get session status:",e),null}}}const i=new class{constructor(){this.config=null,this.sessionId=null,this.recording=!1,this.stopFn=null,this.events=[],this.uploadQueue=[],this.uploadTimer=null,this.apiClient=null,this.appendSequence=0,this.failedAppends=new Map,this.totalEvents=0}async init(e){return this.config={apiKey:e.apiKey,projectId:e.projectId,apiBaseUrl:e.apiBaseUrl||"https://api.yourplatform.com",autoStart:!1!==e.autoStart,chunkSize:e.chunkSize||100,uploadInterval:e.uploadInterval||3e4,privacy:{maskAllInputs:!1,maskInputOptions:{idCard:!0,phone:!0,bankCard:!0,...e.privacy?.maskInputOptions},...e.privacy},metadata:e.metadata||{},onError:e.onError||console.error,onSessionCreated:e.onSessionCreated||(()=>{}),onUploadProgress:e.onUploadProgress||(()=>{})},this.apiClient=new t(this.config.apiBaseUrl,this.config.apiKey),this.config.autoStart&&await this.start(),this}async start(s={}){if(this.recording)console.warn("Recording already in progress");else try{const t=await this.apiClient.createSession({projectId:this.config.projectId,metadata:{...this.config.metadata,...s,url:window.location.href,userAgent:navigator.userAgent,screenResolution:`${window.screen.width}x${window.screen.height}`,startTime:(new Date).toISOString()}});this.sessionId=t.sessionId,this.recording=!0,this.events=[],this.totalEvents=0,this.config.onSessionCreated(t),this.stopFn=e.record({emit:e=>{this.handleEvent(e)},checkoutEveryNms:3e5,...this.getPrivacyConfig(),sampling:{mousemove:!0,mouseInteraction:!0,scroll:150,input:"last"},recordCanvas:!1,inlineImages:!1,collectFonts:!1}),this.startUploadTimer(),console.log("Recording started:",this.sessionId)}catch(e){throw this.config.onError("Failed to start recording",e),e}}async stop(){if(!this.recording)return;this.recording=!1,this.stopFn&&(this.stopFn(),this.stopFn=null),this.stopUploadTimer(),await this.flushEvents(),this.failedAppends.size>0&&(console.warn(`Retrying ${this.failedAppends.size} failed appends before finalize...`),await this.retryFailedAppends(),await new Promise(e=>setTimeout(e,1e3)),this.failedAppends.size>0&&console.error(`Still have ${this.failedAppends.size} failed appends after retry`)),this.events.length>0&&(console.warn("Some events failed to upload, trying one more time..."),await this.flushEvents());try{await this.apiClient.finalizeSession(this.sessionId,{endTime:(new Date).toISOString(),eventCount:this.totalEvents}),console.log("Recording stopped:",this.sessionId)}catch(e){console.error("Failed to finalize session:",e),this.config.onError("Failed to finalize session",e)}const e=this.sessionId;return this.sessionId=null,this.events=[],this.totalEvents=0,e}handleEvent(e){this.events.push(e),this.events.length>=this.config.chunkSize&&this.flushEvents()}async flushEvents(){if(0===this.events.length||!this.sessionId)return;const e=[...this.events];this.totalEvents+=e.length,this.events=[],this.appendSequence++;const s=this.appendSequence;try{const t=this.compressEvents(e),i=await this.apiClient.appendEvents(this.sessionId,t,s);i?.missingSequences&&i.missingSequences.length>0&&(console.warn("Server detected missing sequences:",i.missingSequences),await this.retryMissingSequences(i.missingSequences)),this.config.onUploadProgress({sessionId:this.sessionId,sequence:s,uploaded:e.length,status:i?.status||"success"})}catch(t){this.failedAppends.set(s,{events:e,retries:0,error:t.message}),console.error(`Failed to upload sequence ${s}:`,t),this.config.onError("Failed to upload events",t),"SESSION_NOT_FOUND"!==t.code&&"SESSION_NOT_RECORDING"!==t.code&&setTimeout(()=>this.retryFailedAppends(),2e3)}}async retryFailedAppends(){if(0===this.failedAppends.size||!this.sessionId)return;const e=[];for(const[s,t]of this.failedAppends.entries())t.retries<3?e.push({sequence:s,failedAppend:t}):(console.warn(`Sequence ${s} failed after 3 retries, giving up`),this.failedAppends.delete(s));for(const{sequence:s,failedAppend:t}of e)try{const e=this.compressEvents(t.events);await this.apiClient.appendEvents(this.sessionId,e,s),console.log(`Successfully retried sequence ${s}`),this.failedAppends.delete(s)}catch(e){t.retries++,console.error(`Retry failed for sequence ${s} (attempt ${t.retries}):`,e)}}async retryMissingSequences(e){for(const s of e){const e=this.failedAppends.get(s);if(e)try{const t=this.compressEvents(e.events);await this.apiClient.appendEvents(this.sessionId,t,s),console.log(`Successfully re-sent missing sequence ${s}`),this.failedAppends.delete(s)}catch(e){console.error(`Failed to re-send missing sequence ${s}:`,e)}else console.warn(`Server requested missing sequence ${s}, but no record found`)}}compressEvents(e){const t=JSON.stringify(e),i=s.gzip(t);return btoa(String.fromCharCode(...i))}getPrivacyConfig(){return{blockClass:"rr-block",maskAllInputs:this.config.privacy.maskAllInputs,maskInputOptions:this.config.privacy.maskInputOptions,maskTextFn:(e,s)=>this.maskSensitiveData(e,s)}}maskSensitiveData(e,s){if(!e)return e;const t=e.trim();return this.config.privacy.maskInputOptions.idCard&&/^\d{15}|\d{17}[\dXx]$/.test(t)?t.replace(/(\d{6})\d{8}(\d{4})/,"$1********$2"):this.config.privacy.maskInputOptions.phone&&/^1[3-9]\d{9}$/.test(t)?t.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2"):this.config.privacy.maskInputOptions.bankCard&&/^\d{16,19}$/.test(t)?t.replace(/(\d{6})\d+(\d{3})/,"$1******$2"):e}startUploadTimer(){this.uploadTimer=setInterval(()=>{this.flushEvents()},this.config.uploadInterval)}stopUploadTimer(){this.uploadTimer&&(clearInterval(this.uploadTimer),this.uploadTimer=null)}setMetadata(e){this.config.metadata={...this.config.metadata,...e}}getSessionId(){return this.sessionId}isRecording(){return this.recording}};return"undefined"!=typeof window&&(window.PageRecorder=i),i});
|
|
16
2
|
//# sourceMappingURL=index.umd.js.map
|