posthog-js 1.92.0 → 1.92.1

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.
Files changed (42) hide show
  1. package/dist/array.full.js +1 -1
  2. package/dist/array.full.js.map +1 -1
  3. package/dist/array.js +1 -1
  4. package/dist/array.js.map +1 -1
  5. package/dist/es.js +1 -1
  6. package/dist/es.js.map +1 -1
  7. package/dist/exception-autocapture.js +1 -1
  8. package/dist/exception-autocapture.js.map +1 -1
  9. package/dist/module.d.ts +21 -23
  10. package/dist/module.js +1 -1
  11. package/dist/module.js.map +1 -1
  12. package/dist/recorder-v2.js +2 -2
  13. package/dist/recorder-v2.js.map +1 -1
  14. package/dist/surveys.js.map +1 -1
  15. package/lib/package.json +1 -1
  16. package/lib/src/decide.js +4 -5
  17. package/lib/src/decide.js.map +1 -1
  18. package/lib/src/extensions/replay/config.d.ts +2 -2
  19. package/lib/src/extensions/replay/config.js +73 -6
  20. package/lib/src/extensions/replay/config.js.map +1 -1
  21. package/lib/src/extensions/replay/sessionrecording.d.ts +1 -0
  22. package/lib/src/extensions/replay/sessionrecording.js +14 -2
  23. package/lib/src/extensions/replay/sessionrecording.js.map +1 -1
  24. package/lib/src/loader-recorder-v2.d.ts +2 -2
  25. package/lib/src/loader-recorder-v2.js +101 -49
  26. package/lib/src/loader-recorder-v2.js.map +1 -1
  27. package/lib/src/posthog-core.d.ts +7 -2
  28. package/lib/src/posthog-core.js +18 -3
  29. package/lib/src/posthog-core.js.map +1 -1
  30. package/lib/src/types.d.ts +13 -2
  31. package/lib/src/types.js.map +1 -1
  32. package/lib/src/utils/event-utils.js +3 -4
  33. package/lib/src/utils/event-utils.js.map +1 -1
  34. package/lib/src/utils/request-utils.d.ts +7 -0
  35. package/lib/src/utils/request-utils.js +15 -0
  36. package/lib/src/utils/request-utils.js.map +1 -1
  37. package/lib/src/utils/type-utils.js +2 -7
  38. package/lib/src/utils/type-utils.js.map +1 -1
  39. package/package.json +1 -1
  40. package/lib/src/extensions/replay/web-performance.d.ts +0 -20
  41. package/lib/src/extensions/replay/web-performance.js +0 -248
  42. package/lib/src/extensions/replay/web-performance.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  !function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function r(){
2
2
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
3
- r=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof p?t:p,a=Object.create(o.prototype),i=new w(r||[]);return a._invoke=function(e,t,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return M()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var s=b(i,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,i),a}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d={};function p(){}function f(){}function h(){}var g={};c(g,a,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(k([])));v&&v!==t&&n.call(v,a)&&(g=v);var y=h.prototype=p.prototype=Object.create(g);function I(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function r(o,a,i,s){var c=l(e[o],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,i,s)}),(function(e){r("throw",e,i,s)})):t.resolve(d).then((function(e){u.value=e,i(u)}),(function(e){return r("throw",e,i,s)}))}s(c.arg)}var o;this._invoke=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 b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function S(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 A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function k(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return f.prototype=h,c(y,"constructor",h),c(h,"constructor",f),f.displayName=c(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,c(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},I(C.prototype),c(C.prototype,i,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(t,n,r,o),a);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},I(y),c(y,s,"Generator"),c(y,a,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=k,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},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 t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(i)},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),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function o(e){return o="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},o(e)}function a(e,t,n,r,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,c,"next",e)}function c(e){a(i,r,o,s,c,"throw",e)}s(void 0)}))}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){s=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw o}}return a}(e,t)||f(e,t)||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.")}()}function p(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||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.")}()}function f(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=f(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 a,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw a}}}}var m;function v(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function y(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function I(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(C).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function C(e){var t;if(function(e){return"styleSheet"in e}(e))try{t=I(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}return function(e){if(e.includes(":")){var t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}return e}(t||e.cssText)}!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"}(m||(m={}));var b=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function S(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,o=e.type,a=e.value,i=e.maskInputFn,s=a||"",c=o&&A(o);return(n[r.toLowerCase()]||c&&n[c])&&(s=i?i(s,t):"*".repeat(s.length)),s}function A(e){return e.toLowerCase()}var w="__rrweb_original__";function k(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?A(t):null}var M,T,O=1,N=new RegExp("[^a-z0-9-_:]"),E=-2;function R(){return O++}var x=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,L=/^(?:[a-z+]+:)?\/\//i,F=/^www\..*/i,D=/^(data:)([^,]*),(.*)/i;function B(e,t){return(e||"").replace(x,(function(e,n,r,o,a,i){var s,c=r||a||i,u=n||o||"";if(!c)return e;if(L.test(c)||F.test(c))return"url(".concat(u).concat(c).concat(u,")");if(D.test(c))return"url(".concat(u).concat(c).concat(u,")");if("/"===c[0])return"url(".concat(u).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)).concat(u,")");var l=t.split("/"),d=c.split("/");l.pop();for(var p=0,f=d;p<f.length;p++){var h=f[p];"."!==h&&(".."===h?l.pop():l.push(h))}return"url(".concat(u).concat(l.join("/")).concat(u,")")}))}var W=/^[^ \t\n\r\u000c]+/,G=/^[, \t\n\r\u000c]+/;function V(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function Z(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function U(){var e=document.createElement("a");return e.href="",e.href}function K(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?V(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(G),!(n>=t.length);){var a=r(W);if(","===a.slice(-1))a=V(e,a.substring(0,a.length-1)),o.push(a);else{var i="";a=V(e,a);for(var s=!1;;){var c=t.charAt(n);if(""===c){o.push((a+i).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){n+=1,o.push((a+i).trim());break}"("===c&&(s=!0)}i+=c,n+=1}}}return o.join(", ")}(e,r):"style"===n?B(r,U()):"object"===t&&"data"===n?V(e,r):r:V(e,r):r}function _(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function j(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&j(e.parentNode,t,n);for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&j(e.parentNode,t,n)}function H(e,t,n){try{var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(r.closest(".".concat(t)))return!0}else if(j(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}}catch(e){}return!1}function P(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,a=t.blockSelector,i=t.maskTextClass,s=t.maskTextSelector,c=t.inlineStylesheet,u=t.maskInputOptions,l=void 0===u?{}:u,d=t.maskTextFn,p=t.maskInputFn,f=t.dataURLOptions,h=void 0===f?{}:f,g=t.inlineImages,v=t.recordCanvas,y=t.keepIframeSrcFn,C=t.newlyAddedElement,b=void 0!==C&&C,O=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:m.Document,childNodes:[],compatMode:e.compatMode}:{type:m.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:m.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:O};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,a=t.inlineStylesheet,i=t.maskInputOptions,s=void 0===i?{}:i,c=t.maskInputFn,u=t.dataURLOptions,l=void 0===u?{}:u,d=t.inlineImages,p=t.recordCanvas,f=t.keepIframeSrcFn,h=t.newlyAddedElement,g=void 0!==h&&h,v=t.rootId,y=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,o),C=function(e){if(e instanceof HTMLFormElement)return"form";var t=A(e.tagName);return N.test(t)?"div":t}(e),b={},O=e.attributes.length,E=0;E<O;E++){var R=e.attributes[E];_(C,R.name,R.value)||(b[R.name]=K(n,C,A(R.name),R.value))}if("link"===C&&a){var x=Array.from(n.styleSheets).find((function(t){return t.href===e.href})),L=null;x&&(L=I(x)),L&&(delete b.rel,delete b.href,b._cssText=B(L,x.href))}if("style"===C&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(L=I(e.sheet))&&(b._cssText=B(L,U()))}if("input"===C||"textarea"===C||"select"===C){var F=e.value,D=e.checked;if("radio"!==b.type&&"checkbox"!==b.type&&"submit"!==b.type&&"button"!==b.type&&F){var W=k(e);b.value=S({element:e,type:W,tagName:C,value:F,maskInputOptions:s,maskInputFn:c})}else D&&(b.checked=D)}"option"===C&&(e.selected&&!s.select?b.selected=!0:delete b.selected);if("canvas"===C&&p)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData,a=w in o?o[w]:o;if(new Uint32Array(a.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(b.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){var G=e.toDataURL(l.type,l.quality),V=document.createElement("canvas");V.width=e.width,V.height=e.height,G!==V.toDataURL(l.type,l.quality)&&(b.rr_dataURL=G)}if("img"===C&&d){M||(M=n.createElement("canvas"),T=M.getContext("2d"));var j=e,H=j.crossOrigin;j.crossOrigin="anonymous";var P=function e(){j.removeEventListener("load",e);try{M.width=j.naturalWidth,M.height=j.naturalHeight,T.drawImage(j,0,0),b.rr_dataURL=M.toDataURL(l.type,l.quality)}catch(e){console.warn("Cannot inline img src=".concat(j.currentSrc,"! Error: ").concat(e))}H?b.crossOrigin=H:j.removeAttribute("crossorigin")};j.complete&&0!==j.naturalWidth?P():j.addEventListener("load",P)}"audio"!==C&&"video"!==C||(b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime);g||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop));if(y){var Y=e.getBoundingClientRect(),q=Y.width,J=Y.height;b={class:b.class,rr_width:"".concat(q,"px"),rr_height:"".concat(J,"px")}}"iframe"!==C||f(b.src)||(e.contentDocument||(b.rr_src=b.src),delete b.src);return{type:m.Element,tagName:C,attributes:b,childNodes:[],isSVG:Z(e)||void 0,needBlock:y,rootId:v}}(e,{doc:n,blockClass:o,blockSelector:a,inlineStylesheet:c,maskInputOptions:l,maskInputFn:p,dataURLOptions:h,inlineImages:g,recordCanvas:v,keepIframeSrcFn:y,newlyAddedElement:b,rootId:O});case e.TEXT_NODE:return function(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,a=t.maskTextFn,i=t.rootId,s=e.parentNode&&e.parentNode.tagName,c=e.textContent,u="STYLE"===s||void 0,l="SCRIPT"===s||void 0;if(u&&c){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(c=I(e.parentNode.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}c=B(c,U())}l&&(c="SCRIPT_PLACEHOLDER");!u&&!l&&c&&H(e,r,o)&&(c=a?a(c):c.replace(/[\S]/g,"*"));return{type:m.Text,textContent:c||"",isStyle:u,rootId:i}}(e,{maskTextClass:i,maskTextSelector:s,maskTextFn:d,rootId:O});case e.CDATA_SECTION_NODE:return{type:m.CDATA,textContent:"",rootId:O};case e.COMMENT_NODE:return{type:m.Comment,textContent:e.textContent||"",rootId:O};default:return!1}}function Y(e){return null==e?"":e.toLowerCase()}function q(e,t){var n,r=t.doc,o=t.mirror,a=t.blockClass,i=t.blockSelector,s=t.maskTextClass,c=t.maskTextSelector,u=t.skipChild,l=void 0!==u&&u,d=t.inlineStylesheet,p=void 0===d||d,f=t.maskInputOptions,h=void 0===f?{}:f,g=t.maskTextFn,I=t.maskInputFn,C=t.slimDOMOptions,b=t.dataURLOptions,S=void 0===b?{}:b,A=t.inlineImages,w=void 0!==A&&A,k=t.recordCanvas,M=void 0!==k&&k,T=t.onSerialize,O=t.onIframeLoad,N=t.iframeLoadTimeout,x=void 0===N?5e3:N,L=t.onStylesheetLoad,F=t.stylesheetLoadTimeout,D=void 0===F?5e3:F,B=t.keepIframeSrcFn,W=void 0===B?function(){return!1}:B,G=t.newlyAddedElement,V=void 0!==G&&G,Z=t.preserveWhiteSpace,U=void 0===Z||Z,K=P(e,{doc:r,mirror:o,blockClass:a,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:p,maskInputOptions:h,maskTextFn:g,maskInputFn:I,dataURLOptions:S,inlineImages:w,recordCanvas:M,keepIframeSrcFn:W,newlyAddedElement:V});if(!K)return console.warn(e,"not serialized"),null;n=o.hasNode(e)?o.getId(e):!function(e,t){if(t.comment&&e.type===m.Comment)return!0;if(e.type===m.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Y(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Y(e.attributes.name)||"icon"===Y(e.attributes.rel)||"apple-touch-icon"===Y(e.attributes.rel)||"shortcut icon"===Y(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Y(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Y(e.attributes.property).match(/^(og|twitter|fb):/)||Y(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Y(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Y(e.attributes.name)||"googlebot"===Y(e.attributes.name)||"bingbot"===Y(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Y(e.attributes.name)||"generator"===Y(e.attributes.name)||"framework"===Y(e.attributes.name)||"publisher"===Y(e.attributes.name)||"progid"===Y(e.attributes.name)||Y(e.attributes.property).match(/^article:/)||Y(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Y(e.attributes.name)||"yandex-verification"===Y(e.attributes.name)||"csrf-token"===Y(e.attributes.name)||"p:domain_verify"===Y(e.attributes.name)||"verify-v1"===Y(e.attributes.name)||"verification"===Y(e.attributes.name)||"shopify-checkout-api-token"===Y(e.attributes.name)))return!0}}return!1}(K,C)&&(U||K.type!==m.Text||K.isStyle||K.textContent.replace(/^\s+|\s+$/gm,"").length)?R():E;var _=Object.assign(K,{id:n});if(o.add(e,_),n===E)return null;T&&T(e);var j=!l;if(_.type===m.Element){j=j&&!_.needBlock,delete _.needBlock;var H=e.shadowRoot;H&&y(H)&&(_.isShadowHost=!0)}if((_.type===m.Document||_.type===m.Element)&&j){C.headWhitespace&&_.type===m.Element&&"head"===_.tagName&&(U=!1);for(var J={doc:r,mirror:o,blockClass:a,blockSelector:i,maskTextClass:s,maskTextSelector:c,skipChild:l,inlineStylesheet:p,maskInputOptions:h,maskTextFn:g,maskInputFn:I,slimDOMOptions:C,dataURLOptions:S,inlineImages:w,recordCanvas:M,preserveWhiteSpace:U,onSerialize:T,onIframeLoad:O,iframeLoadTimeout:x,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:W},z=0,Q=Array.from(e.childNodes);z<Q.length;z++){(ee=q(Q[z],J))&&_.childNodes.push(ee)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var X=0,$=Array.from(e.shadowRoot.childNodes);X<$.length;X++){var ee;(ee=q($[X],J))&&(y(e.shadowRoot)&&(ee.isShadow=!0),_.childNodes.push(ee))}}return e.parentNode&&v(e.parentNode)&&y(e.parentNode)&&(_.isShadow=!0),_.type===m.Element&&"iframe"===_.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,a=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var i="about:blank";if(r.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)}),n);e.addEventListener("load",(function(){clearTimeout(s),a=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&O){var n=q(t,{doc:t,mirror:o,blockClass:a,blockSelector:i,maskTextClass:s,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskTextFn:g,maskInputFn:I,slimDOMOptions:C,dataURLOptions:S,inlineImages:w,recordCanvas:M,preserveWhiteSpace:U,onSerialize:T,onIframeLoad:O,iframeLoadTimeout:x,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:W});n&&O(e,n)}}),x),_.type===m.Element&&"link"===_.tagName&&"stylesheet"===_.attributes.rel&&function(e,t,n){var r,o=!1;try{r=e.sheet}catch(e){return}if(!r){var a=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(a),o=!0,t()}))}}(e,(function(){if(L){var t=q(e,{doc:r,mirror:o,blockClass:a,blockSelector:i,maskTextClass:s,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskTextFn:g,maskInputFn:I,slimDOMOptions:C,dataURLOptions:S,inlineImages:w,recordCanvas:M,preserveWhiteSpace:U,onSerialize:T,onIframeLoad:O,iframeLoadTimeout:x,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:W});t&&L(e,t)}}),D),_}function J(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var z="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.",Q={map:{},getId:function(){return console.error(z),-1},getNode:function(){return console.error(z),null},removeNodeFromMap:function(){console.error(z)},has:function(){return console.error(z),!1},reset:function(){console.error(z)}};function X(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];var c=Date.now();o||!1!==n.leading||(o=c);var u=t-(c-o),l=this;u<=0||u>t?(r&&(clearTimeout(r),r=null),o=c,e.apply(l,i)):r||!1===n.trailing||(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(l,i)}),u))}}function $(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,a=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return $(e,t,a||{},!0)}}function ee(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Q=new Proxy(Q,{get:function(e,t,n){return"map"===t&&console.error(z),Reflect.get(e,t,n)}}));var te=Date.now;function ne(e){var t,n,r,o,a,i,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==s?void 0:s.documentElement.scrollLeft)||(null===(n=null===(t=null==s?void 0:s.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==s?void 0:s.body)||void 0===r?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null===(a=null===(o=null==s?void 0:s.body)||void 0===o?void 0:o.parentElement)||void 0===a?void 0:a.scrollTop)||(null===(i=null==s?void 0:s.body)||void 0===i?void 0:i.scrollTop)||0}}function re(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function oe(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ae(e,t,n,r){if(!e)return!1;var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(j(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function ie(e,t){return t.getId(e)===E}function se(e,t){if(v(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||se(e.parentNode,t))}function ce(e){return Boolean(e.changedTouches)}function ue(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 de(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(te=function(){return(new Date).getTime()});var pe=function(){function e(){s(this,e),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return u(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):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}},{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}();function fe(e){var t,n,r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function he(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=fe(n);)n=t;return n}(e);return t.contains(n)}function ge(e){var t=e.ownerDocument;return!!t&&(t.contains(e)||he(e))}var me=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}(me||{}),ve=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}(ve||{}),ye=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}(ye||{}),Ie=function(e){return e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e}(Ie||{}),Ce=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(Ce||{});function be(e){return"__ln"in e}var Se,Ae=function(){function e(){s(this,e),this.length=0,this.head=null,this.tail=null}return u(e,[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}},{key:"addNode",value:function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&be(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&be(e.nextSibling)&&e.nextSibling.__ln.previous){var r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=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.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}]),e}(),we=function(e,t){return"".concat(e,"@").concat(t)},ke=function(){function e(){var t=this;s(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=[],n=new Set,r=new Ae,o=function(e){for(var n=e,r=E;r===E;)r=(n=n&&n.nextSibling)&&t.mirror.getId(n);return r},a=function(a){if(a.parentNode&&ge(a)){var i=v(a.parentNode)?t.mirror.getId(fe(a)):t.mirror.getId(a.parentNode),s=o(a);if(-1===i||-1===s)return r.addNode(a);var c=q(a,{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){ue(e,t.mirror)&&t.iframeManager.addIframe(e),le(e,t.mirror)&&t.stylesheetManager.trackLinkElement(e),de(a)&&t.shadowDomManager.addShadowRoot(a.shadowRoot,t.doc)},onIframeLoad:function(e,n){t.iframeManager.attachIframe(e,n),t.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,n){t.stylesheetManager.attachLinkElement(e,n)}});c&&(e.push({parentId:i,nextId:s,node:c}),n.add(c.id))}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());var i,s=g(t.movedSet);try{for(s.s();!(i=s.n()).done;){var c=i.value;Te(t.removes,c,t.mirror)&&!t.movedSet.has(c.parentNode)||a(c)}}catch(e){s.e(e)}finally{s.f()}var u,l=g(t.addedSet);try{for(l.s();!(u=l.n()).done;){var d=u.value;Ne(t.droppedSet,d)||Te(t.removes,d,t.mirror)?Ne(t.movedSet,d)?a(d):t.droppedSet.add(d):a(d)}}catch(e){l.e(e)}finally{l.f()}for(var p=null;r.length;){var f=null;if(p){var h=t.mirror.getId(p.value.parentNode),m=o(p.value);-1!==h&&-1!==m&&(f=p)}if(!f)for(var y=r.tail;y;){var I=y;if(y=y.previous,I){var C=t.mirror.getId(I.value.parentNode);if(-1===o(I.value))continue;if(-1!==C){f=I;break}var b=I.value;if(b.parentNode&&b.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var S=b.parentNode.host;if(-1!==t.mirror.getId(S)){f=I;break}}}}if(!f){for(;r.head;)r.removeNode(r.head.value);break}p=f.previous,r.removeNode(f.value),a(f.value)}var A={texts:t.texts.map((function(e){return{id:t.mirror.getId(e.node),value:e.value}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),attributes:t.attributes.map((function(e){var n=e.attributes;if("string"==typeof n.style){var r=JSON.stringify(e.styleDiff),o=JSON.stringify(e._unchangedStyles);r.length<n.style.length&&(r+o).split("var(").length===n.style.split("var(").length&&(n.style=e.styleDiff)}return{id:t.mirror.getId(e.node),attributes:n}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),removes:t.removes,adds:e};(A.texts.length||A.attributes.length||A.removes.length||A.adds.length)&&(t.texts=[],t.attributes=[],t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.movedMap={},t.mutationCb(A))}},this.processMutation=function(e){if(!ie(e.target,t.mirror)){var n;try{n=document.implementation.createHTMLDocument()}catch(e){n=t.doc}switch(e.type){case"characterData":var r=e.target.textContent;ae(e.target,t.blockClass,t.blockSelector,!1)||r===e.oldValue||t.texts.push({value:H(e.target,t.maskTextClass,t.maskTextSelector)&&r?t.maskTextFn?t.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:e.target});break;case"attributes":var o=e.target,a=e.attributeName,i=e.target.getAttribute(a);if("value"===a){var s=k(o);i=S({element:o,maskInputOptions:t.maskInputOptions,tagName:o.tagName,type:s,value:i,maskInputFn:t.maskInputFn})}if(ae(e.target,t.blockClass,t.blockSelector,!1)||i===e.oldValue)return;var c=t.attributes.find((function(t){return t.node===e.target}));if("IFRAME"===o.tagName&&"src"===a&&!t.keepIframeSrcFn(i)){if(o.contentDocument)return;a="rr_src"}if(c||(c={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(c)),"type"===a&&"INPUT"===o.tagName&&"password"===(e.oldValue||"").toLowerCase()&&o.setAttribute("data-rr-is-password","true"),!_(o.tagName,a)&&(c.attributes[a]=K(t.doc,A(o.tagName),A(a),i),"style"===a)){var u=n.createElement("span");e.oldValue&&u.setAttribute("style",e.oldValue);for(var l=0,d=Array.from(o.style);l<d.length;l++){var p=d[l],f=o.style.getPropertyValue(p),h=o.style.getPropertyPriority(p);f!==u.style.getPropertyValue(p)||h!==u.style.getPropertyPriority(p)?c.styleDiff[p]=""===h?f:[f,h]:c._unchangedStyles[p]=[f,h]}for(var g=0,m=Array.from(u.style);g<m.length;g++){var I=m[g];""===o.style.getPropertyValue(I)&&(c.styleDiff[I]=!1)}}break;case"childList":if(ae(e.target,t.blockClass,t.blockSelector,!0))return;e.addedNodes.forEach((function(n){return t.genAdds(n,e.target)})),e.removedNodes.forEach((function(n){var r=t.mirror.getId(n),o=v(e.target)?t.mirror.getId(e.target.host):t.mirror.getId(e.target);ae(e.target,t.blockClass,t.blockSelector,!1)||ie(n,t.mirror)||!function(e,t){return-1!==t.getId(e)}(n,t.mirror)||(t.addedSet.has(n)?(Me(t.addedSet,n),t.droppedSet.add(n)):t.addedSet.has(e.target)&&-1===r||se(e.target,t.mirror)||(t.movedSet.has(n)&&t.movedMap[we(r,o)]?Me(t.movedSet,n):t.removes.push({parentId:o,id:r,isShadow:!(!v(e.target)||!y(e.target))||void 0})),t.mapRemoves.push(n))}))}}},this.genAdds=function(e,n){if(!t.processedNodeManager.inOtherBuffer(e,t)&&!t.addedSet.has(e)&&!t.movedSet.has(e)){if(t.mirror.hasNode(e)){if(ie(e,t.mirror))return;t.movedSet.add(e);var r=null;n&&t.mirror.hasNode(n)&&(r=t.mirror.getId(n)),r&&-1!==r&&(t.movedMap[we(t.mirror.getId(e),r)]=!0)}else t.addedSet.add(e),t.droppedSet.delete(e);ae(e,t.blockClass,t.blockSelector,!1)||(e.childNodes.forEach((function(e){return t.genAdds(e)})),de(e)&&e.shadowRoot.childNodes.forEach((function(n){t.processedNodeManager.add(n,t),t.genAdds(n,e)})))}}}return u(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","processedNodeManager"].forEach((function(n){t[n]=e[n]}))}},{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 Me(e,t){e.delete(t),t.childNodes.forEach((function(t){return Me(e,t)}))}function Te(e,t,n){return 0!==e.length&&Oe(e,t,n)}function Oe(e,t,n){var r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||Oe(e,r,n)}function Ne(e,t){return 0!==e.size&&Ee(e,t)}function Ee(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||Ee(e,n))}function Re(e){Se=e}function xe(){Se=void 0}var Le=function(e){if(!Se)return e;return function(){try{return e.apply(void 0,arguments)}catch(e){if(Se&&!0===Se(e))return;throw e}}},Fe=[];function De(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]}catch(e){}return e&&e.target}function Be(e,t){var n,r,o=new ke;Fe.push(o),o.init(e);var a=window.MutationObserver||window.__rrMutationObserver,i=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");i&&window[i]&&(a=window[i]);var s=new a(Le(o.processMutations.bind(o)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function We(e){var t=e.mouseInteractionCb,n=e.doc,r=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,c=[],u=null;return Object.keys(ye).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(e){var i=A(e),s=function(e){return function(n){var i=De(n);if(!ae(i,o,a,!0)){var s=null,c=e;if("pointerType"in n){switch(n.pointerType){case"mouse":s=Ie.Mouse;break;case"touch":s=Ie.Touch;break;case"pen":s=Ie.Pen}s===Ie.Touch?ye[e]===ye.MouseDown?c="TouchStart":ye[e]===ye.MouseUp&&(c="TouchEnd"):Ie.Pen}else ce(n)&&(s=Ie.Touch);null!==s?(u=s,(c.startsWith("Touch")&&s===Ie.Touch||c.startsWith("Mouse")&&s===Ie.Mouse)&&(s=null)):ye[e]===ye.Click&&(s=u,u=null);var l=ce(n)?n.changedTouches[0]:n;if(l){var d=r.getId(i),p=l.clientX,f=l.clientY;Le(t)(Object.assign({type:ye[c],id:d,x:p,y:f},null!==s&&{pointerType:s}))}}}}(e);if(window.PointerEvent)switch(ye[e]){case ye.MouseDown:case ye.MouseUp:i=i.replace("mouse","pointer");break;case ye.TouchStart:case ye.TouchEnd:return}c.push(J(i,s,n))})),Le((function(){c.forEach((function(e){return e()}))}))}function Ge(e){var t=e.scrollCb,n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.sampling;return J("scroll",Le(X(Le((function(e){var i=De(e);if(i&&!ae(i,o,a,!0)){var s=r.getId(i);if(i===n&&n.defaultView){var c=ne(n.defaultView);t({id:s,x:c.left,y:c.top})}else t({id:s,x:i.scrollLeft,y:i.scrollTop})}})),i.scroll||100)),n)}function Ve(e,t){var n=Object.assign({},e);return t||delete n.userTriggered,n}var Ze=["INPUT","TEXTAREA","SELECT"],Ue=new WeakMap;function Ke(e){return function(e,t){if(Pe("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Pe("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Pe("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Pe("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function _e(e,t,n){var r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function je(e,t){var n,r,o,a=e.mirror,i=e.stylesheetManager,s=null;s="#document"===t.nodeName?a.getId(t):a.getId(t.host);var c="#document"===t.nodeName?null===(n=t.defaultView)||void 0===n?void 0:n.Document:null===(o=null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===o?void 0:o.ShadowRoot,u=Object.getOwnPropertyDescriptor(null==c?void 0:c.prototype,"adoptedStyleSheets");return null!==s&&-1!==s&&c&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:function(){var e;return null===(e=u.get)||void 0===e?void 0:e.call(this)},set:function(e){var t,n=null===(t=u.set)||void 0===t?void 0:t.call(this,e);if(null!==s&&-1!==s)try{i.adoptStyleSheets(e,s)}catch(e){}return n}}),Le((function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):function(){}}function He(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.doc.defaultView;if(!n)return function(){};!function(e,t){var n=e.mutationCb,r=e.mousemoveCb,o=e.mouseInteractionCb,a=e.scrollCb,i=e.viewportResizeCb,s=e.inputCb,c=e.mediaInteractionCb,u=e.styleSheetRuleCb,l=e.styleDeclarationCb,d=e.canvasMutationCb,p=e.fontCb,f=e.selectionCb;e.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),r.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),c.apply(void 0,arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),u.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),d.apply(void 0,arguments)},e.fontCb=function(){t.font&&t.font.apply(t,arguments),p.apply(void 0,arguments)},e.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),f.apply(void 0,arguments)}}(e,t);var r,o=Be(e,e.doc),a=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,o=e.mirror;if(!1===n.mousemove)return function(){};var a,i="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,c=[],u=X(Le((function(e){var n=Date.now()-a;t(c.map((function(e){return e.timeOffset-=n,e})),e),c=[],a=null})),s),l=Le(X(Le((function(e){var t=De(e),n=ce(e)?e.changedTouches[0]:e,r=n.clientX,i=n.clientY;a||(a=te()),c.push({x:r,y:i,id:o.getId(t),timeOffset:te()-a}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?ve.Drag:e instanceof MouseEvent?ve.MouseMove:ve.TouchMove)})),i,{trailing:!1})),d=[J("mousemove",l,r),J("touchmove",l,r),J("drag",l,r)];return Le((function(){d.forEach((function(e){return e()}))}))}(e),i=We(e),s=Ge(e),c=function(e,t){var n=e.viewportResizeCb,r=t.win,o=-1,a=-1;return J("resize",Le(X(Le((function(){var e=re(),t=oe();o===e&&a===t||(n({width:Number(t),height:Number(e)}),o=e,a=t)})),200)),r)}(e,{win:n}),u=function(e){var t=e.inputCb,n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.ignoreClass,s=e.ignoreSelector,c=e.maskInputOptions,u=e.maskInputFn,l=e.sampling,d=e.userTriggeredOnInput;function f(e){var t=De(e),r=e.isTrusted,l=t&&t.tagName;if(t&&"OPTION"===l&&(t=t.parentElement),t&&l&&!(Ze.indexOf(l)<0)&&!ae(t,o,a,!0)&&!(t.classList.contains(i)||s&&t.matches(s))){var p=t.value,f=!1,g=k(t)||"";"radio"===g||"checkbox"===g?f=t.checked:(c[l.toLowerCase()]||c[g])&&(p=S({element:t,maskInputOptions:c,tagName:l,type:g,value:p,maskInputFn:u})),h(t,Le(Ve)({text:p,isChecked:f,userTriggered:r},d));var m=t.name;"radio"===g&&m&&f&&n.querySelectorAll('input[type="radio"][name="'.concat(m,'"]')).forEach((function(e){e!==t&&h(e,Le(Ve)({text:e.value,isChecked:!f,userTriggered:!1},d))}))}}function h(e,n){var o=Ue.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Ue.set(e,n);var a=r.getId(e);Le(t)(Object.assign(Object.assign({},n),{id:a}))}}var g=("last"===l.input?["change"]:["input","change"]).map((function(e){return J(e,Le(f),n)})),m=n.defaultView;if(!m)return function(){g.forEach((function(e){return e()}))};var v=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&g.push.apply(g,p(y.map((function(e){return $(e[0],e[1],{set:function(){Le(f)({target:this,isTrusted:!1})}},!1,m)})))),Le((function(){g.forEach((function(e){return e()}))}))}(e),l=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.blockSelector,o=e.mirror,a=e.sampling,i=e.doc,s=Le((function(e){return X(Le((function(a){var i=De(a);if(i&&!ae(i,n,r,!0)){var s=i.currentTime,c=i.volume,u=i.muted,l=i.playbackRate;t({type:e,id:o.getId(i),currentTime:s,volume:c,muted:u,playbackRate:l})}})),a.media||500)})),c=[J("play",s(0),i),J("pause",s(1),i),J("seeked",s(2),i),J("volumechange",s(3),i),J("ratechange",s(4),i)];return Le((function(){c.forEach((function(e){return e()}))}))}(e),f=function(e,t){var n=e.styleSheetRuleCb,r=e.mirror,o=e.stylesheetManager,a=t.win;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return function(){};var i=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Le((function(e,t,a){var i=d(a,2),s=i[0],c=i[1],u=_e(t,r,o.styleMirror),l=u.id,p=u.styleId;return(l&&-1!==l||p&&-1!==p)&&n({id:l,styleId:p,adds:[{rule:s,index:c}]}),e.apply(t,a)}))});var s,c,u=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Le((function(e,t,a){var i=d(a,1)[0],s=_e(t,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,removes:[{index:i}]}),e.apply(t,a)}))}),a.CSSStyleSheet.prototype.replace&&(s=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Le((function(e,t,a){var i=d(a,1)[0],s=_e(t,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,replace:i}),e.apply(t,a)}))})),a.CSSStyleSheet.prototype.replaceSync&&(c=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:Le((function(e,t,a){var i=d(a,1)[0],s=_e(t,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,replaceSync:i}),e.apply(t,a)}))}));var l={};Ye("CSSGroupingRule")?l.CSSGroupingRule=a.CSSGroupingRule:(Ye("CSSMediaRule")&&(l.CSSMediaRule=a.CSSMediaRule),Ye("CSSConditionRule")&&(l.CSSConditionRule=a.CSSConditionRule),Ye("CSSSupportsRule")&&(l.CSSSupportsRule=a.CSSSupportsRule));var f={};return Object.entries(l).forEach((function(e){var t=d(e,2),a=t[0],i=t[1];f[a]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(f[a].insertRule,{apply:Le((function(e,t,a){var i=d(a,2),s=i[0],c=i[1],u=_e(t.parentStyleSheet,r,o.styleMirror),l=u.id,f=u.styleId;return(l&&-1!==l||f&&-1!==f)&&n({id:l,styleId:f,adds:[{rule:s,index:[].concat(p(Ke(t)),[c||0])}]}),e.apply(t,a)}))}),i.prototype.deleteRule=new Proxy(f[a].deleteRule,{apply:Le((function(e,t,a){var i=d(a,1)[0],s=_e(t.parentStyleSheet,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,removes:[{index:[].concat(p(Ke(t)),[i])}]}),e.apply(t,a)}))})})),Le((function(){a.CSSStyleSheet.prototype.insertRule=i,a.CSSStyleSheet.prototype.deleteRule=u,s&&(a.CSSStyleSheet.prototype.replace=s),c&&(a.CSSStyleSheet.prototype.replaceSync=c),Object.entries(l).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];r.prototype.insertRule=f[n].insertRule,r.prototype.deleteRule=f[n].deleteRule}))}))}(e,{win:n}),h=je(e,e.doc),m=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,o=e.ignoreCSSAttributes,a=e.stylesheetManager,i=t.win,s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Le((function(e,t,i){var c,u=d(i,3),l=u[0],p=u[1],f=u[2];if(o.has(l))return s.apply(t,[l,p,f]);var h=_e(null===(c=t.parentRule)||void 0===c?void 0:c.parentStyleSheet,r,a.styleMirror),g=h.id,m=h.styleId;return(g&&-1!==g||m&&-1!==m)&&n({id:g,styleId:m,set:{property:l,value:p,priority:f},index:Ke(t.parentRule)}),e.apply(t,i)}))});var c=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(c,{apply:Le((function(e,t,i){var s,u=d(i,1)[0];if(o.has(u))return c.apply(t,[u]);var l=_e(null===(s=t.parentRule)||void 0===s?void 0:s.parentStyleSheet,r,a.styleMirror),p=l.id,f=l.styleId;return(p&&-1!==p||f&&-1!==f)&&n({id:p,styleId:f,remove:{property:u},index:Ke(t.parentRule)}),e.apply(t,i)}))}),Le((function(){i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=c}))}(e,{win:n}),v=e.collectFonts?function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var o=[],a=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,n){var r=new i(e,t,n);return a.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=ee(n.fonts,"add",(function(e){return function(n){return setTimeout(Le((function(){var e=a.get(n);e&&(t(e),a.delete(n))})),0),e.apply(this,[n])}}));return o.push((function(){r.FontFace=i})),o.push(s),Le((function(){o.forEach((function(e){return e()}))}))}(e):function(){},y=function(e){var t=e.doc,n=e.mirror,r=e.blockClass,o=e.blockSelector,a=e.selectionCb,i=!0,s=Le((function(){var e=t.getSelection();if(!(!e||i&&(null==e?void 0:e.isCollapsed))){i=e.isCollapsed||!1;for(var s=[],c=e.rangeCount||0,u=0;u<c;u++){var l=e.getRangeAt(u),d=l.startContainer,p=l.startOffset,f=l.endContainer,h=l.endOffset;ae(d,r,o,!0)||ae(f,r,o,!0)||s.push({start:n.getId(d),startOffset:p,end:n.getId(f),endOffset:h})}a({ranges:s})}}));return s(),J("selectionchange",s)}(e),I=[],C=g(e.plugins);try{for(C.s();!(r=C.n()).done;){var b=r.value;I.push(b.observer(b.callback,n,b.options))}}catch(e){C.e(e)}finally{C.f()}return Le((function(){Fe.forEach((function(e){return e.reset()})),o.disconnect(),a(),i(),s(),c(),u(),l(),f(),h(),m(),v(),y(),I.forEach((function(e){return e()}))}))}function Pe(e){return void 0!==window[e]}function Ye(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var qe=function(){function e(t){s(this,e),this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}return u(e,[{key:"getId",value:function(e,t,n,r){var o=n||this.getIdToRemoteIdMap(e),a=r||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 n=this,r=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getId(e,t,r,o)}))}},{key:"getRemoteId",value:function(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var o=r.get(t);return o||-1}},{key:"getRemoteIds",value:function(e,t){var n=this,r=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getRemoteId(e,t,r)}))}},{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}(),Je=function(){function e(t){s(this,e),this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new qe(R),this.crossOriginIframeRootIdMap=new WeakMap,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 u(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 n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}}},{key:"transformCrossOriginEvent",value:function(e,t){var n,r=this;switch(t.type){case me.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var o=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,o),this.patchRootIdOnNode(t.data.node,o),{timestamp:t.timestamp,type:me.IncrementalSnapshot,data:{source:ve.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case me.Meta:case me.Load:case me.DomContentLoaded:return!1;case me.Plugin:return t;case me.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case me.IncrementalSnapshot:switch(t.data.source){case ve.Mutation:return t.data.adds.forEach((function(t){r.replaceIds(t,e,["parentId","nextId","previousId"]),r.replaceIdOnNode(t.node,e);var n=r.crossOriginIframeRootIdMap.get(e);n&&r.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((function(t){r.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((function(t){r.replaceIds(t,e,["id"])})),t.data.texts.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case ve.Drag:case ve.TouchMove:case ve.MouseMove:return t.data.positions.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case ve.ViewportResize:return!1;case ve.MediaInteraction:case ve.MouseInteraction:case ve.Scroll:case ve.CanvasMutation:case ve.Input:return this.replaceIds(t.data,e,["id"]),t;case ve.StyleSheetRule:case ve.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case ve.Font:return t;case ve.Selection:return t.data.ranges.forEach((function(t){r.replaceIds(t,e,["start","end"])})),t;case ve.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((function(t){r.replaceStyleIds(t,e,["styleId"])})),t}}}},{key:"replace",value:function(e,t,n,r){var o,a=g(r);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(n,t[i]):t[i]=e.getId(n,t[i]))}}catch(e){a.e(e)}finally{a.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((function(e){n.replaceIdOnNode(e,t)}))}},{key:"patchRootIdOnNode",value:function(e,t){var n=this;e.type===m.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((function(e){n.patchRootIdOnNode(e,t)}))}}]),e}(),ze=function(){function e(t){s(this,e),this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}return u(e,[{key:"init",value:function(){this.reset(),this.patchAttachShadow(Element,document)}},{key:"addShadowRoot",value:function(e,t){var n=this;if(y(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=Be(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((function(){return r.disconnect()})),this.restoreHandlers.push(Ge(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&n.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,n.mirror.getId(e.host)),n.restoreHandlers.push(je({mirror:n.mirror,stylesheetManager:n.bypassOptions.stylesheetManager},e))}),0)}}},{key:"observeAttachShadow",value:function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}},{key:"patchAttachShadow",value:function(e,t){var n=this;this.restoreHandlers.push(ee(e.prototype,"attachShadow",(function(e){return function(r){var o=e.call(this,r);return this.shadowRoot&&ge(this)&&n.addShadowRoot(this.shadowRoot,t),o}})))}},{key:"reset",value:function(){this.restoreHandlers.forEach((function(e){try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}]),e}();function Qe(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}c((r=r.apply(e,t||[])).next())}))}for(var Xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$e="undefined"==typeof Uint8Array?[]:new Uint8Array(256),et=0;et<Xe.length;et++)$e[Xe.charCodeAt(et)]=et;var tt=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=Xe[n[t]>>2],o+=Xe[(3&n[t])<<4|n[t+1]>>4],o+=Xe[(15&n[t+1])<<2|n[t+2]>>6],o+=Xe[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o},nt=new Map;var rt=function(e,t,n){if(e&&(it(e,t)||"object"===o(e))){var r=function(e,t){var n=nt.get(e);return n||(n=new Map,nt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),a=r.indexOf(e);return-1===a&&(a=r.length,r.push(e)),a}};function ot(e,t,n){if(e instanceof Array)return e.map((function(e){return ot(e,t,n)}));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:tt(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ot(e.buffer,t,n),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:[ot(e.data,t,n),e.width,e.height]}:it(e,t)||"object"===o(e)?{rr_type:e.constructor.name,index:rt(e,t,n)}:e}var at=function(e,t,n){return p(e).map((function(e){return ot(e,t,n)}))},it=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function st(e,t,n,r){var a=[];try{var i=ee(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(a){for(var i=arguments.length,s=new Array(i>1?i-1:0),c=1;c<i;c++)s[c-1]=arguments[c];if(!ae(this,t,n,!0)){var u=function(e){return"experimental-webgl"===e?"webgl":e}(a);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(s[0]&&"object"===o(s[0])){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[a].concat(s))}}));a.push(i)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){a.forEach((function(e){return e()}))}}function ct(e,t,n,r,o,a,i){var s,c=[],u=g(Object.getOwnPropertyNames(e));try{var l=function(){var a=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return"continue";try{if("function"!=typeof e[a])return"continue";var u=ee(e,a,(function(e){return function(){for(var s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];var l=e.apply(this,c);if(rt(l,i,this),"tagName"in this.canvas&&!ae(this.canvas,r,o,!0)){var d=at([].concat(c),i,this),p={type:t,property:a,args:d};n(this.canvas,p)}return l}}));c.push(u)}catch(r){var l=$(e,a,{set:function(e){n(this.canvas,{type:t,property:a,args:[e],setter:!0})}});c.push(l)}};for(u.s();!(s=u.n()).done;)l()}catch(e){u.e(e)}finally{u.f()}return c}function ut(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,a=n.length;o<a;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),a=o.indexOf("\n",10)+1,i=o.substring(a)+(r?"//# sourceMappingURL="+r:""),s=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(s)}var lt,dt,pt,ft,ht,gt,mt,vt=(lt="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",dt=null,pt=!1,function(e){return ft=ft||ut(lt,dt,pt),new Worker(ft,e)}),yt=function(){function e(t){var n=this;s(this,e),this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(n.rafStamps.invokeId&&n.rafStamps.latestId!==n.rafStamps.invokeId)&&n.rafStamps.invokeId||(n.rafStamps.invokeId=n.rafStamps.latestId),n.pendingCanvasMutations.has(e)||n.pendingCanvasMutations.set(e,[]),n.pendingCanvasMutations.get(e).push(t)};var r=t.sampling,o=void 0===r?"all":r,a=t.win,i=t.blockClass,c=t.blockSelector,u=t.recordCanvas,l=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,u&&"all"===o&&this.initCanvasMutationObserver(a,i,c),u&&"number"==typeof o&&this.initCanvasFPSObserver(o,a,i,c,{dataURLOptions:l})}return u(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,t,n,o,a){var i=this,s=st(t,n,o,!0),c=new Map,u=new vt;u.onmessage=function(e){var t=e.data.id;if(c.set(t,!1),"base64"in e.data){var n=e.data,r=n.base64,o=n.type,a=n.width,s=n.height;i.mutationCb({id:t,type:Ce["2D"],commands:[{property:"clearRect",args:[0,0,a,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:o}]},0,0]}]})}};var l,d=1e3/e,p=0;l=requestAnimationFrame((function e(s){var f;p&&s-p<d?l=requestAnimationFrame(e):(p=s,(f=[],t.document.querySelectorAll("canvas").forEach((function(e){ae(e,n,o,!0)||f.push(e)})),f).forEach((function(e){return Qe(i,void 0,void 0,r().mark((function t(){var n,o,i,s;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=this.mirror.getId(e),!c.get(o)){t.next=3;break}return t.abrupt("return");case 3:return c.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)&&i.clear(i.COLOR_BUFFER_BIT)),t.next=7,createImageBitmap(e);case 7:s=t.sent,u.postMessage({id:o,bitmap:s,width:e.width,height:e.height,dataURLOptions:a.dataURLOptions},[s]);case 9:case"end":return t.stop()}}),t,this)})))})),l=requestAnimationFrame(e))})),this.resetObservers=function(){s(),cancelAnimationFrame(l)}}},{key:"initCanvasMutationObserver",value:function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=st(e,t,n,!1),o=function(e,t,n,r){var o,a=[],i=g(Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype));try{var s=function(){var i=o.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])return"continue";var s=ee(t.CanvasRenderingContext2D.prototype,i,(function(o){return function(){for(var a=this,s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];return ae(this.canvas,n,r,!0)||setTimeout((function(){var n=at([].concat(c),t,a);e(a.canvas,{type:Ce["2D"],property:i,args:n})}),0),o.apply(this,c)}}));a.push(s)}catch(n){var c=$(t.CanvasRenderingContext2D.prototype,i,{set:function(t){e(this.canvas,{type:Ce["2D"],property:i,args:[t],setter:!0})}});a.push(c)}};for(i.s();!(o=i.n()).done;)s()}catch(e){i.e(e)}finally{i.f()}return function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n),a=function(e,t,n,r,o){var a=[];return a.push.apply(a,p(ct(t.WebGLRenderingContext.prototype,Ce.WebGL,e,n,r,0,t))),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,p(ct(t.WebGL2RenderingContext.prototype,Ce.WebGL2,e,n,r,0,t))),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=function(){r(),o(),a()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"startRAFTimestamping",value:function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))}},{key:"flushPendingCanvasMutations",value:function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"flushPendingCanvasMutationFor",value:function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){var t=
3
+ r=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof p?t:p,a=Object.create(o.prototype),i=new w(r||[]);return a._invoke=function(e,t,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return M()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var s=b(i,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,i),a}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d={};function p(){}function f(){}function h(){}var g={};c(g,a,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(k([])));v&&v!==t&&n.call(v,a)&&(g=v);var y=h.prototype=p.prototype=Object.create(g);function I(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function r(o,a,i,s){var c=l(e[o],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,i,s)}),(function(e){r("throw",e,i,s)})):t.resolve(d).then((function(e){u.value=e,i(u)}),(function(e){return r("throw",e,i,s)}))}s(c.arg)}var o;this._invoke=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 b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function S(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 A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function k(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return f.prototype=h,c(y,"constructor",h),c(h,"constructor",f),f.displayName=c(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,c(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},I(C.prototype),c(C.prototype,i,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(t,n,r,o),a);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},I(y),c(y,s,"Generator"),c(y,a,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=k,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},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 t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(i)},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),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function o(e){return o="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},o(e)}function a(e,t,n,r,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,c,"next",e)}function c(e){a(i,r,o,s,c,"throw",e)}s(void 0)}))}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){s=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw o}}return a}(e,t)||f(e,t)||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.")}()}function p(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||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.")}()}function f(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=f(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 a,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw a}}}}var m;function v(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function y(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function I(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(C).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function C(e){var t;if(function(e){return"styleSheet"in e}(e))try{t=I(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}return function(e){if(e.includes(":")){var t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}return e}(t||e.cssText)}!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"}(m||(m={}));var b=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function S(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,o=e.type,a=e.value,i=e.maskInputFn,s=a||"",c=o&&A(o);return(n[r.toLowerCase()]||c&&n[c])&&(s=i?i(s,t):"*".repeat(s.length)),s}function A(e){return e.toLowerCase()}var w="__rrweb_original__";function k(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?A(t):null}var M,T,O=1,N=new RegExp("[^a-z0-9-_:]"),E=-2;function R(){return O++}var x=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,L=/^(?:[a-z+]+:)?\/\//i,F=/^www\..*/i,D=/^(data:)([^,]*),(.*)/i;function B(e,t){return(e||"").replace(x,(function(e,n,r,o,a,i){var s,c=r||a||i,u=n||o||"";if(!c)return e;if(L.test(c)||F.test(c))return"url(".concat(u).concat(c).concat(u,")");if(D.test(c))return"url(".concat(u).concat(c).concat(u,")");if("/"===c[0])return"url(".concat(u).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)).concat(u,")");var l=t.split("/"),d=c.split("/");l.pop();for(var p=0,f=d;p<f.length;p++){var h=f[p];"."!==h&&(".."===h?l.pop():l.push(h))}return"url(".concat(u).concat(l.join("/")).concat(u,")")}))}var W=/^[^ \t\n\r\u000c]+/,G=/^[, \t\n\r\u000c]+/;function V(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function Z(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function U(){var e=document.createElement("a");return e.href="",e.href}function K(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?V(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(G),!(n>=t.length);){var a=r(W);if(","===a.slice(-1))a=V(e,a.substring(0,a.length-1)),o.push(a);else{var i="";a=V(e,a);for(var s=!1;;){var c=t.charAt(n);if(""===c){o.push((a+i).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){n+=1,o.push((a+i).trim());break}"("===c&&(s=!0)}i+=c,n+=1}}}return o.join(", ")}(e,r):"style"===n?B(r,U()):"object"===t&&"data"===n?V(e,r):r:V(e,r):r}function _(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function j(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&j(e.parentNode,t,n);for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&j(e.parentNode,t,n)}function P(e,t,n){try{var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(r.closest(".".concat(t)))return!0}else if(j(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}}catch(e){}return!1}function H(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,a=t.blockSelector,i=t.maskTextClass,s=t.maskTextSelector,c=t.inlineStylesheet,u=t.maskInputOptions,l=void 0===u?{}:u,d=t.maskTextFn,p=t.maskInputFn,f=t.dataURLOptions,h=void 0===f?{}:f,g=t.inlineImages,v=t.recordCanvas,y=t.keepIframeSrcFn,C=t.newlyAddedElement,b=void 0!==C&&C,O=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:m.Document,childNodes:[],compatMode:e.compatMode}:{type:m.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:m.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:O};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,r=t.blockClass,o=t.blockSelector,a=t.inlineStylesheet,i=t.maskInputOptions,s=void 0===i?{}:i,c=t.maskInputFn,u=t.dataURLOptions,l=void 0===u?{}:u,d=t.inlineImages,p=t.recordCanvas,f=t.keepIframeSrcFn,h=t.newlyAddedElement,g=void 0!==h&&h,v=t.rootId,y=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,o),C=function(e){if(e instanceof HTMLFormElement)return"form";var t=A(e.tagName);return N.test(t)?"div":t}(e),b={},O=e.attributes.length,E=0;E<O;E++){var R=e.attributes[E];_(C,R.name,R.value)||(b[R.name]=K(n,C,A(R.name),R.value))}if("link"===C&&a){var x=Array.from(n.styleSheets).find((function(t){return t.href===e.href})),L=null;x&&(L=I(x)),L&&(delete b.rel,delete b.href,b._cssText=B(L,x.href))}if("style"===C&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(L=I(e.sheet))&&(b._cssText=B(L,U()))}if("input"===C||"textarea"===C||"select"===C){var F=e.value,D=e.checked;if("radio"!==b.type&&"checkbox"!==b.type&&"submit"!==b.type&&"button"!==b.type&&F){var W=k(e);b.value=S({element:e,type:W,tagName:C,value:F,maskInputOptions:s,maskInputFn:c})}else D&&(b.checked=D)}"option"===C&&(e.selected&&!s.select?b.selected=!0:delete b.selected);if("canvas"===C&&p)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData,a=w in o?o[w]:o;if(new Uint32Array(a.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(b.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){var G=e.toDataURL(l.type,l.quality),V=document.createElement("canvas");V.width=e.width,V.height=e.height,G!==V.toDataURL(l.type,l.quality)&&(b.rr_dataURL=G)}if("img"===C&&d){M||(M=n.createElement("canvas"),T=M.getContext("2d"));var j=e,P=j.crossOrigin;j.crossOrigin="anonymous";var H=function e(){j.removeEventListener("load",e);try{M.width=j.naturalWidth,M.height=j.naturalHeight,T.drawImage(j,0,0),b.rr_dataURL=M.toDataURL(l.type,l.quality)}catch(e){console.warn("Cannot inline img src=".concat(j.currentSrc,"! Error: ").concat(e))}P?b.crossOrigin=P:j.removeAttribute("crossorigin")};j.complete&&0!==j.naturalWidth?H():j.addEventListener("load",H)}"audio"!==C&&"video"!==C||(b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime);g||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop));if(y){var Y=e.getBoundingClientRect(),J=Y.width,q=Y.height;b={class:b.class,rr_width:"".concat(J,"px"),rr_height:"".concat(q,"px")}}"iframe"!==C||f(b.src)||(e.contentDocument||(b.rr_src=b.src),delete b.src);return{type:m.Element,tagName:C,attributes:b,childNodes:[],isSVG:Z(e)||void 0,needBlock:y,rootId:v}}(e,{doc:n,blockClass:o,blockSelector:a,inlineStylesheet:c,maskInputOptions:l,maskInputFn:p,dataURLOptions:h,inlineImages:g,recordCanvas:v,keepIframeSrcFn:y,newlyAddedElement:b,rootId:O});case e.TEXT_NODE:return function(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,a=t.maskTextFn,i=t.rootId,s=e.parentNode&&e.parentNode.tagName,c=e.textContent,u="STYLE"===s||void 0,l="SCRIPT"===s||void 0;if(u&&c){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(c=I(e.parentNode.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}c=B(c,U())}l&&(c="SCRIPT_PLACEHOLDER");!u&&!l&&c&&P(e,r,o)&&(c=a?a(c):c.replace(/[\S]/g,"*"));return{type:m.Text,textContent:c||"",isStyle:u,rootId:i}}(e,{maskTextClass:i,maskTextSelector:s,maskTextFn:d,rootId:O});case e.CDATA_SECTION_NODE:return{type:m.CDATA,textContent:"",rootId:O};case e.COMMENT_NODE:return{type:m.Comment,textContent:e.textContent||"",rootId:O};default:return!1}}function Y(e){return null==e?"":e.toLowerCase()}function J(e,t){var n,r=t.doc,o=t.mirror,a=t.blockClass,i=t.blockSelector,s=t.maskTextClass,c=t.maskTextSelector,u=t.skipChild,l=void 0!==u&&u,d=t.inlineStylesheet,p=void 0===d||d,f=t.maskInputOptions,h=void 0===f?{}:f,g=t.maskTextFn,I=t.maskInputFn,C=t.slimDOMOptions,b=t.dataURLOptions,S=void 0===b?{}:b,A=t.inlineImages,w=void 0!==A&&A,k=t.recordCanvas,M=void 0!==k&&k,T=t.onSerialize,O=t.onIframeLoad,N=t.iframeLoadTimeout,x=void 0===N?5e3:N,L=t.onStylesheetLoad,F=t.stylesheetLoadTimeout,D=void 0===F?5e3:F,B=t.keepIframeSrcFn,W=void 0===B?function(){return!1}:B,G=t.newlyAddedElement,V=void 0!==G&&G,Z=t.preserveWhiteSpace,U=void 0===Z||Z,K=H(e,{doc:r,mirror:o,blockClass:a,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:p,maskInputOptions:h,maskTextFn:g,maskInputFn:I,dataURLOptions:S,inlineImages:w,recordCanvas:M,keepIframeSrcFn:W,newlyAddedElement:V});if(!K)return console.warn(e,"not serialized"),null;n=o.hasNode(e)?o.getId(e):!function(e,t){if(t.comment&&e.type===m.Comment)return!0;if(e.type===m.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Y(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Y(e.attributes.name)||"icon"===Y(e.attributes.rel)||"apple-touch-icon"===Y(e.attributes.rel)||"shortcut icon"===Y(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Y(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Y(e.attributes.property).match(/^(og|twitter|fb):/)||Y(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Y(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Y(e.attributes.name)||"googlebot"===Y(e.attributes.name)||"bingbot"===Y(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Y(e.attributes.name)||"generator"===Y(e.attributes.name)||"framework"===Y(e.attributes.name)||"publisher"===Y(e.attributes.name)||"progid"===Y(e.attributes.name)||Y(e.attributes.property).match(/^article:/)||Y(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Y(e.attributes.name)||"yandex-verification"===Y(e.attributes.name)||"csrf-token"===Y(e.attributes.name)||"p:domain_verify"===Y(e.attributes.name)||"verify-v1"===Y(e.attributes.name)||"verification"===Y(e.attributes.name)||"shopify-checkout-api-token"===Y(e.attributes.name)))return!0}}return!1}(K,C)&&(U||K.type!==m.Text||K.isStyle||K.textContent.replace(/^\s+|\s+$/gm,"").length)?R():E;var _=Object.assign(K,{id:n});if(o.add(e,_),n===E)return null;T&&T(e);var j=!l;if(_.type===m.Element){j=j&&!_.needBlock,delete _.needBlock;var P=e.shadowRoot;P&&y(P)&&(_.isShadowHost=!0)}if((_.type===m.Document||_.type===m.Element)&&j){C.headWhitespace&&_.type===m.Element&&"head"===_.tagName&&(U=!1);for(var q={doc:r,mirror:o,blockClass:a,blockSelector:i,maskTextClass:s,maskTextSelector:c,skipChild:l,inlineStylesheet:p,maskInputOptions:h,maskTextFn:g,maskInputFn:I,slimDOMOptions:C,dataURLOptions:S,inlineImages:w,recordCanvas:M,preserveWhiteSpace:U,onSerialize:T,onIframeLoad:O,iframeLoadTimeout:x,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:W},z=0,Q=Array.from(e.childNodes);z<Q.length;z++){(ee=J(Q[z],q))&&_.childNodes.push(ee)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var X=0,$=Array.from(e.shadowRoot.childNodes);X<$.length;X++){var ee;(ee=J($[X],q))&&(y(e.shadowRoot)&&(ee.isShadow=!0),_.childNodes.push(ee))}}return e.parentNode&&v(e.parentNode)&&y(e.parentNode)&&(_.isShadow=!0),_.type===m.Element&&"iframe"===_.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,a=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var i="about:blank";if(r.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)}),n);e.addEventListener("load",(function(){clearTimeout(s),a=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&O){var n=J(t,{doc:t,mirror:o,blockClass:a,blockSelector:i,maskTextClass:s,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskTextFn:g,maskInputFn:I,slimDOMOptions:C,dataURLOptions:S,inlineImages:w,recordCanvas:M,preserveWhiteSpace:U,onSerialize:T,onIframeLoad:O,iframeLoadTimeout:x,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:W});n&&O(e,n)}}),x),_.type===m.Element&&"link"===_.tagName&&"stylesheet"===_.attributes.rel&&function(e,t,n){var r,o=!1;try{r=e.sheet}catch(e){return}if(!r){var a=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(a),o=!0,t()}))}}(e,(function(){if(L){var t=J(e,{doc:r,mirror:o,blockClass:a,blockSelector:i,maskTextClass:s,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskTextFn:g,maskInputFn:I,slimDOMOptions:C,dataURLOptions:S,inlineImages:w,recordCanvas:M,preserveWhiteSpace:U,onSerialize:T,onIframeLoad:O,iframeLoadTimeout:x,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:W});t&&L(e,t)}}),D),_}function q(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var z="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.",Q={map:{},getId:function(){return console.error(z),-1},getNode:function(){return console.error(z),null},removeNodeFromMap:function(){console.error(z)},has:function(){return console.error(z),!1},reset:function(){console.error(z)}};function X(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];var c=Date.now();o||!1!==n.leading||(o=c);var u=t-(c-o),l=this;u<=0||u>t?(r&&(clearTimeout(r),r=null),o=c,e.apply(l,i)):r||!1===n.trailing||(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(l,i)}),u))}}function $(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,a=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return $(e,t,a||{},!0)}}function ee(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Q=new Proxy(Q,{get:function(e,t,n){return"map"===t&&console.error(z),Reflect.get(e,t,n)}}));var te=Date.now;function ne(e){var t,n,r,o,a,i,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==s?void 0:s.documentElement.scrollLeft)||(null===(n=null===(t=null==s?void 0:s.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==s?void 0:s.body)||void 0===r?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null===(a=null===(o=null==s?void 0:s.body)||void 0===o?void 0:o.parentElement)||void 0===a?void 0:a.scrollTop)||(null===(i=null==s?void 0:s.body)||void 0===i?void 0:i.scrollTop)||0}}function re(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function oe(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ae(e,t,n,r){if(!e)return!1;var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(j(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function ie(e,t){return t.getId(e)===E}function se(e,t){if(v(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||se(e.parentNode,t))}function ce(e){return Boolean(e.changedTouches)}function ue(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 de(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(te=function(){return(new Date).getTime()});var pe=function(){function e(){s(this,e),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return u(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):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}},{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}();function fe(e){var t,n,r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function he(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=fe(n);)n=t;return n}(e);return t.contains(n)}function ge(e){var t=e.ownerDocument;return!!t&&(t.contains(e)||he(e))}var me=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}(me||{}),ve=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}(ve||{}),ye=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}(ye||{}),Ie=function(e){return e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e}(Ie||{}),Ce=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(Ce||{});function be(e){return"__ln"in e}var Se,Ae=function(){function e(){s(this,e),this.length=0,this.head=null,this.tail=null}return u(e,[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}},{key:"addNode",value:function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&be(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&be(e.nextSibling)&&e.nextSibling.__ln.previous){var r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=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.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}]),e}(),we=function(e,t){return"".concat(e,"@").concat(t)},ke=function(){function e(){var t=this;s(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=[],n=new Set,r=new Ae,o=function(e){for(var n=e,r=E;r===E;)r=(n=n&&n.nextSibling)&&t.mirror.getId(n);return r},a=function(a){if(a.parentNode&&ge(a)){var i=v(a.parentNode)?t.mirror.getId(fe(a)):t.mirror.getId(a.parentNode),s=o(a);if(-1===i||-1===s)return r.addNode(a);var c=J(a,{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){ue(e,t.mirror)&&t.iframeManager.addIframe(e),le(e,t.mirror)&&t.stylesheetManager.trackLinkElement(e),de(a)&&t.shadowDomManager.addShadowRoot(a.shadowRoot,t.doc)},onIframeLoad:function(e,n){t.iframeManager.attachIframe(e,n),t.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,n){t.stylesheetManager.attachLinkElement(e,n)}});c&&(e.push({parentId:i,nextId:s,node:c}),n.add(c.id))}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());var i,s=g(t.movedSet);try{for(s.s();!(i=s.n()).done;){var c=i.value;Te(t.removes,c,t.mirror)&&!t.movedSet.has(c.parentNode)||a(c)}}catch(e){s.e(e)}finally{s.f()}var u,l=g(t.addedSet);try{for(l.s();!(u=l.n()).done;){var d=u.value;Ne(t.droppedSet,d)||Te(t.removes,d,t.mirror)?Ne(t.movedSet,d)?a(d):t.droppedSet.add(d):a(d)}}catch(e){l.e(e)}finally{l.f()}for(var p=null;r.length;){var f=null;if(p){var h=t.mirror.getId(p.value.parentNode),m=o(p.value);-1!==h&&-1!==m&&(f=p)}if(!f)for(var y=r.tail;y;){var I=y;if(y=y.previous,I){var C=t.mirror.getId(I.value.parentNode);if(-1===o(I.value))continue;if(-1!==C){f=I;break}var b=I.value;if(b.parentNode&&b.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var S=b.parentNode.host;if(-1!==t.mirror.getId(S)){f=I;break}}}}if(!f){for(;r.head;)r.removeNode(r.head.value);break}p=f.previous,r.removeNode(f.value),a(f.value)}var A={texts:t.texts.map((function(e){return{id:t.mirror.getId(e.node),value:e.value}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),attributes:t.attributes.map((function(e){var n=e.attributes;if("string"==typeof n.style){var r=JSON.stringify(e.styleDiff),o=JSON.stringify(e._unchangedStyles);r.length<n.style.length&&(r+o).split("var(").length===n.style.split("var(").length&&(n.style=e.styleDiff)}return{id:t.mirror.getId(e.node),attributes:n}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),removes:t.removes,adds:e};(A.texts.length||A.attributes.length||A.removes.length||A.adds.length)&&(t.texts=[],t.attributes=[],t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.movedMap={},t.mutationCb(A))}},this.processMutation=function(e){if(!ie(e.target,t.mirror)){var n;try{n=document.implementation.createHTMLDocument()}catch(e){n=t.doc}switch(e.type){case"characterData":var r=e.target.textContent;ae(e.target,t.blockClass,t.blockSelector,!1)||r===e.oldValue||t.texts.push({value:P(e.target,t.maskTextClass,t.maskTextSelector)&&r?t.maskTextFn?t.maskTextFn(r):r.replace(/[\S]/g,"*"):r,node:e.target});break;case"attributes":var o=e.target,a=e.attributeName,i=e.target.getAttribute(a);if("value"===a){var s=k(o);i=S({element:o,maskInputOptions:t.maskInputOptions,tagName:o.tagName,type:s,value:i,maskInputFn:t.maskInputFn})}if(ae(e.target,t.blockClass,t.blockSelector,!1)||i===e.oldValue)return;var c=t.attributes.find((function(t){return t.node===e.target}));if("IFRAME"===o.tagName&&"src"===a&&!t.keepIframeSrcFn(i)){if(o.contentDocument)return;a="rr_src"}if(c||(c={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(c)),"type"===a&&"INPUT"===o.tagName&&"password"===(e.oldValue||"").toLowerCase()&&o.setAttribute("data-rr-is-password","true"),!_(o.tagName,a)&&(c.attributes[a]=K(t.doc,A(o.tagName),A(a),i),"style"===a)){var u=n.createElement("span");e.oldValue&&u.setAttribute("style",e.oldValue);for(var l=0,d=Array.from(o.style);l<d.length;l++){var p=d[l],f=o.style.getPropertyValue(p),h=o.style.getPropertyPriority(p);f!==u.style.getPropertyValue(p)||h!==u.style.getPropertyPriority(p)?c.styleDiff[p]=""===h?f:[f,h]:c._unchangedStyles[p]=[f,h]}for(var g=0,m=Array.from(u.style);g<m.length;g++){var I=m[g];""===o.style.getPropertyValue(I)&&(c.styleDiff[I]=!1)}}break;case"childList":if(ae(e.target,t.blockClass,t.blockSelector,!0))return;e.addedNodes.forEach((function(n){return t.genAdds(n,e.target)})),e.removedNodes.forEach((function(n){var r=t.mirror.getId(n),o=v(e.target)?t.mirror.getId(e.target.host):t.mirror.getId(e.target);ae(e.target,t.blockClass,t.blockSelector,!1)||ie(n,t.mirror)||!function(e,t){return-1!==t.getId(e)}(n,t.mirror)||(t.addedSet.has(n)?(Me(t.addedSet,n),t.droppedSet.add(n)):t.addedSet.has(e.target)&&-1===r||se(e.target,t.mirror)||(t.movedSet.has(n)&&t.movedMap[we(r,o)]?Me(t.movedSet,n):t.removes.push({parentId:o,id:r,isShadow:!(!v(e.target)||!y(e.target))||void 0})),t.mapRemoves.push(n))}))}}},this.genAdds=function(e,n){if(!t.processedNodeManager.inOtherBuffer(e,t)&&!t.addedSet.has(e)&&!t.movedSet.has(e)){if(t.mirror.hasNode(e)){if(ie(e,t.mirror))return;t.movedSet.add(e);var r=null;n&&t.mirror.hasNode(n)&&(r=t.mirror.getId(n)),r&&-1!==r&&(t.movedMap[we(t.mirror.getId(e),r)]=!0)}else t.addedSet.add(e),t.droppedSet.delete(e);ae(e,t.blockClass,t.blockSelector,!1)||(e.childNodes.forEach((function(e){return t.genAdds(e)})),de(e)&&e.shadowRoot.childNodes.forEach((function(n){t.processedNodeManager.add(n,t),t.genAdds(n,e)})))}}}return u(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","processedNodeManager"].forEach((function(n){t[n]=e[n]}))}},{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 Me(e,t){e.delete(t),t.childNodes.forEach((function(t){return Me(e,t)}))}function Te(e,t,n){return 0!==e.length&&Oe(e,t,n)}function Oe(e,t,n){var r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||Oe(e,r,n)}function Ne(e,t){return 0!==e.size&&Ee(e,t)}function Ee(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||Ee(e,n))}function Re(e){Se=e}function xe(){Se=void 0}var Le=function(e){if(!Se)return e;return function(){try{return e.apply(void 0,arguments)}catch(e){if(Se&&!0===Se(e))return;throw e}}},Fe=[];function De(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]}catch(e){}return e&&e.target}function Be(e,t){var n,r,o=new ke;Fe.push(o),o.init(e);var a=window.MutationObserver||window.__rrMutationObserver,i=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");i&&window[i]&&(a=window[i]);var s=new a(Le(o.processMutations.bind(o)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function We(e){var t=e.mouseInteractionCb,n=e.doc,r=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,c=[],u=null;return Object.keys(ye).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(e){var i=A(e),s=function(e){return function(n){var i=De(n);if(!ae(i,o,a,!0)){var s=null,c=e;if("pointerType"in n){switch(n.pointerType){case"mouse":s=Ie.Mouse;break;case"touch":s=Ie.Touch;break;case"pen":s=Ie.Pen}s===Ie.Touch?ye[e]===ye.MouseDown?c="TouchStart":ye[e]===ye.MouseUp&&(c="TouchEnd"):Ie.Pen}else ce(n)&&(s=Ie.Touch);null!==s?(u=s,(c.startsWith("Touch")&&s===Ie.Touch||c.startsWith("Mouse")&&s===Ie.Mouse)&&(s=null)):ye[e]===ye.Click&&(s=u,u=null);var l=ce(n)?n.changedTouches[0]:n;if(l){var d=r.getId(i),p=l.clientX,f=l.clientY;Le(t)(Object.assign({type:ye[c],id:d,x:p,y:f},null!==s&&{pointerType:s}))}}}}(e);if(window.PointerEvent)switch(ye[e]){case ye.MouseDown:case ye.MouseUp:i=i.replace("mouse","pointer");break;case ye.TouchStart:case ye.TouchEnd:return}c.push(q(i,s,n))})),Le((function(){c.forEach((function(e){return e()}))}))}function Ge(e){var t=e.scrollCb,n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.sampling;return q("scroll",Le(X(Le((function(e){var i=De(e);if(i&&!ae(i,o,a,!0)){var s=r.getId(i);if(i===n&&n.defaultView){var c=ne(n.defaultView);t({id:s,x:c.left,y:c.top})}else t({id:s,x:i.scrollLeft,y:i.scrollTop})}})),i.scroll||100)),n)}function Ve(e,t){var n=Object.assign({},e);return t||delete n.userTriggered,n}var Ze=["INPUT","TEXTAREA","SELECT"],Ue=new WeakMap;function Ke(e){return function(e,t){if(He("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||He("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||He("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||He("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function _e(e,t,n){var r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function je(e,t){var n,r,o,a=e.mirror,i=e.stylesheetManager,s=null;s="#document"===t.nodeName?a.getId(t):a.getId(t.host);var c="#document"===t.nodeName?null===(n=t.defaultView)||void 0===n?void 0:n.Document:null===(o=null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===o?void 0:o.ShadowRoot,u=Object.getOwnPropertyDescriptor(null==c?void 0:c.prototype,"adoptedStyleSheets");return null!==s&&-1!==s&&c&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:function(){var e;return null===(e=u.get)||void 0===e?void 0:e.call(this)},set:function(e){var t,n=null===(t=u.set)||void 0===t?void 0:t.call(this,e);if(null!==s&&-1!==s)try{i.adoptStyleSheets(e,s)}catch(e){}return n}}),Le((function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):function(){}}function Pe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.doc.defaultView;if(!n)return function(){};!function(e,t){var n=e.mutationCb,r=e.mousemoveCb,o=e.mouseInteractionCb,a=e.scrollCb,i=e.viewportResizeCb,s=e.inputCb,c=e.mediaInteractionCb,u=e.styleSheetRuleCb,l=e.styleDeclarationCb,d=e.canvasMutationCb,p=e.fontCb,f=e.selectionCb;e.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),r.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),c.apply(void 0,arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),u.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),d.apply(void 0,arguments)},e.fontCb=function(){t.font&&t.font.apply(t,arguments),p.apply(void 0,arguments)},e.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),f.apply(void 0,arguments)}}(e,t);var r,o=Be(e,e.doc),a=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,o=e.mirror;if(!1===n.mousemove)return function(){};var a,i="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,c=[],u=X(Le((function(e){var n=Date.now()-a;t(c.map((function(e){return e.timeOffset-=n,e})),e),c=[],a=null})),s),l=Le(X(Le((function(e){var t=De(e),n=ce(e)?e.changedTouches[0]:e,r=n.clientX,i=n.clientY;a||(a=te()),c.push({x:r,y:i,id:o.getId(t),timeOffset:te()-a}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?ve.Drag:e instanceof MouseEvent?ve.MouseMove:ve.TouchMove)})),i,{trailing:!1})),d=[q("mousemove",l,r),q("touchmove",l,r),q("drag",l,r)];return Le((function(){d.forEach((function(e){return e()}))}))}(e),i=We(e),s=Ge(e),c=function(e,t){var n=e.viewportResizeCb,r=t.win,o=-1,a=-1;return q("resize",Le(X(Le((function(){var e=re(),t=oe();o===e&&a===t||(n({width:Number(t),height:Number(e)}),o=e,a=t)})),200)),r)}(e,{win:n}),u=function(e){var t=e.inputCb,n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.ignoreClass,s=e.ignoreSelector,c=e.maskInputOptions,u=e.maskInputFn,l=e.sampling,d=e.userTriggeredOnInput;function f(e){var t=De(e),r=e.isTrusted,l=t&&t.tagName;if(t&&"OPTION"===l&&(t=t.parentElement),t&&l&&!(Ze.indexOf(l)<0)&&!ae(t,o,a,!0)&&!(t.classList.contains(i)||s&&t.matches(s))){var p=t.value,f=!1,g=k(t)||"";"radio"===g||"checkbox"===g?f=t.checked:(c[l.toLowerCase()]||c[g])&&(p=S({element:t,maskInputOptions:c,tagName:l,type:g,value:p,maskInputFn:u})),h(t,Le(Ve)({text:p,isChecked:f,userTriggered:r},d));var m=t.name;"radio"===g&&m&&f&&n.querySelectorAll('input[type="radio"][name="'.concat(m,'"]')).forEach((function(e){e!==t&&h(e,Le(Ve)({text:e.value,isChecked:!f,userTriggered:!1},d))}))}}function h(e,n){var o=Ue.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Ue.set(e,n);var a=r.getId(e);Le(t)(Object.assign(Object.assign({},n),{id:a}))}}var g=("last"===l.input?["change"]:["input","change"]).map((function(e){return q(e,Le(f),n)})),m=n.defaultView;if(!m)return function(){g.forEach((function(e){return e()}))};var v=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return v&&v.set&&g.push.apply(g,p(y.map((function(e){return $(e[0],e[1],{set:function(){Le(f)({target:this,isTrusted:!1})}},!1,m)})))),Le((function(){g.forEach((function(e){return e()}))}))}(e),l=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.blockSelector,o=e.mirror,a=e.sampling,i=e.doc,s=Le((function(e){return X(Le((function(a){var i=De(a);if(i&&!ae(i,n,r,!0)){var s=i.currentTime,c=i.volume,u=i.muted,l=i.playbackRate;t({type:e,id:o.getId(i),currentTime:s,volume:c,muted:u,playbackRate:l})}})),a.media||500)})),c=[q("play",s(0),i),q("pause",s(1),i),q("seeked",s(2),i),q("volumechange",s(3),i),q("ratechange",s(4),i)];return Le((function(){c.forEach((function(e){return e()}))}))}(e),f=function(e,t){var n=e.styleSheetRuleCb,r=e.mirror,o=e.stylesheetManager,a=t.win;if(!a.CSSStyleSheet||!a.CSSStyleSheet.prototype)return function(){};var i=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Le((function(e,t,a){var i=d(a,2),s=i[0],c=i[1],u=_e(t,r,o.styleMirror),l=u.id,p=u.styleId;return(l&&-1!==l||p&&-1!==p)&&n({id:l,styleId:p,adds:[{rule:s,index:c}]}),e.apply(t,a)}))});var s,c,u=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Le((function(e,t,a){var i=d(a,1)[0],s=_e(t,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,removes:[{index:i}]}),e.apply(t,a)}))}),a.CSSStyleSheet.prototype.replace&&(s=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Le((function(e,t,a){var i=d(a,1)[0],s=_e(t,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,replace:i}),e.apply(t,a)}))})),a.CSSStyleSheet.prototype.replaceSync&&(c=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:Le((function(e,t,a){var i=d(a,1)[0],s=_e(t,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,replaceSync:i}),e.apply(t,a)}))}));var l={};Ye("CSSGroupingRule")?l.CSSGroupingRule=a.CSSGroupingRule:(Ye("CSSMediaRule")&&(l.CSSMediaRule=a.CSSMediaRule),Ye("CSSConditionRule")&&(l.CSSConditionRule=a.CSSConditionRule),Ye("CSSSupportsRule")&&(l.CSSSupportsRule=a.CSSSupportsRule));var f={};return Object.entries(l).forEach((function(e){var t=d(e,2),a=t[0],i=t[1];f[a]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(f[a].insertRule,{apply:Le((function(e,t,a){var i=d(a,2),s=i[0],c=i[1],u=_e(t.parentStyleSheet,r,o.styleMirror),l=u.id,f=u.styleId;return(l&&-1!==l||f&&-1!==f)&&n({id:l,styleId:f,adds:[{rule:s,index:[].concat(p(Ke(t)),[c||0])}]}),e.apply(t,a)}))}),i.prototype.deleteRule=new Proxy(f[a].deleteRule,{apply:Le((function(e,t,a){var i=d(a,1)[0],s=_e(t.parentStyleSheet,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,removes:[{index:[].concat(p(Ke(t)),[i])}]}),e.apply(t,a)}))})})),Le((function(){a.CSSStyleSheet.prototype.insertRule=i,a.CSSStyleSheet.prototype.deleteRule=u,s&&(a.CSSStyleSheet.prototype.replace=s),c&&(a.CSSStyleSheet.prototype.replaceSync=c),Object.entries(l).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];r.prototype.insertRule=f[n].insertRule,r.prototype.deleteRule=f[n].deleteRule}))}))}(e,{win:n}),h=je(e,e.doc),m=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,o=e.ignoreCSSAttributes,a=e.stylesheetManager,i=t.win,s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Le((function(e,t,i){var c,u=d(i,3),l=u[0],p=u[1],f=u[2];if(o.has(l))return s.apply(t,[l,p,f]);var h=_e(null===(c=t.parentRule)||void 0===c?void 0:c.parentStyleSheet,r,a.styleMirror),g=h.id,m=h.styleId;return(g&&-1!==g||m&&-1!==m)&&n({id:g,styleId:m,set:{property:l,value:p,priority:f},index:Ke(t.parentRule)}),e.apply(t,i)}))});var c=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(c,{apply:Le((function(e,t,i){var s,u=d(i,1)[0];if(o.has(u))return c.apply(t,[u]);var l=_e(null===(s=t.parentRule)||void 0===s?void 0:s.parentStyleSheet,r,a.styleMirror),p=l.id,f=l.styleId;return(p&&-1!==p||f&&-1!==f)&&n({id:p,styleId:f,remove:{property:u},index:Ke(t.parentRule)}),e.apply(t,i)}))}),Le((function(){i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=c}))}(e,{win:n}),v=e.collectFonts?function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var o=[],a=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,n){var r=new i(e,t,n);return a.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=ee(n.fonts,"add",(function(e){return function(n){return setTimeout(Le((function(){var e=a.get(n);e&&(t(e),a.delete(n))})),0),e.apply(this,[n])}}));return o.push((function(){r.FontFace=i})),o.push(s),Le((function(){o.forEach((function(e){return e()}))}))}(e):function(){},y=function(e){var t=e.doc,n=e.mirror,r=e.blockClass,o=e.blockSelector,a=e.selectionCb,i=!0,s=Le((function(){var e=t.getSelection();if(!(!e||i&&(null==e?void 0:e.isCollapsed))){i=e.isCollapsed||!1;for(var s=[],c=e.rangeCount||0,u=0;u<c;u++){var l=e.getRangeAt(u),d=l.startContainer,p=l.startOffset,f=l.endContainer,h=l.endOffset;ae(d,r,o,!0)||ae(f,r,o,!0)||s.push({start:n.getId(d),startOffset:p,end:n.getId(f),endOffset:h})}a({ranges:s})}}));return s(),q("selectionchange",s)}(e),I=[],C=g(e.plugins);try{for(C.s();!(r=C.n()).done;){var b=r.value;I.push(b.observer(b.callback,n,b.options))}}catch(e){C.e(e)}finally{C.f()}return Le((function(){Fe.forEach((function(e){return e.reset()})),o.disconnect(),a(),i(),s(),c(),u(),l(),f(),h(),m(),v(),y(),I.forEach((function(e){return e()}))}))}function He(e){return void 0!==window[e]}function Ye(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var Je=function(){function e(t){s(this,e),this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}return u(e,[{key:"getId",value:function(e,t,n,r){var o=n||this.getIdToRemoteIdMap(e),a=r||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 n=this,r=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getId(e,t,r,o)}))}},{key:"getRemoteId",value:function(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var o=r.get(t);return o||-1}},{key:"getRemoteIds",value:function(e,t){var n=this,r=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getRemoteId(e,t,r)}))}},{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}(),qe=function(){function e(t){s(this,e),this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Je(R),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Je(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}return u(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 n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}}},{key:"transformCrossOriginEvent",value:function(e,t){var n,r=this;switch(t.type){case me.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var o=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,o),this.patchRootIdOnNode(t.data.node,o),{timestamp:t.timestamp,type:me.IncrementalSnapshot,data:{source:ve.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case me.Meta:case me.Load:case me.DomContentLoaded:return!1;case me.Plugin:return t;case me.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case me.IncrementalSnapshot:switch(t.data.source){case ve.Mutation:return t.data.adds.forEach((function(t){r.replaceIds(t,e,["parentId","nextId","previousId"]),r.replaceIdOnNode(t.node,e);var n=r.crossOriginIframeRootIdMap.get(e);n&&r.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((function(t){r.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((function(t){r.replaceIds(t,e,["id"])})),t.data.texts.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case ve.Drag:case ve.TouchMove:case ve.MouseMove:return t.data.positions.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case ve.ViewportResize:return!1;case ve.MediaInteraction:case ve.MouseInteraction:case ve.Scroll:case ve.CanvasMutation:case ve.Input:return this.replaceIds(t.data,e,["id"]),t;case ve.StyleSheetRule:case ve.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case ve.Font:return t;case ve.Selection:return t.data.ranges.forEach((function(t){r.replaceIds(t,e,["start","end"])})),t;case ve.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((function(t){r.replaceStyleIds(t,e,["styleId"])})),t}}}},{key:"replace",value:function(e,t,n,r){var o,a=g(r);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(n,t[i]):t[i]=e.getId(n,t[i]))}}catch(e){a.e(e)}finally{a.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((function(e){n.replaceIdOnNode(e,t)}))}},{key:"patchRootIdOnNode",value:function(e,t){var n=this;e.type===m.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((function(e){n.patchRootIdOnNode(e,t)}))}}]),e}(),ze=function(){function e(t){s(this,e),this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}return u(e,[{key:"init",value:function(){this.reset(),this.patchAttachShadow(Element,document)}},{key:"addShadowRoot",value:function(e,t){var n=this;if(y(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=Be(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((function(){return r.disconnect()})),this.restoreHandlers.push(Ge(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&n.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,n.mirror.getId(e.host)),n.restoreHandlers.push(je({mirror:n.mirror,stylesheetManager:n.bypassOptions.stylesheetManager},e))}),0)}}},{key:"observeAttachShadow",value:function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}},{key:"patchAttachShadow",value:function(e,t){var n=this;this.restoreHandlers.push(ee(e.prototype,"attachShadow",(function(e){return function(r){var o=e.call(this,r);return this.shadowRoot&&ge(this)&&n.addShadowRoot(this.shadowRoot,t),o}})))}},{key:"reset",value:function(){this.restoreHandlers.forEach((function(e){try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}]),e}();function Qe(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}c((r=r.apply(e,t||[])).next())}))}for(var Xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$e="undefined"==typeof Uint8Array?[]:new Uint8Array(256),et=0;et<Xe.length;et++)$e[Xe.charCodeAt(et)]=et;var tt=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=Xe[n[t]>>2],o+=Xe[(3&n[t])<<4|n[t+1]>>4],o+=Xe[(15&n[t+1])<<2|n[t+2]>>6],o+=Xe[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o},nt=new Map;var rt=function(e,t,n){if(e&&(it(e,t)||"object"===o(e))){var r=function(e,t){var n=nt.get(e);return n||(n=new Map,nt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),a=r.indexOf(e);return-1===a&&(a=r.length,r.push(e)),a}};function ot(e,t,n){if(e instanceof Array)return e.map((function(e){return ot(e,t,n)}));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:tt(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ot(e.buffer,t,n),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:[ot(e.data,t,n),e.width,e.height]}:it(e,t)||"object"===o(e)?{rr_type:e.constructor.name,index:rt(e,t,n)}:e}var at=function(e,t,n){return p(e).map((function(e){return ot(e,t,n)}))},it=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function st(e,t,n,r){var a=[];try{var i=ee(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(a){for(var i=arguments.length,s=new Array(i>1?i-1:0),c=1;c<i;c++)s[c-1]=arguments[c];if(!ae(this,t,n,!0)){var u=function(e){return"experimental-webgl"===e?"webgl":e}(a);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(s[0]&&"object"===o(s[0])){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[a].concat(s))}}));a.push(i)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){a.forEach((function(e){return e()}))}}function ct(e,t,n,r,o,a,i){var s,c=[],u=g(Object.getOwnPropertyNames(e));try{var l=function(){var a=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return"continue";try{if("function"!=typeof e[a])return"continue";var u=ee(e,a,(function(e){return function(){for(var s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];var l=e.apply(this,c);if(rt(l,i,this),"tagName"in this.canvas&&!ae(this.canvas,r,o,!0)){var d=at([].concat(c),i,this),p={type:t,property:a,args:d};n(this.canvas,p)}return l}}));c.push(u)}catch(r){var l=$(e,a,{set:function(e){n(this.canvas,{type:t,property:a,args:[e],setter:!0})}});c.push(l)}};for(u.s();!(s=u.n()).done;)l()}catch(e){u.e(e)}finally{u.f()}return c}function ut(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,a=n.length;o<a;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),a=o.indexOf("\n",10)+1,i=o.substring(a)+(r?"//# sourceMappingURL="+r:""),s=new Blob([i],{type:"application/javascript"});return URL.createObjectURL(s)}var lt,dt,pt,ft,ht,gt,mt,vt=(lt="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",dt=null,pt=!1,function(e){return ft=ft||ut(lt,dt,pt),new Worker(ft,e)}),yt=function(){function e(t){var n=this;s(this,e),this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(n.rafStamps.invokeId&&n.rafStamps.latestId!==n.rafStamps.invokeId)&&n.rafStamps.invokeId||(n.rafStamps.invokeId=n.rafStamps.latestId),n.pendingCanvasMutations.has(e)||n.pendingCanvasMutations.set(e,[]),n.pendingCanvasMutations.get(e).push(t)};var r=t.sampling,o=void 0===r?"all":r,a=t.win,i=t.blockClass,c=t.blockSelector,u=t.recordCanvas,l=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,u&&"all"===o&&this.initCanvasMutationObserver(a,i,c),u&&"number"==typeof o&&this.initCanvasFPSObserver(o,a,i,c,{dataURLOptions:l})}return u(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,t,n,o,a){var i=this,s=st(t,n,o,!0),c=new Map,u=new vt;u.onmessage=function(e){var t=e.data.id;if(c.set(t,!1),"base64"in e.data){var n=e.data,r=n.base64,o=n.type,a=n.width,s=n.height;i.mutationCb({id:t,type:Ce["2D"],commands:[{property:"clearRect",args:[0,0,a,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:o}]},0,0]}]})}};var l,d=1e3/e,p=0;l=requestAnimationFrame((function e(s){var f;p&&s-p<d?l=requestAnimationFrame(e):(p=s,(f=[],t.document.querySelectorAll("canvas").forEach((function(e){ae(e,n,o,!0)||f.push(e)})),f).forEach((function(e){return Qe(i,void 0,void 0,r().mark((function t(){var n,o,i,s;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=this.mirror.getId(e),!c.get(o)){t.next=3;break}return t.abrupt("return");case 3:return c.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)&&i.clear(i.COLOR_BUFFER_BIT)),t.next=7,createImageBitmap(e);case 7:s=t.sent,u.postMessage({id:o,bitmap:s,width:e.width,height:e.height,dataURLOptions:a.dataURLOptions},[s]);case 9:case"end":return t.stop()}}),t,this)})))})),l=requestAnimationFrame(e))})),this.resetObservers=function(){s(),cancelAnimationFrame(l)}}},{key:"initCanvasMutationObserver",value:function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=st(e,t,n,!1),o=function(e,t,n,r){var o,a=[],i=g(Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype));try{var s=function(){var i=o.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])return"continue";var s=ee(t.CanvasRenderingContext2D.prototype,i,(function(o){return function(){for(var a=this,s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];return ae(this.canvas,n,r,!0)||setTimeout((function(){var n=at([].concat(c),t,a);e(a.canvas,{type:Ce["2D"],property:i,args:n})}),0),o.apply(this,c)}}));a.push(s)}catch(n){var c=$(t.CanvasRenderingContext2D.prototype,i,{set:function(t){e(this.canvas,{type:Ce["2D"],property:i,args:[t],setter:!0})}});a.push(c)}};for(i.s();!(o=i.n()).done;)s()}catch(e){i.e(e)}finally{i.f()}return function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n),a=function(e,t,n,r,o){var a=[];return a.push.apply(a,p(ct(t.WebGLRenderingContext.prototype,Ce.WebGL,e,n,r,0,t))),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,p(ct(t.WebGL2RenderingContext.prototype,Ce.WebGL2,e,n,r,0,t))),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=function(){r(),o(),a()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"startRAFTimestamping",value:function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))}},{key:"flushPendingCanvasMutations",value:function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"flushPendingCanvasMutationFor",value:function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){var t=
4
4
  /*! *****************************************************************************
5
5
  Copyright (c) Microsoft Corporation.
6
6
 
@@ -15,5 +15,5 @@ r=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,o="functio
15
15
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
16
  PERFORMANCE OF THIS SOFTWARE.
17
17
  ***************************************************************************** */
