posthog-js 1.428.7 → 1.428.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/default-extensions.js.map +1 -1
- package/dist/exception-autocapture.js +1 -1
- package/dist/exception-autocapture.js.map +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/extension-bundles.js.map +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.mjs.map +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/lib/package.json +10 -4
- package/package.json +14 -8
package/dist/posthog-recorder.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){var t=["type"];function e(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 r(t){return function(){var r=this,i=arguments;return new Promise(function(n,s){var a=t.apply(r,i);function o(t){e(a,n,s,o,u,"next",t)}function u(t){e(a,n,s,o,u,"throw",t)}o(void 0)})}}function i(){return i=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},i.apply(null,arguments)}!function(){var e=function(t){return 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}({}),n=function(t){return 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}({}),s=function(t){return 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}({}),a=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),o=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),u=function(t){return 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}({}),l=function(t){return 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}({});function h(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var d={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},c={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},v={};function f(t){if(v[t])return v[t];var e=function(t){var e,r,i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(r=e.__symbol__)||void 0===r?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in d?d[t]:void 0,n=Boolean(i&&i.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(r,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),s=t in c?c[t]:void 0,a=Boolean(s&&s.every(t=>{var e;return"function"==typeof r[t]&&(null===(e=r[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(n&&a)return v[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var u,l=!1;try{document.body.appendChild(o);var f=o.contentWindow;if(!f)return e.prototype;var p=f[t].prototype;return p?(h(u=navigator.userAgent,"AppleWebKit")&&!h(u,"Chrome")&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),v[t]=p):r}catch(t){return r}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var p=Object.create(null);function g(t,e,r){var i,n=p[t],s=n[r];if(s)return s.call(e);var a=f(t),o=null===(i=Object.getOwnPropertyDescriptor(a,r))||void 0===i?void 0:i.get;return o?(n[r]=o,o.call(e)):e[r]}p.Node=Object.create(null),p.ShadowRoot=Object.create(null),p.MutationObserver=Object.create(null),p.Element=Object.create(null);var m,y={};function b(t,e,r){var i=t+"."+String(r);if(y[i])return y[i].bind(e);var n=f(t)[r];return"function"!=typeof n?e[r]:(y[i]=n,n.bind(e))}function w(){return f("MutationObserver").constructor}function _(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},s=r(function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)});return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var r=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},i=t[e],a=r(i);a;){if(a.next===s)return void(a.next=n.next);a=r(i=a.next)}else t[e]=n.next}}catch(t){return()=>{}}}var k={childNodes:t=>g("Node",t,"childNodes"),parentNode:t=>g("Node",t,"parentNode"),parentElement:t=>g("Node",t,"parentElement"),textContent:t=>g("Node",t,"textContent"),isConnected(t){if(void 0===m){var e,r=null===(e=Object.getOwnPropertyDescriptor(f("Node"),"isConnected"))||void 0===e?void 0:e.get;m=(null==r?void 0:r.toString().includes("[native code]"))?r:null}return null==m?void 0:m.call(t)},contains:(t,e)=>b("Node",t,"contains")(e),getRootNode:t=>b("Node",t,"getRootNode")(),host:t=>t&&"host"in t?g("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null,querySelector:(t,e)=>b("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>b("Element",t,"querySelectorAll")(e),mutationObserver:w,patch:_};function S(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var M=0,C=0;function I(){M+=1}function R(){return M}function A(t,e){return(e!==M||t>6e4)&&(C+=1,!0)}var x=0,T=0,E=0,O={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},F=null,D=null,N=[],L=0,P=0,B={slowestBatchMs:0},j={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function W(t){var e;(x+=1)>1||(O={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},N=[],L=0,D=(e=t)&&e>0?e:null,T=S(),E=M)}function z(){return 0===x?F||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(x-=1)>0?O:(O.durationMs=S()-T,O.deferredStylesheetCount=L,j.deferredCount+=L,D=null,A(O.durationMs,E)?O:F=O)}function U(t,e,r){var i=t.length;if(r>=32)return i;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)i+=U(a,e,r+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var u=o.rules||o.cssRules;u&&(i+=U(u,e,r+1))}}}catch(t){}}return i}function H(t){if(0!==x){var e=U(t,null,0);O.cssRuleCount+=e,P>0&&(O.nonDeferrableCssRuleCount+=e)}}function q(t){P+=1;try{return t()}finally{P-=1}}function G(t){x>0&&(O.stylesheetMs+=t)}function V(t){if(0===x||null===D)return!1;var e=O.cssRuleCount-O.nonDeferrableCssRuleCount;return e>=D||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var r=new WeakSet;return r.add(t),U(e,r,0)}catch(t){return 0}}(t)>D}function Z(){j.failedCount+=1}function J(t){t>0&&(j.abandonedCount+=t)}function Q(t){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(t)}function X(t,e,r){return(e=function(t){var e=function(t){if("object"!=Q(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Q(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Q(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function K(t){return t.nodeType===t.ELEMENT_NODE}function Y(t){var e=t&&"host"in t&&"mode"in t&&k.host(t)||null;return Boolean(e&&"shadowRoot"in e&&k.shadowRoot(e)===t)}function tt(t){return"[object ShadowRoot]"==={}.toString.call(t)}function et(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function rt(t){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}var it=0;function nt(t){var e=0===it,r=e?S():0;it+=1;try{var i=t.rules||t.cssRules;if(!i)return null;H(i);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),et(Array.from(i,t=>st(t,n)).join(""))}catch(t){return null}finally{it-=1,e&&G(S()-r)}}function st(t,e){if(ot(t)){var r;try{r=nt(t.styleSheet)||rt(t)}catch(e){r=t.cssText}try{var i;if(r&&(null===(i=t.styleSheet)||void 0===i?void 0:i.href))return St(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return ut(t)&&t.selectorText.includes(":")&&(n=at(n)),e?St(n,e):n}function at(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function ot(t){return"styleSheet"in t}function ut(t){return"selectorText"in t}var lt=/^-?[A-Za-z_][\w-]*$/,ht=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function dt(t){var e=[],r=!1,i=null,n=new Map;function s(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}var o=e[e.length-1];return o.parts.push(t),void(o.index+=1)}if(!n.importRule)return r=!0,void(i=t);a(e[e.length-1],n.importRule,t)}function a(t,e,r){try{var i;try{i=r||rt(e)}catch(t){i=e.cssText}try{var n;i&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(i=St(i,e.styleSheet.href))}catch(t){}i&&t.parts.push(i),t.index+=1}catch(t){s(null)}}function o(t){var r=t.rules[t.index];if("sheet"===t.kind&&ot(r)){var i=n.get(r);return null===i?(t.parts.push(r.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:r}):void a(t,r,null)}if(!function(t,r){try{var i=function(t){var e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return"@media "+e.media.mediaText+" {";if(ut(t)){if("number"==typeof e.type&&1!==e.type)return null;var r=e.style?e.style.cssText:"";return t.selectorText+" {"+(r?" "+r:"")}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!lt.test(e.containerName)?null:"@container "+(e.containerName?e.containerName+" ":"")+e.containerQuery+" {";if("string"==typeof e.conditionText){var i="";try{var n;i=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===i||"Object"===i||"CSSSupportsRule"===i?"@supports "+e.conditionText+" {":null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?lt.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":ht.test(e.name)?"@layer "+e.name+" {":null:null}(t);if(null===i)return!1;var n=r.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?St(i,n):i,fixColons:"sheet"===r.kind&&ut(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(r,t)){var s=r.cssText;"sheet"===t.kind&&ut(r)&&r.selectorText.includes(":")&&(s=at(s)),t.parts.push(t.sheetHref?St(s,t.sheetHref):s),t.index+=1}}return function(t){try{var r=t.rules||t.cssRules;if(!r)return!1;H(r);var i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);var s=Array.from(r);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){for(var r=[{sheet:e,rules:t,index:0}],i=function(){var t=r[r.length-1];if(t.index>=t.rules.length)return r.pop(),0;var e=t.rules[t.index];if(t.index+=1,!ot(e)||n.has(e))return 0;var i=null;try{i=e.styleSheet}catch(t){return n.set(e,null),0}if(!i||r.some(t=>t.sheet===i))return 0;try{var s=i.rules||i.cssRules;if(!s)return 0;H(s);var a=i.href;!a&&i.ownerNode&&(a=i.ownerNode.baseURI);var o=Array.from(s);n.set(e,{sheet:i,rules:o,sheetHref:a}),r.push({sheet:i,rules:o,index:0})}catch(t){}};r.length>0;)i()}(s,t),!0}catch(t){return!1}}(t)||(r=!0),{advance(t){if(r)return!0;var n=S(),a=t>0?t:1;try{for(;!r&&a>0;){var u=e[e.length-1];if(u.rules.length>u.index){a-=1;try{o(u)}catch(t){s(null)}}else{var l=null;try{if("group"===u.kind){var h=u.prelude+u.parts.join("")+"}";l=u.fixColons?at(h):h}else l=et(u.parts.join(""))}catch(t){}s(l)}}}catch(t){r=!0,i=null}finally{G(S()-n)}return r},text:()=>r?i:null,remainingRules(){if(r)return 0;var t=0;for(var i of e)t+=i.rules.length-i.index;return t}}}var ct=class{constructor(){X(this,"idNodeMap",new Map),X(this,"nodeMetaMap",new WeakMap)}getId(t){var e,r;return t&&null!==(e=null===(r=this.getMeta(t))||void 0===r?void 0:r.id)&&void 0!==e?e:-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)),K(t)){var r=k.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 vt(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&ft(n);return(r[i.toLowerCase()]||o&&r[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function ft(t){return t.toLowerCase()}var pt=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function gt(t){var e=t.element,r=t.name,i=t.value,n=t.maskAttributeFn,s=t.isGenerated;return i?t.maskAllElementAttributes?void 0!==s&&s&&pt.has(ft(r))?i:"*".repeat(i.length):n?n(r,i,e):i:i}var mt="__rrweb_original__";function yt(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ft(e):null}catch(t){return null}}var bt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,wt=/^(?:[a-z+]+:)?\/\//i,_t=/^www\..*/i,kt=/^(data:)([^,]*),(.*)/i;function St(t,e){return(t||"").replace(bt,(t,r,i,n,s,a)=>{var o,u=i||s||a,l=r||n||"";if(!u)return t;if(wt.test(u)||_t.test(u))return"url("+l+u+l+")";if(kt.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 Mt,Ct,It=new Map,Rt=1,At=new RegExp("[^a-z0-9-_:]");function xt(){return Rt++}var Tt=/^[^ \t\n\r\u000c]+/,Et=/^[, \t\n\r\u000c]+/,Ot=new WeakMap;function Ft(t,e){return e&&""!==e.trim()?Dt(t,e):e}function Dt(t,e){var r=Ot.get(t);if(r||(r=t.createElement("a"),Ot.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function Nt(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function Lt(t,e,r,i,n,s){if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var a,o=null===(a=n.sheet)||void 0===a?void 0:a.href;if(o)return o}var u=Ft(t,i);if(u.startsWith("data:")){if("img"===e&&n){var l=u;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(l=function(t,e,r,i){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;var n=It.get(e);if(n&&n.type===r&&n.quality===i)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(r||"image/webp",null!=i?i:.4),u=e.length>o.length?o:e;if(It.size>=10){var l=It.keys().next().value;void 0!==l&&It.delete(l)}return It.set(e,{type:r,quality:i,result:u}),u}catch(t){return e}}(n,u,s.type,s.quality)),Nt(l,s)}if("image"===e)return Nt(u,s)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=Ft(t,i);return"image"===e&&h.startsWith("data:")?Nt(h,s):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(Et),e.length>r;){var s=i(Tt);if(","===s.slice(-1))s=Ft(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=Ft(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?St(i,Dt(t)):"object"===e&&"data"===r?Ft(t,i):i:Ft(t,i)}function Pt(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function Bt(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&Bt(k.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&Bt(k.parentNode(t),e,r)}function $t(t,e,r,i){var n;if(K(t)){if(!k.childNodes(n=t).length)return!1}else{if(null===k.parentElement(t))return!1;n=k.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(Bt(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 jt(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var Wt=new Map;function zt(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function Ut(t){return null==t?"":t.toLowerCase()}var Ht=!1,qt=!1;function Gt(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,u=e.skipChild,h=void 0!==u&&u,d=e.inlineStylesheet,c=void 0===d||d,v=e.maskInputOptions,f=void 0===v?{}:v,p=e.maskTextFn,g=e.maskInputFn,m=e.maskAllElementAttributes,y=void 0!==m&&m,b=e.maskAttributeFn,w=e.slimDOMOptions,_=e.dataURLOptions,S=void 0===_?{}:_,M=e.inlineImages,C=void 0!==M&&M,I=e.recordCanvas,R=void 0!==I&&I,A=e.canvasMaskingConfigured,T=e.onSerialize,E=e.onIframeLoad,F=e.iframeLoadTimeout,D=void 0===F?5e3:F,P=e.onIframeListenerRegistered,B=e.onStylesheetLoad,j=e.stylesheetLoadTimeout,W=void 0===j?5e3:j,z=e.keepIframeSrcFn,U=void 0===z?()=>!1:z,H=e.newlyAddedElement,G=void 0!==H&&H,Z=e.depth,J=void 0===Z?0:Z,Q=e.maxDepth,X=void 0===Q?50:Q,et=e.needsMask,rt=e.preserveWhiteSpace,it=void 0===rt||rt;if(J>=X)return qt=!0,Ht||(Ht=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+X+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;et||(et=$t(t,a,o,void 0===et)),x>0&&(O.nodeCount+=1);var st,at=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,u=void 0===o?{}:o,h=e.maskTextFn,d=e.maskInputFn,c=e.maskAllElementAttributes,v=void 0!==c&&c,f=e.maskAttributeFn,p=e.dataURLOptions,g=void 0===p?{}:p,m=e.inlineImages,y=e.recordCanvas,b=e.canvasMaskingConfigured,w=e.keepIframeSrcFn,_=e.newlyAddedElement,S=void 0!==_&&_,M=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:l.Document,childNodes:[],compatMode:t.compatMode}:{type:l.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:l.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:M};case t.ELEMENT_NODE:return function(t,e){for(var r=e.doc,i=e.inlineStylesheet,n=e.maskInputOptions,s=void 0===n?{}:n,a=e.maskInputFn,o=e.maskAllElementAttributes,u=void 0!==o&&o,h=e.maskAttributeFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,f=e.recordCanvas,p=e.canvasMaskingConfigured,g=e.keepIframeSrcFn,m=e.newlyAddedElement,y=void 0!==m&&m,b=e.rootId,w=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),_=function(t){if(t instanceof HTMLFormElement)return"form";var e=ft(t.tagName);return At.test(e)?"div":e}(t),S=new Set,M={},C=t.attributes.length,I=0;C>I;I++){var R=t.attributes[I];Pt(_,R.name)||(M[R.name]=Lt(r,_,ft(R.name),R.value,t,c))}if("link"===_&&i&&!w){var A=t.sheet;if(!A){var T=function(t){return t.href}(t);T&&!(A=zt(r,T))&&T.includes(".css")&&(A=zt(r,window.location.origin+"/"+T.replace(window.location.href,"")))}var E=null;A&&(V(A)?x>0&&(N.push(t),L+=1):E=nt(A)),E&&(delete M.rel,delete M.href,M._cssText=E)}if("style"===_&&t.sheet&&!(t.innerText||k.textContent(t)||"").trim().length){var O=q(()=>nt(t.sheet));O&&(M._cssText=O)}if("input"===_||"textarea"===_||"select"===_){var F=t.value,D=t.checked;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&F?M.value=vt({element:t,type:yt(t),tagName:_,value:F,maskInputOptions:s,maskInputFn:a}):D&&(M.checked=D)}if("option"===_&&(t.selected&&!s.select?M.selected=!0:delete M.selected),"dialog"===_&&t.open){try{M.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){M.rr_open_mode="modal",M.ph_rr_could_not_detect_modal=!0}S.add("rr_open_mode")}if("canvas"===_&&f&&!(null==p?void 0:p()))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((mt in n?n[mt]: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)||(M.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var P=t.toDataURL(c.type,c.quality),B=r.createElement("canvas");B.width=t.width,B.height=t.height,P!==B.toDataURL(c.type,c.quality)&&(M.rr_dataURL=P)}var j,W,z=!1;if("img"===_&&v){Mt||(Mt=r.createElement("canvas"),Ct=Mt.getContext("2d"));var U=t,H=U.currentSrc||U.getAttribute("src")||"<unknown-src>",G=U.crossOrigin,Z=(e,r)=>z?gt({element:t,name:e,value:r,maskAllElementAttributes:u,maskAttributeFn:h}):r,J=()=>{jt(U,"load",J);try{Mt.width=U.naturalWidth,Mt.height=U.naturalHeight,Ct.drawImage(U,0,0);var t=Mt.toDataURL(c.type,c.quality);M.rr_dataURL=Z("rr_dataURL",t)}catch(t){if("anonymous"!==U.crossOrigin)return U.crossOrigin="anonymous",void(U.complete&&0!==U.naturalWidth?J():U.addEventListener("load",J));console.warn("Cannot inline img src="+H+"! Error: "+t)}"anonymous"===U.crossOrigin&&(G?M.crossOrigin=Z("crossOrigin",G):U.removeAttribute("crossorigin"))};U.complete&&0!==U.naturalWidth?J():U.addEventListener("load",J)}if("audio"===_||"video"===_){var Q=M;Q.rr_mediaState=t.paused?"paused":"played",S.add("rr_mediaState"),Q.rr_mediaCurrentTime=t.currentTime,Q.rr_mediaPlaybackRate=t.playbackRate,Q.rr_mediaMuted=t.muted,Q.rr_mediaLoop=t.loop,Q.rr_mediaVolume=t.volume}if(y||(t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop)),w){var X,K,Y,tt=t.getBoundingClientRect(),et=tt.width,rt=tt.height,it=tt.left,st=tt.top,at=null===(X=r.defaultView)||void 0===X?void 0:X.getComputedStyle(t);M={class:M.class,rr_width:et+"px",rr_height:rt+"px",rr_left:Math.floor(it+((null===(K=r.defaultView)||void 0===K?void 0:K.scrollX)||0))+"px",rr_top:Math.floor(st+((null===(Y=r.defaultView)||void 0===Y?void 0:Y.scrollY)||0))+"px"},S.add("rr_width"),S.add("rr_height"),S.add("rr_left"),S.add("rr_top"),at&&(M.rr_position=at.position||"static",S.add("rr_position"),at.transform&&"none"!==at.transform&&(M.rr_transform=at.transform,S.add("rr_transform")),at.display&&at.display.startsWith("inline")&&(M.rr_display=at.display,S.add("rr_display")))}if("iframe"!==_||g(M.src)||(t.contentDocument||(M.rr_src=M.src),delete M.src),u||h)for(var ot of Object.entries(M)){var ut=ot[0],lt=ot[1];"string"!=typeof lt&&null!==lt||(M[ut]=gt({element:t,name:ut,value:lt,maskAllElementAttributes:u,maskAttributeFn:h,isGenerated:S.has(ut)}))}z=!0;try{customElements.get(_)&&(j=!0)}catch(t){}return{type:l.Element,tagName:_,attributes:M,childNodes:[],isSVG:(W=t,Boolean("svg"===W.tagName||W.ownerSVGElement)||void 0),needBlock:w,rootId:b,isCustom:j}}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:a,maskInputOptions:u,maskInputFn:d,maskAllElementAttributes:v,maskAttributeFn:f,dataURLOptions:g,inlineImages:m,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:w,newlyAddedElement:S,rootId:M});case t.TEXT_NODE:return function(t,e){var r=e.needsMask,i=e.maskTextFn,n=e.rootId,s=k.parentNode(t),a=s&&s.tagName,o=k.textContent(t),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&o){try{var d;if(t.nextSibling||t.previousSibling);else if(V(s.sheet));else if(null===(d=s.sheet)||void 0===d?void 0:d.cssRules){var c=nt(s.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(o=c)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}o=St(o,Dt(e.doc))}return h&&(o="SCRIPT_PLACEHOLDER"),!u&&!h&&o&&r&&(o=i?i(o,k.parentElement(t)):o.replace(/[\S]/g,"*")),{type:l.Text,textContent:o||"",isStyle:u,rootId:n}}(t,{doc:r,needsMask:s,maskTextFn:h,rootId:M});case t.CDATA_SECTION_NODE:return{type:l.CDATA,textContent:"",rootId:M};case t.COMMENT_NODE:return{type:l.Comment,textContent:k.textContent(t)||"",rootId:M};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:et,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:g,maskAllElementAttributes:y,maskAttributeFn:b,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,keepIframeSrcFn:U,newlyAddedElement:G});if(!at)return console.warn(t,"not serialized"),null;st=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===l.Comment)return!0;if(t.type===l.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e,r;try{r=new URL(t,window.location.href)}catch(t){return null}var i=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==i?void 0:i[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Ut(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ut(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Ut(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Ut(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Ut(t.attributes.property).match(/^(og|twitter|fb):/)||Ut(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ut(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Ut(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(Ut(t.attributes.name))||Ut(t.attributes.property).match(/^article:/)||Ut(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(Ut(t.attributes.name)))return!0}}return!1}(at,w)||!it&&at.type===l.Text&&!at.isStyle&&!at.textContent.replace(/^\s+|\s+$/gm,"").length?-2:xt();var ot=Object.assign(at,{id:st});if(i.add(t,ot),-2===st)return null;T&&T(t);var ut=!h;if(ot.type===l.Element){ut=ut&&!ot.needBlock,delete ot.needBlock;var lt=k.shadowRoot(t);lt&&tt(lt)&&(ot.isShadowHost=!0)}if((ot.type===l.Document||ot.type===l.Element)&&ut){w.headWhitespace&&ot.type===l.Element&&"head"===ot.tagName&&(it=!1);var ht={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:a,maskTextSelector:o,skipChild:h,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:g,maskAllElementAttributes:y,maskAttributeFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,preserveWhiteSpace:it,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:D,onIframeListenerRegistered:P,onStylesheetLoad:B,stylesheetLoadTimeout:W,keepIframeSrcFn:U,depth:J+1,maxDepth:X};if(ot.type===l.Element&&"textarea"===ot.tagName&&void 0!==ot.attributes.value);else for(var dt of Array.from(k.childNodes(t))){var ct=Gt(dt,ht);ct&&ot.childNodes.push(ct)}var pt=null;if(K(t)&&(pt=k.shadowRoot(t)))for(var bt of Array.from(k.childNodes(pt))){var wt=Gt(bt,ht);wt&&(tt(pt)&&(wt.isShadow=!0),ot.childNodes.push(wt))}}var _t=k.parentNode(t);if(_t&&Y(_t)&&tt(_t)&&(ot.isShadow=!0),ot.type===l.Element&&"iframe"===ot.tagName){var kt=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var a=()=>e();if("complete"!==i){var o=!1,u=null,l=()=>{o||(o=!0,null!==u&&(clearTimeout(u),u=null),jt(t,"load",h),t.addEventListener("load",a),e())},h=()=>l();return u=setTimeout(l,r),t.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),o?jt(t,"load",a):(o=!0,jt(t,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(t){return n}if(d!==c||t.src===c||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",a),()=>{clearTimeout(v),jt(t,"load",a)}}return t.addEventListener("load",a),()=>{jt(t,"load",a)}}(t,()=>{var e=t.contentDocument;if(e&&E){var r=Gt(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:g,maskAllElementAttributes:y,maskAttributeFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,preserveWhiteSpace:it,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:D,onIframeListenerRegistered:P,onStylesheetLoad:B,stylesheetLoadTimeout:W,keepIframeSrcFn:U,depth:J+1,maxDepth:X});r&&E(t,r)}},D);null==P||P(t,kt)}return ot.type===l.Element&&"link"===ot.tagName&&"stylesheet"===ot.attributes.rel&&function(e,u,l){if(!Wt.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var d=new AbortController,v=!1,m=()=>{if(!v){v=!0;try{(()=>{if(B){var e=Gt(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:g,maskAllElementAttributes:y,maskAttributeFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,preserveWhiteSpace:it,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:D,onStylesheetLoad:B,stylesheetLoadTimeout:W,keepIframeSrcFn:U,depth:J,maxDepth:X});e&&B(t,e)}})()}finally{Wt.delete(e),d.abort()}}},_=setTimeout(m,l);d.signal.addEventListener("abort",()=>clearTimeout(_),{once:!0}),e.addEventListener("load",m,{signal:d.signal,once:!0}),Wt.set(e,d)}}}(t,0,W),ot}function Vt(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}var Zt=class t{constructor(){X(this,"parentElement",null),X(this,"parentNode",null),X(this,"ownerDocument",void 0),X(this,"firstChild",null),X(this,"lastChild",null),X(this,"previousSibling",null),X(this,"nextSibling",null),X(this,"ELEMENT_NODE",1),X(this,"TEXT_NODE",3),X(this,"nodeType",void 0),X(this,"nodeName",void 0),X(this,"RRNodeType",void 0)}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.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 Jt(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>Qt(r,t,e,i)}function Qt(t,e,r,i){Xt(()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))})}function Xt(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function Kt(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var Yt="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.",te={map:{},getId(){return console.error(Yt),-1},getNode(){return console.error(Yt),null},removeNodeFromMap(){console.error(Yt)},has(){return console.error(Yt),!1},reset(){console.error(Yt)}};function ee(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 re(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout(()=>{try{r.set.call(this,t)}catch(t){}},0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>re(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(te=new Proxy(te,{get(t,e,r){return"map"===e&&console.error(Yt),Reflect.get(t,e,r)}}));var ie=Date.now;function ne(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=k.parentElement(s.body))||void 0===e?void 0:e.scrollLeft)||(null==s||null===(r=s.body)||void 0===r?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=k.parentElement(s.body))||void 0===i?void 0:i.scrollTop)||(null==s||null===(n=s.body)||void 0===n?void 0:n.scrollTop)||0}}function se(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ae(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function oe(t){return t?t.nodeType===t.ELEMENT_NODE?t:k.parentElement(t):null}function ue(t,e,r,i){if(!t)return!1;var n=oe(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(Bt(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 le(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)}function he(t,e){if(Y(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=k.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||he(i,e))}function de(t){return Boolean(t.changedTouches)}function ce(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function ve(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function fe(t){return!!t&&(t instanceof Zt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(k.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ie=()=>(new Date).getTime());var pe=class{constructor(){X(this,"id",1),X(this,"styleIDMap",new WeakMap),X(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 ge(t){var e,r=null;return"getRootNode"in t&&(null===(e=k.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&k.host(k.getRootNode(t))&&(r=k.host(k.getRootNode(t))),r}function me(t){var e=t.ownerDocument;if(!e)return!1;if(k.contains(e,t))return!0;var r=k.isConnected(t);return"boolean"==typeof r?r:function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=ge(r);)r=e;return r}(t);return k.contains(e,r)}(t)}function ye(t){return"__ln"in t}var be,we=class{constructor(){X(this,"length",0),X(this,"head",null),X(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&&ye(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&&ye(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--)}},_e=(t,e)=>t+"@"+e,ke=class{constructor(){X(this,"frozen",!1),X(this,"locked",!1),X(this,"texts",[]),X(this,"attributes",[]),X(this,"attributeMap",new WeakMap),X(this,"generatedAttributes",new WeakMap),X(this,"removes",[]),X(this,"mapRemoves",new Set),X(this,"movedMap",{}),X(this,"addedSet",new Set),X(this,"movedSet",new Set),X(this,"droppedSet",new Set),X(this,"removesSubTreeCache",new Set),X(this,"mutationCb",void 0),X(this,"blockClass",void 0),X(this,"blockSelector",void 0),X(this,"maskTextClass",void 0),X(this,"maskTextSelector",void 0),X(this,"inlineStylesheet",void 0),X(this,"maskInputOptions",void 0),X(this,"maskTextFn",void 0),X(this,"maskInputFn",void 0),X(this,"maskAllElementAttributes",void 0),X(this,"maskAttributeFn",void 0),X(this,"keepIframeSrcFn",void 0),X(this,"recordCanvas",void 0),X(this,"canvasMaskingConfigured",void 0),X(this,"inlineImages",void 0),X(this,"slimDOMOptions",void 0),X(this,"dataURLOptions",void 0),X(this,"doc",void 0),X(this,"mirror",void 0),X(this,"iframeManager",void 0),X(this,"stylesheetManager",void 0),X(this,"shadowDomManager",void 0),X(this,"canvasManager",void 0),X(this,"processedNodeManager",void 0),X(this,"unattachedDoc",void 0),X(this,"canvasManagerReleased",!1),X(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),X(this,"emit",()=>{if(!this.frozen&&!this.locked){var t,e,r=S(),i=R();try{this.processBufferedMutations()}finally{t=S()-r,e=i,x>0||A(t,null!=e?e:M)||t>B.slowestBatchMs&&(B.slowestBatchMs=t)}}}),X(this,"processBufferedMutations",()=>{var t,e=[],r=new Set,i=new we,n=t=>{for(var e=t,r=-2;-2===r;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},s=s=>{var a=k.parentNode(s);if(a&&me(s)&&"TEXTAREA"!==a.tagName&&!this.isBlockedAtEmission(a)){var o=Y(a)?this.mirror.getId(ge(s)):this.mirror.getId(a),u=n(s);if(-1===o||-1===u)return i.addNode(s);null!=t||(t={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,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{ce(t,this.mirror)&&this.iframeManager.addIframe(t),ve(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),fe(t)&&!ue(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(k.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});var l=Gt(s,t);l&&(e.push({parentId:o,nextId:u,node:l}),r.add(l.id))}};for(var a of this.mapRemoves)this.mapRemoves.delete(a),this.mirror.removeNodeFromMap(a);for(var o of this.movedSet)Me(this.removesSubTreeCache,o)&&!this.movedSet.has(k.parentNode(o))||s(o);for(var u of this.addedSet)Ce(this.droppedSet,u)||Me(this.removesSubTreeCache,u)?Ce(this.movedSet,u)?s(u):this.droppedSet.add(u):s(u);for(var l=null;i.length;){var h=null;if(l){var d=this.mirror.getId(k.parentNode(l.value)),c=n(l.value);-1!==d&&-1!==c&&(h=l)}if(!h)for(var v=i.tail;v;){var f=v;if(v=v.previous,f){var p=this.mirror.getId(k.parentNode(f.value));if(-1===n(f.value))continue;if(-1!==p){h=f;break}var g=k.parentNode(f.value);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var m=k.host(g);if(-1!==this.mirror.getId(m)){h=f;break}}}}if(!h){for(;i.head;)i.removeNode(i.head.value);break}l=h.previous,i.removeNode(h.value),s(h.value)}var y={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.node,r=k.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!r.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"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)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var n of Object.entries(e)){var s,a=n[0],o=n[1];"string"!=typeof o&&null!==o||(e[a]=gt({element:t.node,name:a,value:o,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(s=this.generatedAttributes.get(t.node))||void 0===s?void 0:s.has(a)}))}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!r.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:e};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(y.texts.length||y.attributes.length||y.removes.length||y.adds.length)&&this.mutationCb(y)}),X(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),X(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(k.childNodes(t),t=>k.textContent(t)||"").join("");e.attributes.value=vt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:yt(t),value:r,maskInputFn:this.maskInputFn})}),X(this,"processMutation",t=>{if(!le(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=k.textContent(t.target);ue(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:$t(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,oe(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r,i=t.target,n=t.attributeName,s=null!==(r=t.attributeNamespace)&&void 0!==r?r:null,a=function(t,e,r){if(!r)return e;var i=t.getAttributeNodeNS(r,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(r);return n?n+":"+e:e}(i,n,s),o=s?i.getAttributeNS(s,n):t.target.getAttribute(n);if("value"===a){var u=i,l=yt(u);o=vt({element:u,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:l,value:o,maskInputFn:this.maskInputFn})}if(ue(t.target,this.blockClass,this.blockSelector,!1)||o===t.oldValue)return;var h=this.attributeMap.get(t.target),d="IFRAME"===i.tagName&&"src"===a;if(d&&!this.keepIframeSrcFn(o)&&i.contentDocument)return;if(h||(this.attributes.push(h={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,h)),"type"===a&&"INPUT"===i.tagName&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!Pt(i.tagName,a)){var c,v=Lt(this.doc,ft(i.tagName),ft(a),o,i,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(o)&&(a="rr_src"),h.attributes[a]=v,null===(c=this.generatedAttributes.get(t.target))||void 0===c||c.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=i.style;for(var g of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?h.styleDiff[g]=""===y?m:[m,y]:h._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(h.styleDiff[b]=!1)}else if("open"===a&&"DIALOG"===i.tagName){h.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";var w=this.generatedAttributes.get(t.target);w||this.generatedAttributes.set(t.target,w=new Set),w.add("rr_open_mode")}}break;case"childList":if(ue(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=Y(t.target)?this.mirror.getId(k.host(t.target)):this.mirror.getId(t.target);ue(t.target,this.blockClass,this.blockSelector,!1)||le(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Se(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||he(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[_e(r,i)]?Se(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!Y(t.target)||!tt(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),k.childNodes(i).forEach(t=>r.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),X(this,"genAdds",(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(le(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[_e(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!ue(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;for(var i=k.childNodes(t),n=0,s=i.length;s>n;n++){var a=i[n];a&&this.genAdds(a)}if(fe(t))for(var o=k.childNodes(k.shadowRoot(t)),u=0,l=o.length;l>u;u++){var h=o[u];h&&(this.processedNodeManager.add(h,this),this.genAdds(h,t))}}}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]}),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(var t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t){for(var e=this.blockClass,r=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;t;){if(r&&(r.lastIndex=0),ue(t,r||e,this.blockSelector,!0))return!0;var i="getRootNode"in t?k.getRootNode(t):null;t=(null==i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?k.host(i):null}return!1}};function Se(t,e){for(var r=[e];r.length;){var i=r.pop();if(t.delete(i),i.nodeType!==i.TEXT_NODE)for(var n=k.childNodes(i),s=0,a=n.length;a>s;s++){var o=n[s];o&&r.push(o)}}}function Me(t,e,r){return 0!==t.size&&function(t,e){var r=k.parentNode(e);return!!r&&t.has(r)}(t,e)}function Ce(t,e){if(0===t.size)return!1;for(var r=k.parentNode(e);r;){if(t.has(r))return!0;r=k.parentNode(r)}return!1}var Ie=function(t,e){return void 0===e&&(e="rrweb"),be?function(){try{return t(...arguments)}catch(t){if(be&&!0===be(t,e))return;throw t}}:t},Re=[];function Ae(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 xe(t,e){var r,i=new ke;i.init(t);try{r=new(w())(Ie(i.processMutations.bind(i)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),r.observe(e,n),Re.push(i),{observer:r,buffer:i}}catch(t){try{null==r||r.disconnect(),i.destroy(),i.reset()}catch(t){}throw t}}function Te(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,u=t=>{var a=Ae(t);if(a&&!ue(a,n,s,!0)){var u,l,h=i.getId(a);if(a===r&&r.defaultView){var d=ne(r.defaultView);u=d.left,l=d.top}else u=a.scrollLeft,l=a.scrollTop;var c=u+","+l;o.get(h)!==c&&(o.set(h,c),e({id:h,x:u,y:l}))}},l=[Jt("scroll",Ie(ee(Ie(t=>u(t)),a.scroll||100)),r)];return"onscrollend"in r&&l.push(Jt("scrollend",Ie(u),r)),()=>l.forEach(t=>t())}function Ee(t,e){for(var r=Re.length-1;r>=0;r--){var i=Re[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),Re.splice(r,1))}}}var Oe=["INPUT","TEXTAREA","SELECT"],Fe=new WeakMap;function De(t){return function t(e,r){if(Be("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Be("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Be("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Be("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 Ne(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function Le(t,e){var r,i,n,s=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:k.host(e));var a="#document"===e.nodeName?null===(r=e.defaultView)||void 0===r?void 0:r.Document:null===(i=e.ownerDocument)||void 0===i||null===(i=i.defaultView)||void 0===i?void 0:i.ShadowRoot,o=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&a&&o?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get(){var t;return null===(t=o.get)||void 0===t?void 0:t.call(this)},set(t){var e;try{var r;e=null===(r=o.set)||void 0===r?void 0:r.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==n&&-1!==n)try{s.adoptStyleSheets(t,n)}catch(t){}return e}}),Ie(()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:o.get,set:o.set})})):()=>{}}function Pe(t,e){void 0===e&&(e={});var r,o,l=t.doc.defaultView;if(!l)return()=>{};!function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,a=t.viewportResizeCb,o=t.inputCb,u=t.mediaInteractionCb,l=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,c=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var h=[],d=Ie(()=>{try{if(o)try{o.destroy(),o.reset()}finally{var e=Re.indexOf(o);-1!==e&&Re.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==r||r.disconnect()}finally{Kt(h)}});try{if(t.recordDOM){var c=xe(t,t.doc);r=c.observer,o=c.buffer}if(h.push(function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,s=t.mirror;if(!1===r.mousemove)return()=>{};var a,o="number"==typeof r.mousemove?r.mousemove:50,u="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],h=ee(Ie(t=>{var r=Date.now()-a;e(l.map(t=>(t.timeOffset-=r,t)),t),l=[],a=null}),u),d=Ie(ee(Ie(t=>{var e=Ae(t),r=de(t)?t.changedTouches[0]:t,i=r.clientX,o=r.clientY;a||(a=ie()),l.push({x:i,y:o,id:s.getId(e),timeOffset:ie()-a}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?n.Drag:t instanceof MouseEvent?n.MouseMove:n.TouchMove)}),o,{trailing:!1})),c=[Jt("mousemove",d,i),Jt("touchmove",d,i),Jt("drag",d,i)];return Ie(()=>{c.forEach(t=>t())})}(t)),h.push(function(t){var e=t.mouseInteractionCb,r=t.doc,n=t.mirror,o=t.blockClass,u=t.blockSelector,l=t.sampling;if(!1===l.mouseInteraction)return()=>{};var h=!0===l.mouseInteraction||void 0===l.mouseInteraction?{}:l.mouseInteraction,d=[],c=null;return Object.keys(s).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==h[t]).forEach(t=>{var l=ft(t),h=(t=>r=>{var l=Ae(r);if(!ue(l,o,u,!0)){var h=null,d=t;if("pointerType"in r){switch(r.pointerType){case"mouse":h=a.Mouse;break;case"touch":h=a.Touch;break;case"pen":h=a.Pen}h===a.Touch&&(s[t]===s.MouseDown?d="TouchStart":s[t]===s.MouseUp&&(d="TouchEnd"))}else de(r)&&(h=a.Touch);null!==h?(c=h,(d.startsWith("Touch")&&h===a.Touch||d.startsWith("Mouse")&&h===a.Mouse)&&(h=null)):s[t]===s.Click&&(h=c,c=null);var v=de(r)?r.changedTouches[0]:r;if(v){var f=n.getId(l),p=v.clientX,g=v.clientY;Ie(e)(i({type:s[d],id:f,x:p,y:g},null!==h&&{pointerType:h}))}}})(t);if(window.PointerEvent)switch(s[t]){case s.MouseDown:case s.MouseUp:l=l.replace("mouse","pointer");break;case s.TouchStart:case s.TouchEnd:return}d.push(Jt(l,h,r))}),Ie(()=>{d.forEach(t=>t())})}(t)),h.push(Te(t)),h.push(function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,s=-1;return Jt("resize",Ie(ee(Ie(()=>{var t=se(),e=ae();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)}),200)),i)}(t,{win:l})),h.push(function(t){var e=t.inputCb,r=t.doc,n=t.mirror,s=t.blockClass,a=t.blockSelector,o=t.ignoreClass,u=t.ignoreSelector,l=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function c(t){var e=Ae(t),i=t.isTrusted,n=r.defaultView;if(!e||!n||e instanceof n.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=k.parentElement(e)),e&&c&&Oe.indexOf(c)>=0&&!ue(e,s,a,!0)&&!(e.classList.contains(o)||u&&e.matches(u))){var f=e.value,p=!1,g=yt(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[c.toLowerCase()]||l[g])&&(f=vt({element:e,maskInputOptions:l,tagName:c,type:g,value:f,maskInputFn:h})),v(e,d?{text:f,isChecked:p,userTriggered:i}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&r.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach(t=>{if(t!==e){var r=t.value;v(t,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}})}}}function v(t,r){var s=Fe.get(t);if(!s||s.text!==r.text||s.isChecked!==r.isChecked){Fe.set(t,r);var a=n.getId(t);Ie(e)(i({},r,{id:a}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map(t=>Jt(t,Ie(c),r)),p=r.defaultView;if(!p)return()=>{f.forEach(t=>t())};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map(t=>re(t[0],t[1],{set(){Ie(c)({target:this,isTrusted:!1})}},!1,p))),Ie(()=>{Kt(f)})}(t)),h.push(function(t){var e=t.mediaInteractionCb,r=t.blockClass,i=t.blockSelector,n=t.mirror,s=t.sampling,a=t.doc,o=Ie(t=>ee(Ie(s=>{var a=Ae(s);if(a&&!ue(a,r,i,!0)){var o=a.currentTime,u=a.volume,l=a.muted,h=a.playbackRate,d=a.loop;e({type:t,id:n.getId(a),currentTime:o,volume:u,muted:l,playbackRate:h,loop:d})}}),s.media||500)),l=[Jt("play",o(u.Play),a),Jt("pause",o(u.Pause),a),Jt("seeked",o(u.Seeked),a),Jt("volumechange",o(u.VolumeChange),a),Jt("ratechange",o(u.RateChange),a)];return Ie(()=>{l.forEach(t=>t())})}(t)),t.recordDOM){var v=function(t){var e=new Map,r=new Set,i=!0,n=t=>{if(i)try{t()}catch(t){}},s=t=>{var r,i=e.get(t);if(i){for(;null===(r=i[0])||void 0===r?void 0:r.ready;){var s=i.shift();(null==s?void 0:s.emit)&&n(s.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,r){if(t){var i=e.get(t);i?(i.push({emit:r,ready:!0}),s(t)):n(r)}else n(r)},queuePendingMutation(a,o,u){if(!i)return()=>{};var l=e.get(a);l||e.set(a,l=[]);var h={emit:o,ready:!1};l.push(h);var d,c=!1,v=!1,f=()=>{c||v||(c=!0,void 0!==d&&r.delete(d),h.ready=!0,h.emit=void 0,s(a))};try{d=t.setTimeout(f,5e3),c||v?t.clearTimeout(d):r.add(d)}catch(t){f()}return e=>{!v&&i&&(v=!0,void 0!==d&&(t.clearTimeout(d),r.delete(d)),c?e&&n(u):(h.ready=!0,e||(h.emit=void 0),s(a)))}},reset(){i=!1,r.forEach(e=>t.clearTimeout(e)),r.clear(),e.clear()}}}(l);h.push(v.reset),h.push(function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,s=e.win,a=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ie((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=Ne(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,()=>r({id:h,styleId:d,adds:[{rule:o,index:u}]})),u},"host")}),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 u,l,h=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:Ie((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=Ne(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,()=>r({id:h,styleId:d,removes:[{index:o}]})),u},"host")}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(u=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:Ie((t,e,s)=>{var o=s[0],u=t.apply(e,s);try{var l=null==u?void 0:u.then;if(e.ownerNode||!u||"function"!=typeof l)return u;n.onCssomSheetMutation(e);var h=Ne(e,i,n.styleMirror),d=h.id,c=h.styleId;if(!(d&&-1!==d||c&&-1!==c))return u;var v=a.queuePendingMutation(e,()=>r({id:d,styleId:c,replace:o}),()=>{var t=nt(e);null!==t&&r({id:d,styleId:c,replace:t})});try{l.call(u,()=>v(!0),()=>v(!1))}catch(t){v(!1)}}catch(t){}return u},"host")})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ie((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=Ne(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,()=>r({id:h,styleId:d,replaceSync:o})),u},"host")}));var d={};$e("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:($e("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),$e("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),$e("CSSSupportsRule")&&(d.CSSSupportsRule=s.CSSSupportsRule));var c={};return Object.entries(d).forEach(t=>{var e=t[0],s=t[1];c[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Ie((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var l=Ne(e.parentStyleSheet,i,n.styleMirror),h=l.id,d=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var c=[...De(e),u];a.queueMutation(e.parentStyleSheet,()=>r({id:h,styleId:d,adds:[{rule:o,index:c}]}))}return u},"host")}),s.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Ie((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var l=Ne(e.parentStyleSheet,i,n.styleMirror),h=l.id,d=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var c=[...De(e),o];a.queueMutation(e.parentStyleSheet,()=>r({id:h,styleId:d,removes:[{index:c}]}))}return u},"host")})}),Ie(()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=h,u&&(s.CSSStyleSheet.prototype.replace=u),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(d).forEach(t=>{var e=t[0],r=t[1];r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule})})}(t,{win:l,mutationQueue:v})),h.push(Le(t,t.doc)),h.push(function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=e.mutationQueue,u=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:Ie((t,e,a)=>{var u,l=a[0],h=a[1],d=a[2],c=t.apply(e,a);if(n.has(l))return c;var v=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;s.onCssomSheetMutation(v);var f=Ne(v,i,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=De(e.parentRule);o.queueMutation(v,()=>r({id:p,styleId:g,set:{property:l,value:h,priority:d},index:m}))}return c},"host")});var l=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ie((t,e,a)=>{var u,l=a[0],h=t.apply(e,a);if(n.has(l))return h;var d=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;s.onCssomSheetMutation(d);var c=Ne(d,i,s.styleMirror),v=c.id,f=c.styleId;if(v&&-1!==v||f&&-1!==f){var p=De(e.parentRule);o.queueMutation(d,()=>r({id:v,styleId:f,remove:{property:l},index:p}))}return h},"host")}),Ie(()=>{a.CSSStyleDeclaration.prototype.setProperty=u,a.CSSStyleDeclaration.prototype.removeProperty=l})}(t,{win:l,mutationQueue:v})),t.collectFonts&&h.push(function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,a=i.FontFace;i.FontFace=function(t,e,r){var i=new a(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var o=_(r.fonts,"add",function(t){return function(r){return setTimeout(Ie(()=>{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),Ie(()=>{n.forEach(t=>t())})}(t))}for(var f of(h.push(function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,s=t.selectionCb,a=!0,o=Ie(()=>{var t=e.getSelection();if(!(!t||a&&(null==t?void 0:t.isCollapsed))){a=t.isCollapsed||!1;for(var o=[],u=t.rangeCount||0,l=0;u>l;l++){var h=t.getRangeAt(l),d=h.startContainer,c=h.startOffset,v=h.endContainer,f=h.endOffset;ue(d,i,n,!0)||ue(v,i,n,!0)||o.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:o})}});return o(),Jt("selectionchange",o)}(t)),h.push(function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?_(r.customElements,"define",function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}}):()=>{}}(t)),t.plugins))h.push(f.observer(f.callback,l,f.options))}catch(t){try{d()}catch(t){}throw t}return d}function Be(t){return void 0!==window[t]}function $e(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var je=class{constructor(t){X(this,"generateIdFn",void 0),X(this,"iframeRemoteIdToLocalIdMap",new WeakMap),X(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){if(0>e)return e;var n=r||this.getRemoteIdToLocalIdMap(t),s=i||this.getLocalIdToRemoteIdMap(t),a=n.get(e);return void 0===a&&(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}getIds(t,e){var r=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,r,i))}getRemoteId(t,e,r){var i;return"number"!=typeof e||0>e?e:null!==(i=(r||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){var r=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,r))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}},We=class{constructor(t){X(this,"iframes",new WeakMap),X(this,"crossOriginIframeMap",new WeakMap),X(this,"crossOriginIframeMirror",new je(xt)),X(this,"crossOriginIframeStyleMirror",void 0),X(this,"crossOriginIframeRootIdMap",new WeakMap),X(this,"mirror",void 0),X(this,"mutationCb",void 0),X(this,"wrappedEmit",void 0),X(this,"loadListener",void 0),X(this,"pageHideListener",void 0),X(this,"stylesheetManager",void 0),X(this,"recordCrossOriginIframes",void 0),X(this,"messageHandler",void 0),X(this,"nestedIframeListeners",new Map),X(this,"attachedWindows",new WeakMap),X(this,"attachedDocuments",new WeakMap),X(this,"attachedIframes",new Map),X(this,"loadListenerDisposers",new WeakMap),X(this,"iframeElementsById",new Map),X(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new je(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>Xt(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach(t=>{Qt(t.win,"pagehide",t.handler)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var a=this.handleMessage.bind(this);Xt(()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)})}Xt(()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}}),null===(r=this.loadListener)||void 0===r||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,r){switch(r.type){case e.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);var i=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(r.data.node,i),this.trackIframeContent(t,r.data.node),{timestamp:r.timestamp,type:e.IncrementalSnapshot,data:{source:n.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case e.Meta:case e.Load:case e.DomContentLoaded:return!1;case e.Plugin:return r;case e.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case e.IncrementalSnapshot:switch(r.data.source){case n.Mutation:return r.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)}),r.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),r.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),r.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),r;case n.Drag:case n.TouchMove:case n.MouseMove:return r.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),r;case n.ViewportResize:return!1;case n.MediaInteraction:case n.MouseInteraction:case n.Scroll:case n.CanvasMutation:case n.Input:return this.replaceIds(r.data,t,["id"]),r;case n.StyleSheetRule:case n.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case n.Font:return r;case n.Selection:return r.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),r;case n.AdoptedStyleSheet:var s;return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),null===(s=r.data.styles)||void 0===s||s.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),r}}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===l.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach(t=>{var e=this.nestedIframeListeners.get(t);e&&(Qt(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(Qt(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var s=this.attachedDocuments.get(r);s&&(s.forEach(t=>{Xt(()=>this.mirror.removeNodeFromMap(t))}),Xt(()=>Ee(r,s)),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach((e,r)=>{this.mirror.has(r)||t.push(r)}),t.forEach(t=>this.removeIframeById(t))}}reattachIframes(){this.attachedIframes.forEach((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&Qt(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Qt(e,"message",t)}),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(e=>t.add(e.element)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},ze=class{constructor(t){X(this,"shadowDoms",new WeakSet),X(this,"mutationCb",void 0),X(this,"scrollCb",void 0),X(this,"bypassOptions",void 0),X(this,"mirror",void 0),X(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var r,n;if(tt(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(r=null===(n=k.host(t))||void 0===n?void 0:n.ownerDocument)&&void 0!==r?r:e,a=xe(i({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),o=a.observer,u=a.buffer;this.restoreHandlers.push({doc:s,handler(){o.disconnect(),u.destroy(),u.releaseCanvasManager();var t=Re.indexOf(u);-1!==t&&Re.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:Te(i({},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(k.host(t))),this.restoreHandlers.push({doc:s,handler:Le({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})},0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push({doc:e,handler:_(t.prototype,"attachShadow",function(t){return function(i){var n=t.call(this,i),s=k.shadowRoot(this);return s&&me(this)&&r.addShadowRoot(s,e),n}})})}reset(){this.restoreHandlers.forEach(t=>{var e=t.handler;try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}},Ue="skip-frame";function He(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ge="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ve=0;64>Ve;Ve++)Ge[qe.charCodeAt(Ve)]=Ve;var Ze=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=qe[r[e]>>2],n+=qe[(3&r[e])<<4|r[e+1]>>4],n+=qe[(15&r[e+1])<<2|r[e+2]>>6],n+=qe[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},Je=new Map,Qe=(t,e,r)=>{if(t&&(Ye(t,e)||"object"==typeof t)){var i=function(t,e){var r=Je.get(t);return r||Je.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 Xe(t,e,r,i){return t instanceof Array?t.map(t=>Xe(t,e,r,i)):null===t?t: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?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:Ze(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[Xe(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Xe(t.data,e,r,i),t.width,t.height]}:Ye(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Qe(t,e,r)}:t}var Ke=(t,e,r,i)=>t.map(t=>Xe(t,e,r,i)),Ye=(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]))},tr=["webgl","webgl2"];function er(t){return"nodeType"in t}function rr(t,e,r,n){var s=[];try{if(n){var a=function(t,e,r){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return _(n.prototype,"configure",function(n){return function(s){var a=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!a||er(a)&&ue(a,e,r,!0))return n.call(this,s);er(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?i({},s,{usage:"number"==typeof s.usage?s.usage|o:o}):s)}})}(t,e,r);a&&s.push(a)}var o=_(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(i){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(i),a=arguments.length,o=new Array(a>1?a-1:0),u=1;a>u;u++)o[u-1]=arguments[u];if(!ue(this,e,r,!0)&&("__context"in this||(this.__context=s),n&&tr.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,[i,...o])}});s.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(t=>t())}}function ir(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=_(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(Qe(d,s,this),this.canvas&&"tagName"in this.canvas&&!ue(this.canvas,i,n,!0)){var c={type:e,property:u,args:Ke(l,s,this,a)};r(this.canvas,c)}return d}});o.push(l)}catch(s){var h=re(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!ue(this.canvas,i,n,!0)&&r(this.canvas,{type:e,property:u,args:[t],setter:!0})}});o.push(h)}};for(var h of u)l(h);return o}var nr='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',sr="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",nr],{type:"text/javascript;charset=utf-8"});function ar(t){var e;try{if(!(e=sr&&(self.URL||self.webkitURL).createObjectURL(sr)))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(nr),{name:null==t?void 0:t.name})}}var or,ur,lr,hr=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){X(this,"pendingCanvasMutations",new Map),X(this,"rafStamps",{latestId:0,invokeId:null}),X(this,"mirror",void 0),X(this,"mutationCb",void 0),X(this,"resetObservers",void 0),X(this,"frozen",!1),X(this,"locked",!1),X(this,"rafIdTimestamp",null),X(this,"rafIdFlush",null),X(this,"refCount",0),X(this,"torndown",!1),X(this,"resetFrameDedup",null),X(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});var e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,s=t.blockSelector,a=t.recordCanvas,o=t.dataURLOptions,u=t.resolutionScale,l=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===r&&this.initCanvasMutationObserver(i,n,s,o),a&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:o,resolutionScale:u,canvasMasking:l})}initCanvasFPSObserver(t,e,i,n,s){var a=this;if("OffscreenCanvas"in e){var u,l="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,h=rr(e,i,n,!0),d=new Map;try{u=new ar}catch(t){return}var c=!1;u.onerror=()=>{var t;c=!0,cancelAnimationFrame(v),null===(t=u.terminate)||void 0===t||t.call(u),this.resetFrameDedup=null},this.resetFrameDedup=()=>{u.postMessage({resetFrameDedup:!0})},u.onmessage=t=>{var e=t.data.id;if(d.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:o["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var v,f=1e3/t,p=0,g=t=>{var o,h;c||(p&&f>t-p||(p=t,(o=[],h=t=>{try{t.querySelectorAll("canvas").forEach(t=>{ue(t,i,n,!0)||o.push(t)}),t.querySelectorAll("*").forEach(t=>{t.shadowRoot&&h(t.shadowRoot)})}catch(t){}},h(e.document),o).forEach(function(){var t=r(function*(t){var e=a.mirror.getId(t);if(!d.get(e)&&0!==t.width&&0!==t.height){d.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var r,i,n=t.getContext(t.__context);if(null==n||null===(r=n.isContextLost)||void 0===r?void 0:r.call(n))return void d.set(e,!1);!1===(null==n||null===(i=n.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var o=t.clientWidth||t.width,h=t.clientHeight||t.height,c=Math.max(1,Math.round(o*l)),v=Math.max(1,Math.round(h*l)),f=function(t,e,r,i,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return Ue}if(void 0!==a){if(!Array.isArray(a)||!a.every(He))return Ue;var o=r/n,u=i/s;return a.filter(t=>t.width>0&&t.height>0).map(t=>{var e=Math.floor(t.x*o),r=Math.floor(t.y*u);return{x:e,y:r,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*u)-r}})}}}(s.canvasMasking,t,c,v,o,h);if("skip-frame"===f)return void d.set(e,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});u.postMessage({id:e,bitmap:p,width:c,height:v,displayWidth:o,displayHeight:h,dataURLOptions:s.dataURLOptions,maskRegions:f},[p])}catch(t){d.set(e,!1)}}});return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(g))};v=requestAnimationFrame(g),this.resetObservers=()=>{var t;h(),cancelAnimationFrame(v),null===(t=u.terminate)||void 0===t||t.call(u),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=rr(t,e,r,!1),s=function(t,e,r,i,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),u=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var u=_(e.CanvasRenderingContext2D.prototype,a,function(s){return function(){for(var u=arguments.length,l=new Array(u),h=0;u>h;h++)l[h]=arguments[h];return ue(this.canvas,r,i,!0)||setTimeout(()=>{var r=Ke(l,e,this,n);t(this.canvas,{type:o["2D"],property:a,args:r})},0),s.apply(this,l)}});s.push(u)}catch(n){var l=re(e.CanvasRenderingContext2D.prototype,a,{set(e){ue(this.canvas,r,i,!0)||t(this.canvas,{type:o["2D"],property:a,args:[e],setter:!0})}});s.push(l)}};for(var l of a)if(u(l))continue;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(...ir(e.WebGLRenderingContext.prototype,o.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...ir(e.WebGL2RenderingContext.prototype,o.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(e,r){if(!this.frozen&&!this.locked){var i=this.pendingCanvasMutations.get(e);if(i&&-1!==r){var n=i.map(e=>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}(e,t));this.mutationCb({id:r,type:i[0].type,commands:n}),this.pendingCanvasMutations.delete(e)}}}},dr=class{constructor(t){var e;X(this,"trackedLinkElements",new WeakSet),X(this,"pendingDeferredSheets",new Set),X(this,"mutationCb",void 0),X(this,"adoptedStyleSheetCb",void 0),X(this,"maskAllElementAttributes",void 0),X(this,"maskAttributeFn",void 0),X(this,"styleMirror",new pe),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var r=null,i=null;try{(i=t.sheet)&&(r=dt(i))}catch(t){}if(!r||!i)return Z(),null;var n=r,s=!1,a={sheet:i,invalidate(){s=!0}};this.pendingDeferredSheets.add(a);var o=!1;return{advance:r=>{if(o)return!0;var u,l,h=S(),d=R(),c=!0;try{if(s)return o=!0,Z(),!0;if(!n.advance(r))return c=!1,!1;o=!0;var v=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==i?(Z(),!0):v?(this.emitCssTextMutation(t,e,v),!0):(Z(),!0)}finally{c&&this.pendingDeferredSheets.delete(a),A(u=S()-h,null!=(l=d)?l:M)||(j.totalMs+=u,u>j.slowestSliceMs&&(j.slowestSliceMs=u))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(a)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var r;null===(r=this.beginDeferredLinkInlining(t,e))||void 0===r||r.advance(1/0)}emitCssTextMutation(t,e,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:gt({element:t,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}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;if(r.styleMirror.has(t))e=r.styleMirror.getId(t);else{var s=r.styleMirror.add(t);e=s;var a=S();try{q(()=>{try{var e=t.rules||t.cssRules;e&&H(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,(e,r)=>({rule:st(e,t.href),index:r}))})})}finally{G(S()-a)}}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,this.pendingDeferredSheets.clear(),Wt.forEach(t=>t.abort()),Wt.clear()}trackStylesheetInLinkElement(t){}},cr=class{constructor(){X(this,"nodeMap",new WeakMap),X(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(){}},vr=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var fr,pr=document.createElement("iframe");document.body.appendChild(pr),Array.from=(null===(fr=pr.contentWindow)||void 0===fr?void 0:fr.Array.from)||Array.from,document.body.removeChild(pr)}}catch(t){console.debug("Unable to override Array.from",t)}var gr=new ct,mr=new Set([n.Mutation,n.MediaInteraction,n.StyleSheetRule,n.CanvasMutation,n.Font,n.Log,n.StyleDeclaration,n.AdoptedStyleSheet]);function yr(t){var e=window;if("function"==typeof e.requestIdleCallback){var r=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,r)}}}var i=setTimeout(t,250);return{cancel:()=>clearTimeout(i)}}function br(t){var r;void 0===t&&(t={});var s=t,a=s.emit,o=s.checkoutEveryNms,u=s.checkoutEveryNth,l=s.blockClass,h=void 0===l?"rr-block":l,d=s.blockSelector,c=void 0===d?null:d,v=s.ignoreClass,f=void 0===v?"rr-ignore":v,p=s.ignoreSelector,g=void 0===p?null:p,m=s.maskTextClass,y=void 0===m?"rr-mask":m,b=s.maskTextSelector,w=void 0===b?null:b,_=s.inlineStylesheet,S=void 0===_||_,M=s.inlineStylesheetBudgetRules,C=s.maskAllInputs,R=s.maskInputOptions,A=s.slimDOMOptions,x=s.maskInputFn,T=s.maskTextFn,E=s.maskAllElementAttributes,O=void 0!==E&&E,F=s.maskAttributeFn,D=s.hooks,L=s.packFn,P=s.sampling,B=void 0===P?{}:P,j=s.dataURLOptions,U=void 0===j?{}:j,H=s.canvasResolutionScale,q=s.canvasMasking,G=s.mousemoveWait,V=s.recordDOM,Z=void 0===V||V,Q=s.recordCanvas,X=void 0!==Q&&Q,K=s.recordCrossOriginIframes,Y=void 0!==K&&K,tt=s.recordAfter,et=void 0===tt?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":tt,rt=s.userTriggeredOnInput,it=void 0!==rt&&rt,nt=s.collectFonts,st=void 0!==nt&&nt,at=s.inlineImages,ot=void 0!==at&&at,ut=s.plugins,lt=s.keepIframeSrcFn,ht=void 0===lt?()=>!1:lt,dt=s.ignoreCSSAttributes,vt=void 0===dt?new Set([]):dt,ft=s.attributeFilter;be=s.errorHandler;var pt=i({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},U),gt=!Y||window.parent===window,mt=!1;if(!gt)try{window.parent.document&&(mt=!1)}catch(t){mt=!0}if(gt&&!a)throw new Error("emit function is required");if(!gt&&!mt)return()=>{};void 0!==G&&void 0===B.mousemove&&(B.mousemove=G),gr.reset();var yt,bt=!0===C?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==R?R:{password:!0},wt=Vt(void 0!==A&&A);!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 _t,kt,St=0,Mt=new Map,Ct=t=>{for(var e of ut||[])e.eventProcessor&&(t=e.eventProcessor(t));return L&&!mt&&(t=L(t)),t};or=(t,r)=>{var i,s=t;if(s.timestamp=ie(),!(null===(i=Re[0])||void 0===i?void 0:i.isFrozen())||s.type===e.FullSnapshot||s.type===e.IncrementalSnapshot&&mr.has(s.data.source)||Re.forEach(t=>t.unfreeze()),gt)null==a||a(Ct(s),r);else if(mt){var l={type:"rrweb",event:Ct(s),origin:window.location.origin,isCheckout:r};window.parent.postMessage(l,"*")}if(s.type===e.FullSnapshot)yt=s,St=0;else if(s.type===e.IncrementalSnapshot){if(s.data.source===n.Mutation&&s.data.isAttachIframe)return;St++,(u&&St>=u||o&&s.timestamp-yt.timestamp>o)&&ur(!0)}};var It=t=>{if(t.removes&&t.removes.length>0){var r=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,s=new Set;if(t.adds.length>0)for(var a of t.adds){var o=gr.getNode(a.node.id);o&&"IFRAME"===o.nodeName&&s.add(o)}t.removes.forEach(t=>{var e=t.id;if(!r||!r.has(e)){var i=Tt.getIframeElementById(e);i&&s.has(i)?Tt.forgetIframeId(e):(null==_t||_t(e),Tt.removeIframeById(e))}}),null==kt||kt(),Tt.cleanupDetachedIframes()}or({type:e.IncrementalSnapshot,data:i({source:n.Mutation},t)})},Rt=t=>or({type:e.IncrementalSnapshot,data:i({source:n.Scroll},t)}),At=t=>or({type:e.IncrementalSnapshot,data:i({source:n.CanvasMutation},t)}),xt=new dr({mutationCb:It,adoptedStyleSheetCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.AdoptedStyleSheet},t)}),maskAllElementAttributes:O,maskAttributeFn:F}),Tt=new We({mirror:gr,mutationCb:It,stylesheetManager:xt,recordCrossOriginIframes:Y,wrappedEmit:or});for(var Et of ut||[])Et.getMirror&&Et.getMirror({nodeMirror:gr,crossOriginIframeMirror:Tt.crossOriginIframeMirror,crossOriginIframeStyleMirror:Tt.crossOriginIframeStyleMirror});var Ot=new cr,Ft=null==q?void 0:q.configured;lr=new hr({recordCanvas:X,mutationCb:At,win:window,blockClass:h,blockSelector:c,mirror:gr,sampling:B.canvas,dataURLOptions:pt,resolutionScale:H,canvasMasking:q});var Dt=new ze({mutationCb:It,scrollCb:Rt,bypassOptions:{blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:w,inlineStylesheet:S,maskInputOptions:bt,dataURLOptions:pt,maskTextFn:T,maskInputFn:x,maskAllElementAttributes:O,maskAttributeFn:F,recordCanvas:X,canvasMaskingConfigured:Ft,inlineImages:ot,sampling:B,slimDOMOptions:wt,iframeManager:Tt,stylesheetManager:xt,canvasManager:lr,keepIframeSrcFn:ht,processedNodeManager:Ot,attributeFilter:ft},mirror:gr});ur=function(t){if(void 0===t&&(t=!1),Z){W(M);try{or({type:e.Meta,data:{href:window.location.href,width:ae(),height:se()}},t),null==r||r.cancel(),r=void 0,xt.reset(),Dt.init(),Re.forEach(t=>t.lock());var i,n=null;try{n=function(t,e){var r=e||{},i=r.mirror,n=void 0===i?new ct:i,s=r.blockClass,a=void 0===s?"rr-block":s,o=r.blockSelector,u=void 0===o?null:o,l=r.maskTextClass,h=void 0===l?"rr-mask":l,d=r.maskTextSelector,c=void 0===d?null:d,v=r.inlineStylesheet,f=void 0===v||v,p=r.inlineImages,g=void 0!==p&&p,m=r.recordCanvas,y=void 0!==m&&m,b=r.canvasMaskingConfigured,w=r.maskAllInputs,_=void 0!==w&&w,k=r.maskTextFn,S=r.maskInputFn,M=r.maskAllElementAttributes,C=void 0!==M&&M,I=r.maskAttributeFn,R=r.slimDOM,A=r.dataURLOptions,x=r.preserveWhiteSpace,T=r.onSerialize,E=r.onIframeLoad,O=r.iframeLoadTimeout,F=r.onIframeListenerRegistered,D=r.onStylesheetLoad,N=r.stylesheetLoadTimeout,L=r.keepIframeSrcFn,P=void 0===L?()=>!1:L,B=r.maxDepth,j=r.inlineStylesheetBudgetRules,U=!0===_?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===_?{password:!0}:_,H=Vt(void 0!==R&&R);W(j);try{return Gt(t,{doc:t,mirror:n,blockClass:a,blockSelector:u,maskTextClass:h,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:U,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:I,slimDOMOptions:H,dataURLOptions:A,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:x,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:O,onIframeListenerRegistered:F,onStylesheetLoad:D,stylesheetLoadTimeout:N,keepIframeSrcFn:P,newlyAddedElement:!1,maxDepth:B})}finally{z()}}(document,{mirror:gr,blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:w,inlineStylesheet:S,maskAllInputs:bt,inlineStylesheetBudgetRules:M,maskTextFn:T,maskInputFn:x,maskAllElementAttributes:O,maskAttributeFn:F,slimDOM:wt,dataURLOptions:pt,recordCanvas:X,canvasMaskingConfigured:Ft,inlineImages:ot,onSerialize(t){ce(t,gr)&&Tt.addIframe(t),ve(t,gr)&&xt.trackLinkElement(t),fe(t)&&Dt.addShadowRoot(k.shadowRoot(t),document)},onIframeLoad(t,e){Tt.attachIframe(t,e),Dt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){Tt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){xt.attachLinkElement(t,e)},keepIframeSrcFn:ht})}finally{a=N,N=[],i=a}if(!n)return console.warn("Failed to snapshot the document");if(or({type:e.FullSnapshot,data:{node:n,initialOffset:ne(window)}},t),Re.forEach(t=>t.unlock()),lr.onFullSnapshot(),i.length){var s=function(t,e,r){var i=!1,n=null,s=0,a=null,o=()=>null!==a||t.length>s,u=()=>{var r=t[s];t[s]=null,s+=1,r&&Xt(()=>{a=e.beginDeferredLinkInlining(r,gr.getId(r))})},l=()=>{if(a){var t=a,e=!0;Xt(()=>{e=t.advance(200)}),e&&(a=null)}},h=()=>{a||u(),l()},d=t=>{if(n=null,!i){var e=0;do{try{h()}catch(t){null==a||a.discard(),a=null,J(1)}e+=1}while(!i&&o()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(o()?n=yr(d):r())}};return n=yr(d),{cancel(){i=!0,null==a||a.discard(),a=null,null==n||n.cancel(),n=null},flush(){if(!i){i=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;o()&&50>e;){a||u();var d=a;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),a=null,h+=1;else{try{l()}catch(t){null==a||a.discard(),a=null,h+=1}e+=1}}if(o()||h>0){for(var c=h+(null!==a?1:0),v=s;t.length>v;v++)null!==t[v]&&(c+=1);J(c),null==a||a.discard(),a=null}r()}}}}(i,xt,()=>{r===s&&(r=void 0)});r=s}Y&&Tt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&xt.adoptStyleSheets(document.adoptedStyleSheets,gr.getId(document))}finally{z()}var a}};try{var Nt=[];for(var Lt of(Nt.push(Jt("pagehide",()=>{try{null==r||r.flush()}catch(t){}r=void 0},window)),["visibilitychange","freeze","resume"]))Nt.push(Jt(Lt,I,document));_t=t=>{var e=Mt.get(t);e&&(e.forEach(t=>{Xt(t);var e=Nt.indexOf(t);-1!==e&&Nt.splice(e,1)}),Mt.delete(t))},kt=()=>{for(var t of Mt){var e=t[0],r=gr.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==_t||_t(e)}catch(t){null==_t||_t(e)}else null==_t||_t(e)}};var Pt=t=>{var r;return Ie(Pe)({mutationCb:It,mousemoveCb:(t,r)=>or({type:e.IncrementalSnapshot,data:{source:r,positions:t}}),mouseInteractionCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.MouseInteraction},t)}),scrollCb:Rt,viewportResizeCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.ViewportResize},t)}),inputCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.Input},t)}),mediaInteractionCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.MediaInteraction},t)}),styleSheetRuleCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.StyleSheetRule},t)}),styleDeclarationCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.StyleDeclaration},t)}),canvasMutationCb:At,fontCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.Font},t)}),selectionCb(t){or({type:e.IncrementalSnapshot,data:i({source:n.Selection},t)})},customElementCb(t){or({type:e.IncrementalSnapshot,data:i({source:n.CustomElement},t)})},blockClass:h,ignoreClass:f,ignoreSelector:g,maskTextClass:y,maskTextSelector:w,maskInputOptions:bt,inlineStylesheet:S,sampling:B,recordDOM:Z,recordCanvas:X,canvasMaskingConfigured:Ft,inlineImages:ot,userTriggeredOnInput:it,collectFonts:st,doc:t,maskInputFn:x,maskTextFn:T,maskAllElementAttributes:O,maskAttributeFn:F,keepIframeSrcFn:ht,blockSelector:c,slimDOMOptions:wt,dataURLOptions:pt,mirror:gr,iframeManager:Tt,stylesheetManager:xt,shadowDomManager:Dt,processedNodeManager:Ot,canvasManager:lr,ignoreCSSAttributes:vt,attributeFilter:ft,plugins:(null==ut||null===(r=ut.filter(t=>t.observer))||void 0===r?void 0:r.map(t=>({observer:t.observer,options:t.options,callback:r=>or({type:e.Plugin,data:{plugin:t.name,payload:r}})})))||[]},D)};Tt.addLoadListener(t=>{try{var e=gr.getId(t),r=Pt(t.contentDocument);if("function"==typeof r&&(Nt.push(r),-1!==e)){var i=Mt.get(e);i||Mt.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}}),Tt.addPageHideListener(t=>{var e=gr.getId(t);null==_t||_t(e),Ee(t)});var Bt=-1,$t=t=>or({type:e.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),jt=()=>{var t,e,r,i,n=document,s=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,a=s?gr.getId(s):-1;a!==Bt&&(-1!==Bt&&$t({id:Bt,enter:!1}),Bt=a,-1!==a&&$t({id:a,enter:!0}))},Wt=()=>{ur();var t=Pt(document);"function"==typeof t&&Nt.push(t),Nt.push(Jt("fullscreenchange",jt)),Nt.push(Jt("webkitfullscreenchange",jt)),Nt.push(Jt("mozfullscreenchange",jt)),Nt.push(Jt("MSFullscreenChange",jt)),vr=!0};return["interactive","complete"].includes(document.readyState)?Wt():(Nt.push(Jt("DOMContentLoaded",()=>{or({type:e.DomContentLoaded,data:{}}),"DOMContentLoaded"===et&&Wt()})),Nt.push(Jt("load",()=>{or({type:e.Load,data:{}}),"load"===et&&Wt()},window))),()=>{try{null==r||r.flush()}catch(t){}r=void 0,Kt(Nt),Ot.destroy(),Tt.removeLoadListener(),Tt.destroy(),Mt.clear(),Dt.reset(),gr.reset(),vr=!1,be=void 0}}catch(t){console.warn(t)}}br.addCustomEvent=(t,r)=>{if(!vr)throw new Error("please add custom event after start recording");or({type:e.Custom,data:{tag:t,payload:r}})},br.freezePage=()=>{Re.forEach(t=>t.freeze())},br.takeFullSnapshot=t=>{if(!vr)throw new Error("please take full snapshot after start recording");ur(t)},br.mirror=gr,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var wr=Object.create(null);function _r(t){return _r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_r(t)}function kr(t,e,r){return(e=function(t){var e=function(t){if("object"!=_r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=_r(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_r(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}wr.Node=Object.create(null),wr.ShadowRoot=Object.create(null),wr.MutationObserver=Object.create(null),wr.Element=Object.create(null);var Sr=class{constructor(t){kr(this,"fileName",void 0),kr(this,"functionName",void 0),kr(this,"lineNumber",void 0),kr(this,"columnNumber",void 0),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}},Mr=/(^|@)\S+:\d+/,Cr=/^\s*at .*(\S+:\d+|\(native\))/m,Ir=/^(eval@)?(\[native code])?$/,Rr={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Cr)?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(Cr)},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());return new Sr({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(Ir)},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 Sr({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Sr({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 Sr({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 Sr({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(Mr)&&!t.match(/^Error created at/)},this).map(function(t){var e=t.split("@"),r=this.extractLocation(e.pop());return new Sr({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Ar(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 xr(t){return Array.isArray(t)}function Tr(t){return"object"==typeof t&&null!==t&&!xr(t)}function Er(t,e){if(0===e)return!0;for(var r of Object.keys(t))if(Tr(t[r])&&Er(t[r],e-1))return!0;return!1}function Or(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(Tr(a=e)&&Object.keys(a).length>r.numOfKeysLimit||"function"==typeof a||Tr(a)&&Er(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]=xr(l)?Ar(l.length?l[0]:null):l}return o}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var Fr={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Dr(t,e,r){var i,n=r?Object.assign({},Fr,r):Fr,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var a=0,o=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message;t({level:"error",trace:Rr.parse(e.error).map(t=>t.toString()),payload:[Or(r,n.stringifyOptions)]})};e.addEventListener("error",l),u.push(()=>{e.removeEventListener("error",l)});var h=e=>{var r,i;e.reason instanceof Error?i=[Or("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Or("Uncaught (in promise)",n.stringifyOptions),Or(e.reason,n.stringifyOptions)]),t({level:"error",trace:Rr.parse(r).map(t=>t.toString()),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){try{if(!(s in e))return()=>{};var u=e[s],l={next:u},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=Rr.parse(new Error).map(t=>t.toString()).splice(1),d=("assert"===r?u.slice(1):u).map(t=>Or(t,n.stringifyOptions));a++,n.lengthThreshold>a?t({level:r,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Or("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{o=!1}}})(function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return l.next.apply(this,e)});return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:l}})),e[s]=h,()=>{if(e[s]!==h)for(var t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},r=e[s],i=t(r);i;){if(i.next===h)return void(i.next=l.next);i=t(r=i.next)}else e[s]=l.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var Nr="u">typeof window?window:void 0,Lr="u">typeof globalThis?globalThis:Nr,Pr=null==Lr?void 0:Lr.document,Br=null==Lr?void 0:Lr.location;null!=Lr&&Lr.XMLHttpRequest&&new Lr.XMLHttpRequest;var $r="undefined"!=typeof globalThis?globalThis:Nr;$r&&"undefined"==typeof self&&($r.self=$r),$r&&"undefined"==typeof File&&($r.File=function(){});var jr=null!=Nr?Nr:{},Wr=Object.prototype,zr=Wr.hasOwnProperty,Ur=Wr.toString,Hr=Array.isArray||function(t){return"[object Array]"===Ur.call(t)},qr=t=>"function"==typeof t,Gr=t=>t===Object(t)&&!Hr(t),Vr=t=>void 0===t,Zr=t=>"[object String]"==Ur.call(t),Jr=t=>null===t,Qr=t=>Vr(t)||Jr(t),Xr=t=>"[object Number]"==Ur.call(t)&&t==t,Kr=t=>"[object Boolean]"===Ur.call(t),Yr=t=>t instanceof FormData;function ti(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),Xr(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),ti(null!=n?n:r,e,r,i))}var ei=class{constructor(t){this.C={},this.I=t.I,this.R=ti(t.bucketSize,0,100,t.A),this.O=ti(t.refillRate,0,this.R,t.A),this.N=ti(t.refillInterval,0,864e5,t.A)}F(t,e){var r=Math.floor((e-t.lastAccess)/this.N);r>0&&(t.tokens=Math.min(t.tokens+r*this.O,this.R),t.lastAccess=t.lastAccess+r*this.N)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.C[i];return n?this.F(n,r):this.C[i]=n={tokens:this.R,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}};function ri(t){return t?t.split("#")[0]:t}var ii,ni="NativeGzipValidationError",si=t=>{throw function(t,e){var r=new Error(e);try{Object.defineProperty(r,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return r}(ni,"Native gzip produced invalid output: "+t)},ai=function(){var t=r(function*(t,e){18>t.size&&si("too-short");var r,i=new Uint8Array(yield t.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&si("invalid-header");var n=new DataView(yield t.slice(t.size-8).arrayBuffer());n.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(ii)return ii;ii=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;ii[t]=e>>>0}return ii})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&si("invalid-crc");var s=e.length>>>0;n.getUint32(4,!0)!==s&&si("invalid-size")});return function(e,r){return t.apply(this,arguments)}}();function oi(){return oi=r(function*(t,e,i){void 0===e&&(e=!0);try{var n=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),a=s.writable.getWriter(),o=a.write(n).then(()=>a.close()).catch(function(){var t=r(function*(t){try{yield a.abort(t)}catch(t){}throw t});return function(e){return t.apply(this,arguments)}}()),u=new Response(s.readable).blob(),l=(yield Promise.all([u,o]))[0];return yield ai(l,n),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),oi.apply(this,arguments)}var ui="0.8.2",li={DEBUG:!1,LIB_VERSION:ui,LIB_NAME:"browser-common",JS_SDK_VERSION:ui},hi=function(t,e){var r=(void 0===e?{}:e).debugEnabled,i={q(e){for(var i=arguments.length,n=new Array(i>1?i-1:0),s=1;i>s;s++)n[s-1]=arguments[s];Nr&&(li.DEBUG||Nr.POSTHOG_DEBUG||r)&&!Vr(Nr.console)&&Nr.console&&("__rrweb_original__"in Nr.console[e]?Nr.console[e].__rrweb_original__:Nr.console[e])(t,...n)},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("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)=>hi(t+" "+e,r)};return i},di=hi("[PostHog.js]"),ci=di.createLogger;function vi(t,e){if(!Qr(t))if(Hr(t))t.forEach(e);else if(Yr(t))t.forEach((t,r)=>e(t,r));else for(var r in t)zr.call(t,r)&&e(t[r],r)}function fi(t,e,r,i){var n=null!=i?i:{},s=n.capture,a=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==s&&s,passive:void 0===a||a})}var pi=["localhost","127.0.0.1"],gi=t=>{var e=null==Pr?void 0:Pr.createElement("a");return Vr(e)?null:(e.href=t,e)},mi=()=>{},yi=t=>{var e;if(qr(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function bi(t,e,r){try{if(!(e in t))return mi;var i={next:t[e]},n=r(function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)});return qr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e],s=yi(r);s;){if(s.next===n)return void(s.next=i.next);s=yi(r=s.next)}else t[e]=i.next}}catch(t){return mi}}function wi(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function _i(t){var e,r=null==Nr||null==(e=Nr.location)?void 0:e.href;return Vr(r)?void 0:function(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!qr(i))return e;try{var n=i(e);return Zr(n)&&n?n:e}catch(t){return di.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,r)}var ki=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),Si=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Mi=[16,15,14,13],Ci=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Ii=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Ri=/[0-9A-Za-z_]/;function Ai(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}var xi=1e6;function Ti(t){var e;return Math.min(xi,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:1e6)}var Ei={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:xi,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},Oi=["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"],Fi=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Di=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Ni=t=>{Qr(t)||vi(Object.keys(t),e=>{(t=>{var e=t.toLowerCase();return Oi.includes(e)||Di.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Li=["/s/","/e/","/i/"];function Pi(t,e,r,i){if(Qr(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Zr(n)&&(n=parseInt(n)),n>r?"[SessionRecording] "+i+" body too large to record ("+n+" bytes)":t}function Bi(t,e){if(Qr(t))return t;var r=t;return function(t,e){if(void 0===e&&(e=!0),Qr(t))return!1;if(Zr(t)){if(t=t.trim(),e?ki.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(Si.lastIndex=0;e=Si.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var s of Mi){var a=n+s;if(i.length>=a){var o=i.slice(n,a);if(ki.test(o)&&Ai(o))return!0}}}return!1}(t))return!1;if(e?Ci.test(t):function(t){var e;for(Ii.lastIndex=0;e=Ii.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&Ri.test(r)&&Ri.test(i)))return!0}return!1}(t))return!1}return!0}(r,!1)||(r="[SessionRecording] "+e+" body redacted"),vi(Fi,t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r="[SessionRecording] "+e+" body redacted as might contain: "+t)}),r}var $i=new WeakSet,ji=ci("[Recorder]"),Wi=t=>"navigation"===t.entryType,zi=t=>"resource"===t.entryType;function Ui(t,e){return!!e&&(Kr(e)||e[t])}function Hi(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var qi=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Gi(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find(t=>"content-type"===t.toLowerCase()),r=e&&i[e];return t.some(t=>null==r?void 0:r.toLowerCase().includes(t))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Hi(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(qi))return!1;if(Kr(r))return!0;if(Hr(r))return n(r);var s=r[e];return Kr(s)?s:n(s)}function Vi(t,e,r,i,n,s){return Zi.apply(this,arguments)}function Zi(){return Zi=r(function*(t,e,r,i,n,s){return void 0===s&&(s=0),s>10?(ji.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null):function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),t=>zi(t)&&t.initiatorType===e&&(Vr(i)||t.startTime>=i)&&(Vr(n)||n>=t.startTime))||(yield new Promise(t=>setTimeout(t,50*s)),Vi(t,e,r,i,n,s+1))}),Zi.apply(this,arguments)}function Ji(t){var e=t.body,r=t.options,i=t.url;if(Qr(e))return null;var n=wi(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(Zr(e))return e;if((t=>"u">typeof Document&&t instanceof Document)(e))return e.textContent;if(Yr(e))return function(t,e){var r,i;void 0===e&&(e="&");var n=[];return vi(t,function(t,e){Vr(t)||Vr(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)}(e);if(Gr(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 Qi=t=>!Jr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Xi(t){var e=t.entry,r=t.method,n=t.status,s=t.networkRequest,a=t.isInitial,o=t.start,u=t.end,l=t.url,h=t.initiatorType;o=e?e.startTime:o,u=e?e.responseEnd:u;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(o||0)),v=[i({},e?e.toJSON():{name:l},{startTime:Vr(o)?void 0:Math.round(o),endTime:Vr(u)?void 0:Math.round(u),timeOrigin:d,timestamp:c,method:r,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:a})];if(Qi(e))for(var f of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Ki=["video/","audio/"];function Yi(t){return Gr(t)&&qr(t.getReader)&&qr(t.tee)}var tn="[SessionReplay] Timeout while trying to read body",en="[SessionReplay] Failed to read body";function rn(t){return en+": "+t}function nn(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function sn(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{var r=setTimeout(()=>e(tn),500);try{t.clone().text().then(t=>e(t),t=>e(rn(t))).finally(()=>clearTimeout(r))}catch(t){clearTimeout(r),e(en)}})}(t);var r=Ti(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(nn(r)):function(t,e){return new Promise(r=>{var i,n=!1;function s(){try{var t;null==(t=i)||t.cancel().catch(()=>{})}catch(t){}}function a(t){n||(n=!0,clearTimeout(u),s(),r(t))}var o,u=setTimeout(()=>a(tn),500);try{o=t.clone()}catch(t){return void a(en)}var l=o.body;if(Yi(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(t){return void a(en)}var h=[],d=0;!function t(){i.read().then(r=>{var i=r.done,o=r.value;if(n)s();else if(i)a((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(o){if(d+o.byteLength>e)return void a(nn(e));d+=o.byteLength,h.push(o)}t()}},t=>a(rn(t)))}()}else try{o.text().then(t=>a(t),t=>a(rn(t)))}catch(t){a(en)}})}(t,r)}function an(){return(an=r(function*(t){var e=t.r,r=t.options,i=wi(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):sn(e,r)})).apply(this,arguments)}function on(){return(on=r(function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),a=Ki.some(t=>null==s?void 0:s.startsWith(t));if(s&&a)return"Content-Type "+s+" is not supported";var o=wi(n,i);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return Jr(i)?sn(e,r):Promise.resolve(i)})).apply(this,arguments)}var un=null;function ln(t,e,n){if(!("performance"in e))return()=>{};if(un)return ji.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Ei,n):Ei,a=e=>{var r=[],n=!1;e.requests.forEach(t=>{var e="serverTiming"===t.entryType;if(!e||!n){var i=s.maskRequestFn(t);e||(n=!i||(t=>!!t&&$i.has(t))(i)),i&&r.push(i)}}),r.length>0&&t(i({},e,{requests:r}))},o=function(t,e,r){r.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>Wi(t)||zi(t)&&r.initiatorTypes.includes(t.initiatorType)).flatMap(t=>Xi({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0});var i=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>Wi(t)||zi(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>Xi({entry:t,method:void 0,status:void 0,networkRequest:{}}))})}),n=PerformanceObserver.supportedEntryTypes.filter(t=>r.performanceEntryTypeToObserve.includes(t));return i.observe({entryTypes:n}),()=>{i.disconnect()}}(a,e,s),u=()=>{},l=()=>{};return(s.recordHeaders||s.recordBody)&&(u=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Ui("request",r.recordHeaders),n=Ui("response",r.recordHeaders),s=bi(e.XMLHttpRequest.prototype,"open",s=>function(a,o,u,l,h){void 0===u&&(u=!0);var d=this;try{var c,v,f=new Request(o),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(Gi({type:"request",headers:g,url:o,recordBody:r.recordBody})&&(p.requestBody=Ji({body:t,options:r,url:o})),c=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",w),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},w=()=>{if(d.readyState===d.DONE){b(),v=e.performance.now();var i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)}),n&&(p.responseHeaders=i),Gi({type:"response",headers:i,url:o,recordBody:r.recordBody})&&(p.responseBody=Ji({body:d.response,options:r,url:o})),Vi(e,"xmlhttprequest",f.url,c,v).then(e=>{t({requests:Xi({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:o.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})}};d.addEventListener("readystatechange",w),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){ji.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),u,l,h)});return()=>{s()}}(a,e,s),l=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Ui("request",i.recordHeaders),s=Ui("response",i.recordHeaders),a=bi(e,"fetch",a=>function(){var o=r(function*(r,o){var u,l;try{u=new Request(r,o)}catch(t){return ji.error("Failed to instrument fetch for network capture",t),a(r,o)}var h,d,c={};try{try{var v={};u.headers.forEach((t,e)=>{v[e]=t}),n&&(c.requestHeaders=v),!Yi(null==o?void 0:o.body)&&Gi({type:"request",headers:v,url:r,recordBody:i.recordBody})&&(c.requestBody=yield function(t){return an.apply(this,arguments)}({r:u,options:i,url:r}))}catch(t){ji.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),l=Hi(r)?yield a(u):yield a(r,o),d=e.performance.now();try{var f={};l.headers.forEach((t,e)=>{f[e]=t}),s&&(c.responseHeaders=f),Gi({type:"response",headers:f,url:r,recordBody:i.recordBody})&&(c.responseBody=yield function(t){return on.apply(this,arguments)}({r:l,options:i,url:r}))}catch(t){ji.error("Failed to record fetch response for network capture",t)}return l}finally{Vi(e,"fetch",u.url,h,d).then(e=>{var r;t({requests:Xi({entry:e,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:c,start:h,end:d,url:u.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return o.apply(this,arguments)}}());return()=>{a()}}(a,e,s)),un=()=>{o(),u(),l(),un=null}}var hn="$session_recording_remote_config",dn="$replay_sample_rate",cn="$replay_override_sampling",vn="$replay_override_linked_flag",fn="$replay_override_url_trigger",pn="$replay_override_event_trigger",gn="$session_is_sampled",mn="$session_past_minimum_duration",yn="$session_recording_url_trigger_activated_session",bn="$session_recording_event_trigger_activated_session",wn="$posthog_sr_group_event_trigger_",_n="$posthog_sr_group_url_trigger_",kn="$posthog_sr_group_sampling_",Sn="$debug_first_full_snapshot_timestamp",Mn="$sess_rec_flush_size",Cn="$stored_person_properties",In="$sdk_debug_replay_event_trigger_status",Rn="$sdk_debug_replay_linked_flag_trigger_status",An="$sdk_debug_replay_matched_recording_trigger_groups",xn="$sdk_debug_replay_pending_trigger_conditions",Tn="$sdk_debug_replay_remote_trigger_matching_config",En="$sdk_debug_replay_trigger_groups_count",On="$sdk_debug_replay_url_trigger_status",Fn="$sdk_debug_rrweb_attached",Dn="$sdk_debug_rrweb_start_attempted",Nn="$session_recording_start_reason",Ln="disabled",Pn="sampled",Bn="active",$n="buffering",jn="paused",Wn="rrweb_error",zn="trigger_activated",Un="trigger_pending",Hn="trigger_disabled";function qn(t,e,r,i,n,s){return 0===e?Hn:(null==t?void 0:t.get_property(r?i+r:n))===s?zn:Un}function Gn(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)})}function Vn(t){return t.includes("trigger_activated")?zn:t.includes("trigger_pending")?Un:Hn}function Zn(t){var e=new Set(t);switch(e.delete(Hn),e.size){case 0:return Hn;case 1:return Array.from(e)[0];default:return Un}}var Jn=class{constructor(t){this.j=t}triggerStatus(t){return Vn(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return Vn(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},Qn=class{constructor(t){this.j=t}triggerStatus(t){return Zn(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return Zn(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},Xn=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return zn}stop(){}},Kn=t=>"sessionRecording"in t,Yn=class{constructor(t,e){this._instance=t,this.B=[],this.H=[],this.$=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,r;this.B=(Kn(t)?Gr(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(Kn(t)?Gr(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){for(var t of(this.$.clear(),this.U.clear(),this.B))if("regex"===t.matching&&!this.$.has(t.url))try{this.$.set(t.url,new RegExp(t.url))}catch(e){di.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.H)if("regex"===e.matching&&!this.U.has(e.url))try{this.U.set(e.url,new RegExp(e.url))}catch(t){di.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return qn(this._instance,this.B.length,this.V,_n,yn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[On]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=_i(this._instance);if(!t)return!1;try{return Gn(t,this.H,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){var r=_i(this._instance);if(r&&r!==this.W){this.W=r;var i=this.urlBlocked,n=Gn(r,this.H,this.U);i&&n||(n&&!i?t():!n&&i&&e())}}checkUrlTriggerConditions(t,e,r,i){var n=_i(this._instance);if(n&&n!==this.W){this.W=n;var s=this.urlBlocked,a=Gn(n,this.H,this.U);a&&!s?t():!a&&s&&e();var o=this.G(i)===zn,u=Gn(n,this.B,this.$);!o&&u&&r("url",n)}}stop(){this.W=""}},ts=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Rn]:t}),t}triggerStatusNoSideEffects(){var t=Un;return Qr(this.linkedFlag)&&(t=Hn),this.linkedFlagSeen&&(t=zn),t}onConfig(t,e){var r;if(this.linkedFlag=(Kn(t)?Gr(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Qr(this.linkedFlag)&&!this.linkedFlagSeen){var i=Zr(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Zr(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((t,r)=>{var s=!1;if(Gr(r)&&i in r){var a=r[i];s=Kr(a)?!0===a:n?a===n:!!a}var o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(i,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}},es=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(Kn(t)?Gr(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return qn(this._instance,this.K.length,this.V,wn,bn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[In]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,r){if(0!==this.K.length){var i=this.X(r)===zn,n=this.K.includes(t);!i&&n&&e("event",t)}}stop(){}},rs=class{constructor(t,e,r){if(this._instance=t,this.group=e,this.Y=new Yn(t,e.id),this.tt=new es(t,e.id),this.et=new ts(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.Y.onConfig(n),this.tt.onConfig(n),this.et.onConfig(n,r);var s=[this.tt,this.Y,this.et];this.rt="any"===e.conditions.matchType?new Jn(s):new Qn(s)}else this.rt=new Xn}triggerStatus(t){return this.rt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.rt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===Un).map(t=>t.label)}checkEventTriggerConditions(t,e,r){this.tt.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.Y.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r,i="url"===t?_n+this.group.id:wn+this.group.id;null==(r=this._instance.persistence)||r.register({[i]:e})}stop(){this.Y.stop(),this.tt.stop(),this.et.stop()}};function is(t){if(t.rrwebError)return Wn;if(!t.receivedFlags)return $n;if(!t.isRecordingEnabled)return Ln;if(t.urlTriggerMatching.urlBlocked)return jn;var e=!0===t.isSampled,r=new Jn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Pn:"trigger_activated"===r?Bn:"trigger_pending"===r?$n:!1===t.isSampled?Ln:Bn}function ns(t){if(t.rrwebError)return Wn;if(!t.receivedFlags)return $n;if(!t.isRecordingEnabled)return Ln;if(t.urlTriggerMatching.urlBlocked)return jn;var e=new Qn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==Hn,i=Kr(t.isSampled);return r&&"trigger_pending"===e?$n:r&&"trigger_disabled"===e||i&&!t.isSampled?Ln:!0===t.isSampled?Pn:Bn}function ss(){var t=[];return function(e,r){if(Gr(r)||Hr(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r}}function as(t){var e=JSON.stringify(t,ss());return e?new Blob([e]).size:0}function os(t){if(Jr(t))return 4;if(Vr(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(Hr(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=Vr(i)||Jr(i)?4:os(i)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var u=n[o];Vr(u)||(a||(s+=1),a=!1,s+=o.length+3+os(u))}return s;default:return 0}}function us(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[us({size:i.reduce((t,e)=>t+e,0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),us({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(r),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap(t=>t)}return[t]}var ls=Uint8Array,hs=Uint16Array,ds=Uint32Array,cs=new ls([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]),vs=new ls([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]),fs=new ls([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ps=function(t,e){for(var r=new hs(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new ds(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]},gs=ps(cs,2),ms=gs[1];gs[0][28]=258,ms[258]=28;for(var ys=ps(vs,0)[1],bs=new hs(32768),ws=0;32768>ws;++ws){var _s=(43690&ws)>>>1|(21845&ws)<<1;bs[ws]=((65280&(_s=(61680&(_s=(52428&_s)>>>2|(13107&_s)<<2))>>>4|(3855&_s)<<4))>>>8|(255&_s)<<8)>>>1}var ks=function(t,e,r){for(var i=t.length,n=0,s=new hs(e);i>n;++n)++s[t[n]-1];var a,o=new hs(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(r){a=new hs(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[bs[d]>>>u]=l}else for(a=new hs(i),n=0;i>n;++n)a[n]=bs[o[t[n]-1]++]>>>15-t[n];return a},Ss=new ls(288);for(ws=0;144>ws;++ws)Ss[ws]=8;for(ws=144;256>ws;++ws)Ss[ws]=9;for(ws=256;280>ws;++ws)Ss[ws]=7;for(ws=280;288>ws;++ws)Ss[ws]=8;var Ms=new ls(32);for(ws=0;32>ws;++ws)Ms[ws]=5;var Cs=ks(Ss,9,0),Is=ks(Ms,5,0),Rs=function(t){return(t/8|0)+(7&t&&1)},As=function(t,e,r){(null==e||0>e)&&(e=0),(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof hs?hs:t instanceof ds?ds:ls)(r-e);return i.set(t.subarray(e,r)),i},xs=function(t,e,r){var i=e/8|0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},Ts=function(t,e,r){var i=e/8|0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Es=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 ls(0),0];if(1==n){var a=new ls(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort(function(t,e){return t.f-e.f}),r.push({s:-1,f:25001});var o=r[0],u=r[1],l=0,h=1,d=2;for(r[0]={s:-1,f:o.f+u.f,l:o,r:u};h!=n-1;)o=r[r[d].f>r[l].f?l++:d++],u=r[l!=h&&r[d].f>r[l].f?l++:d++],r[h++]={s:-1,f:o.f+u.f,l:o,r:u};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new hs(c+1),f=Os(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(s.sort(function(t,e){return v[e.s]-v[t.s]||t.f-e.f});n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=s[i].s;e>v[b]?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new ls(v),f]},Os=function(t,e,r){return-1==t.s?Math.max(Os(t.l,e,r+1),Os(t.r,e,r+1)):e[t.s]=r},Fs=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new hs(++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]},Ds=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Ns=function(t,e,r){var i=r.length,n=Rs(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},Ls=function(t,e,r,i,n,s,a,o,u,l,h){xs(e,h++,r),++n[256];for(var d=Es(n,15),c=d[0],v=d[1],f=Es(s,15),p=f[0],g=f[1],m=Fs(c),y=m[0],b=m[1],w=Fs(p),_=w[0],k=w[1],S=new hs(19),M=0;y.length>M;++M)S[31&y[M]]++;for(M=0;_.length>M;++M)S[31&_[M]]++;for(var C=Es(S,7),I=C[0],R=C[1],A=19;A>4&&!I[fs[A-1]];--A);var x,T,E,O,F=l+5<<3,D=Ds(n,Ss)+Ds(s,Ms)+a,N=Ds(n,c)+Ds(s,p)+a+14+3*A+Ds(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(D>=F&&N>=F)return Ns(e,h,t.subarray(u,u+l));if(xs(e,h,1+(D>N)),h+=2,D>N){x=ks(c,v,0),T=c,E=ks(p,g,0),O=p;var L=ks(I,R,0);for(xs(e,h,b-257),xs(e,h+5,k-1),xs(e,h+10,A-4),h+=14,M=0;A>M;++M)xs(e,h+3*M,I[fs[M]]);h+=3*A;for(var P=[y,_],B=0;2>B;++B){var j=P[B];for(M=0;j.length>M;++M)xs(e,h,L[W=31&j[M]]),h+=I[W],W>15&&(xs(e,h,j[M]>>>5&127),h+=j[M]>>>12)}}else x=Cs,T=Ss,E=Is,O=Ms;for(M=0;o>M;++M)if(i[M]>255){var W;Ts(e,h,x[257+(W=i[M]>>>18&31)]),h+=T[W+257],W>7&&(xs(e,h,i[M]>>>23&31),h+=cs[W]);var z=31&i[M];Ts(e,h,E[z]),h+=O[z],z>3&&(Ts(e,h,i[M]>>>5&8191),h+=vs[z])}else Ts(e,h,x[i[M]]),h+=T[i[M]];return Ts(e,h,x[256]),h+T[256]},Ps=new ds([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Bs=new ls(0),$s=function(){for(var t=new ds(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),js=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Ws(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=$s[255&r^e[i]]^r>>>8;t=r},d(){return 4294967295^t}}}(),i=t.length;r.p(t);var n,s,a,o,u,l,h=(o=10+((n=e).filename&&n.filename.length+1||0),u=8,function(t,e,r,i,n,s){var a=t.length,o=new ls(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=Ns(u,l,t.subarray(h,d)):(u[h]=s,l=Ns(u,l,t.subarray(h,a)))}else{for(var c=Ps[e-1],v=c>>>13,f=8191&c,p=(1<<r)-1,g=new hs(32768),m=new hs(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},_=new ds(25e3),k=new hs(288),S=new hs(32),M=0,C=0,I=(h=0,0),R=0,A=0;a>h;++h){var x=w(h),T=32767&h,E=m[x];if(g[T]=E,m[x]=T,h>=R){var O=a-h;if((M>7e3||I>24576)&&O>423){l=Ls(t,u,0,_,k,S,C,I,A,h-A,l),I=M=C=0,A=h;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var D=2,N=0,L=f,P=T-E&32767;if(O>2&&x==w(h-P))for(var B=Math.min(v,O)-1,j=Math.min(32767,h),W=Math.min(258,O);j>=P&&--L&&T!=E;){if(t[h+D]==t[h+D-P]){for(var z=0;W>z&&t[h+z]==t[h+z-P];++z);if(z>D){if(D=z,N=P,z>B)break;var U=Math.min(P,z-2),H=0;for(F=0;U>F;++F){var q=h-P+F+32768&32767,G=q-g[q]+32768&32767;G>H&&(H=G,E=q)}}}P+=(T=E)-(E=g[T])+32768&32767}if(N){_[I++]=268435456|ms[D]<<18|ys[N];var V=31&ms[D],Z=31&ys[N];C+=cs[V]+vs[Z],++k[257+V],++S[Z],R=h+D,++M}else _[I++]=t[h],++k[t[h]]}}l=Ls(t,u,s,_,k,S,C,I,A,h-A,l),s||(l=Ns(u,l,Bs))}return As(o,0,i+Rs(l)+n)}(s=t,null==(a=e).level?6:a.level,null==a.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+a.mem,o,u,!l)),d=h.length;return 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&&js(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)}}(h,e),js(h,d-8,r.d()),js(h,d-4,i),h}function zs(t,e){var r="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var i=0;t.length>i;){var n=t[i++];128>n||e?r+=String.fromCharCode(n):224>n?r+=String.fromCharCode((31&n)<<6|63&t[i++]):240>n?r+=String.fromCharCode((15&n)<<12|(63&t[i++])<<6|63&t[i++]):(n=((15&n)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,r+=String.fromCharCode(55296|n>>10,56320|1023&n))}return r}var Us=class{constructor(t,e){var r,i,n,s;void 0===e&&(e={}),this._rrweb=t,this.it=e,this.nt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{var t=Date.now(),e=t-this.ot;e>0?(this.ht=Math.min(this.ct,this.ht+e/1e3*this.dt),this.ot=t):this.ot=t},this.vt=t=>{if(!this.nt[t]){var e,r;this.nt[t]=!0;var i=this.ft(t);null==(e=(r=this.it).onBlockedNode)||e.call(r,t,i)}},this.yt=t=>{var e=this.ft(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.ft=t=>this._rrweb.mirror.getNode(t),this.bt=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.bt(e);if(e.attributes){var i,n,s=e.attributes.length;e.attributes=e.attributes.filter(t=>{var e=this.yt(t.id)[0];return!this.wt.consumeRateLimit(e)&&t});var a=s-e.attributes.length;a>0&&(null==(i=(n=this.it).onDroppedAttributeMutations)||i.call(n,a))}var o=this.bt(e);if(0!==o||r===o){if(this.kt)return t;this.ut();var u,l,h=os(t);return h>this.ht?(null==(u=(l=this.it).onDroppedOversizedMutation)||u.call(l,h),void this._t()):(this.ht-=h,t)}},this._t=()=>{if(!this.St){var t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null==(t=(e=this.it).requestFullSnapshot)||t.call(e)},t)}},this.wt=new ei({bucketSize:null!==(r=this.it.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.it.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.vt,A:di}),this.ct=null!==(n=this.it.bytesBucketSize)&&void 0!==n?n:0,this.dt=null!==(s=this.it.bytesRefillRate)&&void 0!==s?s:25600,this.kt=!Number.isFinite(this.ct)||0>=this.ct,this.ht=this.ct;var a=this.it.resyncIntervalMs;this.xt=Xr(a)&&Number.isFinite(a)&&a>0?a:3e5}reset(){this.nt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ht=this.ct,this.ot=Date.now(),this.st=-1/0}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Xr(t)&&isFinite(t)&&Math.floor(t)===t}),Nr&&!Vr(Nr.crypto)&&crypto;var Hs=null,qs={Et(){if(!Jr(Hs))return Hs;if(Hs=!0,Vr(Nr))Hs=!1;else try{var t="__support__";qs.Ot(t,"xyz"),'"xyz"'!==qs.Lt(t)&&(Hs=!1),qs.Dt(t)}catch(t){Hs=!1}return Hs},Pt(t){di.error("sessionStorage error: ",t)},Lt(t){try{return null==Nr?void 0:Nr.sessionStorage.getItem(t)}catch(t){qs.Pt(t)}return null},Nt(t){try{return JSON.parse(qs.Lt(t))||null}catch(t){}return null},Ot(t,e){try{return null==Nr||Nr.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){qs.Pt(t)}return!1},Dt(t){try{null==Nr||Nr.sessionStorage.removeItem(t)}catch(t){qs.Pt(t)}}};li.DEBUG=!1,li.LIB_VERSION="1.428.7",li.LIB_NAME="web";var Gs=li,Vs=class{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.Ft=t.get_property.bind(t),this.qt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.qt(Mn,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,r=this.Ft(Mn);return Gr(e=r)&&Zr(e.sessionId)&&Xr(e.size)&&r.sessionId===t?r.size:0}};function Zs(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<ti(100*e,0,100,di)}var Js=(t,e)=>{if(!(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}},Qs=t=>t.toLowerCase(),Xs={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=>Js(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Js(e,t))),icontains:(t,e)=>e.map(Qs).some(e=>t.map(Qs).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Qs).every(e=>t.map(Qs).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))})},Ks=new Set(["is_not","not_icontains","not_regex"]);function Ys(t,e,r){return!t||0===t.length||t.every(t=>{var i,n=null==(i="person"===t.type?r:e)?void 0:i[t.key],s=t.operator||"exact";if(Vr(n)||Jr(n))return Ks.has(s);var a=Xs[s];return!!a&&!Vr(t.value)&&!Jr(t.value)&&a(Hr(t.value)?t.value.map(String):[String(t.value)],Hr(n)?n.map(String):[String(n)])})}var ta=ci("[SessionRecording]");function ea(t,e){return e?t:"!"+t}function ra(t,e){return t===e||t!=="!"+e&&null}var ia=class{constructor(t,e,r,i,n,s,a){this._instance=t,this.Y=e,this.tt=r,this.et=i,this.jt=n,this.Bt=s,this.Ht=a,this.$t=null,this.zt=ns}onRemoteConfig(t){this.$t=Xr(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ut=new Jn([this.tt,this.Y]),this.zt=is):(this.Ut=new Qn([this.tt,this.Y]),this.zt=ns),this._instance.register_for_session({[Tn]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.jt("linked_flag_matched",{flag:t,variant:e}),this.Ht()})}getStatus(t){return this.zt({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,r=null==(e=this._instance.get_property("$session_recording_remote_config"))?void 0:e.minimumDurationMilliseconds;return Xr(r)?r:null}checkUrlTriggers(t,e,r,i){this.Y.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.tt.K.length&&Qr(this.Wt))return this.Wt=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,r,e)}catch(t){ta.error("Could not activate event trigger",t)}}),this.Wt}makeSamplingDecisions(t){var e,r,i,n=this.$t;if(!Xr(n))return null==(r=this._instance.persistence)||r.unregister(gn),void(null==(i=this._instance.persistence)||i.unregister(dn));var s=this._instance.get_property(gn),a=this._instance.get_property(dn),o=ra(s,t),u=Xr(a)&&a!==n,l=Vr(a)&&s===t,h=u||l||!Kr(o),d=h?Zs(t,n):o;h&&(d?this.jt("sampled"):ta.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[gn]:ea(t,d),[dn]:Jr(a)&&s===t?null:n})}ensureSamplingDecision(t){Xr(this.$t)&&(Kr(ra(this._instance.get_property(gn),t))||this.makeSamplingDecisions(t))}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i,n;null==(t=this._instance.persistence)||t.unregister(bn),null==(e=this._instance.persistence)||e.unregister(yn),null==(r=this._instance.persistence)||r.unregister(gn),null==(i=this._instance.persistence)||i.unregister(dn),null==(n=this._instance.persistence)||n.unregister(mn)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Ut)?void 0:e.triggerStatus(t))===Un}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===Un).map(t=>t.label)}stop(){var t;null==(t=this.Wt)||t.call(this),this.Wt=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},na=class{constructor(t,e,r,i,n){this._instance=t,this.Y=e,this.jt=r,this.Vt=i,this.Ht=n,this.Zt=[],this.Gt=new Map,this.Qt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Jt(t.triggerGroups),this._instance.register_for_session({[Tn]:"v2_trigger_groups",[En]:t.triggerGroups.length}),this.Y.onConfig(t)):ta.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Wn;if(!t.receivedFlags)return $n;if(!t.isRecordingEnabled)return Ln;if(t.urlTriggerMatching.urlBlocked)return jn;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return Ln;var i=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if("trigger_activated"===a){var o=s.group.id,u=r.get(o);Vr(u)?di.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===u&&(n=!0)}else"trigger_pending"===a&&(i=!0)}return n?Pn:i?$n:Ln}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Zt,triggerGroupSamplingResults:this.Gt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.Zt)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;Xr(i)&&(Jr(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.Y.checkUrlBlocklist(e,r);var s=function(i){i.checkUrlTriggerConditions(e,r,e=>{n.Kt(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t),n.Ht(e))},t)};for(var a of this.Zt)s(a)}setupEventTriggerListeners(t,e,r){var i=this;return this.Wt=t(t=>{var r;if(this.Qt)return ta.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.Wt)||r.call(this),void(this.Wt=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,n=>{if(i.Kt(r,t.properties)){var s=(r.group.conditions.events||[]).filter(e=>e.name===t.event),a=i._instance.get_property(Cn);s.some(e=>!e.properties||0===e.properties.length||Ys(e.properties,t.properties,a))&&(r.activateTrigger(n,e),i.updateActiveTriggers(e),i.Ht(n))}},e)};for(var s of this.Zt)n(s)}catch(t){ta.error("Could not activate event trigger for trigger groups",t)}}),this.Wt}makeSamplingDecisions(t){for(var e of this.Zt){var r,i=e.group,n=i.id,s=i.sampleRate,a=kn+n,o=this._instance.get_property(a),u=null,l=!1,h=!1,d=!1;if(Gr(o)){var c=o.sessionId,v=o.sampleRate,f=o.sampled;l="string"==typeof c&&c!==t,h=Xr(v)&&v!==s,u=c===t&&Xr(v)&&v===s&&Kr(f)?f:null}else u=o===t||null,l="string"==typeof o&&o!==t,d=o===t;var p=l||h||d||!Kr(u),g=p?Zs(t+n,s):u;p&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:s,isSampled:g}),this.Gt.set(n,g),null==(r=this._instance.persistence)||r.register({[a]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Qt=!0}clearConditionalRecordingPersistence(){var t,e,r;for(var i of(null==(t=this._instance.persistence)||t.unregister(gn),null==(e=this._instance.persistence)||e.unregister(dn),null==(r=this._instance.persistence)||r.unregister(mn),this.Zt)){var n,s,a,o=i.group.id;null==(n=this._instance.persistence)||n.unregister(wn+o),null==(s=this._instance.persistence)||s.unregister(_n+o),null==(a=this._instance.persistence)||a.unregister(kn+o)}}updateActiveTriggers(t){var e=[];for(var r of this.Zt){var i=r.group,n=i.id,s="trigger_activated"===r.triggerStatus(t),a=!0===this.Gt.get(n);s&&e.push({id:n,name:i.name,matched:!0,sampled:a})}this._instance.register_for_session({[An]:e})}hasPendingTriggers(t){for(var e of this.Zt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Zt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>'trigger group "'+e.group.name+'": '+t))}stop(){var t;null==(t=this.Wt)||t.call(this),this.Wt=void 0,this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear(),this.Y.stop()}Kt(t,e){var r=t.group.conditions.properties;return!r||0===r.length||Ys(r,e,this._instance.get_property(Cn))}Jt(t){var e=this;this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear();var r=function(t){var r=new rs(e._instance,t,(r,i)=>{e.jt("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name}),e.Ht()});e.Zt.push(r)};for(var i of t)r(i)}},sa=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],aa=1e5,oa=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,ua=[],la=()=>!1,ha="@type @id actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),da="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),ca="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),va="Accommodation AdministrativeArea Country Place State".split(" "),fa={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:da,publisher:ca},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:ua},Offer:{seller:ca},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:ca,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:ca,areaServed:va,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:ua}},pa=[["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),fa.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),fa.Event],[ca,fa.Organization],[va,fa.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),fa.Product]];function ga(t,e){return zr.call(t,e)?t[e]:void 0}function ma(t){var e=typeof t;return Jr(t)||"string"===e||"number"===e||"boolean"===e}function ya(t){return ma(t)||Hr(t)&&t.every(ma)?t:void 0}function ba(t,e){if("string"==typeof t){var r=t.trim(),i=r.indexOf("#"),n=0>i?r:r.slice(i+1);if(!(!n||0>i&&(/^[a-z][a-z\d+.-]*:/i.test(r)||r.includes("/")||r.includes("?"))))try{return e(n)?n:void 0}catch(t){return}}}function wa(t){if(zr.call(fa,t))return fa[t];for(var e of pa){var r=e[1];if(e[0].includes(t))return r}}function _a(t,e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0})}function ka(t,e,r,i){if(Hr(t)){var n=t.map(t=>ka(t,e,r,i)).filter(t=>!Vr(t));return n.length?n:void 0}return Sa(t,e,r,i)||void 0}function Sa(t,e,r,i){if(!Gr(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(r))return null;var n=ga(t,"@type"),s=function(t){var e=new Set,r="string"==typeof t?[t]:Hr(t)?t:[],i=[];for(var n of r)if("string"==typeof n){var s=n.replace(/^https?:\/\/schema\.org\//,"");if(100>=s.length&&oa.test(s)&&!e.has(s)&&(e.add(s),i.push(s),20===i.length))break}return i}(n),a=s.filter(t=>!!wa(t)&&(!i||!i.length||i.includes(t))),o={};for(var u of ha){var l="@type"===u?s.length?"string"==typeof n?s[0]:s:void 0:"@id"===u?ba(ga(t,u),e):ya(ga(t,u));Vr(l)||_a(o,u,l)}for(var h of a){var d=wa(h);for(var c of Object.keys(d)){var v=ga(t,c),f=d[c];if(!0===f){var p=ya(v);Vr(p)||_a(o,c,p)}else{var g=ka(v,e,r,f);Vr(g)||_a(o,c,g)}}}var m=ka(ga(t,"@graph"),e,r);return Vr(m)||_a(o,"@graph",m),Object.keys(o).length?o:null}function Ma(t,e,r){if(!Gr(t))return null;var n=ga(t,"@context");if("string"!=typeof n||!/^https?:\/\/schema\.org\/?$/.test(n))return null;var s=Sa(t,e,r);return s?i({"@context":"https://schema.org"},s):null}function Ca(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function Ia(t,e,r){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some(t=>(e.lastIndex=0,e.test(t))))return!0;try{return!!r&&t.matches(r)}catch(t){return!1}}function Ra(t,e,r){for(var i=t;i;){if(Ia(i,e,r))return!0;var n=i.parentNode;i=i.parentElement||(n&&n.nodeType===n.DOCUMENT_FRAGMENT_NODE?n.host:null)}return!1}function Aa(t){return Ca(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Ca)}function xa(t){return Vr(t)?void 0:Math.round(t)}function Ta(t){return Gr(t)?t.network_timing:t}var Ea,Oa,Fa=ci("[SessionRecording]"),Da=[1,2,3,4,5,6,7,12],Na=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function La(){var t;return null==jr||null==(t=jr.__PosthogExtensions__)?void 0:t.rrweb}function Pa(){var t;return null==(t=La())?void 0:t.record}function Ba(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,ss())}}function $a(t){return zs(Ws(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new ls(t.length+(t.length>>>1)),i=0,n=function(t){r[i++]=t},s=0;e>s;++s){if(i+5>r.length){var a=new ls(i+8+(e-s<<1));a.set(r),r=a}var o=t.charCodeAt(s);128>o?n(o):2048>o?(n(192|o>>>6),n(128|63&o)):o>55295&&57344>o?(n(240|(o=65536+(1047552&o)|1023&t.charCodeAt(++s))>>>18),n(128|o>>>12&63),n(128|o>>>6&63),n(128|63&o)):(n(224|o>>>12),n(128|o>>>6&63),n(128|63&o))}return As(r,0,i)}(Ba(t))),!0)}function ja(t){return Wa.apply(this,arguments)}function Wa(){return Wa=r(function*(t){var e=yield function(t,e,r){return oi.apply(this,arguments)}(Ba(t),Gs.DEBUG,{rethrow:!0});return zs(new Uint8Array(yield e.arrayBuffer()),!0)}),Wa.apply(this,arguments)}var za="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Ua=!1;function Ha(t){return Hr(t)&&0===t.length?Ea=null!=Ea?Ea:$a([]):$a(t)}function qa(t){return Ga.apply(this,arguments)}function Ga(){return(Ga=r(function*(t){return Hr(t)&&0===t.length?Ea||(Oa=null!=Oa?Oa:ja([]).then(t=>(Ea=t,t)).catch(t=>{throw Ea=void 0,Oa=void 0,t})):ja(t)})).apply(this,arguments)}function Va(t){return za&&!Ua&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function Za(t){return{event:t,size:os(t)}}function Ja(t,e){return i({},t,{data:e,cv:"2024-10"})}function Qa(t,e){return i({},t,{cv:"2024-10",data:i({},t.data,e)})}function Xa(t){try{if(2===t.type)return Za(Ja(t,$a(t.data)));if(3===t.type&&0===t.data.source)return Za(Qa(t,{texts:Ha(t.data.texts),attributes:Ha(t.data.attributes),removes:Ha(t.data.removes),adds:Ha(t.data.adds)}));if(3===t.type&&8===t.data.source)return Za(Qa(t,{adds:t.data.adds?$a(t.data.adds):void 0,removes:t.data.removes?$a(t.data.removes):void 0}))}catch(t){Fa.error("could not compress event - will use uncompressed event",t)}return{event:t,size:as(t)}}function Ka(){return(Ka=r(function*(t){try{if(2===t.type)return Za(Ja(t,yield ja(t.data)));if(3===t.type&&0===t.data.source){var e=yield Promise.all([qa(t.data.texts),qa(t.data.attributes),qa(t.data.removes),qa(t.data.adds)]);return Za(Qa(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(3===t.type&&8===t.data.source){var r=yield Promise.all([t.data.adds?ja(t.data.adds):void 0,t.data.removes?ja(t.data.removes):void 0]);return Za(Qa(t,{adds:r[0],removes:r[1]}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===ni})(e)&&(Ua=!0),Fa.error("could not compress event asynchronously - trying synchronous compression",e),Xa(t)}return{event:t,size:as(t)}})).apply(this,arguments)}function Ya(t,e){return 5===t.type&&t.data.tag===e}function to(t){return Ya(t,"sessionIdle")}function eo(t){return Ya(t,"$session_ending")}function ro(t){return Ya(t,"$session_starting")}var io=class{get sessionId(){return this.Xt}get Yt(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get te(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ee(){return ra(this._instance.get_property(gn),this.sessionId)}get $t(){var t,e=null==(t=this.re)?void 0:t.sampleRate;return Xr(e)?e:null}get ie(){var t,e;return null!==(t=null==(e=this.ne)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.oe="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.ae=void 0,this.se=!1,this.ue=Date.now(),this.le=!1,this.he=[],this.ce="unknown",this.de=0,this.ve=0,this.fe=0,this.pe=0,this.ge=!1,this.me=!1,this.ye=!1,this.be=!1,this.we=!1,this.ke=!1,this._e=!1,this.Se=!1,this.xe=!1,this.Ce=!1,this.Me=!1,this.Te=!1,this.Ie=[],this.Re=void 0,this.Ae=void 0,this.Ee=!1,this.Oe=[],this.Le=0,this.De=0,this.Pe=!1,this.Ne=void 0,this.Wt=void 0,this.Fe=void 0,this.qe=void 0,this.je=void 0,this.Be=(t,e,r)=>{var i,n,s,a;if(r&&(t!==this.Xt||e!==this.He)){var o=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this.Xt,l=this.He;if(o&&this.Vt("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.ue,flushed_size:null==(i=this.$e)?void 0:i.currentTrackedSize(u)}),null==(n=this._instance.persistence)||n.unregister(Sn),this._e=!1,null==(s=La())||null==s.resetMaxDepthState||s.resetMaxDepthState(),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.ze(),!(!1===this.ce&&this.isStarted||this.Xt===t&&this.He===e)){var h=this.Xt!==t&&!1!==this.ce;this.ce="unknown",this.Ue(h)}o&&this.Vt("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.ue}),null==(a=this.ne)||a.makeSamplingDecisions(t)}},this.We=!1,this.Ve=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[mn])===this.Xt},this.Ze=()=>{var t,e;if(0===this.Rt.data.length)return null;var r=null==(t=this.Rt.data[0])?void 0:t.timestamp,i=null==(e=this.Rt.data[this.Rt.data.length-1])?void 0:e.timestamp;return Xr(r)&&Xr(i)?i-r:null},this.Ge=()=>{var t,e,r=this.ie;if(!Xr(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.Qe;return Xr(i)&&i>=0&&r>i}if(this.Ve())return!1;var n,s=this.Ze();return!!Jr(s)||r>s||(null==(n=this._instance.persistence)||n.register({[mn]:this.Xt}),!1)},this.Je=()=>{"buffering"!==this.status?(this.ge&&this.me&&this.Ke&&!this.ye&&this.Xe(void 0),this.Ye(),this.tr(!0)):this.er()},this.rr=()=>{this.Je()},this.ir=()=>{this.Vt("browser offline",{})},this.nr=()=>{this.Vt("browser online",{})},this.ar=()=>{null!=Pr&&Pr.visibilityState&&("visible"===Pr.visibilityState&&(this.Ke=!0),this.Vt("window "+Pr.visibilityState,{}))},this.Ke=null==e||e;var r=this.Yt.checkAndGetSessionAndWindowId(),i=r.windowId,n=r.sessionStartTimestamp;this.Xt=r.sessionId,this.He=i,this._sessionStartTimestamp=n,this.et=new ts(this._instance),this.Y=new Yn(this._instance),this.tt=new es(this._instance),this.Rt=this.er(),this.sr="ph_"+(this._instance.config.persistence_name||this._instance.config.token)+"_replay_pending_buffer",this.Yt.sessionTimeoutMs>this.te||Fa.warn("session_idle_threshold_ms ("+this.te+") is greater than the session timeout ("+this.Yt.sessionTimeoutMs+"). Session will never be detected as idle"),this.$e=new Vs(this._instance)}setDocumentWasEverVisible(t){t&&(this.Ke=!0)}get ur(){var t,e,r,i,n,s,a,o,u,l=null==(t=this.re)?void 0:t.masking,h={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,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},d=null!==(s=null==h?void 0:h.maskAllInputs)&&void 0!==s?s:null==l?void 0:l.maskAllInputs,c=null!==(a=null==h?void 0:h.maskTextSelector)&&void 0!==a?a:null==l?void 0:l.maskTextSelector,v=null!==(o=null==h?void 0:h.blockSelector)&&void 0!==o?o:null==l?void 0:l.blockSelector,f=null!==(u=null==h?void 0:h.maskAllElementAttributes)&&void 0!==u?u:null==l?void 0:l.maskAllElementAttributes;return Vr(d)&&Vr(c)&&Vr(v)&&Vr(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:c,blockSelector:v,maskAllElementAttributes:f}}lr(){var t;if(!this.xe){var e=null==(t=this.re)?void 0:t.masking;if(!Qr(e)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter(t=>{var i=null==r?void 0:r[t],n=e[t];return!Vr(i)&&i!==n});0!==i.length&&(this.xe=!0,Fa.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==r?void 0:r.maskAllInputs,maskTextSelector:null==r?void 0:r.maskTextSelector,blockSelector:null==r?void 0:r.blockSelector,maskAllElementAttributes:null==r?void 0:r.maskAllElementAttributes},project:e}))}}}get hr(){var t;return ti(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,ci("canvas recording resolution scale"),1)}get cr(){var t,e,r,i,n,s,a,o=this._instance.config.session_recording.captureCanvas,u=null==(t=this.re)?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:ti(h,0,12,ci("canvas recording fps"),4),quality:ti(d,0,1,ci("canvas recording quality"),.4)}}get dr(){var t,e,r=!(null==(t=this.re)||!t.consoleLogRecordingEnabled);return null!==(e=this._instance.config.enable_recording_console_log)&&void 0!==e?e:r}get vr(){var t,e,r,i=null==(t=this.re)?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=Ta(this._instance.config.capture_performance),u=Ta(null==i?void 0:i.capturePerformance),l=!!(Kr(o)?o:u);return s||a||l?{recordHeaders:s,recordBody:a,recordPerformance:l}:void 0}pr(){var t,e,r=[],n=null==(t=jr.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.dr&&r.push(n());var s=null==(e=jr.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.vr&&qr(s))if(!pi.includes(Br.hostname)||this._forceAllowLocalhostNetworkCapture){var a=qr(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;r.push(s(((t,e,r)=>{var n,s={payloadSizeLimitBytes:Ei.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ei.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Ei.payloadHostDenyList]},a=!1!==t.session_recording.recordHeaders&&e.recordHeaders,o=!1!==t.session_recording.recordBody&&e.recordBody,u=!1!==t.capture_performance&&e.recordPerformance,l=(n=Ti(s),t=>(null!=t&&t.requestBody&&(t.requestBody=Pi(t.requestBody,t.requestHeaders,n,"Request")),null!=t&&t.responseBody&&(t.responseBody=Pi(t.responseBody,t.responseHeaders,n,"Response")),t)),h=e=>{return l(((t,e,r)=>{var i;if(null==r||!r(t.name)){var n=gi(t.name),s=0===e.indexOf("http")?null==(i=gi(e))?void 0:i.pathname:e;"/"===s&&(s="");var a=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&a&&Li.some(t=>0===a.indexOf(t))))return t}})((Ni((i=e).requestHeaders),Ni(i.responseHeaders),i),t.api_host,r));var i},d=qr(t.session_recording.maskNetworkRequestFn);return d&&qr(t.session_recording.maskCapturedNetworkRequestFn)&&di.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var r=t.session_recording.maskNetworkRequestFn({url:e.name});return!r&&e.isInitial?r:i({},e,{name:null==r?void 0:r.url})}),s.maskRequestFn=qr(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r=h(e);if(r){var i=r.isInitial?{name:"",entryType:r.entryType,startTime:r.startTime,duration:r.duration,endTime:r.endTime,timeOrigin:r.timeOrigin,timestamp:r.timestamp,isInitial:!0}:void 0,n=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(r);return Qr(n)&&i?($i.add(i),i):null!=n?n:void 0}}:t=>function(t){if(!Vr(t))return t.requestBody=Bi(t.requestBody,"Request"),t.responseBody=Bi(t.responseBody,"Response"),t}(h(t)),i({},Ei,s,{recordHeaders:a,recordBody:o,recordPerformance:u,recordInitialRequests:u,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.vr,a)))}else Fa.info("NetworkCapture not started because we are on localhost.");return r}gr(t){return this._instance.config.disable_capture_url_hashes?ri(t):t}mr(t,e){void 0===e&&(e=!1);var r=e?ri(t):this.gr(t),i=this._instance.config.mask_personal_data_properties?[...sa,...this._instance.config.custom_personal_data_properties||[]]:[];return this.yr(function(t,e){if(!t||!e||!e.length)return t;for(var r=t.split("#"),i=r[1],n=(r[0]||"").split("?"),s=n[1],a=n[0],o=(s||"").split("&"),u=[],l=0;o.length>l;l++){var h=o[l].split("=");Hr(h)&&(e.includes(h[0])?u.push(h[0]+"=<masked>"):u.push(o[l]))}var d=a;return null!=s&&(d+="?"+u.join("&")),null!=i&&(d+="#"+i),d}(r,i))}yr(t){var e,r=this._instance.config.session_recording;if(r.maskCapturedNetworkRequestFn){var i,n=r.maskCapturedNetworkRequestFn({name:t});return null!==(i=null==n?void 0:n.name)&&void 0!==i?i:null==n?void 0:n.url}return r.maskNetworkRequestFn?null==(e=r.maskNetworkRequestFn({url:t}))?void 0:e.url:t}br(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.he.length?this.he.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Fa.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.br(Na(()=>Pa().addCustomEvent(t,e)))}wr(){var t;return this.se&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.ce}kr(t){if(!this.wr())return!1;try{var e=Pa();return!!e&&(e.addCustomEvent("$json_ld",t),this.wr())}catch(t){return!1}}_r(t){void 0===t&&(t=!1),Promise.resolve().then(()=>{var e;return null==(e=this.Sr)?void 0:e.scan(t)})}Cr(){try{if(this._instance.config.capture_pageview||!Nr)return;var t=new URL(Nr.location.href),e=this.mr(t.origin+t.pathname+t.search);this.Mr!==e&&(this.Mr=e,this.Vt("$url_changed",{href:e}))}catch(t){}}Tr(){if(this.he.length){var t=[...this.he];this.he=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.br(t)})}}Bt(){return this.br(Na(()=>Pa().takeFullSnapshot()))}get Ir(){var t,e,r;if(null!=(t=this.ne)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var i,n=null==(i=this._instance.config.session_recording)?void 0:i.trigger_pending_buffer_interval_millis;return Xr(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Rr(){if(this.Ar&&clearInterval(this.Ar),!0!==this.ce){var t=this.Ir;t&&(this.Ar=setInterval(()=>{this.Bt()},t))}}Ht(t){"event"===t&&this.Er(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Rr()}Or(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null==(t=this.Sr)||t.scan(),clearInterval(this.Ar),Fa.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}Lr(){var t;this.Y.urlBlocked&&(null==(t=this.Sr)||t.scan(),this.Y.urlBlocked=!1,this.Bt(),this._r(),this.Rr(),this.Vt("recording resumed",{reason:"left blocked url"}),Fa.info("recording resumed"))}Dr(t,e){var r;if("event"===t&&this.Er(),!this.le&&null!=(r=this.ne)&&r.hasPendingTriggers(this.sessionId)){this.le=!0;try{var i,n,s="url"===t?yn:bn;null==(i=this._instance.persistence)||i.register({[s]:this.sessionId}),null==(n=this.ne)||n.updateActiveTriggers(this.sessionId),this.Ht(),this.tr(),this.jt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.le=!1}}}get isStarted(){return!!this.ae}get re(){var t=this._instance.get_property(hn);if(t){var e;try{e=Gr(t)?t:JSON.parse(t)}catch(t){return void Fa.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.We){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return Fa.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(hn))}return e}}Pr(t,e,r){this._instance.get_property(t)&&(e(),r())}start(t){var e,r,i=this.re;if(i){if(!this.isStarted){var n=!1!==this.ce&&!this.be;this.Xe(n?"no_interaction_since_recording_started":void 0),this.be=!1,this.me=n,this.ye=!1}this.Pe&&(this.Nr(),this.er());var s=this.Yt.checkAndGetSessionAndWindowId(),a=s.windowId,o=s.sessionStartTimestamp;this.Xt=s.sessionId,this.He=a,this._sessionStartTimestamp=o,this.Fr(),null==(e=this._instance.persistence)||e.unregister(Sn),null!=i&&i.endpoint&&(this.oe=null==i?void 0:i.endpoint),this.ne=2===(null==i?void 0:i.version)&&null!=i&&i.triggerGroups&&i.triggerGroups.length>0?new na(this._instance,this.Y,this.jt.bind(this),this.Vt.bind(this),this.Ht.bind(this)):new ia(this._instance,this.Y,this.tt,this.et,this.jt.bind(this),this.Bt.bind(this),this.Ht.bind(this)),this.ne.onRemoteConfig(i),null==(r=this.Wt)||r.call(this),this.Wt=this.ne.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.Dr(t,e)),this.Pr(cn,()=>{this.overrideSampling()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(cn)}),this.Pr(vn,()=>{this.overrideLinkedFlag()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(vn)}),this.Pr(pn,()=>{this.overrideTrigger("event")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(pn)}),this.Pr(fn,()=>{this.overrideTrigger("url")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(fn)}),this.ne.makeSamplingDecisions(this.sessionId),this.qr(),this.we||(fi(Nr,"beforeunload",this.Je),fi(Nr,"pagehide",this.rr),fi(Nr,"offline",this.ir),fi(Nr,"online",this.nr),fi(Pr,"visibilitychange",this.ar),!this.Fe&&qr(this.Yt.onSessionId)&&(this.Fe=this.Yt.onSessionId(this.Be)),!this.qe&&qr(this.Yt.on)?this.qe=this.Yt.on("forcedIdleReset",()=>{this.ze(),this.ce="unknown",this.stop(),this.je=this.Yt.onSessionId((t,e,r)=>{var i;null==(i=this.je)||i.call(this),this.je=void 0,this.Be(t,e,r)})}):qr(this.Yt.on)||Fa.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Qr(this.Ne)&&(this.Ne=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.mr(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){Fa.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.jt(t||"recording_initialized"))}else Fa.info("remote config must be stored in persistence before recording can start")}jr(){var t,e,r,i,n,s;null==Nr||Nr.removeEventListener("beforeunload",this.Je),null==Nr||Nr.removeEventListener("pagehide",this.rr),null==Nr||Nr.removeEventListener("offline",this.ir),null==Nr||Nr.removeEventListener("online",this.nr),null==Pr||Pr.removeEventListener("visibilitychange",this.ar),clearInterval(this.Ar),this.Br(),null==(t=this.Ne)||t.call(this),this.Ne=void 0,null==(e=this.Wt)||e.call(this),this.Wt=void 0,null==(r=this.Fe)||r.call(this),this.Fe=void 0,null==(i=this.qe)||i.call(this),this.qe=void 0,null==(n=this.je)||n.call(this),this.je=void 0,null==(s=this.ne)||s.stop(),this.Hr(),this.Nr()}Nr(){this.De+=1,this.Oe=[],this.Le=0,this.$r=void 0,this.Pe=!1}Hr(){var t,e;null==(t=this.zr)||t.stop(),this.he=[],null==(e=this.Sr)||e.stop(),this.Sr=void 0,this.se=!1;try{var r;null==(r=this.ae)||r.call(this)}catch(t){Fa.warn("could not stop rrweb",t)}this.ae=void 0}Ur(){if(!this.$r||0===this.Le)return!1;if(this.Pe)return!0;this.Pe=!0,this.Wr=void 0;var t=this.De;return this.Br(),this.Hr(),this.$r.catch(()=>{}).then(()=>{t===this.De&&(this.Pe=!1,this.tr(),this.er(),this.Vr(),this.jr(),Fa.info("stopped"))}).catch(()=>{this.Pe=!1,this.Vr(),this.jr(),Fa.info("stopped")}),!0}stop(){if(this.Hr(),this.We)this.Ye();else if(this.Ur())return;this.tr(),this.er(),this.Vr(),this.jr(),Fa.info("stopped")}Vr(){this.Xe(void 0,{preserveLogDedup:this.We}),this.me=!1}flushBeforeIdentityReset(){(this.isStarted||this.Pe)&&(this.Ye(),this.tr())}Ue(t){this.We=!0,this.ue=Date.now();try{var e;this.stop(),this.Zr=void 0,this.Gr=void 0,this.ve=0,this.fe=0,this.pe=0,null==(e=La())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.We=!1}this.Xe(t?"no_interaction_since_session_rotated":void 0),this.me=!1}Xe(t,e){var r=(void 0===e?{}:e).preserveLogDedup,i=void 0!==r&&r;if(this.ge=!Vr(t),this.Wr=t,Vr(t))i||(this.Qr=void 0);else if(!this.We){var n=this.sessionId+":"+t;n!==this.Qr&&(this.Qr=n,Fa.info("holding buffer: "+t+". nothing is uploaded until the user interacts with the page"))}}Er(){this.isStarted||(this.be=!0),this.ge&&(this.Xe(void 0),this.me=!1,this.ye&&(this.ye=!1,this.Bt()),this.Jr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents,r=void 0!==e&&e;this.ge=!0,r&&(this.er(),this.Hr()),this.er(),this.jr(),this.er(),this.Vr(),Fa.info("discarded")}Kr(t,e,r,i,n){var s={$snapshot_bytes:r,$snapshot_data:e,$session_id:i,$window_id:n};"disabled"!==this.status?(this.Xr(t,i),this.Yr(s)):this.er()}ti(){try{this.ei()}catch(t){this.Se||(this.Se=!0,Fa.error("could not track full snapshot cost",t))}}ei(){var t,e=null==(t=La())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Gr&&(this.Gr=e,this.Zr&&this.Zr.durationMs>=e.durationMs||(this.Zr=e),500>e.durationMs||Fa.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}Xr(t,e){2!==t.type?3===t.type&&(Vr(this.Re)||this.Re===e||this.Ae===e||(this.Ae=e,Fa.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Bt())):this.Re=e}ri(t){t.counted&&t.generation===this.De&&(this.Le=Math.max(0,this.Le-1)),t.counted=!1,this.Oe=this.Oe.filter(e=>e!==t)}ii(t,e,r){t.processed||t.generation!==this.De||(t.processed=!0,this.Kr(t.event,e,r,t.targetSessionId,t.targetWindowId))}ni(t){try{var e=t.event,r=as(t.event);if(t.compressionEnabled)try{var i=Xa(t.event);e=i.event,r=i.size}catch(t){Fa.error("could not process queued compression event - will use uncompressed event",t)}try{this.ii(t,e,r)}catch(t){Fa.error("could not capture queued compression event",t)}}finally{this.ri(t)}}Ye(){[...this.Oe].forEach(t=>{this.ni(t)})}oi(t,e,i,n){var s=this,a={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:n,generation:this.De,processed:!1,counted:!0};this.Oe.push(a),this.Le+=1;var o=function(){var i=r(function*(){try{if(a.processed)return;var r,i;try{var n=e?Va(t)?yield function(t){return Ka.apply(this,arguments)}(t):Xa(t):{event:t,size:as(t)};r=n.event,i=n.size}catch(e){Fa.error("could not process queued compression event - will use uncompressed event",e),r=t,i=as(t)}s.ii(a,r,i)}finally{s.ri(a)}});return function(){return i.apply(this,arguments)}}();this.$r=this.$r?this.$r.catch(()=>{}).then(o):o()}onRRwebEmit(t){var e,r,i,n,s,a,o,u,l;if(this._instance.sessionManager&&(this.Tr(),t&&Gr(t))){if(4===t.type){var h=this.mr(t.data.href);if(this.Mr=h,!h)return;t.data.href=h}else this.Cr();if(null==(e=this.ne)||e.checkUrlTriggers(this.sessionId,()=>this.Or(),()=>this.Lr(),(t,e)=>this.Dr(t,e)),!this.Y.urlBlocked||5===(d=t).type&&"recording paused"===d.data.tag){var d,c,v,f;2===t.type&&(null!=(c=La())&&null!=c.wasMaxDepthReached&&c.wasMaxDepthReached()&&(this._e=!0),this.ti(),Promise.resolve().then(()=>this.ti()),this.Rr(),null==(v=this.zr)||v.reset(),null==(f=this._instance.persistence)||f.register_once({[Sn]:t.timestamp},void 0));var p=2===t.type&&(null==(r=this.ne)?void 0:r.hasPendingTriggers(this.sessionId));p&&this.ai();var g=this.zr?this.zr.throttleMutations(t):t;if(g){var m=function(t){var e=t;if(e&&Gr(e)&&6===e.type&&Gr(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}(g),y=function(t){return eo(t)?t.data.payload:null}(m),b=function(t){return ro(t)?t.data.payload:null}(m),w=function(t){return to(t)?t.data.payload:null}(m);y||b?null!=y&&y.lastActivityTimestamp&&(m.timestamp=y.lastActivityTimestamp):null!=w&&w.sessionId||this.si(m),2===t.type&&(this.Ie.push([this.Xt,t.timestamp]),this.Ie.length>6&&(this.Ie=this.Ie.slice(-6)));var _=null!==(i=null!==(n=null!==(s=null==y?void 0:y.currentSessionId)&&void 0!==s?s:null==b?void 0:b.nextSessionId)&&void 0!==n?n:null==w?void 0:w.sessionId)&&void 0!==i?i:this.Xt,k=null!==(a=null!==(o=null!==(u=null==y?void 0:y.currentWindowId)&&void 0!==u?u:null==b?void 0:b.nextWindowId)&&void 0!==o?o:null==w?void 0:w.windowId)&&void 0!==a?a:this.He;if(!0!==this.ce||function(t){return to(t)||eo(t)||ro(t)}(m)){2===m.type&&(this.de=0),w&&(m.timestamp=w.lastActivityTimestamp+w.threshold);var S=this.se;this.se=!0,p?this._r(!0):S||this._r();var M=null===(l=this._instance.config.session_recording.compress_events)||void 0===l||l;if(this.Le>0||M&&Va(m))this.oi(m,M,_,k);else{var C=M?Xa(m):{event:m,size:as(m)};this.Kr(m,C.event,C.size,_,k)}}else(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source})(m)&&this.de++}else!0===this.ce&&this.de++}}}get status(){return this.ne?this.ne.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ee,rrwebError:this.we,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.re}):Ln}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.et.linkedFlagSeen=!0,this.Bt(),this.Er(),this.jt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[gn]:this.sessionId,[dn]:null}),this.Bt(),this.Er(),this.jt("sampling_overridden")}overrideTrigger(t){this.Dr(t),this.Er()}ui(){try{var t,e=null==Nr||null==(t=Nr.location)?void 0:t.href;if(!e)return;var r=this.mr(e);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}Br(){this.li&&(clearTimeout(this.li),this.li=void 0)}Jr(){this.li||(this.li=setTimeout(()=>{this.tr()},2e3))}hi(){return this.Re!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!eo(t)&&!ro(t))}ci(){var t,e;return null!==(t=null==(e=this.ne)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}di(t){if("buffering"!==t)return Vr(this.fi)||this._instance.register_for_session({[xn]:[]}),void(this.fi=void 0);var e=this.ci();if(0===e.length)return Vr(this.fi)||this._instance.register_for_session({[xn]:[]}),void(this.fi=void 0);var r=e.join(", "),i=this.sessionId+":"+r;i!==this.fi&&(this.fi=i,this._instance.register_for_session({[xn]:e}),Fa.info("buffering: "+r))}pi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null==(t=this._instance.persistence)?void 0:t.gi)&&qs.Et()}mi(){0!==this.Rt.data.length&&this.Rt.size!==this.yi&&943718.4>=this.Rt.size&&this.pi()&&(this.yi=this.Rt.size,qs.Ot(this.sr,this.Rt))}Fr(){if(!this.Ee&&this.pi()){this.Ee=!0;var t=qs.Nt(this.sr);qs.Dt(this.sr),Gr(t)&&Hr(t.data)&&0!==t.data.length&&Hr(t.sizes)&&t.sizes.length===t.data.length&&Xr(t.size)&&t.sessionId===this.Xt&&t.windowId===this.He&&(this.Rt.data.length>0||(this.Rt=t))}}tr(t){var e;if(void 0===t&&(t=!1),this.Br(),this.ge)return this.Rt;if(this.hi())return this.Rt.size>943718.4?this.er():(t&&this.mi(),this.Rt);var r=this.Rt;null==(e=this.ne)||e.ensureSamplingDecision(this.sessionId);var i=this.Ge(),n=this.status;if(this.di(n),"buffering"===n||"paused"===n||"disabled"===n||i)return!t||"active"!==n&&"sampled"!==n||this.mi(),this.Jr(),this.Rt;if(this.Rt!==r)return this.Rt;if(r.data.length>0){var s,a=this.ui();us(r).forEach(t=>{try{var e;null==(e=this.$e)||e.trackSize(t.sessionId,t.size),this.bi({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:Gs.LIB_NAME,$lib_version:Gs.LIB_VERSION,$snapshot_host:a})}catch(t){Fa.warn("could not capture snapshot chunk - skipping it",t)}}),Vr(this.yi)||(qs.Dt(this.sr),this.yi=void 0),null==(s=this.ne)||s.onFlushComplete()}return this.er()}Yr(t){var e,r=2+((null==(e=this.Rt)?void 0:e.data.length)||0),i=t.$session_id,n=this.Rt.sessionId!==i;if(n||!0!==this.ce&&!this.ge&&this.Rt.size+t.$snapshot_bytes+r>943718.4){var s=this.Xt;if(this.Rt=this.tr(),this.Xt!==s)return;n&&this.Rt.data.length>0&&(this.Rt=this.er()),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id}this.ge&&(this.ye||this.Rt.size+t.$snapshot_bytes+r>943718.4)?this.ye||(this.ye=!0,this.Rt=this.er()):(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.ce||this.ge||this.Jr())}bi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.oe),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Qe(){var t,e,r=null==(t=this.Rt)?void 0:t.data[(null==(e=this.Rt)?void 0:e.data.length)-1];return r?r.timestamp-this._sessionStartTimestamp:null}ai(){if(!this.Rt||0===this.Rt.data.length)return this.er();for(var t=-1,e=this.Rt.data.length-1;e>=0;e--)if(4===this.Rt.data[e].type){t=e;break}return 0>t?this.er():(this.Rt.data=this.Rt.data.slice(t),this.Rt.sizes=this.Rt.sizes.slice(t),this.Rt.size=this.Rt.sizes.reduce((t,e)=>t+e,0),this.Rt)}er(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.He},this.Rt}jt(t,e){this._instance.register_for_session({[Nn]:t}),Fa.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",i({reason:t},e))}wi(t){var e;return 3===t.type&&-1!==Da.indexOf(null==(e=t.data)?void 0:e.source)}si(t){var e=this.wi(t);e||!0===this.ce||t.timestamp-this.ue>this.te&&(this.ce=!0,clearInterval(this.Ar),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.ue,threshold:this.te,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.He}),this.tr());var r=this.Yt.checkAndGetSessionAndWindowId(!e,t.timestamp),i=r.windowId,n=r.sessionId,s=!1;if(e&&(this.ue=t.timestamp,this.ce)){var a="unknown"===this.ce;this.ce=!1,a||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),s=!0)}var o=this.Xt!==n,u=this.He!==i;if(this.He=i,this.Xt=n,o||u){var l=o&&!1!==this.ce;l&&(this.ce="unknown"),this.Ue(l)}else if(e&&this.Er(),s){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.ne)?void 0:h.hasPendingTriggers(this.sessionId));this.de>0&&d&&this.Bt(),this._r(),this.Rr()}}ze(){var t;null==(t=this.ne)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,r,i,n,s,a,o,u,l=null==(t=La())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Wr,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_current_session_duration:this.Qe,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null==(e=this.$e)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Ie,$snapshot_max_depth_exceeded:this._e,$sdk_debug_replay_slowest_full_snapshot_ms:xa(null==(r=this.Zr)?void 0:r.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:xa(null==(i=this.Zr)?void 0:i.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Zr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Zr)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.Zr)?void 0:a.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==l?void 0:l.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==l?void 0:l.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==l?void 0:l.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:xa(null==l?void 0:l.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:xa(null==l?void 0:l.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:xa(null==(o=La())||null==o.getMutationCost||null==(o=o.getMutationCost())?void 0:o.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(u=La())||null==u.getDiscardedDurationSamples?void 0:u.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.ve,$sdk_debug_replay_oversized_mutations_dropped:this.fe,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.pe,$sdk_debug_replay_rrweb_error:this.we,[Fn]:!!this.ae,[Dn]:this.ke}}qr(){var t;if(!this.ae){this.ke=!0;var e,r,n,s,a={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,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},o=this._instance.config.session_recording;for(var u of Object.entries(o||{})){var l=u[0],h=u[1];if(l in a)if("maskInputOptions"===l)a.maskInputOptions=i({password:!0},h);else if("sampling"===l){var d=null!=h?h:{},c={};Vr(d.mousemove)||(c.mousemove=d.mousemove),Vr(d.mouseInteraction)||(c.mouseInteraction=d.mouseInteraction),a.sampling=c}else a[l]=h}!0===(null==o?void 0:o.captureJsonLd)&&!0!==a.slimDOMOptions&&"all"!==a.slimDOMOptions&&(a.slimDOMOptions=i({},a.slimDOMOptions,{script:!0})),this.cr&&this.cr.enabled&&(a.recordCanvas=!0,a.sampling=i({},a.sampling,{canvas:this.cr.fps}),a.dataURLOptions={type:"image/webp",quality:this.cr.quality},a.canvasResolutionScale=this.hr,a.canvasMasking={configured:()=>{var t;return qr(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,r=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(qr(r))try{var i;return null!==(i=r(t))&&void 0!==i?i:null}catch(t){return this.Me||(this.Me=!0,Fa.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.ur&&(a.maskAllInputs=null===(e=this.ur.maskAllInputs)||void 0===e||e,a.maskTextSelector=null!==(r=this.ur.maskTextSelector)&&void 0!==r?r:void 0,a.blockSelector=null!==(n=this.ur.blockSelector)&&void 0!==n?n:void 0,a.maskAllElementAttributes=null!==(s=this.ur.maskAllElementAttributes)&&void 0!==s&&s),a.maskAllElementAttributes&&a.maskAttributeFn&&(a.maskAttributeFn=void 0,this.Ce||(this.Ce=!0,Fa.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.lr();var v=Pa();if(v){this.zr=null!==(t=this.zr)&&void 0!==t?t:new Us(v,{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";Fa.info(r,{node:e}),this.log("[SessionRecording] "+r,"warn")},onDroppedAttributeMutations:t=>this.ve+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.Ir,onDroppedOversizedMutation:t=>{0===this.fe&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.fe+=1,this.pe+=t},requestFullSnapshot:()=>this.Bt()});var f=this.pr();if(this.ae=v(i({emit:t=>{this.onRRwebEmit(t)},plugins:f,errorHandler:(t,e)=>"rrweb"===e&&(this.Te||(this.Te=!0,Fa.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},a)),!this.ae)return this.we=!0,void Fa.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.we=!1,!0===(null==o?void 0:o.captureJsonLd)&&Pr&&null!=Nr&&Nr.MutationObserver&&!this.Sr&&(this.Sr=function(t,e,r){var i=new WeakMap,n=r.getCaptureState||(()=>!0),s=aa,a=function(t,e){var r=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||null!=r&&r.length&&!r.includes("id")?la:r=>{var i=t.getElementById(r);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!Ra(i,e.blockClass,e.blockSelector)}}(t,r),o=e=>{try{var o=n();if(!s||!1===o||!e.isConnected||e.ownerDocument!==t||function(t,e){return Ra(t,e.blockClass,e.blockSelector)||Ra(t,e.maskTextClass,e.maskTextSelector)}(e,r))return;var u=function(t,e){if(void 0===e&&(e=la),!t||t.length>aa)return null;try{var r=JSON.parse(t),i={remainingNodes:2048,exceeded:!1},n=Hr(r)?r.map(t=>Ma(t,e,i)):Ma(r,e,i);if(i.exceeded||Jr(n)||Hr(n)&&(!n.length||n.some(Jr)))return null;var s=JSON.stringify(n);return s.length>2e4?null:[n,s]}catch(t){return null}}(e.text,a);if(!u)return void i.delete(e);var l=u[0],h=u[1];if(Jr(o))return void i.set(e,h);if(i.get(e)!==h){if(h.length>s)return void(s=0);r.emit(l)&&(i.set(e,h),s-=h.length)}}catch(t){return}};try{var u=new e(t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of Aa(t))o(e)};for(var r of t)if("childList"===r.type)Ca(r.target)&&o(r.target),r.addedNodes.forEach(e);else if("characterData"===r.type){var i=r.target.parentNode;i&&Ca(i)&&o(i)}else"attributes"===r.type&&Ca(r.target)&&o(r.target)}catch(t){return}});return u.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&Aa(t.documentElement).forEach(t=>{e&&i.delete(t),o(t)})},stop(){return u.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(Pr,Nr.MutationObserver,{attributeFilter:a.attributeFilter,blockClass:a.blockClass,blockSelector:a.blockSelector,isRecordedElement:t=>v.mirror.getId(t)>0,maskAllElementAttributes:a.maskAllElementAttributes,maskAttributeFn:a.maskAttributeFn,maskTextClass:a.maskTextClass,maskTextSelector:a.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.wr()},emit:t=>this.kr(t)}),this.Y.isCurrentUrlBlocked()&&this.Sr.scan()),this.ue=Date.now(),this.ce=Kr(this.ce)?this.ce:"unknown",this.tryAddCustomEvent("$remote_config_received",this.re),this.Vt("$session_options",{sessionRecordingOptions:a,activePlugins:f.map(t=>null==t?void 0:t.name)}),this.Vt("$posthog_config",{config:this._instance.config})}else Fa.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Vt(t,e)}};jr.__PosthogExtensions__=jr.__PosthogExtensions__||{},jr.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:t=>({name:"rrweb/console@1",observer:Dr,options:t}),getRecordNetworkPlugin:t=>({name:"rrweb/network@1",observer:ln,options:t})},jr.__PosthogExtensions__.rrweb={record:br,version:"v2",wasMaxDepthReached:()=>qt,resetMaxDepthState(){qt=!1,Ht=!1},getLastSnapshotCost:()=>F,getMutationCost:()=>i({},B),getDeferredStylesheetStats:()=>i({},j),getDiscardedDurationSamples:()=>C,resetSnapshotCostState(){x=0,T=0,E=0,M=0,C=0,O={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},F=null,D=null,N=[],L=0,P=0,B={slowestBatchMs:0},j={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},jr.__PosthogExtensions__.initSessionRecording=(t,e)=>new io(t,e)}()}();
|
|
1
|
+
!function(){var t=["type"];function e(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 r(t){return function(){var r=this,i=arguments;return new Promise(function(n,s){var a=t.apply(r,i);function o(t){e(a,n,s,o,u,"next",t)}function u(t){e(a,n,s,o,u,"throw",t)}o(void 0)})}}function i(){return i=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},i.apply(null,arguments)}!function(){var e=function(t){return 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}({}),n=function(t){return 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}({}),s=function(t){return 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}({}),a=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),o=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),u=function(t){return 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}({}),l=function(t){return 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}({});function h(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var d={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},c={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},v={};function f(t){if(v[t])return v[t];var e=function(t){var e,r,i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(r=e.__symbol__)||void 0===r?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in d?d[t]:void 0,n=Boolean(i&&i.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(r,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),s=t in c?c[t]:void 0,a=Boolean(s&&s.every(t=>{var e;return"function"==typeof r[t]&&(null===(e=r[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(n&&a)return v[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var u,l=!1;try{document.body.appendChild(o);var f=o.contentWindow;if(!f)return e.prototype;var p=f[t].prototype;return p?(h(u=navigator.userAgent,"AppleWebKit")&&!h(u,"Chrome")&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),v[t]=p):r}catch(t){return r}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var p=Object.create(null);function g(t,e,r){var i,n=p[t],s=n[r];if(s)return s.call(e);var a=f(t),o=null===(i=Object.getOwnPropertyDescriptor(a,r))||void 0===i?void 0:i.get;return o?(n[r]=o,o.call(e)):e[r]}p.Node=Object.create(null),p.ShadowRoot=Object.create(null),p.MutationObserver=Object.create(null),p.Element=Object.create(null);var m,y={};function b(t,e,r){var i=t+"."+String(r);if(y[i])return y[i].bind(e);var n=f(t)[r];return"function"!=typeof n?e[r]:(y[i]=n,n.bind(e))}function w(){return f("MutationObserver").constructor}function _(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},s=r(function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)});return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var r=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},i=t[e],a=r(i);a;){if(a.next===s)return void(a.next=n.next);a=r(i=a.next)}else t[e]=n.next}}catch(t){return()=>{}}}var k={childNodes:t=>g("Node",t,"childNodes"),parentNode:t=>g("Node",t,"parentNode"),parentElement:t=>g("Node",t,"parentElement"),textContent:t=>g("Node",t,"textContent"),isConnected(t){if(void 0===m){var e,r=null===(e=Object.getOwnPropertyDescriptor(f("Node"),"isConnected"))||void 0===e?void 0:e.get;m=(null==r?void 0:r.toString().includes("[native code]"))?r:null}return null==m?void 0:m.call(t)},contains:(t,e)=>b("Node",t,"contains")(e),getRootNode:t=>b("Node",t,"getRootNode")(),host:t=>t&&"host"in t?g("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null,querySelector:(t,e)=>b("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>b("Element",t,"querySelectorAll")(e),mutationObserver:w,patch:_};function S(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var M=0,C=0;function I(){M+=1}function R(){return M}function A(t,e){return(e!==M||t>6e4)&&(C+=1,!0)}var x=0,T=0,E=0,O={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},F=null,D=null,N=[],L=0,P=0,B={slowestBatchMs:0},j={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function W(t){var e;(x+=1)>1||(O={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},N=[],L=0,D=(e=t)&&e>0?e:null,T=S(),E=M)}function z(){return 0===x?F||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(x-=1)>0?O:(O.durationMs=S()-T,O.deferredStylesheetCount=L,j.deferredCount+=L,D=null,A(O.durationMs,E)?O:F=O)}function U(t,e,r){var i=t.length;if(r>=32)return i;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)i+=U(a,e,r+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var u=o.rules||o.cssRules;u&&(i+=U(u,e,r+1))}}}catch(t){}}return i}function H(t){if(0!==x){var e=U(t,null,0);O.cssRuleCount+=e,P>0&&(O.nonDeferrableCssRuleCount+=e)}}function q(t){P+=1;try{return t()}finally{P-=1}}function G(t){x>0&&(O.stylesheetMs+=t)}function V(t){if(0===x||null===D)return!1;var e=O.cssRuleCount-O.nonDeferrableCssRuleCount;return e>=D||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var r=new WeakSet;return r.add(t),U(e,r,0)}catch(t){return 0}}(t)>D}function Z(){j.failedCount+=1}function J(t){t>0&&(j.abandonedCount+=t)}function Q(t){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(t)}function X(t,e,r){return(e=function(t){var e=function(t){if("object"!=Q(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Q(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Q(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function K(t){return t.nodeType===t.ELEMENT_NODE}function Y(t){var e=t&&"host"in t&&"mode"in t&&k.host(t)||null;return Boolean(e&&"shadowRoot"in e&&k.shadowRoot(e)===t)}function tt(t){return"[object ShadowRoot]"==={}.toString.call(t)}function et(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function rt(t){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}var it=0;function nt(t){var e=0===it,r=e?S():0;it+=1;try{var i=t.rules||t.cssRules;if(!i)return null;H(i);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),et(Array.from(i,t=>st(t,n)).join(""))}catch(t){return null}finally{it-=1,e&&G(S()-r)}}function st(t,e){if(ot(t)){var r;try{r=nt(t.styleSheet)||rt(t)}catch(e){r=t.cssText}try{var i;if(r&&(null===(i=t.styleSheet)||void 0===i?void 0:i.href))return St(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return ut(t)&&t.selectorText.includes(":")&&(n=at(n)),e?St(n,e):n}function at(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function ot(t){return"styleSheet"in t}function ut(t){return"selectorText"in t}var lt=/^-?[A-Za-z_][\w-]*$/,ht=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function dt(t){var e=[],r=!1,i=null,n=new Map;function s(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void s(null)}var o=e[e.length-1];return o.parts.push(t),void(o.index+=1)}if(!n.importRule)return r=!0,void(i=t);a(e[e.length-1],n.importRule,t)}function a(t,e,r){try{var i;try{i=r||rt(e)}catch(t){i=e.cssText}try{var n;i&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(i=St(i,e.styleSheet.href))}catch(t){}i&&t.parts.push(i),t.index+=1}catch(t){s(null)}}function o(t){var r=t.rules[t.index];if("sheet"===t.kind&&ot(r)){var i=n.get(r);return null===i?(t.parts.push(r.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:r}):void a(t,r,null)}if(!function(t,r){try{var i=function(t){var e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return"@media "+e.media.mediaText+" {";if(ut(t)){if("number"==typeof e.type&&1!==e.type)return null;var r=e.style?e.style.cssText:"";return t.selectorText+" {"+(r?" "+r:"")}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!lt.test(e.containerName)?null:"@container "+(e.containerName?e.containerName+" ":"")+e.containerQuery+" {";if("string"==typeof e.conditionText){var i="";try{var n;i=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===i||"Object"===i||"CSSSupportsRule"===i?"@supports "+e.conditionText+" {":null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?lt.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":ht.test(e.name)?"@layer "+e.name+" {":null:null}(t);if(null===i)return!1;var n=r.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?St(i,n):i,fixColons:"sheet"===r.kind&&ut(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(r,t)){var s=r.cssText;"sheet"===t.kind&&ut(r)&&r.selectorText.includes(":")&&(s=at(s)),t.parts.push(t.sheetHref?St(s,t.sheetHref):s),t.index+=1}}return function(t){try{var r=t.rules||t.cssRules;if(!r)return!1;H(r);var i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);var s=Array.from(r);return e.push({kind:"sheet",sheet:t,rules:s,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){for(var r=[{sheet:e,rules:t,index:0}],i=function(){var t=r[r.length-1];if(t.index>=t.rules.length)return r.pop(),0;var e=t.rules[t.index];if(t.index+=1,!ot(e)||n.has(e))return 0;var i=null;try{i=e.styleSheet}catch(t){return n.set(e,null),0}if(!i||r.some(t=>t.sheet===i))return 0;try{var s=i.rules||i.cssRules;if(!s)return 0;H(s);var a=i.href;!a&&i.ownerNode&&(a=i.ownerNode.baseURI);var o=Array.from(s);n.set(e,{sheet:i,rules:o,sheetHref:a}),r.push({sheet:i,rules:o,index:0})}catch(t){}};r.length>0;)i()}(s,t),!0}catch(t){return!1}}(t)||(r=!0),{advance(t){if(r)return!0;var n=S(),a=t>0?t:1;try{for(;!r&&a>0;){var u=e[e.length-1];if(u.rules.length>u.index){a-=1;try{o(u)}catch(t){s(null)}}else{var l=null;try{if("group"===u.kind){var h=u.prelude+u.parts.join("")+"}";l=u.fixColons?at(h):h}else l=et(u.parts.join(""))}catch(t){}s(l)}}}catch(t){r=!0,i=null}finally{G(S()-n)}return r},text:()=>r?i:null,remainingRules(){if(r)return 0;var t=0;for(var i of e)t+=i.rules.length-i.index;return t}}}var ct=class{constructor(){X(this,"idNodeMap",new Map),X(this,"nodeMetaMap",new WeakMap)}getId(t){var e,r;return t&&null!==(e=null===(r=this.getMeta(t))||void 0===r?void 0:r.id)&&void 0!==e?e:-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)),K(t)){var r=k.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 vt(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&ft(n);return(r[i.toLowerCase()]||o&&r[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function ft(t){return t.toLowerCase()}var pt=new Set(["rr_width","rr_height","rr_left","rr_top","rr_position","rr_transform","rr_display","rr_scrollleft","rr_scrolltop","rr_mediastate","rr_open_mode"]);function gt(t){var e=t.element,r=t.name,i=t.value,n=t.maskAttributeFn,s=t.isGenerated;return i?t.maskAllElementAttributes?void 0!==s&&s&&pt.has(ft(r))?i:"*".repeat(i.length):n?n(r,i,e):i:i}var mt="__rrweb_original__";function yt(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?ft(e):null}catch(t){return null}}var bt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,wt=/^(?:[a-z+]+:)?\/\//i,_t=/^www\..*/i,kt=/^(data:)([^,]*),(.*)/i;function St(t,e){return(t||"").replace(bt,(t,r,i,n,s,a)=>{var o,u=i||s||a,l=r||n||"";if(!u)return t;if(wt.test(u)||_t.test(u))return"url("+l+u+l+")";if(kt.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 Mt,Ct,It=new Map,Rt=1,At=new RegExp("[^a-z0-9-_:]");function xt(){return Rt++}var Tt=/^[^ \t\n\r\u000c]+/,Et=/^[, \t\n\r\u000c]+/,Ot=new WeakMap;function Ft(t,e){return e&&""!==e.trim()?Dt(t,e):e}function Dt(t,e){var r=Ot.get(t);if(r||(r=t.createElement("a"),Ot.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function Nt(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function Lt(t,e,r,i,n,s){if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var a,o=null===(a=n.sheet)||void 0===a?void 0:a.href;if(o)return o}var u=Ft(t,i);if(u.startsWith("data:")){if("img"===e&&n){var l=u;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(l=function(t,e,r,i){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;var n=It.get(e);if(n&&n.type===r&&n.quality===i)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(r||"image/webp",null!=i?i:.4),u=e.length>o.length?o:e;if(It.size>=10){var l=It.keys().next().value;void 0!==l&&It.delete(l)}return It.set(e,{type:r,quality:i,result:u}),u}catch(t){return e}}(n,u,s.type,s.quality)),Nt(l,s)}if("image"===e)return Nt(u,s)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=Ft(t,i);return"image"===e&&h.startsWith("data:")?Nt(h,s):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(Et),e.length>r;){var s=i(Tt);if(","===s.slice(-1))s=Ft(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=Ft(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?St(i,Dt(t)):"object"===e&&"data"===r?Ft(t,i):i:Ft(t,i)}function Pt(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function Bt(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&Bt(k.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&Bt(k.parentNode(t),e,r)}function $t(t,e,r,i){var n;if(K(t)){if(!k.childNodes(n=t).length)return!1}else{if(null===k.parentElement(t))return!1;n=k.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(Bt(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 jt(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var Wt=new Map;function zt(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function Ut(t){return null==t?"":t.toLowerCase()}var Ht=!1,qt=!1;function Gt(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,u=e.skipChild,h=void 0!==u&&u,d=e.inlineStylesheet,c=void 0===d||d,v=e.maskInputOptions,f=void 0===v?{}:v,p=e.maskTextFn,g=e.maskInputFn,m=e.maskAllElementAttributes,y=void 0!==m&&m,b=e.maskAttributeFn,w=e.slimDOMOptions,_=e.dataURLOptions,S=void 0===_?{}:_,M=e.inlineImages,C=void 0!==M&&M,I=e.recordCanvas,R=void 0!==I&&I,A=e.canvasMaskingConfigured,T=e.onSerialize,E=e.onIframeLoad,F=e.iframeLoadTimeout,D=void 0===F?5e3:F,P=e.onIframeListenerRegistered,B=e.onStylesheetLoad,j=e.stylesheetLoadTimeout,W=void 0===j?5e3:j,z=e.keepIframeSrcFn,U=void 0===z?()=>!1:z,H=e.newlyAddedElement,G=void 0!==H&&H,Z=e.depth,J=void 0===Z?0:Z,Q=e.maxDepth,X=void 0===Q?50:Q,et=e.needsMask,rt=e.preserveWhiteSpace,it=void 0===rt||rt;if(J>=X)return qt=!0,Ht||(Ht=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+X+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;et||(et=$t(t,a,o,void 0===et)),x>0&&(O.nodeCount+=1);var st,at=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,u=void 0===o?{}:o,h=e.maskTextFn,d=e.maskInputFn,c=e.maskAllElementAttributes,v=void 0!==c&&c,f=e.maskAttributeFn,p=e.dataURLOptions,g=void 0===p?{}:p,m=e.inlineImages,y=e.recordCanvas,b=e.canvasMaskingConfigured,w=e.keepIframeSrcFn,_=e.newlyAddedElement,S=void 0!==_&&_,M=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:l.Document,childNodes:[],compatMode:t.compatMode}:{type:l.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:l.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:M};case t.ELEMENT_NODE:return function(t,e){for(var r=e.doc,i=e.inlineStylesheet,n=e.maskInputOptions,s=void 0===n?{}:n,a=e.maskInputFn,o=e.maskAllElementAttributes,u=void 0!==o&&o,h=e.maskAttributeFn,d=e.dataURLOptions,c=void 0===d?{}:d,v=e.inlineImages,f=e.recordCanvas,p=e.canvasMaskingConfigured,g=e.keepIframeSrcFn,m=e.newlyAddedElement,y=void 0!==m&&m,b=e.rootId,w=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),_=function(t){if(t instanceof HTMLFormElement)return"form";var e=ft(t.tagName);return At.test(e)?"div":e}(t),S=new Set,M={},C=t.attributes.length,I=0;C>I;I++){var R=t.attributes[I];Pt(_,R.name)||(M[R.name]=Lt(r,_,ft(R.name),R.value,t,c))}if("link"===_&&i&&!w){var A=t.sheet;if(!A){var T=function(t){return t.href}(t);T&&!(A=zt(r,T))&&T.includes(".css")&&(A=zt(r,window.location.origin+"/"+T.replace(window.location.href,"")))}var E=null;A&&(V(A)?x>0&&(N.push(t),L+=1):E=nt(A)),E&&(delete M.rel,delete M.href,M._cssText=E)}if("style"===_&&t.sheet&&!(t.innerText||k.textContent(t)||"").trim().length){var O=q(()=>nt(t.sheet));O&&(M._cssText=O)}if("input"===_||"textarea"===_||"select"===_){var F=t.value,D=t.checked;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&F?M.value=vt({element:t,type:yt(t),tagName:_,value:F,maskInputOptions:s,maskInputFn:a}):D&&(M.checked=D)}if("option"===_&&(t.selected&&!s.select?M.selected=!0:delete M.selected),"dialog"===_&&t.open){try{M.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){M.rr_open_mode="modal",M.ph_rr_could_not_detect_modal=!0}S.add("rr_open_mode")}if("canvas"===_&&f&&!(null==p?void 0:p()))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((mt in n?n[mt]: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)||(M.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var P=t.toDataURL(c.type,c.quality),B=r.createElement("canvas");B.width=t.width,B.height=t.height,P!==B.toDataURL(c.type,c.quality)&&(M.rr_dataURL=P)}var j,W,z=!1;if("img"===_&&v){Mt||(Mt=r.createElement("canvas"),Ct=Mt.getContext("2d"));var U=t,H=U.currentSrc||U.getAttribute("src")||"<unknown-src>",G=U.crossOrigin,Z=(e,r)=>z?gt({element:t,name:e,value:r,maskAllElementAttributes:u,maskAttributeFn:h}):r,J=()=>{jt(U,"load",J);try{Mt.width=U.naturalWidth,Mt.height=U.naturalHeight,Ct.drawImage(U,0,0);var t=Mt.toDataURL(c.type,c.quality);M.rr_dataURL=Z("rr_dataURL",t)}catch(t){if("anonymous"!==U.crossOrigin)return U.crossOrigin="anonymous",void(U.complete&&0!==U.naturalWidth?J():U.addEventListener("load",J));console.warn("Cannot inline img src="+H+"! Error: "+t)}"anonymous"===U.crossOrigin&&(G?M.crossOrigin=Z("crossOrigin",G):U.removeAttribute("crossorigin"))};U.complete&&0!==U.naturalWidth?J():U.addEventListener("load",J)}if("audio"===_||"video"===_){var Q=M;Q.rr_mediaState=t.paused?"paused":"played",S.add("rr_mediaState"),Q.rr_mediaCurrentTime=t.currentTime,Q.rr_mediaPlaybackRate=t.playbackRate,Q.rr_mediaMuted=t.muted,Q.rr_mediaLoop=t.loop,Q.rr_mediaVolume=t.volume}if(y||(t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop)),w){var X,K,Y,tt=t.getBoundingClientRect(),et=tt.width,rt=tt.height,it=tt.left,st=tt.top,at=null===(X=r.defaultView)||void 0===X?void 0:X.getComputedStyle(t);M={class:M.class,rr_width:et+"px",rr_height:rt+"px",rr_left:Math.floor(it+((null===(K=r.defaultView)||void 0===K?void 0:K.scrollX)||0))+"px",rr_top:Math.floor(st+((null===(Y=r.defaultView)||void 0===Y?void 0:Y.scrollY)||0))+"px"},S.add("rr_width"),S.add("rr_height"),S.add("rr_left"),S.add("rr_top"),at&&(M.rr_position=at.position||"static",S.add("rr_position"),at.transform&&"none"!==at.transform&&(M.rr_transform=at.transform,S.add("rr_transform")),at.display&&at.display.startsWith("inline")&&(M.rr_display=at.display,S.add("rr_display")))}if("iframe"!==_||g(M.src)||(t.contentDocument||(M.rr_src=M.src),delete M.src),u||h)for(var ot of Object.entries(M)){var ut=ot[0],lt=ot[1];"string"!=typeof lt&&null!==lt||(M[ut]=gt({element:t,name:ut,value:lt,maskAllElementAttributes:u,maskAttributeFn:h,isGenerated:S.has(ut)}))}z=!0;try{customElements.get(_)&&(j=!0)}catch(t){}return{type:l.Element,tagName:_,attributes:M,childNodes:[],isSVG:(W=t,Boolean("svg"===W.tagName||W.ownerSVGElement)||void 0),needBlock:w,rootId:b,isCustom:j}}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:a,maskInputOptions:u,maskInputFn:d,maskAllElementAttributes:v,maskAttributeFn:f,dataURLOptions:g,inlineImages:m,recordCanvas:y,canvasMaskingConfigured:b,keepIframeSrcFn:w,newlyAddedElement:S,rootId:M});case t.TEXT_NODE:return function(t,e){var r=e.needsMask,i=e.maskTextFn,n=e.rootId,s=k.parentNode(t),a=s&&s.tagName,o=k.textContent(t),u="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(u&&o){try{var d;if(t.nextSibling||t.previousSibling);else if(V(s.sheet));else if(null===(d=s.sheet)||void 0===d?void 0:d.cssRules){var c=nt(s.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(o=c)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}o=St(o,Dt(e.doc))}return h&&(o="SCRIPT_PLACEHOLDER"),!u&&!h&&o&&r&&(o=i?i(o,k.parentElement(t)):o.replace(/[\S]/g,"*")),{type:l.Text,textContent:o||"",isStyle:u,rootId:n}}(t,{doc:r,needsMask:s,maskTextFn:h,rootId:M});case t.CDATA_SECTION_NODE:return{type:l.CDATA,textContent:"",rootId:M};case t.COMMENT_NODE:return{type:l.Comment,textContent:k.textContent(t)||"",rootId:M};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:et,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:g,maskAllElementAttributes:y,maskAttributeFn:b,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,keepIframeSrcFn:U,newlyAddedElement:G});if(!at)return console.warn(t,"not serialized"),null;st=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===l.Comment)return!0;if(t.type===l.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e,r;try{r=new URL(t,window.location.href)}catch(t){return null}var i=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==i?void 0:i[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Ut(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ut(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Ut(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Ut(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Ut(t.attributes.property).match(/^(og|twitter|fb):/)||Ut(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ut(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Ut(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(Ut(t.attributes.name))||Ut(t.attributes.property).match(/^article:/)||Ut(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(Ut(t.attributes.name)))return!0}}return!1}(at,w)||!it&&at.type===l.Text&&!at.isStyle&&!at.textContent.replace(/^\s+|\s+$/gm,"").length?-2:xt();var ot=Object.assign(at,{id:st});if(i.add(t,ot),-2===st)return null;T&&T(t);var ut=!h;if(ot.type===l.Element){ut=ut&&!ot.needBlock,delete ot.needBlock;var lt=k.shadowRoot(t);lt&&tt(lt)&&(ot.isShadowHost=!0)}if((ot.type===l.Document||ot.type===l.Element)&&ut){w.headWhitespace&&ot.type===l.Element&&"head"===ot.tagName&&(it=!1);var ht={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:a,maskTextSelector:o,skipChild:h,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:g,maskAllElementAttributes:y,maskAttributeFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,preserveWhiteSpace:it,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:D,onIframeListenerRegistered:P,onStylesheetLoad:B,stylesheetLoadTimeout:W,keepIframeSrcFn:U,depth:J+1,maxDepth:X};if(ot.type===l.Element&&"textarea"===ot.tagName&&void 0!==ot.attributes.value);else for(var dt of Array.from(k.childNodes(t))){var ct=Gt(dt,ht);ct&&ot.childNodes.push(ct)}var pt=null;if(K(t)&&(pt=k.shadowRoot(t)))for(var bt of Array.from(k.childNodes(pt))){var wt=Gt(bt,ht);wt&&(tt(pt)&&(wt.isShadow=!0),ot.childNodes.push(wt))}}var _t=k.parentNode(t);if(_t&&Y(_t)&&tt(_t)&&(ot.isShadow=!0),ot.type===l.Element&&"iframe"===ot.tagName){var kt=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var a=()=>e();if("complete"!==i){var o=!1,u=null,l=()=>{o||(o=!0,null!==u&&(clearTimeout(u),u=null),jt(t,"load",h),t.addEventListener("load",a),e())},h=()=>l();return u=setTimeout(l,r),t.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),o?jt(t,"load",a):(o=!0,jt(t,"load",h))}}var d,c="about:blank";try{d=s.location.href}catch(t){return n}if(d!==c||t.src===c||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",a),()=>{clearTimeout(v),jt(t,"load",a)}}return t.addEventListener("load",a),()=>{jt(t,"load",a)}}(t,()=>{var e=t.contentDocument;if(e&&E){var r=Gt(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:g,maskAllElementAttributes:y,maskAttributeFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,preserveWhiteSpace:it,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:D,onIframeListenerRegistered:P,onStylesheetLoad:B,stylesheetLoadTimeout:W,keepIframeSrcFn:U,depth:J+1,maxDepth:X});r&&E(t,r)}},D);null==P||P(t,kt)}return ot.type===l.Element&&"link"===ot.tagName&&"stylesheet"===ot.attributes.rel&&function(e,u,l){if(!Wt.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var d=new AbortController,v=!1,m=()=>{if(!v){v=!0;try{(()=>{if(B){var e=Gt(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:c,maskInputOptions:f,maskTextFn:p,maskInputFn:g,maskAllElementAttributes:y,maskAttributeFn:b,slimDOMOptions:w,dataURLOptions:S,inlineImages:C,recordCanvas:R,canvasMaskingConfigured:A,preserveWhiteSpace:it,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:D,onStylesheetLoad:B,stylesheetLoadTimeout:W,keepIframeSrcFn:U,depth:J,maxDepth:X});e&&B(t,e)}})()}finally{Wt.delete(e),d.abort()}}},_=setTimeout(m,l);d.signal.addEventListener("abort",()=>clearTimeout(_),{once:!0}),e.addEventListener("load",m,{signal:d.signal,once:!0}),Wt.set(e,d)}}}(t,0,W),ot}function Vt(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}var Zt=class t{constructor(){X(this,"parentElement",null),X(this,"parentNode",null),X(this,"ownerDocument",void 0),X(this,"firstChild",null),X(this,"lastChild",null),X(this,"previousSibling",null),X(this,"nextSibling",null),X(this,"ELEMENT_NODE",1),X(this,"TEXT_NODE",3),X(this,"nodeType",void 0),X(this,"nodeName",void 0),X(this,"RRNodeType",void 0)}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.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 Jt(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>Qt(r,t,e,i)}function Qt(t,e,r,i){Xt(()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))})}function Xt(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}function Kt(t){t.forEach(t=>{if("function"==typeof t)try{t()}catch(t){}})}var Yt="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.",te={map:{},getId(){return console.error(Yt),-1},getNode(){return console.error(Yt),null},removeNodeFromMap(){console.error(Yt)},has(){return console.error(Yt),!1},reset(){console.error(Yt)}};function ee(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 re(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout(()=>{try{r.set.call(this,t)}catch(t){}},0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>re(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(te=new Proxy(te,{get(t,e,r){return"map"===e&&console.error(Yt),Reflect.get(t,e,r)}}));var ie=Date.now;function ne(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=k.parentElement(s.body))||void 0===e?void 0:e.scrollLeft)||(null==s||null===(r=s.body)||void 0===r?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=k.parentElement(s.body))||void 0===i?void 0:i.scrollTop)||(null==s||null===(n=s.body)||void 0===n?void 0:n.scrollTop)||0}}function se(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ae(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function oe(t){return t?t.nodeType===t.ELEMENT_NODE?t:k.parentElement(t):null}function ue(t,e,r,i){if(!t)return!1;var n=oe(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(Bt(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 le(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)}function he(t,e){if(Y(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=k.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||he(i,e))}function de(t){return Boolean(t.changedTouches)}function ce(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function ve(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function fe(t){return!!t&&(t instanceof Zt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(k.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ie=()=>(new Date).getTime());var pe=class{constructor(){X(this,"id",1),X(this,"styleIDMap",new WeakMap),X(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 ge(t){var e,r=null;return"getRootNode"in t&&(null===(e=k.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&k.host(k.getRootNode(t))&&(r=k.host(k.getRootNode(t))),r}function me(t){var e=t.ownerDocument;if(!e)return!1;if(k.contains(e,t))return!0;var r=k.isConnected(t);return"boolean"==typeof r?r:function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=ge(r);)r=e;return r}(t);return k.contains(e,r)}(t)}function ye(t){return"__ln"in t}var be,we=class{constructor(){X(this,"length",0),X(this,"head",null),X(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&&ye(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&&ye(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--)}},_e=(t,e)=>t+"@"+e,ke=class{constructor(){X(this,"frozen",!1),X(this,"locked",!1),X(this,"texts",[]),X(this,"attributes",[]),X(this,"attributeMap",new WeakMap),X(this,"generatedAttributes",new WeakMap),X(this,"removes",[]),X(this,"mapRemoves",new Set),X(this,"movedMap",{}),X(this,"addedSet",new Set),X(this,"movedSet",new Set),X(this,"droppedSet",new Set),X(this,"removesSubTreeCache",new Set),X(this,"mutationCb",void 0),X(this,"blockClass",void 0),X(this,"blockSelector",void 0),X(this,"maskTextClass",void 0),X(this,"maskTextSelector",void 0),X(this,"inlineStylesheet",void 0),X(this,"maskInputOptions",void 0),X(this,"maskTextFn",void 0),X(this,"maskInputFn",void 0),X(this,"maskAllElementAttributes",void 0),X(this,"maskAttributeFn",void 0),X(this,"keepIframeSrcFn",void 0),X(this,"recordCanvas",void 0),X(this,"canvasMaskingConfigured",void 0),X(this,"inlineImages",void 0),X(this,"slimDOMOptions",void 0),X(this,"dataURLOptions",void 0),X(this,"doc",void 0),X(this,"mirror",void 0),X(this,"iframeManager",void 0),X(this,"stylesheetManager",void 0),X(this,"shadowDomManager",void 0),X(this,"canvasManager",void 0),X(this,"processedNodeManager",void 0),X(this,"unattachedDoc",void 0),X(this,"canvasManagerReleased",!1),X(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),X(this,"emit",()=>{if(!this.frozen&&!this.locked){var t,e,r=S(),i=R();try{this.processBufferedMutations()}finally{t=S()-r,e=i,x>0||A(t,null!=e?e:M)||t>B.slowestBatchMs&&(B.slowestBatchMs=t)}}}),X(this,"processBufferedMutations",()=>{var t,e=[],r=new Set,i=new we,n=t=>{for(var e=t,r=-2;-2===r;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},s=s=>{var a=k.parentNode(s);if(a&&me(s)&&"TEXTAREA"!==a.tagName&&!this.isBlockedAtEmission(a)){var o=Y(a)?this.mirror.getId(ge(s)):this.mirror.getId(a),u=n(s);if(-1===o||-1===u)return i.addNode(s);null!=t||(t={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,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{ce(t,this.mirror)&&this.iframeManager.addIframe(t),ve(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),fe(t)&&!ue(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(k.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});var l=Gt(s,t);l&&(e.push({parentId:o,nextId:u,node:l}),r.add(l.id))}};for(var a of this.mapRemoves)this.mapRemoves.delete(a),this.mirror.removeNodeFromMap(a);for(var o of this.movedSet)Me(this.removesSubTreeCache,o)&&!this.movedSet.has(k.parentNode(o))||s(o);for(var u of this.addedSet)Ce(this.droppedSet,u)||Me(this.removesSubTreeCache,u)?Ce(this.movedSet,u)?s(u):this.droppedSet.add(u):s(u);for(var l=null;i.length;){var h=null;if(l){var d=this.mirror.getId(k.parentNode(l.value)),c=n(l.value);-1!==d&&-1!==c&&(h=l)}if(!h)for(var v=i.tail;v;){var f=v;if(v=v.previous,f){var p=this.mirror.getId(k.parentNode(f.value));if(-1===n(f.value))continue;if(-1!==p){h=f;break}var g=k.parentNode(f.value);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var m=k.host(g);if(-1!==this.mirror.getId(m)){h=f;break}}}}if(!h){for(;i.head;)i.removeNode(i.head.value);break}l=h.previous,i.removeNode(h.value),s(h.value)}var y={texts:this.texts.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.node,r=k.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!r.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"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)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var n of Object.entries(e)){var s,a=n[0],o=n[1];"string"!=typeof o&&null!==o||(e[a]=gt({element:t.node,name:a,value:o,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(s=this.generatedAttributes.get(t.node))||void 0===s?void 0:s.has(a)}))}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!r.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:e};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(y.texts.length||y.attributes.length||y.removes.length||y.adds.length)&&this.mutationCb(y)}),X(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),X(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(k.childNodes(t),t=>k.textContent(t)||"").join("");e.attributes.value=vt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:yt(t),value:r,maskInputFn:this.maskInputFn})}),X(this,"processMutation",t=>{if(!le(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=k.textContent(t.target);ue(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:$t(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,oe(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r,i=t.target,n=t.attributeName,s=null!==(r=t.attributeNamespace)&&void 0!==r?r:null,a=function(t,e,r){if(!r)return e;var i=t.getAttributeNodeNS(r,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(r);return n?n+":"+e:e}(i,n,s),o=s?i.getAttributeNS(s,n):t.target.getAttribute(n);if("value"===a){var u=i,l=yt(u);o=vt({element:u,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:l,value:o,maskInputFn:this.maskInputFn})}if(ue(t.target,this.blockClass,this.blockSelector,!1)||o===t.oldValue)return;var h=this.attributeMap.get(t.target),d="IFRAME"===i.tagName&&"src"===a;if(d&&!this.keepIframeSrcFn(o)&&i.contentDocument)return;if(h||(this.attributes.push(h={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,h)),"type"===a&&"INPUT"===i.tagName&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!Pt(i.tagName,a)){var c,v=Lt(this.doc,ft(i.tagName),ft(a),o,i,this.dataURLOptions);if(d&&!this.keepIframeSrcFn(o)&&(a="rr_src"),h.attributes[a]=v,null===(c=this.generatedAttributes.get(t.target))||void 0===c||c.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=i.style;for(var g of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?h.styleDiff[g]=""===y?m:[m,y]:h._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(h.styleDiff[b]=!1)}else if("open"===a&&"DIALOG"===i.tagName){h.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";var w=this.generatedAttributes.get(t.target);w||this.generatedAttributes.set(t.target,w=new Set),w.add("rr_open_mode")}}break;case"childList":if(ue(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=Y(t.target)?this.mirror.getId(k.host(t.target)):this.mirror.getId(t.target);ue(t.target,this.blockClass,this.blockSelector,!1)||le(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Se(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||he(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[_e(r,i)]?Se(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!Y(t.target)||!tt(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),k.childNodes(i).forEach(t=>r.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.add(e))})}}),X(this,"genAdds",(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(le(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[_e(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);if(!ue(t,this.blockClass,this.blockSelector,!1)){if(t.nodeType===t.TEXT_NODE)return;for(var i=k.childNodes(t),n=0,s=i.length;s>n;n++){var a=i[n];a&&this.genAdds(a)}if(fe(t))for(var o=k.childNodes(k.shadowRoot(t)),u=0,l=o.length;l>u;u++){var h=o[u];h&&(this.processedNodeManager.add(h,this),this.genAdds(h,t))}}}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]}),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(var t of this.mapRemoves)this.mapRemoves.delete(t),this.mirror.removeNodeFromMap(t)}isBlockedAtEmission(t){for(var e=this.blockClass,r=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;t;){if(r&&(r.lastIndex=0),ue(t,r||e,this.blockSelector,!0))return!0;var i="getRootNode"in t?k.getRootNode(t):null;t=(null==i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?k.host(i):null}return!1}};function Se(t,e){for(var r=[e];r.length;){var i=r.pop();if(t.delete(i),i.nodeType!==i.TEXT_NODE)for(var n=k.childNodes(i),s=0,a=n.length;a>s;s++){var o=n[s];o&&r.push(o)}}}function Me(t,e,r){return 0!==t.size&&function(t,e){var r=k.parentNode(e);return!!r&&t.has(r)}(t,e)}function Ce(t,e){if(0===t.size)return!1;for(var r=k.parentNode(e);r;){if(t.has(r))return!0;r=k.parentNode(r)}return!1}var Ie=function(t,e){return void 0===e&&(e="rrweb"),be?function(){try{return t(...arguments)}catch(t){if(be&&!0===be(t,e))return;throw t}}:t},Re=[];function Ae(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 xe(t,e){var r,i=new ke;i.init(t);try{r=new(w())(Ie(i.processMutations.bind(i)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),r.observe(e,n),Re.push(i),{observer:r,buffer:i}}catch(t){try{null==r||r.disconnect(),i.destroy(),i.reset()}catch(t){}throw t}}function Te(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,u=t=>{var a=Ae(t);if(a&&!ue(a,n,s,!0)){var u,l,h=i.getId(a);if(a===r&&r.defaultView){var d=ne(r.defaultView);u=d.left,l=d.top}else u=a.scrollLeft,l=a.scrollTop;var c=u+","+l;o.get(h)!==c&&(o.set(h,c),e({id:h,x:u,y:l}))}},l=[Jt("scroll",Ie(ee(Ie(t=>u(t)),a.scroll||100)),r)];return"onscrollend"in r&&l.push(Jt("scrollend",Ie(u),r)),()=>l.forEach(t=>t())}function Ee(t,e){for(var r=Re.length-1;r>=0;r--){var i=Re[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),Re.splice(r,1))}}}var Oe=["INPUT","TEXTAREA","SELECT"],Fe=new WeakMap;function De(t){return function t(e,r){if(Be("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Be("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Be("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Be("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 Ne(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function Le(t,e){var r,i,n,s=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:k.host(e));var a="#document"===e.nodeName?null===(r=e.defaultView)||void 0===r?void 0:r.Document:null===(i=e.ownerDocument)||void 0===i||null===(i=i.defaultView)||void 0===i?void 0:i.ShadowRoot,o=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&a&&o?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get(){var t;return null===(t=o.get)||void 0===t?void 0:t.call(this)},set(t){var e;try{var r;e=null===(r=o.set)||void 0===r?void 0:r.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==n&&-1!==n)try{s.adoptStyleSheets(t,n)}catch(t){}return e}}),Ie(()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:o.get,set:o.set})})):()=>{}}function Pe(t,e){void 0===e&&(e={});var r,o,l=t.doc.defaultView;if(!l)return()=>{};!function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,a=t.viewportResizeCb,o=t.inputCb,u=t.mediaInteractionCb,l=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,c=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),c(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e);var h=[],d=Ie(()=>{try{if(o)try{o.destroy(),o.reset()}finally{var e=Re.indexOf(o);-1!==e&&Re.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==r||r.disconnect()}finally{Kt(h)}});try{if(t.recordDOM){var c=xe(t,t.doc);r=c.observer,o=c.buffer}if(h.push(function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,s=t.mirror;if(!1===r.mousemove)return()=>{};var a,o="number"==typeof r.mousemove?r.mousemove:50,u="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],h=ee(Ie(t=>{var r=Date.now()-a;e(l.map(t=>(t.timeOffset-=r,t)),t),l=[],a=null}),u),d=Ie(ee(Ie(t=>{var e=Ae(t),r=de(t)?t.changedTouches[0]:t,i=r.clientX,o=r.clientY;a||(a=ie()),l.push({x:i,y:o,id:s.getId(e),timeOffset:ie()-a}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?n.Drag:t instanceof MouseEvent?n.MouseMove:n.TouchMove)}),o,{trailing:!1})),c=[Jt("mousemove",d,i),Jt("touchmove",d,i),Jt("drag",d,i)];return Ie(()=>{c.forEach(t=>t())})}(t)),h.push(function(t){var e=t.mouseInteractionCb,r=t.doc,n=t.mirror,o=t.blockClass,u=t.blockSelector,l=t.sampling;if(!1===l.mouseInteraction)return()=>{};var h=!0===l.mouseInteraction||void 0===l.mouseInteraction?{}:l.mouseInteraction,d=[],c=null;return Object.keys(s).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==h[t]).forEach(t=>{var l=ft(t),h=(t=>r=>{var l=Ae(r);if(!ue(l,o,u,!0)){var h=null,d=t;if("pointerType"in r){switch(r.pointerType){case"mouse":h=a.Mouse;break;case"touch":h=a.Touch;break;case"pen":h=a.Pen}h===a.Touch&&(s[t]===s.MouseDown?d="TouchStart":s[t]===s.MouseUp&&(d="TouchEnd"))}else de(r)&&(h=a.Touch);null!==h?(c=h,(d.startsWith("Touch")&&h===a.Touch||d.startsWith("Mouse")&&h===a.Mouse)&&(h=null)):s[t]===s.Click&&(h=c,c=null);var v=de(r)?r.changedTouches[0]:r;if(v){var f=n.getId(l),p=v.clientX,g=v.clientY;Ie(e)(i({type:s[d],id:f,x:p,y:g},null!==h&&{pointerType:h}))}}})(t);if(window.PointerEvent)switch(s[t]){case s.MouseDown:case s.MouseUp:l=l.replace("mouse","pointer");break;case s.TouchStart:case s.TouchEnd:return}d.push(Jt(l,h,r))}),Ie(()=>{d.forEach(t=>t())})}(t)),h.push(Te(t)),h.push(function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,s=-1;return Jt("resize",Ie(ee(Ie(()=>{var t=se(),e=ae();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)}),200)),i)}(t,{win:l})),h.push(function(t){var e=t.inputCb,r=t.doc,n=t.mirror,s=t.blockClass,a=t.blockSelector,o=t.ignoreClass,u=t.ignoreSelector,l=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function c(t){var e=Ae(t),i=t.isTrusted,n=r.defaultView;if(!e||!n||e instanceof n.HTMLElement){var c=e&&e.tagName;if(e&&"OPTION"===c&&(e=k.parentElement(e)),e&&c&&Oe.indexOf(c)>=0&&!ue(e,s,a,!0)&&!(e.classList.contains(o)||u&&e.matches(u))){var f=e.value,p=!1,g=yt(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[c.toLowerCase()]||l[g])&&(f=vt({element:e,maskInputOptions:l,tagName:c,type:g,value:f,maskInputFn:h})),v(e,d?{text:f,isChecked:p,userTriggered:i}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&r.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach(t=>{if(t!==e){var r=t.value;v(t,d?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}})}}}function v(t,r){var s=Fe.get(t);if(!s||s.text!==r.text||s.isChecked!==r.isChecked){Fe.set(t,r);var a=n.getId(t);Ie(e)(i({},r,{id:a}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map(t=>Jt(t,Ie(c),r)),p=r.defaultView;if(!p)return()=>{f.forEach(t=>t())};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map(t=>re(t[0],t[1],{set(){Ie(c)({target:this,isTrusted:!1})}},!1,p))),Ie(()=>{Kt(f)})}(t)),h.push(function(t){var e=t.mediaInteractionCb,r=t.blockClass,i=t.blockSelector,n=t.mirror,s=t.sampling,a=t.doc,o=Ie(t=>ee(Ie(s=>{var a=Ae(s);if(a&&!ue(a,r,i,!0)){var o=a.currentTime,u=a.volume,l=a.muted,h=a.playbackRate,d=a.loop;e({type:t,id:n.getId(a),currentTime:o,volume:u,muted:l,playbackRate:h,loop:d})}}),s.media||500)),l=[Jt("play",o(u.Play),a),Jt("pause",o(u.Pause),a),Jt("seeked",o(u.Seeked),a),Jt("volumechange",o(u.VolumeChange),a),Jt("ratechange",o(u.RateChange),a)];return Ie(()=>{l.forEach(t=>t())})}(t)),t.recordDOM){var v=function(t){var e=new Map,r=new Set,i=!0,n=t=>{if(i)try{t()}catch(t){}},s=t=>{var r,i=e.get(t);if(i){for(;null===(r=i[0])||void 0===r?void 0:r.ready;){var s=i.shift();(null==s?void 0:s.emit)&&n(s.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,r){if(t){var i=e.get(t);i?(i.push({emit:r,ready:!0}),s(t)):n(r)}else n(r)},queuePendingMutation(a,o,u){if(!i)return()=>{};var l=e.get(a);l||e.set(a,l=[]);var h={emit:o,ready:!1};l.push(h);var d,c=!1,v=!1,f=()=>{c||v||(c=!0,void 0!==d&&r.delete(d),h.ready=!0,h.emit=void 0,s(a))};try{d=t.setTimeout(f,5e3),c||v?t.clearTimeout(d):r.add(d)}catch(t){f()}return e=>{!v&&i&&(v=!0,void 0!==d&&(t.clearTimeout(d),r.delete(d)),c?e&&n(u):(h.ready=!0,e||(h.emit=void 0),s(a)))}},reset(){i=!1,r.forEach(e=>t.clearTimeout(e)),r.clear(),e.clear()}}}(l);h.push(v.reset),h.push(function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,s=e.win,a=e.mutationQueue;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ie((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=Ne(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,()=>r({id:h,styleId:d,adds:[{rule:o,index:u}]})),u},"host")}),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 u,l,h=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:Ie((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=Ne(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,()=>r({id:h,styleId:d,removes:[{index:o}]})),u},"host")}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(u=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:Ie((t,e,s)=>{var o=s[0],u=t.apply(e,s);try{var l=null==u?void 0:u.then;if(e.ownerNode||!u||"function"!=typeof l)return u;n.onCssomSheetMutation(e);var h=Ne(e,i,n.styleMirror),d=h.id,c=h.styleId;if(!(d&&-1!==d||c&&-1!==c))return u;var v=a.queuePendingMutation(e,()=>r({id:d,styleId:c,replace:o}),()=>{var t=nt(e);null!==t&&r({id:d,styleId:c,replace:t})});try{l.call(u,()=>v(!0),()=>v(!1))}catch(t){v(!1)}}catch(t){}return u},"host")})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ie((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e);var l=Ne(e,i,n.styleMirror),h=l.id,d=l.styleId;return(h&&-1!==h||d&&-1!==d)&&a.queueMutation(e,()=>r({id:h,styleId:d,replaceSync:o})),u},"host")}));var d={};$e("CSSGroupingRule")?d.CSSGroupingRule=s.CSSGroupingRule:($e("CSSMediaRule")&&(d.CSSMediaRule=s.CSSMediaRule),$e("CSSConditionRule")&&(d.CSSConditionRule=s.CSSConditionRule),$e("CSSSupportsRule")&&(d.CSSSupportsRule=s.CSSSupportsRule));var c={};return Object.entries(d).forEach(t=>{var e=t[0],s=t[1];c[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Ie((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var l=Ne(e.parentStyleSheet,i,n.styleMirror),h=l.id,d=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var c=[...De(e),u];a.queueMutation(e.parentStyleSheet,()=>r({id:h,styleId:d,adds:[{rule:o,index:c}]}))}return u},"host")}),s.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Ie((t,e,s)=>{var o=s[0],u=t.apply(e,s);n.onCssomSheetMutation(e.parentStyleSheet);var l=Ne(e.parentStyleSheet,i,n.styleMirror),h=l.id,d=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||d&&-1!==d)){var c=[...De(e),o];a.queueMutation(e.parentStyleSheet,()=>r({id:h,styleId:d,removes:[{index:c}]}))}return u},"host")})}),Ie(()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=h,u&&(s.CSSStyleSheet.prototype.replace=u),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(d).forEach(t=>{var e=t[0],r=t[1];r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule})})}(t,{win:l,mutationQueue:v})),h.push(Le(t,t.doc)),h.push(function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=e.mutationQueue,u=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:Ie((t,e,a)=>{var u,l=a[0],h=a[1],d=a[2],c=t.apply(e,a);if(n.has(l))return c;var v=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;s.onCssomSheetMutation(v);var f=Ne(v,i,s.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=De(e.parentRule);o.queueMutation(v,()=>r({id:p,styleId:g,set:{property:l,value:h,priority:d},index:m}))}return c},"host")});var l=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ie((t,e,a)=>{var u,l=a[0],h=t.apply(e,a);if(n.has(l))return h;var d=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;s.onCssomSheetMutation(d);var c=Ne(d,i,s.styleMirror),v=c.id,f=c.styleId;if(v&&-1!==v||f&&-1!==f){var p=De(e.parentRule);o.queueMutation(d,()=>r({id:v,styleId:f,remove:{property:l},index:p}))}return h},"host")}),Ie(()=>{a.CSSStyleDeclaration.prototype.setProperty=u,a.CSSStyleDeclaration.prototype.removeProperty=l})}(t,{win:l,mutationQueue:v})),t.collectFonts&&h.push(function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,a=i.FontFace;i.FontFace=function(t,e,r){var i=new a(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var o=_(r.fonts,"add",function(t){return function(r){return setTimeout(Ie(()=>{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),Ie(()=>{n.forEach(t=>t())})}(t))}for(var f of(h.push(function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,s=t.selectionCb,a=!0,o=Ie(()=>{var t=e.getSelection();if(!(!t||a&&(null==t?void 0:t.isCollapsed))){a=t.isCollapsed||!1;for(var o=[],u=t.rangeCount||0,l=0;u>l;l++){var h=t.getRangeAt(l),d=h.startContainer,c=h.startOffset,v=h.endContainer,f=h.endOffset;ue(d,i,n,!0)||ue(v,i,n,!0)||o.push({start:r.getId(d),startOffset:c,end:r.getId(v),endOffset:f})}s({ranges:o})}});return o(),Jt("selectionchange",o)}(t)),h.push(function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?_(r.customElements,"define",function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}}):()=>{}}(t)),t.plugins))h.push(f.observer(f.callback,l,f.options))}catch(t){try{d()}catch(t){}throw t}return d}function Be(t){return void 0!==window[t]}function $e(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var je=class{constructor(t){X(this,"generateIdFn",void 0),X(this,"iframeRemoteIdToLocalIdMap",new WeakMap),X(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){if(0>e)return e;var n=r||this.getRemoteIdToLocalIdMap(t),s=i||this.getLocalIdToRemoteIdMap(t),a=n.get(e);return void 0===a&&(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}getIds(t,e){var r=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,r,i))}getRemoteId(t,e,r){var i;return"number"!=typeof e||0>e?e:null!==(i=(r||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){var r=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,r))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}},We=class{constructor(t){X(this,"iframes",new WeakMap),X(this,"crossOriginIframeMap",new WeakMap),X(this,"crossOriginIframeMirror",new je(xt)),X(this,"crossOriginIframeStyleMirror",void 0),X(this,"crossOriginIframeRootIdMap",new WeakMap),X(this,"mirror",void 0),X(this,"mutationCb",void 0),X(this,"wrappedEmit",void 0),X(this,"loadListener",void 0),X(this,"pageHideListener",void 0),X(this,"stylesheetManager",void 0),X(this,"recordCrossOriginIframes",void 0),X(this,"messageHandler",void 0),X(this,"nestedIframeListeners",new Map),X(this,"attachedWindows",new WeakMap),X(this,"attachedDocuments",new WeakMap),X(this,"attachedIframes",new Map),X(this,"loadListenerDisposers",new WeakMap),X(this,"iframeElementsById",new Map),X(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new je(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>Xt(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach(t=>{Qt(t.win,"pagehide",t.handler)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var a=this.handleMessage.bind(this);Xt(()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)})}Xt(()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}}),null===(r=this.loadListener)||void 0===r||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,r){switch(r.type){case e.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);var i=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(r.data.node,i),this.trackIframeContent(t,r.data.node),{timestamp:r.timestamp,type:e.IncrementalSnapshot,data:{source:n.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case e.Meta:case e.Load:case e.DomContentLoaded:return!1;case e.Plugin:return r;case e.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case e.IncrementalSnapshot:switch(r.data.source){case n.Mutation:return r.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)}),r.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),r.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),r.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),r;case n.Drag:case n.TouchMove:case n.MouseMove:return r.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),r;case n.ViewportResize:return!1;case n.MediaInteraction:case n.MouseInteraction:case n.Scroll:case n.CanvasMutation:case n.Input:return this.replaceIds(r.data,t,["id"]),r;case n.StyleSheetRule:case n.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case n.Font:return r;case n.Selection:return r.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),r;case n.AdoptedStyleSheet:var s;return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),null===(s=r.data.styles)||void 0===s||s.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),r}}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===l.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach(t=>{var e=this.nestedIframeListeners.get(t);e&&(Qt(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(Qt(i,"message",this.nestedIframeListeners.get(i)),this.nestedIframeListeners.delete(i)),i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var s=this.attachedDocuments.get(r);s&&(s.forEach(t=>{Xt(()=>this.mirror.removeNodeFromMap(t))}),Xt(()=>Ee(r,s)),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach((e,r)=>{this.mirror.has(r)||t.push(r)}),t.forEach(t=>this.removeIframeById(t))}}reattachIframes(){this.attachedIframes.forEach((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&Qt(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{Qt(e,"message",t)}),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(e=>t.add(e.element)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},ze=class{constructor(t){X(this,"shadowDoms",new WeakSet),X(this,"mutationCb",void 0),X(this,"scrollCb",void 0),X(this,"bypassOptions",void 0),X(this,"mirror",void 0),X(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){var r,n;if(tt(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(r=null===(n=k.host(t))||void 0===n?void 0:n.ownerDocument)&&void 0!==r?r:e,a=xe(i({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),o=a.observer,u=a.buffer;this.restoreHandlers.push({doc:s,handler(){o.disconnect(),u.destroy(),u.releaseCanvasManager();var t=Re.indexOf(u);-1!==t&&Re.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:Te(i({},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(k.host(t))),this.restoreHandlers.push({doc:s,handler:Le({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})},0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push({doc:e,handler:_(t.prototype,"attachShadow",function(t){return function(i){var n=t.call(this,i),s=k.shadowRoot(this);return s&&me(this)&&r.addShadowRoot(s,e),n}})})}reset(){this.restoreHandlers.forEach(t=>{var e=t.handler;try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}},Ue="skip-frame";function He(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ge="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ve=0;64>Ve;Ve++)Ge[qe.charCodeAt(Ve)]=Ve;var Ze=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=qe[r[e]>>2],n+=qe[(3&r[e])<<4|r[e+1]>>4],n+=qe[(15&r[e+1])<<2|r[e+2]>>6],n+=qe[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},Je=new Map,Qe=(t,e,r)=>{if(t&&(Ye(t,e)||"object"==typeof t)){var i=function(t,e){var r=Je.get(t);return r||Je.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 Xe(t,e,r,i){return t instanceof Array?t.map(t=>Xe(t,e,r,i)):null===t?t: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?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:Ze(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[Xe(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Xe(t.data,e,r,i),t.width,t.height]}:Ye(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Qe(t,e,r)}:t}var Ke=(t,e,r,i)=>t.map(t=>Xe(t,e,r,i)),Ye=(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]))},tr=["webgl","webgl2"];function er(t){return"nodeType"in t}function rr(t,e,r,n){var s=[];try{if(n){var a=function(t,e,r){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return _(n.prototype,"configure",function(n){return function(s){var a=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!a||er(a)&&ue(a,e,r,!0))return n.call(this,s);er(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?i({},s,{usage:"number"==typeof s.usage?s.usage|o:o}):s)}})}(t,e,r);a&&s.push(a)}var o=_(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(i){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(i),a=arguments.length,o=new Array(a>1?a-1:0),u=1;a>u;u++)o[u-1]=arguments[u];if(!ue(this,e,r,!0)&&("__context"in this||(this.__context=s),n&&tr.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,[i,...o])}});s.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(t=>t())}}function ir(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=_(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(Qe(d,s,this),this.canvas&&"tagName"in this.canvas&&!ue(this.canvas,i,n,!0)){var c={type:e,property:u,args:Ke(l,s,this,a)};r(this.canvas,c)}return d}});o.push(l)}catch(s){var h=re(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!ue(this.canvas,i,n,!0)&&r(this.canvas,{type:e,property:u,args:[t],setter:!0})}});o.push(h)}};for(var h of u)l(h);return o}var nr='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',sr="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",nr],{type:"text/javascript;charset=utf-8"});function ar(t){var e;try{if(!(e=sr&&(self.URL||self.webkitURL).createObjectURL(sr)))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(nr),{name:null==t?void 0:t.name})}}var or,ur,lr,hr=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){X(this,"pendingCanvasMutations",new Map),X(this,"rafStamps",{latestId:0,invokeId:null}),X(this,"mirror",void 0),X(this,"mutationCb",void 0),X(this,"resetObservers",void 0),X(this,"frozen",!1),X(this,"locked",!1),X(this,"rafIdTimestamp",null),X(this,"rafIdFlush",null),X(this,"refCount",0),X(this,"torndown",!1),X(this,"resetFrameDedup",null),X(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});var e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,s=t.blockSelector,a=t.recordCanvas,o=t.dataURLOptions,u=t.resolutionScale,l=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===r&&this.initCanvasMutationObserver(i,n,s,o),a&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,s,{dataURLOptions:o,resolutionScale:u,canvasMasking:l})}initCanvasFPSObserver(t,e,i,n,s){var a=this;if("OffscreenCanvas"in e){var u,l="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,h=rr(e,i,n,!0),d=new Map;try{u=new ar}catch(t){return}var c=!1;u.onerror=()=>{var t;c=!0,cancelAnimationFrame(v),null===(t=u.terminate)||void 0===t||t.call(u),this.resetFrameDedup=null},this.resetFrameDedup=()=>{u.postMessage({resetFrameDedup:!0})},u.onmessage=t=>{var e=t.data.id;if(d.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:o["2D"],commands:[{property:"clearRect",args:[0,0,i,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r.base64}],type:r.type}]},0,0,i,n]}],displayWidth:i,displayHeight:n})}};var v,f=1e3/t,p=0,g=t=>{var o,h;c||(p&&f>t-p||(p=t,(o=[],h=t=>{try{t.querySelectorAll("canvas").forEach(t=>{ue(t,i,n,!0)||o.push(t)}),t.querySelectorAll("*").forEach(t=>{t.shadowRoot&&h(t.shadowRoot)})}catch(t){}},h(e.document),o).forEach(function(){var t=r(function*(t){var e=a.mirror.getId(t);if(!d.get(e)&&0!==t.width&&0!==t.height){d.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var r,i,n=t.getContext(t.__context);if(null==n||null===(r=n.isContextLost)||void 0===r?void 0:r.call(n))return void d.set(e,!1);!1===(null==n||null===(i=n.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var o=t.clientWidth||t.width,h=t.clientHeight||t.height,c=Math.max(1,Math.round(o*l)),v=Math.max(1,Math.round(h*l)),f=function(t,e,r,i,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return Ue}if(void 0!==a){if(!Array.isArray(a)||!a.every(He))return Ue;var o=r/n,u=i/s;return a.filter(t=>t.width>0&&t.height>0).map(t=>{var e=Math.floor(t.x*o),r=Math.floor(t.y*u);return{x:e,y:r,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*u)-r}})}}}(s.canvasMasking,t,c,v,o,h);if("skip-frame"===f)return void d.set(e,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:c,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:c,resizeHeight:v});u.postMessage({id:e,bitmap:p,width:c,height:v,displayWidth:o,displayHeight:h,dataURLOptions:s.dataURLOptions,maskRegions:f},[p])}catch(t){d.set(e,!1)}}});return function(e){return t.apply(this,arguments)}}())),v=requestAnimationFrame(g))};v=requestAnimationFrame(g),this.resetObservers=()=>{var t;h(),cancelAnimationFrame(v),null===(t=u.terminate)||void 0===t||t.call(u),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=rr(t,e,r,!1),s=function(t,e,r,i,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),u=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var u=_(e.CanvasRenderingContext2D.prototype,a,function(s){return function(){for(var u=arguments.length,l=new Array(u),h=0;u>h;h++)l[h]=arguments[h];return ue(this.canvas,r,i,!0)||setTimeout(()=>{var r=Ke(l,e,this,n);t(this.canvas,{type:o["2D"],property:a,args:r})},0),s.apply(this,l)}});s.push(u)}catch(n){var l=re(e.CanvasRenderingContext2D.prototype,a,{set(e){ue(this.canvas,r,i,!0)||t(this.canvas,{type:o["2D"],property:a,args:[e],setter:!0})}});s.push(l)}};for(var l of a)if(u(l))continue;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(...ir(e.WebGLRenderingContext.prototype,o.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...ir(e.WebGL2RenderingContext.prototype,o.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(e,r){if(!this.frozen&&!this.locked){var i=this.pendingCanvasMutations.get(e);if(i&&-1!==r){var n=i.map(e=>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}(e,t));this.mutationCb({id:r,type:i[0].type,commands:n}),this.pendingCanvasMutations.delete(e)}}}},dr=class{constructor(t){var e;X(this,"trackedLinkElements",new WeakSet),X(this,"pendingDeferredSheets",new Set),X(this,"mutationCb",void 0),X(this,"adoptedStyleSheetCb",void 0),X(this,"maskAllElementAttributes",void 0),X(this,"maskAttributeFn",void 0),X(this,"styleMirror",new pe),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var r=null,i=null;try{(i=t.sheet)&&(r=dt(i))}catch(t){}if(!r||!i)return Z(),null;var n=r,s=!1,a={sheet:i,invalidate(){s=!0}};this.pendingDeferredSheets.add(a);var o=!1;return{advance:r=>{if(o)return!0;var u,l,h=S(),d=R(),c=!0;try{if(s)return o=!0,Z(),!0;if(!n.advance(r))return c=!1,!1;o=!0;var v=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==i?(Z(),!0):v?(this.emitCssTextMutation(t,e,v),!0):(Z(),!0)}finally{c&&this.pendingDeferredSheets.delete(a),A(u=S()-h,null!=(l=d)?l:M)||(j.totalMs+=u,u>j.slowestSliceMs&&(j.slowestSliceMs=u))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(a)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var r;null===(r=this.beginDeferredLinkInlining(t,e))||void 0===r||r.advance(1/0)}emitCssTextMutation(t,e,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:gt({element:t,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}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;if(r.styleMirror.has(t))e=r.styleMirror.getId(t);else{var s=r.styleMirror.add(t);e=s;var a=S();try{q(()=>{try{var e=t.rules||t.cssRules;e&&H(e)}catch(t){}n.push({styleId:s,rules:Array.from(t.rules||CSSRule,(e,r)=>({rule:st(e,t.href),index:r}))})})}finally{G(S()-a)}}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,this.pendingDeferredSheets.clear(),Wt.forEach(t=>t.abort()),Wt.clear()}trackStylesheetInLinkElement(t){}},cr=class{constructor(){X(this,"nodeMap",new WeakMap),X(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(){}},vr=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var fr,pr=document.createElement("iframe");document.body.appendChild(pr),Array.from=(null===(fr=pr.contentWindow)||void 0===fr?void 0:fr.Array.from)||Array.from,document.body.removeChild(pr)}}catch(t){console.debug("Unable to override Array.from",t)}var gr=new ct,mr=new Set([n.Mutation,n.MediaInteraction,n.StyleSheetRule,n.CanvasMutation,n.Font,n.Log,n.StyleDeclaration,n.AdoptedStyleSheet]);function yr(t){var e=window;if("function"==typeof e.requestIdleCallback){var r=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,r)}}}var i=setTimeout(t,250);return{cancel:()=>clearTimeout(i)}}function br(t){var r;void 0===t&&(t={});var s=t,a=s.emit,o=s.checkoutEveryNms,u=s.checkoutEveryNth,l=s.blockClass,h=void 0===l?"rr-block":l,d=s.blockSelector,c=void 0===d?null:d,v=s.ignoreClass,f=void 0===v?"rr-ignore":v,p=s.ignoreSelector,g=void 0===p?null:p,m=s.maskTextClass,y=void 0===m?"rr-mask":m,b=s.maskTextSelector,w=void 0===b?null:b,_=s.inlineStylesheet,S=void 0===_||_,M=s.inlineStylesheetBudgetRules,C=s.maskAllInputs,R=s.maskInputOptions,A=s.slimDOMOptions,x=s.maskInputFn,T=s.maskTextFn,E=s.maskAllElementAttributes,O=void 0!==E&&E,F=s.maskAttributeFn,D=s.hooks,L=s.packFn,P=s.sampling,B=void 0===P?{}:P,j=s.dataURLOptions,U=void 0===j?{}:j,H=s.canvasResolutionScale,q=s.canvasMasking,G=s.mousemoveWait,V=s.recordDOM,Z=void 0===V||V,Q=s.recordCanvas,X=void 0!==Q&&Q,K=s.recordCrossOriginIframes,Y=void 0!==K&&K,tt=s.recordAfter,et=void 0===tt?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":tt,rt=s.userTriggeredOnInput,it=void 0!==rt&&rt,nt=s.collectFonts,st=void 0!==nt&&nt,at=s.inlineImages,ot=void 0!==at&&at,ut=s.plugins,lt=s.keepIframeSrcFn,ht=void 0===lt?()=>!1:lt,dt=s.ignoreCSSAttributes,vt=void 0===dt?new Set([]):dt,ft=s.attributeFilter;be=s.errorHandler;var pt=i({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},U),gt=!Y||window.parent===window,mt=!1;if(!gt)try{window.parent.document&&(mt=!1)}catch(t){mt=!0}if(gt&&!a)throw new Error("emit function is required");if(!gt&&!mt)return()=>{};void 0!==G&&void 0===B.mousemove&&(B.mousemove=G),gr.reset();var yt,bt=!0===C?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==R?R:{password:!0},wt=Vt(void 0!==A&&A);!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 _t,kt,St=0,Mt=new Map,Ct=t=>{for(var e of ut||[])e.eventProcessor&&(t=e.eventProcessor(t));return L&&!mt&&(t=L(t)),t};or=(t,r)=>{var i,s=t;if(s.timestamp=ie(),!(null===(i=Re[0])||void 0===i?void 0:i.isFrozen())||s.type===e.FullSnapshot||s.type===e.IncrementalSnapshot&&mr.has(s.data.source)||Re.forEach(t=>t.unfreeze()),gt)null==a||a(Ct(s),r);else if(mt){var l={type:"rrweb",event:Ct(s),origin:window.location.origin,isCheckout:r};window.parent.postMessage(l,"*")}if(s.type===e.FullSnapshot)yt=s,St=0;else if(s.type===e.IncrementalSnapshot){if(s.data.source===n.Mutation&&s.data.isAttachIframe)return;St++,(u&&St>=u||o&&s.timestamp-yt.timestamp>o)&&ur(!0)}};var It=t=>{if(t.removes&&t.removes.length>0){var r=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,s=new Set;if(t.adds.length>0)for(var a of t.adds){var o=gr.getNode(a.node.id);o&&"IFRAME"===o.nodeName&&s.add(o)}t.removes.forEach(t=>{var e=t.id;if(!r||!r.has(e)){var i=Tt.getIframeElementById(e);i&&s.has(i)?Tt.forgetIframeId(e):(null==_t||_t(e),Tt.removeIframeById(e))}}),null==kt||kt(),Tt.cleanupDetachedIframes()}or({type:e.IncrementalSnapshot,data:i({source:n.Mutation},t)})},Rt=t=>or({type:e.IncrementalSnapshot,data:i({source:n.Scroll},t)}),At=t=>or({type:e.IncrementalSnapshot,data:i({source:n.CanvasMutation},t)}),xt=new dr({mutationCb:It,adoptedStyleSheetCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.AdoptedStyleSheet},t)}),maskAllElementAttributes:O,maskAttributeFn:F}),Tt=new We({mirror:gr,mutationCb:It,stylesheetManager:xt,recordCrossOriginIframes:Y,wrappedEmit:or});for(var Et of ut||[])Et.getMirror&&Et.getMirror({nodeMirror:gr,crossOriginIframeMirror:Tt.crossOriginIframeMirror,crossOriginIframeStyleMirror:Tt.crossOriginIframeStyleMirror});var Ot=new cr,Ft=null==q?void 0:q.configured;lr=new hr({recordCanvas:X,mutationCb:At,win:window,blockClass:h,blockSelector:c,mirror:gr,sampling:B.canvas,dataURLOptions:pt,resolutionScale:H,canvasMasking:q});var Dt=new ze({mutationCb:It,scrollCb:Rt,bypassOptions:{blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:w,inlineStylesheet:S,maskInputOptions:bt,dataURLOptions:pt,maskTextFn:T,maskInputFn:x,maskAllElementAttributes:O,maskAttributeFn:F,recordCanvas:X,canvasMaskingConfigured:Ft,inlineImages:ot,sampling:B,slimDOMOptions:wt,iframeManager:Tt,stylesheetManager:xt,canvasManager:lr,keepIframeSrcFn:ht,processedNodeManager:Ot,attributeFilter:ft},mirror:gr});ur=function(t){if(void 0===t&&(t=!1),Z){W(M);try{or({type:e.Meta,data:{href:window.location.href,width:ae(),height:se()}},t),null==r||r.cancel(),r=void 0,xt.reset(),Dt.init(),Re.forEach(t=>t.lock());var i,n=null;try{n=function(t,e){var r=e||{},i=r.mirror,n=void 0===i?new ct:i,s=r.blockClass,a=void 0===s?"rr-block":s,o=r.blockSelector,u=void 0===o?null:o,l=r.maskTextClass,h=void 0===l?"rr-mask":l,d=r.maskTextSelector,c=void 0===d?null:d,v=r.inlineStylesheet,f=void 0===v||v,p=r.inlineImages,g=void 0!==p&&p,m=r.recordCanvas,y=void 0!==m&&m,b=r.canvasMaskingConfigured,w=r.maskAllInputs,_=void 0!==w&&w,k=r.maskTextFn,S=r.maskInputFn,M=r.maskAllElementAttributes,C=void 0!==M&&M,I=r.maskAttributeFn,R=r.slimDOM,A=r.dataURLOptions,x=r.preserveWhiteSpace,T=r.onSerialize,E=r.onIframeLoad,O=r.iframeLoadTimeout,F=r.onIframeListenerRegistered,D=r.onStylesheetLoad,N=r.stylesheetLoadTimeout,L=r.keepIframeSrcFn,P=void 0===L?()=>!1:L,B=r.maxDepth,j=r.inlineStylesheetBudgetRules,U=!0===_?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===_?{password:!0}:_,H=Vt(void 0!==R&&R);W(j);try{return Gt(t,{doc:t,mirror:n,blockClass:a,blockSelector:u,maskTextClass:h,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:U,maskTextFn:k,maskInputFn:S,maskAllElementAttributes:C,maskAttributeFn:I,slimDOMOptions:H,dataURLOptions:A,inlineImages:g,recordCanvas:y,canvasMaskingConfigured:b,preserveWhiteSpace:x,onSerialize:T,onIframeLoad:E,iframeLoadTimeout:O,onIframeListenerRegistered:F,onStylesheetLoad:D,stylesheetLoadTimeout:N,keepIframeSrcFn:P,newlyAddedElement:!1,maxDepth:B})}finally{z()}}(document,{mirror:gr,blockClass:h,blockSelector:c,maskTextClass:y,maskTextSelector:w,inlineStylesheet:S,maskAllInputs:bt,inlineStylesheetBudgetRules:M,maskTextFn:T,maskInputFn:x,maskAllElementAttributes:O,maskAttributeFn:F,slimDOM:wt,dataURLOptions:pt,recordCanvas:X,canvasMaskingConfigured:Ft,inlineImages:ot,onSerialize(t){ce(t,gr)&&Tt.addIframe(t),ve(t,gr)&&xt.trackLinkElement(t),fe(t)&&Dt.addShadowRoot(k.shadowRoot(t),document)},onIframeLoad(t,e){Tt.attachIframe(t,e),Dt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){Tt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){xt.attachLinkElement(t,e)},keepIframeSrcFn:ht})}finally{a=N,N=[],i=a}if(!n)return console.warn("Failed to snapshot the document");if(or({type:e.FullSnapshot,data:{node:n,initialOffset:ne(window)}},t),Re.forEach(t=>t.unlock()),lr.onFullSnapshot(),i.length){var s=function(t,e,r){var i=!1,n=null,s=0,a=null,o=()=>null!==a||t.length>s,u=()=>{var r=t[s];t[s]=null,s+=1,r&&Xt(()=>{a=e.beginDeferredLinkInlining(r,gr.getId(r))})},l=()=>{if(a){var t=a,e=!0;Xt(()=>{e=t.advance(200)}),e&&(a=null)}},h=()=>{a||u(),l()},d=t=>{if(n=null,!i){var e=0;do{try{h()}catch(t){null==a||a.discard(),a=null,J(1)}e+=1}while(!i&&o()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(o()?n=yr(d):r())}};return n=yr(d),{cancel(){i=!0,null==a||a.discard(),a=null,null==n||n.cancel(),n=null},flush(){if(!i){i=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;o()&&50>e;){a||u();var d=a;if(d)if(Math.floor(d.remainingRules()/200)+1>50-e)d.discard(),a=null,h+=1;else{try{l()}catch(t){null==a||a.discard(),a=null,h+=1}e+=1}}if(o()||h>0){for(var c=h+(null!==a?1:0),v=s;t.length>v;v++)null!==t[v]&&(c+=1);J(c),null==a||a.discard(),a=null}r()}}}}(i,xt,()=>{r===s&&(r=void 0)});r=s}Y&&Tt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&xt.adoptStyleSheets(document.adoptedStyleSheets,gr.getId(document))}finally{z()}var a}};try{var Nt=[];for(var Lt of(Nt.push(Jt("pagehide",()=>{try{null==r||r.flush()}catch(t){}r=void 0},window)),["visibilitychange","freeze","resume"]))Nt.push(Jt(Lt,I,document));_t=t=>{var e=Mt.get(t);e&&(e.forEach(t=>{Xt(t);var e=Nt.indexOf(t);-1!==e&&Nt.splice(e,1)}),Mt.delete(t))},kt=()=>{for(var t of Mt){var e=t[0],r=gr.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==_t||_t(e)}catch(t){null==_t||_t(e)}else null==_t||_t(e)}};var Pt=t=>{var r;return Ie(Pe)({mutationCb:It,mousemoveCb:(t,r)=>or({type:e.IncrementalSnapshot,data:{source:r,positions:t}}),mouseInteractionCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.MouseInteraction},t)}),scrollCb:Rt,viewportResizeCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.ViewportResize},t)}),inputCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.Input},t)}),mediaInteractionCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.MediaInteraction},t)}),styleSheetRuleCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.StyleSheetRule},t)}),styleDeclarationCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.StyleDeclaration},t)}),canvasMutationCb:At,fontCb:t=>or({type:e.IncrementalSnapshot,data:i({source:n.Font},t)}),selectionCb(t){or({type:e.IncrementalSnapshot,data:i({source:n.Selection},t)})},customElementCb(t){or({type:e.IncrementalSnapshot,data:i({source:n.CustomElement},t)})},blockClass:h,ignoreClass:f,ignoreSelector:g,maskTextClass:y,maskTextSelector:w,maskInputOptions:bt,inlineStylesheet:S,sampling:B,recordDOM:Z,recordCanvas:X,canvasMaskingConfigured:Ft,inlineImages:ot,userTriggeredOnInput:it,collectFonts:st,doc:t,maskInputFn:x,maskTextFn:T,maskAllElementAttributes:O,maskAttributeFn:F,keepIframeSrcFn:ht,blockSelector:c,slimDOMOptions:wt,dataURLOptions:pt,mirror:gr,iframeManager:Tt,stylesheetManager:xt,shadowDomManager:Dt,processedNodeManager:Ot,canvasManager:lr,ignoreCSSAttributes:vt,attributeFilter:ft,plugins:(null==ut||null===(r=ut.filter(t=>t.observer))||void 0===r?void 0:r.map(t=>({observer:t.observer,options:t.options,callback:r=>or({type:e.Plugin,data:{plugin:t.name,payload:r}})})))||[]},D)};Tt.addLoadListener(t=>{try{var e=gr.getId(t),r=Pt(t.contentDocument);if("function"==typeof r&&(Nt.push(r),-1!==e)){var i=Mt.get(e);i||Mt.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}}),Tt.addPageHideListener(t=>{var e=gr.getId(t);null==_t||_t(e),Ee(t)});var Bt=-1,$t=t=>or({type:e.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),jt=()=>{var t,e,r,i,n=document,s=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,a=s?gr.getId(s):-1;a!==Bt&&(-1!==Bt&&$t({id:Bt,enter:!1}),Bt=a,-1!==a&&$t({id:a,enter:!0}))},Wt=()=>{ur();var t=Pt(document);"function"==typeof t&&Nt.push(t),Nt.push(Jt("fullscreenchange",jt)),Nt.push(Jt("webkitfullscreenchange",jt)),Nt.push(Jt("mozfullscreenchange",jt)),Nt.push(Jt("MSFullscreenChange",jt)),vr=!0};return["interactive","complete"].includes(document.readyState)?Wt():(Nt.push(Jt("DOMContentLoaded",()=>{or({type:e.DomContentLoaded,data:{}}),"DOMContentLoaded"===et&&Wt()})),Nt.push(Jt("load",()=>{or({type:e.Load,data:{}}),"load"===et&&Wt()},window))),()=>{try{null==r||r.flush()}catch(t){}r=void 0,Kt(Nt),Ot.destroy(),Tt.removeLoadListener(),Tt.destroy(),Mt.clear(),Dt.reset(),gr.reset(),vr=!1,be=void 0}}catch(t){console.warn(t)}}br.addCustomEvent=(t,r)=>{if(!vr)throw new Error("please add custom event after start recording");or({type:e.Custom,data:{tag:t,payload:r}})},br.freezePage=()=>{Re.forEach(t=>t.freeze())},br.takeFullSnapshot=t=>{if(!vr)throw new Error("please take full snapshot after start recording");ur(t)},br.mirror=gr,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var wr=Object.create(null);function _r(t){return _r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_r(t)}function kr(t,e,r){return(e=function(t){var e=function(t){if("object"!=_r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=_r(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_r(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}wr.Node=Object.create(null),wr.ShadowRoot=Object.create(null),wr.MutationObserver=Object.create(null),wr.Element=Object.create(null);var Sr=class{constructor(t){kr(this,"fileName",void 0),kr(this,"functionName",void 0),kr(this,"lineNumber",void 0),kr(this,"columnNumber",void 0),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}},Mr=/(^|@)\S+:\d+/,Cr=/^\s*at .*(\S+:\d+|\(native\))/m,Ir=/^(eval@)?(\[native code])?$/,Rr={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Cr)?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(Cr)},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());return new Sr({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(Ir)},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 Sr({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Sr({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 Sr({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 Sr({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(Mr)&&!t.match(/^Error created at/)},this).map(function(t){var e=t.split("@"),r=this.extractLocation(e.pop());return new Sr({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function Ar(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 xr(t){return Array.isArray(t)}function Tr(t){return"object"==typeof t&&null!==t&&!xr(t)}function Er(t,e){if(0===e)return!0;for(var r of Object.keys(t))if(Tr(t[r])&&Er(t[r],e-1))return!0;return!1}function Or(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(Tr(a=e)&&Object.keys(a).length>r.numOfKeysLimit||"function"==typeof a||Tr(a)&&Er(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]=xr(l)?Ar(l.length?l[0]:null):l}return o}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var Fr={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Dr(t,e,r){var i,n=r?Object.assign({},Fr,r):Fr,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var a=0,o=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message;t({level:"error",trace:Rr.parse(e.error).map(t=>t.toString()),payload:[Or(r,n.stringifyOptions)]})};e.addEventListener("error",l),u.push(()=>{e.removeEventListener("error",l)});var h=e=>{var r,i;e.reason instanceof Error?i=[Or("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Or("Uncaught (in promise)",n.stringifyOptions),Or(e.reason,n.stringifyOptions)]),t({level:"error",trace:Rr.parse(r).map(t=>t.toString()),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){try{if(!(s in e))return()=>{};var u=e[s],l={next:u},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=Rr.parse(new Error).map(t=>t.toString()).splice(1),d=("assert"===r?u.slice(1):u).map(t=>Or(t,n.stringifyOptions));a++,n.lengthThreshold>a?t({level:r,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Or("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{o=!1}}})(function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return l.next.apply(this,e)});return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:l}})),e[s]=h,()=>{if(e[s]!==h)for(var t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},r=e[s],i=t(r);i;){if(i.next===h)return void(i.next=l.next);i=t(r=i.next)}else e[s]=l.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var Nr="u">typeof window?window:void 0,Lr="u">typeof globalThis?globalThis:Nr,Pr=null==Lr?void 0:Lr.document,Br=null==Lr?void 0:Lr.location;null!=Lr&&Lr.XMLHttpRequest&&new Lr.XMLHttpRequest;var $r="undefined"!=typeof globalThis?globalThis:Nr;$r&&"undefined"==typeof self&&($r.self=$r),$r&&"undefined"==typeof File&&($r.File=function(){});var jr=null!=Nr?Nr:{},Wr=Object.prototype,zr=Wr.hasOwnProperty,Ur=Wr.toString,Hr=Array.isArray||function(t){return"[object Array]"===Ur.call(t)},qr=t=>"function"==typeof t,Gr=t=>t===Object(t)&&!Hr(t),Vr=t=>void 0===t,Zr=t=>"[object String]"==Ur.call(t),Jr=t=>null===t,Qr=t=>Vr(t)||Jr(t),Xr=t=>"[object Number]"==Ur.call(t)&&t==t,Kr=t=>"[object Boolean]"===Ur.call(t),Yr=t=>t instanceof FormData;function ti(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),Xr(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),ti(null!=n?n:r,e,r,i))}var ei=class{constructor(t){this.C={},this.I=t.I,this.R=ti(t.bucketSize,0,100,t.A),this.O=ti(t.refillRate,0,this.R,t.A),this.N=ti(t.refillInterval,0,864e5,t.A)}F(t,e){var r=Math.floor((e-t.lastAccess)/this.N);r>0&&(t.tokens=Math.min(t.tokens+r*this.O,this.R),t.lastAccess=t.lastAccess+r*this.N)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.C[i];return n?this.F(n,r):this.C[i]=n={tokens:this.R,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}};function ri(t){return t?t.split("#")[0]:t}var ii,ni="NativeGzipValidationError",si=t=>{throw function(t,e){var r=new Error(e);try{Object.defineProperty(r,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return r}(ni,"Native gzip produced invalid output: "+t)},ai=function(){var t=r(function*(t,e){18>t.size&&si("too-short");var r,i=new Uint8Array(yield t.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&si("invalid-header");var n=new DataView(yield t.slice(t.size-8).arrayBuffer());n.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(ii)return ii;ii=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;ii[t]=e>>>0}return ii})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&si("invalid-crc");var s=e.length>>>0;n.getUint32(4,!0)!==s&&si("invalid-size")});return function(e,r){return t.apply(this,arguments)}}();function oi(){return oi=r(function*(t,e,i){void 0===e&&(e=!0);try{var n=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),a=s.writable.getWriter(),o=a.write(n).then(()=>a.close()).catch(function(){var t=r(function*(t){try{yield a.abort(t)}catch(t){}throw t});return function(e){return t.apply(this,arguments)}}()),u=new Response(s.readable).blob(),l=(yield Promise.all([u,o]))[0];return yield ai(l,n),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),oi.apply(this,arguments)}var ui="0.8.2",li={DEBUG:!1,LIB_VERSION:ui,LIB_NAME:"browser-common",JS_SDK_VERSION:ui},hi=function(t,e){var r=(void 0===e?{}:e).debugEnabled,i={q(e){for(var i=arguments.length,n=new Array(i>1?i-1:0),s=1;i>s;s++)n[s-1]=arguments[s];Nr&&(li.DEBUG||Nr.POSTHOG_DEBUG||r)&&!Vr(Nr.console)&&Nr.console&&("__rrweb_original__"in Nr.console[e]?Nr.console[e].__rrweb_original__:Nr.console[e])(t,...n)},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.q("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)=>hi(t+" "+e,r)};return i},di=hi("[PostHog.js]"),ci=di.createLogger;function vi(t,e){if(!Qr(t))if(Hr(t))t.forEach(e);else if(Yr(t))t.forEach((t,r)=>e(t,r));else for(var r in t)zr.call(t,r)&&e(t[r],r)}function fi(t,e,r,i){var n=null!=i?i:{},s=n.capture,a=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==s&&s,passive:void 0===a||a})}var pi=["localhost","127.0.0.1"],gi=t=>{var e=null==Pr?void 0:Pr.createElement("a");return Vr(e)?null:(e.href=t,e)},mi=()=>{},yi=t=>{var e;if(qr(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function bi(t,e,r){try{if(!(e in t))return mi;var i={next:t[e]},n=r(function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)});return qr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e],s=yi(r);s;){if(s.next===n)return void(s.next=i.next);s=yi(r=s.next)}else t[e]=i.next}}catch(t){return mi}}function wi(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}function _i(t){var e,r=null==Nr||null==(e=Nr.location)?void 0:e.href;return Vr(r)?void 0:function(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!qr(i))return e;try{var n=i(e);return Zr(n)&&n?n:e}catch(t){return di.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,r)}var ki=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),Si=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Mi=[16,15,14,13],Ci=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Ii=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Ri=/[0-9A-Za-z_]/;function Ai(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}var xi=1e6;function Ti(t){var e;return Math.min(xi,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:1e6)}var Ei={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:xi,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},Oi=["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"],Fi=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Di=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],Ni=t=>{Qr(t)||vi(Object.keys(t),e=>{(t=>{var e=t.toLowerCase();return Oi.includes(e)||Di.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Li=["/s/","/e/","/i/"];function Pi(t,e,r,i){if(Qr(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return Zr(n)&&(n=parseInt(n)),n>r?"[SessionRecording] "+i+" body too large to record ("+n+" bytes)":t}function Bi(t,e){if(Qr(t))return t;var r=t;return function(t,e){if(void 0===e&&(e=!0),Qr(t))return!1;if(Zr(t)){if(t=t.trim(),e?ki.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(Si.lastIndex=0;e=Si.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var s of Mi){var a=n+s;if(i.length>=a){var o=i.slice(n,a);if(ki.test(o)&&Ai(o))return!0}}}return!1}(t))return!1;if(e?Ci.test(t):function(t){var e;for(Ii.lastIndex=0;e=Ii.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&Ri.test(r)&&Ri.test(i)))return!0}return!1}(t))return!1}return!0}(r,!1)||(r="[SessionRecording] "+e+" body redacted"),vi(Fi,t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r="[SessionRecording] "+e+" body redacted as might contain: "+t)}),r}var $i=new WeakSet,ji=ci("[Recorder]"),Wi=t=>"navigation"===t.entryType,zi=t=>"resource"===t.entryType;function Ui(t,e){return!!e&&(Kr(e)||e[t])}function Hi(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var qi=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function Gi(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find(t=>"content-type"===t.toLowerCase()),r=e&&i[e];return t.some(t=>null==r?void 0:r.toLowerCase().includes(t))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!Hi(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(qi))return!1;if(Kr(r))return!0;if(Hr(r))return n(r);var s=r[e];return Kr(s)?s:n(s)}function Vi(t,e,r,i,n,s){return Zi.apply(this,arguments)}function Zi(){return Zi=r(function*(t,e,r,i,n,s){return void 0===s&&(s=0),s>10?(ji.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null):function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),t=>zi(t)&&t.initiatorType===e&&(Vr(i)||t.startTime>=i)&&(Vr(n)||n>=t.startTime))||(yield new Promise(t=>setTimeout(t,50*s)),Vi(t,e,r,i,n,s+1))}),Zi.apply(this,arguments)}function Ji(t){var e=t.body,r=t.options,i=t.url;if(Qr(e))return null;var n=wi(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(Zr(e))return e;if((t=>"u">typeof Document&&t instanceof Document)(e))return e.textContent;if(Yr(e))return function(t,e){var r,i;void 0===e&&(e="&");var n=[];return vi(t,function(t,e){Vr(t)||Vr(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)}(e);if(Gr(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 Qi=t=>!Jr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Xi(t){var e=t.entry,r=t.method,n=t.status,s=t.networkRequest,a=t.isInitial,o=t.start,u=t.end,l=t.url,h=t.initiatorType;o=e?e.startTime:o,u=e?e.responseEnd:u;var d=Math.floor(Date.now()-performance.now()),c=Math.floor(d+(o||0)),v=[i({},e?e.toJSON():{name:l},{startTime:Vr(o)?void 0:Math.round(o),endTime:Vr(u)?void 0:Math.round(u),timeOrigin:d,timestamp:c,method:r,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:a})];if(Qi(e))for(var f of e.serverTiming||[])v.push({timeOrigin:d,timestamp:c,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Ki=["video/","audio/"];function Yi(t){return Gr(t)&&qr(t.getReader)&&qr(t.tee)}var tn="[SessionReplay] Timeout while trying to read body",en="[SessionReplay] Failed to read body";function rn(t){return en+": "+t}function nn(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function sn(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{var r=setTimeout(()=>e(tn),500);try{t.clone().text().then(t=>e(t),t=>e(rn(t))).finally(()=>clearTimeout(r))}catch(t){clearTimeout(r),e(en)}})}(t);var r=Ti(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(nn(r)):function(t,e){return new Promise(r=>{var i,n=!1;function s(){try{var t;null==(t=i)||t.cancel().catch(()=>{})}catch(t){}}function a(t){n||(n=!0,clearTimeout(u),s(),r(t))}var o,u=setTimeout(()=>a(tn),500);try{o=t.clone()}catch(t){return void a(en)}var l=o.body;if(Yi(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(t){return void a(en)}var h=[],d=0;!function t(){i.read().then(r=>{var i=r.done,o=r.value;if(n)s();else if(i)a((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,d)));else{if(o){if(d+o.byteLength>e)return void a(nn(e));d+=o.byteLength,h.push(o)}t()}},t=>a(rn(t)))}()}else try{o.text().then(t=>a(t),t=>a(rn(t)))}catch(t){a(en)}})}(t,r)}function an(){return(an=r(function*(t){var e=t.r,r=t.options,i=wi(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):sn(e,r)})).apply(this,arguments)}function on(){return(on=r(function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),a=Ki.some(t=>null==s?void 0:s.startsWith(t));if(s&&a)return"Content-Type "+s+" is not supported";var o=wi(n,i);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return Jr(i)?sn(e,r):Promise.resolve(i)})).apply(this,arguments)}var un=null;function ln(t,e,n){if(!("performance"in e))return()=>{};if(un)return ji.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Ei,n):Ei,a=e=>{var r=[],n=!1;e.requests.forEach(t=>{var e="serverTiming"===t.entryType;if(!e||!n){var i=s.maskRequestFn(t);e||(n=!i||(t=>!!t&&$i.has(t))(i)),i&&r.push(i)}}),r.length>0&&t(i({},e,{requests:r}))},o=function(t,e,r){r.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>Wi(t)||zi(t)&&r.initiatorTypes.includes(t.initiatorType)).flatMap(t=>Xi({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0});var i=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>Wi(t)||zi(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>Xi({entry:t,method:void 0,status:void 0,networkRequest:{}}))})}),n=PerformanceObserver.supportedEntryTypes.filter(t=>r.performanceEntryTypeToObserve.includes(t));return i.observe({entryTypes:n}),()=>{i.disconnect()}}(a,e,s),u=()=>{},l=()=>{};return(s.recordHeaders||s.recordBody)&&(u=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Ui("request",r.recordHeaders),n=Ui("response",r.recordHeaders),s=bi(e.XMLHttpRequest.prototype,"open",s=>function(a,o,u,l,h){void 0===u&&(u=!0);var d=this;try{var c,v,f=new Request(o),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(Gi({type:"request",headers:g,url:o,recordBody:r.recordBody})&&(p.requestBody=Ji({body:t,options:r,url:o})),c=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",w),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},w=()=>{if(d.readyState===d.DONE){b(),v=e.performance.now();var i={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)}),n&&(p.responseHeaders=i),Gi({type:"response",headers:i,url:o,recordBody:r.recordBody})&&(p.responseBody=Ji({body:d.response,options:r,url:o})),Vi(e,"xmlhttprequest",f.url,c,v).then(e=>{t({requests:Xi({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:c,end:v,url:o.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})}};d.addEventListener("readystatechange",w),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){ji.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),u,l,h)});return()=>{s()}}(a,e,s),l=function(t,e,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Ui("request",i.recordHeaders),s=Ui("response",i.recordHeaders),a=bi(e,"fetch",a=>function(){var o=r(function*(r,o){var u,l;try{u=new Request(r,o)}catch(t){return ji.error("Failed to instrument fetch for network capture",t),a(r,o)}var h,d,c={};try{try{var v={};u.headers.forEach((t,e)=>{v[e]=t}),n&&(c.requestHeaders=v),!Yi(null==o?void 0:o.body)&&Gi({type:"request",headers:v,url:r,recordBody:i.recordBody})&&(c.requestBody=yield function(t){return an.apply(this,arguments)}({r:u,options:i,url:r}))}catch(t){ji.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),l=Hi(r)?yield a(u):yield a(r,o),d=e.performance.now();try{var f={};l.headers.forEach((t,e)=>{f[e]=t}),s&&(c.responseHeaders=f),Gi({type:"response",headers:f,url:r,recordBody:i.recordBody})&&(c.responseBody=yield function(t){return on.apply(this,arguments)}({r:l,options:i,url:r}))}catch(t){ji.error("Failed to record fetch response for network capture",t)}return l}finally{Vi(e,"fetch",u.url,h,d).then(e=>{var r;t({requests:Xi({entry:e,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:c,start:h,end:d,url:u.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return o.apply(this,arguments)}}());return()=>{a()}}(a,e,s)),un=()=>{o(),u(),l(),un=null}}var hn="$session_recording_remote_config",dn="$replay_sample_rate",cn="$replay_override_sampling",vn="$replay_override_linked_flag",fn="$replay_override_url_trigger",pn="$replay_override_event_trigger",gn="$session_is_sampled",mn="$session_past_minimum_duration",yn="$session_recording_url_trigger_activated_session",bn="$session_recording_event_trigger_activated_session",wn="$posthog_sr_group_event_trigger_",_n="$posthog_sr_group_url_trigger_",kn="$posthog_sr_group_sampling_",Sn="$debug_first_full_snapshot_timestamp",Mn="$sess_rec_flush_size",Cn="$stored_person_properties",In="$sdk_debug_replay_event_trigger_status",Rn="$sdk_debug_replay_linked_flag_trigger_status",An="$sdk_debug_replay_matched_recording_trigger_groups",xn="$sdk_debug_replay_pending_trigger_conditions",Tn="$sdk_debug_replay_remote_trigger_matching_config",En="$sdk_debug_replay_trigger_groups_count",On="$sdk_debug_replay_url_trigger_status",Fn="$sdk_debug_rrweb_attached",Dn="$sdk_debug_rrweb_start_attempted",Nn="$session_recording_start_reason",Ln="disabled",Pn="sampled",Bn="active",$n="buffering",jn="paused",Wn="rrweb_error",zn="trigger_activated",Un="trigger_pending",Hn="trigger_disabled";function qn(t,e,r,i,n,s){return 0===e?Hn:(null==t?void 0:t.get_property(r?i+r:n))===s?zn:Un}function Gn(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)})}function Vn(t){return t.includes("trigger_activated")?zn:t.includes("trigger_pending")?Un:Hn}function Zn(t){var e=new Set(t);switch(e.delete(Hn),e.size){case 0:return Hn;case 1:return Array.from(e)[0];default:return Un}}var Jn=class{constructor(t){this.j=t}triggerStatus(t){return Vn(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return Vn(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},Qn=class{constructor(t){this.j=t}triggerStatus(t){return Zn(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return Zn(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},Xn=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return zn}stop(){}},Kn=t=>"sessionRecording"in t,Yn=class{constructor(t,e){this._instance=t,this.B=[],this.H=[],this.$=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,r;this.B=(Kn(t)?Gr(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(Kn(t)?Gr(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){for(var t of(this.$.clear(),this.U.clear(),this.B))if("regex"===t.matching&&!this.$.has(t.url))try{this.$.set(t.url,new RegExp(t.url))}catch(e){di.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.H)if("regex"===e.matching&&!this.U.has(e.url))try{this.U.set(e.url,new RegExp(e.url))}catch(t){di.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return qn(this._instance,this.B.length,this.V,_n,yn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[On]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=_i(this._instance);if(!t)return!1;try{return Gn(t,this.H,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){var r=_i(this._instance);if(r&&r!==this.W){this.W=r;var i=this.urlBlocked,n=Gn(r,this.H,this.U);i&&n||(n&&!i?t():!n&&i&&e())}}checkUrlTriggerConditions(t,e,r,i){var n=_i(this._instance);if(n&&n!==this.W){this.W=n;var s=this.urlBlocked,a=Gn(n,this.H,this.U);a&&!s?t():!a&&s&&e();var o=this.G(i)===zn,u=Gn(n,this.B,this.$);!o&&u&&r("url",n)}}stop(){this.W=""}},ts=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[Rn]:t}),t}triggerStatusNoSideEffects(){var t=Un;return Qr(this.linkedFlag)&&(t=Hn),this.linkedFlagSeen&&(t=zn),t}onConfig(t,e){var r;if(this.linkedFlag=(Kn(t)?Gr(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Qr(this.linkedFlag)&&!this.linkedFlagSeen){var i=Zr(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=Zr(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((t,r)=>{var s=!1;if(Gr(r)&&i in r){var a=r[i];s=Kr(a)?!0===a:n?a===n:!!a}var o=s&&!this.linkedFlagSeen;this.linkedFlagSeen=s,o&&e(i,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}},es=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(Kn(t)?Gr(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return qn(this._instance,this.K.length,this.V,wn,bn,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[In]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,r){if(0!==this.K.length){var i=this.X(r)===zn,n=this.K.includes(t);!i&&n&&e("event",t)}}stop(){}},rs=class{constructor(t,e,r){if(this._instance=t,this.group=e,this.Y=new Yn(t,e.id),this.tt=new es(t,e.id),this.et=new ts(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.Y.onConfig(n),this.tt.onConfig(n),this.et.onConfig(n,r);var s=[this.tt,this.Y,this.et];this.rt="any"===e.conditions.matchType?new Jn(s):new Qn(s)}else this.rt=new Xn}triggerStatus(t){return this.rt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.rt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===Un).map(t=>t.label)}checkEventTriggerConditions(t,e,r){this.tt.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.Y.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r,i="url"===t?_n+this.group.id:wn+this.group.id;null==(r=this._instance.persistence)||r.register({[i]:e})}stop(){this.Y.stop(),this.tt.stop(),this.et.stop()}};function is(t){if(t.rrwebError)return Wn;if(!t.receivedFlags)return $n;if(!t.isRecordingEnabled)return Ln;if(t.urlTriggerMatching.urlBlocked)return jn;var e=!0===t.isSampled,r=new Jn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?Pn:"trigger_activated"===r?Bn:"trigger_pending"===r?$n:!1===t.isSampled?Ln:Bn}function ns(t){if(t.rrwebError)return Wn;if(!t.receivedFlags)return $n;if(!t.isRecordingEnabled)return Ln;if(t.urlTriggerMatching.urlBlocked)return jn;var e=new Qn([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==Hn,i=Kr(t.isSampled);return r&&"trigger_pending"===e?$n:r&&"trigger_disabled"===e||i&&!t.isSampled?Ln:!0===t.isSampled?Pn:Bn}function ss(){var t=[];return function(e,r){if(Gr(r)||Hr(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r}}function as(t){var e=JSON.stringify(t,ss());return e?new Blob([e]).size:0}function os(t){if(Jr(t))return 4;if(Vr(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(Hr(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=Vr(i)||Jr(i)?4:os(i)}return e}var n=t,s=2,a=!0;for(var o in n)if({}.hasOwnProperty.call(n,o)){var u=n[o];Vr(u)||(a||(s+=1),a=!1,s+=o.length+3+os(u))}return s;default:return 0}}function us(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[us({size:i.reduce((t,e)=>t+e,0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),us({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(r),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap(t=>t)}return[t]}var ls=Uint8Array,hs=Uint16Array,ds=Uint32Array,cs=new ls([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]),vs=new ls([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]),fs=new ls([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ps=function(t,e){for(var r=new hs(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new ds(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]},gs=ps(cs,2),ms=gs[1];gs[0][28]=258,ms[258]=28;for(var ys=ps(vs,0)[1],bs=new hs(32768),ws=0;32768>ws;++ws){var _s=(43690&ws)>>>1|(21845&ws)<<1;bs[ws]=((65280&(_s=(61680&(_s=(52428&_s)>>>2|(13107&_s)<<2))>>>4|(3855&_s)<<4))>>>8|(255&_s)<<8)>>>1}var ks=function(t,e,r){for(var i=t.length,n=0,s=new hs(e);i>n;++n)++s[t[n]-1];var a,o=new hs(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(r){a=new hs(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[bs[d]>>>u]=l}else for(a=new hs(i),n=0;i>n;++n)a[n]=bs[o[t[n]-1]++]>>>15-t[n];return a},Ss=new ls(288);for(ws=0;144>ws;++ws)Ss[ws]=8;for(ws=144;256>ws;++ws)Ss[ws]=9;for(ws=256;280>ws;++ws)Ss[ws]=7;for(ws=280;288>ws;++ws)Ss[ws]=8;var Ms=new ls(32);for(ws=0;32>ws;++ws)Ms[ws]=5;var Cs=ks(Ss,9,0),Is=ks(Ms,5,0),Rs=function(t){return(t/8|0)+(7&t&&1)},As=function(t,e,r){(null==e||0>e)&&(e=0),(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof hs?hs:t instanceof ds?ds:ls)(r-e);return i.set(t.subarray(e,r)),i},xs=function(t,e,r){var i=e/8|0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},Ts=function(t,e,r){var i=e/8|0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Es=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 ls(0),0];if(1==n){var a=new ls(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort(function(t,e){return t.f-e.f}),r.push({s:-1,f:25001});var o=r[0],u=r[1],l=0,h=1,d=2;for(r[0]={s:-1,f:o.f+u.f,l:o,r:u};h!=n-1;)o=r[r[d].f>r[l].f?l++:d++],u=r[l!=h&&r[d].f>r[l].f?l++:d++],r[h++]={s:-1,f:o.f+u.f,l:o,r:u};var c=s[0].s;for(i=1;n>i;++i)s[i].s>c&&(c=s[i].s);var v=new hs(c+1),f=Os(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(s.sort(function(t,e){return v[e.s]-v[t.s]||t.f-e.f});n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=s[i].s;e>v[b]?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new ls(v),f]},Os=function(t,e,r){return-1==t.s?Math.max(Os(t.l,e,r+1),Os(t.r,e,r+1)):e[t.s]=r},Fs=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new hs(++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]},Ds=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Ns=function(t,e,r){var i=r.length,n=Rs(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},Ls=function(t,e,r,i,n,s,a,o,u,l,h){xs(e,h++,r),++n[256];for(var d=Es(n,15),c=d[0],v=d[1],f=Es(s,15),p=f[0],g=f[1],m=Fs(c),y=m[0],b=m[1],w=Fs(p),_=w[0],k=w[1],S=new hs(19),M=0;y.length>M;++M)S[31&y[M]]++;for(M=0;_.length>M;++M)S[31&_[M]]++;for(var C=Es(S,7),I=C[0],R=C[1],A=19;A>4&&!I[fs[A-1]];--A);var x,T,E,O,F=l+5<<3,D=Ds(n,Ss)+Ds(s,Ms)+a,N=Ds(n,c)+Ds(s,p)+a+14+3*A+Ds(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(D>=F&&N>=F)return Ns(e,h,t.subarray(u,u+l));if(xs(e,h,1+(D>N)),h+=2,D>N){x=ks(c,v,0),T=c,E=ks(p,g,0),O=p;var L=ks(I,R,0);for(xs(e,h,b-257),xs(e,h+5,k-1),xs(e,h+10,A-4),h+=14,M=0;A>M;++M)xs(e,h+3*M,I[fs[M]]);h+=3*A;for(var P=[y,_],B=0;2>B;++B){var j=P[B];for(M=0;j.length>M;++M)xs(e,h,L[W=31&j[M]]),h+=I[W],W>15&&(xs(e,h,j[M]>>>5&127),h+=j[M]>>>12)}}else x=Cs,T=Ss,E=Is,O=Ms;for(M=0;o>M;++M)if(i[M]>255){var W;Ts(e,h,x[257+(W=i[M]>>>18&31)]),h+=T[W+257],W>7&&(xs(e,h,i[M]>>>23&31),h+=cs[W]);var z=31&i[M];Ts(e,h,E[z]),h+=O[z],z>3&&(Ts(e,h,i[M]>>>5&8191),h+=vs[z])}else Ts(e,h,x[i[M]]),h+=T[i[M]];return Ts(e,h,x[256]),h+T[256]},Ps=new ds([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Bs=new ls(0),$s=function(){for(var t=new ds(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),js=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Ws(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=$s[255&r^e[i]]^r>>>8;t=r},d(){return 4294967295^t}}}(),i=t.length;r.p(t);var n,s,a,o,u,l,h=(o=10+((n=e).filename&&n.filename.length+1||0),u=8,function(t,e,r,i,n,s){var a=t.length,o=new ls(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=Ns(u,l,t.subarray(h,d)):(u[h]=s,l=Ns(u,l,t.subarray(h,a)))}else{for(var c=Ps[e-1],v=c>>>13,f=8191&c,p=(1<<r)-1,g=new hs(32768),m=new hs(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},_=new ds(25e3),k=new hs(288),S=new hs(32),M=0,C=0,I=(h=0,0),R=0,A=0;a>h;++h){var x=w(h),T=32767&h,E=m[x];if(g[T]=E,m[x]=T,h>=R){var O=a-h;if((M>7e3||I>24576)&&O>423){l=Ls(t,u,0,_,k,S,C,I,A,h-A,l),I=M=C=0,A=h;for(var F=0;286>F;++F)k[F]=0;for(F=0;30>F;++F)S[F]=0}var D=2,N=0,L=f,P=T-E&32767;if(O>2&&x==w(h-P))for(var B=Math.min(v,O)-1,j=Math.min(32767,h),W=Math.min(258,O);j>=P&&--L&&T!=E;){if(t[h+D]==t[h+D-P]){for(var z=0;W>z&&t[h+z]==t[h+z-P];++z);if(z>D){if(D=z,N=P,z>B)break;var U=Math.min(P,z-2),H=0;for(F=0;U>F;++F){var q=h-P+F+32768&32767,G=q-g[q]+32768&32767;G>H&&(H=G,E=q)}}}P+=(T=E)-(E=g[T])+32768&32767}if(N){_[I++]=268435456|ms[D]<<18|ys[N];var V=31&ms[D],Z=31&ys[N];C+=cs[V]+vs[Z],++k[257+V],++S[Z],R=h+D,++M}else _[I++]=t[h],++k[t[h]]}}l=Ls(t,u,s,_,k,S,C,I,A,h-A,l),s||(l=Ns(u,l,Bs))}return As(o,0,i+Rs(l)+n)}(s=t,null==(a=e).level?6:a.level,null==a.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+a.mem,o,u,!l)),d=h.length;return 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&&js(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)}}(h,e),js(h,d-8,r.d()),js(h,d-4,i),h}function zs(t,e){var r="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var i=0;t.length>i;){var n=t[i++];128>n||e?r+=String.fromCharCode(n):224>n?r+=String.fromCharCode((31&n)<<6|63&t[i++]):240>n?r+=String.fromCharCode((15&n)<<12|(63&t[i++])<<6|63&t[i++]):(n=((15&n)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,r+=String.fromCharCode(55296|n>>10,56320|1023&n))}return r}var Us=class{constructor(t,e){var r,i,n,s;void 0===e&&(e={}),this._rrweb=t,this.it=e,this.nt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{var t=Date.now(),e=t-this.ot;e>0?(this.ht=Math.min(this.ct,this.ht+e/1e3*this.dt),this.ot=t):this.ot=t},this.vt=t=>{if(!this.nt[t]){var e,r;this.nt[t]=!0;var i=this.ft(t);null==(e=(r=this.it).onBlockedNode)||e.call(r,t,i)}},this.yt=t=>{var e=this.ft(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.ft=t=>this._rrweb.mirror.getNode(t),this.bt=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.bt(e);if(e.attributes){var i,n,s=e.attributes.length;e.attributes=e.attributes.filter(t=>{var e=this.yt(t.id)[0];return!this.wt.consumeRateLimit(e)&&t});var a=s-e.attributes.length;a>0&&(null==(i=(n=this.it).onDroppedAttributeMutations)||i.call(n,a))}var o=this.bt(e);if(0!==o||r===o){if(this.kt)return t;this.ut();var u,l,h=os(t);return h>this.ht?(null==(u=(l=this.it).onDroppedOversizedMutation)||u.call(l,h),void this._t()):(this.ht-=h,t)}},this._t=()=>{if(!this.St){var t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null==(t=(e=this.it).requestFullSnapshot)||t.call(e)},t)}},this.wt=new ei({bucketSize:null!==(r=this.it.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.it.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.vt,A:di}),this.ct=null!==(n=this.it.bytesBucketSize)&&void 0!==n?n:0,this.dt=null!==(s=this.it.bytesRefillRate)&&void 0!==s?s:25600,this.kt=!Number.isFinite(this.ct)||0>=this.ct,this.ht=this.ct;var a=this.it.resyncIntervalMs;this.xt=Xr(a)&&Number.isFinite(a)&&a>0?a:3e5}reset(){this.nt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ht=this.ct,this.ot=Date.now(),this.st=-1/0}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Xr(t)&&isFinite(t)&&Math.floor(t)===t}),Nr&&!Vr(Nr.crypto)&&crypto;var Hs=null,qs={Et(){if(!Jr(Hs))return Hs;if(Hs=!0,Vr(Nr))Hs=!1;else try{var t="__support__";qs.Ot(t,"xyz"),'"xyz"'!==qs.Lt(t)&&(Hs=!1),qs.Dt(t)}catch(t){Hs=!1}return Hs},Pt(t){di.error("sessionStorage error: ",t)},Lt(t){try{return null==Nr?void 0:Nr.sessionStorage.getItem(t)}catch(t){qs.Pt(t)}return null},Nt(t){try{return JSON.parse(qs.Lt(t))||null}catch(t){}return null},Ot(t,e){try{return null==Nr||Nr.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){qs.Pt(t)}return!1},Dt(t){try{null==Nr||Nr.sessionStorage.removeItem(t)}catch(t){qs.Pt(t)}}};li.DEBUG=!1,li.LIB_VERSION="1.428.8",li.LIB_NAME="web";var Gs=li,Vs=class{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.Ft=t.get_property.bind(t),this.qt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.qt(Mn,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,r=this.Ft(Mn);return Gr(e=r)&&Zr(e.sessionId)&&Xr(e.size)&&r.sessionId===t?r.size:0}};function Zs(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<ti(100*e,0,100,di)}var Js=(t,e)=>{if(!(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}},Qs=t=>t.toLowerCase(),Xs={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=>Js(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Js(e,t))),icontains:(t,e)=>e.map(Qs).some(e=>t.map(Qs).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Qs).every(e=>t.map(Qs).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))})},Ks=new Set(["is_not","not_icontains","not_regex"]);function Ys(t,e,r){return!t||0===t.length||t.every(t=>{var i,n=null==(i="person"===t.type?r:e)?void 0:i[t.key],s=t.operator||"exact";if(Vr(n)||Jr(n))return Ks.has(s);var a=Xs[s];return!!a&&!Vr(t.value)&&!Jr(t.value)&&a(Hr(t.value)?t.value.map(String):[String(t.value)],Hr(n)?n.map(String):[String(n)])})}var ta=ci("[SessionRecording]");function ea(t,e){return e?t:"!"+t}function ra(t,e){return t===e||t!=="!"+e&&null}var ia=class{constructor(t,e,r,i,n,s,a){this._instance=t,this.Y=e,this.tt=r,this.et=i,this.jt=n,this.Bt=s,this.Ht=a,this.$t=null,this.zt=ns}onRemoteConfig(t){this.$t=Xr(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Ut=new Jn([this.tt,this.Y]),this.zt=is):(this.Ut=new Qn([this.tt,this.Y]),this.zt=ns),this._instance.register_for_session({[Tn]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.jt("linked_flag_matched",{flag:t,variant:e}),this.Ht()})}getStatus(t){return this.zt({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,r=null==(e=this._instance.get_property("$session_recording_remote_config"))?void 0:e.minimumDurationMilliseconds;return Xr(r)?r:null}checkUrlTriggers(t,e,r,i){this.Y.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.tt.K.length&&Qr(this.Wt))return this.Wt=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,r,e)}catch(t){ta.error("Could not activate event trigger",t)}}),this.Wt}makeSamplingDecisions(t){var e,r,i,n=this.$t;if(!Xr(n))return null==(r=this._instance.persistence)||r.unregister(gn),void(null==(i=this._instance.persistence)||i.unregister(dn));var s=this._instance.get_property(gn),a=this._instance.get_property(dn),o=ra(s,t),u=Xr(a)&&a!==n,l=Vr(a)&&s===t,h=u||l||!Kr(o),d=h?Zs(t,n):o;h&&(d?this.jt("sampled"):ta.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[gn]:ea(t,d),[dn]:Jr(a)&&s===t?null:n})}ensureSamplingDecision(t){Xr(this.$t)&&(Kr(ra(this._instance.get_property(gn),t))||this.makeSamplingDecisions(t))}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i,n;null==(t=this._instance.persistence)||t.unregister(bn),null==(e=this._instance.persistence)||e.unregister(yn),null==(r=this._instance.persistence)||r.unregister(gn),null==(i=this._instance.persistence)||i.unregister(dn),null==(n=this._instance.persistence)||n.unregister(mn)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Ut)?void 0:e.triggerStatus(t))===Un}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===Un).map(t=>t.label)}stop(){var t;null==(t=this.Wt)||t.call(this),this.Wt=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},na=class{constructor(t,e,r,i,n){this._instance=t,this.Y=e,this.jt=r,this.Vt=i,this.Ht=n,this.Zt=[],this.Gt=new Map,this.Qt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.Jt(t.triggerGroups),this._instance.register_for_session({[Tn]:"v2_trigger_groups",[En]:t.triggerGroups.length}),this.Y.onConfig(t)):ta.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Wn;if(!t.receivedFlags)return $n;if(!t.isRecordingEnabled)return Ln;if(t.urlTriggerMatching.urlBlocked)return jn;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return Ln;var i=!1,n=!1;for(var s of e){var a=s.triggerStatus(t.sessionId);if("trigger_activated"===a){var o=s.group.id,u=r.get(o);Vr(u)?di.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:o}):!0===u&&(n=!0)}else"trigger_pending"===a&&(i=!0)}return n?Pn:i?$n:Ln}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Zt,triggerGroupSamplingResults:this.Gt,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.Zt)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;Xr(i)&&(Jr(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.Y.checkUrlBlocklist(e,r);var s=function(i){i.checkUrlTriggerConditions(e,r,e=>{n.Kt(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t),n.Ht(e))},t)};for(var a of this.Zt)s(a)}setupEventTriggerListeners(t,e,r){var i=this;return this.Wt=t(t=>{var r;if(this.Qt)return ta.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.Wt)||r.call(this),void(this.Wt=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,n=>{if(i.Kt(r,t.properties)){var s=(r.group.conditions.events||[]).filter(e=>e.name===t.event),a=i._instance.get_property(Cn);s.some(e=>!e.properties||0===e.properties.length||Ys(e.properties,t.properties,a))&&(r.activateTrigger(n,e),i.updateActiveTriggers(e),i.Ht(n))}},e)};for(var s of this.Zt)n(s)}catch(t){ta.error("Could not activate event trigger for trigger groups",t)}}),this.Wt}makeSamplingDecisions(t){for(var e of this.Zt){var r,i=e.group,n=i.id,s=i.sampleRate,a=kn+n,o=this._instance.get_property(a),u=null,l=!1,h=!1,d=!1;if(Gr(o)){var c=o.sessionId,v=o.sampleRate,f=o.sampled;l="string"==typeof c&&c!==t,h=Xr(v)&&v!==s,u=c===t&&Xr(v)&&v===s&&Kr(f)?f:null}else u=o===t||null,l="string"==typeof o&&o!==t,d=o===t;var p=l||h||d||!Kr(u),g=p?Zs(t+n,s):u;p&&this.Vt("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:s,isSampled:g}),this.Gt.set(n,g),null==(r=this._instance.persistence)||r.register({[a]:{sessionId:t,sampleRate:s,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Qt=!0}clearConditionalRecordingPersistence(){var t,e,r;for(var i of(null==(t=this._instance.persistence)||t.unregister(gn),null==(e=this._instance.persistence)||e.unregister(dn),null==(r=this._instance.persistence)||r.unregister(mn),this.Zt)){var n,s,a,o=i.group.id;null==(n=this._instance.persistence)||n.unregister(wn+o),null==(s=this._instance.persistence)||s.unregister(_n+o),null==(a=this._instance.persistence)||a.unregister(kn+o)}}updateActiveTriggers(t){var e=[];for(var r of this.Zt){var i=r.group,n=i.id,s="trigger_activated"===r.triggerStatus(t),a=!0===this.Gt.get(n);s&&e.push({id:n,name:i.name,matched:!0,sampled:a})}this._instance.register_for_session({[An]:e})}hasPendingTriggers(t){for(var e of this.Zt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Zt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>'trigger group "'+e.group.name+'": '+t))}stop(){var t;null==(t=this.Wt)||t.call(this),this.Wt=void 0,this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear(),this.Y.stop()}Kt(t,e){var r=t.group.conditions.properties;return!r||0===r.length||Ys(r,e,this._instance.get_property(Cn))}Jt(t){var e=this;this.Zt.forEach(t=>t.stop()),this.Zt=[],this.Gt.clear();var r=function(t){var r=new rs(e._instance,t,(r,i)=>{e.jt("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name}),e.Ht()});e.Zt.push(r)};for(var i of t)r(i)}},sa=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],aa=1e5,oa=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,ua=[],la=()=>!1,ha="@type @id actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),da="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),ca="AutoDealer Bakery BarOrPub CafeOrCoffeeShop CollegeOrUniversity Corporation DaySpa Dentist EducationalOrganization Electrician FoodEstablishment GovernmentOrganization HealthClub Hotel LegalService Library LibrarySystem LocalBusiness Locksmith LodgingBusiness MedicalBusiness NGO OnlineStore Organization PerformingGroup Pharmacy Physician Plumber RealEstateAgent Restaurant School SportsOrganization Store".split(" "),va="Accommodation AdministrativeArea Country Place State".split(" "),fa={AggregateOffer:{offers:["Offer"]},Brand:{name:!0},BreadcrumbList:{itemListElement:["ListItem"]},CreativeWork:{genre:!0,dateCreated:!0,dateModified:!0,datePublished:!0,expires:!0,learningResourceType:!0,educationalLevel:!0,educationalUse:!0,interactivityType:!0,aggregateRating:["AggregateRating"],potentialAction:da,publisher:ca},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:ua},Offer:{seller:ca},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:ca,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:ca,areaServed:va,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:ua}},pa=[["3DModel AboutPage Answer Article AudioObject Blog BlogPosting Book Clip CollectionPage Comment ContactPage Course CreativeWorkSeason CreativeWorkSeries DataCatalog DataDownload DataFeed Dataset DiscussionForumPosting Episode FAQPage Game HowTo HowToDirection HowToSection HowToStep HowToTip ImageObject LearningResource MediaObject Message MobileApplication Movie MusicPlaylist MusicRecording NewsArticle Photograph PodcastEpisode PodcastSeries ProfilePage QAPage Question Quiz Recipe Review ScholarlyArticle SearchResultsPage SiteNavigationElement SocialMediaPosting SoftwareApplication TVEpisode TVSeries TechArticle VacationRental VideoGame VideoObject WebApplication WebPage WebPageElement WebSite".split(" "),fa.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),fa.Event],[ca,fa.Organization],[va,fa.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),fa.Product]];function ga(t,e){return zr.call(t,e)?t[e]:void 0}function ma(t){var e=typeof t;return Jr(t)||"string"===e||"number"===e||"boolean"===e}function ya(t){return ma(t)||Hr(t)&&t.every(ma)?t:void 0}function ba(t,e){if("string"==typeof t){var r=t.trim(),i=r.indexOf("#"),n=0>i?r:r.slice(i+1);if(!(!n||0>i&&(/^[a-z][a-z\d+.-]*:/i.test(r)||r.includes("/")||r.includes("?"))))try{return e(n)?n:void 0}catch(t){return}}}function wa(t){if(zr.call(fa,t))return fa[t];for(var e of pa){var r=e[1];if(e[0].includes(t))return r}}function _a(t,e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0})}function ka(t,e,r,i){if(Hr(t)){var n=t.map(t=>ka(t,e,r,i)).filter(t=>!Vr(t));return n.length?n:void 0}return Sa(t,e,r,i)||void 0}function Sa(t,e,r,i){if(!Gr(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(r))return null;var n=ga(t,"@type"),s=function(t){var e=new Set,r="string"==typeof t?[t]:Hr(t)?t:[],i=[];for(var n of r)if("string"==typeof n){var s=n.replace(/^https?:\/\/schema\.org\//,"");if(100>=s.length&&oa.test(s)&&!e.has(s)&&(e.add(s),i.push(s),20===i.length))break}return i}(n),a=s.filter(t=>!!wa(t)&&(!i||!i.length||i.includes(t))),o={};for(var u of ha){var l="@type"===u?s.length?"string"==typeof n?s[0]:s:void 0:"@id"===u?ba(ga(t,u),e):ya(ga(t,u));Vr(l)||_a(o,u,l)}for(var h of a){var d=wa(h);for(var c of Object.keys(d)){var v=ga(t,c),f=d[c];if(!0===f){var p=ya(v);Vr(p)||_a(o,c,p)}else{var g=ka(v,e,r,f);Vr(g)||_a(o,c,g)}}}var m=ka(ga(t,"@graph"),e,r);return Vr(m)||_a(o,"@graph",m),Object.keys(o).length?o:null}function Ma(t,e,r){if(!Gr(t))return null;var n=ga(t,"@context");if("string"!=typeof n||!/^https?:\/\/schema\.org\/?$/.test(n))return null;var s=Sa(t,e,r);return s?i({"@context":"https://schema.org"},s):null}function Ca(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function Ia(t,e,r){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some(t=>(e.lastIndex=0,e.test(t))))return!0;try{return!!r&&t.matches(r)}catch(t){return!1}}function Ra(t,e,r){for(var i=t;i;){if(Ia(i,e,r))return!0;var n=i.parentNode;i=i.parentElement||(n&&n.nodeType===n.DOCUMENT_FRAGMENT_NODE?n.host:null)}return!1}function Aa(t){return Ca(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Ca)}function xa(t){return Vr(t)?void 0:Math.round(t)}function Ta(t){return Gr(t)?t.network_timing:t}var Ea,Oa,Fa=ci("[SessionRecording]"),Da=[1,2,3,4,5,6,7,12],Na=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function La(){var t;return null==jr||null==(t=jr.__PosthogExtensions__)?void 0:t.rrweb}function Pa(){var t;return null==(t=La())?void 0:t.record}function Ba(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,ss())}}function $a(t){return zs(Ws(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new ls(t.length+(t.length>>>1)),i=0,n=function(t){r[i++]=t},s=0;e>s;++s){if(i+5>r.length){var a=new ls(i+8+(e-s<<1));a.set(r),r=a}var o=t.charCodeAt(s);128>o?n(o):2048>o?(n(192|o>>>6),n(128|63&o)):o>55295&&57344>o?(n(240|(o=65536+(1047552&o)|1023&t.charCodeAt(++s))>>>18),n(128|o>>>12&63),n(128|o>>>6&63),n(128|63&o)):(n(224|o>>>12),n(128|o>>>6&63),n(128|63&o))}return As(r,0,i)}(Ba(t))),!0)}function ja(t){return Wa.apply(this,arguments)}function Wa(){return Wa=r(function*(t){var e=yield function(t,e,r){return oi.apply(this,arguments)}(Ba(t),Gs.DEBUG,{rethrow:!0});return zs(new Uint8Array(yield e.arrayBuffer()),!0)}),Wa.apply(this,arguments)}var za="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,Ua=!1;function Ha(t){return Hr(t)&&0===t.length?Ea=null!=Ea?Ea:$a([]):$a(t)}function qa(t){return Ga.apply(this,arguments)}function Ga(){return(Ga=r(function*(t){return Hr(t)&&0===t.length?Ea||(Oa=null!=Oa?Oa:ja([]).then(t=>(Ea=t,t)).catch(t=>{throw Ea=void 0,Oa=void 0,t})):ja(t)})).apply(this,arguments)}function Va(t){return za&&!Ua&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function Za(t){return{event:t,size:os(t)}}function Ja(t,e){return i({},t,{data:e,cv:"2024-10"})}function Qa(t,e){return i({},t,{cv:"2024-10",data:i({},t.data,e)})}function Xa(t){try{if(2===t.type)return Za(Ja(t,$a(t.data)));if(3===t.type&&0===t.data.source)return Za(Qa(t,{texts:Ha(t.data.texts),attributes:Ha(t.data.attributes),removes:Ha(t.data.removes),adds:Ha(t.data.adds)}));if(3===t.type&&8===t.data.source)return Za(Qa(t,{adds:t.data.adds?$a(t.data.adds):void 0,removes:t.data.removes?$a(t.data.removes):void 0}))}catch(t){Fa.error("could not compress event - will use uncompressed event",t)}return{event:t,size:as(t)}}function Ka(){return(Ka=r(function*(t){try{if(2===t.type)return Za(Ja(t,yield ja(t.data)));if(3===t.type&&0===t.data.source){var e=yield Promise.all([qa(t.data.texts),qa(t.data.attributes),qa(t.data.removes),qa(t.data.adds)]);return Za(Qa(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(3===t.type&&8===t.data.source){var r=yield Promise.all([t.data.adds?ja(t.data.adds):void 0,t.data.removes?ja(t.data.removes):void 0]);return Za(Qa(t,{adds:r[0],removes:r[1]}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===ni})(e)&&(Ua=!0),Fa.error("could not compress event asynchronously - trying synchronous compression",e),Xa(t)}return{event:t,size:as(t)}})).apply(this,arguments)}function Ya(t,e){return 5===t.type&&t.data.tag===e}function to(t){return Ya(t,"sessionIdle")}function eo(t){return Ya(t,"$session_ending")}function ro(t){return Ya(t,"$session_starting")}var io=class{get sessionId(){return this.Xt}get Yt(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get te(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get ee(){return ra(this._instance.get_property(gn),this.sessionId)}get $t(){var t,e=null==(t=this.re)?void 0:t.sampleRate;return Xr(e)?e:null}get ie(){var t,e;return null!==(t=null==(e=this.ne)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.oe="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.ae=void 0,this.se=!1,this.ue=Date.now(),this.le=!1,this.he=[],this.ce="unknown",this.de=0,this.ve=0,this.fe=0,this.pe=0,this.ge=!1,this.me=!1,this.ye=!1,this.be=!1,this.we=!1,this.ke=!1,this._e=!1,this.Se=!1,this.xe=!1,this.Ce=!1,this.Me=!1,this.Te=!1,this.Ie=[],this.Re=void 0,this.Ae=void 0,this.Ee=!1,this.Oe=[],this.Le=0,this.De=0,this.Pe=!1,this.Ne=void 0,this.Wt=void 0,this.Fe=void 0,this.qe=void 0,this.je=void 0,this.Be=(t,e,r)=>{var i,n,s,a;if(r&&(t!==this.Xt||e!==this.He)){var o=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this.Xt,l=this.He;if(o&&this.Vt("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.ue,flushed_size:null==(i=this.$e)?void 0:i.currentTrackedSize(u)}),null==(n=this._instance.persistence)||n.unregister(Sn),this._e=!1,null==(s=La())||null==s.resetMaxDepthState||s.resetMaxDepthState(),this.Vt("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.ze(),!(!1===this.ce&&this.isStarted||this.Xt===t&&this.He===e)){var h=this.Xt!==t&&!1!==this.ce;this.ce="unknown",this.Ue(h)}o&&this.Vt("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.ue}),null==(a=this.ne)||a.makeSamplingDecisions(t)}},this.We=!1,this.Ve=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[mn])===this.Xt},this.Ze=()=>{var t,e;if(0===this.Rt.data.length)return null;var r=null==(t=this.Rt.data[0])?void 0:t.timestamp,i=null==(e=this.Rt.data[this.Rt.data.length-1])?void 0:e.timestamp;return Xr(r)&&Xr(i)?i-r:null},this.Ge=()=>{var t,e,r=this.ie;if(!Xr(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.Qe;return Xr(i)&&i>=0&&r>i}if(this.Ve())return!1;var n,s=this.Ze();return!!Jr(s)||r>s||(null==(n=this._instance.persistence)||n.register({[mn]:this.Xt}),!1)},this.Je=()=>{"buffering"!==this.status?(this.ge&&this.me&&this.Ke&&!this.ye&&this.Xe(void 0),this.Ye(),this.tr(!0)):this.er()},this.rr=()=>{this.Je()},this.ir=()=>{this.Vt("browser offline",{})},this.nr=()=>{this.Vt("browser online",{})},this.ar=()=>{null!=Pr&&Pr.visibilityState&&("visible"===Pr.visibilityState&&(this.Ke=!0),this.Vt("window "+Pr.visibilityState,{}))},this.Ke=null==e||e;var r=this.Yt.checkAndGetSessionAndWindowId(),i=r.windowId,n=r.sessionStartTimestamp;this.Xt=r.sessionId,this.He=i,this._sessionStartTimestamp=n,this.et=new ts(this._instance),this.Y=new Yn(this._instance),this.tt=new es(this._instance),this.Rt=this.er(),this.sr="ph_"+(this._instance.config.persistence_name||this._instance.config.token)+"_replay_pending_buffer",this.Yt.sessionTimeoutMs>this.te||Fa.warn("session_idle_threshold_ms ("+this.te+") is greater than the session timeout ("+this.Yt.sessionTimeoutMs+"). Session will never be detected as idle"),this.$e=new Vs(this._instance)}setDocumentWasEverVisible(t){t&&(this.Ke=!0)}get ur(){var t,e,r,i,n,s,a,o,u,l=null==(t=this.re)?void 0:t.masking,h={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,maskAllElementAttributes:null==(n=this._instance.config.session_recording)?void 0:n.maskAllElementAttributes},d=null!==(s=null==h?void 0:h.maskAllInputs)&&void 0!==s?s:null==l?void 0:l.maskAllInputs,c=null!==(a=null==h?void 0:h.maskTextSelector)&&void 0!==a?a:null==l?void 0:l.maskTextSelector,v=null!==(o=null==h?void 0:h.blockSelector)&&void 0!==o?o:null==l?void 0:l.blockSelector,f=null!==(u=null==h?void 0:h.maskAllElementAttributes)&&void 0!==u?u:null==l?void 0:l.maskAllElementAttributes;return Vr(d)&&Vr(c)&&Vr(v)&&Vr(f)?void 0:{maskAllInputs:null==d||d,maskTextSelector:c,blockSelector:v,maskAllElementAttributes:f}}lr(){var t;if(!this.xe){var e=null==(t=this.re)?void 0:t.masking;if(!Qr(e)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter(t=>{var i=null==r?void 0:r[t],n=e[t];return!Vr(i)&&i!==n});0!==i.length&&(this.xe=!0,Fa.warn('Session recording masking is configured both in `posthog.init` and in your project settings, and they differ. The `session_recording` options in `posthog.init` take precedence, so the project ("Privacy and masking") setting is ignored for: '+i.join(", ")+". Remove these masking options from `posthog.init` to use the project setting instead. See https://posthog.com/docs/session-replay/privacy",{client:{maskAllInputs:null==r?void 0:r.maskAllInputs,maskTextSelector:null==r?void 0:r.maskTextSelector,blockSelector:null==r?void 0:r.blockSelector,maskAllElementAttributes:null==r?void 0:r.maskAllElementAttributes},project:e}))}}}get hr(){var t;return ti(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,ci("canvas recording resolution scale"),1)}get cr(){var t,e,r,i,n,s,a,o=this._instance.config.session_recording.captureCanvas,u=null==(t=this.re)?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:ti(h,0,12,ci("canvas recording fps"),4),quality:ti(d,0,1,ci("canvas recording quality"),.4)}}get dr(){var t,e,r=!(null==(t=this.re)||!t.consoleLogRecordingEnabled);return null!==(e=this._instance.config.enable_recording_console_log)&&void 0!==e?e:r}get vr(){var t,e,r,i=null==(t=this.re)?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=Ta(this._instance.config.capture_performance),u=Ta(null==i?void 0:i.capturePerformance),l=!!(Kr(o)?o:u);return s||a||l?{recordHeaders:s,recordBody:a,recordPerformance:l}:void 0}pr(){var t,e,r=[],n=null==(t=jr.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.dr&&r.push(n());var s=null==(e=jr.__PosthogExtensions__)||null==(e=e.rrwebPlugins)?void 0:e.getRecordNetworkPlugin;if(this.vr&&qr(s))if(!pi.includes(Br.hostname)||this._forceAllowLocalhostNetworkCapture){var a=qr(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;r.push(s(((t,e,r)=>{var n,s={payloadSizeLimitBytes:Ei.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Ei.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...Ei.payloadHostDenyList]},a=!1!==t.session_recording.recordHeaders&&e.recordHeaders,o=!1!==t.session_recording.recordBody&&e.recordBody,u=!1!==t.capture_performance&&e.recordPerformance,l=(n=Ti(s),t=>(null!=t&&t.requestBody&&(t.requestBody=Pi(t.requestBody,t.requestHeaders,n,"Request")),null!=t&&t.responseBody&&(t.responseBody=Pi(t.responseBody,t.responseHeaders,n,"Response")),t)),h=e=>{return l(((t,e,r)=>{var i;if(null==r||!r(t.name)){var n=gi(t.name),s=0===e.indexOf("http")?null==(i=gi(e))?void 0:i.pathname:e;"/"===s&&(s="");var a=null==n?void 0:n.pathname.replace(s||"","");if(!(n&&a&&Li.some(t=>0===a.indexOf(t))))return t}})((Ni((i=e).requestHeaders),Ni(i.responseHeaders),i),t.api_host,r));var i},d=qr(t.session_recording.maskNetworkRequestFn);return d&&qr(t.session_recording.maskCapturedNetworkRequestFn)&&di.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(t.session_recording.maskCapturedNetworkRequestFn=e=>{var r=t.session_recording.maskNetworkRequestFn({url:e.name});return!r&&e.isInitial?r:i({},e,{name:null==r?void 0:r.url})}),s.maskRequestFn=qr(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r=h(e);if(r){var i=r.isInitial?{name:"",entryType:r.entryType,startTime:r.startTime,duration:r.duration,endTime:r.endTime,timeOrigin:r.timeOrigin,timestamp:r.timestamp,isInitial:!0}:void 0,n=null==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(r);return Qr(n)&&i?($i.add(i),i):null!=n?n:void 0}}:t=>function(t){if(!Vr(t))return t.requestBody=Bi(t.requestBody,"Request"),t.responseBody=Bi(t.responseBody,"Response"),t}(h(t)),i({},Ei,s,{recordHeaders:a,recordBody:o,recordPerformance:u,recordInitialRequests:u,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.vr,a)))}else Fa.info("NetworkCapture not started because we are on localhost.");return r}gr(t){return this._instance.config.disable_capture_url_hashes?ri(t):t}mr(t,e){void 0===e&&(e=!1);var r=e?ri(t):this.gr(t),i=this._instance.config.mask_personal_data_properties?[...sa,...this._instance.config.custom_personal_data_properties||[]]:[];return this.yr(function(t,e){if(!t||!e||!e.length)return t;for(var r=t.split("#"),i=r[1],n=(r[0]||"").split("?"),s=n[1],a=n[0],o=(s||"").split("&"),u=[],l=0;o.length>l;l++){var h=o[l].split("=");Hr(h)&&(e.includes(h[0])?u.push(h[0]+"=<masked>"):u.push(o[l]))}var d=a;return null!=s&&(d+="?"+u.join("&")),null!=i&&(d+="#"+i),d}(r,i))}yr(t){var e,r=this._instance.config.session_recording;if(r.maskCapturedNetworkRequestFn){var i,n=r.maskCapturedNetworkRequestFn({name:t});return null!==(i=null==n?void 0:n.name)&&void 0!==i?i:null==n?void 0:n.url}return r.maskNetworkRequestFn?null==(e=r.maskNetworkRequestFn({url:t}))?void 0:e.url:t}br(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.he.length?this.he.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Fa.warn("could not emit queued rrweb event.",e,t),!1}}Vt(t,e){return this.br(Na(()=>Pa().addCustomEvent(t,e)))}wr(){var t;return this.se&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.ce}kr(t){if(!this.wr())return!1;try{var e=Pa();return!!e&&(e.addCustomEvent("$json_ld",t),this.wr())}catch(t){return!1}}_r(t){void 0===t&&(t=!1),Promise.resolve().then(()=>{var e;return null==(e=this.Sr)?void 0:e.scan(t)})}Cr(){try{if(this._instance.config.capture_pageview||!Nr)return;var t=new URL(Nr.location.href),e=this.mr(t.origin+t.pathname+t.search);this.Mr!==e&&(this.Mr=e,this.Vt("$url_changed",{href:e}))}catch(t){}}Tr(){if(this.he.length){var t=[...this.he];this.he=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.br(t)})}}Bt(){return this.br(Na(()=>Pa().takeFullSnapshot()))}get Ir(){var t,e,r;if(null!=(t=this.ne)&&t.hasPendingTriggers(this.sessionId)&&!["sampled","active"].includes(this.status)){var i,n=null==(i=this._instance.config.session_recording)?void 0:i.trigger_pending_buffer_interval_millis;return Xr(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}Rr(){if(this.Ar&&clearInterval(this.Ar),!0!==this.ce){var t=this.Ir;t&&(this.Ar=setInterval(()=>{this.Bt()},t))}}Ht(t){"event"===t&&this.Er(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.Rr()}Or(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null==(t=this.Sr)||t.scan(),clearInterval(this.Ar),Fa.info("recording paused due to URL blocker"),this.Vt("recording paused",{reason:"url blocker"}))}Lr(){var t;this.Y.urlBlocked&&(null==(t=this.Sr)||t.scan(),this.Y.urlBlocked=!1,this.Bt(),this._r(),this.Rr(),this.Vt("recording resumed",{reason:"left blocked url"}),Fa.info("recording resumed"))}Dr(t,e){var r;if("event"===t&&this.Er(),!this.le&&null!=(r=this.ne)&&r.hasPendingTriggers(this.sessionId)){this.le=!0;try{var i,n,s="url"===t?yn:bn;null==(i=this._instance.persistence)||i.register({[s]:this.sessionId}),null==(n=this.ne)||n.updateActiveTriggers(this.sessionId),this.Ht(),this.tr(),this.jt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.le=!1}}}get isStarted(){return!!this.ae}get re(){var t=this._instance.get_property(hn);if(t){var e;try{e=Gr(t)?t:JSON.parse(t)}catch(t){return void Fa.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.We){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return Fa.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(hn))}return e}}Pr(t,e,r){this._instance.get_property(t)&&(e(),r())}start(t){var e,r,i=this.re;if(i){if(!this.isStarted){var n=!1!==this.ce&&!this.be;this.Xe(n?"no_interaction_since_recording_started":void 0),this.be=!1,this.me=n,this.ye=!1}this.Pe&&(this.Nr(),this.er());var s=this.Yt.checkAndGetSessionAndWindowId(),a=s.windowId,o=s.sessionStartTimestamp;this.Xt=s.sessionId,this.He=a,this._sessionStartTimestamp=o,this.Fr(),null==(e=this._instance.persistence)||e.unregister(Sn),null!=i&&i.endpoint&&(this.oe=null==i?void 0:i.endpoint),this.ne=2===(null==i?void 0:i.version)&&null!=i&&i.triggerGroups&&i.triggerGroups.length>0?new na(this._instance,this.Y,this.jt.bind(this),this.Vt.bind(this),this.Ht.bind(this)):new ia(this._instance,this.Y,this.tt,this.et,this.jt.bind(this),this.Bt.bind(this),this.Ht.bind(this)),this.ne.onRemoteConfig(i),null==(r=this.Wt)||r.call(this),this.Wt=this.ne.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.Dr(t,e)),this.Pr(cn,()=>{this.overrideSampling()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(cn)}),this.Pr(vn,()=>{this.overrideLinkedFlag()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(vn)}),this.Pr(pn,()=>{this.overrideTrigger("event")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(pn)}),this.Pr(fn,()=>{this.overrideTrigger("url")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(fn)}),this.ne.makeSamplingDecisions(this.sessionId),this.qr(),this.we||(fi(Nr,"beforeunload",this.Je),fi(Nr,"pagehide",this.rr),fi(Nr,"offline",this.ir),fi(Nr,"online",this.nr),fi(Pr,"visibilitychange",this.ar),!this.Fe&&qr(this.Yt.onSessionId)&&(this.Fe=this.Yt.onSessionId(this.Be)),!this.qe&&qr(this.Yt.on)?this.qe=this.Yt.on("forcedIdleReset",()=>{this.ze(),this.ce="unknown",this.stop(),this.je=this.Yt.onSessionId((t,e,r)=>{var i;null==(i=this.je)||i.call(this),this.je=void 0,this.Be(t,e,r)})}):qr(this.Yt.on)||Fa.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Qr(this.Ne)&&(this.Ne=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.mr(t.properties.$current_url):"";if(!e)return;this.Vt("$pageview",{href:e})}}catch(t){Fa.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.jt(t||"recording_initialized"))}else Fa.info("remote config must be stored in persistence before recording can start")}jr(){var t,e,r,i,n,s;null==Nr||Nr.removeEventListener("beforeunload",this.Je),null==Nr||Nr.removeEventListener("pagehide",this.rr),null==Nr||Nr.removeEventListener("offline",this.ir),null==Nr||Nr.removeEventListener("online",this.nr),null==Pr||Pr.removeEventListener("visibilitychange",this.ar),clearInterval(this.Ar),this.Br(),null==(t=this.Ne)||t.call(this),this.Ne=void 0,null==(e=this.Wt)||e.call(this),this.Wt=void 0,null==(r=this.Fe)||r.call(this),this.Fe=void 0,null==(i=this.qe)||i.call(this),this.qe=void 0,null==(n=this.je)||n.call(this),this.je=void 0,null==(s=this.ne)||s.stop(),this.Hr(),this.Nr()}Nr(){this.De+=1,this.Oe=[],this.Le=0,this.$r=void 0,this.Pe=!1}Hr(){var t,e;null==(t=this.zr)||t.stop(),this.he=[],null==(e=this.Sr)||e.stop(),this.Sr=void 0,this.se=!1;try{var r;null==(r=this.ae)||r.call(this)}catch(t){Fa.warn("could not stop rrweb",t)}this.ae=void 0}Ur(){if(!this.$r||0===this.Le)return!1;if(this.Pe)return!0;this.Pe=!0,this.Wr=void 0;var t=this.De;return this.Br(),this.Hr(),this.$r.catch(()=>{}).then(()=>{t===this.De&&(this.Pe=!1,this.tr(),this.er(),this.Vr(),this.jr(),Fa.info("stopped"))}).catch(()=>{this.Pe=!1,this.Vr(),this.jr(),Fa.info("stopped")}),!0}stop(){if(this.Hr(),this.We)this.Ye();else if(this.Ur())return;this.tr(),this.er(),this.Vr(),this.jr(),Fa.info("stopped")}Vr(){this.Xe(void 0,{preserveLogDedup:this.We}),this.me=!1}flushBeforeIdentityReset(){(this.isStarted||this.Pe)&&(this.Ye(),this.tr())}Ue(t){this.We=!0,this.ue=Date.now();try{var e;this.stop(),this.Zr=void 0,this.Gr=void 0,this.ve=0,this.fe=0,this.pe=0,null==(e=La())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.We=!1}this.Xe(t?"no_interaction_since_session_rotated":void 0),this.me=!1}Xe(t,e){var r=(void 0===e?{}:e).preserveLogDedup,i=void 0!==r&&r;if(this.ge=!Vr(t),this.Wr=t,Vr(t))i||(this.Qr=void 0);else if(!this.We){var n=this.sessionId+":"+t;n!==this.Qr&&(this.Qr=n,Fa.info("holding buffer: "+t+". nothing is uploaded until the user interacts with the page"))}}Er(){this.isStarted||(this.be=!0),this.ge&&(this.Xe(void 0),this.me=!1,this.ye&&(this.ye=!1,this.Bt()),this.Jr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents,r=void 0!==e&&e;this.ge=!0,r&&(this.er(),this.Hr()),this.er(),this.jr(),this.er(),this.Vr(),Fa.info("discarded")}Kr(t,e,r,i,n){var s={$snapshot_bytes:r,$snapshot_data:e,$session_id:i,$window_id:n};"disabled"!==this.status?(this.Xr(t,i),this.Yr(s)):this.er()}ti(){try{this.ei()}catch(t){this.Se||(this.Se=!0,Fa.error("could not track full snapshot cost",t))}}ei(){var t,e=null==(t=La())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Gr&&(this.Gr=e,this.Zr&&this.Zr.durationMs>=e.durationMs||(this.Zr=e),500>e.durationMs||Fa.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}Xr(t,e){2!==t.type?3===t.type&&(Vr(this.Re)||this.Re===e||this.Ae===e||(this.Ae=e,Fa.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.Bt())):this.Re=e}ri(t){t.counted&&t.generation===this.De&&(this.Le=Math.max(0,this.Le-1)),t.counted=!1,this.Oe=this.Oe.filter(e=>e!==t)}ii(t,e,r){t.processed||t.generation!==this.De||(t.processed=!0,this.Kr(t.event,e,r,t.targetSessionId,t.targetWindowId))}ni(t){try{var e=t.event,r=as(t.event);if(t.compressionEnabled)try{var i=Xa(t.event);e=i.event,r=i.size}catch(t){Fa.error("could not process queued compression event - will use uncompressed event",t)}try{this.ii(t,e,r)}catch(t){Fa.error("could not capture queued compression event",t)}}finally{this.ri(t)}}Ye(){[...this.Oe].forEach(t=>{this.ni(t)})}oi(t,e,i,n){var s=this,a={event:t,compressionEnabled:e,targetSessionId:i,targetWindowId:n,generation:this.De,processed:!1,counted:!0};this.Oe.push(a),this.Le+=1;var o=function(){var i=r(function*(){try{if(a.processed)return;var r,i;try{var n=e?Va(t)?yield function(t){return Ka.apply(this,arguments)}(t):Xa(t):{event:t,size:as(t)};r=n.event,i=n.size}catch(e){Fa.error("could not process queued compression event - will use uncompressed event",e),r=t,i=as(t)}s.ii(a,r,i)}finally{s.ri(a)}});return function(){return i.apply(this,arguments)}}();this.$r=this.$r?this.$r.catch(()=>{}).then(o):o()}onRRwebEmit(t){var e,r,i,n,s,a,o,u,l;if(this._instance.sessionManager&&(this.Tr(),t&&Gr(t))){if(4===t.type){var h=this.mr(t.data.href);if(this.Mr=h,!h)return;t.data.href=h}else this.Cr();if(null==(e=this.ne)||e.checkUrlTriggers(this.sessionId,()=>this.Or(),()=>this.Lr(),(t,e)=>this.Dr(t,e)),!this.Y.urlBlocked||5===(d=t).type&&"recording paused"===d.data.tag){var d,c,v,f;2===t.type&&(null!=(c=La())&&null!=c.wasMaxDepthReached&&c.wasMaxDepthReached()&&(this._e=!0),this.ti(),Promise.resolve().then(()=>this.ti()),this.Rr(),null==(v=this.zr)||v.reset(),null==(f=this._instance.persistence)||f.register_once({[Sn]:t.timestamp},void 0));var p=2===t.type&&(null==(r=this.ne)?void 0:r.hasPendingTriggers(this.sessionId));p&&this.ai();var g=this.zr?this.zr.throttleMutations(t):t;if(g){var m=function(t){var e=t;if(e&&Gr(e)&&6===e.type&&Gr(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}(g),y=function(t){return eo(t)?t.data.payload:null}(m),b=function(t){return ro(t)?t.data.payload:null}(m),w=function(t){return to(t)?t.data.payload:null}(m);y||b?null!=y&&y.lastActivityTimestamp&&(m.timestamp=y.lastActivityTimestamp):null!=w&&w.sessionId||this.si(m),2===t.type&&(this.Ie.push([this.Xt,t.timestamp]),this.Ie.length>6&&(this.Ie=this.Ie.slice(-6)));var _=null!==(i=null!==(n=null!==(s=null==y?void 0:y.currentSessionId)&&void 0!==s?s:null==b?void 0:b.nextSessionId)&&void 0!==n?n:null==w?void 0:w.sessionId)&&void 0!==i?i:this.Xt,k=null!==(a=null!==(o=null!==(u=null==y?void 0:y.currentWindowId)&&void 0!==u?u:null==b?void 0:b.nextWindowId)&&void 0!==o?o:null==w?void 0:w.windowId)&&void 0!==a?a:this.He;if(!0!==this.ce||function(t){return to(t)||eo(t)||ro(t)}(m)){2===m.type&&(this.de=0),w&&(m.timestamp=w.lastActivityTimestamp+w.threshold);var S=this.se;this.se=!0,p?this._r(!0):S||this._r();var M=null===(l=this._instance.config.session_recording.compress_events)||void 0===l||l;if(this.Le>0||M&&Va(m))this.oi(m,M,_,k);else{var C=M?Xa(m):{event:m,size:as(m)};this.Kr(m,C.event,C.size,_,k)}}else(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source})(m)&&this.de++}else!0===this.ce&&this.de++}}}get status(){return this.ne?this.ne.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.ee,rrwebError:this.we,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.re}):Ln}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.et.linkedFlagSeen=!0,this.Bt(),this.Er(),this.jt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[gn]:this.sessionId,[dn]:null}),this.Bt(),this.Er(),this.jt("sampling_overridden")}overrideTrigger(t){this.Dr(t),this.Er()}ui(){try{var t,e=null==Nr||null==(t=Nr.location)?void 0:t.href;if(!e)return;var r=this.mr(e);if(!r)return;return new URL(r).hostname||void 0}catch(t){return}}Br(){this.li&&(clearTimeout(this.li),this.li=void 0)}Jr(){this.li||(this.li=setTimeout(()=>{this.tr()},2e3))}hi(){return this.Re!==this.Rt.sessionId&&0!==this.Rt.data.length&&this.Rt.data.every(t=>5===(null==t?void 0:t.type)&&!eo(t)&&!ro(t))}ci(){var t,e;return null!==(t=null==(e=this.ne)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}di(t){if("buffering"!==t)return Vr(this.fi)||this._instance.register_for_session({[xn]:[]}),void(this.fi=void 0);var e=this.ci();if(0===e.length)return Vr(this.fi)||this._instance.register_for_session({[xn]:[]}),void(this.fi=void 0);var r=e.join(", "),i=this.sessionId+":"+r;i!==this.fi&&(this.fi=i,this._instance.register_for_session({[xn]:e}),Fa.info("buffering: "+r))}pi(){var t;return"memory"!==this._instance.config.persistence&&!0!==(null==(t=this._instance.persistence)?void 0:t.gi)&&qs.Et()}mi(){0!==this.Rt.data.length&&this.Rt.size!==this.yi&&943718.4>=this.Rt.size&&this.pi()&&(this.yi=this.Rt.size,qs.Ot(this.sr,this.Rt))}Fr(){if(!this.Ee&&this.pi()){this.Ee=!0;var t=qs.Nt(this.sr);qs.Dt(this.sr),Gr(t)&&Hr(t.data)&&0!==t.data.length&&Hr(t.sizes)&&t.sizes.length===t.data.length&&Xr(t.size)&&t.sessionId===this.Xt&&t.windowId===this.He&&(this.Rt.data.length>0||(this.Rt=t))}}tr(t){var e;if(void 0===t&&(t=!1),this.Br(),this.ge)return this.Rt;if(this.hi())return this.Rt.size>943718.4?this.er():(t&&this.mi(),this.Rt);var r=this.Rt;null==(e=this.ne)||e.ensureSamplingDecision(this.sessionId);var i=this.Ge(),n=this.status;if(this.di(n),"buffering"===n||"paused"===n||"disabled"===n||i)return!t||"active"!==n&&"sampled"!==n||this.mi(),this.Jr(),this.Rt;if(this.Rt!==r)return this.Rt;if(r.data.length>0){var s,a=this.ui();us(r).forEach(t=>{try{var e;null==(e=this.$e)||e.trackSize(t.sessionId,t.size),this.bi({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:Gs.LIB_NAME,$lib_version:Gs.LIB_VERSION,$snapshot_host:a})}catch(t){Fa.warn("could not capture snapshot chunk - skipping it",t)}}),Vr(this.yi)||(qs.Dt(this.sr),this.yi=void 0),null==(s=this.ne)||s.onFlushComplete()}return this.er()}Yr(t){var e,r=2+((null==(e=this.Rt)?void 0:e.data.length)||0),i=t.$session_id,n=this.Rt.sessionId!==i;if(n||!0!==this.ce&&!this.ge&&this.Rt.size+t.$snapshot_bytes+r>943718.4){var s=this.Xt;if(this.Rt=this.tr(),this.Xt!==s)return;n&&this.Rt.data.length>0&&(this.Rt=this.er()),this.Rt.sessionId=i,this.Rt.windowId=t.$window_id}this.ge&&(this.ye||this.Rt.size+t.$snapshot_bytes+r>943718.4)?this.ye||(this.ye=!0,this.Rt=this.er()):(this.Rt.size+=t.$snapshot_bytes,this.Rt.data.push(t.$snapshot_data),this.Rt.sizes.push(t.$snapshot_bytes),!0===this.ce||this.ge||this.Jr())}bi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.oe),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Qe(){var t,e,r=null==(t=this.Rt)?void 0:t.data[(null==(e=this.Rt)?void 0:e.data.length)-1];return r?r.timestamp-this._sessionStartTimestamp:null}ai(){if(!this.Rt||0===this.Rt.data.length)return this.er();for(var t=-1,e=this.Rt.data.length-1;e>=0;e--)if(4===this.Rt.data[e].type){t=e;break}return 0>t?this.er():(this.Rt.data=this.Rt.data.slice(t),this.Rt.sizes=this.Rt.sizes.slice(t),this.Rt.size=this.Rt.sizes.reduce((t,e)=>t+e,0),this.Rt)}er(){return this.Rt={size:0,data:[],sizes:[],sessionId:this.Xt,windowId:this.He},this.Rt}jt(t,e){this._instance.register_for_session({[Nn]:t}),Fa.info(t.replace("_"," "),e),"session_id_changed"!==t&&this.Vt("$recording_started",i({reason:t},e))}wi(t){var e;return 3===t.type&&-1!==Da.indexOf(null==(e=t.data)?void 0:e.source)}si(t){var e=this.wi(t);e||!0===this.ce||t.timestamp-this.ue>this.te&&(this.ce=!0,clearInterval(this.Ar),this.Vt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.ue,threshold:this.te,bufferLength:this.Rt.data.length,bufferSize:this.Rt.size,sessionId:this.Xt,windowId:this.He}),this.tr());var r=this.Yt.checkAndGetSessionAndWindowId(!e,t.timestamp),i=r.windowId,n=r.sessionId,s=!1;if(e&&(this.ue=t.timestamp,this.ce)){var a="unknown"===this.ce;this.ce=!1,a||(this.Vt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),s=!0)}var o=this.Xt!==n,u=this.He!==i;if(this.He=i,this.Xt=n,o||u){var l=o&&!1!==this.ce;l&&(this.ce="unknown"),this.Ue(l)}else if(e&&this.Er(),s){var h,d=["sampled","active"].includes(this.status)||(null==(h=this.ne)?void 0:h.hasPendingTriggers(this.sessionId));this.de>0&&d&&this.Bt(),this._r(),this.Rr()}}ze(){var t;null==(t=this.ne)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,r,i,n,s,a,o,u,l=null==(t=La())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Wr,$sdk_debug_replay_internal_buffer_length:this.Rt.data.length,$sdk_debug_replay_internal_buffer_size:this.Rt.size,$sdk_debug_current_session_duration:this.Qe,$sdk_debug_session_start:this._sessionStartTimestamp,$sdk_debug_replay_flushed_size:null==(e=this.$e)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.Ie,$snapshot_max_depth_exceeded:this._e,$sdk_debug_replay_slowest_full_snapshot_ms:xa(null==(r=this.Zr)?void 0:r.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:xa(null==(i=this.Zr)?void 0:i.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Zr)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(s=this.Zr)?void 0:s.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.Zr)?void 0:a.nonDeferrableCssRuleCount,$sdk_debug_replay_deferred_stylesheets:null==l?void 0:l.deferredCount,$sdk_debug_replay_deferred_stylesheets_failed:null==l?void 0:l.failedCount,$sdk_debug_replay_deferred_stylesheets_abandoned:null==l?void 0:l.abandonedCount,$sdk_debug_replay_deferred_stylesheet_ms:xa(null==l?void 0:l.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:xa(null==l?void 0:l.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:xa(null==(o=La())||null==o.getMutationCost||null==(o=o.getMutationCost())?void 0:o.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(u=La())||null==u.getDiscardedDurationSamples?void 0:u.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.ve,$sdk_debug_replay_oversized_mutations_dropped:this.fe,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.pe,$sdk_debug_replay_rrweb_error:this.we,[Fn]:!!this.ae,[Dn]:this.ke}}qr(){var t;if(!this.ae){this.ke=!0;var e,r,n,s,a={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,maskAllElementAttributes:!1,maskAttributeFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,inlineStylesheetBudgetRules:1e4,recordCrossOriginIframes:!1,sampling:void 0,attributeFilter:void 0},o=this._instance.config.session_recording;for(var u of Object.entries(o||{})){var l=u[0],h=u[1];if(l in a)if("maskInputOptions"===l)a.maskInputOptions=i({password:!0},h);else if("sampling"===l){var d=null!=h?h:{},c={};Vr(d.mousemove)||(c.mousemove=d.mousemove),Vr(d.mouseInteraction)||(c.mouseInteraction=d.mouseInteraction),a.sampling=c}else a[l]=h}!0===(null==o?void 0:o.captureJsonLd)&&!0!==a.slimDOMOptions&&"all"!==a.slimDOMOptions&&(a.slimDOMOptions=i({},a.slimDOMOptions,{script:!0})),this.cr&&this.cr.enabled&&(a.recordCanvas=!0,a.sampling=i({},a.sampling,{canvas:this.cr.fps}),a.dataURLOptions={type:"image/webp",quality:this.cr.quality},a.canvasResolutionScale=this.hr,a.canvasMasking={configured:()=>{var t;return qr(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,r=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(qr(r))try{var i;return null!==(i=r(t))&&void 0!==i?i:null}catch(t){return this.Me||(this.Me=!0,Fa.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.ur&&(a.maskAllInputs=null===(e=this.ur.maskAllInputs)||void 0===e||e,a.maskTextSelector=null!==(r=this.ur.maskTextSelector)&&void 0!==r?r:void 0,a.blockSelector=null!==(n=this.ur.blockSelector)&&void 0!==n?n:void 0,a.maskAllElementAttributes=null!==(s=this.ur.maskAllElementAttributes)&&void 0!==s&&s),a.maskAllElementAttributes&&a.maskAttributeFn&&(a.maskAttributeFn=void 0,this.Ce||(this.Ce=!0,Fa.warn('`maskAllElementAttributes` and `maskAttributeFn` are mutually exclusive, and `maskAttributeFn` is being ignored. Remove one of the two. Note that `maskAllElementAttributes` can also come from your project\'s "Privacy and masking" settings. See https://posthog.com/docs/session-replay/privacy'))),this.lr();var v=Pa();if(v){this.zr=null!==(t=this.zr)&&void 0!==t?t:new Us(v,{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";Fa.info(r,{node:e}),this.log("[SessionRecording] "+r,"warn")},onDroppedAttributeMutations:t=>this.ve+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.Ir,onDroppedOversizedMutation:t=>{0===this.fe&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.fe+=1,this.pe+=t},requestFullSnapshot:()=>this.Bt()});var f=this.pr();if(this.ae=v(i({emit:t=>{this.onRRwebEmit(t)},plugins:f,errorHandler:(t,e)=>"rrweb"===e&&(this.Te||(this.Te=!0,Fa.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},a)),!this.ae)return this.we=!0,void Fa.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.we=!1,!0===(null==o?void 0:o.captureJsonLd)&&Pr&&null!=Nr&&Nr.MutationObserver&&!this.Sr&&(this.Sr=function(t,e,r){var i=new WeakMap,n=r.getCaptureState||(()=>!0),s=aa,a=function(t,e){var r=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||null!=r&&r.length&&!r.includes("id")?la:r=>{var i=t.getElementById(r);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!Ra(i,e.blockClass,e.blockSelector)}}(t,r),o=e=>{try{var o=n();if(!s||!1===o||!e.isConnected||e.ownerDocument!==t||function(t,e){return Ra(t,e.blockClass,e.blockSelector)||Ra(t,e.maskTextClass,e.maskTextSelector)}(e,r))return;var u=function(t,e){if(void 0===e&&(e=la),!t||t.length>aa)return null;try{var r=JSON.parse(t),i={remainingNodes:2048,exceeded:!1},n=Hr(r)?r.map(t=>Ma(t,e,i)):Ma(r,e,i);if(i.exceeded||Jr(n)||Hr(n)&&(!n.length||n.some(Jr)))return null;var s=JSON.stringify(n);return s.length>2e4?null:[n,s]}catch(t){return null}}(e.text,a);if(!u)return void i.delete(e);var l=u[0],h=u[1];if(Jr(o))return void i.set(e,h);if(i.get(e)!==h){if(h.length>s)return void(s=0);r.emit(l)&&(i.set(e,h),s-=h.length)}}catch(t){return}};try{var u=new e(t=>{try{if(!s||!1===n())return;var e=t=>{for(var e of Aa(t))o(e)};for(var r of t)if("childList"===r.type)Ca(r.target)&&o(r.target),r.addedNodes.forEach(e);else if("characterData"===r.type){var i=r.target.parentNode;i&&Ca(i)&&o(i)}else"attributes"===r.type&&Ca(r.target)&&o(r.target)}catch(t){return}});return u.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),s&&!1!==n()&&Aa(t.documentElement).forEach(t=>{e&&i.delete(t),o(t)})},stop(){return u.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(Pr,Nr.MutationObserver,{attributeFilter:a.attributeFilter,blockClass:a.blockClass,blockSelector:a.blockSelector,isRecordedElement:t=>v.mirror.getId(t)>0,maskAllElementAttributes:a.maskAllElementAttributes,maskAttributeFn:a.maskAttributeFn,maskTextClass:a.maskTextClass,maskTextSelector:a.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.wr()},emit:t=>this.kr(t)}),this.Y.isCurrentUrlBlocked()&&this.Sr.scan()),this.ue=Date.now(),this.ce=Kr(this.ce)?this.ce:"unknown",this.tryAddCustomEvent("$remote_config_received",this.re),this.Vt("$session_options",{sessionRecordingOptions:a,activePlugins:f.map(t=>null==t?void 0:t.name)}),this.Vt("$posthog_config",{config:this._instance.config})}else Fa.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Vt(t,e)}};jr.__PosthogExtensions__=jr.__PosthogExtensions__||{},jr.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:t=>({name:"rrweb/console@1",observer:Dr,options:t}),getRecordNetworkPlugin:t=>({name:"rrweb/network@1",observer:ln,options:t})},jr.__PosthogExtensions__.rrweb={record:br,version:"v2",wasMaxDepthReached:()=>qt,resetMaxDepthState(){qt=!1,Ht=!1},getLastSnapshotCost:()=>F,getMutationCost:()=>i({},B),getDeferredStylesheetStats:()=>i({},j),getDiscardedDurationSamples:()=>C,resetSnapshotCostState(){x=0,T=0,E=0,M=0,C=0,O={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},F=null,D=null,N=[],L=0,P=0,B={slowestBatchMs:0},j={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},jr.__PosthogExtensions__.initSessionRecording=(t,e)=>new io(t,e)}()}();
|
|
2
2
|
//# sourceMappingURL=posthog-recorder.js.map
|