posthog-js 1.372.1 → 1.372.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/array.full.es5.js +1 -1
  2. package/dist/array.full.js +1 -1
  3. package/dist/array.full.no-external.js +1 -1
  4. package/dist/array.js +1 -1
  5. package/dist/array.no-external.js +1 -1
  6. package/dist/conversations.js +1 -1
  7. package/dist/conversations.js.map +1 -1
  8. package/dist/customizations.full.js +1 -1
  9. package/dist/default-extensions.js +1 -1
  10. package/dist/extension-bundles.js +1 -1
  11. package/dist/lazy-recorder.js +1 -1
  12. package/dist/main.js +1 -1
  13. package/dist/module.full.js +1 -1
  14. package/dist/module.full.no-external.js +1 -1
  15. package/dist/module.js +1 -1
  16. package/dist/module.no-external.js +1 -1
  17. package/dist/module.slim.js +1 -1
  18. package/dist/module.slim.no-external.js +1 -1
  19. package/dist/posthog-recorder.js +1 -1
  20. package/dist/src/extensions/conversations/external/components/ConversationsWidget.d.ts +0 -2
  21. package/dist/src/extensions/conversations/external/components/MessagesView.d.ts +1 -2
  22. package/dist/src/extensions/conversations/external/components/styles.d.ts +1 -1
  23. package/lib/package.json +1 -1
  24. package/lib/src/extensions/conversations/external/components/ConversationsWidget.d.ts +0 -2
  25. package/lib/src/extensions/conversations/external/components/ConversationsWidget.js +3 -12
  26. package/lib/src/extensions/conversations/external/components/ConversationsWidget.js.map +1 -1
  27. package/lib/src/extensions/conversations/external/components/MessagesView.d.ts +1 -2
  28. package/lib/src/extensions/conversations/external/components/MessagesView.js +2 -2
  29. package/lib/src/extensions/conversations/external/components/MessagesView.js.map +1 -1
  30. package/lib/src/extensions/conversations/external/components/OpenChatButton.js +0 -2
  31. package/lib/src/extensions/conversations/external/components/OpenChatButton.js.map +1 -1
  32. package/lib/src/extensions/conversations/external/components/styles.d.ts +1 -1
  33. package/lib/src/extensions/conversations/external/components/styles.js +2 -2
  34. package/lib/src/extensions/conversations/external/components/styles.js.map +1 -1
  35. package/lib/src/extensions/conversations/external/index.js +3 -1
  36. package/lib/src/extensions/conversations/external/index.js.map +1 -1
  37. package/package.json +3 -3
