posthog-js 1.412.0 → 1.412.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.
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.js +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/product-tours-preview.js +1 -1
- package/dist/product-tours-preview.js.map +1 -1
- package/dist/product-tours.js +1 -1
- package/dist/product-tours.js.map +1 -1
- package/dist/rrweb.js +1 -1
- package/dist/rrweb.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +6 -6
package/dist/posthog-recorder.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";function t(t,e,r,i,n,s,a){try{var o=t[s](a),u=o.value}catch(t){return void r(t)}o.done?e(u):Promise.resolve(u).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var a=e.apply(r,i);function o(e){t(a,n,s,o,u,"next",e)}function u(e){t(a,n,s,o,u,"throw",e)}o(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}var i,n=["type"],s=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),o=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(o||{}),u=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(u||{}),l=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(l||{}),h=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(h||{}),d=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(d||{}),c=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(c||{}),v=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(v||{});function f(t,e){return-1!==t.indexOf(e)}var p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},m={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},g={};function y(t){if(g[t])return g[t];var e=function(t){var e,r,i=null==(r=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in p?p[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in m?m[t]:void 0,a=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&a)return g[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var u,l=!1;try{document.body.appendChild(o);var h=o.contentWindow;if(!h)return e.prototype;var d=h[t].prototype;return d?(f(u=navigator.userAgent,"AppleWebKit")&&!f(u,"Chrome")&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),g[t]=d):r}catch(t){return r}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var w={};function b(t,e,r){var i,n=t+"."+String(r);if(w[n])return w[n].call(e);var s=y(t),a=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return a?(w[n]=a,a.call(e)):e[r]}var k={};function _(t,e,r){var i=t+"."+String(r);if(k[i])return k[i].bind(e);var n=y(t)[r];return"function"!=typeof n?e[r]:(k[i]=n,n.bind(e))}function S(){return y("MutationObserver").constructor}function I(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},s=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var r=t[e];"function"==typeof r&&r.__rrweb_layer__;){var i=r.__rrweb_layer__;if(i.next===s)return void(i.next=n.next);r=i.next}else t[e]=n.next}}catch(t){return()=>{}}}var M={childNodes:t=>b("Node",t,"childNodes"),parentNode:t=>b("Node",t,"parentNode"),parentElement:t=>b("Node",t,"parentElement"),textContent:t=>b("Node",t,"textContent"),contains:(t,e)=>_("Node",t,"contains")(e),getRootNode:t=>_("Node",t,"getRootNode")(),host:t=>t&&"host"in t?b("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?b("Element",t,"shadowRoot"):null,querySelector:(t,e)=>_("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>_("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:I},C=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,deferredStylesheetCount:0});function R(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var x=0,T=0,A=C(),O=null,E=null,F=[],N={slowestBatchMs:0},L=t=>t&&t>0?t:null,D=32;function P(t,e,r){var i=t.length;if(r>=D)return i;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)i+=P(a,e,r+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var u=o.rules||o.cssRules;u&&(i+=P(u,e,r+1))}}}catch(t){}}return i}function B(t){return 0!==x&&null!==E&&(A.cssRuleCount>=E||A.cssRuleCount+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var r=new WeakSet;return r.add(t),P(e,r,0)}catch(t){return 0}}(t)>E)}function W(t){return t.nodeType===t.ELEMENT_NODE}function z(t){var e=t&&"host"in t&&"mode"in t&&M.host(t)||null;return Boolean(e&&"shadowRoot"in e&&M.shadowRoot(e)===t)}function U(t){return"[object ShadowRoot]"==={}.toString.call(t)}var j=0;function q(t){var e,r,i=0===j,n=i?R():0;j+=1;try{var s=t.rules||t.cssRules;if(!s)return null;!function(t){0!==x&&(A.cssRuleCount+=P(t,null,0))}(s);var a=t.href;return!a&&t.ownerNode&&(a=t.ownerNode.baseURI),(r=Array.from(s,(t=>H(t,a))).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r}catch(t){return null}finally{j-=1,i&&(e=R()-n,x>0&&(A.stylesheetMs+=e))}}function H(t,e){var r;if(function(t){return"styleSheet"in t}(t)){var i;try{i=q(t.styleSheet)||function(t){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){i=t.cssText}try{if(i&&(null==(r=t.styleSheet)?void 0:r.href))return et(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?et(n,e):n}class G{constructor(){a(this,"idNodeMap",new Map),a(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),W(t)){var r=M.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function V(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&Z(n);return(r[i.toLowerCase()]||o&&r[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function Z(t){return t.toLowerCase()}var J="__rrweb_original__";function Q(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Z(e):null}catch(t){return null}}var K=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,X=/^(?:[a-z+]+:)?\/\//i,Y=/^www\..*/i,tt=/^(data:)([^,]*),(.*)/i;function et(t,e){return(t||"").replace(K,((t,r,i,n,s,a)=>{var o,u=i||s||a,l=r||n||"";if(!u)return t;if(X.test(u)||Y.test(u))return"url("+l+u+l+")";if(tt.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((o=e).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),d=u.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+l+h.join("/")+l+")"}))}var rt,it,nt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",st=4096,at=1e5,ot=10,ut=new Map,lt=1,ht=new RegExp("[^a-z0-9-_:]"),dt=-2;function ct(){return lt++}var vt=/^[^ \t\n\r\u000c]+/,ft=/^[, \t\n\r\u000c]+/,pt=new WeakMap;function mt(t,e){return e&&""!==e.trim()?gt(t,e):e}function gt(t,e){var r=pt.get(t);if(r||(r=t.createElement("a"),pt.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function yt(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?nt:t}(t,e.maxBase64ImageLength):t}function wt(t,e,r,i,n,s){var a;if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var o=null==(a=n.sheet)?void 0:a.href;if(o)return o}var u=mt(t,i);if(u.startsWith("data:")){if("img"===e&&n){var l=u;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(l=function(t,e,r,i){if(at>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>st||t.naturalHeight>st)return e;var n=ut.get(e);if(n&&n.type===r&&n.quality===i)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(r||"image/webp",null!=i?i:.4),u=e.length>o.length?o:e;if(ut.size>=ot){var l=ut.keys().next().value;void 0!==l&&ut.delete(l)}return ut.set(e,{type:r,quality:i,result:u}),u}catch(t){return e}}(n,u,s.type,s.quality)),yt(l,s)}if("image"===e)return yt(u,s)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=mt(t,i);return"image"===e&&h.startsWith("data:")?yt(h,s):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(ft),e.length>r;){var s=i(vt);if(","===s.slice(-1))s=mt(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=mt(t,s);for(var o=!1;;){var u=e.charAt(r);if(""===u){n.push((s+a).trim());break}if(o)")"===u&&(o=!1);else{if(","===u){r+=1,n.push((s+a).trim());break}"("===u&&(o=!0)}a+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?et(i,gt(t)):"object"===e&&"data"===r?mt(t,i):i:mt(t,i)}function bt(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function kt(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&kt(M.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&kt(M.parentNode(t),e,r)}function _t(t,e,r,i){var n;if(W(t)){if(!M.childNodes(n=t).length)return!1}else{if(null===M.parentElement(t))return!1;n=M.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(kt(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function St(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var It=new Map;function Mt(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Ct(t){return null==t?"":t.toLowerCase()}var Rt=50,xt=!1,Tt=!1;function At(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,u=e.skipChild,l=void 0!==u&&u,h=e.inlineStylesheet,d=void 0===h||h,c=e.maskInputOptions,f=void 0===c?{}:c,p=e.maskTextFn,m=e.maskInputFn,g=e.slimDOMOptions,y=e.dataURLOptions,w=void 0===y?{}:y,b=e.inlineImages,k=void 0!==b&&b,_=e.recordCanvas,S=void 0!==_&&_,I=e.canvasMaskingConfigured,C=e.onSerialize,R=e.onIframeLoad,T=e.iframeLoadTimeout,O=void 0===T?5e3:T,E=e.onIframeListenerRegistered,N=e.onStylesheetLoad,L=e.stylesheetLoadTimeout,D=void 0===L?5e3:L,P=e.keepIframeSrcFn,j=void 0===P?()=>!1:P,H=e.newlyAddedElement,G=void 0!==H&&H,K=e.depth,X=void 0===K?0:K,Y=e.maxDepth,tt=void 0===Y?Rt:Y,nt=e.needsMask,st=e.preserveWhiteSpace,at=void 0===st||st;if(X>=tt)return Tt=!0,xt||(xt=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+tt+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;nt||(nt=_t(t,a,o,void 0===nt)),x>0&&(A.nodeCount+=1);var ot,ut=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,u=void 0===o?{}:o,l=e.maskTextFn,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,f=e.inlineImages,p=e.recordCanvas,m=e.canvasMaskingConfigured,g=e.keepIframeSrcFn,y=e.newlyAddedElement,w=void 0!==y&&y,b=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:v.Document,childNodes:[],compatMode:t.compatMode}:{type:v.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:v.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:b};case t.ELEMENT_NODE:return function(t,e){for(var r,i,n,s,a=e.doc,o=e.inlineStylesheet,u=e.maskInputOptions,l=void 0===u?{}:u,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,f=e.inlineImages,p=e.recordCanvas,m=e.canvasMaskingConfigured,g=e.keepIframeSrcFn,y=e.newlyAddedElement,w=void 0!==y&&y,b=e.rootId,k=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),_=function(t){if(t instanceof HTMLFormElement)return"form";var e=Z(t.tagName);return ht.test(e)?"div":e}(t),S={},I=t.attributes.length,C=0;I>C;C++){var R=t.attributes[C];bt(_,R.name)||(S[R.name]=wt(a,_,Z(R.name),R.value,t,c))}if("link"===_&&o&&!k){var T=t.sheet;if(!T){var A=function(t){return t.href}(t);A&&!(T=Mt(a,A))&&A.includes(".css")&&(T=Mt(a,window.location.origin+"/"+A.replace(window.location.href,"")))}var O=null;T&&(B(T)?x>0&&F.push(t):O=q(T)),O&&(delete S.rel,delete S.href,S._cssText=O)}var E;if("style"===_&&t.sheet&&!(t.innerText||M.textContent(t)||"").trim().length){var N=q(t.sheet);N&&(S._cssText=N)}if("input"===_||"textarea"===_||"select"===_){var L=t.value,D=t.checked;"radio"!==S.type&&"checkbox"!==S.type&&"submit"!==S.type&&"button"!==S.type&&L?S.value=V({element:t,type:Q(t),tagName:_,value:L,maskInputOptions:l,maskInputFn:h}):D&&(S.checked=D)}if("option"===_&&(t.selected&&!l.select?S.selected=!0:delete S.selected),"dialog"===_&&t.open)try{S.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){S.rr_open_mode="modal",S.ph_rr_could_not_detect_modal=!0}if("canvas"===_&&p&&!(null==m?void 0:m()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((J in n?n[J]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(S.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var P=t.toDataURL(c.type,c.quality),W=a.createElement("canvas");W.width=t.width,W.height=t.height,P!==W.toDataURL(c.type,c.quality)&&(S.rr_dataURL=P)}if("img"===_&&f){rt||(rt=a.createElement("canvas"),it=rt.getContext("2d"));var z=t,U=z.currentSrc||z.getAttribute("src")||"<unknown-src>",j=z.crossOrigin,H=()=>{St(z,"load",H);try{rt.width=z.naturalWidth,rt.height=z.naturalHeight,it.drawImage(z,0,0),S.rr_dataURL=rt.toDataURL(c.type,c.quality)}catch(t){if("anonymous"!==z.crossOrigin)return z.crossOrigin="anonymous",void(z.complete&&0!==z.naturalWidth?H():z.addEventListener("load",H));console.warn("Cannot inline img src="+U+"! Error: "+t)}"anonymous"===z.crossOrigin&&(j?S.crossOrigin=j:z.removeAttribute("crossorigin"))};z.complete&&0!==z.naturalWidth?H():z.addEventListener("load",H)}if("audio"===_||"video"===_){var G=S;G.rr_mediaState=t.paused?"paused":"played",G.rr_mediaCurrentTime=t.currentTime,G.rr_mediaPlaybackRate=t.playbackRate,G.rr_mediaMuted=t.muted,G.rr_mediaLoop=t.loop,G.rr_mediaVolume=t.volume}if(w||(t.scrollLeft&&(S.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(S.rr_scrollTop=t.scrollTop)),k){var K=t.getBoundingClientRect(),X=K.width,Y=K.height,tt=K.left,et=K.top,nt=null==(r=a.defaultView)?void 0:r.getComputedStyle(t);S={class:S.class,rr_width:X+"px",rr_height:Y+"px",rr_left:Math.floor(tt+((null==(i=a.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(et+((null==(n=a.defaultView)?void 0:n.scrollY)||0))+"px"},nt&&(S.rr_position=nt.position||"static",nt.transform&&"none"!==nt.transform&&(S.rr_transform=nt.transform),nt.display&&nt.display.startsWith("inline")&&(S.rr_display=nt.display))}"iframe"!==_||g(S.src)||(t.contentDocument||(S.rr_src=S.src),delete S.src);try{customElements.get(_)&&(s=!0)}catch(t){}return{type:v.Element,tagName:_,attributes:S,childNodes:[],isSVG:(E=t,Boolean("svg"===E.tagName||E.ownerSVGElement)||void 0),needBlock:k,rootId:b,isCustom:s}}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,dataURLOptions:c,inlineImages:f,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:w,rootId:b});case t.TEXT_NODE:return function(t,e){var r,i=e.needsMask,n=e.maskTextFn,s=e.rootId,a=M.parentNode(t),o=a&&a.tagName,u=M.textContent(t),l="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(l&&u){try{if(t.nextSibling||t.previousSibling);else if(B(a.sheet));else if(null==(r=a.sheet)?void 0:r.cssRules){var d=q(a.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(u=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=et(u,gt(e.doc))}return h&&(u="SCRIPT_PLACEHOLDER"),!l&&!h&&u&&i&&(u=n?n(u,M.parentElement(t)):u.replace(/[\S]/g,"*")),{type:v.Text,textContent:u||"",isStyle:l,rootId:s}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:b});case t.CDATA_SECTION_NODE:return{type:v.CDATA,textContent:"",rootId:b};case t.COMMENT_NODE:return{type:v.Comment,textContent:M.textContent(t)||"",rootId:b};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:nt,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,dataURLOptions:w,inlineImages:k,recordCanvas:S,canvasMaskingConfigured:I,keepIframeSrcFn:j,newlyAddedElement:G});if(!ut)return console.warn(t,"not serialized"),null;ot=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===v.Comment)return!0;if(t.type===v.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Ct(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ct(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Ct(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Ct(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Ct(t.attributes.property).match(/^(og|twitter|fb):/)||Ct(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ct(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Ct(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(Ct(t.attributes.name))||Ct(t.attributes.property).match(/^article:/)||Ct(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(Ct(t.attributes.name)))return!0}}return!1}(ut,g)||!at&&ut.type===v.Text&&!ut.isStyle&&!ut.textContent.replace(/^\s+|\s+$/gm,"").length?dt:ct();var lt=Object.assign(ut,{id:ot});if(i.add(t,lt),ot===dt)return null;C&&C(t);var vt=!l;if(lt.type===v.Element){vt=vt&&!lt.needBlock,delete lt.needBlock;var ft=M.shadowRoot(t);ft&&U(ft)&&(lt.isShadowHost=!0)}if((lt.type===v.Document||lt.type===v.Element)&&vt){g.headWhitespace&<.type===v.Element&&"head"===lt.tagName&&(at=!1);var pt={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:nt,maskTextClass:a,maskTextSelector:o,skipChild:l,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,slimDOMOptions:g,dataURLOptions:w,inlineImages:k,recordCanvas:S,canvasMaskingConfigured:I,preserveWhiteSpace:at,onSerialize:C,onIframeLoad:R,iframeLoadTimeout:O,onIframeListenerRegistered:E,onStylesheetLoad:N,stylesheetLoadTimeout:D,keepIframeSrcFn:j,depth:X+1,maxDepth:tt};if(lt.type===v.Element&&"textarea"===lt.tagName&&void 0!==lt.attributes.value);else for(var mt of Array.from(M.childNodes(t))){var yt=At(mt,pt);yt&<.childNodes.push(yt)}var kt=null;if(W(t)&&(kt=M.shadowRoot(t)))for(var Ot of Array.from(M.childNodes(kt))){var Et=At(Ot,pt);Et&&(U(kt)&&(Et.isShadow=!0),lt.childNodes.push(Et))}}var Ft=M.parentNode(t);if(Ft&&z(Ft)&&U(Ft)&&(lt.isShadow=!0),lt.type===v.Element&&"iframe"===lt.tagName){var Nt=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var a=()=>e();if("complete"!==i){var o=!1,u=null,l=()=>{o||(o=!0,null!==u&&(clearTimeout(u),u=null),St(t,"load",h),t.addEventListener("load",a),e())},h=()=>l();return u=setTimeout(l,r),t.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),o?St(t,"load",a):(o=!0,St(t,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(t){return n}if(d!==c||t.src===c||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",a),()=>{clearTimeout(v),St(t,"load",a)}}return t.addEventListener("load",a),()=>{St(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&R){var r=At(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:nt,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,slimDOMOptions:g,dataURLOptions:w,inlineImages:k,recordCanvas:S,canvasMaskingConfigured:I,preserveWhiteSpace:at,onSerialize:C,onIframeLoad:R,iframeLoadTimeout:O,onIframeListenerRegistered:E,onStylesheetLoad:N,stylesheetLoadTimeout:D,keepIframeSrcFn:j,depth:X+1,maxDepth:tt});r&&R(t,r)}}),O);null==E||E(t,Nt)}return lt.type===v.Element&&"link"===lt.tagName&&"stylesheet"===lt.attributes.rel&&function(e,u,l){if(!It.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var c=new AbortController,v=!1,y=()=>{if(!v){v=!0;try{(()=>{if(N){var e=At(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:nt,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,slimDOMOptions:g,dataURLOptions:w,inlineImages:k,recordCanvas:S,canvasMaskingConfigured:I,preserveWhiteSpace:at,onSerialize:C,onIframeLoad:R,iframeLoadTimeout:O,onStylesheetLoad:N,stylesheetLoadTimeout:D,keepIframeSrcFn:j,depth:X,maxDepth:tt});e&&N(t,e)}})()}finally{It.delete(e),c.abort()}}},b=setTimeout(y,l);c.signal.addEventListener("abort",(()=>clearTimeout(b)),{once:!0}),e.addEventListener("load",y,{signal:c.signal,once:!0}),It.set(e,c)}}}(t,0,D),lt}function Ot(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class Et{constructor(){a(this,"parentElement",null),a(this,"parentNode",null),a(this,"ownerDocument"),a(this,"firstChild",null),a(this,"lastChild",null),a(this,"previousSibling",null),a(this,"nextSibling",null),a(this,"ELEMENT_NODE",1),a(this,"TEXT_NODE",3),a(this,"nodeType"),a(this,"nodeName"),a(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Et))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Ft(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>Nt(r,t,e,i)}function Nt(t,e,r,i){Lt((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))}))}function Lt(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var Dt="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.",Pt={map:{},getId(){return console.error(Dt),-1},getNode(){return console.error(Dt),null},removeNodeFromMap(){console.error(Dt)},has(){return console.error(Dt),!1},reset(){console.error(Dt)}};function $t(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,a=new Array(s),o=0;s>o;o++)a[o]=arguments[o];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;0>=l||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,a)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,a)}),l))}}function Bt(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout((()=>{try{r.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>Bt(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Pt=new Proxy(Pt,{get(t,e,r){return"map"===e&&console.error(Dt),Reflect.get(t,e,r)}}));var Wt=Date.now;function zt(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=M.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=M.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function Ut(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function jt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function qt(t){return t?t.nodeType===t.ELEMENT_NODE?t:M.parentElement(t):null}function Ht(t,e,r,i){if(!t)return!1;var n=qt(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(kt(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Gt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===dt}function Vt(t,e){if(z(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=M.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Vt(i,e))}function Zt(t){return Boolean(t.changedTouches)}function Jt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Qt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Kt(t){return!!t&&(t instanceof Et&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(M.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Wt=()=>(new Date).getTime());class Xt{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Yt(t){var e,r=null;return"getRootNode"in t&&(null==(e=M.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&M.host(M.getRootNode(t))&&(r=M.host(M.getRootNode(t))),r}function te(t){var e=t.ownerDocument;return!!e&&(M.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Yt(r);)r=e;return r}(t);return M.contains(e,r)}(t))}function ee(t){return"__ln"in t}class re{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&ee(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&ee(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var ie,ne=(t,e)=>t+"@"+e;class se{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"removesSubTreeCache",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"canvasMaskingConfigured"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"canvasManagerReleased",!1),a(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e=R();try{this.processBufferedMutations()}finally{(t=R()-e)>N.slowestBatchMs&&(N.slowestBatchMs=t)}}})),a(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,r=new re,i=t=>{for(var e=t,r=dt;r===dt;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=M.parentNode(n);if(s&&te(n)&&"TEXTAREA"!==s.tagName){var a=z(s)?this.mirror.getId(Yt(n)):this.mirror.getId(s),o=i(n);if(-1===a||-1===o)return r.addNode(n);var u=At(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{Jt(t,this.mirror)&&this.iframeManager.addIframe(t),Qt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Kt(n)&&this.shadowDomManager.addShadowRoot(M.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:a,nextId:o,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)oe(this.removesSubTreeCache,s)&&!this.movedSet.has(M.parentNode(s))||n(s);for(var a of this.addedSet)ue(this.droppedSet,a)||oe(this.removesSubTreeCache,a)?ue(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var o=null;r.length;){var u=null;if(o){var l=this.mirror.getId(M.parentNode(o.value)),h=i(o.value);-1!==l&&-1!==h&&(u=o)}if(!u)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(M.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){u=c;break}var f=M.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=M.host(f);if(-1!==this.mirror.getId(p)){u=c;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}o=u.previous,r.removeNode(u.value),n(u.value)}var m={texts:this.texts.map((t=>{var e=t.node,r=M.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e=t.attributes;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(m))})),a(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(M.childNodes(t),(t=>M.textContent(t)||"")).join("");e.attributes.value=V({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Q(t),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(t=>{if(!Gt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=M.textContent(t.target);Ht(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:_t(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,qt(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=Q(r);n=V({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Ht(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var a=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(a||(this.attributes.push(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,a)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!bt(r.tagName,i))if(a.attributes[i]=wt(this.doc,Z(r.tagName),Z(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var o=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&(o.style.cssText=t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),h=r.style.getPropertyPriority(u);l!==o.style.getPropertyValue(u)||h!==o.style.getPropertyPriority(u)?a.styleDiff[u]=""===h?l:[l,h]:a._unchangedStyles[u]=[l,h]}for(var d of Array.from(o.style))""===r.style.getPropertyValue(d)&&(a.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(a.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ht(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=z(t.target)?this.mirror.getId(M.host(t.target)):this.mirror.getId(t.target);Ht(t.target,this.blockClass,this.blockSelector,!1)||Gt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(ae(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Vt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[ne(r,i)]?ae(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!z(t.target)||!U(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),M.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Gt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[ne(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ht(t,this.blockClass,this.blockSelector,!1)||(M.childNodes(t).forEach((t=>this.genAdds(t))),Kt(t)&&M.childNodes(M.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function ae(t,e){t.delete(e),M.childNodes(e).forEach((e=>ae(t,e)))}function oe(t,e,r){return 0!==t.size&&function(t,e,r){var i=M.parentNode(e);return!!i&&t.has(i)}(t,e)}function ue(t,e){return 0!==t.size&&le(t,e)}function le(t,e){var r=M.parentNode(e);return!!r&&(!!t.has(r)||le(t,r))}var he=t=>ie?function(){try{return t(...arguments)}catch(t){if(ie&&!0===ie(t))return;throw t}}:t,de=[];function ce(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function ve(t,e){var r=new se;de.push(r),r.init(t);var i=new(S())(he(r.processMutations.bind(r))),n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),{observer:i,buffer:r}}function fe(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,u=t=>{var a=ce(t);if(a&&!Ht(a,n,s,!0)){var u,l,h=i.getId(a);if(a===r&&r.defaultView){var d=zt(r.defaultView);u=d.left,l=d.top}else u=a.scrollLeft,l=a.scrollTop;var c=u+","+l;o.get(h)!==c&&(o.set(h,c),e({id:h,x:u,y:l}))}},l=[Ft("scroll",he($t(he((t=>u(t))),a.scroll||100)),r)];return"onscrollend"in r&&l.push(Ft("scrollend",he(u),r)),()=>l.forEach((t=>t()))}function pe(t,e){for(var r=de.length-1;r>=0;r--){var i=de[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),de.splice(r,1))}}}var me=["INPUT","TEXTAREA","SELECT"],ge=new WeakMap;function ye(t){return function t(e,r){if(_e("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||_e("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||_e("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||_e("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function we(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function be(t,e){var r,i,n,s,a=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:M.host(e));var o="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&o&&u?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var t;return null==(t=u.get)?void 0:t.call(this)},set(t){var e,r;try{r=null==(e=u.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return r}}),he((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function ke(t,e){void 0===e&&(e={});var i,n,s=t.doc.defaultView;if(!s)return()=>{};if(function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,a=t.viewportResizeCb,o=t.inputCb,u=t.mediaInteractionCb,l=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,c=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM){var a=ve(t,t.doc);i=a.observer,n=a.buffer}var o,d,v,f,p,m,g,y,w,b=function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.mirror;if(!1===r.mousemove)return()=>{};var s,a="number"==typeof r.mousemove?r.mousemove:50,o="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],h=$t(he((t=>{var r=Date.now()-s;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],s=null})),o),d=he($t(he((t=>{var e=ce(t),r=Zt(t)?t.changedTouches[0]:t,i=r.clientX,a=r.clientY;s||(s=Wt()),l.push({x:i,y:a,id:n.getId(e),timeOffset:Wt()-s}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?u.Drag:t instanceof MouseEvent?u.MouseMove:u.TouchMove)})),a,{trailing:!1})),c=[Ft("mousemove",d,i),Ft("touchmove",d,i),Ft("drag",d,i)];return he((()=>{c.forEach((t=>t()))}))}(t),k=function(t){var e=t.mouseInteractionCb,i=t.doc,n=t.mirror,s=t.blockClass,a=t.blockSelector,o=t.sampling;if(!1===o.mouseInteraction)return()=>{};var u=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,d=[],c=null;return Object.keys(l).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==u[t])).forEach((t=>{var o=Z(t),u=(t=>i=>{var o=ce(i);if(!Ht(o,s,a,!0)){var u=null,d=t;if("pointerType"in i){switch(i.pointerType){case"mouse":u=h.Mouse;break;case"touch":u=h.Touch;break;case"pen":u=h.Pen}u===h.Touch&&(l[t]===l.MouseDown?d="TouchStart":l[t]===l.MouseUp&&(d="TouchEnd"))}else Zt(i)&&(u=h.Touch);null!==u?(c=u,(d.startsWith("Touch")&&u===h.Touch||d.startsWith("Mouse")&&u===h.Mouse)&&(u=null)):l[t]===l.Click&&(u=c,c=null);var v=Zt(i)?i.changedTouches[0]:i;if(v){var f=n.getId(o),p=v.clientX,m=v.clientY;he(e)(r({type:l[d],id:f,x:p,y:m},null!==u&&{pointerType:u}))}}})(t);if(window.PointerEvent)switch(l[t]){case l.MouseDown:case l.MouseUp:o=o.replace("mouse","pointer");break;case l.TouchStart:case l.TouchEnd:return}d.push(Ft(o,u,i))})),he((()=>{d.forEach((t=>t()))}))}(t),_=fe(t),S=function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,s=-1;return Ft("resize",he($t(he((()=>{var t=Ut(),e=jt();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:s}),C=function(t){var e=t.inputCb,i=t.doc,n=t.mirror,s=t.blockClass,a=t.blockSelector,o=t.ignoreClass,u=t.ignoreSelector,l=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function c(t){var e=ce(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=M.parentElement(e)),e&&c&&me.indexOf(c)>=0&&!Ht(e,s,a,!0)&&!(e.classList.contains(o)||u&&e.matches(u))){var f=e.value,p=!1,m=Q(e)||"";"radio"===m||"checkbox"===m?p=e.checked:(l[c.toLowerCase()]||l[m])&&(f=V({element:e,maskInputOptions:l,tagName:c,type:m,value:f,maskInputFn:h})),v(e,d?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var g=e.name;"radio"===m&&g&&p&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(t,i){var s=ge.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){ge.set(t,i);var a=n.getId(t);he(e)(r({},i,{id:a}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>Ft(t,he(c),i))),p=i.defaultView;if(!p)return()=>{f.forEach((t=>t()))};var m=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return m&&m.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((t=>Bt(t[0],t[1],{set(){he(c)({target:this,isTrusted:!1})}},!1,p)))),he((()=>{f.forEach((t=>t()))}))}(t),R=(d=(o=t).mediaInteractionCb,v=o.blockClass,f=o.blockSelector,p=o.mirror,m=o.sampling,g=o.doc,y=he((t=>$t(he((e=>{var r=ce(e);if(r&&!Ht(r,v,f,!0)){var i=r.currentTime,n=r.volume,s=r.muted,a=r.playbackRate,o=r.loop;d({type:t,id:p.getId(r),currentTime:i,volume:n,muted:s,playbackRate:a,loop:o})}})),m.media||500))),w=[Ft("play",y(c.Play),g),Ft("pause",y(c.Pause),g),Ft("seeked",y(c.Seeked),g),Ft("volumechange",y(c.VolumeChange),g),Ft("ratechange",y(c.RateChange),g)],he((()=>{w.forEach((t=>t()))}))),x=()=>{},T=()=>{},A=()=>{},O=()=>{};t.recordDOM&&(x=function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,s=e.win;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var a=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:he(((t,e,s)=>{var a=s[0],o=s[1],u=we(e,i,n.styleMirror),l=u.id,h=u.styleId;return(l&&-1!==l||h&&-1!==h)&&r({id:l,styleId:h,adds:[{rule:a,index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var o,u,l=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:he(((t,e,s)=>{var a=s[0],o=we(e,i,n.styleMirror),u=o.id,l=o.styleId;return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,removes:[{index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(o=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:he(((t,e,s)=>{var a=s[0],o=we(e,i,n.styleMirror),u=o.id,l=o.styleId;return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,replace:a}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:he(((t,e,s)=>{var a=s[0],o=we(e,i,n.styleMirror),u=o.id,l=o.styleId;return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,replaceSync:a}),t.apply(e,s)}))}));var h={};Se("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(Se("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),Se("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),Se("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((t=>{var e=t[0],s=t[1];d[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[e].insertRule,{apply:he(((t,e,s)=>{var a=s[0],o=s[1],u=we(e.parentStyleSheet,i,n.styleMirror),l=u.id,h=u.styleId;return(l&&-1!==l||h&&-1!==h)&&r({id:l,styleId:h,adds:[{rule:a,index:[...ye(e),o||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:he(((t,e,s)=>{var a=s[0],o=we(e.parentStyleSheet,i,n.styleMirror),u=o.id,l=o.styleId;return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,removes:[{index:[...ye(e),a]}]}),t.apply(e,s)}))})})),he((()=>{s.CSSStyleSheet.prototype.insertRule=a,s.CSSStyleSheet.prototype.deleteRule=l,o&&(s.CSSStyleSheet.prototype.replace=o),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(h).forEach((t=>{var e=t[0],r=t[1];r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:s}),T=be(t,t.doc),A=function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:he(((t,e,a)=>{var u,l=a[0],h=a[1],d=a[2];if(n.has(l))return o.apply(e,[l,h,d]);var c=we(null==(u=e.parentRule)?void 0:u.parentStyleSheet,i,s.styleMirror),v=c.id,f=c.styleId;return(v&&-1!==v||f&&-1!==f)&&r({id:v,styleId:f,set:{property:l,value:h,priority:d},index:ye(e.parentRule)}),t.apply(e,a)}))});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:he(((t,e,a)=>{var o,l=a[0];if(n.has(l))return u.apply(e,[l]);var h=we(null==(o=e.parentRule)?void 0:o.parentStyleSheet,i,s.styleMirror),d=h.id,c=h.styleId;return(d&&-1!==d||c&&-1!==c)&&r({id:d,styleId:c,remove:{property:l},index:ye(e.parentRule)}),t.apply(e,a)}))}),he((()=>{a.CSSStyleDeclaration.prototype.setProperty=o,a.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:s}),t.collectFonts&&(O=function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,a=i.FontFace;i.FontFace=function(t,e,r){var i=new a(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var o=I(r.fonts,"add",(function(t){return function(r){return setTimeout(he((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=a})),n.push(o),he((()=>{n.forEach((t=>t()))}))}(t)));var E=function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,s=t.selectionCb,a=!0,o=he((()=>{var t=e.getSelection();if(!(!t||a&&(null==t?void 0:t.isCollapsed))){a=t.isCollapsed||!1;for(var o=[],u=t.rangeCount||0,l=0;u>l;l++){var h=t.getRangeAt(l),d=h.startContainer,c=h.startOffset,v=h.endContainer,f=h.endOffset;Ht(d,i,n,!0)||Ht(v,i,n,!0)||o.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:o})}}));return o(),Ft("selectionchange",o)}(t),F=function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?I(r.customElements,"define",(function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}})):()=>{}}(t),N=[];for(var L of t.plugins)N.push(L.observer(L.callback,s,L.options));return he((()=>{if(n){n.destroy(),n.reset();var e=de.indexOf(n);-1!==e&&de.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),b(),k(),_(),S(),C(),R(),x(),T(),A(),O(),E(),F(),N.forEach((t=>t()))}))}function _e(t){return void 0!==window[t]}function Se(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Ie{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),a=n.get(e);return a||(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:i.get(e)||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||this.iframeIdToRemoteIdMap.set(t,e=new Map),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||this.iframeRemoteIdToIdMap.set(t,e=new Map),e}}class Me{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new Ie(ct)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"pageHideListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),a(this,"messageHandler"),a(this,"nestedIframeListeners",new Map),a(this,"attachedWindows",new WeakMap),a(this,"attachedDocuments",new WeakMap),a(this,"attachedIframes",new Map),a(this,"loadListenerDisposers",new WeakMap),a(this,"iframeElementsById",new Map),a(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ie(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null==(i=this.attachedIframes.get(t))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>Lt(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{Nt(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var a=this.handleMessage.bind(this);Lt((()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}Lt((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),null==(r=this.loadListener)||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case o.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:o.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case o.Meta:case o.Load:case o.DomContentLoaded:return!1;case o.Plugin:return e;case o.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case o.IncrementalSnapshot:switch(e.data.source){case u.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.Drag:case u.TouchMove:case u.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(e.data,t,["id"]),e;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case u.Font:return e;case u.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case u.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===v.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(Nt(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(Nt(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var s=this.attachedDocuments.get(r);s&&(s.forEach((t=>{Lt((()=>this.mirror.removeNodeFromMap(t)))})),Lt((()=>pe(r,s))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&Nt(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{Nt(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class Ce{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var i,n;if(U(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null==(n=M.host(t))?void 0:n.ownerDocument)&&void 0!==i?i:e,a=ve(r({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),o=a.observer,u=a.buffer;this.restoreHandlers.push({doc:s,handler(){o.disconnect(),u.destroy(),u.releaseCanvasManager();var t=de.indexOf(u);-1!==t&&de.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:fe(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(M.host(t))),this.restoreHandlers.push({doc:s,handler:be({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push({doc:e,handler:I(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=M.shadowRoot(this);return s&&te(this)&&r.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}}var Re="skip-frame";function xe(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ae="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Oe=0;64>Oe;Oe++)Ae[Te.charCodeAt(Oe)]=Oe;var Ee=new Map,Fe=(t,e,r)=>{if(t&&(De(t,e)||"object"==typeof t)){var i=function(t,e){var r=Ee.get(t);return r||Ee.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function Ne(t,e,r,i){if(t instanceof Array)return t.map((t=>Ne(t,e,r,i)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){var n=t.constructor.name,s=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=Te[r[e]>>2],n+=Te[(3&r[e])<<4|r[e+1]>>4],n+=Te[(15&r[e+1])<<2|r[e+2]>>6],n+=Te[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[Ne(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Ne(t.data,e,r,i),t.width,t.height]}:De(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Fe(t,e,r)}:t}var Le=(t,e,r,i)=>t.map((t=>Ne(t,e,r,i))),De=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))},Pe=["webgl","webgl2"];function $e(t){return"nodeType"in t}function Be(t,e,i,n){var s=[];try{if(n){var a=function(t,e,i){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return I(n.prototype,"configure",(function(n){return function(s){var a=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!a||$e(a)&&Ht(a,e,i,!0))return n.call(this,s);$e(a)&&!("__context"in a)&&(a.__context="webgpu");var o=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==o&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|o:o}):s)}}))}(t,e,i);a&&s.push(a)}var o=I(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(r){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(r),a=arguments.length,o=new Array(a>1?a-1:0),u=1;a>u;u++)o[u-1]=arguments[u];if(!Ht(this,e,i,!0)&&("__context"in this||(this.__context=s),n&&Pe.includes(s)))if(o[0]&&"object"==typeof o[0]){var l=o[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...o])}}));s.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((t=>t()))}}function We(t,e,r,i,n,s,a){var o=[],u=Object.getOwnPropertyNames(t),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof t[u])return 0;var l=I(t,u,(function(t){return function(){for(var o=arguments.length,l=new Array(o),h=0;o>h;h++)l[h]=arguments[h];var d=t.apply(this,l);if(Fe(d,s,this),"tagName"in this.canvas&&!Ht(this.canvas,i,n,!0)){var c=Le(l,s,this,a);r(this.canvas,{type:e,property:u,args:c})}return d}}));o.push(l)}catch(i){var h=Bt(t,u,{set(t){r(this.canvas,{type:e,property:u,args:[t],setter:!0})}});o.push(h)}};for(var h of u)l(h);return o}var ze,Ue,je,qe='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',He="undefined"!=typeof self&&self.Blob&&new Blob([qe],{type:"text/javascript;charset=utf-8"});function Ge(t){var e;try{if(!(e=He&&(self.URL||self.webkitURL).createObjectURL(He)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(qe),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Ve{constructor(t){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"rafIdTimestamp",null),a(this,"rafIdFlush",null),a(this,"refCount",0),a(this,"torndown",!1),a(this,"resetFrameDedup",null),a(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,s=t.blockSelector,o=t.recordCanvas,u=t.dataURLOptions,l=t.resolutionScale,h=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===r&&this.initCanvasMutationObserver(i,n,s,u),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:u,resolutionScale:l,canvasMasking:h})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,i,n,s){var a=this;if("OffscreenCanvas"in r){var o,u="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,l=Be(r,i,n,!0),h=new Map;try{o=new Ge}catch(t){return}var c=!1;o.onerror=()=>{var t;c=!0,cancelAnimationFrame(v),null==(t=o.terminate)||t.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:d["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var v,f=1e3/t,p=0,m=t=>{var l,d;c||(p&&f>t-p||(p=t,(l=[],d=t=>{try{t.querySelectorAll("canvas").forEach((t=>{Ht(t,i,n,!0)||l.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&d(t.shadowRoot)}))}catch(t){}},d(r.document),l).forEach(function(){var t=e((function*(t){var e,r,i=a.mirror.getId(t);if(!h.get(i)&&0!==t.width&&0!==t.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n=t.getContext(t.__context);if(null==(e=null==n?void 0:n.isContextLost)?void 0:e.call(n))return void h.set(i,!1);!1===(null==(r=null==n?void 0:n.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var l=t.clientWidth||t.width,d=t.clientHeight||t.height,c=Math.max(1,Math.round(l*u)),v=Math.max(1,Math.round(d*u)),f=function(t,e,r,i,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return Re}if(void 0!==a){if(!Array.isArray(a)||!a.every(xe))return Re;var o=r/n,u=i/s;return a.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*o),r=Math.floor(t.y*u);return{x:e,y:r,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*u)-r}}))}}}(s.canvasMasking,t,c,v,l,d);if(f===Re)return void h.set(i,!1);var p=yield createImageBitmap(t,1>u?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});o.postMessage({id:i,bitmap:p,width:c,height:v,displayWidth:l,displayHeight:d,dataURLOptions:s.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(i,!1)}}}));return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(m))};v=requestAnimationFrame(m),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(v),null==(t=o.terminate)||t.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Be(t,e,r,!1),s=function(t,e,r,i,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var o=I(e.CanvasRenderingContext2D.prototype,a,(function(s){return function(){for(var o=arguments.length,u=new Array(o),l=0;o>l;l++)u[l]=arguments[l];return Ht(this.canvas,r,i,!0)||setTimeout((()=>{var r=Le(u,e,this,n);t(this.canvas,{type:d["2D"],property:a,args:r})}),0),s.apply(this,u)}}));s.push(o)}catch(r){var u=Bt(e.CanvasRenderingContext2D.prototype,a,{set(e){t(this.canvas,{type:d["2D"],property:a,args:[e],setter:!0})}});s.push(u)}};for(var u of a)o(u);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),a=function(t,e,r,i,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...We(e.WebGLRenderingContext.prototype,d.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...We(e.WebGL2RenderingContext.prototype,d.WebGL2,t,r,i,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),s(),a()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var i=r.map((t=>function(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}(t,n)));this.mutationCb({id:e,type:r[0].type,commands:i}),this.pendingCanvasMutations.delete(t)}}}}class Ze{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Xt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}inlineDeferredLinkElement(t,e){if(-1!==e&&t.isConnected){var r=null;try{var i=t.sheet;i&&(r=q(i))}catch(t){}r&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:r}}]})}}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:H(e,t.href),index:r})))})),i.styleIds.push(e)};for(var a of t)s(a);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,It.forEach((t=>t.abort())),It.clear()}trackStylesheetInLinkElement(t){}}class Je{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Qe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Ke=document.createElement("iframe");document.body.appendChild(Ke),Array.from=(null==(i=Ke.contentWindow)?void 0:i.Array.from)||Array.from,document.body.removeChild(Ke)}}catch(t){console.debug("Unable to override Array.from",t)}var Xe=new G,Ye=new Set([u.Mutation,u.MediaInteraction,u.StyleSheetRule,u.CanvasMutation,u.Font,u.Log,u.StyleDeclaration,u.AdoptedStyleSheet]);function tr(t){var e=window;if("function"==typeof e.requestIdleCallback){var r=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null==(t=e.cancelIdleCallback)?void 0:t.call(e,r)}}}var i=setTimeout(t,250);return{cancel:()=>clearTimeout(i)}}function er(t){var e;void 0===t&&(t={});var i=t,n=i.emit,s=i.checkoutEveryNms,a=i.checkoutEveryNth,l=i.blockClass,h=void 0===l?"rr-block":l,d=i.blockSelector,c=void 0===d?null:d,v=i.ignoreClass,f=void 0===v?"rr-ignore":v,p=i.ignoreSelector,m=void 0===p?null:p,g=i.maskTextClass,y=void 0===g?"rr-mask":g,w=i.maskTextSelector,b=void 0===w?null:w,k=i.inlineStylesheet,_=void 0===k||k,S=i.inlineStylesheetBudgetRules,I=void 0===S?1e4:S,N=i.maskAllInputs,D=i.maskInputOptions,P=i.slimDOMOptions,B=i.maskInputFn,W=i.maskTextFn,z=i.hooks,U=i.packFn,j=i.sampling,q=void 0===j?{}:j,H=i.dataURLOptions,V=void 0===H?{}:H,Z=i.canvasResolutionScale,J=i.canvasMasking,Q=i.mousemoveWait,K=i.recordDOM,X=void 0===K||K,Y=i.recordCanvas,tt=void 0!==Y&&Y,et=i.recordCrossOriginIframes,rt=void 0!==et&&et,it=i.recordAfter,nt=void 0===it?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":it,st=i.userTriggeredOnInput,at=void 0!==st&&st,ot=i.collectFonts,ut=void 0!==ot&&ot,lt=i.inlineImages,ht=void 0!==lt&<,dt=i.plugins,ct=i.keepIframeSrcFn,vt=void 0===ct?()=>!1:ct,ft=i.ignoreCSSAttributes,pt=void 0===ft?new Set([]):ft,mt=i.attributeFilter;ie=i.errorHandler;var gt=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},V),yt=!rt||window.parent===window,wt=!1;if(!yt)try{window.parent.document&&(wt=!1)}catch(t){wt=!0}if(yt&&!n)throw new Error("emit function is required");if(!yt&&!wt)return()=>{};void 0!==Q&&void 0===q.mousemove&&(q.mousemove=Q),Xe.reset();var bt,kt=!0===N?{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!==D?D:{password:!0},_t=Ot(void 0!==P&&P);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var St,It,Mt=0,Ct=new Map,Rt=t=>{for(var e of dt||[])e.eventProcessor&&(t=e.eventProcessor(t));return U&&!wt&&(t=U(t)),t};ze=(t,e)=>{var r,i=t;if(i.timestamp=Wt(),!(null==(r=de[0])?void 0:r.isFrozen())||i.type===o.FullSnapshot||i.type===o.IncrementalSnapshot&&Ye.has(i.data.source)||de.forEach((t=>t.unfreeze())),yt)null==n||n(Rt(i),e);else if(wt){var l={type:"rrweb",event:Rt(i),origin:window.location.origin,isCheckout:e};window.parent.postMessage(l,"*")}if(i.type===o.FullSnapshot)bt=i,Mt=0;else if(i.type===o.IncrementalSnapshot){if(i.data.source===u.Mutation&&i.data.isAttachIframe)return;Mt++,(a&&Mt>=a||s&&i.timestamp-bt.timestamp>s)&&Ue(!0)}};var xt=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var n of t.adds){var s=Xe.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}t.removes.forEach((t=>{var r=t.id;if(!e||!e.has(r)){var n=Dt.getIframeElementById(r);n&&i.has(n)?Dt.forgetIframeId(r):(null==St||St(r),Dt.removeIframeById(r))}})),null==It||It(),Dt.cleanupDetachedIframes()}ze({type:o.IncrementalSnapshot,data:r({source:u.Mutation},t)})},Tt=t=>ze({type:o.IncrementalSnapshot,data:r({source:u.Scroll},t)}),Et=t=>ze({type:o.IncrementalSnapshot,data:r({source:u.CanvasMutation},t)}),Nt=new Ze({mutationCb:xt,adoptedStyleSheetCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},t)})}),Dt=new Me({mirror:Xe,mutationCb:xt,stylesheetManager:Nt,recordCrossOriginIframes:rt,wrappedEmit:ze});for(var Pt of dt||[])Pt.getMirror&&Pt.getMirror({nodeMirror:Xe,crossOriginIframeMirror:Dt.crossOriginIframeMirror,crossOriginIframeStyleMirror:Dt.crossOriginIframeStyleMirror});var $t=new Je,Bt=null==J?void 0:J.configured;je=new Ve({recordCanvas:tt,mutationCb:Et,win:window,blockClass:h,blockSelector:c,mirror:Xe,sampling:q.canvas,dataURLOptions:gt,resolutionScale:Z,canvasMasking:J});var qt=new Ce({mutationCb:xt,scrollCb:Tt,bypassOptions:{blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:b,inlineStylesheet:_,maskInputOptions:kt,dataURLOptions:gt,maskTextFn:W,maskInputFn:B,recordCanvas:tt,canvasMaskingConfigured:Bt,inlineImages:ht,sampling:q,slimDOMOptions:_t,iframeManager:Dt,stylesheetManager:Nt,canvasManager:je,keepIframeSrcFn:vt,processedNodeManager:$t,attributeFilter:mt},mirror:Xe});Ue=function(t){if(void 0===t&&(t=!1),X){ze({type:o.Meta,data:{href:window.location.href,width:jt(),height:Ut()}},t),null==e||e(),e=void 0,Nt.reset(),qt.init(),de.forEach((t=>t.lock()));var r,i,n=null;try{n=function(t,e){var r,i=e||{},n=i.mirror,s=void 0===n?new G:n,a=i.blockClass,o=void 0===a?"rr-block":a,u=i.blockSelector,l=void 0===u?null:u,h=i.maskTextClass,d=void 0===h?"rr-mask":h,c=i.maskTextSelector,v=void 0===c?null:c,f=i.inlineStylesheet,p=void 0===f||f,m=i.inlineImages,g=void 0!==m&&m,y=i.recordCanvas,w=void 0!==y&&y,b=i.canvasMaskingConfigured,k=i.maskAllInputs,_=void 0!==k&&k,S=i.maskTextFn,I=i.maskInputFn,M=i.slimDOM,N=i.dataURLOptions,D=i.preserveWhiteSpace,P=i.onSerialize,B=i.onIframeLoad,W=i.iframeLoadTimeout,z=i.onIframeListenerRegistered,U=i.onStylesheetLoad,j=i.stylesheetLoadTimeout,q=i.keepIframeSrcFn,H=void 0===q?()=>!1:q,V=i.maxDepth,Z=i.inlineStylesheetBudgetRules,J=!0===_?{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===_?{password:!0}:_,Q=Ot(void 0!==M&&M);r=Z,(x+=1)>1||(A=C(),F=[],E=L(r),T=R());try{return At(t,{doc:t,mirror:s,blockClass:o,blockSelector:l,maskTextClass:d,maskTextSelector:v,skipChild:!1,inlineStylesheet:p,maskInputOptions:J,maskTextFn:S,maskInputFn:I,slimDOMOptions:Q,dataURLOptions:N,inlineImages:g,recordCanvas:w,canvasMaskingConfigured:b,preserveWhiteSpace:D,onSerialize:P,onIframeLoad:B,iframeLoadTimeout:W,onIframeListenerRegistered:z,onStylesheetLoad:U,stylesheetLoadTimeout:j,keepIframeSrcFn:H,newlyAddedElement:!1,maxDepth:V})}finally{0===x?O||C():(x-=1)>0||(A.durationMs=R()-T,A.deferredStylesheetCount=F.length,E=null,O=A)}}(document,{mirror:Xe,blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:b,inlineStylesheet:_,maskAllInputs:kt,inlineStylesheetBudgetRules:I,maskTextFn:W,maskInputFn:B,slimDOM:_t,dataURLOptions:gt,recordCanvas:tt,canvasMaskingConfigured:Bt,inlineImages:ht,onSerialize(t){Jt(t,Xe)&&Dt.addIframe(t),Qt(t,Xe)&&Nt.trackLinkElement(t),Kt(t)&&qt.addShadowRoot(M.shadowRoot(t),document)},onIframeLoad(t,e){Dt.attachIframe(t,e),qt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){Dt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){Nt.attachLinkElement(t,e)},keepIframeSrcFn:vt})}finally{r=F,F=[],i=r}if(!n)return console.warn("Failed to snapshot the document");ze({type:o.FullSnapshot,data:{node:n,initialOffset:zt(window)}},t),de.forEach((t=>t.unlock())),je.onFullSnapshot(),i.length&&(e=function(t,r,i){var n=!1,s=null,a=0,o=i=>{if(s=null,!n){var u=function(){var e=t[a];t[a]=null,a+=1,e&&Lt((()=>r.inlineDeferredLinkElement(e,Xe.getId(e))))};do{u()}while(t.length>a&&i&&!i.didTimeout&&i.timeRemaining()>5);t.length>a?s=tr(o):e=void 0}};return s=tr(o),()=>{n=!0,null==s||s.cancel(),s=null}}(i,Nt)),rt&&Dt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Nt.adoptStyleSheets(document.adoptedStyleSheets,Xe.getId(document))}};try{var Ht=[];St=t=>{var e=Ct.get(t);e&&(e.forEach((t=>{Lt(t);var e=Ht.indexOf(t);-1!==e&&Ht.splice(e,1)})),Ct.delete(t))},It=()=>{for(var t of Ct){var e=t[0],r=Xe.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==St||St(e)}catch(t){null==St||St(e)}else null==St||St(e)}};var Gt=t=>{var e;return he(ke)({mutationCb:xt,mousemoveCb:(t,e)=>ze({type:o.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.MouseInteraction},t)}),scrollCb:Tt,viewportResizeCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.ViewportResize},t)}),inputCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.Input},t)}),mediaInteractionCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.MediaInteraction},t)}),styleSheetRuleCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.StyleSheetRule},t)}),styleDeclarationCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.StyleDeclaration},t)}),canvasMutationCb:Et,fontCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.Font},t)}),selectionCb(t){ze({type:o.IncrementalSnapshot,data:r({source:u.Selection},t)})},customElementCb(t){ze({type:o.IncrementalSnapshot,data:r({source:u.CustomElement},t)})},blockClass:h,ignoreClass:f,ignoreSelector:m,maskTextClass:y,maskTextSelector:b,maskInputOptions:kt,inlineStylesheet:_,sampling:q,recordDOM:X,recordCanvas:tt,canvasMaskingConfigured:Bt,inlineImages:ht,userTriggeredOnInput:at,collectFonts:ut,doc:t,maskInputFn:B,maskTextFn:W,keepIframeSrcFn:vt,blockSelector:c,slimDOMOptions:_t,dataURLOptions:gt,mirror:Xe,iframeManager:Dt,stylesheetManager:Nt,shadowDomManager:qt,processedNodeManager:$t,canvasManager:je,ignoreCSSAttributes:pt,attributeFilter:mt,plugins:(null==(e=null==dt?void 0:dt.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ze({type:o.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},z)};Dt.addLoadListener((t=>{try{var e=Xe.getId(t),r=Gt(t.contentDocument);if(Ht.push(r),-1!==e){var i=Ct.get(e);i||Ct.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),Dt.addPageHideListener((t=>{var e=Xe.getId(t);null==St||St(e),pe(t)}));var Vt=-1,Zt=t=>ze({type:o.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Xt=()=>{var t,e,r,i,n=document,s=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,a=s?Xe.getId(s):-1;a!==Vt&&(-1!==Vt&&Zt({id:Vt,enter:!1}),Vt=a,-1!==a&&Zt({id:a,enter:!0}))},Yt=()=>{Ue(),Ht.push(Gt(document)),Ht.push(Ft("fullscreenchange",Xt)),Ht.push(Ft("webkitfullscreenchange",Xt)),Ht.push(Ft("mozfullscreenchange",Xt)),Ht.push(Ft("MSFullscreenChange",Xt)),Qe=!0};return["interactive","complete"].includes(document.readyState)?Yt():(Ht.push(Ft("DOMContentLoaded",(()=>{ze({type:o.DomContentLoaded,data:{}}),"DOMContentLoaded"===nt&&Yt()}))),Ht.push(Ft("load",(()=>{ze({type:o.Load,data:{}}),"load"===nt&&Yt()}),window))),()=>{null==e||e(),e=void 0,Ht.forEach((t=>Lt(t))),$t.destroy(),Dt.removeLoadListener(),Dt.destroy(),Ct.clear(),qt.reset(),Xe.reset(),Qe=!1,ie=void 0}}catch(t){console.warn(t)}}er.addCustomEvent=(t,e)=>{if(!Qe)throw new Error("please add custom event after start recording");ze({type:o.Custom,data:{tag:t,payload:e}})},er.freezePage=()=>{de.forEach((t=>t.freeze()))},er.takeFullSnapshot=t=>{if(!Qe)throw new Error("please take full snapshot after start recording");Ue(t)},er.mirror=Xe;var rr=Object.defineProperty,ir=(t,e,r)=>((t,e,r)=>e in t?rr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class nr{constructor(t){ir(this,"fileName"),ir(this,"functionName"),ir(this,"lineNumber"),ir(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var sr=/(^|@)\S+:\d+/,ar=/^\s*at .*(\S+:\d+|\(native\))/m,or=/^(eval@)?(\[native code])?$/,ur={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(ar)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter((function(t){return!!t.match(ar)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new nr({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(or)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new nr({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new nr({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var a=e.exec(r[n]);a&&i.push(new nr({fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var a=e.exec(r[n]);a&&i.push(new nr({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(sr)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new nr({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function lr(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var a=i.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===r&&n.push(a)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function hr(t){return Array.isArray(t)}function dr(t){return"object"==typeof t&&null!==t&&!hr(t)}function cr(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(dr(t[i])&&cr(t[i],e-1))return!0;return!1}function vr(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(dr(a=e)&&Object.keys(a).length>r.numOfKeysLimit||"function"==typeof a||dr(a)&&cr(a,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var u in e){var l=e[u];o[u]=hr(l)?lr(l.length?l[0]:null):l}return o}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var fr={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 pr(t,e,r){var i,n=r?Object.assign({},fr,r):fr,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var a=0,o=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message,i=ur.parse(e.error).map((t=>t.toString())),s=[vr(r,n.stringifyOptions)];t({level:"error",trace:i,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[vr("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[vr("Uncaught (in promise)",n.stringifyOptions),vr(e.reason,n.stringifyOptions)]);var s=ur.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)u.push(c(i,d));return()=>{u.forEach((t=>t()))};function c(e,r){var i=this;return e[r]?function(e,s,u){try{if(!(s in e))return()=>{};var l=e[s],h={next:l},d=(e=>function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||o)){o=!0;try{var h=ur.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?u.slice(1):u).map((t=>vr(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:r,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[vr("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{o=!1}}})((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=e[s];"function"==typeof t&&t.__rrweb_layer__;){var r=t.__rrweb_layer__;if(r.next===d)return void(r.next=h.next);t=r.next}else e[s]=h.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var mr="undefined"!=typeof window?window:void 0,gr="undefined"!=typeof globalThis?globalThis:mr,yr=null==gr?void 0:gr.document,wr=null==gr?void 0:gr.location;null!=gr&&gr.XMLHttpRequest&&new gr.XMLHttpRequest;var br="undefined"!=typeof globalThis?globalThis:mr;br&&"undefined"==typeof self&&(br.self=br),br&&"undefined"==typeof File&&(br.File=function(){});var kr,_r=null!=mr?mr:{},Sr="NativeGzipValidationError",Ir=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Sr,e},Mr=function(){var t=e((function*(t,e){18>t.size&&Ir("too-short");var r,i=new Uint8Array(yield t.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&Ir("invalid-header");var n=new DataView(yield t.slice(t.size-8).arrayBuffer());n.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(kr)return kr;kr=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;kr[t]=e>>>0}return kr})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&Ir("invalid-crc");var s=e.length>>>0;n.getUint32(4,!0)!==s&&Ir("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function Cr(){return Cr=e((function*(t,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),a=s.writable.getWriter(),o=a.write(n).then((()=>a.close())).catch(function(){var t=e((function*(t){try{yield a.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),u=new Response(s.readable).blob(),l=(yield Promise.all([u,o]))[0];return yield Mr(l,n),l}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),null}})),Cr.apply(this,arguments)}var Rr=function(t){return t.trim()},xr=Object.prototype,Tr=xr.hasOwnProperty,Ar=xr.toString,Or=Array.isArray||function(t){return"[object Array]"===Ar.call(t)},Er=t=>"function"==typeof t,Fr=t=>t===Object(t)&&!Or(t),Nr=t=>void 0===t,Lr=t=>"[object String]"==Ar.call(t),Dr=t=>null===t,Pr=t=>Nr(t)||Dr(t),$r=t=>"[object Number]"==Ar.call(t)&&t==t,Br=t=>"[object Boolean]"===Ar.call(t),Wr=t=>t instanceof FormData;function zr(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),$r(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),zr(n||r,e,r,i))}class Ur{constructor(t){this.tt={},this.et=t.et,this.it=zr(t.bucketSize,0,100,t.rt),this.nt=zr(t.refillRate,0,this.it,t.rt),this.st=zr(t.refillInterval,0,864e5,t.rt)}ot(t,e){var r=Math.floor((e-t.lastAccess)/this.st);r>0&&(t.tokens=Math.min(t.tokens+r*this.nt,this.it),t.lastAccess=t.lastAccess+r*this.st)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.tt[i];return n?this.ot(n,r):this.tt[i]=n={tokens:this.it,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.et)||e.call(this,t)),0===n.tokens)}stop(){this.tt={}}}function jr(t){return t?t.split("#")[0]:t}var qr=t=>"undefined"!=typeof Document&&t instanceof Document,Hr={DEBUG:!1,LIB_VERSION:"0.3.1",LIB_NAME:"browser-common"},Gr=function(t,e){var r=(void 0===e?{}:e).debugEnabled,i={k(e){if(mr&&(Hr.DEBUG||mr.POSTHOG_DEBUG||r)&&!Nr(mr.console)&&mr.console){for(var i=("__rrweb_original__"in mr.console[e]?mr.console[e].__rrweb_original__:mr.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),a=1;n>a;a++)s[a-1]=arguments[a];i(t,...s)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(t){i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>Gr(t+" "+e,r)};return i},Vr=Gr("[PostHog.js]"),Zr=Vr.createLogger;function Jr(t,e){if(!Pr(t))if(Or(t))t.forEach(e);else if(Wr(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)Tr.call(t,r)&&e(t[r],r)}function Qr(t,e,r,i){var n={},s=n.capture,a=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==s&&s,passive:void 0===a||a})}var Kr=["localhost","127.0.0.1"],Xr=t=>{var e=null==yr?void 0:yr.createElement("a");return Nr(e)?null:(e.href=t,e)},Yr=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return Jr(t,(function(t,e){Nr(t)||Nr(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},ti=()=>{};function ei(t,e,r){try{if(!(e in t))return ti;var i={next:t[e]},n=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)}));return Er(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e];Er(r)&&r.__posthog_layer__;){var s=r.__posthog_layer__;if(s.next===n)return void(s.next=i.next);r=s.next}else t[e]=i.next}}catch(t){return ti}}function ri(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function ii(t){var e,r=null==mr||null==(e=mr.location)?void 0:e.href;return Nr(r)?void 0:function(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!Er(i))return e;try{var n=i(e);return Lr(n)&&n?n:e}catch(t){return Vr.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,r)}var ni=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),si=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,ai=[16,15,14,13],oi=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),ui=/[0-9A-Za-z_]/;function li(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}var hi="[SessionRecording]",di="redacted",ci=1e6;function vi(t){var e;return Math.min(ci,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:ci)}var fi={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:ci,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},pi=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],mi=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],gi=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],yi=t=>{Pr(t)||Jr(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return pi.includes(e)||gi.some((t=>e.includes(t)))})(e)&&(t[e]=di)}))},wi=["/s/","/e/","/i/"];function bi(t,e,r,i){if(Pr(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Lr(n)&&(n=parseInt(n)),n>r?hi+" "+i+" body too large to record ("+n+" bytes)":t}function ki(t,e){if(Pr(t))return t;var r=t;return function(t,e){if(Pr(t))return!1;if(Lr(t)){if(function(t){var e;for(si.lastIndex=0;e=si.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var s of ai){var a=n+s;if(i.length>=a){var o=i.slice(n,a);if(ni.test(o)&&li(o))return!0}}}return!1}(t=Rr(t)))return!1;var r=function(t){var e;for(oi.lastIndex=0;e=oi.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&ui.test(r)&&ui.test(i)))return!0}return!1}(t);if(r)return!1}return!0}(r)||(r=hi+" "+e+" body "+di),Jr(mi,(t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r=hi+" "+e+" body "+di+" as might contain: "+t)})),r}var _i=Zr("[Recorder]"),Si=t=>"navigation"===t.entryType,Ii=t=>"resource"===t.entryType;function Mi(t,e){return!!e&&(Br(e)||e[t])}function Ci(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var Ri=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function xi(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.toLowerCase().includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Ci(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(Ri))return!1;if(Br(r))return!0;if(Or(r))return n(r);var s=r[e];return Br(s)?s:n(s)}function Ti(t,e,r,i,n,s){return Ai.apply(this,arguments)}function Ai(){return Ai=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return _i.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var a=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(Ii(a=t[s])&&a.initiatorType===e&&(Nr(i)||a.startTime>=i)&&(Nr(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(r));return a||(yield new Promise((t=>setTimeout(t,50*s))),Ti(t,e,r,i,n,s+1))})),Ai.apply(this,arguments)}function Oi(t){var e=t.body,r=t.options,i=t.url;if(Pr(e))return null;var n=ri(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(Lr(e))return e;if(qr(e))return e.textContent;if(Wr(e))return Yr(e);if(Fr(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var Ei=t=>!Dr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Fi(t){var e=t.entry,i=t.method,n=t.status,s=t.networkRequest,a=t.isInitial,o=t.start,u=t.end,l=t.url,h=t.initiatorType;o=e?e.startTime:o,u=e?e.responseEnd:u;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(o||0)),v=[r({},e?e.toJSON():{name:l},{startTime:Nr(o)?void 0:Math.round(o),endTime:Nr(u)?void 0:Math.round(u),timeOrigin:d,timestamp:c,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:a})];if(Ei(e))for(var f of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Ni=["video/","audio/"];function Li(t){return Fr(t)&&Er(t.getReader)&&Er(t.tee)}var Di=500,Pi="[SessionReplay] Timeout while trying to read body",$i="[SessionReplay] Failed to read body";function Bi(t){return $i+": "+t}function Wi(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function zi(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var r=setTimeout((()=>e(Pi)),Di);try{t.clone().text().then((t=>e(t)),(t=>e(Bi(t)))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e($i)}}))}(t);var r=vi(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(Wi(r)):function(t,e){return new Promise((r=>{var i,n=!1;function s(){try{var t;null==(t=i)||t.cancel()}catch(t){}}function a(t){n||(n=!0,clearTimeout(u),s(),r(t))}var o,u=setTimeout((()=>a(Pi)),Di);try{o=t.clone()}catch(t){return void a($i)}var l=o.body;if(Li(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(t){return void a($i)}var h=[],d=0;!function t(){i.read().then((r=>{var i=r.done,o=r.value;if(n)s();else if(i)a((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(o){if(d+o.byteLength>e)return void a(Wi(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(Bi(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(Bi(t))))}catch(t){a($i)}}))}(t,r)}function Ui(){return(Ui=e((function*(t){var e=t.r,r=t.options,i=ri(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):zi(e,r)}))).apply(this,arguments)}function ji(){return(ji=e((function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),a=Ni.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=ri(n,i);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return Dr(i)?zi(e,r):Promise.resolve(i)}))).apply(this,arguments)}var qi=null;function Hi(t,i,n){if(!("performance"in i))return()=>{};if(qi)return _i.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},fi,n):fi,a=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var r=s.maskRequestFn(t);e||(n=!r),r&&i.push(r)}})),i.length>0&&t(r({},e,{requests:i}))},o=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Si(t)||Ii(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>Fi({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>Si(t)||Ii(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>Fi({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(a,i,s),u=()=>{},l=()=>{};return(s.recordHeaders||s.recordBody)&&(u=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Mi("request",r.recordHeaders),n=Mi("response",r.recordHeaders),s=ei(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,u,l,h){void 0===u&&(u=!0);var d=this;try{var c,v,f=new Request(o),p={},m={},g=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(m[t]=e,g(t,e)),i&&(p.requestHeaders=m);var y=d.send.bind(d);d.send=t=>(xi({type:"request",headers:m,url:o,recordBody:r.recordBody})&&(p.requestBody=Oi({body:t,options:r,url:o})),c=e.performance.now(),y(t));var w=()=>{d.removeEventListener("readystatechange",b),d.removeEventListener("error",w),d.removeEventListener("abort",w),d.removeEventListener("timeout",w)},b=()=>{if(d.readyState===d.DONE){w(),v=e.performance.now();var i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),xi({type:"response",headers:i,url:o,recordBody:r.recordBody})&&(p.responseBody=Oi({body:d.response,options:r,url:o})),Ti(e,"xmlhttprequest",f.url,c,v).then((e=>{var r=Fi({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};d.addEventListener("readystatechange",b),d.addEventListener("error",w),d.addEventListener("abort",w),d.addEventListener("timeout",w)}catch(t){_i.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),u,l,h)}));return()=>{s()}}(a,i,s),l=function(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Mi("request",i.recordHeaders),s=Mi("response",i.recordHeaders),a=ei(r,"fetch",(a=>function(){var o=e((function*(e,o){var u,l;try{u=new Request(e,o)}catch(t){return _i.error("Failed to instrument fetch for network capture",t),a(e,o)}var h,d,c={};try{try{var v={};u.headers.forEach(((t,e)=>{v[e]=t})),n&&(c.requestHeaders=v),!Li(null==o?void 0:o.body)&&xi({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(c.requestBody=yield function(t){return Ui.apply(this,arguments)}({r:u,options:i,url:e}))}catch(t){_i.error("Failed to record fetch request for network capture",t)}h=r.performance.now(),l=Ci(e)?yield a(u):yield a(e,o),d=r.performance.now();var f={};return l.headers.forEach(((t,e)=>{f[e]=t})),s&&(c.responseHeaders=f),xi({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(c.responseBody=yield function(t){return ji.apply(this,arguments)}({r:l,options:i,url:e})),l}finally{Ti(r,"fetch",u.url,h,d).then((e=>{var r,i=Fi({entry:e,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:c,start:h,end:d,url:u.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return o.apply(this,arguments)}}()));return()=>{a()}}(a,i,s)),qi=()=>{o(),u(),l(),qi=null}}var Gi={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},Vi={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},Zi="$session_recording_remote_config",Ji="$replay_sample_rate",Qi="$replay_override_sampling",Ki="$replay_override_linked_flag",Xi="$replay_override_url_trigger",Yi="$replay_override_event_trigger",tn="$session_is_sampled",en="$session_past_minimum_duration",rn="$session_recording_url_trigger_activated_session",nn="$session_recording_event_trigger_activated_session",sn="$posthog_sr_group_event_trigger_",an="$posthog_sr_group_url_trigger_",on="$posthog_sr_group_sampling_",un="$debug_first_full_snapshot_timestamp",ln="$sess_rec_flush_size",hn="$stored_person_properties",dn="$sdk_debug_replay_remote_trigger_matching_config",cn="disabled",vn="sampled",fn="active",pn="buffering",mn="paused",gn="rrweb_error",yn="trigger",wn=yn+"_activated",bn=yn+"_pending",kn=yn+"_"+cn;function _n(t,e,r,i,n,s){return 0===e?kn:(null==t?void 0:t.get_property(r?i+r:n))===s?wn:bn}function Sn(t,e,r){return e.some((e=>{var i;return"regex"===e.matching&&(null!==(i=null==r?void 0:r.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)}))}class In{constructor(t){this.u=t}triggerStatus(t){var e=this.u.map((e=>e.triggerStatus(t)));return e.includes(wn)?wn:e.includes(bn)?bn:kn}stop(){this.u.forEach((t=>t.stop()))}}class Mn{constructor(t){this.u=t}triggerStatus(t){var e=new Set;for(var r of this.u)e.add(r.triggerStatus(t));switch(e.delete(kn),e.size){case 0:return kn;case 1:return Array.from(e)[0];default:return bn}}stop(){this.u.forEach((t=>t.stop()))}}class Cn{triggerStatus(){return wn}stop(){}}var Rn=t=>"sessionRecording"in t;class xn{constructor(t,e){this.th=[],this.eh=[],this.rh=new Map,this.ih=new Map,this.nh="",this.urlBlocked=!1,this._instance=t,this.sh=e}onConfig(t){var e,r;this.th=(Rn(t)?Fr(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.eh=(Rn(t)?Fr(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.ah()}ah(){for(var t of(this.rh.clear(),this.ih.clear(),this.th))if("regex"===t.matching&&!this.rh.has(t.url))try{this.rh.set(t.url,new RegExp(t.url))}catch(e){Vr.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.eh)if("regex"===e.matching&&!this.ih.has(e.url))try{this.ih.set(e.url,new RegExp(e.url))}catch(t){Vr.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}oh(t){return _n(this._instance,this.th.length,this.sh,an,rn,t)}triggerStatus(t){var e=this.oh(t),r=e===wn?wn:e===bn?bn:kn;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:r}),r}checkUrlBlocklist(t,e){var r=ii(this._instance);if(r&&r!==this.nh){this.nh=r;var i=this.urlBlocked,n=Sn(r,this.eh,this.ih);i&&n||(n&&!i?t():!n&&i&&e())}}checkUrlTriggerConditions(t,e,r,i){var n=ii(this._instance);if(n&&n!==this.nh){this.nh=n;var s=this.urlBlocked,a=Sn(n,this.eh,this.ih);a&&!s?t():!a&&s&&e();var o=this.oh(i)===wn,u=Sn(n,this.th,this.rh);!o&&u&&r("url",n)}}stop(){this.nh=""}}class Tn{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.uh=()=>{},this._instance=t}triggerStatus(){var t=bn;return Pr(this.linkedFlag)&&(t=kn),this.linkedFlagSeen&&(t=wn),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}onConfig(t,e){var r;if(this.linkedFlag=(Rn(t)?Fr(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Pr(this.linkedFlag)&&!this.linkedFlagSeen){var i=Lr(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Lr(this.linkedFlag)?null:this.linkedFlag.variant;this.uh=this._instance.onFeatureFlags(((t,r)=>{var s=!1;if(Fr(r)&&i in r){var a=r[i];s=Br(a)?!0===a:n?a===n:!!a}var o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(i,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.uh()}}class An{constructor(t,e){this.lh=[],this._instance=t,this.sh=e}onConfig(t){var e;this.lh=(Rn(t)?Fr(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}hh(t){return _n(this._instance,this.lh.length,this.sh,sn,nn,t)}triggerStatus(t){var e=this.hh(t),r=e===wn?wn:e===bn?bn:kn;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:r}),r}checkEventTriggerConditions(t,e,r){if(0!==this.lh.length){var i=this.hh(r)===wn,n=this.lh.includes(t);!i&&n&&e("event",t)}}stop(){}}class On{constructor(t,e,r){if(this._instance=t,this.group=e,this.dh=new xn(t,e.id),this.fh=new An(t,e.id),this.ph=new Tn(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var i=(e.conditions.events||[]).map((t=>t.name)),n={urlTriggers:e.conditions.urls||[],eventTriggers:i,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.dh.onConfig(n),this.fh.onConfig(n),this.ph.onConfig(n,r);var s=[this.fh,this.dh,this.ph];this.mh="any"===e.conditions.matchType?new In(s):new Mn(s)}else this.mh=new Cn}triggerStatus(t){return this.mh.triggerStatus(t)}checkEventTriggerConditions(t,e,r){this.fh.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.dh.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r;null==(r=this._instance.persistence)||r.register({["url"===t?an+this.group.id:sn+this.group.id]:e})}stop(){this.dh.stop(),this.fh.stop(),this.ph.stop()}}function En(t){if(t.rrwebError)return gn;if(!t.receivedFlags)return pn;if(!t.isRecordingEnabled)return cn;if(t.urlTriggerMatching.urlBlocked)return mn;var e=!0===t.isSampled,r=new In([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?vn:r===wn?fn:r===bn?pn:!1===t.isSampled?cn:fn}function Fn(t){if(t.rrwebError)return gn;if(!t.receivedFlags)return pn;if(!t.isRecordingEnabled)return cn;if(t.urlTriggerMatching.urlBlocked)return mn;var e=new Mn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==kn,i=Br(t.isSampled);return r&&e===bn?pn:r&&e===kn||i&&!t.isSampled?cn:!0===t.isSampled?vn:fn}function Nn(){var t=[];return function(e,r){if(Fr(r)||Or(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r}}function Ln(t){var e=JSON.stringify(t,Nn());return e?new Blob([e]).size:0}function Dn(t){if(Dr(t))return 4;if(Nr(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":if(Or(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=Nr(i)||Dr(i)?4:Dn(i)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var u=n[o];Nr(u)||(a||(s+=1),a=!1,s+=o.length+3+Dn(u))}return s;default:return 0}}function Pn(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),i=t.sizes.slice(0,r),n=t.sizes.slice(r);return[Pn({size:i.reduce(((t,e)=>t+e),0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),Pn({size:n.reduce(((t,e)=>t+e),0),data:t.data.slice(r),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}var $n=Uint8Array,Bn=Uint16Array,Wn=Uint32Array,zn=new $n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Un=new $n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),jn=new $n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qn=function(t,e){for(var r=new Bn(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new Wn(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},Hn=qn(zn,2),Gn=Hn[1];Hn[0][28]=258,Gn[258]=28;for(var Vn=qn(Un,0)[1],Zn=new Bn(32768),Jn=0;32768>Jn;++Jn){var Qn=(43690&Jn)>>>1|(21845&Jn)<<1;Zn[Jn]=((65280&(Qn=(61680&(Qn=(52428&Qn)>>>2|(13107&Qn)<<2))>>>4|(3855&Qn)<<4))>>>8|(255&Qn)<<8)>>>1}var Kn=function(t,e,r){for(var i=t.length,n=0,s=new Bn(e);i>n;++n)++s[t[n]-1];var a,o=new Bn(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(r){a=new Bn(1<<e);var u=15-e;for(n=0;i>n;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],d=o[t[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)a[Zn[d]>>>u]=l}else for(a=new Bn(i),n=0;i>n;++n)a[n]=Zn[o[t[n]-1]++]>>>15-t[n];return a},Xn=new $n(288);for(Jn=0;144>Jn;++Jn)Xn[Jn]=8;for(Jn=144;256>Jn;++Jn)Xn[Jn]=9;for(Jn=256;280>Jn;++Jn)Xn[Jn]=7;for(Jn=280;288>Jn;++Jn)Xn[Jn]=8;var Yn=new $n(32);for(Jn=0;32>Jn;++Jn)Yn[Jn]=5;var ts=Kn(Xn,9,0),es=Kn(Yn,5,0),rs=function(t){return(t/8>>0)+(7&t&&1)},is=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof Bn?Bn:t instanceof Wn?Wn:$n)(r-e);return i.set(t.subarray(e,r)),i},ns=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},ss=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},as=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new $n(0),0];if(1==n){var a=new $n(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var o=r[0],u=r[1],l=0,h=1,d=2;for(r[0]={s:-1,f:o.f+u.f,l:o,r:u};h!=n-1;)o=r[r[d].f>r[l].f?l++:d++],u=r[l!=h&&r[d].f>r[l].f?l++:d++],r[h++]={s:-1,f:o.f+u.f,l:o,r:u};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new Bn(c+1),f=os(r[h-1],v,0);if(f>e){i=0;var p=0,m=f-e,g=1<<m;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=g-(1<<f-v[y]),v[y]=e}for(p>>>=m;p>0;){var w=s[i].s;e>v[w]?p-=1<<e-v[w]++-1:++i}for(;i>=0&&p;--i){var b=s[i].s;v[b]==e&&(--v[b],++p)}f=e}return[new $n(v),f]},os=function(t,e,r){return-1==t.s?Math.max(os(t.l,e,r+1),os(t.r,e,r+1)):e[t.s]=r},us=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Bn(++e),i=0,n=t[0],s=1,a=function(t){r[i++]=t},o=1;e>=o;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[r.subarray(0,i),e]},ls=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},hs=function(t,e,r){var i=r.length,n=rs(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},ds=function(t,e,r,i,n,s,a,o,u,l,h){ns(e,h++,r),++n[256];for(var d=as(n,15),c=d[0],v=d[1],f=as(s,15),p=f[0],m=f[1],g=us(c),y=g[0],w=g[1],b=us(p),k=b[0],_=b[1],S=new Bn(19),I=0;y.length>I;++I)S[31&y[I]]++;for(I=0;k.length>I;++I)S[31&k[I]]++;for(var M=as(S,7),C=M[0],R=M[1],x=19;x>4&&!C[jn[x-1]];--x);var T,A,O,E,F=l+5<<3,N=ls(n,Xn)+ls(s,Yn)+a,L=ls(n,c)+ls(s,p)+a+14+3*x+ls(S,C)+(2*S[16]+3*S[17]+7*S[18]);if(N>=F&&L>=F)return hs(e,h,t.subarray(u,u+l));if(ns(e,h,1+(N>L)),h+=2,N>L){T=Kn(c,v,0),A=c,O=Kn(p,m,0),E=p;var D=Kn(C,R,0);for(ns(e,h,w-257),ns(e,h+5,_-1),ns(e,h+10,x-4),h+=14,I=0;x>I;++I)ns(e,h+3*I,C[jn[I]]);h+=3*x;for(var P=[y,k],B=0;2>B;++B){var W=P[B];for(I=0;W.length>I;++I)ns(e,h,D[z=31&W[I]]),h+=C[z],z>15&&(ns(e,h,W[I]>>>5&127),h+=W[I]>>>12)}}else T=ts,A=Xn,O=es,E=Yn;for(I=0;o>I;++I)if(i[I]>255){var z;ss(e,h,T[257+(z=i[I]>>>18&31)]),h+=A[z+257],z>7&&(ns(e,h,i[I]>>>23&31),h+=zn[z]);var U=31&i[I];ss(e,h,O[U]),h+=E[U],U>3&&(ss(e,h,i[I]>>>5&8191),h+=Un[U])}else ss(e,h,T[i[I]]),h+=A[i[I]];return ss(e,h,T[256]),h+A[256]},cs=new Wn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),vs=function(){for(var t=new Wn(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),fs=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=vs[255&r^e[i]]^r>>>8;t=r},d:()=>4294967295^t}},ps=function(t,e,r,i,n){return function(t,e,r,i,n,s){var a=t.length,o=new $n(i+a+5*(1+Math.floor(a/7e3))+n),u=o.subarray(i,o.length-n),l=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var d=h+65535;a>d?l=hs(u,l,t.subarray(h,d)):(u[h]=true,l=hs(u,l,t.subarray(h,a)))}else{for(var c=cs[e-1],v=c>>>13,f=8191&c,p=(1<<r)-1,m=new Bn(32768),g=new Bn(p+1),y=Math.ceil(r/3),w=2*y,b=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<w)&p},k=new Wn(25e3),_=new Bn(288),S=new Bn(32),I=0,M=0,C=(h=0,0),R=0,x=0;a>h;++h){var T=b(h),A=32767&h,O=g[T];if(m[A]=O,g[T]=A,h>=R){var E=a-h;if((I>7e3||C>24576)&&E>423){l=ds(t,u,0,k,_,S,M,C,x,h-x,l),C=I=M=0,x=h;for(var F=0;286>F;++F)_[F]=0;for(F=0;30>F;++F)S[F]=0}var N=2,L=0,D=f,P=A-O&32767;if(E>2&&T==b(h-P))for(var B=Math.min(v,E)-1,W=Math.min(32767,h),z=Math.min(258,E);W>=P&&--D&&A!=O;){if(t[h+N]==t[h+N-P]){for(var U=0;z>U&&t[h+U]==t[h+U-P];++U);if(U>N){if(N=U,L=P,U>B)break;var j=Math.min(P,U-2),q=0;for(F=0;j>F;++F){var H=h-P+F+32768&32767,G=H-m[H]+32768&32767;G>q&&(q=G,O=H)}}}P+=(A=O)-(O=m[A])+32768&32767}if(L){k[C++]=268435456|Gn[N]<<18|Vn[L];var V=31&Gn[N],Z=31&Vn[L];M+=zn[V]+Un[Z],++_[257+V],++S[Z],R=h+N,++I}else k[C++]=t[h],++_[t[h]]}}l=ds(t,u,true,k,_,S,M,C,x,h-x,l)}return is(o,0,i+rs(l)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i)},ms=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},gs=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&ms(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}},ys=function(t){return 10+(t.filename&&t.filename.length+1||0)};function ws(t,e){for(var r="",i=0;t.length>i;){var n=t[i++];r+=String.fromCharCode(n)}return r}class bs{constructor(t,e){var r,i;void 0===e&&(e={}),this.gh={},this.yh=t=>{if(!this.gh[t]){var e,r;this.gh[t]=!0;var i=this.wh(t);null==(e=(r=this.bh).onBlockedNode)||e.call(r,t,i)}},this.kh=t=>{var e=this.wh(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var r=e.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[t,e]},this.wh=t=>this._rrweb.mirror.getNode(t),this._h=t=>{var e,r,i,n,s,a,o,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(i=null==(n=t.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(s=null==(a=t.texts)?void 0:a.length)&&void 0!==s?s:0)+(null!==(o=null==(u=t.adds)?void 0:u.length)&&void 0!==o?o:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,r=this._h(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var e=this.kh(t.id);return!this.To.consumeRateLimit(e[0])&&t})));var i=this._h(e);return 0!==i||r===i?t:void 0},this._rrweb=t,this.bh=e,this.To=new Ur({bucketSize:null!==(r=this.bh.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.bh.refillRate)&&void 0!==i?i:10,refillInterval:1e3,et:this.yh,rt:Vr})}reset(){this.gh={}}stop(){this.To.stop(),this.reset()}}Hr.DEBUG=!1,Hr.LIB_VERSION="1.412.0",Hr.LIB_NAME="web";class ks{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.Sh=t.get_property.bind(t),this.Ih=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Ih(ln,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,r=this.Sh(ln);return Fr(e=r)&&Lr(e.sessionId)&&$r(e.size)&&r.sessionId===t?r.size:0}}function _s(t,e){return function(t){for(var e=0,r=0;t.length>r;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<zr(100*e,0,100,Vr)}var Ss=function(t,e){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},Is={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>Ss(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Ss(e,t))))),icontains:(t,e)=>e.map(Ms).some((e=>t.map(Ms).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Ms).every((e=>t.map(Ms).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},Ms=t=>t.toLowerCase(),Cs=new Set(["is_not","not_icontains","not_regex"]);function Rs(t,e,r){return!t||0===t.length||t.every((t=>{var i="person"===t.type?r:e,n=null==i?void 0:i[t.key],s=t.operator||"exact";if(Nr(n)||Dr(n))return Cs.has(s);var a=Is[s];return!!a&&!Nr(t.value)&&!Dr(t.value)&&a(Or(t.value)?t.value.map(String):[String(t.value)],Or(n)?n.map(String):[String(n)])}))}var xs=Zr("[SessionRecording]");function Ts(t,e){return e?t:"!"+t}function As(t,e){return t===e||t!=="!"+e&&null}class Os{constructor(t,e,r,i,n,s,a){this.Mh=null,this.Ch=Fn,this._instance=t,this.dh=e,this.fh=r,this.ph=i,this.Rh=n,this.xh=s,this.Th=a}onRemoteConfig(t){this.Mh=$r(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ah=new In([this.fh,this.dh]),this.Ch=En):(this.Ah=new Mn([this.fh,this.dh]),this.Ch=Fn),this._instance.register_for_session({[dn]:t.triggerMatchType}),this.dh.onConfig(t),this.fh.onConfig(t),this.ph.onConfig(t,((t,e)=>{this.Rh("linked_flag_matched",{flag:t,variant:e}),this.Th()}))}getStatus(t){return this.Ch({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e=this._instance.get_property("$session_recording_remote_config"),r=null==e?void 0:e.minimumDurationMilliseconds;return $r(r)?r:null}checkUrlTriggers(t,e,r,i){this.dh.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.fh.lh.length&&Pr(this.Oh))return this.Oh=t((t=>{try{this.fh.checkEventTriggerConditions(t.event,r,e)}catch(t){xs.error("Could not activate event trigger",t)}})),this.Oh}makeSamplingDecisions(t){var e,r,i,n=this.Mh;if(!$r(n))return null==(r=this._instance.persistence)||r.unregister(tn),void(null==(i=this._instance.persistence)||i.unregister(Ji));var s=this._instance.get_property(tn),a=this._instance.get_property(Ji),o=As(s,t),u=$r(a)&&a!==n,l=Nr(a)&&s===t,h=u||l||!Br(o),d=h?_s(t,n):o;h&&(d?this.Rh("sampled"):xs.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[tn]:Ts(t,d),[Ji]:Dr(a)&&s===t?null:n})}ensureSamplingDecision(t){if($r(this.Mh)){var e=this._instance.get_property(tn);Br(As(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i,n;null==(t=this._instance.persistence)||t.unregister(nn),null==(e=this._instance.persistence)||e.unregister(rn),null==(r=this._instance.persistence)||r.unregister(tn),null==(i=this._instance.persistence)||i.unregister(Ji),null==(n=this._instance.persistence)||n.unregister(en)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Ah)?void 0:e.triggerStatus(t))===bn}stop(){var t;null==(t=this.Oh)||t.call(this),this.Oh=void 0,this.fh.stop(),this.dh.stop(),this.ph.stop()}}class Es{constructor(t,e,r,i,n){this.Eh=[],this.Fh=new Map,this.Nh=!1,this._instance=t,this.dh=e,this.Rh=r,this.Lh=i,this.Th=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Dh(t.triggerGroups),this._instance.register_for_session({[dn]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:t.triggerGroups.length}),this.dh.onConfig(t)):xs.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return gn;if(t.urlTriggerMatching.urlBlocked)return mn;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return cn;var i=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===wn){var o=s.group.id,u=r.get(o);Nr(u)?Vr.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===u&&(n=!0)}else a===bn&&(i=!0)}return n?vn:i?pn:cn}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Eh,triggerGroupSamplingResults:this.Fh,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.Eh)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;$r(i)&&(Dr(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.dh.checkUrlBlocklist(e,r);var s=function(i){i.checkUrlTriggerConditions(e,r,(e=>{n.Ph(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t),n.Th(e))}),t)};for(var a of this.Eh)s(a)}setupEventTriggerListeners(t,e,r){var i=this;return this.Oh=t((t=>{var r;if(this.Nh)return xs.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.Oh)||r.call(this),void(this.Oh=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,(n=>{if(i.Ph(r,t.properties)){var s=(r.group.conditions.events||[]).filter((e=>e.name===t.event)),a=i._instance.get_property(hn);s.some((e=>!e.properties||0===e.properties.length||Rs(e.properties,t.properties,a)))&&(r.activateTrigger(n,e),i.updateActiveTriggers(e),i.Th(n))}}),e)};for(var s of this.Eh)n(s)}catch(t){xs.error("Could not activate event trigger for trigger groups",t)}})),this.Oh}makeSamplingDecisions(t){for(var e of this.Eh){var r,i=e.group,n=i.id,s=i.sampleRate,a=on+n,o=this._instance.get_property(a),u=null,l=!1,h=!1,d=!1;if(Fr(o)){var c=o.sessionId,v=o.sampleRate,f=o.sampled;l="string"==typeof c&&c!==t,h=$r(v)&&v!==s,u=c===t&&$r(v)&&v===s&&Br(f)?f:null}else u=o===t||null,l="string"==typeof o&&o!==t,d=o===t;var p=l||h||d||!Br(u),m=p?_s(t+n,s):u;p&&this.Lh("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:s,isSampled:m}),this.Fh.set(n,m),null==(r=this._instance.persistence)||r.register({[a]:{sessionId:t,sampleRate:s,sampled:m}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Nh=!0}clearConditionalRecordingPersistence(){var t,e,r;for(var i of(null==(t=this._instance.persistence)||t.unregister(tn),null==(e=this._instance.persistence)||e.unregister(Ji),null==(r=this._instance.persistence)||r.unregister(en),this.Eh)){var n,s,a,o=i.group.id;null==(n=this._instance.persistence)||n.unregister(sn+o),null==(s=this._instance.persistence)||s.unregister(an+o),null==(a=this._instance.persistence)||a.unregister(on+o)}}updateActiveTriggers(t){var e=[];for(var r of this.Eh){var i=r.group,n=i.id,s="trigger_activated"===r.triggerStatus(t),a=!0===this.Fh.get(n);s&&e.push({id:n,name:i.name,matched:!0,sampled:a})}this._instance.register_for_session({$sdk_debug_replay_matched_recording_trigger_groups:e})}hasPendingTriggers(t){for(var e of this.Eh)if(e.triggerStatus(t)===bn)return!0;return!1}stop(){var t;null==(t=this.Oh)||t.call(this),this.Oh=void 0,this.Eh.forEach((t=>t.stop())),this.Eh=[],this.Fh.clear(),this.dh.stop()}Ph(t,e){var r=t.group.conditions.properties;return!r||0===r.length||Rs(r,e,this._instance.get_property(hn))}Dh(t){var e=this;this.Eh.forEach((t=>t.stop())),this.Eh=[],this.Fh.clear();var r=function(t){var r=new On(e._instance,t,((r,i)=>{e.Rh("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name}),e.Th()}));e.Eh.push(r)};for(var i of t)r(i)}}var Fs=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"];function Ns(t){return Nr(t)?void 0:Math.round(t)}function Ls(t){return Fr(t)?t.network_timing:t}var Ds,Ps,$s=943718.4,Bs="[SessionRecording]",Ws=Zr(Bs),zs=[Vi.MouseMove,Vi.MouseInteraction,Vi.Scroll,Vi.ViewportResize,Vi.Input,Vi.TouchMove,Vi.MediaInteraction,Vi.Drag],Us=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function js(){var t;return null==_r||null==(t=_r.__PosthogExtensions__)?void 0:t.rrweb}function qs(){var t;return null==(t=js())?void 0:t.record}function Hs(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,Nn())}}function Gs(t){return ws(function(t,e){void 0===e&&(e={});var r=fs(),i=t.length;r.p(t);var n=ps(t,e,ys(e),8),s=n.length;return gs(n,e),ms(n,s-8,r.d()),ms(n,s-4,i),n}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new $n(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},a=0;r>a;++a){if(n+5>i.length){var o=new $n(n+8+(r-a<<1));o.set(i),i=o}var u=t.charCodeAt(a);128>u?s(u):2048>u?(s(192|u>>>6),s(128|63&u)):u>55295&&57344>u?(s(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++a))>>>18),s(128|u>>>12&63),s(128|u>>>6&63),s(128|63&u)):(s(224|u>>>12),s(128|u>>>6&63),s(128|63&u))}return is(i,0,n)}(Hs(t))))}function Vs(t){return Zs.apply(this,arguments)}function Zs(){return Zs=e((function*(t){var e=Hs(t),r=yield function(t,e,r){return Cr.apply(this,arguments)}(e,Hr.DEBUG,{rethrow:!0});return ws(new Uint8Array(yield r.arrayBuffer()))})),Zs.apply(this,arguments)}var Js="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Qs=!1;function Ks(t){return Or(t)&&0===t.length?Ds=null!=Ds?Ds:Gs([]):Gs(t)}function Xs(t){return Ys.apply(this,arguments)}function Ys(){return(Ys=e((function*(t){return Or(t)&&0===t.length?Ds||(Ps=null!=Ps?Ps:Vs([]).then((t=>(Ds=t,t))).catch((t=>{throw Ds=void 0,Ps=void 0,t}))):Vs(t)}))).apply(this,arguments)}function ta(t){return Js&&!Qs&&function(t){return t.type===Gi.FullSnapshot||t.type===Gi.IncrementalSnapshot&&(t.data.source===Vi.Mutation||t.data.source===Vi.StyleSheetRule)}(t)}function ea(t){return{event:t,size:Dn(t)}}function ra(t,e){return r({},t,{data:e,cv:"2024-10"})}function ia(t,e){return r({},t,{cv:"2024-10",data:r({},t.data,e)})}function na(t){try{if(t.type===Gi.FullSnapshot)return ea(ra(t,Gs(t.data)));if(t.type===Gi.IncrementalSnapshot&&t.data.source===Vi.Mutation)return ea(ia(t,{texts:Ks(t.data.texts),attributes:Ks(t.data.attributes),removes:Ks(t.data.removes),adds:Ks(t.data.adds)}));if(t.type===Gi.IncrementalSnapshot&&t.data.source===Vi.StyleSheetRule)return ea(ia(t,{adds:t.data.adds?Gs(t.data.adds):void 0,removes:t.data.removes?Gs(t.data.removes):void 0}))}catch(t){Ws.error("could not compress event - will use uncompressed event",t)}return{event:t,size:Ln(t)}}function sa(){return(sa=e((function*(t){try{if(t.type===Gi.FullSnapshot)return ea(ra(t,yield Vs(t.data)));if(t.type===Gi.IncrementalSnapshot&&t.data.source===Vi.Mutation){var e=yield Promise.all([Xs(t.data.texts),Xs(t.data.attributes),Xs(t.data.removes),Xs(t.data.adds)]);return ea(ia(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(t.type===Gi.IncrementalSnapshot&&t.data.source===Vi.StyleSheetRule){var r=yield Promise.all([t.data.adds?Vs(t.data.adds):void 0,t.data.removes?Vs(t.data.removes):void 0]);return ea(ia(t,{adds:r[0],removes:r[1]}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===Sr})(e)&&(Qs=!0),Ws.error("could not compress event asynchronously - trying synchronous compression",e),na(t)}return{event:t,size:Ln(t)}}))).apply(this,arguments)}function aa(t,e){return t.type===Gi.Custom&&t.data.tag===e}function oa(t){return aa(t,"sessionIdle")}function ua(t){return aa(t,"$session_ending")}function la(t){return aa(t,"$session_starting")}class ha{get sessionId(){return this.$r}get $h(){if(!this._instance.sessionManager)throw new Error(Bs+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Bh(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get Wh(){return As(this._instance.get_property(tn),this.sessionId)}get Mh(){var t,e=null==(t=this.Tl)?void 0:t.sampleRate;return $r(e)?e:null}get zh(){var t,e;return null!==(t=null==(e=this.Uh)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t){this.jh="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.qh=void 0,this.Hh=Date.now(),this.Gh=!1,this.Vh=[],this.Zh="unknown",this.Jh=!1,this.Qh=!1,this.Kh=!1,this.Xh=!1,this.Yh=!1,this.kd=!1,this._d=!1,this.Sd=!1,this.Id=!1,this.Md=[],this.Cd=void 0,this.Rd=void 0,this.Td=[],this.Ad=0,this.Od=0,this.Ed=!1,this.Fd=void 0,this.Oh=void 0,this.Nd=void 0,this.Ld=void 0,this.Dd=void 0,this.Sr=(t,e,r)=>{var i,n,s,a;if(r&&(t!==this.$r||e!==this.Dr)){var o,u=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),l=this.$r,h=this.Dr;if(u&&this.Lh("$session_ending",{currentSessionId:l,currentWindowId:h,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Hh,flushed_size:null==(o=this.Pd)?void 0:o.currentTrackedSize(l)}),null==(i=this._instance.persistence)||i.unregister(un),this._d=!1,null==(n=js())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.$d=void 0,null==(s=js())||null==s.resetSnapshotCostState||s.resetSnapshotCostState(),this.Lh("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.Bd(),!(!1===this.Zh&&this.isStarted||this.$r===t&&this.Dr===e)){var d=this.$r!==t&&!1!==this.Zh;this.Zh="unknown",this.Wd(d)}u&&this.Lh("$session_starting",{previousSessionId:l,previousWindowId:h,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Hh}),null==(a=this.Uh)||a.makeSamplingDecisions(t)}},this.zd=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[en])===this.$r},this.Ud=()=>{var t,e;if(0===this.O.data.length)return null;var r=null==(t=this.O.data[0])?void 0:t.timestamp,i=null==(e=this.O.data[this.O.data.length-1])?void 0:e.timestamp;return $r(r)&&$r(i)?i-r:null},this.jd=()=>{var t,e,r=this.zh;if(!$r(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.qd;return $r(i)&&i>=0&&r>i}if(this.zd())return!1;var n,s=this.Ud();return!!Dr(s)||r>s||(null==(n=this._instance.persistence)||n.register({[en]:this.$r}),!1)},this.Hd=()=>{this.status!==pn?(this.Jh&&this.Qh&&!this.Kh&&(this.Jh=!1),this.Gd(),this.Vd()):this.Zd()},this.Jd=()=>{this.Lh("browser offline",{})},this.pa=()=>{this.Lh("browser online",{})},this.Ie=()=>{null!=yr&&yr.visibilityState&&this.Lh("window "+yr.visibilityState,{})},this._instance=t;var e=this.$h.checkAndGetSessionAndWindowId(),r=e.windowId;this.$r=e.sessionId,this.Dr=r,this.ph=new Tn(this._instance),this.dh=new xn(this._instance),this.fh=new An(this._instance),this.O=this.Zd(),this.$h.sessionTimeoutMs>this.Bh||Ws.warn("session_idle_threshold_ms ("+this.Bh+") is greater than the session timeout ("+this.$h.sessionTimeoutMs+"). Session will never be detected as idle"),this.Pd=new ks(this._instance)}get Qd(){var t,e,r,i,n,s,a,o=null==(t=this.Tl)?void 0:t.masking,u={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector},l=null!==(n=null==u?void 0:u.maskAllInputs)&&void 0!==n?n:null==o?void 0:o.maskAllInputs,h=null!==(s=null==u?void 0:u.maskTextSelector)&&void 0!==s?s:null==o?void 0:o.maskTextSelector,d=null!==(a=null==u?void 0:u.blockSelector)&&void 0!==a?a:null==o?void 0:o.blockSelector;return Nr(l)&&Nr(h)&&Nr(d)?void 0:{maskAllInputs:null==l||l,maskTextSelector:h,blockSelector:d}}Kd(){var t;if(!this.Sd){var e=null==(t=this.Tl)?void 0:t.masking;if(!Pr(e)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector"].filter((t=>{var i=null==r?void 0:r[t],n=e[t];return!Nr(i)&&i!==n}));0!==i.length&&(this.Sd=!0,Ws.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==r?void 0:r.maskAllInputs,maskTextSelector:null==r?void 0:r.maskTextSelector,blockSelector:null==r?void 0:r.blockSelector},project:e}))}}}get Xd(){var t;return zr(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Zr("canvas recording resolution scale"),1)}get Yd(){var t,e,r,i,n,s,a,o=this._instance.config.session_recording.captureCanvas,u=null==(t=this.Tl)?void 0:t.canvasRecording,l=null!==(e=null!==(r=null==o?void 0:o.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==e&&e,h=null!==(i=null!==(n=null==o?void 0:o.canvasFps)&&void 0!==n?n:null==u?void 0:u.fps)&&void 0!==i?i:4,d=null!==(s=null!==(a=null==o?void 0:o.canvasQuality)&&void 0!==a?a:null==u?void 0:u.quality)&&void 0!==s?s:.4;if("string"==typeof d){var c=parseFloat(d);d=isNaN(c)?.4:c}return{enabled:l,fps:zr(h,0,12,Zr("canvas recording fps"),4),quality:zr(d,0,1,Zr("canvas recording quality"),.4)}}get tc(){var t,e=!(null==(t=this.Tl)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get ec(){var t,e,r,i=null==(t=this.Tl)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),a=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),o=Ls(this._instance.config.capture_performance),u=Ls(null==i?void 0:i.capturePerformance),l=!!(Br(o)?o:u);return s||a||l?{recordHeaders:s,recordBody:a,recordPerformance:l}:void 0}rc(){var t,e,i=[],n=null==(t=_r.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.tc&&i.push(n());var s=null==(e=_r.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;return this.ec&&Er(s)&&(!Kr.includes(wr.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(s(((t,e)=>{var i,n={payloadSizeLimitBytes:fi.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...fi.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...fi.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,o=!1!==t.capture_performance&&e.recordPerformance,u=(i=vi(n),t=>(null!=t&&t.requestBody&&(t.requestBody=bi(t.requestBody,t.requestHeaders,i,"Request")),null!=t&&t.responseBody&&(t.responseBody=bi(t.responseBody,t.responseHeaders,i,"Response")),t)),l=e=>{return u(((t,e)=>{var r,i=Xr(t.name),n=0===e.indexOf("http")?null==(r=Xr(e))?void 0:r.pathname:e;"/"===n&&(n="");var s=null==i?void 0:i.pathname.replace(n||"","");if(!(i&&s&&wi.some((t=>0===s.indexOf(t)))))return t})((yi((r=e).requestHeaders),yi(r.responseHeaders),r),t.api_host));var r},h=Er(t.session_recording.maskNetworkRequestFn);return h&&Er(t.session_recording.maskCapturedNetworkRequestFn)&&Vr.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return r({},e,{name:null==i?void 0:i.url})}),n.maskRequestFn=Er(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r,i=l(e);return i&&null!==(r=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(i))&&void 0!==r?r:void 0}:t=>function(t){if(!Nr(t))return t.requestBody=ki(t.requestBody,"Request"),t.responseBody=ki(t.responseBody,"Response"),t}(l(t)),r({},fi,n,{recordHeaders:s,recordBody:a,recordPerformance:o,recordInitialRequests:o,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.ec))):Ws.info("NetworkCapture not started because we are on localhost.")),i}ic(t){return this._instance.config.disable_capture_url_hashes?jr(t):t}nc(t,e){void 0===e&&(e=!1);var r=e?jr(t):this.ic(t),i=this._instance.config.mask_personal_data_properties?[...Fs,...this._instance.config.custom_personal_data_properties||[]]:[];return this.sc(function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[1],s=(i[0]||"").split("?"),a=s[1],o=s[0],u=(a||"").split("&"),l=[],h=0;u.length>h;h++){var d=u[h].split("=");Or(d)&&(e.includes(d[0])?l.push(d[0]+"=<masked>"):l.push(u[h]))}var c=o;return null!=a&&(c+="?"+l.join("&")),null!=n&&(c+="#"+n),c}(r,i))}sc(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var r,i=e.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}ac(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Vh.length?this.Vh.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Ws.warn("could not emit queued rrweb event.",e,t),!1}}Lh(t,e){return this.ac(Us((()=>qs().addCustomEvent(t,e))))}oc(){try{if(this._instance.config.capture_pageview||!mr)return;var t=new URL(mr.location.href),e=this.nc(t.origin+t.pathname+t.search);this.uc!==e&&(this.uc=e,this.Lh("$url_changed",{href:e}))}catch(t){}}lc(){if(this.Vh.length){var t=[...this.Vh];this.Vh=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.ac(t)}))}}xh(){return this.ac(Us((()=>qs().takeFullSnapshot())))}get hc(){var t,e,r;if(null!=(t=this.Uh)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var i,n=null==(i=this._instance.config.session_recording)?void 0:i.trigger_pending_buffer_interval_millis;return $r(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}dc(){if(this.cc&&clearInterval(this.cc),!0!==this.Zh){var t=this.hc;t&&(this.cc=setInterval((()=>{this.xh()}),t))}}Th(t){"event"===t&&this.vc(),!this.dh.urlBlocked&&["sampled","active"].includes(this.status)&&this.dc()}fc(){this.dh.urlBlocked||(this.dh.urlBlocked=!0,clearInterval(this.cc),Ws.info("recording paused due to URL blocker"),this.Lh("recording paused",{reason:"url blocker"}))}mc(){this.dh.urlBlocked&&(this.dh.urlBlocked=!1,this.xh(),this.dc(),this.Lh("recording resumed",{reason:"left blocked url"}),Ws.info("recording resumed"))}gc(t,e){var r;if("event"===t&&this.vc(),!this.Gh&&null!=(r=this.Uh)&&r.hasPendingTriggers(this.sessionId)){this.Gh=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===t?rn:nn]:this.sessionId}),null==(n=this.Uh)||n.updateActiveTriggers(this.sessionId),this.Th(),this.Vd(),this.Rh(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Gh=!1}}}get isStarted(){return!!this.qh}get Tl(){var t=this._instance.get_property(Zi);if(t){var e;try{e=Fr(t)?t:JSON.parse(t)}catch(t){return void Ws.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return Ws.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(i=this._instance.persistence)||i.unregister(Zi))}return e}}yc(t,e,r){this._instance.get_property(t)&&(e(),r())}start(t){var e,r,i=this.Tl;if(i){this.isStarted||(this.Jh=!1!==this.Zh&&!this.Xh,this.Xh=!1,this.Qh=this.Jh,this.Kh=!1),this.Ed&&(this.wc(),this.Zd());var n=this.$h.checkAndGetSessionAndWindowId(),s=n.windowId;this.$r=n.sessionId,this.Dr=s,null==(e=this._instance.persistence)||e.unregister(un),null!=i&&i.endpoint&&(this.jh=null==i?void 0:i.endpoint),this.Uh=2===(null==i?void 0:i.version)&&(null==i?void 0:i.triggerGroups)&&i.triggerGroups.length>0?new Es(this._instance,this.dh,this.Rh.bind(this),this.Lh.bind(this),this.Th.bind(this)):new Os(this._instance,this.dh,this.fh,this.ph,this.Rh.bind(this),this.xh.bind(this),this.Th.bind(this)),this.Uh.onRemoteConfig(i),null==(r=this.Oh)||r.call(this),this.Oh=this.Uh.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.gc(t,e))),this.yc(Qi,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Qi)})),this.yc(Ki,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Ki)})),this.yc(Yi,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Yi)})),this.yc(Xi,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Xi)})),this.Uh.makeSamplingDecisions(this.sessionId),this.bc(),this.Yh||(Qr(mr,"beforeunload",this.Hd),Qr(mr,"offline",this.Jd),Qr(mr,"online",this.pa),Qr(mr,"visibilitychange",this.Ie),!this.Nd&&Er(this.$h.onSessionId)&&(this.Nd=this.$h.onSessionId(this.Sr)),!this.Ld&&Er(this.$h.on)?this.Ld=this.$h.on("forcedIdleReset",(()=>{this.Bd(),this.Zh="unknown",this.stop(),this.Dd=this.$h.onSessionId(((t,e,r)=>{var i;null==(i=this.Dd)||i.call(this),this.Dd=void 0,this.Sr(t,e,r)}))})):Er(this.$h.on)||Ws.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Pr(this.Fd)&&(this.Fd=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.nc(t.properties.$current_url):"";if(!e)return;this.Lh("$pageview",{href:e})}}catch(t){Ws.error("Could not add $pageview to rrweb session",t)}}))),this.status===fn&&this.Rh(t||"recording_initialized"))}else Ws.info("remote config must be stored in persistence before recording can start")}kc(){var t,e,r,i,n,s;null==mr||mr.removeEventListener("beforeunload",this.Hd),null==mr||mr.removeEventListener("offline",this.Jd),null==mr||mr.removeEventListener("online",this.pa),null==mr||mr.removeEventListener("visibilitychange",this.Ie),clearInterval(this.cc),this._c(),null==(t=this.Fd)||t.call(this),this.Fd=void 0,null==(e=this.Oh)||e.call(this),this.Oh=void 0,null==(r=this.Nd)||r.call(this),this.Nd=void 0,null==(i=this.Ld)||i.call(this),this.Ld=void 0,null==(n=this.Dd)||n.call(this),this.Dd=void 0,null==(s=this.Uh)||s.stop(),this.Sc(),this.wc()}wc(){this.Od+=1,this.Td=[],this.Ad=0,this.Ic=void 0,this.Ed=!1}Sc(){var t,e;null==(t=this.Mc)||t.stop(),this.Vh=[],null==(e=this.qh)||e.call(this),this.qh=void 0}Cc(){if(!this.Ic||0===this.Ad)return!1;if(this.Ed)return!0;this.Ed=!0;var t=this.Od;return this._c(),this.Sc(),this.Ic.catch((()=>{})).then((()=>{t===this.Od&&(this.Ed=!1,this.Vd(),this.Zd(),this.kc(),Ws.info("stopped"))})).catch((()=>{this.Ed=!1,this.kc(),Ws.info("stopped")})),!0}stop(){this.Cc()||(this.Vd(),this.Zd(),this.kc(),Ws.info("stopped"))}Wd(t){this.stop(),this.start("session_id_changed"),this.Jh=t,this.Qh=!1}vc(){this.isStarted||(this.Xh=!0),this.Jh&&(this.Jh=!1,this.Qh=!1,this.Kh&&(this.Kh=!1,this.xh()),this.Rc())}discard(){this.Zd(),this.kc(),Ws.info("discarded")}xc(t,e,r,i,n){var s={$snapshot_bytes:r,$snapshot_data:e,$session_id:i,$window_id:n};this.status!==cn?(this.Tc(t,i),this.Ac(s)):this.Zd()}Oc(){var t,e=null==(t=js())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&(this.$d&&this.$d.durationMs>=e.durationMs||(this.$d=e),500>e.durationMs||Ws.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}Tc(t,e){t.type!==Gi.FullSnapshot?t.type===Gi.IncrementalSnapshot&&(Nr(this.Cd)||this.Cd===e||this.Rd===e||(this.Rd=e,Ws.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.xh())):this.Cd=e}Ec(t){t.counted&&t.generation===this.Od&&(this.Ad=Math.max(0,this.Ad-1)),t.counted=!1,this.Td=this.Td.filter((e=>e!==t))}Fc(t,e,r){t.processed||t.generation!==this.Od||(t.processed=!0,this.xc(t.event,e,r,t.targetSessionId,t.targetWindowId))}Nc(t){try{var e=t.compressionEnabled?na(t.event):{event:t.event,size:Ln(t.event)};this.Fc(t,e.event,e.size)}finally{this.Ec(t)}}Gd(){[...this.Td].forEach((t=>{this.Nc(t)}))}Lc(t,r,i,n){var s=this,a={event:t,compressionEnabled:r,targetSessionId:i,targetWindowId:n,generation:this.Od,processed:!1,counted:!0};this.Td.push(a),this.Ad+=1;var o=function(){var i=e((function*(){try{if(a.processed)return;var e,i;try{var n=r?ta(t)?yield function(t){return sa.apply(this,arguments)}(t):na(t):{event:t,size:Ln(t)};e=n.event,i=n.size}catch(r){Ws.error("could not process queued compression event - will use uncompressed event",r),e=t,i=Ln(t)}s.Fc(a,e,i)}finally{s.Ec(a)}}));return function(){return i.apply(this,arguments)}}();this.Ic=this.Ic?this.Ic.catch((()=>{})).then(o):o()}onRRwebEmit(t){var e,r,i,n,s,a,o;if(this._instance.sessionManager&&(this.lc(),t&&Fr(t))){if(t.type===Gi.Meta){var u=this.nc(t.data.href);if(this.uc=u,!u)return;t.data.href=u}else this.oc();if(null==(e=this.Uh)||e.checkUrlTriggers(this.sessionId,(()=>this.fc()),(()=>this.mc()),((t,e)=>this.gc(t,e))),!this.dh.urlBlocked||(l=t).type===Gi.Custom&&"recording paused"===l.data.tag){var l,h,d,c;t.type===Gi.FullSnapshot&&(null!=(h=js())&&null!=h.wasMaxDepthReached&&h.wasMaxDepthReached()&&(this._d=!0),this.Oc(),this.dc(),null==(d=this.Mc)||d.reset(),null==(c=this._instance.persistence)||c.register_once({[un]:t.timestamp},void 0)),t.type===Gi.FullSnapshot&&null!=(r=this.Uh)&&r.hasPendingTriggers(this.sessionId)&&this.Dc();var v=this.Mc?this.Mc.throttleMutations(t):t;if(v){var f=function(t){var e=t;if(e&&Fr(e)&&6===e.type&&Fr(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var r=[],i=0;e.data.payload.payload.length>i;i++)r.push(e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?e.data.payload.payload[i].slice(0,2e3)+"...[truncated]":e.data.payload.payload[i]);return e.data.payload.payload=r,t}return t}(v),p=function(t){return ua(t)?t.data.payload:null}(f),m=function(t){return la(t)?t.data.payload:null}(f);if(p||m){var g=null!=p?p:m;null!=g&&g.lastActivityTimestamp&&(f.timestamp=g.lastActivityTimestamp)}else this.Pc(f);t.type===Gi.FullSnapshot&&(this.Md.push([this.$r,t.timestamp]),this.Md.length>6&&(this.Md=this.Md.slice(-6)));var y=null!==(i=null!==(n=null==p?void 0:p.currentSessionId)&&void 0!==n?n:null==m?void 0:m.nextSessionId)&&void 0!==i?i:this.$r,w=null!==(s=null!==(a=null==p?void 0:p.currentWindowId)&&void 0!==a?a:null==m?void 0:m.nextWindowId)&&void 0!==s?s:this.Dr;if(!0!==this.Zh||function(t){return oa(t)||ua(t)||la(t)}(f)){if(oa(f)){var b=f.data.payload;b&&(f.timestamp=b.lastActivityTimestamp+b.threshold)}var k=null===(o=this._instance.config.session_recording.compress_events)||void 0===o||o;if(this.Ad>0||k&&ta(f))this.Lc(f,k,y,w);else{var _=k?na(f):{event:f,size:Ln(f)};this.xc(f,_.event,_.size,y,w)}}}}}}get status(){return this.Uh?this.Uh.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.Wh,rrwebError:this.Yh,urlTriggerMatching:this.dh,eventTriggerMatching:this.fh,linkedFlagMatching:this.ph,remoteConfig:this.Tl}):cn}log(t,e){var r;void 0===e&&(e="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.ph.linkedFlagSeen=!0,this.xh(),this.vc(),this.Rh("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[tn]:this.sessionId,[Ji]:null}),this.xh(),this.vc(),this.Rh("sampling_overridden")}overrideTrigger(t){this.gc(t),this.vc()}$c(){try{var t,e=null==mr||null==(t=mr.location)?void 0:t.href;if(!e)return;var r=this.nc(e);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}_c(){this.Bc&&(clearTimeout(this.Bc),this.Bc=void 0)}Rc(){this.Bc||(this.Bc=setTimeout((()=>{this.Vd()}),2e3))}Vd(){var t;if(this._c(),this.Jh)return this.O;null==(t=this.Uh)||t.ensureSamplingDecision(this.sessionId);var e=this.jd();if(this.status===pn||this.status===mn||this.status===cn||e)return this.Rc(),this.O;if(this.O.data.length>0){var r,i=this.$c();Pn(this.O).forEach((t=>{var e;null==(e=this.Pd)||e.trackSize(t.sessionId,t.size),this.Wc({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:Hr.LIB_NAME,$lib_version:Hr.LIB_VERSION,$snapshot_host:i})})),null==(r=this.Uh)||r.onFlushComplete()}return this.Zd()}Ac(t){var e,r=2+((null==(e=this.O)?void 0:e.data.length)||0),i=t.$session_id,n=this.O.sessionId!==i;(n||!0!==this.Zh&&!this.Jh&&this.O.size+t.$snapshot_bytes+r>$s)&&(this.O=this.Vd(),n&&this.O.data.length>0&&(this.O=this.Zd()),this.O.sessionId=i,this.O.windowId=t.$window_id),this.Jh&&(this.Kh||this.O.size+t.$snapshot_bytes+r>$s)?this.Kh||(this.Kh=!0,this.O=this.Zd()):(this.O.size+=t.$snapshot_bytes,this.O.data.push(t.$snapshot_data),this.O.sizes.push(t.$snapshot_bytes),!0===this.Zh||this.Jh||this.Rc())}Wc(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.jh),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get qd(){var t,e,r=null==(t=this.O)?void 0:t.data[(null==(e=this.O)?void 0:e.data.length)-1],i=this.$h.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i.sessionStartTimestamp:null}Dc(){if(!this.O||0===this.O.data.length)return this.Zd();for(var t=-1,e=this.O.data.length-1;e>=0;e--)if(this.O.data[e].type===Gi.Meta){t=e;break}return 0>t?this.Zd():(this.O.data=this.O.data.slice(t),this.O.sizes=this.O.sizes.slice(t),this.O.size=this.O.sizes.reduce(((t,e)=>t+e),0),this.O)}Zd(){return this.O={size:0,data:[],sizes:[],sessionId:this.$r,windowId:this.Dr},this.O}Rh(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),Ws.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Lh("$recording_started",r({reason:t},e))}zc(t){var e;return 3===t.type&&-1!==zs.indexOf(null==(e=t.data)?void 0:e.source)}Pc(t){var e=this.zc(t);e||!0===this.Zh||t.timestamp-this.Hh>this.Bh&&(this.Zh=!0,clearInterval(this.cc),this.Lh("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Hh,threshold:this.Bh,bufferLength:this.O.data.length,bufferSize:this.O.size}),this.Vd());var r=!1;if(e&&(this.Hh=t.timestamp,this.Zh)){var i="unknown"===this.Zh;this.Zh=!1,i||(this.Lh("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}var n=this.$h.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,a=n.sessionId,o=this.$r!==a,u=this.Dr!==s;if(this.Dr=s,this.$r=a,o||u){var l=o&&!1!==this.Zh;l&&(this.Zh="unknown"),this.Wd(l)}else e&&this.vc(),r&&this.dc()}Bd(){var t;null==(t=this.Uh)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,r,i,n,s,a,o=this.$h.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.O.data.length,$sdk_debug_replay_internal_buffer_size:this.O.size,$sdk_debug_current_session_duration:this.qd,$sdk_debug_session_start:o.sessionStartTimestamp,$sdk_debug_replay_flushed_size:null==(t=this.Pd)?void 0:t.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Md,$snapshot_max_depth_exceeded:this._d,$sdk_debug_replay_slowest_full_snapshot_ms:Ns(null==(e=this.$d)?void 0:e.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Ns(null==(r=this.$d)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(i=this.$d)?void 0:i.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(n=this.$d)?void 0:n.cssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==(s=this.$d)?void 0:s.deferredStylesheetCount,$sdk_debug_replay_slowest_mutation_batch_ms:Ns(null==(a=js())||null==a.getMutationCost||null==(a=a.getMutationCost())?void 0:a.slowestBatchMs),$sdk_debug_replay_rrweb_error:this.Yh,$sdk_debug_rrweb_attached:!!this.qh,$sdk_debug_rrweb_start_attempted:this.kd}}bc(){var t;if(!this.qh){this.kd=!0;var e,i,n,s={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:void 0,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},a=this._instance.config.session_recording;for(var o of Object.entries(a||{})){var u=o[0],l=o[1];if(u in s)if("maskInputOptions"===u)s.maskInputOptions=r({password:!0},l);else if("sampling"===u){var h=null!=l?l:{},d={};Nr(h.mousemove)||(d.mousemove=h.mousemove),Nr(h.mouseInteraction)||(d.mouseInteraction=h.mouseInteraction),s.sampling=d}else s[u]=l}this.Yd&&this.Yd.enabled&&(s.recordCanvas=!0,s.sampling=r({},s.sampling,{canvas:this.Yd.fps}),s.dataURLOptions={type:"image/webp",quality:this.Yd.quality},s.canvasResolutionScale=this.Xd,s.canvasMasking={configured:()=>{var t;return Er(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,r=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(Er(r))try{var i;return null!==(i=r(t))&&void 0!==i?i:null}catch(t){return this.Id||(this.Id=!0,Ws.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Qd&&(s.maskAllInputs=null===(e=this.Qd.maskAllInputs)||void 0===e||e,s.maskTextSelector=null!==(i=this.Qd.maskTextSelector)&&void 0!==i?i:void 0,s.blockSelector=null!==(n=this.Qd.blockSelector)&&void 0!==n?n:void 0),this.Kd();var c=qs();if(c){this.Mc=null!==(t=this.Mc)&&void 0!==t?t:new bs(c,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var r="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";Ws.info(r,{node:e}),this.log(Bs+" "+r,"warn")}});var v=this.rc();if(this.qh=c(r({emit:t=>{this.onRRwebEmit(t)},plugins:v},s)),!this.qh)return this.Yh=!0,void Ws.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.Yh=!1,this.Hh=Date.now(),this.Zh=Br(this.Zh)?this.Zh:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Tl),this.Lh("$session_options",{sessionRecordingOptions:s,activePlugins:v.map((t=>null==t?void 0:t.name))}),this.Lh("$posthog_config",{config:this._instance.config})}else Ws.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Lh(t,e)}}_r.__PosthogExtensions__=_r.__PosthogExtensions__||{},_r.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:t=>({name:"rrweb/console@1",observer:pr,options:t}),getRecordNetworkPlugin:t=>({name:"rrweb/network@1",observer:Hi,options:t})},_r.__PosthogExtensions__.rrweb={record:er,version:"v2",wasMaxDepthReached:()=>Tt,resetMaxDepthState(){Tt=!1,xt=!1},getLastSnapshotCost:()=>O,getMutationCost:()=>r({},N),resetSnapshotCostState(){x=0,T=0,A=C(),O=null,E=null,F=[],N={slowestBatchMs:0}}},_r.__PosthogExtensions__.initSessionRecording=t=>new ha(t)}();
|
|
1
|
+
!function(){"use strict";function t(t,e,r,i,n,s,a){try{var o=t[s](a),u=o.value}catch(t){return void r(t)}o.done?e(u):Promise.resolve(u).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var a=e.apply(r,i);function o(e){t(a,n,s,o,u,"next",e)}function u(e){t(a,n,s,o,u,"throw",e)}o(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}var i,n=["type"],s=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),o=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(o||{}),u=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(u||{}),l=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(l||{}),h=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(h||{}),d=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(d||{}),c=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(c||{}),v=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(v||{});function f(t,e){return-1!==t.indexOf(e)}var p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},m={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},g={};function y(t){if(g[t])return g[t];var e=function(t){var e,r,i=null==(r=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in p?p[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in m?m[t]:void 0,a=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&a)return g[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var u,l=!1;try{document.body.appendChild(o);var h=o.contentWindow;if(!h)return e.prototype;var d=h[t].prototype;return d?(f(u=navigator.userAgent,"AppleWebKit")&&!f(u,"Chrome")&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),g[t]=d):r}catch(t){return r}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var w={};function b(t,e,r){var i,n=t+"."+String(r);if(w[n])return w[n].call(e);var s=y(t),a=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return a?(w[n]=a,a.call(e)):e[r]}var k={};function _(t,e,r){var i=t+"."+String(r);if(k[i])return k[i].bind(e);var n=y(t)[r];return"function"!=typeof n?e[r]:(k[i]=n,n.bind(e))}function S(){return y("MutationObserver").constructor}function I(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},s=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var r=t[e];"function"==typeof r&&r.__rrweb_layer__;){var i=r.__rrweb_layer__;if(i.next===s)return void(i.next=n.next);r=i.next}else t[e]=n.next}}catch(t){return()=>{}}}var M={childNodes:t=>b("Node",t,"childNodes"),parentNode:t=>b("Node",t,"parentNode"),parentElement:t=>b("Node",t,"parentElement"),textContent:t=>b("Node",t,"textContent"),contains:(t,e)=>_("Node",t,"contains")(e),getRootNode:t=>_("Node",t,"getRootNode")(),host:t=>t&&"host"in t?b("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?b("Element",t,"shadowRoot"):null,querySelector:(t,e)=>_("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>_("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:I},C=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,deferredStylesheetCount:0});function R(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var x=0,T=0,A=C(),O=null,E=null,F=[],N={slowestBatchMs:0},L=t=>t&&t>0?t:null,D=32;function P(t,e,r){var i=t.length;if(r>=D)return i;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)i+=P(a,e,r+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var u=o.rules||o.cssRules;u&&(i+=P(u,e,r+1))}}}catch(t){}}return i}function B(t){return 0!==x&&null!==E&&(A.cssRuleCount>=E||A.cssRuleCount+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var r=new WeakSet;return r.add(t),P(e,r,0)}catch(t){return 0}}(t)>E)}function W(t){return t.nodeType===t.ELEMENT_NODE}function z(t){var e=t&&"host"in t&&"mode"in t&&M.host(t)||null;return Boolean(e&&"shadowRoot"in e&&M.shadowRoot(e)===t)}function U(t){return"[object ShadowRoot]"==={}.toString.call(t)}var j=0;function q(t){var e,r,i=0===j,n=i?R():0;j+=1;try{var s=t.rules||t.cssRules;if(!s)return null;!function(t){0!==x&&(A.cssRuleCount+=P(t,null,0))}(s);var a=t.href;return!a&&t.ownerNode&&(a=t.ownerNode.baseURI),(r=Array.from(s,(t=>H(t,a))).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r}catch(t){return null}finally{j-=1,i&&(e=R()-n,x>0&&(A.stylesheetMs+=e))}}function H(t,e){var r;if(function(t){return"styleSheet"in t}(t)){var i;try{i=q(t.styleSheet)||function(t){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){i=t.cssText}try{if(i&&(null==(r=t.styleSheet)?void 0:r.href))return et(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?et(n,e):n}class G{constructor(){a(this,"idNodeMap",new Map),a(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),W(t)){var r=M.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function V(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&Z(n);return(r[i.toLowerCase()]||o&&r[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function Z(t){return t.toLowerCase()}var J="__rrweb_original__";function Q(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Z(e):null}catch(t){return null}}var K=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,X=/^(?:[a-z+]+:)?\/\//i,Y=/^www\..*/i,tt=/^(data:)([^,]*),(.*)/i;function et(t,e){return(t||"").replace(K,((t,r,i,n,s,a)=>{var o,u=i||s||a,l=r||n||"";if(!u)return t;if(X.test(u)||Y.test(u))return"url("+l+u+l+")";if(tt.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((o=e).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),d=u.split("/");for(var c of(h.pop(),d))"."!==c&&(".."===c?h.pop():h.push(c));return"url("+l+h.join("/")+l+")"}))}var rt,it,nt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",st=4096,at=1e5,ot=10,ut=new Map,lt=1,ht=new RegExp("[^a-z0-9-_:]"),dt=-2;function ct(){return lt++}var vt=/^[^ \t\n\r\u000c]+/,ft=/^[, \t\n\r\u000c]+/,pt=new WeakMap;function mt(t,e){return e&&""!==e.trim()?gt(t,e):e}function gt(t,e){var r=pt.get(t);if(r||(r=t.createElement("a"),pt.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function yt(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?nt:t}(t,e.maxBase64ImageLength):t}function wt(t,e,r,i,n,s){var a;if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var o=null==(a=n.sheet)?void 0:a.href;if(o)return o}var u=mt(t,i);if(u.startsWith("data:")){if("img"===e&&n){var l=u;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(l=function(t,e,r,i){if(at>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>st||t.naturalHeight>st)return e;var n=ut.get(e);if(n&&n.type===r&&n.quality===i)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(r||"image/webp",null!=i?i:.4),u=e.length>o.length?o:e;if(ut.size>=ot){var l=ut.keys().next().value;void 0!==l&&ut.delete(l)}return ut.set(e,{type:r,quality:i,result:u}),u}catch(t){return e}}(n,u,s.type,s.quality)),yt(l,s)}if("image"===e)return yt(u,s)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=mt(t,i);return"image"===e&&h.startsWith("data:")?yt(h,s):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(ft),e.length>r;){var s=i(vt);if(","===s.slice(-1))s=mt(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=mt(t,s);for(var o=!1;;){var u=e.charAt(r);if(""===u){n.push((s+a).trim());break}if(o)")"===u&&(o=!1);else{if(","===u){r+=1,n.push((s+a).trim());break}"("===u&&(o=!0)}a+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?et(i,gt(t)):"object"===e&&"data"===r?mt(t,i):i:mt(t,i)}function bt(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function kt(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&kt(M.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&kt(M.parentNode(t),e,r)}function _t(t,e,r,i){var n;if(W(t)){if(!M.childNodes(n=t).length)return!1}else{if(null===M.parentElement(t))return!1;n=M.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(kt(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function St(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var It=new Map;function Mt(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Ct(t){return null==t?"":t.toLowerCase()}var Rt=50,xt=!1,Tt=!1;function At(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,u=e.skipChild,l=void 0!==u&&u,h=e.inlineStylesheet,d=void 0===h||h,c=e.maskInputOptions,f=void 0===c?{}:c,p=e.maskTextFn,m=e.maskInputFn,g=e.slimDOMOptions,y=e.dataURLOptions,w=void 0===y?{}:y,b=e.inlineImages,k=void 0!==b&&b,_=e.recordCanvas,S=void 0!==_&&_,I=e.canvasMaskingConfigured,C=e.onSerialize,R=e.onIframeLoad,T=e.iframeLoadTimeout,O=void 0===T?5e3:T,E=e.onIframeListenerRegistered,N=e.onStylesheetLoad,L=e.stylesheetLoadTimeout,D=void 0===L?5e3:L,P=e.keepIframeSrcFn,j=void 0===P?()=>!1:P,H=e.newlyAddedElement,G=void 0!==H&&H,K=e.depth,X=void 0===K?0:K,Y=e.maxDepth,tt=void 0===Y?Rt:Y,nt=e.needsMask,st=e.preserveWhiteSpace,at=void 0===st||st;if(X>=tt)return Tt=!0,xt||(xt=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+tt+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;nt||(nt=_t(t,a,o,void 0===nt)),x>0&&(A.nodeCount+=1);var ot,ut=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,u=void 0===o?{}:o,l=e.maskTextFn,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,f=e.inlineImages,p=e.recordCanvas,m=e.canvasMaskingConfigured,g=e.keepIframeSrcFn,y=e.newlyAddedElement,w=void 0!==y&&y,b=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:v.Document,childNodes:[],compatMode:t.compatMode}:{type:v.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:v.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:b};case t.ELEMENT_NODE:return function(t,e){for(var r,i,n,s,a=e.doc,o=e.inlineStylesheet,u=e.maskInputOptions,l=void 0===u?{}:u,h=e.maskInputFn,d=e.dataURLOptions,c=void 0===d?{}:d,f=e.inlineImages,p=e.recordCanvas,m=e.canvasMaskingConfigured,g=e.keepIframeSrcFn,y=e.newlyAddedElement,w=void 0!==y&&y,b=e.rootId,k=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),_=function(t){if(t instanceof HTMLFormElement)return"form";var e=Z(t.tagName);return ht.test(e)?"div":e}(t),S={},I=t.attributes.length,C=0;I>C;C++){var R=t.attributes[C];bt(_,R.name)||(S[R.name]=wt(a,_,Z(R.name),R.value,t,c))}if("link"===_&&o&&!k){var T=t.sheet;if(!T){var A=function(t){return t.href}(t);A&&!(T=Mt(a,A))&&A.includes(".css")&&(T=Mt(a,window.location.origin+"/"+A.replace(window.location.href,"")))}var O=null;T&&(B(T)?x>0&&F.push(t):O=q(T)),O&&(delete S.rel,delete S.href,S._cssText=O)}var E;if("style"===_&&t.sheet&&!(t.innerText||M.textContent(t)||"").trim().length){var N=q(t.sheet);N&&(S._cssText=N)}if("input"===_||"textarea"===_||"select"===_){var L=t.value,D=t.checked;"radio"!==S.type&&"checkbox"!==S.type&&"submit"!==S.type&&"button"!==S.type&&L?S.value=V({element:t,type:Q(t),tagName:_,value:L,maskInputOptions:l,maskInputFn:h}):D&&(S.checked=D)}if("option"===_&&(t.selected&&!l.select?S.selected=!0:delete S.selected),"dialog"===_&&t.open)try{S.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){S.rr_open_mode="modal",S.ph_rr_could_not_detect_modal=!0}if("canvas"===_&&p&&!(null==m?void 0:m()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((J in n?n[J]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(S.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var P=t.toDataURL(c.type,c.quality),W=a.createElement("canvas");W.width=t.width,W.height=t.height,P!==W.toDataURL(c.type,c.quality)&&(S.rr_dataURL=P)}if("img"===_&&f){rt||(rt=a.createElement("canvas"),it=rt.getContext("2d"));var z=t,U=z.currentSrc||z.getAttribute("src")||"<unknown-src>",j=z.crossOrigin,H=()=>{St(z,"load",H);try{rt.width=z.naturalWidth,rt.height=z.naturalHeight,it.drawImage(z,0,0),S.rr_dataURL=rt.toDataURL(c.type,c.quality)}catch(t){if("anonymous"!==z.crossOrigin)return z.crossOrigin="anonymous",void(z.complete&&0!==z.naturalWidth?H():z.addEventListener("load",H));console.warn("Cannot inline img src="+U+"! Error: "+t)}"anonymous"===z.crossOrigin&&(j?S.crossOrigin=j:z.removeAttribute("crossorigin"))};z.complete&&0!==z.naturalWidth?H():z.addEventListener("load",H)}if("audio"===_||"video"===_){var G=S;G.rr_mediaState=t.paused?"paused":"played",G.rr_mediaCurrentTime=t.currentTime,G.rr_mediaPlaybackRate=t.playbackRate,G.rr_mediaMuted=t.muted,G.rr_mediaLoop=t.loop,G.rr_mediaVolume=t.volume}if(w||(t.scrollLeft&&(S.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(S.rr_scrollTop=t.scrollTop)),k){var K=t.getBoundingClientRect(),X=K.width,Y=K.height,tt=K.left,et=K.top,nt=null==(r=a.defaultView)?void 0:r.getComputedStyle(t);S={class:S.class,rr_width:X+"px",rr_height:Y+"px",rr_left:Math.floor(tt+((null==(i=a.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(et+((null==(n=a.defaultView)?void 0:n.scrollY)||0))+"px"},nt&&(S.rr_position=nt.position||"static",nt.transform&&"none"!==nt.transform&&(S.rr_transform=nt.transform),nt.display&&nt.display.startsWith("inline")&&(S.rr_display=nt.display))}"iframe"!==_||g(S.src)||(t.contentDocument||(S.rr_src=S.src),delete S.src);try{customElements.get(_)&&(s=!0)}catch(t){}return{type:v.Element,tagName:_,attributes:S,childNodes:[],isSVG:(E=t,Boolean("svg"===E.tagName||E.ownerSVGElement)||void 0),needBlock:k,rootId:b,isCustom:s}}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,dataURLOptions:c,inlineImages:f,recordCanvas:p,canvasMaskingConfigured:m,keepIframeSrcFn:g,newlyAddedElement:w,rootId:b});case t.TEXT_NODE:return function(t,e){var r,i=e.needsMask,n=e.maskTextFn,s=e.rootId,a=M.parentNode(t),o=a&&a.tagName,u=M.textContent(t),l="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(l&&u){try{if(t.nextSibling||t.previousSibling);else if(B(a.sheet));else if(null==(r=a.sheet)?void 0:r.cssRules){var d=q(a.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(u=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=et(u,gt(e.doc))}return h&&(u="SCRIPT_PLACEHOLDER"),!l&&!h&&u&&i&&(u=n?n(u,M.parentElement(t)):u.replace(/[\S]/g,"*")),{type:v.Text,textContent:u||"",isStyle:l,rootId:s}}(t,{doc:r,needsMask:s,maskTextFn:l,rootId:b});case t.CDATA_SECTION_NODE:return{type:v.CDATA,textContent:"",rootId:b};case t.COMMENT_NODE:return{type:v.Comment,textContent:M.textContent(t)||"",rootId:b};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:nt,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,dataURLOptions:w,inlineImages:k,recordCanvas:S,canvasMaskingConfigured:I,keepIframeSrcFn:j,newlyAddedElement:G});if(!ut)return console.warn(t,"not serialized"),null;ot=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===v.Comment)return!0;if(t.type===v.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Ct(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ct(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Ct(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Ct(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Ct(t.attributes.property).match(/^(og|twitter|fb):/)||Ct(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ct(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Ct(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(Ct(t.attributes.name))||Ct(t.attributes.property).match(/^article:/)||Ct(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(Ct(t.attributes.name)))return!0}}return!1}(ut,g)||!at&&ut.type===v.Text&&!ut.isStyle&&!ut.textContent.replace(/^\s+|\s+$/gm,"").length?dt:ct();var lt=Object.assign(ut,{id:ot});if(i.add(t,lt),ot===dt)return null;C&&C(t);var vt=!l;if(lt.type===v.Element){vt=vt&&!lt.needBlock,delete lt.needBlock;var ft=M.shadowRoot(t);ft&&U(ft)&&(lt.isShadowHost=!0)}if((lt.type===v.Document||lt.type===v.Element)&&vt){g.headWhitespace&<.type===v.Element&&"head"===lt.tagName&&(at=!1);var pt={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:nt,maskTextClass:a,maskTextSelector:o,skipChild:l,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,slimDOMOptions:g,dataURLOptions:w,inlineImages:k,recordCanvas:S,canvasMaskingConfigured:I,preserveWhiteSpace:at,onSerialize:C,onIframeLoad:R,iframeLoadTimeout:O,onIframeListenerRegistered:E,onStylesheetLoad:N,stylesheetLoadTimeout:D,keepIframeSrcFn:j,depth:X+1,maxDepth:tt};if(lt.type===v.Element&&"textarea"===lt.tagName&&void 0!==lt.attributes.value);else for(var mt of Array.from(M.childNodes(t))){var yt=At(mt,pt);yt&<.childNodes.push(yt)}var kt=null;if(W(t)&&(kt=M.shadowRoot(t)))for(var Ot of Array.from(M.childNodes(kt))){var Et=At(Ot,pt);Et&&(U(kt)&&(Et.isShadow=!0),lt.childNodes.push(Et))}}var Ft=M.parentNode(t);if(Ft&&z(Ft)&&U(Ft)&&(lt.isShadow=!0),lt.type===v.Element&&"iframe"===lt.tagName){var Nt=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var a=()=>e();if("complete"!==i){var o=!1,u=null,l=()=>{o||(o=!0,null!==u&&(clearTimeout(u),u=null),St(t,"load",h),t.addEventListener("load",a),e())},h=()=>l();return u=setTimeout(l,r),t.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),o?St(t,"load",a):(o=!0,St(t,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(t){return n}if(d!==c||t.src===c||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",a),()=>{clearTimeout(v),St(t,"load",a)}}return t.addEventListener("load",a),()=>{St(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&R){var r=At(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:nt,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,slimDOMOptions:g,dataURLOptions:w,inlineImages:k,recordCanvas:S,canvasMaskingConfigured:I,preserveWhiteSpace:at,onSerialize:C,onIframeLoad:R,iframeLoadTimeout:O,onIframeListenerRegistered:E,onStylesheetLoad:N,stylesheetLoadTimeout:D,keepIframeSrcFn:j,depth:X+1,maxDepth:tt});r&&R(t,r)}}),O);null==E||E(t,Nt)}return lt.type===v.Element&&"link"===lt.tagName&&"stylesheet"===lt.attributes.rel&&function(e,u,l){if(!It.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var c=new AbortController,v=!1,y=()=>{if(!v){v=!0;try{(()=>{if(N){var e=At(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:nt,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,slimDOMOptions:g,dataURLOptions:w,inlineImages:k,recordCanvas:S,canvasMaskingConfigured:I,preserveWhiteSpace:at,onSerialize:C,onIframeLoad:R,iframeLoadTimeout:O,onStylesheetLoad:N,stylesheetLoadTimeout:D,keepIframeSrcFn:j,depth:X,maxDepth:tt});e&&N(t,e)}})()}finally{It.delete(e),c.abort()}}},b=setTimeout(y,l);c.signal.addEventListener("abort",(()=>clearTimeout(b)),{once:!0}),e.addEventListener("load",y,{signal:c.signal,once:!0}),It.set(e,c)}}}(t,0,D),lt}function Ot(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class Et{constructor(){a(this,"parentElement",null),a(this,"parentNode",null),a(this,"ownerDocument"),a(this,"firstChild",null),a(this,"lastChild",null),a(this,"previousSibling",null),a(this,"nextSibling",null),a(this,"ELEMENT_NODE",1),a(this,"TEXT_NODE",3),a(this,"nodeType"),a(this,"nodeName"),a(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Et))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}function Ft(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>Nt(r,t,e,i)}function Nt(t,e,r,i){Lt((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))}))}function Lt(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var Dt="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.",Pt={map:{},getId(){return console.error(Dt),-1},getNode(){return console.error(Dt),null},removeNodeFromMap(){console.error(Dt)},has(){return console.error(Dt),!1},reset(){console.error(Dt)}};function $t(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,a=new Array(s),o=0;s>o;o++)a[o]=arguments[o];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;0>=l||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,a)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,a)}),l))}}function Bt(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout((()=>{try{r.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>Bt(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Pt=new Proxy(Pt,{get(t,e,r){return"map"===e&&console.error(Dt),Reflect.get(t,e,r)}}));var Wt=Date.now;function zt(t){var e,r,i,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=M.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=M.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function Ut(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function jt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function qt(t){return t?t.nodeType===t.ELEMENT_NODE?t:M.parentElement(t):null}function Ht(t,e,r,i){if(!t)return!1;var n=qt(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(kt(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Gt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===dt}function Vt(t,e){if(z(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=M.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Vt(i,e))}function Zt(t){return Boolean(t.changedTouches)}function Jt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Qt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Kt(t){return!!t&&(t instanceof Et&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(M.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Wt=()=>(new Date).getTime());class Xt{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Yt(t){var e,r=null;return"getRootNode"in t&&(null==(e=M.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&M.host(M.getRootNode(t))&&(r=M.host(M.getRootNode(t))),r}function te(t){var e=t.ownerDocument;return!!e&&(M.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Yt(r);)r=e;return r}(t);return M.contains(e,r)}(t))}function ee(t){return"__ln"in t}class re{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&ee(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&ee(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var ie,ne=(t,e)=>t+"@"+e;class se{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"removesSubTreeCache",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"canvasMaskingConfigured"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"canvasManagerReleased",!1),a(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e=R();try{this.processBufferedMutations()}finally{(t=R()-e)>N.slowestBatchMs&&(N.slowestBatchMs=t)}}})),a(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,r=new re,i=t=>{for(var e=t,r=dt;r===dt;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=M.parentNode(n);if(s&&te(n)&&"TEXTAREA"!==s.tagName){var a=z(s)?this.mirror.getId(Yt(n)):this.mirror.getId(s),o=i(n);if(-1===a||-1===o)return r.addNode(n);var u=At(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{Jt(t,this.mirror)&&this.iframeManager.addIframe(t),Qt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Kt(n)&&this.shadowDomManager.addShadowRoot(M.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:a,nextId:o,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)oe(this.removesSubTreeCache,s)&&!this.movedSet.has(M.parentNode(s))||n(s);for(var a of this.addedSet)ue(this.droppedSet,a)||oe(this.removesSubTreeCache,a)?ue(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var o=null;r.length;){var u=null;if(o){var l=this.mirror.getId(M.parentNode(o.value)),h=i(o.value);-1!==l&&-1!==h&&(u=o)}if(!u)for(var d=r.tail;d;){var c=d;if(d=d.previous,c){var v=this.mirror.getId(M.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==v){u=c;break}var f=M.parentNode(c.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=M.host(f);if(-1!==this.mirror.getId(p)){u=c;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}o=u.previous,r.removeNode(u.value),n(u.value)}var m={texts:this.texts.map((t=>{var e=t.node,r=M.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e=t.attributes;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(m))})),a(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(M.childNodes(t),(t=>M.textContent(t)||"")).join("");e.attributes.value=V({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Q(t),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(t=>{if(!Gt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=M.textContent(t.target);Ht(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:_t(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,qt(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=Q(r);n=V({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Ht(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var a=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(a||(this.attributes.push(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,a)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!bt(r.tagName,i))if(a.attributes[i]=wt(this.doc,Z(r.tagName),Z(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var o=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&(o.style.cssText=t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),h=r.style.getPropertyPriority(u);l!==o.style.getPropertyValue(u)||h!==o.style.getPropertyPriority(u)?a.styleDiff[u]=""===h?l:[l,h]:a._unchangedStyles[u]=[l,h]}for(var d of Array.from(o.style))""===r.style.getPropertyValue(d)&&(a.styleDiff[d]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(a.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ht(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=z(t.target)?this.mirror.getId(M.host(t.target)):this.mirror.getId(t.target);Ht(t.target,this.blockClass,this.blockSelector,!1)||Gt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(ae(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Vt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[ne(r,i)]?ae(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!z(t.target)||!U(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),M.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Gt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[ne(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ht(t,this.blockClass,this.blockSelector,!1)||(M.childNodes(t).forEach((t=>this.genAdds(t))),Kt(t)&&M.childNodes(M.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function ae(t,e){t.delete(e),M.childNodes(e).forEach((e=>ae(t,e)))}function oe(t,e,r){return 0!==t.size&&function(t,e,r){var i=M.parentNode(e);return!!i&&t.has(i)}(t,e)}function ue(t,e){return 0!==t.size&&le(t,e)}function le(t,e){var r=M.parentNode(e);return!!r&&(!!t.has(r)||le(t,r))}var he=t=>ie?function(){try{return t(...arguments)}catch(t){if(ie&&!0===ie(t))return;throw t}}:t,de=[];function ce(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function ve(t,e){var r=new se;de.push(r),r.init(t);var i=new(S())(he(r.processMutations.bind(r))),n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),i.observe(e,n),{observer:i,buffer:r}}function fe(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,u=t=>{var a=ce(t);if(a&&!Ht(a,n,s,!0)){var u,l,h=i.getId(a);if(a===r&&r.defaultView){var d=zt(r.defaultView);u=d.left,l=d.top}else u=a.scrollLeft,l=a.scrollTop;var c=u+","+l;o.get(h)!==c&&(o.set(h,c),e({id:h,x:u,y:l}))}},l=[Ft("scroll",he($t(he((t=>u(t))),a.scroll||100)),r)];return"onscrollend"in r&&l.push(Ft("scrollend",he(u),r)),()=>l.forEach((t=>t()))}function pe(t,e){for(var r=de.length-1;r>=0;r--){var i=de[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),de.splice(r,1))}}}var me=["INPUT","TEXTAREA","SELECT"],ge=new WeakMap;function ye(t){return function t(e,r){if(_e("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||_e("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||_e("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||_e("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function we(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function be(t,e){var r,i,n,s,a=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:M.host(e));var o="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&o&&u?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var t;return null==(t=u.get)?void 0:t.call(this)},set(t){var e,r;try{r=null==(e=u.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return r}}),he((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function ke(t,e){void 0===e&&(e={});var i,n,s=t.doc.defaultView;if(!s)return()=>{};if(function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,a=t.viewportResizeCb,o=t.inputCb,u=t.mediaInteractionCb,l=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,c=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM){var a=ve(t,t.doc);i=a.observer,n=a.buffer}var o,d,v,f,p,m,g,y,w,b=function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.mirror;if(!1===r.mousemove)return()=>{};var s,a="number"==typeof r.mousemove?r.mousemove:50,o="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],h=$t(he((t=>{var r=Date.now()-s;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],s=null})),o),d=he($t(he((t=>{var e=ce(t),r=Zt(t)?t.changedTouches[0]:t,i=r.clientX,a=r.clientY;s||(s=Wt()),l.push({x:i,y:a,id:n.getId(e),timeOffset:Wt()-s}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?u.Drag:t instanceof MouseEvent?u.MouseMove:u.TouchMove)})),a,{trailing:!1})),c=[Ft("mousemove",d,i),Ft("touchmove",d,i),Ft("drag",d,i)];return he((()=>{c.forEach((t=>t()))}))}(t),k=function(t){var e=t.mouseInteractionCb,i=t.doc,n=t.mirror,s=t.blockClass,a=t.blockSelector,o=t.sampling;if(!1===o.mouseInteraction)return()=>{};var u=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,d=[],c=null;return Object.keys(l).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==u[t])).forEach((t=>{var o=Z(t),u=(t=>i=>{var o=ce(i);if(!Ht(o,s,a,!0)){var u=null,d=t;if("pointerType"in i){switch(i.pointerType){case"mouse":u=h.Mouse;break;case"touch":u=h.Touch;break;case"pen":u=h.Pen}u===h.Touch&&(l[t]===l.MouseDown?d="TouchStart":l[t]===l.MouseUp&&(d="TouchEnd"))}else Zt(i)&&(u=h.Touch);null!==u?(c=u,(d.startsWith("Touch")&&u===h.Touch||d.startsWith("Mouse")&&u===h.Mouse)&&(u=null)):l[t]===l.Click&&(u=c,c=null);var v=Zt(i)?i.changedTouches[0]:i;if(v){var f=n.getId(o),p=v.clientX,m=v.clientY;he(e)(r({type:l[d],id:f,x:p,y:m},null!==u&&{pointerType:u}))}}})(t);if(window.PointerEvent)switch(l[t]){case l.MouseDown:case l.MouseUp:o=o.replace("mouse","pointer");break;case l.TouchStart:case l.TouchEnd:return}d.push(Ft(o,u,i))})),he((()=>{d.forEach((t=>t()))}))}(t),_=fe(t),S=function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,s=-1;return Ft("resize",he($t(he((()=>{var t=Ut(),e=jt();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:s}),C=function(t){var e=t.inputCb,i=t.doc,n=t.mirror,s=t.blockClass,a=t.blockSelector,o=t.ignoreClass,u=t.ignoreSelector,l=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function c(t){var e=ce(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=M.parentElement(e)),e&&c&&me.indexOf(c)>=0&&!Ht(e,s,a,!0)&&!(e.classList.contains(o)||u&&e.matches(u))){var f=e.value,p=!1,m=Q(e)||"";"radio"===m||"checkbox"===m?p=e.checked:(l[c.toLowerCase()]||l[m])&&(f=V({element:e,maskInputOptions:l,tagName:c,type:m,value:f,maskInputFn:h})),v(e,d?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var g=e.name;"radio"===m&&g&&p&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}}function v(t,i){var s=ge.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){ge.set(t,i);var a=n.getId(t);he(e)(r({},i,{id:a}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>Ft(t,he(c),i))),p=i.defaultView;if(!p)return()=>{f.forEach((t=>t()))};var m=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return m&&m.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((t=>Bt(t[0],t[1],{set(){he(c)({target:this,isTrusted:!1})}},!1,p)))),he((()=>{f.forEach((t=>t()))}))}(t),R=(d=(o=t).mediaInteractionCb,v=o.blockClass,f=o.blockSelector,p=o.mirror,m=o.sampling,g=o.doc,y=he((t=>$t(he((e=>{var r=ce(e);if(r&&!Ht(r,v,f,!0)){var i=r.currentTime,n=r.volume,s=r.muted,a=r.playbackRate,o=r.loop;d({type:t,id:p.getId(r),currentTime:i,volume:n,muted:s,playbackRate:a,loop:o})}})),m.media||500))),w=[Ft("play",y(c.Play),g),Ft("pause",y(c.Pause),g),Ft("seeked",y(c.Seeked),g),Ft("volumechange",y(c.VolumeChange),g),Ft("ratechange",y(c.RateChange),g)],he((()=>{w.forEach((t=>t()))}))),x=()=>{},T=()=>{},A=()=>{},O=()=>{};t.recordDOM&&(x=function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,s=e.win;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var a=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:he(((t,e,s)=>{var a=s[0],o=s[1],u=we(e,i,n.styleMirror),l=u.id,h=u.styleId;return(l&&-1!==l||h&&-1!==h)&&r({id:l,styleId:h,adds:[{rule:a,index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var o,u,l=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:he(((t,e,s)=>{var a=s[0],o=we(e,i,n.styleMirror),u=o.id,l=o.styleId;return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,removes:[{index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(o=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:he(((t,e,s)=>{var a=s[0],o=we(e,i,n.styleMirror),u=o.id,l=o.styleId;return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,replace:a}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:he(((t,e,s)=>{var a=s[0],o=we(e,i,n.styleMirror),u=o.id,l=o.styleId;return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,replaceSync:a}),t.apply(e,s)}))}));var h={};Se("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(Se("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),Se("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),Se("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((t=>{var e=t[0],s=t[1];d[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[e].insertRule,{apply:he(((t,e,s)=>{var a=s[0],o=s[1],u=we(e.parentStyleSheet,i,n.styleMirror),l=u.id,h=u.styleId;return(l&&-1!==l||h&&-1!==h)&&r({id:l,styleId:h,adds:[{rule:a,index:[...ye(e),o||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:he(((t,e,s)=>{var a=s[0],o=we(e.parentStyleSheet,i,n.styleMirror),u=o.id,l=o.styleId;return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,removes:[{index:[...ye(e),a]}]}),t.apply(e,s)}))})})),he((()=>{s.CSSStyleSheet.prototype.insertRule=a,s.CSSStyleSheet.prototype.deleteRule=l,o&&(s.CSSStyleSheet.prototype.replace=o),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(h).forEach((t=>{var e=t[0],r=t[1];r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:s}),T=be(t,t.doc),A=function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:he(((t,e,a)=>{var u,l=a[0],h=a[1],d=a[2];if(n.has(l))return o.apply(e,[l,h,d]);var c=we(null==(u=e.parentRule)?void 0:u.parentStyleSheet,i,s.styleMirror),v=c.id,f=c.styleId;return(v&&-1!==v||f&&-1!==f)&&r({id:v,styleId:f,set:{property:l,value:h,priority:d},index:ye(e.parentRule)}),t.apply(e,a)}))});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:he(((t,e,a)=>{var o,l=a[0];if(n.has(l))return u.apply(e,[l]);var h=we(null==(o=e.parentRule)?void 0:o.parentStyleSheet,i,s.styleMirror),d=h.id,c=h.styleId;return(d&&-1!==d||c&&-1!==c)&&r({id:d,styleId:c,remove:{property:l},index:ye(e.parentRule)}),t.apply(e,a)}))}),he((()=>{a.CSSStyleDeclaration.prototype.setProperty=o,a.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:s}),t.collectFonts&&(O=function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,a=i.FontFace;i.FontFace=function(t,e,r){var i=new a(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var o=I(r.fonts,"add",(function(t){return function(r){return setTimeout(he((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=a})),n.push(o),he((()=>{n.forEach((t=>t()))}))}(t)));var E=function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,s=t.selectionCb,a=!0,o=he((()=>{var t=e.getSelection();if(!(!t||a&&(null==t?void 0:t.isCollapsed))){a=t.isCollapsed||!1;for(var o=[],u=t.rangeCount||0,l=0;u>l;l++){var h=t.getRangeAt(l),d=h.startContainer,c=h.startOffset,v=h.endContainer,f=h.endOffset;Ht(d,i,n,!0)||Ht(v,i,n,!0)||o.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:o})}}));return o(),Ft("selectionchange",o)}(t),F=function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?I(r.customElements,"define",(function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}})):()=>{}}(t),N=[];for(var L of t.plugins)N.push(L.observer(L.callback,s,L.options));return he((()=>{if(n){n.destroy(),n.reset();var e=de.indexOf(n);-1!==e&&de.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),b(),k(),_(),S(),C(),R(),x(),T(),A(),O(),E(),F(),N.forEach((t=>t()))}))}function _e(t){return void 0!==window[t]}function Se(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Ie{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),s=i||this.getRemoteIdToIdMap(t),a=n.get(e);return a||(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}getIds(t,e){var r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:i.get(e)||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||this.iframeIdToRemoteIdMap.set(t,e=new Map),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||this.iframeRemoteIdToIdMap.set(t,e=new Map),e}}class Me{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new Ie(ct)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"pageHideListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),a(this,"messageHandler"),a(this,"nestedIframeListeners",new Map),a(this,"attachedWindows",new WeakMap),a(this,"attachedDocuments",new WeakMap),a(this,"attachedIframes",new Map),a(this,"loadListenerDisposers",new WeakMap),a(this,"iframeElementsById",new Map),a(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ie(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null==(i=this.attachedIframes.get(t))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>Lt(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{Nt(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var a=this.handleMessage.bind(this);Lt((()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}Lt((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),null==(r=this.loadListener)||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case o.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:o.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case o.Meta:case o.Load:case o.DomContentLoaded:return!1;case o.Plugin:return e;case o.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case o.IncrementalSnapshot:switch(e.data.source){case u.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.Drag:case u.TouchMove:case u.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(e.data,t,["id"]),e;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case u.Font:return e;case u.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case u.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===v.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(Nt(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(Nt(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var s=this.attachedDocuments.get(r);s&&(s.forEach((t=>{Lt((()=>this.mirror.removeNodeFromMap(t)))})),Lt((()=>pe(r,s))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&Nt(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{Nt(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class Ce{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var i,n;if(U(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(i=null==(n=M.host(t))?void 0:n.ownerDocument)&&void 0!==i?i:e,a=ve(r({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),o=a.observer,u=a.buffer;this.restoreHandlers.push({doc:s,handler(){o.disconnect(),u.destroy(),u.releaseCanvasManager();var t=de.indexOf(u);-1!==t&&de.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:fe(r({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(M.host(t))),this.restoreHandlers.push({doc:s,handler:be({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push({doc:e,handler:I(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=M.shadowRoot(this);return s&&te(this)&&r.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}}var Re="skip-frame";function xe(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ae="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Oe=0;64>Oe;Oe++)Ae[Te.charCodeAt(Oe)]=Oe;var Ee=new Map,Fe=(t,e,r)=>{if(t&&(De(t,e)||"object"==typeof t)){var i=function(t,e){var r=Ee.get(t);return r||Ee.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function Ne(t,e,r,i){if(t instanceof Array)return t.map((t=>Ne(t,e,r,i)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer){var n=t.constructor.name,s=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=Te[r[e]>>2],n+=Te[(3&r[e])<<4|r[e+1]>>4],n+=Te[(15&r[e+1])<<2|r[e+2]>>6],n+=Te[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[Ne(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Ne(t.data,e,r,i),t.width,t.height]}:De(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Fe(t,e,r)}:t}var Le=(t,e,r,i)=>t.map((t=>Ne(t,e,r,i))),De=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))},Pe=["webgl","webgl2"];function $e(t){return"nodeType"in t}function Be(t,e,i,n){var s=[];try{if(n){var a=function(t,e,i){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return I(n.prototype,"configure",(function(n){return function(s){var a=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!a||$e(a)&&Ht(a,e,i,!0))return n.call(this,s);$e(a)&&!("__context"in a)&&(a.__context="webgpu");var o=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==o&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|o:o}):s)}}))}(t,e,i);a&&s.push(a)}var o=I(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(r){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(r),a=arguments.length,o=new Array(a>1?a-1:0),u=1;a>u;u++)o[u-1]=arguments[u];if(!Ht(this,e,i,!0)&&("__context"in this||(this.__context=s),n&&Pe.includes(s)))if(o[0]&&"object"==typeof o[0]){var l=o[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...o])}}));s.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((t=>t()))}}function We(t,e,r,i,n,s,a){var o=[],u=Object.getOwnPropertyNames(t),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof t[u])return 0;var l=I(t,u,(function(t){return function(){for(var o=arguments.length,l=new Array(o),h=0;o>h;h++)l[h]=arguments[h];var d=t.apply(this,l);if(Fe(d,s,this),"tagName"in this.canvas&&!Ht(this.canvas,i,n,!0)){var c=Le(l,s,this,a);r(this.canvas,{type:e,property:u,args:c})}return d}}));o.push(l)}catch(i){var h=Bt(t,u,{set(t){r(this.canvas,{type:e,property:u,args:[t],setter:!0})}});o.push(h)}};for(var h of u)l(h);return o}var ze,Ue,je,qe='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n',He="undefined"!=typeof self&&self.Blob&&new Blob([qe],{type:"text/javascript;charset=utf-8"});function Ge(t){var e;try{if(!(e=He&&(self.URL||self.webkitURL).createObjectURL(He)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(qe),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Ve{constructor(t){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"rafIdTimestamp",null),a(this,"rafIdFlush",null),a(this,"refCount",0),a(this,"torndown",!1),a(this,"resetFrameDedup",null),a(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,s=t.blockSelector,o=t.recordCanvas,u=t.dataURLOptions,l=t.resolutionScale,h=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===r&&this.initCanvasMutationObserver(i,n,s,u),o&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:u,resolutionScale:l,canvasMasking:h})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,i,n,s){var a=this;if("OffscreenCanvas"in r){var o,u="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,l=Be(r,i,n,!0),h=new Map;try{o=new Ge}catch(t){return}var c=!1;o.onerror=()=>{var t;c=!0,cancelAnimationFrame(v),null==(t=o.terminate)||t.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:d["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var v,f=1e3/t,p=0,m=t=>{var l,d;c||(p&&f>t-p||(p=t,(l=[],d=t=>{try{t.querySelectorAll("canvas").forEach((t=>{Ht(t,i,n,!0)||l.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&d(t.shadowRoot)}))}catch(t){}},d(r.document),l).forEach(function(){var t=e((function*(t){var e,r,i=a.mirror.getId(t);if(!h.get(i)&&0!==t.width&&0!==t.height){h.set(i,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n=t.getContext(t.__context);if(null==(e=null==n?void 0:n.isContextLost)?void 0:e.call(n))return void h.set(i,!1);!1===(null==(r=null==n?void 0:n.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var l=t.clientWidth||t.width,d=t.clientHeight||t.height,c=Math.max(1,Math.round(l*u)),v=Math.max(1,Math.round(d*u)),f=function(t,e,r,i,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return Re}if(void 0!==a){if(!Array.isArray(a)||!a.every(xe))return Re;var o=r/n,u=i/s;return a.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*o),r=Math.floor(t.y*u);return{x:e,y:r,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*u)-r}}))}}}(s.canvasMasking,t,c,v,l,d);if(f===Re)return void h.set(i,!1);var p=yield createImageBitmap(t,1>u?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});o.postMessage({id:i,bitmap:p,width:c,height:v,displayWidth:l,displayHeight:d,dataURLOptions:s.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(i,!1)}}}));return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(m))};v=requestAnimationFrame(m),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(v),null==(t=o.terminate)||t.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Be(t,e,r,!1),s=function(t,e,r,i,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var o=I(e.CanvasRenderingContext2D.prototype,a,(function(s){return function(){for(var o=arguments.length,u=new Array(o),l=0;o>l;l++)u[l]=arguments[l];return Ht(this.canvas,r,i,!0)||setTimeout((()=>{var r=Le(u,e,this,n);t(this.canvas,{type:d["2D"],property:a,args:r})}),0),s.apply(this,u)}}));s.push(o)}catch(r){var u=Bt(e.CanvasRenderingContext2D.prototype,a,{set(e){t(this.canvas,{type:d["2D"],property:a,args:[e],setter:!0})}});s.push(u)}};for(var u of a)o(u);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),a=function(t,e,r,i,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...We(e.WebGLRenderingContext.prototype,d.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...We(e.WebGL2RenderingContext.prototype,d.WebGL2,t,r,i,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),s(),a()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var i=r.map((t=>function(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}(t,n)));this.mutationCb({id:e,type:r[0].type,commands:i}),this.pendingCanvasMutations.delete(t)}}}}class Ze{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Xt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}inlineDeferredLinkElement(t,e){if(-1!==e&&t.isConnected){var r=null;try{var i=t.sheet;i&&(r=q(i))}catch(t){}r&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:r}}]})}}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:H(e,t.href),index:r})))})),i.styleIds.push(e)};for(var a of t)s(a);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,It.forEach((t=>t.abort())),It.clear()}trackStylesheetInLinkElement(t){}}class Je{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Qe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Ke=document.createElement("iframe");document.body.appendChild(Ke),Array.from=(null==(i=Ke.contentWindow)?void 0:i.Array.from)||Array.from,document.body.removeChild(Ke)}}catch(t){console.debug("Unable to override Array.from",t)}var Xe=new G,Ye=new Set([u.Mutation,u.MediaInteraction,u.StyleSheetRule,u.CanvasMutation,u.Font,u.Log,u.StyleDeclaration,u.AdoptedStyleSheet]);function tr(t){var e=window;if("function"==typeof e.requestIdleCallback){var r=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null==(t=e.cancelIdleCallback)?void 0:t.call(e,r)}}}var i=setTimeout(t,250);return{cancel:()=>clearTimeout(i)}}function er(t){var e;void 0===t&&(t={});var i=t,n=i.emit,s=i.checkoutEveryNms,a=i.checkoutEveryNth,l=i.blockClass,h=void 0===l?"rr-block":l,d=i.blockSelector,c=void 0===d?null:d,v=i.ignoreClass,f=void 0===v?"rr-ignore":v,p=i.ignoreSelector,m=void 0===p?null:p,g=i.maskTextClass,y=void 0===g?"rr-mask":g,w=i.maskTextSelector,b=void 0===w?null:w,k=i.inlineStylesheet,_=void 0===k||k,S=i.inlineStylesheetBudgetRules,I=void 0===S?1e4:S,N=i.maskAllInputs,D=i.maskInputOptions,P=i.slimDOMOptions,B=i.maskInputFn,W=i.maskTextFn,z=i.hooks,U=i.packFn,j=i.sampling,q=void 0===j?{}:j,H=i.dataURLOptions,V=void 0===H?{}:H,Z=i.canvasResolutionScale,J=i.canvasMasking,Q=i.mousemoveWait,K=i.recordDOM,X=void 0===K||K,Y=i.recordCanvas,tt=void 0!==Y&&Y,et=i.recordCrossOriginIframes,rt=void 0!==et&&et,it=i.recordAfter,nt=void 0===it?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":it,st=i.userTriggeredOnInput,at=void 0!==st&&st,ot=i.collectFonts,ut=void 0!==ot&&ot,lt=i.inlineImages,ht=void 0!==lt&<,dt=i.plugins,ct=i.keepIframeSrcFn,vt=void 0===ct?()=>!1:ct,ft=i.ignoreCSSAttributes,pt=void 0===ft?new Set([]):ft,mt=i.attributeFilter;ie=i.errorHandler;var gt=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},V),yt=!rt||window.parent===window,wt=!1;if(!yt)try{window.parent.document&&(wt=!1)}catch(t){wt=!0}if(yt&&!n)throw new Error("emit function is required");if(!yt&&!wt)return()=>{};void 0!==Q&&void 0===q.mousemove&&(q.mousemove=Q),Xe.reset();var bt,kt=!0===N?{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!==D?D:{password:!0},_t=Ot(void 0!==P&&P);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var St,It,Mt=0,Ct=new Map,Rt=t=>{for(var e of dt||[])e.eventProcessor&&(t=e.eventProcessor(t));return U&&!wt&&(t=U(t)),t};ze=(t,e)=>{var r,i=t;if(i.timestamp=Wt(),!(null==(r=de[0])?void 0:r.isFrozen())||i.type===o.FullSnapshot||i.type===o.IncrementalSnapshot&&Ye.has(i.data.source)||de.forEach((t=>t.unfreeze())),yt)null==n||n(Rt(i),e);else if(wt){var l={type:"rrweb",event:Rt(i),origin:window.location.origin,isCheckout:e};window.parent.postMessage(l,"*")}if(i.type===o.FullSnapshot)bt=i,Mt=0;else if(i.type===o.IncrementalSnapshot){if(i.data.source===u.Mutation&&i.data.isAttachIframe)return;Mt++,(a&&Mt>=a||s&&i.timestamp-bt.timestamp>s)&&Ue(!0)}};var xt=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var n of t.adds){var s=Xe.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}t.removes.forEach((t=>{var r=t.id;if(!e||!e.has(r)){var n=Dt.getIframeElementById(r);n&&i.has(n)?Dt.forgetIframeId(r):(null==St||St(r),Dt.removeIframeById(r))}})),null==It||It(),Dt.cleanupDetachedIframes()}ze({type:o.IncrementalSnapshot,data:r({source:u.Mutation},t)})},Tt=t=>ze({type:o.IncrementalSnapshot,data:r({source:u.Scroll},t)}),Et=t=>ze({type:o.IncrementalSnapshot,data:r({source:u.CanvasMutation},t)}),Nt=new Ze({mutationCb:xt,adoptedStyleSheetCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},t)})}),Dt=new Me({mirror:Xe,mutationCb:xt,stylesheetManager:Nt,recordCrossOriginIframes:rt,wrappedEmit:ze});for(var Pt of dt||[])Pt.getMirror&&Pt.getMirror({nodeMirror:Xe,crossOriginIframeMirror:Dt.crossOriginIframeMirror,crossOriginIframeStyleMirror:Dt.crossOriginIframeStyleMirror});var $t=new Je,Bt=null==J?void 0:J.configured;je=new Ve({recordCanvas:tt,mutationCb:Et,win:window,blockClass:h,blockSelector:c,mirror:Xe,sampling:q.canvas,dataURLOptions:gt,resolutionScale:Z,canvasMasking:J});var qt=new Ce({mutationCb:xt,scrollCb:Tt,bypassOptions:{blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:b,inlineStylesheet:_,maskInputOptions:kt,dataURLOptions:gt,maskTextFn:W,maskInputFn:B,recordCanvas:tt,canvasMaskingConfigured:Bt,inlineImages:ht,sampling:q,slimDOMOptions:_t,iframeManager:Dt,stylesheetManager:Nt,canvasManager:je,keepIframeSrcFn:vt,processedNodeManager:$t,attributeFilter:mt},mirror:Xe});Ue=function(t){if(void 0===t&&(t=!1),X){ze({type:o.Meta,data:{href:window.location.href,width:jt(),height:Ut()}},t),null==e||e(),e=void 0,Nt.reset(),qt.init(),de.forEach((t=>t.lock()));var r,i,n=null;try{n=function(t,e){var r,i=e||{},n=i.mirror,s=void 0===n?new G:n,a=i.blockClass,o=void 0===a?"rr-block":a,u=i.blockSelector,l=void 0===u?null:u,h=i.maskTextClass,d=void 0===h?"rr-mask":h,c=i.maskTextSelector,v=void 0===c?null:c,f=i.inlineStylesheet,p=void 0===f||f,m=i.inlineImages,g=void 0!==m&&m,y=i.recordCanvas,w=void 0!==y&&y,b=i.canvasMaskingConfigured,k=i.maskAllInputs,_=void 0!==k&&k,S=i.maskTextFn,I=i.maskInputFn,M=i.slimDOM,N=i.dataURLOptions,D=i.preserveWhiteSpace,P=i.onSerialize,B=i.onIframeLoad,W=i.iframeLoadTimeout,z=i.onIframeListenerRegistered,U=i.onStylesheetLoad,j=i.stylesheetLoadTimeout,q=i.keepIframeSrcFn,H=void 0===q?()=>!1:q,V=i.maxDepth,Z=i.inlineStylesheetBudgetRules,J=!0===_?{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===_?{password:!0}:_,Q=Ot(void 0!==M&&M);r=Z,(x+=1)>1||(A=C(),F=[],E=L(r),T=R());try{return At(t,{doc:t,mirror:s,blockClass:o,blockSelector:l,maskTextClass:d,maskTextSelector:v,skipChild:!1,inlineStylesheet:p,maskInputOptions:J,maskTextFn:S,maskInputFn:I,slimDOMOptions:Q,dataURLOptions:N,inlineImages:g,recordCanvas:w,canvasMaskingConfigured:b,preserveWhiteSpace:D,onSerialize:P,onIframeLoad:B,iframeLoadTimeout:W,onIframeListenerRegistered:z,onStylesheetLoad:U,stylesheetLoadTimeout:j,keepIframeSrcFn:H,newlyAddedElement:!1,maxDepth:V})}finally{0===x?O||C():(x-=1)>0||(A.durationMs=R()-T,A.deferredStylesheetCount=F.length,E=null,O=A)}}(document,{mirror:Xe,blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:b,inlineStylesheet:_,maskAllInputs:kt,inlineStylesheetBudgetRules:I,maskTextFn:W,maskInputFn:B,slimDOM:_t,dataURLOptions:gt,recordCanvas:tt,canvasMaskingConfigured:Bt,inlineImages:ht,onSerialize(t){Jt(t,Xe)&&Dt.addIframe(t),Qt(t,Xe)&&Nt.trackLinkElement(t),Kt(t)&&qt.addShadowRoot(M.shadowRoot(t),document)},onIframeLoad(t,e){Dt.attachIframe(t,e),qt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){Dt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){Nt.attachLinkElement(t,e)},keepIframeSrcFn:vt})}finally{r=F,F=[],i=r}if(!n)return console.warn("Failed to snapshot the document");ze({type:o.FullSnapshot,data:{node:n,initialOffset:zt(window)}},t),de.forEach((t=>t.unlock())),je.onFullSnapshot(),i.length&&(e=function(t,r,i){var n=!1,s=null,a=0,o=i=>{if(s=null,!n){var u=function(){var e=t[a];t[a]=null,a+=1,e&&Lt((()=>r.inlineDeferredLinkElement(e,Xe.getId(e))))};do{u()}while(t.length>a&&i&&!i.didTimeout&&i.timeRemaining()>5);t.length>a?s=tr(o):e=void 0}};return s=tr(o),()=>{n=!0,null==s||s.cancel(),s=null}}(i,Nt)),rt&&Dt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Nt.adoptStyleSheets(document.adoptedStyleSheets,Xe.getId(document))}};try{var Ht=[];St=t=>{var e=Ct.get(t);e&&(e.forEach((t=>{Lt(t);var e=Ht.indexOf(t);-1!==e&&Ht.splice(e,1)})),Ct.delete(t))},It=()=>{for(var t of Ct){var e=t[0],r=Xe.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==St||St(e)}catch(t){null==St||St(e)}else null==St||St(e)}};var Gt=t=>{var e;return he(ke)({mutationCb:xt,mousemoveCb:(t,e)=>ze({type:o.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.MouseInteraction},t)}),scrollCb:Tt,viewportResizeCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.ViewportResize},t)}),inputCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.Input},t)}),mediaInteractionCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.MediaInteraction},t)}),styleSheetRuleCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.StyleSheetRule},t)}),styleDeclarationCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.StyleDeclaration},t)}),canvasMutationCb:Et,fontCb:t=>ze({type:o.IncrementalSnapshot,data:r({source:u.Font},t)}),selectionCb(t){ze({type:o.IncrementalSnapshot,data:r({source:u.Selection},t)})},customElementCb(t){ze({type:o.IncrementalSnapshot,data:r({source:u.CustomElement},t)})},blockClass:h,ignoreClass:f,ignoreSelector:m,maskTextClass:y,maskTextSelector:b,maskInputOptions:kt,inlineStylesheet:_,sampling:q,recordDOM:X,recordCanvas:tt,canvasMaskingConfigured:Bt,inlineImages:ht,userTriggeredOnInput:at,collectFonts:ut,doc:t,maskInputFn:B,maskTextFn:W,keepIframeSrcFn:vt,blockSelector:c,slimDOMOptions:_t,dataURLOptions:gt,mirror:Xe,iframeManager:Dt,stylesheetManager:Nt,shadowDomManager:qt,processedNodeManager:$t,canvasManager:je,ignoreCSSAttributes:pt,attributeFilter:mt,plugins:(null==(e=null==dt?void 0:dt.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ze({type:o.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},z)};Dt.addLoadListener((t=>{try{var e=Xe.getId(t),r=Gt(t.contentDocument);if(Ht.push(r),-1!==e){var i=Ct.get(e);i||Ct.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),Dt.addPageHideListener((t=>{var e=Xe.getId(t);null==St||St(e),pe(t)}));var Vt=-1,Zt=t=>ze({type:o.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Xt=()=>{var t,e,r,i,n=document,s=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,a=s?Xe.getId(s):-1;a!==Vt&&(-1!==Vt&&Zt({id:Vt,enter:!1}),Vt=a,-1!==a&&Zt({id:a,enter:!0}))},Yt=()=>{Ue(),Ht.push(Gt(document)),Ht.push(Ft("fullscreenchange",Xt)),Ht.push(Ft("webkitfullscreenchange",Xt)),Ht.push(Ft("mozfullscreenchange",Xt)),Ht.push(Ft("MSFullscreenChange",Xt)),Qe=!0};return["interactive","complete"].includes(document.readyState)?Yt():(Ht.push(Ft("DOMContentLoaded",(()=>{ze({type:o.DomContentLoaded,data:{}}),"DOMContentLoaded"===nt&&Yt()}))),Ht.push(Ft("load",(()=>{ze({type:o.Load,data:{}}),"load"===nt&&Yt()}),window))),()=>{null==e||e(),e=void 0,Ht.forEach((t=>Lt(t))),$t.destroy(),Dt.removeLoadListener(),Dt.destroy(),Ct.clear(),qt.reset(),Xe.reset(),Qe=!1,ie=void 0}}catch(t){console.warn(t)}}er.addCustomEvent=(t,e)=>{if(!Qe)throw new Error("please add custom event after start recording");ze({type:o.Custom,data:{tag:t,payload:e}})},er.freezePage=()=>{de.forEach((t=>t.freeze()))},er.takeFullSnapshot=t=>{if(!Qe)throw new Error("please take full snapshot after start recording");Ue(t)},er.mirror=Xe;var rr=Object.defineProperty,ir=(t,e,r)=>((t,e,r)=>e in t?rr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class nr{constructor(t){ir(this,"fileName"),ir(this,"functionName"),ir(this,"lineNumber"),ir(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var sr=/(^|@)\S+:\d+/,ar=/^\s*at .*(\S+:\d+|\(native\))/m,or=/^(eval@)?(\[native code])?$/,ur={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(ar)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter((function(t){return!!t.match(ar)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new nr({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(or)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new nr({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new nr({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var a=e.exec(r[n]);a&&i.push(new nr({fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var a=e.exec(r[n]);a&&i.push(new nr({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(sr)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new nr({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function lr(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var a=i.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===r&&n.push(a)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function hr(t){return Array.isArray(t)}function dr(t){return"object"==typeof t&&null!==t&&!hr(t)}function cr(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(dr(t[i])&&cr(t[i],e-1))return!0;return!1}function vr(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(dr(a=e)&&Object.keys(a).length>r.numOfKeysLimit||"function"==typeof a||dr(a)&&cr(a,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var u in e){var l=e[u];o[u]=hr(l)?lr(l.length?l[0]:null):l}return o}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var fr={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 pr(t,e,r){var i,n=r?Object.assign({},fr,r):fr,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var a=0,o=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message,i=ur.parse(e.error).map((t=>t.toString())),s=[vr(r,n.stringifyOptions)];t({level:"error",trace:i,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[vr("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[vr("Uncaught (in promise)",n.stringifyOptions),vr(e.reason,n.stringifyOptions)]);var s=ur.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)u.push(c(i,d));return()=>{u.forEach((t=>t()))};function c(e,r){var i=this;return e[r]?function(e,s,u){try{if(!(s in e))return()=>{};var l=e[s],h={next:l},d=(e=>function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||o)){o=!0;try{var h=ur.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?u.slice(1):u).map((t=>vr(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:r,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[vr("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{o=!1}}})((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:l},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=e[s];"function"==typeof t&&t.__rrweb_layer__;){var r=t.__rrweb_layer__;if(r.next===d)return void(r.next=h.next);t=r.next}else e[s]=h.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var mr="undefined"!=typeof window?window:void 0,gr="undefined"!=typeof globalThis?globalThis:mr,yr=null==gr?void 0:gr.document,wr=null==gr?void 0:gr.location;null!=gr&&gr.XMLHttpRequest&&new gr.XMLHttpRequest;var br="undefined"!=typeof globalThis?globalThis:mr;br&&"undefined"==typeof self&&(br.self=br),br&&"undefined"==typeof File&&(br.File=function(){});var kr,_r=null!=mr?mr:{},Sr="NativeGzipValidationError",Ir=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Sr,e},Mr=function(){var t=e((function*(t,e){18>t.size&&Ir("too-short");var r,i=new Uint8Array(yield t.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&Ir("invalid-header");var n=new DataView(yield t.slice(t.size-8).arrayBuffer());n.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(kr)return kr;kr=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;kr[t]=e>>>0}return kr})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&Ir("invalid-crc");var s=e.length>>>0;n.getUint32(4,!0)!==s&&Ir("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function Cr(){return Cr=e((function*(t,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),a=s.writable.getWriter(),o=a.write(n).then((()=>a.close())).catch(function(){var t=e((function*(t){try{yield a.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),u=new Response(s.readable).blob(),l=(yield Promise.all([u,o]))[0];return yield Mr(l,n),l}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),null}})),Cr.apply(this,arguments)}var Rr=function(t){return t.trim()},xr=Object.prototype,Tr=xr.hasOwnProperty,Ar=xr.toString,Or=Array.isArray||function(t){return"[object Array]"===Ar.call(t)},Er=t=>"function"==typeof t,Fr=t=>t===Object(t)&&!Or(t),Nr=t=>void 0===t,Lr=t=>"[object String]"==Ar.call(t),Dr=t=>null===t,Pr=t=>Nr(t)||Dr(t),$r=t=>"[object Number]"==Ar.call(t)&&t==t,Br=t=>"[object Boolean]"===Ar.call(t),Wr=t=>t instanceof FormData;function zr(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),$r(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),zr(n||r,e,r,i))}class Ur{constructor(t){this.tt={},this.et=t.et,this.it=zr(t.bucketSize,0,100,t.rt),this.nt=zr(t.refillRate,0,this.it,t.rt),this.st=zr(t.refillInterval,0,864e5,t.rt)}ot(t,e){var r=Math.floor((e-t.lastAccess)/this.st);r>0&&(t.tokens=Math.min(t.tokens+r*this.nt,this.it),t.lastAccess=t.lastAccess+r*this.st)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.tt[i];return n?this.ot(n,r):this.tt[i]=n={tokens:this.it,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.et)||e.call(this,t)),0===n.tokens)}stop(){this.tt={}}}function jr(t){return t?t.split("#")[0]:t}var qr=t=>"undefined"!=typeof Document&&t instanceof Document,Hr={DEBUG:!1,LIB_VERSION:"0.3.1",LIB_NAME:"browser-common"},Gr=function(t,e){var r=(void 0===e?{}:e).debugEnabled,i={k(e){if(mr&&(Hr.DEBUG||mr.POSTHOG_DEBUG||r)&&!Nr(mr.console)&&mr.console){for(var i=("__rrweb_original__"in mr.console[e]?mr.console[e].__rrweb_original__:mr.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),a=1;n>a;a++)s[a-1]=arguments[a];i(t,...s)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(t){i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>Gr(t+" "+e,r)};return i},Vr=Gr("[PostHog.js]"),Zr=Vr.createLogger;function Jr(t,e){if(!Pr(t))if(Or(t))t.forEach(e);else if(Wr(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)Tr.call(t,r)&&e(t[r],r)}function Qr(t,e,r,i){var n={},s=n.capture,a=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==s&&s,passive:void 0===a||a})}var Kr=["localhost","127.0.0.1"],Xr=t=>{var e=null==yr?void 0:yr.createElement("a");return Nr(e)?null:(e.href=t,e)},Yr=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return Jr(t,(function(t,e){Nr(t)||Nr(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},ti=()=>{};function ei(t,e,r){try{if(!(e in t))return ti;var i={next:t[e]},n=r((function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)}));return Er(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e];Er(r)&&r.__posthog_layer__;){var s=r.__posthog_layer__;if(s.next===n)return void(s.next=i.next);r=s.next}else t[e]=i.next}}catch(t){return ti}}function ri(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function ii(t){var e,r=null==mr||null==(e=mr.location)?void 0:e.href;return Nr(r)?void 0:function(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!Er(i))return e;try{var n=i(e);return Lr(n)&&n?n:e}catch(t){return Vr.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,r)}var ni=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),si=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,ai=[16,15,14,13],oi=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),ui=/[0-9A-Za-z_]/;function li(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}var hi="[SessionRecording]",di="redacted",ci=1e6;function vi(t){var e;return Math.min(ci,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:ci)}var fi={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:ci,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},pi=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],mi=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],gi=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],yi=t=>{Pr(t)||Jr(Object.keys(t),(e=>{(t=>{var e=t.toLowerCase();return pi.includes(e)||gi.some((t=>e.includes(t)))})(e)&&(t[e]=di)}))},wi=["/s/","/e/","/i/"];function bi(t,e,r,i){if(Pr(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Lr(n)&&(n=parseInt(n)),n>r?hi+" "+i+" body too large to record ("+n+" bytes)":t}function ki(t,e){if(Pr(t))return t;var r=t;return function(t,e){if(Pr(t))return!1;if(Lr(t)){if(function(t){var e;for(si.lastIndex=0;e=si.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var s of ai){var a=n+s;if(i.length>=a){var o=i.slice(n,a);if(ni.test(o)&&li(o))return!0}}}return!1}(t=Rr(t)))return!1;var r=function(t){var e;for(oi.lastIndex=0;e=oi.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&ui.test(r)&&ui.test(i)))return!0}return!1}(t);if(r)return!1}return!0}(r)||(r=hi+" "+e+" body "+di),Jr(mi,(t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r=hi+" "+e+" body "+di+" as might contain: "+t)})),r}var _i=Zr("[Recorder]"),Si=t=>"navigation"===t.entryType,Ii=t=>"resource"===t.entryType;function Mi(t,e){return!!e&&(Br(e)||e[t])}function Ci(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var Ri=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function xi(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.toLowerCase().includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Ci(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(Ri))return!1;if(Br(r))return!0;if(Or(r))return n(r);var s=r[e];return Br(s)?s:n(s)}function Ti(t,e,r,i,n,s){return Ai.apply(this,arguments)}function Ai(){return Ai=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return _i.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var a=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(Ii(a=t[s])&&a.initiatorType===e&&(Nr(i)||a.startTime>=i)&&(Nr(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(r));return a||(yield new Promise((t=>setTimeout(t,50*s))),Ti(t,e,r,i,n,s+1))})),Ai.apply(this,arguments)}function Oi(t){var e=t.body,r=t.options,i=t.url;if(Pr(e))return null;var n=ri(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(Lr(e))return e;if(qr(e))return e.textContent;if(Wr(e))return Yr(e);if(Fr(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var Ei=t=>!Dr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Fi(t){var e=t.entry,i=t.method,n=t.status,s=t.networkRequest,a=t.isInitial,o=t.start,u=t.end,l=t.url,h=t.initiatorType;o=e?e.startTime:o,u=e?e.responseEnd:u;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(o||0)),v=[r({},e?e.toJSON():{name:l},{startTime:Nr(o)?void 0:Math.round(o),endTime:Nr(u)?void 0:Math.round(u),timeOrigin:d,timestamp:c,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:a})];if(Ei(e))for(var f of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Ni=["video/","audio/"];function Li(t){return Fr(t)&&Er(t.getReader)&&Er(t.tee)}var Di=500,Pi="[SessionReplay] Timeout while trying to read body",$i="[SessionReplay] Failed to read body";function Bi(t){return $i+": "+t}function Wi(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function zi(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var r=setTimeout((()=>e(Pi)),Di);try{t.clone().text().then((t=>e(t)),(t=>e(Bi(t)))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e($i)}}))}(t);var r=vi(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(Wi(r)):function(t,e){return new Promise((r=>{var i,n=!1;function s(){try{var t;null==(t=i)||t.cancel()}catch(t){}}function a(t){n||(n=!0,clearTimeout(u),s(),r(t))}var o,u=setTimeout((()=>a(Pi)),Di);try{o=t.clone()}catch(t){return void a($i)}var l=o.body;if(Li(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(t){return void a($i)}var h=[],d=0;!function t(){i.read().then((r=>{var i=r.done,o=r.value;if(n)s();else if(i)a((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(o){if(d+o.byteLength>e)return void a(Wi(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(Bi(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(Bi(t))))}catch(t){a($i)}}))}(t,r)}function Ui(){return(Ui=e((function*(t){var e=t.r,r=t.options,i=ri(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):zi(e,r)}))).apply(this,arguments)}function ji(){return(ji=e((function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),a=Ni.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=ri(n,i);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return Dr(i)?zi(e,r):Promise.resolve(i)}))).apply(this,arguments)}var qi=null;function Hi(t,i,n){if(!("performance"in i))return()=>{};if(qi)return _i.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},fi,n):fi,a=e=>{var i=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var r=s.maskRequestFn(t);e||(n=!r),r&&i.push(r)}})),i.length>0&&t(r({},e,{requests:i}))},o=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Si(t)||Ii(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>Fi({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>Si(t)||Ii(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>Fi({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(a,i,s),u=()=>{},l=()=>{};return(s.recordHeaders||s.recordBody)&&(u=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Mi("request",r.recordHeaders),n=Mi("response",r.recordHeaders),s=ei(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,u,l,h){void 0===u&&(u=!0);var d=this;try{var c,v,f=new Request(o),p={},m={},g=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(m[t]=e,g(t,e)),i&&(p.requestHeaders=m);var y=d.send.bind(d);d.send=t=>(xi({type:"request",headers:m,url:o,recordBody:r.recordBody})&&(p.requestBody=Oi({body:t,options:r,url:o})),c=e.performance.now(),y(t));var w=()=>{d.removeEventListener("readystatechange",b),d.removeEventListener("error",w),d.removeEventListener("abort",w),d.removeEventListener("timeout",w)},b=()=>{if(d.readyState===d.DONE){w(),v=e.performance.now();var i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),xi({type:"response",headers:i,url:o,recordBody:r.recordBody})&&(p.responseBody=Oi({body:d.response,options:r,url:o})),Ti(e,"xmlhttprequest",f.url,c,v).then((e=>{var r=Fi({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};d.addEventListener("readystatechange",b),d.addEventListener("error",w),d.addEventListener("abort",w),d.addEventListener("timeout",w)}catch(t){_i.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),u,l,h)}));return()=>{s()}}(a,i,s),l=function(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Mi("request",i.recordHeaders),s=Mi("response",i.recordHeaders),a=ei(r,"fetch",(a=>function(){var o=e((function*(e,o){var u,l;try{u=new Request(e,o)}catch(t){return _i.error("Failed to instrument fetch for network capture",t),a(e,o)}var h,d,c={};try{try{var v={};u.headers.forEach(((t,e)=>{v[e]=t})),n&&(c.requestHeaders=v),!Li(null==o?void 0:o.body)&&xi({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(c.requestBody=yield function(t){return Ui.apply(this,arguments)}({r:u,options:i,url:e}))}catch(t){_i.error("Failed to record fetch request for network capture",t)}h=r.performance.now(),l=Ci(e)?yield a(u):yield a(e,o),d=r.performance.now();var f={};return l.headers.forEach(((t,e)=>{f[e]=t})),s&&(c.responseHeaders=f),xi({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(c.responseBody=yield function(t){return ji.apply(this,arguments)}({r:l,options:i,url:e})),l}finally{Ti(r,"fetch",u.url,h,d).then((e=>{var r,i=Fi({entry:e,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:c,start:h,end:d,url:u.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return o.apply(this,arguments)}}()));return()=>{a()}}(a,i,s)),qi=()=>{o(),u(),l(),qi=null}}var Gi={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},Vi={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9,Font:10,Log:11,Drag:12,StyleDeclaration:13,Selection:14,AdoptedStyleSheet:15,CustomElement:16},Zi="$session_recording_remote_config",Ji="$replay_sample_rate",Qi="$replay_override_sampling",Ki="$replay_override_linked_flag",Xi="$replay_override_url_trigger",Yi="$replay_override_event_trigger",tn="$session_is_sampled",en="$session_past_minimum_duration",rn="$session_recording_url_trigger_activated_session",nn="$session_recording_event_trigger_activated_session",sn="$posthog_sr_group_event_trigger_",an="$posthog_sr_group_url_trigger_",on="$posthog_sr_group_sampling_",un="$debug_first_full_snapshot_timestamp",ln="$sess_rec_flush_size",hn="$stored_person_properties",dn="$sdk_debug_replay_remote_trigger_matching_config",cn="disabled",vn="sampled",fn="active",pn="buffering",mn="paused",gn="rrweb_error",yn="trigger",wn=yn+"_activated",bn=yn+"_pending",kn=yn+"_"+cn;function _n(t,e,r,i,n,s){return 0===e?kn:(null==t?void 0:t.get_property(r?i+r:n))===s?wn:bn}function Sn(t,e,r){return e.some((e=>{var i;return"regex"===e.matching&&(null!==(i=null==r?void 0:r.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)}))}class In{constructor(t){this.u=t}triggerStatus(t){var e=this.u.map((e=>e.triggerStatus(t)));return e.includes(wn)?wn:e.includes(bn)?bn:kn}stop(){this.u.forEach((t=>t.stop()))}}class Mn{constructor(t){this.u=t}triggerStatus(t){var e=new Set;for(var r of this.u)e.add(r.triggerStatus(t));switch(e.delete(kn),e.size){case 0:return kn;case 1:return Array.from(e)[0];default:return bn}}stop(){this.u.forEach((t=>t.stop()))}}class Cn{triggerStatus(){return wn}stop(){}}var Rn=t=>"sessionRecording"in t;class xn{constructor(t,e){this.th=[],this.eh=[],this.rh=new Map,this.ih=new Map,this.nh="",this.urlBlocked=!1,this._instance=t,this.sh=e}onConfig(t){var e,r;this.th=(Rn(t)?Fr(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.eh=(Rn(t)?Fr(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.ah()}ah(){for(var t of(this.rh.clear(),this.ih.clear(),this.th))if("regex"===t.matching&&!this.rh.has(t.url))try{this.rh.set(t.url,new RegExp(t.url))}catch(e){Vr.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.eh)if("regex"===e.matching&&!this.ih.has(e.url))try{this.ih.set(e.url,new RegExp(e.url))}catch(t){Vr.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}oh(t){return _n(this._instance,this.th.length,this.sh,an,rn,t)}triggerStatus(t){var e=this.oh(t),r=e===wn?wn:e===bn?bn:kn;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:r}),r}checkUrlBlocklist(t,e){var r=ii(this._instance);if(r&&r!==this.nh){this.nh=r;var i=this.urlBlocked,n=Sn(r,this.eh,this.ih);i&&n||(n&&!i?t():!n&&i&&e())}}checkUrlTriggerConditions(t,e,r,i){var n=ii(this._instance);if(n&&n!==this.nh){this.nh=n;var s=this.urlBlocked,a=Sn(n,this.eh,this.ih);a&&!s?t():!a&&s&&e();var o=this.oh(i)===wn,u=Sn(n,this.th,this.rh);!o&&u&&r("url",n)}}stop(){this.nh=""}}class Tn{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.uh=()=>{},this._instance=t}triggerStatus(){var t=bn;return Pr(this.linkedFlag)&&(t=kn),this.linkedFlagSeen&&(t=wn),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}onConfig(t,e){var r;if(this.linkedFlag=(Rn(t)?Fr(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Pr(this.linkedFlag)&&!this.linkedFlagSeen){var i=Lr(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Lr(this.linkedFlag)?null:this.linkedFlag.variant;this.uh=this._instance.onFeatureFlags(((t,r)=>{var s=!1;if(Fr(r)&&i in r){var a=r[i];s=Br(a)?!0===a:n?a===n:!!a}var o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(i,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.uh()}}class An{constructor(t,e){this.lh=[],this._instance=t,this.sh=e}onConfig(t){var e;this.lh=(Rn(t)?Fr(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}hh(t){return _n(this._instance,this.lh.length,this.sh,sn,nn,t)}triggerStatus(t){var e=this.hh(t),r=e===wn?wn:e===bn?bn:kn;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:r}),r}checkEventTriggerConditions(t,e,r){if(0!==this.lh.length){var i=this.hh(r)===wn,n=this.lh.includes(t);!i&&n&&e("event",t)}}stop(){}}class On{constructor(t,e,r){if(this._instance=t,this.group=e,this.dh=new xn(t,e.id),this.fh=new An(t,e.id),this.ph=new Tn(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var i=(e.conditions.events||[]).map((t=>t.name)),n={urlTriggers:e.conditions.urls||[],eventTriggers:i,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.dh.onConfig(n),this.fh.onConfig(n),this.ph.onConfig(n,r);var s=[this.fh,this.dh,this.ph];this.mh="any"===e.conditions.matchType?new In(s):new Mn(s)}else this.mh=new Cn}triggerStatus(t){return this.mh.triggerStatus(t)}checkEventTriggerConditions(t,e,r){this.fh.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.dh.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r;null==(r=this._instance.persistence)||r.register({["url"===t?an+this.group.id:sn+this.group.id]:e})}stop(){this.dh.stop(),this.fh.stop(),this.ph.stop()}}function En(t){if(t.rrwebError)return gn;if(!t.receivedFlags)return pn;if(!t.isRecordingEnabled)return cn;if(t.urlTriggerMatching.urlBlocked)return mn;var e=!0===t.isSampled,r=new In([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?vn:r===wn?fn:r===bn?pn:!1===t.isSampled?cn:fn}function Fn(t){if(t.rrwebError)return gn;if(!t.receivedFlags)return pn;if(!t.isRecordingEnabled)return cn;if(t.urlTriggerMatching.urlBlocked)return mn;var e=new Mn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==kn,i=Br(t.isSampled);return r&&e===bn?pn:r&&e===kn||i&&!t.isSampled?cn:!0===t.isSampled?vn:fn}function Nn(){var t=[];return function(e,r){if(Fr(r)||Or(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r}}function Ln(t){var e=JSON.stringify(t,Nn());return e?new Blob([e]).size:0}function Dn(t){if(Dr(t))return 4;if(Nr(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":if(Or(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=Nr(i)||Dr(i)?4:Dn(i)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var u=n[o];Nr(u)||(a||(s+=1),a=!1,s+=o.length+3+Dn(u))}return s;default:return 0}}function Pn(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),i=t.sizes.slice(0,r),n=t.sizes.slice(r);return[Pn({size:i.reduce(((t,e)=>t+e),0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),Pn({size:n.reduce(((t,e)=>t+e),0),data:t.data.slice(r),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap((t=>t))}return[t]}var $n=Uint8Array,Bn=Uint16Array,Wn=Uint32Array,zn=new $n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Un=new $n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),jn=new $n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qn=function(t,e){for(var r=new Bn(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new Wn(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},Hn=qn(zn,2),Gn=Hn[1];Hn[0][28]=258,Gn[258]=28;for(var Vn=qn(Un,0)[1],Zn=new Bn(32768),Jn=0;32768>Jn;++Jn){var Qn=(43690&Jn)>>>1|(21845&Jn)<<1;Zn[Jn]=((65280&(Qn=(61680&(Qn=(52428&Qn)>>>2|(13107&Qn)<<2))>>>4|(3855&Qn)<<4))>>>8|(255&Qn)<<8)>>>1}var Kn=function(t,e,r){for(var i=t.length,n=0,s=new Bn(e);i>n;++n)++s[t[n]-1];var a,o=new Bn(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(r){a=new Bn(1<<e);var u=15-e;for(n=0;i>n;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],d=o[t[n]-1]++<<h,c=d|(1<<h)-1;c>=d;++d)a[Zn[d]>>>u]=l}else for(a=new Bn(i),n=0;i>n;++n)a[n]=Zn[o[t[n]-1]++]>>>15-t[n];return a},Xn=new $n(288);for(Jn=0;144>Jn;++Jn)Xn[Jn]=8;for(Jn=144;256>Jn;++Jn)Xn[Jn]=9;for(Jn=256;280>Jn;++Jn)Xn[Jn]=7;for(Jn=280;288>Jn;++Jn)Xn[Jn]=8;var Yn=new $n(32);for(Jn=0;32>Jn;++Jn)Yn[Jn]=5;var ts=Kn(Xn,9,0),es=Kn(Yn,5,0),rs=function(t){return(t/8>>0)+(7&t&&1)},is=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof Bn?Bn:t instanceof Wn?Wn:$n)(r-e);return i.set(t.subarray(e,r)),i},ns=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},ss=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},as=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new $n(0),0];if(1==n){var a=new $n(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var o=r[0],u=r[1],l=0,h=1,d=2;for(r[0]={s:-1,f:o.f+u.f,l:o,r:u};h!=n-1;)o=r[r[d].f>r[l].f?l++:d++],u=r[l!=h&&r[d].f>r[l].f?l++:d++],r[h++]={s:-1,f:o.f+u.f,l:o,r:u};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new Bn(c+1),f=os(r[h-1],v,0);if(f>e){i=0;var p=0,m=f-e,g=1<<m;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=g-(1<<f-v[y]),v[y]=e}for(p>>>=m;p>0;){var w=s[i].s;e>v[w]?p-=1<<e-v[w]++-1:++i}for(;i>=0&&p;--i){var b=s[i].s;v[b]==e&&(--v[b],++p)}f=e}return[new $n(v),f]},os=function(t,e,r){return-1==t.s?Math.max(os(t.l,e,r+1),os(t.r,e,r+1)):e[t.s]=r},us=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Bn(++e),i=0,n=t[0],s=1,a=function(t){r[i++]=t},o=1;e>=o;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[r.subarray(0,i),e]},ls=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},hs=function(t,e,r){var i=r.length,n=rs(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},ds=function(t,e,r,i,n,s,a,o,u,l,h){ns(e,h++,r),++n[256];for(var d=as(n,15),c=d[0],v=d[1],f=as(s,15),p=f[0],m=f[1],g=us(c),y=g[0],w=g[1],b=us(p),k=b[0],_=b[1],S=new Bn(19),I=0;y.length>I;++I)S[31&y[I]]++;for(I=0;k.length>I;++I)S[31&k[I]]++;for(var M=as(S,7),C=M[0],R=M[1],x=19;x>4&&!C[jn[x-1]];--x);var T,A,O,E,F=l+5<<3,N=ls(n,Xn)+ls(s,Yn)+a,L=ls(n,c)+ls(s,p)+a+14+3*x+ls(S,C)+(2*S[16]+3*S[17]+7*S[18]);if(N>=F&&L>=F)return hs(e,h,t.subarray(u,u+l));if(ns(e,h,1+(N>L)),h+=2,N>L){T=Kn(c,v,0),A=c,O=Kn(p,m,0),E=p;var D=Kn(C,R,0);for(ns(e,h,w-257),ns(e,h+5,_-1),ns(e,h+10,x-4),h+=14,I=0;x>I;++I)ns(e,h+3*I,C[jn[I]]);h+=3*x;for(var P=[y,k],B=0;2>B;++B){var W=P[B];for(I=0;W.length>I;++I)ns(e,h,D[z=31&W[I]]),h+=C[z],z>15&&(ns(e,h,W[I]>>>5&127),h+=W[I]>>>12)}}else T=ts,A=Xn,O=es,E=Yn;for(I=0;o>I;++I)if(i[I]>255){var z;ss(e,h,T[257+(z=i[I]>>>18&31)]),h+=A[z+257],z>7&&(ns(e,h,i[I]>>>23&31),h+=zn[z]);var U=31&i[I];ss(e,h,O[U]),h+=E[U],U>3&&(ss(e,h,i[I]>>>5&8191),h+=Un[U])}else ss(e,h,T[i[I]]),h+=A[i[I]];return ss(e,h,T[256]),h+A[256]},cs=new Wn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),vs=function(){for(var t=new Wn(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),fs=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=vs[255&r^e[i]]^r>>>8;t=r},d:()=>4294967295^t}},ps=function(t,e,r,i,n){return function(t,e,r,i,n,s){var a=t.length,o=new $n(i+a+5*(1+Math.floor(a/7e3))+n),u=o.subarray(i,o.length-n),l=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var d=h+65535;a>d?l=hs(u,l,t.subarray(h,d)):(u[h]=true,l=hs(u,l,t.subarray(h,a)))}else{for(var c=cs[e-1],v=c>>>13,f=8191&c,p=(1<<r)-1,m=new Bn(32768),g=new Bn(p+1),y=Math.ceil(r/3),w=2*y,b=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<w)&p},k=new Wn(25e3),_=new Bn(288),S=new Bn(32),I=0,M=0,C=(h=0,0),R=0,x=0;a>h;++h){var T=b(h),A=32767&h,O=g[T];if(m[A]=O,g[T]=A,h>=R){var E=a-h;if((I>7e3||C>24576)&&E>423){l=ds(t,u,0,k,_,S,M,C,x,h-x,l),C=I=M=0,x=h;for(var F=0;286>F;++F)_[F]=0;for(F=0;30>F;++F)S[F]=0}var N=2,L=0,D=f,P=A-O&32767;if(E>2&&T==b(h-P))for(var B=Math.min(v,E)-1,W=Math.min(32767,h),z=Math.min(258,E);W>=P&&--D&&A!=O;){if(t[h+N]==t[h+N-P]){for(var U=0;z>U&&t[h+U]==t[h+U-P];++U);if(U>N){if(N=U,L=P,U>B)break;var j=Math.min(P,U-2),q=0;for(F=0;j>F;++F){var H=h-P+F+32768&32767,G=H-m[H]+32768&32767;G>q&&(q=G,O=H)}}}P+=(A=O)-(O=m[A])+32768&32767}if(L){k[C++]=268435456|Gn[N]<<18|Vn[L];var V=31&Gn[N],Z=31&Vn[L];M+=zn[V]+Un[Z],++_[257+V],++S[Z],R=h+N,++I}else k[C++]=t[h],++_[t[h]]}}l=ds(t,u,true,k,_,S,M,C,x,h-x,l)}return is(o,0,i+rs(l)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,i)},ms=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},gs=function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&ms(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}},ys=function(t){return 10+(t.filename&&t.filename.length+1||0)};function ws(t,e){for(var r="",i=0;t.length>i;){var n=t[i++];r+=String.fromCharCode(n)}return r}class bs{constructor(t,e){var r,i;void 0===e&&(e={}),this.gh={},this.yh=t=>{if(!this.gh[t]){var e,r;this.gh[t]=!0;var i=this.wh(t);null==(e=(r=this.bh).onBlockedNode)||e.call(r,t,i)}},this.kh=t=>{var e=this.wh(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var r=e.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[t,e]},this.wh=t=>this._rrweb.mirror.getNode(t),this._h=t=>{var e,r,i,n,s,a,o,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(i=null==(n=t.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(s=null==(a=t.texts)?void 0:a.length)&&void 0!==s?s:0)+(null!==(o=null==(u=t.adds)?void 0:u.length)&&void 0!==o?o:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,r=this._h(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var e=this.kh(t.id);return!this.To.consumeRateLimit(e[0])&&t})));var i=this._h(e);return 0!==i||r===i?t:void 0},this._rrweb=t,this.bh=e,this.To=new Ur({bucketSize:null!==(r=this.bh.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.bh.refillRate)&&void 0!==i?i:10,refillInterval:1e3,et:this.yh,rt:Vr})}reset(){this.gh={}}stop(){this.To.stop(),this.reset()}}Hr.DEBUG=!1,Hr.LIB_VERSION="1.412.1",Hr.LIB_NAME="web";class ks{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.Sh=t.get_property.bind(t),this.Ih=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Ih(ln,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,r=this.Sh(ln);return Fr(e=r)&&Lr(e.sessionId)&&$r(e.size)&&r.sessionId===t?r.size:0}}function _s(t,e){return function(t){for(var e=0,r=0;t.length>r;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<zr(100*e,0,100,Vr)}var Ss=function(t,e){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},Is={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>Ss(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Ss(e,t))))),icontains:(t,e)=>e.map(Ms).some((e=>t.map(Ms).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Ms).every((e=>t.map(Ms).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},Ms=t=>t.toLowerCase(),Cs=new Set(["is_not","not_icontains","not_regex"]);function Rs(t,e,r){return!t||0===t.length||t.every((t=>{var i="person"===t.type?r:e,n=null==i?void 0:i[t.key],s=t.operator||"exact";if(Nr(n)||Dr(n))return Cs.has(s);var a=Is[s];return!!a&&!Nr(t.value)&&!Dr(t.value)&&a(Or(t.value)?t.value.map(String):[String(t.value)],Or(n)?n.map(String):[String(n)])}))}var xs=Zr("[SessionRecording]");function Ts(t,e){return e?t:"!"+t}function As(t,e){return t===e||t!=="!"+e&&null}class Os{constructor(t,e,r,i,n,s,a){this.Mh=null,this.Ch=Fn,this._instance=t,this.dh=e,this.fh=r,this.ph=i,this.Rh=n,this.xh=s,this.Th=a}onRemoteConfig(t){this.Mh=$r(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ah=new In([this.fh,this.dh]),this.Ch=En):(this.Ah=new Mn([this.fh,this.dh]),this.Ch=Fn),this._instance.register_for_session({[dn]:t.triggerMatchType}),this.dh.onConfig(t),this.fh.onConfig(t),this.ph.onConfig(t,((t,e)=>{this.Rh("linked_flag_matched",{flag:t,variant:e}),this.Th()}))}getStatus(t){return this.Ch({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e=this._instance.get_property("$session_recording_remote_config"),r=null==e?void 0:e.minimumDurationMilliseconds;return $r(r)?r:null}checkUrlTriggers(t,e,r,i){this.dh.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.fh.lh.length&&Pr(this.Oh))return this.Oh=t((t=>{try{this.fh.checkEventTriggerConditions(t.event,r,e)}catch(t){xs.error("Could not activate event trigger",t)}})),this.Oh}makeSamplingDecisions(t){var e,r,i,n=this.Mh;if(!$r(n))return null==(r=this._instance.persistence)||r.unregister(tn),void(null==(i=this._instance.persistence)||i.unregister(Ji));var s=this._instance.get_property(tn),a=this._instance.get_property(Ji),o=As(s,t),u=$r(a)&&a!==n,l=Nr(a)&&s===t,h=u||l||!Br(o),d=h?_s(t,n):o;h&&(d?this.Rh("sampled"):xs.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[tn]:Ts(t,d),[Ji]:Dr(a)&&s===t?null:n})}ensureSamplingDecision(t){if($r(this.Mh)){var e=this._instance.get_property(tn);Br(As(e,t))||this.makeSamplingDecisions(t)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i,n;null==(t=this._instance.persistence)||t.unregister(nn),null==(e=this._instance.persistence)||e.unregister(rn),null==(r=this._instance.persistence)||r.unregister(tn),null==(i=this._instance.persistence)||i.unregister(Ji),null==(n=this._instance.persistence)||n.unregister(en)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Ah)?void 0:e.triggerStatus(t))===bn}stop(){var t;null==(t=this.Oh)||t.call(this),this.Oh=void 0,this.fh.stop(),this.dh.stop(),this.ph.stop()}}class Es{constructor(t,e,r,i,n){this.Eh=[],this.Fh=new Map,this.Nh=!1,this._instance=t,this.dh=e,this.Rh=r,this.Lh=i,this.Th=n}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Dh(t.triggerGroups),this._instance.register_for_session({[dn]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:t.triggerGroups.length}),this.dh.onConfig(t)):xs.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return gn;if(t.urlTriggerMatching.urlBlocked)return mn;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return cn;var i=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===wn){var o=s.group.id,u=r.get(o);Nr(u)?Vr.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===u&&(n=!0)}else a===bn&&(i=!0)}return n?vn:i?pn:cn}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Eh,triggerGroupSamplingResults:this.Fh,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.Eh)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;$r(i)&&(Dr(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.dh.checkUrlBlocklist(e,r);var s=function(i){i.checkUrlTriggerConditions(e,r,(e=>{n.Ph(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t),n.Th(e))}),t)};for(var a of this.Eh)s(a)}setupEventTriggerListeners(t,e,r){var i=this;return this.Oh=t((t=>{var r;if(this.Nh)return xs.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.Oh)||r.call(this),void(this.Oh=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,(n=>{if(i.Ph(r,t.properties)){var s=(r.group.conditions.events||[]).filter((e=>e.name===t.event)),a=i._instance.get_property(hn);s.some((e=>!e.properties||0===e.properties.length||Rs(e.properties,t.properties,a)))&&(r.activateTrigger(n,e),i.updateActiveTriggers(e),i.Th(n))}}),e)};for(var s of this.Eh)n(s)}catch(t){xs.error("Could not activate event trigger for trigger groups",t)}})),this.Oh}makeSamplingDecisions(t){for(var e of this.Eh){var r,i=e.group,n=i.id,s=i.sampleRate,a=on+n,o=this._instance.get_property(a),u=null,l=!1,h=!1,d=!1;if(Fr(o)){var c=o.sessionId,v=o.sampleRate,f=o.sampled;l="string"==typeof c&&c!==t,h=$r(v)&&v!==s,u=c===t&&$r(v)&&v===s&&Br(f)?f:null}else u=o===t||null,l="string"==typeof o&&o!==t,d=o===t;var p=l||h||d||!Br(u),m=p?_s(t+n,s):u;p&&this.Lh("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:s,isSampled:m}),this.Fh.set(n,m),null==(r=this._instance.persistence)||r.register({[a]:{sessionId:t,sampleRate:s,sampled:m}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Nh=!0}clearConditionalRecordingPersistence(){var t,e,r;for(var i of(null==(t=this._instance.persistence)||t.unregister(tn),null==(e=this._instance.persistence)||e.unregister(Ji),null==(r=this._instance.persistence)||r.unregister(en),this.Eh)){var n,s,a,o=i.group.id;null==(n=this._instance.persistence)||n.unregister(sn+o),null==(s=this._instance.persistence)||s.unregister(an+o),null==(a=this._instance.persistence)||a.unregister(on+o)}}updateActiveTriggers(t){var e=[];for(var r of this.Eh){var i=r.group,n=i.id,s="trigger_activated"===r.triggerStatus(t),a=!0===this.Fh.get(n);s&&e.push({id:n,name:i.name,matched:!0,sampled:a})}this._instance.register_for_session({$sdk_debug_replay_matched_recording_trigger_groups:e})}hasPendingTriggers(t){for(var e of this.Eh)if(e.triggerStatus(t)===bn)return!0;return!1}stop(){var t;null==(t=this.Oh)||t.call(this),this.Oh=void 0,this.Eh.forEach((t=>t.stop())),this.Eh=[],this.Fh.clear(),this.dh.stop()}Ph(t,e){var r=t.group.conditions.properties;return!r||0===r.length||Rs(r,e,this._instance.get_property(hn))}Dh(t){var e=this;this.Eh.forEach((t=>t.stop())),this.Eh=[],this.Fh.clear();var r=function(t){var r=new On(e._instance,t,((r,i)=>{e.Rh("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name}),e.Th()}));e.Eh.push(r)};for(var i of t)r(i)}}var Fs=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"];function Ns(t){return Nr(t)?void 0:Math.round(t)}function Ls(t){return Fr(t)?t.network_timing:t}var Ds,Ps,$s=943718.4,Bs="[SessionRecording]",Ws=Zr(Bs),zs=[Vi.MouseMove,Vi.MouseInteraction,Vi.Scroll,Vi.ViewportResize,Vi.Input,Vi.TouchMove,Vi.MediaInteraction,Vi.Drag],Us=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function js(){var t;return null==_r||null==(t=_r.__PosthogExtensions__)?void 0:t.rrweb}function qs(){var t;return null==(t=js())?void 0:t.record}function Hs(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,Nn())}}function Gs(t){return ws(function(t,e){void 0===e&&(e={});var r=fs(),i=t.length;r.p(t);var n=ps(t,e,ys(e),8),s=n.length;return gs(n,e),ms(n,s-8,r.d()),ms(n,s-4,i),n}(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new $n(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},a=0;r>a;++a){if(n+5>i.length){var o=new $n(n+8+(r-a<<1));o.set(i),i=o}var u=t.charCodeAt(a);128>u?s(u):2048>u?(s(192|u>>>6),s(128|63&u)):u>55295&&57344>u?(s(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++a))>>>18),s(128|u>>>12&63),s(128|u>>>6&63),s(128|63&u)):(s(224|u>>>12),s(128|u>>>6&63),s(128|63&u))}return is(i,0,n)}(Hs(t))))}function Vs(t){return Zs.apply(this,arguments)}function Zs(){return Zs=e((function*(t){var e=Hs(t),r=yield function(t,e,r){return Cr.apply(this,arguments)}(e,Hr.DEBUG,{rethrow:!0});return ws(new Uint8Array(yield r.arrayBuffer()))})),Zs.apply(this,arguments)}var Js="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Qs=!1;function Ks(t){return Or(t)&&0===t.length?Ds=null!=Ds?Ds:Gs([]):Gs(t)}function Xs(t){return Ys.apply(this,arguments)}function Ys(){return(Ys=e((function*(t){return Or(t)&&0===t.length?Ds||(Ps=null!=Ps?Ps:Vs([]).then((t=>(Ds=t,t))).catch((t=>{throw Ds=void 0,Ps=void 0,t}))):Vs(t)}))).apply(this,arguments)}function ta(t){return Js&&!Qs&&function(t){return t.type===Gi.FullSnapshot||t.type===Gi.IncrementalSnapshot&&(t.data.source===Vi.Mutation||t.data.source===Vi.StyleSheetRule)}(t)}function ea(t){return{event:t,size:Dn(t)}}function ra(t,e){return r({},t,{data:e,cv:"2024-10"})}function ia(t,e){return r({},t,{cv:"2024-10",data:r({},t.data,e)})}function na(t){try{if(t.type===Gi.FullSnapshot)return ea(ra(t,Gs(t.data)));if(t.type===Gi.IncrementalSnapshot&&t.data.source===Vi.Mutation)return ea(ia(t,{texts:Ks(t.data.texts),attributes:Ks(t.data.attributes),removes:Ks(t.data.removes),adds:Ks(t.data.adds)}));if(t.type===Gi.IncrementalSnapshot&&t.data.source===Vi.StyleSheetRule)return ea(ia(t,{adds:t.data.adds?Gs(t.data.adds):void 0,removes:t.data.removes?Gs(t.data.removes):void 0}))}catch(t){Ws.error("could not compress event - will use uncompressed event",t)}return{event:t,size:Ln(t)}}function sa(){return(sa=e((function*(t){try{if(t.type===Gi.FullSnapshot)return ea(ra(t,yield Vs(t.data)));if(t.type===Gi.IncrementalSnapshot&&t.data.source===Vi.Mutation){var e=yield Promise.all([Xs(t.data.texts),Xs(t.data.attributes),Xs(t.data.removes),Xs(t.data.adds)]);return ea(ia(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(t.type===Gi.IncrementalSnapshot&&t.data.source===Vi.StyleSheetRule){var r=yield Promise.all([t.data.adds?Vs(t.data.adds):void 0,t.data.removes?Vs(t.data.removes):void 0]);return ea(ia(t,{adds:r[0],removes:r[1]}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===Sr})(e)&&(Qs=!0),Ws.error("could not compress event asynchronously - trying synchronous compression",e),na(t)}return{event:t,size:Ln(t)}}))).apply(this,arguments)}function aa(t,e){return t.type===Gi.Custom&&t.data.tag===e}function oa(t){return aa(t,"sessionIdle")}function ua(t){return aa(t,"$session_ending")}function la(t){return aa(t,"$session_starting")}class ha{get sessionId(){return this.$r}get $h(){if(!this._instance.sessionManager)throw new Error(Bs+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Bh(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get Wh(){return As(this._instance.get_property(tn),this.sessionId)}get Mh(){var t,e=null==(t=this.Tl)?void 0:t.sampleRate;return $r(e)?e:null}get zh(){var t,e;return null!==(t=null==(e=this.Uh)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t){this.jh="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.qh=void 0,this.Hh=Date.now(),this.Gh=!1,this.Vh=[],this.Zh="unknown",this.Jh=!1,this.Qh=!1,this.Kh=!1,this.Xh=!1,this.Yh=!1,this.kd=!1,this._d=!1,this.Sd=!1,this.Id=!1,this.Md=[],this.Cd=void 0,this.Rd=void 0,this.Td=[],this.Ad=0,this.Od=0,this.Ed=!1,this.Fd=void 0,this.Oh=void 0,this.Nd=void 0,this.Ld=void 0,this.Dd=void 0,this.Sr=(t,e,r)=>{var i,n,s,a;if(r&&(t!==this.$r||e!==this.Dr)){var o,u=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),l=this.$r,h=this.Dr;if(u&&this.Lh("$session_ending",{currentSessionId:l,currentWindowId:h,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Hh,flushed_size:null==(o=this.Pd)?void 0:o.currentTrackedSize(l)}),null==(i=this._instance.persistence)||i.unregister(un),this._d=!1,null==(n=js())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.$d=void 0,null==(s=js())||null==s.resetSnapshotCostState||s.resetSnapshotCostState(),this.Lh("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.Bd(),!(!1===this.Zh&&this.isStarted||this.$r===t&&this.Dr===e)){var d=this.$r!==t&&!1!==this.Zh;this.Zh="unknown",this.Wd(d)}u&&this.Lh("$session_starting",{previousSessionId:l,previousWindowId:h,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Hh}),null==(a=this.Uh)||a.makeSamplingDecisions(t)}},this.zd=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[en])===this.$r},this.Ud=()=>{var t,e;if(0===this.O.data.length)return null;var r=null==(t=this.O.data[0])?void 0:t.timestamp,i=null==(e=this.O.data[this.O.data.length-1])?void 0:e.timestamp;return $r(r)&&$r(i)?i-r:null},this.jd=()=>{var t,e,r=this.zh;if(!$r(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.qd;return $r(i)&&i>=0&&r>i}if(this.zd())return!1;var n,s=this.Ud();return!!Dr(s)||r>s||(null==(n=this._instance.persistence)||n.register({[en]:this.$r}),!1)},this.Hd=()=>{this.status!==pn?(this.Jh&&this.Qh&&!this.Kh&&(this.Jh=!1),this.Gd(),this.Vd()):this.Zd()},this.Jd=()=>{this.Lh("browser offline",{})},this.pa=()=>{this.Lh("browser online",{})},this.Ie=()=>{null!=yr&&yr.visibilityState&&this.Lh("window "+yr.visibilityState,{})},this._instance=t;var e=this.$h.checkAndGetSessionAndWindowId(),r=e.windowId;this.$r=e.sessionId,this.Dr=r,this.ph=new Tn(this._instance),this.dh=new xn(this._instance),this.fh=new An(this._instance),this.O=this.Zd(),this.$h.sessionTimeoutMs>this.Bh||Ws.warn("session_idle_threshold_ms ("+this.Bh+") is greater than the session timeout ("+this.$h.sessionTimeoutMs+"). Session will never be detected as idle"),this.Pd=new ks(this._instance)}get Qd(){var t,e,r,i,n,s,a,o=null==(t=this.Tl)?void 0:t.masking,u={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.maskAllInputs,maskTextSelector:null==(r=this._instance.config.session_recording)?void 0:r.maskTextSelector,blockSelector:null==(i=this._instance.config.session_recording)?void 0:i.blockSelector},l=null!==(n=null==u?void 0:u.maskAllInputs)&&void 0!==n?n:null==o?void 0:o.maskAllInputs,h=null!==(s=null==u?void 0:u.maskTextSelector)&&void 0!==s?s:null==o?void 0:o.maskTextSelector,d=null!==(a=null==u?void 0:u.blockSelector)&&void 0!==a?a:null==o?void 0:o.blockSelector;return Nr(l)&&Nr(h)&&Nr(d)?void 0:{maskAllInputs:null==l||l,maskTextSelector:h,blockSelector:d}}Kd(){var t;if(!this.Sd){var e=null==(t=this.Tl)?void 0:t.masking;if(!Pr(e)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector"].filter((t=>{var i=null==r?void 0:r[t],n=e[t];return!Nr(i)&&i!==n}));0!==i.length&&(this.Sd=!0,Ws.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==r?void 0:r.maskAllInputs,maskTextSelector:null==r?void 0:r.maskTextSelector,blockSelector:null==r?void 0:r.blockSelector},project:e}))}}}get Xd(){var t;return zr(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,Zr("canvas recording resolution scale"),1)}get Yd(){var t,e,r,i,n,s,a,o=this._instance.config.session_recording.captureCanvas,u=null==(t=this.Tl)?void 0:t.canvasRecording,l=null!==(e=null!==(r=null==o?void 0:o.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==e&&e,h=null!==(i=null!==(n=null==o?void 0:o.canvasFps)&&void 0!==n?n:null==u?void 0:u.fps)&&void 0!==i?i:4,d=null!==(s=null!==(a=null==o?void 0:o.canvasQuality)&&void 0!==a?a:null==u?void 0:u.quality)&&void 0!==s?s:.4;if("string"==typeof d){var c=parseFloat(d);d=isNaN(c)?.4:c}return{enabled:l,fps:zr(h,0,12,Zr("canvas recording fps"),4),quality:zr(d,0,1,Zr("canvas recording quality"),.4)}}get tc(){var t,e=!(null==(t=this.Tl)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get ec(){var t,e,r,i=null==(t=this.Tl)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},s=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),a=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),o=Ls(this._instance.config.capture_performance),u=Ls(null==i?void 0:i.capturePerformance),l=!!(Br(o)?o:u);return s||a||l?{recordHeaders:s,recordBody:a,recordPerformance:l}:void 0}rc(){var t,e,i=[],n=null==(t=_r.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.tc&&i.push(n());var s=null==(e=_r.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;return this.ec&&Er(s)&&(!Kr.includes(wr.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(s(((t,e)=>{var i,n={payloadSizeLimitBytes:fi.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...fi.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...fi.payloadHostDenyList]},s=!1!==t.session_recording.recordHeaders&&e.recordHeaders,a=!1!==t.session_recording.recordBody&&e.recordBody,o=!1!==t.capture_performance&&e.recordPerformance,u=(i=vi(n),t=>(null!=t&&t.requestBody&&(t.requestBody=bi(t.requestBody,t.requestHeaders,i,"Request")),null!=t&&t.responseBody&&(t.responseBody=bi(t.responseBody,t.responseHeaders,i,"Response")),t)),l=e=>{return u(((t,e)=>{var r,i=Xr(t.name),n=0===e.indexOf("http")?null==(r=Xr(e))?void 0:r.pathname:e;"/"===n&&(n="");var s=null==i?void 0:i.pathname.replace(n||"","");if(!(i&&s&&wi.some((t=>0===s.indexOf(t)))))return t})((yi((r=e).requestHeaders),yi(r.responseHeaders),r),t.api_host));var r},h=Er(t.session_recording.maskNetworkRequestFn);return h&&Er(t.session_recording.maskCapturedNetworkRequestFn)&&Vr.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var i=t.session_recording.maskNetworkRequestFn({url:e.name});return r({},e,{name:null==i?void 0:i.url})}),n.maskRequestFn=Er(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r,i=l(e);return i&&null!==(r=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(i))&&void 0!==r?r:void 0}:t=>function(t){if(!Nr(t))return t.requestBody=ki(t.requestBody,"Request"),t.responseBody=ki(t.responseBody,"Response"),t}(l(t)),r({},fi,n,{recordHeaders:s,recordBody:a,recordPerformance:o,recordInitialRequests:o,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.ec))):Ws.info("NetworkCapture not started because we are on localhost.")),i}ic(t){return this._instance.config.disable_capture_url_hashes?jr(t):t}nc(t,e){void 0===e&&(e=!1);var r=e?jr(t):this.ic(t),i=this._instance.config.mask_personal_data_properties?[...Fs,...this._instance.config.custom_personal_data_properties||[]]:[];return this.sc(function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[1],s=(i[0]||"").split("?"),a=s[1],o=s[0],u=(a||"").split("&"),l=[],h=0;u.length>h;h++){var d=u[h].split("=");Or(d)&&(e.includes(d[0])?l.push(d[0]+"=<masked>"):l.push(u[h]))}var c=o;return null!=a&&(c+="?"+l.join("&")),null!=n&&(c+="#"+n),c}(r,i))}sc(t){var e=this._instance.config.session_recording;if(e.maskCapturedNetworkRequestFn){var r,i=e.maskCapturedNetworkRequestFn({name:t});return null!==(r=null==i?void 0:i.name)&&void 0!==r?r:null==i?void 0:i.url}if(e.maskNetworkRequestFn){var n=e.maskNetworkRequestFn({url:t});return null==n?void 0:n.url}return t}ac(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Vh.length?this.Vh.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Ws.warn("could not emit queued rrweb event.",e,t),!1}}Lh(t,e){return this.ac(Us((()=>qs().addCustomEvent(t,e))))}oc(){try{if(this._instance.config.capture_pageview||!mr)return;var t=new URL(mr.location.href),e=this.nc(t.origin+t.pathname+t.search);this.uc!==e&&(this.uc=e,this.Lh("$url_changed",{href:e}))}catch(t){}}lc(){if(this.Vh.length){var t=[...this.Vh];this.Vh=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.ac(t)}))}}xh(){return this.ac(Us((()=>qs().takeFullSnapshot())))}get hc(){var t,e,r;if(null!=(t=this.Uh)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var i,n=null==(i=this._instance.config.session_recording)?void 0:i.trigger_pending_buffer_interval_millis;return $r(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}dc(){if(this.cc&&clearInterval(this.cc),!0!==this.Zh){var t=this.hc;t&&(this.cc=setInterval((()=>{this.xh()}),t))}}Th(t){"event"===t&&this.vc(),!this.dh.urlBlocked&&["sampled","active"].includes(this.status)&&this.dc()}fc(){this.dh.urlBlocked||(this.dh.urlBlocked=!0,clearInterval(this.cc),Ws.info("recording paused due to URL blocker"),this.Lh("recording paused",{reason:"url blocker"}))}mc(){this.dh.urlBlocked&&(this.dh.urlBlocked=!1,this.xh(),this.dc(),this.Lh("recording resumed",{reason:"left blocked url"}),Ws.info("recording resumed"))}gc(t,e){var r;if("event"===t&&this.vc(),!this.Gh&&null!=(r=this.Uh)&&r.hasPendingTriggers(this.sessionId)){this.Gh=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===t?rn:nn]:this.sessionId}),null==(n=this.Uh)||n.updateActiveTriggers(this.sessionId),this.Th(),this.Vd(),this.Rh(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Gh=!1}}}get isStarted(){return!!this.qh}get Tl(){var t=this._instance.get_property(Zi);if(t){var e;try{e=Fr(t)?t:JSON.parse(t)}catch(t){return void Ws.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return Ws.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(i=this._instance.persistence)||i.unregister(Zi))}return e}}yc(t,e,r){this._instance.get_property(t)&&(e(),r())}start(t){var e,r,i=this.Tl;if(i){this.isStarted||(this.Jh=!1!==this.Zh&&!this.Xh,this.Xh=!1,this.Qh=this.Jh,this.Kh=!1),this.Ed&&(this.wc(),this.Zd());var n=this.$h.checkAndGetSessionAndWindowId(),s=n.windowId;this.$r=n.sessionId,this.Dr=s,null==(e=this._instance.persistence)||e.unregister(un),null!=i&&i.endpoint&&(this.jh=null==i?void 0:i.endpoint),this.Uh=2===(null==i?void 0:i.version)&&(null==i?void 0:i.triggerGroups)&&i.triggerGroups.length>0?new Es(this._instance,this.dh,this.Rh.bind(this),this.Lh.bind(this),this.Th.bind(this)):new Os(this._instance,this.dh,this.fh,this.ph,this.Rh.bind(this),this.xh.bind(this),this.Th.bind(this)),this.Uh.onRemoteConfig(i),null==(r=this.Oh)||r.call(this),this.Oh=this.Uh.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.gc(t,e))),this.yc(Qi,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Qi)})),this.yc(Ki,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Ki)})),this.yc(Yi,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Yi)})),this.yc(Xi,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Xi)})),this.Uh.makeSamplingDecisions(this.sessionId),this.bc(),this.Yh||(Qr(mr,"beforeunload",this.Hd),Qr(mr,"offline",this.Jd),Qr(mr,"online",this.pa),Qr(mr,"visibilitychange",this.Ie),!this.Nd&&Er(this.$h.onSessionId)&&(this.Nd=this.$h.onSessionId(this.Sr)),!this.Ld&&Er(this.$h.on)?this.Ld=this.$h.on("forcedIdleReset",(()=>{this.Bd(),this.Zh="unknown",this.stop(),this.Dd=this.$h.onSessionId(((t,e,r)=>{var i;null==(i=this.Dd)||i.call(this),this.Dd=void 0,this.Sr(t,e,r)}))})):Er(this.$h.on)||Ws.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Pr(this.Fd)&&(this.Fd=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.nc(t.properties.$current_url):"";if(!e)return;this.Lh("$pageview",{href:e})}}catch(t){Ws.error("Could not add $pageview to rrweb session",t)}}))),this.status===fn&&this.Rh(t||"recording_initialized"))}else Ws.info("remote config must be stored in persistence before recording can start")}kc(){var t,e,r,i,n,s;null==mr||mr.removeEventListener("beforeunload",this.Hd),null==mr||mr.removeEventListener("offline",this.Jd),null==mr||mr.removeEventListener("online",this.pa),null==mr||mr.removeEventListener("visibilitychange",this.Ie),clearInterval(this.cc),this._c(),null==(t=this.Fd)||t.call(this),this.Fd=void 0,null==(e=this.Oh)||e.call(this),this.Oh=void 0,null==(r=this.Nd)||r.call(this),this.Nd=void 0,null==(i=this.Ld)||i.call(this),this.Ld=void 0,null==(n=this.Dd)||n.call(this),this.Dd=void 0,null==(s=this.Uh)||s.stop(),this.Sc(),this.wc()}wc(){this.Od+=1,this.Td=[],this.Ad=0,this.Ic=void 0,this.Ed=!1}Sc(){var t,e;null==(t=this.Mc)||t.stop(),this.Vh=[],null==(e=this.qh)||e.call(this),this.qh=void 0}Cc(){if(!this.Ic||0===this.Ad)return!1;if(this.Ed)return!0;this.Ed=!0;var t=this.Od;return this._c(),this.Sc(),this.Ic.catch((()=>{})).then((()=>{t===this.Od&&(this.Ed=!1,this.Vd(),this.Zd(),this.kc(),Ws.info("stopped"))})).catch((()=>{this.Ed=!1,this.kc(),Ws.info("stopped")})),!0}stop(){this.Cc()||(this.Vd(),this.Zd(),this.kc(),Ws.info("stopped"))}Wd(t){this.stop(),this.start("session_id_changed"),this.Jh=t,this.Qh=!1}vc(){this.isStarted||(this.Xh=!0),this.Jh&&(this.Jh=!1,this.Qh=!1,this.Kh&&(this.Kh=!1,this.xh()),this.Rc())}discard(){this.Zd(),this.kc(),Ws.info("discarded")}xc(t,e,r,i,n){var s={$snapshot_bytes:r,$snapshot_data:e,$session_id:i,$window_id:n};this.status!==cn?(this.Tc(t,i),this.Ac(s)):this.Zd()}Oc(){var t,e=null==(t=js())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&(this.$d&&this.$d.durationMs>=e.durationMs||(this.$d=e),500>e.durationMs||Ws.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}Tc(t,e){t.type!==Gi.FullSnapshot?t.type===Gi.IncrementalSnapshot&&(Nr(this.Cd)||this.Cd===e||this.Rd===e||(this.Rd=e,Ws.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.xh())):this.Cd=e}Ec(t){t.counted&&t.generation===this.Od&&(this.Ad=Math.max(0,this.Ad-1)),t.counted=!1,this.Td=this.Td.filter((e=>e!==t))}Fc(t,e,r){t.processed||t.generation!==this.Od||(t.processed=!0,this.xc(t.event,e,r,t.targetSessionId,t.targetWindowId))}Nc(t){try{var e=t.compressionEnabled?na(t.event):{event:t.event,size:Ln(t.event)};this.Fc(t,e.event,e.size)}finally{this.Ec(t)}}Gd(){[...this.Td].forEach((t=>{this.Nc(t)}))}Lc(t,r,i,n){var s=this,a={event:t,compressionEnabled:r,targetSessionId:i,targetWindowId:n,generation:this.Od,processed:!1,counted:!0};this.Td.push(a),this.Ad+=1;var o=function(){var i=e((function*(){try{if(a.processed)return;var e,i;try{var n=r?ta(t)?yield function(t){return sa.apply(this,arguments)}(t):na(t):{event:t,size:Ln(t)};e=n.event,i=n.size}catch(r){Ws.error("could not process queued compression event - will use uncompressed event",r),e=t,i=Ln(t)}s.Fc(a,e,i)}finally{s.Ec(a)}}));return function(){return i.apply(this,arguments)}}();this.Ic=this.Ic?this.Ic.catch((()=>{})).then(o):o()}onRRwebEmit(t){var e,r,i,n,s,a,o;if(this._instance.sessionManager&&(this.lc(),t&&Fr(t))){if(t.type===Gi.Meta){var u=this.nc(t.data.href);if(this.uc=u,!u)return;t.data.href=u}else this.oc();if(null==(e=this.Uh)||e.checkUrlTriggers(this.sessionId,(()=>this.fc()),(()=>this.mc()),((t,e)=>this.gc(t,e))),!this.dh.urlBlocked||(l=t).type===Gi.Custom&&"recording paused"===l.data.tag){var l,h,d,c;t.type===Gi.FullSnapshot&&(null!=(h=js())&&null!=h.wasMaxDepthReached&&h.wasMaxDepthReached()&&(this._d=!0),this.Oc(),this.dc(),null==(d=this.Mc)||d.reset(),null==(c=this._instance.persistence)||c.register_once({[un]:t.timestamp},void 0)),t.type===Gi.FullSnapshot&&null!=(r=this.Uh)&&r.hasPendingTriggers(this.sessionId)&&this.Dc();var v=this.Mc?this.Mc.throttleMutations(t):t;if(v){var f=function(t){var e=t;if(e&&Fr(e)&&6===e.type&&Fr(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var r=[],i=0;e.data.payload.payload.length>i;i++)r.push(e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?e.data.payload.payload[i].slice(0,2e3)+"...[truncated]":e.data.payload.payload[i]);return e.data.payload.payload=r,t}return t}(v),p=function(t){return ua(t)?t.data.payload:null}(f),m=function(t){return la(t)?t.data.payload:null}(f);if(p||m){var g=null!=p?p:m;null!=g&&g.lastActivityTimestamp&&(f.timestamp=g.lastActivityTimestamp)}else this.Pc(f);t.type===Gi.FullSnapshot&&(this.Md.push([this.$r,t.timestamp]),this.Md.length>6&&(this.Md=this.Md.slice(-6)));var y=null!==(i=null!==(n=null==p?void 0:p.currentSessionId)&&void 0!==n?n:null==m?void 0:m.nextSessionId)&&void 0!==i?i:this.$r,w=null!==(s=null!==(a=null==p?void 0:p.currentWindowId)&&void 0!==a?a:null==m?void 0:m.nextWindowId)&&void 0!==s?s:this.Dr;if(!0!==this.Zh||function(t){return oa(t)||ua(t)||la(t)}(f)){if(oa(f)){var b=f.data.payload;b&&(f.timestamp=b.lastActivityTimestamp+b.threshold)}var k=null===(o=this._instance.config.session_recording.compress_events)||void 0===o||o;if(this.Ad>0||k&&ta(f))this.Lc(f,k,y,w);else{var _=k?na(f):{event:f,size:Ln(f)};this.xc(f,_.event,_.size,y,w)}}}}}}get status(){return this.Uh?this.Uh.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.Wh,rrwebError:this.Yh,urlTriggerMatching:this.dh,eventTriggerMatching:this.fh,linkedFlagMatching:this.ph,remoteConfig:this.Tl}):cn}log(t,e){var r;void 0===e&&(e="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.ph.linkedFlagSeen=!0,this.xh(),this.vc(),this.Rh("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[tn]:this.sessionId,[Ji]:null}),this.xh(),this.vc(),this.Rh("sampling_overridden")}overrideTrigger(t){this.gc(t),this.vc()}$c(){try{var t,e=null==mr||null==(t=mr.location)?void 0:t.href;if(!e)return;var r=this.nc(e);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}_c(){this.Bc&&(clearTimeout(this.Bc),this.Bc=void 0)}Rc(){this.Bc||(this.Bc=setTimeout((()=>{this.Vd()}),2e3))}Vd(){var t;if(this._c(),this.Jh)return this.O;null==(t=this.Uh)||t.ensureSamplingDecision(this.sessionId);var e=this.jd();if(this.status===pn||this.status===mn||this.status===cn||e)return this.Rc(),this.O;if(this.O.data.length>0){var r,i=this.$c();Pn(this.O).forEach((t=>{var e;null==(e=this.Pd)||e.trackSize(t.sessionId,t.size),this.Wc({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:Hr.LIB_NAME,$lib_version:Hr.LIB_VERSION,$snapshot_host:i})})),null==(r=this.Uh)||r.onFlushComplete()}return this.Zd()}Ac(t){var e,r=2+((null==(e=this.O)?void 0:e.data.length)||0),i=t.$session_id,n=this.O.sessionId!==i;(n||!0!==this.Zh&&!this.Jh&&this.O.size+t.$snapshot_bytes+r>$s)&&(this.O=this.Vd(),n&&this.O.data.length>0&&(this.O=this.Zd()),this.O.sessionId=i,this.O.windowId=t.$window_id),this.Jh&&(this.Kh||this.O.size+t.$snapshot_bytes+r>$s)?this.Kh||(this.Kh=!0,this.O=this.Zd()):(this.O.size+=t.$snapshot_bytes,this.O.data.push(t.$snapshot_data),this.O.sizes.push(t.$snapshot_bytes),!0===this.Zh||this.Jh||this.Rc())}Wc(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.jh),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get qd(){var t,e,r=null==(t=this.O)?void 0:t.data[(null==(e=this.O)?void 0:e.data.length)-1],i=this.$h.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i.sessionStartTimestamp:null}Dc(){if(!this.O||0===this.O.data.length)return this.Zd();for(var t=-1,e=this.O.data.length-1;e>=0;e--)if(this.O.data[e].type===Gi.Meta){t=e;break}return 0>t?this.Zd():(this.O.data=this.O.data.slice(t),this.O.sizes=this.O.sizes.slice(t),this.O.size=this.O.sizes.reduce(((t,e)=>t+e),0),this.O)}Zd(){return this.O={size:0,data:[],sizes:[],sessionId:this.$r,windowId:this.Dr},this.O}Rh(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),Ws.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Lh("$recording_started",r({reason:t},e))}zc(t){var e;return 3===t.type&&-1!==zs.indexOf(null==(e=t.data)?void 0:e.source)}Pc(t){var e=this.zc(t);e||!0===this.Zh||t.timestamp-this.Hh>this.Bh&&(this.Zh=!0,clearInterval(this.cc),this.Lh("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Hh,threshold:this.Bh,bufferLength:this.O.data.length,bufferSize:this.O.size}),this.Vd());var r=!1;if(e&&(this.Hh=t.timestamp,this.Zh)){var i="unknown"===this.Zh;this.Zh=!1,i||(this.Lh("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}var n=this.$h.checkAndGetSessionAndWindowId(!e,t.timestamp),s=n.windowId,a=n.sessionId,o=this.$r!==a,u=this.Dr!==s;if(this.Dr=s,this.$r=a,o||u){var l=o&&!1!==this.Zh;l&&(this.Zh="unknown"),this.Wd(l)}else e&&this.vc(),r&&this.dc()}Bd(){var t;null==(t=this.Uh)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,r,i,n,s,a,o=this.$h.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.O.data.length,$sdk_debug_replay_internal_buffer_size:this.O.size,$sdk_debug_current_session_duration:this.qd,$sdk_debug_session_start:o.sessionStartTimestamp,$sdk_debug_replay_flushed_size:null==(t=this.Pd)?void 0:t.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Md,$snapshot_max_depth_exceeded:this._d,$sdk_debug_replay_slowest_full_snapshot_ms:Ns(null==(e=this.$d)?void 0:e.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Ns(null==(r=this.$d)?void 0:r.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(i=this.$d)?void 0:i.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(n=this.$d)?void 0:n.cssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==(s=this.$d)?void 0:s.deferredStylesheetCount,$sdk_debug_replay_slowest_mutation_batch_ms:Ns(null==(a=js())||null==a.getMutationCost||null==(a=a.getMutationCost())?void 0:a.slowestBatchMs),$sdk_debug_replay_rrweb_error:this.Yh,$sdk_debug_rrweb_attached:!!this.qh,$sdk_debug_rrweb_start_attempted:this.kd}}bc(){var t;if(!this.qh){this.kd=!0;var e,i,n,s={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:void 0,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},a=this._instance.config.session_recording;for(var o of Object.entries(a||{})){var u=o[0],l=o[1];if(u in s)if("maskInputOptions"===u)s.maskInputOptions=r({password:!0},l);else if("sampling"===u){var h=null!=l?l:{},d={};Nr(h.mousemove)||(d.mousemove=h.mousemove),Nr(h.mouseInteraction)||(d.mouseInteraction=h.mouseInteraction),s.sampling=d}else s[u]=l}this.Yd&&this.Yd.enabled&&(s.recordCanvas=!0,s.sampling=r({},s.sampling,{canvas:this.Yd.fps}),s.dataURLOptions={type:"image/webp",quality:this.Yd.quality},s.canvasResolutionScale=this.Xd,s.canvasMasking={configured:()=>{var t;return Er(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,r=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(Er(r))try{var i;return null!==(i=r(t))&&void 0!==i?i:null}catch(t){return this.Id||(this.Id=!0,Ws.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Qd&&(s.maskAllInputs=null===(e=this.Qd.maskAllInputs)||void 0===e||e,s.maskTextSelector=null!==(i=this.Qd.maskTextSelector)&&void 0!==i?i:void 0,s.blockSelector=null!==(n=this.Qd.blockSelector)&&void 0!==n?n:void 0),this.Kd();var c=qs();if(c){this.Mc=null!==(t=this.Mc)&&void 0!==t?t:new bs(c,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var r="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";Ws.info(r,{node:e}),this.log(Bs+" "+r,"warn")}});var v=this.rc();if(this.qh=c(r({emit:t=>{this.onRRwebEmit(t)},plugins:v},s)),!this.qh)return this.Yh=!0,void Ws.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.Yh=!1,this.Hh=Date.now(),this.Zh=Br(this.Zh)?this.Zh:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Tl),this.Lh("$session_options",{sessionRecordingOptions:s,activePlugins:v.map((t=>null==t?void 0:t.name))}),this.Lh("$posthog_config",{config:this._instance.config})}else Ws.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Lh(t,e)}}_r.__PosthogExtensions__=_r.__PosthogExtensions__||{},_r.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:t=>({name:"rrweb/console@1",observer:pr,options:t}),getRecordNetworkPlugin:t=>({name:"rrweb/network@1",observer:Hi,options:t})},_r.__PosthogExtensions__.rrweb={record:er,version:"v2",wasMaxDepthReached:()=>Tt,resetMaxDepthState(){Tt=!1,xt=!1},getLastSnapshotCost:()=>O,getMutationCost:()=>r({},N),resetSnapshotCostState(){x=0,T=0,A=C(),O=null,E=null,F=[],N={slowestBatchMs:0}}},_r.__PosthogExtensions__.initSessionRecording=t=>new ha(t)}();
|
|
2
2
|
//# sourceMappingURL=posthog-recorder.js.map
|