@antglobal/rlog-sdk 0.0.1755855517-dev.13 → 0.0.1755855517-dev.15
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/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +11 -18
- package/dist/esm/lib/config.d.ts.map +1 -1
- package/dist/esm/lib/config.js +7 -5
- package/dist/esm/lib/logger.d.ts +1 -1
- package/dist/esm/lib/logger.d.ts.map +1 -1
- package/dist/esm/lib/logger.js +16 -106
- package/dist/esm/lib/storage-manager.js +15 -17
- package/dist/esm/lib/upload-worker-manager.d.ts +7 -1
- package/dist/esm/lib/upload-worker-manager.d.ts.map +1 -1
- package/dist/esm/lib/upload-worker-manager.js +62 -11
- package/dist/esm/lib/upload-worker.d.ts +0 -1
- package/dist/esm/lib/upload-worker.d.ts.map +1 -1
- package/dist/esm/lib/upload-worker.js +1 -1
- package/dist/esm/lib/uploader.d.ts.map +1 -1
- package/dist/esm/lib/uploader.js +15 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +11 -18
- package/dist/lib/lib/config.d.ts.map +1 -1
- package/dist/lib/lib/config.js +6 -4
- package/dist/lib/lib/logger.d.ts +1 -1
- package/dist/lib/lib/logger.d.ts.map +1 -1
- package/dist/lib/lib/logger.js +16 -106
- package/dist/lib/lib/storage-manager.js +15 -17
- package/dist/lib/lib/upload-worker-manager.d.ts +7 -1
- package/dist/lib/lib/upload-worker-manager.d.ts.map +1 -1
- package/dist/lib/lib/upload-worker-manager.js +63 -11
- package/dist/lib/lib/upload-worker.d.ts +0 -1
- package/dist/lib/lib/upload-worker.d.ts.map +1 -1
- package/dist/lib/lib/upload-worker.js +1 -1
- package/dist/lib/lib/uploader.d.ts.map +1 -1
- package/dist/lib/lib/uploader.js +14 -0
- package/dist/rlog-sdk.min.js +1 -1
- package/package.json +1 -1
package/dist/rlog-sdk.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Rlog=t():e.Rlog=t()}(self,(function(){return function(){var e={115:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=u(e),i=a[0],s=a[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,i,s)),l=0,f=s>0?i-4:i;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,a=[],i=16383,s=0,u=n-o;s<u;s+=i)a.push(c(e,s,s+i>u?u:s+i));1===o?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=a.length;i<s;++i)r[i]=a[i],n[a.charCodeAt(i)]=i;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var o,a,i=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),i.push(r[(a=o)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},877:function(e,t,r){"use strict";var n=r(115),o=r(175),a=r(206);function i(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(t,r);e=s(e,n);var o=e.write(t,r);o!==n&&(e=e.slice(0,o));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|p(t.length);return 0===(e=s(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):d(e,t);if("Buffer"===t.type&&a(t.data))return d(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(l(t),e=s(e,t<0?0:0|p(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|p(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function p(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(n)return G(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,o){var a,i=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;i=2,s/=2,u/=2,r/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){var l=-1;for(a=r;a<s;a++)if(c(e,a)===c(t,-1===l?0:a-l)){if(-1===l&&(l=a),a-l+1===u)return l*i}else-1!==l&&(a-=a-l),l=-1}else for(r+u>s&&(r=s-u),a=r;a>=0;a--){for(var f=!0,d=0;d<u;d++)if(c(e,a+d)!==c(t,d)){f=!1;break}if(f)return a}return-1}function w(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var s=parseInt(t.substr(2*i,2),16);if(isNaN(s))return i;e[r+i]=s}return i}function I(e,t,r,n){return j(G(t,e.length-r),e,r,n)}function b(e,t,r,n){return j(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function C(e,t,r,n){return b(e,t,r,n)}function S(e,t,r,n){return j(K(t),e,r,n)}function k(e,t,r,n){return j(function(e,t){for(var r,n,o,a=[],i=0;i<e.length&&!((t-=2)<0);++i)n=(r=e.charCodeAt(i))>>8,o=r%256,a.push(o),a.push(n);return a}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var a,i,s,u,c=e[o],l=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[o+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=e[o+1],i=e[o+2],128==(192&a)&&128==(192&i)&&(u=(15&c)<<12|(63&a)<<6|63&i)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[o+1],i=e[o+2],s=e[o+3],128==(192&a)&&128==(192&i)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&i)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(e){var t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=E));return r}(n)}t.lW=u,t.h2=50,u.TYPED_ARRAY_SUPPORT=void 0!==r.g.TYPED_ARRAY_SUPPORT?r.g.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),i(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return l(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,o=0,a=Math.min(r,n);o<a;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if(!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},u.byteLength=h,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?x(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.h2;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(n>>>=0),i=(r>>>=0)-(t>>>=0),s=Math.min(a,i),c=this.slice(n,o),l=e.slice(t,r),f=0;f<s;++f)if(c[f]!==l[f]){a=c[f],i=l[f];break}return a<i?-1:i<a?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return I(this,e,t,r);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return C(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function T(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function R(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function M(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",a=t;a<r;++a)o+=W(e[a]);return o}function O(e,t,r){for(var n=e.slice(t,r),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+256*n[a+1]);return o}function L(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,o,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n){t<0&&(t=65535+t+1);for(var o=0,a=Math.min(e.length-r,2);o<a;++o)e[r+o]=(t&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function _(e,t,r,n){t<0&&(t=4294967295+t+1);for(var o=0,a=Math.min(e.length-r,4);o<a;++o)e[r+o]=t>>>8*(n?o:3-o)&255}function F(e,t,r,n,o,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,a){return a||F(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function B(e,t,r,n,a){return a||F(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var o=t-e;r=new u(o,void 0);for(var a=0;a<o;++a)r[a]=this[a+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],o=1,a=0;++a<t&&(o*=256);)n+=this[e+a]*o;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],o=1,a=0;++a<t&&(o*=256);)n+=this[e+a]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=t,o=1,a=this[e+--n];n>0&&(o*=256);)a+=this[e+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||N(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[t]=255&e;++a<r&&(o*=256);)this[t+a]=e/o&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||N(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):_(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);N(this,e,t,r,o-1,-o)}var a=0,i=1,s=0;for(this[t]=255&e;++a<r&&(i*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/i>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);N(this,e,t,r,o-1,-o)}var a=r-1,i=1,s=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/i>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):_(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o,a=n-r;if(this===e&&r<t&&t<n)for(o=a-1;o>=0;--o)e[o+t]=this[o+r];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+a),t);return a},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var i=u.isBuffer(e)?e:G(new u(e,n).toString()),s=i.length;for(a=0;a<r-t;++a)this[a+t]=i[a%s]}return this};var P=/[^+\/0-9A-Za-z-_]/g;function W(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){var r;t=t||1/0;for(var n=e.length,o=null,a=[],i=0;i<n;++i){if((r=e.charCodeAt(i))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(t-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function K(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(P,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}},175:function(e,t){t.read=function(e,t,r,n,o){var a,i,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?o-1:0,d=r?-1:1,p=e[t+f];for(f+=d,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=d,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=n;l>0;i=256*i+e[t+f],f+=d,l-=8);if(0===a)a=1-c;else{if(a===u)return i?NaN:1/0*(p?-1:1);i+=Math.pow(2,n),a-=c}return(p?-1:1)*i*Math.pow(2,a-n)},t.write=function(e,t,r,n,o,a){var i,s,u,c=8*a-o-1,l=(1<<c)-1,f=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,h=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,i=l):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),(t+=i+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(i++,u/=2),i+f>=l?(s=0,i=l):i+f>=1?(s=(t*u-1)*Math.pow(2,o),i+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),i=0));o>=8;e[r+p]=255&s,p+=h,s/=256,o-=8);for(i=i<<o|s,c+=o;c>0;e[r+p]=255&i,p+=h,i/=256,c-=8);e[r+p-h]|=128*g}},206:function(e){var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},142:function(e){var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],c=!1,l=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&d())}function d(){if(!c){var e=i(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l<t;)s&&s[l].run();l=-1,t=u.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function h(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||c||i(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=h,n.addListener=h,n.once=h,n.off=h,n.removeListener=h,n.removeAllListeners=h,n.emit=h,n.prependListener=h,n.prependOnceListener=h,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},500:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},77:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},825:function(e,t,r){var n=r(500);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},251:function(e){function t(e,t,r,n,o,a,i){try{var s=e[a](i),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,a){var i=e.apply(r,n);function s(e){t(i,o,a,s,u,"next",e)}function u(e){t(i,o,a,s,u,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},902:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},733:function(e,t,r){var n=r(308);function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}e.exports=function(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},28:function(e,t,r){var n=r(82);e.exports=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=n(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,a=function(){};return{s:a,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw i}}}},e.exports.__esModule=!0,e.exports.default=e.exports},313:function(e,t,r){var n=r(308);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},426:function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},606:function(e){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},614:function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},475:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},53:function(e,t,r){var n=r(313);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}e.exports=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports},418:function(e,t,r){var n=r(757).default;function o(){"use strict";e.exports=o=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},a=Object.prototype,i=a.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(t){d=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof w?t:w,a=Object.create(o.prototype),i=new L(n||[]);return s(a,"_invoke",{value:T(e,r,i)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var g="suspendedStart",v="executing",m="completed",y={};function w(){}function I(){}function b(){}var C={};d(C,c,(function(){return this}));var S=Object.getPrototypeOf,k=S&&S(S(N([])));k&&k!==a&&i.call(k,c)&&(C=k);var A=b.prototype=w.prototype=Object.create(C);function x(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,a,s,u){var c=h(e[o],e,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}))}u(c.arg)}var o;s(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function T(e,r,n){var o=g;return function(a,i){if(o===v)throw new Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var s=n.delegate;if(s){var u=R(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===g)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=h(e,r,n);if("normal"===c.type){if(o=n.done?m:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}function R(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,R(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=h(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return I.prototype=b,s(A,"constructor",{value:b,configurable:!0}),s(b,"constructor",{value:I,configurable:!0}),I.displayName=d(b,f,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===I||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,d(e,f,"GeneratorFunction")),e.prototype=Object.create(A),e},r.awrap=function(e){return{__await:e}},x(E.prototype),d(E.prototype,l,(function(){return this})),r.AsyncIterator=E,r.async=function(e,t,n,o,a){void 0===a&&(a=Promise);var i=new E(p(e,t,n,o),a);return r.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},x(A),d(A,f,"Generator"),d(A,c,(function(){return this})),d(A,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=N,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},r}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},385:function(e,t,r){var n=r(77),o=r(606),a=r(82),i=r(614);e.exports=function(e,t){return n(e)||o(e,t)||a(e,t)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},906:function(e,t,r){var n=r(825),o=r(426),a=r(82),i=r(475);e.exports=function(e){return n(e)||o(e)||a(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},488:function(e,t,r){var n=r(757).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},308:function(e,t,r){var n=r(757).default,o=r(488);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},757:function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},82:function(e,t,r){var n=r(500);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return function(){"use strict";r.r(n),r.d(n,{addCustomEvent:function(){return zo},cancelRecord:function(){return qo},cleanupErrorHandler:function(){return Ko},debug:function(){return ta},getBlackListUrls:function(){return xn},getCurrentRouteInfo:function(){return No},getCustomHeaders:function(){return Rn},getSdkLogEndpoint:function(){return En},getWhiteListUrls:function(){return kn},init:function(){return Jo},isConsumeOnlyMode:function(){return Xo},manualRouteChange:function(){return Do},reportError:function(){return ea},setBlackListUrls:function(){return An},setConsumeOnlyMode:function(){return Qo},setCustomHeaders:function(){return Tn},setWhiteListUrls:function(){return Sn},stopRouterMonitor:function(){return _o},toggleConsumeOnlyMode:function(){return $o},updateRouterConfig:function(){return xo}});var e,t=r(418),o=r.n(t),a=r(251),i=r.n(a),s=r(757),u=r.n(s),c=r(53),l=r.n(c),f=r(28);function d(e){return e.nodeType===e.ELEMENT_NODE}function p(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function h(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function g(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t).map(v).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function v(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=g(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 m=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-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,r=this.getId(e);this.idNodeMap.delete(r),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 r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function y(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,a=e.maskInputFn,i=o||"";return(t[r.toLowerCase()]||t[n])&&(i=a?a(i):"*".repeat(i.length)),i}var w="__rrweb_original__";var I,b,C=1,S=new RegExp("[^a-z0-9-_:]");function k(){return C++}var A=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,x=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,E=/^(data:)([^,]*),(.*)/i;function T(e,t){return(e||"").replace(A,(function(e,r,n,o,a,i){var s,u=n||a||i,c=r||o||"";if(!u)return e;if(!x.test(u))return"url(".concat(c).concat(u).concat(c,")");if(E.test(u))return"url(".concat(c).concat(u).concat(c,")");if("/"===u[0])return"url(".concat(c).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)).concat(c,")");var l=t.split("/"),f=u.split("/");l.pop();for(var d=0,p=f;d<p.length;d++){var h=p[d];"."!==h&&(".."===h?l.pop():l.push(h))}return"url(".concat(c).concat(l.join("/")).concat(c,")")}))}var R=/^[^ \t\n\r\u000c]+/,M=/^[, \t\n\r\u000c]+/;function O(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function L(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function N(){var e=document.createElement("a");return e.href="",e.href}function D(e,t,r,n){return"src"===r||"href"===r&&n&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&n&&"#"!==n[0]?O(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,o=e.exec(t.substring(r));return o?(n=o[0],r+=n.length,n):""}for(var o=[];n(M),!(r>=t.length);){var a=n(R);if(","===a.slice(-1))a=O(e,a.substring(0,a.length-1)),o.push(a);else{var i="";a=O(e,a);for(var s=!1;;){var u=t.charAt(r);if(""===u){o.push((a+i).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,o.push((a+i).trim());break}"("===u&&(s=!0)}i+=u,r+=1}}}return o.join(", ")}(e,n):"style"===r&&n?T(n,N()):"object"===t&&"data"===r&&n?O(e,n):n:O(e,n)}function _(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&_(e.parentNode,t,r);for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return!!r&&_(e.parentNode,t,r)}function F(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(_(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}return!1}function U(t,r){var n=r.doc,o=r.mirror,a=r.blockClass,i=r.blockSelector,s=r.maskTextClass,u=r.maskTextSelector,c=r.inlineStylesheet,l=r.maskInputOptions,f=void 0===l?{}:l,d=r.maskTextFn,p=r.maskInputFn,h=r.dataURLOptions,v=void 0===h?{}:h,m=r.inlineImages,C=r.recordCanvas,k=r.keepIframeSrcFn,A=r.newlyAddedElement,x=void 0!==A&&A,E=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(n,o);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:E};case t.ELEMENT_NODE:return function(t,r){for(var n=r.doc,o=r.blockClass,a=r.blockSelector,i=r.inlineStylesheet,s=r.maskInputOptions,u=void 0===s?{}:s,c=r.maskInputFn,l=r.dataURLOptions,f=void 0===l?{}:l,d=r.inlineImages,p=r.recordCanvas,h=r.keepIframeSrcFn,v=r.newlyAddedElement,m=void 0!==v&&v,C=r.rootId,k=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return!!r&&e.matches(r)}(t,o,a),A=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return S.test(t)?"div":t}(t),x={},E=t.attributes.length,R=0;R<E;R++){var M=t.attributes[R];x[M.name]=D(n,A,M.name,M.value)}if("link"===A&&i){var O=Array.from(n.styleSheets).find((function(e){return e.href===t.href})),_=null;O&&(_=g(O)),_&&(delete x.rel,delete x.href,x._cssText=T(_,O.href))}if("style"===A&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){(_=g(t.sheet))&&(x._cssText=T(_,N()))}if("input"===A||"textarea"===A||"select"===A){var F=t.value,U=t.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&F?x.value=y({type:x.type,tagName:A,value:F,maskInputOptions:u,maskInputFn:c}):U&&(x.checked=U)}"option"===A&&(t.selected&&!u.select?x.selected=!0:delete x.selected);if("canvas"===A&&p)if("2d"===t.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var o=t.getImageData,a=w in o?o[w]:o;if(new Uint32Array(a.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(t)||(x.rr_dataURL=t.toDataURL(f.type,f.quality));else if(!("__context"in t)){var B=t.toDataURL(f.type,f.quality),P=document.createElement("canvas");P.width=t.width,P.height=t.height,B!==P.toDataURL(f.type,f.quality)&&(x.rr_dataURL=B)}if("img"===A&&d){I||(I=n.createElement("canvas"),b=I.getContext("2d"));var W=t,G=W.crossOrigin;W.crossOrigin="anonymous";var K=function(){try{I.width=W.naturalWidth,I.height=W.naturalHeight,b.drawImage(W,0,0),x.rr_dataURL=I.toDataURL(f.type,f.quality)}catch(e){console.warn("Cannot inline img src=".concat(W.currentSrc,"! Error: ").concat(e))}G?x.crossOrigin=G:W.removeAttribute("crossorigin")};W.complete&&0!==W.naturalWidth?K():W.onload=K}"audio"!==A&&"video"!==A||(x.rr_mediaState=t.paused?"paused":"played",x.rr_mediaCurrentTime=t.currentTime);m||(t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop));if(k){var j=t.getBoundingClientRect(),Y=j.width,Z=j.height;x={class:x.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(Z,"px")}}"iframe"!==A||h(x.src)||(t.contentDocument||(x.rr_src=x.src),delete x.src);return{type:e.Element,tagName:A,attributes:x,childNodes:[],isSVG:L(t)||void 0,needBlock:k,rootId:C}}(t,{doc:n,blockClass:a,blockSelector:i,inlineStylesheet:c,maskInputOptions:f,maskInputFn:p,dataURLOptions:v,inlineImages:m,recordCanvas:C,keepIframeSrcFn:k,newlyAddedElement:x,rootId:E});case t.TEXT_NODE:return function(t,r){var n,o=r.maskTextClass,a=r.maskTextSelector,i=r.maskTextFn,s=r.rootId,u=t.parentNode&&t.parentNode.tagName,c=t.textContent,l="STYLE"===u||void 0,f="SCRIPT"===u||void 0;if(l&&c){try{t.nextSibling||t.previousSibling||(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(c=(d=t.parentNode.sheet).cssRules?Array.from(d.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(e),t)}c=T(c,N())}var d;f&&(c="SCRIPT_PLACEHOLDER");!l&&!f&&c&&F(t,o,a)&&(c=i?i(c):c.replace(/[\S]/g,"*"));return{type:e.Text,textContent:c||"",isStyle:l,rootId:s}}(t,{maskTextClass:s,maskTextSelector:u,maskTextFn:d,rootId:E});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:E};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:E};default:return!1}}function B(e){return void 0===e?"":e.toLowerCase()}function P(t,r){var n,o=r.doc,a=r.mirror,i=r.blockClass,s=r.blockSelector,u=r.maskTextClass,c=r.maskTextSelector,l=r.skipChild,f=void 0!==l&&l,g=r.inlineStylesheet,v=void 0===g||g,m=r.maskInputOptions,y=void 0===m?{}:m,w=r.maskTextFn,I=r.maskInputFn,b=r.slimDOMOptions,C=r.dataURLOptions,S=void 0===C?{}:C,A=r.inlineImages,x=void 0!==A&&A,E=r.recordCanvas,T=void 0!==E&&E,R=r.onSerialize,M=r.onIframeLoad,O=r.iframeLoadTimeout,L=void 0===O?5e3:O,N=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,_=void 0===D?5e3:D,F=r.keepIframeSrcFn,W=void 0===F?function(){return!1}:F,G=r.newlyAddedElement,K=void 0!==G&&G,j=r.preserveWhiteSpace,Y=void 0===j||j,Z=U(t,{doc:o,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:v,maskInputOptions:y,maskTextFn:w,maskInputFn:I,dataURLOptions:S,inlineImages:x,recordCanvas:T,keepIframeSrcFn:W,newlyAddedElement:K});if(!Z)return console.warn(t,"not serialized"),null;n=a.hasNode(t)?a.getId(t):!function(t,r){if(r.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(r.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(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(B(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===B(t.attributes.name)||"icon"===B(t.attributes.rel)||"apple-touch-icon"===B(t.attributes.rel)||"shortcut icon"===B(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&B(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(B(t.attributes.property).match(/^(og|twitter|fb):/)||B(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===B(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===B(t.attributes.name)||"googlebot"===B(t.attributes.name)||"bingbot"===B(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===B(t.attributes.name)||"generator"===B(t.attributes.name)||"framework"===B(t.attributes.name)||"publisher"===B(t.attributes.name)||"progid"===B(t.attributes.name)||B(t.attributes.property).match(/^article:/)||B(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===B(t.attributes.name)||"yandex-verification"===B(t.attributes.name)||"csrf-token"===B(t.attributes.name)||"p:domain_verify"===B(t.attributes.name)||"verify-v1"===B(t.attributes.name)||"verification"===B(t.attributes.name)||"shopify-checkout-api-token"===B(t.attributes.name)))return!0}}return!1}(Z,b)&&(Y||Z.type!==e.Text||Z.isStyle||Z.textContent.replace(/^\s+|\s+$/gm,"").length)?k():-2;var V=Object.assign(Z,{id:n});if(a.add(t,V),-2===n)return null;R&&R(t);var H=!f;if(V.type===e.Element){H=H&&!V.needBlock,delete V.needBlock;var J=t.shadowRoot;J&&h(J)&&(V.isShadowHost=!0)}if((V.type===e.Document||V.type===e.Element)&&H){b.headWhitespace&&V.type===e.Element&&"head"===V.tagName&&(Y=!1);for(var q={doc:o,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:f,inlineStylesheet:v,maskInputOptions:y,maskTextFn:w,maskInputFn:I,slimDOMOptions:b,dataURLOptions:S,inlineImages:x,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:L,onStylesheetLoad:N,stylesheetLoadTimeout:_,keepIframeSrcFn:W},z=0,Q=Array.from(t.childNodes);z<Q.length;z++){(ee=P(Q[z],q))&&V.childNodes.push(ee)}if(d(t)&&t.shadowRoot)for(var X=0,$=Array.from(t.shadowRoot.childNodes);X<$.length;X++){var ee;(ee=P($[X],q))&&(h(t.shadowRoot)&&(ee.isShadow=!0),V.childNodes.push(ee))}}return t.parentNode&&p(t.parentNode)&&h(t.parentNode)&&(V.isShadow=!0),V.type===e.Element&&"iframe"===V.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var o,a=!1;try{o=n.document.readyState}catch(e){return}if("complete"===o){var i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){a||(t(),a=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),a=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&M){var r=P(e,{doc:e,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:w,maskInputFn:I,slimDOMOptions:b,dataURLOptions:S,inlineImages:x,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:L,onStylesheetLoad:N,stylesheetLoadTimeout:_,keepIframeSrcFn:W});r&&M(t,r)}}),L),V.type===e.Element&&"link"===V.tagName&&"stylesheet"===V.attributes.rel&&function(e,t,r){var n,o=!1;try{n=e.sheet}catch(e){return}if(!n){var a=setTimeout((function(){o||(t(),o=!0)}),r);e.addEventListener("load",(function(){clearTimeout(a),o=!0,t()}))}}(t,(function(){if(N){var e=P(t,{doc:o,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:w,maskInputFn:I,slimDOMOptions:b,dataURLOptions:S,inlineImages:x,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:L,onStylesheetLoad:N,stylesheetLoadTimeout:_,keepIframeSrcFn:W});e&&N(t,e)}}),_),V}function W(e,t){var r=t||{},n=r.mirror,o=void 0===n?new m:n,a=r.blockClass,i=void 0===a?"rr-block":a,s=r.blockSelector,u=void 0===s?null:s,c=r.maskTextClass,l=void 0===c?"rr-mask":c,f=r.maskTextSelector,d=void 0===f?null:f,p=r.inlineStylesheet,h=void 0===p||p,g=r.inlineImages,v=void 0!==g&&g,y=r.recordCanvas,w=void 0!==y&&y,I=r.maskAllInputs,b=void 0!==I&&I,C=r.maskTextFn,S=r.maskInputFn,k=r.slimDOM,A=void 0!==k&&k,x=r.dataURLOptions,E=r.preserveWhiteSpace,T=r.onSerialize,R=r.onIframeLoad,M=r.iframeLoadTimeout,O=r.onStylesheetLoad,L=r.stylesheetLoadTimeout,N=r.keepIframeSrcFn;return P(e,{doc:e,mirror:o,blockClass:i,blockSelector:u,maskTextClass:l,maskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===b?{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===b?{password:!0}:b,maskTextFn:C,maskInputFn:S,slimDOMOptions:!0===A||"all"===A?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===A,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===A?{}:A,dataURLOptions:x,inlineImages:v,recordCanvas:w,preserveWhiteSpace:E,onSerialize:T,onIframeLoad:R,iframeLoadTimeout:M,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:void 0===N?function(){return!1}:N,newlyAddedElement:!1})}var G=/([^\\]):hover/;new RegExp(G.source,"g");var K=r(385),j=r.n(K),Y=r(906),Z=r.n(Y),V=r(902),H=r.n(V),J=r(733),q=r.n(J);function z(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,n={capture:!0,passive:!0};return r.addEventListener(e,t,n),function(){return r.removeEventListener(e,t,n)}}var Q="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.",X={map:{},getId:function(){return console.error(Q),-1},getNode:function(){return console.error(Q),null},removeNodeFromMap:function(){console.error(Q)},has:function(){return console.error(Q),!1},reset:function(){console.error(Q)}};function $(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=null,o=0;return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];var u=Date.now();o||!1!==r.leading||(o=u);var c=t-(u-o),l=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),o=u,e.apply(l,i)):n||!1===r.trailing||(n=setTimeout((function(){o=!1===r.leading?0:Date.now(),n=null,e.apply(l,i)}),c))}}function ee(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,a=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set:function(e){var t=this;setTimeout((function(){r.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return ee(e,t,a||{},!0)}}function te(e,t,r){try{if(!(t in e))return function(){};var n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,function(){e[t]=n}}catch(e){return function(){}}}function re(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ne(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function oe(e,t,r,n){if(!e)return!1;var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(n&&null!==o.closest("."+t))return!0}else if(_(o,t,n))return!0;if(r){if(e.matches(r))return!0;if(n&&null!==o.closest(r))return!0}return!1}function ae(e,t){return-2===t.getId(e)}function ie(e,t){if(p(e))return!1;var r=t.getId(e);return!t.has(r)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ie(e.parentNode,t))}function se(e){return Boolean(e.changedTouches)}function ue(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var o=r[0];if(!(0 in r))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}function ce(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function le(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function fe(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(X=new Proxy(X,{get:function(e,t,r){return"map"===t&&console.error(Q),Reflect.get(e,t,r)}}));var de=function(){function e(){V(this,e),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return J(e,[{key:"getId",value:function(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]),e}(),pe=function(e){return 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}(pe||{}),he=function(e){return 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}(he||{}),ge=function(e){return 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}(ge||{}),ve=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(ve||{});function me(e){return"__ln"in e}var ye=function(){function e(){V(this,e),this.length=0,this.head=null}return J(e,[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}},{key:"addNode",value:function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&me(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&me(e.nextSibling)&&e.nextSibling.__ln.previous){var 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++}},{key:"removeNode",value:function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}]),e}(),we=function(e,t){return"".concat(e,"@").concat(t)},Ie=function(){function e(){var t=this;V(this,e),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=function(e){e.forEach(t.processMutation),t.emit()},this.emit=function(){if(!t.frozen&&!t.locked){for(var e=[],r=new ye,n=function(e){for(var r=e,n=-2;-2===n;)n=(r=r&&r.nextSibling)&&t.mirror.getId(r);return n},o=function(o){var a,i,s,u,c=null;(null===(i=null===(a=o.getRootNode)||void 0===a?void 0:a.call(o))||void 0===i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&o.getRootNode().host&&(c=o.getRootNode().host);for(var l=c;(null===(u=null===(s=null==l?void 0:l.getRootNode)||void 0===s?void 0:s.call(l))||void 0===u?void 0:u.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&l.getRootNode().host;)l=l.getRootNode().host;var f=!(t.doc.contains(o)||l&&t.doc.contains(l));if(o.parentNode&&!f){var d=p(o.parentNode)?t.mirror.getId(c):t.mirror.getId(o.parentNode),h=n(o);if(-1===d||-1===h)return r.addNode(o);var g=P(o,{doc:t.doc,mirror:t.mirror,blockClass:t.blockClass,blockSelector:t.blockSelector,maskTextClass:t.maskTextClass,maskTextSelector:t.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:t.inlineStylesheet,maskInputOptions:t.maskInputOptions,maskTextFn:t.maskTextFn,maskInputFn:t.maskInputFn,slimDOMOptions:t.slimDOMOptions,dataURLOptions:t.dataURLOptions,recordCanvas:t.recordCanvas,inlineImages:t.inlineImages,onSerialize:function(e){ce(e,t.mirror)&&t.iframeManager.addIframe(e),le(e,t.mirror)&&t.stylesheetManager.trackLinkElement(e),fe(o)&&t.shadowDomManager.addShadowRoot(o.shadowRoot,t.doc)},onIframeLoad:function(e,r){t.iframeManager.attachIframe(e,r),t.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,r){t.stylesheetManager.attachLinkElement(e,r)}});g&&e.push({parentId:d,nextId:h,node:g})}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());for(var a=0,i=Array.from(t.movedSet.values());a<i.length;a++){var s=i[a];Ce(t.removes,s,t.mirror)&&!t.movedSet.has(s.parentNode)||o(s)}for(var u=0,c=Array.from(t.addedSet.values());u<c.length;u++){var l=c[u];ke(t.droppedSet,l)||Ce(t.removes,l,t.mirror)?ke(t.movedSet,l)?o(l):t.droppedSet.add(l):o(l)}for(var f=null;r.length;){var d=null;if(f){var h=t.mirror.getId(f.value.parentNode),g=n(f.value);-1!==h&&-1!==g&&(d=f)}if(!d)for(var v=r.length-1;v>=0;v--){var m=r.get(v);if(m){var y=t.mirror.getId(m.value.parentNode);if(-1===n(m.value))continue;if(-1!==y){d=m;break}var w=m.value;if(w.parentNode&&w.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var I=w.parentNode.host;if(-1!==t.mirror.getId(I)){d=m;break}}}}if(!d){for(;r.head;)r.removeNode(r.head.value);break}f=d.previous,r.removeNode(d.value),o(d.value)}var b={texts:t.texts.map((function(e){return{id:t.mirror.getId(e.node),value:e.value}})).filter((function(e){return t.mirror.has(e.id)})),attributes:t.attributes.map((function(e){return{id:t.mirror.getId(e.node),attributes:e.attributes}})).filter((function(e){return t.mirror.has(e.id)})),removes:t.removes,adds:e};(b.texts.length||b.attributes.length||b.removes.length||b.adds.length)&&(t.texts=[],t.attributes=[],t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.movedMap={},t.mutationCb(b))}},this.processMutation=function(e){if(!ae(e.target,t.mirror))switch(e.type){case"characterData":var r=e.target.textContent;oe(e.target,t.blockClass,t.blockSelector,!1)||r===e.oldValue||t.texts.push({value:F(e.target,t.maskTextClass,t.maskTextSelector)&&r?t.maskTextFn?t.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:e.target});break;case"attributes":var n=e.target,o=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(o=y({maskInputOptions:t.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:o,maskInputFn:t.maskInputFn})),oe(e.target,t.blockClass,t.blockSelector,!1)||o===e.oldValue)return;var a=t.attributes.find((function(t){return t.node===e.target}));if("IFRAME"===n.tagName&&"src"===e.attributeName&&!t.keepIframeSrcFn(o)){if(n.contentDocument)return;e.attributeName="rr_src"}if(a||(a={node:e.target,attributes:{}},t.attributes.push(a)),"style"===e.attributeName){var i=t.doc.createElement("span");e.oldValue&&i.setAttribute("style",e.oldValue),void 0!==a.attributes.style&&null!==a.attributes.style||(a.attributes.style={});for(var s=a.attributes.style,u=0,c=Array.from(n.style);u<c.length;u++){var l=c[u],f=n.style.getPropertyValue(l),d=n.style.getPropertyPriority(l);f===i.style.getPropertyValue(l)&&d===i.style.getPropertyPriority(l)||(s[l]=""===d?f:[f,d])}for(var g=0,v=Array.from(i.style);g<v.length;g++){var m=v[g];""===n.style.getPropertyValue(m)&&(s[m]=!1)}}else a.attributes[e.attributeName]=D(t.doc,n.tagName,e.attributeName,o);break;case"childList":if(oe(e.target,t.blockClass,t.blockSelector,!0))return;e.addedNodes.forEach((function(r){return t.genAdds(r,e.target)})),e.removedNodes.forEach((function(r){var n=t.mirror.getId(r),o=p(e.target)?t.mirror.getId(e.target.host):t.mirror.getId(e.target);oe(e.target,t.blockClass,t.blockSelector,!1)||ae(r,t.mirror)||!function(e,t){return-1!==t.getId(e)}(r,t.mirror)||(t.addedSet.has(r)?(be(t.addedSet,r),t.droppedSet.add(r)):t.addedSet.has(e.target)&&-1===n||ie(e.target,t.mirror)||(t.movedSet.has(r)&&t.movedMap[we(n,o)]?be(t.movedSet,r):t.removes.push({parentId:o,id:n,isShadow:!(!p(e.target)||!h(e.target))||void 0})),t.mapRemoves.push(r))}))}},this.genAdds=function(e,r){if(t.mirror.hasNode(e)){if(ae(e,t.mirror))return;t.movedSet.add(e);var n=null;r&&t.mirror.hasNode(r)&&(n=t.mirror.getId(r)),n&&-1!==n&&(t.movedMap[we(t.mirror.getId(e),n)]=!0)}else t.addedSet.add(e),t.droppedSet.delete(e);oe(e,t.blockClass,t.blockSelector,!1)||e.childNodes.forEach((function(e){return t.genAdds(e)}))}}return J(e,[{key:"init",value:function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach((function(r){t[r]=e[r]}))}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]),e}();function be(e,t){e.delete(t),t.childNodes.forEach((function(t){return be(e,t)}))}function Ce(e,t,r){return 0!==e.length&&Se(e,t,r)}function Se(e,t,r){var n=t.parentNode;if(!n)return!1;var o=r.getId(n);return!!e.some((function(e){return e.id===o}))||Se(e,n,r)}function ke(e,t){return 0!==e.size&&Ae(e,t)}function Ae(e,t){var r=t.parentNode;return!!r&&(!!e.has(r)||Ae(e,r))}var xe=[],Ee="undefined"!=typeof CSSGroupingRule,Te="undefined"!=typeof CSSMediaRule,Re="undefined"!=typeof CSSSupportsRule,Me="undefined"!=typeof CSSConditionRule;function Oe(e){try{if("composedPath"in e){var 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 Le(e,t){var r,n,o=new Ie;xe.push(o),o.init(e);var a=window.MutationObserver||window.__rrMutationObserver,i=null===(n=null===(r=null===window||void 0===window?void 0:window.Zone)||void 0===r?void 0:r.__symbol__)||void 0===n?void 0:n.call(r,"MutationObserver");i&&window[i]&&(a=window[i]);var s=new a(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Ne(e){var t=e.mousemoveCb,r=e.sampling,n=e.doc,o=e.mirror;if(!1===r.mousemove)return function(){};var a,i="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],c=$((function(e){var r=Date.now()-a;t(u.map((function(e){return e.timeOffset-=r,e})),e),u=[],a=null}),s),l=$((function(e){var t=Oe(e),r=se(e)?e.changedTouches[0]:e,n=r.clientX,i=r.clientY;a||(a=Date.now()),u.push({x:n,y:i,id:o.getId(t),timeOffset:Date.now()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?he.Drag:e instanceof MouseEvent?he.MouseMove:he.TouchMove)}),i,{trailing:!1}),f=[z("mousemove",l,n),z("touchmove",l,n),z("drag",l,n)];return function(){f.forEach((function(e){return e()}))}}function De(e){var t=e.mouseInteractionCb,r=e.doc,n=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.sampling;if(!1===i.mouseInteraction)return function(){};var s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,u=[];return Object.keys(ge).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(e){var i=e.toLowerCase(),s=function(e){return function(r){var i=Oe(r);if(!oe(i,o,a,!0)){var s=se(r)?r.changedTouches[0]:r;if(s){var u=n.getId(i),c=s.clientX,l=s.clientY;t({type:ge[e],id:u,x:c,y:l})}}}}(e);u.push(z(i,s,r))})),function(){u.forEach((function(e){return e()}))}}function _e(e){var t=e.scrollCb,r=e.doc,n=e.mirror,o=e.blockClass,a=e.blockSelector;return z("scroll",$((function(e){var i=Oe(e);if(i&&!oe(i,o,a,!0)){var s=n.getId(i);if(i===r){var u=r.scrollingElement||r.documentElement;t({id:s,x:u.scrollLeft,y:u.scrollTop})}else t({id:s,x:i.scrollLeft,y:i.scrollTop})}}),e.sampling.scroll||100),r)}function Fe(e){var t=e.viewportResizeCb,r=-1,n=-1;return z("resize",$((function(){var e=re(),o=ne();r===e&&n===o||(t({width:Number(o),height:Number(e)}),r=e,n=o)}),200),window)}function Ue(e,t){var r=Object.assign({},e);return t||delete r.userTriggered,r}var Be=["INPUT","TEXTAREA","SELECT"],Pe=new WeakMap;function We(e){var t=e.inputCb,r=e.doc,n=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.ignoreClass,s=e.maskInputOptions,u=e.maskInputFn,c=e.sampling,l=e.userTriggeredOnInput;function f(e){var t=Oe(e),n=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(Be.indexOf(t.tagName)<0)&&!oe(t,o,a,!0)){var c=t.type;if(!t.classList.contains(i)){var f=t.value,p=!1;"radio"===c||"checkbox"===c?p=t.checked:(s[t.tagName.toLowerCase()]||s[c])&&(f=y({maskInputOptions:s,tagName:t.tagName,type:c,value:f,maskInputFn:u})),d(t,Ue({text:f,isChecked:p,userTriggered:n},l));var h=t.name;"radio"===c&&h&&p&&r.querySelectorAll('input[type="radio"][name="'.concat(h,'"]')).forEach((function(e){e!==t&&d(e,Ue({text:e.value,isChecked:!p,userTriggered:!1},l))}))}}}function d(e,r){var o=Pe.get(e);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Pe.set(e,r);var a=n.getId(e);t(Object.assign(Object.assign({},r),{id:a}))}}var p=("last"===c.input?["change"]:["input","change"]).map((function(e){return z(e,f,r)})),h=r.defaultView;if(!h)return function(){p.forEach((function(e){return e()}))};var g=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),v=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push.apply(p,Y(v.map((function(e){return ee(e[0],e[1],{set:function(){f({target:this})}},!1,h)})))),function(){p.forEach((function(e){return e()}))}}function Ge(e){return function(e,t){if(Ee&&e.parentRule instanceof CSSGroupingRule||Te&&e.parentRule instanceof CSSMediaRule||Re&&e.parentRule instanceof CSSSupportsRule||Me&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ke(e,t,r){var n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function je(e,t){var r=e.styleSheetRuleCb,n=e.mirror,o=e.stylesheetManager,a=t.win,i=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var a=Ke(this,n,o.styleMirror),s=a.id,u=a.styleId;return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,adds:[{rule:e,index:t}]}),i.apply(this,[e,t])};var s,u,c=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=Ke(this,n,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&r({id:a,styleId:i,removes:[{index:e}]}),c.apply(this,[e])},a.CSSStyleSheet.prototype.replace&&(s=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=function(e){var t=Ke(this,n,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&r({id:a,styleId:i,replace:e}),s.apply(this,[e])}),a.CSSStyleSheet.prototype.replaceSync&&(u=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=function(e){var t=Ke(this,n,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&r({id:a,styleId:i,replaceSync:e}),u.apply(this,[e])});var l={};Ee?l.CSSGroupingRule=a.CSSGroupingRule:(Te&&(l.CSSMediaRule=a.CSSMediaRule),Me&&(l.CSSConditionRule=a.CSSConditionRule),Re&&(l.CSSSupportsRule=a.CSSSupportsRule));var f={};return Object.entries(l).forEach((function(e){var t=K(e,2),a=t[0],i=t[1];f[a]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=function(e,t){var i=Ke(this.parentStyleSheet,n,o.styleMirror),s=i.id,u=i.styleId;return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,adds:[{rule:e,index:[].concat(Y(Ge(this)),[t||0])}]}),f[a].insertRule.apply(this,[e,t])},i.prototype.deleteRule=function(e){var t=Ke(this.parentStyleSheet,n,o.styleMirror),i=t.id,s=t.styleId;return(i&&-1!==i||s&&-1!==s)&&r({id:i,styleId:s,removes:[{index:[].concat(Y(Ge(this)),[e])}]}),f[a].deleteRule.apply(this,[e])}})),function(){a.CSSStyleSheet.prototype.insertRule=i,a.CSSStyleSheet.prototype.deleteRule=c,s&&(a.CSSStyleSheet.prototype.replace=s),u&&(a.CSSStyleSheet.prototype.replaceSync=u),Object.entries(l).forEach((function(e){var t=K(e,2),r=t[0],n=t[1];n.prototype.insertRule=f[r].insertRule,n.prototype.deleteRule=f[r].deleteRule}))}}function Ye(e,t){var r,n,o,a=e.mirror,i=e.stylesheetManager,s=null;s="#document"===t.nodeName?a.getId(t):a.getId(t.host);var u="#document"===t.nodeName?null===(r=t.defaultView)||void 0===r?void 0:r.Document:null===(o=null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===o?void 0:o.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets");return null!==s&&-1!==s&&u&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:function(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set:function(e){var t,r=null===(t=c.set)||void 0===t?void 0:t.call(this,e);if(null!==s&&-1!==s)try{i.adoptStyleSheets(e,s)}catch(e){}return r}}),function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}):function(){}}function Ze(e,t){var r=e.styleDeclarationCb,n=e.mirror,o=e.ignoreCSSAttributes,a=e.stylesheetManager,i=t.win,s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var u;if(o.has(e))return s.apply(this,[e,t,i]);var c=Ke(null===(u=this.parentRule)||void 0===u?void 0:u.parentStyleSheet,n,a.styleMirror),l=c.id,f=c.styleId;return(l&&-1!==l||f&&-1!==f)&&r({id:l,styleId:f,set:{property:e,value:t,priority:i},index:Ge(this.parentRule)}),s.apply(this,[e,t,i])};var u=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t;if(o.has(e))return u.apply(this,[e]);var i=Ke(null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet,n,a.styleMirror),s=i.id,c=i.styleId;return(s&&-1!==s||c&&-1!==c)&&r({id:s,styleId:c,remove:{property:e},index:Ge(this.parentRule)}),u.apply(this,[e])},function(){i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=u}}function Ve(e){var t=e.mediaInteractionCb,r=e.blockClass,n=e.blockSelector,o=e.mirror,a=e.sampling,i=function(e){return $((function(a){var i=Oe(a);if(i&&!oe(i,r,n,!0)){var s=i.currentTime,u=i.volume,c=i.muted,l=i.playbackRate;t({type:e,id:o.getId(i),currentTime:s,volume:u,muted:c,playbackRate:l})}}),a.media||500)},s=[z("play",i(0)),z("pause",i(1)),z("seeked",i(2)),z("volumechange",i(3)),z("ratechange",i(4))];return function(){s.forEach((function(e){return e()}))}}function He(e){var t=e.fontCb,r=e.doc,n=r.defaultView;if(!n)return function(){};var o=[],a=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,r){var n=new i(e,t,r);return a.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var s=te(r.fonts,"add",(function(e){return function(r){return setTimeout((function(){var e=a.get(r);e&&(t(e),a.delete(r))}),0),e.apply(this,[r])}}));return o.push((function(){n.FontFace=i})),o.push(s),function(){o.forEach((function(e){return e()}))}}function Je(e){var t=e.doc,r=e.mirror,n=e.blockClass,o=e.blockSelector,a=e.selectionCb,i=!0,s=function(){var e=t.getSelection();if(!(!e||i&&(null==e?void 0:e.isCollapsed))){i=e.isCollapsed||!1;for(var s=[],u=e.rangeCount||0,c=0;c<u;c++){var l=e.getRangeAt(c),f=l.startContainer,d=l.startOffset,p=l.endContainer,h=l.endOffset;oe(f,n,o,!0)||oe(p,n,o,!0)||s.push({start:r.getId(f),startOffset:d,end:r.getId(p),endOffset:h})}a({ranges:s})}};return s(),z("selectionchange",s)}function qe(e,t){var r=e.mutationCb,n=e.mousemoveCb,o=e.mouseInteractionCb,a=e.scrollCb,i=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,c=e.styleSheetRuleCb,l=e.styleDeclarationCb,f=e.canvasMutationCb,d=e.fontCb,p=e.selectionCb;e.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),r.apply(void 0,arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),n.apply(void 0,arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),o.apply(void 0,arguments)},e.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),a.apply(void 0,arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),i.apply(void 0,arguments)},e.inputCb=function(){t.input&&t.input.apply(t,arguments),s.apply(void 0,arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),u.apply(void 0,arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),c.apply(void 0,arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),l.apply(void 0,arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),f.apply(void 0,arguments)},e.fontCb=function(){t.font&&t.font.apply(t,arguments),d.apply(void 0,arguments)},e.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),p.apply(void 0,arguments)}}function ze(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.doc.defaultView;if(!r)return function(){};qe(e,t);var n,o=Le(e,e.doc),a=Ne(e),i=De(e),s=_e(e),u=Fe(e),c=We(e),l=Ve(e),d=je(e,{win:r}),p=Ye(e,e.doc),h=Ze(e,{win:r}),g=e.collectFonts?He(e):function(){},v=Je(e),m=[],y=f(e.plugins);try{for(y.s();!(n=y.n()).done;){var w=n.value;m.push(w.observer(w.callback,r,w.options))}}catch(e){y.e(e)}finally{y.f()}return function(){xe.forEach((function(e){return e.reset()})),o.disconnect(),a(),i(),s(),u(),c(),l(),d(),p(),h(),g(),v(),m.forEach((function(e){return e()}))}}var Qe=function(){function e(t){V(this,e),this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}return J(e,[{key:"getId",value:function(e,t,r,n){var o=r||this.getIdToRemoteIdMap(e),a=n||this.getRemoteIdToIdMap(e),i=o.get(t);return i||(i=this.generateIdFn(),o.set(t,i),a.set(i,t)),i}},{key:"getIds",value:function(e,t){var r=this,n=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map((function(t){return r.getId(e,t,n,o)}))}},{key:"getRemoteId",value:function(e,t,r){var n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var o=n.get(t);return o||-1}},{key:"getRemoteIds",value:function(e,t){var r=this,n=this.getRemoteIdToIdMap(e);return t.map((function(t){return r.getRemoteId(e,t,n)}))}},{key:"reset",value:function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),e}(),Xe=function(){function e(t){V(this,e),this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Qe(k),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Qe(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}return J(e,[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(r=this.loadListener)||void 0===r||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){if("rrweb"===e.data.type){if(!e.source)return;var t=this.crossOriginIframeMap.get(e.source);if(!t)return;var r=this.transformCrossOriginEvent(t,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}},{key:"transformCrossOriginEvent",value:function(e,t){var r,n=this;switch(t.type){case pe.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:pe.IncrementalSnapshot,data:{source:he.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case pe.Meta:case pe.Load:case pe.DomContentLoaded:return!1;case pe.Plugin:return t;case pe.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case pe.IncrementalSnapshot:switch(t.data.source){case he.Mutation:return t.data.adds.forEach((function(t){n.replaceIds(t,e,["parentId","nextId","previousId"]),n.replaceIdOnNode(t.node,e)})),t.data.removes.forEach((function(t){n.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((function(t){n.replaceIds(t,e,["id"])})),t.data.texts.forEach((function(t){n.replaceIds(t,e,["id"])})),t;case he.Drag:case he.TouchMove:case he.MouseMove:return t.data.positions.forEach((function(t){n.replaceIds(t,e,["id"])})),t;case he.ViewportResize:return!1;case he.MediaInteraction:case he.MouseInteraction:case he.Scroll:case he.CanvasMutation:case he.Input:return this.replaceIds(t.data,e,["id"]),t;case he.StyleSheetRule:case he.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case he.Font:return t;case he.Selection:return t.data.ranges.forEach((function(t){n.replaceIds(t,e,["start","end"])})),t;case he.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(r=t.data.styles)||void 0===r||r.forEach((function(t){n.replaceStyleIds(t,e,["styleId"])})),t}}}},{key:"replace",value:function(e,t,r,n){var o,a=f(n);try{for(a.s();!(o=a.n()).done;){var i=o.value;(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]))}}catch(e){a.e(e)}finally{a.f()}return t}},{key:"replaceIds",value:function(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}},{key:"replaceStyleIds",value:function(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}},{key:"replaceIdOnNode",value:function(e,t){var r=this;this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach((function(e){r.replaceIdOnNode(e,t)}))}}]),e}(),$e=function(){function e(t){V(this,e),this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;var r=this;this.restorePatches.push(te(Element.prototype,"attachShadow",(function(e){return function(t){var n=e.call(this,t);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}return J(e,[{key:"addShadowRoot",value:function(e,t){var r=this;h(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),Le(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),_e(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&r.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,r.mirror.getId(e.host)),Ye({mirror:r.mirror,stylesheetManager:r.bypassOptions.stylesheetManager},e)}),0)))}},{key:"observeAttachShadow",value:function(e){if(e.contentWindow){var t=this;this.restorePatches.push(te(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(r){return function(n){var o=r.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),o}})))}}},{key:"reset",value:function(){this.restorePatches.forEach((function(e){return e()})),this.shadowDoms=new WeakSet}}]),e}();function et(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))}for(var tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),nt=0;nt<tt.length;nt++)rt[tt.charCodeAt(nt)]=nt;var ot=new Map;var at=function(e,t,r){if(e&&(ut(e,t)||"object"===s(e))){var n=function(e,t){var r=ot.get(e);return r||(r=new Map,ot.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),o=n.indexOf(e);return-1===o&&(o=n.length,n.push(e)),o}};function it(e,t,r){if(e instanceof Array)return e.map((function(e){return it(e,t,r)}));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){var n=e.constructor.name,o=function(e){var t,r=new Uint8Array(e),n=r.length,o="";for(t=0;t<n;t+=3)o+=tt[r[t]>>2],o+=tt[(3&r[t])<<4|r[t+1]>>4],o+=tt[(15&r[t+1])<<2|r[t+2]>>6],o+=tt[63&r[t+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:n,base64:o}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[it(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement)return{rr_type:e.constructor.name,src:e.src};if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[it(e.data,t,r),e.width,e.height]}:ut(e,t)||"object"===s(e)?{rr_type:e.constructor.name,index:at(e,t,r)}:e}var st=function(e,t,r){return Y(e).map((function(e){return it(e,t,r)}))},ut=function(e,t){var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(r.find((function(r){return e instanceof t[r]})))};function ct(e,t,r){var n=[];try{var o=te(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){oe(this,t,r,!0)||"__context"in this||(this.__context=n);for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return e.apply(this,[n].concat(a))}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}function lt(e,t,r,n,o,a,i){var s,u=[],c=Object.getOwnPropertyNames(e),l=f(c);try{var d=function(){var a=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof e[a])return 0;var c=te(e,a,(function(e){return function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];var l=e.apply(this,u);if(at(l,i,this),!oe(this.canvas,n,o,!0)){var f=st([].concat(u),i,this),d={type:t,property:a,args:f};r(this.canvas,d)}return l}}));u.push(c)}catch(n){var l=ee(e,a,{set:function(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});u.push(l)}};for(l.s();!(s=l.n()).done;)d()}catch(e){l.e(e)}finally{l.f()}return u}var ft=null;try{var dt="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof require&&require("worker_threads")||"function"==typeof require&&require("worker_threads");ft=dt.Worker}catch(e){}var pt=r(877).lW;function ht(e,t,r){var n=void 0===t?null:t,o=function(e,t){return pt.from(e,"base64").toString(t?"utf16":"utf8")}(e,void 0!==r&&r),a=o.indexOf("\n",10)+1,i=o.substring(a)+(n?"//# sourceMappingURL="+n:"");return function(e){return new ft(i,Object.assign({},e,{eval:!0}))}}function gt(e,t,r){var n=void 0===t?null:t,o=function(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,a=r.length;o<a;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}(e,void 0!==r&&r),a=o.indexOf("\n",10)+1,i=o.substring(a)+(n?"//# sourceMappingURL="+n:""),s=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(s)}var vt=r(142),mt="[object process]"===Object.prototype.toString.call(void 0!==vt?vt:0);var yt,wt,It,bt,Ct,St,kt=(yt="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",wt=null,It=!1,mt?ht(yt,wt,It):function(e,t,r){var n;return function(o){return n=n||gt(e,t,r),new Worker(n,o)}}(yt,wt,It)),At=function(){function e(t){var r=this;V(this,e),this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(r.rafStamps.invokeId&&r.rafStamps.latestId!==r.rafStamps.invokeId)&&r.rafStamps.invokeId||(r.rafStamps.invokeId=r.rafStamps.latestId),r.pendingCanvasMutations.has(e)||r.pendingCanvasMutations.set(e,[]),r.pendingCanvasMutations.get(e).push(t)};var n=t.sampling,o=void 0===n?"all":n,a=t.win,i=t.blockClass,s=t.blockSelector,u=t.recordCanvas,c=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,u&&"all"===o&&this.initCanvasMutationObserver(a,i,s),u&&"number"==typeof o&&this.initCanvasFPSObserver(o,a,i,s,{dataURLOptions:c})}return J(e,[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,r,n,o,a){var i=this,s=ct(r,n,o),u=new Map,c=new kt;c.onmessage=function(e){var t=e.data.id;if(u.set(t,!1),"base64"in e.data){var r=e.data,n=r.base64,o=r.type,a=r.width,s=r.height;i.mutationCb({id:t,type:ve["2D"],commands:[{property:"clearRect",args:[0,0,a,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:o}]},0,0]}]})}};var l,f=1e3/e,d=0;l=requestAnimationFrame((function e(s){var p;d&&s-d<f?l=requestAnimationFrame(e):(d=s,(p=[],r.document.querySelectorAll("canvas").forEach((function(e){oe(e,n,o,!0)||p.push(e)})),p).forEach((function(e){return et(i,void 0,void 0,t().mark((function r(){var n,o,i,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=this.mirror.getId(e),!u.get(o)){t.next=3;break}return t.abrupt("return");case 3:return u.set(o,!0),["webgl","webgl2"].includes(e.__context)&&(i=e.getContext(e.__context),!1===(null===(n=null==i?void 0:i.getContextAttributes())||void 0===n?void 0:n.preserveDrawingBuffer)&&(null==i||i.clear(i.COLOR_BUFFER_BIT))),t.next=7,createImageBitmap(e);case 7:s=t.sent,c.postMessage({id:o,bitmap:s,width:e.width,height:e.height,dataURLOptions:a.dataURLOptions},[s]);case 9:case"end":return t.stop()}}),r,this)})))})),l=requestAnimationFrame(e))})),this.resetObservers=function(){s(),cancelAnimationFrame(l)}}},{key:"initCanvasMutationObserver",value:function(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=ct(e,t,r),o=function(e,t,r,n){var o,a=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=f(i);try{var u=function(){var i=o.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])return 1;var s=te(t.CanvasRenderingContext2D.prototype,i,(function(o){return function(){for(var a=this,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return oe(this.canvas,r,n,!0)||setTimeout((function(){var r=st([].concat(u),t,a);e(a.canvas,{type:ve["2D"],property:i,args:r})}),0),o.apply(this,u)}}));a.push(s)}catch(r){var u=ee(t.CanvasRenderingContext2D.prototype,i,{set:function(t){e(this.canvas,{type:ve["2D"],property:i,args:[t],setter:!0})}});a.push(u)}};for(s.s();!(o=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}return function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,r),a=function(e,t,r,n,o){var a=[];return a.push.apply(a,Y(lt(t.WebGLRenderingContext.prototype,ve.WebGL,e,r,n,0,t))),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,Y(lt(t.WebGL2RenderingContext.prototype,ve.WebGL2,e,r,n,0,t))),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,r,this.mirror);this.resetObservers=function(){n(),o(),a()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"startRAFTimestamping",value:function(){var e=this;requestAnimationFrame((function t(r){e.rafStamps.latestId=r,requestAnimationFrame(t)}))}},{key:"flushPendingCanvasMutations",value:function(){var e=this;this.pendingCanvasMutations.forEach((function(t,r){var n=e.mirror.getId(r);e.flushPendingCanvasMutationFor(r,n)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"flushPendingCanvasMutationFor",value:function(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((function(e){var t=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["type"]);return t})),o=r[0].type;this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),xt=function(){function e(t){V(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new de,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return J(e,[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){if(0!==e.length){var r,n={id:t,styleIds:[]},o=[],a=f(e);try{for(a.s();!(r=a.n()).done;){var i=r.value,s=void 0;if(this.styleMirror.has(i))s=this.styleMirror.getId(i);else{s=this.styleMirror.add(i);var u=Array.from(i.rules||CSSRule);o.push({styleId:s,rules:u.map((function(e,t){return{rule:v(e),index:t}}))})}n.styleIds.push(s)}}catch(e){a.e(e)}finally{a.f()}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}();function Et(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}var Tt=!1,Rt=new m;function Mt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,r=e.checkoutEveryNms,n=e.checkoutEveryNth,o=e.blockClass,a=void 0===o?"rr-block":o,i=e.blockSelector,s=void 0===i?null:i,u=e.ignoreClass,c=void 0===u?"rr-ignore":u,l=e.maskTextClass,d=void 0===l?"rr-mask":l,p=e.maskTextSelector,h=void 0===p?null:p,g=e.inlineStylesheet,v=void 0===g||g,m=e.maskAllInputs,y=e.maskInputOptions,w=e.slimDOMOptions,I=e.maskInputFn,b=e.maskTextFn,C=e.hooks,S=e.packFn,k=e.sampling,A=void 0===k?{}:k,x=e.dataURLOptions,E=void 0===x?{}:x,T=e.mousemoveWait,R=e.recordCanvas,M=void 0!==R&&R,O=e.recordCrossOriginIframes,L=void 0!==O&&O,N=e.userTriggeredOnInput,D=void 0!==N&&N,_=e.collectFonts,F=void 0!==_&&_,U=e.inlineImages,B=void 0!==U&&U,P=e.plugins,G=e.keepIframeSrcFn,K=void 0===G?function(){return!1}:G,j=e.ignoreCSSAttributes,Y=void 0===j?new Set([]):j,Z=!L||window.parent===window,V=!1;if(!Z)try{window.parent.document,V=!1}catch(e){V=!0}if(Z&&!t)throw new Error("emit function is required");void 0!==T&&void 0===A.mousemove&&(A.mousemove=T),Rt.reset();var H,J=!0===m?{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!==y?y:{password:!0},q=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};ue();var Q=0,X=function(e){var t,r=f(P||[]);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.eventProcessor&&(e=n.eventProcessor(e))}}catch(e){r.e(e)}finally{r.f()}return S&&(e=S(e)),e};bt=function(e,o){var a;if(!(null===(a=xe[0])||void 0===a?void 0:a.isFrozen())||e.type===pe.FullSnapshot||e.type===pe.IncrementalSnapshot&&e.data.source===he.Mutation||xe.forEach((function(e){return e.unfreeze()})),Z)null==t||t(X(e),o);else if(V){var i={type:"rrweb",event:X(e),isCheckout:o};window.parent.postMessage(i,"*")}if(e.type===pe.FullSnapshot)H=e,Q=0;else if(e.type===pe.IncrementalSnapshot){if(e.data.source===he.Mutation&&e.data.isAttachIframe)return;Q++;var s=n&&Q>=n,u=r&&e.timestamp-H.timestamp>r;(s||u)&&Ct(!0)}};var $,ee=function(e){bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.Mutation},e)}))},te=function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.Scroll},e)}))},oe=function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.CanvasMutation},e)}))},ae=function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.AdoptedStyleSheet},e)}))},ie=new xt({mutationCb:ee,adoptedStyleSheetCb:ae}),se=new Xe({mirror:Rt,mutationCb:ee,stylesheetManager:ie,recordCrossOriginIframes:L,wrappedEmit:bt}),de=f(P||[]);try{for(de.s();!($=de.n()).done;){var ge=$.value;ge.getMirror&&ge.getMirror({nodeMirror:Rt,crossOriginIframeMirror:se.crossOriginIframeMirror,crossOriginIframeStyleMirror:se.crossOriginIframeStyleMirror})}}catch(e){de.e(e)}finally{de.f()}St=new At({recordCanvas:M,mutationCb:oe,win:window,blockClass:a,blockSelector:s,mirror:Rt,sampling:A.canvas,dataURLOptions:E});var ve=new $e({mutationCb:ee,scrollCb:te,bypassOptions:{blockClass:a,blockSelector:s,maskTextClass:d,maskTextSelector:h,inlineStylesheet:v,maskInputOptions:J,dataURLOptions:E,maskTextFn:b,maskInputFn:I,recordCanvas:M,inlineImages:B,sampling:A,slimDOMOptions:q,iframeManager:se,stylesheetManager:ie,canvasManager:St,keepIframeSrcFn:K},mirror:Rt});Ct=function(){var e,t,r,n,o,i,u=arguments.length>0&&void 0!==arguments[0]&&arguments[0];bt(Et({type:pe.Meta,data:{href:window.location.href,width:ne(),height:re()}}),u),ie.reset(),xe.forEach((function(e){return e.lock()}));var c=W(document,{mirror:Rt,blockClass:a,blockSelector:s,maskTextClass:d,maskTextSelector:h,inlineStylesheet:v,maskAllInputs:J,maskTextFn:b,slimDOM:q,dataURLOptions:E,recordCanvas:M,inlineImages:B,onSerialize:function(e){ce(e,Rt)&&se.addIframe(e),le(e,Rt)&&ie.trackLinkElement(e),fe(e)&&ve.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){se.attachIframe(e,t),ve.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ie.attachLinkElement(e,t)},keepIframeSrcFn:K});if(!c)return console.warn("Failed to snapshot the document");bt(Et({type:pe.FullSnapshot,data:{node:c,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(t=null===(e=null===document||void 0===document?void 0:document.body)||void 0===e?void 0:e.parentElement)||void 0===t?void 0:t.scrollLeft)||(null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(o=null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.parentElement)||void 0===o?void 0:o.scrollTop)||(null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.scrollTop)||0}}})),xe.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ie.adoptStyleSheets(document.adoptedStyleSheets,Rt.getId(document))};try{var me=[];me.push(z("DOMContentLoaded",(function(){bt(Et({type:pe.DomContentLoaded,data:{}}))})));var ye=function(e){var t;return ze({mutationCb:ee,mousemoveCb:function(e,t){return bt(Et({type:pe.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.MouseInteraction},e)}))},scrollCb:te,viewportResizeCb:function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.ViewportResize},e)}))},inputCb:function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.Input},e)}))},mediaInteractionCb:function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.StyleDeclaration},e)}))},canvasMutationCb:oe,fontCb:function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.Font},e)}))},selectionCb:function(e){bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.Selection},e)}))},blockClass:a,ignoreClass:c,maskTextClass:d,maskTextSelector:h,maskInputOptions:J,inlineStylesheet:v,sampling:A,recordCanvas:M,inlineImages:B,userTriggeredOnInput:D,collectFonts:F,doc:e,maskInputFn:I,maskTextFn:b,keepIframeSrcFn:K,blockSelector:s,slimDOMOptions:q,dataURLOptions:E,mirror:Rt,iframeManager:se,stylesheetManager:ie,shadowDomManager:ve,canvasManager:St,ignoreCSSAttributes:Y,plugins:(null===(t=null==P?void 0:P.filter((function(e){return e.observer})))||void 0===t?void 0:t.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return bt(Et({type:pe.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},C)};se.addLoadListener((function(e){me.push(ye(e.contentDocument))}));var we=function(){Ct(),me.push(ye(document)),Tt=!0};return"interactive"===document.readyState||"complete"===document.readyState?we():me.push(z("load",(function(){bt(Et({type:pe.Load,data:{}})),we()}),window)),function(){me.forEach((function(e){return e()})),Tt=!1}}catch(e){console.warn(e)}}Mt.addCustomEvent=function(e,t){if(!Tt)throw new Error("please add custom event after start recording");bt(Et({type:pe.Custom,data:{tag:e,payload:t}}))},Mt.freezePage=function(){xe.forEach((function(e){return e.freeze()}))},Mt.takeFullSnapshot=function(e){if(!Tt)throw new Error("please take full snapshot after start recording");Ct(e)},Mt.mirror=Rt;var Ot=Uint8Array,Lt=Uint16Array,Nt=Uint32Array,Dt=new Ot([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),_t=new Ot([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ft=new Ot([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ut=function(e,t){for(var r=new Lt(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var o=new Nt(r[30]);for(n=1;n<30;++n)for(var a=r[n];a<r[n+1];++a)o[a]=a-r[n]<<5|n;return[r,o]},Bt=Ut(Dt,2),Pt=Bt[0],Wt=Bt[1];Pt[28]=258,Wt[258]=28;for(var Gt=Ut(_t,0),Kt=(Gt[0],Gt[1]),jt=new Lt(32768),Yt=0;Yt<32768;++Yt){var Zt=(43690&Yt)>>>1|(21845&Yt)<<1;Zt=(61680&(Zt=(52428&Zt)>>>2|(13107&Zt)<<2))>>>4|(3855&Zt)<<4,jt[Yt]=((65280&Zt)>>>8|(255&Zt)<<8)>>>1}var Vt=function(e,t,r){for(var n=e.length,o=0,a=new Lt(t);o<n;++o)++a[e[o]-1];var i,s=new Lt(t);for(o=0;o<t;++o)s[o]=s[o-1]+a[o-1]<<1;if(r){i=new Lt(1<<t);var u=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],l=t-e[o],f=s[e[o]-1]++<<l,d=f|(1<<l)-1;f<=d;++f)i[jt[f]>>>u]=c}else for(i=new Lt(n),o=0;o<n;++o)i[o]=jt[s[e[o]-1]++]>>>15-e[o];return i},Ht=new Ot(288);for(Yt=0;Yt<144;++Yt)Ht[Yt]=8;for(Yt=144;Yt<256;++Yt)Ht[Yt]=9;for(Yt=256;Yt<280;++Yt)Ht[Yt]=7;for(Yt=280;Yt<288;++Yt)Ht[Yt]=8;var Jt=new Ot(32);for(Yt=0;Yt<32;++Yt)Jt[Yt]=5;var qt=Vt(Ht,9,0),zt=Vt(Jt,5,0),Qt=function(e){return(e/8>>0)+(7&e&&1)},Xt=function(e,t,r){(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof Lt?Lt:e instanceof Nt?Nt:Ot)(r-t);return n.set(e.subarray(t,r)),n},$t=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},er=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},tr=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,a=r.slice();if(!o)return[new Ot(0),0];if(1==o){var i=new Ot(r[0].s+1);return i[r[0].s]=1,[i,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var s=r[0],u=r[1],c=0,l=1,f=2;for(r[0]={s:-1,f:s.f+u.f,l:s,r:u};l!=o-1;)s=r[r[c].f<r[f].f?c++:f++],u=r[c!=l&&r[c].f<r[f].f?c++:f++],r[l++]={s:-1,f:s.f+u.f,l:s,r:u};var d=a[0].s;for(n=1;n<o;++n)a[n].s>d&&(d=a[n].s);var p=new Lt(d+1),h=rr(r[l-1],p,0);if(h>t){n=0;var g=0,v=h-t,m=1<<v;for(a.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));n<o;++n){var y=a[n].s;if(!(p[y]>t))break;g+=m-(1<<h-p[y]),p[y]=t}for(g>>>=v;g>0;){var w=a[n].s;p[w]<t?g-=1<<t-p[w]++-1:++n}for(;n>=0&&g;--n){var I=a[n].s;p[I]==t&&(--p[I],++g)}h=t}return[new Ot(p),h]},rr=function e(t,r,n){return-1==t.s?Math.max(e(t.l,r,n+1),e(t.r,r,n+1)):r[t.s]=n},nr=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Lt(++t),n=0,o=e[0],a=1,i=function(e){r[n++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++a;else{if(!o&&a>2){for(;a>138;a-=138)i(32754);a>2&&(i(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(i(o),--a;a>6;a-=6)i(8304);a>2&&(i(a-3<<5|8208),a=0)}for(;a--;)i(o);a=1,o=e[s]}return[r.subarray(0,n),t]},or=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},ar=function(e,t,r){var n=r.length,o=Qt(t+2);e[o]=255&n,e[o+1]=n>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var a=0;a<n;++a)e[o+a+4]=r[a];return 8*(o+4+n)},ir=function(e,t,r,n,o,a,i,s,u,c,l){$t(t,l++,r),++o[256];for(var f=tr(o,15),d=f[0],p=f[1],h=tr(a,15),g=h[0],v=h[1],m=nr(d),y=m[0],w=m[1],I=nr(g),b=I[0],C=I[1],S=new Lt(19),k=0;k<y.length;++k)S[31&y[k]]++;for(k=0;k<b.length;++k)S[31&b[k]]++;for(var A=tr(S,7),x=A[0],E=A[1],T=19;T>4&&!x[Ft[T-1]];--T);var R,M,O,L,N=c+5<<3,D=or(o,Ht)+or(a,Jt)+i,_=or(o,d)+or(a,g)+i+14+3*T+or(S,x)+(2*S[16]+3*S[17]+7*S[18]);if(N<=D&&N<=_)return ar(t,l,e.subarray(u,u+c));if($t(t,l,1+(_<D)),l+=2,_<D){R=Vt(d,p,0),M=d,O=Vt(g,v,0),L=g;var F=Vt(x,E,0);$t(t,l,w-257),$t(t,l+5,C-1),$t(t,l+10,T-4),l+=14;for(k=0;k<T;++k)$t(t,l+3*k,x[Ft[k]]);l+=3*T;for(var U=[y,b],B=0;B<2;++B){var P=U[B];for(k=0;k<P.length;++k){var W=31&P[k];$t(t,l,F[W]),l+=x[W],W>15&&($t(t,l,P[k]>>>5&127),l+=P[k]>>>12)}}}else R=qt,M=Ht,O=zt,L=Jt;for(k=0;k<s;++k)if(n[k]>255){W=n[k]>>>18&31;er(t,l,R[W+257]),l+=M[W+257],W>7&&($t(t,l,n[k]>>>23&31),l+=Dt[W]);var G=31&n[k];er(t,l,O[G]),l+=L[G],G>3&&(er(t,l,n[k]>>>5&8191),l+=_t[G])}else er(t,l,R[n[k]]),l+=M[n[k]];return er(t,l,R[256]),l+M[256]},sr=new Nt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ur=new Ot(0),cr=function(e,t,r,n,o){return function(e,t,r,n,o,a){var i=e.length,s=new Ot(n+i+5*(1+Math.floor(i/7e3))+o),u=s.subarray(n,s.length-o),c=0;if(!t||i<8)for(var l=0;l<=i;l+=65535){var f=l+65535;f<i?c=ar(u,c,e.subarray(l,f)):(u[l]=a,c=ar(u,c,e.subarray(l,i)))}else{for(var d=sr[t-1],p=d>>>13,h=8191&d,g=(1<<r)-1,v=new Lt(32768),m=new Lt(g+1),y=Math.ceil(r/3),w=2*y,I=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<w)&g},b=new Nt(25e3),C=new Lt(288),S=new Lt(32),k=0,A=0,x=(l=0,0),E=0,T=0;l<i;++l){var R=I(l),M=32767&l,O=m[R];if(v[M]=O,m[R]=M,E<=l){var L=i-l;if((k>7e3||x>24576)&&L>423){c=ir(e,u,0,b,C,S,A,x,T,l-T,c),x=k=A=0,T=l;for(var N=0;N<286;++N)C[N]=0;for(N=0;N<30;++N)S[N]=0}var D=2,_=0,F=h,U=M-O&32767;if(L>2&&R==I(l-U))for(var B=Math.min(p,L)-1,P=Math.min(32767,l),W=Math.min(258,L);U<=P&&--F&&M!=O;){if(e[l+D]==e[l+D-U]){for(var G=0;G<W&&e[l+G]==e[l+G-U];++G);if(G>D){if(D=G,_=U,G>B)break;var K=Math.min(U,G-2),j=0;for(N=0;N<K;++N){var Y=l-U+N+32768&32767,Z=Y-v[Y]+32768&32767;Z>j&&(j=Z,O=Y)}}}U+=(M=O)-(O=v[M])+32768&32767}if(_){b[x++]=268435456|Wt[D]<<18|Kt[_];var V=31&Wt[D],H=31&Kt[_];A+=Dt[V]+_t[H],++C[257+V],++S[H],E=l+D,++k}else b[x++]=e[l],++C[e[l]]}}c=ir(e,u,a,b,C,S,A,x,T,l-T,c),a||(c=ar(u,c,ur))}return Xt(s,0,n+Qt(c)+o)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!o)};function lr(e,t){void 0===t&&(t={});var r=function(){var e=1,t=0;return{p:function(r){for(var n=e,o=t,a=r.length,i=0;i!=a;){for(var s=Math.min(i+5552,a);i<s;++i)o+=n+=r[i];n%=65521,o%=65521}e=n,t=o},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();r.p(e);var n=cr(e,t,2,4);return function(e,t){var r=t.level,n=0==r?0:r<6?1:9==r?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)}(n,t),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(n,n.length-4,r.d()),n}var fr=function(e){var t=Object.assign(Object.assign({},e),{v:"v1"});return function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var n=0;n<e.length;){var o=e[n++];o<128||t?r+=String.fromCharCode(o):o<224?r+=String.fromCharCode((31&o)<<6|63&e[n++]):o<240?r+=String.fromCharCode((15&o)<<12|(63&e[n++])<<6|63&e[n++]):(o=((15&o)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}return r}(lr(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Ot(e.length+(e.length>>>1)),o=0,a=function(e){n[o++]=e},i=0;i<r;++i){if(o+5>n.length){var s=new Ot(o+8+(r-i<<1));s.set(n),n=s}var u=e.charCodeAt(i);u<128||t?a(u):u<2048?(a(192|u>>>6),a(128|63&u)):u>55295&&u<57344?(a(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++i))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return Xt(n,0,o)}(JSON.stringify(t))),!0)},dr=Object.defineProperty,pr=function(e,t,r){return function(e,t,r){return t in e?dr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r}(e,"symbol"!==s(t)?t+"":t,r)};var hr=function(){function e(t){V(this,e),pr(this,"fileName"),pr(this,"functionName"),pr(this,"lineNumber"),pr(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return J(e,[{key:"toString",value:function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}]),e}(),gr=/(^|@)\S+:\d+/,vr=/^\s*at .*(\S+:\d+|\(native\))/m,mr=/^(eval@)?(\[native code])?$/,yr={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(vr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(vr)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(r?r[1]:n.pop()),a=n.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new hr({functionName:a,fileName:i,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(mr)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new hr({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,o=this.extractLocation(e.replace(t,""));return new hr({functionName:n,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],o=2,a=r.length;o<a;o+=2){var i=t.exec(r[o]);i&&n.push(new hr({fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],o=0,a=r.length;o<a;o+=2){var i=t.exec(r[o]);i&&n.push(new hr({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(gr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new hr({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function wr(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,o=[];if(n.children&&n.children.length>0)for(var a=0;a<n.children.length;a++){var i=n.children[a];i.localName&&i.localName.toLowerCase&&i.localName.toLowerCase()===r&&o.push(i)}o.length>1&&(r+=":eq(".concat(o.indexOf(e),")")),t=r+(t?">"+t:""),e=n}return t}function Ir(e){return"[object Object]"===Object.prototype.toString.call(e)}function br(e,t){if(0===t)return!0;for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];if(Ir(e[o])&&br(e[o],t-1))return!0}return!1}function Cr(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],o=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?o.splice(a,1/0,e):o.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Ir(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ir(e)&&br(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t="".concat(t.slice(0,r.stringLengthLimit),"..."));return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var i={};for(var s in t){var u=t[s];Array.isArray(u)?i[s]=wr(u.length?u[0]:null):i[s]=u}return i}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Sr={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function kr(e,t,r){var n,o=r?Object.assign({},Sr,r):Sr,a=o.logger;if(!a)return function(){};n="string"==typeof a?t[a]:a;var i=0,s=!1,u=[];if(o.level.includes("error")){var c=function(t){var r=t.message,n=t.error,a=yr.parse(n).map((function(e){return e.toString()})),i=[Cr(r,o.stringifyOptions)];e({level:"error",trace:a,payload:i})};t.addEventListener("error",c),u.push((function(){t.removeEventListener("error",c)}));var l=function(t){var r,n;t.reason instanceof Error?(r=t.reason,n=[Cr("Uncaught (in promise) ".concat(r.name,": ").concat(r.message),o.stringifyOptions)]):(r=new Error,n=[Cr("Uncaught (in promise)",o.stringifyOptions),Cr(t.reason,o.stringifyOptions)]);var a=yr.parse(r).map((function(e){return e.toString()}));e({level:"error",trace:a,payload:n})};t.addEventListener("unhandledrejection",l),u.push((function(){t.removeEventListener("unhandledrejection",l)}))}var d,p=f(o.level);try{for(p.s();!(d=p.n()).done;){var h=d.value;u.push(g(n,h))}}catch(e){p.e(e)}finally{p.f()}return function(){u.forEach((function(e){return e()}))};function g(t,r){var n=this;return t[r]?function(e,t,r){try{if(!(t in e))return function(){};var n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,function(){e[t]=n}}catch(e){return function(){}}}(t,r,(function(t){return function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];if(t.apply(n,u),!("assert"===r&&u[0]||s)){s=!0;try{var l=yr.parse(new Error).map((function(e){return e.toString()})).splice(1),f="assert"===r?u.slice(1):u,d=f.map((function(e){return Cr(e,o.stringifyOptions)}));++i<o.lengthThreshold?e({level:r,trace:l,payload:d}):i===o.lengthThreshold&&e({level:"warn",trace:[],payload:[Cr("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(u))}finally{s=!1}}}})):function(){}}}var Ar=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},xr=function(){var e,t,r;if(localStorage.getItem("rlog-deviceId"))return localStorage.getItem("rlog-deviceId");var n=(null===(e=localStorage)||void 0===e?void 0:e.getItem("utoken"))||(null===(t=localStorage)||void 0===t?void 0:t.getItem("IWP-iwp-deivceTag"))||Ar();return null===(r=localStorage)||void 0===r||r.setItem("rlog-deviceId",n),n},Er=function(e){return null!==e&&"object"===u()(e)&&!Array.isArray(e)},Tr=function e(t,r){var n=l()({},t);for(var o in r)if(r.hasOwnProperty(o)){var a=r[o],i=t[o];Er(a)&&Er(i)?n[o]=e(i,a):void 0!==a&&(n[o]=a)}return n},Rr=r(313),Mr=r.n(Rr),Or=r(142),Lr="[0m",Nr="[1m",Dr={log:{prefix:"📝 LOG",color:"[36m",style:"color: #00bcd4; font-weight: bold;"},info:{prefix:"ℹ️ INFO",color:"[34m",style:"color: #2196f3; font-weight: bold;"},warn:{prefix:"⚠️ WARN",color:"[33m",style:"color: #ff9800; font-weight: bold;"},error:{prefix:"❌ ERROR",color:"[31m",style:"color: #f44336; font-weight: bold;"}};function _r(){return"undefined"!=typeof window||!(void 0===Or||!Or.stdout)&&!0===Or.stdout.isTTY}function Fr(e){for(var t,r,n,o,a,i,s,u,c=Dr[e],l=_r(),f=l?"".concat(c.color).concat(Nr,"[Rlog]").concat(Lr," ").concat(c.prefix).concat(Lr):"[Rlog] ".concat(c.prefix),d=arguments.length,p=new Array(d>1?d-1:0),h=1;h<d;h++)p[h-1]=arguments[h];if("undefined"!=typeof window){var g="%c[Rlog]%c ".concat(c.prefix,"%c"),v=["color: #9c27b0; font-weight: bold; font-size: 14px;",c.style,"color: inherit; font-weight: normal;"];switch(e){case"log":(t=console).log.apply(t,[g].concat(v,p));break;case"info":(r=console).info.apply(r,[g].concat(v,p));break;case"warn":(n=console).warn.apply(n,[g].concat(v,p));break;case"error":(o=console).error.apply(o,[g].concat(v,p))}}else switch(e){case"log":(a=console).log.apply(a,[f].concat(p));break;case"info":(i=console).info.apply(i,[f].concat(p));break;case"warn":(s=console).warn.apply(s,[f].concat(p));break;case"error":(u=console).error.apply(u,[f].concat(p))}}var Ur={log:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Fr.apply(void 0,["log"].concat(t))},info:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Fr.apply(void 0,["info"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Fr.apply(void 0,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Fr.apply(void 0,["error"].concat(t))}},Br=Ur,Pr="logs",Wr=function(){function e(){H()(this,e),Mr()(this,"db",null),Mr()(this,"isOpening",!1),Mr()(this,"openPromise",null),this.openDB().catch(Br.error)}var t,r,n,a,s,u,c,l,f,d;return q()(e,[{key:"openDB",value:(d=i()(o()().mark((function e(){var t=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.db){e.next=2;break}return e.abrupt("return");case 2:if(!this.isOpening||!this.openPromise){e.next=4;break}return e.abrupt("return",this.openPromise);case 4:return this.isOpening=!0,this.openPromise=new Promise((function(e,r){var n=indexedDB.open("LogStorageDB",2);n.onupgradeneeded=function(e){var t=e.target.result;if(t.objectStoreNames.contains(Pr)){var r=e.target.transaction;if(r){var n=r.objectStore(Pr);n.indexNames.contains("lastModified")||n.createIndex("lastModified","lastModified",{unique:!1})}}else t.createObjectStore(Pr,{keyPath:"deviceId"}).createIndex("lastModified","lastModified",{unique:!1})},n.onsuccess=function(r){t.db=r.target.result,t.isOpening=!1,e()},n.onerror=function(e){t.isOpening=!1,r(e.target.error)},n.onblocked=function(){Br.warn("IndexedDB is blocked, trying to close existing connections"),t.isOpening=!1,r(new Error("IndexedDB blocked"))}})),e.abrupt("return",this.openPromise);case 7:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"ensureDB",value:(f=i()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.db){e.next=3;break}return e.next=3,this.openDB();case 3:if(this.db){e.next=5;break}throw new Error("Failed to open IndexedDB");case 5:return e.abrupt("return",this.db);case 6:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"withTransaction",value:(l=i()(o()().mark((function e(t,r){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureDB();case 2:return n=e.sent,e.abrupt("return",new Promise((function(e,o){var a,i=n.transaction([Pr],t),s=i.objectStore(Pr);i.onerror=function(){return o(i.error)},i.oncomplete=function(){setTimeout((function(){return e(a)}),0)},r(s).then((function(e){a=e}),o)})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"push",value:(c=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};i.data.push(r),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>1e4&&i.data.splice(0,i.data.length-1e4);var s=n.put(i);s.onsuccess=function(){return e()},s.onerror=function(){return o(s.error)}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"unshift",value:(u=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};i.data.unshift(r),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>1e4&&i.data.splice(0,i.data.length-1e4);var s=n.put(i);s.onsuccess=function(){return e()},s.onerror=function(){return o(s.error)}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"unshiftBatch",value:(s=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i,s=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};(i=s.data).unshift.apply(i,Z()(r)),s.lastModified=Date.now(),s.version=(s.version||1)+1,s.data.length>1e4&&s.data.splice(0,s.data.length-1e4);var u=n.put(s);u.onsuccess=function(){return e()},u.onerror=function(){return o(u.error)}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"pull",value:(a=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};if(0!==i.data.length){var s=Math.min(r,i.data.length),u=i.data.slice(0,s);if(i.data=i.data.slice(s),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>0){var c=n.put(i);c.onsuccess=function(){return e(u)},c.onerror=function(){return o(c.error)}}else{var l=n.delete(t);l.onsuccess=function(){return e(u)},l.onerror=function(){return o(l.error)}}}else e([])},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"clear",value:(n=i()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var o=r.delete(t);o.onsuccess=function(){return e()},o.onerror=function(){return n(o.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"pullByTimeRange",value:(r=i()(o()().mark((function e(t,r,n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readonly",function(){var e=i()(o()().mark((function e(a){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var i=a.get(t);i.onsuccess=function(){var o=(i.result||{deviceId:t,data:[],lastModified:Date.now(),version:1}).data.filter((function(e){return e.timestamp>=r&&e.timestamp<=n}));e(o)},i.onerror=function(){return o(i.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"removeByTimeRange",value:(t=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};if(i.data=i.data.filter((function(e){return e.timestamp<r})),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>0){var s=n.put(i);s.onsuccess=function(){return e()},s.onerror=function(){return o(s.error)}}else{var u=n.delete(t);u.onsuccess=function(){return e()},u.onerror=function(){return o(u.error)}}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}(),Gr=function(){function e(){H()(this,e),Mr()(this,"storage",new Map),Mr()(this,"locks",new Map)}var t,r,n,a,s,u,c,l;return q()(e,[{key:"acquireLock",value:(l=i()(o()().mark((function e(t){var r,n,a,i=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t;case 1:if(!this.locks.has(r)){e.next=6;break}return e.next=4,this.locks.get(r);case 4:e.next=1;break;case 6:return a=new Promise((function(e){n=e})),this.locks.set(r,a),e.abrupt("return",(function(){i.locks.delete(r),n()}));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"push",value:(c=i()(o()().mark((function e(t,r){var n,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{this.storage.has(t)||this.storage.set(t,[]),(a=this.storage.get(t)).push(r),a.length>1e4&&a.splice(0,a.length-1e4)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"unshift",value:(u=i()(o()().mark((function e(t,r){var n,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{this.storage.has(t)||this.storage.set(t,[]),(a=this.storage.get(t)).unshift(r),a.length>1e4&&a.splice(0,a.length-1e4)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"unshiftBatch",value:(s=i()(o()().mark((function e(t,r){var n,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{this.storage.has(t)||this.storage.set(t,[]),(a=this.storage.get(t)).unshift.apply(a,Z()(r)),a.length>1e4&&a.splice(0,a.length-1e4)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"pull",value:(a=i()(o()().mark((function e(t,r){var n,a,i,s,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:if(n=e.sent,e.prev=3,0!==(a=this.storage.get(t)||[]).length){e.next=7;break}return e.abrupt("return",[]);case 7:return i=Math.min(r,a.length),s=a.slice(0,i),(u=a.slice(i)).length>0?this.storage.set(t,u):this.storage.delete(t),e.abrupt("return",s);case 12:return e.prev=12,n(),e.finish(12);case 15:case"end":return e.stop()}}),e,this,[[3,,12,15]])}))),function(e,t){return a.apply(this,arguments)})},{key:"clear",value:(n=i()(o()().mark((function e(t){var r;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:r=e.sent;try{this.storage.delete(t)}finally{r()}case 4:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"pullByTimeRange",value:(r=i()(o()().mark((function e(t,r,n){var a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:return a=e.sent,e.prev=3,i=this.storage.get(t)||[],e.abrupt("return",i.filter((function(e){return e.timestamp>=r&&e.timestamp<=n})));case 6:return e.prev=6,a(),e.finish(6);case 9:case"end":return e.stop()}}),e,this,[[3,,6,9]])}))),function(e,t,n){return r.apply(this,arguments)})},{key:"removeByTimeRange",value:(t=i()(o()().mark((function e(t,r){var n,a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{a=this.storage.get(t)||[],(i=a.filter((function(e){return e.timestamp<r}))).length>0?this.storage.set(t,i):this.storage.delete(t)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();Mr()(Gr,"instance",void 0);var Kr=function(){function e(){H()(this,e)}var t,r,n,a,s,u,c,l,f;return q()(e,[{key:"acquireLock",value:(f=i()(o()().mark((function t(r){var n,a,i,s,u,c;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n="".concat(e.LOCK_KEY_PREFIX).concat(r),a="".concat(Date.now(),"_").concat(Math.random()),t.prev=2,!(i=localStorage.getItem(n))){t.next=8;break}if(s=i.split("_"),u=j()(s,1),c=u[0],!(Date.now()-parseInt(c)<e.LOCK_TIMEOUT)){t.next=8;break}return t.abrupt("return",!1);case 8:if(localStorage.setItem(n,a),localStorage.getItem(n)!==a){t.next=12;break}return t.abrupt("return",!0);case 12:return t.abrupt("return",!1);case 15:return t.prev=15,t.t0=t.catch(2),Br.warn("Failed to acquire lock",t.t0),t.abrupt("return",!1);case 19:case"end":return t.stop()}}),t,null,[[2,15]])}))),function(e){return f.apply(this,arguments)})},{key:"releaseLock",value:function(t){var r="".concat(e.LOCK_KEY_PREFIX).concat(t);try{localStorage.removeItem(r)}catch(e){Br.warn("Failed to release lock",e)}}},{key:"withLock",value:(l=i()(o()().mark((function t(r,n){var a,i;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=0;case 1:if(!(a<e.MAX_RETRIES)){t.next=18;break}return t.next=4,this.acquireLock(r);case 4:if(!t.sent){t.next=13;break}return t.prev=5,t.next=8,n();case 8:return i=t.sent,t.abrupt("return",i);case 10:return t.prev=10,this.releaseLock(r),t.finish(10);case 13:return a++,t.next=16,new Promise((function(t){return setTimeout(t,e.RETRY_DELAY)}));case 16:t.next=1;break;case 18:throw new Error("Failed to acquire lock after maximum retries");case 19:case"end":return t.stop()}}),t,this,[[5,,10,13]])}))),function(e,t){return l.apply(this,arguments)})},{key:"getStorageKey",value:function(t){return"".concat(e.STORAGE_KEY_PREFIX).concat(t)}},{key:"push",value:(c=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),(s=i?JSON.parse(i):[]).push(r),s.length>1e4&&s.splice(0,s.length-1e4),localStorage.setItem(a,JSON.stringify(s));case 6:case"end":return e.stop()}}),e)}))));case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),Br.warn("LocalStorage不可用,将使用内存缓存"),e.abrupt("return",Gr.getInstance().push(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,t){return c.apply(this,arguments)})},{key:"unshift",value:(u=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),(s=i?JSON.parse(i):[]).unshift(r),s.length>1e4&&s.splice(0,s.length-1e4),localStorage.setItem(a,JSON.stringify(s));case 6:case"end":return e.stop()}}),e)}))));case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),Br.warn("LocalStorage不可用,将使用内存缓存"),e.abrupt("return",Gr.getInstance().unshift(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,t){return u.apply(this,arguments)})},{key:"unshiftBatch",value:(s=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),(s=i?JSON.parse(i):[]).unshift.apply(s,Z()(r)),s.length>1e4&&s.splice(0,s.length-1e4),localStorage.setItem(a,JSON.stringify(s));case 6:case"end":return e.stop()}}),e)}))));case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),Br.warn("LocalStorage不可用,将使用内存缓存"),e.abrupt("return",Gr.getInstance().unshiftBatch(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,t){return s.apply(this,arguments)})},{key:"pull",value:(a=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s,u,c,l;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.getStorageKey(t),i=localStorage.getItem(a),0!==(s=i?JSON.parse(i):[]).length){e.next=5;break}return e.abrupt("return",[]);case 5:return u=Math.min(r,s.length),c=s.slice(0,u),(l=s.slice(u)).length>0?localStorage.setItem(a,JSON.stringify(l)):localStorage.removeItem(a),e.abrupt("return",c);case 10:case"end":return e.stop()}}),e)}))));case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Gr.getInstance().pull(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e,t){return a.apply(this,arguments)})},{key:"clear",value:(n=i()(o()().mark((function e(t){var r=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r.getStorageKey(t),localStorage.removeItem(n);case 2:case"end":return e.stop()}}),e)}))));case 3:e.next=8;break;case 5:return e.prev=5,e.t0=e.catch(0),e.abrupt("return",Gr.getInstance().clear(t));case 8:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return n.apply(this,arguments)})},{key:"pullByTimeRange",value:(r=i()(o()().mark((function e(t,r,n){var a=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var i,s,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.getStorageKey(t),s=localStorage.getItem(i),u=s?JSON.parse(s):[],e.abrupt("return",u.filter((function(e){return e.timestamp>=r&&e.timestamp<=n})));case 4:case"end":return e.stop()}}),e)}))));case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Gr.getInstance().pullByTimeRange(t,r,n));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e,t,n){return r.apply(this,arguments)})},{key:"removeByTimeRange",value:(t=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),s=i?JSON.parse(i):[],(u=s.filter((function(e){return e.timestamp<r}))).length>0?localStorage.setItem(a,JSON.stringify(u)):localStorage.removeItem(a);case 5:case"end":return e.stop()}}),e)}))));case 3:e.next=8;break;case 5:return e.prev=5,e.t0=e.catch(0),e.abrupt("return",Gr.getInstance().removeByTimeRange(t,r));case 8:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,r){return t.apply(this,arguments)})}]),e}();Mr()(Kr,"LOCK_KEY_PREFIX","rlog_lock_"),Mr()(Kr,"STORAGE_KEY_PREFIX","rlog_data_"),Mr()(Kr,"LOCK_TIMEOUT",5e3),Mr()(Kr,"RETRY_DELAY",10),Mr()(Kr,"MAX_RETRIES",50);var jr=function(){function e(){H()(this,e),Mr()(this,"adapter",void 0),Mr()(this,"operationQueue",new Map),this.adapter=this.selectAdapter()}var t,r,n,a,s,u,c,l,f;return q()(e,[{key:"selectAdapter",value:function(){if("undefined"!=typeof window&&window.indexedDB)try{var e=indexedDB.open("__rlog_test__",1);return e.onerror=function(){throw new Error("IndexedDB blocked")},e.onsuccess=function(){e.result.close(),indexedDB.deleteDatabase("__rlog_test__")},new Wr}catch(e){Br.warn("IndexedDB不可用,降级使用LocalStorage")}if("undefined"!=typeof window&&window.localStorage)try{var t="__rlog_storage_test__";return window.localStorage.setItem(t,"test"),window.localStorage.removeItem(t),new Kr}catch(e){Br.warn("LocalStorage不可用,降级使用内存缓存")}return Gr.getInstance()}},{key:"serialize",value:(f=i()(o()().mark((function e(t,r){var n,a,i,s=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t,a=this.operationQueue.get(n)||Promise.resolve(),i=a.then((function(){return r()})).catch((function(e){throw Br.error("Storage operation failed:",e),e})).finally((function(){s.operationQueue.get(n)===i&&s.operationQueue.delete(n)})),this.operationQueue.set(n,i),e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"push",value:(l=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.push(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"unshift",value:(c=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.unshift(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"unshiftBatch",value:(u=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.unshiftBatch(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"pull",value:(s=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.pull(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"clear",value:(a=i()(o()().mark((function e(t){var r=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return r.adapter.clear?r.adapter.clear(t):(Br.warn("Storage adapter does not support clear operation"),Promise.resolve())})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"pullByTimeRange",value:(n=i()(o()().mark((function e(t,r,n){var a=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return a.adapter.pullByTimeRange?a.adapter.pullByTimeRange(t,r,n):(Br.warn("Storage adapter does not support pullByTimeRange operation"),Promise.resolve([]))})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"removeByTimeRange",value:(r=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.removeByTimeRange?n.adapter.removeByTimeRange(t,r):(Br.warn("Storage adapter does not support removeByTimeRange operation"),Promise.resolve())})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getAdapterType",value:function(){return this.adapter instanceof Wr?"IndexedDB":this.adapter instanceof Kr?"LocalStorage":this.adapter instanceof Gr?"Memory":"Unknown"}},{key:"getStorageState",value:(t=i()(o()().mark((function e(t){var r,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getAdapterType(),e.prev=1,e.next=4,this.pull(t,1e4);case 4:if(!((n=e.sent).length>0)){e.next=8;break}return e.next=8,this.unshiftBatch(t,n);case 8:return e.abrupt("return",{adapterType:r,eventCount:n.length});case 11:return e.prev=11,e.t0=e.catch(1),e.abrupt("return",{adapterType:r,eventCount:-1});case 14:case"end":return e.stop()}}),e,this,[[1,11]])}))),function(e){return t.apply(this,arguments)})}]),e}(),Yr=new jr;function Zr(e){return Vr.apply(this,arguments)}function Vr(){return Vr=i()(o()().mark((function e(t){var r,n=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",new Promise((function(e,n){var o=r.method,a=void 0===o?"GET":o,i=r.headers,s=void 0===i?{}:i,c=r.body,l=r.timeout,f=void 0===l?1e4:l,d=new XMLHttpRequest;d.timeout=f,d.onreadystatechange=function(){if(4===d.readyState){var t={ok:d.status>=200&&d.status<300,status:d.status,statusText:d.statusText,data:null,json:function(){return Promise.resolve(JSON.parse(d.responseText))},text:function(){return Promise.resolve(d.responseText)}};try{t.data=JSON.parse(d.responseText)}catch(e){t.data=d.responseText}t.ok?e(t):n(new Error("HTTP ".concat(d.status,": ").concat(d.statusText)))}},d.onerror=function(){n(new Error("Network error"))},d.ontimeout=function(){n(new Error("Request timeout"))},d.open(a,t,!0),Object.keys(s).forEach((function(e){d.setRequestHeader(e,s[e])})),c instanceof FormData?d.send(c):"object"===u()(c)?(d.setRequestHeader("Content-Type","application/json"),d.send(JSON.stringify(c))):d.send(c||null)})));case 2:case"end":return e.stop()}}),e)}))),Vr.apply(this,arguments)}function Hr(e){return Jr.apply(this,arguments)}function Jr(){return Jr=i()(o()().mark((function e(t){var r,n=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",Zr(t,l()(l()({},r),{},{method:"GET"})));case 2:case"end":return e.stop()}}),e)}))),Jr.apply(this,arguments)}function qr(e,t){return zr.apply(this,arguments)}function zr(){return zr=i()(o()().mark((function e(t,r){var n,a=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",Zr(t,l()(l()({},n),{},{method:"POST",body:r})));case 2:case"end":return e.stop()}}),e)}))),zr.apply(this,arguments)}var Qr={enable:!0,uploadInterval:2e3,configUpdateInterval:3e5,console:{enable:!1,level:["log","warn","error","info"]},http:!1,consumeOnly:!1,maxRetryCount:3,checkoutEveryNms:5e3,ignoreClass:"rr-ignore",blockClass:"rr-block",maskTextClass:"rr-mask",sampling:{canvas:15,mousemove:50,scroll:100,input:"last"},packEvents:!1,clearStorageBeforeRecord:!0,error:!1,captureMode:"full",errorCapture:{beforeDuration:3e4,afterDuration:3e4,httpErrorThreshold:400},routerMonitor:{enable:!1,trackHashChange:!0,trackHistoryChange:!0,trackPageStayTime:!0,ignoreRoutes:[]}},Xr=l()({},Qr);function $r(e){return en.apply(this,arguments)}function en(){return en=i()(o()().mark((function e(t){var r,n,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=Rn(),e.next=4,Hr(t,{headers:r});case 4:if((n=e.sent).ok){e.next=7;break}throw new Error("Failed to fetch config: ".concat(n.status));case 7:if(a={},n.data)if("object"!==u()(n.data)||n.data.data){if("object"===u()(n.data.data))a=n.data.data;else if("string"==typeof n.data.data)try{a=JSON.parse(n.data.data)}catch(e){Br.warn("Failed to parse config JSON string",e)}}else a=n.data;return e.abrupt("return",Tr(Qr,a));case 12:return e.prev=12,e.t0=e.catch(0),Br.warn("Failed to fetch config from CDN, using default config",e.t0),e.abrupt("return",l()({},Qr));case 16:case"end":return e.stop()}}),e,null,[[0,12]])}))),en.apply(this,arguments)}function tn(e){Xr=Tr(Xr,e)}function rn(){return l()({},Xr)}function nn(){return(nn=i()(o()().mark((function e(t){var r,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=7;break}return e.next=3,$r(t);case 3:tn(r=e.sent),(n=r.configUpdateInterval||Qr.configUpdateInterval)&&setInterval(i()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,$r(t);case 3:tn(e.sent),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),Br.warn("Failed to update config from CDN",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),n);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var on=null;function an(e){on=e}var sn=["arms","log","marmot-cloud.com","alipayobjects.com","renderpre.alipay.com","nemo-office.alipay.com","render.alipay.com"],un=["r.png","dwcookieLogGet.do","track","spm","logstores","render",".json",".js",".css",".wasm",".png",".jpg",".jpeg",".weapp",".data"],cn=[],ln={},fn=[],dn=null,pn=["sky_trace_id","antbank-traceid"];function hn(e){try{if(e.startsWith("http://")||e.startsWith("https://"))return e;if(e.startsWith("/"))return window.location.origin+e;var t=window.location.href,r=t.lastIndexOf("/");return t.substring(0,r+1)+e}catch(t){return e}}function gn(e){return!function(e,t){try{var r=hn(e),n=new URL(r),o=n.pathname,a=n.hostname;return!(!sn.some((function(e){return a.includes(e)}))&&!un.some((function(e){return o.includes(e)})))||t.some((function(e){return!!r.includes(e)||!!a.includes(e)||!!o.includes(e)||(e.startsWith(".")?o.toLowerCase().endsWith(e.toLowerCase()):!(!e.startsWith("/")||!o.startsWith(e)))}))}catch(e){return!1}}(e,fn)&&(0!==cn.length&&function(e,t){try{var r=hn(e);return t.some((function(e){return e.startsWith("/")?new URL(r).pathname.startsWith(e):r.startsWith(e)}))}catch(e){return!1}}(e,cn))}function vn(){try{Mt.addCustomEvent("network-status",{type:"NETWORK_ONLINE",timestamp:Date.now()})}catch(e){Br.warn("Failed to add NETWORK_ONLINE event (recording may have stopped)",e)}}function mn(){try{Mt.addCustomEvent("network-status",{type:"NETWORK_OFFLINE",timestamp:Date.now()})}catch(e){Br.warn("Failed to add NETWORK_OFFLINE event (recording may have stopped)",e)}}var yn=XMLHttpRequest.prototype.open,wn=XMLHttpRequest.prototype.send,In=window.fetch,bn=!1;function Cn(){yn&&(XMLHttpRequest.prototype.open=yn),wn&&(XMLHttpRequest.prototype.send=wn),In&&(window.fetch=In),window.removeEventListener("online",vn),window.removeEventListener("offline",mn),bn=!1,Br.log("Network monitoring restored")}function Sn(e){if(e&&e.length>0){var t=cn.concat(e),r=Array.from(new Set(t));cn.splice.apply(cn,[0,cn.length].concat(r))}}function kn(){return[].concat(cn)}function An(e){if(e&&e.length>0){var t=fn.concat(e),r=Array.from(new Set(t));fn.splice.apply(fn,[0,fn.length].concat(r))}}function xn(){return[].concat(fn)}function En(){return dn}function Tn(e){Object.assign(ln,e)}function Rn(){return l()({},ln)}var Mn=null,On=function(){Mn&&(Mn(),Mn=null)},Ln=function(){var e=rn();if(e.enable){var t=xr();e.clearStorageBeforeRecord&&Yr.clear(t).then((function(){Br.log("Storage cleared before recording")})).catch((function(e){Br.warn("Failed to clear storage before recording",e)}));var r,n=[];if(e.console&&e.console.enable){var a,s,u,c,f,d=l()(l()({level:e.console.level||["info","log","warn","error"]},e.console.lengthThreshold&&{lengthThreshold:e.console.lengthThreshold}),{},{stringifyOptions:l()({numOfKeysLimit:null!==(a=null===(s=e.console.stringifyOptions)||void 0===s?void 0:s.numOfKeysLimit)&&void 0!==a?a:50,depthOfLimit:null!==(u=null===(c=e.console.stringifyOptions)||void 0===c?void 0:c.depthOfLimit)&&void 0!==u?u:4},(null===(f=e.console.stringifyOptions)||void 0===f?void 0:f.stringLengthLimit)&&{stringLengthLimit:e.console.stringifyOptions.stringLengthLimit})});n.push({name:"rrweb/console@1",observer:kr,options:d})}else Br.log("Console recording is disabled by config");Mn=Mt({emit:function(e){Yr.push(t,e)},recordCanvas:!0,sampling:e.sampling,checkoutEveryNms:e.checkoutEveryNms,ignoreClass:e.ignoreClass,blockClass:e.blockClass,maskTextClass:e.maskTextClass,dataURLOptions:{type:"image/webp",quality:.6},collectFonts:!0,recordCrossOriginIframes:!0,plugins:[].concat(n),packFn:e.packEvents?fr:void 0}),Tn({"rlog-deviceId":t}),Sn(["http://alipay-rmsdeploy-image.cn-hangzhou.alipay.aliyun-inc.com"]),e.http?(r=Mt,bn?Br.warn("Network monitoring is already active"):(Br.log("Network monitoring is active"),bn=!0,XMLHttpRequest.prototype.open=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return this._rlogRequest={method:e,url:t.toString(),startTime:0,endTime:0},yn.apply(this,[e,t,r,n,o])},XMLHttpRequest.prototype.send=function(e){var t=this,n=this._rlogRequest;return n.startTime=Date.now(),n.method,gn(n.url)&&Object.entries(ln).forEach((function(e){var r=j()(e,2),n=r[0],o=r[1];t.setRequestHeader(n,o)})),this.addEventListener("load",(function(){var e=this;if(n.endTime=Date.now(),gn(n.url)){var t={};pn.forEach((function(r){try{var n=e.getResponseHeader(r);n&&(t[r]=n)}catch(e){Br.warn("无法获取响应头 ".concat(r),e)}}));try{r.addCustomEvent("http-success",l()(l()({},n),{},{dur:n.endTime-n.startTime,responseHeaders:t,pagePath:window.location.href}))}catch(e){Br.warn("Failed to add custom event (recording may have stopped)",e)}}if(on){var o,a,i=null!==(o=null===(a=rn().errorCapture)||void 0===a?void 0:a.httpErrorThreshold)&&void 0!==o?o:400;this.status>=i&&on.onError({type:"http",message:"XHR ".concat(n.method," ").concat(n.url," responded with status ").concat(this.status),timestamp:Date.now(),detail:{url:n.url,method:n.method,status:this.status}})}})),this.addEventListener("error",(function(){try{r.addCustomEvent("http-error",l()(l()({},n),{},{dur:n.endTime-n.startTime,pagePath:window.location.href}))}catch(e){Br.warn("Failed to add custom event (recording may have stopped)",e)}on&&on.onError({type:"http",message:"XHR ".concat(n.method," ").concat(n.url," network error"),timestamp:Date.now(),detail:{url:n.url,method:n.method}})})),wn.apply(this,[e])},window.fetch=function(){var e=i()(o()().mark((function e(t,n){var a,i,s,u,c,f,d,p,h,g,v;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t instanceof Request?t.url:t.toString(),i=(null==n?void 0:n.method)||(t instanceof Request?t.method:"GET").toUpperCase(),s=Date.now(),e.prev=3,u=l()({},n),gn(a)&&Object.keys(ln).length>0&&(u.headers=l()(l()({},(null==n?void 0:n.headers)||{}),ln)),e.next=8,In(t,u);case 8:if(c=e.sent,f=Date.now(),gn(a)){Br.log("[Fetch] ".concat(i," ").concat(a," - ").concat(f-s,"ms")),d={},pn.forEach((function(e){try{var t=c.headers.get(e);t&&(d[e]=t)}catch(t){Br.warn("无法获取响应头 ".concat(e),t)}}));try{r.addCustomEvent("http-success",{url:a,method:i,dur:f-s,responseHeaders:d,pagePath:window.location.href})}catch(e){Br.warn("Failed to add custom event (recording may have stopped)",e)}}return on&&(g=rn(),v=null!==(p=null===(h=g.errorCapture)||void 0===h?void 0:h.httpErrorThreshold)&&void 0!==p?p:400,c.status>=v&&on.onError({type:"http",message:"Fetch ".concat(i," ").concat(a," responded with status ").concat(c.status),timestamp:Date.now(),detail:{url:a,method:i,status:c.status}})),e.abrupt("return",c);case 15:e.prev=15,e.t0=e.catch(3),Br.error("[Fetch Error] ".concat(i," ").concat(a),e.t0);try{r.addCustomEvent("http-error",{url:a,method:i,pagePath:window.location.href})}catch(e){Br.warn("Failed to add custom event (recording may have stopped)",e)}throw on&&on.onError({type:"http",message:"Fetch ".concat(i," ").concat(a," network error"),timestamp:Date.now(),detail:{url:a,method:i,error:String(e.t0)}}),e.t0;case 21:case"end":return e.stop()}}),e,null,[[3,15]])})));return function(t,r){return e.apply(this,arguments)}}(),window.addEventListener("online",vn),window.addEventListener("offline",mn))):Br.log("HTTP recording is disabled by config")}else Br.log("Recording is disabled by config")};function Nn(e){var t,r,n,o;n=rn().urlParamsToCache||["taskId"],o=new URLSearchParams(window.location.search),n.forEach((function(e){var t=o.get(e);t&&sessionStorage.setItem("rlog-".concat(e),t)}));var a=e.data&&e.data.length>0?e.data.length-1:-1,i={deviceId:e.deviceId,appId:e.appId,startTime:null===(t=e.data)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.timestamp,endTime:null===(r=e.data)||void 0===r||null===(r=r[a])||void 0===r?void 0:r.timestamp};return(rn().urlParamsToCache||["taskId"]).forEach((function(e){var t=function(e){return sessionStorage.getItem("rlog-".concat(e))}(e);t&&(i[e]=t)})),i}var Dn=function(){var e=i()(o()().mark((function e(t){var r,n,a,i,s,c,l,f;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Nn({appId:t.appId,deviceId:t.deviceId,data:t.data}),n=new URLSearchParams(r),a="".concat(t.url).concat(n?"?".concat(n):""),(i=new FormData).append("file",new Blob([JSON.stringify(t.data)]),Ar()+".json"),s=Rn(),e.next=8,qr(a,i,{headers:s});case 8:c=e.sent,e.prev=9,l="string"==typeof c.data?JSON.parse(c.data):c.data,e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(9),e.abrupt("return");case 16:if(!l||"object"!==u()(l)||!1!==l.success){e.next=20;break}throw(f=new Error(l.errorMessage||"Upload failed with success=false")).responseData=l,f;case 20:case"end":return e.stop()}}),e,null,[[9,13]])})));return function(t){return e.apply(this,arguments)}}();var _n=null,Fn=!1,Un=!1,Bn="",Pn=!1,Wn=0,Gn=!1,Kn=0;function jn(){return"batch_".concat(Date.now(),"_").concat(++Kn)}function Yn(e){var t=e.data;if(t&&t.type)switch(t.type){case"READY":Fn=!0,Br.log("Upload Worker is ready");break;case"REQUEST_BATCH":!function(e){Zn.apply(this,arguments)}(t.mode);break;case"UPLOAD_SUCCESS":!function(e){Hn.apply(this,arguments)}(t.batchId);break;case"UPLOAD_FAILURE":!function(e,t,r){Jn.apply(this,arguments)}(t.batchId,t.error,t.failureCount);break;case"MAX_RETRY_REACHED":!function(e,t){qn.apply(this,arguments)}(t.batchId,t.error)}}function Zn(){return Zn=i()(o()().mark((function e(t){var r,n,a,i,s,u,c,l;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Gn){e.next=2;break}return e.abrupt("return");case 2:if((r=rn()).enable){e.next=6;break}return Br.log("SDK is disabled by config, skipping batch request"),e.abrupt("return");case 6:if(!(n="error"===r.captureMode)||Pn){e.next=9;break}return e.abrupt("return");case 9:if(e.prev=9,Gn=!0,i=0,!n){e.next=20;break}return i=Wn>0?Wn:Date.now(),e.next=16,Yr.pullByTimeRange(xr(),i,Date.now());case 16:a=e.sent,Wn=0,e.next=23;break;case 20:return e.next=22,Yr.pull(xr(),100);case 22:a=e.sent;case 23:if(a&&0!==a.length){e.next=26;break}return Gn=!1,e.abrupt("return");case 26:if(s=rn(),!("YES"===sessionStorage.getItem("RLOG_CONSUME_ONLY")||s.consumeOnly)){e.next=32;break}return Br.log("Consume only mode, skip upload"),Gn=!1,e.abrupt("return");case 32:u=Nn({appId:Bn,deviceId:xr(),data:a}),c=Rn(),l=jn(),Vn.set(l,{events:a,isErrorMode:n,windowStart:i}),zn({type:"UPLOAD_BATCH",batchId:l,events:a,queryParams:u,customHeaders:c}),Gn=!1,e.next=44;break;case 40:e.prev=40,e.t0=e.catch(9),Gn=!1,Br.error("Error fetching batch for Worker:",e.t0);case 44:case"end":return e.stop()}}),e,null,[[9,40]])}))),Zn.apply(this,arguments)}var Vn=new Map;function Hn(){return(Hn=i()(o()().mark((function e(t){var r,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Vn.get(t)){e.next=3;break}return e.abrupt("return");case 3:if(Vn.delete(t),!(r.isErrorMode&&r.windowStart>0&&r.events.length>0)){e.next=9;break}return e.next=7,Yr.removeByTimeRange(xr(),r.windowStart);case 7:(n=r.events[r.events.length-1])&&n.timestamp&&(Wn=n.timestamp);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Jn(){return(Jn=i()(o()().mark((function e(t,r,n){var a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Vn.get(t)){e.next=3;break}return e.abrupt("return");case 3:return Vn.delete(t),Br.warn("Upload failed ".concat(n," time(s), will retry in next cycle:"),r),e.next=7,Yr.unshiftBatch(xr(),a.events);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function qn(){return(qn=i()(o()().mark((function e(t,r){var n,a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Vn.get(t)){e.next=3;break}return e.abrupt("return");case 3:return Vn.delete(t),a=rn(),i=a.maxRetryCount||3,Br.warn("Upload failed ".concat(i," times consecutively, stopping upload")),e.next=9,Yr.unshiftBatch(xr(),n.events);case 9:s=new CustomEvent("rlog-upload-failure",{detail:{error:r,retryCount:i,appId:Bn,deviceId:xr()}}),"undefined"!=typeof window&&window.dispatchEvent(s);try{Mt.addCustomEvent("rlog-upload-failure",{error:r,retryCount:i,appId:Bn,deviceId:xr(),timestamp:Date.now()})}catch(e){Br.warn("Failed to record upload failure event via addCustomEvent:",e)}$n(),setTimeout((function(){Vo()}),0),Br.error("Upload and recording stopped due to repeated failures");case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function zn(e){_n&&Fn&&_n.postMessage(e)}function Qn(e){Br.error("Upload Worker error:",e.message),$n()}function Xn(e,t){e,Bn=t;var r=function(){try{if("undefined"==typeof Worker)return null;var e=new Blob(["\n'use strict';\n\n// ===== Worker 内部状态 =====\nvar config = null;\nvar pollTimer = null;\nvar isRunning = false;\nvar errorModeUploading = false;\nvar failureCountMap = {};\n\n// ===== UUID 生成 =====\nfunction generateUUID() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (Math.random() * 16) | 0;\n var v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n\n// ===== 构建上传 URL =====\nfunction buildUploadUrl(serv, queryParams) {\n var params = [];\n for (var key in queryParams) {\n if (queryParams.hasOwnProperty(key) && queryParams[key] != null && queryParams[key] !== '') {\n params.push(encodeURIComponent(key) + '=' + encodeURIComponent(queryParams[key]));\n }\n }\n var queryString = params.join('&');\n return serv + (queryString ? '?' + queryString : '');\n}\n\n// ===== 执行上传 =====\nfunction performUpload(msg) {\n var batchId = msg.batchId;\n var events = msg.events;\n var queryParams = msg.queryParams;\n var customHeaders = msg.customHeaders;\n\n try {\n // JSON 序列化在 Worker 中执行,不阻塞主线程\n var jsonStr = JSON.stringify(events);\n var blob = new Blob([jsonStr], { type: 'application/json' });\n var formData = new FormData();\n formData.append('file', blob, generateUUID() + '.json');\n\n var url = buildUploadUrl(config ? config.serv : '', queryParams);\n\n var xhr = new XMLHttpRequest();\n xhr.open('POST', url, true);\n xhr.timeout = 10000;\n\n // 设置自定义请求头\n if (customHeaders) {\n for (var key in customHeaders) {\n if (customHeaders.hasOwnProperty(key)) {\n xhr.setRequestHeader(key, customHeaders[key]);\n }\n }\n }\n\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status >= 200 && xhr.status < 300) {\n // 检查业务层 success 字段\n var uploadSuccess = true;\n var errorMessage = '';\n try {\n var responseData = JSON.parse(xhr.responseText);\n if (responseData && typeof responseData === 'object' && responseData.success === false) {\n uploadSuccess = false;\n errorMessage = responseData.errorMessage || 'Upload failed with success=false';\n }\n } catch(e) {\n // 无法解析 JSON,视为成功\n }\n\n if (uploadSuccess) {\n // 上传成功,重置失败计数\n var batchKey = config ? (config.appId + '_' + config.deviceId) : batchId;\n delete failureCountMap[batchKey];\n self.postMessage({ type: 'UPLOAD_SUCCESS', batchId: batchId });\n } else {\n handleFailure(batchId, errorMessage);\n }\n } else {\n handleFailure(batchId, 'HTTP ' + xhr.status + ': ' + xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function() {\n handleFailure(batchId, 'Network error');\n };\n\n xhr.ontimeout = function() {\n handleFailure(batchId, 'Request timeout');\n };\n\n xhr.send(formData);\n } catch (e) {\n handleFailure(batchId, 'Upload exception: ' + (e.message || String(e)));\n }\n}\n\n// ===== 处理上传失败 =====\nfunction handleFailure(batchId, errorMessage) {\n var batchKey = config ? (config.appId + '_' + config.deviceId) : batchId;\n var currentCount = failureCountMap[batchKey] || 0;\n var newCount = currentCount + 1;\n failureCountMap[batchKey] = newCount;\n\n var maxRetry = (config && config.maxRetryCount) ? config.maxRetryCount : 3;\n\n if (newCount >= maxRetry) {\n // 达到最大重试次数\n delete failureCountMap[batchKey];\n self.postMessage({\n type: 'MAX_RETRY_REACHED',\n batchId: batchId,\n error: errorMessage\n });\n } else {\n self.postMessage({\n type: 'UPLOAD_FAILURE',\n batchId: batchId,\n error: errorMessage,\n failureCount: newCount\n });\n }\n}\n\n// ===== 轮询调度 =====\nfunction startPolling() {\n if (pollTimer) {\n clearInterval(pollTimer);\n }\n\n var interval = (config && config.uploadInterval) ? config.uploadInterval : 2000;\n\n pollTimer = setInterval(function() {\n if (!isRunning) return;\n\n // 向主线程请求数据批次\n // 主线程会根据当前模式(full/error)和状态决定是否提供数据\n self.postMessage({\n type: 'REQUEST_BATCH',\n mode: errorModeUploading ? 'error' : 'full'\n });\n }, interval);\n}\n\nfunction stopPolling() {\n if (pollTimer) {\n clearInterval(pollTimer);\n pollTimer = null;\n }\n}\n\n// ===== 清理 =====\nfunction cleanup() {\n isRunning = false;\n stopPolling();\n failureCountMap = {};\n config = null;\n errorModeUploading = false;\n}\n\n// ===== 消息处理 =====\nself.onmessage = function(e) {\n var msg = e.data;\n if (!msg || !msg.type) return;\n\n switch (msg.type) {\n case 'START':\n config = msg.config;\n isRunning = true;\n failureCountMap = {};\n startPolling();\n break;\n\n case 'STOP':\n cleanup();\n break;\n\n case 'UPLOAD_BATCH':\n if (isRunning) {\n performUpload(msg);\n }\n break;\n\n case 'UPDATE_CONFIG':\n if (msg.config) {\n for (var key in msg.config) {\n if (msg.config.hasOwnProperty(key) && config) {\n config[key] = msg.config[key];\n }\n }\n // 如果 uploadInterval 变了,重启轮询\n if (msg.config.uploadInterval && isRunning) {\n startPolling();\n }\n }\n break;\n\n case 'SET_ERROR_MODE_UPLOADING':\n errorModeUploading = msg.uploading;\n break;\n }\n};\n\n// Worker 就绪通知\nself.postMessage({ type: 'READY' });\n"],{type:"application/javascript"}),t=URL.createObjectURL(e),r=new Worker(t);return URL.revokeObjectURL(t),r}catch(e){return Br.warn("Failed to create inline Worker, will fallback to main thread:",e),null}}();if(!r)return Un=!1,!1;(_n=r).onmessage=Yn,_n.onerror=Qn;var n=rn(),o={serv:e,appId:t,deviceId:xr(),uploadInterval:n.uploadInterval,maxRetryCount:n.maxRetryCount||3};return _n.postMessage({type:"START",config:o}),Un=!0,Br.log("Upload Worker mode initialized"),!0}function $n(){if(_n){try{_n.postMessage({type:"STOP"}),_n.terminate()}catch(e){}_n=null}Fn=!1,Un=!1,Gn=!1,Pn=!1,Wn=0,Kn=0,Vn.clear()}function eo(){return Un&&null!==_n}var to=!1,ro=new Map,no=!1,oo=!1,ao=0;function io(e){eo()?function(e){Pn=e,zn({type:"SET_ERROR_MODE_UPLOADING",uploading:e})}(e):oo=e}function so(e){eo()?function(e){Wn=e}(e):ao=e}function uo(e,t,r){return co.apply(this,arguments)}function co(){return(co=i()(o()().mark((function e(t,r,n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&0!==n.length){e.next=2;break}return e.abrupt("return",{success:!0});case 2:return e.prev=2,e.next=5,Dn({appId:r,data:n,deviceId:xr(),url:t});case 5:return e.abrupt("return",{success:!0});case 8:return e.prev=8,e.t0=e.catch(2),Br.warn("Upload failed:",e.t0),e.abrupt("return",{success:!1,error:e.t0});case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function lo(e,t,r,n,o,a){return fo.apply(this,arguments)}function fo(){return(fo=i()(o()().mark((function e(t,r,n,a,i,s){var u,c,l;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=s+1,c="".concat(n,"_").concat(xr()),ro.set(c,u),!(u>=i)){e.next=16;break}return Br.warn("Upload failed ".concat(i," times consecutively, stopping upload")),e.next=7,Yr.unshiftBatch(xr(),t);case 7:l=new CustomEvent("rlog-upload-failure",{detail:{error:r,retryCount:i,appId:n,deviceId:xr()}}),"undefined"!=typeof window&&window.dispatchEvent(l);try{Mt.addCustomEvent("rlog-upload-failure",{error:r,retryCount:i,appId:n,deviceId:xr(),timestamp:Date.now()})}catch(e){Br.warn("Failed to record upload failure event via addCustomEvent:",e)}return ro.delete(c),setTimeout((function(){Vo()}),0),Br.error("Upload and recording stopped due to repeated failures"),e.abrupt("return",!0);case 16:return Br.warn("Upload failed ".concat(u," time(s), will retry in next cycle")),e.next=19,Yr.unshiftBatch(xr(),t);case 19:return e.abrupt("return",!1);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function po(e,t){Xn(e,t)?Br.log("Upload loop started in Worker mode"):(Br.log("Worker not available, falling back to main thread upload"),function(e,t){var r=function(){var n=i()(o()().mark((function n(){var a,i,s,u,c,l,f,d,p,h,g;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!to){n.next=3;break}return Br.log("Upload has been cancelled"),n.abrupt("return");case 3:if(!no){n.next=6;break}return setTimeout((function(){r()}),100),n.abrupt("return");case 6:if((a=rn()).enable){n.next=10;break}return Br.log("SDK is disabled by config, stopping upload"),n.abrupt("return");case 10:if(!(i="error"===a.captureMode)||oo){n.next=14;break}return setTimeout((function(){r()}),a.uploadInterval),n.abrupt("return");case 14:if(n.prev=14,no=!0,u=0,!i){n.next=25;break}return u=ao>0?ao:Date.now(),n.next=21,Yr.pullByTimeRange(xr(),u,Date.now());case 21:s=n.sent,ao=0,n.next=28;break;case 25:return n.next=27,Yr.pull(xr(),100);case 27:s=n.sent;case 28:if(s&&0!==s.length){n.next=32;break}return no=!1,setTimeout((function(){r()}),a.uploadInterval),n.abrupt("return");case 32:if(c=rn(),"YES"!==sessionStorage.getItem("RLOG_CONSUME_ONLY")&&!c.consumeOnly){n.next=39;break}return Br.log("Consume only mode, skip upload"),no=!1,setTimeout((function(){r()}),a.uploadInterval),n.abrupt("return");case 39:return n.next=41,uo(e,t,s);case 41:if(!(l=n.sent).success){n.next=53;break}if(f="".concat(t,"_").concat(xr()),ro.delete(f),!(i&&u>0&&s.length>0)){n.next=50;break}return n.next=48,Yr.removeByTimeRange(xr(),u);case 48:(d=s[s.length-1])&&d.timestamp&&(ao=d.timestamp);case 50:no=!1,n.next=62;break;case 53:return no=!1,p=c.maxRetryCount||3,h="".concat(t,"_").concat(xr()),g=ro.get(h)||0,n.next=59,lo(s,l.error,t,e,p,g);case 59:if(!n.sent){n.next=62;break}return n.abrupt("return");case 62:n.next=68;break;case 64:n.prev=64,n.t0=n.catch(14),no=!1,Br.error("Error in upload loop:",n.t0);case 68:setTimeout((function(){r()}),a.uploadInterval);case 69:case"end":return n.stop()}}),n,null,[[14,64]])})));return function(){return n.apply(this,arguments)}}();r()}(e,t))}function ho(){eo()&&$n(),to=!0,no=!1,oo=!1,ao=0}function go(){eo()&&$n(),to=!1,no=!1,oo=!1,ao=0,ro.clear()}var vo=l()({},rn().routerMonitor||{}),mo="",yo=Date.now(),wo=!1,Io=null,bo=null;function Co(){return"undefined"==typeof window?"":window.location.pathname+window.location.search+window.location.hash}function So(e,t,r){var n;if(null!==(n=vo)&&void 0!==n&&n.enable&&(o=t,null===(a=vo)||void 0===a||!a.ignoreRoutes||!vo.ignoreRoutes.some((function(e){return"string"==typeof e?o.includes(e):e instanceof RegExp&&e.test(o)})))){var o,a,i={type:"route-change",from:e,to:t,method:r,timestamp:Date.now()};vo.trackPageStayTime&&e&&(i.duration=Date.now()-yo);try{Mt.addCustomEvent("route-change",i)}catch(e){Br.warn("Failed to add custom event (recording may have stopped)",e)}yo=Date.now()}}function ko(){var e=mo,t=Co();e!==t&&So(e,t,"popstate")}function Ao(){var e=mo,t=Co();e!==t&&So(e,t,"hashchange")}function xo(e){var t,r,n,o,a,i=rn().routerMonitor||{},s=l()({enable:null!==(t=i.enable)&&void 0!==t&&t,trackHashChange:null===(r=i.trackHashChange)||void 0===r||r,trackHistoryChange:null===(n=i.trackHistoryChange)||void 0===n||n,trackPageStayTime:null===(o=i.trackPageStayTime)||void 0===o||o,ignoreRoutes:null!==(a=i.ignoreRoutes)&&void 0!==a?a:[]},e||{}),u=JSON.stringify(s)!==JSON.stringify(vo);vo=s,u&&vo.enable?Lo(vo):vo.enable||_o()}function Eo(){try{Mt.addCustomEvent("page-lifecycle",{type:"PAGE_LOAD",url:window.location.href,timestamp:Date.now()})}catch(e){Br.warn("Failed to add PAGE_LOAD event (recording may have stopped)",e)}}function To(){try{Mt.addCustomEvent("page-lifecycle",{type:"PAGE_UNLOAD",url:window.location.href,timestamp:Date.now()})}catch(e){Br.warn("Failed to add PAGE_UNLOAD event (recording may have stopped)",e)}}function Ro(e){try{Mt.addCustomEvent("page-lifecycle",{type:"PAGE_HIDE",url:window.location.href,timestamp:Date.now(),persisted:e.persisted})}catch(e){Br.warn("Failed to add PAGE_HIDE event (recording may have stopped)",e)}}function Mo(e){try{Mt.addCustomEvent("page-lifecycle",{type:"PAGE_SHOW",url:window.location.href,timestamp:Date.now(),persisted:e.persisted}),e.persisted&&(yo=Date.now())}catch(e){Br.warn("Failed to add PAGE_SHOW event (recording may have stopped)",e)}}function Oo(){try{var e="hidden"===document.visibilityState;Mt.addCustomEvent("page-lifecycle",{type:e?"PAGE_VISIBILITY_HIDDEN":"PAGE_VISIBILITY_VISIBLE",url:window.location.href,timestamp:Date.now()})}catch(e){Br.warn("Failed to add visibility change event (recording may have stopped)",e)}}function Lo(e){var t,r,n,o,a;if(!wo&&"undefined"!=typeof window){var i=rn().routerMonitor||{};(vo=l()({enable:null!==(t=i.enable)&&void 0!==t&&t,trackHashChange:null===(r=i.trackHashChange)||void 0===r||r,trackHistoryChange:null===(n=i.trackHistoryChange)||void 0===n||n,trackPageStayTime:null===(o=i.trackPageStayTime)||void 0===o||o,ignoreRoutes:null!==(a=i.ignoreRoutes)&&void 0!==a?a:[]},e||{})).enable?(Br.log("Route monitor initialized with config",vo),mo=Co(),yo=Date.now(),vo.trackHistoryChange&&(Io=window.history.pushState,bo=window.history.replaceState,window.history.pushState=function(){for(var e=Co(),t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var o=Io.apply(this,r),a=Co();return e!==a&&So(e,a,"pushState"),o},window.history.replaceState=function(){for(var e=Co(),t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var o=bo.apply(this,r),a=Co();return e!==a&&So(e,a,"replaceState"),o},window.addEventListener("popstate",ko)),vo.trackHashChange&&window.addEventListener("hashchange",Ao),window.addEventListener("load",Eo),window.addEventListener("beforeunload",To),window.addEventListener("pagehide",Ro),window.addEventListener("pageshow",Mo),document.addEventListener("visibilitychange",Oo),wo=!0):Br.log("Route monitor is disabled by config")}}function No(){return{currentRoute:mo,startTime:yo,stayTime:Date.now()-yo}}function Do(e,t){So(t||mo,e,"pushState")}function _o(){wo&&(Io&&bo&&"undefined"!=typeof window&&(window.history.pushState=Io,window.history.replaceState=bo),"undefined"!=typeof window&&(window.removeEventListener("popstate",ko),window.removeEventListener("hashchange",Ao),window.removeEventListener("load",Eo),window.removeEventListener("beforeunload",To),window.removeEventListener("pagehide",Ro),window.removeEventListener("pageshow",Mo),document.removeEventListener("visibilitychange",Oo)),wo=!1,Io=null,bo=null,Br.log("Router monitor stopped"))}var Fo=null,Uo=!1;function Bo(e){Fo=e}var Po=function(e){try{Mt.addCustomEvent("custom-error-event",e)}catch(t){Br.error("Error captured",e)}"error"===rn().captureMode&&Fo&&Fo.onError({type:e.type,message:e.message||e.type,timestamp:e.timestamp||Date.now(),detail:e})};function Wo(e){var t=e;if(e.target!==window){var r={type:"RESOURCE_ERROR",resourceType:e.target.tagName,url:e.target.src||e.target.href||e.target.src,message:t.message,userAgent:navigator.userAgent,timestamp:Date.now(),location:window.location.href};return Po(r),!1}var n=t.message,o=t.filename,a=t.lineno,i=t.colno,s=t.error,u={type:"JS_ERROR",message:n,file:o,line:a,column:i,stack:null==s?void 0:s.stack,userAgent:navigator.userAgent,timestamp:Date.now(),location:window.location.href};return Po(u),!1}function Go(e){var t=e.reason||"Unknown rejection",r={type:"PROMISE_REJECTION",message:"string"==typeof t?t:t.message,stack:"object"===u()(t)?t.stack:null,timestamp:Date.now(),location:window.location.href};Po(r),e.preventDefault()}function Ko(){Uo&&(Br.log("Cleaning up error handlers"),window.removeEventListener("error",Wo,!0),window.removeEventListener("unhandledrejection",Go),Uo=!1,Br.log("Error handlers cleaned up successfully"))}var jo=function(){function e(){var t,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};H()(this,e),Mr()(this,"beforeDuration",void 0),Mr()(this,"afterDuration",void 0),Mr()(this,"state","idle"),Mr()(this,"cooldownTimer",null),Mr()(this,"destroyed",!1),this.beforeDuration=null!==(t=n.beforeDuration)&&void 0!==t?t:3e4,this.afterDuration=null!==(r=n.afterDuration)&&void 0!==r?r:3e4}return q()(e,[{key:"isUploading",value:function(){return"uploading"===this.state}},{key:"onError",value:function(e){this.destroyed||("idle"===this.state?this.enterUploadingState(e.timestamp):this.resetCooldown())}},{key:"enterUploadingState",value:function(e){this.state="uploading",Br.log("ErrorTrigger: error detected, entering uploading state"),so(e-this.beforeDuration),io(!0),this.resetCooldown()}},{key:"resetCooldown",value:function(){var e=this;this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null),this.cooldownTimer=setTimeout((function(){e.exitUploadingState()}),this.afterDuration)}},{key:"exitUploadingState",value:function(){Br.log("ErrorTrigger: cooldown expired, exiting uploading state"),this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null),io(!1),this.state="idle"}},{key:"destroy",value:function(){this.destroyed=!0,this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null),io(!1),this.state="idle"}}]),e}(),Yo=!1,Zo=null;function Vo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"SDK instance";if(Yo)Br.warn("SDK has already been cancelled");else{Yo=!0;try{if(On(),ho(),"undefined"!=typeof window&&window.XMLHttpRequest&&Cn(),_o(),Ko(),Zo&&(Zo.destroy(),Zo=null),Bo(null),an(null),e.clearData){var r=xr();r&&Yr.clear(r).catch((function(e){Br.error("Error clearing storage",e)}))}Br.log("SDK cancelled successfully via ".concat(t))}catch(e){Br.error("Error cancelling SDK via ".concat(t),e)}}}function Ho(e,t,r){Yo=!1,go();var n=hn(e);!function(e){if(e){dn=e;var t=hn(e),r=[e];t!==e&&r.push(t),r.forEach((function(e){fn.includes(e)||fn.push(e)}))}}(n),function(e){return nn.apply(this,arguments)}(r).then((function(){var e,r=rn();if(r.enable){var o,a,i="error"===r.captureMode;if(i)Br.log("Initializing in error capture mode"),Bo(Zo=new jo({beforeDuration:null===(o=r.errorCapture)||void 0===o?void 0:o.beforeDuration,afterDuration:null===(a=r.errorCapture)||void 0===a?void 0:a.afterDuration})),an(Zo);Ln(),po(n,t),Lo(r.routerMonitor),i||null!==(e=r.error)&&void 0!==e&&e?Uo||(Br.log("Error handling is enabled"),window.addEventListener("error",Wo,!0),window.addEventListener("unhandledrejection",Go),Uo=!0):Br.log("Error handling is disabled by config")}else Br.log("SDK is disabled by config")})).catch((function(e){Br.error("Failed to initialize SDK",e)}))}function Jo(e){return Ho(e.serv,e.appId,e.cdnConfigUrl),{cancel:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Vo(e,"SDK instance")}}}function qo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Br.warn("Please use rlog.cancel() from initialized instance instead of standalone cancelRecord()"),Vo(e,"standalone function")}function zo(e,t){Mt.addCustomEvent(e,t)}function Qo(e){tn({consumeOnly:e}),Br.log("Consume only mode ".concat(e?"enabled":"disabled"))}function Xo(){return"YES"===sessionStorage.getItem("RLOG_CONSUME_ONLY")||!!rn().consumeOnly}function $o(){var e=!rn().consumeOnly;return Qo(e),e}function ea(e){if("error"===rn().captureMode){var t=Fo;if(t){var r="string"==typeof e?e:e.message,n="object"===u()(e)&&e.stack?e.stack:void 0;try{Mt.addCustomEvent("custom-error-event",{type:"CUSTOM_ERROR",message:r,stack:n,timestamp:Date.now(),location:"undefined"!=typeof window?window.location.href:""})}catch(e){Br.warn("Failed to add custom error event:",e)}t.onError({type:"custom",message:r,timestamp:Date.now(),detail:{stack:n}})}else Br.warn("reportError() called but error trigger is not initialized")}else Br.warn('reportError() is only available in error capture mode (captureMode: "error")')}var ta={getStorageAdapterType:function(){return Yr.getAdapterType()},getDeviceId:xr,resetUploadState:function(){go()},getStorageState:function(){return i()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=xr(),e.abrupt("return",Yr.getStorageState(t));case 2:case"end":return e.stop()}}),e)})))()},clearStorage:function(){return i()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=xr(),e.abrupt("return",Yr.clear(t));case 2:case"end":return e.stop()}}),e)})))()},shouldRecordUrl:gn,getConfig:rn}}(),n}()}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Rlog=t():e.Rlog=t()}(self,(function(){return function(){var e={751:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=u(e),i=a[0],s=a[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,i,s)),l=0,f=s>0?i-4:i;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,a=[],i=16383,s=0,u=n-o;s<u;s+=i)a.push(c(e,s,s+i>u?u:s+i));1===o?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=a.length;i<s;++i)r[i]=a[i],n[a.charCodeAt(i)]=i;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var o,a,i=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),i.push(r[(a=o)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},671:function(e,t,r){"use strict";var n=r(751),o=r(983),a=r(532);function i(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(t,r);e=s(e,n);var o=e.write(t,r);o!==n&&(e=e.slice(0,o));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|p(t.length);return 0===(e=s(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):d(e,t);if("Buffer"===t.type&&a(t.data))return d(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(l(t),e=s(e,t<0?0:0|p(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|p(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function p(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(n)return G(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,o){var a,i=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;i=2,s/=2,u/=2,r/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){var l=-1;for(a=r;a<s;a++)if(c(e,a)===c(t,-1===l?0:a-l)){if(-1===l&&(l=a),a-l+1===u)return l*i}else-1!==l&&(a-=a-l),l=-1}else for(r+u>s&&(r=s-u),a=r;a>=0;a--){for(var f=!0,d=0;d<u;d++)if(c(e,a+d)!==c(t,d)){f=!1;break}if(f)return a}return-1}function w(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var i=0;i<n;++i){var s=parseInt(t.substr(2*i,2),16);if(isNaN(s))return i;e[r+i]=s}return i}function I(e,t,r,n){return j(G(t,e.length-r),e,r,n)}function b(e,t,r,n){return j(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function C(e,t,r,n){return b(e,t,r,n)}function S(e,t,r,n){return j(K(t),e,r,n)}function k(e,t,r,n){return j(function(e,t){for(var r,n,o,a=[],i=0;i<e.length&&!((t-=2)<0);++i)n=(r=e.charCodeAt(i))>>8,o=r%256,a.push(o),a.push(n);return a}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var a,i,s,u,c=e[o],l=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[o+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=e[o+1],i=e[o+2],128==(192&a)&&128==(192&i)&&(u=(15&c)<<12|(63&a)<<6|63&i)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[o+1],i=e[o+2],s=e[o+3],128==(192&a)&&128==(192&i)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&i)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),o+=f}return function(e){var t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=E));return r}(n)}t.lW=u,t.h2=50,u.TYPED_ARRAY_SUPPORT=void 0!==r.g.TYPED_ARRAY_SUPPORT?r.g.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),i(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return l(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,o=0,a=Math.min(r,n);o<a;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if(!u.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},u.byteLength=h,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?x(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.h2;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(n>>>=0),i=(r>>>=0)-(t>>>=0),s=Math.min(a,i),c=this.slice(n,o),l=e.slice(t,r),f=0;f<s;++f)if(c[f]!==l[f]){a=c[f],i=l[f];break}return a<i?-1:i<a?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return I(this,e,t,r);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return C(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function T(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function R(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function M(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",a=t;a<r;++a)o+=W(e[a]);return o}function O(e,t,r){for(var n=e.slice(t,r),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+256*n[a+1]);return o}function L(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,o,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n){t<0&&(t=65535+t+1);for(var o=0,a=Math.min(e.length-r,2);o<a;++o)e[r+o]=(t&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function _(e,t,r,n){t<0&&(t=4294967295+t+1);for(var o=0,a=Math.min(e.length-r,4);o<a;++o)e[r+o]=t>>>8*(n?o:3-o)&255}function F(e,t,r,n,o,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,a){return a||F(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function B(e,t,r,n,a){return a||F(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var o=t-e;r=new u(o,void 0);for(var a=0;a<o;++a)r[a]=this[a+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],o=1,a=0;++a<t&&(o*=256);)n+=this[e+a]*o;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},u.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],o=1,a=0;++a<t&&(o*=256);)n+=this[e+a]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=t,o=1,a=this[e+--n];n>0&&(o*=256);)a+=this[e+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||N(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[t]=255&e;++a<r&&(o*=256);)this[t+a]=e/o&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||N(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):_(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);N(this,e,t,r,o-1,-o)}var a=0,i=1,s=0;for(this[t]=255&e;++a<r&&(i*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/i>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);N(this,e,t,r,o-1,-o)}var a=r-1,i=1,s=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/i>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):_(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o,a=n-r;if(this===e&&r<t&&t<n)for(o=a-1;o>=0;--o)e[o+t]=this[o+r];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+a),t);return a},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var i=u.isBuffer(e)?e:G(new u(e,n).toString()),s=i.length;for(a=0;a<r-t;++a)this[a+t]=i[a%s]}return this};var P=/[^+\/0-9A-Za-z-_]/g;function W(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){var r;t=t||1/0;for(var n=e.length,o=null,a=[],i=0;i<n;++i){if((r=e.charCodeAt(i))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(t-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function K(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(P,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}},983:function(e,t){t.read=function(e,t,r,n,o){var a,i,s=8*o-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?o-1:0,d=r?-1:1,p=e[t+f];for(f+=d,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=d,l-=8);for(i=a&(1<<-l)-1,a>>=-l,l+=n;l>0;i=256*i+e[t+f],f+=d,l-=8);if(0===a)a=1-c;else{if(a===u)return i?NaN:1/0*(p?-1:1);i+=Math.pow(2,n),a-=c}return(p?-1:1)*i*Math.pow(2,a-n)},t.write=function(e,t,r,n,o,a){var i,s,u,c=8*a-o-1,l=(1<<c)-1,f=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,h=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,i=l):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),(t+=i+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(i++,u/=2),i+f>=l?(s=0,i=l):i+f>=1?(s=(t*u-1)*Math.pow(2,o),i+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),i=0));o>=8;e[r+p]=255&s,p+=h,s/=256,o-=8);for(i=i<<o|s,c+=o;c>0;e[r+p]=255&i,p+=h,i/=256,c-=8);e[r+p-h]|=128*g}},532:function(e){var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},931:function(e){var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],c=!1,l=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&d())}function d(){if(!c){var e=i(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l<t;)s&&s[l].run();l=-1,t=u.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function h(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||c||i(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=h,n.addListener=h,n.once=h,n.off=h,n.removeListener=h,n.removeAllListeners=h,n.emit=h,n.prependListener=h,n.prependOnceListener=h,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},951:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},182:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},56:function(e,t,r){var n=r(951);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},340:function(e){function t(e,t,r,n,o,a,i){try{var s=e[a](i),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,a){var i=e.apply(r,n);function s(e){t(i,o,a,s,u,"next",e)}function u(e){t(i,o,a,s,u,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},477:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},851:function(e,t,r){var n=r(768);function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,n(o.key),o)}}e.exports=function(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},681:function(e,t,r){var n=r(921);e.exports=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=n(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,a=function(){};return{s:a,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw i}}}},e.exports.__esModule=!0,e.exports.default=e.exports},295:function(e,t,r){var n=r(768);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},370:function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},379:function(e){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},695:function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},50:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},218:function(e,t,r){var n=r(295);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}e.exports=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports},346:function(e,t,r){var n=r(691).default;function o(){"use strict";e.exports=o=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},a=Object.prototype,i=a.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(t){d=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof w?t:w,a=Object.create(o.prototype),i=new L(n||[]);return s(a,"_invoke",{value:T(e,r,i)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var g="suspendedStart",v="executing",m="completed",y={};function w(){}function I(){}function b(){}var C={};d(C,c,(function(){return this}));var S=Object.getPrototypeOf,k=S&&S(S(N([])));k&&k!==a&&i.call(k,c)&&(C=k);var A=b.prototype=w.prototype=Object.create(C);function x(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,a,s,u){var c=h(e[o],e,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}))}u(c.arg)}var o;s(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function T(e,r,n){var o=g;return function(a,i){if(o===v)throw new Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var s=n.delegate;if(s){var u=R(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===g)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=h(e,r,n);if("normal"===c.type){if(o=n.done?m:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=m,n.method="throw",n.arg=c.arg)}}}function R(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,R(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=h(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return I.prototype=b,s(A,"constructor",{value:b,configurable:!0}),s(b,"constructor",{value:I,configurable:!0}),I.displayName=d(b,f,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===I||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,d(e,f,"GeneratorFunction")),e.prototype=Object.create(A),e},r.awrap=function(e){return{__await:e}},x(E.prototype),d(E.prototype,l,(function(){return this})),r.AsyncIterator=E,r.async=function(e,t,n,o,a){void 0===a&&(a=Promise);var i=new E(p(e,t,n,o),a);return r.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},x(A),d(A,f,"Generator"),d(A,c,(function(){return this})),d(A,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=N,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},r}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},573:function(e,t,r){var n=r(182),o=r(379),a=r(921),i=r(695);e.exports=function(e,t){return n(e)||o(e,t)||a(e,t)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},638:function(e,t,r){var n=r(56),o=r(370),a=r(921),i=r(50);e.exports=function(e){return n(e)||o(e)||a(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports},790:function(e,t,r){var n=r(691).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},768:function(e,t,r){var n=r(691).default,o=r(790);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},691:function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},921:function(e,t,r){var n=r(951);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return function(){"use strict";r.r(n),r.d(n,{addCustomEvent:function(){return Jo},cancelRecord:function(){return Ho},cleanupErrorHandler:function(){return Wo},debug:function(){return $o},getBlackListUrls:function(){return bn},getCurrentRouteInfo:function(){return Oo},getCustomHeaders:function(){return kn},getSdkLogEndpoint:function(){return Cn},getWhiteListUrls:function(){return wn},init:function(){return Vo},isConsumeOnlyMode:function(){return zo},manualRouteChange:function(){return Lo},reportError:function(){return Xo},setBlackListUrls:function(){return In},setConsumeOnlyMode:function(){return qo},setCustomHeaders:function(){return Sn},setWhiteListUrls:function(){return yn},stopRouterMonitor:function(){return No},toggleConsumeOnlyMode:function(){return Qo},updateRouterConfig:function(){return ko}});var e,t=r(346),o=r.n(t),a=r(340),i=r.n(a),s=r(691),u=r.n(s),c=r(218),l=r.n(c),f=r(681);function d(e){return e.nodeType===e.ELEMENT_NODE}function p(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function h(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function g(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t).map(v).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function v(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=g(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 m=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var r=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=r?r:-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,r=this.getId(e);this.idNodeMap.delete(r),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 r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function y(e){var t=e.maskInputOptions,r=e.tagName,n=e.type,o=e.value,a=e.maskInputFn,i=o||"";return(t[r.toLowerCase()]||t[n])&&(i=a?a(i):"*".repeat(i.length)),i}var w="__rrweb_original__";var I,b,C=1,S=new RegExp("[^a-z0-9-_:]");function k(){return C++}var A=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,x=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,E=/^(data:)([^,]*),(.*)/i;function T(e,t){return(e||"").replace(A,(function(e,r,n,o,a,i){var s,u=n||a||i,c=r||o||"";if(!u)return e;if(!x.test(u))return"url(".concat(c).concat(u).concat(c,")");if(E.test(u))return"url(".concat(c).concat(u).concat(c,")");if("/"===u[0])return"url(".concat(c).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)).concat(c,")");var l=t.split("/"),f=u.split("/");l.pop();for(var d=0,p=f;d<p.length;d++){var h=p[d];"."!==h&&(".."===h?l.pop():l.push(h))}return"url(".concat(c).concat(l.join("/")).concat(c,")")}))}var R=/^[^ \t\n\r\u000c]+/,M=/^[, \t\n\r\u000c]+/;function O(e,t){if(!t||""===t.trim())return t;var r=e.createElement("a");return r.href=t,r.href}function L(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function N(){var e=document.createElement("a");return e.href="",e.href}function D(e,t,r,n){return"src"===r||"href"===r&&n&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&n&&"#"!==n[0]?O(e,n):"background"!==r||!n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r&&n?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,o=e.exec(t.substring(r));return o?(n=o[0],r+=n.length,n):""}for(var o=[];n(M),!(r>=t.length);){var a=n(R);if(","===a.slice(-1))a=O(e,a.substring(0,a.length-1)),o.push(a);else{var i="";a=O(e,a);for(var s=!1;;){var u=t.charAt(r);if(""===u){o.push((a+i).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,o.push((a+i).trim());break}"("===u&&(s=!0)}i+=u,r+=1}}}return o.join(", ")}(e,n):"style"===r&&n?T(n,N()):"object"===t&&"data"===r&&n?O(e,n):n:O(e,n)}function _(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&_(e.parentNode,t,r);for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return!!r&&_(e.parentNode,t,r)}function F(e,t,r){var n=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===n)return!1;if("string"==typeof t){if(n.classList.contains(t))return!0;if(n.closest(".".concat(t)))return!0}else if(_(n,t,!0))return!0;if(r){if(n.matches(r))return!0;if(n.closest(r))return!0}return!1}function U(t,r){var n=r.doc,o=r.mirror,a=r.blockClass,i=r.blockSelector,s=r.maskTextClass,u=r.maskTextSelector,c=r.inlineStylesheet,l=r.maskInputOptions,f=void 0===l?{}:l,d=r.maskTextFn,p=r.maskInputFn,h=r.dataURLOptions,v=void 0===h?{}:h,m=r.inlineImages,C=r.recordCanvas,k=r.keepIframeSrcFn,A=r.newlyAddedElement,x=void 0!==A&&A,E=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(n,o);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:E};case t.ELEMENT_NODE:return function(t,r){for(var n=r.doc,o=r.blockClass,a=r.blockSelector,i=r.inlineStylesheet,s=r.maskInputOptions,u=void 0===s?{}:s,c=r.maskInputFn,l=r.dataURLOptions,f=void 0===l?{}:l,d=r.inlineImages,p=r.recordCanvas,h=r.keepIframeSrcFn,v=r.newlyAddedElement,m=void 0!==v&&v,C=r.rootId,k=function(e,t,r){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var o=e.classList[n];if(t.test(o))return!0}return!!r&&e.matches(r)}(t,o,a),A=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return S.test(t)?"div":t}(t),x={},E=t.attributes.length,R=0;R<E;R++){var M=t.attributes[R];x[M.name]=D(n,A,M.name,M.value)}if("link"===A&&i){var O=Array.from(n.styleSheets).find((function(e){return e.href===t.href})),_=null;O&&(_=g(O)),_&&(delete x.rel,delete x.href,x._cssText=T(_,O.href))}if("style"===A&&t.sheet&&!(t.innerText||t.textContent||"").trim().length){(_=g(t.sheet))&&(x._cssText=T(_,N()))}if("input"===A||"textarea"===A||"select"===A){var F=t.value,U=t.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&F?x.value=y({type:x.type,tagName:A,value:F,maskInputOptions:u,maskInputFn:c}):U&&(x.checked=U)}"option"===A&&(t.selected&&!u.select?x.selected=!0:delete x.selected);if("canvas"===A&&p)if("2d"===t.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var o=t.getImageData,a=w in o?o[w]:o;if(new Uint32Array(a.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(t)||(x.rr_dataURL=t.toDataURL(f.type,f.quality));else if(!("__context"in t)){var B=t.toDataURL(f.type,f.quality),P=document.createElement("canvas");P.width=t.width,P.height=t.height,B!==P.toDataURL(f.type,f.quality)&&(x.rr_dataURL=B)}if("img"===A&&d){I||(I=n.createElement("canvas"),b=I.getContext("2d"));var W=t,G=W.crossOrigin;W.crossOrigin="anonymous";var K=function(){try{I.width=W.naturalWidth,I.height=W.naturalHeight,b.drawImage(W,0,0),x.rr_dataURL=I.toDataURL(f.type,f.quality)}catch(e){console.warn("Cannot inline img src=".concat(W.currentSrc,"! Error: ").concat(e))}G?x.crossOrigin=G:W.removeAttribute("crossorigin")};W.complete&&0!==W.naturalWidth?K():W.onload=K}"audio"!==A&&"video"!==A||(x.rr_mediaState=t.paused?"paused":"played",x.rr_mediaCurrentTime=t.currentTime);m||(t.scrollLeft&&(x.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(x.rr_scrollTop=t.scrollTop));if(k){var j=t.getBoundingClientRect(),Y=j.width,Z=j.height;x={class:x.class,rr_width:"".concat(Y,"px"),rr_height:"".concat(Z,"px")}}"iframe"!==A||h(x.src)||(t.contentDocument||(x.rr_src=x.src),delete x.src);return{type:e.Element,tagName:A,attributes:x,childNodes:[],isSVG:L(t)||void 0,needBlock:k,rootId:C}}(t,{doc:n,blockClass:a,blockSelector:i,inlineStylesheet:c,maskInputOptions:f,maskInputFn:p,dataURLOptions:v,inlineImages:m,recordCanvas:C,keepIframeSrcFn:k,newlyAddedElement:x,rootId:E});case t.TEXT_NODE:return function(t,r){var n,o=r.maskTextClass,a=r.maskTextSelector,i=r.maskTextFn,s=r.rootId,u=t.parentNode&&t.parentNode.tagName,c=t.textContent,l="STYLE"===u||void 0,f="SCRIPT"===u||void 0;if(l&&c){try{t.nextSibling||t.previousSibling||(null===(n=t.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(c=(d=t.parentNode.sheet).cssRules?Array.from(d.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(e),t)}c=T(c,N())}var d;f&&(c="SCRIPT_PLACEHOLDER");!l&&!f&&c&&F(t,o,a)&&(c=i?i(c):c.replace(/[\S]/g,"*"));return{type:e.Text,textContent:c||"",isStyle:l,rootId:s}}(t,{maskTextClass:s,maskTextSelector:u,maskTextFn:d,rootId:E});case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:E};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:E};default:return!1}}function B(e){return void 0===e?"":e.toLowerCase()}function P(t,r){var n,o=r.doc,a=r.mirror,i=r.blockClass,s=r.blockSelector,u=r.maskTextClass,c=r.maskTextSelector,l=r.skipChild,f=void 0!==l&&l,g=r.inlineStylesheet,v=void 0===g||g,m=r.maskInputOptions,y=void 0===m?{}:m,w=r.maskTextFn,I=r.maskInputFn,b=r.slimDOMOptions,C=r.dataURLOptions,S=void 0===C?{}:C,A=r.inlineImages,x=void 0!==A&&A,E=r.recordCanvas,T=void 0!==E&&E,R=r.onSerialize,M=r.onIframeLoad,O=r.iframeLoadTimeout,L=void 0===O?5e3:O,N=r.onStylesheetLoad,D=r.stylesheetLoadTimeout,_=void 0===D?5e3:D,F=r.keepIframeSrcFn,W=void 0===F?function(){return!1}:F,G=r.newlyAddedElement,K=void 0!==G&&G,j=r.preserveWhiteSpace,Y=void 0===j||j,Z=U(t,{doc:o,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,inlineStylesheet:v,maskInputOptions:y,maskTextFn:w,maskInputFn:I,dataURLOptions:S,inlineImages:x,recordCanvas:T,keepIframeSrcFn:W,newlyAddedElement:K});if(!Z)return console.warn(t,"not serialized"),null;n=a.hasNode(t)?a.getId(t):!function(t,r){if(r.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(r.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(r.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(B(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===B(t.attributes.name)||"icon"===B(t.attributes.rel)||"apple-touch-icon"===B(t.attributes.rel)||"shortcut icon"===B(t.attributes.rel))))return!0;if("meta"===t.tagName){if(r.headMetaDescKeywords&&B(t.attributes.name).match(/^description|keywords$/))return!0;if(r.headMetaSocial&&(B(t.attributes.property).match(/^(og|twitter|fb):/)||B(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===B(t.attributes.name)))return!0;if(r.headMetaRobots&&("robots"===B(t.attributes.name)||"googlebot"===B(t.attributes.name)||"bingbot"===B(t.attributes.name)))return!0;if(r.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(r.headMetaAuthorship&&("author"===B(t.attributes.name)||"generator"===B(t.attributes.name)||"framework"===B(t.attributes.name)||"publisher"===B(t.attributes.name)||"progid"===B(t.attributes.name)||B(t.attributes.property).match(/^article:/)||B(t.attributes.property).match(/^product:/)))return!0;if(r.headMetaVerification&&("google-site-verification"===B(t.attributes.name)||"yandex-verification"===B(t.attributes.name)||"csrf-token"===B(t.attributes.name)||"p:domain_verify"===B(t.attributes.name)||"verify-v1"===B(t.attributes.name)||"verification"===B(t.attributes.name)||"shopify-checkout-api-token"===B(t.attributes.name)))return!0}}return!1}(Z,b)&&(Y||Z.type!==e.Text||Z.isStyle||Z.textContent.replace(/^\s+|\s+$/gm,"").length)?k():-2;var V=Object.assign(Z,{id:n});if(a.add(t,V),-2===n)return null;R&&R(t);var H=!f;if(V.type===e.Element){H=H&&!V.needBlock,delete V.needBlock;var J=t.shadowRoot;J&&h(J)&&(V.isShadowHost=!0)}if((V.type===e.Document||V.type===e.Element)&&H){b.headWhitespace&&V.type===e.Element&&"head"===V.tagName&&(Y=!1);for(var q={doc:o,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:f,inlineStylesheet:v,maskInputOptions:y,maskTextFn:w,maskInputFn:I,slimDOMOptions:b,dataURLOptions:S,inlineImages:x,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:L,onStylesheetLoad:N,stylesheetLoadTimeout:_,keepIframeSrcFn:W},z=0,Q=Array.from(t.childNodes);z<Q.length;z++){(ee=P(Q[z],q))&&V.childNodes.push(ee)}if(d(t)&&t.shadowRoot)for(var X=0,$=Array.from(t.shadowRoot.childNodes);X<$.length;X++){var ee;(ee=P($[X],q))&&(h(t.shadowRoot)&&(ee.isShadow=!0),V.childNodes.push(ee))}}return t.parentNode&&p(t.parentNode)&&h(t.parentNode)&&(V.isShadow=!0),V.type===e.Element&&"iframe"===V.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var o,a=!1;try{o=n.document.readyState}catch(e){return}if("complete"===o){var i="about:blank";if(n.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){a||(t(),a=!0)}),r);e.addEventListener("load",(function(){clearTimeout(s),a=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&M){var r=P(e,{doc:e,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:w,maskInputFn:I,slimDOMOptions:b,dataURLOptions:S,inlineImages:x,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:L,onStylesheetLoad:N,stylesheetLoadTimeout:_,keepIframeSrcFn:W});r&&M(t,r)}}),L),V.type===e.Element&&"link"===V.tagName&&"stylesheet"===V.attributes.rel&&function(e,t,r){var n,o=!1;try{n=e.sheet}catch(e){return}if(!n){var a=setTimeout((function(){o||(t(),o=!0)}),r);e.addEventListener("load",(function(){clearTimeout(a),o=!0,t()}))}}(t,(function(){if(N){var e=P(t,{doc:o,mirror:a,blockClass:i,blockSelector:s,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:v,maskInputOptions:y,maskTextFn:w,maskInputFn:I,slimDOMOptions:b,dataURLOptions:S,inlineImages:x,recordCanvas:T,preserveWhiteSpace:Y,onSerialize:R,onIframeLoad:M,iframeLoadTimeout:L,onStylesheetLoad:N,stylesheetLoadTimeout:_,keepIframeSrcFn:W});e&&N(t,e)}}),_),V}function W(e,t){var r=t||{},n=r.mirror,o=void 0===n?new m:n,a=r.blockClass,i=void 0===a?"rr-block":a,s=r.blockSelector,u=void 0===s?null:s,c=r.maskTextClass,l=void 0===c?"rr-mask":c,f=r.maskTextSelector,d=void 0===f?null:f,p=r.inlineStylesheet,h=void 0===p||p,g=r.inlineImages,v=void 0!==g&&g,y=r.recordCanvas,w=void 0!==y&&y,I=r.maskAllInputs,b=void 0!==I&&I,C=r.maskTextFn,S=r.maskInputFn,k=r.slimDOM,A=void 0!==k&&k,x=r.dataURLOptions,E=r.preserveWhiteSpace,T=r.onSerialize,R=r.onIframeLoad,M=r.iframeLoadTimeout,O=r.onStylesheetLoad,L=r.stylesheetLoadTimeout,N=r.keepIframeSrcFn;return P(e,{doc:e,mirror:o,blockClass:i,blockSelector:u,maskTextClass:l,maskTextSelector:d,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===b?{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===b?{password:!0}:b,maskTextFn:C,maskInputFn:S,slimDOMOptions:!0===A||"all"===A?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===A,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===A?{}:A,dataURLOptions:x,inlineImages:v,recordCanvas:w,preserveWhiteSpace:E,onSerialize:T,onIframeLoad:R,iframeLoadTimeout:M,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:void 0===N?function(){return!1}:N,newlyAddedElement:!1})}var G=/([^\\]):hover/;new RegExp(G.source,"g");var K=r(573),j=r.n(K),Y=r(638),Z=r.n(Y),V=r(477),H=r.n(V),J=r(851),q=r.n(J);function z(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,n={capture:!0,passive:!0};return r.addEventListener(e,t,n),function(){return r.removeEventListener(e,t,n)}}var Q="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.",X={map:{},getId:function(){return console.error(Q),-1},getNode:function(){return console.error(Q),null},removeNodeFromMap:function(){console.error(Q)},has:function(){return console.error(Q),!1},reset:function(){console.error(Q)}};function $(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=null,o=0;return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];var u=Date.now();o||!1!==r.leading||(o=u);var c=t-(u-o),l=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),o=u,e.apply(l,i)):n||!1===r.trailing||(n=setTimeout((function(){o=!1===r.leading?0:Date.now(),n=null,e.apply(l,i)}),c))}}function ee(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,a=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set:function(e){var t=this;setTimeout((function(){r.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return ee(e,t,a||{},!0)}}function te(e,t,r){try{if(!(t in e))return function(){};var n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,function(){e[t]=n}}catch(e){return function(){}}}function re(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ne(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function oe(e,t,r,n){if(!e)return!1;var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(n&&null!==o.closest("."+t))return!0}else if(_(o,t,n))return!0;if(r){if(e.matches(r))return!0;if(n&&null!==o.closest(r))return!0}return!1}function ae(e,t){return-2===t.getId(e)}function ie(e,t){if(p(e))return!1;var r=t.getId(e);return!t.has(r)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ie(e.parentNode,t))}function se(e){return Boolean(e.changedTouches)}function ue(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var o=r[0];if(!(0 in r))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}function ce(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function le(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function fe(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(X=new Proxy(X,{get:function(e,t,r){return"map"===t&&console.error(Q),Reflect.get(e,t,r)}}));var de=function(){function e(){V(this,e),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return J(e,[{key:"getId",value:function(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]),e}(),pe=function(e){return 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}(pe||{}),he=function(e){return 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}(he||{}),ge=function(e){return 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}(ge||{}),ve=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(ve||{});function me(e){return"__ln"in e}var ye=function(){function e(){V(this,e),this.length=0,this.head=null}return J(e,[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}},{key:"addNode",value:function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&me(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&me(e.nextSibling)&&e.nextSibling.__ln.previous){var 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++}},{key:"removeNode",value:function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}]),e}(),we=function(e,t){return"".concat(e,"@").concat(t)},Ie=function(){function e(){var t=this;V(this,e),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=function(e){e.forEach(t.processMutation),t.emit()},this.emit=function(){if(!t.frozen&&!t.locked){for(var e=[],r=new ye,n=function(e){for(var r=e,n=-2;-2===n;)n=(r=r&&r.nextSibling)&&t.mirror.getId(r);return n},o=function(o){var a,i,s,u,c=null;(null===(i=null===(a=o.getRootNode)||void 0===a?void 0:a.call(o))||void 0===i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&o.getRootNode().host&&(c=o.getRootNode().host);for(var l=c;(null===(u=null===(s=null==l?void 0:l.getRootNode)||void 0===s?void 0:s.call(l))||void 0===u?void 0:u.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&l.getRootNode().host;)l=l.getRootNode().host;var f=!(t.doc.contains(o)||l&&t.doc.contains(l));if(o.parentNode&&!f){var d=p(o.parentNode)?t.mirror.getId(c):t.mirror.getId(o.parentNode),h=n(o);if(-1===d||-1===h)return r.addNode(o);var g=P(o,{doc:t.doc,mirror:t.mirror,blockClass:t.blockClass,blockSelector:t.blockSelector,maskTextClass:t.maskTextClass,maskTextSelector:t.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:t.inlineStylesheet,maskInputOptions:t.maskInputOptions,maskTextFn:t.maskTextFn,maskInputFn:t.maskInputFn,slimDOMOptions:t.slimDOMOptions,dataURLOptions:t.dataURLOptions,recordCanvas:t.recordCanvas,inlineImages:t.inlineImages,onSerialize:function(e){ce(e,t.mirror)&&t.iframeManager.addIframe(e),le(e,t.mirror)&&t.stylesheetManager.trackLinkElement(e),fe(o)&&t.shadowDomManager.addShadowRoot(o.shadowRoot,t.doc)},onIframeLoad:function(e,r){t.iframeManager.attachIframe(e,r),t.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,r){t.stylesheetManager.attachLinkElement(e,r)}});g&&e.push({parentId:d,nextId:h,node:g})}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());for(var a=0,i=Array.from(t.movedSet.values());a<i.length;a++){var s=i[a];Ce(t.removes,s,t.mirror)&&!t.movedSet.has(s.parentNode)||o(s)}for(var u=0,c=Array.from(t.addedSet.values());u<c.length;u++){var l=c[u];ke(t.droppedSet,l)||Ce(t.removes,l,t.mirror)?ke(t.movedSet,l)?o(l):t.droppedSet.add(l):o(l)}for(var f=null;r.length;){var d=null;if(f){var h=t.mirror.getId(f.value.parentNode),g=n(f.value);-1!==h&&-1!==g&&(d=f)}if(!d)for(var v=r.length-1;v>=0;v--){var m=r.get(v);if(m){var y=t.mirror.getId(m.value.parentNode);if(-1===n(m.value))continue;if(-1!==y){d=m;break}var w=m.value;if(w.parentNode&&w.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var I=w.parentNode.host;if(-1!==t.mirror.getId(I)){d=m;break}}}}if(!d){for(;r.head;)r.removeNode(r.head.value);break}f=d.previous,r.removeNode(d.value),o(d.value)}var b={texts:t.texts.map((function(e){return{id:t.mirror.getId(e.node),value:e.value}})).filter((function(e){return t.mirror.has(e.id)})),attributes:t.attributes.map((function(e){return{id:t.mirror.getId(e.node),attributes:e.attributes}})).filter((function(e){return t.mirror.has(e.id)})),removes:t.removes,adds:e};(b.texts.length||b.attributes.length||b.removes.length||b.adds.length)&&(t.texts=[],t.attributes=[],t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.movedMap={},t.mutationCb(b))}},this.processMutation=function(e){if(!ae(e.target,t.mirror))switch(e.type){case"characterData":var r=e.target.textContent;oe(e.target,t.blockClass,t.blockSelector,!1)||r===e.oldValue||t.texts.push({value:F(e.target,t.maskTextClass,t.maskTextSelector)&&r?t.maskTextFn?t.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:e.target});break;case"attributes":var n=e.target,o=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(o=y({maskInputOptions:t.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:o,maskInputFn:t.maskInputFn})),oe(e.target,t.blockClass,t.blockSelector,!1)||o===e.oldValue)return;var a=t.attributes.find((function(t){return t.node===e.target}));if("IFRAME"===n.tagName&&"src"===e.attributeName&&!t.keepIframeSrcFn(o)){if(n.contentDocument)return;e.attributeName="rr_src"}if(a||(a={node:e.target,attributes:{}},t.attributes.push(a)),"style"===e.attributeName){var i=t.doc.createElement("span");e.oldValue&&i.setAttribute("style",e.oldValue),void 0!==a.attributes.style&&null!==a.attributes.style||(a.attributes.style={});for(var s=a.attributes.style,u=0,c=Array.from(n.style);u<c.length;u++){var l=c[u],f=n.style.getPropertyValue(l),d=n.style.getPropertyPriority(l);f===i.style.getPropertyValue(l)&&d===i.style.getPropertyPriority(l)||(s[l]=""===d?f:[f,d])}for(var g=0,v=Array.from(i.style);g<v.length;g++){var m=v[g];""===n.style.getPropertyValue(m)&&(s[m]=!1)}}else a.attributes[e.attributeName]=D(t.doc,n.tagName,e.attributeName,o);break;case"childList":if(oe(e.target,t.blockClass,t.blockSelector,!0))return;e.addedNodes.forEach((function(r){return t.genAdds(r,e.target)})),e.removedNodes.forEach((function(r){var n=t.mirror.getId(r),o=p(e.target)?t.mirror.getId(e.target.host):t.mirror.getId(e.target);oe(e.target,t.blockClass,t.blockSelector,!1)||ae(r,t.mirror)||!function(e,t){return-1!==t.getId(e)}(r,t.mirror)||(t.addedSet.has(r)?(be(t.addedSet,r),t.droppedSet.add(r)):t.addedSet.has(e.target)&&-1===n||ie(e.target,t.mirror)||(t.movedSet.has(r)&&t.movedMap[we(n,o)]?be(t.movedSet,r):t.removes.push({parentId:o,id:n,isShadow:!(!p(e.target)||!h(e.target))||void 0})),t.mapRemoves.push(r))}))}},this.genAdds=function(e,r){if(t.mirror.hasNode(e)){if(ae(e,t.mirror))return;t.movedSet.add(e);var n=null;r&&t.mirror.hasNode(r)&&(n=t.mirror.getId(r)),n&&-1!==n&&(t.movedMap[we(t.mirror.getId(e),n)]=!0)}else t.addedSet.add(e),t.droppedSet.delete(e);oe(e,t.blockClass,t.blockSelector,!1)||e.childNodes.forEach((function(e){return t.genAdds(e)}))}}return J(e,[{key:"init",value:function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach((function(r){t[r]=e[r]}))}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]),e}();function be(e,t){e.delete(t),t.childNodes.forEach((function(t){return be(e,t)}))}function Ce(e,t,r){return 0!==e.length&&Se(e,t,r)}function Se(e,t,r){var n=t.parentNode;if(!n)return!1;var o=r.getId(n);return!!e.some((function(e){return e.id===o}))||Se(e,n,r)}function ke(e,t){return 0!==e.size&&Ae(e,t)}function Ae(e,t){var r=t.parentNode;return!!r&&(!!e.has(r)||Ae(e,r))}var xe=[],Ee="undefined"!=typeof CSSGroupingRule,Te="undefined"!=typeof CSSMediaRule,Re="undefined"!=typeof CSSSupportsRule,Me="undefined"!=typeof CSSConditionRule;function Oe(e){try{if("composedPath"in e){var 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 Le(e,t){var r,n,o=new Ie;xe.push(o),o.init(e);var a=window.MutationObserver||window.__rrMutationObserver,i=null===(n=null===(r=null===window||void 0===window?void 0:window.Zone)||void 0===r?void 0:r.__symbol__)||void 0===n?void 0:n.call(r,"MutationObserver");i&&window[i]&&(a=window[i]);var s=new a(o.processMutations.bind(o));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Ne(e){var t=e.mousemoveCb,r=e.sampling,n=e.doc,o=e.mirror;if(!1===r.mousemove)return function(){};var a,i="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],c=$((function(e){var r=Date.now()-a;t(u.map((function(e){return e.timeOffset-=r,e})),e),u=[],a=null}),s),l=$((function(e){var t=Oe(e),r=se(e)?e.changedTouches[0]:e,n=r.clientX,i=r.clientY;a||(a=Date.now()),u.push({x:n,y:i,id:o.getId(t),timeOffset:Date.now()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?he.Drag:e instanceof MouseEvent?he.MouseMove:he.TouchMove)}),i,{trailing:!1}),f=[z("mousemove",l,n),z("touchmove",l,n),z("drag",l,n)];return function(){f.forEach((function(e){return e()}))}}function De(e){var t=e.mouseInteractionCb,r=e.doc,n=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.sampling;if(!1===i.mouseInteraction)return function(){};var s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,u=[];return Object.keys(ge).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(e){var i=e.toLowerCase(),s=function(e){return function(r){var i=Oe(r);if(!oe(i,o,a,!0)){var s=se(r)?r.changedTouches[0]:r;if(s){var u=n.getId(i),c=s.clientX,l=s.clientY;t({type:ge[e],id:u,x:c,y:l})}}}}(e);u.push(z(i,s,r))})),function(){u.forEach((function(e){return e()}))}}function _e(e){var t=e.scrollCb,r=e.doc,n=e.mirror,o=e.blockClass,a=e.blockSelector;return z("scroll",$((function(e){var i=Oe(e);if(i&&!oe(i,o,a,!0)){var s=n.getId(i);if(i===r){var u=r.scrollingElement||r.documentElement;t({id:s,x:u.scrollLeft,y:u.scrollTop})}else t({id:s,x:i.scrollLeft,y:i.scrollTop})}}),e.sampling.scroll||100),r)}function Fe(e){var t=e.viewportResizeCb,r=-1,n=-1;return z("resize",$((function(){var e=re(),o=ne();r===e&&n===o||(t({width:Number(o),height:Number(e)}),r=e,n=o)}),200),window)}function Ue(e,t){var r=Object.assign({},e);return t||delete r.userTriggered,r}var Be=["INPUT","TEXTAREA","SELECT"],Pe=new WeakMap;function We(e){var t=e.inputCb,r=e.doc,n=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.ignoreClass,s=e.maskInputOptions,u=e.maskInputFn,c=e.sampling,l=e.userTriggeredOnInput;function f(e){var t=Oe(e),n=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(Be.indexOf(t.tagName)<0)&&!oe(t,o,a,!0)){var c=t.type;if(!t.classList.contains(i)){var f=t.value,p=!1;"radio"===c||"checkbox"===c?p=t.checked:(s[t.tagName.toLowerCase()]||s[c])&&(f=y({maskInputOptions:s,tagName:t.tagName,type:c,value:f,maskInputFn:u})),d(t,Ue({text:f,isChecked:p,userTriggered:n},l));var h=t.name;"radio"===c&&h&&p&&r.querySelectorAll('input[type="radio"][name="'.concat(h,'"]')).forEach((function(e){e!==t&&d(e,Ue({text:e.value,isChecked:!p,userTriggered:!1},l))}))}}}function d(e,r){var o=Pe.get(e);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Pe.set(e,r);var a=n.getId(e);t(Object.assign(Object.assign({},r),{id:a}))}}var p=("last"===c.input?["change"]:["input","change"]).map((function(e){return z(e,f,r)})),h=r.defaultView;if(!h)return function(){p.forEach((function(e){return e()}))};var g=h.Object.getOwnPropertyDescriptor(h.HTMLInputElement.prototype,"value"),v=[[h.HTMLInputElement.prototype,"value"],[h.HTMLInputElement.prototype,"checked"],[h.HTMLSelectElement.prototype,"value"],[h.HTMLTextAreaElement.prototype,"value"],[h.HTMLSelectElement.prototype,"selectedIndex"],[h.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&p.push.apply(p,Y(v.map((function(e){return ee(e[0],e[1],{set:function(){f({target:this})}},!1,h)})))),function(){p.forEach((function(e){return e()}))}}function Ge(e){return function(e,t){if(Ee&&e.parentRule instanceof CSSGroupingRule||Te&&e.parentRule instanceof CSSMediaRule||Re&&e.parentRule instanceof CSSSupportsRule||Me&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ke(e,t,r){var n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function je(e,t){var r=e.styleSheetRuleCb,n=e.mirror,o=e.stylesheetManager,a=t.win,i=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var a=Ke(this,n,o.styleMirror),s=a.id,u=a.styleId;return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,adds:[{rule:e,index:t}]}),i.apply(this,[e,t])};var s,u,c=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=Ke(this,n,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&r({id:a,styleId:i,removes:[{index:e}]}),c.apply(this,[e])},a.CSSStyleSheet.prototype.replace&&(s=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=function(e){var t=Ke(this,n,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&r({id:a,styleId:i,replace:e}),s.apply(this,[e])}),a.CSSStyleSheet.prototype.replaceSync&&(u=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=function(e){var t=Ke(this,n,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&r({id:a,styleId:i,replaceSync:e}),u.apply(this,[e])});var l={};Ee?l.CSSGroupingRule=a.CSSGroupingRule:(Te&&(l.CSSMediaRule=a.CSSMediaRule),Me&&(l.CSSConditionRule=a.CSSConditionRule),Re&&(l.CSSSupportsRule=a.CSSSupportsRule));var f={};return Object.entries(l).forEach((function(e){var t=K(e,2),a=t[0],i=t[1];f[a]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=function(e,t){var i=Ke(this.parentStyleSheet,n,o.styleMirror),s=i.id,u=i.styleId;return(s&&-1!==s||u&&-1!==u)&&r({id:s,styleId:u,adds:[{rule:e,index:[].concat(Y(Ge(this)),[t||0])}]}),f[a].insertRule.apply(this,[e,t])},i.prototype.deleteRule=function(e){var t=Ke(this.parentStyleSheet,n,o.styleMirror),i=t.id,s=t.styleId;return(i&&-1!==i||s&&-1!==s)&&r({id:i,styleId:s,removes:[{index:[].concat(Y(Ge(this)),[e])}]}),f[a].deleteRule.apply(this,[e])}})),function(){a.CSSStyleSheet.prototype.insertRule=i,a.CSSStyleSheet.prototype.deleteRule=c,s&&(a.CSSStyleSheet.prototype.replace=s),u&&(a.CSSStyleSheet.prototype.replaceSync=u),Object.entries(l).forEach((function(e){var t=K(e,2),r=t[0],n=t[1];n.prototype.insertRule=f[r].insertRule,n.prototype.deleteRule=f[r].deleteRule}))}}function Ye(e,t){var r,n,o,a=e.mirror,i=e.stylesheetManager,s=null;s="#document"===t.nodeName?a.getId(t):a.getId(t.host);var u="#document"===t.nodeName?null===(r=t.defaultView)||void 0===r?void 0:r.Document:null===(o=null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===o?void 0:o.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets");return null!==s&&-1!==s&&u&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:function(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set:function(e){var t,r=null===(t=c.set)||void 0===t?void 0:t.call(this,e);if(null!==s&&-1!==s)try{i.adoptStyleSheets(e,s)}catch(e){}return r}}),function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}):function(){}}function Ze(e,t){var r=e.styleDeclarationCb,n=e.mirror,o=e.ignoreCSSAttributes,a=e.stylesheetManager,i=t.win,s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var u;if(o.has(e))return s.apply(this,[e,t,i]);var c=Ke(null===(u=this.parentRule)||void 0===u?void 0:u.parentStyleSheet,n,a.styleMirror),l=c.id,f=c.styleId;return(l&&-1!==l||f&&-1!==f)&&r({id:l,styleId:f,set:{property:e,value:t,priority:i},index:Ge(this.parentRule)}),s.apply(this,[e,t,i])};var u=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t;if(o.has(e))return u.apply(this,[e]);var i=Ke(null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet,n,a.styleMirror),s=i.id,c=i.styleId;return(s&&-1!==s||c&&-1!==c)&&r({id:s,styleId:c,remove:{property:e},index:Ge(this.parentRule)}),u.apply(this,[e])},function(){i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=u}}function Ve(e){var t=e.mediaInteractionCb,r=e.blockClass,n=e.blockSelector,o=e.mirror,a=e.sampling,i=function(e){return $((function(a){var i=Oe(a);if(i&&!oe(i,r,n,!0)){var s=i.currentTime,u=i.volume,c=i.muted,l=i.playbackRate;t({type:e,id:o.getId(i),currentTime:s,volume:u,muted:c,playbackRate:l})}}),a.media||500)},s=[z("play",i(0)),z("pause",i(1)),z("seeked",i(2)),z("volumechange",i(3)),z("ratechange",i(4))];return function(){s.forEach((function(e){return e()}))}}function He(e){var t=e.fontCb,r=e.doc,n=r.defaultView;if(!n)return function(){};var o=[],a=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,r){var n=new i(e,t,r);return a.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var s=te(r.fonts,"add",(function(e){return function(r){return setTimeout((function(){var e=a.get(r);e&&(t(e),a.delete(r))}),0),e.apply(this,[r])}}));return o.push((function(){n.FontFace=i})),o.push(s),function(){o.forEach((function(e){return e()}))}}function Je(e){var t=e.doc,r=e.mirror,n=e.blockClass,o=e.blockSelector,a=e.selectionCb,i=!0,s=function(){var e=t.getSelection();if(!(!e||i&&(null==e?void 0:e.isCollapsed))){i=e.isCollapsed||!1;for(var s=[],u=e.rangeCount||0,c=0;c<u;c++){var l=e.getRangeAt(c),f=l.startContainer,d=l.startOffset,p=l.endContainer,h=l.endOffset;oe(f,n,o,!0)||oe(p,n,o,!0)||s.push({start:r.getId(f),startOffset:d,end:r.getId(p),endOffset:h})}a({ranges:s})}};return s(),z("selectionchange",s)}function qe(e,t){var r=e.mutationCb,n=e.mousemoveCb,o=e.mouseInteractionCb,a=e.scrollCb,i=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,c=e.styleSheetRuleCb,l=e.styleDeclarationCb,f=e.canvasMutationCb,d=e.fontCb,p=e.selectionCb;e.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),r.apply(void 0,arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),n.apply(void 0,arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),o.apply(void 0,arguments)},e.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),a.apply(void 0,arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),i.apply(void 0,arguments)},e.inputCb=function(){t.input&&t.input.apply(t,arguments),s.apply(void 0,arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),u.apply(void 0,arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),c.apply(void 0,arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),l.apply(void 0,arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),f.apply(void 0,arguments)},e.fontCb=function(){t.font&&t.font.apply(t,arguments),d.apply(void 0,arguments)},e.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),p.apply(void 0,arguments)}}function ze(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.doc.defaultView;if(!r)return function(){};qe(e,t);var n,o=Le(e,e.doc),a=Ne(e),i=De(e),s=_e(e),u=Fe(e),c=We(e),l=Ve(e),d=je(e,{win:r}),p=Ye(e,e.doc),h=Ze(e,{win:r}),g=e.collectFonts?He(e):function(){},v=Je(e),m=[],y=f(e.plugins);try{for(y.s();!(n=y.n()).done;){var w=n.value;m.push(w.observer(w.callback,r,w.options))}}catch(e){y.e(e)}finally{y.f()}return function(){xe.forEach((function(e){return e.reset()})),o.disconnect(),a(),i(),s(),u(),c(),l(),d(),p(),h(),g(),v(),m.forEach((function(e){return e()}))}}var Qe=function(){function e(t){V(this,e),this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}return J(e,[{key:"getId",value:function(e,t,r,n){var o=r||this.getIdToRemoteIdMap(e),a=n||this.getRemoteIdToIdMap(e),i=o.get(t);return i||(i=this.generateIdFn(),o.set(t,i),a.set(i,t)),i}},{key:"getIds",value:function(e,t){var r=this,n=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map((function(t){return r.getId(e,t,n,o)}))}},{key:"getRemoteId",value:function(e,t,r){var n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var o=n.get(t);return o||-1}},{key:"getRemoteIds",value:function(e,t){var r=this,n=this.getRemoteIdToIdMap(e);return t.map((function(t){return r.getRemoteId(e,t,n)}))}},{key:"reset",value:function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),e}(),Xe=function(){function e(t){V(this,e),this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Qe(k),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Qe(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}return J(e,[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){var r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(r=this.loadListener)||void 0===r||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){if("rrweb"===e.data.type){if(!e.source)return;var t=this.crossOriginIframeMap.get(e.source);if(!t)return;var r=this.transformCrossOriginEvent(t,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}},{key:"transformCrossOriginEvent",value:function(e,t){var r,n=this;switch(t.type){case pe.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:pe.IncrementalSnapshot,data:{source:he.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case pe.Meta:case pe.Load:case pe.DomContentLoaded:return!1;case pe.Plugin:return t;case pe.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case pe.IncrementalSnapshot:switch(t.data.source){case he.Mutation:return t.data.adds.forEach((function(t){n.replaceIds(t,e,["parentId","nextId","previousId"]),n.replaceIdOnNode(t.node,e)})),t.data.removes.forEach((function(t){n.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((function(t){n.replaceIds(t,e,["id"])})),t.data.texts.forEach((function(t){n.replaceIds(t,e,["id"])})),t;case he.Drag:case he.TouchMove:case he.MouseMove:return t.data.positions.forEach((function(t){n.replaceIds(t,e,["id"])})),t;case he.ViewportResize:return!1;case he.MediaInteraction:case he.MouseInteraction:case he.Scroll:case he.CanvasMutation:case he.Input:return this.replaceIds(t.data,e,["id"]),t;case he.StyleSheetRule:case he.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case he.Font:return t;case he.Selection:return t.data.ranges.forEach((function(t){n.replaceIds(t,e,["start","end"])})),t;case he.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(r=t.data.styles)||void 0===r||r.forEach((function(t){n.replaceStyleIds(t,e,["styleId"])})),t}}}},{key:"replace",value:function(e,t,r,n){var o,a=f(n);try{for(a.s();!(o=a.n()).done;){var i=o.value;(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]))}}catch(e){a.e(e)}finally{a.f()}return t}},{key:"replaceIds",value:function(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}},{key:"replaceStyleIds",value:function(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}},{key:"replaceIdOnNode",value:function(e,t){var r=this;this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach((function(e){r.replaceIdOnNode(e,t)}))}}]),e}(),$e=function(){function e(t){V(this,e),this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;var r=this;this.restorePatches.push(te(Element.prototype,"attachShadow",(function(e){return function(t){var n=e.call(this,t);return this.shadowRoot&&r.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}return J(e,[{key:"addShadowRoot",value:function(e,t){var r=this;h(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),Le(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),_e(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&r.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,r.mirror.getId(e.host)),Ye({mirror:r.mirror,stylesheetManager:r.bypassOptions.stylesheetManager},e)}),0)))}},{key:"observeAttachShadow",value:function(e){if(e.contentWindow){var t=this;this.restorePatches.push(te(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(r){return function(n){var o=r.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),o}})))}}},{key:"reset",value:function(){this.restorePatches.forEach((function(e){return e()})),this.shadowDoms=new WeakSet}}]),e}();function et(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))}for(var tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),nt=0;nt<tt.length;nt++)rt[tt.charCodeAt(nt)]=nt;var ot=new Map;var at=function(e,t,r){if(e&&(ut(e,t)||"object"===s(e))){var n=function(e,t){var r=ot.get(e);return r||(r=new Map,ot.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),o=n.indexOf(e);return-1===o&&(o=n.length,n.push(e)),o}};function it(e,t,r){if(e instanceof Array)return e.map((function(e){return it(e,t,r)}));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){var n=e.constructor.name,o=function(e){var t,r=new Uint8Array(e),n=r.length,o="";for(t=0;t<n;t+=3)o+=tt[r[t]>>2],o+=tt[(3&r[t])<<4|r[t+1]>>4],o+=tt[(15&r[t+1])<<2|r[t+2]>>6],o+=tt[63&r[t+2]];return n%3==2?o=o.substring(0,o.length-1)+"=":n%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:n,base64:o}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[it(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement)return{rr_type:e.constructor.name,src:e.src};if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[it(e.data,t,r),e.width,e.height]}:ut(e,t)||"object"===s(e)?{rr_type:e.constructor.name,index:at(e,t,r)}:e}var st=function(e,t,r){return Y(e).map((function(e){return it(e,t,r)}))},ut=function(e,t){var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(r.find((function(r){return e instanceof t[r]})))};function ct(e,t,r){var n=[];try{var o=te(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){oe(this,t,r,!0)||"__context"in this||(this.__context=n);for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return e.apply(this,[n].concat(a))}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}function lt(e,t,r,n,o,a,i){var s,u=[],c=Object.getOwnPropertyNames(e),l=f(c);try{var d=function(){var a=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof e[a])return 0;var c=te(e,a,(function(e){return function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];var l=e.apply(this,u);if(at(l,i,this),!oe(this.canvas,n,o,!0)){var f=st([].concat(u),i,this),d={type:t,property:a,args:f};r(this.canvas,d)}return l}}));u.push(c)}catch(n){var l=ee(e,a,{set:function(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});u.push(l)}};for(l.s();!(s=l.n()).done;)d()}catch(e){l.e(e)}finally{l.f()}return u}var ft=null;try{var dt="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof require&&require("worker_threads")||"function"==typeof require&&require("worker_threads");ft=dt.Worker}catch(e){}var pt=r(671).lW;function ht(e,t,r){var n=void 0===t?null:t,o=function(e,t){return pt.from(e,"base64").toString(t?"utf16":"utf8")}(e,void 0!==r&&r),a=o.indexOf("\n",10)+1,i=o.substring(a)+(n?"//# sourceMappingURL="+n:"");return function(e){return new ft(i,Object.assign({},e,{eval:!0}))}}function gt(e,t,r){var n=void 0===t?null:t,o=function(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),o=0,a=r.length;o<a;++o)n[o]=r.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(n.buffer))}return r}(e,void 0!==r&&r),a=o.indexOf("\n",10)+1,i=o.substring(a)+(n?"//# sourceMappingURL="+n:""),s=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(s)}var vt=r(931),mt="[object process]"===Object.prototype.toString.call(void 0!==vt?vt:0);var yt,wt,It,bt,Ct,St,kt=(yt="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",wt=null,It=!1,mt?ht(yt,wt,It):function(e,t,r){var n;return function(o){return n=n||gt(e,t,r),new Worker(n,o)}}(yt,wt,It)),At=function(){function e(t){var r=this;V(this,e),this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(r.rafStamps.invokeId&&r.rafStamps.latestId!==r.rafStamps.invokeId)&&r.rafStamps.invokeId||(r.rafStamps.invokeId=r.rafStamps.latestId),r.pendingCanvasMutations.has(e)||r.pendingCanvasMutations.set(e,[]),r.pendingCanvasMutations.get(e).push(t)};var n=t.sampling,o=void 0===n?"all":n,a=t.win,i=t.blockClass,s=t.blockSelector,u=t.recordCanvas,c=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,u&&"all"===o&&this.initCanvasMutationObserver(a,i,s),u&&"number"==typeof o&&this.initCanvasFPSObserver(o,a,i,s,{dataURLOptions:c})}return J(e,[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,r,n,o,a){var i=this,s=ct(r,n,o),u=new Map,c=new kt;c.onmessage=function(e){var t=e.data.id;if(u.set(t,!1),"base64"in e.data){var r=e.data,n=r.base64,o=r.type,a=r.width,s=r.height;i.mutationCb({id:t,type:ve["2D"],commands:[{property:"clearRect",args:[0,0,a,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:o}]},0,0]}]})}};var l,f=1e3/e,d=0;l=requestAnimationFrame((function e(s){var p;d&&s-d<f?l=requestAnimationFrame(e):(d=s,(p=[],r.document.querySelectorAll("canvas").forEach((function(e){oe(e,n,o,!0)||p.push(e)})),p).forEach((function(e){return et(i,void 0,void 0,t().mark((function r(){var n,o,i,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=this.mirror.getId(e),!u.get(o)){t.next=3;break}return t.abrupt("return");case 3:return u.set(o,!0),["webgl","webgl2"].includes(e.__context)&&(i=e.getContext(e.__context),!1===(null===(n=null==i?void 0:i.getContextAttributes())||void 0===n?void 0:n.preserveDrawingBuffer)&&(null==i||i.clear(i.COLOR_BUFFER_BIT))),t.next=7,createImageBitmap(e);case 7:s=t.sent,c.postMessage({id:o,bitmap:s,width:e.width,height:e.height,dataURLOptions:a.dataURLOptions},[s]);case 9:case"end":return t.stop()}}),r,this)})))})),l=requestAnimationFrame(e))})),this.resetObservers=function(){s(),cancelAnimationFrame(l)}}},{key:"initCanvasMutationObserver",value:function(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=ct(e,t,r),o=function(e,t,r,n){var o,a=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=f(i);try{var u=function(){var i=o.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])return 1;var s=te(t.CanvasRenderingContext2D.prototype,i,(function(o){return function(){for(var a=this,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return oe(this.canvas,r,n,!0)||setTimeout((function(){var r=st([].concat(u),t,a);e(a.canvas,{type:ve["2D"],property:i,args:r})}),0),o.apply(this,u)}}));a.push(s)}catch(r){var u=ee(t.CanvasRenderingContext2D.prototype,i,{set:function(t){e(this.canvas,{type:ve["2D"],property:i,args:[t],setter:!0})}});a.push(u)}};for(s.s();!(o=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}return function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,r),a=function(e,t,r,n,o){var a=[];return a.push.apply(a,Y(lt(t.WebGLRenderingContext.prototype,ve.WebGL,e,r,n,0,t))),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,Y(lt(t.WebGL2RenderingContext.prototype,ve.WebGL2,e,r,n,0,t))),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,r,this.mirror);this.resetObservers=function(){n(),o(),a()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"startRAFTimestamping",value:function(){var e=this;requestAnimationFrame((function t(r){e.rafStamps.latestId=r,requestAnimationFrame(t)}))}},{key:"flushPendingCanvasMutations",value:function(){var e=this;this.pendingCanvasMutations.forEach((function(t,r){var n=e.mirror.getId(r);e.flushPendingCanvasMutationFor(r,n)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"flushPendingCanvasMutationFor",value:function(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((function(e){var t=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["type"]);return t})),o=r[0].type;this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),xt=function(){function e(t){V(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new de,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return J(e,[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){if(0!==e.length){var r,n={id:t,styleIds:[]},o=[],a=f(e);try{for(a.s();!(r=a.n()).done;){var i=r.value,s=void 0;if(this.styleMirror.has(i))s=this.styleMirror.getId(i);else{s=this.styleMirror.add(i);var u=Array.from(i.rules||CSSRule);o.push({styleId:s,rules:u.map((function(e,t){return{rule:v(e),index:t}}))})}n.styleIds.push(s)}}catch(e){a.e(e)}finally{a.f()}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}();function Et(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}var Tt=!1,Rt=new m;function Mt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,r=e.checkoutEveryNms,n=e.checkoutEveryNth,o=e.blockClass,a=void 0===o?"rr-block":o,i=e.blockSelector,s=void 0===i?null:i,u=e.ignoreClass,c=void 0===u?"rr-ignore":u,l=e.maskTextClass,d=void 0===l?"rr-mask":l,p=e.maskTextSelector,h=void 0===p?null:p,g=e.inlineStylesheet,v=void 0===g||g,m=e.maskAllInputs,y=e.maskInputOptions,w=e.slimDOMOptions,I=e.maskInputFn,b=e.maskTextFn,C=e.hooks,S=e.packFn,k=e.sampling,A=void 0===k?{}:k,x=e.dataURLOptions,E=void 0===x?{}:x,T=e.mousemoveWait,R=e.recordCanvas,M=void 0!==R&&R,O=e.recordCrossOriginIframes,L=void 0!==O&&O,N=e.userTriggeredOnInput,D=void 0!==N&&N,_=e.collectFonts,F=void 0!==_&&_,U=e.inlineImages,B=void 0!==U&&U,P=e.plugins,G=e.keepIframeSrcFn,K=void 0===G?function(){return!1}:G,j=e.ignoreCSSAttributes,Y=void 0===j?new Set([]):j,Z=!L||window.parent===window,V=!1;if(!Z)try{window.parent.document,V=!1}catch(e){V=!0}if(Z&&!t)throw new Error("emit function is required");void 0!==T&&void 0===A.mousemove&&(A.mousemove=T),Rt.reset();var H,J=!0===m?{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!==y?y:{password:!0},q=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};ue();var Q=0,X=function(e){var t,r=f(P||[]);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.eventProcessor&&(e=n.eventProcessor(e))}}catch(e){r.e(e)}finally{r.f()}return S&&(e=S(e)),e};bt=function(e,o){var a;if(!(null===(a=xe[0])||void 0===a?void 0:a.isFrozen())||e.type===pe.FullSnapshot||e.type===pe.IncrementalSnapshot&&e.data.source===he.Mutation||xe.forEach((function(e){return e.unfreeze()})),Z)null==t||t(X(e),o);else if(V){var i={type:"rrweb",event:X(e),isCheckout:o};window.parent.postMessage(i,"*")}if(e.type===pe.FullSnapshot)H=e,Q=0;else if(e.type===pe.IncrementalSnapshot){if(e.data.source===he.Mutation&&e.data.isAttachIframe)return;Q++;var s=n&&Q>=n,u=r&&e.timestamp-H.timestamp>r;(s||u)&&Ct(!0)}};var $,ee=function(e){bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.Mutation},e)}))},te=function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.Scroll},e)}))},oe=function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.CanvasMutation},e)}))},ae=function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.AdoptedStyleSheet},e)}))},ie=new xt({mutationCb:ee,adoptedStyleSheetCb:ae}),se=new Xe({mirror:Rt,mutationCb:ee,stylesheetManager:ie,recordCrossOriginIframes:L,wrappedEmit:bt}),de=f(P||[]);try{for(de.s();!($=de.n()).done;){var ge=$.value;ge.getMirror&&ge.getMirror({nodeMirror:Rt,crossOriginIframeMirror:se.crossOriginIframeMirror,crossOriginIframeStyleMirror:se.crossOriginIframeStyleMirror})}}catch(e){de.e(e)}finally{de.f()}St=new At({recordCanvas:M,mutationCb:oe,win:window,blockClass:a,blockSelector:s,mirror:Rt,sampling:A.canvas,dataURLOptions:E});var ve=new $e({mutationCb:ee,scrollCb:te,bypassOptions:{blockClass:a,blockSelector:s,maskTextClass:d,maskTextSelector:h,inlineStylesheet:v,maskInputOptions:J,dataURLOptions:E,maskTextFn:b,maskInputFn:I,recordCanvas:M,inlineImages:B,sampling:A,slimDOMOptions:q,iframeManager:se,stylesheetManager:ie,canvasManager:St,keepIframeSrcFn:K},mirror:Rt});Ct=function(){var e,t,r,n,o,i,u=arguments.length>0&&void 0!==arguments[0]&&arguments[0];bt(Et({type:pe.Meta,data:{href:window.location.href,width:ne(),height:re()}}),u),ie.reset(),xe.forEach((function(e){return e.lock()}));var c=W(document,{mirror:Rt,blockClass:a,blockSelector:s,maskTextClass:d,maskTextSelector:h,inlineStylesheet:v,maskAllInputs:J,maskTextFn:b,slimDOM:q,dataURLOptions:E,recordCanvas:M,inlineImages:B,onSerialize:function(e){ce(e,Rt)&&se.addIframe(e),le(e,Rt)&&ie.trackLinkElement(e),fe(e)&&ve.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){se.attachIframe(e,t),ve.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ie.attachLinkElement(e,t)},keepIframeSrcFn:K});if(!c)return console.warn("Failed to snapshot the document");bt(Et({type:pe.FullSnapshot,data:{node:c,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(t=null===(e=null===document||void 0===document?void 0:document.body)||void 0===e?void 0:e.parentElement)||void 0===t?void 0:t.scrollLeft)||(null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(o=null===(n=null===document||void 0===document?void 0:document.body)||void 0===n?void 0:n.parentElement)||void 0===o?void 0:o.scrollTop)||(null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.scrollTop)||0}}})),xe.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ie.adoptStyleSheets(document.adoptedStyleSheets,Rt.getId(document))};try{var me=[];me.push(z("DOMContentLoaded",(function(){bt(Et({type:pe.DomContentLoaded,data:{}}))})));var ye=function(e){var t;return ze({mutationCb:ee,mousemoveCb:function(e,t){return bt(Et({type:pe.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.MouseInteraction},e)}))},scrollCb:te,viewportResizeCb:function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.ViewportResize},e)}))},inputCb:function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.Input},e)}))},mediaInteractionCb:function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.StyleDeclaration},e)}))},canvasMutationCb:oe,fontCb:function(e){return bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.Font},e)}))},selectionCb:function(e){bt(Et({type:pe.IncrementalSnapshot,data:Object.assign({source:he.Selection},e)}))},blockClass:a,ignoreClass:c,maskTextClass:d,maskTextSelector:h,maskInputOptions:J,inlineStylesheet:v,sampling:A,recordCanvas:M,inlineImages:B,userTriggeredOnInput:D,collectFonts:F,doc:e,maskInputFn:I,maskTextFn:b,keepIframeSrcFn:K,blockSelector:s,slimDOMOptions:q,dataURLOptions:E,mirror:Rt,iframeManager:se,stylesheetManager:ie,shadowDomManager:ve,canvasManager:St,ignoreCSSAttributes:Y,plugins:(null===(t=null==P?void 0:P.filter((function(e){return e.observer})))||void 0===t?void 0:t.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return bt(Et({type:pe.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},C)};se.addLoadListener((function(e){me.push(ye(e.contentDocument))}));var we=function(){Ct(),me.push(ye(document)),Tt=!0};return"interactive"===document.readyState||"complete"===document.readyState?we():me.push(z("load",(function(){bt(Et({type:pe.Load,data:{}})),we()}),window)),function(){me.forEach((function(e){return e()})),Tt=!1}}catch(e){console.warn(e)}}Mt.addCustomEvent=function(e,t){if(!Tt)throw new Error("please add custom event after start recording");bt(Et({type:pe.Custom,data:{tag:e,payload:t}}))},Mt.freezePage=function(){xe.forEach((function(e){return e.freeze()}))},Mt.takeFullSnapshot=function(e){if(!Tt)throw new Error("please take full snapshot after start recording");Ct(e)},Mt.mirror=Rt;var Ot=Uint8Array,Lt=Uint16Array,Nt=Uint32Array,Dt=new Ot([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),_t=new Ot([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ft=new Ot([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ut=function(e,t){for(var r=new Lt(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var o=new Nt(r[30]);for(n=1;n<30;++n)for(var a=r[n];a<r[n+1];++a)o[a]=a-r[n]<<5|n;return[r,o]},Bt=Ut(Dt,2),Pt=Bt[0],Wt=Bt[1];Pt[28]=258,Wt[258]=28;for(var Gt=Ut(_t,0),Kt=(Gt[0],Gt[1]),jt=new Lt(32768),Yt=0;Yt<32768;++Yt){var Zt=(43690&Yt)>>>1|(21845&Yt)<<1;Zt=(61680&(Zt=(52428&Zt)>>>2|(13107&Zt)<<2))>>>4|(3855&Zt)<<4,jt[Yt]=((65280&Zt)>>>8|(255&Zt)<<8)>>>1}var Vt=function(e,t,r){for(var n=e.length,o=0,a=new Lt(t);o<n;++o)++a[e[o]-1];var i,s=new Lt(t);for(o=0;o<t;++o)s[o]=s[o-1]+a[o-1]<<1;if(r){i=new Lt(1<<t);var u=15-t;for(o=0;o<n;++o)if(e[o])for(var c=o<<4|e[o],l=t-e[o],f=s[e[o]-1]++<<l,d=f|(1<<l)-1;f<=d;++f)i[jt[f]>>>u]=c}else for(i=new Lt(n),o=0;o<n;++o)i[o]=jt[s[e[o]-1]++]>>>15-e[o];return i},Ht=new Ot(288);for(Yt=0;Yt<144;++Yt)Ht[Yt]=8;for(Yt=144;Yt<256;++Yt)Ht[Yt]=9;for(Yt=256;Yt<280;++Yt)Ht[Yt]=7;for(Yt=280;Yt<288;++Yt)Ht[Yt]=8;var Jt=new Ot(32);for(Yt=0;Yt<32;++Yt)Jt[Yt]=5;var qt=Vt(Ht,9,0),zt=Vt(Jt,5,0),Qt=function(e){return(e/8>>0)+(7&e&&1)},Xt=function(e,t,r){(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof Lt?Lt:e instanceof Nt?Nt:Ot)(r-t);return n.set(e.subarray(t,r)),n},$t=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},er=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},tr=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,a=r.slice();if(!o)return[new Ot(0),0];if(1==o){var i=new Ot(r[0].s+1);return i[r[0].s]=1,[i,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var s=r[0],u=r[1],c=0,l=1,f=2;for(r[0]={s:-1,f:s.f+u.f,l:s,r:u};l!=o-1;)s=r[r[c].f<r[f].f?c++:f++],u=r[c!=l&&r[c].f<r[f].f?c++:f++],r[l++]={s:-1,f:s.f+u.f,l:s,r:u};var d=a[0].s;for(n=1;n<o;++n)a[n].s>d&&(d=a[n].s);var p=new Lt(d+1),h=rr(r[l-1],p,0);if(h>t){n=0;var g=0,v=h-t,m=1<<v;for(a.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));n<o;++n){var y=a[n].s;if(!(p[y]>t))break;g+=m-(1<<h-p[y]),p[y]=t}for(g>>>=v;g>0;){var w=a[n].s;p[w]<t?g-=1<<t-p[w]++-1:++n}for(;n>=0&&g;--n){var I=a[n].s;p[I]==t&&(--p[I],++g)}h=t}return[new Ot(p),h]},rr=function e(t,r,n){return-1==t.s?Math.max(e(t.l,r,n+1),e(t.r,r,n+1)):r[t.s]=n},nr=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Lt(++t),n=0,o=e[0],a=1,i=function(e){r[n++]=e},s=1;s<=t;++s)if(e[s]==o&&s!=t)++a;else{if(!o&&a>2){for(;a>138;a-=138)i(32754);a>2&&(i(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(i(o),--a;a>6;a-=6)i(8304);a>2&&(i(a-3<<5|8208),a=0)}for(;a--;)i(o);a=1,o=e[s]}return[r.subarray(0,n),t]},or=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},ar=function(e,t,r){var n=r.length,o=Qt(t+2);e[o]=255&n,e[o+1]=n>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var a=0;a<n;++a)e[o+a+4]=r[a];return 8*(o+4+n)},ir=function(e,t,r,n,o,a,i,s,u,c,l){$t(t,l++,r),++o[256];for(var f=tr(o,15),d=f[0],p=f[1],h=tr(a,15),g=h[0],v=h[1],m=nr(d),y=m[0],w=m[1],I=nr(g),b=I[0],C=I[1],S=new Lt(19),k=0;k<y.length;++k)S[31&y[k]]++;for(k=0;k<b.length;++k)S[31&b[k]]++;for(var A=tr(S,7),x=A[0],E=A[1],T=19;T>4&&!x[Ft[T-1]];--T);var R,M,O,L,N=c+5<<3,D=or(o,Ht)+or(a,Jt)+i,_=or(o,d)+or(a,g)+i+14+3*T+or(S,x)+(2*S[16]+3*S[17]+7*S[18]);if(N<=D&&N<=_)return ar(t,l,e.subarray(u,u+c));if($t(t,l,1+(_<D)),l+=2,_<D){R=Vt(d,p,0),M=d,O=Vt(g,v,0),L=g;var F=Vt(x,E,0);$t(t,l,w-257),$t(t,l+5,C-1),$t(t,l+10,T-4),l+=14;for(k=0;k<T;++k)$t(t,l+3*k,x[Ft[k]]);l+=3*T;for(var U=[y,b],B=0;B<2;++B){var P=U[B];for(k=0;k<P.length;++k){var W=31&P[k];$t(t,l,F[W]),l+=x[W],W>15&&($t(t,l,P[k]>>>5&127),l+=P[k]>>>12)}}}else R=qt,M=Ht,O=zt,L=Jt;for(k=0;k<s;++k)if(n[k]>255){W=n[k]>>>18&31;er(t,l,R[W+257]),l+=M[W+257],W>7&&($t(t,l,n[k]>>>23&31),l+=Dt[W]);var G=31&n[k];er(t,l,O[G]),l+=L[G],G>3&&(er(t,l,n[k]>>>5&8191),l+=_t[G])}else er(t,l,R[n[k]]),l+=M[n[k]];return er(t,l,R[256]),l+M[256]},sr=new Nt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ur=new Ot(0),cr=function(e,t,r,n,o){return function(e,t,r,n,o,a){var i=e.length,s=new Ot(n+i+5*(1+Math.floor(i/7e3))+o),u=s.subarray(n,s.length-o),c=0;if(!t||i<8)for(var l=0;l<=i;l+=65535){var f=l+65535;f<i?c=ar(u,c,e.subarray(l,f)):(u[l]=a,c=ar(u,c,e.subarray(l,i)))}else{for(var d=sr[t-1],p=d>>>13,h=8191&d,g=(1<<r)-1,v=new Lt(32768),m=new Lt(g+1),y=Math.ceil(r/3),w=2*y,I=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<w)&g},b=new Nt(25e3),C=new Lt(288),S=new Lt(32),k=0,A=0,x=(l=0,0),E=0,T=0;l<i;++l){var R=I(l),M=32767&l,O=m[R];if(v[M]=O,m[R]=M,E<=l){var L=i-l;if((k>7e3||x>24576)&&L>423){c=ir(e,u,0,b,C,S,A,x,T,l-T,c),x=k=A=0,T=l;for(var N=0;N<286;++N)C[N]=0;for(N=0;N<30;++N)S[N]=0}var D=2,_=0,F=h,U=M-O&32767;if(L>2&&R==I(l-U))for(var B=Math.min(p,L)-1,P=Math.min(32767,l),W=Math.min(258,L);U<=P&&--F&&M!=O;){if(e[l+D]==e[l+D-U]){for(var G=0;G<W&&e[l+G]==e[l+G-U];++G);if(G>D){if(D=G,_=U,G>B)break;var K=Math.min(U,G-2),j=0;for(N=0;N<K;++N){var Y=l-U+N+32768&32767,Z=Y-v[Y]+32768&32767;Z>j&&(j=Z,O=Y)}}}U+=(M=O)-(O=v[M])+32768&32767}if(_){b[x++]=268435456|Wt[D]<<18|Kt[_];var V=31&Wt[D],H=31&Kt[_];A+=Dt[V]+_t[H],++C[257+V],++S[H],E=l+D,++k}else b[x++]=e[l],++C[e[l]]}}c=ir(e,u,a,b,C,S,A,x,T,l-T,c),a||(c=ar(u,c,ur))}return Xt(s,0,n+Qt(c)+o)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,r,n,!o)};function lr(e,t){void 0===t&&(t={});var r=function(){var e=1,t=0;return{p:function(r){for(var n=e,o=t,a=r.length,i=0;i!=a;){for(var s=Math.min(i+5552,a);i<s;++i)o+=n+=r[i];n%=65521,o%=65521}e=n,t=o},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+2*((255&e)<<23)}}}();r.p(e);var n=cr(e,t,2,4);return function(e,t){var r=t.level,n=0==r?0:r<6?1:9==r?3:2;e[0]=120,e[1]=n<<6|(n?32-2*n:1)}(n,t),function(e,t,r){for(;r;++t)e[t]=r,r>>>=8}(n,n.length-4,r.d()),n}var fr=function(e){var t=Object.assign(Object.assign({},e),{v:"v1"});return function(e,t){var r="";if(!t&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var n=0;n<e.length;){var o=e[n++];o<128||t?r+=String.fromCharCode(o):o<224?r+=String.fromCharCode((31&o)<<6|63&e[n++]):o<240?r+=String.fromCharCode((15&o)<<12|(63&e[n++])<<6|63&e[n++]):(o=((15&o)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}return r}(lr(function(e,t){var r=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Ot(e.length+(e.length>>>1)),o=0,a=function(e){n[o++]=e},i=0;i<r;++i){if(o+5>n.length){var s=new Ot(o+8+(r-i<<1));s.set(n),n=s}var u=e.charCodeAt(i);u<128||t?a(u):u<2048?(a(192|u>>>6),a(128|63&u)):u>55295&&u<57344?(a(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++i))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return Xt(n,0,o)}(JSON.stringify(t))),!0)},dr=Object.defineProperty,pr=function(e,t,r){return function(e,t,r){return t in e?dr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r}(e,"symbol"!==s(t)?t+"":t,r)};var hr=function(){function e(t){V(this,e),pr(this,"fileName"),pr(this,"functionName"),pr(this,"lineNumber"),pr(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return J(e,[{key:"toString",value:function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}]),e}(),gr=/(^|@)\S+:\d+/,vr=/^\s*at .*(\S+:\d+|\(native\))/m,mr=/^(eval@)?(\[native code])?$/,yr={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(vr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(vr)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(r?r[1]:n.pop()),a=n.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new hr({functionName:a,fileName:i,lineNumber:o[1],columnNumber:o[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(mr)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new hr({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,o=this.extractLocation(e.replace(t,""));return new hr({functionName:n,fileName:o[0],lineNumber:o[1],columnNumber:o[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],o=2,a=r.length;o<a;o+=2){var i=t.exec(r[o]);i&&n.push(new hr({fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],o=0,a=r.length;o<a;o+=2){var i=t.exec(r[o]);i&&n.push(new hr({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(gr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new hr({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function wr(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,o=[];if(n.children&&n.children.length>0)for(var a=0;a<n.children.length;a++){var i=n.children[a];i.localName&&i.localName.toLowerCase&&i.localName.toLowerCase()===r&&o.push(i)}o.length>1&&(r+=":eq(".concat(o.indexOf(e),")")),t=r+(t?">"+t:""),e=n}return t}function Ir(e){return"[object Object]"===Object.prototype.toString.call(e)}function br(e,t){if(0===t)return!0;for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];if(Ir(e[o])&&br(e[o],t-1))return!0}return!1}function Cr(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],o=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?o.splice(a,1/0,e):o.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Ir(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ir(e)&&br(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t="".concat(t.slice(0,r.stringLengthLimit),"..."));return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var i={};for(var s in t){var u=t[s];Array.isArray(u)?i[s]=wr(u.length?u[0]:null):i[s]=u}return i}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Sr={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function kr(e,t,r){var n,o=r?Object.assign({},Sr,r):Sr,a=o.logger;if(!a)return function(){};n="string"==typeof a?t[a]:a;var i=0,s=!1,u=[];if(o.level.includes("error")){var c=function(t){var r=t.message,n=t.error,a=yr.parse(n).map((function(e){return e.toString()})),i=[Cr(r,o.stringifyOptions)];e({level:"error",trace:a,payload:i})};t.addEventListener("error",c),u.push((function(){t.removeEventListener("error",c)}));var l=function(t){var r,n;t.reason instanceof Error?(r=t.reason,n=[Cr("Uncaught (in promise) ".concat(r.name,": ").concat(r.message),o.stringifyOptions)]):(r=new Error,n=[Cr("Uncaught (in promise)",o.stringifyOptions),Cr(t.reason,o.stringifyOptions)]);var a=yr.parse(r).map((function(e){return e.toString()}));e({level:"error",trace:a,payload:n})};t.addEventListener("unhandledrejection",l),u.push((function(){t.removeEventListener("unhandledrejection",l)}))}var d,p=f(o.level);try{for(p.s();!(d=p.n()).done;){var h=d.value;u.push(g(n,h))}}catch(e){p.e(e)}finally{p.f()}return function(){u.forEach((function(e){return e()}))};function g(t,r){var n=this;return t[r]?function(e,t,r){try{if(!(t in e))return function(){};var n=e[t],o=r(n);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,function(){e[t]=n}}catch(e){return function(){}}}(t,r,(function(t){return function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];if(t.apply(n,u),!("assert"===r&&u[0]||s)){s=!0;try{var l=yr.parse(new Error).map((function(e){return e.toString()})).splice(1),f="assert"===r?u.slice(1):u,d=f.map((function(e){return Cr(e,o.stringifyOptions)}));++i<o.lengthThreshold?e({level:r,trace:l,payload:d}):i===o.lengthThreshold&&e({level:"warn",trace:[],payload:[Cr("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(u))}finally{s=!1}}}})):function(){}}}var Ar=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},xr=function(){var e,t,r;if(localStorage.getItem("rlog-deviceId"))return localStorage.getItem("rlog-deviceId");var n=(null===(e=localStorage)||void 0===e?void 0:e.getItem("utoken"))||(null===(t=localStorage)||void 0===t?void 0:t.getItem("IWP-iwp-deivceTag"))||Ar();return null===(r=localStorage)||void 0===r||r.setItem("rlog-deviceId",n),n},Er=function(e){return null!==e&&"object"===u()(e)&&!Array.isArray(e)},Tr=function e(t,r){var n=l()({},t);for(var o in r)if(r.hasOwnProperty(o)){var a=r[o],i=t[o];Er(a)&&Er(i)?n[o]=e(i,a):void 0!==a&&(n[o]=a)}return n},Rr=r(295),Mr=r.n(Rr);function Or(e){for(var t,r,n,o,a="[Rlog]",i=arguments.length,s=new Array(i>1?i-1:0),u=1;u<i;u++)s[u-1]=arguments[u];switch(e){case"log":(t=console).log.apply(t,[a].concat(s));break;case"info":(r=console).info.apply(r,[a].concat(s));break;case"warn":(n=console).warn.apply(n,[a].concat(s));break;case"error":(o=console).error.apply(o,[a].concat(s))}}var Lr={log:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Or.apply(void 0,["log"].concat(t))},info:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Or.apply(void 0,["info"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Or.apply(void 0,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Or.apply(void 0,["error"].concat(t))}},Nr=Lr,Dr="logs",_r=function(){function e(){H()(this,e),Mr()(this,"db",null),Mr()(this,"isOpening",!1),Mr()(this,"openPromise",null),this.openDB().catch(Nr.error)}var t,r,n,a,s,u,c,l,f,d;return q()(e,[{key:"openDB",value:(d=i()(o()().mark((function e(){var t=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.db){e.next=2;break}return e.abrupt("return");case 2:if(!this.isOpening||!this.openPromise){e.next=4;break}return e.abrupt("return",this.openPromise);case 4:return this.isOpening=!0,this.openPromise=new Promise((function(e,r){var n=indexedDB.open("LogStorageDB",2);n.onupgradeneeded=function(e){var t=e.target.result;if(t.objectStoreNames.contains(Dr)){var r=e.target.transaction;if(r){var n=r.objectStore(Dr);n.indexNames.contains("lastModified")||n.createIndex("lastModified","lastModified",{unique:!1})}}else t.createObjectStore(Dr,{keyPath:"deviceId"}).createIndex("lastModified","lastModified",{unique:!1})},n.onsuccess=function(r){t.db=r.target.result,t.isOpening=!1,e()},n.onerror=function(e){t.isOpening=!1,r(e.target.error)},n.onblocked=function(){Nr.warn("IndexedDB is blocked, trying to close existing connections"),t.isOpening=!1,r(new Error("IndexedDB blocked"))}})),e.abrupt("return",this.openPromise);case 7:case"end":return e.stop()}}),e,this)}))),function(){return d.apply(this,arguments)})},{key:"ensureDB",value:(f=i()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.db){e.next=3;break}return e.next=3,this.openDB();case 3:if(this.db){e.next=5;break}throw new Error("Failed to open IndexedDB");case 5:return e.abrupt("return",this.db);case 6:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"withTransaction",value:(l=i()(o()().mark((function e(t,r){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureDB();case 2:return n=e.sent,e.abrupt("return",new Promise((function(e,o){var a,i=n.transaction([Dr],t),s=i.objectStore(Dr);i.onerror=function(){return o(i.error)},i.oncomplete=function(){setTimeout((function(){return e(a)}),0)},r(s).then((function(e){a=e}),o)})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"push",value:(c=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};i.data.push(r),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>1e4&&i.data.splice(0,i.data.length-1e4);var s=n.put(i);s.onsuccess=function(){return e()},s.onerror=function(){return o(s.error)}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"unshift",value:(u=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};i.data.unshift(r),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>1e4&&i.data.splice(0,i.data.length-1e4);var s=n.put(i);s.onsuccess=function(){return e()},s.onerror=function(){return o(s.error)}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"unshiftBatch",value:(s=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i,s=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};(i=s.data).unshift.apply(i,Z()(r)),s.lastModified=Date.now(),s.version=(s.version||1)+1,s.data.length>1e4&&s.data.splice(0,s.data.length-1e4);var u=n.put(s);u.onsuccess=function(){return e()},u.onerror=function(){return o(u.error)}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"pull",value:(a=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};if(0!==i.data.length){var s=Math.min(r,i.data.length),u=i.data.slice(0,s);if(i.data=i.data.slice(s),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>0){var c=n.put(i);c.onsuccess=function(){return e(u)},c.onerror=function(){return o(c.error)}}else{var l=n.delete(t);l.onsuccess=function(){return e(u)},l.onerror=function(){return o(l.error)}}}else e([])},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"clear",value:(n=i()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var o=r.delete(t);o.onsuccess=function(){return e()},o.onerror=function(){return n(o.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"pullByTimeRange",value:(r=i()(o()().mark((function e(t,r,n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readonly",function(){var e=i()(o()().mark((function e(a){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var i=a.get(t);i.onsuccess=function(){var o=(i.result||{deviceId:t,data:[],lastModified:Date.now(),version:1}).data.filter((function(e){return e.timestamp>=r&&e.timestamp<=n}));e(o)},i.onerror=function(){return o(i.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"removeByTimeRange",value:(t=i()(o()().mark((function e(t,r){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.withTransaction("readwrite",function(){var e=i()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,o){var a=n.get(t);a.onsuccess=function(){var i=a.result||{deviceId:t,data:[],lastModified:Date.now(),version:1};if(i.data=i.data.filter((function(e){return e.timestamp<r})),i.lastModified=Date.now(),i.version=(i.version||1)+1,i.data.length>0){var s=n.put(i);s.onsuccess=function(){return e()},s.onerror=function(){return o(s.error)}}else{var u=n.delete(t);u.onsuccess=function(){return e()},u.onerror=function(){return o(u.error)}}},a.onerror=function(){return o(a.error)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}(),Fr=function(){function e(){H()(this,e),Mr()(this,"storage",new Map),Mr()(this,"locks",new Map)}var t,r,n,a,s,u,c,l;return q()(e,[{key:"acquireLock",value:(l=i()(o()().mark((function e(t){var r,n,a,i=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t;case 1:if(!this.locks.has(r)){e.next=6;break}return e.next=4,this.locks.get(r);case 4:e.next=1;break;case 6:return a=new Promise((function(e){n=e})),this.locks.set(r,a),e.abrupt("return",(function(){i.locks.delete(r),n()}));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"push",value:(c=i()(o()().mark((function e(t,r){var n,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{this.storage.has(t)||this.storage.set(t,[]),(a=this.storage.get(t)).push(r),a.length>1e4&&a.splice(0,a.length-1e4)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"unshift",value:(u=i()(o()().mark((function e(t,r){var n,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{this.storage.has(t)||this.storage.set(t,[]),(a=this.storage.get(t)).unshift(r),a.length>1e4&&a.splice(0,a.length-1e4)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"unshiftBatch",value:(s=i()(o()().mark((function e(t,r){var n,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{this.storage.has(t)||this.storage.set(t,[]),(a=this.storage.get(t)).unshift.apply(a,Z()(r)),a.length>1e4&&a.splice(0,a.length-1e4)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"pull",value:(a=i()(o()().mark((function e(t,r){var n,a,i,s,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:if(n=e.sent,e.prev=3,0!==(a=this.storage.get(t)||[]).length){e.next=7;break}return e.abrupt("return",[]);case 7:return i=Math.min(r,a.length),s=a.slice(0,i),(u=a.slice(i)).length>0?this.storage.set(t,u):this.storage.delete(t),e.abrupt("return",s);case 12:return e.prev=12,n(),e.finish(12);case 15:case"end":return e.stop()}}),e,this,[[3,,12,15]])}))),function(e,t){return a.apply(this,arguments)})},{key:"clear",value:(n=i()(o()().mark((function e(t){var r;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:r=e.sent;try{this.storage.delete(t)}finally{r()}case 4:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"pullByTimeRange",value:(r=i()(o()().mark((function e(t,r,n){var a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:return a=e.sent,e.prev=3,i=this.storage.get(t)||[],e.abrupt("return",i.filter((function(e){return e.timestamp>=r&&e.timestamp<=n})));case 6:return e.prev=6,a(),e.finish(6);case 9:case"end":return e.stop()}}),e,this,[[3,,6,9]])}))),function(e,t,n){return r.apply(this,arguments)})},{key:"removeByTimeRange",value:(t=i()(o()().mark((function e(t,r){var n,a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.acquireLock(t);case 2:n=e.sent;try{a=this.storage.get(t)||[],(i=a.filter((function(e){return e.timestamp<r}))).length>0?this.storage.set(t,i):this.storage.delete(t)}finally{n()}case 4:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();Mr()(Fr,"instance",void 0);var Ur=function(){function e(){H()(this,e)}var t,r,n,a,s,u,c,l,f;return q()(e,[{key:"acquireLock",value:(f=i()(o()().mark((function t(r){var n,a,i,s,u,c;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n="".concat(e.LOCK_KEY_PREFIX).concat(r),a="".concat(Date.now(),"_").concat(Math.random()),t.prev=2,!(i=localStorage.getItem(n))){t.next=8;break}if(s=i.split("_"),u=j()(s,1),c=u[0],!(Date.now()-parseInt(c)<e.LOCK_TIMEOUT)){t.next=8;break}return t.abrupt("return",!1);case 8:if(localStorage.setItem(n,a),localStorage.getItem(n)!==a){t.next=12;break}return t.abrupt("return",!0);case 12:return t.abrupt("return",!1);case 15:return t.prev=15,t.t0=t.catch(2),Nr.warn("Failed to acquire lock",t.t0),t.abrupt("return",!1);case 19:case"end":return t.stop()}}),t,null,[[2,15]])}))),function(e){return f.apply(this,arguments)})},{key:"releaseLock",value:function(t){var r="".concat(e.LOCK_KEY_PREFIX).concat(t);try{localStorage.removeItem(r)}catch(e){Nr.warn("Failed to release lock",e)}}},{key:"withLock",value:(l=i()(o()().mark((function t(r,n){var a,i;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=0;case 1:if(!(a<e.MAX_RETRIES)){t.next=18;break}return t.next=4,this.acquireLock(r);case 4:if(!t.sent){t.next=13;break}return t.prev=5,t.next=8,n();case 8:return i=t.sent,t.abrupt("return",i);case 10:return t.prev=10,this.releaseLock(r),t.finish(10);case 13:return a++,t.next=16,new Promise((function(t){return setTimeout(t,e.RETRY_DELAY)}));case 16:t.next=1;break;case 18:throw new Error("Failed to acquire lock after maximum retries");case 19:case"end":return t.stop()}}),t,this,[[5,,10,13]])}))),function(e,t){return l.apply(this,arguments)})},{key:"getStorageKey",value:function(t){return"".concat(e.STORAGE_KEY_PREFIX).concat(t)}},{key:"push",value:(c=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),(s=i?JSON.parse(i):[]).push(r),s.length>1e4&&s.splice(0,s.length-1e4),localStorage.setItem(a,JSON.stringify(s));case 6:case"end":return e.stop()}}),e)}))));case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),Nr.warn("LocalStorage不可用,将使用内存缓存"),e.abrupt("return",Fr.getInstance().push(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,t){return c.apply(this,arguments)})},{key:"unshift",value:(u=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),(s=i?JSON.parse(i):[]).unshift(r),s.length>1e4&&s.splice(0,s.length-1e4),localStorage.setItem(a,JSON.stringify(s));case 6:case"end":return e.stop()}}),e)}))));case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),Nr.warn("LocalStorage不可用,将使用内存缓存"),e.abrupt("return",Fr.getInstance().unshift(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,t){return u.apply(this,arguments)})},{key:"unshiftBatch",value:(s=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),(s=i?JSON.parse(i):[]).unshift.apply(s,Z()(r)),s.length>1e4&&s.splice(0,s.length-1e4),localStorage.setItem(a,JSON.stringify(s));case 6:case"end":return e.stop()}}),e)}))));case 3:e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(0),Nr.warn("LocalStorage不可用,将使用内存缓存"),e.abrupt("return",Fr.getInstance().unshiftBatch(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,t){return s.apply(this,arguments)})},{key:"pull",value:(a=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s,u,c,l;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.getStorageKey(t),i=localStorage.getItem(a),0!==(s=i?JSON.parse(i):[]).length){e.next=5;break}return e.abrupt("return",[]);case 5:return u=Math.min(r,s.length),c=s.slice(0,u),(l=s.slice(u)).length>0?localStorage.setItem(a,JSON.stringify(l)):localStorage.removeItem(a),e.abrupt("return",c);case 10:case"end":return e.stop()}}),e)}))));case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Fr.getInstance().pull(t,r));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e,t){return a.apply(this,arguments)})},{key:"clear",value:(n=i()(o()().mark((function e(t){var r=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r.getStorageKey(t),localStorage.removeItem(n);case 2:case"end":return e.stop()}}),e)}))));case 3:e.next=8;break;case 5:return e.prev=5,e.t0=e.catch(0),e.abrupt("return",Fr.getInstance().clear(t));case 8:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return n.apply(this,arguments)})},{key:"pullByTimeRange",value:(r=i()(o()().mark((function e(t,r,n){var a=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var i,s,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=a.getStorageKey(t),s=localStorage.getItem(i),u=s?JSON.parse(s):[],e.abrupt("return",u.filter((function(e){return e.timestamp>=r&&e.timestamp<=n})));case 4:case"end":return e.stop()}}),e)}))));case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Fr.getInstance().pullByTimeRange(t,r,n));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e,t,n){return r.apply(this,arguments)})},{key:"removeByTimeRange",value:(t=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.withLock(t,i()(o()().mark((function e(){var a,i,s,u;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=n.getStorageKey(t),i=localStorage.getItem(a),s=i?JSON.parse(i):[],(u=s.filter((function(e){return e.timestamp<r}))).length>0?localStorage.setItem(a,JSON.stringify(u)):localStorage.removeItem(a);case 5:case"end":return e.stop()}}),e)}))));case 3:e.next=8;break;case 5:return e.prev=5,e.t0=e.catch(0),e.abrupt("return",Fr.getInstance().removeByTimeRange(t,r));case 8:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e,r){return t.apply(this,arguments)})}]),e}();Mr()(Ur,"LOCK_KEY_PREFIX","rlog_lock_"),Mr()(Ur,"STORAGE_KEY_PREFIX","rlog_data_"),Mr()(Ur,"LOCK_TIMEOUT",5e3),Mr()(Ur,"RETRY_DELAY",10),Mr()(Ur,"MAX_RETRIES",50);var Br=function(){function e(){H()(this,e),Mr()(this,"adapter",void 0),Mr()(this,"operationQueue",new Map),this.adapter=this.selectAdapter()}var t,r,n,a,s,u,c,l,f;return q()(e,[{key:"selectAdapter",value:function(){if("undefined"!=typeof window&&window.localStorage)try{var e="__rlog_storage_test__";return window.localStorage.setItem(e,"test"),window.localStorage.removeItem(e),new Ur}catch(e){Nr.warn("LocalStorage不可用,降级使用内存缓存")}return Fr.getInstance()}},{key:"serialize",value:(f=i()(o()().mark((function e(t,r){var n,a,i,s=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t,a=this.operationQueue.get(n)||Promise.resolve(),i=a.then((function(){return r()})).catch((function(e){throw Nr.error("Storage operation failed:",e),e})).finally((function(){s.operationQueue.get(n)===i&&s.operationQueue.delete(n)})),this.operationQueue.set(n,i),e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"push",value:(l=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.push(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"unshift",value:(c=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.unshift(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"unshiftBatch",value:(u=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.unshiftBatch(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"pull",value:(s=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.pull(t,r)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"clear",value:(a=i()(o()().mark((function e(t){var r=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return r.adapter.clear?r.adapter.clear(t):(Nr.warn("Storage adapter does not support clear operation"),Promise.resolve())})));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"pullByTimeRange",value:(n=i()(o()().mark((function e(t,r,n){var a=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return a.adapter.pullByTimeRange?a.adapter.pullByTimeRange(t,r,n):(Nr.warn("Storage adapter does not support pullByTimeRange operation"),Promise.resolve([]))})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"removeByTimeRange",value:(r=i()(o()().mark((function e(t,r){var n=this;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.serialize(t,(function(){return n.adapter.removeByTimeRange?n.adapter.removeByTimeRange(t,r):(Nr.warn("Storage adapter does not support removeByTimeRange operation"),Promise.resolve())})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getAdapterType",value:function(){return this.adapter instanceof _r?"IndexedDB":this.adapter instanceof Ur?"LocalStorage":this.adapter instanceof Fr?"Memory":"Unknown"}},{key:"getStorageState",value:(t=i()(o()().mark((function e(t){var r,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getAdapterType(),e.prev=1,e.next=4,this.pull(t,1e4);case 4:if(!((n=e.sent).length>0)){e.next=8;break}return e.next=8,this.unshiftBatch(t,n);case 8:return e.abrupt("return",{adapterType:r,eventCount:n.length});case 11:return e.prev=11,e.t0=e.catch(1),e.abrupt("return",{adapterType:r,eventCount:-1});case 14:case"end":return e.stop()}}),e,this,[[1,11]])}))),function(e){return t.apply(this,arguments)})}]),e}(),Pr=new Br;function Wr(e){return Gr.apply(this,arguments)}function Gr(){return Gr=i()(o()().mark((function e(t){var r,n=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",new Promise((function(e,n){var o=r.method,a=void 0===o?"GET":o,i=r.headers,s=void 0===i?{}:i,c=r.body,l=r.timeout,f=void 0===l?1e4:l,d=new XMLHttpRequest;d.timeout=f,d.onreadystatechange=function(){if(4===d.readyState){var t={ok:d.status>=200&&d.status<300,status:d.status,statusText:d.statusText,data:null,json:function(){return Promise.resolve(JSON.parse(d.responseText))},text:function(){return Promise.resolve(d.responseText)}};try{t.data=JSON.parse(d.responseText)}catch(e){t.data=d.responseText}t.ok?e(t):n(new Error("HTTP ".concat(d.status,": ").concat(d.statusText)))}},d.onerror=function(){n(new Error("Network error"))},d.ontimeout=function(){n(new Error("Request timeout"))},d.open(a,t,!0),Object.keys(s).forEach((function(e){d.setRequestHeader(e,s[e])})),c instanceof FormData?d.send(c):"object"===u()(c)?(d.setRequestHeader("Content-Type","application/json"),d.send(JSON.stringify(c))):d.send(c||null)})));case 2:case"end":return e.stop()}}),e)}))),Gr.apply(this,arguments)}function Kr(e){return jr.apply(this,arguments)}function jr(){return jr=i()(o()().mark((function e(t){var r,n=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:{},e.abrupt("return",Wr(t,l()(l()({},r),{},{method:"GET"})));case 2:case"end":return e.stop()}}),e)}))),jr.apply(this,arguments)}function Yr(e,t){return Zr.apply(this,arguments)}function Zr(){return Zr=i()(o()().mark((function e(t,r){var n,a=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:{},e.abrupt("return",Wr(t,l()(l()({},n),{},{method:"POST",body:r})));case 2:case"end":return e.stop()}}),e)}))),Zr.apply(this,arguments)}var Vr={enable:!0,uploadInterval:2e3,configUpdateInterval:3e5,console:{enable:!1,level:["log","warn","error","info"]},http:!1,consumeOnly:!1,maxRetryCount:3,checkoutEveryNms:5e3,ignoreClass:"rr-ignore",blockClass:"rr-block",maskTextClass:"rr-mask",sampling:{canvas:15,mousemove:50,scroll:100,input:"last"},packEvents:!1,clearStorageBeforeRecord:!0,error:!1,captureMode:"full",errorCapture:{beforeDuration:3e4,afterDuration:3e4,httpErrorThreshold:400},routerMonitor:{enable:!1,trackHashChange:!0,trackHistoryChange:!0,trackPageStayTime:!0,ignoreRoutes:[]}},Hr=l()({},Vr);function Jr(e){return qr.apply(this,arguments)}function qr(){return qr=i()(o()().mark((function e(t){var r,n,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=kn(),e.next=4,Kr(t,{headers:r});case 4:if((n=e.sent).ok){e.next=7;break}throw new Error("Failed to fetch config: ".concat(n.status));case 7:if(a={},n.data)if("object"!==u()(n.data)||n.data.data){if("object"===u()(n.data.data))a=n.data.data;else if("string"==typeof n.data.data)try{a=JSON.parse(n.data.data)}catch(e){Nr.warn("Failed to parse config JSON string",e)}}else a=n.data;return e.abrupt("return",Tr(Vr,a));case 12:return e.prev=12,e.t0=e.catch(0),Nr.warn("Failed to fetch config from CDN, using default config",e.t0),e.abrupt("return",l()({},Vr));case 16:case"end":return e.stop()}}),e,null,[[0,12]])}))),qr.apply(this,arguments)}function zr(e){Hr=Tr(Hr,e)}function Qr(){return l()({},Hr)}function Xr(){return(Xr=i()(o()().mark((function e(t){var r,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=8;break}return In([t]),e.next=4,Jr(t);case 4:zr(r=e.sent),(n=r.configUpdateInterval||Vr.configUpdateInterval)&&setInterval(i()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Jr(t);case 3:zr(e.sent),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),Nr.warn("Failed to update config from CDN",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),n);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var $r=null;function en(e){$r=e}var tn=["arms","log","marmot-cloud.com","alipayobjects.com","renderpre.alipay.com","nemo-office.alipay.com","render.alipay.com"],rn=["r.png","dwcookieLogGet.do","track","spm","logstores","render",".json",".js",".css",".wasm",".png",".jpg",".jpeg",".weapp",".data"],nn=[],on={},an=[],sn=null,un=["sky_trace_id","antbank-traceid"];function cn(e){try{if(e.startsWith("http://")||e.startsWith("https://"))return e;if(e.startsWith("/"))return window.location.origin+e;var t=window.location.href,r=t.lastIndexOf("/");return t.substring(0,r+1)+e}catch(t){return e}}function ln(e){return!function(e,t){try{var r=cn(e),n=new URL(r),o=n.pathname,a=n.hostname;return!(!tn.some((function(e){return a.includes(e)}))&&!rn.some((function(e){return o.includes(e)})))||t.some((function(e){return!!r.includes(e)||!!a.includes(e)||!!o.includes(e)||(e.startsWith(".")?o.toLowerCase().endsWith(e.toLowerCase()):!(!e.startsWith("/")||!o.startsWith(e)))}))}catch(e){return!1}}(e,an)&&(0!==nn.length&&function(e,t){try{var r=cn(e);return t.some((function(e){return e.startsWith("/")?new URL(r).pathname.startsWith(e):r.startsWith(e)}))}catch(e){return!1}}(e,nn))}function fn(){try{Mt.addCustomEvent("network-status",{type:"NETWORK_ONLINE",timestamp:Date.now()})}catch(e){Nr.warn("Failed to add NETWORK_ONLINE event (recording may have stopped)",e)}}function dn(){try{Mt.addCustomEvent("network-status",{type:"NETWORK_OFFLINE",timestamp:Date.now()})}catch(e){Nr.warn("Failed to add NETWORK_OFFLINE event (recording may have stopped)",e)}}var pn=XMLHttpRequest.prototype.open,hn=XMLHttpRequest.prototype.send,gn=window.fetch,vn=!1;function mn(){pn&&(XMLHttpRequest.prototype.open=pn),hn&&(XMLHttpRequest.prototype.send=hn),gn&&(window.fetch=gn),window.removeEventListener("online",fn),window.removeEventListener("offline",dn),vn=!1,Nr.log("Network monitoring restored")}function yn(e){if(e&&e.length>0){var t=nn.concat(e),r=Array.from(new Set(t));nn.splice.apply(nn,[0,nn.length].concat(r))}}function wn(){return[].concat(nn)}function In(e){if(e&&e.length>0){var t=an.concat(e),r=Array.from(new Set(t));an.splice.apply(an,[0,an.length].concat(r))}}function bn(){return[].concat(an)}function Cn(){return sn}function Sn(e){Object.assign(on,e)}function kn(){return l()({},on)}var An=null,xn=function(){An&&(An(),An=null)},En=function(){var e=Qr();if(e.enable){var t=xr();e.clearStorageBeforeRecord&&Pr.clear(t).then((function(){Nr.log("Storage cleared before recording")})).catch((function(e){Nr.warn("Failed to clear storage before recording",e)}));var r,n=[];if(e.console&&e.console.enable){var a,s,u,c,f,d=l()(l()({level:e.console.level||["info","log","warn","error"]},e.console.lengthThreshold&&{lengthThreshold:e.console.lengthThreshold}),{},{stringifyOptions:l()({numOfKeysLimit:null!==(a=null===(s=e.console.stringifyOptions)||void 0===s?void 0:s.numOfKeysLimit)&&void 0!==a?a:50,depthOfLimit:null!==(u=null===(c=e.console.stringifyOptions)||void 0===c?void 0:c.depthOfLimit)&&void 0!==u?u:4},(null===(f=e.console.stringifyOptions)||void 0===f?void 0:f.stringLengthLimit)&&{stringLengthLimit:e.console.stringifyOptions.stringLengthLimit})});n.push({name:"rrweb/console@1",observer:kr,options:d})}else Nr.log("Console recording is disabled by config");An=Mt({emit:function(e){Pr.push(t,e)},recordCanvas:!0,sampling:e.sampling,checkoutEveryNms:e.checkoutEveryNms,ignoreClass:e.ignoreClass,blockClass:e.blockClass,maskTextClass:e.maskTextClass,dataURLOptions:{type:"image/webp",quality:.6},collectFonts:!0,recordCrossOriginIframes:!0,plugins:[].concat(n),packFn:e.packEvents?fr:void 0}),Sn({"rlog-deviceId":t}),yn(["http://alipay-rmsdeploy-image.cn-hangzhou.alipay.aliyun-inc.com"]),e.http?(r=Mt,vn?Nr.warn("Network monitoring is already active"):(Nr.log("Network monitoring is active"),vn=!0,XMLHttpRequest.prototype.open=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return this._rlogRequest={method:e,url:t.toString(),startTime:0,endTime:0},pn.apply(this,[e,t,r,n,o])},XMLHttpRequest.prototype.send=function(e){var t=this,n=this._rlogRequest;return n.startTime=Date.now(),n.method,ln(n.url)&&Object.entries(on).forEach((function(e){var r=j()(e,2),n=r[0],o=r[1];t.setRequestHeader(n,o)})),this.addEventListener("load",(function(){var e=this;if(n.endTime=Date.now(),ln(n.url)){var t={};un.forEach((function(r){try{var n=e.getResponseHeader(r);n&&(t[r]=n)}catch(e){Nr.warn("无法获取响应头 ".concat(r),e)}}));try{r.addCustomEvent("http-success",l()(l()({},n),{},{dur:n.endTime-n.startTime,responseHeaders:t,pagePath:window.location.href}))}catch(e){Nr.warn("Failed to add custom event (recording may have stopped)",e)}}if($r){var o,a,i=null!==(o=null===(a=Qr().errorCapture)||void 0===a?void 0:a.httpErrorThreshold)&&void 0!==o?o:400;this.status>=i&&$r.onError({type:"http",message:"XHR ".concat(n.method," ").concat(n.url," responded with status ").concat(this.status),timestamp:Date.now(),detail:{url:n.url,method:n.method,status:this.status}})}})),this.addEventListener("error",(function(){try{r.addCustomEvent("http-error",l()(l()({},n),{},{dur:n.endTime-n.startTime,pagePath:window.location.href}))}catch(e){Nr.warn("Failed to add custom event (recording may have stopped)",e)}$r&&$r.onError({type:"http",message:"XHR ".concat(n.method," ").concat(n.url," network error"),timestamp:Date.now(),detail:{url:n.url,method:n.method}})})),hn.apply(this,[e])},window.fetch=function(){var e=i()(o()().mark((function e(t,n){var a,i,s,u,c,f,d,p,h,g,v;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=t instanceof Request?t.url:t.toString(),i=(null==n?void 0:n.method)||(t instanceof Request?t.method:"GET").toUpperCase(),s=Date.now(),e.prev=3,u=l()({},n),ln(a)&&Object.keys(on).length>0&&(u.headers=l()(l()({},(null==n?void 0:n.headers)||{}),on)),e.next=8,gn(t,u);case 8:if(c=e.sent,f=Date.now(),ln(a)){Nr.log("[Fetch] ".concat(i," ").concat(a," - ").concat(f-s,"ms")),d={},un.forEach((function(e){try{var t=c.headers.get(e);t&&(d[e]=t)}catch(t){Nr.warn("无法获取响应头 ".concat(e),t)}}));try{r.addCustomEvent("http-success",{url:a,method:i,dur:f-s,responseHeaders:d,pagePath:window.location.href})}catch(e){Nr.warn("Failed to add custom event (recording may have stopped)",e)}}return $r&&(g=Qr(),v=null!==(p=null===(h=g.errorCapture)||void 0===h?void 0:h.httpErrorThreshold)&&void 0!==p?p:400,c.status>=v&&$r.onError({type:"http",message:"Fetch ".concat(i," ").concat(a," responded with status ").concat(c.status),timestamp:Date.now(),detail:{url:a,method:i,status:c.status}})),e.abrupt("return",c);case 15:e.prev=15,e.t0=e.catch(3),Nr.error("[Fetch Error] ".concat(i," ").concat(a),e.t0);try{r.addCustomEvent("http-error",{url:a,method:i,pagePath:window.location.href})}catch(e){Nr.warn("Failed to add custom event (recording may have stopped)",e)}throw $r&&$r.onError({type:"http",message:"Fetch ".concat(i," ").concat(a," network error"),timestamp:Date.now(),detail:{url:a,method:i,error:String(e.t0)}}),e.t0;case 21:case"end":return e.stop()}}),e,null,[[3,15]])})));return function(t,r){return e.apply(this,arguments)}}(),window.addEventListener("online",fn),window.addEventListener("offline",dn))):Nr.log("HTTP recording is disabled by config")}else Nr.log("Recording is disabled by config")};function Tn(e){var t,r,n,o;n=Qr().urlParamsToCache||["taskId"],o=new URLSearchParams(window.location.search),n.forEach((function(e){var t=o.get(e);t&&sessionStorage.setItem("rlog-".concat(e),t)}));var a=e.data&&e.data.length>0?e.data.length-1:-1,i={deviceId:e.deviceId,appId:e.appId,startTime:null===(t=e.data)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.timestamp,endTime:null===(r=e.data)||void 0===r||null===(r=r[a])||void 0===r?void 0:r.timestamp};return(Qr().urlParamsToCache||["taskId"]).forEach((function(e){var t=function(e){return sessionStorage.getItem("rlog-".concat(e))}(e);t&&(i[e]=t)})),i}var Rn=function(){var e=i()(o()().mark((function e(t){var r,n,a,i,s,c,l,f;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Tn({appId:t.appId,deviceId:t.deviceId,data:t.data}),n=new URLSearchParams(r),a="".concat(t.url).concat(n?"?".concat(n):""),(i=new FormData).append("file",new Blob([JSON.stringify(t.data)]),Ar()+".json"),s=kn(),e.next=8,Yr(a,i,{headers:s});case 8:c=e.sent,e.prev=9,l="string"==typeof c.data?JSON.parse(c.data):c.data,e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(9),e.abrupt("return");case 16:if(!l||"object"!==u()(l)||!1!==l.success){e.next=20;break}throw(f=new Error(l.errorMessage||"Upload failed with success=false")).responseData=l,f;case 20:case"end":return e.stop()}}),e,null,[[9,13]])})));return function(t){return e.apply(this,arguments)}}();var Mn=null,On=!1,Ln=!1,Nn="",Dn=!1,_n=0,Fn=!1,Un=0,Bn=null,Pn=null;function Wn(){return"batch_".concat(Date.now(),"_").concat(++Un)}function Gn(e){var t=e.data;if(t&&t.type)switch(Nr.log("Received Worker message:",t.type),t.type){case"READY":On=!0,Bn&&(clearTimeout(Bn),Bn=null),Nr.log("Upload Worker is ready, workerReady state:",On,"isWorkerMode:",Ln);break;case"REQUEST_BATCH":!function(){Kn.apply(this,arguments)}();break;case"UPLOAD_SUCCESS":!function(e){Yn.apply(this,arguments)}(t.batchId);break;case"UPLOAD_FAILURE":!function(e,t,r){Zn.apply(this,arguments)}(t.batchId,t.error,t.failureCount);break;case"MAX_RETRY_REACHED":!function(e,t){Vn.apply(this,arguments)}(t.batchId,t.error)}else Nr.warn("Received invalid Worker message:",t)}function Kn(){return Kn=i()(o()().mark((function e(){var t,r,n,a,i,s,u,c;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Fn){e.next=2;break}return e.abrupt("return");case 2:if((t=Qr()).enable){e.next=6;break}return Nr.log("SDK is disabled by config, skipping batch request"),e.abrupt("return");case 6:if(!(r="error"===t.captureMode)||Dn){e.next=9;break}return e.abrupt("return");case 9:if(e.prev=9,Fn=!0,a=0,!r){e.next=20;break}return a=_n>0?_n:Date.now(),e.next=16,Pr.pullByTimeRange(xr(),a,Date.now());case 16:n=e.sent,_n=0,e.next=23;break;case 20:return e.next=22,Pr.pull(xr(),100);case 22:n=e.sent;case 23:if(n&&0!==n.length){e.next=26;break}return Fn=!1,e.abrupt("return");case 26:if(i=Qr(),!("YES"===sessionStorage.getItem("RLOG_CONSUME_ONLY")||i.consumeOnly)){e.next=32;break}return Nr.log("Consume only mode, skip upload"),Fn=!1,e.abrupt("return");case 32:s=Tn({appId:Nn,deviceId:xr(),data:n}),u=kn(),c=Wn(),jn.set(c,{events:n,isErrorMode:r,windowStart:a}),Hn({type:"UPLOAD_BATCH",batchId:c,events:n,queryParams:s,customHeaders:u}),Fn=!1,e.next=44;break;case 40:e.prev=40,e.t0=e.catch(9),Fn=!1,Nr.error("Error fetching batch for Worker:",e.t0);case 44:case"end":return e.stop()}}),e,null,[[9,40]])}))),Kn.apply(this,arguments)}var jn=new Map;function Yn(){return(Yn=i()(o()().mark((function e(t){var r,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=jn.get(t)){e.next=3;break}return e.abrupt("return");case 3:if(jn.delete(t),!(r.isErrorMode&&r.windowStart>0&&r.events.length>0)){e.next=9;break}return e.next=7,Pr.removeByTimeRange(xr(),r.windowStart);case 7:(n=r.events[r.events.length-1])&&n.timestamp&&(_n=n.timestamp);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Zn(){return(Zn=i()(o()().mark((function e(t,r,n){var a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=jn.get(t)){e.next=3;break}return e.abrupt("return");case 3:return jn.delete(t),Nr.warn("Upload failed ".concat(n," time(s), will retry in next cycle:"),r),e.next=7,Pr.unshiftBatch(xr(),a.events);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Vn(){return(Vn=i()(o()().mark((function e(t,r){var n,a,i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=jn.get(t)){e.next=3;break}return e.abrupt("return");case 3:return jn.delete(t),a=Qr(),i=a.maxRetryCount||3,Nr.warn("Upload failed ".concat(i," times consecutively, stopping upload")),e.next=9,Pr.unshiftBatch(xr(),n.events);case 9:s=new CustomEvent("rlog-upload-failure",{detail:{error:r,retryCount:i,appId:Nn,deviceId:xr()}}),"undefined"!=typeof window&&window.dispatchEvent(s);try{Mt.addCustomEvent("rlog-upload-failure",{error:r,retryCount:i,appId:Nn,deviceId:xr(),timestamp:Date.now()})}catch(e){Nr.warn("Failed to record upload failure event via addCustomEvent:",e)}Qn(),setTimeout((function(){Yo()}),0),Nr.error("Upload and recording stopped due to repeated failures");case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Hn(e){Mn&&On?(Nr.log("Sending command to Worker:",e.type),Mn.postMessage(e)):Nr.warn("Cannot send to Worker - worker:",!!Mn,"workerReady:",On,"command:",e.type)}function Jn(e){Nr.error("Upload Worker error:",e.message),Qn(!0)}function qn(e){Pn=e}function zn(e,t){e,Nn=t;var r=function(){try{if("undefined"==typeof Worker)return null;var e=new Blob(["\n'use strict';\n\n// ===== Worker 内部状态 =====\nvar config = null;\nvar pollTimer = null;\nvar isRunning = false;\nvar errorModeUploading = false;\nvar failureCountMap = {};\n\n// ===== UUID 生成 =====\nfunction generateUUID() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (Math.random() * 16) | 0;\n var v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n\n// ===== 构建上传 URL =====\nfunction buildUploadUrl(serv, queryParams) {\n var params = [];\n for (var key in queryParams) {\n if (queryParams.hasOwnProperty(key) && queryParams[key] != null && queryParams[key] !== '') {\n params.push(encodeURIComponent(key) + '=' + encodeURIComponent(queryParams[key]));\n }\n }\n var queryString = params.join('&');\n return serv + (queryString ? '?' + queryString : '');\n}\n\n// ===== 执行上传 =====\nfunction performUpload(msg) {\n var batchId = msg.batchId;\n var events = msg.events;\n var queryParams = msg.queryParams;\n var customHeaders = msg.customHeaders;\n\n try {\n // JSON 序列化在 Worker 中执行,不阻塞主线程\n var jsonStr = JSON.stringify(events);\n var blob = new Blob([jsonStr], { type: 'application/json' });\n var formData = new FormData();\n formData.append('file', blob, generateUUID() + '.json');\n\n var url = buildUploadUrl(config ? config.serv : '', queryParams);\n\n var xhr = new XMLHttpRequest();\n xhr.open('POST', url, true);\n xhr.timeout = 10000;\n\n // 设置自定义请求头\n if (customHeaders) {\n for (var key in customHeaders) {\n if (customHeaders.hasOwnProperty(key)) {\n xhr.setRequestHeader(key, customHeaders[key]);\n }\n }\n }\n\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status >= 200 && xhr.status < 300) {\n // 检查业务层 success 字段\n var uploadSuccess = true;\n var errorMessage = '';\n try {\n var responseData = JSON.parse(xhr.responseText);\n if (responseData && typeof responseData === 'object' && responseData.success === false) {\n uploadSuccess = false;\n errorMessage = responseData.errorMessage || 'Upload failed with success=false';\n }\n } catch(e) {\n // 无法解析 JSON,视为成功\n }\n\n if (uploadSuccess) {\n // 上传成功,重置失败计数\n var batchKey = config ? (config.appId + '_' + config.deviceId) : batchId;\n delete failureCountMap[batchKey];\n self.postMessage({ type: 'UPLOAD_SUCCESS', batchId: batchId });\n } else {\n handleFailure(batchId, errorMessage);\n }\n } else {\n handleFailure(batchId, 'HTTP ' + xhr.status + ': ' + xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function() {\n handleFailure(batchId, 'Network error');\n };\n\n xhr.ontimeout = function() {\n handleFailure(batchId, 'Request timeout');\n };\n\n xhr.send(formData);\n } catch (e) {\n handleFailure(batchId, 'Upload exception: ' + (e.message || String(e)));\n }\n}\n\n// ===== 处理上传失败 =====\nfunction handleFailure(batchId, errorMessage) {\n var batchKey = config ? (config.appId + '_' + config.deviceId) : batchId;\n var currentCount = failureCountMap[batchKey] || 0;\n var newCount = currentCount + 1;\n failureCountMap[batchKey] = newCount;\n\n var maxRetry = (config && config.maxRetryCount) ? config.maxRetryCount : 3;\n\n if (newCount >= maxRetry) {\n // 达到最大重试次数\n delete failureCountMap[batchKey];\n self.postMessage({\n type: 'MAX_RETRY_REACHED',\n batchId: batchId,\n error: errorMessage\n });\n } else {\n self.postMessage({\n type: 'UPLOAD_FAILURE',\n batchId: batchId,\n error: errorMessage,\n failureCount: newCount\n });\n }\n}\n\n// ===== 轮询调度 =====\nfunction startPolling() {\n if (pollTimer) {\n clearInterval(pollTimer);\n }\n\n var interval = (config && config.uploadInterval) ? config.uploadInterval : 2000;\n\n pollTimer = setInterval(function() {\n if (!isRunning) return;\n\n // 向主线程请求数据批次\n // 主线程会根据当前模式(full/error)和状态决定是否提供数据\n self.postMessage({\n type: 'REQUEST_BATCH'\n });\n }, interval);\n}\n\nfunction stopPolling() {\n if (pollTimer) {\n clearInterval(pollTimer);\n pollTimer = null;\n }\n}\n\n// ===== 清理 =====\nfunction cleanup() {\n isRunning = false;\n stopPolling();\n failureCountMap = {};\n config = null;\n errorModeUploading = false;\n}\n\n// ===== 消息处理 =====\nself.onmessage = function(e) {\n var msg = e.data;\n if (!msg || !msg.type) return;\n\n switch (msg.type) {\n case 'START':\n config = msg.config;\n isRunning = true;\n failureCountMap = {};\n startPolling();\n break;\n\n case 'STOP':\n cleanup();\n break;\n\n case 'UPLOAD_BATCH':\n if (isRunning) {\n performUpload(msg);\n }\n break;\n\n case 'UPDATE_CONFIG':\n if (msg.config) {\n for (var key in msg.config) {\n if (msg.config.hasOwnProperty(key) && config) {\n config[key] = msg.config[key];\n }\n }\n // 如果 uploadInterval 变了,重启轮询\n if (msg.config.uploadInterval && isRunning) {\n startPolling();\n }\n }\n break;\n\n case 'SET_ERROR_MODE_UPLOADING':\n errorModeUploading = msg.uploading;\n break;\n }\n};\n\n// Worker 就绪通知\nself.postMessage({ type: 'READY' });\n"],{type:"application/javascript"}),t=URL.createObjectURL(e),r=new Worker(t);return URL.revokeObjectURL(t),r}catch(e){return Nr.warn("Failed to create inline Worker, will fallback to main thread:",e),null}}();if(!r)return Ln=!1,!1;(Mn=r).onmessage=Gn,Mn.onerror=Jn;var n=Qr(),o={serv:e,appId:t,deviceId:xr(),uploadInterval:n.uploadInterval,maxRetryCount:n.maxRetryCount||3};return Mn.postMessage({type:"START",config:o}),Ln=!0,Bn=setTimeout((function(){On||(Nr.warn("Worker failed to send READY within 5 seconds, falling back to main thread"),Qn(!0))}),5e3),Nr.log("Upload Worker mode initialized, waiting for READY..."),!0}function Qn(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(Bn&&(clearTimeout(Bn),Bn=null),Mn){try{Mn.postMessage({type:"STOP"}),Mn.terminate()}catch(e){}Mn=null}On=!1,Ln=!1,Fn=!1,Dn=!1,_n=0,Un=0,jn.clear(),e&&Pn&&Pn()}function Xn(){return Ln&&null!==Mn}var $n=!1,eo=new Map,to=!1,ro=!1,no=0;function oo(e){Xn()?function(e){Dn=e,Hn({type:"SET_ERROR_MODE_UPLOADING",uploading:e})}(e):ro=e}function ao(e){Xn()?function(e){_n=e}(e):no=e}function io(e,t,r){return so.apply(this,arguments)}function so(){return(so=i()(o()().mark((function e(t,r,n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&0!==n.length){e.next=2;break}return e.abrupt("return",{success:!0});case 2:return e.prev=2,e.next=5,Rn({appId:r,data:n,deviceId:xr(),url:t});case 5:return e.abrupt("return",{success:!0});case 8:return e.prev=8,e.t0=e.catch(2),Nr.warn("Upload failed:",e.t0),e.abrupt("return",{success:!1,error:e.t0});case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function uo(e,t,r,n,o,a){return co.apply(this,arguments)}function co(){return(co=i()(o()().mark((function e(t,r,n,a,i,s){var u,c,l;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=s+1,c="".concat(n,"_").concat(xr()),eo.set(c,u),!(u>=i)){e.next=16;break}return Nr.warn("Upload failed ".concat(i," times consecutively, stopping upload")),e.next=7,Pr.unshiftBatch(xr(),t);case 7:l=new CustomEvent("rlog-upload-failure",{detail:{error:r,retryCount:i,appId:n,deviceId:xr()}}),"undefined"!=typeof window&&window.dispatchEvent(l);try{Mt.addCustomEvent("rlog-upload-failure",{error:r,retryCount:i,appId:n,deviceId:xr(),timestamp:Date.now()})}catch(e){Nr.warn("Failed to record upload failure event via addCustomEvent:",e)}return eo.delete(c),setTimeout((function(){Yo()}),0),Nr.error("Upload and recording stopped due to repeated failures"),e.abrupt("return",!0);case 16:return Nr.warn("Upload failed ".concat(u," time(s), will retry in next cycle")),e.next=19,Pr.unshiftBatch(xr(),t);case 19:return e.abrupt("return",!1);case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lo(e,t){var r=function(){var n=i()(o()().mark((function n(){var a,i,s,u,c,l,f,d,p,h,g;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!$n){n.next=3;break}return Nr.log("Upload has been cancelled"),n.abrupt("return");case 3:if(!to){n.next=6;break}return setTimeout((function(){r()}),100),n.abrupt("return");case 6:if((a=Qr()).enable){n.next=10;break}return Nr.log("SDK is disabled by config, stopping upload"),n.abrupt("return");case 10:if(!(i="error"===a.captureMode)||ro){n.next=14;break}return setTimeout((function(){r()}),a.uploadInterval),n.abrupt("return");case 14:if(n.prev=14,to=!0,u=0,!i){n.next=25;break}return u=no>0?no:Date.now(),n.next=21,Pr.pullByTimeRange(xr(),u,Date.now());case 21:s=n.sent,no=0,n.next=28;break;case 25:return n.next=27,Pr.pull(xr(),100);case 27:s=n.sent;case 28:if(s&&0!==s.length){n.next=32;break}return to=!1,setTimeout((function(){r()}),a.uploadInterval),n.abrupt("return");case 32:if(c=Qr(),!("YES"===sessionStorage.getItem("RLOG_CONSUME_ONLY")||c.consumeOnly)){n.next=39;break}return Nr.log("Consume only mode, skip upload"),to=!1,setTimeout((function(){r()}),a.uploadInterval),n.abrupt("return");case 39:return n.next=41,io(e,t,s);case 41:if(!(l=n.sent).success){n.next=53;break}if(f="".concat(t,"_").concat(xr()),eo.delete(f),!(i&&u>0&&s.length>0)){n.next=50;break}return n.next=48,Pr.removeByTimeRange(xr(),u);case 48:(d=s[s.length-1])&&d.timestamp&&(no=d.timestamp);case 50:to=!1,n.next=62;break;case 53:return to=!1,p=c.maxRetryCount||3,h="".concat(t,"_").concat(xr()),g=eo.get(h)||0,n.next=59,uo(s,l.error,t,e,p,g);case 59:if(!n.sent){n.next=62;break}return n.abrupt("return");case 62:n.next=68;break;case 64:n.prev=64,n.t0=n.catch(14),to=!1,Nr.error("Error in upload loop:",n.t0);case 68:setTimeout((function(){r()}),a.uploadInterval);case 69:case"end":return n.stop()}}),n,null,[[14,64]])})));return function(){return n.apply(this,arguments)}}();r()}function fo(){qn(null),Xn()&&Qn(),$n=!0,to=!1,ro=!1,no=0}function po(){qn(null),Xn()&&Qn(),$n=!1,to=!1,ro=!1,no=0,eo.clear()}var ho=l()({},Qr().routerMonitor||{}),go="",vo=Date.now(),mo=!1,yo=null,wo=null;function Io(){return"undefined"==typeof window?"":window.location.pathname+window.location.search+window.location.hash}function bo(e,t,r){var n;if(null!==(n=ho)&&void 0!==n&&n.enable&&(o=t,null===(a=ho)||void 0===a||!a.ignoreRoutes||!ho.ignoreRoutes.some((function(e){return"string"==typeof e?o.includes(e):e instanceof RegExp&&e.test(o)})))){var o,a,i={type:"route-change",from:e,to:t,method:r,timestamp:Date.now()};ho.trackPageStayTime&&e&&(i.duration=Date.now()-vo);try{Mt.addCustomEvent("route-change",i)}catch(e){Nr.warn("Failed to add custom event (recording may have stopped)",e)}vo=Date.now()}}function Co(){var e=go,t=Io();e!==t&&bo(e,t,"popstate")}function So(){var e=go,t=Io();e!==t&&bo(e,t,"hashchange")}function ko(e){var t,r,n,o,a,i=Qr().routerMonitor||{},s=l()({enable:null!==(t=i.enable)&&void 0!==t&&t,trackHashChange:null===(r=i.trackHashChange)||void 0===r||r,trackHistoryChange:null===(n=i.trackHistoryChange)||void 0===n||n,trackPageStayTime:null===(o=i.trackPageStayTime)||void 0===o||o,ignoreRoutes:null!==(a=i.ignoreRoutes)&&void 0!==a?a:[]},e||{}),u=JSON.stringify(s)!==JSON.stringify(ho);ho=s,u&&ho.enable?Mo(ho):ho.enable||No()}function Ao(){try{Mt.addCustomEvent("page-lifecycle",{type:"PAGE_LOAD",url:window.location.href,timestamp:Date.now()})}catch(e){Nr.warn("Failed to add PAGE_LOAD event (recording may have stopped)",e)}}function xo(){try{Mt.addCustomEvent("page-lifecycle",{type:"PAGE_UNLOAD",url:window.location.href,timestamp:Date.now()})}catch(e){Nr.warn("Failed to add PAGE_UNLOAD event (recording may have stopped)",e)}}function Eo(e){try{Mt.addCustomEvent("page-lifecycle",{type:"PAGE_HIDE",url:window.location.href,timestamp:Date.now(),persisted:e.persisted})}catch(e){Nr.warn("Failed to add PAGE_HIDE event (recording may have stopped)",e)}}function To(e){try{Mt.addCustomEvent("page-lifecycle",{type:"PAGE_SHOW",url:window.location.href,timestamp:Date.now(),persisted:e.persisted}),e.persisted&&(vo=Date.now())}catch(e){Nr.warn("Failed to add PAGE_SHOW event (recording may have stopped)",e)}}function Ro(){try{var e="hidden"===document.visibilityState;Mt.addCustomEvent("page-lifecycle",{type:e?"PAGE_VISIBILITY_HIDDEN":"PAGE_VISIBILITY_VISIBLE",url:window.location.href,timestamp:Date.now()})}catch(e){Nr.warn("Failed to add visibility change event (recording may have stopped)",e)}}function Mo(e){var t,r,n,o,a;if(!mo&&"undefined"!=typeof window){var i=Qr().routerMonitor||{};(ho=l()({enable:null!==(t=i.enable)&&void 0!==t&&t,trackHashChange:null===(r=i.trackHashChange)||void 0===r||r,trackHistoryChange:null===(n=i.trackHistoryChange)||void 0===n||n,trackPageStayTime:null===(o=i.trackPageStayTime)||void 0===o||o,ignoreRoutes:null!==(a=i.ignoreRoutes)&&void 0!==a?a:[]},e||{})).enable?(Nr.log("Route monitor initialized with config",ho),go=Io(),vo=Date.now(),ho.trackHistoryChange&&(yo=window.history.pushState,wo=window.history.replaceState,window.history.pushState=function(){for(var e=Io(),t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var o=yo.apply(this,r),a=Io();return e!==a&&bo(e,a,"pushState"),o},window.history.replaceState=function(){for(var e=Io(),t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var o=wo.apply(this,r),a=Io();return e!==a&&bo(e,a,"replaceState"),o},window.addEventListener("popstate",Co)),ho.trackHashChange&&window.addEventListener("hashchange",So),window.addEventListener("load",Ao),window.addEventListener("beforeunload",xo),window.addEventListener("pagehide",Eo),window.addEventListener("pageshow",To),document.addEventListener("visibilitychange",Ro),mo=!0):Nr.log("Route monitor is disabled by config")}}function Oo(){return{currentRoute:go,startTime:vo,stayTime:Date.now()-vo}}function Lo(e,t){bo(t||go,e,"pushState")}function No(){mo&&(yo&&wo&&"undefined"!=typeof window&&(window.history.pushState=yo,window.history.replaceState=wo),"undefined"!=typeof window&&(window.removeEventListener("popstate",Co),window.removeEventListener("hashchange",So),window.removeEventListener("load",Ao),window.removeEventListener("beforeunload",xo),window.removeEventListener("pagehide",Eo),window.removeEventListener("pageshow",To),document.removeEventListener("visibilitychange",Ro)),mo=!1,yo=null,wo=null,Nr.log("Router monitor stopped"))}var Do=null,_o=!1;function Fo(e){Do=e}var Uo=function(e){try{Mt.addCustomEvent("custom-error-event",e)}catch(t){Nr.error("Error captured",e)}"error"===Qr().captureMode&&Do&&Do.onError({type:e.type,message:e.message||e.type,timestamp:e.timestamp||Date.now(),detail:e})};function Bo(e){var t=e;if(e.target!==window){var r={type:"RESOURCE_ERROR",resourceType:e.target.tagName,url:e.target.src||e.target.href||e.target.src,message:t.message,userAgent:navigator.userAgent,timestamp:Date.now(),location:window.location.href};return Uo(r),!1}var n=t.message,o=t.filename,a=t.lineno,i=t.colno,s=t.error,u={type:"JS_ERROR",message:n,file:o,line:a,column:i,stack:null==s?void 0:s.stack,userAgent:navigator.userAgent,timestamp:Date.now(),location:window.location.href};return Uo(u),!1}function Po(e){var t=e.reason||"Unknown rejection",r={type:"PROMISE_REJECTION",message:"string"==typeof t?t:t.message,stack:"object"===u()(t)?t.stack:null,timestamp:Date.now(),location:window.location.href};Uo(r),e.preventDefault()}function Wo(){_o&&(Nr.log("Cleaning up error handlers"),window.removeEventListener("error",Bo,!0),window.removeEventListener("unhandledrejection",Po),_o=!1,Nr.log("Error handlers cleaned up successfully"))}var Go=function(){function e(){var t,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};H()(this,e),Mr()(this,"beforeDuration",void 0),Mr()(this,"afterDuration",void 0),Mr()(this,"state","idle"),Mr()(this,"cooldownTimer",null),Mr()(this,"destroyed",!1),this.beforeDuration=null!==(t=n.beforeDuration)&&void 0!==t?t:3e4,this.afterDuration=null!==(r=n.afterDuration)&&void 0!==r?r:3e4}return q()(e,[{key:"isUploading",value:function(){return"uploading"===this.state}},{key:"onError",value:function(e){this.destroyed||("idle"===this.state?this.enterUploadingState(e.timestamp):this.resetCooldown())}},{key:"enterUploadingState",value:function(e){this.state="uploading",Nr.log("ErrorTrigger: error detected, entering uploading state"),ao(e-this.beforeDuration),oo(!0),this.resetCooldown()}},{key:"resetCooldown",value:function(){var e=this;this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null),this.cooldownTimer=setTimeout((function(){e.exitUploadingState()}),this.afterDuration)}},{key:"exitUploadingState",value:function(){Nr.log("ErrorTrigger: cooldown expired, exiting uploading state"),this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null),oo(!1),this.state="idle"}},{key:"destroy",value:function(){this.destroyed=!0,this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null),oo(!1),this.state="idle"}}]),e}(),Ko=!1,jo=null;function Yo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"SDK instance";if(Ko)Nr.warn("SDK has already been cancelled");else{Ko=!0;try{if(xn(),fo(),"undefined"!=typeof window&&window.XMLHttpRequest&&mn(),No(),Wo(),jo&&(jo.destroy(),jo=null),Fo(null),en(null),e.clearData){var r=xr();r&&Pr.clear(r).catch((function(e){Nr.error("Error clearing storage",e)}))}Nr.log("SDK cancelled successfully via ".concat(t))}catch(e){Nr.error("Error cancelling SDK via ".concat(t),e)}}}function Zo(e,t,r){Ko=!1,po();var n=cn(e);!function(e){if(e){sn=e;var t=cn(e),r=[e];t!==e&&r.push(t),r.forEach((function(e){an.includes(e)||an.push(e)}))}}(n),function(e){return Xr.apply(this,arguments)}(r).then((function(){var e,r=Qr();if(r.enable){var o,a,i="error"===r.captureMode;if(i)Nr.log("Initializing in error capture mode"),Fo(jo=new Go({beforeDuration:null===(o=r.errorCapture)||void 0===o?void 0:o.beforeDuration,afterDuration:null===(a=r.errorCapture)||void 0===a?void 0:a.afterDuration})),en(jo);En(),function(e,t){qn((function(){Nr.log("Worker mode was downgraded, starting main thread upload"),lo(e,t)})),zn(e,t)?Nr.log("Upload loop started in Worker mode"):(Nr.log("Worker not available, falling back to main thread upload"),lo(e,t))}(n,t),Mo(r.routerMonitor),i||null!==(e=r.error)&&void 0!==e&&e?_o||(Nr.log("Error handling is enabled"),window.addEventListener("error",Bo,!0),window.addEventListener("unhandledrejection",Po),_o=!0):Nr.log("Error handling is disabled by config")}else Nr.log("SDK is disabled by config")})).catch((function(e){Nr.error("Failed to initialize SDK",e)}))}function Vo(e){return Zo(e.serv,e.appId,e.cdnConfigUrl),{cancel:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Yo(e,"SDK instance")}}}function Ho(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Nr.warn("Please use rlog.cancel() from initialized instance instead of standalone cancelRecord()"),Yo(e,"standalone function")}function Jo(e,t){Mt.addCustomEvent(e,t)}function qo(e){zr({consumeOnly:e}),Nr.log("Consume only mode ".concat(e?"enabled":"disabled"))}function zo(){return"YES"===sessionStorage.getItem("RLOG_CONSUME_ONLY")||!!Qr().consumeOnly}function Qo(){var e=!Qr().consumeOnly;return qo(e),e}function Xo(e){var t="string"==typeof e?e:e.message,r="object"===u()(e)&&e.stack?e.stack:void 0;try{Mt.addCustomEvent("custom-error-event",{type:"CUSTOM_ERROR",message:t,stack:r,timestamp:Date.now(),location:"undefined"!=typeof window?window.location.href:""})}catch(e){Nr.warn("Failed to add custom error event:",e)}Do&&Do.onError({type:"custom",message:t,timestamp:Date.now(),detail:{stack:r}})}var $o={getStorageAdapterType:function(){return Pr.getAdapterType()},getDeviceId:xr,resetUploadState:function(){po()},getStorageState:function(){return i()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=xr(),e.abrupt("return",Pr.getStorageState(t));case 2:case"end":return e.stop()}}),e)})))()},clearStorage:function(){return i()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=xr(),e.abrupt("return",Pr.clear(t));case 2:case"end":return e.stop()}}),e)})))()},shouldRecordUrl:ln,getConfig:Qr}}(),n}()}));
|