18
- function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"]);return t})),o=n[0].type;this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),It=function(){function e(t){s(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new pe,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return u(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 n,r={id:t,styleIds:[]},o=[],a=g(e);try{for(a.s();!(n=a.n()).done;){var i=n.value,s=void 0;if(this.styleMirror.has(i))s=this.styleMirror.getId(i);else{s=this.styleMirror.add(i);var c=Array.from(i.rules||CSSRule);o.push({styleId:s,rules:c.map((function(e,t){return{rule:C(e),index:t}}))})}r.styleIds.push(s)}}catch(e){a.e(e)}finally{a.f()}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}(),Ct=function(){function e(){s(this,e),this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}return u(e,[{key:"periodicallyClear",value:function(){var e=this;requestAnimationFrame((function(){e.clear(),e.loop&&e.periodicallyClear()}))}},{key:"inOtherBuffer",value:function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some((function(e){return e!==t}))}},{key:"add",value:function(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"clear",value:function(){this.nodeMap=new WeakMap}},{key:"destroy",value:function(){this.loop=!1}}]),e}();function bt(e){return Object.assign(Object.assign({},e),{timestamp:te()})}var St=!1,At=new b;function wt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,o=e.blockClass,a=void 0===o?"rr-block":o,i=e.blockSelector,s=void 0===i?null:i,c=e.ignoreClass,u=void 0===c?"rr-ignore":c,l=e.ignoreSelector,d=void 0===l?null:l,p=e.maskTextClass,f=void 0===p?"rr-mask":p,h=e.maskTextSelector,m=void 0===h?null:h,v=e.inlineStylesheet,y=void 0===v||v,I=e.maskAllInputs,C=e.maskInputOptions,S=e.slimDOMOptions,A=e.maskInputFn,w=e.maskTextFn,k=e.hooks,M=e.packFn,T=e.sampling,O=void 0===T?{}:T,N=e.dataURLOptions,E=void 0===N?{}:N,R=e.mousemoveWait,x=e.recordCanvas,L=void 0!==x&&x,F=e.recordCrossOriginIframes,D=void 0!==F&&F,B=e.recordAfter,W=void 0===B?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":B,G=e.userTriggeredOnInput,V=void 0!==G&&G,Z=e.collectFonts,U=void 0!==Z&&Z,K=e.inlineImages,_=void 0!==K&&K,j=e.plugins,H=e.keepIframeSrcFn,P=void 0===H?function(){return!1}:H,Y=e.ignoreCSSAttributes,z=void 0===Y?new Set([]):Y;Re(e.errorHandler);var Q=!D||window.parent===window,X=!1;if(!Q)try{window.parent.document&&(X=!1)}catch(e){X=!0}if(Q&&!t)throw new Error("emit function is required");void 0!==R&&void 0===O.mousemove&&(O.mousemove=R),At.reset();var $,ee=!0===I?{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!==C?C:{password:!0},te=!0===S||"all"===S?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===S,headMetaDescKeywords:"all"===S}:S||{};!function(){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,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}();var ae=0,ie=function(e){var t,n=g(j||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return M&&!X&&(e=M(e)),e};ht=function(e,o){var a;if(!(null===(a=Fe[0])||void 0===a?void 0:a.isFrozen())||e.type===me.FullSnapshot||e.type===me.IncrementalSnapshot&&e.data.source===ve.Mutation||Fe.forEach((function(e){return e.unfreeze()})),Q)null==t||t(ie(e),o);else if(X){var i={type:"rrweb",event:ie(e),origin:window.location.origin,isCheckout:o};window.parent.postMessage(i,"*")}if(e.type===me.FullSnapshot)$=e,ae=0;else if(e.type===me.IncrementalSnapshot){if(e.data.source===ve.Mutation&&e.data.isAttachIframe)return;ae++;var s=r&&ae>=r,c=n&&e.timestamp-$.timestamp>n;(s||c)&&gt(!0)}};var se,ce=function(e){ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.Mutation},e)}))},pe=function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.Scroll},e)}))},fe=function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.CanvasMutation},e)}))},he=new It({mutationCb:ce,adoptedStyleSheetCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.AdoptedStyleSheet},e)}))}}),ge=new Je({mirror:At,mutationCb:ce,stylesheetManager:he,recordCrossOriginIframes:D,wrappedEmit:ht}),ye=g(j||[]);try{for(ye.s();!(se=ye.n()).done;){var Ie=se.value;Ie.getMirror&&Ie.getMirror({nodeMirror:At,crossOriginIframeMirror:ge.crossOriginIframeMirror,crossOriginIframeStyleMirror:ge.crossOriginIframeStyleMirror})}}catch(e){ye.e(e)}finally{ye.f()}var Ce=new Ct;mt=new yt({recordCanvas:L,mutationCb:fe,win:window,blockClass:a,blockSelector:s,mirror:At,sampling:O.canvas,dataURLOptions:E});var be=new ze({mutationCb:ce,scrollCb:pe,bypassOptions:{blockClass:a,blockSelector:s,maskTextClass:f,maskTextSelector:m,inlineStylesheet:y,maskInputOptions:ee,dataURLOptions:E,maskTextFn:w,maskInputFn:A,recordCanvas:L,inlineImages:_,sampling:O,slimDOMOptions:te,iframeManager:ge,stylesheetManager:he,canvasManager:mt,keepIframeSrcFn:P,processedNodeManager:Ce},mirror:At});gt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];ht(bt({type:me.Meta,data:{href:window.location.href,width:oe(),height:re()}}),e),he.reset(),be.init(),Fe.forEach((function(e){return e.lock()}));var t=function(e,t){var n=t||{},r=n.mirror,o=void 0===r?new b:r,a=n.blockClass,i=void 0===a?"rr-block":a,s=n.blockSelector,c=void 0===s?null:s,u=n.maskTextClass,l=void 0===u?"rr-mask":u,d=n.maskTextSelector,p=void 0===d?null:d,f=n.inlineStylesheet,h=void 0===f||f,g=n.inlineImages,m=void 0!==g&&g,v=n.recordCanvas,y=void 0!==v&&v,I=n.maskAllInputs,C=void 0!==I&&I,S=n.maskTextFn,A=n.maskInputFn,w=n.slimDOM,k=void 0!==w&&w,M=n.dataURLOptions,T=n.preserveWhiteSpace,O=n.onSerialize,N=n.onIframeLoad,E=n.iframeLoadTimeout,R=n.onStylesheetLoad,x=n.stylesheetLoadTimeout,L=n.keepIframeSrcFn;return q(e,{doc:e,mirror:o,blockClass:i,blockSelector:c,maskTextClass:l,maskTextSelector:p,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===C?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===C?{password:!0}:C,maskTextFn:S,maskInputFn:A,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:M,inlineImages:m,recordCanvas:y,preserveWhiteSpace:T,onSerialize:O,onIframeLoad:N,iframeLoadTimeout:E,onStylesheetLoad:R,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===L?function(){return!1}:L,newlyAddedElement:!1})}(document,{mirror:At,blockClass:a,blockSelector:s,maskTextClass:f,maskTextSelector:m,inlineStylesheet:y,maskAllInputs:ee,maskTextFn:w,slimDOM:te,dataURLOptions:E,recordCanvas:L,inlineImages:_,onSerialize:function(e){ue(e,At)&&ge.addIframe(e),le(e,At)&&he.trackLinkElement(e),de(e)&&be.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){ge.attachIframe(e,t),be.observeAttachShadow(e)},onStylesheetLoad:function(e,t){he.attachLinkElement(e,t)},keepIframeSrcFn:P});if(!t)return console.warn("Failed to snapshot the document");ht(bt({type:me.FullSnapshot,data:{node:t,initialOffset:ne(window)}}),e),Fe.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&he.adoptStyleSheets(document.adoptedStyleSheets,At.getId(document))};try{var Se=[],Ae=function(e){var t;return Le(He)({mutationCb:ce,mousemoveCb:function(e,t){return ht(bt({type:me.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.MouseInteraction},e)}))},scrollCb:pe,viewportResizeCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.ViewportResize},e)}))},inputCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.Input},e)}))},mediaInteractionCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.StyleDeclaration},e)}))},canvasMutationCb:fe,fontCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.Font},e)}))},selectionCb:function(e){ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.Selection},e)}))},blockClass:a,ignoreClass:u,ignoreSelector:d,maskTextClass:f,maskTextSelector:m,maskInputOptions:ee,inlineStylesheet:y,sampling:O,recordCanvas:L,inlineImages:_,userTriggeredOnInput:V,collectFonts:U,doc:e,maskInputFn:A,maskTextFn:w,keepIframeSrcFn:P,blockSelector:s,slimDOMOptions:te,dataURLOptions:E,mirror:At,iframeManager:ge,stylesheetManager:he,shadowDomManager:be,processedNodeManager:Ce,canvasManager:mt,ignoreCSSAttributes:z,plugins:(null===(t=null==j?void 0:j.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 ht(bt({type:me.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},k)};ge.addLoadListener((function(e){try{Se.push(Ae(e.contentDocument))}catch(e){console.warn(e)}}));var we=function(){gt(),Se.push(Ae(document)),St=!0};return"interactive"===document.readyState||"complete"===document.readyState?we():(Se.push(J("DOMContentLoaded",(function(){ht(bt({type:me.DomContentLoaded,data:{}})),"DOMContentLoaded"===W&&we()}))),Se.push(J("load",(function(){ht(bt({type:me.Load,data:{}})),"load"===W&&we()}),window))),function(){Se.forEach((function(e){return e()})),Ce.destroy(),St=!1,xe()}}catch(e){console.warn(e)}}wt.addCustomEvent=function(e,t){if(!St)throw new Error("please add custom event after start recording");ht(bt({type:me.Custom,data:{tag:e,payload:t}}))},wt.freezePage=function(){Fe.forEach((function(e){return e.freeze()}))},wt.takeFullSnapshot=function(e){if(!St)throw new Error("please take full snapshot after start recording");gt(e)},wt.mirror=At;var kt=function(){function e(t){s(this,e),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return u(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}(),Mt=/(^|@)\S+:\d+/,Tt=/^\s*at .*(\S+:\d+|\(native\))/m,Ot=/^(eval@)?(\[native code])?$/,Nt={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Tt)?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(Tt)}),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,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),a=r.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new kt({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(Ot)}),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 kt({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new kt({functionName:r,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,n=e.message.split("\n"),r=[],o=2,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new kt({fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],o=0,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new kt({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Mt)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new kt({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Et(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(var a=0;a<r.children.length;a++){var i=r.children[a];i.localName&&i.localName.toLowerCase&&i.localName.toLowerCase()===n&&o.push(i)}o.length>1&&(n+=":eq(".concat(o.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Rt(e){return"[object Object]"===Object.prototype.toString.call(e)}function xt(e,t){if(0===t)return!0;for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if(Rt(e[o])&&xt(e[o],t-1))return!0}return!1}function Lt(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var a=r.indexOf(this);~a?r.splice(a+1):r.push(this),~a?o.splice(a,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Rt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Rt(e)&&xt(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if(t instanceof Event){var i={};for(var s in t){var c=t[s];Array.isArray(c)?i[s]=Et(c.length?c[0]:null):i[s]=c}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 Ft={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 Dt(e,t,n){var r,o=n?Object.assign({},Ft,n):Ft,a=o.logger;if(!a)return function(){};r="string"==typeof a?t[a]:a;var i=0,s=!1,c=[];if(o.level.includes("error")){var u=function(t){var n=t.message,r=t.error,a=Nt.parse(r).map((function(e){return e.toString()})),i=[Lt(n,o.stringifyOptions)];e({level:"error",trace:a,payload:i})};t.addEventListener("error",u),c.push((function(){t.removeEventListener("error",u)}));var l=function(t){var n,r;t.reason instanceof Error?(n=t.reason,r=[Lt("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),o.stringifyOptions)]):(n=new Error,r=[Lt("Uncaught (in promise)",o.stringifyOptions),Lt(t.reason,o.stringifyOptions)]);var a=Nt.parse(n).map((function(e){return e.toString()}));e({level:"error",trace:a,payload:r})};t.addEventListener("unhandledrejection",l),c.push((function(){t.removeEventListener("unhandledrejection",l)}))}var d,p=g(o.level);try{for(p.s();!(d=p.n()).done;){var f=d.value;c.push(h(r,f))}}catch(e){p.e(e)}finally{p.f()}return function(){c.forEach((function(e){return e()}))};function h(t,n){var r=this;return t[n]?ee(t,n,(function(t){return function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];if(t.apply(r,c),!s){s=!0;try{var l=Nt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=c.map((function(e){return Lt(e,o.stringifyOptions)}));++i<o.lengthThreshold?e({level:n,trace:l,payload:d}):i===o.lengthThreshold&&e({level:"warn",trace:[],payload:[Lt("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(c))}finally{s=!1}}}})):function(){}}}var Bt=Array.isArray,Wt=Object.prototype.toString,Gt=Bt||function(e){return"[object Array]"===Wt.call(e)},Vt=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}},Zt=function(e){return void 0===e},Ut=function(e){return null===e},Kt=function(e){return"[object Boolean]"===Wt.call(e)},_t="undefined"!=typeof window?window:void 0,jt=null==_t?void 0:_t.navigator;null==_t||_t.document,null==jt||jt.userAgent;var Ht=null!=_t?_t:{},Pt="[PostHog.js]",Yt={_log:function(e){if(_t&&Ht.POSTHOG_DEBUG&&!Zt(_t.console)&&_t.console){for(var t=("__rrweb_original__"in _t.console[e]?_t.console[e].__rrweb_original__:_t.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.apply(void 0,[Pt].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Yt._log.apply(Yt,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Yt._log.apply(Yt,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Yt._log.apply(Yt,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[Pt].concat(n))},uninitializedWarning:function(e){Yt.error("You must initialize PostHog before calling ".concat(e))}},qt={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1},Jt=function(e){return"navigation"===e.entryType},zt=function(e){return"resource"===e.entryType};function Qt(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return Vt(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}function Xt(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function $t(e,t){return!!t&&(Kt(t)||t[e])}function en(e,t,n){function r(e){var t=Object.keys(n).find((function(e){return"content-type"===e.toLowerCase()})),r=t&&n[t];return e.some((function(e){return null==r?void 0:r.includes(e)}))}if(!t)return!1;if(Kt(t))return!0;if(Gt(t))return r(t);var o=t[e];return Kt(o)?o:r(o)}function tn(e,t,n,r,o){return nn.apply(this,arguments)}function nn(){return nn=i(r().mark((function e(t,n,o,a,i){var s,c,u,l=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((s=l.length>5&&void 0!==l[5]?l[5]:0)>10)){e.next=4;break}return Yt.warn("Failed to get performance entry for request",{url:o,initiatorType:n}),e.abrupt("return",null);case 4:if(c=t.performance.getEntriesByName(o),u=Xt(c,(function(e){return zt(e)&&e.initiatorType===n&&(!a||e.startTime>=a)&&(!i||e.startTime<=i)}))){e.next=10;break}return e.next=9,new Promise((function(e){return setTimeout(e,50*s)}));case 9:return e.abrupt("return",tn(t,n,o,a,i,s+1));case 10:return e.abrupt("return",u);case 11:case"end":return e.stop()}}),e)}))),nn.apply(this,arguments)}function rn(e,t,o){if(!("performance"in t))return function(){};var a=o?Object.assign({},qt,o):qt,s=function(t){var r=[];t.requests.forEach((function(e){var t=a.maskRequestFn(e);t&&r.push(t)})),(r.length>0||t.isInitial)&&e(n(n({},t),{},{requests:r}))},c=function(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((function(e){return Jt(e)||zt(e)&&n.initiatorTypes.includes(e.initiatorType)}));e({requests:r.map((function(e){return{url:e.name,initiatorType:e.initiatorType,status:"responseStatus"in e?e.responseStatus:void 0,startTime:Math.round(e.startTime),endTime:Math.round(e.responseEnd)}})),isInitial:!0})}var o=new t.PerformanceObserver((function(t){var r=t.getEntries().filter((function(e){return Jt(e)||zt(e)&&n.initiatorTypes.includes(e.initiatorType)&&"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType}));e({requests:r.map((function(e){return{url:e.name,initiatorType:e.initiatorType,status:"responseStatus"in e?e.responseStatus:void 0,startTime:Math.round(e.startTime),endTime:Math.round(e.responseEnd)}}))})}));return o.observe({entryTypes:["navigation","resource"]}),function(){o.disconnect()}}(s,t,a),u=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return function(){};var r=$t("request",n.recordHeaders),o=$t("response",n.recordHeaders),a=Qt(t.XMLHttpRequest.prototype,"open",(function(a){return function(i,s){var c,u,l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,p=arguments.length>4?arguments[4]:void 0,f=this,h=new Request(s),g={},m={},v=f.setRequestHeader.bind(f);f.setRequestHeader=function(e,t){return m[e]=t,v(e,t)},r&&(g.requestHeaders=m);var y=f.send.bind(f);f.send=function(e){return en("request",n.recordBody,m)&&(Zt(e)||Ut(e)?g.requestBody=null:g.requestBody=e),c=t.performance.now(),y(e)},f.addEventListener("readystatechange",(function(){if(f.readyState===f.DONE){u=t.performance.now();var r={};f.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var t=e.split(": "),n=t.shift(),o=t.join(": ");n&&(r[n]=o)})),o&&(g.responseHeaders=r),en("response",n.recordBody,r)&&(Zt(f.response)||Ut(f.response)?g.responseBody=null:g.responseBody=f.response),tn(t,"xmlhttprequest",h.url,c,u).then((function(t){if(!Ut(t)){var n={url:t.name,method:h.method,initiatorType:t.initiatorType,status:f.status,startTime:Math.round(t.startTime),endTime:Math.round(t.responseEnd),requestHeaders:g.requestHeaders,requestBody:g.requestBody,responseHeaders:g.responseHeaders,responseBody:g.responseBody};e({requests:[n]})}})).catch((function(){}))}})),a.call(f,i,s,l,d,p)}}));return function(){a()}}(s,t,a),l=function(e,t,n){if(!n.initiatorTypes.includes("fetch"))return function(){};var o=$t("request",n.recordHeaders),a=$t("response",n.recordHeaders),s=Qt(t,"fetch",(function(s){return function(){var c=i(r().mark((function i(c,u){var l,d,p,f,h,g,m,v;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return l=new Request(c,u),p={},r.prev=2,g={},l.headers.forEach((function(e,t){g[t]=e})),o&&(p.requestHeaders=g),en("request",n.recordBody,g)&&(Zt(l.body)||Ut(l.body)?p.requestBody=null:p.requestBody=l.body),f=t.performance.now(),r.next=10,s(l);case 10:if(d=r.sent,h=t.performance.now(),m={},d.headers.forEach((function(e,t){m[t]=e})),a&&(p.responseHeaders=m),!en("response",n.recordBody,m)){r.next=25;break}return r.prev=16,r.next=19,d.clone().text();case 19:v=r.sent,r.next=24;break;case 22:r.prev=22,r.t0=r.catch(16);case 24:Zt(d.body)||Ut(d.body)?p.responseBody=null:p.responseBody=v;case 25:return r.abrupt("return",d);case 26:return r.prev=26,tn(t,"fetch",l.url,f,h).then((function(t){var n;if(!Ut(t)){var r={url:t.name,method:l.method,initiatorType:t.initiatorType,status:null===(n=d)||void 0===n?void 0:n.status,startTime:Math.round(t.startTime),endTime:Math.round(t.responseEnd),requestHeaders:p.requestHeaders,requestBody:p.requestBody,responseHeaders:p.responseHeaders,responseBody:p.responseBody};e({requests:[r]})}})).catch((function(){})),r.finish(26);case 29:case"end":return r.stop()}}),i,null,[[2,,26,29],[16,22]])})));return function(e,t){return c.apply(this,arguments)}}()}));return function(){s()}}(s,t,a);return function(){c(),u(),l()}}var on="rrweb/network@1",an=function(e){return{name:on,observer:rn,options:e}};_t&&(_t.rrweb={record:wt,version:"v2",rrwebVersion:"2.0.0-alpha.11"},_t.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:Dt,options:e}}},_t.getRecordNetworkPlugin=an),e.NETWORK_PLUGIN_NAME=on,e.default=wt,e.findLast=Xt,e.getRecordNetworkPlugin=an,e.patch=Qt,Object.defineProperty(e,"__esModule",{value:!0})}({});
18
+ function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"]);return t})),o=n[0].type;this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),It=function(){function e(t){s(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new pe,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return u(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 n,r={id:t,styleIds:[]},o=[],a=g(e);try{for(a.s();!(n=a.n()).done;){var i=n.value,s=void 0;if(this.styleMirror.has(i))s=this.styleMirror.getId(i);else{s=this.styleMirror.add(i);var c=Array.from(i.rules||CSSRule);o.push({styleId:s,rules:c.map((function(e,t){return{rule:C(e),index:t}}))})}r.styleIds.push(s)}}catch(e){a.e(e)}finally{a.f()}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}(),Ct=function(){function e(){s(this,e),this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}return u(e,[{key:"periodicallyClear",value:function(){var e=this;requestAnimationFrame((function(){e.clear(),e.loop&&e.periodicallyClear()}))}},{key:"inOtherBuffer",value:function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some((function(e){return e!==t}))}},{key:"add",value:function(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"clear",value:function(){this.nodeMap=new WeakMap}},{key:"destroy",value:function(){this.loop=!1}}]),e}();function bt(e){return Object.assign(Object.assign({},e),{timestamp:te()})}var St=!1,At=new b;function wt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,o=e.blockClass,a=void 0===o?"rr-block":o,i=e.blockSelector,s=void 0===i?null:i,c=e.ignoreClass,u=void 0===c?"rr-ignore":c,l=e.ignoreSelector,d=void 0===l?null:l,p=e.maskTextClass,f=void 0===p?"rr-mask":p,h=e.maskTextSelector,m=void 0===h?null:h,v=e.inlineStylesheet,y=void 0===v||v,I=e.maskAllInputs,C=e.maskInputOptions,S=e.slimDOMOptions,A=e.maskInputFn,w=e.maskTextFn,k=e.hooks,M=e.packFn,T=e.sampling,O=void 0===T?{}:T,N=e.dataURLOptions,E=void 0===N?{}:N,R=e.mousemoveWait,x=e.recordCanvas,L=void 0!==x&&x,F=e.recordCrossOriginIframes,D=void 0!==F&&F,B=e.recordAfter,W=void 0===B?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":B,G=e.userTriggeredOnInput,V=void 0!==G&&G,Z=e.collectFonts,U=void 0!==Z&&Z,K=e.inlineImages,_=void 0!==K&&K,j=e.plugins,P=e.keepIframeSrcFn,H=void 0===P?function(){return!1}:P,Y=e.ignoreCSSAttributes,z=void 0===Y?new Set([]):Y;Re(e.errorHandler);var Q=!D||window.parent===window,X=!1;if(!Q)try{window.parent.document&&(X=!1)}catch(e){X=!0}if(Q&&!t)throw new Error("emit function is required");void 0!==R&&void 0===O.mousemove&&(O.mousemove=R),At.reset();var $,ee=!0===I?{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!==C?C:{password:!0},te=!0===S||"all"===S?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===S,headMetaDescKeywords:"all"===S}:S||{};!function(){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,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}();var ae=0,ie=function(e){var t,n=g(j||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return M&&!X&&(e=M(e)),e};ht=function(e,o){var a;if(!(null===(a=Fe[0])||void 0===a?void 0:a.isFrozen())||e.type===me.FullSnapshot||e.type===me.IncrementalSnapshot&&e.data.source===ve.Mutation||Fe.forEach((function(e){return e.unfreeze()})),Q)null==t||t(ie(e),o);else if(X){var i={type:"rrweb",event:ie(e),origin:window.location.origin,isCheckout:o};window.parent.postMessage(i,"*")}if(e.type===me.FullSnapshot)$=e,ae=0;else if(e.type===me.IncrementalSnapshot){if(e.data.source===ve.Mutation&&e.data.isAttachIframe)return;ae++;var s=r&&ae>=r,c=n&&e.timestamp-$.timestamp>n;(s||c)&&gt(!0)}};var se,ce=function(e){ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.Mutation},e)}))},pe=function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.Scroll},e)}))},fe=function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.CanvasMutation},e)}))},he=new It({mutationCb:ce,adoptedStyleSheetCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.AdoptedStyleSheet},e)}))}}),ge=new qe({mirror:At,mutationCb:ce,stylesheetManager:he,recordCrossOriginIframes:D,wrappedEmit:ht}),ye=g(j||[]);try{for(ye.s();!(se=ye.n()).done;){var Ie=se.value;Ie.getMirror&&Ie.getMirror({nodeMirror:At,crossOriginIframeMirror:ge.crossOriginIframeMirror,crossOriginIframeStyleMirror:ge.crossOriginIframeStyleMirror})}}catch(e){ye.e(e)}finally{ye.f()}var Ce=new Ct;mt=new yt({recordCanvas:L,mutationCb:fe,win:window,blockClass:a,blockSelector:s,mirror:At,sampling:O.canvas,dataURLOptions:E});var be=new ze({mutationCb:ce,scrollCb:pe,bypassOptions:{blockClass:a,blockSelector:s,maskTextClass:f,maskTextSelector:m,inlineStylesheet:y,maskInputOptions:ee,dataURLOptions:E,maskTextFn:w,maskInputFn:A,recordCanvas:L,inlineImages:_,sampling:O,slimDOMOptions:te,iframeManager:ge,stylesheetManager:he,canvasManager:mt,keepIframeSrcFn:H,processedNodeManager:Ce},mirror:At});gt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];ht(bt({type:me.Meta,data:{href:window.location.href,width:oe(),height:re()}}),e),he.reset(),be.init(),Fe.forEach((function(e){return e.lock()}));var t=function(e,t){var n=t||{},r=n.mirror,o=void 0===r?new b:r,a=n.blockClass,i=void 0===a?"rr-block":a,s=n.blockSelector,c=void 0===s?null:s,u=n.maskTextClass,l=void 0===u?"rr-mask":u,d=n.maskTextSelector,p=void 0===d?null:d,f=n.inlineStylesheet,h=void 0===f||f,g=n.inlineImages,m=void 0!==g&&g,v=n.recordCanvas,y=void 0!==v&&v,I=n.maskAllInputs,C=void 0!==I&&I,S=n.maskTextFn,A=n.maskInputFn,w=n.slimDOM,k=void 0!==w&&w,M=n.dataURLOptions,T=n.preserveWhiteSpace,O=n.onSerialize,N=n.onIframeLoad,E=n.iframeLoadTimeout,R=n.onStylesheetLoad,x=n.stylesheetLoadTimeout,L=n.keepIframeSrcFn;return J(e,{doc:e,mirror:o,blockClass:i,blockSelector:c,maskTextClass:l,maskTextSelector:p,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===C?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===C?{password:!0}:C,maskTextFn:S,maskInputFn:A,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:M,inlineImages:m,recordCanvas:y,preserveWhiteSpace:T,onSerialize:O,onIframeLoad:N,iframeLoadTimeout:E,onStylesheetLoad:R,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===L?function(){return!1}:L,newlyAddedElement:!1})}(document,{mirror:At,blockClass:a,blockSelector:s,maskTextClass:f,maskTextSelector:m,inlineStylesheet:y,maskAllInputs:ee,maskTextFn:w,slimDOM:te,dataURLOptions:E,recordCanvas:L,inlineImages:_,onSerialize:function(e){ue(e,At)&&ge.addIframe(e),le(e,At)&&he.trackLinkElement(e),de(e)&&be.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){ge.attachIframe(e,t),be.observeAttachShadow(e)},onStylesheetLoad:function(e,t){he.attachLinkElement(e,t)},keepIframeSrcFn:H});if(!t)return console.warn("Failed to snapshot the document");ht(bt({type:me.FullSnapshot,data:{node:t,initialOffset:ne(window)}}),e),Fe.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&he.adoptStyleSheets(document.adoptedStyleSheets,At.getId(document))};try{var Se=[],Ae=function(e){var t;return Le(Pe)({mutationCb:ce,mousemoveCb:function(e,t){return ht(bt({type:me.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.MouseInteraction},e)}))},scrollCb:pe,viewportResizeCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.ViewportResize},e)}))},inputCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.Input},e)}))},mediaInteractionCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.StyleDeclaration},e)}))},canvasMutationCb:fe,fontCb:function(e){return ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.Font},e)}))},selectionCb:function(e){ht(bt({type:me.IncrementalSnapshot,data:Object.assign({source:ve.Selection},e)}))},blockClass:a,ignoreClass:u,ignoreSelector:d,maskTextClass:f,maskTextSelector:m,maskInputOptions:ee,inlineStylesheet:y,sampling:O,recordCanvas:L,inlineImages:_,userTriggeredOnInput:V,collectFonts:U,doc:e,maskInputFn:A,maskTextFn:w,keepIframeSrcFn:H,blockSelector:s,slimDOMOptions:te,dataURLOptions:E,mirror:At,iframeManager:ge,stylesheetManager:he,shadowDomManager:be,processedNodeManager:Ce,canvasManager:mt,ignoreCSSAttributes:z,plugins:(null===(t=null==j?void 0:j.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 ht(bt({type:me.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},k)};ge.addLoadListener((function(e){try{Se.push(Ae(e.contentDocument))}catch(e){console.warn(e)}}));var we=function(){gt(),Se.push(Ae(document)),St=!0};return"interactive"===document.readyState||"complete"===document.readyState?we():(Se.push(q("DOMContentLoaded",(function(){ht(bt({type:me.DomContentLoaded,data:{}})),"DOMContentLoaded"===W&&we()}))),Se.push(q("load",(function(){ht(bt({type:me.Load,data:{}})),"load"===W&&we()}),window))),function(){Se.forEach((function(e){return e()})),Ce.destroy(),St=!1,xe()}}catch(e){console.warn(e)}}wt.addCustomEvent=function(e,t){if(!St)throw new Error("please add custom event after start recording");ht(bt({type:me.Custom,data:{tag:e,payload:t}}))},wt.freezePage=function(){Fe.forEach((function(e){return e.freeze()}))},wt.takeFullSnapshot=function(e){if(!St)throw new Error("please take full snapshot after start recording");gt(e)},wt.mirror=At;var kt=function(){function e(t){s(this,e),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return u(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}(),Mt=/(^|@)\S+:\d+/,Tt=/^\s*at .*(\S+:\d+|\(native\))/m,Ot=/^(eval@)?(\[native code])?$/,Nt={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Tt)?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(Tt)}),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,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),o=this.extractLocation(n?n[1]:r.pop()),a=r.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new kt({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(Ot)}),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 kt({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new kt({functionName:r,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,n=e.message.split("\n"),r=[],o=2,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new kt({fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],o=0,a=n.length;o<a;o+=2){var i=t.exec(n[o]);i&&r.push(new kt({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Mt)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new kt({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Et(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,o=[];if(r.children&&r.children.length>0)for(var a=0;a<r.children.length;a++){var i=r.children[a];i.localName&&i.localName.toLowerCase&&i.localName.toLowerCase()===n&&o.push(i)}o.length>1&&(n+=":eq(".concat(o.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Rt(e){return"[object Object]"===Object.prototype.toString.call(e)}function xt(e,t){if(0===t)return!0;for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if(Rt(e[o])&&xt(e[o],t-1))return!0}return!1}function Lt(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var a=r.indexOf(this);~a?r.splice(a+1):r.push(this),~a?o.splice(a,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Rt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Rt(e)&&xt(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if(t instanceof Event){var i={};for(var s in t){var c=t[s];Array.isArray(c)?i[s]=Et(c.length?c[0]:null):i[s]=c}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 Ft={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 Dt(e,t,n){var r,o=n?Object.assign({},Ft,n):Ft,a=o.logger;if(!a)return function(){};r="string"==typeof a?t[a]:a;var i=0,s=!1,c=[];if(o.level.includes("error")){var u=function(t){var n=t.message,r=t.error,a=Nt.parse(r).map((function(e){return e.toString()})),i=[Lt(n,o.stringifyOptions)];e({level:"error",trace:a,payload:i})};t.addEventListener("error",u),c.push((function(){t.removeEventListener("error",u)}));var l=function(t){var n,r;t.reason instanceof Error?(n=t.reason,r=[Lt("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),o.stringifyOptions)]):(n=new Error,r=[Lt("Uncaught (in promise)",o.stringifyOptions),Lt(t.reason,o.stringifyOptions)]);var a=Nt.parse(n).map((function(e){return e.toString()}));e({level:"error",trace:a,payload:r})};t.addEventListener("unhandledrejection",l),c.push((function(){t.removeEventListener("unhandledrejection",l)}))}var d,p=g(o.level);try{for(p.s();!(d=p.n()).done;){var f=d.value;c.push(h(r,f))}}catch(e){p.e(e)}finally{p.f()}return function(){c.forEach((function(e){return e()}))};function h(t,n){var r=this;return t[n]?ee(t,n,(function(t){return function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];if(t.apply(r,c),!s){s=!0;try{var l=Nt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=c.map((function(e){return Lt(e,o.stringifyOptions)}));++i<o.lengthThreshold?e({level:n,trace:l,payload:d}):i===o.lengthThreshold&&e({level:"warn",trace:[],payload:[Lt("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(c))}finally{s=!1}}}})):function(){}}}var Bt=Array.isArray,Wt=Object.prototype.toString,Gt=Bt||function(e){return"[object Array]"===Wt.call(e)},Vt=function(e){return"function"==typeof e},Zt=function(e){return void 0===e},Ut=function(e){return null===e},Kt=function(e){return"[object Boolean]"===Wt.call(e)},_t="undefined"!=typeof window?window:void 0,jt=null==_t?void 0:_t.navigator;null==_t||_t.document,null==jt||jt.userAgent;var Pt=null!=_t?_t:{},Ht="[PostHog.js]",Yt={_log:function(e){if(_t&&Pt.POSTHOG_DEBUG&&!Zt(_t.console)&&_t.console){for(var t=("__rrweb_original__"in _t.console[e]?_t.console[e].__rrweb_original__:_t.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.apply(void 0,[Ht].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Yt._log.apply(Yt,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Yt._log.apply(Yt,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Yt._log.apply(Yt,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[Ht].concat(n))},uninitializedWarning:function(e){Yt.error("You must initialize PostHog before calling ".concat(e))}},Jt={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},qt=function(e){return"navigation"===e.entryType},zt=function(e){return"resource"===e.entryType};function Qt(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return Vt(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}function Xt(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function $t(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((function(e){return qt(e)||zt(e)&&n.initiatorTypes.includes(e.initiatorType)}));e({requests:r.flatMap((function(e){return an(e,void 0,void 0,{},!0)})),isInitial:!0})}var o=new t.PerformanceObserver((function(t){var r=t.getEntries().filter((function(e){return qt(e)||zt(e)&&n.initiatorTypes.includes(e.initiatorType)&&function(e){return!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType}(e)}));e({requests:r.flatMap((function(e){return an(e,void 0,void 0,{})}))})})),a=PerformanceObserver.supportedEntryTypes.filter((function(e){return n.performanceEntryTypeToObserve.includes(e)}));return o.observe({entryTypes:a}),function(){o.disconnect()}}function en(e,t){return!!t&&(Kt(t)||t[e])}function tn(e,t,n){function r(e){var t=Object.keys(n).find((function(e){return"content-type"===e.toLowerCase()})),r=t&&n[t];return e.some((function(e){return null==r?void 0:r.includes(e)}))}if(!t)return!1;if(Kt(t))return!0;if(Gt(t))return r(t);var o=t[e];return Kt(o)?o:r(o)}function nn(e,t,n,r,o){return rn.apply(this,arguments)}function rn(){return rn=i(r().mark((function e(t,n,o,a,i){var s,c,u,l=arguments;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((s=l.length>5&&void 0!==l[5]?l[5]:0)>10)){e.next=4;break}return Yt.warn("Failed to get performance entry for request",{url:o,initiatorType:n}),e.abrupt("return",null);case 4:if(c=t.performance.getEntriesByName(o),u=Xt(c,(function(e){return zt(e)&&e.initiatorType===n&&(!a||e.startTime>=a)&&(!i||e.startTime<=i)}))){e.next=10;break}return e.next=9,new Promise((function(e){return setTimeout(e,50*s)}));case 9:return e.abrupt("return",nn(t,n,o,a,i,s+1));case 10:return e.abrupt("return",u);case 11:case"end":return e.stop()}}),e)}))),rn.apply(this,arguments)}var on=function(e){return"navigation"===e.entryType||"resource"===e.entryType};function an(e,t,r,o,a){var i=Math.floor(Date.now()-performance.now()),s=Math.floor(i+e.startTime),c=[n(n({},e.toJSON()),{},{startTime:Math.round(e.startTime),endTime:Math.round(e.responseEnd),timeOrigin:i,timestamp:s,method:t,initiatorType:e.initiatorType,status:r,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:a})];if(on(e)){var u,l=g(e.serverTiming||[]);try{for(l.s();!(u=l.n()).done;){var d=u.value;c.push({timeOrigin:i,timestamp:s,startTime:Math.round(e.startTime),name:d.name,duration:d.duration,entryType:"serverTiming"})}}catch(e){l.e(e)}finally{l.f()}}return c}function sn(e,t,o){if(!("performance"in t))return function(){};var a=o?Object.assign({},Jt,o):Jt,s=function(t){var r=[];t.requests.forEach((function(e){var t=a.maskRequestFn(e);t&&r.push(t)})),(r.length>0||t.isInitial)&&e(n(n({},t),{},{requests:r}))},c=$t(s,t,a),u=function(){},l=function(){};return(a.recordHeaders||a.recordBody)&&(u=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return function(){};var r=en("request",n.recordHeaders),o=en("response",n.recordHeaders),a=Qt(t.XMLHttpRequest.prototype,"open",(function(a){return function(i,s){var c,u,l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,p=arguments.length>4?arguments[4]:void 0,f=this,h=new Request(s),g={},m={},v=f.setRequestHeader.bind(f);f.setRequestHeader=function(e,t){return m[e]=t,v(e,t)},r&&(g.requestHeaders=m);var y=f.send.bind(f);f.send=function(e){return tn("request",n.recordBody,m)&&(Zt(e)||Ut(e)?g.requestBody=null:g.requestBody=e),c=t.performance.now(),y(e)},f.addEventListener("readystatechange",(function(){if(f.readyState===f.DONE){u=t.performance.now();var r={};f.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var t=e.split(": "),n=t.shift(),o=t.join(": ");n&&(r[n]=o)})),o&&(g.responseHeaders=r),tn("response",n.recordBody,r)&&(Zt(f.response)||Ut(f.response)?g.responseBody=null:g.responseBody=f.response),nn(t,"xmlhttprequest",h.url,c,u).then((function(t){if(!Ut(t)){var n=an(t,h.method,null==f?void 0:f.status,g);e({requests:n})}})).catch((function(){}))}})),a.call(f,i,s,l,d,p)}}));return function(){a()}}(s,t,a),l=function(e,t,n){if(!n.initiatorTypes.includes("fetch"))return function(){};var o=en("request",n.recordHeaders),a=en("response",n.recordHeaders),s=Qt(t,"fetch",(function(s){return function(){var c=i(r().mark((function i(c,u){var l,d,p,f,h,g,m,v;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return l=new Request(c,u),p={},r.prev=2,g={},l.headers.forEach((function(e,t){g[t]=e})),o&&(p.requestHeaders=g),tn("request",n.recordBody,g)&&(Zt(l.body)||Ut(l.body)?p.requestBody=null:p.requestBody=l.body),f=t.performance.now(),r.next=10,s(l);case 10:if(d=r.sent,h=t.performance.now(),m={},d.headers.forEach((function(e,t){m[t]=e})),a&&(p.responseHeaders=m),!tn("response",n.recordBody,m)){r.next=25;break}return r.prev=16,r.next=19,d.clone().text();case 19:v=r.sent,r.next=24;break;case 22:r.prev=22,r.t0=r.catch(16);case 24:Zt(d.body)||Ut(d.body)?p.responseBody=null:p.responseBody=v;case 25:return r.abrupt("return",d);case 26:return r.prev=26,nn(t,"fetch",l.url,f,h).then((function(t){var n;if(!Ut(t)){var r=an(t,l.method,null===(n=d)||void 0===n?void 0:n.status,p);e({requests:r})}})).catch((function(){})),r.finish(26);case 29:case"end":return r.stop()}}),i,null,[[2,,26,29],[16,22]])})));return function(e,t){return c.apply(this,arguments)}}()}));return function(){s()}}(s,t,a)),function(){c(),u(),l()}}var cn="rrweb/network@1",un=function(e){return{name:cn,observer:sn,options:e}};_t&&(_t.rrweb={record:wt,version:"v2",rrwebVersion:"2.0.0-alpha.11"},_t.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:Dt,options:e}}},_t.getRecordNetworkPlugin=un),e.NETWORK_PLUGIN_NAME=cn,e.default=wt,e.findLast=Xt,e.getRecordNetworkPlugin=un,e.patch=Qt,Object.defineProperty(e,"__esModule",{value:!0})}({});
19
19
  //# sourceMappingURL=recorder-v2.js.map