@@ -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||{}),f=(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))(f||{}),v={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},p={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},m={};function g(t){if(m[t])return m[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 v?v[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 p?p[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 m[t]=e.prototype,e.prototype;var o=document.createElement("iframe");try{document.body.appendChild(o);var u=o.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return l?m[t]=l:r}catch(t){return r}finally{o.parentNode&&document.body.removeChild(o)}}var y={};function b(t,e,r){var i,n=t+"."+String(r);if(y[n])return y[n].call(e);var s=g(t),a=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return a?(y[n]=a,a.call(e)):e[r]}var w={};function k(t,e,r){var i=t+"."+String(r);if(w[i])return w[i].bind(e);var n=g(t)[r];return"function"!=typeof n?e[r]:(w[i]=n,n.bind(e))}function S(){return g("MutationObserver").constructor}function I(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}var _={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)=>k("Node",t,"contains")(e),getRootNode:t=>k("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)=>k("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>k("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:I};function C(t){return t.nodeType===t.ELEMENT_NODE}function M(t){var e=t&&"host"in t&&"mode"in t&&_.host(t)||null;return Boolean(e&&"shadowRoot"in e&&_.shadowRoot(e)===t)}function T(t){return"[object ShadowRoot]"==={}.toString.call(t)}function x(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=t.href;return!r&&t.ownerNode&&(r=t.ownerNode.baseURI),(i=Array.from(e,(t=>R(t,r))).join("")).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function R(t,e){var r;if(function(t){return"styleSheet"in t}(t)){var i;try{i=x(t.styleSheet)||function(t){var{cssText:e}=t;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 W(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?W(n,e):n}class O{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))),C(t)){var r=_.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 A(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:a}=t,o=s||"",u=n&&L(n);return(r[i.toLowerCase()]||u&&r[u])&&(o=a?a(o,e):"*".repeat(o.length)),o}function L(t){return t.toLowerCase()}var F="__rrweb_original__";function N(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?L(e):null}function E(t,e){var r,i;try{i=new URL(t,null!=e?e: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}var D=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,B=/^(?:[a-z+]+:)?\/\//i,U=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function W(t,e){return(t||"").replace(D,((t,r,i,n,s,a)=>{var o,u=i||s||a,l=r||n||"";if(!u)return t;if(B.test(u)||U.test(u))return"url("+l+u+l+")";if(P.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 z,j,q="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",H=4096,G=1,V=new RegExp("[^a-z0-9-_:]"),Z=-2;function J(){return G++}var X=/^[^ \t\n\r\u000c]+/,Y=/^[, \t\n\r\u000c]+/,K=new WeakMap;function Q(t,e){return e&&""!==e.trim()?tt(t,e):e}function tt(t,e){var r=K.get(t);if(r||(r=t.createElement("a"),K.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function et(t,e,r,i,n,s){if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){var a=Q(t,i);if("img"===e&&a.startsWith("data:")&&n){var o=a;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(o=function(t,e,r,i){if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>H||t.naturalHeight>H)return e;try{var n=document.createElement("canvas");n.width=t.naturalWidth,n.height=t.naturalHeight;var s=n.getContext("2d");return s?(s.drawImage(t,0,0),n.toDataURL(r||"image/webp",null!=i?i:.4)):e}catch(t){return e}}(n,a,s.type,s.quality)),(null==s?void 0:s.maxBase64ImageLength)&&(u=o,o=(l=s.maxBase64ImageLength)&&u.length>l?q:u),o}return a}return"xlink:href"===r&&"#"!==i[0]?Q(t,i):"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(Y),e.length>r;){var s=i(X);if(","===s.slice(-1))s=Q(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=Q(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?W(i,tt(t)):"object"===e&&"data"===r?Q(t,i):i:Q(t,i);var u,l}function rt(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function it(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&it(_.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&it(_.parentNode(t),e,r)}function nt(t,e,r,i){var n;if(C(t)){if(!_.childNodes(n=t).length)return!1}else{if(null===_.parentElement(t))return!1;n=_.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(it(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){return Array.from(t.styleSheets).find((t=>t.href===e))}function at(t){return null==t?"":t.toLowerCase()}var ot=50,ut=!1,lt=!1;function ht(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:a,maskTextSelector:o,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:h={},maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:I=(()=>!1),newlyAddedElement:R=!1,depth:O=0,maxDepth:D=ot}=e,{needsMask:B}=e,{preserveWhiteSpace:U=!0}=e;if(O>=D)return lt=!0,ut||(ut=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+D+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;B||(B=nt(t,a,o,void 0===B));var P,q=function(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:a,inlineStylesheet:o,maskInputOptions:u={},maskTextFn:l,maskInputFn:h,dataURLOptions:d={},inlineImages:c,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:m=!1}=e,g=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:f.Document,childNodes:[],compatMode:t.compatMode}:{type:f.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:g};case t.ELEMENT_NODE:return function(t,e){for(var r,i,n,{doc:s,blockClass:a,blockSelector:o,inlineStylesheet:u,maskInputOptions:l={},maskInputFn:h,dataURLOptions:d={},inlineImages:c,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:g}=e,y=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,a,o),b=function(t){if(t instanceof HTMLFormElement)return"form";var e=L(t.tagName);return V.test(e)?"div":e}(t),w={},k=t.attributes.length,S=0;k>S;S++){var I=t.attributes[S];rt(b,I.name)||(w[I.name]=et(s,b,L(I.name),I.value,t,d))}if("link"===b&&u){var C=function(t){return t.href}(t);if(C){var M=st(s,C);!M&&C.includes(".css")&&(M=st(s,window.location.origin+"/"+C.replace(window.location.href,"")));var T=null;M&&(T=x(M)),T&&(delete w.rel,delete w.href,w._cssText=T)}}if("style"===b&&t.sheet&&!(t.innerText||_.textContent(t)||"").trim().length){var R=x(t.sheet);R&&(w._cssText=R)}if("input"===b||"textarea"===b||"select"===b){var O=t.value,E=t.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&O?w.value=A({element:t,type:N(t),tagName:b,value:O,maskInputOptions:l,maskInputFn:h}):E&&(w.checked=E)}if("option"===b&&(t.selected&&!l.select?w.selected=!0:delete w.selected),"dialog"===b&&t.open)try{w.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){w.rr_open_mode="modal",w.ph_rr_could_not_detect_modal=!0}if("canvas"===b&&v)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((F in n?n[F]: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)||(w.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){var D=t.toDataURL(d.type,d.quality),B=s.createElement("canvas");B.width=t.width,B.height=t.height,D!==B.toDataURL(d.type,d.quality)&&(w.rr_dataURL=D)}if("img"===b&&c){z||(z=s.createElement("canvas"),j=z.getContext("2d"));var U=t,P=U.currentSrc||U.getAttribute("src")||"<unknown-src>",W=U.crossOrigin,q=()=>{U.removeEventListener("load",q);try{z.width=U.naturalWidth,z.height=U.naturalHeight,j.drawImage(U,0,0),w.rr_dataURL=z.toDataURL(d.type,d.quality)}catch(t){if("anonymous"!==U.crossOrigin)return U.crossOrigin="anonymous",void(U.complete&&0!==U.naturalWidth?q():U.addEventListener("load",q));console.warn("Cannot inline img src="+P+"! Error: "+t)}"anonymous"===U.crossOrigin&&(W?w.crossOrigin=W:U.removeAttribute("crossorigin"))};U.complete&&0!==U.naturalWidth?q():U.addEventListener("load",q)}if("audio"===b||"video"===b){var H=w;H.rr_mediaState=t.paused?"paused":"played",H.rr_mediaCurrentTime=t.currentTime,H.rr_mediaPlaybackRate=t.playbackRate,H.rr_mediaMuted=t.muted,H.rr_mediaLoop=t.loop,H.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(w.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(w.rr_scrollTop=t.scrollTop)),y){var{width:G,height:Z,left:J,top:X}=t.getBoundingClientRect();w={class:w.class,rr_width:G+"px",rr_height:Z+"px",rr_left:Math.floor(J+((null==(r=s.defaultView)?void 0:r.scrollX)||0))+"px",rr_top:Math.floor(X+((null==(i=s.defaultView)?void 0:i.scrollY)||0))+"px"}}"iframe"!==b||p(w.src)||(t.contentDocument||(w.rr_src=w.src),delete w.src);try{customElements.get(b)&&(n=!0)}catch(t){}return{type:f.Element,tagName:b,attributes:w,childNodes:[],isSVG:(Y=t,Boolean("svg"===Y.tagName||Y.ownerSVGElement)||void 0),needBlock:y,rootId:g,isCustom:n};var Y}(t,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:u,maskInputFn:h,dataURLOptions:d,inlineImages:c,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:m,rootId:g});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:s}=e,a=_.parentNode(t),o=a&&a.tagName,u=_.textContent(t),l="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(l&&u){try{t.nextSibling||t.previousSibling||(null==(r=a.sheet)?void 0:r.cssRules)&&(u=x(a.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=W(u,tt(e.doc))}return h&&(u="SCRIPT_PLACEHOLDER"),!l&&!h&&u&&i&&(u=n?n(u,_.parentElement(t)):u.replace(/[\S]/g,"*")),{type:f.Text,textContent:u||"",isStyle:l,rootId:s}}(t,{doc:r,needsMask:a,maskTextFn:l,rootId:g});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:g};case t.COMMENT_NODE:return{type:f.Comment,textContent:_.textContent(t)||"",rootId:g};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:B,inlineStylesheet:l,maskInputOptions:h,maskTextFn:d,maskInputFn:c,dataURLOptions:p,inlineImages:m,recordCanvas:g,keepIframeSrcFn:I,newlyAddedElement:R});if(!q)return console.warn(t,"not serialized"),null;P=i.hasNode(t)?i.getId(t):!function(t,e){if(e.comment&&t.type===f.Comment)return!0;if(t.type===f.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"===E(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(at(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===at(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(at(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&at(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(at(t.attributes.property).match(/^(og|twitter|fb):/)||at(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===at(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(at(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(at(t.attributes.name))||at(t.attributes.property).match(/^article:/)||at(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(at(t.attributes.name)))return!0}}return!1}(q,v)&&(U||q.type!==f.Text||q.isStyle||q.textContent.replace(/^\s+|\s+$/gm,"").length)?J():Z;var H=Object.assign(q,{id:P});if(i.add(t,H),P===Z)return null;y&&y(t);var G=!u;if(H.type===f.Element){G=G&&!H.needBlock,delete H.needBlock;var X=_.shadowRoot(t);X&&T(X)&&(H.isShadowHost=!0)}if((H.type===f.Document||H.type===f.Element)&&G){v.headWhitespace&&H.type===f.Element&&"head"===H.tagName&&(U=!1);var Y={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:B,maskTextClass:a,maskTextSelector:o,skipChild:u,inlineStylesheet:l,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,preserveWhiteSpace:U,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:k,stylesheetLoadTimeout:S,keepIframeSrcFn:I,depth:O+1,maxDepth:D};if(H.type===f.Element&&"textarea"===H.tagName&&void 0!==H.attributes.value);else for(var K of Array.from(_.childNodes(t))){var Q=ht(K,Y);Q&&H.childNodes.push(Q)}var it=null;if(C(t)&&(it=_.shadowRoot(t)))for(var dt of Array.from(_.childNodes(it))){var ct=ht(dt,Y);ct&&(T(it)&&(ct.isShadow=!0),H.childNodes.push(ct))}}var ft=_.parentNode(t);return ft&&M(ft)&&T(ft)&&(H.isShadow=!0),H.type===f.Element&&"iframe"===H.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var a="about:blank";if(i.location.href!==a||t.src===a||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var o=setTimeout((()=>{s||(e(),s=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),s=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&b){var r=ht(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:B,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,preserveWhiteSpace:U,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:k,stylesheetLoadTimeout:S,keepIframeSrcFn:I,depth:O+1,maxDepth:D});r&&b(t,r)}}),w),H.type===f.Element&&"link"===H.tagName&&"string"==typeof H.attributes.rel&&("stylesheet"===H.attributes.rel||"preload"===H.attributes.rel&&"string"==typeof H.attributes.href&&"css"===E(H.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var s=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(s),n=!0,e()}))}}(t,(()=>{if(k){var e=ht(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:B,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,preserveWhiteSpace:U,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:k,stylesheetLoadTimeout:S,keepIframeSrcFn:I,depth:O,maxDepth:D});e&&k(t,e)}}),S),H}function dt(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 ct{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 ct))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),()=>r.removeEventListener(t,e,i)}function vt(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var pt="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.",mt={map:{},getId(){return console.error(pt),-1},getNode(){return console.error(pt),null},removeNodeFromMap(){console.error(pt)},has(){return console.error(pt),!1},reset(){console.error(pt)}};function gt(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 yt(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){setTimeout((()=>{r.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>yt(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(mt=new Proxy(mt,{get(t,e,r){return"map"===e&&console.error(pt),Reflect.get(t,e,r)}}));var bt=Date.now;function wt(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=_.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=_.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function kt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function St(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function It(t){return t?t.nodeType===t.ELEMENT_NODE?t:_.parentElement(t):null}function _t(t,e,r,i){if(!t)return!1;var n=It(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(it(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 Ct(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===Z}function Mt(t,e){if(M(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=_.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Mt(i,e))}function Tt(t){return Boolean(t.changedTouches)}function xt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Rt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Ot(t){return!!t&&(t instanceof ct&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(_.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(bt=()=>(new Date).getTime());class At{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 Lt(t){var e,r=null;return"getRootNode"in t&&(null==(e=_.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&_.host(_.getRootNode(t))&&(r=_.host(_.getRootNode(t))),r}function Ft(t){var e=t.ownerDocument;return!!e&&(_.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Lt(r);)r=e;return r}(t);return _.contains(e,r)}(t))}function Nt(t){return"__ln"in t}class Et{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&&Nt(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&&Nt(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 Dt,Bt=(t,e)=>t+"@"+e;class Ut{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,"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,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Et,i=t=>{for(var e=t,r=Z;r===Z;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=_.parentNode(n);if(s&&Ft(n)&&"TEXTAREA"!==s.tagName){var a=M(s)?this.mirror.getId(Lt(n)):this.mirror.getId(s),o=i(n);if(-1===a||-1===o)return r.addNode(n);var u=ht(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,inlineImages:this.inlineImages,onSerialize:t=>{xt(t,this.mirror)&&this.iframeManager.addIframe(t),Rt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Ot(n)&&this.shadowDomManager.addShadowRoot(_.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},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)Wt(this.removesSubTreeCache,s)&&!this.movedSet.has(_.parentNode(s))||n(s);for(var a of this.addedSet)$t(this.droppedSet,a)||Wt(this.removesSubTreeCache,a)?$t(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(_.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 f=this.mirror.getId(_.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==f){u=c;break}var v=_.parentNode(c.value);if(v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=_.host(v);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=_.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{attributes:e}=t;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(_.childNodes(t),(t=>_.textContent(t)||"")).join("");e.attributes.value=A({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:N(t),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(t=>{if(!Ct(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=_.textContent(t.target);_t(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:nt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,It(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=N(r);n=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(_t(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"),!rt(r.tagName,i))if(a.attributes[i]=et(this.doc,L(r.tagName),L(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.setAttribute("style",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(_t(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=M(t.target)?this.mirror.getId(_.host(t.target)):this.mirror.getId(t.target);_t(t.target,this.blockClass,this.blockSelector,!1)||Ct(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Pt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Mt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Bt(r,i)]?Pt(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!M(t.target)||!T(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),_.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)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Ct(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[Bt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);_t(t,this.blockClass,this.blockSelector,!1)||(_.childNodes(t).forEach((t=>this.genAdds(t))),Ot(t)&&_.childNodes(_.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","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function Pt(t,e){t.delete(e),_.childNodes(e).forEach((e=>Pt(t,e)))}function Wt(t,e,r){return 0!==t.size&&function(t,e,r){var i=_.parentNode(e);return!!i&&t.has(i)}(t,e)}function $t(t,e){return 0!==t.size&&zt(t,e)}function zt(t,e){var r=_.parentNode(e);return!!r&&(!!t.has(r)||zt(t,r))}var jt=t=>Dt?function(){try{return t(...arguments)}catch(t){if(Dt&&!0===Dt(t))return;throw t}}:t,qt=[];function Ht(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 Gt(t,e){var r=new Ut;qt.push(r),r.init(t);var i=new(S())(jt(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{observer:i,buffer:r}}function Vt(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:a}=t;return ft("scroll",jt(gt(jt((t=>{var a=Ht(t);if(a&&!_t(a,n,s,!0)){var o=i.getId(a);if(a===r&&r.defaultView){var u=wt(r.defaultView);e({id:o,x:u.left,y:u.top})}else e({id:o,x:a.scrollLeft,y:a.scrollTop})}})),a.scroll||100)),r)}var Zt=["INPUT","TEXTAREA","SELECT"],Jt=new WeakMap;function Xt(t){return function t(e,r){if(te("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||te("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||te("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||te("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 Yt(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function Kt(t,e){var r,i,n,s,{mirror:a,stylesheetManager:o}=t;s=a.getId("#document"===e.nodeName?e:_.host(e));var u="#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,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&u&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r=null==(e=l.set)?void 0:e.call(this,t);if(null!==s&&-1!==s)try{o.adoptStyleSheets(t,s)}catch(t){}return r}}),jt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function Qt(t,e){void 0===e&&(e={});var i,n,s=t.doc.defaultView;if(!s)return()=>{};if(function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:a,inputCb:o,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:h,canvasMutationCb:d,fontCb:c,selectionCb:f,customElementCb:v}=t;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),f(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),v(...arguments)}}(t,e),t.recordDOM){var a=Gt(t,t.doc);i=a.observer,n=a.buffer}var o=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;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=gt(jt((t=>{var r=Date.now()-s;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],s=null})),o),d=jt(gt(jt((t=>{var e=Ht(t),{clientX:r,clientY:i}=Tt(t)?t.changedTouches[0]:t;s||(s=bt()),l.push({x:r,y:i,id:n.getId(e),timeOffset:bt()-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 jt((()=>{c.forEach((t=>t()))}))}(t),d=function(t){var{mouseInteractionCb:e,doc:i,mirror:n,blockClass:s,blockSelector:a,sampling:o}=t;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=L(t),u=(t=>i=>{var o=Ht(i);if(!_t(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 Tt(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 f=Tt(i)?i.changedTouches[0]:i;if(f){var v=n.getId(o),{clientX:p,clientY:m}=f;jt(e)(r({type:l[d],id:v,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))})),jt((()=>{d.forEach((t=>t()))}))}(t),f=Vt(t),v=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,s=-1;return ft("resize",jt(gt(jt((()=>{var t=kt(),e=St();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:s}),p=function(t){var{inputCb:e,doc:i,mirror:n,blockClass:s,blockSelector:a,ignoreClass:o,ignoreSelector:u,maskInputOptions:l,maskInputFn:h,sampling:d,userTriggeredOnInput:c}=t;function f(t){var e=Ht(t),r=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=_.parentElement(e)),e&&n&&Zt.indexOf(n)>=0&&!_t(e,s,a,!0)&&!(e.classList.contains(o)||u&&e.matches(u))){var d=e.value,f=!1,p=N(e)||"";"radio"===p||"checkbox"===p?f=e.checked:(l[n.toLowerCase()]||l[p])&&(d=A({element:e,maskInputOptions:l,tagName:n,type:p,value:d,maskInputFn:h})),v(e,c?{text:d,isChecked:f,userTriggered:r}:{text:d,isChecked:f});var m=e.name;"radio"===p&&m&&f&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,c?{text:r,isChecked:!f,userTriggered:!1}:{text:r,isChecked:!f})}}))}}function v(t,i){var s=Jt.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){Jt.set(t,i);var a=n.getId(t);jt(e)(r({},i,{id:a}))}}var p=("last"===d.input?["change"]:["input","change"]).map((t=>ft(t,jt(f),i))),m=i.defaultView;if(!m)return()=>{p.forEach((t=>t()))};var g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value");return g&&g.set&&p.push(...[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]].map((t=>yt(t[0],t[1],{set(){jt(f)({target:this,isTrusted:!1})}},!1,m)))),jt((()=>{p.forEach((t=>t()))}))}(t),m=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:a}=t,o=jt((t=>gt(jt((s=>{var a=Ht(s);if(a&&!_t(a,r,i,!0)){var{currentTime:o,volume:u,muted:l,playbackRate:h,loop:d}=a;e({type:t,id:n.getId(a),currentTime:o,volume:u,muted:l,playbackRate:h,loop:d})}})),s.media||500))),u=[ft("play",o(c.Play),a),ft("pause",o(c.Pause),a),ft("seeked",o(c.Seeked),a),ft("volumechange",o(c.VolumeChange),a),ft("ratechange",o(c.RateChange),a)];return jt((()=>{u.forEach((t=>t()))}))}(t),g=()=>{},y=()=>{},b=()=>{},w=()=>{};t.recordDOM&&(g=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:s}=e;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var a=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:jt(((t,e,s)=>{var[a,o]=s,{id:u,styleId:l}=Yt(e,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,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:jt(((t,e,s)=>{var[a]=s,{id:o,styleId:u}=Yt(e,i,n.styleMirror);return(o&&-1!==o||u&&-1!==u)&&r({id:o,styleId:u,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:jt(((t,e,s)=>{var[a]=s,{id:o,styleId:u}=Yt(e,i,n.styleMirror);return(o&&-1!==o||u&&-1!==u)&&r({id:o,styleId:u,replace:a}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:jt(((t,e,s)=>{var[a]=s,{id:o,styleId:u}=Yt(e,i,n.styleMirror);return(o&&-1!==o||u&&-1!==u)&&r({id:o,styleId:u,replaceSync:a}),t.apply(e,s)}))}));var h={};ee("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(ee("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),ee("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),ee("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((t=>{var[e,s]=t;d[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[e].insertRule,{apply:jt(((t,e,s)=>{var[a,o]=s,{id:u,styleId:l}=Yt(e.parentStyleSheet,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:a,index:[...Xt(e),o||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:jt(((t,e,s)=>{var[a]=s,{id:o,styleId:u}=Yt(e.parentStyleSheet,i,n.styleMirror);return(o&&-1!==o||u&&-1!==u)&&r({id:o,styleId:u,removes:[{index:[...Xt(e),a]}]}),t.apply(e,s)}))})})),jt((()=>{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,r]=t;r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:s}),y=Kt(t,t.doc),b=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=t,{win:a}=e,o=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:jt(((t,e,a)=>{var u,[l,h,d]=a;if(n.has(l))return o.apply(e,[l,h,d]);var{id:c,styleId:f}=Yt(null==(u=e.parentRule)?void 0:u.parentStyleSheet,i,s.styleMirror);return(c&&-1!==c||f&&-1!==f)&&r({id:c,styleId:f,set:{property:l,value:h,priority:d},index:Xt(e.parentRule)}),t.apply(e,a)}))});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:jt(((t,e,a)=>{var o,[l]=a;if(n.has(l))return u.apply(e,[l]);var{id:h,styleId:d}=Yt(null==(o=e.parentRule)?void 0:o.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||d&&-1!==d)&&r({id:h,styleId:d,remove:{property:l},index:Xt(e.parentRule)}),t.apply(e,a)}))}),jt((()=>{a.CSSStyleDeclaration.prototype.setProperty=o,a.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:s}),t.collectFonts&&(w=function(t){var{fontCb:e,doc:r}=t,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(jt((()=>{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),jt((()=>{n.forEach((t=>t()))}))}(t)));var k=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=t,a=!0,o=jt((()=>{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),{startContainer:d,startOffset:c,endContainer:f,endOffset:v}=h;_t(d,i,n,!0)||_t(f,i,n,!0)||o.push({start:r.getId(d),startOffset:c,end:r.getId(f),endOffset:v})}s({ranges:o})}}));return o(),ft("selectionchange",o)}(t),S=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?I(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),C=[];for(var M of t.plugins)C.push(M.observer(M.callback,s,M.options));return jt((()=>{if(n){n.destroy(),n.reset();var t=qt.indexOf(n);-1!==t&&qt.splice(t,1)}null==i||i.disconnect(),o(),d(),f(),v(),p(),m(),g(),y(),b(),w(),k(),S(),C.forEach((t=>t()))}))}function te(t){return void 0!==window[t]}function ee(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class re{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 ie{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new re(J)),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,"attachedIframes",new Map),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new re(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)}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);this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var n=t.contentWindow;if(this.recordCrossOriginIframes&&n&&!this.nestedIframeListeners.has(n)){var s=this.handleMessage.bind(this);vt((()=>{n.addEventListener("message",s),this.nestedIframeListeners.set(n,s)}))}vt((()=>{var e;return null==(e=t.contentWindow)?void 0:e.addEventListener("pagehide",(()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)}))})),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===f.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.mirror.getNode(t);if(r){var i=r.contentWindow;if(i&&this.nestedIframeListeners.has(i)){var n=this.nestedIframeListeners.get(i);vt((()=>i.removeEventListener("message",n))),this.nestedIframeListeners.delete(i)}i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r)}e&&this.attachedIframes.delete(t)}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var{content:r}=t;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&&window.removeEventListener("message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{vt((()=>e.removeEventListener("message",t)))})),this.nestedIframeListeners.clear(),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap}}class ne{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){if(T(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var{observer:i,buffer:n}=Gt(r({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>{i.disconnect(),n.destroy();var t=qt.indexOf(n);-1!==t&&qt.splice(t,1)})),this.restoreHandlers.push(Vt(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(_.host(t))),this.restoreHandlers.push(Kt({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(I(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=_.shadowRoot(this);return s&&Ft(this)&&r.addShadowRoot(s,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var se="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ae="undefined"==typeof Uint8Array?[]:new Uint8Array(256),oe=0;64>oe;oe++)ae[se.charCodeAt(oe)]=oe;var ue=new Map,le=(t,e,r)=>{if(t&&(ce(t,e)||"object"==typeof t)){var i=function(t,e){var r=ue.get(t);return r||ue.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 he(t,e,r,i){if(t instanceof Array)return t.map((t=>he(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+=se[r[e]>>2],n+=se[(3&r[e])<<4|r[e+1]>>4],n+=se[(15&r[e+1])<<2|r[e+2]>>6],n+=se[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}}if(t instanceof DataView)return{rr_type:t.constructor.name,args:[he(t.buffer,e,r,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var a=t.constructor.name,{src:o}=t;return{rr_type:a,src:o}}return t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[he(t.data,e,r,i),t.width,t.height]}:ce(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:le(t,e,r)}:t}var de=(t,e,r,i)=>t.map((t=>he(t,e,r,i))),ce=(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])))},fe=["webgl","webgl2"];function ve(t){return"nodeType"in t}function pe(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{canvas:e}=t;return e&&"object"==typeof e?e:null}(this);if(!a||ve(a)&&_t(a,e,i,!0))return n.call(this,s);ve(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(!_t(this,e,i,!0)&&("__context"in this||(this.__context=s),n&&fe.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 me(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(le(d,s,this),"tagName"in this.canvas&&!_t(this.canvas,i,n,!0)){var c=de(l,s,this,a);r(this.canvas,{type:e,property:u,args:c})}return d}}));o.push(l)}catch(i){var h=yt(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 ge,ye,be,we='(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 transparentBlobMap = /* @__PURE__ */ new Map();\n function fnv1aHash(buffer) {\n const view = new Uint8Array(buffer);\n let hash = 2166136261;\n for (let i2 = 0; i2 < view.length; i2++) {\n hash ^= view[i2];\n hash = hash * 16777619 | 0;\n }\n return (hash >>> 0).toString(16);\n }\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n try {\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d");\n }\n reusableCtx.clearRect(0, 0, width, height);\n reusableCtx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const fingerprint = fnv1aHash(arrayBuffer);\n if (!lastFingerprintMap.has(id)) {\n const base642 = encode(arrayBuffer);\n if (await transparentBase64 === base642) {\n lastFingerprintMap.set(id, fingerprint);\n return worker.postMessage({ id });\n }\n lastFingerprintMap.set(id, fingerprint);\n worker.postMessage({ id, type, base64: base642, width, height });\n return;\n }\n if (lastFingerprintMap.get(id) === fingerprint)\n return worker.postMessage({ id });\n const base64 = encode(arrayBuffer);\n worker.postMessage({ id, type, base64, width, height });\n lastFingerprintMap.set(id, fingerprint);\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//# sourceMappingURL=image-bitmap-data-url-worker-Ca9A-vl6.js.map\n',ke="undefined"!=typeof self&&self.Blob&&new Blob([we],{type:"text/javascript;charset=utf-8"});function Se(t){var e;try{if(!(e=ke&&(self.URL||self.webkitURL).createObjectURL(ke)))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(we),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Ie{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,"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{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:s,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(r,i,n,o),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:o})}reset(){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=pe(r,i,n,!0),u=new Map,l=new Se;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:s}=t.data;this.mutationCb({id:e,type:d["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}],displayWidth:n,displayHeight:s})}};var h,c=1e3/t,f=0,v=t=>{var o,d;f&&c>t-f||(f=t,(o=[],d=t=>{t.querySelectorAll("canvas").forEach((t=>{_t(t,i,n,!0)||o.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&d(t.shadowRoot)}))},d(r.document),o).forEach(function(){var t=e((function*(t){var e,r=a.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){u.set(r,!0);try{if(["webgl","webgl2"].includes(t.__context)){var i=t.getContext(t.__context);!1===(null==(e=null==i?void 0:i.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=t.clientWidth||t.width,o=t.clientHeight||t.height,h=yield createImageBitmap(t,{resizeWidth:n,resizeHeight:o});l.postMessage({id:r,bitmap:h,width:n,height:o,dataURLOptions:s.dataURLOptions},[h])}catch(t){u.set(r,!1)}}}));return function(e){return t.apply(this,arguments)}}())),h=requestAnimationFrame(v)};h=requestAnimationFrame(v),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=pe(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 _t(this.canvas,r,i,!0)||setTimeout((()=>{var r=de(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=yt(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(...me(e.WebGLRenderingContext.prototype,d.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...me(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))),{type:s}=r[0];this.mutationCb({id:e,type:s,commands:i}),this.pendingCanvasMutations.delete(t)}}}}class _e{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new At),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)}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:R(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}trackStylesheetInLinkElement(t){}}class Ce{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 Me=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Te=document.createElement("iframe");document.body.appendChild(Te),Array.from=(null==(i=Te.contentWindow)?void 0:i.Array.from)||Array.from,document.body.removeChild(Te)}}catch(t){console.debug("Unable to override Array.from",t)}var xe=new O;function Re(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:a=null,ignoreClass:l="rr-ignore",ignoreSelector:h=null,maskTextClass:d="rr-mask",maskTextSelector:c=null,inlineStylesheet:f=!0,maskAllInputs:v,maskInputOptions:p,slimDOMOptions:m,maskInputFn:g,maskTextFn:y,hooks:b,packFn:w,sampling:k={},dataURLOptions:S={},mousemoveWait:I,recordDOM:C=!0,recordCanvas:M=!1,recordCrossOriginIframes:T=!1,recordAfter:x=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:R=!1,collectFonts:A=!1,inlineImages:L=!1,plugins:F,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:E=new Set([]),errorHandler:D}=t;Dt=D;var B=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},S),U=!T||window.parent===window,P=!1;if(!U)try{window.parent.document&&(P=!1)}catch(t){P=!0}if(U&&!e)throw new Error("emit function is required");if(!U&&!P)return()=>{};void 0!==I&&void 0===k.mousemove&&(k.mousemove=I),xe.reset();var W,z=!0===v?{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!==p?p:{password:!0},j=dt(void 0!==m&&m);!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 q=0,H=new Map,G=t=>{for(var e of F||[])e.eventProcessor&&(t=e.eventProcessor(t));return w&&!P&&(t=w(t)),t};ge=(t,r)=>{var s,a=t;if(a.timestamp=bt(),!(null==(s=qt[0])?void 0:s.isFrozen())||a.type===o.FullSnapshot||a.type===o.IncrementalSnapshot&&a.data.source===u.Mutation||qt.forEach((t=>t.unfreeze())),U)null==e||e(G(a),r);else if(P){var l={type:"rrweb",event:G(a),origin:window.location.origin,isCheckout:r};window.parent.postMessage(l,"*")}if(a.type===o.FullSnapshot)W=a,q=0;else if(a.type===o.IncrementalSnapshot){if(a.data.source===u.Mutation&&a.data.isAttachIframe)return;q++,(n&&q>=n||i&&a.timestamp-W.timestamp>i)&&ye(!0)}};var V=t=>{if(T&&t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null;t.removes.forEach((t=>{var{id:r}=t;if(!e||!e.has(r)){var i=H.get(r);i&&(i(),H.delete(r)),Y.removeIframeById(r)}})),function(){for(var[t,e]of H){var r=xe.getNode(t);if(r)try{r.contentDocument&&r.contentDocument.defaultView||(e(),H.delete(t))}catch(r){e(),H.delete(t)}else e(),H.delete(t)}}()}ge({type:o.IncrementalSnapshot,data:r({source:u.Mutation},t)})},Z=t=>ge({type:o.IncrementalSnapshot,data:r({source:u.Scroll},t)}),J=t=>ge({type:o.IncrementalSnapshot,data:r({source:u.CanvasMutation},t)}),X=new _e({mutationCb:V,adoptedStyleSheetCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},t)})}),Y=new ie({mirror:xe,mutationCb:V,stylesheetManager:X,recordCrossOriginIframes:T,wrappedEmit:ge});for(var K of F||[])K.getMirror&&K.getMirror({nodeMirror:xe,crossOriginIframeMirror:Y.crossOriginIframeMirror,crossOriginIframeStyleMirror:Y.crossOriginIframeStyleMirror});var Q=new Ce;be=new Ie({recordCanvas:M,mutationCb:J,win:window,blockClass:s,blockSelector:a,mirror:xe,sampling:k.canvas,dataURLOptions:B});var tt=new ne({mutationCb:V,scrollCb:Z,bypassOptions:{blockClass:s,blockSelector:a,maskTextClass:d,maskTextSelector:c,inlineStylesheet:f,maskInputOptions:z,dataURLOptions:B,maskTextFn:y,maskInputFn:g,recordCanvas:M,inlineImages:L,sampling:k,slimDOMOptions:j,iframeManager:Y,stylesheetManager:X,canvasManager:be,keepIframeSrcFn:N,processedNodeManager:Q},mirror:xe});ye=function(t){if(void 0===t&&(t=!1),C){ge({type:o.Meta,data:{href:window.location.href,width:St(),height:kt()}},t),X.reset(),tt.init(),qt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new O,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:a=null,inlineStylesheet:o=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:h=!1,maskTextFn:d,maskInputFn:c,slimDOM:f=!1,dataURLOptions:v,preserveWhiteSpace:p,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k=(()=>!1),maxDepth:S}=e||{};return ht(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:o,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:dt(f),dataURLOptions:v,inlineImages:u,recordCanvas:l,preserveWhiteSpace:p,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k,newlyAddedElement:!1,maxDepth:S})}(document,{mirror:xe,blockClass:s,blockSelector:a,maskTextClass:d,maskTextSelector:c,inlineStylesheet:f,maskAllInputs:z,maskTextFn:y,maskInputFn:g,slimDOM:j,dataURLOptions:B,recordCanvas:M,inlineImages:L,onSerialize(t){xt(t,xe)&&Y.addIframe(t),Rt(t,xe)&&X.trackLinkElement(t),Ot(t)&&tt.addShadowRoot(_.shadowRoot(t),document)},onIframeLoad(t,e){Y.attachIframe(t,e),tt.observeAttachShadow(t)},onStylesheetLoad(t,e){X.attachLinkElement(t,e)},keepIframeSrcFn:N});if(!e)return console.warn("Failed to snapshot the document");ge({type:o.FullSnapshot,data:{node:e,initialOffset:wt(window)}},t),qt.forEach((t=>t.unlock())),T&&Y.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&X.adoptStyleSheets(document.adoptedStyleSheets,xe.getId(document))}};try{var et=[],rt=t=>{var e;return jt(Qt)({mutationCb:V,mousemoveCb:(t,e)=>ge({type:o.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.MouseInteraction},t)}),scrollCb:Z,viewportResizeCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.ViewportResize},t)}),inputCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.Input},t)}),mediaInteractionCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.MediaInteraction},t)}),styleSheetRuleCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.StyleSheetRule},t)}),styleDeclarationCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.StyleDeclaration},t)}),canvasMutationCb:J,fontCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.Font},t)}),selectionCb(t){ge({type:o.IncrementalSnapshot,data:r({source:u.Selection},t)})},customElementCb(t){ge({type:o.IncrementalSnapshot,data:r({source:u.CustomElement},t)})},blockClass:s,ignoreClass:l,ignoreSelector:h,maskTextClass:d,maskTextSelector:c,maskInputOptions:z,inlineStylesheet:f,sampling:k,recordDOM:C,recordCanvas:M,inlineImages:L,userTriggeredOnInput:R,collectFonts:A,doc:t,maskInputFn:g,maskTextFn:y,keepIframeSrcFn:N,blockSelector:a,slimDOMOptions:j,dataURLOptions:B,mirror:xe,iframeManager:Y,stylesheetManager:X,shadowDomManager:tt,processedNodeManager:Q,canvasManager:be,ignoreCSSAttributes:E,plugins:(null==(e=null==F?void 0:F.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ge({type:o.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},b)};Y.addLoadListener((t=>{try{var e=xe.getId(t),r=rt(t.contentDocument);et.push(r),-1!==e&&H.set(e,r)}catch(t){console.warn(t)}})),Y.addPageHideListener((t=>{var e=xe.getId(t),r=H.get(e);r&&(r(),H.delete(e)),function(t){for(var e=qt.length-1;e>=0;e--){var r=qt[e];r.bufferBelongsToIframe(t)&&(r.reset(),qt.splice(e,1))}}(t)}));var it=()=>{ye(),et.push(rt(document)),Me=!0};return["interactive","complete"].includes(document.readyState)?it():(et.push(ft("DOMContentLoaded",(()=>{ge({type:o.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&it()}))),et.push(ft("load",(()=>{ge({type:o.Load,data:{}}),"load"===x&&it()}),window))),()=>{et.forEach((t=>vt(t))),Q.destroy(),Y.removeLoadListener(),Y.destroy(),H.clear(),xe.reset(),Me=!1,Dt=void 0}}catch(t){console.warn(t)}}Re.addCustomEvent=(t,e)=>{if(!Me)throw new Error("please add custom event after start recording");ge({type:o.Custom,data:{tag:t,payload:e}})},Re.freezePage=()=>{qt.forEach((t=>t.freeze()))},Re.takeFullSnapshot=t=>{if(!Me)throw new Error("please take full snapshot after start recording");ye(t)},Re.mirror=xe;var Oe=Object.defineProperty,Ae=(t,e,r)=>((t,e,r)=>e in t?Oe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class Le{constructor(t){Ae(this,"fileName"),Ae(this,"functionName"),Ae(this,"lineNumber"),Ae(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 Fe=/(^|@)\S+:\d+/,Ne=/^\s*at .*(\S+:\d+|\(native\))/m,Ee=/^(eval@)?(\[native code])?$/,De={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Ne)?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(Ne)}),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 Le({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Ee)}),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 Le({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Le({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 Le({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 Le({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(Fe)&&!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 Le({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Be(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 Ue(t){return Array.isArray(t)}function Pe(t){return"object"==typeof t&&null!==t&&!Ue(t)}function We(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Pe(t[i])&&We(t[i],e-1))return!0;return!1}function $e(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(Pe(a=e)&&Object.keys(a).length>r.numOfKeysLimit||"function"==typeof a||Pe(a)&&We(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]=Ue(l)?Be(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 ze={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 je(t,e,r){var i,n=r?Object.assign({},ze,r):ze,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=De.parse(e.error).map((t=>t.toString())),s=[$e(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=[$e("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[$e("Uncaught (in promise)",n.stringifyOptions),$e(e.reason,n.stringifyOptions)]);var s=De.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=(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=De.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?u.slice(1):u).map((t=>$e(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:r,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[$e("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{o=!1}}})(l);return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:l}})),e[s]=h,()=>{e[s]=l}}catch(t){return()=>{}}}(e,r):()=>{}}}var qe="undefined"!=typeof window?window:void 0,He="undefined"!=typeof globalThis?globalThis:qe;"undefined"==typeof self&&(He.self=He),"undefined"==typeof File&&(He.File=function(){});var Ge=null==He?void 0:He.document;null!=He&&He.XMLHttpRequest&&new He.XMLHttpRequest;var Ve=null!=qe?qe:{},Ze=Object.prototype,Je=Ze.hasOwnProperty,Xe=Ze.toString,Ye=Array.isArray||function(t){return"[object Array]"===Xe.call(t)},Ke=t=>"function"==typeof t,Qe=t=>t===Object(t)&&!Ye(t),tr=t=>void 0===t,er=t=>"[object String]"==Xe.call(t),rr=t=>null===t,ir=t=>tr(t)||rr(t),nr=t=>"[object Number]"==Xe.call(t)&&t==t,sr=t=>"[object Boolean]"===Xe.call(t),ar=t=>t instanceof FormData;function or(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),nr(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),or(n||r,e,r,i))}class ur{constructor(t){this.$t={},this.zt=t.zt,this.Ut=or(t.bucketSize,0,100,t.Yt),this.Wt=or(t.refillRate,0,this.Ut,t.Yt),this.Gt=or(t.refillInterval,0,864e5,t.Yt)}Xt(t,e){var r=Math.floor((e-t.lastAccess)/this.Gt);r>0&&(t.tokens=Math.min(t.tokens+r*this.Wt,this.Ut),t.lastAccess=t.lastAccess+r*this.Gt)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.$t[i];return n?this.Xt(n,r):this.$t[i]=n={tokens:this.Ut,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.zt)||e.call(this,t)),0===n.tokens)}stop(){this.$t={}}}var lr=t=>t instanceof Document,hr="1.372.1",dr="web",cr=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={C(e){if(qe&&(Ve.POSTHOG_DEBUG||r)&&!tr(qe.console)&&qe.console){for(var i=("__rrweb_original__"in qe.console[e]?qe.console[e].__rrweb_original__:qe.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)}},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.C("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.C("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.C("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)=>cr(t+" "+e,r)};return i},fr=cr("[PostHog.js]"),vr=fr.createLogger;function pr(t,e){if(!ir(t))if(Ye(t))t.forEach(e);else if(ar(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)Je.call(t,r)&&e(t[r],r)}function mr(t,e,r,i){var{capture:n=!1,passive:s=!0}={};null==t||t.addEventListener(e,r,{capture:n,passive:s})}var gr=["localhost","127.0.0.1"],yr=t=>{var e=null==Ge?void 0:Ge.createElement("a");return tr(e)?null:(e.href=t,e)},br=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return pr(t,(function(t,e){tr(t)||tr(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)};function wr(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return Ke(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function kr(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}var Sr="$session_recording_remote_config",Ir="$replay_override_sampling",_r="$replay_override_linked_flag",Cr="$replay_override_url_trigger",Mr="$replay_override_event_trigger",Tr="$session_is_sampled",xr="$session_past_minimum_duration",Rr="$session_recording_url_trigger_activated_session",Or="$session_recording_event_trigger_activated_session",Ar="$posthog_sr_group_event_trigger_",Lr="$posthog_sr_group_url_trigger_",Fr="$posthog_sr_group_sampling_",Nr="$debug_first_full_snapshot_timestamp",Er="$stored_person_properties",Dr="$sdk_debug_replay_remote_trigger_matching_config",Br=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})"),Ur=new RegExp("(\\d{3}-?\\d{2}-?\\d{4})"),Pr="[SessionRecording]",Wr="redacted",$r={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:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},zr=["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"],jr=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],qr=["/s/","/e/","/i/"];function Hr(t,e,r,i){if(ir(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return er(n)&&(n=parseInt(n)),n>r?Pr+" "+i+" body too large to record ("+n+" bytes)":t}function Gr(t,e){if(ir(t))return t;var r=t;return function(t,e){if(ir(t))return!1;if(er(t)){if(t=t.trim(),Br.test((t||"").replace(/[- ]/g,"")))return!1;if(Ur.test(t))return!1}return!0}(r)||(r=Pr+" "+e+" body "+Wr),pr(jr,(t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r=Pr+" "+e+" body "+Wr+" as might contain: "+t)})),r}var Vr=vr("[Recorder]"),Zr=t=>"navigation"===t.entryType,Jr=t=>"resource"===t.entryType;function Xr(t,e){return!!e&&(sr(e)||e[t])}function Yr(t){var{type:e,recordBody:r,headers:i,url:n}=t;function s(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.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(sr(r))return!0;if(Ye(r))return s(r);var a=r[e];return sr(a)?a:s(a)}function Kr(t,e,r,i,n,s){return Qr.apply(this,arguments)}function Qr(){return Qr=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return Vr.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(Jr(a=t[s])&&a.initiatorType===e&&(tr(i)||a.startTime>=i)&&(tr(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(r));return a||(yield new Promise((t=>setTimeout(t,50*s))),Kr(t,e,r,i,n,s+1))})),Qr.apply(this,arguments)}function ti(t){var{body:e,options:r,url:i}=t;if(ir(e))return null;var{hostname:n,isHostDenied:s}=kr(i,r);if(s)return n+" is in deny list";if(er(e))return e;if(lr(e))return e.textContent;if(ar(e))return br(e);if(Qe(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=>!rr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ri(t){var{entry:e,method:i,status:n,networkRequest:s,isInitial:a,start:o,end:u,url:l,initiatorType:h}=t;o=e?e.startTime:o,u=e?e.responseEnd:u;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(o||0)),f=[r({},e?e.toJSON():{name:l},{startTime:tr(o)?void 0:Math.round(o),endTime:tr(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 v of e.serverTiming||[])f.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return f}var ii=["video/","audio/"];function ni(t){return new Promise((e=>{var r=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>e("[SessionReplay] Failed to read body: "+t))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e("[SessionReplay] Failed to read body")}}))}function si(){return(si=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:s}=kr(i,r);return s?Promise.resolve(n+" is in deny list"):ni(e)}))).apply(this,arguments)}function ai(){return(ai=e((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;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=ii.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var{hostname:o,isHostDenied:u}=kr(n,i);return u?o+" is in deny list":null}({r:e,options:r,url:i});return rr(n)?ni(e):Promise.resolve(n)}))).apply(this,arguments)}var oi=null;function ui(t,i,n){if(!("performance"in i))return()=>{};if(oi)return Vr.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},$r,n):$r,a=e=>{var i=[];e.requests.forEach((t=>{var e=s.maskRequestFn(t);e&&i.push(e)})),i.length>0&&t(r({},e,{requests:i}))},o=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Zr(t)||Jr(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>ri({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=>Zr(t)||Jr(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>ri({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=Xr("request",r.recordHeaders),n=Xr("response",r.recordHeaders),s=wr(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,u,l,h){void 0===u&&(u=!0);var d,c,f=this,v=new Request(o),p={},m={},g=f.setRequestHeader.bind(f);f.setRequestHeader=(t,e)=>(m[t]=e,g(t,e)),i&&(p.requestHeaders=m);var y=f.send.bind(f);f.send=t=>(Yr({type:"request",headers:m,url:o,recordBody:r.recordBody})&&(p.requestBody=ti({body:t,options:r,url:o})),d=e.performance.now(),y(t));var b=()=>{f.removeEventListener("readystatechange",w),f.removeEventListener("error",b),f.removeEventListener("abort",b),f.removeEventListener("timeout",b)},w=()=>{if(f.readyState===f.DONE){b(),c=e.performance.now();var i={};f.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),Yr({type:"response",headers:i,url:o,recordBody:r.recordBody})&&(p.responseBody=ti({body:f.response,options:r,url:o})),Kr(e,"xmlhttprequest",v.url,d,c).then((e=>{var r=ri({entry:e,method:a,status:null==f?void 0:f.status,networkRequest:p,start:d,end:c,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};f.addEventListener("readystatechange",w),f.addEventListener("error",b),f.addEventListener("abort",b),f.addEventListener("timeout",b),s.call(f,a,o.toString(),u,l,h)}));return()=>{s()}}(a,i,s),l=function(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Xr("request",i.recordHeaders),s=Xr("response",i.recordHeaders),a=wr(r,"fetch",(a=>function(){var o=e((function*(e,o){var u,l,h,d=new Request(e,o),c={};try{var f={};d.headers.forEach(((t,e)=>{f[e]=t})),n&&(c.requestHeaders=f),Yr({type:"request",headers:f,url:e,recordBody:i.recordBody})&&(c.requestBody=yield function(t){return si.apply(this,arguments)}({r:d,options:i,url:e})),l=r.performance.now(),u=yield a(d),h=r.performance.now();var v={};return u.headers.forEach(((t,e)=>{v[e]=t})),s&&(c.responseHeaders=v),Yr({type:"response",headers:v,url:e,recordBody:i.recordBody})&&(c.responseBody=yield function(t){return ai.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{Kr(r,"fetch",d.url,l,h).then((e=>{var r,i=ri({entry:e,method:d.method,status:null==(r=u)?void 0:r.status,networkRequest:c,start:l,end:h,url:d.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return o.apply(this,arguments)}}()));return()=>{a()}}(a,i,s)),oi=()=>{o(),u(),l(),oi=null}}var li={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},hi="disabled",di="sampled",ci="active",fi="buffering",vi="paused",pi="rrweb_error",mi="trigger",gi=mi+"_activated",yi=mi+"_pending",bi=mi+"_"+hi;function wi(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 ki{constructor(t){this.t=t}triggerStatus(t){var e=this.t.map((e=>e.triggerStatus(t)));return e.includes(gi)?gi:e.includes(yi)?yi:bi}stop(){this.t.forEach((t=>t.stop()))}}class Si{constructor(t){this.t=t}triggerStatus(t){var e=new Set;for(var r of this.t)e.add(r.triggerStatus(t));switch(e.delete(bi),e.size){case 0:return bi;case 1:return Array.from(e)[0];default:return yi}}stop(){this.t.forEach((t=>t.stop()))}}class Ii{triggerStatus(){return gi}stop(){}}var _i=t=>"sessionRecording"in t;class Ci{constructor(t,e){this.u=[],this.Aa=[],this.Na=new Map,this.Ma=new Map,this.Fa="",this.urlBlocked=!1,this._instance=t,this.Ba=e}onConfig(t){var e,r;this.u=(_i(t)?Qe(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.Aa=(_i(t)?Qe(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Oa()}Oa(){for(var t of(this.Na.clear(),this.Ma.clear(),this.u))if("regex"===t.matching&&!this.Na.has(t.url))try{this.Na.set(t.url,new RegExp(t.url))}catch(e){fr.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.Aa)if("regex"===e.matching&&!this.Ma.has(e.url))try{this.Ma.set(e.url,new RegExp(e.url))}catch(t){fr.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}Za(t){var e;return 0===this.u.length?bi:(null==(e=this._instance)?void 0:e.get_property(this.Ba?Lr+this.Ba:Rr))===t?gi:yi}triggerStatus(t){var e=this.Za(t),r=e===gi?gi:e===yi?yi:bi;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:r}),r}checkUrlBlocklist(t,e){if(void 0!==qe&&qe.location.href){var r=qe.location.href;if(r!==this.Fa){this.Fa=r;var i=this.urlBlocked,n=wi(r,this.Aa,this.Ma);i&&n||(n&&!i?t():!n&&i&&e())}}}checkUrlTriggerConditions(t,e,r,i){if(void 0!==qe&&qe.location.href){var n=qe.location.href;if(n!==this.Fa){this.Fa=n;var s=this.urlBlocked,a=wi(n,this.Aa,this.Ma);a&&!s?t():!a&&s&&e();var o=this.Za(i)===gi,u=wi(n,this.u,this.Na);!o&&u&&r("url",n)}}}stop(){this.Fa=""}}class Mi{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Ya=()=>{},this._instance=t}triggerStatus(){var t=yi;return ir(this.linkedFlag)&&(t=bi),this.linkedFlagSeen&&(t=gi),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}onConfig(t,e){var r;if(this.linkedFlag=(_i(t)?Qe(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!ir(this.linkedFlag)&&!this.linkedFlagSeen){var i=er(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=er(this.linkedFlag)?null:this.linkedFlag.variant;this.Ya=this._instance.onFeatureFlags(((t,r)=>{var s=!1;if(Qe(r)&&i in r){var a=r[i];s=sr(a)?!0===a:n?a===n:!!a}this.linkedFlagSeen=s,s&&e(i,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.Ya()}}class Ti{constructor(t,e){this.Ga=[],this._instance=t,this.Ba=e}onConfig(t){var e;this.Ga=(_i(t)?Qe(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}La(t){var e;return 0===this.Ga.length?bi:(null==(e=this._instance)?void 0:e.get_property(this.Ba?Ar+this.Ba:Or))===t?gi:yi}triggerStatus(t){var e=this.La(t),r=e===gi?gi:e===yi?yi:bi;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:r}),r}checkEventTriggerConditions(t,e,r){if(0!==this.Ga.length){var i=this.La(r)===gi,n=this.Ga.includes(t);!i&&n&&e("event",t)}}stop(){}}class xi{constructor(t,e,r){if(this._instance=t,this.group=e,this.Da=new Ci(t,e.id),this.Wa=new Ti(t,e.id),this.Va=new Mi(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.Da.onConfig(n),this.Wa.onConfig(n),this.Va.onConfig(n,r);var s=[this.Wa,this.Da,this.Va];this.Xa="any"===e.conditions.matchType?new ki(s):new Si(s)}else this.Xa=new Ii}triggerStatus(t){return this.Xa.triggerStatus(t)}checkEventTriggerConditions(t,e,r){this.Wa.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.Da.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r;null==(r=this._instance.persistence)||r.register({["url"===t?Lr+this.group.id:Ar+this.group.id]:e})}stop(){this.Da.stop(),this.Wa.stop(),this.Va.stop()}}function Ri(t){if(t.rrwebError)return pi;if(!t.receivedFlags)return fi;if(!t.isRecordingEnabled)return hi;if(t.urlTriggerMatching.urlBlocked)return vi;var e=!0===t.isSampled,r=new ki([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?di:r===gi?ci:r===yi?fi:!1===t.isSampled?hi:ci}function Oi(t){if(t.rrwebError)return pi;if(!t.receivedFlags)return fi;if(!t.isRecordingEnabled)return hi;if(t.urlTriggerMatching.urlBlocked)return vi;var e=new Si([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==bi,i=sr(t.isSampled);return r&&e===yi?fi:r&&e===bi||i&&!t.isSampled?hi:!0===t.isSampled?di:ci}function Ai(t){var e,r;return(null==(e=JSON.stringify(t,(r=[],function(t,e){if(Qe(e)){for(;r.length>0&&r[r.length-1]!==this;)r.pop();return r.includes(e)?"[Circular]":(r.push(e),e)}return e})))?void 0:e.length)||0}function Li(t){if(rr(t))return 4;if(tr(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(Ye(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=tr(i)||rr(i)?4:Li(i)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var u=n[o];tr(u)||(a||(s+=1),a=!1,s+=o.length+3+Li(u))}return s;default:return 0}}var Fi=Uint8Array,Ni=Uint16Array,Ei=Uint32Array,Di=new Fi([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]),Bi=new Fi([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]),Ui=new Fi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pi=function(t,e){for(var r=new Ni(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new Ei(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]},Wi=Pi(Di,2),$i=Wi[1];Wi[0][28]=258,$i[258]=28;for(var zi=Pi(Bi,0)[1],ji=new Ni(32768),qi=0;32768>qi;++qi){var Hi=(43690&qi)>>>1|(21845&qi)<<1;ji[qi]=((65280&(Hi=(61680&(Hi=(52428&Hi)>>>2|(13107&Hi)<<2))>>>4|(3855&Hi)<<4))>>>8|(255&Hi)<<8)>>>1}var Gi=function(t,e,r){for(var i=t.length,n=0,s=new Ni(e);i>n;++n)++s[t[n]-1];var a,o=new Ni(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(r){a=new Ni(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[ji[d]>>>u]=l}else for(a=new Ni(i),n=0;i>n;++n)a[n]=ji[o[t[n]-1]++]>>>15-t[n];return a},Vi=new Fi(288);for(qi=0;144>qi;++qi)Vi[qi]=8;for(qi=144;256>qi;++qi)Vi[qi]=9;for(qi=256;280>qi;++qi)Vi[qi]=7;for(qi=280;288>qi;++qi)Vi[qi]=8;var Zi=new Fi(32);for(qi=0;32>qi;++qi)Zi[qi]=5;var Ji=Gi(Vi,9,0),Xi=Gi(Zi,5,0),Yi=function(t){return(t/8>>0)+(7&t&&1)},Ki=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof Ni?Ni:t instanceof Ei?Ei:Fi)(r-e);return i.set(t.subarray(e,r)),i},Qi=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},tn=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},en=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 Fi(0),0];if(1==n){var a=new Fi(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 f=new Ni(c+1),v=rn(r[h-1],f,0);if(v>e){i=0;var p=0,m=v-e,g=1<<m;for(s.sort((function(t,e){return f[e.s]-f[t.s]||t.f-e.f}));n>i;++i){var y=s[i].s;if(e>=f[y])break;p+=g-(1<<v-f[y]),f[y]=e}for(p>>>=m;p>0;){var b=s[i].s;e>f[b]?p-=1<<e-f[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;f[w]==e&&(--f[w],++p)}v=e}return[new Fi(f),v]},rn=function(t,e,r){return-1==t.s?Math.max(rn(t.l,e,r+1),rn(t.r,e,r+1)):e[t.s]=r},nn=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Ni(++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]},sn=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},an=function(t,e,r){var i=r.length,n=Yi(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)},on=function(t,e,r,i,n,s,a,o,u,l,h){Qi(e,h++,r),++n[256];for(var d=en(n,15),c=d[0],f=d[1],v=en(s,15),p=v[0],m=v[1],g=nn(c),y=g[0],b=g[1],w=nn(p),k=w[0],S=w[1],I=new Ni(19),_=0;y.length>_;++_)I[31&y[_]]++;for(_=0;k.length>_;++_)I[31&k[_]]++;for(var C=en(I,7),M=C[0],T=C[1],x=19;x>4&&!M[Ui[x-1]];--x);var R,O,A,L,F=l+5<<3,N=sn(n,Vi)+sn(s,Zi)+a,E=sn(n,c)+sn(s,p)+a+14+3*x+sn(I,M)+(2*I[16]+3*I[17]+7*I[18]);if(N>=F&&E>=F)return an(e,h,t.subarray(u,u+l));if(Qi(e,h,1+(N>E)),h+=2,N>E){R=Gi(c,f,0),O=c,A=Gi(p,m,0),L=p;var D=Gi(M,T,0);for(Qi(e,h,b-257),Qi(e,h+5,S-1),Qi(e,h+10,x-4),h+=14,_=0;x>_;++_)Qi(e,h+3*_,M[Ui[_]]);h+=3*x;for(var B=[y,k],U=0;2>U;++U){var P=B[U];for(_=0;P.length>_;++_)Qi(e,h,D[W=31&P[_]]),h+=M[W],W>15&&(Qi(e,h,P[_]>>>5&127),h+=P[_]>>>12)}}else R=Ji,O=Vi,A=Xi,L=Zi;for(_=0;o>_;++_)if(i[_]>255){var W;tn(e,h,R[257+(W=i[_]>>>18&31)]),h+=O[W+257],W>7&&(Qi(e,h,i[_]>>>23&31),h+=Di[W]);var z=31&i[_];tn(e,h,A[z]),h+=L[z],z>3&&(tn(e,h,i[_]>>>5&8191),h+=Bi[z])}else tn(e,h,R[i[_]]),h+=O[i[_]];return tn(e,h,R[256]),h+O[256]},un=new Ei([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ln=function(){for(var t=new Ei(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),hn=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=ln[255&r^e[i]]^r>>>8;t=r},d:()=>4294967295^t}},dn=function(t,e,r,i,n){return function(t,e,r,i,n,s){var a=t.length,o=new Fi(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=an(u,l,t.subarray(h,d)):(u[h]=true,l=an(u,l,t.subarray(h,a)))}else{for(var c=un[e-1],f=c>>>13,v=8191&c,p=(1<<r)-1,m=new Ni(32768),g=new Ni(p+1),y=Math.ceil(r/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},k=new Ei(25e3),S=new Ni(288),I=new Ni(32),_=0,C=0,M=(h=0,0),T=0,x=0;a>h;++h){var R=w(h),O=32767&h,A=g[R];if(m[O]=A,g[R]=O,h>=T){var L=a-h;if((_>7e3||M>24576)&&L>423){l=on(t,u,0,k,S,I,C,M,x,h-x,l),M=_=C=0,x=h;for(var F=0;286>F;++F)S[F]=0;for(F=0;30>F;++F)I[F]=0}var N=2,E=0,D=v,B=O-A&32767;if(L>2&&R==w(h-B))for(var U=Math.min(f,L)-1,P=Math.min(32767,h),W=Math.min(258,L);P>=B&&--D&&O!=A;){if(t[h+N]==t[h+N-B]){for(var z=0;W>z&&t[h+z]==t[h+z-B];++z);if(z>N){if(N=z,E=B,z>U)break;var j=Math.min(B,z-2),q=0;for(F=0;j>F;++F){var H=h-B+F+32768&32767,G=H-m[H]+32768&32767;G>q&&(q=G,A=H)}}}B+=(O=A)-(A=m[O])+32768&32767}if(E){k[M++]=268435456|$i[N]<<18|zi[E];var V=31&$i[N],Z=31&zi[E];C+=Di[V]+Bi[Z],++S[257+V],++I[Z],T=h+N,++_}else k[M++]=t[h],++S[t[h]]}}l=on(t,u,true,k,S,I,C,M,x,h-x,l)}return Ki(o,0,i+Yi(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)},cn=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},fn=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&&cn(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)}},vn=function(t){return 10+(t.filename&&t.filename.length+1||0)};class pn{constructor(t,e){var r,i;void 0===e&&(e={}),this.za={},this.Ja=t=>{if(!this.za[t]){var e,r;this.za[t]=!0;var i=this.Ka(t);null==(e=(r=this.Ha).onBlockedNode)||e.call(r,t,i)}},this.ja=t=>{var e=this.Ka(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.Ka=t=>this._rrweb.mirror.getNode(t),this.Ua=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.Ua(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var[e]=this.ja(t.id);return!this.co.consumeRateLimit(e)&&t})));var i=this.Ua(e);return 0!==i||r===i?t:void 0},this._rrweb=t,this.Ha=e,this.co=new ur({bucketSize:null!==(r=this.Ha.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.Ha.refillRate)&&void 0!==i?i:10,refillInterval:1e3,zt:this.Ja,Yt:fr})}reset(){this.za={}}stop(){this.co.stop(),this.reset()}}var mn="$sess_rec_flush_size";class gn{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.Pa=t.get_property.bind(t),this.qa=t.persistence.set_property.bind(t.persistence)}trackSize(t){var e=Number(this.Pa(mn))||0;this.qa(mn,e+t)}reset(){return this.qa(mn,0)}get currentTrackedSize(){return Number(this.Pa(mn))||0}}function yn(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<or(100*e,0,100,fr)}var bn=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}},wn={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=>bn(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!bn(e,t))))),icontains:(t,e)=>e.map(kn).some((e=>t.map(kn).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(kn).every((e=>t.map(kn).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)))}))},kn=t=>t.toLowerCase(),Sn=new Set(["is_not","not_icontains","not_regex"]);function In(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(tr(n)||rr(n))return Sn.has(s);var a=wn[s];return!!a&&!tr(t.value)&&!rr(t.value)&&a(Ye(t.value)?t.value.map(String):[String(t.value)],Ye(n)?n.map(String):[String(n)])}))}var _n=vr("[SessionRecording]");class Cn{constructor(t,e,r,i,n,s){this.Qa=null,this.$a=Oi,this._instance=t,this.Da=e,this.Wa=r,this.Va=i,this.tu=n,this.eu=s}onRemoteConfig(t){this.Qa=nr(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.ru=new ki([this.Wa,this.Da]),this.$a=Ri):(this.ru=new Si([this.Wa,this.Da]),this.$a=Oi),this._instance.register_for_session({[Dr]:t.triggerMatchType}),this.Da.onConfig(t),this.Wa.onConfig(t),this.Va.onConfig(t,((t,e)=>{this.tu("linked_flag_matched",{flag:t,variant:e})}))}getStatus(t){return this.$a({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 nr(r)?r:null}checkUrlTriggers(t,e,r,i){this.Da.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.Wa.Ga.length&&ir(this.iu))return this.iu=t((t=>{try{this.Wa.checkEventTriggerConditions(t.event,r,e)}catch(t){_n.error("Could not activate event trigger",t)}})),this.iu}makeSamplingDecisions(t){var e,r=this.Qa;if(nr(r)){var i=this._instance.get_property(Tr),n=i===t||!1!==i&&null,s="string"==typeof i&&i!==t||!sr(n),a=s?yn(t,r):n;s&&(a?this.tu("sampled"):_n.warn("Sample rate ("+r+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Tr]:!!a&&t})}else{var o;null==(o=this._instance.persistence)||o.unregister(Tr)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i;null==(t=this._instance.persistence)||t.unregister(Or),null==(e=this._instance.persistence)||e.unregister(Rr),null==(r=this._instance.persistence)||r.unregister(Tr),null==(i=this._instance.persistence)||i.unregister(xr)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.ru)?void 0:e.triggerStatus(t))===yi}stop(){var t;null==(t=this.iu)||t.call(this),this.iu=void 0,this.Wa.stop(),this.Da.stop(),this.Va.stop()}}class Mn{constructor(t,e,r,i){this.nu=[],this.su=new Map,this.ou=!1,this._instance=t,this.Da=e,this.tu=r,this.au=i}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.lu(t.triggerGroups),this._instance.register_for_session({[Dr]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:t.triggerGroups.length}),this.Da.onConfig(t)):_n.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return pi;if(t.urlTriggerMatching.urlBlocked)return vi;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return hi;var i=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===gi){var o=s.group.id,u=r.get(o);tr(u)?fr.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===u&&(n=!0)}else a===yi&&(i=!0)}return n?di:i?fi:hi}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.nu,triggerGroupSamplingResults:this.su,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.nu)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;nr(i)&&(rr(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.Da.checkUrlBlocklist(e,r);var s=function(i){i.checkUrlTriggerConditions(e,r,(e=>{n.uu(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t))}),t)};for(var a of this.nu)s(a)}setupEventTriggerListeners(t,e,r){var i=this;return this.iu=t((t=>{var r;if(this.ou)return _n.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.iu)||r.call(this),void(this.iu=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,(n=>{if(i.uu(r,t.properties)){var s=(r.group.conditions.events||[]).filter((e=>e.name===t.event)),a=i._instance.get_property(Er);s.some((e=>!e.properties||0===e.properties.length||In(e.properties,t.properties,a)))&&(r.activateTrigger(n,e),i.updateActiveTriggers(e))}}),e)};for(var s of this.nu)n(s)}catch(t){_n.error("Could not activate event trigger for trigger groups",t)}})),this.iu}makeSamplingDecisions(t){for(var e of this.nu){var r,i=e.group,n=i.id,s=i.sampleRate,a=Fr+n,o=this._instance.get_property(a),u=o===t||!1!==o&&null,l="string"==typeof o&&o!==t||!sr(u),h=l?yn(t+n,s):u;l&&this.au("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:s,isSampled:h}),this.su.set(n,h),null==(r=this._instance.persistence)||r.register({[a]:!!h&&t})}this.updateActiveTriggers(t)}onFlushComplete(){this.ou=!0}clearConditionalRecordingPersistence(){var t,e;for(var r of(null==(t=this._instance.persistence)||t.unregister(Tr),null==(e=this._instance.persistence)||e.unregister(xr),this.nu)){var i,n,s,a=r.group.id;null==(i=this._instance.persistence)||i.unregister(Ar+a),null==(n=this._instance.persistence)||n.unregister(Lr+a),null==(s=this._instance.persistence)||s.unregister(Fr+a)}}updateActiveTriggers(t){var e=[];for(var r of this.nu){var i=r.group,n=i.id,s="trigger_activated"===r.triggerStatus(t),a=!0===this.su.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.nu)if(e.triggerStatus(t)===yi)return!0;return!1}stop(){var t;null==(t=this.iu)||t.call(this),this.iu=void 0,this.nu.forEach((t=>t.stop())),this.nu=[],this.su.clear(),this.Da.stop()}uu(t,e){var r=t.group.conditions.properties;return!r||0===r.length||In(r,e,this._instance.get_property(Er))}lu(t){var e=this;this.nu.forEach((t=>t.stop())),this.nu=[],this.su.clear();var r=function(t){var r=new xi(e._instance,t,((r,i)=>{e.tu("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name})}));e.nu.push(r)};for(var i of t)r(i)}}function Tn(t){return Qe(t)?t.network_timing:t}var xn,Rn="[SessionRecording]",On=vr(Rn),An=[1,2,3,4,5,6,7,12],Ln=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Fn(){var t;return null==Ve||null==(t=Ve.__PosthogExtensions__)?void 0:t.rrweb}function Nn(){var t;return null==(t=Fn())?void 0:t.record}function En(t){return function(t,e){for(var r="",i=0;t.length>i;){var n=t[i++];r+=String.fromCharCode(n)}return r}(function(t,e){void 0===e&&(e={});var r=hn(),i=t.length;r.p(t);var n=dn(t,e,vn(e),8),s=n.length;return fn(n,e),cn(n,s-8,r.d()),cn(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 Fi(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 Fi(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 Ki(i,0,n)}(JSON.stringify(t))))}function Dn(t){return Ye(t)&&0===t.length?xn=null!=xn?xn:En([]):En(t)}function Bn(t,e){return t.type===li.Custom&&t.data.tag===e}function Un(t){return Bn(t,"sessionIdle")}function Pn(t){return Bn(t,"$session_ending")}function Wn(t){return Bn(t,"$session_starting")}function $n(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[$n({size:i.reduce(((t,e)=>t+e),0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),$n({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]}class zn{get sessionId(){return this.ci}get hu(){if(!this._instance.sessionManager)throw new Error(Rn+" must be started with a valid sessionManager.");return this._instance.sessionManager}get du(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get cu(){var t=this._instance.get_property(Tr);return!0===t?null:!1!==t&&(er(t)?t===this.sessionId:null)}get Qa(){var t,e=null==(t=this.Qo)?void 0:t.sampleRate;return nr(e)?e:null}get vu(){var t,e;return null!==(t=null==(e=this.fu)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t){this.gu="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.mu=void 0,this.pu=Date.now(),this.Iu=!1,this.yu=[],this.bu="unknown",this.Cu=!1,this.wu=!1,this.Su=[],this.ku=void 0,this.iu=void 0,this.Au=void 0,this.Ru=void 0,this.Nu=void 0,this._u=void 0,this.ei=(t,e,r)=>{var i,n;if(r&&(t!==this.ci||e!==this.hi)){var s,a,o=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this.ci,l=this.hi;o&&this.au("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.pu,flushed_size:null==(s=this.Tu)?void 0:s.currentTrackedSize}),this.Tu&&this.Tu.reset(),null==(i=this._instance.persistence)||i.unregister(Nr),this.wu=!1,null==(n=Fn())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.au("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.Mu(),!0===this.bu&&(this.bu="unknown",this.stop(),this.start("session_id_changed")),o&&this.au("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.pu}),nr(this.Qa)&&ir(this.Nu)&&(null==(a=this.fu)||a.makeSamplingDecisions(t))}},this.Fu=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[xr])===this.ci},this.xu=()=>{var t,e;if(0===this.T.data.length)return null;var r=null==(t=this.T.data[0])?void 0:t.timestamp,i=null==(e=this.T.data[this.T.data.length-1])?void 0:e.timestamp;return nr(r)&&nr(i)?i-r:null},this.Bu=()=>{var t,e,r=this.vu;if(!nr(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.Ou;return nr(i)&&i>=0&&r>i}if(this.Fu())return!1;var n,s=this.xu();return!!rr(s)||r>s||(null==(n=this._instance.persistence)||n.register({[xr]:this.ci}),!1)},this.Zu=()=>{this.status!==fi?this.Yu():this.Eu()},this.Gu=()=>{this.au("browser offline",{})},this.Lu=()=>{this.au("browser online",{})},this.Ot=()=>{null!=Ge&&Ge.visibilityState&&this.au("window "+Ge.visibilityState,{})},this._instance=t;var{sessionId:e,windowId:r}=this.hu.checkAndGetSessionAndWindowId();this.ci=e,this.hi=r,this.Va=new Mi(this._instance),this.Da=new Ci(this._instance),this.Wa=new Ti(this._instance),this.T=this.Eu(),this.hu.sessionTimeoutMs>this.du||On.warn("session_idle_threshold_ms ("+this.du+") is greater than the session timeout ("+this.hu.sessionTimeoutMs+"). Session will never be detected as idle"),this.Tu=new gn(this._instance)}get Du(){var t,e,r,i,n,s,a,o=null==(t=this.Qo)?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 tr(l)&&tr(h)&&tr(d)?void 0:{maskAllInputs:null==l||l,maskTextSelector:h,blockSelector:d}}get Wu(){var t,e,r,i,n,s,a,o=this._instance.config.session_recording.captureCanvas,u=null==(t=this.Qo)?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:or(h,0,12,vr("canvas recording fps"),4),quality:or(d,0,1,vr("canvas recording quality"),.4)}}get Vu(){var t,e=!(null==(t=this.Qo)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Xu(){var t,e,r,i=null==(t=this.Qo)?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=Tn(this._instance.config.capture_performance),u=Tn(null==i?void 0:i.capturePerformance),l=!!(sr(o)?o:u);return s||a||l?{recordHeaders:s,recordBody:a,recordPerformance:l}:void 0}zu(){var t,e,i=[],n=null==(t=Ve.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.Vu&&i.push(n());var s,a,o,u,l,h,d,c,f,v,p,m=null==(e=Ve.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;return this.Xu&&Ke(m)&&(!gr.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(m((l={payloadSizeLimitBytes:$r.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...$r.performanceEntryTypeToObserve],payloadHostDenyList:[...(a=this.Xu).payloadHostDenyList||[],...$r.payloadHostDenyList]},h=!1!==(s=this._instance.config).session_recording.recordHeaders&&a.recordHeaders,d=!1!==s.session_recording.recordBody&&a.recordBody,c=!1!==s.capture_performance&&a.recordPerformance,u=Math.min(1e6,null!==(o=l.payloadSizeLimitBytes)&&void 0!==o?o:1e6),f=t=>(null!=t&&t.requestBody&&(t.requestBody=Hr(t.requestBody,t.requestHeaders,u,"Request")),null!=t&&t.responseBody&&(t.responseBody=Hr(t.responseBody,t.responseHeaders,u,"Response")),t),v=t=>{return f(((t,e)=>{var r,i=yr(t.name),n=0===e.indexOf("http")?null==(r=yr(e))?void 0:r.pathname:e;"/"===n&&(n="");var s=null==i?void 0:i.pathname.replace(n||"","");if(!(i&&s&&qr.some((t=>0===s.indexOf(t)))))return t})((ir(r=(e=t).requestHeaders)||pr(Object.keys(null!=r?r:{}),(t=>{zr.includes(t.toLowerCase())&&(r[t]=Wr)})),e),s.api_host));var e,r},(p=Ke(s.session_recording.maskNetworkRequestFn))&&Ke(s.session_recording.maskCapturedNetworkRequestFn)&&fr.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),p&&(s.session_recording.maskCapturedNetworkRequestFn=t=>{var e=s.session_recording.maskNetworkRequestFn({url:t.name});return r({},t,{name:null==e?void 0:e.url})}),l.maskRequestFn=Ke(s.session_recording.maskCapturedNetworkRequestFn)?t=>{var e,r=v(t);return r&&null!==(e=null==s.session_recording.maskCapturedNetworkRequestFn?void 0:s.session_recording.maskCapturedNetworkRequestFn(r))&&void 0!==e?e:void 0}:t=>function(t){if(!tr(t))return t.requestBody=Gr(t.requestBody,"Request"),t.responseBody=Gr(t.responseBody,"Response"),t}(v(t)),r({},$r,l,{recordHeaders:h,recordBody:d,recordPerformance:c,recordInitialRequests:c})))):On.info("NetworkCapture not started because we are on localhost.")),i}Ju(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}Ku(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.yu.length?this.yu.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):On.warn("could not emit queued rrweb event.",e,t),!1}}au(t,e){return this.Ku(Ln((()=>Nn().addCustomEvent(t,e))))}Hu(){try{if(this._instance.config.capture_pageview||!qe)return;var t=new URL(qe.location.href),e=this.Ju(t.origin+t.pathname+t.search);this.ju!==e&&(this.ju=e,this.au("$url_changed",{href:e}))}catch(t){}}Uu(){if(this.yu.length){var t=[...this.yu];this.yu=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.Ku(t)}))}}eu(){return this.Ku(Ln((()=>Nn().takeFullSnapshot())))}get Pu(){var t,e,r;return null!=(t=this.fu)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)?6e4:null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}qu(){if(this.Qu&&clearInterval(this.Qu),!0!==this.bu){var t=this.Pu;t&&(this.Qu=setInterval((()=>{this.eu()}),t))}}$u(){this.Da.urlBlocked||(this.Da.urlBlocked=!0,clearInterval(this.Qu),On.info("recording paused due to URL blocker"),this.au("recording paused",{reason:"url blocker"}))}th(){this.Da.urlBlocked&&(this.Da.urlBlocked=!1,this.eu(),this.qu(),this.au("recording resumed",{reason:"left blocked url"}),On.info("recording resumed"))}eh(t,e){var r;if(!this.Iu&&null!=(r=this.fu)&&r.hasPendingTriggers(this.sessionId)){this.Iu=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===t?Rr:Or]:this.sessionId}),null==(n=this.fu)||n.updateActiveTriggers(this.sessionId),this.Yu(),this.tu(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Iu=!1}}}get isStarted(){return!!this.mu}get Qo(){var t=this._instance.get_property(Sr);if(t){var e=Qe(t)?t:JSON.parse(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 On.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(Sr))}return e}}rh(t,e,r){this._instance.get_property(t)&&(e(),r())}start(t){var e,r,i=this.Qo;if(i){var{sessionId:n,windowId:s}=this.hu.checkAndGetSessionAndWindowId();this.ci=n,this.hi=s,null==(e=this._instance.persistence)||e.unregister(Nr),null!=i&&i.endpoint&&(this.gu=null==i?void 0:i.endpoint),this.fu=2===(null==i?void 0:i.version)&&(null==i?void 0:i.triggerGroups)&&i.triggerGroups.length>0?new Mn(this._instance,this.Da,this.tu.bind(this),this.au.bind(this)):new Cn(this._instance,this.Da,this.Wa,this.Va,this.tu.bind(this),this.eu.bind(this)),this.fu.onRemoteConfig(i),null==(r=this.iu)||r.call(this),this.iu=this.fu.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.eh(t,e))),this.rh(Ir,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Ir)})),this.rh(_r,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(_r)})),this.rh(Mr,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Mr)})),this.rh(Cr,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Cr)})),this.fu.makeSamplingDecisions(this.sessionId),this.ih(),this.Cu||(mr(qe,"beforeunload",this.Zu),mr(qe,"offline",this.Gu),mr(qe,"online",this.Lu),mr(qe,"visibilitychange",this.Ot),this.Au||(this.Au=this.hu.onSessionId(this.ei)),this.Ru||(this.Ru=this.hu.on("forcedIdleReset",(()=>{this.Mu(),this.bu="unknown",this.stop(),this._u=this.hu.onSessionId(((t,e,r)=>{var i;null==(i=this._u)||i.call(this),this._u=void 0,this.ei(t,e,r)}))}))),ir(this.ku)&&(this.ku=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.Ju(null==t?void 0:t.properties.$current_url):"";if(!e)return;this.au("$pageview",{href:e})}}catch(t){On.error("Could not add $pageview to rrweb session",t)}}))),this.status===ci&&this.tu(t||"recording_initialized"))}else On.info("remote config must be stored in persistence before recording can start")}nh(){var t,e,r,i,n,s,a,o,u;null==qe||qe.removeEventListener("beforeunload",this.Zu),null==qe||qe.removeEventListener("offline",this.Gu),null==qe||qe.removeEventListener("online",this.Lu),null==qe||qe.removeEventListener("visibilitychange",this.Ot),clearInterval(this.Qu),this.sh(),null==(t=this.ku)||t.call(this),this.ku=void 0,null==(e=this.iu)||e.call(this),this.iu=void 0,null==(r=this.Au)||r.call(this),this.Au=void 0,null==(i=this.Ru)||i.call(this),this.Ru=void 0,null==(n=this.Nu)||n.call(this),this.Nu=void 0,null==(s=this._u)||s.call(this),this._u=void 0,null==(a=this.fu)||a.stop(),null==(o=this.oh)||o.stop(),this.yu=[],null==(u=this.mu)||u.call(this),this.mu=void 0}stop(){this.Yu(),this.Eu(),this.nh(),On.info("stopped")}discard(){this.Eu(),this.nh(),On.info("discarded")}onRRwebEmit(t){var e,i,n,s,a,o,u,l;if(this.Uu(),t&&Qe(t)){if(t.type===li.Meta){var h=this.Ju(t.data.href);if(this.ju=h,!h)return;t.data.href=h}else this.Hu();if(null==(e=this.fu)||e.checkUrlTriggers(this.sessionId,(()=>this.$u()),(()=>this.th()),((t,e)=>this.eh(t,e))),!this.Da.urlBlocked||(d=t).type===li.Custom&&"recording paused"===d.data.tag){var d,c,f;t.type===li.FullSnapshot&&(this.qu(),null==(c=this.oh)||c.reset(),null==(f=this._instance.persistence)||f.register_once({[Nr]:t.timestamp},void 0)),t.type===li.FullSnapshot&&null!=(i=this.fu)&&i.hasPendingTriggers(this.sessionId)&&this.ah();var v=this.oh?this.oh.throttleMutations(t):t;if(v){var p=function(t){var e=t;if(e&&Qe(e)&&6===e.type&&Qe(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),m=function(t){return Pn(t)?t.data.payload:null}(p),g=function(t){return Wn(t)?t.data.payload:null}(p);if(m||g){var y=null!=m?m:g;null!=y&&y.lastActivityTimestamp&&(p.timestamp=y.lastActivityTimestamp)}else this.lh(p);t.type===li.FullSnapshot&&(this.Su.push([this.ci,t.timestamp]),this.Su.length>6&&(this.Su=this.Su.slice(-6)));var b=null!==(n=null!==(s=null==m?void 0:m.currentSessionId)&&void 0!==s?s:null==g?void 0:g.nextSessionId)&&void 0!==n?n:this.ci,w=null!==(a=null!==(o=null==m?void 0:m.currentWindowId)&&void 0!==o?o:null==g?void 0:g.nextWindowId)&&void 0!==a?a:this.hi;if(!0!==this.bu||function(t){return Un(t)||Pn(t)||Wn(t)}(p)){if(Un(p)){var k=p.data.payload;k&&(p.timestamp=k.lastActivityTimestamp+k.threshold)}var{event:S,size:I}=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u?function(t){try{if(t.type===li.FullSnapshot){var e=r({},t,{data:En(t.data),cv:"2024-10"});return{event:e,size:Li(e)}}if(t.type===li.IncrementalSnapshot&&0===t.data.source){var i=r({},t,{cv:"2024-10",data:r({},t.data,{texts:Dn(t.data.texts),attributes:Dn(t.data.attributes),removes:Dn(t.data.removes),adds:Dn(t.data.adds)})});return{event:i,size:Li(i)}}if(t.type===li.IncrementalSnapshot&&8===t.data.source){var n=r({},t,{cv:"2024-10",data:r({},t.data,{adds:t.data.adds?En(t.data.adds):void 0,removes:t.data.removes?En(t.data.removes):void 0})});return{event:n,size:Li(n)}}}catch(t){On.error("could not compress event - will use uncompressed event",t)}return{event:t,size:Ai(t)}}(p):{event:p,size:Ai(p)},_={$snapshot_bytes:I,$snapshot_data:S,$session_id:b,$window_id:w};p.type===li.FullSnapshot&&null!=(l=Fn())&&null!=l.wasMaxDepthReached&&l.wasMaxDepthReached()&&(this.wu=!0),this.status!==hi?this.uh(_):this.Eu()}}}}}get status(){return this.fu?this.fu.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.cu,rrwebError:this.Cu,urlTriggerMatching:this.Da,eventTriggerMatching:this.Wa,linkedFlagMatching:this.Va,remoteConfig:this.Qo}):hi}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.Va.linkedFlagSeen=!0,this.eu(),this.tu("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Tr]:this.sessionId}),this.eu(),this.tu("sampling_overridden")}overrideTrigger(t){this.eh(t)}sh(){this.hh&&(clearTimeout(this.hh),this.hh=void 0)}Yu(){this.sh();var t,e=this.Bu();return this.status===fi||this.status===vi||this.status===hi||e?(this.hh=setTimeout((()=>{this.Yu()}),2e3),this.T):(this.T.data.length>0&&($n(this.T).forEach((t=>{var e;null==(e=this.Tu)||e.trackSize(t.size),this.dh({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:dr,$lib_version:hr})})),null==(t=this.fu)||t.onFlushComplete()),this.Eu())}uh(t){var e,r=2+((null==(e=this.T)?void 0:e.data.length)||0),i=t.$session_id;this.bu||943718.4>=this.T.size+t.$snapshot_bytes+r&&this.T.sessionId===i||(this.T=this.Yu(),this.T.sessionId=i,this.T.windowId=t.$window_id),this.T.size+=t.$snapshot_bytes,this.T.data.push(t.$snapshot_data),this.T.sizes.push(t.$snapshot_bytes),this.hh||this.bu||(this.hh=setTimeout((()=>{this.Yu()}),2e3))}dh(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.gu),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Ou(){var t,e,r=null==(t=this.T)?void 0:t.data[(null==(e=this.T)?void 0:e.data.length)-1],{sessionStartTimestamp:i}=this.hu.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i:null}ah(){if(!this.T||0===this.T.data.length)return this.Eu();for(var t=-1,e=this.T.data.length-1;e>=0;e--)if(this.T.data[e].type===li.Meta){t=e;break}return 0>t?this.Eu():(this.T.data=this.T.data.slice(t),this.T.sizes=this.T.sizes.slice(t),this.T.size=this.T.sizes.reduce(((t,e)=>t+e),0),this.T)}Eu(){return this.T={size:0,data:[],sizes:[],sessionId:this.ci,windowId:this.hi},this.T}tu(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),On.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.au("$recording_started",r({reason:t},e))}fh(t){var e;return 3===t.type&&-1!==An.indexOf(null==(e=t.data)?void 0:e.source)}lh(t){var e=this.fh(t);e||this.bu||t.timestamp-this.pu>this.du&&(this.bu=!0,clearInterval(this.Qu),this.au("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.pu,threshold:this.du,bufferLength:this.T.data.length,bufferSize:this.T.size}),this.Yu());var r=!1;if(e&&(this.pu=t.timestamp,this.bu)){var i="unknown"===this.bu;this.bu=!1,i||(this.au("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}if(!this.bu){var{windowId:n,sessionId:s}=this.hu.checkAndGetSessionAndWindowId(!e,t.timestamp),a=this.ci!==s,o=this.hi!==n;this.hi=n,this.ci=s,a||o?(this.stop(),this.start("session_id_changed")):r&&this.qu()}}Mu(){var t;null==(t=this.fu)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,{sessionStartTimestamp:e}=this.hu.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.T.data.length,$sdk_debug_replay_internal_buffer_size:this.T.size,$sdk_debug_current_session_duration:this.Ou,$sdk_debug_session_start:e,$sdk_debug_replay_flushed_size:null==(t=this.Tu)?void 0:t.currentTrackedSize,$sdk_debug_replay_full_snapshots:this.Su,$snapshot_max_depth_exceeded:this.wu,$sdk_debug_replay_rrweb_error:this.Cu}}ih(){var t;if(!this.mu){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,recordCrossOriginIframes:!1},a=this._instance.config.session_recording;for(var[o,u]of Object.entries(a||{}))o in s&&("maskInputOptions"===o?s.maskInputOptions=r({password:!0},u):s[o]=u);this.Wu&&this.Wu.enabled&&(s.recordCanvas=!0,s.sampling={canvas:this.Wu.fps},s.dataURLOptions={type:"image/webp",quality:this.Wu.quality}),this.Du&&(s.maskAllInputs=null===(e=this.Du.maskAllInputs)||void 0===e||e,s.maskTextSelector=null!==(i=this.Du.maskTextSelector)&&void 0!==i?i:void 0,s.blockSelector=null!==(n=this.Du.blockSelector)&&void 0!==n?n:void 0);var l=Nn();if(l){this.oh=null!==(t=this.oh)&&void 0!==t?t:new pn(l,{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";On.info(r,{node:e}),this.log(Rn+" "+r,"warn")}});var h=this.zu();if(this.mu=l(r({emit:t=>{this.onRRwebEmit(t)},plugins:h},s)),!this.mu)return this.Cu=!0,void On.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.Cu=!1,this.pu=Date.now(),this.bu=sr(this.bu)?this.bu:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Qo),this.au("$session_options",{sessionRecordingOptions:s,activePlugins:h.map((t=>null==t?void 0:t.name))}),this.au("$posthog_config",{config:this._instance.config})}else On.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.au(t,e)}}Ve.__PosthogExtensions__=Ve.__PosthogExtensions__||{},Ve.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:t=>({name:"rrweb/console@1",observer:je,options:t}),getRecordNetworkPlugin:t=>({name:"rrweb/network@1",observer:ui,options:t})},Ve.__PosthogExtensions__.rrweb={record:Re,version:"v2",wasMaxDepthReached:()=>lt,resetMaxDepthState(){lt=!1,ut=!1}},Ve.__PosthogExtensions__.initSessionRecording=t=>new zn(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||{}),f=(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))(f||{}),v={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},p={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},m={};function g(t){if(m[t])return m[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 v?v[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 p?p[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 m[t]=e.prototype,e.prototype;var o=document.createElement("iframe");try{document.body.appendChild(o);var u=o.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return l?m[t]=l:r}catch(t){return r}finally{o.parentNode&&document.body.removeChild(o)}}var y={};function b(t,e,r){var i,n=t+"."+String(r);if(y[n])return y[n].call(e);var s=g(t),a=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return a?(y[n]=a,a.call(e)):e[r]}var w={};function k(t,e,r){var i=t+"."+String(r);if(w[i])return w[i].bind(e);var n=g(t)[r];return"function"!=typeof n?e[r]:(w[i]=n,n.bind(e))}function S(){return g("MutationObserver").constructor}function I(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}var _={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)=>k("Node",t,"contains")(e),getRootNode:t=>k("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)=>k("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>k("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:I};function C(t){return t.nodeType===t.ELEMENT_NODE}function M(t){var e=t&&"host"in t&&"mode"in t&&_.host(t)||null;return Boolean(e&&"shadowRoot"in e&&_.shadowRoot(e)===t)}function T(t){return"[object ShadowRoot]"==={}.toString.call(t)}function x(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=t.href;return!r&&t.ownerNode&&(r=t.ownerNode.baseURI),(i=Array.from(e,(t=>R(t,r))).join("")).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function R(t,e){var r;if(function(t){return"styleSheet"in t}(t)){var i;try{i=x(t.styleSheet)||function(t){var{cssText:e}=t;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 W(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?W(n,e):n}class O{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))),C(t)){var r=_.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 A(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:a}=t,o=s||"",u=n&&L(n);return(r[i.toLowerCase()]||u&&r[u])&&(o=a?a(o,e):"*".repeat(o.length)),o}function L(t){return t.toLowerCase()}var F="__rrweb_original__";function N(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?L(e):null}function E(t,e){var r,i;try{i=new URL(t,null!=e?e: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}var D=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,B=/^(?:[a-z+]+:)?\/\//i,U=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function W(t,e){return(t||"").replace(D,((t,r,i,n,s,a)=>{var o,u=i||s||a,l=r||n||"";if(!u)return t;if(B.test(u)||U.test(u))return"url("+l+u+l+")";if(P.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 z,j,q="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",H=4096,G=1,V=new RegExp("[^a-z0-9-_:]"),Z=-2;function J(){return G++}var X=/^[^ \t\n\r\u000c]+/,Y=/^[, \t\n\r\u000c]+/,K=new WeakMap;function Q(t,e){return e&&""!==e.trim()?tt(t,e):e}function tt(t,e){var r=K.get(t);if(r||(r=t.createElement("a"),K.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function et(t,e,r,i,n,s){if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){var a=Q(t,i);if("img"===e&&a.startsWith("data:")&&n){var o=a;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(o=function(t,e,r,i){if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>H||t.naturalHeight>H)return e;try{var n=document.createElement("canvas");n.width=t.naturalWidth,n.height=t.naturalHeight;var s=n.getContext("2d");return s?(s.drawImage(t,0,0),n.toDataURL(r||"image/webp",null!=i?i:.4)):e}catch(t){return e}}(n,a,s.type,s.quality)),(null==s?void 0:s.maxBase64ImageLength)&&(u=o,o=(l=s.maxBase64ImageLength)&&u.length>l?q:u),o}return a}return"xlink:href"===r&&"#"!==i[0]?Q(t,i):"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(Y),e.length>r;){var s=i(X);if(","===s.slice(-1))s=Q(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=Q(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?W(i,tt(t)):"object"===e&&"data"===r?Q(t,i):i:Q(t,i);var u,l}function rt(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function it(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&it(_.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&it(_.parentNode(t),e,r)}function nt(t,e,r,i){var n;if(C(t)){if(!_.childNodes(n=t).length)return!1}else{if(null===_.parentElement(t))return!1;n=_.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(it(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){return Array.from(t.styleSheets).find((t=>t.href===e))}function at(t){return null==t?"":t.toLowerCase()}var ot=50,ut=!1,lt=!1;function ht(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:a,maskTextSelector:o,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:h={},maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:I=(()=>!1),newlyAddedElement:R=!1,depth:O=0,maxDepth:D=ot}=e,{needsMask:B}=e,{preserveWhiteSpace:U=!0}=e;if(O>=D)return lt=!0,ut||(ut=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+D+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;B||(B=nt(t,a,o,void 0===B));var P,q=function(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:a,inlineStylesheet:o,maskInputOptions:u={},maskTextFn:l,maskInputFn:h,dataURLOptions:d={},inlineImages:c,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:m=!1}=e,g=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:f.Document,childNodes:[],compatMode:t.compatMode}:{type:f.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:g};case t.ELEMENT_NODE:return function(t,e){for(var r,i,n,{doc:s,blockClass:a,blockSelector:o,inlineStylesheet:u,maskInputOptions:l={},maskInputFn:h,dataURLOptions:d={},inlineImages:c,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:m=!1,rootId:g}=e,y=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,a,o),b=function(t){if(t instanceof HTMLFormElement)return"form";var e=L(t.tagName);return V.test(e)?"div":e}(t),w={},k=t.attributes.length,S=0;k>S;S++){var I=t.attributes[S];rt(b,I.name)||(w[I.name]=et(s,b,L(I.name),I.value,t,d))}if("link"===b&&u){var C=function(t){return t.href}(t);if(C){var M=st(s,C);!M&&C.includes(".css")&&(M=st(s,window.location.origin+"/"+C.replace(window.location.href,"")));var T=null;M&&(T=x(M)),T&&(delete w.rel,delete w.href,w._cssText=T)}}if("style"===b&&t.sheet&&!(t.innerText||_.textContent(t)||"").trim().length){var R=x(t.sheet);R&&(w._cssText=R)}if("input"===b||"textarea"===b||"select"===b){var O=t.value,E=t.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&O?w.value=A({element:t,type:N(t),tagName:b,value:O,maskInputOptions:l,maskInputFn:h}):E&&(w.checked=E)}if("option"===b&&(t.selected&&!l.select?w.selected=!0:delete w.selected),"dialog"===b&&t.open)try{w.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){w.rr_open_mode="modal",w.ph_rr_could_not_detect_modal=!0}if("canvas"===b&&v)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((F in n?n[F]: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)||(w.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){var D=t.toDataURL(d.type,d.quality),B=s.createElement("canvas");B.width=t.width,B.height=t.height,D!==B.toDataURL(d.type,d.quality)&&(w.rr_dataURL=D)}if("img"===b&&c){z||(z=s.createElement("canvas"),j=z.getContext("2d"));var U=t,P=U.currentSrc||U.getAttribute("src")||"<unknown-src>",W=U.crossOrigin,q=()=>{U.removeEventListener("load",q);try{z.width=U.naturalWidth,z.height=U.naturalHeight,j.drawImage(U,0,0),w.rr_dataURL=z.toDataURL(d.type,d.quality)}catch(t){if("anonymous"!==U.crossOrigin)return U.crossOrigin="anonymous",void(U.complete&&0!==U.naturalWidth?q():U.addEventListener("load",q));console.warn("Cannot inline img src="+P+"! Error: "+t)}"anonymous"===U.crossOrigin&&(W?w.crossOrigin=W:U.removeAttribute("crossorigin"))};U.complete&&0!==U.naturalWidth?q():U.addEventListener("load",q)}if("audio"===b||"video"===b){var H=w;H.rr_mediaState=t.paused?"paused":"played",H.rr_mediaCurrentTime=t.currentTime,H.rr_mediaPlaybackRate=t.playbackRate,H.rr_mediaMuted=t.muted,H.rr_mediaLoop=t.loop,H.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(w.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(w.rr_scrollTop=t.scrollTop)),y){var{width:G,height:Z,left:J,top:X}=t.getBoundingClientRect();w={class:w.class,rr_width:G+"px",rr_height:Z+"px",rr_left:Math.floor(J+((null==(r=s.defaultView)?void 0:r.scrollX)||0))+"px",rr_top:Math.floor(X+((null==(i=s.defaultView)?void 0:i.scrollY)||0))+"px"}}"iframe"!==b||p(w.src)||(t.contentDocument||(w.rr_src=w.src),delete w.src);try{customElements.get(b)&&(n=!0)}catch(t){}return{type:f.Element,tagName:b,attributes:w,childNodes:[],isSVG:(Y=t,Boolean("svg"===Y.tagName||Y.ownerSVGElement)||void 0),needBlock:y,rootId:g,isCustom:n};var Y}(t,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:u,maskInputFn:h,dataURLOptions:d,inlineImages:c,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:m,rootId:g});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:s}=e,a=_.parentNode(t),o=a&&a.tagName,u=_.textContent(t),l="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(l&&u){try{t.nextSibling||t.previousSibling||(null==(r=a.sheet)?void 0:r.cssRules)&&(u=x(a.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=W(u,tt(e.doc))}return h&&(u="SCRIPT_PLACEHOLDER"),!l&&!h&&u&&i&&(u=n?n(u,_.parentElement(t)):u.replace(/[\S]/g,"*")),{type:f.Text,textContent:u||"",isStyle:l,rootId:s}}(t,{doc:r,needsMask:a,maskTextFn:l,rootId:g});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:g};case t.COMMENT_NODE:return{type:f.Comment,textContent:_.textContent(t)||"",rootId:g};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:B,inlineStylesheet:l,maskInputOptions:h,maskTextFn:d,maskInputFn:c,dataURLOptions:p,inlineImages:m,recordCanvas:g,keepIframeSrcFn:I,newlyAddedElement:R});if(!q)return console.warn(t,"not serialized"),null;P=i.hasNode(t)?i.getId(t):!function(t,e){if(e.comment&&t.type===f.Comment)return!0;if(t.type===f.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"===E(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(at(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===at(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(at(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&at(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(at(t.attributes.property).match(/^(og|twitter|fb):/)||at(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===at(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(at(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(at(t.attributes.name))||at(t.attributes.property).match(/^article:/)||at(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(at(t.attributes.name)))return!0}}return!1}(q,v)&&(U||q.type!==f.Text||q.isStyle||q.textContent.replace(/^\s+|\s+$/gm,"").length)?J():Z;var H=Object.assign(q,{id:P});if(i.add(t,H),P===Z)return null;y&&y(t);var G=!u;if(H.type===f.Element){G=G&&!H.needBlock,delete H.needBlock;var X=_.shadowRoot(t);X&&T(X)&&(H.isShadowHost=!0)}if((H.type===f.Document||H.type===f.Element)&&G){v.headWhitespace&&H.type===f.Element&&"head"===H.tagName&&(U=!1);var Y={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:B,maskTextClass:a,maskTextSelector:o,skipChild:u,inlineStylesheet:l,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,preserveWhiteSpace:U,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:k,stylesheetLoadTimeout:S,keepIframeSrcFn:I,depth:O+1,maxDepth:D};if(H.type===f.Element&&"textarea"===H.tagName&&void 0!==H.attributes.value);else for(var K of Array.from(_.childNodes(t))){var Q=ht(K,Y);Q&&H.childNodes.push(Q)}var it=null;if(C(t)&&(it=_.shadowRoot(t)))for(var dt of Array.from(_.childNodes(it))){var ct=ht(dt,Y);ct&&(T(it)&&(ct.isShadow=!0),H.childNodes.push(ct))}}var ft=_.parentNode(t);return ft&&M(ft)&&T(ft)&&(H.isShadow=!0),H.type===f.Element&&"iframe"===H.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var a="about:blank";if(i.location.href!==a||t.src===a||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var o=setTimeout((()=>{s||(e(),s=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(o),s=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&b){var r=ht(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:B,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,preserveWhiteSpace:U,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:k,stylesheetLoadTimeout:S,keepIframeSrcFn:I,depth:O+1,maxDepth:D});r&&b(t,r)}}),w),H.type===f.Element&&"link"===H.tagName&&"string"==typeof H.attributes.rel&&("stylesheet"===H.attributes.rel||"preload"===H.attributes.rel&&"string"==typeof H.attributes.href&&"css"===E(H.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var s=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(s),n=!0,e()}))}}(t,(()=>{if(k){var e=ht(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:B,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:v,dataURLOptions:p,inlineImages:m,recordCanvas:g,preserveWhiteSpace:U,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:k,stylesheetLoadTimeout:S,keepIframeSrcFn:I,depth:O,maxDepth:D});e&&k(t,e)}}),S),H}function dt(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 ct{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 ct))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),()=>r.removeEventListener(t,e,i)}function vt(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var pt="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.",mt={map:{},getId(){return console.error(pt),-1},getNode(){return console.error(pt),null},removeNodeFromMap(){console.error(pt)},has(){return console.error(pt),!1},reset(){console.error(pt)}};function gt(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 yt(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){setTimeout((()=>{r.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>yt(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(mt=new Proxy(mt,{get(t,e,r){return"map"===e&&console.error(pt),Reflect.get(t,e,r)}}));var bt=Date.now;function wt(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=_.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=_.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function kt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function St(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function It(t){return t?t.nodeType===t.ELEMENT_NODE?t:_.parentElement(t):null}function _t(t,e,r,i){if(!t)return!1;var n=It(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(it(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 Ct(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===Z}function Mt(t,e){if(M(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=_.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Mt(i,e))}function Tt(t){return Boolean(t.changedTouches)}function xt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Rt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Ot(t){return!!t&&(t instanceof ct&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(_.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(bt=()=>(new Date).getTime());class At{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 Lt(t){var e,r=null;return"getRootNode"in t&&(null==(e=_.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&_.host(_.getRootNode(t))&&(r=_.host(_.getRootNode(t))),r}function Ft(t){var e=t.ownerDocument;return!!e&&(_.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Lt(r);)r=e;return r}(t);return _.contains(e,r)}(t))}function Nt(t){return"__ln"in t}class Et{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&&Nt(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&&Nt(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 Dt,Bt=(t,e)=>t+"@"+e;class Ut{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,"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,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Et,i=t=>{for(var e=t,r=Z;r===Z;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=_.parentNode(n);if(s&&Ft(n)&&"TEXTAREA"!==s.tagName){var a=M(s)?this.mirror.getId(Lt(n)):this.mirror.getId(s),o=i(n);if(-1===a||-1===o)return r.addNode(n);var u=ht(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,inlineImages:this.inlineImages,onSerialize:t=>{xt(t,this.mirror)&&this.iframeManager.addIframe(t),Rt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Ot(n)&&this.shadowDomManager.addShadowRoot(_.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},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)Wt(this.removesSubTreeCache,s)&&!this.movedSet.has(_.parentNode(s))||n(s);for(var a of this.addedSet)$t(this.droppedSet,a)||Wt(this.removesSubTreeCache,a)?$t(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(_.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 f=this.mirror.getId(_.parentNode(c.value));if(-1===i(c.value))continue;if(-1!==f){u=c;break}var v=_.parentNode(c.value);if(v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=_.host(v);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=_.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{attributes:e}=t;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(_.childNodes(t),(t=>_.textContent(t)||"")).join("");e.attributes.value=A({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:N(t),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(t=>{if(!Ct(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=_.textContent(t.target);_t(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:nt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,It(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=N(r);n=A({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(_t(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"),!rt(r.tagName,i))if(a.attributes[i]=et(this.doc,L(r.tagName),L(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.setAttribute("style",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(_t(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=M(t.target)?this.mirror.getId(_.host(t.target)):this.mirror.getId(t.target);_t(t.target,this.blockClass,this.blockSelector,!1)||Ct(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Pt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Mt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Bt(r,i)]?Pt(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!M(t.target)||!T(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),_.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)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Ct(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[Bt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);_t(t,this.blockClass,this.blockSelector,!1)||(_.childNodes(t).forEach((t=>this.genAdds(t))),Ot(t)&&_.childNodes(_.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","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function Pt(t,e){t.delete(e),_.childNodes(e).forEach((e=>Pt(t,e)))}function Wt(t,e,r){return 0!==t.size&&function(t,e,r){var i=_.parentNode(e);return!!i&&t.has(i)}(t,e)}function $t(t,e){return 0!==t.size&&zt(t,e)}function zt(t,e){var r=_.parentNode(e);return!!r&&(!!t.has(r)||zt(t,r))}var jt=t=>Dt?function(){try{return t(...arguments)}catch(t){if(Dt&&!0===Dt(t))return;throw t}}:t,qt=[];function Ht(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 Gt(t,e){var r=new Ut;qt.push(r),r.init(t);var i=new(S())(jt(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{observer:i,buffer:r}}function Vt(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:a}=t;return ft("scroll",jt(gt(jt((t=>{var a=Ht(t);if(a&&!_t(a,n,s,!0)){var o=i.getId(a);if(a===r&&r.defaultView){var u=wt(r.defaultView);e({id:o,x:u.left,y:u.top})}else e({id:o,x:a.scrollLeft,y:a.scrollTop})}})),a.scroll||100)),r)}var Zt=["INPUT","TEXTAREA","SELECT"],Jt=new WeakMap;function Xt(t){return function t(e,r){if(te("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||te("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||te("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||te("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 Yt(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function Kt(t,e){var r,i,n,s,{mirror:a,stylesheetManager:o}=t;s=a.getId("#document"===e.nodeName?e:_.host(e));var u="#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,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&u&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r=null==(e=l.set)?void 0:e.call(this,t);if(null!==s&&-1!==s)try{o.adoptStyleSheets(t,s)}catch(t){}return r}}),jt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function Qt(t,e){void 0===e&&(e={});var i,n,s=t.doc.defaultView;if(!s)return()=>{};if(function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:a,inputCb:o,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:h,canvasMutationCb:d,fontCb:c,selectionCb:f,customElementCb:v}=t;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),f(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),v(...arguments)}}(t,e),t.recordDOM){var a=Gt(t,t.doc);i=a.observer,n=a.buffer}var o=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;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=gt(jt((t=>{var r=Date.now()-s;e(l.map((t=>(t.timeOffset-=r,t))),t),l=[],s=null})),o),d=jt(gt(jt((t=>{var e=Ht(t),{clientX:r,clientY:i}=Tt(t)?t.changedTouches[0]:t;s||(s=bt()),l.push({x:r,y:i,id:n.getId(e),timeOffset:bt()-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 jt((()=>{c.forEach((t=>t()))}))}(t),d=function(t){var{mouseInteractionCb:e,doc:i,mirror:n,blockClass:s,blockSelector:a,sampling:o}=t;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=L(t),u=(t=>i=>{var o=Ht(i);if(!_t(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 Tt(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 f=Tt(i)?i.changedTouches[0]:i;if(f){var v=n.getId(o),{clientX:p,clientY:m}=f;jt(e)(r({type:l[d],id:v,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))})),jt((()=>{d.forEach((t=>t()))}))}(t),f=Vt(t),v=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,s=-1;return ft("resize",jt(gt(jt((()=>{var t=kt(),e=St();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:s}),p=function(t){var{inputCb:e,doc:i,mirror:n,blockClass:s,blockSelector:a,ignoreClass:o,ignoreSelector:u,maskInputOptions:l,maskInputFn:h,sampling:d,userTriggeredOnInput:c}=t;function f(t){var e=Ht(t),r=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=_.parentElement(e)),e&&n&&Zt.indexOf(n)>=0&&!_t(e,s,a,!0)&&!(e.classList.contains(o)||u&&e.matches(u))){var d=e.value,f=!1,p=N(e)||"";"radio"===p||"checkbox"===p?f=e.checked:(l[n.toLowerCase()]||l[p])&&(d=A({element:e,maskInputOptions:l,tagName:n,type:p,value:d,maskInputFn:h})),v(e,c?{text:d,isChecked:f,userTriggered:r}:{text:d,isChecked:f});var m=e.name;"radio"===p&&m&&f&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var r=t.value;v(t,c?{text:r,isChecked:!f,userTriggered:!1}:{text:r,isChecked:!f})}}))}}function v(t,i){var s=Jt.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){Jt.set(t,i);var a=n.getId(t);jt(e)(r({},i,{id:a}))}}var p=("last"===d.input?["change"]:["input","change"]).map((t=>ft(t,jt(f),i))),m=i.defaultView;if(!m)return()=>{p.forEach((t=>t()))};var g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value");return g&&g.set&&p.push(...[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]].map((t=>yt(t[0],t[1],{set(){jt(f)({target:this,isTrusted:!1})}},!1,m)))),jt((()=>{p.forEach((t=>t()))}))}(t),m=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:a}=t,o=jt((t=>gt(jt((s=>{var a=Ht(s);if(a&&!_t(a,r,i,!0)){var{currentTime:o,volume:u,muted:l,playbackRate:h,loop:d}=a;e({type:t,id:n.getId(a),currentTime:o,volume:u,muted:l,playbackRate:h,loop:d})}})),s.media||500))),u=[ft("play",o(c.Play),a),ft("pause",o(c.Pause),a),ft("seeked",o(c.Seeked),a),ft("volumechange",o(c.VolumeChange),a),ft("ratechange",o(c.RateChange),a)];return jt((()=>{u.forEach((t=>t()))}))}(t),g=()=>{},y=()=>{},b=()=>{},w=()=>{};t.recordDOM&&(g=function(t,e){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=t,{win:s}=e;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var a=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:jt(((t,e,s)=>{var[a,o]=s,{id:u,styleId:l}=Yt(e,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,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:jt(((t,e,s)=>{var[a]=s,{id:o,styleId:u}=Yt(e,i,n.styleMirror);return(o&&-1!==o||u&&-1!==u)&&r({id:o,styleId:u,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:jt(((t,e,s)=>{var[a]=s,{id:o,styleId:u}=Yt(e,i,n.styleMirror);return(o&&-1!==o||u&&-1!==u)&&r({id:o,styleId:u,replace:a}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:jt(((t,e,s)=>{var[a]=s,{id:o,styleId:u}=Yt(e,i,n.styleMirror);return(o&&-1!==o||u&&-1!==u)&&r({id:o,styleId:u,replaceSync:a}),t.apply(e,s)}))}));var h={};ee("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(ee("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),ee("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),ee("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((t=>{var[e,s]=t;d[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[e].insertRule,{apply:jt(((t,e,s)=>{var[a,o]=s,{id:u,styleId:l}=Yt(e.parentStyleSheet,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:a,index:[...Xt(e),o||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:jt(((t,e,s)=>{var[a]=s,{id:o,styleId:u}=Yt(e.parentStyleSheet,i,n.styleMirror);return(o&&-1!==o||u&&-1!==u)&&r({id:o,styleId:u,removes:[{index:[...Xt(e),a]}]}),t.apply(e,s)}))})})),jt((()=>{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,r]=t;r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:s}),y=Kt(t,t.doc),b=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=t,{win:a}=e,o=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:jt(((t,e,a)=>{var u,[l,h,d]=a;if(n.has(l))return o.apply(e,[l,h,d]);var{id:c,styleId:f}=Yt(null==(u=e.parentRule)?void 0:u.parentStyleSheet,i,s.styleMirror);return(c&&-1!==c||f&&-1!==f)&&r({id:c,styleId:f,set:{property:l,value:h,priority:d},index:Xt(e.parentRule)}),t.apply(e,a)}))});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:jt(((t,e,a)=>{var o,[l]=a;if(n.has(l))return u.apply(e,[l]);var{id:h,styleId:d}=Yt(null==(o=e.parentRule)?void 0:o.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||d&&-1!==d)&&r({id:h,styleId:d,remove:{property:l},index:Xt(e.parentRule)}),t.apply(e,a)}))}),jt((()=>{a.CSSStyleDeclaration.prototype.setProperty=o,a.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:s}),t.collectFonts&&(w=function(t){var{fontCb:e,doc:r}=t,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(jt((()=>{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),jt((()=>{n.forEach((t=>t()))}))}(t)));var k=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=t,a=!0,o=jt((()=>{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),{startContainer:d,startOffset:c,endContainer:f,endOffset:v}=h;_t(d,i,n,!0)||_t(f,i,n,!0)||o.push({start:r.getId(d),startOffset:c,end:r.getId(f),endOffset:v})}s({ranges:o})}}));return o(),ft("selectionchange",o)}(t),S=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?I(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),C=[];for(var M of t.plugins)C.push(M.observer(M.callback,s,M.options));return jt((()=>{if(n){n.destroy(),n.reset();var t=qt.indexOf(n);-1!==t&&qt.splice(t,1)}null==i||i.disconnect(),o(),d(),f(),v(),p(),m(),g(),y(),b(),w(),k(),S(),C.forEach((t=>t()))}))}function te(t){return void 0!==window[t]}function ee(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class re{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 ie{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new re(J)),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,"attachedIframes",new Map),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new re(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)}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);this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var n=t.contentWindow;if(this.recordCrossOriginIframes&&n&&!this.nestedIframeListeners.has(n)){var s=this.handleMessage.bind(this);vt((()=>{n.addEventListener("message",s),this.nestedIframeListeners.set(n,s)}))}vt((()=>{var e;return null==(e=t.contentWindow)?void 0:e.addEventListener("pagehide",(()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)}))})),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===f.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.mirror.getNode(t);if(r){var i=r.contentWindow;if(i&&this.nestedIframeListeners.has(i)){var n=this.nestedIframeListeners.get(i);vt((()=>i.removeEventListener("message",n))),this.nestedIframeListeners.delete(i)}i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r)}e&&this.attachedIframes.delete(t)}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var{content:r}=t;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&&window.removeEventListener("message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{vt((()=>e.removeEventListener("message",t)))})),this.nestedIframeListeners.clear(),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap}}class ne{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){if(T(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var{observer:i,buffer:n}=Gt(r({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>{i.disconnect(),n.destroy();var t=qt.indexOf(n);-1!==t&&qt.splice(t,1)})),this.restoreHandlers.push(Vt(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(_.host(t))),this.restoreHandlers.push(Kt({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(I(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=_.shadowRoot(this);return s&&Ft(this)&&r.addShadowRoot(s,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var se="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ae="undefined"==typeof Uint8Array?[]:new Uint8Array(256),oe=0;64>oe;oe++)ae[se.charCodeAt(oe)]=oe;var ue=new Map,le=(t,e,r)=>{if(t&&(ce(t,e)||"object"==typeof t)){var i=function(t,e){var r=ue.get(t);return r||ue.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 he(t,e,r,i){if(t instanceof Array)return t.map((t=>he(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+=se[r[e]>>2],n+=se[(3&r[e])<<4|r[e+1]>>4],n+=se[(15&r[e+1])<<2|r[e+2]>>6],n+=se[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}}if(t instanceof DataView)return{rr_type:t.constructor.name,args:[he(t.buffer,e,r,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var a=t.constructor.name,{src:o}=t;return{rr_type:a,src:o}}return t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[he(t.data,e,r,i),t.width,t.height]}:ce(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:le(t,e,r)}:t}var de=(t,e,r,i)=>t.map((t=>he(t,e,r,i))),ce=(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])))},fe=["webgl","webgl2"];function ve(t){return"nodeType"in t}function pe(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{canvas:e}=t;return e&&"object"==typeof e?e:null}(this);if(!a||ve(a)&&_t(a,e,i,!0))return n.call(this,s);ve(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(!_t(this,e,i,!0)&&("__context"in this||(this.__context=s),n&&fe.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 me(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(le(d,s,this),"tagName"in this.canvas&&!_t(this.canvas,i,n,!0)){var c=de(l,s,this,a);r(this.canvas,{type:e,property:u,args:c})}return d}}));o.push(l)}catch(i){var h=yt(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 ge,ye,be,we='(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 transparentBlobMap = /* @__PURE__ */ new Map();\n function fnv1aHash(buffer) {\n const view = new Uint8Array(buffer);\n let hash = 2166136261;\n for (let i2 = 0; i2 < view.length; i2++) {\n hash ^= view[i2];\n hash = hash * 16777619 | 0;\n }\n return (hash >>> 0).toString(16);\n }\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n try {\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d");\n }\n reusableCtx.clearRect(0, 0, width, height);\n reusableCtx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const fingerprint = fnv1aHash(arrayBuffer);\n if (!lastFingerprintMap.has(id)) {\n const base642 = encode(arrayBuffer);\n if (await transparentBase64 === base642) {\n lastFingerprintMap.set(id, fingerprint);\n return worker.postMessage({ id });\n }\n lastFingerprintMap.set(id, fingerprint);\n worker.postMessage({ id, type, base64: base642, width, height });\n return;\n }\n if (lastFingerprintMap.get(id) === fingerprint)\n return worker.postMessage({ id });\n const base64 = encode(arrayBuffer);\n worker.postMessage({ id, type, base64, width, height });\n lastFingerprintMap.set(id, fingerprint);\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//# sourceMappingURL=image-bitmap-data-url-worker-Ca9A-vl6.js.map\n',ke="undefined"!=typeof self&&self.Blob&&new Blob([we],{type:"text/javascript;charset=utf-8"});function Se(t){var e;try{if(!(e=ke&&(self.URL||self.webkitURL).createObjectURL(ke)))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(we),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Ie{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,"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{sampling:e="all",win:r,blockClass:i,blockSelector:n,recordCanvas:s,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(r,i,n,o),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:o})}reset(){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=pe(r,i,n,!0),u=new Map,l=new Se;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:s}=t.data;this.mutationCb({id:e,type:d["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}],displayWidth:n,displayHeight:s})}};var h,c=1e3/t,f=0,v=t=>{var o,d;f&&c>t-f||(f=t,(o=[],d=t=>{t.querySelectorAll("canvas").forEach((t=>{_t(t,i,n,!0)||o.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&d(t.shadowRoot)}))},d(r.document),o).forEach(function(){var t=e((function*(t){var e,r=a.mirror.getId(t);if(!u.get(r)&&0!==t.width&&0!==t.height){u.set(r,!0);try{if(["webgl","webgl2"].includes(t.__context)){var i=t.getContext(t.__context);!1===(null==(e=null==i?void 0:i.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=t.clientWidth||t.width,o=t.clientHeight||t.height,h=yield createImageBitmap(t,{resizeWidth:n,resizeHeight:o});l.postMessage({id:r,bitmap:h,width:n,height:o,dataURLOptions:s.dataURLOptions},[h])}catch(t){u.set(r,!1)}}}));return function(e){return t.apply(this,arguments)}}())),h=requestAnimationFrame(v)};h=requestAnimationFrame(v),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=pe(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 _t(this.canvas,r,i,!0)||setTimeout((()=>{var r=de(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=yt(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(...me(e.WebGLRenderingContext.prototype,d.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...me(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))),{type:s}=r[0];this.mutationCb({id:e,type:s,commands:i}),this.pendingCanvasMutations.delete(t)}}}}class _e{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new At),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)}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:R(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}trackStylesheetInLinkElement(t){}}class Ce{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 Me=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Te=document.createElement("iframe");document.body.appendChild(Te),Array.from=(null==(i=Te.contentWindow)?void 0:i.Array.from)||Array.from,document.body.removeChild(Te)}}catch(t){console.debug("Unable to override Array.from",t)}var xe=new O;function Re(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:a=null,ignoreClass:l="rr-ignore",ignoreSelector:h=null,maskTextClass:d="rr-mask",maskTextSelector:c=null,inlineStylesheet:f=!0,maskAllInputs:v,maskInputOptions:p,slimDOMOptions:m,maskInputFn:g,maskTextFn:y,hooks:b,packFn:w,sampling:k={},dataURLOptions:S={},mousemoveWait:I,recordDOM:C=!0,recordCanvas:M=!1,recordCrossOriginIframes:T=!1,recordAfter:x=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:R=!1,collectFonts:A=!1,inlineImages:L=!1,plugins:F,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:E=new Set([]),errorHandler:D}=t;Dt=D;var B=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},S),U=!T||window.parent===window,P=!1;if(!U)try{window.parent.document&&(P=!1)}catch(t){P=!0}if(U&&!e)throw new Error("emit function is required");if(!U&&!P)return()=>{};void 0!==I&&void 0===k.mousemove&&(k.mousemove=I),xe.reset();var W,z=!0===v?{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!==p?p:{password:!0},j=dt(void 0!==m&&m);!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 q=0,H=new Map,G=t=>{for(var e of F||[])e.eventProcessor&&(t=e.eventProcessor(t));return w&&!P&&(t=w(t)),t};ge=(t,r)=>{var s,a=t;if(a.timestamp=bt(),!(null==(s=qt[0])?void 0:s.isFrozen())||a.type===o.FullSnapshot||a.type===o.IncrementalSnapshot&&a.data.source===u.Mutation||qt.forEach((t=>t.unfreeze())),U)null==e||e(G(a),r);else if(P){var l={type:"rrweb",event:G(a),origin:window.location.origin,isCheckout:r};window.parent.postMessage(l,"*")}if(a.type===o.FullSnapshot)W=a,q=0;else if(a.type===o.IncrementalSnapshot){if(a.data.source===u.Mutation&&a.data.isAttachIframe)return;q++,(n&&q>=n||i&&a.timestamp-W.timestamp>i)&&ye(!0)}};var V=t=>{if(T&&t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null;t.removes.forEach((t=>{var{id:r}=t;if(!e||!e.has(r)){var i=H.get(r);i&&(i(),H.delete(r)),Y.removeIframeById(r)}})),function(){for(var[t,e]of H){var r=xe.getNode(t);if(r)try{r.contentDocument&&r.contentDocument.defaultView||(e(),H.delete(t))}catch(r){e(),H.delete(t)}else e(),H.delete(t)}}()}ge({type:o.IncrementalSnapshot,data:r({source:u.Mutation},t)})},Z=t=>ge({type:o.IncrementalSnapshot,data:r({source:u.Scroll},t)}),J=t=>ge({type:o.IncrementalSnapshot,data:r({source:u.CanvasMutation},t)}),X=new _e({mutationCb:V,adoptedStyleSheetCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.AdoptedStyleSheet},t)})}),Y=new ie({mirror:xe,mutationCb:V,stylesheetManager:X,recordCrossOriginIframes:T,wrappedEmit:ge});for(var K of F||[])K.getMirror&&K.getMirror({nodeMirror:xe,crossOriginIframeMirror:Y.crossOriginIframeMirror,crossOriginIframeStyleMirror:Y.crossOriginIframeStyleMirror});var Q=new Ce;be=new Ie({recordCanvas:M,mutationCb:J,win:window,blockClass:s,blockSelector:a,mirror:xe,sampling:k.canvas,dataURLOptions:B});var tt=new ne({mutationCb:V,scrollCb:Z,bypassOptions:{blockClass:s,blockSelector:a,maskTextClass:d,maskTextSelector:c,inlineStylesheet:f,maskInputOptions:z,dataURLOptions:B,maskTextFn:y,maskInputFn:g,recordCanvas:M,inlineImages:L,sampling:k,slimDOMOptions:j,iframeManager:Y,stylesheetManager:X,canvasManager:be,keepIframeSrcFn:N,processedNodeManager:Q},mirror:xe});ye=function(t){if(void 0===t&&(t=!1),C){ge({type:o.Meta,data:{href:window.location.href,width:St(),height:kt()}},t),X.reset(),tt.init(),qt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new O,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:a=null,inlineStylesheet:o=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:h=!1,maskTextFn:d,maskInputFn:c,slimDOM:f=!1,dataURLOptions:v,preserveWhiteSpace:p,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k=(()=>!1),maxDepth:S}=e||{};return ht(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:o,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:d,maskInputFn:c,slimDOMOptions:dt(f),dataURLOptions:v,inlineImages:u,recordCanvas:l,preserveWhiteSpace:p,onSerialize:m,onIframeLoad:g,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:k,newlyAddedElement:!1,maxDepth:S})}(document,{mirror:xe,blockClass:s,blockSelector:a,maskTextClass:d,maskTextSelector:c,inlineStylesheet:f,maskAllInputs:z,maskTextFn:y,maskInputFn:g,slimDOM:j,dataURLOptions:B,recordCanvas:M,inlineImages:L,onSerialize(t){xt(t,xe)&&Y.addIframe(t),Rt(t,xe)&&X.trackLinkElement(t),Ot(t)&&tt.addShadowRoot(_.shadowRoot(t),document)},onIframeLoad(t,e){Y.attachIframe(t,e),tt.observeAttachShadow(t)},onStylesheetLoad(t,e){X.attachLinkElement(t,e)},keepIframeSrcFn:N});if(!e)return console.warn("Failed to snapshot the document");ge({type:o.FullSnapshot,data:{node:e,initialOffset:wt(window)}},t),qt.forEach((t=>t.unlock())),T&&Y.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&X.adoptStyleSheets(document.adoptedStyleSheets,xe.getId(document))}};try{var et=[],rt=t=>{var e;return jt(Qt)({mutationCb:V,mousemoveCb:(t,e)=>ge({type:o.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.MouseInteraction},t)}),scrollCb:Z,viewportResizeCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.ViewportResize},t)}),inputCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.Input},t)}),mediaInteractionCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.MediaInteraction},t)}),styleSheetRuleCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.StyleSheetRule},t)}),styleDeclarationCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.StyleDeclaration},t)}),canvasMutationCb:J,fontCb:t=>ge({type:o.IncrementalSnapshot,data:r({source:u.Font},t)}),selectionCb(t){ge({type:o.IncrementalSnapshot,data:r({source:u.Selection},t)})},customElementCb(t){ge({type:o.IncrementalSnapshot,data:r({source:u.CustomElement},t)})},blockClass:s,ignoreClass:l,ignoreSelector:h,maskTextClass:d,maskTextSelector:c,maskInputOptions:z,inlineStylesheet:f,sampling:k,recordDOM:C,recordCanvas:M,inlineImages:L,userTriggeredOnInput:R,collectFonts:A,doc:t,maskInputFn:g,maskTextFn:y,keepIframeSrcFn:N,blockSelector:a,slimDOMOptions:j,dataURLOptions:B,mirror:xe,iframeManager:Y,stylesheetManager:X,shadowDomManager:tt,processedNodeManager:Q,canvasManager:be,ignoreCSSAttributes:E,plugins:(null==(e=null==F?void 0:F.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ge({type:o.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},b)};Y.addLoadListener((t=>{try{var e=xe.getId(t),r=rt(t.contentDocument);et.push(r),-1!==e&&H.set(e,r)}catch(t){console.warn(t)}})),Y.addPageHideListener((t=>{var e=xe.getId(t),r=H.get(e);r&&(r(),H.delete(e)),function(t){for(var e=qt.length-1;e>=0;e--){var r=qt[e];r.bufferBelongsToIframe(t)&&(r.reset(),qt.splice(e,1))}}(t)}));var it=()=>{ye(),et.push(rt(document)),Me=!0};return["interactive","complete"].includes(document.readyState)?it():(et.push(ft("DOMContentLoaded",(()=>{ge({type:o.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&it()}))),et.push(ft("load",(()=>{ge({type:o.Load,data:{}}),"load"===x&&it()}),window))),()=>{et.forEach((t=>vt(t))),Q.destroy(),Y.removeLoadListener(),Y.destroy(),H.clear(),xe.reset(),Me=!1,Dt=void 0}}catch(t){console.warn(t)}}Re.addCustomEvent=(t,e)=>{if(!Me)throw new Error("please add custom event after start recording");ge({type:o.Custom,data:{tag:t,payload:e}})},Re.freezePage=()=>{qt.forEach((t=>t.freeze()))},Re.takeFullSnapshot=t=>{if(!Me)throw new Error("please take full snapshot after start recording");ye(t)},Re.mirror=xe;var Oe=Object.defineProperty,Ae=(t,e,r)=>((t,e,r)=>e in t?Oe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class Le{constructor(t){Ae(this,"fileName"),Ae(this,"functionName"),Ae(this,"lineNumber"),Ae(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 Fe=/(^|@)\S+:\d+/,Ne=/^\s*at .*(\S+:\d+|\(native\))/m,Ee=/^(eval@)?(\[native code])?$/,De={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Ne)?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(Ne)}),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 Le({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Ee)}),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 Le({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Le({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 Le({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 Le({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(Fe)&&!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 Le({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Be(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 Ue(t){return Array.isArray(t)}function Pe(t){return"object"==typeof t&&null!==t&&!Ue(t)}function We(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Pe(t[i])&&We(t[i],e-1))return!0;return!1}function $e(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(Pe(a=e)&&Object.keys(a).length>r.numOfKeysLimit||"function"==typeof a||Pe(a)&&We(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]=Ue(l)?Be(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 ze={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 je(t,e,r){var i,n=r?Object.assign({},ze,r):ze,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=De.parse(e.error).map((t=>t.toString())),s=[$e(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=[$e("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[$e("Uncaught (in promise)",n.stringifyOptions),$e(e.reason,n.stringifyOptions)]);var s=De.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=(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=De.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===r?u.slice(1):u).map((t=>$e(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:r,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[$e("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{o=!1}}})(l);return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:l}})),e[s]=h,()=>{e[s]=l}}catch(t){return()=>{}}}(e,r):()=>{}}}var qe="undefined"!=typeof window?window:void 0,He="undefined"!=typeof globalThis?globalThis:qe;"undefined"==typeof self&&(He.self=He),"undefined"==typeof File&&(He.File=function(){});var Ge=null==He?void 0:He.document;null!=He&&He.XMLHttpRequest&&new He.XMLHttpRequest;var Ve=null!=qe?qe:{},Ze=Object.prototype,Je=Ze.hasOwnProperty,Xe=Ze.toString,Ye=Array.isArray||function(t){return"[object Array]"===Xe.call(t)},Ke=t=>"function"==typeof t,Qe=t=>t===Object(t)&&!Ye(t),tr=t=>void 0===t,er=t=>"[object String]"==Xe.call(t),rr=t=>null===t,ir=t=>tr(t)||rr(t),nr=t=>"[object Number]"==Xe.call(t)&&t==t,sr=t=>"[object Boolean]"===Xe.call(t),ar=t=>t instanceof FormData;function or(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),nr(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),or(n||r,e,r,i))}class ur{constructor(t){this.$t={},this.zt=t.zt,this.Ut=or(t.bucketSize,0,100,t.Yt),this.Wt=or(t.refillRate,0,this.Ut,t.Yt),this.Gt=or(t.refillInterval,0,864e5,t.Yt)}Xt(t,e){var r=Math.floor((e-t.lastAccess)/this.Gt);r>0&&(t.tokens=Math.min(t.tokens+r*this.Wt,this.Ut),t.lastAccess=t.lastAccess+r*this.Gt)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.$t[i];return n?this.Xt(n,r):this.$t[i]=n={tokens:this.Ut,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.zt)||e.call(this,t)),0===n.tokens)}stop(){this.$t={}}}var lr=t=>t instanceof Document,hr="1.372.2",dr="web",cr=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={C(e){if(qe&&(Ve.POSTHOG_DEBUG||r)&&!tr(qe.console)&&qe.console){for(var i=("__rrweb_original__"in qe.console[e]?qe.console[e].__rrweb_original__:qe.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)}},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.C("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.C("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.C("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)=>cr(t+" "+e,r)};return i},fr=cr("[PostHog.js]"),vr=fr.createLogger;function pr(t,e){if(!ir(t))if(Ye(t))t.forEach(e);else if(ar(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)Je.call(t,r)&&e(t[r],r)}function mr(t,e,r,i){var{capture:n=!1,passive:s=!0}={};null==t||t.addEventListener(e,r,{capture:n,passive:s})}var gr=["localhost","127.0.0.1"],yr=t=>{var e=null==Ge?void 0:Ge.createElement("a");return tr(e)?null:(e.href=t,e)},br=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return pr(t,(function(t,e){tr(t)||tr(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)};function wr(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return Ke(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function kr(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}var Sr="$session_recording_remote_config",Ir="$replay_override_sampling",_r="$replay_override_linked_flag",Cr="$replay_override_url_trigger",Mr="$replay_override_event_trigger",Tr="$session_is_sampled",xr="$session_past_minimum_duration",Rr="$session_recording_url_trigger_activated_session",Or="$session_recording_event_trigger_activated_session",Ar="$posthog_sr_group_event_trigger_",Lr="$posthog_sr_group_url_trigger_",Fr="$posthog_sr_group_sampling_",Nr="$debug_first_full_snapshot_timestamp",Er="$stored_person_properties",Dr="$sdk_debug_replay_remote_trigger_matching_config",Br=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})"),Ur=new RegExp("(\\d{3}-?\\d{2}-?\\d{4})"),Pr="[SessionRecording]",Wr="redacted",$r={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:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},zr=["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"],jr=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],qr=["/s/","/e/","/i/"];function Hr(t,e,r,i){if(ir(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return er(n)&&(n=parseInt(n)),n>r?Pr+" "+i+" body too large to record ("+n+" bytes)":t}function Gr(t,e){if(ir(t))return t;var r=t;return function(t,e){if(ir(t))return!1;if(er(t)){if(t=t.trim(),Br.test((t||"").replace(/[- ]/g,"")))return!1;if(Ur.test(t))return!1}return!0}(r)||(r=Pr+" "+e+" body "+Wr),pr(jr,(t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r=Pr+" "+e+" body "+Wr+" as might contain: "+t)})),r}var Vr=vr("[Recorder]"),Zr=t=>"navigation"===t.entryType,Jr=t=>"resource"===t.entryType;function Xr(t,e){return!!e&&(sr(e)||e[t])}function Yr(t){var{type:e,recordBody:r,headers:i,url:n}=t;function s(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.includes(t)))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(sr(r))return!0;if(Ye(r))return s(r);var a=r[e];return sr(a)?a:s(a)}function Kr(t,e,r,i,n,s){return Qr.apply(this,arguments)}function Qr(){return Qr=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return Vr.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(Jr(a=t[s])&&a.initiatorType===e&&(tr(i)||a.startTime>=i)&&(tr(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(r));return a||(yield new Promise((t=>setTimeout(t,50*s))),Kr(t,e,r,i,n,s+1))})),Qr.apply(this,arguments)}function ti(t){var{body:e,options:r,url:i}=t;if(ir(e))return null;var{hostname:n,isHostDenied:s}=kr(i,r);if(s)return n+" is in deny list";if(er(e))return e;if(lr(e))return e.textContent;if(ar(e))return br(e);if(Qe(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=>!rr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ri(t){var{entry:e,method:i,status:n,networkRequest:s,isInitial:a,start:o,end:u,url:l,initiatorType:h}=t;o=e?e.startTime:o,u=e?e.responseEnd:u;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(o||0)),f=[r({},e?e.toJSON():{name:l},{startTime:tr(o)?void 0:Math.round(o),endTime:tr(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 v of e.serverTiming||[])f.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return f}var ii=["video/","audio/"];function ni(t){return new Promise((e=>{var r=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>e("[SessionReplay] Failed to read body: "+t))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e("[SessionReplay] Failed to read body")}}))}function si(){return(si=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:s}=kr(i,r);return s?Promise.resolve(n+" is in deny list"):ni(e)}))).apply(this,arguments)}function ai(){return(ai=e((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;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=ii.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var{hostname:o,isHostDenied:u}=kr(n,i);return u?o+" is in deny list":null}({r:e,options:r,url:i});return rr(n)?ni(e):Promise.resolve(n)}))).apply(this,arguments)}var oi=null;function ui(t,i,n){if(!("performance"in i))return()=>{};if(oi)return Vr.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},$r,n):$r,a=e=>{var i=[];e.requests.forEach((t=>{var e=s.maskRequestFn(t);e&&i.push(e)})),i.length>0&&t(r({},e,{requests:i}))},o=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Zr(t)||Jr(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>ri({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=>Zr(t)||Jr(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>ri({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=Xr("request",r.recordHeaders),n=Xr("response",r.recordHeaders),s=wr(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,u,l,h){void 0===u&&(u=!0);var d,c,f=this,v=new Request(o),p={},m={},g=f.setRequestHeader.bind(f);f.setRequestHeader=(t,e)=>(m[t]=e,g(t,e)),i&&(p.requestHeaders=m);var y=f.send.bind(f);f.send=t=>(Yr({type:"request",headers:m,url:o,recordBody:r.recordBody})&&(p.requestBody=ti({body:t,options:r,url:o})),d=e.performance.now(),y(t));var b=()=>{f.removeEventListener("readystatechange",w),f.removeEventListener("error",b),f.removeEventListener("abort",b),f.removeEventListener("timeout",b)},w=()=>{if(f.readyState===f.DONE){b(),c=e.performance.now();var i={};f.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),Yr({type:"response",headers:i,url:o,recordBody:r.recordBody})&&(p.responseBody=ti({body:f.response,options:r,url:o})),Kr(e,"xmlhttprequest",v.url,d,c).then((e=>{var r=ri({entry:e,method:a,status:null==f?void 0:f.status,networkRequest:p,start:d,end:c,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};f.addEventListener("readystatechange",w),f.addEventListener("error",b),f.addEventListener("abort",b),f.addEventListener("timeout",b),s.call(f,a,o.toString(),u,l,h)}));return()=>{s()}}(a,i,s),l=function(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Xr("request",i.recordHeaders),s=Xr("response",i.recordHeaders),a=wr(r,"fetch",(a=>function(){var o=e((function*(e,o){var u,l,h,d=new Request(e,o),c={};try{var f={};d.headers.forEach(((t,e)=>{f[e]=t})),n&&(c.requestHeaders=f),Yr({type:"request",headers:f,url:e,recordBody:i.recordBody})&&(c.requestBody=yield function(t){return si.apply(this,arguments)}({r:d,options:i,url:e})),l=r.performance.now(),u=yield a(d),h=r.performance.now();var v={};return u.headers.forEach(((t,e)=>{v[e]=t})),s&&(c.responseHeaders=v),Yr({type:"response",headers:v,url:e,recordBody:i.recordBody})&&(c.responseBody=yield function(t){return ai.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{Kr(r,"fetch",d.url,l,h).then((e=>{var r,i=ri({entry:e,method:d.method,status:null==(r=u)?void 0:r.status,networkRequest:c,start:l,end:h,url:d.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return o.apply(this,arguments)}}()));return()=>{a()}}(a,i,s)),oi=()=>{o(),u(),l(),oi=null}}var li={DomContentLoaded:0,Load:1,FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Custom:5,Plugin:6},hi="disabled",di="sampled",ci="active",fi="buffering",vi="paused",pi="rrweb_error",mi="trigger",gi=mi+"_activated",yi=mi+"_pending",bi=mi+"_"+hi;function wi(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 ki{constructor(t){this.t=t}triggerStatus(t){var e=this.t.map((e=>e.triggerStatus(t)));return e.includes(gi)?gi:e.includes(yi)?yi:bi}stop(){this.t.forEach((t=>t.stop()))}}class Si{constructor(t){this.t=t}triggerStatus(t){var e=new Set;for(var r of this.t)e.add(r.triggerStatus(t));switch(e.delete(bi),e.size){case 0:return bi;case 1:return Array.from(e)[0];default:return yi}}stop(){this.t.forEach((t=>t.stop()))}}class Ii{triggerStatus(){return gi}stop(){}}var _i=t=>"sessionRecording"in t;class Ci{constructor(t,e){this.u=[],this.Ia=[],this.Aa=new Map,this.Ra=new Map,this.Na="",this.urlBlocked=!1,this._instance=t,this.Ma=e}onConfig(t){var e,r;this.u=(_i(t)?Qe(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.Ia=(_i(t)?Qe(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Fa()}Fa(){for(var t of(this.Aa.clear(),this.Ra.clear(),this.u))if("regex"===t.matching&&!this.Aa.has(t.url))try{this.Aa.set(t.url,new RegExp(t.url))}catch(e){fr.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.Ia)if("regex"===e.matching&&!this.Ra.has(e.url))try{this.Ra.set(e.url,new RegExp(e.url))}catch(t){fr.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}Ba(t){var e;return 0===this.u.length?bi:(null==(e=this._instance)?void 0:e.get_property(this.Ma?Lr+this.Ma:Rr))===t?gi:yi}triggerStatus(t){var e=this.Ba(t),r=e===gi?gi:e===yi?yi:bi;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:r}),r}checkUrlBlocklist(t,e){if(void 0!==qe&&qe.location.href){var r=qe.location.href;if(r!==this.Na){this.Na=r;var i=this.urlBlocked,n=wi(r,this.Ia,this.Ra);i&&n||(n&&!i?t():!n&&i&&e())}}}checkUrlTriggerConditions(t,e,r,i){if(void 0!==qe&&qe.location.href){var n=qe.location.href;if(n!==this.Na){this.Na=n;var s=this.urlBlocked,a=wi(n,this.Ia,this.Ra);a&&!s?t():!a&&s&&e();var o=this.Ba(i)===gi,u=wi(n,this.u,this.Aa);!o&&u&&r("url",n)}}}stop(){this.Na=""}}class Mi{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Oa=()=>{},this._instance=t}triggerStatus(){var t=yi;return ir(this.linkedFlag)&&(t=bi),this.linkedFlagSeen&&(t=gi),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}onConfig(t,e){var r;if(this.linkedFlag=(_i(t)?Qe(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!ir(this.linkedFlag)&&!this.linkedFlagSeen){var i=er(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=er(this.linkedFlag)?null:this.linkedFlag.variant;this.Oa=this._instance.onFeatureFlags(((t,r)=>{var s=!1;if(Qe(r)&&i in r){var a=r[i];s=sr(a)?!0===a:n?a===n:!!a}this.linkedFlagSeen=s,s&&e(i,n)}))}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.Oa()}}class Ti{constructor(t,e){this.Za=[],this._instance=t,this.Ma=e}onConfig(t){var e;this.Za=(_i(t)?Qe(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}Ya(t){var e;return 0===this.Za.length?bi:(null==(e=this._instance)?void 0:e.get_property(this.Ma?Ar+this.Ma:Or))===t?gi:yi}triggerStatus(t){var e=this.Ya(t),r=e===gi?gi:e===yi?yi:bi;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:r}),r}checkEventTriggerConditions(t,e,r){if(0!==this.Za.length){var i=this.Ya(r)===gi,n=this.Za.includes(t);!i&&n&&e("event",t)}}stop(){}}class xi{constructor(t,e,r){if(this._instance=t,this.group=e,this.Ga=new Ci(t,e.id),this.La=new Ti(t,e.id),this.Da=new Mi(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.Ga.onConfig(n),this.La.onConfig(n),this.Da.onConfig(n,r);var s=[this.La,this.Ga,this.Da];this.Wa="any"===e.conditions.matchType?new ki(s):new Si(s)}else this.Wa=new Ii}triggerStatus(t){return this.Wa.triggerStatus(t)}checkEventTriggerConditions(t,e,r){this.La.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.Ga.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r;null==(r=this._instance.persistence)||r.register({["url"===t?Lr+this.group.id:Ar+this.group.id]:e})}stop(){this.Ga.stop(),this.La.stop(),this.Da.stop()}}function Ri(t){if(t.rrwebError)return pi;if(!t.receivedFlags)return fi;if(!t.isRecordingEnabled)return hi;if(t.urlTriggerMatching.urlBlocked)return vi;var e=!0===t.isSampled,r=new ki([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?di:r===gi?ci:r===yi?fi:!1===t.isSampled?hi:ci}function Oi(t){if(t.rrwebError)return pi;if(!t.receivedFlags)return fi;if(!t.isRecordingEnabled)return hi;if(t.urlTriggerMatching.urlBlocked)return vi;var e=new Si([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==bi,i=sr(t.isSampled);return r&&e===yi?fi:r&&e===bi||i&&!t.isSampled?hi:!0===t.isSampled?di:ci}function Ai(t){var e,r;return(null==(e=JSON.stringify(t,(r=[],function(t,e){if(Qe(e)){for(;r.length>0&&r[r.length-1]!==this;)r.pop();return r.includes(e)?"[Circular]":(r.push(e),e)}return e})))?void 0:e.length)||0}function Li(t){if(rr(t))return 4;if(tr(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(Ye(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=tr(i)||rr(i)?4:Li(i)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var u=n[o];tr(u)||(a||(s+=1),a=!1,s+=o.length+3+Li(u))}return s;default:return 0}}var Fi=Uint8Array,Ni=Uint16Array,Ei=Uint32Array,Di=new Fi([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]),Bi=new Fi([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]),Ui=new Fi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pi=function(t,e){for(var r=new Ni(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new Ei(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]},Wi=Pi(Di,2),$i=Wi[1];Wi[0][28]=258,$i[258]=28;for(var zi=Pi(Bi,0)[1],ji=new Ni(32768),qi=0;32768>qi;++qi){var Hi=(43690&qi)>>>1|(21845&qi)<<1;ji[qi]=((65280&(Hi=(61680&(Hi=(52428&Hi)>>>2|(13107&Hi)<<2))>>>4|(3855&Hi)<<4))>>>8|(255&Hi)<<8)>>>1}var Gi=function(t,e,r){for(var i=t.length,n=0,s=new Ni(e);i>n;++n)++s[t[n]-1];var a,o=new Ni(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(r){a=new Ni(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[ji[d]>>>u]=l}else for(a=new Ni(i),n=0;i>n;++n)a[n]=ji[o[t[n]-1]++]>>>15-t[n];return a},Vi=new Fi(288);for(qi=0;144>qi;++qi)Vi[qi]=8;for(qi=144;256>qi;++qi)Vi[qi]=9;for(qi=256;280>qi;++qi)Vi[qi]=7;for(qi=280;288>qi;++qi)Vi[qi]=8;var Zi=new Fi(32);for(qi=0;32>qi;++qi)Zi[qi]=5;var Ji=Gi(Vi,9,0),Xi=Gi(Zi,5,0),Yi=function(t){return(t/8>>0)+(7&t&&1)},Ki=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof Ni?Ni:t instanceof Ei?Ei:Fi)(r-e);return i.set(t.subarray(e,r)),i},Qi=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},tn=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},en=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 Fi(0),0];if(1==n){var a=new Fi(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 f=new Ni(c+1),v=rn(r[h-1],f,0);if(v>e){i=0;var p=0,m=v-e,g=1<<m;for(s.sort((function(t,e){return f[e.s]-f[t.s]||t.f-e.f}));n>i;++i){var y=s[i].s;if(e>=f[y])break;p+=g-(1<<v-f[y]),f[y]=e}for(p>>>=m;p>0;){var b=s[i].s;e>f[b]?p-=1<<e-f[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;f[w]==e&&(--f[w],++p)}v=e}return[new Fi(f),v]},rn=function(t,e,r){return-1==t.s?Math.max(rn(t.l,e,r+1),rn(t.r,e,r+1)):e[t.s]=r},nn=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Ni(++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]},sn=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},an=function(t,e,r){var i=r.length,n=Yi(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)},on=function(t,e,r,i,n,s,a,o,u,l,h){Qi(e,h++,r),++n[256];for(var d=en(n,15),c=d[0],f=d[1],v=en(s,15),p=v[0],m=v[1],g=nn(c),y=g[0],b=g[1],w=nn(p),k=w[0],S=w[1],I=new Ni(19),_=0;y.length>_;++_)I[31&y[_]]++;for(_=0;k.length>_;++_)I[31&k[_]]++;for(var C=en(I,7),M=C[0],T=C[1],x=19;x>4&&!M[Ui[x-1]];--x);var R,O,A,L,F=l+5<<3,N=sn(n,Vi)+sn(s,Zi)+a,E=sn(n,c)+sn(s,p)+a+14+3*x+sn(I,M)+(2*I[16]+3*I[17]+7*I[18]);if(N>=F&&E>=F)return an(e,h,t.subarray(u,u+l));if(Qi(e,h,1+(N>E)),h+=2,N>E){R=Gi(c,f,0),O=c,A=Gi(p,m,0),L=p;var D=Gi(M,T,0);for(Qi(e,h,b-257),Qi(e,h+5,S-1),Qi(e,h+10,x-4),h+=14,_=0;x>_;++_)Qi(e,h+3*_,M[Ui[_]]);h+=3*x;for(var B=[y,k],U=0;2>U;++U){var P=B[U];for(_=0;P.length>_;++_)Qi(e,h,D[W=31&P[_]]),h+=M[W],W>15&&(Qi(e,h,P[_]>>>5&127),h+=P[_]>>>12)}}else R=Ji,O=Vi,A=Xi,L=Zi;for(_=0;o>_;++_)if(i[_]>255){var W;tn(e,h,R[257+(W=i[_]>>>18&31)]),h+=O[W+257],W>7&&(Qi(e,h,i[_]>>>23&31),h+=Di[W]);var z=31&i[_];tn(e,h,A[z]),h+=L[z],z>3&&(tn(e,h,i[_]>>>5&8191),h+=Bi[z])}else tn(e,h,R[i[_]]),h+=O[i[_]];return tn(e,h,R[256]),h+O[256]},un=new Ei([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ln=function(){for(var t=new Ei(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),hn=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=ln[255&r^e[i]]^r>>>8;t=r},d:()=>4294967295^t}},dn=function(t,e,r,i,n){return function(t,e,r,i,n,s){var a=t.length,o=new Fi(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=an(u,l,t.subarray(h,d)):(u[h]=true,l=an(u,l,t.subarray(h,a)))}else{for(var c=un[e-1],f=c>>>13,v=8191&c,p=(1<<r)-1,m=new Ni(32768),g=new Ni(p+1),y=Math.ceil(r/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},k=new Ei(25e3),S=new Ni(288),I=new Ni(32),_=0,C=0,M=(h=0,0),T=0,x=0;a>h;++h){var R=w(h),O=32767&h,A=g[R];if(m[O]=A,g[R]=O,h>=T){var L=a-h;if((_>7e3||M>24576)&&L>423){l=on(t,u,0,k,S,I,C,M,x,h-x,l),M=_=C=0,x=h;for(var F=0;286>F;++F)S[F]=0;for(F=0;30>F;++F)I[F]=0}var N=2,E=0,D=v,B=O-A&32767;if(L>2&&R==w(h-B))for(var U=Math.min(f,L)-1,P=Math.min(32767,h),W=Math.min(258,L);P>=B&&--D&&O!=A;){if(t[h+N]==t[h+N-B]){for(var z=0;W>z&&t[h+z]==t[h+z-B];++z);if(z>N){if(N=z,E=B,z>U)break;var j=Math.min(B,z-2),q=0;for(F=0;j>F;++F){var H=h-B+F+32768&32767,G=H-m[H]+32768&32767;G>q&&(q=G,A=H)}}}B+=(O=A)-(A=m[O])+32768&32767}if(E){k[M++]=268435456|$i[N]<<18|zi[E];var V=31&$i[N],Z=31&zi[E];C+=Di[V]+Bi[Z],++S[257+V],++I[Z],T=h+N,++_}else k[M++]=t[h],++S[t[h]]}}l=on(t,u,true,k,S,I,C,M,x,h-x,l)}return Ki(o,0,i+Yi(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)},cn=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},fn=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&&cn(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)}},vn=function(t){return 10+(t.filename&&t.filename.length+1||0)};class pn{constructor(t,e){var r,i;void 0===e&&(e={}),this.Va={},this.Xa=t=>{if(!this.Va[t]){var e,r;this.Va[t]=!0;var i=this.za(t);null==(e=(r=this.Ja).onBlockedNode)||e.call(r,t,i)}},this.Ka=t=>{var e=this.za(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.za=t=>this._rrweb.mirror.getNode(t),this.Ha=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.Ha(e);e.attributes&&(e.attributes=e.attributes.filter((t=>{var[e]=this.Ka(t.id);return!this.co.consumeRateLimit(e)&&t})));var i=this.Ha(e);return 0!==i||r===i?t:void 0},this._rrweb=t,this.Ja=e,this.co=new ur({bucketSize:null!==(r=this.Ja.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.Ja.refillRate)&&void 0!==i?i:10,refillInterval:1e3,zt:this.Xa,Yt:fr})}reset(){this.Va={}}stop(){this.co.stop(),this.reset()}}var mn="$sess_rec_flush_size";class gn{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.ja=t.get_property.bind(t),this.Ua=t.persistence.set_property.bind(t.persistence)}trackSize(t){var e=Number(this.ja(mn))||0;this.Ua(mn,e+t)}reset(){return this.Ua(mn,0)}get currentTrackedSize(){return Number(this.ja(mn))||0}}function yn(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<or(100*e,0,100,fr)}var bn=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}},wn={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=>bn(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!bn(e,t))))),icontains:(t,e)=>e.map(kn).some((e=>t.map(kn).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(kn).every((e=>t.map(kn).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)))}))},kn=t=>t.toLowerCase(),Sn=new Set(["is_not","not_icontains","not_regex"]);function In(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(tr(n)||rr(n))return Sn.has(s);var a=wn[s];return!!a&&!tr(t.value)&&!rr(t.value)&&a(Ye(t.value)?t.value.map(String):[String(t.value)],Ye(n)?n.map(String):[String(n)])}))}var _n=vr("[SessionRecording]");class Cn{constructor(t,e,r,i,n,s){this.Pa=null,this.qa=Oi,this._instance=t,this.Ga=e,this.La=r,this.Da=i,this.Qa=n,this.$a=s}onRemoteConfig(t){this.Pa=nr(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.tu=new ki([this.La,this.Ga]),this.qa=Ri):(this.tu=new Si([this.La,this.Ga]),this.qa=Oi),this._instance.register_for_session({[Dr]:t.triggerMatchType}),this.Ga.onConfig(t),this.La.onConfig(t),this.Da.onConfig(t,((t,e)=>{this.Qa("linked_flag_matched",{flag:t,variant:e})}))}getStatus(t){return this.qa({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 nr(r)?r:null}checkUrlTriggers(t,e,r,i){this.Ga.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.La.Za.length&&ir(this.eu))return this.eu=t((t=>{try{this.La.checkEventTriggerConditions(t.event,r,e)}catch(t){_n.error("Could not activate event trigger",t)}})),this.eu}makeSamplingDecisions(t){var e,r=this.Pa;if(nr(r)){var i=this._instance.get_property(Tr),n=i===t||!1!==i&&null,s="string"==typeof i&&i!==t||!sr(n),a=s?yn(t,r):n;s&&(a?this.Qa("sampled"):_n.warn("Sample rate ("+r+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[Tr]:!!a&&t})}else{var o;null==(o=this._instance.persistence)||o.unregister(Tr)}}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i;null==(t=this._instance.persistence)||t.unregister(Or),null==(e=this._instance.persistence)||e.unregister(Rr),null==(r=this._instance.persistence)||r.unregister(Tr),null==(i=this._instance.persistence)||i.unregister(xr)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.tu)?void 0:e.triggerStatus(t))===yi}stop(){var t;null==(t=this.eu)||t.call(this),this.eu=void 0,this.La.stop(),this.Ga.stop(),this.Da.stop()}}class Mn{constructor(t,e,r,i){this.ru=[],this.iu=new Map,this.nu=!1,this._instance=t,this.Ga=e,this.Qa=r,this.su=i}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.ou(t.triggerGroups),this._instance.register_for_session({[Dr]:"v2_trigger_groups",$sdk_debug_replay_trigger_groups_count:t.triggerGroups.length}),this.Ga.onConfig(t)):_n.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return pi;if(t.urlTriggerMatching.urlBlocked)return vi;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return hi;var i=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if(a===gi){var o=s.group.id,u=r.get(o);tr(u)?fr.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===u&&(n=!0)}else a===yi&&(i=!0)}return n?di:i?fi:hi}({isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.ru,triggerGroupSamplingResults:this.iu,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.ru)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;nr(i)&&(rr(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.Ga.checkUrlBlocklist(e,r);var s=function(i){i.checkUrlTriggerConditions(e,r,(e=>{n.au(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t))}),t)};for(var a of this.ru)s(a)}setupEventTriggerListeners(t,e,r){var i=this;return this.eu=t((t=>{var r;if(this.nu)return _n.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.eu)||r.call(this),void(this.eu=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,(n=>{if(i.au(r,t.properties)){var s=(r.group.conditions.events||[]).filter((e=>e.name===t.event)),a=i._instance.get_property(Er);s.some((e=>!e.properties||0===e.properties.length||In(e.properties,t.properties,a)))&&(r.activateTrigger(n,e),i.updateActiveTriggers(e))}}),e)};for(var s of this.ru)n(s)}catch(t){_n.error("Could not activate event trigger for trigger groups",t)}})),this.eu}makeSamplingDecisions(t){for(var e of this.ru){var r,i=e.group,n=i.id,s=i.sampleRate,a=Fr+n,o=this._instance.get_property(a),u=o===t||!1!==o&&null,l="string"==typeof o&&o!==t||!sr(u),h=l?yn(t+n,s):u;l&&this.su("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:s,isSampled:h}),this.iu.set(n,h),null==(r=this._instance.persistence)||r.register({[a]:!!h&&t})}this.updateActiveTriggers(t)}onFlushComplete(){this.nu=!0}clearConditionalRecordingPersistence(){var t,e;for(var r of(null==(t=this._instance.persistence)||t.unregister(Tr),null==(e=this._instance.persistence)||e.unregister(xr),this.ru)){var i,n,s,a=r.group.id;null==(i=this._instance.persistence)||i.unregister(Ar+a),null==(n=this._instance.persistence)||n.unregister(Lr+a),null==(s=this._instance.persistence)||s.unregister(Fr+a)}}updateActiveTriggers(t){var e=[];for(var r of this.ru){var i=r.group,n=i.id,s="trigger_activated"===r.triggerStatus(t),a=!0===this.iu.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.ru)if(e.triggerStatus(t)===yi)return!0;return!1}stop(){var t;null==(t=this.eu)||t.call(this),this.eu=void 0,this.ru.forEach((t=>t.stop())),this.ru=[],this.iu.clear(),this.Ga.stop()}au(t,e){var r=t.group.conditions.properties;return!r||0===r.length||In(r,e,this._instance.get_property(Er))}ou(t){var e=this;this.ru.forEach((t=>t.stop())),this.ru=[],this.iu.clear();var r=function(t){var r=new xi(e._instance,t,((r,i)=>{e.Qa("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name})}));e.ru.push(r)};for(var i of t)r(i)}}function Tn(t){return Qe(t)?t.network_timing:t}var xn,Rn="[SessionRecording]",On=vr(Rn),An=[1,2,3,4,5,6,7,12],Ln=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Fn(){var t;return null==Ve||null==(t=Ve.__PosthogExtensions__)?void 0:t.rrweb}function Nn(){var t;return null==(t=Fn())?void 0:t.record}function En(t){return function(t,e){for(var r="",i=0;t.length>i;){var n=t[i++];r+=String.fromCharCode(n)}return r}(function(t,e){void 0===e&&(e={});var r=hn(),i=t.length;r.p(t);var n=dn(t,e,vn(e),8),s=n.length;return fn(n,e),cn(n,s-8,r.d()),cn(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 Fi(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 Fi(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 Ki(i,0,n)}(JSON.stringify(t))))}function Dn(t){return Ye(t)&&0===t.length?xn=null!=xn?xn:En([]):En(t)}function Bn(t,e){return t.type===li.Custom&&t.data.tag===e}function Un(t){return Bn(t,"sessionIdle")}function Pn(t){return Bn(t,"$session_ending")}function Wn(t){return Bn(t,"$session_starting")}function $n(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[$n({size:i.reduce(((t,e)=>t+e),0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),$n({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]}class zn{get sessionId(){return this.ci}get lu(){if(!this._instance.sessionManager)throw new Error(Rn+" must be started with a valid sessionManager.");return this._instance.sessionManager}get uu(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get hu(){var t=this._instance.get_property(Tr);return!0===t?null:!1!==t&&(er(t)?t===this.sessionId:null)}get Pa(){var t,e=null==(t=this.Qo)?void 0:t.sampleRate;return nr(e)?e:null}get du(){var t,e;return null!==(t=null==(e=this.cu)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t){this.vu="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.fu=void 0,this.gu=Date.now(),this.mu=!1,this.pu=[],this.Iu="unknown",this.yu=!1,this.bu=!1,this.Cu=[],this.wu=void 0,this.eu=void 0,this.Su=void 0,this.ku=void 0,this.Au=void 0,this.Ru=void 0,this.ei=(t,e,r)=>{var i,n;if(r&&(t!==this.ci||e!==this.hi)){var s,a,o=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this.ci,l=this.hi;o&&this.su("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.gu,flushed_size:null==(s=this.Nu)?void 0:s.currentTrackedSize}),this.Nu&&this.Nu.reset(),null==(i=this._instance.persistence)||i.unregister(Nr),this.bu=!1,null==(n=Fn())||null==n.resetMaxDepthState||n.resetMaxDepthState(),this.su("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this._u(),!0===this.Iu&&(this.Iu="unknown",this.stop(),this.start("session_id_changed")),o&&this.su("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.gu}),nr(this.Pa)&&ir(this.Au)&&(null==(a=this.cu)||a.makeSamplingDecisions(t))}},this.Tu=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[xr])===this.ci},this.Mu=()=>{var t,e;if(0===this.T.data.length)return null;var r=null==(t=this.T.data[0])?void 0:t.timestamp,i=null==(e=this.T.data[this.T.data.length-1])?void 0:e.timestamp;return nr(r)&&nr(i)?i-r:null},this.Fu=()=>{var t,e,r=this.du;if(!nr(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.xu;return nr(i)&&i>=0&&r>i}if(this.Tu())return!1;var n,s=this.Mu();return!!rr(s)||r>s||(null==(n=this._instance.persistence)||n.register({[xr]:this.ci}),!1)},this.Bu=()=>{this.status!==fi?this.Ou():this.Zu()},this.Yu=()=>{this.su("browser offline",{})},this.Eu=()=>{this.su("browser online",{})},this.Ot=()=>{null!=Ge&&Ge.visibilityState&&this.su("window "+Ge.visibilityState,{})},this._instance=t;var{sessionId:e,windowId:r}=this.lu.checkAndGetSessionAndWindowId();this.ci=e,this.hi=r,this.Da=new Mi(this._instance),this.Ga=new Ci(this._instance),this.La=new Ti(this._instance),this.T=this.Zu(),this.lu.sessionTimeoutMs>this.uu||On.warn("session_idle_threshold_ms ("+this.uu+") is greater than the session timeout ("+this.lu.sessionTimeoutMs+"). Session will never be detected as idle"),this.Nu=new gn(this._instance)}get Gu(){var t,e,r,i,n,s,a,o=null==(t=this.Qo)?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 tr(l)&&tr(h)&&tr(d)?void 0:{maskAllInputs:null==l||l,maskTextSelector:h,blockSelector:d}}get Lu(){var t,e,r,i,n,s,a,o=this._instance.config.session_recording.captureCanvas,u=null==(t=this.Qo)?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:or(h,0,12,vr("canvas recording fps"),4),quality:or(d,0,1,vr("canvas recording quality"),.4)}}get Du(){var t,e=!(null==(t=this.Qo)||!t.consoleLogRecordingEnabled),r=this._instance.config.enable_recording_console_log;return null!=r?r:e}get Wu(){var t,e,r,i=null==(t=this.Qo)?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=Tn(this._instance.config.capture_performance),u=Tn(null==i?void 0:i.capturePerformance),l=!!(sr(o)?o:u);return s||a||l?{recordHeaders:s,recordBody:a,recordPerformance:l}:void 0}Vu(){var t,e,i=[],n=null==(t=Ve.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.Du&&i.push(n());var s,a,o,u,l,h,d,c,f,v,p,m=null==(e=Ve.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;return this.Wu&&Ke(m)&&(!gr.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(m((l={payloadSizeLimitBytes:$r.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...$r.performanceEntryTypeToObserve],payloadHostDenyList:[...(a=this.Wu).payloadHostDenyList||[],...$r.payloadHostDenyList]},h=!1!==(s=this._instance.config).session_recording.recordHeaders&&a.recordHeaders,d=!1!==s.session_recording.recordBody&&a.recordBody,c=!1!==s.capture_performance&&a.recordPerformance,u=Math.min(1e6,null!==(o=l.payloadSizeLimitBytes)&&void 0!==o?o:1e6),f=t=>(null!=t&&t.requestBody&&(t.requestBody=Hr(t.requestBody,t.requestHeaders,u,"Request")),null!=t&&t.responseBody&&(t.responseBody=Hr(t.responseBody,t.responseHeaders,u,"Response")),t),v=t=>{return f(((t,e)=>{var r,i=yr(t.name),n=0===e.indexOf("http")?null==(r=yr(e))?void 0:r.pathname:e;"/"===n&&(n="");var s=null==i?void 0:i.pathname.replace(n||"","");if(!(i&&s&&qr.some((t=>0===s.indexOf(t)))))return t})((ir(r=(e=t).requestHeaders)||pr(Object.keys(null!=r?r:{}),(t=>{zr.includes(t.toLowerCase())&&(r[t]=Wr)})),e),s.api_host));var e,r},(p=Ke(s.session_recording.maskNetworkRequestFn))&&Ke(s.session_recording.maskCapturedNetworkRequestFn)&&fr.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),p&&(s.session_recording.maskCapturedNetworkRequestFn=t=>{var e=s.session_recording.maskNetworkRequestFn({url:t.name});return r({},t,{name:null==e?void 0:e.url})}),l.maskRequestFn=Ke(s.session_recording.maskCapturedNetworkRequestFn)?t=>{var e,r=v(t);return r&&null!==(e=null==s.session_recording.maskCapturedNetworkRequestFn?void 0:s.session_recording.maskCapturedNetworkRequestFn(r))&&void 0!==e?e:void 0}:t=>function(t){if(!tr(t))return t.requestBody=Gr(t.requestBody,"Request"),t.responseBody=Gr(t.responseBody,"Response"),t}(v(t)),r({},$r,l,{recordHeaders:h,recordBody:d,recordPerformance:c,recordInitialRequests:c})))):On.info("NetworkCapture not started because we are on localhost.")),i}Xu(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}zu(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.pu.length?this.pu.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):On.warn("could not emit queued rrweb event.",e,t),!1}}su(t,e){return this.zu(Ln((()=>Nn().addCustomEvent(t,e))))}Ju(){try{if(this._instance.config.capture_pageview||!qe)return;var t=new URL(qe.location.href),e=this.Xu(t.origin+t.pathname+t.search);this.Ku!==e&&(this.Ku=e,this.su("$url_changed",{href:e}))}catch(t){}}Hu(){if(this.pu.length){var t=[...this.pu];this.pu=[],t.forEach((t=>{Date.now()-t.enqueuedAt>2e3||this.zu(t)}))}}$a(){return this.zu(Ln((()=>Nn().takeFullSnapshot())))}get ju(){var t,e,r;return null!=(t=this.cu)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)?6e4:null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Uu(){if(this.Pu&&clearInterval(this.Pu),!0!==this.Iu){var t=this.ju;t&&(this.Pu=setInterval((()=>{this.$a()}),t))}}qu(){this.Ga.urlBlocked||(this.Ga.urlBlocked=!0,clearInterval(this.Pu),On.info("recording paused due to URL blocker"),this.su("recording paused",{reason:"url blocker"}))}Qu(){this.Ga.urlBlocked&&(this.Ga.urlBlocked=!1,this.$a(),this.Uu(),this.su("recording resumed",{reason:"left blocked url"}),On.info("recording resumed"))}$u(t,e){var r;if(!this.mu&&null!=(r=this.cu)&&r.hasPendingTriggers(this.sessionId)){this.mu=!0;try{var i,n;null==(i=this._instance.persistence)||i.register({["url"===t?Rr:Or]:this.sessionId}),null==(n=this.cu)||n.updateActiveTriggers(this.sessionId),this.Ou(),this.Qa(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.mu=!1}}}get isStarted(){return!!this.fu}get Qo(){var t=this._instance.get_property(Sr);if(t){var e=Qe(t)?t:JSON.parse(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 On.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(Sr))}return e}}th(t,e,r){this._instance.get_property(t)&&(e(),r())}start(t){var e,r,i=this.Qo;if(i){var{sessionId:n,windowId:s}=this.lu.checkAndGetSessionAndWindowId();this.ci=n,this.hi=s,null==(e=this._instance.persistence)||e.unregister(Nr),null!=i&&i.endpoint&&(this.vu=null==i?void 0:i.endpoint),this.cu=2===(null==i?void 0:i.version)&&(null==i?void 0:i.triggerGroups)&&i.triggerGroups.length>0?new Mn(this._instance,this.Ga,this.Qa.bind(this),this.su.bind(this)):new Cn(this._instance,this.Ga,this.La,this.Da,this.Qa.bind(this),this.$a.bind(this)),this.cu.onRemoteConfig(i),null==(r=this.eu)||r.call(this),this.eu=this.cu.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,((t,e)=>this.$u(t,e))),this.th(Ir,(()=>{this.overrideSampling()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Ir)})),this.th(_r,(()=>{this.overrideLinkedFlag()}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(_r)})),this.th(Mr,(()=>{this.overrideTrigger("event")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Mr)})),this.th(Cr,(()=>{this.overrideTrigger("url")}),(()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(Cr)})),this.cu.makeSamplingDecisions(this.sessionId),this.eh(),this.yu||(mr(qe,"beforeunload",this.Bu),mr(qe,"offline",this.Yu),mr(qe,"online",this.Eu),mr(qe,"visibilitychange",this.Ot),this.Su||(this.Su=this.lu.onSessionId(this.ei)),this.ku||(this.ku=this.lu.on("forcedIdleReset",(()=>{this._u(),this.Iu="unknown",this.stop(),this.Ru=this.lu.onSessionId(((t,e,r)=>{var i;null==(i=this.Ru)||i.call(this),this.Ru=void 0,this.ei(t,e,r)}))}))),ir(this.wu)&&(this.wu=this._instance.on("eventCaptured",(t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.Xu(null==t?void 0:t.properties.$current_url):"";if(!e)return;this.su("$pageview",{href:e})}}catch(t){On.error("Could not add $pageview to rrweb session",t)}}))),this.status===ci&&this.Qa(t||"recording_initialized"))}else On.info("remote config must be stored in persistence before recording can start")}rh(){var t,e,r,i,n,s,a,o,u;null==qe||qe.removeEventListener("beforeunload",this.Bu),null==qe||qe.removeEventListener("offline",this.Yu),null==qe||qe.removeEventListener("online",this.Eu),null==qe||qe.removeEventListener("visibilitychange",this.Ot),clearInterval(this.Pu),this.ih(),null==(t=this.wu)||t.call(this),this.wu=void 0,null==(e=this.eu)||e.call(this),this.eu=void 0,null==(r=this.Su)||r.call(this),this.Su=void 0,null==(i=this.ku)||i.call(this),this.ku=void 0,null==(n=this.Au)||n.call(this),this.Au=void 0,null==(s=this.Ru)||s.call(this),this.Ru=void 0,null==(a=this.cu)||a.stop(),null==(o=this.nh)||o.stop(),this.pu=[],null==(u=this.fu)||u.call(this),this.fu=void 0}stop(){this.Ou(),this.Zu(),this.rh(),On.info("stopped")}discard(){this.Zu(),this.rh(),On.info("discarded")}onRRwebEmit(t){var e,i,n,s,a,o,u,l;if(this.Hu(),t&&Qe(t)){if(t.type===li.Meta){var h=this.Xu(t.data.href);if(this.Ku=h,!h)return;t.data.href=h}else this.Ju();if(null==(e=this.cu)||e.checkUrlTriggers(this.sessionId,(()=>this.qu()),(()=>this.Qu()),((t,e)=>this.$u(t,e))),!this.Ga.urlBlocked||(d=t).type===li.Custom&&"recording paused"===d.data.tag){var d,c,f;t.type===li.FullSnapshot&&(this.Uu(),null==(c=this.nh)||c.reset(),null==(f=this._instance.persistence)||f.register_once({[Nr]:t.timestamp},void 0)),t.type===li.FullSnapshot&&null!=(i=this.cu)&&i.hasPendingTriggers(this.sessionId)&&this.sh();var v=this.nh?this.nh.throttleMutations(t):t;if(v){var p=function(t){var e=t;if(e&&Qe(e)&&6===e.type&&Qe(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),m=function(t){return Pn(t)?t.data.payload:null}(p),g=function(t){return Wn(t)?t.data.payload:null}(p);if(m||g){var y=null!=m?m:g;null!=y&&y.lastActivityTimestamp&&(p.timestamp=y.lastActivityTimestamp)}else this.oh(p);t.type===li.FullSnapshot&&(this.Cu.push([this.ci,t.timestamp]),this.Cu.length>6&&(this.Cu=this.Cu.slice(-6)));var b=null!==(n=null!==(s=null==m?void 0:m.currentSessionId)&&void 0!==s?s:null==g?void 0:g.nextSessionId)&&void 0!==n?n:this.ci,w=null!==(a=null!==(o=null==m?void 0:m.currentWindowId)&&void 0!==o?o:null==g?void 0:g.nextWindowId)&&void 0!==a?a:this.hi;if(!0!==this.Iu||function(t){return Un(t)||Pn(t)||Wn(t)}(p)){if(Un(p)){var k=p.data.payload;k&&(p.timestamp=k.lastActivityTimestamp+k.threshold)}var{event:S,size:I}=null===(u=this._instance.config.session_recording.compress_events)||void 0===u||u?function(t){try{if(t.type===li.FullSnapshot){var e=r({},t,{data:En(t.data),cv:"2024-10"});return{event:e,size:Li(e)}}if(t.type===li.IncrementalSnapshot&&0===t.data.source){var i=r({},t,{cv:"2024-10",data:r({},t.data,{texts:Dn(t.data.texts),attributes:Dn(t.data.attributes),removes:Dn(t.data.removes),adds:Dn(t.data.adds)})});return{event:i,size:Li(i)}}if(t.type===li.IncrementalSnapshot&&8===t.data.source){var n=r({},t,{cv:"2024-10",data:r({},t.data,{adds:t.data.adds?En(t.data.adds):void 0,removes:t.data.removes?En(t.data.removes):void 0})});return{event:n,size:Li(n)}}}catch(t){On.error("could not compress event - will use uncompressed event",t)}return{event:t,size:Ai(t)}}(p):{event:p,size:Ai(p)},_={$snapshot_bytes:I,$snapshot_data:S,$session_id:b,$window_id:w};p.type===li.FullSnapshot&&null!=(l=Fn())&&null!=l.wasMaxDepthReached&&l.wasMaxDepthReached()&&(this.bu=!0),this.status!==hi?this.ah(_):this.Zu()}}}}}get status(){return this.cu?this.cu.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.hu,rrwebError:this.yu,urlTriggerMatching:this.Ga,eventTriggerMatching:this.La,linkedFlagMatching:this.Da,remoteConfig:this.Qo}):hi}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.Da.linkedFlagSeen=!0,this.$a(),this.Qa("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[Tr]:this.sessionId}),this.$a(),this.Qa("sampling_overridden")}overrideTrigger(t){this.$u(t)}ih(){this.lh&&(clearTimeout(this.lh),this.lh=void 0)}Ou(){this.ih();var t,e=this.Fu();return this.status===fi||this.status===vi||this.status===hi||e?(this.lh=setTimeout((()=>{this.Ou()}),2e3),this.T):(this.T.data.length>0&&($n(this.T).forEach((t=>{var e;null==(e=this.Nu)||e.trackSize(t.size),this.uh({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:dr,$lib_version:hr})})),null==(t=this.cu)||t.onFlushComplete()),this.Zu())}ah(t){var e,r=2+((null==(e=this.T)?void 0:e.data.length)||0),i=t.$session_id;this.Iu||943718.4>=this.T.size+t.$snapshot_bytes+r&&this.T.sessionId===i||(this.T=this.Ou(),this.T.sessionId=i,this.T.windowId=t.$window_id),this.T.size+=t.$snapshot_bytes,this.T.data.push(t.$snapshot_data),this.T.sizes.push(t.$snapshot_bytes),this.lh||this.Iu||(this.lh=setTimeout((()=>{this.Ou()}),2e3))}uh(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.vu),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get xu(){var t,e,r=null==(t=this.T)?void 0:t.data[(null==(e=this.T)?void 0:e.data.length)-1],{sessionStartTimestamp:i}=this.lu.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i:null}sh(){if(!this.T||0===this.T.data.length)return this.Zu();for(var t=-1,e=this.T.data.length-1;e>=0;e--)if(this.T.data[e].type===li.Meta){t=e;break}return 0>t?this.Zu():(this.T.data=this.T.data.slice(t),this.T.sizes=this.T.sizes.slice(t),this.T.size=this.T.sizes.reduce(((t,e)=>t+e),0),this.T)}Zu(){return this.T={size:0,data:[],sizes:[],sessionId:this.ci,windowId:this.hi},this.T}Qa(t,e){this._instance.register_for_session({$session_recording_start_reason:t}),On.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.su("$recording_started",r({reason:t},e))}hh(t){var e;return 3===t.type&&-1!==An.indexOf(null==(e=t.data)?void 0:e.source)}oh(t){var e=this.hh(t);e||this.Iu||t.timestamp-this.gu>this.uu&&(this.Iu=!0,clearInterval(this.Pu),this.su("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.gu,threshold:this.uu,bufferLength:this.T.data.length,bufferSize:this.T.size}),this.Ou());var r=!1;if(e&&(this.gu=t.timestamp,this.Iu)){var i="unknown"===this.Iu;this.Iu=!1,i||(this.su("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}if(!this.Iu){var{windowId:n,sessionId:s}=this.lu.checkAndGetSessionAndWindowId(!e,t.timestamp),a=this.ci!==s,o=this.hi!==n;this.hi=n,this.ci=s,a||o?(this.stop(),this.start("session_id_changed")):r&&this.Uu()}}_u(){var t;null==(t=this.cu)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,{sessionStartTimestamp:e}=this.lu.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.T.data.length,$sdk_debug_replay_internal_buffer_size:this.T.size,$sdk_debug_current_session_duration:this.xu,$sdk_debug_session_start:e,$sdk_debug_replay_flushed_size:null==(t=this.Nu)?void 0:t.currentTrackedSize,$sdk_debug_replay_full_snapshots:this.Cu,$snapshot_max_depth_exceeded:this.bu,$sdk_debug_replay_rrweb_error:this.yu}}eh(){var t;if(!this.fu){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,recordCrossOriginIframes:!1},a=this._instance.config.session_recording;for(var[o,u]of Object.entries(a||{}))o in s&&("maskInputOptions"===o?s.maskInputOptions=r({password:!0},u):s[o]=u);this.Lu&&this.Lu.enabled&&(s.recordCanvas=!0,s.sampling={canvas:this.Lu.fps},s.dataURLOptions={type:"image/webp",quality:this.Lu.quality}),this.Gu&&(s.maskAllInputs=null===(e=this.Gu.maskAllInputs)||void 0===e||e,s.maskTextSelector=null!==(i=this.Gu.maskTextSelector)&&void 0!==i?i:void 0,s.blockSelector=null!==(n=this.Gu.blockSelector)&&void 0!==n?n:void 0);var l=Nn();if(l){this.nh=null!==(t=this.nh)&&void 0!==t?t:new pn(l,{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";On.info(r,{node:e}),this.log(Rn+" "+r,"warn")}});var h=this.Vu();if(this.fu=l(r({emit:t=>{this.onRRwebEmit(t)},plugins:h},s)),!this.fu)return this.yu=!0,void On.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.yu=!1,this.gu=Date.now(),this.Iu=sr(this.Iu)?this.Iu:"unknown",this.tryAddCustomEvent("$remote_config_received",this.Qo),this.su("$session_options",{sessionRecordingOptions:s,activePlugins:h.map((t=>null==t?void 0:t.name))}),this.su("$posthog_config",{config:this._instance.config})}else On.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.su(t,e)}}Ve.__PosthogExtensions__=Ve.__PosthogExtensions__||{},Ve.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:t=>({name:"rrweb/console@1",observer:je,options:t}),getRecordNetworkPlugin:t=>({name:"rrweb/network@1",observer:ui,options:t})},Ve.__PosthogExtensions__.rrweb={record:Re,version:"v2",wasMaxDepthReached:()=>lt,resetMaxDepthState(){lt=!1,ut=!1}},Ve.__PosthogExtensions__.initSessionRecording=t=>new zn(t)}();
2
2
  //# sourceMappingURL=posthog-recorder.js.map