var rrwebRecord=function(){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var e,t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i}function o(){for(var e=[],t=0;t-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),d=u.split("/");c.pop();for(var p=0,m=d;p=t.length);){var a=r(k);if(","===a.slice(-1))a=w(e,a.substring(0,a.length-1)),o.push(a);else{var i="";a=w(e,a);for(var s=!1;;){var u=t.charAt(n);if(""===u){o.push((a+i).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,o.push((a+i).trim());break}"("===u&&(s=!0)}i+=u,n+=1}}}return o.join(", ")}(e,r):"style"===n&&r?v(r,T()):"object"===t&&"data"===n&&r?w(e,r):r:w(e,r)}function M(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else e.classList.forEach((function(e){if(t.test(e))return!0}));return!(!n||!e.matches(n))||M(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,M(e.parentNode,t,n)}function E(t,n){var r,o,a,l,p=n.doc,m=n.blockClass,f=n.blockSelector,h=n.maskTextClass,y=n.maskTextSelector,g=n.inlineStylesheet,S=n.maskInputOptions,b=void 0===S?{}:S,C=n.maskTextFn,k=n.maskInputFn,I=n.inlineImages,w=n.recordCanvas,E=n.keepIframeSrcFn;if(p.__sn){var O=p.__sn.id;o=1===O?void 0:O}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:o}:{type:e.Document,childNodes:[],rootId:o};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:o};case t.ELEMENT_NODE:for(var N=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;rt?(r&&(clearTimeout(r),r=null),o=i,e.apply(u,l)):r||!1===n.trailing||(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,l)}),s))}}function L(e,t,n,r,o){void 0===o&&(o=window);var 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 L(e,t,a||{},!0)}}function A(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(){}}}function P(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function z(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function V(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;return"string"==typeof t?n=e.classList.contains(t):e.classList.forEach((function(e){t.test(e)&&(n=!0)})),n||V(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,V(e.parentNode,t)}function j(e){return"__sn"in e&&-2===e.__sn.id}function W(e,t){if(a(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||W(e.parentNode,t))}function H(e){return Boolean(e.changedTouches)}function U(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function B(e){var t;return Boolean(null===(t=e)||void 0===t?void 0:t.shadowRoot)}function X(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(_=new Proxy(_,{get:function(e,t,n){return"map"===t&&console.error(D),Reflect.get(e,t,n)}}));var q=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n=0;b--){var C=u.get(b);if(C){g=e.mirror.getId(C.value.parentNode),S=l(C.value);if(-1!==g&&-1!==S){y=C;break}}}if(!y){for(;u.head;)u.removeNode(u.head.value);break}v=y.previous,u.removeNode(y.value),c(y.value)}var k={texts:e.texts.map((function(t){return{id:e.mirror.getId(t.node),value:t.value}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:s};(k.texts.length||k.attributes.length||k.removes.length||k.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.emissionCallback(k))}},this.processMutation=function(t){var r,o,s,u;if(!j(t.target))switch(t.type){case"characterData":var l=t.target.textContent;V(t.target,e.blockClass)||l===t.oldValue||e.texts.push({value:M(t.target,e.maskTextClass,e.maskTextSelector)&&l?e.maskTextFn?e.maskTextFn(l):l.replace(/[\S]/g,"*"):l,node:t.target});break;case"attributes":var c=t.target;l=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(l=i({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:l,maskInputFn:e.maskInputFn})),V(t.target,e.blockClass)||l===t.oldValue)return;var d=e.attributes.find((function(e){return e.node===t.target}));if(d||(d={node:t.target,attributes:{}},e.attributes.push(d)),"style"===t.attributeName){var p=e.doc.createElement("span");t.oldValue&&p.setAttribute("style",t.oldValue),void 0!==d.attributes.style&&null!==d.attributes.style||(d.attributes.style={});var m=d.attributes.style;try{for(var f=n(Array.from(c.style)),h=f.next();!h.done;h=f.next()){var v=h.value,y=c.style.getPropertyValue(v),g=c.style.getPropertyPriority(v);y===p.style.getPropertyValue(v)&&g===p.style.getPropertyPriority(v)||(m[v]=""===g?y:[y,g])}}catch(e){r={error:e}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}try{for(var S=n(Array.from(p.style)),b=S.next();!b.done;b=S.next()){v=b.value;""===c.style.getPropertyValue(v)&&(m[v]=!1)}}catch(e){s={error:e}}finally{try{b&&!b.done&&(u=S.return)&&u.call(S)}finally{if(s)throw s.error}}}else d.attributes[t.attributeName]=x(e.doc,t.target.tagName,t.attributeName,l);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var r=e.mirror.getId(n),o=a(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);V(t.target,e.blockClass)||j(n)||(e.addedSet.has(n)?($(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||W(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[G(r,o)]?$(e.movedSet,n):e.removes.push({parentId:o,id:r,isShadow:!!a(t.target)||void 0})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!n||!V(n,e.blockClass)){if(Y(t)){if(j(t))return;e.movedSet.add(t);var r=null;n&&Y(n)&&(r=n.__sn.id),r&&(e.movedMap[G(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);V(t,e.blockClass)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e,t,n,r,o,a,i,s,u,l,c,d,p,m,f,h){this.blockClass=t,this.blockSelector=n,this.maskTextClass=r,this.maskTextSelector=o,this.inlineStylesheet=a,this.maskInputOptions=i,this.maskTextFn=s,this.maskInputFn=u,this.recordCanvas=l,this.inlineImages=c,this.slimDOMOptions=d,this.emissionCallback=e,this.doc=p,this.mirror=m,this.iframeManager=f,this.shadowDomManager=h},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1,this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1,this.emit()},e}();function $(e,t){e.delete(t),t.childNodes.forEach((function(t){return $(e,t)}))}function J(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}))||J(e,r,n)}function Z(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||Z(e,n))}var Q=[],ee="undefined"!=typeof CSSGroupingRule,te="undefined"!=typeof CSSMediaRule,ne="undefined"!=typeof CSSSupportsRule,re="undefined"!=typeof CSSConditionRule;function oe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function ae(e,t,n,r,o,a,i,s,u,l,c,d,p,m,f,h,v){var y,g,S,b=new K;Q.push(b),b.init(e,n,r,o,a,i,s,u,l,c,d,p,t,m,f,h);var C=window.MutationObserver||window.__rrMutationObserver,k=null===(S=null===(g=null===(y=window)||void 0===y?void 0:y.Zone)||void 0===g?void 0:g.__symbol__)||void 0===S?void 0:S.call(g,"MutationObserver");k&&window[k]&&(C=window[k]);var I=new C(b.processMutations.bind(b));return I.observe(v,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),I}function ie(e,t,n,r,o){if(!1===o.mouseInteraction)return function(){};var a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,i=[];return Object.keys(S).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(o){var a=o.toLowerCase(),s=function(t){return function(o){var a=oe(o);if(!V(a,r)){var i=H(o)?o.changedTouches[0]:o;if(i){var s=n.getId(a),u=i.clientX,l=i.clientY;e({type:S[t],id:s,x:u,y:l})}}}}(o);i.push(R(a,s,t))})),function(){i.forEach((function(e){return e()}))}}function se(e,t,n,r,o){return R("scroll",F((function(o){var a=oe(o);if(a&&!V(a,r)){var i=n.getId(a);if(a===t){var s=t.scrollingElement||t.documentElement;e({id:i,x:s.scrollLeft,y:s.scrollTop})}else e({id:i,x:a.scrollLeft,y:a.scrollTop})}}),o.scroll||100),t)}function ue(e,n){var r=t({},e);return n||delete r.userTriggered,r}var le=["INPUT","TEXTAREA","SELECT"],ce=new WeakMap;function de(e){return function(e,t){if(ee&&e.parentRule instanceof CSSGroupingRule||te&&e.parentRule instanceof CSSMediaRule||ne&&e.parentRule instanceof CSSSupportsRule||re&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else{n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function pe(e,a){var s,u;void 0===a&&(a={});var l=e.doc.defaultView;if(!l)return function(){};!function(e,t){var n=e.mutationCb,r=e.mousemoveCb,a=e.mouseInteractionCb,i=e.scrollCb,s=e.viewportResizeCb,u=e.inputCb,l=e.mediaInteractionCb,c=e.styleSheetRuleCb,d=e.styleDeclarationCb,p=e.canvasMutationCb,m=e.fontCb;e.mutationCb=function(){for(var e=[],r=0;r=a,s=o&&e.timestamp-Y.timestamp>o;(i||s)&&fe(!0)}};var Z=function(e){me(ye({type:y.IncrementalSnapshot,data:t({source:g.Mutation},e)}))},ee=function(e){return me(ye({type:y.IncrementalSnapshot,data:t({source:g.Scroll},e)}))},te=new he({mutationCb:Z}),ne=new ve({mutationCb:Z,scrollCb:ee,bypassOptions:{blockClass:s,blockSelector:l,maskTextClass:m,maskTextSelector:h,inlineStylesheet:S,maskInputOptions:K,maskTextFn:w,maskInputFn:I,recordCanvas:_,inlineImages:W,sampling:E,slimDOMOptions:$,iframeManager:te},mirror:ge});fe=function(e){var t,n,o,a;void 0===e&&(e=!1),me(ye({type:y.Meta,data:{href:window.location.href,width:z(),height:P()}}),e),Q.forEach((function(e){return e.lock()}));var i=r(function(e,t){var n=t||{},r=n.blockClass,o=void 0===r?"rr-block":r,a=n.blockSelector,i=void 0===a?null:a,s=n.maskTextClass,u=void 0===s?"rr-mask":s,l=n.maskTextSelector,c=void 0===l?null:l,d=n.inlineStylesheet,p=void 0===d||d,m=n.inlineImages,f=void 0!==m&&m,h=n.recordCanvas,v=void 0!==h&&h,y=n.maskAllInputs,g=void 0!==y&&y,S=n.maskTextFn,b=n.maskInputFn,C=n.slimDOM,k=void 0!==C&&C,I=n.preserveWhiteSpace,w=n.onSerialize,T=n.onIframeLoad,x=n.iframeLoadTimeout,M=n.keepIframeSrcFn,E={};return[N(e,{doc:e,map:E,blockClass:o,blockSelector:i,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===g?{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===g?{password:!0}:g,maskTextFn:S,maskInputFn:b,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,inlineImages:f,recordCanvas:v,preserveWhiteSpace:I,onSerialize:w,onIframeLoad:T,iframeLoadTimeout:x,keepIframeSrcFn:void 0===M?function(){return!1}:M}),E]}(document,{blockClass:s,blockSelector:l,maskTextClass:m,maskTextSelector:h,inlineStylesheet:S,maskAllInputs:K,maskTextFn:w,slimDOM:$,recordCanvas:_,inlineImages:W,onSerialize:function(e){U(e)&&te.addIframe(e),B(e)&&ne.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){te.attachIframe(e,t)},keepIframeSrcFn:q}),2),u=i[0],c=i[1];if(!u)return console.warn("Failed to snapshot the document");ge.map=c,me(ye({type:y.FullSnapshot,data:{node:u,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(a=null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.parentElement)||void 0===a?void 0:a.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),Q.forEach((function(e){return e.unlock()}))};try{var re=[];re.push(R("DOMContentLoaded",(function(){me(ye({type:y.DomContentLoaded,data:{}}))})));var oe=function(e){return pe({mutationCb:Z,mousemoveCb:function(e,t){return me(ye({type:y.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return me(ye({type:y.IncrementalSnapshot,data:t({source:g.MouseInteraction},e)}))},scrollCb:ee,viewportResizeCb:function(e){return me(ye({type:y.IncrementalSnapshot,data:t({source:g.ViewportResize},e)}))},inputCb:function(e){return me(ye({type:y.IncrementalSnapshot,data:t({source:g.Input},e)}))},mediaInteractionCb:function(e){return me(ye({type:y.IncrementalSnapshot,data:t({source:g.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return me(ye({type:y.IncrementalSnapshot,data:t({source:g.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return me(ye({type:y.IncrementalSnapshot,data:t({source:g.StyleDeclaration},e)}))},canvasMutationCb:function(e){return me(ye({type:y.IncrementalSnapshot,data:t({source:g.CanvasMutation},e)}))},fontCb:function(e){return me(ye({type:y.IncrementalSnapshot,data:t({source:g.Font},e)}))},blockClass:s,ignoreClass:d,maskTextClass:m,maskTextSelector:h,maskInputOptions:K,inlineStylesheet:S,sampling:E,recordCanvas:_,inlineImages:W,userTriggeredOnInput:L,collectFonts:V,doc:e,maskInputFn:I,maskTextFn:w,blockSelector:l,slimDOMOptions:$,mirror:ge,iframeManager:te,shadowDomManager:ne,plugins:(null==H?void 0:H.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return me(ye({type:y.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},T)};te.addLoadListener((function(e){re.push(oe(e.contentDocument))}));var ae=function(){fe(),re.push(oe(document))};return"interactive"===document.readyState||"complete"===document.readyState?ae():re.push(R("load",(function(){me(ye({type:y.Load,data:{}})),ae()}),window)),function(){re.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}return Se.addCustomEvent=function(e,t){if(!me)throw new Error("please add custom event after start recording");me(ye({type:y.Custom,data:{tag:e,payload:t}}))},Se.freezePage=function(){Q.forEach((function(e){return e.freeze()}))},Se.takeFullSnapshot=function(e){if(!fe)throw new Error("please take full snapshot after start recording");fe(e)},Se.mirror=ge,Se}();