posthog-js 1.115.0 → 1.115.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- !function(){"use strict";var e,t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};
1
+ !function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){c(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(){n=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),a=new C(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return A()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=I(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=l(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var d={};function f(){}function p(){}function h(){}var g={};u(g,o,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(S([])));m&&m!==t&&r.call(m,o)&&(g=m);var y=h.prototype=f.prototype=Object.create(g);function _(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function n(i,o,a,s){var u=l(e[i],e,o);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function I(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,I(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:A}}function A(){return{value:void 0,done:!0}}return p.prototype=h,u(y,"constructor",h),u(h,"constructor",p),p.displayName=u(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,u(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},_(b.prototype),u(b.prototype,a,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new b(c(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(y),u(y,s,"Generator"),u(y,o,(function(){return this})),u(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=S,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,u,"next",e)}function u(e){i(a,r,o,s,u,"throw",e)}s(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=p(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}var v;function m(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function y(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function _(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(b).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function b(e){var t;if(function(e){return"styleSheet"in e}(e))try{t=_(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}return function(e){if(e.includes(":")){var t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}return e}(t||e.cssText)}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(v||(v={}));var I=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function w(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.value,a=e.maskInputFn,s=o||"",u=i&&k(i);return(n[r.toLowerCase()]||u&&n[u])&&(s=a?a(s,t):"*".repeat(s.length)),s}function k(e){return e.toLowerCase()}var C="__rrweb_original__";function S(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?k(t):null}var A,R,F=1,E=new RegExp("[^a-z0-9-_:]"),T=-2;function x(){return F++}var M=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,O=/^(?:[a-z+]+:)?\/\//i,N=/^www\..*/i,L=/^(data:)([^,]*),(.*)/i;function D(e,t){return(e||"").replace(M,(function(e,n,r,i,o,a){var s,u=r||o||a,c=n||i||"";if(!u)return e;if(O.test(u)||N.test(u))return"url(".concat(c).concat(u).concat(c,")");if(L.test(u))return"url(".concat(c).concat(u).concat(c,")");if("/"===u[0])return"url(".concat(c).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)).concat(c,")");var l=t.split("/"),d=u.split("/");l.pop();for(var f=0,p=d;f<p.length;f++){var h=p[f];"."!==h&&(".."===h?l.pop():l.push(h))}return"url(".concat(c).concat(l.join("/")).concat(c,")")}))}var P=/^[^ \t\n\r\u000c]+/,B=/^[, \t\n\r\u000c]+/;function q(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function W(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function V(){var e=document.createElement("a");return e.href="",e.href}function H(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?q(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}for(var i=[];r(B),!(n>=t.length);){var o=r(P);if(","===o.slice(-1))o=q(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=q(e,o);for(var s=!1;;){var u=t.charAt(n);if(""===u){i.push((o+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,i.push((o+a).trim());break}"("===u&&(s=!0)}a+=u,n+=1}}}return i.join(", ")}(e,r):"style"===n?D(r,V()):"object"===t&&"data"===n?q(e,r):r:q(e,r):r}function G(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function U(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&U(e.parentNode,t,n);for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&U(e.parentNode,t,n)}function j(e,t,n){try{var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(r.closest(".".concat(t)))return!0}else if(U(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}}catch(e){}return!1}function $(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,u=t.inlineStylesheet,c=t.maskInputOptions,l=void 0===c?{}:c,d=t.maskTextFn,f=t.maskInputFn,p=t.dataURLOptions,h=void 0===p?{}:p,g=t.inlineImages,m=t.recordCanvas,y=t.keepIframeSrcFn,b=t.newlyAddedElement,I=void 0!==b&&b,F=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:v.Document,childNodes:[],compatMode:e.compatMode}:{type:v.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:v.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:F};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,r=t.blockClass,i=t.blockSelector,o=t.inlineStylesheet,a=t.maskInputOptions,s=void 0===a?{}:a,u=t.maskInputFn,c=t.dataURLOptions,l=void 0===c?{}:c,d=t.inlineImages,f=t.recordCanvas,p=t.keepIframeSrcFn,h=t.newlyAddedElement,g=void 0!==h&&h,m=t.rootId,y=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,i),b=function(e){if(e instanceof HTMLFormElement)return"form";var t=k(e.tagName);return E.test(t)?"div":t}(e),I={},F=e.attributes.length,T=0;T<F;T++){var x=e.attributes[T];G(b,x.name,x.value)||(I[x.name]=H(n,b,k(x.name),x.value))}if("link"===b&&o){var M=Array.from(n.styleSheets).find((function(t){return t.href===e.href})),O=null;M&&(O=_(M)),O&&(delete I.rel,delete I.href,I._cssText=D(O,M.href))}if("style"===b&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(O=_(e.sheet))&&(I._cssText=D(O,V()))}if("input"===b||"textarea"===b||"select"===b){var N=e.value,L=e.checked;if("radio"!==I.type&&"checkbox"!==I.type&&"submit"!==I.type&&"button"!==I.type&&N){var P=S(e);I.value=w({element:e,type:P,tagName:b,value:N,maskInputOptions:s,maskInputFn:u})}else L&&(I.checked=L)}"option"===b&&(e.selected&&!s.select?I.selected=!0:delete I.selected);if("canvas"===b&&f)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var i=t.getImageData,o=C in i?i[C]:i;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(I.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){var B=e.toDataURL(l.type,l.quality),q=document.createElement("canvas");q.width=e.width,q.height=e.height,B!==q.toDataURL(l.type,l.quality)&&(I.rr_dataURL=B)}if("img"===b&&d){A||(A=n.createElement("canvas"),R=A.getContext("2d"));var U=e,j=U.crossOrigin;U.crossOrigin="anonymous";var $=function e(){U.removeEventListener("load",e);try{A.width=U.naturalWidth,A.height=U.naturalHeight,R.drawImage(U,0,0),I.rr_dataURL=A.toDataURL(l.type,l.quality)}catch(e){console.warn("Cannot inline img src=".concat(U.currentSrc,"! Error: ").concat(e))}j?I.crossOrigin=j:U.removeAttribute("crossorigin")};U.complete&&0!==U.naturalWidth?$():U.addEventListener("load",$)}"audio"!==b&&"video"!==b||(I.rr_mediaState=e.paused?"paused":"played",I.rr_mediaCurrentTime=e.currentTime);g||(e.scrollLeft&&(I.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(I.rr_scrollTop=e.scrollTop));if(y){var Z=e.getBoundingClientRect(),K=Z.width,z=Z.height;I={class:I.class,rr_width:"".concat(K,"px"),rr_height:"".concat(z,"px")}}"iframe"!==b||p(I.src)||(e.contentDocument||(I.rr_src=I.src),delete I.src);return{type:v.Element,tagName:b,attributes:I,childNodes:[],isSVG:W(e)||void 0,needBlock:y,rootId:m}}(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:u,maskInputOptions:l,maskInputFn:f,dataURLOptions:h,inlineImages:g,recordCanvas:m,keepIframeSrcFn:y,newlyAddedElement:I,rootId:F});case e.TEXT_NODE:return function(e,t){var n,r=t.maskTextClass,i=t.maskTextSelector,o=t.maskTextFn,a=t.rootId,s=e.parentNode&&e.parentNode.tagName,u=e.textContent,c="STYLE"===s||void 0,l="SCRIPT"===s||void 0;if(c&&u){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(u=_(e.parentNode.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}u=D(u,V())}l&&(u="SCRIPT_PLACEHOLDER");!c&&!l&&u&&j(e,r,i)&&(u=o?o(u):u.replace(/[\S]/g,"*"));return{type:v.Text,textContent:u||"",isStyle:c,rootId:a}}(e,{maskTextClass:a,maskTextSelector:s,maskTextFn:d,rootId:F});case e.CDATA_SECTION_NODE:return{type:v.CDATA,textContent:"",rootId:F};case e.COMMENT_NODE:return{type:v.Comment,textContent:e.textContent||"",rootId:F};default:return!1}}function Z(e){return null==e?"":e.toLowerCase()}function K(e,t){var n,r=t.doc,i=t.mirror,o=t.blockClass,a=t.blockSelector,s=t.maskTextClass,u=t.maskTextSelector,c=t.skipChild,l=void 0!==c&&c,d=t.inlineStylesheet,f=void 0===d||d,p=t.maskInputOptions,h=void 0===p?{}:p,g=t.maskTextFn,_=t.maskInputFn,b=t.slimDOMOptions,I=t.dataURLOptions,w=void 0===I?{}:I,k=t.inlineImages,C=void 0!==k&&k,S=t.recordCanvas,A=void 0!==S&&S,R=t.onSerialize,F=t.onIframeLoad,E=t.iframeLoadTimeout,M=void 0===E?5e3:E,O=t.onStylesheetLoad,N=t.stylesheetLoadTimeout,L=void 0===N?5e3:N,D=t.keepIframeSrcFn,P=void 0===D?function(){return!1}:D,B=t.newlyAddedElement,q=void 0!==B&&B,W=t.preserveWhiteSpace,V=void 0===W||W,H=$(e,{doc:r,mirror:i,blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:u,inlineStylesheet:f,maskInputOptions:h,maskTextFn:g,maskInputFn:_,dataURLOptions:w,inlineImages:C,recordCanvas:A,keepIframeSrcFn:P,newlyAddedElement:q});if(!H)return console.warn(e,"not serialized"),null;n=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===v.Comment)return!0;if(e.type===v.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Z(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Z(e.attributes.name)||"icon"===Z(e.attributes.rel)||"apple-touch-icon"===Z(e.attributes.rel)||"shortcut icon"===Z(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Z(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Z(e.attributes.property).match(/^(og|twitter|fb):/)||Z(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Z(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Z(e.attributes.name)||"googlebot"===Z(e.attributes.name)||"bingbot"===Z(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Z(e.attributes.name)||"generator"===Z(e.attributes.name)||"framework"===Z(e.attributes.name)||"publisher"===Z(e.attributes.name)||"progid"===Z(e.attributes.name)||Z(e.attributes.property).match(/^article:/)||Z(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Z(e.attributes.name)||"yandex-verification"===Z(e.attributes.name)||"csrf-token"===Z(e.attributes.name)||"p:domain_verify"===Z(e.attributes.name)||"verify-v1"===Z(e.attributes.name)||"verification"===Z(e.attributes.name)||"shopify-checkout-api-token"===Z(e.attributes.name)))return!0}}return!1}(H,b)&&(V||H.type!==v.Text||H.isStyle||H.textContent.replace(/^\s+|\s+$/gm,"").length)?x():T;var G=Object.assign(H,{id:n});if(i.add(e,G),n===T)return null;R&&R(e);var U=!l;if(G.type===v.Element){U=U&&!G.needBlock,delete G.needBlock;var j=e.shadowRoot;j&&y(j)&&(G.isShadowHost=!0)}if((G.type===v.Document||G.type===v.Element)&&U){b.headWhitespace&&G.type===v.Element&&"head"===G.tagName&&(V=!1);for(var z={doc:r,mirror:i,blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:u,skipChild:l,inlineStylesheet:f,maskInputOptions:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:b,dataURLOptions:w,inlineImages:C,recordCanvas:A,preserveWhiteSpace:V,onSerialize:R,onIframeLoad:F,iframeLoadTimeout:M,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:P},Y=0,J=Array.from(e.childNodes);Y<J.length;Y++){(ee=K(J[Y],z))&&G.childNodes.push(ee)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var Q=0,X=Array.from(e.shadowRoot.childNodes);Q<X.length;Q++){var ee;(ee=K(X[Q],z))&&(y(e.shadowRoot)&&(ee.isShadow=!0),G.childNodes.push(ee))}}return e.parentNode&&m(e.parentNode)&&y(e.parentNode)&&(G.isShadow=!0),G.type===v.Element&&"iframe"===G.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){var a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&F){var n=K(t,{doc:t,mirror:i,blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:b,dataURLOptions:w,inlineImages:C,recordCanvas:A,preserveWhiteSpace:V,onSerialize:R,onIframeLoad:F,iframeLoadTimeout:M,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:P});n&&F(e,n)}}),M),G.type===v.Element&&"link"===G.tagName&&"stylesheet"===G.attributes.rel&&function(e,t,n){var r,i=!1;try{r=e.sheet}catch(e){return}if(!r){var o=setTimeout((function(){i||(t(),i=!0)}),n);e.addEventListener("load",(function(){clearTimeout(o),i=!0,t()}))}}(e,(function(){if(O){var t=K(e,{doc:r,mirror:i,blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:u,skipChild:!1,inlineStylesheet:f,maskInputOptions:h,maskTextFn:g,maskInputFn:_,slimDOMOptions:b,dataURLOptions:w,inlineImages:C,recordCanvas:A,preserveWhiteSpace:V,onSerialize:R,onIframeLoad:F,iframeLoadTimeout:M,onStylesheetLoad:O,stylesheetLoadTimeout:L,keepIframeSrcFn:P});t&&O(e,t)}}),L),G}function z(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var Y="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.",J={map:{},getId:function(){return console.error(Y),-1},getNode:function(){return console.error(Y),null},removeNodeFromMap:function(){console.error(Y)},has:function(){return console.error(Y),!1},reset:function(){console.error(Y)}};function Q(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,i=0;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var u=Date.now();i||!1!==n.leading||(i=u);var c=t-(u-i),l=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),i=u,e.apply(l,a)):r||!1===n.trailing||(r=setTimeout((function(){i=!1===n.leading?0:Date.now(),r=null,e.apply(l,a)}),c))}}function X(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),o&&o.set&&o.set.call(this,e)}}),function(){return X(e,t,o||{},!0)}}function ee(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(J=new Proxy(J,{get:function(e,t,n){return"map"===t&&console.error(Y),Reflect.get(e,t,n)}}));var te=Date.now;function ne(e){var t,n,r,i,o,a,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==s?void 0:s.documentElement.scrollLeft)||(null===(n=null===(t=null==s?void 0:s.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==s?void 0:s.body)||void 0===r?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null===(o=null===(i=null==s?void 0:s.body)||void 0===i?void 0:i.parentElement)||void 0===o?void 0:o.scrollTop)||(null===(a=null==s?void 0:s.body)||void 0===a?void 0:a.scrollTop)||0}}function re(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ie(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function oe(e,t,n,r){if(!e)return!1;var i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if(U(i,t,r))return!0}catch(e){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function ae(e,t){return t.getId(e)===T}function se(e,t){if(m(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||se(e.parentNode,t))}function ue(e){return Boolean(e.changedTouches)}function ce(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function le(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function de(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(te=function(){return(new Date).getTime()});var fe=function(){function e(){a(this,e),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return u(e,[{key:"getId",value:function(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]),e}();function pe(e){var t,n,r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function he(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=pe(n);)n=t;return n}(e);return t.contains(n)}function ge(e){var t=e.ownerDocument;return!!t&&(t.contains(e)||he(e))}var ve=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(ve||{}),me=function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e}(me||{}),ye=function(e){return e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e}(ye||{}),_e=function(e){return e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e}(_e||{}),be=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(be||{});function Ie(e){return"__ln"in e}var we,ke=function(){function e(){a(this,e),this.length=0,this.head=null,this.tail=null}return u(e,[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}},{key:"addNode",value:function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ie(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Ie(e.nextSibling)&&e.nextSibling.__ln.previous){var r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}},{key:"removeNode",value:function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}]),e}(),Ce=function(e,t){return"".concat(e,"@").concat(t)},Se=function(){function e(){var t=this;a(this,e),this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.unattachedDoc=null,this.processMutations=function(e){e.forEach(t.processMutation),t.emit()},this.emit=function(){if(!t.frozen&&!t.locked){for(var e=[],n=new Set,r=new ke,i=function(e){for(var n=e,r=T;r===T;)r=(n=n&&n.nextSibling)&&t.mirror.getId(n);return r},o=function(o){if(o.parentNode&&ge(o)){var a=m(o.parentNode)?t.mirror.getId(pe(o)):t.mirror.getId(o.parentNode),s=i(o);if(-1===a||-1===s)return r.addNode(o);var u=K(o,{doc:t.doc,mirror:t.mirror,blockClass:t.blockClass,blockSelector:t.blockSelector,maskTextClass:t.maskTextClass,maskTextSelector:t.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:t.inlineStylesheet,maskInputOptions:t.maskInputOptions,maskTextFn:t.maskTextFn,maskInputFn:t.maskInputFn,slimDOMOptions:t.slimDOMOptions,dataURLOptions:t.dataURLOptions,recordCanvas:t.recordCanvas,inlineImages:t.inlineImages,onSerialize:function(e){ce(e,t.mirror)&&t.iframeManager.addIframe(e),le(e,t.mirror)&&t.stylesheetManager.trackLinkElement(e),de(o)&&t.shadowDomManager.addShadowRoot(o.shadowRoot,t.doc)},onIframeLoad:function(e,n){t.iframeManager.attachIframe(e,n),t.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,n){t.stylesheetManager.attachLinkElement(e,n)}});u&&(e.push({parentId:a,nextId:s,node:u}),n.add(u.id))}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());var a,s=g(t.movedSet);try{for(s.s();!(a=s.n()).done;){var u=a.value;Re(t.removes,u,t.mirror)&&!t.movedSet.has(u.parentNode)||o(u)}}catch(e){s.e(e)}finally{s.f()}var c,l=g(t.addedSet);try{for(l.s();!(c=l.n()).done;){var d=c.value;Ee(t.droppedSet,d)||Re(t.removes,d,t.mirror)?Ee(t.movedSet,d)?o(d):t.droppedSet.add(d):o(d)}}catch(e){l.e(e)}finally{l.f()}for(var f=null;r.length;){var p=null;if(f){var h=t.mirror.getId(f.value.parentNode),v=i(f.value);-1!==h&&-1!==v&&(p=f)}if(!p)for(var y=r.tail;y;){var _=y;if(y=y.previous,_){var b=t.mirror.getId(_.value.parentNode);if(-1===i(_.value))continue;if(-1!==b){p=_;break}var I=_.value;if(I.parentNode&&I.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var w=I.parentNode.host;if(-1!==t.mirror.getId(w)){p=_;break}}}}if(!p){for(;r.head;)r.removeNode(r.head.value);break}f=p.previous,r.removeNode(p.value),o(p.value)}var k={texts:t.texts.map((function(e){return{id:t.mirror.getId(e.node),value:e.value}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),attributes:t.attributes.map((function(e){var n=e.attributes;if("string"==typeof n.style){var r=JSON.stringify(e.styleDiff),i=JSON.stringify(e._unchangedStyles);r.length<n.style.length&&(r+i).split("var(").length===n.style.split("var(").length&&(n.style=e.styleDiff)}return{id:t.mirror.getId(e.node),attributes:n}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),removes:t.removes,adds:e};(k.texts.length||k.attributes.length||k.removes.length||k.adds.length)&&(t.texts=[],t.attributes=[],t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.movedMap={},t.mutationCb(k))}},this.processMutation=function(e){if(!ae(e.target,t.mirror))switch(e.type){case"characterData":var n=e.target.textContent;oe(e.target,t.blockClass,t.blockSelector,!1)||n===e.oldValue||t.texts.push({value:j(e.target,t.maskTextClass,t.maskTextSelector)&&n?t.maskTextFn?t.maskTextFn(n):n.replace(/[\S]/g,"*"):n,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,o=e.target.getAttribute(i);if("value"===i){var a=S(r);o=w({element:r,maskInputOptions:t.maskInputOptions,tagName:r.tagName,type:a,value:o,maskInputFn:t.maskInputFn})}if(oe(e.target,t.blockClass,t.blockSelector,!1)||o===e.oldValue)return;var s=t.attributes.find((function(t){return t.node===e.target}));if("IFRAME"===r.tagName&&"src"===i&&!t.keepIframeSrcFn(o)){if(r.contentDocument)return;i="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(s)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!G(r.tagName,i)&&(s.attributes[i]=H(t.doc,k(r.tagName),k(i),o),"style"===i)){if(!t.unattachedDoc)try{t.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){t.unattachedDoc=t.doc}var u=t.unattachedDoc.createElement("span");e.oldValue&&u.setAttribute("style",e.oldValue);for(var c=0,l=Array.from(r.style);c<l.length;c++){var d=l[c],f=r.style.getPropertyValue(d),p=r.style.getPropertyPriority(d);f!==u.style.getPropertyValue(d)||p!==u.style.getPropertyPriority(d)?s.styleDiff[d]=""===p?f:[f,p]:s._unchangedStyles[d]=[f,p]}for(var h=0,g=Array.from(u.style);h<g.length;h++){var v=g[h];""===r.style.getPropertyValue(v)&&(s.styleDiff[v]=!1)}}break;case"childList":if(oe(e.target,t.blockClass,t.blockSelector,!0))return;e.addedNodes.forEach((function(n){return t.genAdds(n,e.target)})),e.removedNodes.forEach((function(n){var r=t.mirror.getId(n),i=m(e.target)?t.mirror.getId(e.target.host):t.mirror.getId(e.target);oe(e.target,t.blockClass,t.blockSelector,!1)||ae(n,t.mirror)||!function(e,t){return-1!==t.getId(e)}(n,t.mirror)||(t.addedSet.has(n)?(Ae(t.addedSet,n),t.droppedSet.add(n)):t.addedSet.has(e.target)&&-1===r||se(e.target,t.mirror)||(t.movedSet.has(n)&&t.movedMap[Ce(r,i)]?Ae(t.movedSet,n):t.removes.push({parentId:i,id:r,isShadow:!(!m(e.target)||!y(e.target))||void 0})),t.mapRemoves.push(n))}))}},this.genAdds=function(e,n){if(!t.processedNodeManager.inOtherBuffer(e,t)&&!t.addedSet.has(e)&&!t.movedSet.has(e)){if(t.mirror.hasNode(e)){if(ae(e,t.mirror))return;t.movedSet.add(e);var r=null;n&&t.mirror.hasNode(n)&&(r=t.mirror.getId(n)),r&&-1!==r&&(t.movedMap[Ce(t.mirror.getId(e),r)]=!0)}else t.addedSet.add(e),t.droppedSet.delete(e);oe(e,t.blockClass,t.blockSelector,!1)||(e.childNodes.forEach((function(e){return t.genAdds(e)})),de(e)&&e.shadowRoot.childNodes.forEach((function(n){t.processedNodeManager.add(n,t),t.genAdds(n,e)})))}}}return u(e,[{key:"init",value:function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((function(n){t[n]=e[n]}))}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]),e}();function Ae(e,t){e.delete(t),t.childNodes.forEach((function(t){return Ae(e,t)}))}function Re(e,t,n){return 0!==e.length&&Fe(e,t,n)}function Fe(e,t,n){var r=t.parentNode;if(!r)return!1;var i=n.getId(r);return!!e.some((function(e){return e.id===i}))||Fe(e,r,n)}function Ee(e,t){return 0!==e.size&&Te(e,t)}function Te(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||Te(e,n))}function xe(e){we=e}function Me(){we=void 0}var Oe=function(e){if(!we)return e;return function(){try{return e.apply(void 0,arguments)}catch(e){if(we&&!0===we(e))return;throw e}}},Ne=[];function Le(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function De(e,t){var n,r,i=new Se;Ne.push(i),i.init(e);var o=window.MutationObserver||window.__rrMutationObserver,a=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");a&&window[a]&&(o=window[a]);var s=new o(Oe(i.processMutations.bind(i)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function Pe(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,a=e.sampling;if(!1===a.mouseInteraction)return function(){};var s=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],c=null;return Object.keys(ye).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(e){var a=k(e),s=function(e){return function(n){var a=Le(n);if(!oe(a,i,o,!0)){var s=null,u=e;if("pointerType"in n){switch(n.pointerType){case"mouse":s=_e.Mouse;break;case"touch":s=_e.Touch;break;case"pen":s=_e.Pen}s===_e.Touch?ye[e]===ye.MouseDown?u="TouchStart":ye[e]===ye.MouseUp&&(u="TouchEnd"):_e.Pen}else ue(n)&&(s=_e.Touch);null!==s?(c=s,(u.startsWith("Touch")&&s===_e.Touch||u.startsWith("Mouse")&&s===_e.Mouse)&&(s=null)):ye[e]===ye.Click&&(s=c,c=null);var l=ue(n)?n.changedTouches[0]:n;if(l){var d=r.getId(a),f=l.clientX,p=l.clientY;Oe(t)(Object.assign({type:ye[u],id:d,x:f,y:p},null!==s&&{pointerType:s}))}}}}(e);if(window.PointerEvent)switch(ye[e]){case ye.MouseDown:case ye.MouseUp:a=a.replace("mouse","pointer");break;case ye.TouchStart:case ye.TouchEnd:return}u.push(z(a,s,n))})),Oe((function(){u.forEach((function(e){return e()}))}))}function Be(e){var t=e.scrollCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,a=e.sampling;return z("scroll",Oe(Q(Oe((function(e){var a=Le(e);if(a&&!oe(a,i,o,!0)){var s=r.getId(a);if(a===n&&n.defaultView){var u=ne(n.defaultView);t({id:s,x:u.left,y:u.top})}else t({id:s,x:a.scrollLeft,y:a.scrollTop})}})),a.scroll||100)),n)}function qe(e,t){var n=Object.assign({},e);return t||delete n.userTriggered,n}var We=["INPUT","TEXTAREA","SELECT"],Ve=new WeakMap;function He(e){return function(e,t){if($e("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||$e("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||$e("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||$e("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function Ge(e,t,n){var r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function Ue(e,t){var n,r,i,o=e.mirror,a=e.stylesheetManager,s=null;s="#document"===t.nodeName?o.getId(t):o.getId(t.host);var u="#document"===t.nodeName?null===(n=t.defaultView)||void 0===n?void 0:n.Document:null===(i=null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===i?void 0:i.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets");return null!==s&&-1!==s&&u&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:function(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set:function(e){var t,n=null===(t=c.set)||void 0===t?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(e){}return n}}),Oe((function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):function(){}}function je(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.doc.defaultView;if(!n)return function(){};!function(e,t){var n=e.mutationCb,r=e.mousemoveCb,i=e.mouseInteractionCb,o=e.scrollCb,a=e.viewportResizeCb,s=e.inputCb,u=e.mediaInteractionCb,c=e.styleSheetRuleCb,l=e.styleDeclarationCb,d=e.canvasMutationCb,f=e.fontCb,p=e.selectionCb;e.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),r.apply(void 0,arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),i.apply(void 0,arguments)},e.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),o.apply(void 0,arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),a.apply(void 0,arguments)},e.inputCb=function(){t.input&&t.input.apply(t,arguments),s.apply(void 0,arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),u.apply(void 0,arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),c.apply(void 0,arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),l.apply(void 0,arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),d.apply(void 0,arguments)},e.fontCb=function(){t.font&&t.font.apply(t,arguments),f.apply(void 0,arguments)},e.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),p.apply(void 0,arguments)}}(e,t);var r,i=De(e,e.doc),o=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,i=e.mirror;if(!1===n.mousemove)return function(){};var o,a="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,u=[],c=Q(Oe((function(e){var n=Date.now()-o;t(u.map((function(e){return e.timeOffset-=n,e})),e),u=[],o=null})),s),l=Oe(Q(Oe((function(e){var t=Le(e),n=ue(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;o||(o=te()),u.push({x:r,y:a,id:i.getId(t),timeOffset:te()-o}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?me.Drag:e instanceof MouseEvent?me.MouseMove:me.TouchMove)})),a,{trailing:!1})),d=[z("mousemove",l,r),z("touchmove",l,r),z("drag",l,r)];return Oe((function(){d.forEach((function(e){return e()}))}))}(e),a=Pe(e),s=Be(e),u=function(e,t){var n=e.viewportResizeCb,r=t.win,i=-1,o=-1;return z("resize",Oe(Q(Oe((function(){var e=re(),t=ie();i===e&&o===t||(n({width:Number(t),height:Number(e)}),i=e,o=t)})),200)),r)}(e,{win:n}),c=function(e){var t=e.inputCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,a=e.ignoreClass,s=e.ignoreSelector,u=e.maskInputOptions,c=e.maskInputFn,l=e.sampling,d=e.userTriggeredOnInput;function p(e){var t=Le(e),r=e.isTrusted,l=t&&t.tagName;if(t&&"OPTION"===l&&(t=t.parentElement),t&&l&&!(We.indexOf(l)<0)&&!oe(t,i,o,!0)&&!(t.classList.contains(a)||s&&t.matches(s))){var f=t.value,p=!1,g=S(t)||"";"radio"===g||"checkbox"===g?p=t.checked:(u[l.toLowerCase()]||u[g])&&(f=w({element:t,maskInputOptions:u,tagName:l,type:g,value:f,maskInputFn:c})),h(t,Oe(qe)({text:f,isChecked:p,userTriggered:r},d));var v=t.name;"radio"===g&&v&&p&&n.querySelectorAll('input[type="radio"][name="'.concat(v,'"]')).forEach((function(e){e!==t&&h(e,Oe(qe)({text:e.value,isChecked:!p,userTriggered:!1},d))}))}}function h(e,n){var i=Ve.get(e);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){Ve.set(e,n);var o=r.getId(e);Oe(t)(Object.assign(Object.assign({},n),{id:o}))}}var g=("last"===l.input?["change"]:["input","change"]).map((function(e){return z(e,Oe(p),n)})),v=n.defaultView;if(!v)return function(){g.forEach((function(e){return e()}))};var m=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value"),y=[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&g.push.apply(g,f(y.map((function(e){return X(e[0],e[1],{set:function(){Oe(p)({target:this,isTrusted:!1})}},!1,v)})))),Oe((function(){g.forEach((function(e){return e()}))}))}(e),l=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.blockSelector,i=e.mirror,o=e.sampling,a=e.doc,s=Oe((function(e){return Q(Oe((function(o){var a=Le(o);if(a&&!oe(a,n,r,!0)){var s=a.currentTime,u=a.volume,c=a.muted,l=a.playbackRate;t({type:e,id:i.getId(a),currentTime:s,volume:u,muted:c,playbackRate:l})}})),o.media||500)})),u=[z("play",s(0),a),z("pause",s(1),a),z("seeked",s(2),a),z("volumechange",s(3),a),z("ratechange",s(4),a)];return Oe((function(){u.forEach((function(e){return e()}))}))}(e),p=function(e,t){var n=e.styleSheetRuleCb,r=e.mirror,i=e.stylesheetManager,o=t.win;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return function(){};var a=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Oe((function(e,t,o){var a=d(o,2),s=a[0],u=a[1],c=Ge(t,r,i.styleMirror),l=c.id,f=c.styleId;return(l&&-1!==l||f&&-1!==f)&&n({id:l,styleId:f,adds:[{rule:s,index:u}]}),e.apply(t,o)}))});var s,u,c=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:Oe((function(e,t,o){var a=d(o,1)[0],s=Ge(t,r,i.styleMirror),u=s.id,c=s.styleId;return(u&&-1!==u||c&&-1!==c)&&n({id:u,styleId:c,removes:[{index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.replace&&(s=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Oe((function(e,t,o){var a=d(o,1)[0],s=Ge(t,r,i.styleMirror),u=s.id,c=s.styleId;return(u&&-1!==u||c&&-1!==c)&&n({id:u,styleId:c,replace:a}),e.apply(t,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(u=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:Oe((function(e,t,o){var a=d(o,1)[0],s=Ge(t,r,i.styleMirror),u=s.id,c=s.styleId;return(u&&-1!==u||c&&-1!==c)&&n({id:u,styleId:c,replaceSync:a}),e.apply(t,o)}))}));var l={};Ze("CSSGroupingRule")?l.CSSGroupingRule=o.CSSGroupingRule:(Ze("CSSMediaRule")&&(l.CSSMediaRule=o.CSSMediaRule),Ze("CSSConditionRule")&&(l.CSSConditionRule=o.CSSConditionRule),Ze("CSSSupportsRule")&&(l.CSSSupportsRule=o.CSSSupportsRule));var p={};return Object.entries(l).forEach((function(e){var t=d(e,2),o=t[0],a=t[1];p[o]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(p[o].insertRule,{apply:Oe((function(e,t,o){var a=d(o,2),s=a[0],u=a[1],c=Ge(t.parentStyleSheet,r,i.styleMirror),l=c.id,p=c.styleId;return(l&&-1!==l||p&&-1!==p)&&n({id:l,styleId:p,adds:[{rule:s,index:[].concat(f(He(t)),[u||0])}]}),e.apply(t,o)}))}),a.prototype.deleteRule=new Proxy(p[o].deleteRule,{apply:Oe((function(e,t,o){var a=d(o,1)[0],s=Ge(t.parentStyleSheet,r,i.styleMirror),u=s.id,c=s.styleId;return(u&&-1!==u||c&&-1!==c)&&n({id:u,styleId:c,removes:[{index:[].concat(f(He(t)),[a])}]}),e.apply(t,o)}))})})),Oe((function(){o.CSSStyleSheet.prototype.insertRule=a,o.CSSStyleSheet.prototype.deleteRule=c,s&&(o.CSSStyleSheet.prototype.replace=s),u&&(o.CSSStyleSheet.prototype.replaceSync=u),Object.entries(l).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];r.prototype.insertRule=p[n].insertRule,r.prototype.deleteRule=p[n].deleteRule}))}))}(e,{win:n}),h=Ue(e,e.doc),v=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,i=e.ignoreCSSAttributes,o=e.stylesheetManager,a=t.win,s=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Oe((function(e,t,a){var u,c=d(a,3),l=c[0],f=c[1],p=c[2];if(i.has(l))return s.apply(t,[l,f,p]);var h=Ge(null===(u=t.parentRule)||void 0===u?void 0:u.parentStyleSheet,r,o.styleMirror),g=h.id,v=h.styleId;return(g&&-1!==g||v&&-1!==v)&&n({id:g,styleId:v,set:{property:l,value:f,priority:p},index:He(t.parentRule)}),e.apply(t,a)}))});var u=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:Oe((function(e,t,a){var s,c=d(a,1)[0];if(i.has(c))return u.apply(t,[c]);var l=Ge(null===(s=t.parentRule)||void 0===s?void 0:s.parentStyleSheet,r,o.styleMirror),f=l.id,p=l.styleId;return(f&&-1!==f||p&&-1!==p)&&n({id:f,styleId:p,remove:{property:c},index:He(t.parentRule)}),e.apply(t,a)}))}),Oe((function(){a.CSSStyleDeclaration.prototype.setProperty=s,a.CSSStyleDeclaration.prototype.removeProperty=u}))}(e,{win:n}),m=e.collectFonts?function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var i=[],o=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=ee(n.fonts,"add",(function(e){return function(n){return setTimeout(Oe((function(){var e=o.get(n);e&&(t(e),o.delete(n))})),0),e.apply(this,[n])}}));return i.push((function(){r.FontFace=a})),i.push(s),Oe((function(){i.forEach((function(e){return e()}))}))}(e):function(){},y=function(e){var t=e.doc,n=e.mirror,r=e.blockClass,i=e.blockSelector,o=e.selectionCb,a=!0,s=Oe((function(){var e=t.getSelection();if(!(!e||a&&(null==e?void 0:e.isCollapsed))){a=e.isCollapsed||!1;for(var s=[],u=e.rangeCount||0,c=0;c<u;c++){var l=e.getRangeAt(c),d=l.startContainer,f=l.startOffset,p=l.endContainer,h=l.endOffset;oe(d,r,i,!0)||oe(p,r,i,!0)||s.push({start:n.getId(d),startOffset:f,end:n.getId(p),endOffset:h})}o({ranges:s})}}));return s(),z("selectionchange",s)}(e),_=[],b=g(e.plugins);try{for(b.s();!(r=b.n()).done;){var I=r.value;_.push(I.observer(I.callback,n,I.options))}}catch(e){b.e(e)}finally{b.f()}return Oe((function(){Ne.forEach((function(e){return e.reset()})),i.disconnect(),o(),a(),s(),u(),c(),l(),p(),h(),v(),m(),y(),_.forEach((function(e){return e()}))}))}function $e(e){return void 0!==window[e]}function Ze(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var Ke=function(){function e(t){a(this,e),this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}return u(e,[{key:"getId",value:function(e,t,n,r){var i=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e),a=i.get(t);return a||(a=this.generateIdFn(),i.set(t,a),o.set(a,t)),a}},{key:"getIds",value:function(e,t){var n=this,r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getId(e,t,r,i)}))}},{key:"getRemoteId",value:function(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var i=r.get(t);return i||-1}},{key:"getRemoteIds",value:function(e,t){var n=this,r=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getRemoteId(e,t,r)}))}},{key:"reset",value:function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),e}(),ze=function(){function e(t){a(this,e),this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ke(x),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ke(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}return u(e,[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}}},{key:"transformCrossOriginEvent",value:function(e,t){var n,r=this;switch(t.type){case ve.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:ve.IncrementalSnapshot,data:{source:me.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case ve.Meta:case ve.Load:case ve.DomContentLoaded:return!1;case ve.Plugin:return t;case ve.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ve.IncrementalSnapshot:switch(t.data.source){case me.Mutation:return t.data.adds.forEach((function(t){r.replaceIds(t,e,["parentId","nextId","previousId"]),r.replaceIdOnNode(t.node,e);var n=r.crossOriginIframeRootIdMap.get(e);n&&r.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((function(t){r.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((function(t){r.replaceIds(t,e,["id"])})),t.data.texts.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case me.Drag:case me.TouchMove:case me.MouseMove:return t.data.positions.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case me.ViewportResize:return!1;case me.MediaInteraction:case me.MouseInteraction:case me.Scroll:case me.CanvasMutation:case me.Input:return this.replaceIds(t.data,e,["id"]),t;case me.StyleSheetRule:case me.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case me.Font:return t;case me.Selection:return t.data.ranges.forEach((function(t){r.replaceIds(t,e,["start","end"])})),t;case me.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((function(t){r.replaceStyleIds(t,e,["styleId"])})),t}}}},{key:"replace",value:function(e,t,n,r){var i,o=g(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;(Array.isArray(t[a])||"number"==typeof t[a])&&(Array.isArray(t[a])?t[a]=e.getIds(n,t[a]):t[a]=e.getId(n,t[a]))}}catch(e){o.e(e)}finally{o.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((function(e){n.replaceIdOnNode(e,t)}))}},{key:"patchRootIdOnNode",value:function(e,t){var n=this;e.type===v.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((function(e){n.patchRootIdOnNode(e,t)}))}}]),e}(),Ye=function(){function e(t){a(this,e),this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}return u(e,[{key:"init",value:function(){this.reset(),this.patchAttachShadow(Element,document)}},{key:"addShadowRoot",value:function(e,t){var n=this;if(y(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=De(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((function(){return r.disconnect()})),this.restoreHandlers.push(Be(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&n.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,n.mirror.getId(e.host)),n.restoreHandlers.push(Ue({mirror:n.mirror,stylesheetManager:n.bypassOptions.stylesheetManager},e))}),0)}}},{key:"observeAttachShadow",value:function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}},{key:"patchAttachShadow",value:function(e,t){var n=this;this.restoreHandlers.push(ee(e.prototype,"attachShadow",(function(e){return function(r){var i=e.call(this,r);return this.shadowRoot&&ge(this)&&n.addShadowRoot(this.shadowRoot,t),i}})))}},{key:"reset",value:function(){this.restoreHandlers.forEach((function(e){try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}]),e}();function Je(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}for(var Qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),et=0;et<64;et++)Xe[Qe.charCodeAt(et)]=et;var tt=new Map;var nt=function(e,t,n){if(e&&(ot(e,t)||"object"===r(e))){var i=function(e,t){var n=tt.get(e);return n||(n=new Map,tt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),o=i.indexOf(e);return-1===o&&(o=i.length,i.push(e)),o}};function rt(e,t,n){if(e instanceof Array)return e.map((function(e){return rt(e,t,n)}));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var i=e.constructor.name,o=function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=Qe[n[t]>>2],i+=Qe[(3&n[t])<<4|n[t+1]>>4],i+=Qe[(15&n[t+1])<<2|n[t+2]>>6],i+=Qe[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e);return{rr_type:i,base64:o}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[rt(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement)return{rr_type:e.constructor.name,src:e.src};if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[rt(e.data,t,n),e.width,e.height]}:ot(e,t)||"object"===r(e)?{rr_type:e.constructor.name,index:nt(e,t,n)}:e}var it=function(e,t,n){return f(e).map((function(e){return rt(e,t,n)}))},ot=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function at(e,t,n,i){var o=[];try{var a=ee(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(o){for(var a=arguments.length,s=new Array(a>1?a-1:0),u=1;u<a;u++)s[u-1]=arguments[u];if(!oe(this,t,n,!0)){var c=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=c),i&&["webgl","webgl2"].includes(c))if(s[0]&&"object"===r(s[0])){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o].concat(s))}}));o.push(a)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){o.forEach((function(e){return e()}))}}function st(e,t,n,r,i,o,a){var s,u=[],c=g(Object.getOwnPropertyNames(e));try{var l=function(){var o=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(o))return"continue";try{if("function"!=typeof e[o])return"continue";var c=ee(e,o,(function(e){return function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];var l=e.apply(this,u);if(nt(l,a,this),"tagName"in this.canvas&&!oe(this.canvas,r,i,!0)){var d=it([].concat(u),a,this),f={type:t,property:o,args:d};n(this.canvas,f)}return l}}));u.push(c)}catch(r){var l=X(e,o,{set:function(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});u.push(l)}};for(c.s();!(s=c.n()).done;)l()}catch(e){c.e(e)}finally{c.f()}return u}function ut(e,t,n){var r=void 0===t?null:t,i=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),i=0,o=n.length;i<o;++i)r[i]=n.charCodeAt(i);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),o=i.indexOf("\n",10)+1,a=i.substring(o)+(r?"//# sourceMappingURL="+r:""),s=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(s)}var ct,lt,dt,ft,pt,ht,gt,vt=(ct="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",lt=null,dt=!1,function(e){return ft=ft||ut(ct,lt,dt),new Worker(ft,e)}),mt=function(){function e(t){var n=this;a(this,e),this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(n.rafStamps.invokeId&&n.rafStamps.latestId!==n.rafStamps.invokeId)&&n.rafStamps.invokeId||(n.rafStamps.invokeId=n.rafStamps.latestId),n.pendingCanvasMutations.has(e)||n.pendingCanvasMutations.set(e,[]),n.pendingCanvasMutations.get(e).push(t)};var r=t.sampling,i=void 0===r?"all":r,o=t.win,s=t.blockClass,u=t.blockSelector,c=t.recordCanvas,l=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,c&&"all"===i&&this.initCanvasMutationObserver(o,s,u),c&&"number"==typeof i&&this.initCanvasFPSObserver(i,o,s,u,{dataURLOptions:l})}return u(e,[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,t,r,i,o){var a=this,s=at(t,r,i,!0),u=new Map,c=new vt;c.onmessage=function(e){var t=e.data.id;if(u.set(t,!1),"base64"in e.data){var n=e.data,r=n.base64,i=n.type,o=n.width,s=n.height;a.mutationCb({id:t,type:be["2D"],commands:[{property:"clearRect",args:[0,0,o,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var l,d=1e3/e,f=0;l=requestAnimationFrame((function e(s){var p;f&&s-f<d?l=requestAnimationFrame(e):(f=s,(p=[],function e(t){t.querySelectorAll("canvas").forEach((function(e){oe(e,r,i,!0)||p.push(e)})),t.querySelectorAll("*").forEach((function(t){t.shadowRoot&&e(t.shadowRoot)}))}(t.document),p).forEach((function(e){return Je(a,void 0,void 0,n().mark((function t(){var r,i,a,s,l,d;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.mirror.getId(e),!u.get(i)){t.next=3;break}return t.abrupt("return");case 3:if(0!==e.width&&0!==e.height){t.next=5;break}return t.abrupt("return");case 5:return u.set(i,!0),["webgl","webgl2"].includes(e.__context)&&(a=e.getContext(e.__context),!1===(null===(r=null==a?void 0:a.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&a.clear(a.COLOR_BUFFER_BIT)),s=e.clientWidth,l=e.clientHeight,t.next=11,createImageBitmap(e,{resizeWidth:s,resizeHeight:l});case 11:d=t.sent,c.postMessage({id:i,bitmap:d,width:s,height:l,dataURLOptions:o.dataURLOptions},[d]);case 13:case"end":return t.stop()}}),t,this)})))})),l=requestAnimationFrame(e))})),this.resetObservers=function(){s(),cancelAnimationFrame(l)}}},{key:"initCanvasMutationObserver",value:function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=at(e,t,n,!1),i=function(e,t,n,r){var i,o=[],a=g(Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype));try{var s=function(){var a=i.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])return"continue";var s=ee(t.CanvasRenderingContext2D.prototype,a,(function(i){return function(){for(var o=this,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return oe(this.canvas,n,r,!0)||setTimeout((function(){var n=it([].concat(u),t,o);e(o.canvas,{type:be["2D"],property:a,args:n})}),0),i.apply(this,u)}}));o.push(s)}catch(n){var u=X(t.CanvasRenderingContext2D.prototype,a,{set:function(t){e(this.canvas,{type:be["2D"],property:a,args:[t],setter:!0})}});o.push(u)}};for(a.s();!(i=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return function(){o.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r,i){var o=[];return o.push.apply(o,f(st(t.WebGLRenderingContext.prototype,be.WebGL,e,n,r,0,t))),void 0!==t.WebGL2RenderingContext&&o.push.apply(o,f(st(t.WebGL2RenderingContext.prototype,be.WebGL2,e,n,r,0,t))),function(){o.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=function(){r(),i(),o()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"startRAFTimestamping",value:function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))}},{key:"flushPendingCanvasMutations",value:function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"flushPendingCanvasMutationFor",value:function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){var t=
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,5 +12,6 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function n(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function i(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||v(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=v(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function _(e){var t,n=null===(t=e)||void 0===t?void 0:t.host;return Boolean(n&&n.shadowRoot&&n.shadowRoot===e)}function y(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,i=e.value,o=e.maskInputFn,a=i||"";return(t[n.toLowerCase()]||t[r])&&(a=o?o(a):"*".repeat(a.length)),a}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(e||(e={}));var b="__rrweb_original__";var w,k,S=1,C=new RegExp("[^a-z0-9-_:]"),x=-2;function I(e){try{var t=e.rules||e.cssRules;return t?Array.from(t).map(F).join(""):null}catch(e){return null}}function F(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=I(e.styleSheet)||t}catch(e){}return t}var E=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,R=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,T=/^(data:)([^,]*),(.*)/i;function O(e,t){return(e||"").replace(E,(function(e,n,r,i,o,a){var s,u=r||o||a,l=n||i||"";if(!u)return e;if(!R.test(u))return"url("+l+u+l+")";if(T.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var c=t.split("/"),d=u.split("/");c.pop();for(var f=0,p=d;f<p.length;f++){var h=p[f];"."!==h&&(".."===h?c.pop():c.push(h))}return"url("+l+c.join("/")+l+")"}))}var M,P,N,L,D,A,$=/^[^ \t\n\r\u000c]+/,q=/^[, \t\n\r\u000c]+/;function H(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function B(){var e=document.createElement("a");return e.href="",e.href}function j(e,t,n,r){return"src"===n||"href"===n&&r||"xlink:href"===n&&r&&"#"!==r[0]?H(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}for(var i=[];r(q),!(n>=t.length);){var o=r($);if(","===o.slice(-1))o=H(e,o.substring(0,o.length-1)),i.push(o);else{var a="";o=H(e,o);for(var s=!1;;){var u=t.charAt(n);if(""===u){i.push((o+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){n+=1,i.push((o+a).trim());break}"("===u&&(s=!0)}a+=u,n+=1}}}return i.join(", ")}(e,r):"style"===n&&r?O(r,B()):"object"===t&&"data"===n&&r?H(e,r):r:H(e,r)}function W(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return!(!n||!e.matches(n))||W(e.parentNode,t,n)}return e.nodeType,e.TEXT_NODE,W(e.parentNode,t,n)}function U(t,n){var r,i,o,a,s=n.doc,u=n.blockClass,l=n.blockSelector,c=n.maskTextClass,d=n.maskTextSelector,f=n.inlineStylesheet,p=n.maskInputOptions,h=void 0===p?{}:p,v=n.maskTextFn,g=n.maskInputFn,m=n.dataURLOptions,_=void 0===m?{}:m,S=n.inlineImages,x=n.recordCanvas,F=n.keepIframeSrcFn;if(s.__sn){var E=s.__sn.id;i=1===E?void 0:E}switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode,rootId:i}:{type:e.Document,childNodes:[],rootId:i};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:i};case t.ELEMENT_NODE:for(var R=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=0;r<e.classList.length;r++){var i=e.classList[r];if(t.test(i))return!0}return!!n&&e.matches(n)}(t,u,l),T=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return C.test(t)?"div":t}(t),M={},P=0,N=Array.from(t.attributes);P<N.length;P++){var L=N[P],D=L.name,A=L.value;M[D]=j(s,T,D,A)}if("link"===T&&f){var $=Array.from(s.styleSheets).find((function(e){return e.href===t.href})),q=null;$&&(q=I($)),q&&(delete M.rel,delete M.href,M._cssText=O(q,$.href))}if("style"===T&&t.sheet&&!(t.innerText||t.textContent||"").trim().length)(q=I(t.sheet))&&(M._cssText=O(q,B()));if("input"===T||"textarea"===T||"select"===T){A=t.value;"radio"!==M.type&&"checkbox"!==M.type&&"submit"!==M.type&&"button"!==M.type&&A?M.value=y({type:M.type,tagName:T,value:A,maskInputOptions:h,maskInputFn:g}):t.checked&&(M.checked=t.checked)}if("option"===T&&(t.selected&&!h.select?M.selected=!0:delete M.selected),"canvas"===T&&x)if("2d"===t.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var i=t.getImageData,o=b in i?i[b]:i;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(t)||(M.rr_dataURL=t.toDataURL(_.type,_.quality));else if(!("__context"in t)){var H=t.toDataURL(_.type,_.quality),U=document.createElement("canvas");U.width=t.width,U.height=t.height,H!==U.toDataURL(_.type,_.quality)&&(M.rr_dataURL=H)}if("img"===T&&S){w||(w=s.createElement("canvas"),k=w.getContext("2d"));var V=t,z=V.crossOrigin;V.crossOrigin="anonymous";var G=function(){try{w.width=V.naturalWidth,w.height=V.naturalHeight,k.drawImage(V,0,0),M.rr_dataURL=w.toDataURL(_.type,_.quality)}catch(e){console.warn("Cannot inline img src="+V.currentSrc+"! Error: "+e)}z?M.crossOrigin=z:delete M.crossOrigin};V.complete&&0!==V.naturalWidth?G():V.onload=G}if("audio"!==T&&"video"!==T||(M.rr_mediaState=t.paused?"paused":"played",M.rr_mediaCurrentTime=t.currentTime),t.scrollLeft&&(M.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(M.rr_scrollTop=t.scrollTop),R){var Y=t.getBoundingClientRect(),J=Y.width,Q=Y.height;M={class:M.class,rr_width:J+"px",rr_height:Q+"px"}}return"iframe"!==T||F(M.src)||(t.contentDocument||(M.rr_src=M.src),delete M.src),{type:e.Element,tagName:T,attributes:M,childNodes:[],isSVG:(a=t,Boolean("svg"===a.tagName||a.ownerSVGElement)||void 0),needBlock:R,rootId:i};case t.TEXT_NODE:var X=t.parentNode&&t.parentNode.tagName,K=t.textContent,Z="STYLE"===X||void 0,ee="SCRIPT"===X||void 0;if(Z&&K){try{t.nextSibling||t.previousSibling||(null===(r=t.parentNode.sheet)||void 0===r?void 0:r.cssRules)&&(K=(o=t.parentNode.sheet).cssRules?Array.from(o.cssRules).map((function(e){return e.cssText||""})).join(""):"")}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}K=O(K,B())}return ee&&(K="SCRIPT_PLACEHOLDER"),!Z&&!ee&&W(t,c,d)&&K&&(K=v?v(K):K.replace(/[\S]/g,"*")),{type:e.Text,textContent:K||"",isStyle:Z,rootId:i};case t.CDATA_SECTION_NODE:return{type:e.CDATA,textContent:"",rootId:i};case t.COMMENT_NODE:return{type:e.Comment,textContent:t.textContent||"",rootId:i};default:return!1}}function V(e){return void 0===e?"":e.toLowerCase()}function z(t,n){var r,i=n.doc,o=n.map,a=n.blockClass,s=n.blockSelector,u=n.maskTextClass,l=n.maskTextSelector,c=n.skipChild,d=void 0!==c&&c,f=n.inlineStylesheet,p=void 0===f||f,h=n.maskInputOptions,v=void 0===h?{}:h,g=n.maskTextFn,m=n.maskInputFn,y=n.slimDOMOptions,b=n.dataURLOptions,w=void 0===b?{}:b,k=n.inlineImages,C=void 0!==k&&k,I=n.recordCanvas,F=void 0!==I&&I,E=n.onSerialize,R=n.onIframeLoad,T=n.iframeLoadTimeout,O=void 0===T?5e3:T,M=n.keepIframeSrcFn,P=void 0===M?function(){return!1}:M,N=n.preserveWhiteSpace,L=void 0===N||N,D=U(t,{doc:i,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:l,inlineStylesheet:p,maskInputOptions:v,maskTextFn:g,maskInputFn:m,dataURLOptions:w,inlineImages:C,recordCanvas:F,keepIframeSrcFn:P});if(!D)return console.warn(t,"not serialized"),null;r="__sn"in t?t.__sn.id:!function(t,n){if(n.comment&&t.type===e.Comment)return!0;if(t.type===e.Element){if(n.script&&("script"===t.tagName||"link"===t.tagName&&"preload"===t.attributes.rel&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&t.attributes.href.endsWith(".js")))return!0;if(n.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(V(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===V(t.attributes.name)||"icon"===V(t.attributes.rel)||"apple-touch-icon"===V(t.attributes.rel)||"shortcut icon"===V(t.attributes.rel))))return!0;if("meta"===t.tagName){if(n.headMetaDescKeywords&&V(t.attributes.name).match(/^description|keywords$/))return!0;if(n.headMetaSocial&&(V(t.attributes.property).match(/^(og|twitter|fb):/)||V(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===V(t.attributes.name)))return!0;if(n.headMetaRobots&&("robots"===V(t.attributes.name)||"googlebot"===V(t.attributes.name)||"bingbot"===V(t.attributes.name)))return!0;if(n.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(n.headMetaAuthorship&&("author"===V(t.attributes.name)||"generator"===V(t.attributes.name)||"framework"===V(t.attributes.name)||"publisher"===V(t.attributes.name)||"progid"===V(t.attributes.name)||V(t.attributes.property).match(/^article:/)||V(t.attributes.property).match(/^product:/)))return!0;if(n.headMetaVerification&&("google-site-verification"===V(t.attributes.name)||"yandex-verification"===V(t.attributes.name)||"csrf-token"===V(t.attributes.name)||"p:domain_verify"===V(t.attributes.name)||"verify-v1"===V(t.attributes.name)||"verification"===V(t.attributes.name)||"shopify-checkout-api-token"===V(t.attributes.name)))return!0}}return!1}(D,y)&&(L||D.type!==e.Text||D.isStyle||D.textContent.replace(/^\s+|\s+$/gm,"").length)?S++:x;var A=Object.assign(D,{id:r});if(t.__sn=A,r===x)return null;o[r]=t,E&&E(t);var $=!d;if(A.type===e.Element&&($=$&&!A.needBlock,delete A.needBlock,t.shadowRoot&&(A.isShadowHost=!0)),(A.type===e.Document||A.type===e.Element)&&$){y.headWhitespace&&D.type===e.Element&&"head"===D.tagName&&(L=!1);for(var q={doc:i,map:o,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:l,skipChild:d,inlineStylesheet:p,maskInputOptions:v,maskTextFn:g,maskInputFn:m,slimDOMOptions:y,dataURLOptions:w,inlineImages:C,recordCanvas:F,preserveWhiteSpace:L,onSerialize:E,onIframeLoad:R,iframeLoadTimeout:O,keepIframeSrcFn:P},H=0,B=Array.from(t.childNodes);H<B.length;H++){(G=z(B[H],q))&&A.childNodes.push(G)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(t)&&t.shadowRoot)for(var j=0,W=Array.from(t.shadowRoot.childNodes);j<W.length;j++){var G;(G=z(W[j],q))&&(G.isShadow=!0,A.childNodes.push(G))}}return t.parentNode&&_(t.parentNode)&&(A.isShadow=!0),A.type===e.Element&&"iframe"===A.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){var a="about:blank";r.location.href===a&&e.src!==a&&""!==e.src?e.addEventListener("load",t):setTimeout(t,0)}else{var s=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),o=!0,t()}))}}}(t,(function(){var e=t.contentDocument;if(e&&R){var n=z(e,{doc:e,map:o,blockClass:a,blockSelector:s,maskTextClass:u,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:v,maskTextFn:g,maskInputFn:m,slimDOMOptions:y,dataURLOptions:w,inlineImages:C,recordCanvas:F,preserveWhiteSpace:L,onSerialize:E,onIframeLoad:R,iframeLoadTimeout:O,keepIframeSrcFn:P});n&&R(t,n)}}),O),A}function G(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}!function(e){e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin"}(M||(M={})),function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration"}(P||(P={})),function(e){e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel"}(N||(N={})),function(e){e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2"}(L||(L={})),function(e){e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange"}(D||(D={})),function(e){e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back"}(A||(A={}));var Y="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.",J={map:{},getId:function(){return console.error(Y),-1},getNode:function(){return console.error(Y),null},removeNodeFromMap:function(){console.error(Y)},has:function(){return console.error(Y),!1},reset:function(){console.error(Y)}};function Q(e,t,n){void 0===n&&(n={});var r=null,i=0;return function(o){var a=Date.now();i||!1!==n.leading||(i=a);var s=t-(a-i),u=this,l=arguments;s<=0||s>t?(r&&(clearTimeout(r),r=null),i=a,e.apply(u,l)):r||!1===n.trailing||(r=setTimeout((function(){i=!1===n.leading?0:Date.now(),r=null,e.apply(u,l)}),s))}}function X(e,t,n,r,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),o&&o.set&&o.set.call(this,e)}}),function(){return X(e,t,o||{},!0)}}function K(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}function Z(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ee(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function te(e,t){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE){var n=!1;if("string"==typeof t){if(void 0!==e.closest)return null!==e.closest("."+t);n=e.classList.contains(t)}else e.classList.forEach((function(e){t.test(e)&&(n=!0)}));return n||te(e.parentNode,t)}return e.nodeType,e.TEXT_NODE,te(e.parentNode,t)}function ne(e){return"__sn"in e&&e.__sn.id===x}function re(e,t){if(_(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||re(e.parentNode,t))}function ie(e){return Boolean(e.changedTouches)}function oe(t){return"__sn"in t&&(t.__sn.type===e.Element&&"iframe"===t.__sn.tagName)}function ae(e){return Boolean(null==e?void 0:e.shadowRoot)}function se(e){return"__ln"in e}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(J=new Proxy(J,{get:function(e,t,n){return"map"===t&&console.error(Y),Reflect.get(e,t,n)}}));var ue=function(){function e(){this.length=0,this.head=null}return e.prototype.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},e.prototype.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&se(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&se(e.nextSibling)&&e.nextSibling.__ln.previous){n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++},e.prototype.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)},e}(),le=function(e,t){return"".concat(e,"@").concat(t)};function ce(e){return"__sn"in e}var de=function(){function e(){var e=this;this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(t){t.forEach(e.processMutation),e.emit()},this.emit=function(){var t,r,i,o;if(!e.frozen&&!e.locked){for(var a=[],s=new ue,u=function(t){for(var n=t,r=x;r===x;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return r},l=function(t){for(var n,r,i,o,l,c=t.getRootNode?null===(n=t.getRootNode())||void 0===n?void 0:n.host:null,d=c;null===(i=null===(r=null==d?void 0:d.getRootNode)||void 0===r?void 0:r.call(d))||void 0===i?void 0:i.host;)d=(null===(l=null===(o=null==d?void 0:d.getRootNode)||void 0===o?void 0:o.call(d))||void 0===l?void 0:l.host)||null;var f=!(e.doc.contains(t)||null!==d&&e.doc.contains(d));if(t.parentNode&&!f){var p=_(t.parentNode)?e.mirror.getId(c):e.mirror.getId(t.parentNode),h=u(t);if(-1===p||-1===h)return s.addNode(t);var v=z(t,{doc:e.doc,map:e.mirror.map,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(n){oe(n)&&e.iframeManager.addIframe(n),ae(t)&&e.shadowDomManager.addShadowRoot(t.shadowRoot,document)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)}});v&&a.push({parentId:p,nextId:h,node:v})}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());try{for(var c=n(e.movedSet),d=c.next();!d.done;d=c.next()){var f=d.value;pe(e.removes,f,e.mirror)&&!e.movedSet.has(f.parentNode)||l(f)}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}try{for(var p=n(e.addedSet),h=p.next();!h.done;h=p.next()){f=h.value;he(e.droppedSet,f)||pe(e.removes,f,e.mirror)?he(e.movedSet,f)?l(f):e.droppedSet.add(f):l(f)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}for(var v=null;s.length;){var g=null;if(v){var m=e.mirror.getId(v.value.parentNode),y=u(v.value);-1!==m&&-1!==y&&(g=v)}if(!g)for(var b=s.length-1;b>=0;b--){var w=s.get(b);if(w){m=e.mirror.getId(w.value.parentNode),y=u(w.value);if(-1!==m&&-1!==y){g=w;break}}}if(!g){for(;s.head;)s.removeNode(s.head.value);break}v=g.previous,s.removeNode(g.value),l(g.value)}var k={texts:e.texts.map((function(t){return{id:e.mirror.getId(t.node),value:t.value}})).filter((function(t){return e.mirror.has(t.id)})),attributes:e.attributes.map((function(t){return{id:e.mirror.getId(t.node),attributes:t.attributes}})).filter((function(t){return e.mirror.has(t.id)})),removes:e.removes,adds:a};(k.texts.length||k.attributes.length||k.removes.length||k.adds.length)&&(e.texts=[],e.attributes=[],e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.movedMap={},e.mutationCb(k))}},this.processMutation=function(t){var r,i,o,a;if(!ne(t.target))switch(t.type){case"characterData":var s=t.target.textContent;te(t.target,e.blockClass)||s===t.oldValue||e.texts.push({value:W(t.target,e.maskTextClass,e.maskTextSelector)&&s?e.maskTextFn?e.maskTextFn(s):s.replace(/[\S]/g,"*"):s,node:t.target});break;case"attributes":var u=t.target;s=t.target.getAttribute(t.attributeName);if("value"===t.attributeName&&(s=y({maskInputOptions:e.maskInputOptions,tagName:t.target.tagName,type:t.target.getAttribute("type"),value:s,maskInputFn:e.maskInputFn})),te(t.target,e.blockClass)||s===t.oldValue)return;var l=e.attributes.find((function(e){return e.node===t.target}));if(l||(l={node:t.target,attributes:{}},e.attributes.push(l)),"style"===t.attributeName){var c=e.doc.createElement("span");t.oldValue&&c.setAttribute("style",t.oldValue),void 0!==l.attributes.style&&null!==l.attributes.style||(l.attributes.style={});var d=l.attributes.style;try{for(var f=n(Array.from(u.style)),p=f.next();!p.done;p=f.next()){var h=p.value,v=u.style.getPropertyValue(h),g=u.style.getPropertyPriority(h);v===c.style.getPropertyValue(h)&&g===c.style.getPropertyPriority(h)||(d[h]=""===g?v:[v,g])}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}try{for(var m=n(Array.from(c.style)),b=m.next();!b.done;b=m.next()){h=b.value;""===u.style.getPropertyValue(h)&&(d[h]=!1)}}catch(e){o={error:e}}finally{try{b&&!b.done&&(a=m.return)&&a.call(m)}finally{if(o)throw o.error}}}else l.attributes[t.attributeName]=j(e.doc,t.target.tagName,t.attributeName,s);break;case"childList":t.addedNodes.forEach((function(n){return e.genAdds(n,t.target)})),t.removedNodes.forEach((function(n){var r=e.mirror.getId(n),i=_(t.target)?e.mirror.getId(t.target.host):e.mirror.getId(t.target);te(t.target,e.blockClass)||ne(n)||(e.addedSet.has(n)?(fe(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||re(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[le(r,i)]?fe(e.movedSet,n):e.removes.push({parentId:i,id:r,isShadow:!!_(t.target)||void 0})),e.mapRemoves.push(n))}))}},this.genAdds=function(t,n){if(!n||!te(n,e.blockClass)){if(ce(t)){if(ne(t))return;e.movedSet.add(t);var r=null;n&&ce(n)&&(r=n.__sn.id),r&&(e.movedMap[le(t.__sn.id,r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);te(t,e.blockClass)||t.childNodes.forEach((function(t){return e.genAdds(t)}))}}}return e.prototype.init=function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","recordCanvas","inlineImages","slimDOMOptions","doc","mirror","iframeManager","shadowDomManager","canvasManager"].forEach((function(n){t[n]=e[n]}))},e.prototype.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},e.prototype.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},e.prototype.isFrozen=function(){return this.frozen},e.prototype.lock=function(){this.locked=!0,this.canvasManager.lock()},e.prototype.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},e.prototype.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function fe(e,t){e.delete(t),t.childNodes.forEach((function(t){return fe(e,t)}))}function pe(e,t,n){var r=t.parentNode;if(!r)return!1;var i=n.getId(r);return!!e.some((function(e){return e.id===i}))||pe(e,r,n)}function he(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||he(e,n))}var ve=[],ge="undefined"!=typeof CSSGroupingRule,me="undefined"!=typeof CSSMediaRule,_e="undefined"!=typeof CSSSupportsRule,ye="undefined"!=typeof CSSConditionRule;function be(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function we(e,t){var n,r,i=new de;ve.push(i),i.init(e);var o=window.MutationObserver||window.__rrMutationObserver,a=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");a&&window[a]&&(o=window[a]);var s=new o(i.processMutations.bind(i));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function ke(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.sampling;if(!1===o.mouseInteraction)return function(){};var a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,s=[];return Object.keys(N).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]})).forEach((function(e){var o=e.toLowerCase(),a=function(e){return function(n){var o=be(n);if(!te(o,i)){var a=ie(n)?n.changedTouches[0]:n;if(a){var s=r.getId(o),u=a.clientX,l=a.clientY;t({type:N[e],id:s,x:u,y:l})}}}}(e);s.push(G(o,a,n))})),function(){s.forEach((function(e){return e()}))}}function Se(e){var t=e.scrollCb,n=e.doc,r=e.mirror,i=e.blockClass;return G("scroll",Q((function(e){var o=be(e);if(o&&!te(o,i)){var a=r.getId(o);if(o===n){var s=n.scrollingElement||n.documentElement;t({id:a,x:s.scrollLeft,y:s.scrollTop})}else t({id:a,x:o.scrollLeft,y:o.scrollTop})}}),e.sampling.scroll||100),n)}function Ce(e,n){var r=t({},e);return n||delete r.userTriggered,r}var xe=["INPUT","TEXTAREA","SELECT"],Ie=new WeakMap;function Fe(e){return function(e,t){if(ge&&e.parentRule instanceof CSSGroupingRule||me&&e.parentRule instanceof CSSMediaRule||_e&&e.parentRule instanceof CSSSupportsRule||ye&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else{n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ee(e,o){var a,s;void 0===o&&(o={});var u=e.doc.defaultView;if(!u)return function(){};!function(e,t){var n=e.mutationCb,o=e.mousemoveCb,a=e.mouseInteractionCb,s=e.scrollCb,u=e.viewportResizeCb,l=e.inputCb,c=e.mediaInteractionCb,d=e.styleSheetRuleCb,f=e.styleDeclarationCb,p=e.canvasMutationCb,h=e.fontCb;e.mutationCb=function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];t.mutation&&t.mutation.apply(t,i([],r(e),!1)),n.apply(void 0,i([],r(e),!1))},e.mousemoveCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mousemove&&t.mousemove.apply(t,i([],r(e),!1)),o.apply(void 0,i([],r(e),!1))},e.mouseInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mouseInteraction&&t.mouseInteraction.apply(t,i([],r(e),!1)),a.apply(void 0,i([],r(e),!1))},e.scrollCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.scroll&&t.scroll.apply(t,i([],r(e),!1)),s.apply(void 0,i([],r(e),!1))},e.viewportResizeCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.viewportResize&&t.viewportResize.apply(t,i([],r(e),!1)),u.apply(void 0,i([],r(e),!1))},e.inputCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.input&&t.input.apply(t,i([],r(e),!1)),l.apply(void 0,i([],r(e),!1))},e.mediaInteractionCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.mediaInteaction&&t.mediaInteaction.apply(t,i([],r(e),!1)),c.apply(void 0,i([],r(e),!1))},e.styleSheetRuleCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleSheetRule&&t.styleSheetRule.apply(t,i([],r(e),!1)),d.apply(void 0,i([],r(e),!1))},e.styleDeclarationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.styleDeclaration&&t.styleDeclaration.apply(t,i([],r(e),!1)),f.apply(void 0,i([],r(e),!1))},e.canvasMutationCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.canvasMutation&&t.canvasMutation.apply(t,i([],r(e),!1)),p.apply(void 0,i([],r(e),!1))},e.fontCb=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.font&&t.font.apply(t,i([],r(e),!1)),h.apply(void 0,i([],r(e),!1))}}(e,o);var l=we(e,e.doc),c=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,i=e.mirror;if(!1===n.mousemove)return function(){};var o,a="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,u=[],l=Q((function(e){var n=Date.now()-o;t(u.map((function(e){return e.timeOffset-=n,e})),e),u=[],o=null}),s),c=Q((function(e){var t=be(e),n=ie(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;o||(o=Date.now()),u.push({x:r,y:a,id:i.getId(t),timeOffset:Date.now()-o}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?P.Drag:e instanceof MouseEvent?P.MouseMove:P.TouchMove)}),a,{trailing:!1}),d=[G("mousemove",c,r),G("touchmove",c,r),G("drag",c,r)];return function(){d.forEach((function(e){return e()}))}}(e),d=ke(e),f=Se(e),p=function(e){var t=e.viewportResizeCb,n=-1,r=-1;return G("resize",Q((function(){var e=Z(),i=ee();n===e&&r===i||(t({width:Number(i),height:Number(e)}),n=e,r=i)}),200),window)}(e),h=function(e){var n=e.inputCb,o=e.doc,a=e.mirror,s=e.blockClass,u=e.ignoreClass,l=e.maskInputOptions,c=e.maskInputFn,d=e.sampling,f=e.userTriggeredOnInput;function p(e){var t=be(e),n=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(xe.indexOf(t.tagName)<0)&&!te(t,s)){var r=t.type;if(!t.classList.contains(u)){var i=t.value,a=!1;"radio"===r||"checkbox"===r?a=t.checked:(l[t.tagName.toLowerCase()]||l[r])&&(i=y({maskInputOptions:l,tagName:t.tagName,type:r,value:i,maskInputFn:c})),h(t,Ce({text:i,isChecked:a,userTriggered:n},f));var d=t.name;"radio"===r&&d&&a&&o.querySelectorAll('input[type="radio"][name="'.concat(d,'"]')).forEach((function(e){e!==t&&h(e,Ce({text:e.value,isChecked:!a,userTriggered:!1},f))}))}}}function h(e,r){var i=Ie.get(e);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){Ie.set(e,r);var o=a.getId(e);n(t(t({},r),{id:o}))}}var v=("last"===d.input?["change"]:["input","change"]).map((function(e){return G(e,p,o)})),g=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),m=[[HTMLInputElement.prototype,"value"],[HTMLInputElement.prototype,"checked"],[HTMLSelectElement.prototype,"value"],[HTMLTextAreaElement.prototype,"value"],[HTMLSelectElement.prototype,"selectedIndex"],[HTMLOptionElement.prototype,"selected"]];return g&&g.set&&v.push.apply(v,i([],r(m.map((function(e){return X(e[0],e[1],{set:function(){p({target:this})}})}))),!1)),function(){v.forEach((function(e){return e()}))}}(e),v=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.mirror,i=e.sampling,o=function(e){return Q((function(i){var o=be(i);if(o&&!te(o,n)){var a=o,s=a.currentTime,u=a.volume,l=a.muted;t({type:e,id:r.getId(o),currentTime:s,volume:u,muted:l})}}),i.media||500)},a=[G("play",o(0)),G("pause",o(1)),G("seeked",o(2)),G("volumechange",o(3))];return function(){a.forEach((function(e){return e()}))}}(e),g=function(e,t){var n=e.styleSheetRuleCb,o=e.mirror,a=t.win,s=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var r=o.getId(this.ownerNode);return-1!==r&&n({id:r,adds:[{rule:e,index:t}]}),s.apply(this,arguments)};var u=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=o.getId(this.ownerNode);return-1!==t&&n({id:t,removes:[{index:e}]}),u.apply(this,arguments)};var l={};ge?l.CSSGroupingRule=a.CSSGroupingRule:(me&&(l.CSSMediaRule=a.CSSMediaRule),ye&&(l.CSSConditionRule=a.CSSConditionRule),_e&&(l.CSSSupportsRule=a.CSSSupportsRule));var c={};return Object.entries(l).forEach((function(e){var t=r(e,2),a=t[0],s=t[1];c[a]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(e,t){var s=o.getId(this.parentStyleSheet.ownerNode);return-1!==s&&n({id:s,adds:[{rule:e,index:i(i([],r(Fe(this)),!1),[t||0],!1)}]}),c[a].insertRule.apply(this,arguments)},s.prototype.deleteRule=function(e){var t=o.getId(this.parentStyleSheet.ownerNode);return-1!==t&&n({id:t,removes:[{index:i(i([],r(Fe(this)),!1),[e],!1)}]}),c[a].deleteRule.apply(this,arguments)}})),function(){a.CSSStyleSheet.prototype.insertRule=s,a.CSSStyleSheet.prototype.deleteRule=u,Object.entries(l).forEach((function(e){var t=r(e,2),n=t[0],i=t[1];i.prototype.insertRule=c[n].insertRule,i.prototype.deleteRule=c[n].deleteRule}))}}(e,{win:u}),m=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,i=t.win,o=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var a,s,u=r.getId(null===(s=null===(a=this.parentRule)||void 0===a?void 0:a.parentStyleSheet)||void 0===s?void 0:s.ownerNode);return-1!==u&&n({id:u,set:{property:e,value:t,priority:i},index:Fe(this.parentRule)}),o.apply(this,arguments)};var a=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t,i,o=r.getId(null===(i=null===(t=this.parentRule)||void 0===t?void 0:t.parentStyleSheet)||void 0===i?void 0:i.ownerNode);return-1!==o&&n({id:o,remove:{property:e},index:Fe(this.parentRule)}),a.apply(this,arguments)},function(){i.CSSStyleDeclaration.prototype.setProperty=o,i.CSSStyleDeclaration.prototype.removeProperty=a}}(e,{win:u}),_=e.collectFonts?function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var i=[],o=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=K(n.fonts,"add",(function(e){return function(n){return setTimeout((function(){var e=o.get(n);e&&(t(e),o.delete(n))}),0),e.apply(this,[n])}}));return i.push((function(){r.FontFace=a})),i.push(s),function(){i.forEach((function(e){return e()}))}}(e):function(){},b=[];try{for(var w=n(e.plugins),k=w.next();!k.done;k=w.next()){var S=k.value;b.push(S.observer(S.callback,u,S.options))}}catch(e){a={error:e}}finally{try{k&&!k.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}return function(){ve.forEach((function(e){return e.reset()})),l.disconnect(),c(),d(),f(),p(),h(),v(),g(),m(),_(),b.forEach((function(e){return e()}))}}var Re=function(){function e(e){this.iframes=new WeakMap,this.mutationCb=e.mutationCb}return e.prototype.addIframe=function(e){this.iframes.set(e,!0)},e.prototype.addLoadListener=function(e){this.loadListener=e},e.prototype.attachIframe=function(e,t){var n;this.mutationCb({adds:[{parentId:e.__sn.id,nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e)},e}(),Te=function(){function e(e){this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;var t=this;this.restorePatches.push(K(HTMLElement.prototype,"attachShadow",(function(e){return function(){var n=e.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),n}})))}return e.prototype.addShadowRoot=function(e,n){we(t(t({},this.bypassOptions),{doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Se(t(t({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))},e.prototype.observeAttachShadow=function(e){if(e.contentWindow){var t=this;this.restorePatches.push(K(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(){var r=n.apply(this,arguments);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}})))}},e.prototype.reset=function(){this.restorePatches.forEach((function(e){return e()}))},e}();for(var Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Me="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Pe=0;Pe<64;Pe++)Me[Oe.charCodeAt(Pe)]=Pe;var Ne=new Map;var Le=function(e,t,n){if(e&&($e(e,t)||"object"===s(e))){var r=function(e,t){var n=Ne.get(e);return n||(n=new Map,Ne.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i}};function De(e,t,n){if(e instanceof Array)return e.map((function(e){return De(e,t,n)}));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var r=e.constructor.name,i=function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=Oe[n[t]>>2],i+=Oe[(3&n[t])<<4|n[t+1]>>4],i+=Oe[(15&n[t+1])<<2|n[t+2]>>6],i+=Oe[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e);return{rr_type:r,base64:i}}return e instanceof DataView?{rr_type:e.constructor.name,args:[De(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof ImageData?{rr_type:e.constructor.name,args:[De(e.data,t,n),e.width,e.height]}:$e(e,t)||"object"===s(e)?{rr_type:e.constructor.name,index:Le(e,t,n)}:e}var Ae=function(e,t,n){return i([],r(e),!1).map((function(e){return De(e,t,n)}))},$e=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function qe(e,t,o,a,s,u){var l,c,d=[],f=Object.getOwnPropertyNames(e),p=function(n){try{if("function"!=typeof e[n])return"continue";var l=K(e,n,(function(l){return function(){for(var c=[],d=0;d<arguments.length;d++)c[d]=arguments[d];var f=l.apply(this,c);if(Le(f,u,e),!te(this.canvas,a)){s.getId(this.canvas);var p=Ae(i([],r(c),!1),u,e),h={type:t,property:n,args:p};o(this.canvas,h)}return f}}));d.push(l)}catch(r){var c=X(e,n,{set:function(e){o(this.canvas,{type:t,property:n,args:[e],setter:!0})}});d.push(c)}};try{for(var h=n(f),v=h.next();!v.done;v=h.next()){p(v.value)}}catch(e){l={error:e}}finally{try{v&&!v.done&&(c=h.return)&&c.call(h)}finally{if(l)throw l.error}}return d}var He,Be,je=function(){function e(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)},this.mutationCb=e.mutationCb,this.mirror=e.mirror,!0===e.recordCanvas&&this.initCanvasMutationObserver(e.win,e.blockClass)}return e.prototype.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},e.prototype.freeze=function(){this.frozen=!0},e.prototype.unfreeze=function(){this.frozen=!1},e.prototype.lock=function(){this.locked=!0},e.prototype.unlock=function(){this.locked=!1},e.prototype.initCanvasMutationObserver=function(e,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var o=function(e,t){var n=[];try{var o=K(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return te(this,t)||"__context"in this||(this.__context=n),e.apply(this,i([n],r(o),!1))}}));n.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){n.forEach((function(e){return e()}))}}(e,t),a=function(e,t,o,a){var s,u,l=[],c=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),d=function(n){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[n])return"continue";var a=K(t.CanvasRenderingContext2D.prototype,n,(function(t){return function(){for(var a=this,s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return te(this.canvas,o)||setTimeout((function(){var t=i([],r(s),!1);if("drawImage"===n&&t[0]&&t[0]instanceof HTMLCanvasElement){var o=t[0],u=o.getContext("2d"),l=null==u?void 0:u.getImageData(0,0,o.width,o.height),c=null==l?void 0:l.data;t[0]=JSON.stringify(c)}e(a.canvas,{type:L["2D"],property:n,args:t})}),0),t.apply(this,s)}}));l.push(a)}catch(r){var s=X(t.CanvasRenderingContext2D.prototype,n,{set:function(t){e(this.canvas,{type:L["2D"],property:n,args:[t],setter:!0})}});l.push(s)}};try{for(var f=n(c),p=f.next();!p.done;p=f.next())d(p.value)}catch(e){s={error:e}}finally{try{p&&!p.done&&(u=f.return)&&u.call(f)}finally{if(s)throw s.error}}return function(){l.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror),s=function(e,t,n,o){var a=[];return a.push.apply(a,i([],r(qe(t.WebGLRenderingContext.prototype,L.WebGL,e,n,o,t)),!1)),void 0!==t.WebGL2RenderingContext&&a.push.apply(a,i([],r(qe(t.WebGL2RenderingContext.prototype,L.WebGL2,e,n,o,t)),!1)),function(){a.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,this.mirror);this.resetObservers=function(){o(),a(),s()}},e.prototype.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.startRAFTimestamping=function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))},e.prototype.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))},e.prototype.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){e.type;var t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["type"]);return t})),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}();function We(e){return t(t({},e),{timestamp:Date.now()})}var Ue={map:{},getId:function(e){return e&&e.__sn?e.__sn.id:-1},getNode:function(e){return this.map[e]||null},removeNodeFromMap:function(e){var t=this,n=e.__sn&&e.__sn.id;delete this.map[n],e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))},has:function(e){return this.map.hasOwnProperty(e)},reset:function(){this.map={}}};function Ve(e){void 0===e&&(e={});var i=e.emit,o=e.checkoutEveryNms,a=e.checkoutEveryNth,s=e.blockClass,u=void 0===s?"rr-block":s,l=e.blockSelector,c=void 0===l?null:l,d=e.ignoreClass,f=void 0===d?"rr-ignore":d,p=e.maskTextClass,h=void 0===p?"rr-mask":p,v=e.maskTextSelector,g=void 0===v?null:v,m=e.inlineStylesheet,_=void 0===m||m,y=e.maskAllInputs,b=e.maskInputOptions,w=e.slimDOMOptions,k=e.maskInputFn,S=e.maskTextFn,C=e.hooks,x=e.packFn,I=e.sampling,F=void 0===I?{}:I,E=e.mousemoveWait,R=e.recordCanvas,T=void 0!==R&&R,O=e.userTriggeredOnInput,N=void 0!==O&&O,L=e.collectFonts,D=void 0!==L&&L,A=e.inlineImages,$=void 0!==A&&A,q=e.plugins,H=e.keepIframeSrcFn,B=void 0===H?function(){return!1}:H;if(!i)throw new Error("emit function is required");void 0!==E&&void 0===F.mousemove&&(F.mousemove=E);var j,W=!0===y?{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!==b?b:{password:!0},U=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1})}();var V=0;He=function(e,t){var r;if(!(null===(r=ve[0])||void 0===r?void 0:r.isFrozen())||e.type===M.FullSnapshot||e.type===M.IncrementalSnapshot&&e.data.source===P.Mutation||ve.forEach((function(e){return e.unfreeze()})),i(function(e){var t,r;try{for(var i=n(q||[]),o=i.next();!o.done;o=i.next()){var a=o.value;a.eventProcessor&&(e=a.eventProcessor(e))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return x&&(e=x(e)),e}(e),t),e.type===M.FullSnapshot)j=e,V=0;else if(e.type===M.IncrementalSnapshot){if(e.data.source===P.Mutation&&e.data.isAttachIframe)return;V++;var s=a&&V>=a,u=o&&e.timestamp-j.timestamp>o;(s||u)&&Be(!0)}};var Y=function(e){He(We({type:M.IncrementalSnapshot,data:t({source:P.Mutation},e)}))},J=function(e){return He(We({type:M.IncrementalSnapshot,data:t({source:P.Scroll},e)}))},Q=function(e){return He(We({type:M.IncrementalSnapshot,data:t({source:P.CanvasMutation},e)}))},X=new Re({mutationCb:Y}),K=new je({recordCanvas:T,mutationCb:Q,win:window,blockClass:u,mirror:Ue}),te=new Te({mutationCb:Y,scrollCb:J,bypassOptions:{blockClass:u,blockSelector:c,maskTextClass:h,maskTextSelector:g,inlineStylesheet:_,maskInputOptions:W,maskTextFn:S,maskInputFn:k,recordCanvas:T,inlineImages:$,sampling:F,slimDOMOptions:U,iframeManager:X,canvasManager:K},mirror:Ue});Be=function(e){var t,n,i,o;void 0===e&&(e=!1),He(We({type:M.Meta,data:{href:window.location.href,width:ee(),height:Z()}}),e),ve.forEach((function(e){return e.lock()}));var a=r(function(e,t){var n=t||{},r=n.blockClass,i=void 0===r?"rr-block":r,o=n.blockSelector,a=void 0===o?null:o,s=n.maskTextClass,u=void 0===s?"rr-mask":s,l=n.maskTextSelector,c=void 0===l?null:l,d=n.inlineStylesheet,f=void 0===d||d,p=n.inlineImages,h=void 0!==p&&p,v=n.recordCanvas,g=void 0!==v&&v,m=n.maskAllInputs,_=void 0!==m&&m,y=n.maskTextFn,b=n.maskInputFn,w=n.slimDOM,k=void 0!==w&&w,S=n.dataURLOptions,C=n.preserveWhiteSpace,x=n.onSerialize,I=n.onIframeLoad,F=n.iframeLoadTimeout,E=n.keepIframeSrcFn,R={};return[z(e,{doc:e,map:R,blockClass:i,blockSelector:a,maskTextClass:u,maskTextSelector:c,skipChild:!1,inlineStylesheet:f,maskInputOptions:!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}:_,maskTextFn:y,maskInputFn:b,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:S,inlineImages:h,recordCanvas:g,preserveWhiteSpace:C,onSerialize:x,onIframeLoad:I,iframeLoadTimeout:F,keepIframeSrcFn:void 0===E?function(){return!1}:E}),R]}(document,{blockClass:u,blockSelector:c,maskTextClass:h,maskTextSelector:g,inlineStylesheet:_,maskAllInputs:W,maskTextFn:S,slimDOM:U,recordCanvas:T,inlineImages:$,onSerialize:function(e){oe(e)&&X.addIframe(e),ae(e)&&te.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){X.attachIframe(e,t),te.observeAttachShadow(e)},keepIframeSrcFn:B}),2),s=a[0],l=a[1];if(!s)return console.warn("Failed to snapshot the document");Ue.map=l,He(We({type:M.FullSnapshot,data:{node:s,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===document||void 0===document?void 0:document.body.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(o=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===o?void 0:o.scrollTop)||(null===document||void 0===document?void 0:document.body.scrollTop)||0}}})),ve.forEach((function(e){return e.unlock()}))};try{var ne=[];ne.push(G("DOMContentLoaded",(function(){He(We({type:M.DomContentLoaded,data:{}}))})));var re=function(e){var n;return Ee({mutationCb:Y,mousemoveCb:function(e,t){return He(We({type:M.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return He(We({type:M.IncrementalSnapshot,data:t({source:P.MouseInteraction},e)}))},scrollCb:J,viewportResizeCb:function(e){return He(We({type:M.IncrementalSnapshot,data:t({source:P.ViewportResize},e)}))},inputCb:function(e){return He(We({type:M.IncrementalSnapshot,data:t({source:P.Input},e)}))},mediaInteractionCb:function(e){return He(We({type:M.IncrementalSnapshot,data:t({source:P.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return He(We({type:M.IncrementalSnapshot,data:t({source:P.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return He(We({type:M.IncrementalSnapshot,data:t({source:P.StyleDeclaration},e)}))},canvasMutationCb:Q,fontCb:function(e){return He(We({type:M.IncrementalSnapshot,data:t({source:P.Font},e)}))},blockClass:u,ignoreClass:f,maskTextClass:h,maskTextSelector:g,maskInputOptions:W,inlineStylesheet:_,sampling:F,recordCanvas:T,inlineImages:$,userTriggeredOnInput:N,collectFonts:D,doc:e,maskInputFn:k,maskTextFn:S,blockSelector:c,slimDOMOptions:U,mirror:Ue,iframeManager:X,shadowDomManager:te,canvasManager:K,plugins:(null===(n=null==q?void 0:q.filter((function(e){return e.observer})))||void 0===n?void 0:n.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return He(We({type:M.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},C)};X.addLoadListener((function(e){ne.push(re(e.contentDocument))}));var ie=function(){Be(),ne.push(re(document))};return"interactive"===document.readyState||"complete"===document.readyState?ie():ne.push(G("load",(function(){He(We({type:M.Load,data:{}})),ie()}),window)),function(){ne.forEach((function(e){return e()}))}}catch(e){console.warn(e)}}Ve.addCustomEvent=function(e,t){if(!He)throw new Error("please add custom event after start recording");He(We({type:M.Custom,data:{tag:e,payload:t}}))},Ve.freezePage=function(){ve.forEach((function(e){return e.freeze()}))},Ve.takeFullSnapshot=function(e){if(!Be)throw new Error("please take full snapshot after start recording");Be(e)},Ve.mirror=Ue;var ze=function(){function e(e){this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),Ge=/(^|@)\S+:\d+/,Ye=/^\s*at .*(\S+:\d+|\(native\))/m,Je=/^(eval@)?(\[native code])?$/,Qe={parse:function(e){if(!e)return[];if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(Ye))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ye)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new ze({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Je)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new ze({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new ze({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new ze({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new ze({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ge)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new ze({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Xe(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,i=[];if(r.children&&r.children.length>0)for(var o=0;o<r.children.length;o++){var a=r.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=":eq("+i.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function Ke(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ze(e,t){var r,i;if(0===t)return!0;var o=Object.keys(e);try{for(var a=n(o),s=a.next();!s.done;s=a.next()){var u=s.value;if(Ke(e[u])&&Ze(e[u],t-1))return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return!1}function et(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],i=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null==t)return t;if(function(e){if(Ke(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ke(e)&&Ze(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=Xe(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var tt={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 nt(e,t,o){var a,s,u,l=o.logger;if(!l)return function(){};u="string"==typeof l?t[l]:l;var c=0,d=[];if(o.level.includes("error")&&window){var f=function(t){var n=t.message,r=t.error,i=Qe.parse(r).map((function(e){return e.toString()})),a=[et(n,o.stringifyOptions)];e({level:"error",trace:i,payload:a})};window.addEventListener("error",f),d.push((function(){window&&window.removeEventListener("error",f)}))}try{for(var p=n(o.level),h=p.next();!h.done;h=p.next()){var v=h.value;d.push(g(u,v))}}catch(e){a={error:e}}finally{try{h&&!h.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}return function(){d.forEach((function(e){return e()}))};function g(t,n){var a=this;return t[n]?K(t,n,(function(t){return function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];t.apply(a,s);try{var l=Qe.parse(new Error).map((function(e){return e.toString()})).splice(1),d=s.map((function(e){return et(e,o.stringifyOptions)}));++c<o.lengthThreshold?e({level:n,trace:l,payload:d}):c===o.lengthThreshold&&e({level:"warn",trace:[],payload:[et("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,i(["rrweb logger error:",e],r(s),!1))}}})):function(){}}}var rt="undefined"!=typeof window?window:void 0,it="undefined"!=typeof globalThis?globalThis:rt,ot=Array.prototype,at=ot.forEach,st=ot.indexOf,ut=null==it?void 0:it.navigator,lt=null==it?void 0:it.document,ct=null==it?void 0:it.location,dt=null==it?void 0:it.fetch,ft=null!=it&&it.XMLHttpRequest&&"withCredentials"in new it.XMLHttpRequest?it.XMLHttpRequest:void 0,pt=null==it?void 0:it.AbortController,ht=null==ut?void 0:ut.userAgent,vt=null!=rt?rt:{};rt&&(rt.rrweb={record:Ve,version:"v1",rrwebVersion:"1.1.3"},rt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:nt,options:e?Object.assign({},tt,e):tt}}});var gt={DEBUG:!1,LIB_VERSION:"1.115.0"},mt=Array.isArray,_t=Object.prototype,yt=_t.hasOwnProperty,bt=_t.toString,wt=mt||function(e){return"[object Array]"===bt.call(e)},kt=function(e){return"function"==typeof e},St=function(e){return e===Object(e)&&!wt(e)},Ct=function(e){return void 0===e},xt=function(e){return"[object String]"==bt.call(e)},It=function(e){return null===e},Ft=function(e){return Ct(e)||It(e)},Et=function(e){return"[object Number]"==bt.call(e)},Rt=function(e){return"[object Boolean]"===bt.call(e)},Tt=function(e){return e instanceof FormData},Ot="[PostHog.js]",Mt={_log:function(e){if(rt&&(gt.DEBUG||vt.POSTHOG_DEBUG)&&!Ct(rt.console)&&rt.console){for(var t=("__rrweb_original__"in rt.console[e]?rt.console[e].__rrweb_original__:rt.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.apply(void 0,[Ot].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Mt._log.apply(Mt,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Mt._log.apply(Mt,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Mt._log.apply(Mt,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[Ot].concat(n))},uninitializedWarning:function(e){Mt.error("You must initialize PostHog before calling ".concat(e))}},Pt={},Nt=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Lt(e,t,n){if(wt(e))if(at&&e.forEach===at)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===Pt)return}function Dt(e,t,n){if(!Ft(e)){if(wt(e))return Lt(e,t,n);if(Tt(e)){var r,i=m(e.entries());try{for(i.s();!(r=i.n()).done;){var o=r.value;if(t.call(n,o[1],o[0])===Pt)return}}catch(e){i.e(e)}finally{i.f()}}else for(var a in e)if(yt.call(e,a)&&t.call(n,e[a],a)===Pt)return}}var At=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Lt(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function $t(e,t){return-1!==e.indexOf(t)}function qt(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var Ht=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Bt=function(e){try{return e()}catch(e){return}},jt=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){Mt.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Mt.critical(e)}}},Wt=function(e){var t={};return Dt(e,(function(e,n){xt(e)&&e.length>0&&(t[n]=e)})),t};function Ut(e,t){return n=e,r=function(e){return xt(e)&&!It(t)?e.slice(0,t):e},i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),wt(t)?(o=[],Lt(t,(function(t){o.push(e(t))}))):(o={},Dt(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}var Vt=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var a=e.charCodeAt(i),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),It(s)||(n>t&&(o+=e.substring(t,n)),o+=s,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},zt=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var a="on"+n,s=t[a];t[a]=function(t,n,r){return function(i){if(i=i||e(null==rt?void 0:rt.event)){var o,a=!0;kt(r)&&(o=r(i));var s=n.call(t,i);return!1!==o&&!1!==s||(a=!1),a}}}(t,r,s)}else Mt.error("No valid element provided to register_event")}}();function Gt(e,t){var n=function(){if(!lt)return t("document not found");var n=lt.createElement("script");n.type="text/javascript",n.src=e,n.onload=function(e){return t(void 0,e)},n.onerror=function(e){return t(e)};var r,i=lt.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):lt.body.appendChild(n)};null!=lt&&lt.body?n():null==lt||lt.addEventListener("DOMContentLoaded",n)}function Yt(e){return e?Nt(e).split(/\s+/):[]}function Jt(e){var t="";switch(s(e.className)){case"string":t=e.className;break;case"object":t=("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Yt(t)}function Qt(e){return Ft(e)?null:Nt(e).split(/(\s+)/).filter((function(e){return hn(e)})).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Xt(e){var t="";return an(e)&&!sn(e)&&e.childNodes&&e.childNodes.length&&Dt(e.childNodes,(function(e){var n;en(e)&&e.textContent&&(t+=null!==(n=Qt(e.textContent))&&void 0!==n?n:"")})),Nt(t)}function Kt(e){return!!e&&1===e.nodeType}function Zt(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function en(e){return!!e&&3===e.nodeType}function tn(e){return!!e&&11===e.nodeType}var nn=["a","button","form","input","select","textarea","label"];function rn(e){var t=e.parentNode;return!(!t||!Kt(t))&&t}function on(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!rt||!e||Zt(e,"html")||!Kt(e))return!1;if(null!=n&&n.url_allowlist){var o=rt.location.href,a=n.url_allowlist;if(a&&!a.some((function(e){return o.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some((function(e){return t.type===e})))return!1}for(var l=!1,c=[e],d=!0,f=e;f.parentNode&&!Zt(f,"body");)if(tn(f.parentNode))c.push(f.parentNode.host),f=f.parentNode.host;else{if(!(d=rn(f)))break;if(r||nn.indexOf(d.tagName.toLowerCase())>-1)l=!0;else{var p=rt.getComputedStyle(d);p&&"pointer"===p.getPropertyValue("cursor")&&(l=!0)}c.push(d),f=d}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Ct(n))return!0;var r,i=m(e);try{var o=function(){var e=r.value;if(n.some((function(t){return e.tagName.toLowerCase()===t})))return{v:!0}};for(i.s();!(r=i.n()).done;){var a=o();if("object"===s(a))return a.v}}catch(e){i.e(e)}finally{i.f()}return!1}(c,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(Ct(n))return!0;var r,i=m(e);try{var o=function(){var e=r.value;if(n.some((function(t){return e.matches(t)})))return{v:!0}};for(i.s();!(r=i.n()).done;){var a=o();if("object"===s(a))return a.v}}catch(e){i.e(e)}finally{i.f()}return!1}(c,n))return!1;var h=rt.getComputedStyle(e);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===t.type)return!0;var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return l?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(nn.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}function an(e){for(var t=e;t.parentNode&&!Zt(t,"body");t=t.parentNode){var n=Jt(t);if($t(n,"ph-sensitive")||$t(n,"ph-no-capture"))return!1}if($t(Jt(e),"ph-include"))return!0;var r=e.type||"";if(xt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(xt(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function sn(e){return!!(Zt(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Zt(e,"select")||Zt(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var un="(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})",ln=new RegExp("^(?:".concat(un,")$")),cn=new RegExp(un),dn="\\d{3}-?\\d{2}-?\\d{4}",fn=new RegExp("^(".concat(dn,")$")),pn=new RegExp("(".concat(dn,")"));function hn(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Ft(e))return!1;if(xt(e)){if(e=Nt(e),(t?ln:cn).test((e||"").replace(/[- ]/g,"")))return!1;if((t?fn:pn).test(e))return!1}return!0}function vn(e){var t=Xt(e);return hn(t="".concat(t," ").concat(gn(e)).trim())?t:""}function gn(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Dt(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=Xt(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(gn(e)).trim())}catch(e){Mt.error(e)}})),t}function mn(e){return function(e){var t=e.map((function(e){var t,n,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class){e.attr_class.sort();var i,o=m(e.attr_class);try{for(o.s();!(i=o.n()).done;){var s=i.value;r+=".".concat(s.replace(/"/g,""))}}catch(e){o.e(e)}finally{o.f()}}var u=a(a(a(a({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),l={};return qt(u).sort((function(e,t){var n=p(e,1)[0],r=p(t,1)[0];return n.localeCompare(r)})).forEach((function(e){var t=p(e,2),n=t[0],r=t[1];return l[_n(n.toString())]=_n(r.toString())})),r+=":",r+=qt(u).map((function(e){var t=p(e,2),n=t[0],r=t[1];return"".concat(n,'="').concat(r,'"')})).join("")}));return t.join(";")}(function(e){return e.map((function(e){var t,n,r={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:yn(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return qt(e).filter((function(e){return 0===p(e,1)[0].indexOf("attr__")})).forEach((function(e){var t=p(e,2),n=t[0],i=t[1];return r.attributes[n]=i})),r}))}(e))}function _n(e){return e.replace(/"|\\"/g,'\\"')}function yn(e){var t=e.attr__class;return t?wt(t)?t:Yt(t):void 0}var bn=function(){function e(t){u(this,e),this.clicks=[],this.enabled=t}return c(e,[{key:"isRageClick",value:function(e,t,n){if(!this.enabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}(),wn="$people_distinct_id",kn="__alias",Sn="__timers",Cn="$autocapture_disabled_server_side",xn="$session_recording_enabled_server_side",In="$console_log_recording_enabled_server_side",Fn="$session_recording_recorder_version_server_side",En="$session_recording_network_payload_capture",Rn="$session_recording_canvas_recording",Tn="$sesid",On="$session_is_sampled",Mn="$enabled_feature_flags",Pn="$early_access_features",Nn="$stored_person_properties",Ln="$stored_group_properties",Dn="$surveys",An="$flag_call_reported",$n="$user_state",qn="$posthog_quota_limited",Hn="$client_session_props",Bn=[wn,kn,"__cmpns",Sn,xn,Tn,Mn,$n,qn,Pn,Ln,Nn,Dn,An,Hn],jn="$copy_autocapture";function Wn(e,t){return t.length>e?t.slice(0,e)+"...":t}var Un,Vn={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t,n=It(this._isDisabledServerSide)?!(null===(t=e.persistence)||void 0===t||!t.props[Cn]):this._isDisabledServerSide,r=!!e.config.autocapture;this._isAutocaptureEnabled=r&&!n},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Kt(t));return t},_getAugmentPropertiesFromElement:function(e){if(!an(e))return{};var t={};return Dt(e.attributes,(function(e){if(0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&hn(r)&&(t[n]=r)}})),t},_getPropertiesFromElement:function(e,t,n){var r,i=e.tagName.toLowerCase(),o={tag_name:i};nn.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Wn(1024,vn(e)):o.$el_text=Wn(1024,Xt(e)));var a=Jt(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e})));var s=null===(r=this.config)||void 0===r?void 0:r.element_attribute_ignorelist;Dt(e.attributes,(function(n){var r;if((!sn(e)||-1!==["name","id","class"].indexOf(n.name))&&((null==s||!s.includes(n.name))&&!t&&hn(n.value)&&(r=n.name,!xt(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7)))){var i=n.value;"class"===n.name&&(i=Yt(i).join(" ")),o["attr__"+n.name]=Wn(1024,i)}}));for(var u=1,l=1,c=e;c=this._previousElementSibling(c);)u++,c.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return Dt(null==lt?void 0:lt.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),hn(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return Dt(this._customProperties,(function(r){Dt(r.event_selectors,(function(i){Dt(null==lt?void 0:lt.querySelectorAll(i),(function(i){$t(e,i)&&an(i)&&(n[r.name]=t._extractCustomPropertyValue(r))}))}))})),n},_getEventTarget:function(e){return Ct(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",o=arguments.length>3?arguments[3]:void 0,a=this._getEventTarget(e);(en(a)&&(a=a.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent)&&(null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,t,"$rageclick"));var s=i===jn;if(a&&on(a,e,this.config,s,s?["copy","cut"]:void 0)){for(var u,l,c=[a],d=a;d.parentNode&&!Zt(d,"body");)tn(d.parentNode)?(c.push(d.parentNode.host),d=d.parentNode.host):(c.push(d.parentNode),d=d.parentNode);var f,p=[],h={},v=!1;if(Dt(c,(function(e){var n=an(e);"a"===e.tagName.toLowerCase()&&(f=e.getAttribute("href"),f=n&&hn(f)&&f),$t(Jt(e),"ph-no-capture")&&(v=!0),p.push(r._getPropertiesFromElement(e,t.config.mask_all_element_attributes,t.config.mask_all_text));var i=r._getAugmentPropertiesFromElement(e);At(h,i)})),t.config.mask_all_text||("a"===a.tagName.toLowerCase()||"button"===a.tagName.toLowerCase()?p[0].$el_text=vn(a):p[0].$el_text=Xt(a)),f&&(p[0].attr__href=f),v)return!1;var g=At(this._getDefaultProperties(e.type),t.elementsChainAsString?{$elements_chain:mn(p)}:{$elements:p},null!==(u=p[0])&&void 0!==u&&u.$el_text?{$el_text:null===(l=p[0])||void 0===l?void 0:l.$el_text}:{},this._getCustomProperties(c),h,o||{});if(i===jn){var m,_=Qt(null==rt||null===(m=rt.getSelection())||void 0===m?void 0:m.toString()),y=e.type||"clipboard";if(!_)return!1;g.$selected_content=_,g.$copy_type=y}return t.capture(i,g),!0}},_navigate:function(e){rt&&(rt.location.href=e)},_addDomEventHandlers:function(e){var t=this;if(rt&&lt){var n=function(n){n=n||(null==rt?void 0:rt.event),t._captureEvent(n,e)},r=function(n){n=n||(null==rt?void 0:rt.event),t._captureEvent(n,e,jn)};zt(lt,"submit",n,!1,!0),zt(lt,"change",n,!1,!0),zt(lt,"click",n,!1,!0),St(e.config.autocapture)&&e.config.autocapture.capture_copied_text&&(zt(lt,"copy",r,!1,!0),zt(lt,"cut",r,!1,!0))}},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;Rt(e.__autocapture)||(this.config=e.__autocapture),null!==(t=this.config)&&void 0!==t&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map((function(e){return new RegExp(e)}))),this.rageclicks=new bn(e.config.rageclick)},afterDecideResponse:function(e,t){var n=t.config.token;this._initializedTokens.indexOf(n)>-1?Mt.info('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(d({},Cn,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this._setIsAutocaptureEnabled(t),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=Ct(t)?10:t,n=Ct(n)?10:n;for(var r=0,i=0;i<e.length;i++)r+=e.charCodeAt(i);return r%t<n},isBrowserSupported:function(){return kt(null==lt?void 0:lt.querySelectorAll)}};!function(e){for(var t in e)kt(e[t])&&(e[t]=e[t].bind(e))}(Vn),function(e){for(var t in e)kt(e[t])&&(e[t]=jt(e[t]))}(Vn),function(e){e.GZipJS="gzip-js",e.Base64="base64"}(Un||(Un={}));var zn="$active_feature_flags",Gn="$override_feature_flags",Yn="$feature_flag_payloads",Jn=function(e){var t,n={},r=m(qt(e||{}));try{for(r.s();!(t=r.n()).done;){var i=p(t.value,2),o=i[0],a=i[1];a&&(n[o]=a)}}catch(e){r.e(e)}finally{r.f()}return n},Qn=function(){function e(t){u(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return c(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Mn),t=this.instance.get_property(Gn);if(!t)return e||{};for(var n=At({},e),r=Object.keys(t),i=0;i<r.length;i++)!1===t[r[i]]?delete n[r[i]]:n[r[i]]=t[r[i]];return this._override_warning||(Mt.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(Yn)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())}),5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,n=this.instance.get_property(Nn),r=this.instance.get_property(Ln),i={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:i,compression:Un.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){var n;e.setReloadingPaused(!1);var r=!0;200===t.statusCode&&(e.$anon_distinct_id=void 0,r=!1),e.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},r),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,r=this.getFlagVariants()[e],i="".concat(r),o=this.instance.get_property(An)||{};if(t.send_event||!("send_event"in t))if(!(e in o)||!o[e].includes(i))wt(o[e])?o[e].push(i):o[e]=[i],null===(n=this.instance.persistence)||void 0===n||n.register(d({},An,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r});return r}Mt.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Mt.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e,t){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads();!function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,s=e.featureFlagPayloads;if(o)if(wt(o)){var u,l={};if(o)for(var c=0;c<o.length;c++)l[o[c]]=!0;t&&t.register((d(u={},zn,o),d(u,Mn,l),u))}else{var f=o,p=s;e.errorsWhileComputingFlags&&(f=a(a({},r),f),p=a(a({},i),p)),t&&t.register((d(n={},zn,Object.keys(Jn(f))),d(n,Mn,f||{}),d(n,Yn,p||{}),n))}}(e,this.instance.persistence,n,r),this._fireFeatureFlagsCallbacks(t)}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return Mt.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(Gn);else if(wt(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(d({},Gn,t))}else this.instance.persistence.register(d({},Gn,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var n,r,i=d({},"$feature_enrollment/".concat(e),t);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:i}),this.setPersonPropertiesForFlags(i,!1);var o=a(a({},this.getFlagVariants()),{},d({},e,t));null===(n=this.instance.persistence)||void 0===n||n.register((d(r={},zn,Object.keys(Jn(o))),d(r,Mn,o),r)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(Pn);if(r&&!n)return e(r);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:function(n){var r;if(n.json){var i=n.json.earlyAccessFeatures;return null===(r=t.instance.persistence)||void 0===r||r.register(d({},Pn,i)),e(i)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach((function(t){return t(n,r,{errorsLoading:e})}))}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(Nn)||{};this.instance.register(d({},Nn,a(a({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Nn)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(Ln)||{};0!==Object.keys(n).length&&Object.keys(n).forEach((function(t){n[t]=a(a({},n[t]),e[t]),delete e[t]})),this.instance.register(d({},Ln,a(a({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(Ln)||{};this.instance.register(d({},Ln,a(a({},t),{},d({},e,{}))))}else this.instance.unregister(Ln)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Et(e)&&isFinite(e)&&Math.floor(e)===e});var Xn="0123456789abcdef",Kn=function(){function e(t){if(u(this,e),this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}return c(e,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Xn.charAt(this.bytes[t]>>>4)+Xn.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(e){return 0===this.compareTo(e)}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}],[{key:"fromFieldsV7",value:function(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/Math.pow(2,8),o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)}}]),e}(),Zn=function(){function e(){u(this,e),d(this,"timestamp",0),d(this,"counter",0),d(this,"random",new nr)}return c(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if(Ct(e)){this.timestamp=0;var t=this.generateOrAbort();if(Ct(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Kn.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),er=function(e){if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};rt&&!Ct(rt.crypto)&&crypto.getRandomValues&&(er=function(e){return crypto.getRandomValues(e)});var tr,nr=function(){function e(){u(this,e),d(this,"buffer",new Uint32Array(8)),d(this,"cursor",1/0)}return c(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(er(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),rr=function(){return ir().toString()},ir=function(){return(tr||(tr=new Zn)).generate()},or="Thu, 01 Jan 1970 00:00:00 GMT",ar="";var sr=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function ur(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lt;if(ar)return ar;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+rr(),o=new RegExp("(^|;)\\s*"+i+"=1");!ar&&r--;){var a=n.slice(r).join("."),s=i+"=1;domain=."+a;t.cookie=s,o.test(t.cookie)&&(t.cookie=s+";expires="+or,ar=a)}return ar}(e);if(!n){var r=function(e){var t=e.match(sr);return t?t[0]:""}(e);r!==n&&Mt.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var lr,cr={is_supported:function(){return!!lt},error:function(e){Mt.error("cookieStore error: "+e)},get:function(e){if(lt){try{for(var t=e+"=",n=lt.cookie.split(";").filter((function(e){return e.length})),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(cr.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){if(lt)try{var o="",a="",s=ur(lt.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),o="; expires="+u.toUTCString()}i&&(a="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+s+a;return l.length>3686.4&&Mt.warn("cookieStore warning: large cookie, len="+l.length),lt.cookie=l,l}catch(e){return}},remove:function(e,t){try{cr.set(e,"",-1,t)}catch(e){return}}},dr=null,fr={is_supported:function(){if(!It(dr))return dr;var e=!0;if(Ct(rt))e=!1;else try{var t="__mplssupport__";fr.set(t,"xyz"),'"xyz"'!==fr.get(t)&&(e=!1),fr.remove(t)}catch(t){e=!1}return e||Mt.error("localStorage unsupported; falling back to cookie store"),dr=e,e},error:function(e){Mt.error("localStorage error: "+e)},get:function(e){try{return null==rt?void 0:rt.localStorage.getItem(e)}catch(e){fr.error(e)}return null},parse:function(e){try{return JSON.parse(fr.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==rt||rt.localStorage.setItem(e,JSON.stringify(t))}catch(e){fr.error(e)}},remove:function(e){try{null==rt||rt.localStorage.removeItem(e)}catch(e){fr.error(e)}}},pr=["distinct_id",Tn,On],hr=a(a({},fr),{},{parse:function(e){try{var t={};try{t=cr.parse(e)||{}}catch(e){}var n=At(t,JSON.parse(fr.get(e)||"{}"));return fr.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i){try{fr.set(e,t);var o={};pr.forEach((function(e){t[e]&&(o[e]=t[e])})),Object.keys(o).length&&cr.set(e,o,n,r,i)}catch(e){fr.error(e)}},remove:function(e,t){try{null==rt||rt.localStorage.removeItem(e),cr.remove(e,t)}catch(e){fr.error(e)}}}),vr={},gr={is_supported:function(){return!0},error:function(e){Mt.error("memoryStorage error: "+e)},get:function(e){return vr[e]||null},parse:function(e){return vr[e]||null},set:function(e,t){vr[e]=t},remove:function(e){delete vr[e]}},mr=null,_r={is_supported:function(){if(!It(mr))return mr;if(mr=!0,Ct(rt))mr=!1;else try{var e="__support__";_r.set(e,"xyz"),'"xyz"'!==_r.get(e)&&(mr=!1),_r.remove(e)}catch(e){mr=!1}return mr},error:function(e){Mt.error("sessionStorage error: ",e)},get:function(e){try{return null==rt?void 0:rt.sessionStorage.getItem(e)}catch(e){_r.error(e)}return null},parse:function(e){try{return JSON.parse(_r.get(e))||null}catch(e){}return null},set:function(e,t){try{null==rt||rt.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){_r.error(e)}},remove:function(e){try{null==rt||rt.sessionStorage.removeItem(e)}catch(e){_r.error(e)}}},yr=["localhost","127.0.0.1"],br=function(e){var t=null==lt?void 0:lt.createElement("a");return Ct(t)?null:(t.href=e,t)},wr=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},kr=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return Dt(e,(function(e,r){Ct(e)||Ct(r)||"undefined"===r||(t=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t)})),i.join(r)},Sr=function(e,t){for(var n,r=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!wt(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch(e){Mt.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Cr=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},xr="Mobile",Ir="iOS",Fr="Android",Er="Tablet",Rr=Fr+" "+Er,Tr="iPad",Or="Apple",Mr=Or+" Watch",Pr="Safari",Nr="BlackBerry",Lr="Samsung",Dr=Lr+"Browser",Ar=Lr+" Internet",$r="Chrome",qr=$r+" OS",Hr=$r+" "+Ir,Br="Internet Explorer",jr=Br+" "+xr,Wr="Opera",Ur=Wr+" Mini",Vr="Edge",zr="Microsoft "+Vr,Gr="Firefox",Yr=Gr+" "+Ir,Jr="Nintendo",Qr="PlayStation",Xr="Xbox",Kr=Fr+" "+xr,Zr=xr+" "+Pr,ei="Windows",ti=ei+" Phone",ni="Nokia",ri="Ouya",ii="Generic",oi=ii+" "+xr.toLowerCase(),ai=ii+" "+Er.toLowerCase(),si="Konqueror",ui="(\\d+(\\.\\d+)?)",li=new RegExp("Version/"+ui),ci=new RegExp(Xr,"i"),di=new RegExp(Qr+" \\w+","i"),fi=new RegExp(Jr+" \\w+","i"),pi=new RegExp(Nr+"|PlayBook|BB10","i"),hi={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var vi=function(e,t){return t&&$t(t,Or)||function(e){return $t(e,Pr)&&!$t(e,$r)&&!$t(e,Fr)}(e)},gi=function(e,t){return t=t||"",$t(e," OPR/")&&$t(e,"Mini")?Ur:$t(e," OPR/")?Wr:pi.test(e)?Nr:$t(e,"IE"+xr)||$t(e,"WPDesktop")?jr:$t(e,Dr)?Ar:$t(e,Vr)||$t(e,"Edg/")?zr:$t(e,"FBIOS")?"Facebook "+xr:$t(e,$r)?$r:$t(e,"CriOS")?Hr:$t(e,"UCWEB")||$t(e,"UCBrowser")?"UC Browser":$t(e,"FxiOS")?Yr:$t(e,Fr)?Kr:$t(e.toLowerCase(),si.toLowerCase())?si:vi(e,t)?$t(e,xr)?Zr:Pr:$t(e,Gr)?Gr:$t(e,"MSIE")||$t(e,"Trident/")?Br:$t(e,"Gecko")?Gr:""},mi=(d(lr={},jr,[new RegExp("rv:"+ui)]),d(lr,zr,[new RegExp(Vr+"?\\/"+ui)]),d(lr,$r,[new RegExp($r+"/"+ui)]),d(lr,Hr,[new RegExp("CriOS\\/"+ui)]),d(lr,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+ui)]),d(lr,Pr,[li]),d(lr,Zr,[li]),d(lr,Wr,[new RegExp("(Opera|OPR)\\/"+ui)]),d(lr,Gr,[new RegExp(Gr+"\\/"+ui)]),d(lr,Yr,[new RegExp("FxiOS\\/"+ui)]),d(lr,si,[new RegExp("Konqueror[:/]?"+ui,"i")]),d(lr,Nr,[new RegExp(Nr+" "+ui),li]),d(lr,Kr,[new RegExp("android\\s"+ui)]),d(lr,Ar,[new RegExp(Dr+"\\/"+ui)]),d(lr,Br,[new RegExp("(rv:|MSIE )"+ui)]),d(lr,"Mozilla",[new RegExp("rv:"+ui)]),lr),_i=[[new RegExp(Xr+"; "+Xr+" (.*?)[);]","i"),function(e){return[Xr,e&&e[1]||""]}],[new RegExp(Jr,"i"),[Jr,""]],[new RegExp(Qr,"i"),[Qr,""]],[pi,[Nr,""]],[new RegExp(ei,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[ti,""];if(new RegExp(xr).test(t)&&!/IEMobile\b/.test(t))return[ei+" "+xr,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=hi[r]||"";return/arm/i.test(t)&&(i="RT"),[ei,i]}return[ei,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Ir,t.join(".")]}return[Ir,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=Ct(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Fr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Fr+")","i"),function(e){if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Fr,t.join(".")]}return[Fr,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[qr,""]],[/Linux|debian/i,["Linux",""]]],yi=function(e){return fi.test(e)?Jr:di.test(e)?Qr:ci.test(e)?Xr:new RegExp(ri,"i").test(e)?ri:new RegExp("("+ti+"|WPDesktop)","i").test(e)?ti:/iPad/.test(e)?Tr:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Mr:pi.test(e)?Nr:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ni,"i").test(e)?ni:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(xr).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Fr:Rr:Fr:new RegExp("(pda|"+xr+")","i").test(e)?oi:new RegExp(Er,"i").test(e)&&!new RegExp(Er+" pc","i").test(e)?ai:""},bi="https?://(.*)",wi={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid"].concat(e||[]),n={};return Dt(t,(function(e){var t=lt?Sr(lt.URL,e):"";t.length&&(n[e]=t)})),n},searchEngine:function(){var e=null==lt?void 0:lt.referrer;return e?0===e.search(bi+"google.([^/?]*)")?"google":0===e.search(bi+"bing.com")?"bing":0===e.search(bi+"yahoo.com")?"yahoo":0===e.search(bi+"duckduckgo.com")?"duckduckgo":null:null},searchInfo:function(){var e=wi.searchEngine(),t="yahoo"!=e?"q":"p",n={};if(!It(e)){n.$search_engine=e;var r=lt?Sr(lt.referrer,t):"";r.length&&(n.ph_keyword=r)}return n},browser:gi,browserVersion:function(e,t){var n=gi(e,t),r=mi[n];if(Ct(r))return null;for(var i=0;i<r.length;i++){var o=r[i],a=e.match(o);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(var t=0;t<_i.length;t++){var n=p(_i[t],2),r=n[0],i=n[1],o=r.exec(e),a=o&&(kt(i)?i(o,e):i);if(a)return a}return["",""]},device:yi,deviceType:function(e){var t=yi(e);return t===Tr||t===Rr||"Kobo"===t||"Kindle Fire"===t||t===ai?Er:t===Jr||t===Xr||t===Qr||t===ri?"Console":t===Mr?"Wearable":t?xr:"Desktop"},referrer:function(){return(null==lt?void 0:lt.referrer)||"$direct"},referringDomain:function(){var e;return null!=lt&&lt.referrer&&(null===(e=br(lt.referrer))||void 0===e?void 0:e.host)||"$direct"},properties:function(){if(!ht)return{};var e=p(wi.os(ht),2),t=e[0],n=e[1];return At(Wt({$os:t,$os_version:n,$browser:wi.browser(ht,navigator.vendor),$device:wi.device(ht),$device_type:wi.deviceType(ht)}),{$current_url:null==ct?void 0:ct.href,$host:null==ct?void 0:ct.host,$pathname:null==ct?void 0:ct.pathname,$raw_user_agent:ht.length>1e3?ht.substring(0,997)+"...":ht,$browser_version:wi.browserVersion(ht,navigator.vendor),$browser_language:wi.browserLanguage(),$screen_height:null==rt?void 0:rt.screen.height,$screen_width:null==rt?void 0:rt.screen.width,$viewport_height:null==rt?void 0:rt.innerHeight,$viewport_width:null==rt?void 0:rt.innerWidth,$lib:"web",$lib_version:gt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Ht()/1e3})},people_properties:function(){if(!ht)return{};var e=p(wi.os(ht),2),t=e[0],n=e[1];return At(Wt({$os:t,$os_version:n,$browser:wi.browser(ht,navigator.vendor)}),{$browser_version:wi.browserVersion(ht,navigator.vendor)})}},ki=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Si=function(){function e(t){u(this,e),this.config=t,this.props={},this.campaign_params_saved=!1,this.name=function(e){var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"}(t),this.storage=this.buildStorage(t),this.load(),this.update_config(t,t),this.save()}return c(e,[{key:"buildStorage",value:function(e){-1===ki.indexOf(e.persistence.toLowerCase())&&(Mt.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&fr.is_supported()?fr:"localstorage+cookie"===t&&hr.is_supported()?hr:"sessionstorage"===t&&_r.is_supported()?_r:"memory"===t?gr:"cookie"===t?cr:hr.is_supported()?hr:cr}},{key:"properties",value:function(){var e={};return Dt(this.props,(function(t,n){if(n===Mn&&St(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e["$feature/".concat(r[i])]=t[r[i]];else a=n,s=!1,(It(o=Bn)?s:st&&o.indexOf===st?-1!=o.indexOf(a):(Dt(o,(function(e){if(s||(s=e===a))return Pt})),s))||(e[n]=t);var o,a,s})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=At({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var r=this;if(St(e)){Ct(t)&&(t="None"),this.expire_days=Ct(n)?this.default_expiry:n;var i=!1;if(Dt(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(St(e)){this.expire_days=Ct(t)?this.default_expiry:t;var r=!1;if(Dt(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(wi.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(wi.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||wi.referrer(),$referring_domain:this.props.$referring_domain||wi.referringDomain()})}},{key:"get_referrer_info",value:function(){return Wt({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return Dt(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this.buildStorage(e),r=this.props;this.clear(),this.storage=n,this.props=r,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[Sn]||{};n[e]=t,this.props[Sn]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Sn]||{})[e];return Ct(t)||(delete this.props[Sn][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[$n]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[$n]=e,this.save()}},{key:"get_quota_limits",value:function(){return this.props[qn]||{}}},{key:"set_quota_limits",value:function(e){this.props[qn]=e,this.save()}}]),e}(),Ci=2,xi=4;var Ii=c((function e(t){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};u(this,e),d(this,"bucketSize",100),d(this,"refillRate",10),d(this,"mutationBuckets",{}),d(this,"loggedTracker",{}),d(this,"refillBuckets",(function(){Object.keys(i.mutationBuckets).forEach((function(e){i.mutationBuckets[e]=i.mutationBuckets[e]+i.refillRate,i.mutationBuckets[e]>=i.bucketSize&&delete i.mutationBuckets[e]}))})),d(this,"getNodeOrRelevantParent",(function(e){var t=i.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[i.rrweb.mirror.getId(n),n]}return[e,t]})),d(this,"numberOfChanges",(function(e){var t,n,r,i,o,a,s,u;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null===(a=e.texts)||void 0===a?void 0:a.length)&&void 0!==o?o:0)+(null!==(s=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==s?s:0)})),d(this,"throttleMutations",(function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=i.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,r,o=p(i.getNodeOrRelevantParent(e.id),2),a=o[0],s=o[1];if(0===i.mutationBuckets[a])return!1;(i.mutationBuckets[a]=null!==(t=i.mutationBuckets[a])&&void 0!==t?t:i.bucketSize,i.mutationBuckets[a]=Math.max(i.mutationBuckets[a]-1,0),0===i.mutationBuckets[a])&&(i.loggedTracker[a]||(i.loggedTracker[a]=!0,null===(n=(r=i.options).onBlockedNode)||void 0===n||n.call(r,a,s)));return e})));var r=i.numberOfChanges(t);return 0!==r||n===r?e:void 0})),this.rrweb=t,this.options=o,this.refillRate=null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,this.bucketSize=null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,setInterval((function(){i.refillBuckets()}),1e3)})),Fi=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(Fi||{}),Ei="[SessionRecording]",Ri={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},Ti=["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"],Oi=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Mi=["/s/","/e/","/i/"];function Pi(e,t,n,r){if(Ft(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return xt(i)&&(i=parseInt(i)),i>n?Ei+" ".concat(r," body too large to record (").concat(i," bytes)"):e}function Ni(e,t){if(Ft(e))return e;var n=e;return hn(n,!1)||(n=Ei+" "+t+" body redacted"),Dt(Oi,(function(e){var r,i;null!==(r=n)&&void 0!==r&&r.length&&-1!==(null===(i=n)||void 0===i?void 0:i.indexOf(e))&&(n=Ei+" "+t+" body redacted as might contain: "+e)})),n}var Li=function(e,t){var n,r,i,o=e.session_recording,s=!1!==o.recordHeaders&&t.recordHeaders,u=!1!==o.recordBody&&t.recordBody,l=!1!==o.recordPerformance&&t.recordPerformance,c=(n=o,i=Math.min(1e6,null!==(r=n.payloadSizeLimitBytes)&&void 0!==r?r:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=Pi(e.requestBody,e.requestHeaders,i,"Request")),null!=e&&e.responseBody&&(e.responseBody=Pi(e.responseBody,e.responseHeaders,i,"Response")),e}),d=function(e){return function(e){if(!Ct(e))return e.requestBody=Ni(e.requestBody,"Request"),e.responseBody=Ni(e.responseBody,"Response"),e}(c(function(e){var t=br(e.name);if(!(t&&t.pathname&&Mi.some((function(e){return 0===t.pathname.indexOf(e)}))))return e}((t=e,Dt(Object.keys(null!==(n=t.requestHeaders)&&void 0!==n?n:{}),(function(e){var n;Ti.includes(e.toLowerCase())&&(null===(n=t.requestHeaders)||void 0===n||delete n[e])})),t))));var t,n},f=kt(e.session_recording.maskNetworkRequestFn);return f&&kt(e.session_recording.maskCapturedNetworkRequestFn)&&Mt.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),f&&(e.session_recording.maskCapturedNetworkRequestFn=function(t){var n=e.session_recording.maskNetworkRequestFn({url:t.name});return a(a({},t),{},{name:null==n?void 0:n.url})}),o.maskRequestFn=kt(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var n,r,i,o=d(t);return o&&null!==(n=null===(r=(i=e.session_recording).maskCapturedNetworkRequestFn)||void 0===r?void 0:r.call(i,o))&&void 0!==n?n:void 0}:void 0,o.maskRequestFn||(o.maskRequestFn=d),a(a(a({},Ri),o),{},{recordHeaders:s,recordBody:u,recordPerformance:l,recordInitialRequests:l})},Di="__ph_opt_in_out_";function Ai(e,t){Vi(!0,e,t)}function $i(e,t){Vi(!1,e,t)}function qi(e,t){return"1"===Ui(e,t)}function Hi(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||rt,n=null==t?void 0:t.navigator,r=!1;return Dt([null==n?void 0:n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){$t([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===Ui(e,t)}function Bi(e,t){ji(t=t||{}).remove(Wi(e,t),!!t.crossSubdomainCookie)}function ji(e){return"localStorage"===(e=e||{}).persistenceType?fr:"localStorage+cookie"===e.persistenceType?hr:cr}function Wi(e,t){return((t=t||{}).persistencePrefix||Di)+e}function Ui(e,t){return ji(t).get(Wi(e,t))}function Vi(e,t,n){xt(t)&&t.length?(ji(n=n||{}).set(Wi(t,n),e?1:0,Et(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):Mt.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function zi(e){var t=!1;try{var n=e.config.token,r=e.config.respect_dnt,i=e.config.opt_out_capturing_persistence_type,o=e.config.opt_out_capturing_cookie_prefix||void 0,a=e.config.window;n&&(t=Hi(n,{respectDnt:r,persistenceType:i,persistencePrefix:o,window:a}))}catch(e){Mt.error("Unexpected error when checking capturing opt-out status: "+e)}return t}var Gi,Yi=3e5,Ji=Yi;!function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"}(Gi||(Gi={}));var Qi=[Gi.MouseMove,Gi.MouseInteraction,Gi.Scroll,Gi.ViewportResize,Gi.Input,Gi.TouchMove,Gi.MediaInteraction,Gi.Drag],Xi=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}},Ki="[SessionRecording]",Zi=function(){function e(t){var n=this;if(u(this,e),d(this,"queuedRRWebEvents",[]),d(this,"isIdle",!1),d(this,"_linkedFlagSeen",!1),d(this,"_lastActivityTimestamp",Date.now()),d(this,"windowId",null),d(this,"sessionId",null),d(this,"_linkedFlag",null),d(this,"_sampleRate",null),d(this,"_minimumDuration",null),d(this,"_forceAllowLocalhostNetworkCapture",!1),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,null==rt||rt.addEventListener("beforeunload",(function(){n._flushBuffer()})),null==rt||rt.addEventListener("offline",(function(){n._tryAddCustomEvent("browser offline",{})})),null==rt||rt.addEventListener("online",(function(){n._tryAddCustomEvent("browser online",{})})),null==rt||rt.addEventListener("visibilitychange",(function(){if(null!=lt&&lt.visibilityState){var e="window "+lt.visibilityState;n._tryAddCustomEvent(e,{})}})),!this.instance.sessionManager)throw Mt.error(Ki+" started without valid sessionManager"),new Error(Ki+" started without valid sessionManager. This is a bug.");this.buffer=this.clearBuffer()}return c(e,[{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw Mt.error(Ki+" started without valid sessionManager"),new Error(Ki+" started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){return Et(this._sampleRate)?this.instance.get_property(On):null}},{key:"sessionDuration",get:function(){var e,t,n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(xn),t=!this.instance.config.disable_session_recording;return rt&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(In),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(Rn);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"recordingVersion",get:function(){var e,t=this.instance.get_property(Fn);return(null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recorderVersion)||t||"v1"}},{key:"networkPayloadCapture",get:function(){var e,t,n=this.instance.get_property(En),r={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},i=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),a=this.instance.config.capture_performance||(null==n?void 0:n.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?Ft(this._linkedFlag)||this._linkedFlagSeen?Rt(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled?(this._startCapture(),Mt.info(Ki+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,Mt.info(Ki+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,n=this.sessionId!==e;if(Et(this._sampleRate)){var r,i=this.isSampled;if(n||!Rt(i))r=Math.random()<this._sampleRate;else r=i;r||Mt.warn(Ki+" Sample rate (".concat(this._sampleRate,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),null===(t=this.instance.persistence)||void 0===t||t.register(d({},On,r))}else{var o;null===(o=this.instance.persistence)||void 0===o||o.register(d({},On,null))}}},{key:"afterDecideResponse",value:function(e){var t,n,r,i,o,s,u,l,c,f,p,h=this;this.instance.persistence&&this.instance.persistence.register((d(p={},xn,!!e.sessionRecording),d(p,In,null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled),d(p,Fn,null===(s=e.sessionRecording)||void 0===s?void 0:s.recorderVersion),d(p,En,a({capturePerformance:e.capturePerformance},null===(u=e.sessionRecording)||void 0===u?void 0:u.networkPayloadCapture)),d(p,Rn,{enabled:null===(l=e.sessionRecording)||void 0===l?void 0:l.recordCanvas,fps:null===(c=e.sessionRecording)||void 0===c?void 0:c.canvasFps,quality:null===(f=e.sessionRecording)||void 0===f?void 0:f.canvasQuality}),p));var v=null===(t=e.sessionRecording)||void 0===t?void 0:t.sampleRate;this._sampleRate=Ft(v)?null:parseFloat(v);var g,m=null===(n=e.sessionRecording)||void 0===n?void 0:n.minimumDurationMilliseconds;(this._minimumDuration=Ct(m)?null:m,this._linkedFlag=(null===(r=e.sessionRecording)||void 0===r?void 0:r.linkedFlag)||null,null!==(i=e.sessionRecording)&&void 0!==i&&i.endpoint)&&(this._endpoint=null===(g=e.sessionRecording)||void 0===g?void 0:g.endpoint);if(Et(this._sampleRate)&&this.sessionManager.onSessionId((function(e){h.makeSamplingDecision(e)})),!Ft(this._linkedFlag)){var _,y,b=xt(this._linkedFlag)?this._linkedFlag:null===(_=this._linkedFlag)||void 0===_?void 0:_.flag,w=xt(this._linkedFlag)?null:null===(y=this._linkedFlag)||void 0===y?void 0:y.variant;this.instance.onFeatureFlags((function(e,t){var n=St(t)&&b in t,r=w?t[b]===w:n;r&&Mt.info(Ki+" linked flag matched",{linkedFlag:b,linkedVariant:w}),h._linkedFlagSeen=r}))}this.receivedDecide=!0,this.startRecordingIfEnabled()}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:Ht()})}},{key:"_startCapture",value:function(){var e=this;if(!Ct(Object.assign)&&!(this._captureStarted||this.instance.config.disable_session_recording||zi(this.instance))){this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId();var t="v2"===this.recordingVersion?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.recordingVersion?Gt(this.instance.requestRouter.endpointFor("assets","/static/".concat(t,"?v=").concat(gt.LIB_VERSION)),(function(n){if(n)return Mt.error(Ki+" could not load ".concat(t),n);e._onScriptLoaded()})):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(e){var t;return 3===e.type&&-1!==Qi.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this._isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>Ji&&(this.isIdle=!0,this._tryAddCustomEvent("sessionIdle",{reason:"user inactivity",timeSinceLastActive:e.timestamp-this._lastActivityTimestamp,threshold:Ji}));var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),i=r.windowId,o=r.sessionId,a=this.sessionId!==o,s=this.windowId!==i;this.windowId=i,this.sessionId=o,(n||-1===[Ci,xi].indexOf(e.type)&&(s||a))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):Mt.warn(Ki+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var n=this;return this._tryRRWebMethod(Xi((function(){return n.rrwebRecord.addCustomEvent(e,t)})))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(Xi((function(){return e.rrwebRecord.takeFullSnapshot()})))}},{key:"_onScriptLoaded",value:function(){var e,t=this,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=rt.rrweb?rt.rrweb.record:rt.rrwebRecord;for(var r=this.instance.config.session_recording,i=0,o=Object.entries(r||{});i<o.length;i++){var s=p(o[i],2),u=s[0],l=s[1];u in n&&(n[u]=l)}if(this.canvasRecording&&this.canvasRecording.enabled&&(n.recordCanvas=!0,n.sampling={canvas:this.canvasRecording.fps},n.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new Ii(this.rrwebRecord,{onBlockedNode:function(e,n){var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");Mt.info(r,{node:n}),t.log(Ki+" "+r,"warn")}}),this._scheduleFullSnapshot();var c=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(a({emit:function(e){t.onRRwebEmit(e)},plugins:c},n)),this.instance._addCaptureHook((function(e){try{if("$pageview"===e){var n=rt?t._maskUrl(rt.location.href):"";if(!n)return;t._tryAddCustomEvent("$pageview",{href:n}),t._tryTakeFullSnapshot()}}catch(e){Mt.error("Could not add $pageview to rrweb session",e)}})),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:n,activePlugins:c.map((function(e){return null==e?void 0:e.name}))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else Mt.error(Ki+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this._fullSnapshotTimer=setInterval((function(){e._tryTakeFullSnapshot()}),Yi)}},{key:"_gatherRRWebPlugins",value:function(){var e=[];(vt.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(vt.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&kt(vt.getRecordNetworkPlugin))&&(!yr.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(vt.getRecordNetworkPlugin(Li(this.instance.config,this.networkPayloadCapture))):Mt.info(Ki+" NetworkCapture not started because we are on localhost."));return e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&St(e)){if(e.type===Fi.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===Fi.FullSnapshot&&this._scheduleFullSnapshot();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var r=function(e){var t=e;if(t&&St(t)&&6===t.type&&St(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(n),i=JSON.stringify(r).length;if(this._updateWindowAndSessionIds(r),!this.isIdle||r.type===Fi.Custom){var o={$snapshot_bytes:i,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&rt){var e=this._maskUrl(rt.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=h(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach((function(n){Date.now()-n.enqueuedAt>2e3?e._tryAddCustomEvent("rrwebQueueTimeout",{enqueuedAt:n.enqueuedAt,attempt:n.attempt,queueLength:t.length}):e._tryRRWebMethod(n)&&e._tryAddCustomEvent("rrwebQueueSuccess",{enqueuedAt:n.enqueuedAt,attempt:n.attempt,queueLength:t.length})}))}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null===(n=r=t.maskNetworkRequestFn(r))||void 0===n?void 0:n.url}return e}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this._minimumDuration,n=this.sessionDuration,r=Et(n)&&n>=0,i=Et(t)&&r&&n<t;return"buffering"===this.status||i?(this.flushBufferTimer=setTimeout((function(){e._flushBuffer()}),2e3),this.buffer||this.clearBuffer()):this.buffer&&0!==this.buffer.data.length?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);(!this.buffer||this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId&&this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),It(this.buffer.sessionId)&&!It(this.sessionId)&&(this.buffer.sessionId=this.sessionId,this.buffer.windowId=this.windowId),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout((function(){n._flushBuffer()}),2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings"})}}]),e}(),eo=function(){function e(t){u(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return c(e,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Nn),group_properties:this.instance.get_property(Ln),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:Un.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){return e.parseDecideResponse(t.json)}})}},{key:"parseDecideResponse",value:function(e){var t,n=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var r=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=e?e:{},r),r)Mt.error("Failed to fetch feature flags from PostHog.");else{if(!lt||!lt.body)return Mt.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){n.parseDecideResponse(e)}),500);this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),Vn.afterDecideResponse(e,this.instance),this.instance._afterDecideResponse(e);var i=null==rt?void 0:rt.extendPostHogWithSurveys;e.surveys&&!i&&Gt(this.instance.requestRouter.endpointFor("assets","/static/surveys.js"),(function(e){if(e)return Mt.error("Could not load surveys script",e);rt.extendPostHogWithSurveys(n.instance)}));var o=null==rt?void 0:rt.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&Ct(o)&&Gt(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js"),(function(t){if(t)return Mt.error("Could not load exception autocapture script",t);rt.extendPostHogWithExceptionAutocapture(n.instance,e)})),e.siteApps)if(this.instance.config.opt_in_site_apps){var a,s=m(e.siteApps);try{var u=function(){var e=a.value,t=e.id,r=e.url,i=n.instance.requestRouter.endpointFor("api",r);vt["__$$ph_site_app_".concat(t)]=n.instance,Gt(i,(function(e){e&&Mt.error("Error while initializing PostHog app with config id ".concat(t),e)}))};for(s.s();!(a=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}}else e.siteApps.length>0&&Mt.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),e}(),to=["source"],no=null!=rt&&rt.location?Cr(rt.location.hash,"__posthog")||Cr(location.hash,"state"):null,ro=function(){function e(t){u(this,e),this.instance=t}return c(e,[{key:"afterDecideResponse",value:function(e){var t=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&t.toolbarVersion&&0===t.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(a({},t))}},{key:"maybeLoadToolbar",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!rt||!lt)return!1;n=null!==(e=n)&&void 0!==e?e:rt.location,i=null!==(t=i)&&void 0!==t?t:rt.history;try{if(!r){try{rt.localStorage.setItem("test","test"),rt.localStorage.removeItem("test")}catch(e){return!1}r=null==rt?void 0:rt.localStorage}var o,a=no||Cr(n.hash,"__posthog")||Cr(n.hash,"state"),s=a?Bt((function(){return JSON.parse(atob(decodeURIComponent(a)))}))||Bt((function(){return JSON.parse(decodeURIComponent(a))})):null;return s&&"ph_authorize"===s.action?((o=s).source="url",o&&Object.keys(o).length>0&&(s.desiredHash?n.hash=s.desiredHash:i?i.replaceState("",lt.title,n.pathname+n.search):n.hash="")):((o=JSON.parse(r.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}},{key:"loadToolbar",value:function(e){var t=this;if(!rt||vt._postHogToolbarLoaded)return!1;vt._postHogToolbarLoaded=!0;var n=3e5,r=Math.floor(Date.now()/n)*n,i=this.instance.requestRouter.endpointFor("assets","/static/toolbar.js?t=".concat(r)),o="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=a(a({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},o?{instrument:!1}:{});s.source;var u=f(s,to);return rt.localStorage.setItem("_postHogToolbarParams",JSON.stringify(u)),Gt(i,(function(e){e?Mt.error("Failed to load toolbar",e):(vt.ph_load_toolbar||vt.ph_load_editor)(s,t.instance)})),zt(rt,"turbolinks:load",(function(){vt._postHogToolbarLoaded=!1,t.loadToolbar(s)})),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}]),e}(),io=function(){function e(t){u(this,e),d(this,"isPaused",!0),d(this,"queue",[]),d(this,"flushTimeoutMs",3e3),this.sendRequest=t}return c(e,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var t=this.queue.length>0?this.formatQueue():{},n=Object.values(t);[].concat(h(n.filter((function(e){return 0===e.url.indexOf("/e")}))),h(n.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(t){e.sendRequest(a(a({},t),{},{transport:"sendBeacon"}))}))}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=(new Date).getTime();r.data&&wt(r.data)&&Dt(r.data,(function(e){e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.sendRequest(r)};for(var r in t)n(r)}}),this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return Dt(this.queue,(function(t){var n,r=t,i=(r?r.batchKey:null)||r.url;Ct(e[i])&&(e[i]=a(a({},r),{},{data:[]})),null===(n=e[i].data)||void 0===n||n.push(r.data)})),this.queue=[],e}}]),e}(),oo=Uint8Array,ao=Uint16Array,so=Uint32Array,uo=new oo([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]),lo=new oo([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]),co=new oo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fo=function(e,t){for(var n=new ao(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new so(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},po=fo(uo,2),ho=po[0],vo=po[1];ho[28]=258,vo[258]=28;for(var go=fo(lo,0)[1],mo=new ao(32768),_o=0;_o<32768;++_o){var yo=(43690&_o)>>>1|(21845&_o)<<1;yo=(61680&(yo=(52428&yo)>>>2|(13107&yo)<<2))>>>4|(3855&yo)<<4,mo[_o]=((65280&yo)>>>8|(255&yo)<<8)>>>1}var bo=function(e,t,n){for(var r=e.length,i=0,o=new ao(t);i<r;++i)++o[e[i]-1];var a,s=new ao(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(n){a=new ao(1<<t);var u=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],c=t-e[i],d=s[e[i]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)a[mo[d]>>>u]=l}else for(a=new ao(r),i=0;i<r;++i)a[i]=mo[s[e[i]-1]++]>>>15-e[i];return a},wo=new oo(288);for(_o=0;_o<144;++_o)wo[_o]=8;for(_o=144;_o<256;++_o)wo[_o]=9;for(_o=256;_o<280;++_o)wo[_o]=7;for(_o=280;_o<288;++_o)wo[_o]=8;var ko=new oo(32);for(_o=0;_o<32;++_o)ko[_o]=5;var So=bo(wo,9,0),Co=bo(ko,5,0),xo=function(e){return(e/8>>0)+(7&e&&1)},Io=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof ao?ao:e instanceof so?so:oo)(n-t);return r.set(e.subarray(t,n)),r},Fo=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Eo=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Ro=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new oo(0),0];if(1==i){var a=new oo(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],u=n[1],l=0,c=1,d=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};c!=i-1;)s=n[n[l].f<n[d].f?l++:d++],u=n[l!=c&&n[l].f<n[d].f?l++:d++],n[c++]={s:-1,f:s.f+u.f,l:s,r:u};var f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var p=new ao(f+1),h=To(n[c-1],p,0);if(h>t){r=0;var v=0,g=h-t,m=1<<g;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var _=o[r].s;if(!(p[_]>t))break;v+=m-(1<<h-p[_]),p[_]=t}for(v>>>=g;v>0;){var y=o[r].s;p[y]<t?v-=1<<t-p[y]++-1:++r}for(;r>=0&&v;--r){var b=o[r].s;p[b]==t&&(--p[b],++v)}h=t}return[new oo(p),h]},To=function e(t,n,r){return-1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},Oo=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ao(++t),r=0,i=e[0],o=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[s]}return[n.subarray(0,r),t]},Mo=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Po=function(e,t,n){var r=n.length,i=xo(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},No=function(e,t,n,r,i,o,a,s,u,l,c){Fo(t,c++,n),++i[256];for(var d=Ro(i,15),f=d[0],p=d[1],h=Ro(o,15),v=h[0],g=h[1],m=Oo(f),_=m[0],y=m[1],b=Oo(v),w=b[0],k=b[1],S=new ao(19),C=0;C<_.length;++C)S[31&_[C]]++;for(C=0;C<w.length;++C)S[31&w[C]]++;for(var x=Ro(S,7),I=x[0],F=x[1],E=19;E>4&&!I[co[E-1]];--E);var R,T,O,M,P=l+5<<3,N=Mo(i,wo)+Mo(o,ko)+a,L=Mo(i,f)+Mo(o,v)+a+14+3*E+Mo(S,I)+(2*S[16]+3*S[17]+7*S[18]);if(P<=N&&P<=L)return Po(t,c,e.subarray(u,u+l));if(Fo(t,c,1+(L<N)),c+=2,L<N){R=bo(f,p,0),T=f,O=bo(v,g,0),M=v;var D=bo(I,F,0);Fo(t,c,y-257),Fo(t,c+5,k-1),Fo(t,c+10,E-4),c+=14;for(C=0;C<E;++C)Fo(t,c+3*C,I[co[C]]);c+=3*E;for(var A=[_,w],$=0;$<2;++$){var q=A[$];for(C=0;C<q.length;++C){var H=31&q[C];Fo(t,c,D[H]),c+=I[H],H>15&&(Fo(t,c,q[C]>>>5&127),c+=q[C]>>>12)}}}else R=So,T=wo,O=Co,M=ko;for(C=0;C<s;++C)if(r[C]>255){H=r[C]>>>18&31;Eo(t,c,R[H+257]),c+=T[H+257],H>7&&(Fo(t,c,r[C]>>>23&31),c+=uo[H]);var B=31&r[C];Eo(t,c,O[B]),c+=M[B],B>3&&(Eo(t,c,r[C]>>>5&8191),c+=lo[B])}else Eo(t,c,R[r[C]]),c+=T[r[C]];return Eo(t,c,R[256]),c+T[256]},Lo=new so([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Do=new oo(0),Ao=function(){for(var e=new so(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),$o=function(e,t,n,r,i){return function(e,t,n,r,i,o){var a=e.length,s=new oo(r+a+5*(1+Math.floor(a/7e3))+i),u=s.subarray(r,s.length-i),l=0;if(!t||a<8)for(var c=0;c<=a;c+=65535){var d=c+65535;d<a?l=Po(u,l,e.subarray(c,d)):(u[c]=o,l=Po(u,l,e.subarray(c,a)))}else{for(var f=Lo[t-1],p=f>>>13,h=8191&f,v=(1<<n)-1,g=new ao(32768),m=new ao(v+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&v},w=new so(25e3),k=new ao(288),S=new ao(32),C=0,x=0,I=(c=0,0),F=0,E=0;c<a;++c){var R=b(c),T=32767&c,O=m[R];if(g[T]=O,m[R]=T,F<=c){var M=a-c;if((C>7e3||I>24576)&&M>423){l=No(e,u,0,w,k,S,x,I,E,c-E,l),I=C=x=0,E=c;for(var P=0;P<286;++P)k[P]=0;for(P=0;P<30;++P)S[P]=0}var N=2,L=0,D=h,A=T-O&32767;if(M>2&&R==b(c-A))for(var $=Math.min(p,M)-1,q=Math.min(32767,c),H=Math.min(258,M);A<=q&&--D&&T!=O;){if(e[c+N]==e[c+N-A]){for(var B=0;B<H&&e[c+B]==e[c+B-A];++B);if(B>N){if(N=B,L=A,B>$)break;var j=Math.min(A,B-2),W=0;for(P=0;P<j;++P){var U=c-A+P+32768&32767,V=U-g[U]+32768&32767;V>W&&(W=V,O=U)}}}A+=(T=O)-(O=g[T])+32768&32767}if(L){w[I++]=268435456|vo[N]<<18|go[L];var z=31&vo[N],G=31&go[L];x+=uo[z]+lo[G],++k[257+z],++S[G],F=c+N,++C}else w[I++]=e[c],++k[e[c]]}}l=No(e,u,o,w,k,S,x,I,E,c-E,l),o||(l=Po(u,l,Do))}return Io(s,0,r+xo(l)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},qo=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Ho(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Ao[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,o=$o(e,t,10+((i=t).filename&&i.filename.length+1||0),8),a=o.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&qo(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}}(o,t),qo(o,a-8,n.d()),qo(o,a-4,r),o}var Bo=!!ft||!!dt,jo="text/plain",Wo=function(e,t){var n=p(e.split("?"),2),r=n[0],i=n[1],o=a({},t);null==i||i.split("&").forEach((function(e){var t=p(e.split("="),1)[0];delete o[t]}));var s=kr(o);return s=s?(i?i+"&":"")+s:i,"".concat(r,"?").concat(s)},Uo=function(e){return"data="+encodeURIComponent("string"==typeof e?e:JSON.stringify(e))},Vo=function(e){var t=e.data,n=e.compression;if(t){if(n===Un.GZipJS){var r=Ho(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new oo(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},a=0;a<n;++a){if(i+5>r.length){var s=new oo(i+8+(n-a<<1));s.set(r),r=s}var u=e.charCodeAt(a);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return Io(r,0,i)}(JSON.stringify(t)),{mtime:0});return{contentType:jo,body:new Blob([r],{type:jo})}}if(n===Un.Base64){var i=function(e){var t,n,r,i,o,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,l="",c=[];if(!e)return e;e=Vt(e);do{t=(o=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,c[u++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(i)}while(s<e.length);switch(l=c.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}(JSON.stringify(t));return{contentType:"application/x-www-form-urlencoded",body:Uo(i)}}return{contentType:"application/json",body:JSON.stringify(t)}}},zo=function(e){var t,n=new ft;n.open(e.method||"GET",e.url,!0);var r=null!==(t=Vo(e))&&void 0!==t?t:{},i=r.contentType,o=r.body;Dt(e.headers,(function(e,t){n.setRequestHeader(t,e)})),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=function(){if(4===n.readyState){var t,r={statusCode:n.status,text:n.responseText};if(200===n.status)try{r.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,r)}},n.send(o)},Go=function(e){var t,n,r=null!==(t=Vo(e))&&void 0!==t?t:{},i=r.contentType,o=r.body,a=new Headers;Dt(a,(function(e,t){a.append(t,e)})),i&&a.append("Content-Type",i);var s=e.url,u=null;if(pt){var l=new pt;u={signal:l.signal,timeout:setTimeout((function(){return l.abort()}),e.timeout)}}dt(s,{method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method,body:o,signal:null===(n=u)||void 0===n?void 0:n.signal}).then((function(t){return t.text().then((function(n){var r,i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){Mt.error(e)}null===(r=e.callback)||void 0===r||r.call(e,i)}))})).catch((function(t){var n;Mt.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((function(){return u?clearTimeout(u.timeout):null}))},Yo=function(e){var t=Wo(e.url,{beacon:"1"});try{var n,r=null!==(n=Vo(e))&&void 0!==n?n:{},i=r.contentType,o=r.body,a="string"==typeof o?new Blob([o],{type:i}):o;ut.sendBeacon(t,a)}catch(e){}},Jo=function(e){var t;if(lt){var n=lt.createElement("script");n.type="text/javascript",n.async=!0,n.defer=!0,n.src=e.url;var r=lt.getElementsByTagName("script")[0];null===(t=r.parentNode)||void 0===t||t.insertBefore(n,r)}},Qo=["retriesPerformedSoFar"];var Xo,Ko=function(){function e(t){var n=this;u(this,e),d(this,"isPolling",!1),d(this,"pollIntervalMs",3e3),d(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!Ct(rt)&&"onLine"in rt.navigator&&(this.areWeOnline=rt.navigator.onLine,rt.addEventListener("online",(function(){n.areWeOnline=!0,n.flush()})),rt.addEventListener("offline",(function(){n.areWeOnline=!1})))}return c(e,[{key:"retriableRequest",value:function(e){var t=this,n=e.retriesPerformedSoFar,r=f(e,Qo);Et(n)&&n>0&&(r.url=Wo(r.url,{retry_count:n})),this.instance._send_request(a(a({},r),{},{callback:function(e){var i;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=n?n:0)<10?t.enqueue(a({},r)):null===(i=r.callback)||void 0===i||i.call(r,e)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(t),r=Date.now()+n;this.queue.push({retryAt:r,requestOptions:e});var i="Enqueued failed request for retry in ".concat(n);navigator.onLine||(i+=" (Browser is offline)"),Mt.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout((function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()}),this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],n=this.queue.filter((function(n){return n.retryAt<e||(t.push(n),!1)}));if(this.queue=t,n.length>0){var r,i=m(n);try{for(i.s();!(r=i.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(e){i.e(e)}finally{i.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,t=m(this.queue);try{for(t.s();!(e=t.n()).done;){var n=e.value.requestOptions;try{this.instance._send_request(a(a({},n),{},{transport:"sendBeacon"}))}catch(e){Mt.error(e)}}}catch(e){t.e(e)}finally{t.f()}this.queue=[]}}]),e}(),Zo=1800,ea=function(){function e(t,n,r,i){u(this,e),d(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||rr,this._windowIdGenerator=i||rr;var o=t.persistence_name||t.token,a=t.session_idle_timeout_seconds||Zo;if(Et(a)?a>Zo?Mt.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a<60&&Mt.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(Mt.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=Zo),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,60),Zo),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var s=_r.parse(this._window_id_storage_key),l=_r.parse(this._primary_window_exists_storage_key);s&&!l?this._windowId=s:_r.remove(this._window_id_storage_key),_r.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return c(e,[{key:"onSessionId",value:function(e){var t=this;return Ct(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter((function(t){return t!==e}))}}},{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&_r.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&_r.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?_r.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(d({},Tn,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Tn];return wt(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;null==rt||rt.addEventListener("beforeunload",(function(){e._canUseSessionStorage()&&_r.remove(e._primary_window_exists_storage_key)}))}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),n=p(this._getSessionId(),3),r=n[0],i=n[1],o=n[2],a=this._getWindowId(),s=o&&o>0&&Math.abs(t-o)>864e5,u=!1,l=!i,c=!e&&Math.abs(t-r)>this._sessionTimeoutMs;l||c||s?(i=this._sessionIdGenerator(),a=this._windowIdGenerator(),Mt.info("[SessionId] new session ID generated",{sessionId:i,windowId:a,changeReason:{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:s}}),o=t,u=!0):a||(a=this._windowIdGenerator(),u=!0);var d=0===r||!e||s?t:r,f=0===o?(new Date).getTime():o;return this._setWindowId(a),this._setSessionId(i,d,f),u&&this._sessionIdChangedHandlers.forEach((function(e){return e(i,a)})),{sessionId:i,windowId:a,sessionStartTimestamp:f}}}]),e}();!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(Xo||(Xo={}));var ta=function(){function e(t){u(this,e),d(this,"_regionCache",{}),this.instance=t}return c(e,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e;return null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"")}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Xo.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Xo.EU:this._regionCache[this.apiHost]=Xo.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return(this.uiHost||this.apiHost)+t;if(this.region===Xo.CUSTOM)return this.apiHost+t;var n="i.posthog.com"+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,".").concat(n)}}}]),e}(),na=c((function e(t,n,r,i){u(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var o,a,s,u,l;if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var c=t.requestRouter.endpointFor("ui","/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=c,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var d=(null===(o=e.exception)||void 0===o?void 0:o.values)||[],f={$exception_message:null===(a=d[0])||void 0===a?void 0:a.value,$exception_type:null===(s=d[0])||void 0===s?void 0:s.type,$exception_personURL:c,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:null===(u=d[0])||void 0===u?void 0:u.value,$sentry_exception_type:null===(l=d[0])||void 0===l?void 0:l.type,$sentry_tags:e.tags};return n&&r&&(f.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",f),e}))}})),ra=function(){function e(t){var n=this;u(this,e),d(this,"_hasSeenPageView",!1),d(this,"_updateScrollData",(function(){var e,t,r,i;n._pageViewData||(n._pageViewData=n._createPageViewData());var o=n._pageViewData,a=n._scrollY(),s=n._scrollHeight(),u=n._contentY(),l=n._contentHeight();o.lastScrollY=a,o.maxScrollY=Math.max(a,null!==(e=o.maxScrollY)&&void 0!==e?e:0),o.maxScrollHeight=Math.max(s,null!==(t=o.maxScrollHeight)&&void 0!==t?t:0),o.lastContentY=u,o.maxContentY=Math.max(u,null!==(r=o.maxContentY)&&void 0!==r?r:0),o.maxContentHeight=Math.max(l,null!==(i=o.maxContentHeight)&&void 0!==i?i:0)})),this._instance=t}return c(e,[{key:"_createPageViewData",value:function(){var e;return{pathname:null!==(e=null==rt?void 0:rt.location.pathname)&&void 0!==e?e:""}}},{key:"doPageView",value:function(){var e,t;return this._hasSeenPageView?(t=this._pageViewData,this._pageViewData=this._createPageViewData()):(this._hasSeenPageView=!0,t=void 0,this._pageViewData||(this._pageViewData=this._createPageViewData())),setTimeout(this._updateScrollData,0),a({$prev_pageview_pathname:null===(e=t)||void 0===e?void 0:e.pathname},this._calculatePrevPageScrollProperties(t))}},{key:"doPageLeave",value:function(){var e=this._pageViewData;return a({$prev_pageview_pathname:null==e?void 0:e.pathname},this._calculatePrevPageScrollProperties(e))}},{key:"_calculatePrevPageScrollProperties",value:function(e){if(!e||null==e.maxScrollHeight||null==e.lastScrollY||null==e.maxScrollY||null==e.maxContentHeight||null==e.lastContentY||null==e.maxContentY)return{};var t=e.maxScrollHeight,n=e.lastScrollY,r=e.maxScrollY,i=e.maxContentHeight,o=e.lastContentY,a=e.maxContentY;return t=Math.ceil(t),n=Math.ceil(n),r=Math.ceil(r),i=Math.ceil(i),o=Math.ceil(o),a=Math.ceil(a),{$prev_pageview_last_scroll:n,$prev_pageview_last_scroll_percentage:t<=1?1:ia(n/t,0,1),$prev_pageview_max_scroll:r,$prev_pageview_max_scroll_percentage:t<=1?1:ia(r/t,0,1),$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:i<=1?1:ia(o/i,0,1),$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:i<=1?1:ia(a/i,0,1)}}},{key:"startMeasuringScrollPosition",value:function(){null==rt||rt.addEventListener("scroll",this._updateScrollData,!0),null==rt||rt.addEventListener("scrollend",this._updateScrollData,!0),null==rt||rt.addEventListener("resize",this._updateScrollData)}},{key:"stopMeasuringScrollPosition",value:function(){null==rt||rt.removeEventListener("scroll",this._updateScrollData),null==rt||rt.removeEventListener("scrollend",this._updateScrollData),null==rt||rt.removeEventListener("resize",this._updateScrollData)}},{key:"_scrollElement",value:function(){if(!this._instance.config.scroll_root_selector)return null==rt?void 0:rt.document.documentElement;var e,t=m(wt(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var n=e.value,r=null==rt?void 0:rt.document.querySelector(n);if(r)return r}}catch(e){t.e(e)}finally{t.f()}}},{key:"_scrollHeight",value:function(){var e=this._scrollElement();return e?Math.max(0,e.scrollHeight-e.clientHeight):0}},{key:"_scrollY",value:function(){if(this._instance.config.scroll_root_selector){var e=this._scrollElement();return e&&e.scrollTop||0}return rt&&(rt.scrollY||rt.pageYOffset||rt.document.documentElement.scrollTop)||0}},{key:"_contentHeight",value:function(){var e=this._scrollElement();return(null==e?void 0:e.scrollHeight)||0}},{key:"_contentY",value:function(){var e=this._scrollElement(),t=(null==e?void 0:e.clientHeight)||0;return this._scrollY()+t}}]),e}();function ia(e,t,n){return Math.max(t,Math.min(e,n))}var oa={icontains:function(e){return!!rt&&rt.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},regex:function(e){return!!rt&&wr(rt.location.href,e)},exact:function(e){return(null==rt?void 0:rt.location.href)===e}},aa=function(){function e(t){u(this,e),this.instance=t}return c(e,[{key:"getSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(Dn);if(r&&!n)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:function(n){var r;if(200!==n.statusCode||!n.json)return e([]);var i=n.json.surveys||[];return null===(r=t.instance.persistence)||void 0===r||r.register(d({},Dn,i)),e(i)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((function(n){var r=n.filter((function(e){return!(!e.start_date||e.end_date)})).filter((function(e){var t,n,r,i;if(!e.conditions)return!0;var o=null===(t=e.conditions)||void 0===t||!t.url||oa[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),a=null===(i=e.conditions)||void 0===i||!i.selector||(null==lt?void 0:lt.querySelector(e.conditions.selector));return o&&a})).filter((function(e){if(!e.linked_flag_key&&!e.targeting_flag_key)return!0;var n=!e.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),r=!e.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key);return n&&r}));return e(r)}),n)}}]),e}(),sa=function(){function e(){var t=this;u(this,e),d(this,"limits",{}),d(this,"checkForLimiting",(function(e){var n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach((function(e){Mt.info("[RateLimiter] ".concat(e||"events"," is quota limited.")),t.limits[e]=(new Date).getTime()+6e4}))}catch(e){return void Mt.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:n})}}))}return c(e,[{key:"isRateLimited",value:function(e){var t=this.limits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),ua=function(){return a({initialPathName:(null==ct?void 0:ct.pathname)||"",referringDomain:wi.referringDomain()},wi.campaignParams())},la=function(){function e(t,n,r){var i=this;u(this,e),d(this,"_onSessionIdCallback",(function(e){var t=i._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:i._sessionSourceParamGenerator()};i._persistence.register(d({},Hn,n))}})),this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||ua,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return c(e,[{key:"_getStoredProps",value:function(){return this._persistence.props[Hn]}},{key:"getSessionProps",value:function(){var e,t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}]),e}(),ca=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"],da=function(e,t){if(!e)return!1;var n=e.toLowerCase();return ca.concat(t||[]).some((function(e){var t=e.toLowerCase();return n.includes?n.includes(t):-1!==n.indexOf(t)}))},fa={},pa=function(){},ha="posthog",va=!Bo&&-1===(null==ht?void 0:ht.indexOf("MSIE"))&&-1===(null==ht?void 0:ht.indexOf("Mozilla")),ga=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(t=null==lt?void 0:lt.location,n=null==t?void 0:t.hostname,!!xt(n)&&"herokuapp.com"!==n.split(".").slice(-2).join(".")),persistence:"localStorage+cookie",persistence_name:"",cookie_name:"",loaded:pa,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:!0,debug:!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==rt||null===(e=rt.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:function(e){var t="Bad HTTP status: "+e.statusCode+" "+e.text;Mt.error(t)},get_device_id:function(e){return e},_onCapture:pa,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800}},ma=function(){function e(){u(this,e),d(this,"__forceAllowLocalhost",!1)}return c(e,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){Mt.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),e}(),_a=function(){function e(){var t=this;u(this,e),d(this,"webPerformance",new ma),this.config=ga(),this.decideEndpointWasHit=!1,this.SentryIntegration=na,this.segmentIntegration=function(){return function(e){Promise&&Promise.resolve||Mt.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(t,n){t.event.userId||t.event.anonymousId===e.get_distinct_id()||e.reset(),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:t.event.userId}),e.reloadFeatureFlags());var r=e._calculate_event_properties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}}(t)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this.analyticsDefaultEndpoint="/e/",this.elementsChainAsString=!1,this.featureFlags=new Qn(this),this.toolbar=new ro(this),this.pageViewManager=new ra(this),this.surveys=new aa(this),this.rateLimiter=new sa,this.requestRouter=new ta(this),this.people={set:function(e,n,r){var i=xt(e)?d({},e,n):e;t.setPersonProperties(i),null==r||r({})},set_once:function(e,n,r){var i=xt(e)?d({},e,n):e;t.setPersonProperties(void 0,i),null==r||r({})}}}return c(e,[{key:"init",value:function(t,n,r){if(r&&r!==ha){var i,o=null!==(i=fa[r])&&void 0!==i?i:new e;return o._init(t,n,r),fa[r]=o,fa[ha][r]=o,o}return this._init(t,n,r)}},{key:"_init",value:function(e){var t,n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;if(Ct(e)||function(e){return xt(e)&&0===e.trim().length}(e))Mt.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()");else{if(!this.__loaded){var u;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],o.request_headers=o.request_headers||o.xhr_headers,this.set_config(At({},ga(),o,{name:s,token:e})),null!=rt&&null!==(t=rt.rrweb)&&void 0!==t&&t.record||null!=rt&&rt.rrwebRecord)this.__loaded_recorder_version=null==rt||null===(u=rt.rrweb)||void 0===u?void 0:u.version;if(this.compression=o.disable_compression?void 0:Un.Base64,this.persistence=new Si(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new Si(a(a({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new io((function(e){return i._send_request(e)})),this._retryQueue=new Ko(this),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new ea(this.config,this.persistence),this.sessionPropsManager=new la(this.sessionManager,this.persistence),this.sessionRecording=new Zi(this),this.sessionRecording.startRecordingIfEnabled(),this.config.disable_scroll_properties||this.pageViewManager.startMeasuringScrollPosition(),this.__autocapture=this.config.autocapture,Vn._setIsAutocaptureEnabled(this),Vn._isAutocaptureEnabled){this.__autocapture=this.config.autocapture;Vn.enabledForProject(this.config.token,100,100)?Vn.isBrowserSupported()?Vn.init(this):(this.__autocapture=!1,Mt.info("Disabling Automatic Event Collection because this browser is not supported")):(this.__autocapture=!1,Mt.info("Not in active bucket: disabling Automatic Event Collection."))}if(gt.DEBUG=gt.DEBUG||this.config.debug,this._gdpr_init(),o.segment&&(this.config.get_device_id=function(){return o.segment.user().anonymousId()},o.segment.user().id()&&(this.register({distinct_id:o.segment.user().id()}),this.persistence.set_user_state("identified"))),void 0!==(null===(n=o.bootstrap)||void 0===n?void 0:n.distinctID)){var l,c,d=this.config.get_device_id(rr()),f=null!==(l=o.bootstrap)&&void 0!==l&&l.isIdentifiedID?d:o.bootstrap.distinctID;this.persistence.set_user_state(null!==(c=o.bootstrap)&&void 0!==c&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:f})}if(this._hasBootstrappedFeatureFlags()){var p,h,v=Object.keys((null===(p=o.bootstrap)||void 0===p?void 0:p.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=o.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,r;return e[t]=(null===(n=o.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),g=Object.keys((null===(h=o.bootstrap)||void 0===h?void 0:h.featureFlagPayloads)||{}).filter((function(e){return v[e]})).reduce((function(e,t){var n,r,i,a;null!==(n=o.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=o.bootstrap)||void 0===i||null===(a=i.featureFlagPayloads)||void 0===a?void 0:a[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:g})}if(!this.get_distinct_id()){var m=this.config.get_device_id(rr());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_user_state("anonymous")}return null==rt||null===(r=rt.addEventListener)||void 0===r||r.call(rt,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),o.segment?o.segment.register(this.segmentIntegration()).then((function(){i._loaded()})):this._loaded(),this}Mt.warn("You have already initialized PostHog! Re-initialising is a no-op")}}},{key:"_afterDecideResponse",value:function(e){var t;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=$t(e.supportedCompression,Un.GZipJS)?Un.GZipJS:$t(e.supportedCompression,Un.Base64)?Un.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),e.elementsChainAsString&&(this.elementsChainAsString=e.elementsChainAsString)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){Mt.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((function(){lt&&e.capture("$pageview",{title:lt.title},{send_instantly:!0})}),1),t||(new eo(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||Lt(this.__request_queue,(function(t){return e._send_retriable_request(t)})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var t=this;this.__loaded&&(va?this.__request_queue.push(e):this.rateLimiter.isRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Wo(e.url,{ip:this.config.ip?1:0}),e.headers=this.config.request_headers,e.compression="best-available"===e.compression?this.compression:e.compression,function(e){var t=a({},e);t.timeout=t.timeout||6e4,t.url=Wo(t.url,{_:(new Date).getTime().toString(),ver:gt.LIB_VERSION,compression:t.compression}),"sendBeacon"===t.transport&&null!=ut&&ut.sendBeacon?Yo(t):"fetch"===t.transport&&dt?Go(t):ft||!lt?zo(t):Jo(t)}(a(a({},e),{},{callback:function(n){var r,i,o;(t.rateLimiter.checkForLimiting(n),n.statusCode>=400)&&(null===(i=(o=t.config).on_request_error)||void 0===i||i.call(o,n));null===(r=e.callback)||void 0===r||r.call(e,n)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];Lt(e,(function(e){e&&(t=e[0],wt(t)?o.push(e):kt(e)?e.call(n):wt(e)&&"alias"===t?r.push(e):wt(e)&&-1!==t.indexOf("capture")&&kt(n[t])?o.push(e):i.push(e))}));var a=function(e,t){Lt(e,(function(e){if(wt(e[0])){var n=t;Dt(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};a(r,this),a(i,this),a(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t,n){var r;if(!this.__loaded||!this.sessionPersistence||!this._requestQueue)return Mt.uninitializedWarning("posthog.capture");if(!zi(this))if(!Ct(e)&&xt(e)){if(!ht||this.config.opt_out_useragent_filter||!da(ht,this.config.custom_blocked_useragents)){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info();var i={uuid:rr(),event:e,properties:this._calculate_event_properties(e,t||{})};"$identify"===e&&(i.$set=null==n?void 0:n.$set,i.$set_once=null==n?void 0:n.$set_once),(i=Ut(i,null!=n&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=(null==n?void 0:n.timestamp)||new Date,Ct(null==n?void 0:n.timestamp)||(i.properties.$event_time_override_provided=!0,i.properties.$event_time_override_system_time=new Date);var o=a(a({},i.properties.$set),i.$set);(function(e){if(St(e)){for(var t in e)if(yt.call(e,t))return!1;return!0}return!1})(o)||this.setPersonPropertiesForFlags(o),Mt.info("send",i);var s={method:"POST",url:null!==(r=null==n?void 0:n._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:i,compression:"best-available",batchKey:null==n?void 0:n._batchKey};return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly?this._send_retriable_request(s):this._requestQueue.enqueue(s),this._invokeCaptureHooks(e,i),i}}else Mt.error("No event name provided to posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,t){this.config._onCapture(e,t),Dt(this.__captureHooks,(function(t){return t(e)}))}},{key:"_calculate_event_properties",value:function(e,t){if(!this.persistence||!this.sessionPersistence)return t;var n=this.persistence.remove_event_timer(e),r=a({},t);if(r.token=this.config.token,"$snapshot"===e){var i=a(a({},this.persistence.properties()),this.sessionPersistence.properties());return r.distinct_id=i.distinct_id,r}var o=wi.properties();if(this.sessionManager){var s=this.sessionManager.checkAndGetSessionAndWindowId(),u=s.sessionId,l=s.windowId;r.$session_id=u,r.$window_id=l}if(this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){var c=this.sessionPropsManager.getSessionProps();r=At(r,c)}if(!this.config.disable_scroll_properties){var d={};"$pageview"===e?d=this.pageViewManager.doPageView():"$pageleave"===e&&(d=this.pageViewManager.doPageLeave()),r=At(r,d)}if("$pageview"===e&&lt&&(r.title=lt.title),"$performance_event"===e){var f=this.persistence.properties();return r.distinct_id=f.distinct_id,r.$current_url=o.$current_url,r}if(!Ct(n)){var p=(new Date).getTime()-n;r.$duration=parseFloat((p/1e3).toFixed(3))}(ht&&this.config.opt_out_useragent_filter&&(r.$browser_type=da(ht,this.config.custom_blocked_useragents)?"bot":"browser"),r=At({},wi.properties(),this.persistence.properties(),this.sessionPersistence.properties(),r),wt(this.config.property_denylist)&&wt(this.config.property_blacklist))?Dt([].concat(h(this.config.property_blacklist),h(this.config.property_denylist)),(function(e){delete r[e]})):Mt.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var v=this.config.sanitize_properties;return v&&(r=v(r,e)),r}},{key:"register",value:function(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}},{key:"register_once",value:function(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}},{key:"register_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}},{key:"unregister",value:function(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(d({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"identify",value:function(e,t,n){if(!this.__loaded||!this.persistence)return Mt.uninitializedWarning("posthog.identify");if(Et(e)&&(e=e.toString(),Mt.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))Mt.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else{var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(kn)&&(this.unregister(kn),this.register({distinct_id:e}));var o="anonymous"===this.persistence.get_user_state();e!==r&&o?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(An))}else Mt.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,t,n){if(e&&t){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:a(a({},r),{},d({},e,t))}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags(d({},e,n))),r[e]===t||n||this.reloadFeatureFlags()}else Mt.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,n,r,i;if(!this.__loaded)return Mt.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(r=this.persistence)||void 0===r||r.set_user_state("anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId();var a=this.config.get_device_id(rr());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionId,r=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/replay/"+n);if(null!=e&&e.withTimestamp&&r){var o,a=null!==(o=e.timestampLookBack)&&void 0!==o?o:10;if(!r)return i;var s=Math.max(Math.floor(((new Date).getTime()-r)/1e3)-a,0);i+="?t=".concat(s)}return i}},{key:"alias",value:function(e,t){return e===this.get_property(wn)?(Mt.critical("Attempting to create alias for existing People user - aborting."),-2):(Ct(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(kn,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Mt.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var t,n=a({},this.config);if(St(e)&&(At(this.config,e),this.config.persistence_name||(this.config.persistence_name=this.config.cookie_name),this.config.disable_persistence||(this.config.disable_persistence=this.config.disable_cookie),null===(t=this.persistence)||void 0===t||t.update_config(this.config,n),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new Si(a(a({},this.config),{},{persistence:"sessionStorage"})),fr.is_supported()&&"true"===fr.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(gt.DEBUG=!0),this.sessionRecording&&!Ct(e.disable_session_recording))){var r=n.disable_session_recording!==e.disable_session_recording,i=!zi(this)&&!e.disable_session_recording&&!this.sessionRecording.started;(r||i)&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled())}}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:ha;return t!==ha&&(t=ha+"."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.config.opt_out_capturing_persistence_type&&fr.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.config.opt_out_capturing_by_default&&!cr.get("ph_optout")||(cr.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.config.opt_out_persistence_by_default}))}},{key:"_gdpr_update_persistence",value:function(e){var t,n,r,i,o;if(e&&e.clear_persistence)r=!0;else{if(!e||!e.enable_persistence)return;r=!1}this.config.disable_persistence||(null===(t=this.persistence)||void 0===t?void 0:t.disabled)===r||(null===(i=this.persistence)||void 0===i||i.set_disabled(r));this.config.disable_persistence||(null===(n=this.sessionPersistence)||void 0===n?void 0:n.disabled)===r||(null===(o=this.sessionPersistence)||void 0===o||o.set_disabled(r))}},{key:"_gdpr_call_func",value:function(e,t){return t=At({capture:this.capture.bind(this),persistence_type:this.config.opt_out_capturing_persistence_type,cookie_prefix:this.config.opt_out_capturing_cookie_prefix,cookie_expiration:this.config.cookie_expiration,cross_subdomain_cookie:this.config.cross_subdomain_cookie,secure_cookie:this.config.secure_cookie},t||{}),fr.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.config.token,{capture:t.capture,captureEventName:t.capture_event_name,captureProperties:t.capture_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieExpiration:t.cookie_expiration,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=At({enable_persistence:!0},e||{}),this._gdpr_call_func(Ai,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=At({clear_persistence:!0},e||{});this._gdpr_call_func($i,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(qi,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(Hi,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=At({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Bi,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(null==rt||rt.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==rt||rt.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=jt(e.prototype[t[n]])}(_a,["identify"]);var ya,ba;ya=fa[ha]=new _a,(ba=vt.posthog)&&Dt(ba._i,(function(e){if(e&&wt(e)){var t=ya.init(e[0],e[1],e[2]),n=ba[e[2]]||ba;t&&(t._execute_array.call(t.people,n.people),t._execute_array(n))}})),vt.posthog=ya,function(){function e(){e.done||(e.done=!0,va=!1,Dt(fa,(function(e){e._dom_loaded()})))}null!=lt&&lt.addEventListener&&("complete"===lt.readyState?e():lt.addEventListener("DOMContentLoaded",e,!1)),rt&&zt(rt,"load",e,!0)}()}();
15
+ ***************************************************************************** */
16
+ function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["type"]);return t})),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),yt=function(){function e(t){a(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new fe,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return u(e,[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){if(0!==e.length){var n,r={id:t,styleIds:[]},i=[],o=g(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=void 0;if(this.styleMirror.has(a))s=this.styleMirror.getId(a);else{s=this.styleMirror.add(a);var u=Array.from(a.rules||CSSRule);i.push({styleId:s,rules:u.map((function(e,t){return{rule:b(e),index:t}}))})}r.styleIds.push(s)}}catch(e){o.e(e)}finally{o.f()}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}(),_t=function(){function e(){a(this,e),this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}return u(e,[{key:"periodicallyClear",value:function(){var e=this;requestAnimationFrame((function(){e.clear(),e.loop&&e.periodicallyClear()}))}},{key:"inOtherBuffer",value:function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some((function(e){return e!==t}))}},{key:"add",value:function(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"clear",value:function(){this.nodeMap=new WeakMap}},{key:"destroy",value:function(){this.loop=!1}}]),e}();function bt(e){return Object.assign(Object.assign({},e),{timestamp:te()})}var It=!1,wt=new I;function kt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,o=void 0===i?"rr-block":i,a=e.blockSelector,s=void 0===a?null:a,u=e.ignoreClass,c=void 0===u?"rr-ignore":u,l=e.ignoreSelector,d=void 0===l?null:l,f=e.maskTextClass,p=void 0===f?"rr-mask":f,h=e.maskTextSelector,v=void 0===h?null:h,m=e.inlineStylesheet,y=void 0===m||m,_=e.maskAllInputs,b=e.maskInputOptions,w=e.slimDOMOptions,k=e.maskInputFn,C=e.maskTextFn,S=e.hooks,A=e.packFn,R=e.sampling,F=void 0===R?{}:R,E=e.dataURLOptions,T=void 0===E?{}:E,x=e.mousemoveWait,M=e.recordCanvas,O=void 0!==M&&M,N=e.recordCrossOriginIframes,L=void 0!==N&&N,D=e.recordAfter,P=void 0===D?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":D,B=e.userTriggeredOnInput,q=void 0!==B&&B,W=e.collectFonts,V=void 0!==W&&W,H=e.inlineImages,G=void 0!==H&&H,U=e.plugins,j=e.keepIframeSrcFn,$=void 0===j?function(){return!1}:j,Z=e.ignoreCSSAttributes,Y=void 0===Z?new Set([]):Z;xe(e.errorHandler);var J=!L||window.parent===window,Q=!1;if(!J)try{window.parent.document&&(Q=!1)}catch(e){Q=!0}if(J&&!t)throw new Error("emit function is required");void 0!==x&&void 0===F.mousemove&&(F.mousemove=x),wt.reset();var X,ee=!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}:void 0!==b?b:{password:!0},te=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};!function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===i)return!0}while(i=i&&i.parentNode);return!1})}();var oe=0,ae=function(e){var t,n=g(U||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return A&&!Q&&(e=A(e)),e};pt=function(e,i){var o;if(!(null===(o=Ne[0])||void 0===o?void 0:o.isFrozen())||e.type===ve.FullSnapshot||e.type===ve.IncrementalSnapshot&&e.data.source===me.Mutation||Ne.forEach((function(e){return e.unfreeze()})),J)null==t||t(ae(e),i);else if(Q){var a={type:"rrweb",event:ae(e),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(e.type===ve.FullSnapshot)X=e,oe=0;else if(e.type===ve.IncrementalSnapshot){if(e.data.source===me.Mutation&&e.data.isAttachIframe)return;oe++;var s=r&&oe>=r,u=n&&e.timestamp-X.timestamp>n;(s||u)&&ht(!0)}};var se,ue=function(e){pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.Mutation},e)}))},fe=function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.Scroll},e)}))},pe=function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.CanvasMutation},e)}))},he=new yt({mutationCb:ue,adoptedStyleSheetCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.AdoptedStyleSheet},e)}))}}),ge=new ze({mirror:wt,mutationCb:ue,stylesheetManager:he,recordCrossOriginIframes:L,wrappedEmit:pt}),ye=g(U||[]);try{for(ye.s();!(se=ye.n()).done;){var _e=se.value;_e.getMirror&&_e.getMirror({nodeMirror:wt,crossOriginIframeMirror:ge.crossOriginIframeMirror,crossOriginIframeStyleMirror:ge.crossOriginIframeStyleMirror})}}catch(e){ye.e(e)}finally{ye.f()}var be=new _t;gt=new mt({recordCanvas:O,mutationCb:pe,win:window,blockClass:o,blockSelector:s,mirror:wt,sampling:F.canvas,dataURLOptions:T});var Ie=new Ye({mutationCb:ue,scrollCb:fe,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:p,maskTextSelector:v,inlineStylesheet:y,maskInputOptions:ee,dataURLOptions:T,maskTextFn:C,maskInputFn:k,recordCanvas:O,inlineImages:G,sampling:F,slimDOMOptions:te,iframeManager:ge,stylesheetManager:he,canvasManager:gt,keepIframeSrcFn:$,processedNodeManager:be},mirror:wt});ht=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];pt(bt({type:ve.Meta,data:{href:window.location.href,width:ie(),height:re()}}),e),he.reset(),Ie.init(),Ne.forEach((function(e){return e.lock()}));var t=function(e,t){var n=t||{},r=n.mirror,i=void 0===r?new I:r,o=n.blockClass,a=void 0===o?"rr-block":o,s=n.blockSelector,u=void 0===s?null:s,c=n.maskTextClass,l=void 0===c?"rr-mask":c,d=n.maskTextSelector,f=void 0===d?null:d,p=n.inlineStylesheet,h=void 0===p||p,g=n.inlineImages,v=void 0!==g&&g,m=n.recordCanvas,y=void 0!==m&&m,_=n.maskAllInputs,b=void 0!==_&&_,w=n.maskTextFn,k=n.maskInputFn,C=n.slimDOM,S=void 0!==C&&C,A=n.dataURLOptions,R=n.preserveWhiteSpace,F=n.onSerialize,E=n.onIframeLoad,T=n.iframeLoadTimeout,x=n.onStylesheetLoad,M=n.stylesheetLoadTimeout,O=n.keepIframeSrcFn;return K(e,{doc:e,mirror:i,blockClass:a,blockSelector:u,maskTextClass:l,maskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===b?{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===b?{password:!0}:b,maskTextFn:w,maskInputFn:k,slimDOMOptions:!0===S||"all"===S?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===S,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===S?{}:S,dataURLOptions:A,inlineImages:v,recordCanvas:y,preserveWhiteSpace:R,onSerialize:F,onIframeLoad:E,iframeLoadTimeout:T,onStylesheetLoad:x,stylesheetLoadTimeout:M,keepIframeSrcFn:void 0===O?function(){return!1}:O,newlyAddedElement:!1})}(document,{mirror:wt,blockClass:o,blockSelector:s,maskTextClass:p,maskTextSelector:v,inlineStylesheet:y,maskAllInputs:ee,maskTextFn:C,slimDOM:te,dataURLOptions:T,recordCanvas:O,inlineImages:G,onSerialize:function(e){ce(e,wt)&&ge.addIframe(e),le(e,wt)&&he.trackLinkElement(e),de(e)&&Ie.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){ge.attachIframe(e,t),Ie.observeAttachShadow(e)},onStylesheetLoad:function(e,t){he.attachLinkElement(e,t)},keepIframeSrcFn:$});if(!t)return console.warn("Failed to snapshot the document");pt(bt({type:ve.FullSnapshot,data:{node:t,initialOffset:ne(window)}}),e),Ne.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&he.adoptStyleSheets(document.adoptedStyleSheets,wt.getId(document))};try{var we=[],ke=function(e){var t;return Oe(je)({mutationCb:ue,mousemoveCb:function(e,t){return pt(bt({type:ve.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.MouseInteraction},e)}))},scrollCb:fe,viewportResizeCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.ViewportResize},e)}))},inputCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.Input},e)}))},mediaInteractionCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.StyleDeclaration},e)}))},canvasMutationCb:pe,fontCb:function(e){return pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.Font},e)}))},selectionCb:function(e){pt(bt({type:ve.IncrementalSnapshot,data:Object.assign({source:me.Selection},e)}))},blockClass:o,ignoreClass:c,ignoreSelector:d,maskTextClass:p,maskTextSelector:v,maskInputOptions:ee,inlineStylesheet:y,sampling:F,recordCanvas:O,inlineImages:G,userTriggeredOnInput:q,collectFonts:V,doc:e,maskInputFn:k,maskTextFn:C,keepIframeSrcFn:$,blockSelector:s,slimDOMOptions:te,dataURLOptions:T,mirror:wt,iframeManager:ge,stylesheetManager:he,shadowDomManager:Ie,processedNodeManager:be,canvasManager:gt,ignoreCSSAttributes:Y,plugins:(null===(t=null==U?void 0:U.filter((function(e){return e.observer})))||void 0===t?void 0:t.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return pt(bt({type:ve.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},S)};ge.addLoadListener((function(e){try{we.push(ke(e.contentDocument))}catch(e){console.warn(e)}}));var Ce=function(){ht(),we.push(ke(document)),It=!0};return"interactive"===document.readyState||"complete"===document.readyState?Ce():(we.push(z("DOMContentLoaded",(function(){pt(bt({type:ve.DomContentLoaded,data:{}})),"DOMContentLoaded"===P&&Ce()}))),we.push(z("load",(function(){pt(bt({type:ve.Load,data:{}})),"load"===P&&Ce()}),window))),function(){we.forEach((function(e){return e()})),be.destroy(),It=!1,Me()}}catch(e){console.warn(e)}}kt.addCustomEvent=function(e,t){if(!It)throw new Error("please add custom event after start recording");pt(bt({type:ve.Custom,data:{tag:e,payload:t}}))},kt.freezePage=function(){Ne.forEach((function(e){return e.freeze()}))},kt.takeFullSnapshot=function(e){if(!It)throw new Error("please take full snapshot after start recording");ht(e)},kt.mirror=wt;var Ct=function(){function e(t){a(this,e),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return u(e,[{key:"toString",value:function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}]),e}(),St=/(^|@)\S+:\d+/,At=/^\s*at .*(\S+:\d+|\(native\))/m,Rt=/^(eval@)?(\[native code])?$/,Ft={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(At)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(At)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Ct({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Rt)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Ct({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Ct({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new Ct({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new Ct({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(St)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ct({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Et(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,i=[];if(r.children&&r.children.length>0)for(var o=0;o<r.children.length;o++){var a=r.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=":eq(".concat(i.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Tt(e){return"[object Object]"===Object.prototype.toString.call(e)}function xt(e,t){if(0===t)return!0;for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(Tt(e[i])&&xt(e[i],t-1))return!0}return!1}function Mt(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],i=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Tt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Tt(e)&&xt(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=Et(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Ot={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 Nt(e,t,n){var r,i=n?Object.assign({},Ot,n):Ot,o=i.logger;if(!o)return function(){};r="string"==typeof o?t[o]:o;var a=0,s=!1,u=[];if(i.level.includes("error")){var c=function(t){var n=t.message,r=t.error,o=Ft.parse(r).map((function(e){return e.toString()})),a=[Mt(n,i.stringifyOptions)];e({level:"error",trace:o,payload:a})};t.addEventListener("error",c),u.push((function(){t.removeEventListener("error",c)}));var l=function(t){var n,r;t.reason instanceof Error?(n=t.reason,r=[Mt("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),i.stringifyOptions)]):(n=new Error,r=[Mt("Uncaught (in promise)",i.stringifyOptions),Mt(t.reason,i.stringifyOptions)]);var o=Ft.parse(n).map((function(e){return e.toString()}));e({level:"error",trace:o,payload:r})};t.addEventListener("unhandledrejection",l),u.push((function(){t.removeEventListener("unhandledrejection",l)}))}var d,f=g(i.level);try{for(f.s();!(d=f.n()).done;){var p=d.value;u.push(h(r,p))}}catch(e){f.e(e)}finally{f.f()}return function(){u.forEach((function(e){return e()}))};function h(t,n){var r=this;return t[n]?ee(t,n,(function(t){return function(){for(var o=arguments.length,u=new Array(o),c=0;c<o;c++)u[c]=arguments[c];if(t.apply(r,u),!s){s=!0;try{var l=Ft.parse(new Error).map((function(e){return e.toString()})).splice(1),d=u.map((function(e){return Mt(e,i.stringifyOptions)}));++a<i.lengthThreshold?e({level:n,trace:l,payload:d}):a===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Mt("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(u))}finally{s=!1}}}})):function(){}}}var Lt=Array.isArray,Dt=Object.prototype,Pt=Dt.hasOwnProperty,Bt=Dt.toString,qt=Lt||function(e){return"[object Array]"===Bt.call(e)},Wt=function(e){return"function"==typeof e},Vt=function(e){return e===Object(e)&&!qt(e)},Ht=function(e){return void 0===e},Gt=function(e){return"[object String]"==Bt.call(e)},Ut=function(e){return null===e},jt=function(e){return Ht(e)||Ut(e)},$t=function(e){return"[object Number]"==Bt.call(e)},Zt=function(e){return"[object Boolean]"===Bt.call(e)},Kt=function(e){return e instanceof Document},zt=function(e){return e instanceof FormData},Yt={DEBUG:!1,LIB_VERSION:"1.115.2"},Jt="undefined"!=typeof window?window:void 0,Qt="undefined"!=typeof globalThis?globalThis:Jt,Xt=Array.prototype,en=Xt.forEach,tn=Xt.indexOf,nn=null==Qt?void 0:Qt.navigator,rn=null==Qt?void 0:Qt.document,on=null==Qt?void 0:Qt.location,an=null==Qt?void 0:Qt.fetch,sn=null!=Qt&&Qt.XMLHttpRequest&&"withCredentials"in new Qt.XMLHttpRequest?Qt.XMLHttpRequest:void 0,un=null==Qt?void 0:Qt.AbortController,cn=null==nn?void 0:nn.userAgent,ln=null!=Jt?Jt:{},dn="[PostHog.js]",fn={_log:function(e){if(Jt&&(Yt.DEBUG||ln.POSTHOG_DEBUG)&&!Ht(Jt.console)&&Jt.console){for(var t=("__rrweb_original__"in Jt.console[e]?Jt.console[e].__rrweb_original__:Jt.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.apply(void 0,[dn].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];fn._log.apply(fn,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];fn._log.apply(fn,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];fn._log.apply(fn,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[dn].concat(n))},uninitializedWarning:function(e){fn.error("You must initialize PostHog before calling ".concat(e))}},pn={},hn=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function gn(e,t,n){if(qt(e))if(en&&e.forEach===en)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===pn)return}function vn(e,t,n){if(!jt(e)){if(qt(e))return gn(e,t,n);if(zt(e)){var r,i=g(e.entries());try{for(i.s();!(r=i.n()).done;){var o=r.value;if(t.call(n,o[1],o[0])===pn)return}}catch(e){i.e(e)}finally{i.f()}}else for(var a in e)if(Pt.call(e,a)&&t.call(n,e[a],a)===pn)return}}var mn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return gn(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function yn(e,t){return-1!==e.indexOf(t)}function _n(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var bn=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},In=function(e){try{return e()}catch(e){return}},wn=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){fn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),fn.critical(e)}}},kn=function(e){var t={};return vn(e,(function(e,n){Gt(e)&&e.length>0&&(t[n]=e)})),t};function Cn(e,t){return n=e,r=function(e){return Gt(e)&&!Ut(t)?e.slice(0,t):e},i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),qt(t)?(o=[],gn(t,(function(t){o.push(e(t))}))):(o={},vn(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}var Sn=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var a=e.charCodeAt(i),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),Ut(s)||(n>t&&(o+=e.substring(t,n)),o+=s,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},An=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var a="on"+n,s=t[a];t[a]=function(t,n,r){return function(i){if(i=i||e(null==Jt?void 0:Jt.event)){var o,a=!0;Wt(r)&&(o=r(i));var s=n.call(t,i);return!1!==o&&!1!==s||(a=!1),a}}}(t,r,s)}else fn.error("No valid element provided to register_event")}}();function Rn(e,t){var n=function(){if(!rn)return t("document not found");var n=rn.createElement("script");n.type="text/javascript",n.src=e,n.onload=function(e){return t(void 0,e)},n.onerror=function(e){return t(e)};var r,i=rn.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):rn.body.appendChild(n)};null!=rn&&rn.body?n():null==rn||rn.addEventListener("DOMContentLoaded",n)}var Fn=["localhost","127.0.0.1"],En=function(e){var t=null==rn?void 0:rn.createElement("a");return Ht(t)?null:(t.href=e,t)},Tn=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},xn=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return vn(e,(function(e,r){Ht(e)||Ht(r)||"undefined"===r||(t=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t)})),i.join(r)},Mn=function(e,t){for(var n,r=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!qt(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch(e){fn.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},On=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null};function Nn(e){return e?hn(e).split(/\s+/):[]}function Ln(e){var t="";switch(r(e.className)){case"string":t=e.className;break;case"object":t=("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Nn(t)}function Dn(e){return jt(e)?null:hn(e).split(/(\s+)/).filter((function(e){return Xn(e)})).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Pn(e){var t="";return jn(e)&&!$n(e)&&e.childNodes&&e.childNodes.length&&vn(e.childNodes,(function(e){var n;Wn(e)&&e.textContent&&(t+=null!==(n=Dn(e.textContent))&&void 0!==n?n:"")})),hn(t)}function Bn(e){return!!e&&1===e.nodeType}function qn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Wn(e){return!!e&&3===e.nodeType}function Vn(e){return!!e&&11===e.nodeType}var Hn=["a","button","form","input","select","textarea","label"];function Gn(e){var t=e.parentNode;return!(!t||!Bn(t))&&t}function Un(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!Jt||!e||qn(e,"html")||!Bn(e))return!1;if(null!=n&&n.url_allowlist){var a=Jt.location.href,s=n.url_allowlist;if(s&&!s.some((function(e){return a.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some((function(e){return t.type===e})))return!1}for(var c=!1,l=[e],d=!0,f=e;f.parentNode&&!qn(f,"body");)if(Vn(f.parentNode))l.push(f.parentNode.host),f=f.parentNode.host;else{if(!(d=Gn(f)))break;if(i||Hn.indexOf(d.tagName.toLowerCase())>-1)c=!0;else{var p=Jt.getComputedStyle(d);p&&"pointer"===p.getPropertyValue("cursor")&&(c=!0)}l.push(d),f=d}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Ht(n))return!0;var i,o=g(e);try{var a=function(){var e=i.value;if(n.some((function(t){return e.tagName.toLowerCase()===t})))return{v:!0}};for(o.s();!(i=o.n()).done;){var s=a();if("object"===r(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(l,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(Ht(n))return!0;var i,o=g(e);try{var a=function(){var e=i.value;if(n.some((function(t){return e.matches(t)})))return{v:!0}};for(o.s();!(i=o.n()).done;){var s=a();if("object"===r(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(l,n))return!1;var h=Jt.getComputedStyle(e);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===t.type)return!0;var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(o||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(o||["change","click"]).indexOf(t.type)>=0;default:return c?(o||["click"]).indexOf(t.type)>=0:(o||["click"]).indexOf(t.type)>=0&&(Hn.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}function jn(e){for(var t=e;t.parentNode&&!qn(t,"body");t=t.parentNode){var n=Ln(t);if(yn(n,"ph-sensitive")||yn(n,"ph-no-capture"))return!1}if(yn(Ln(e),"ph-include"))return!0;var r=e.type||"";if(Gt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(Gt(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function $n(e){return!!(qn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||qn(e,"select")||qn(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Zn="(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})",Kn=new RegExp("^(?:".concat(Zn,")$")),zn=new RegExp(Zn),Yn="\\d{3}-?\\d{2}-?\\d{4}",Jn=new RegExp("^(".concat(Yn,")$")),Qn=new RegExp("(".concat(Yn,")"));function Xn(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(jt(e))return!1;if(Gt(e)){if(e=hn(e),(t?Kn:zn).test((e||"").replace(/[- ]/g,"")))return!1;if((t?Jn:Qn).test(e))return!1}return!0}function er(e){var t=Pn(e);return Xn(t="".concat(t," ").concat(tr(e)).trim())?t:""}function tr(e){var t="";return e&&e.childNodes&&e.childNodes.length&&vn(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=Pn(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(tr(e)).trim())}catch(e){fn.error(e)}})),t}function nr(e){return function(e){var n=e.map((function(e){var n,r,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();var o,a=g(e.attr_class);try{for(a.s();!(o=a.n()).done;){var s=o.value;i+=".".concat(s.replace(/"/g,""))}}catch(e){a.e(e)}finally{a.f()}}var u=t(t(t(t({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(n=e.nth_child)&&void 0!==n?n:0,"nth-of-type":null!==(r=e.nth_of_type)&&void 0!==r?r:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),c={};return _n(u).sort((function(e,t){var n=d(e,1)[0],r=d(t,1)[0];return n.localeCompare(r)})).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];return c[rr(n.toString())]=rr(r.toString())})),i+=":",i+=_n(u).map((function(e){var t=d(e,2),n=t[0],r=t[1];return"".concat(n,'="').concat(r,'"')})).join("")}));return n.join(";")}(function(e){return e.map((function(e){var t,n,r={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:ir(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return _n(e).filter((function(e){return 0===d(e,1)[0].indexOf("attr__")})).forEach((function(e){var t=d(e,2),n=t[0],i=t[1];return r.attributes[n]=i})),r}))}(e))}function rr(e){return e.replace(/"|\\"/g,'\\"')}function ir(e){var t=e.attr__class;return t?qt(t)?t:Nn(t):void 0}var or="[SessionRecording]",ar={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},sr=["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"],ur=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],cr=["/s/","/e/","/i/"];function lr(e,t,n,r){if(jt(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return Gt(i)&&(i=parseInt(i)),i>n?or+" ".concat(r," body too large to record (").concat(i," bytes)"):e}function dr(e,t){if(jt(e))return e;var n=e;return Xn(n,!1)||(n=or+" "+t+" body redacted"),vn(ur,(function(e){var r,i;null!==(r=n)&&void 0!==r&&r.length&&-1!==(null===(i=n)||void 0===i?void 0:i.indexOf(e))&&(n=or+" "+t+" body redacted as might contain: "+e)})),n}var fr=function(e,n){var r,i,o,a=e.session_recording,s=!1!==a.recordHeaders&&n.recordHeaders,u=!1!==a.recordBody&&n.recordBody,c=!1!==a.recordPerformance&&n.recordPerformance,l=(r=a,o=Math.min(1e6,null!==(i=r.payloadSizeLimitBytes)&&void 0!==i?i:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=lr(e.requestBody,e.requestHeaders,o,"Request")),null!=e&&e.responseBody&&(e.responseBody=lr(e.responseBody,e.responseHeaders,o,"Response")),e}),d=function(e){return function(e){if(!Ht(e))return e.requestBody=dr(e.requestBody,"Request"),e.responseBody=dr(e.responseBody,"Response"),e}(l(function(e){var t=En(e.name);if(!(t&&t.pathname&&cr.some((function(e){return 0===t.pathname.indexOf(e)}))))return e}((t=e,vn(Object.keys(null!==(n=t.requestHeaders)&&void 0!==n?n:{}),(function(e){var n;sr.includes(e.toLowerCase())&&(null===(n=t.requestHeaders)||void 0===n||delete n[e])})),t))));var t,n},f=Wt(e.session_recording.maskNetworkRequestFn);return f&&Wt(e.session_recording.maskCapturedNetworkRequestFn)&&fn.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),f&&(e.session_recording.maskCapturedNetworkRequestFn=function(n){var r=e.session_recording.maskNetworkRequestFn({url:n.name});return t(t({},n),{},{name:null==r?void 0:r.url})}),a.maskRequestFn=Wt(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var n,r,i,o=d(t);return o&&null!==(n=null===(r=(i=e.session_recording).maskCapturedNetworkRequestFn)||void 0===r?void 0:r.call(i,o))&&void 0!==n?n:void 0}:void 0,a.maskRequestFn||(a.maskRequestFn=d),t(t(t({},ar),a),{},{recordHeaders:s,recordBody:u,recordPerformance:c,recordInitialRequests:c})},pr=function(e){return"navigation"===e.entryType},hr=function(e){return"resource"===e.entryType};function gr(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return Wt(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}function vr(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function mr(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((function(e){return pr(e)||hr(e)&&n.initiatorTypes.includes(e.initiatorType)}));e({requests:r.flatMap((function(e){return Cr(e,void 0,void 0,{},!0)})),isInitial:!0})}var i=new t.PerformanceObserver((function(t){var r=t.getEntries().filter((function(e){return pr(e)||hr(e)&&n.initiatorTypes.includes(e.initiatorType)&&function(e){return!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType}(e)}));e({requests:r.flatMap((function(e){return Cr(e,void 0,void 0,{})}))})})),o=PerformanceObserver.supportedEntryTypes.filter((function(e){return n.performanceEntryTypeToObserve.includes(e)}));return i.observe({entryTypes:o}),function(){i.disconnect()}}function yr(e,t){return!!t&&(Zt(t)||t[e])}function _r(e,t,n){function r(e){var t=Object.keys(n).find((function(e){return"content-type"===e.toLowerCase()})),r=t&&n[t];return e.some((function(e){return null==r?void 0:r.includes(e)}))}if(!t)return!1;if(Zt(t))return!0;if(qt(t))return r(t);var i=t[e];return Zt(i)?i:r(i)}function br(e,t,n,r,i){return Ir.apply(this,arguments)}function Ir(){return Ir=o(n().mark((function e(t,r,i,o,a){var s,u,c,l=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((s=l.length>5&&void 0!==l[5]?l[5]:0)>10)){e.next=4;break}return fn.warn("Failed to get performance entry for request",{url:i,initiatorType:r}),e.abrupt("return",null);case 4:if(u=t.performance.getEntriesByName(i),c=vr(u,(function(e){return hr(e)&&e.initiatorType===r&&(!o||e.startTime>=o)&&(!a||e.startTime<=a)}))){e.next=10;break}return e.next=9,new Promise((function(e){return setTimeout(e,50*s)}));case 9:return e.abrupt("return",br(t,r,i,o,a,s+1));case 10:return e.abrupt("return",c);case 11:case"end":return e.stop()}}),e)}))),Ir.apply(this,arguments)}function wr(e){if(jt(e))return null;if(Gt(e))return e;if(Kt(e))return e.textContent;if(zt(e))return xn(e);if(Vt(e))try{return JSON.stringify(e)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var kr=function(e){return"navigation"===e.entryType||"resource"===e.entryType};function Cr(e,n,r,i,o){var a=Math.floor(Date.now()-performance.now()),s=Math.floor(a+e.startTime),u=[t(t({},e.toJSON()),{},{startTime:Math.round(e.startTime),endTime:Math.round(e.responseEnd),timeOrigin:a,timestamp:s,method:n,initiatorType:e.initiatorType,status:r,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:o})];if(kr(e)){var c,l=g(e.serverTiming||[]);try{for(l.s();!(c=l.n()).done;){var d=c.value;u.push({timeOrigin:a,timestamp:s,startTime:Math.round(e.startTime),name:d.name,duration:d.duration,entryType:"serverTiming"})}}catch(e){l.e(e)}finally{l.f()}}return u}var Sr=["video/","audio/"];function Ar(e){var t;if("chunked"===e.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var n=null===(t=e.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),r=Sr.some((function(e){return null==n?void 0:n.startsWith(e)}));return n&&r?"Content-Type ".concat(n," is not supported"):null}function Rr(e){return new Promise((function(t,n){var r=setTimeout((function(){return t("[SessionReplay] Timeout while trying to read body")}),500);e.clone().text().then((function(e){return t(e)}),(function(e){return n(e)})).finally((function(){return clearTimeout(r)}))}))}function Fr(e){return Er.apply(this,arguments)}function Er(){return(Er=o(n().mark((function e(t){var r;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Ar(t),Ut(r)){e.next=3;break}return e.abrupt("return",Promise.resolve(r));case 3:return e.abrupt("return",Rr(t));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tr(e,r,i){if(!("performance"in r))return function(){};var a=i?Object.assign({},ar,i):ar,s=function(n){var r=[];n.requests.forEach((function(e){var t=a.maskRequestFn(e);t&&r.push(t)})),r.length>0&&e(t(t({},n),{},{requests:r}))},u=mr(s,r,a),c=function(){},l=function(){};return(a.recordHeaders||a.recordBody)&&(c=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return function(){};var r=yr("request",n.recordHeaders),i=yr("response",n.recordHeaders),o=gr(t.XMLHttpRequest.prototype,"open",(function(o){return function(a,s){var u,c,l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,f=arguments.length>4?arguments[4]:void 0,p=this,h=new Request(s),g={},v={},m=p.setRequestHeader.bind(p);p.setRequestHeader=function(e,t){return v[e]=t,m(e,t)},r&&(g.requestHeaders=v);var y=p.send.bind(p);p.send=function(e){return _r("request",n.recordBody,v)&&(Ht(e)||Ut(e)?g.requestBody=null:g.requestBody=wr(e)),u=t.performance.now(),y(e)},p.addEventListener("readystatechange",(function(){if(p.readyState===p.DONE){c=t.performance.now();var r={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var t=e.split(": "),n=t.shift(),i=t.join(": ");n&&(r[n]=i)})),i&&(g.responseHeaders=r),_r("response",n.recordBody,r)&&(jt(p.response)?g.responseBody=null:g.responseBody=wr(p.response)),br(t,"xmlhttprequest",h.url,u,c).then((function(t){if(!Ut(t)){var n=Cr(t,h.method,null==p?void 0:p.status,g);e({requests:n})}})).catch((function(){}))}})),o.call(p,a,s,l,d,f)}}));return function(){o()}}(s,r,a),l=function(e,t,r){if(!r.initiatorTypes.includes("fetch"))return function(){};var i=yr("request",r.recordHeaders),a=yr("response",r.recordHeaders),s=gr(t,"fetch",(function(s){return function(){var u=o(n().mark((function o(u,c){var l,d,f,p,h,g,v;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(l=new Request(u,c),f={},n.prev=2,g={},l.headers.forEach((function(e,t){g[t]=e})),i&&(f.requestHeaders=g),!_r("request",r.recordBody,g)){n.next=10;break}return n.next=9,Rr(l);case 9:f.requestBody=n.sent;case 10:return p=t.performance.now(),n.next=13,s(l);case 13:if(d=n.sent,h=t.performance.now(),v={},d.headers.forEach((function(e,t){v[t]=e})),a&&(f.responseHeaders=v),!_r("response",r.recordBody,v)){n.next=22;break}return n.next=21,Fr(d);case 21:f.responseBody=n.sent;case 22:return n.abrupt("return",d);case 23:return n.prev=23,br(t,"fetch",l.url,p,h).then((function(t){var n;if(!Ut(t)){var r=Cr(t,l.method,null===(n=d)||void 0===n?void 0:n.status,f);e({requests:r})}})).catch((function(){})),n.finish(23);case 26:case"end":return n.stop()}}),o,null,[[2,,23,26]])})));return function(e,t){return u.apply(this,arguments)}}()}));return function(){s()}}(s,r,a)),function(){u(),c(),l()}}Jt&&(Jt.rrweb={record:kt,version:"v2",rrwebVersion:"2.0.0-alpha.11"},Jt.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:Nt,options:e}}},Jt.getRecordNetworkPlugin=function(e){return{name:"rrweb/network@1",observer:Tr,options:e}});var xr=function(){function e(t){a(this,e),this.clicks=[],this.enabled=t}return u(e,[{key:"isRageClick",value:function(e,t,n){if(!this.enabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}(),Mr="$people_distinct_id",Or="__alias",Nr="__timers",Lr="$autocapture_disabled_server_side",Dr="$session_recording_enabled_server_side",Pr="$console_log_recording_enabled_server_side",Br="$session_recording_network_payload_capture",qr="$session_recording_canvas_recording",Wr="$sesid",Vr="$session_is_sampled",Hr="$enabled_feature_flags",Gr="$early_access_features",Ur="$stored_person_properties",jr="$stored_group_properties",$r="$surveys",Zr="$flag_call_reported",Kr="$user_state",zr="$posthog_quota_limited",Yr="$client_session_props",Jr=[Mr,Or,"__cmpns",Nr,Dr,Wr,Hr,Kr,zr,Gr,jr,Ur,$r,Zr,Yr],Qr="$copy_autocapture";function Xr(e,t){return t.length>e?t.slice(0,e)+"...":t}var ei,ti={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t,n=Ut(this._isDisabledServerSide)?!(null===(t=e.persistence)||void 0===t||!t.props[Lr]):this._isDisabledServerSide,r=!!e.config.autocapture;this._isAutocaptureEnabled=r&&!n},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Bn(t));return t},_getAugmentPropertiesFromElement:function(e){if(!jn(e))return{};var t={};return vn(e.attributes,(function(e){if(0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&Xn(r)&&(t[n]=r)}})),t},_getPropertiesFromElement:function(e,t,n){var r,i=e.tagName.toLowerCase(),o={tag_name:i};Hn.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Xr(1024,er(e)):o.$el_text=Xr(1024,Pn(e)));var a=Ln(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e})));var s=null===(r=this.config)||void 0===r?void 0:r.element_attribute_ignorelist;vn(e.attributes,(function(n){var r;if((!$n(e)||-1!==["name","id","class"].indexOf(n.name))&&((null==s||!s.includes(n.name))&&!t&&Xn(n.value)&&(r=n.name,!Gt(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7)))){var i=n.value;"class"===n.name&&(i=Nn(i).join(" ")),o["attr__"+n.name]=Xr(1024,i)}}));for(var u=1,c=1,l=e;l=this._previousElementSibling(l);)u++,l.tagName===e.tagName&&c++;return o.nth_child=u,o.nth_of_type=c,o},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return vn(null==rn?void 0:rn.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),Xn(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return vn(this._customProperties,(function(r){vn(r.event_selectors,(function(i){vn(null==rn?void 0:rn.querySelectorAll(i),(function(i){yn(e,i)&&jn(i)&&(n[r.name]=t._extractCustomPropertyValue(r))}))}))})),n},_getEventTarget:function(e){return Ht(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",o=arguments.length>3?arguments[3]:void 0,a=this._getEventTarget(e);(Wn(a)&&(a=a.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent)&&(null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,t,"$rageclick"));var s=i===Qr;if(a&&Un(a,e,this.config,s,s?["copy","cut"]:void 0)){for(var u,c,l=[a],d=a;d.parentNode&&!qn(d,"body");)Vn(d.parentNode)?(l.push(d.parentNode.host),d=d.parentNode.host):(l.push(d.parentNode),d=d.parentNode);var f,p=[],h={},g=!1;if(vn(l,(function(e){var n=jn(e);"a"===e.tagName.toLowerCase()&&(f=e.getAttribute("href"),f=n&&Xn(f)&&f),yn(Ln(e),"ph-no-capture")&&(g=!0),p.push(r._getPropertiesFromElement(e,t.config.mask_all_element_attributes,t.config.mask_all_text));var i=r._getAugmentPropertiesFromElement(e);mn(h,i)})),t.config.mask_all_text||("a"===a.tagName.toLowerCase()||"button"===a.tagName.toLowerCase()?p[0].$el_text=er(a):p[0].$el_text=Pn(a)),f&&(p[0].attr__href=f),g)return!1;var v=mn(this._getDefaultProperties(e.type),t.elementsChainAsString?{$elements_chain:nr(p)}:{$elements:p},null!==(u=p[0])&&void 0!==u&&u.$el_text?{$el_text:null===(c=p[0])||void 0===c?void 0:c.$el_text}:{},this._getCustomProperties(l),h,o||{});if(i===Qr){var m,y=Dn(null==Jt||null===(m=Jt.getSelection())||void 0===m?void 0:m.toString()),_=e.type||"clipboard";if(!y)return!1;v.$selected_content=y,v.$copy_type=_}return t.capture(i,v),!0}},_navigate:function(e){Jt&&(Jt.location.href=e)},_addDomEventHandlers:function(e){var t=this;if(Jt&&rn){var n=function(n){n=n||(null==Jt?void 0:Jt.event),t._captureEvent(n,e)},r=function(n){n=n||(null==Jt?void 0:Jt.event),t._captureEvent(n,e,Qr)};An(rn,"submit",n,!1,!0),An(rn,"change",n,!1,!0),An(rn,"click",n,!1,!0),Vt(e.config.autocapture)&&e.config.autocapture.capture_copied_text&&(An(rn,"copy",r,!1,!0),An(rn,"cut",r,!1,!0))}},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;Zt(e.__autocapture)||(this.config=e.__autocapture),null!==(t=this.config)&&void 0!==t&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map((function(e){return new RegExp(e)}))),this.rageclicks=new xr(e.config.rageclick)},afterDecideResponse:function(e,t){var n=t.config.token;this._initializedTokens.indexOf(n)>-1?fn.info('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(c({},Lr,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this._setIsAutocaptureEnabled(t),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=Ht(t)?10:t,n=Ht(n)?10:n;for(var r=0,i=0;i<e.length;i++)r+=e.charCodeAt(i);return r%t<n},isBrowserSupported:function(){return Wt(null==rn?void 0:rn.querySelectorAll)}};!function(e){for(var t in e)Wt(e[t])&&(e[t]=e[t].bind(e))}(ti),function(e){for(var t in e)Wt(e[t])&&(e[t]=wn(e[t]))}(ti),function(e){e.GZipJS="gzip-js",e.Base64="base64"}(ei||(ei={}));var ni="$active_feature_flags",ri="$override_feature_flags",ii="$feature_flag_payloads",oi=function(e){var t,n={},r=g(_n(e||{}));try{for(r.s();!(t=r.n()).done;){var i=d(t.value,2),o=i[0],a=i[1];a&&(n[o]=a)}}catch(e){r.e(e)}finally{r.f()}return n},ai=function(){function e(t){a(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return u(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Hr),t=this.instance.get_property(ri);if(!t)return e||{};for(var n=mn({},e),r=Object.keys(t),i=0;i<r.length;i++)!1===t[r[i]]?delete n[r[i]]:n[r[i]]=t[r[i]];return this._override_warning||(fn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(ii)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())}),5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,n=this.instance.get_property(Ur),r=this.instance.get_property(jr),i={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:i,compression:ei.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){var n;e.setReloadingPaused(!1);var r=!0;200===t.statusCode&&(e.$anon_distinct_id=void 0,r=!1),e.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},r),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,r=this.getFlagVariants()[e],i="".concat(r),o=this.instance.get_property(Zr)||{};if(t.send_event||!("send_event"in t))if(!(e in o)||!o[e].includes(i))qt(o[e])?o[e].push(i):o[e]=[i],null===(n=this.instance.persistence)||void 0===n||n.register(c({},Zr,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r});return r}fn.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);fn.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e,n){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=e.featureFlags,s=e.featureFlagPayloads;if(a)if(qt(a)){var u,l={};if(a)for(var d=0;d<a.length;d++)l[a[d]]=!0;n&&n.register((c(u={},ni,a),c(u,Hr,l),u))}else{var f=a,p=s;e.errorsWhileComputingFlags&&(f=t(t({},i),f),p=t(t({},o),p)),n&&n.register((c(r={},ni,Object.keys(oi(f))),c(r,Hr,f||{}),c(r,ii,p||{}),r))}}(e,this.instance.persistence,r,i),this._fireFeatureFlagsCallbacks(n)}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return fn.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(ri);else if(qt(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(c({},ri,t))}else this.instance.persistence.register(c({},ri,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,n){var r,i,o=c({},"$feature_enrollment/".concat(e),n);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:n,$set:o}),this.setPersonPropertiesForFlags(o,!1);var a=t(t({},this.getFlagVariants()),{},c({},e,n));null===(r=this.instance.persistence)||void 0===r||r.register((c(i={},ni,Object.keys(oi(a))),c(i,Hr,a),i)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(Gr);if(r&&!n)return e(r);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:function(n){var r;if(n.json){var i=n.json.earlyAccessFeatures;return null===(r=t.instance.persistence)||void 0===r||r.register(c({},Gr,i)),e(i)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach((function(t){return t(n,r,{errorsLoading:e})}))}},{key:"setPersonPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(Ur)||{};this.instance.register(c({},Ur,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Ur)}},{key:"setGroupPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(jr)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((function(n){r[n]=t(t({},r[n]),e[n]),delete e[n]})),this.instance.register(c({},jr,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var n=this.instance.get_property(jr)||{};this.instance.register(c({},jr,t(t({},n),{},c({},e,{}))))}else this.instance.unregister(jr)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return $t(e)&&isFinite(e)&&Math.floor(e)===e});var si="0123456789abcdef",ui=function(){function e(t){if(a(this,e),this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}return u(e,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+si.charAt(this.bytes[t]>>>4)+si.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(e){return 0===this.compareTo(e)}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}],[{key:"fromFieldsV7",value:function(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/Math.pow(2,8),o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)}}]),e}(),ci=function(){function e(){a(this,e),c(this,"timestamp",0),c(this,"counter",0),c(this,"random",new fi)}return u(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if(Ht(e)){this.timestamp=0;var t=this.generateOrAbort();if(Ht(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return ui.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),li=function(e){if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Jt&&!Ht(Jt.crypto)&&crypto.getRandomValues&&(li=function(e){return crypto.getRandomValues(e)});var di,fi=function(){function e(){a(this,e),c(this,"buffer",new Uint32Array(8)),c(this,"cursor",1/0)}return u(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(li(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),pi=function(){return hi().toString()},hi=function(){return(di||(di=new ci)).generate()},gi="Thu, 01 Jan 1970 00:00:00 GMT",vi="";var mi=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function yi(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rn;if(vi)return vi;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+pi(),o=new RegExp("(^|;)\\s*"+i+"=1");!vi&&r--;){var a=n.slice(r).join("."),s=i+"=1;domain=."+a;t.cookie=s,o.test(t.cookie)&&(t.cookie=s+";expires="+gi,vi=a)}return vi}(e);if(!n){var r=function(e){var t=e.match(mi);return t?t[0]:""}(e);r!==n&&fn.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var _i,bi={is_supported:function(){return!!rn},error:function(e){fn.error("cookieStore error: "+e)},get:function(e){if(rn){try{for(var t=e+"=",n=rn.cookie.split(";").filter((function(e){return e.length})),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(bi.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){if(rn)try{var o="",a="",s=yi(rn.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),o="; expires="+u.toUTCString()}i&&(a="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+s+a;return c.length>3686.4&&fn.warn("cookieStore warning: large cookie, len="+c.length),rn.cookie=c,c}catch(e){return}},remove:function(e,t){try{bi.set(e,"",-1,t)}catch(e){return}}},Ii=null,wi={is_supported:function(){if(!Ut(Ii))return Ii;var e=!0;if(Ht(Jt))e=!1;else try{var t="__mplssupport__";wi.set(t,"xyz"),'"xyz"'!==wi.get(t)&&(e=!1),wi.remove(t)}catch(t){e=!1}return e||fn.error("localStorage unsupported; falling back to cookie store"),Ii=e,e},error:function(e){fn.error("localStorage error: "+e)},get:function(e){try{return null==Jt?void 0:Jt.localStorage.getItem(e)}catch(e){wi.error(e)}return null},parse:function(e){try{return JSON.parse(wi.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==Jt||Jt.localStorage.setItem(e,JSON.stringify(t))}catch(e){wi.error(e)}},remove:function(e){try{null==Jt||Jt.localStorage.removeItem(e)}catch(e){wi.error(e)}}},ki=["distinct_id",Wr,Vr],Ci=t(t({},wi),{},{parse:function(e){try{var t={};try{t=bi.parse(e)||{}}catch(e){}var n=mn(t,JSON.parse(wi.get(e)||"{}"));return wi.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i){try{wi.set(e,t);var o={};ki.forEach((function(e){t[e]&&(o[e]=t[e])})),Object.keys(o).length&&bi.set(e,o,n,r,i)}catch(e){wi.error(e)}},remove:function(e,t){try{null==Jt||Jt.localStorage.removeItem(e),bi.remove(e,t)}catch(e){wi.error(e)}}}),Si={},Ai={is_supported:function(){return!0},error:function(e){fn.error("memoryStorage error: "+e)},get:function(e){return Si[e]||null},parse:function(e){return Si[e]||null},set:function(e,t){Si[e]=t},remove:function(e){delete Si[e]}},Ri=null,Fi={is_supported:function(){if(!Ut(Ri))return Ri;if(Ri=!0,Ht(Jt))Ri=!1;else try{var e="__support__";Fi.set(e,"xyz"),'"xyz"'!==Fi.get(e)&&(Ri=!1),Fi.remove(e)}catch(e){Ri=!1}return Ri},error:function(e){fn.error("sessionStorage error: ",e)},get:function(e){try{return null==Jt?void 0:Jt.sessionStorage.getItem(e)}catch(e){Fi.error(e)}return null},parse:function(e){try{return JSON.parse(Fi.get(e))||null}catch(e){}return null},set:function(e,t){try{null==Jt||Jt.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Fi.error(e)}},remove:function(e){try{null==Jt||Jt.sessionStorage.removeItem(e)}catch(e){Fi.error(e)}}},Ei="Mobile",Ti="iOS",xi="Android",Mi="Tablet",Oi=xi+" "+Mi,Ni="iPad",Li="Apple",Di=Li+" Watch",Pi="Safari",Bi="BlackBerry",qi="Samsung",Wi=qi+"Browser",Vi=qi+" Internet",Hi="Chrome",Gi=Hi+" OS",Ui=Hi+" "+Ti,ji="Internet Explorer",$i=ji+" "+Ei,Zi="Opera",Ki=Zi+" Mini",zi="Edge",Yi="Microsoft "+zi,Ji="Firefox",Qi=Ji+" "+Ti,Xi="Nintendo",eo="PlayStation",to="Xbox",no=xi+" "+Ei,ro=Ei+" "+Pi,io="Windows",oo=io+" Phone",ao="Nokia",so="Ouya",uo="Generic",co=uo+" "+Ei.toLowerCase(),lo=uo+" "+Mi.toLowerCase(),fo="Konqueror",po="(\\d+(\\.\\d+)?)",ho=new RegExp("Version/"+po),go=new RegExp(to,"i"),vo=new RegExp(eo+" \\w+","i"),mo=new RegExp(Xi+" \\w+","i"),yo=new RegExp(Bi+"|PlayBook|BB10","i"),_o={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var bo=function(e,t){return t&&yn(t,Li)||function(e){return yn(e,Pi)&&!yn(e,Hi)&&!yn(e,xi)}(e)},Io=function(e,t){return t=t||"",yn(e," OPR/")&&yn(e,"Mini")?Ki:yn(e," OPR/")?Zi:yo.test(e)?Bi:yn(e,"IE"+Ei)||yn(e,"WPDesktop")?$i:yn(e,Wi)?Vi:yn(e,zi)||yn(e,"Edg/")?Yi:yn(e,"FBIOS")?"Facebook "+Ei:yn(e,Hi)?Hi:yn(e,"CriOS")?Ui:yn(e,"UCWEB")||yn(e,"UCBrowser")?"UC Browser":yn(e,"FxiOS")?Qi:yn(e,xi)?no:yn(e.toLowerCase(),fo.toLowerCase())?fo:bo(e,t)?yn(e,Ei)?ro:Pi:yn(e,Ji)?Ji:yn(e,"MSIE")||yn(e,"Trident/")?ji:yn(e,"Gecko")?Ji:""},wo=(c(_i={},$i,[new RegExp("rv:"+po)]),c(_i,Yi,[new RegExp(zi+"?\\/"+po)]),c(_i,Hi,[new RegExp(Hi+"/"+po)]),c(_i,Ui,[new RegExp("CriOS\\/"+po)]),c(_i,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+po)]),c(_i,Pi,[ho]),c(_i,ro,[ho]),c(_i,Zi,[new RegExp("(Opera|OPR)\\/"+po)]),c(_i,Ji,[new RegExp(Ji+"\\/"+po)]),c(_i,Qi,[new RegExp("FxiOS\\/"+po)]),c(_i,fo,[new RegExp("Konqueror[:/]?"+po,"i")]),c(_i,Bi,[new RegExp(Bi+" "+po),ho]),c(_i,no,[new RegExp("android\\s"+po)]),c(_i,Vi,[new RegExp(Wi+"\\/"+po)]),c(_i,ji,[new RegExp("(rv:|MSIE )"+po)]),c(_i,"Mozilla",[new RegExp("rv:"+po)]),_i),ko=[[new RegExp(to+"; "+to+" (.*?)[);]","i"),function(e){return[to,e&&e[1]||""]}],[new RegExp(Xi,"i"),[Xi,""]],[new RegExp(eo,"i"),[eo,""]],[yo,[Bi,""]],[new RegExp(io,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[oo,""];if(new RegExp(Ei).test(t)&&!/IEMobile\b/.test(t))return[io+" "+Ei,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=_o[r]||"";return/arm/i.test(t)&&(i="RT"),[io,i]}return[io,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Ti,t.join(".")]}return[Ti,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=Ht(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+xi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+xi+")","i"),function(e){if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[xi,t.join(".")]}return[xi,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Gi,""]],[/Linux|debian/i,["Linux",""]]],Co=function(e){return mo.test(e)?Xi:vo.test(e)?eo:go.test(e)?to:new RegExp(so,"i").test(e)?so:new RegExp("("+oo+"|WPDesktop)","i").test(e)?oo:/iPad/.test(e)?Ni:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Di:yo.test(e)?Bi:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(ao,"i").test(e)?ao:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(Ei).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?xi:Oi:xi:new RegExp("(pda|"+Ei+")","i").test(e)?co:new RegExp(Mi,"i").test(e)&&!new RegExp(Mi+" pc","i").test(e)?lo:""},So="https?://(.*)",Ao={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid"].concat(e||[]),n={};return vn(t,(function(e){var t=rn?Mn(rn.URL,e):"";t.length&&(n[e]=t)})),n},searchEngine:function(){var e=null==rn?void 0:rn.referrer;return e?0===e.search(So+"google.([^/?]*)")?"google":0===e.search(So+"bing.com")?"bing":0===e.search(So+"yahoo.com")?"yahoo":0===e.search(So+"duckduckgo.com")?"duckduckgo":null:null},searchInfo:function(){var e=Ao.searchEngine(),t="yahoo"!=e?"q":"p",n={};if(!Ut(e)){n.$search_engine=e;var r=rn?Mn(rn.referrer,t):"";r.length&&(n.ph_keyword=r)}return n},browser:Io,browserVersion:function(e,t){var n=Io(e,t),r=wo[n];if(Ht(r))return null;for(var i=0;i<r.length;i++){var o=r[i],a=e.match(o);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(var t=0;t<ko.length;t++){var n=d(ko[t],2),r=n[0],i=n[1],o=r.exec(e),a=o&&(Wt(i)?i(o,e):i);if(a)return a}return["",""]},device:Co,deviceType:function(e){var t=Co(e);return t===Ni||t===Oi||"Kobo"===t||"Kindle Fire"===t||t===lo?Mi:t===Xi||t===to||t===eo||t===so?"Console":t===Di?"Wearable":t?Ei:"Desktop"},referrer:function(){return(null==rn?void 0:rn.referrer)||"$direct"},referringDomain:function(){var e;return null!=rn&&rn.referrer&&(null===(e=En(rn.referrer))||void 0===e?void 0:e.host)||"$direct"},properties:function(){if(!cn)return{};var e=d(Ao.os(cn),2),t=e[0],n=e[1];return mn(kn({$os:t,$os_version:n,$browser:Ao.browser(cn,navigator.vendor),$device:Ao.device(cn),$device_type:Ao.deviceType(cn)}),{$current_url:null==on?void 0:on.href,$host:null==on?void 0:on.host,$pathname:null==on?void 0:on.pathname,$raw_user_agent:cn.length>1e3?cn.substring(0,997)+"...":cn,$browser_version:Ao.browserVersion(cn,navigator.vendor),$browser_language:Ao.browserLanguage(),$screen_height:null==Jt?void 0:Jt.screen.height,$screen_width:null==Jt?void 0:Jt.screen.width,$viewport_height:null==Jt?void 0:Jt.innerHeight,$viewport_width:null==Jt?void 0:Jt.innerWidth,$lib:"web",$lib_version:Yt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:bn()/1e3})},people_properties:function(){if(!cn)return{};var e=d(Ao.os(cn),2),t=e[0],n=e[1];return mn(kn({$os:t,$os_version:n,$browser:Ao.browser(cn,navigator.vendor)}),{$browser_version:Ao.browserVersion(cn,navigator.vendor)})}},Ro=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Fo=function(){function e(t){a(this,e),this.config=t,this.props={},this.campaign_params_saved=!1,this.name=function(e){var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"}(t),this.storage=this.buildStorage(t),this.load(),this.update_config(t,t),this.save()}return u(e,[{key:"buildStorage",value:function(e){-1===Ro.indexOf(e.persistence.toLowerCase())&&(fn.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&wi.is_supported()?wi:"localstorage+cookie"===t&&Ci.is_supported()?Ci:"sessionstorage"===t&&Fi.is_supported()?Fi:"memory"===t?Ai:"cookie"===t?bi:Ci.is_supported()?Ci:bi}},{key:"properties",value:function(){var e={};return vn(this.props,(function(t,n){if(n===Hr&&Vt(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e["$feature/".concat(r[i])]=t[r[i]];else a=n,s=!1,(Ut(o=Jr)?s:tn&&o.indexOf===tn?-1!=o.indexOf(a):(vn(o,(function(e){if(s||(s=e===a))return pn})),s))||(e[n]=t);var o,a,s})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=mn({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var r=this;if(Vt(e)){Ht(t)&&(t="None"),this.expire_days=Ht(n)?this.default_expiry:n;var i=!1;if(vn(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(Vt(e)){this.expire_days=Ht(t)?this.default_expiry:t;var r=!1;if(vn(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(Ao.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(Ao.searchInfo())}},{key:"update_referrer_info",value:function(){this.register({$referrer:this.props.$referrer||Ao.referrer(),$referring_domain:this.props.$referring_domain||Ao.referringDomain()})}},{key:"get_referrer_info",value:function(){return kn({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return vn(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this.buildStorage(e),r=this.props;this.clear(),this.storage=n,this.props=r,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[Nr]||{};n[e]=t,this.props[Nr]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Nr]||{})[e];return Ht(t)||(delete this.props[Nr][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[Kr]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[Kr]=e,this.save()}},{key:"get_quota_limits",value:function(){return this.props[zr]||{}}},{key:"set_quota_limits",value:function(e){this.props[zr]=e,this.save()}}]),e}(),Eo=2,To=4;var xo=u((function e(t){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),c(this,"bucketSize",100),c(this,"refillRate",10),c(this,"mutationBuckets",{}),c(this,"loggedTracker",{}),c(this,"refillBuckets",(function(){Object.keys(i.mutationBuckets).forEach((function(e){i.mutationBuckets[e]=i.mutationBuckets[e]+i.refillRate,i.mutationBuckets[e]>=i.bucketSize&&delete i.mutationBuckets[e]}))})),c(this,"getNodeOrRelevantParent",(function(e){var t=i.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[i.rrweb.mirror.getId(n),n]}return[e,t]})),c(this,"numberOfChanges",(function(e){var t,n,r,i,o,a,s,u;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null===(a=e.texts)||void 0===a?void 0:a.length)&&void 0!==o?o:0)+(null!==(s=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==s?s:0)})),c(this,"throttleMutations",(function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=i.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,r,o=d(i.getNodeOrRelevantParent(e.id),2),a=o[0],s=o[1];if(0===i.mutationBuckets[a])return!1;(i.mutationBuckets[a]=null!==(t=i.mutationBuckets[a])&&void 0!==t?t:i.bucketSize,i.mutationBuckets[a]=Math.max(i.mutationBuckets[a]-1,0),0===i.mutationBuckets[a])&&(i.loggedTracker[a]||(i.loggedTracker[a]=!0,null===(n=(r=i.options).onBlockedNode)||void 0===n||n.call(r,a,s)));return e})));var r=i.numberOfChanges(t);return 0!==r||n===r?e:void 0})),this.rrweb=t,this.options=o,this.refillRate=null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,this.bucketSize=null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,setInterval((function(){i.refillBuckets()}),1e3)})),Mo=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(Mo||{}),Oo="__ph_opt_in_out_";function No(e,t){Ho(!0,e,t)}function Lo(e,t){Ho(!1,e,t)}function Do(e,t){return"1"===Vo(e,t)}function Po(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||Jt,n=null==t?void 0:t.navigator,r=!1;return vn([null==n?void 0:n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){yn([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===Vo(e,t)}function Bo(e,t){qo(t=t||{}).remove(Wo(e,t),!!t.crossSubdomainCookie)}function qo(e){return"localStorage"===(e=e||{}).persistenceType?wi:"localStorage+cookie"===e.persistenceType?Ci:bi}function Wo(e,t){return((t=t||{}).persistencePrefix||Oo)+e}function Vo(e,t){return qo(t).get(Wo(e,t))}function Ho(e,t,n){Gt(t)&&t.length?(qo(n=n||{}).set(Wo(t,n),e?1:0,$t(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):fn.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function Go(e){var t=!1;try{var n=e.config.token,r=e.config.respect_dnt,i=e.config.opt_out_capturing_persistence_type,o=e.config.opt_out_capturing_cookie_prefix||void 0,a=e.config.window;n&&(t=Po(n,{respectDnt:r,persistenceType:i,persistencePrefix:o,window:a}))}catch(e){fn.error("Unexpected error when checking capturing opt-out status: "+e)}return t}var Uo,jo=3e5,$o=jo;!function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"}(Uo||(Uo={}));var Zo=[Uo.MouseMove,Uo.MouseInteraction,Uo.Scroll,Uo.ViewportResize,Uo.Input,Uo.TouchMove,Uo.MediaInteraction,Uo.Drag],Ko=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}},zo="[SessionRecording]",Yo=function(){function e(t){var n=this;if(a(this,e),c(this,"queuedRRWebEvents",[]),c(this,"isIdle",!1),c(this,"_linkedFlagSeen",!1),c(this,"_lastActivityTimestamp",Date.now()),c(this,"windowId",null),c(this,"sessionId",null),c(this,"_linkedFlag",null),c(this,"_sampleRate",null),c(this,"_minimumDuration",null),c(this,"_forceAllowLocalhostNetworkCapture",!1),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,null==Jt||Jt.addEventListener("beforeunload",(function(){n._flushBuffer()})),null==Jt||Jt.addEventListener("offline",(function(){n._tryAddCustomEvent("browser offline",{})})),null==Jt||Jt.addEventListener("online",(function(){n._tryAddCustomEvent("browser online",{})})),null==Jt||Jt.addEventListener("visibilitychange",(function(){if(null!=rn&&rn.visibilityState){var e="window "+rn.visibilityState;n._tryAddCustomEvent(e,{})}})),!this.instance.sessionManager)throw fn.error(zo+" started without valid sessionManager"),new Error(zo+" started without valid sessionManager. This is a bug.");this.buffer=this.clearBuffer()}return u(e,[{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw fn.error(zo+" started without valid sessionManager"),new Error(zo+" started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"isSampled",get:function(){return $t(this._sampleRate)?this.instance.get_property(Vr):null}},{key:"sessionDuration",get:function(){var e,t,n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(Dr),t=!this.instance.config.disable_session_recording;return Jt&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(Pr),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(qr);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,n=this.instance.get_property(Br),r={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},i=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),a=this.instance.config.capture_performance||(null==n?void 0:n.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?jt(this._linkedFlag)||this._linkedFlagSeen?Zt(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled?(this._startCapture(),fn.info(zo+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,fn.info(zo+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,n=this.sessionId!==e;if($t(this._sampleRate)){var r,i=this.isSampled;if(n||!Zt(i))r=Math.random()<this._sampleRate;else r=i;r||fn.warn(zo+" Sample rate (".concat(this._sampleRate,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),null===(t=this.instance.persistence)||void 0===t||t.register(c({},Vr,r))}else{var o;null===(o=this.instance.persistence)||void 0===o||o.register(c({},Vr,null))}}},{key:"afterDecideResponse",value:function(e){var n,r,i,o,a,s,u,l,d,f,p=this;this.instance.persistence&&this.instance.persistence.register((c(f={},Dr,!!e.sessionRecording),c(f,Pr,null===(a=e.sessionRecording)||void 0===a?void 0:a.consoleLogRecordingEnabled),c(f,Br,t({capturePerformance:e.capturePerformance},null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture)),c(f,qr,{enabled:null===(u=e.sessionRecording)||void 0===u?void 0:u.recordCanvas,fps:null===(l=e.sessionRecording)||void 0===l?void 0:l.canvasFps,quality:null===(d=e.sessionRecording)||void 0===d?void 0:d.canvasQuality}),f));var h=null===(n=e.sessionRecording)||void 0===n?void 0:n.sampleRate;this._sampleRate=jt(h)?null:parseFloat(h);var g,v=null===(r=e.sessionRecording)||void 0===r?void 0:r.minimumDurationMilliseconds;(this._minimumDuration=Ht(v)?null:v,this._linkedFlag=(null===(i=e.sessionRecording)||void 0===i?void 0:i.linkedFlag)||null,null!==(o=e.sessionRecording)&&void 0!==o&&o.endpoint)&&(this._endpoint=null===(g=e.sessionRecording)||void 0===g?void 0:g.endpoint);if($t(this._sampleRate)&&this.sessionManager.onSessionId((function(e){p.makeSamplingDecision(e)})),!jt(this._linkedFlag)){var m,y,_=Gt(this._linkedFlag)?this._linkedFlag:null===(m=this._linkedFlag)||void 0===m?void 0:m.flag,b=Gt(this._linkedFlag)?null:null===(y=this._linkedFlag)||void 0===y?void 0:y.variant;this.instance.onFeatureFlags((function(e,t){var n=Vt(t)&&_ in t,r=b?t[_]===b:n;r&&fn.info(zo+" linked flag matched",{linkedFlag:_,linkedVariant:b}),p._linkedFlagSeen=r}))}this.receivedDecide=!0,this.startRecordingIfEnabled()}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:bn()})}},{key:"_startCapture",value:function(){var e=this;Ht(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||Go(this.instance)||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),"v2"!==this.instance.__loaded_recorder_version?Rn(this.instance.requestRouter.endpointFor("assets","/static/recorder-v2.js?v=".concat(Yt.LIB_VERSION)),(function(t){if(t)return fn.error(zo+" could not load recorder-v2.js",t);e._onScriptLoaded()})):this._onScriptLoaded())}},{key:"_isInteractiveEvent",value:function(e){var t;return 3===e.type&&-1!==Zo.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this._isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>$o&&(this.isIdle=!0,this._tryAddCustomEvent("sessionIdle",{reason:"user inactivity",timeSinceLastActive:e.timestamp-this._lastActivityTimestamp,threshold:$o}));var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),i=r.windowId,o=r.sessionId,a=this.sessionId!==o,s=this.windowId!==i;this.windowId=i,this.sessionId=o,(n||-1===[Eo,To].indexOf(e.type)&&(s||a))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):fn.warn(zo+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var n=this;return this._tryRRWebMethod(Ko((function(){return n.rrwebRecord.addCustomEvent(e,t)})))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(Ko((function(){return e.rrwebRecord.takeFullSnapshot()})))}},{key:"_onScriptLoaded",value:function(){var e,n=this,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=Jt.rrweb?Jt.rrweb.record:Jt.rrwebRecord;for(var i=this.instance.config.session_recording,o=0,a=Object.entries(i||{});o<a.length;o++){var s=d(a[o],2),u=s[0],c=s[1];u in r&&(r[u]=c)}if(this.canvasRecording&&this.canvasRecording.enabled&&(r.recordCanvas=!0,r.sampling={canvas:this.canvasRecording.fps},r.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new xo(this.rrwebRecord,{onBlockedNode:function(e,t){var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");fn.info(r,{node:t}),n.log(zo+" "+r,"warn")}}),this._scheduleFullSnapshot();var l=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(t({emit:function(e){n.onRRwebEmit(e)},plugins:l},r)),this.instance._addCaptureHook((function(e){try{if("$pageview"===e){var t=Jt?n._maskUrl(Jt.location.href):"";if(!t)return;n._tryAddCustomEvent("$pageview",{href:t}),n._tryTakeFullSnapshot()}}catch(e){fn.error("Could not add $pageview to rrweb session",e)}})),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:r,activePlugins:l.map((function(e){return null==e?void 0:e.name}))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else fn.error(zo+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this._fullSnapshotTimer=setInterval((function(){e._tryTakeFullSnapshot()}),jo)}},{key:"_gatherRRWebPlugins",value:function(){var e=[];(ln.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(ln.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&Wt(ln.getRecordNetworkPlugin))&&(!Fn.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(ln.getRecordNetworkPlugin(fr(this.instance.config,this.networkPayloadCapture))):fn.info(zo+" NetworkCapture not started because we are on localhost."));return e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&Vt(e)){if(e.type===Mo.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===Mo.FullSnapshot&&this._scheduleFullSnapshot();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var r=function(e){var t=e;if(t&&Vt(t)&&6===t.type&&Vt(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(n),i=JSON.stringify(r).length;if(this._updateWindowAndSessionIds(r),!this.isIdle||r.type===Mo.Custom){var o={$snapshot_bytes:i,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&Jt){var e=this._maskUrl(Jt.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=f(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach((function(n){Date.now()-n.enqueuedAt>2e3?e._tryAddCustomEvent("rrwebQueueTimeout",{enqueuedAt:n.enqueuedAt,attempt:n.attempt,queueLength:t.length}):e._tryRRWebMethod(n)&&e._tryAddCustomEvent("rrwebQueueSuccess",{enqueuedAt:n.enqueuedAt,attempt:n.attempt,queueLength:t.length})}))}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null===(n=r=t.maskNetworkRequestFn(r))||void 0===n?void 0:n.url}return e}},{key:"clearBuffer",value:function(){return this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this._minimumDuration,n=this.sessionDuration,r=$t(n)&&n>=0,i=$t(t)&&r&&n<t;return"buffering"===this.status||i?(this.flushBufferTimer=setTimeout((function(){e._flushBuffer()}),2e3),this.buffer||this.clearBuffer()):this.buffer&&0!==this.buffer.data.length?(this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer()):this.buffer||this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);(!this.buffer||this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId&&this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),Ut(this.buffer.sessionId)&&!Ut(this.sessionId)&&(this.buffer.sessionId=this.sessionId,this.buffer.windowId=this.windowId),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout((function(){n._flushBuffer()}),2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings"})}}]),e}(),Jo=function(){function e(t){a(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return u(e,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Ur),group_properties:this.instance.get_property(jr),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:ei.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){return e.parseDecideResponse(t.json)}})}},{key:"parseDecideResponse",value:function(e){var t,n=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var r=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=e?e:{},r),r)fn.error("Failed to fetch feature flags from PostHog.");else{if(!rn||!rn.body)return fn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){n.parseDecideResponse(e)}),500);this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),ti.afterDecideResponse(e,this.instance),this.instance._afterDecideResponse(e);var i=null==Jt?void 0:Jt.extendPostHogWithSurveys;e.surveys&&!i&&Rn(this.instance.requestRouter.endpointFor("assets","/static/surveys.js"),(function(e){if(e)return fn.error("Could not load surveys script",e);Jt.extendPostHogWithSurveys(n.instance)}));var o=null==Jt?void 0:Jt.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&Ht(o)&&Rn(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js"),(function(t){if(t)return fn.error("Could not load exception autocapture script",t);Jt.extendPostHogWithExceptionAutocapture(n.instance,e)})),e.siteApps)if(this.instance.config.opt_in_site_apps){var a,s=g(e.siteApps);try{var u=function(){var e=a.value,t=e.id,r=e.url,i=n.instance.requestRouter.endpointFor("api",r);ln["__$$ph_site_app_".concat(t)]=n.instance,Rn(i,(function(e){e&&fn.error("Error while initializing PostHog app with config id ".concat(t),e)}))};for(s.s();!(a=s.n()).done;)u()}catch(e){s.e(e)}finally{s.f()}}else e.siteApps.length>0&&fn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),e}(),Qo=["source"],Xo=null!=Jt&&Jt.location?On(Jt.location.hash,"__posthog")||On(location.hash,"state"):null,ea=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"afterDecideResponse",value:function(e){var n=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&n.toolbarVersion&&0===n.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(t({},n))}},{key:"maybeLoadToolbar",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!Jt||!rn)return!1;n=null!==(e=n)&&void 0!==e?e:Jt.location,i=null!==(t=i)&&void 0!==t?t:Jt.history;try{if(!r){try{Jt.localStorage.setItem("test","test"),Jt.localStorage.removeItem("test")}catch(e){return!1}r=null==Jt?void 0:Jt.localStorage}var o,a=Xo||On(n.hash,"__posthog")||On(n.hash,"state"),s=a?In((function(){return JSON.parse(atob(decodeURIComponent(a)))}))||In((function(){return JSON.parse(decodeURIComponent(a))})):null;return s&&"ph_authorize"===s.action?((o=s).source="url",o&&Object.keys(o).length>0&&(s.desiredHash?n.hash=s.desiredHash:i?i.replaceState("",rn.title,n.pathname+n.search):n.hash="")):((o=JSON.parse(r.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}},{key:"loadToolbar",value:function(e){var n=this;if(!Jt||ln._postHogToolbarLoaded)return!1;ln._postHogToolbarLoaded=!0;var r=3e5,i=Math.floor(Date.now()/r)*r,o=this.instance.requestRouter.endpointFor("assets","/static/toolbar.js?t=".concat(i)),a="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=t(t({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},a?{instrument:!1}:{});s.source;var u=l(s,Qo);return Jt.localStorage.setItem("_postHogToolbarParams",JSON.stringify(u)),Rn(o,(function(e){e?fn.error("Failed to load toolbar",e):(ln.ph_load_toolbar||ln.ph_load_editor)(s,n.instance)})),An(Jt,"turbolinks:load",(function(){ln._postHogToolbarLoaded=!1,n.loadToolbar(s)})),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}]),e}(),ta=function(){function e(t){a(this,e),c(this,"isPaused",!0),c(this,"queue",[]),c(this,"flushTimeoutMs",3e3),this.sendRequest=t}return u(e,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var n=this.queue.length>0?this.formatQueue():{},r=Object.values(n);[].concat(f(r.filter((function(e){return 0===e.url.indexOf("/e")}))),f(r.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(n){e.sendRequest(t(t({},n),{},{transport:"sendBeacon"}))}))}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=(new Date).getTime();r.data&&qt(r.data)&&vn(r.data,(function(e){e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.sendRequest(r)};for(var r in t)n(r)}}),this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return vn(this.queue,(function(n){var r,i=n,o=(i?i.batchKey:null)||i.url;Ht(e[o])&&(e[o]=t(t({},i),{},{data:[]})),null===(r=e[o].data)||void 0===r||r.push(i.data)})),this.queue=[],e}}]),e}(),na=Uint8Array,ra=Uint16Array,ia=Uint32Array,oa=new na([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]),aa=new na([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]),sa=new na([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ua=function(e,t){for(var n=new ra(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new ia(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},ca=ua(oa,2),la=ca[0],da=ca[1];la[28]=258,da[258]=28;for(var fa=ua(aa,0)[1],pa=new ra(32768),ha=0;ha<32768;++ha){var ga=(43690&ha)>>>1|(21845&ha)<<1;ga=(61680&(ga=(52428&ga)>>>2|(13107&ga)<<2))>>>4|(3855&ga)<<4,pa[ha]=((65280&ga)>>>8|(255&ga)<<8)>>>1}var va=function(e,t,n){for(var r=e.length,i=0,o=new ra(t);i<r;++i)++o[e[i]-1];var a,s=new ra(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(n){a=new ra(1<<t);var u=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],l=t-e[i],d=s[e[i]-1]++<<l,f=d|(1<<l)-1;d<=f;++d)a[pa[d]>>>u]=c}else for(a=new ra(r),i=0;i<r;++i)a[i]=pa[s[e[i]-1]++]>>>15-e[i];return a},ma=new na(288);for(ha=0;ha<144;++ha)ma[ha]=8;for(ha=144;ha<256;++ha)ma[ha]=9;for(ha=256;ha<280;++ha)ma[ha]=7;for(ha=280;ha<288;++ha)ma[ha]=8;var ya=new na(32);for(ha=0;ha<32;++ha)ya[ha]=5;var _a=va(ma,9,0),ba=va(ya,5,0),Ia=function(e){return(e/8>>0)+(7&e&&1)},wa=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof ra?ra:e instanceof ia?ia:na)(n-t);return r.set(e.subarray(t,n)),r},ka=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Ca=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Sa=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new na(0),0];if(1==i){var a=new na(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],u=n[1],c=0,l=1,d=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};l!=i-1;)s=n[n[c].f<n[d].f?c++:d++],u=n[c!=l&&n[c].f<n[d].f?c++:d++],n[l++]={s:-1,f:s.f+u.f,l:s,r:u};var f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var p=new ra(f+1),h=Aa(n[l-1],p,0);if(h>t){r=0;var g=0,v=h-t,m=1<<v;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var y=o[r].s;if(!(p[y]>t))break;g+=m-(1<<h-p[y]),p[y]=t}for(g>>>=v;g>0;){var _=o[r].s;p[_]<t?g-=1<<t-p[_]++-1:++r}for(;r>=0&&g;--r){var b=o[r].s;p[b]==t&&(--p[b],++g)}h=t}return[new na(p),h]},Aa=function e(t,n,r){return-1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},Ra=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ra(++t),r=0,i=e[0],o=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[s]}return[n.subarray(0,r),t]},Fa=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Ea=function(e,t,n){var r=n.length,i=Ia(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},Ta=function(e,t,n,r,i,o,a,s,u,c,l){ka(t,l++,n),++i[256];for(var d=Sa(i,15),f=d[0],p=d[1],h=Sa(o,15),g=h[0],v=h[1],m=Ra(f),y=m[0],_=m[1],b=Ra(g),I=b[0],w=b[1],k=new ra(19),C=0;C<y.length;++C)k[31&y[C]]++;for(C=0;C<I.length;++C)k[31&I[C]]++;for(var S=Sa(k,7),A=S[0],R=S[1],F=19;F>4&&!A[sa[F-1]];--F);var E,T,x,M,O=c+5<<3,N=Fa(i,ma)+Fa(o,ya)+a,L=Fa(i,f)+Fa(o,g)+a+14+3*F+Fa(k,A)+(2*k[16]+3*k[17]+7*k[18]);if(O<=N&&O<=L)return Ea(t,l,e.subarray(u,u+c));if(ka(t,l,1+(L<N)),l+=2,L<N){E=va(f,p,0),T=f,x=va(g,v,0),M=g;var D=va(A,R,0);ka(t,l,_-257),ka(t,l+5,w-1),ka(t,l+10,F-4),l+=14;for(C=0;C<F;++C)ka(t,l+3*C,A[sa[C]]);l+=3*F;for(var P=[y,I],B=0;B<2;++B){var q=P[B];for(C=0;C<q.length;++C){var W=31&q[C];ka(t,l,D[W]),l+=A[W],W>15&&(ka(t,l,q[C]>>>5&127),l+=q[C]>>>12)}}}else E=_a,T=ma,x=ba,M=ya;for(C=0;C<s;++C)if(r[C]>255){W=r[C]>>>18&31;Ca(t,l,E[W+257]),l+=T[W+257],W>7&&(ka(t,l,r[C]>>>23&31),l+=oa[W]);var V=31&r[C];Ca(t,l,x[V]),l+=M[V],V>3&&(Ca(t,l,r[C]>>>5&8191),l+=aa[V])}else Ca(t,l,E[r[C]]),l+=T[r[C]];return Ca(t,l,E[256]),l+T[256]},xa=new ia([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ma=new na(0),Oa=function(){for(var e=new ia(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Na=function(e,t,n,r,i){return function(e,t,n,r,i,o){var a=e.length,s=new na(r+a+5*(1+Math.floor(a/7e3))+i),u=s.subarray(r,s.length-i),c=0;if(!t||a<8)for(var l=0;l<=a;l+=65535){var d=l+65535;d<a?c=Ea(u,c,e.subarray(l,d)):(u[l]=o,c=Ea(u,c,e.subarray(l,a)))}else{for(var f=xa[t-1],p=f>>>13,h=8191&f,g=(1<<n)-1,v=new ra(32768),m=new ra(g+1),y=Math.ceil(n/3),_=2*y,b=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<_)&g},I=new ia(25e3),w=new ra(288),k=new ra(32),C=0,S=0,A=(l=0,0),R=0,F=0;l<a;++l){var E=b(l),T=32767&l,x=m[E];if(v[T]=x,m[E]=T,R<=l){var M=a-l;if((C>7e3||A>24576)&&M>423){c=Ta(e,u,0,I,w,k,S,A,F,l-F,c),A=C=S=0,F=l;for(var O=0;O<286;++O)w[O]=0;for(O=0;O<30;++O)k[O]=0}var N=2,L=0,D=h,P=T-x&32767;if(M>2&&E==b(l-P))for(var B=Math.min(p,M)-1,q=Math.min(32767,l),W=Math.min(258,M);P<=q&&--D&&T!=x;){if(e[l+N]==e[l+N-P]){for(var V=0;V<W&&e[l+V]==e[l+V-P];++V);if(V>N){if(N=V,L=P,V>B)break;var H=Math.min(P,V-2),G=0;for(O=0;O<H;++O){var U=l-P+O+32768&32767,j=U-v[U]+32768&32767;j>G&&(G=j,x=U)}}}P+=(T=x)-(x=v[T])+32768&32767}if(L){I[A++]=268435456|da[N]<<18|fa[L];var $=31&da[N],Z=31&fa[L];S+=oa[$]+aa[Z],++w[257+$],++k[Z],R=l+N,++C}else I[A++]=e[l],++w[e[l]]}}c=Ta(e,u,o,I,w,k,S,A,F,l-F,c),o||(c=Ea(u,c,Ma))}return wa(s,0,r+Ia(c)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},La=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Da(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Oa[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,o=Na(e,t,10+((i=t).filename&&i.filename.length+1||0),8),a=o.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&La(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}}(o,t),La(o,a-8,n.d()),La(o,a-4,r),o}var Pa=!!sn||!!an,Ba="text/plain",qa=function(e,n){var r=d(e.split("?"),2),i=r[0],o=r[1],a=t({},n);null==o||o.split("&").forEach((function(e){var t=d(e.split("="),1)[0];delete a[t]}));var s=xn(a);return s=s?(o?o+"&":"")+s:o,"".concat(i,"?").concat(s)},Wa=function(e){return"data="+encodeURIComponent("string"==typeof e?e:JSON.stringify(e))},Va=function(e){var t=e.data,n=e.compression;if(t){if(n===ei.GZipJS){var r=Da(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new na(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},a=0;a<n;++a){if(i+5>r.length){var s=new na(i+8+(n-a<<1));s.set(r),r=s}var u=e.charCodeAt(a);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return wa(r,0,i)}(JSON.stringify(t)),{mtime:0});return{contentType:Ba,body:new Blob([r],{type:Ba})}}if(n===ei.Base64){var i=function(e){var t,n,r,i,o,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,c="",l=[];if(!e)return e;e=Sn(e);do{t=(o=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,l[u++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(i)}while(s<e.length);switch(c=l.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(JSON.stringify(t));return{contentType:"application/x-www-form-urlencoded",body:Wa(i)}}return{contentType:"application/json",body:JSON.stringify(t)}}},Ha=function(e){var t,n=new sn;n.open(e.method||"GET",e.url,!0);var r=null!==(t=Va(e))&&void 0!==t?t:{},i=r.contentType,o=r.body;vn(e.headers,(function(e,t){n.setRequestHeader(t,e)})),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=function(){if(4===n.readyState){var t,r={statusCode:n.status,text:n.responseText};if(200===n.status)try{r.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,r)}},n.send(o)},Ga=function(e){var t,n,r=null!==(t=Va(e))&&void 0!==t?t:{},i=r.contentType,o=r.body,a=new Headers;vn(a,(function(e,t){a.append(t,e)})),i&&a.append("Content-Type",i);var s=e.url,u=null;if(un){var c=new un;u={signal:c.signal,timeout:setTimeout((function(){return c.abort()}),e.timeout)}}an(s,{method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method,body:o,signal:null===(n=u)||void 0===n?void 0:n.signal}).then((function(t){return t.text().then((function(n){var r,i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){fn.error(e)}null===(r=e.callback)||void 0===r||r.call(e,i)}))})).catch((function(t){var n;fn.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((function(){return u?clearTimeout(u.timeout):null}))},Ua=function(e){var t=qa(e.url,{beacon:"1"});try{var n,r=null!==(n=Va(e))&&void 0!==n?n:{},i=r.contentType,o=r.body,a="string"==typeof o?new Blob([o],{type:i}):o;nn.sendBeacon(t,a)}catch(e){}},ja=function(e){var t;if(rn){var n=rn.createElement("script");n.type="text/javascript",n.async=!0,n.defer=!0,n.src=e.url;var r=rn.getElementsByTagName("script")[0];null===(t=r.parentNode)||void 0===t||t.insertBefore(n,r)}},$a=["retriesPerformedSoFar"];var Za,Ka=function(){function e(t){var n=this;a(this,e),c(this,"isPolling",!1),c(this,"pollIntervalMs",3e3),c(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!Ht(Jt)&&"onLine"in Jt.navigator&&(this.areWeOnline=Jt.navigator.onLine,Jt.addEventListener("online",(function(){n.areWeOnline=!0,n.flush()})),Jt.addEventListener("offline",(function(){n.areWeOnline=!1})))}return u(e,[{key:"retriableRequest",value:function(e){var n=this,r=e.retriesPerformedSoFar,i=l(e,$a);$t(r)&&r>0&&(i.url=qa(i.url,{retry_count:r})),this.instance._send_request(t(t({},i),{},{callback:function(e){var o;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=r?r:0)<10?n.enqueue(t({},i)):null===(o=i.callback)||void 0===o||o.call(i,e)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(t),r=Date.now()+n;this.queue.push({retryAt:r,requestOptions:e});var i="Enqueued failed request for retry in ".concat(n);navigator.onLine||(i+=" (Browser is offline)"),fn.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout((function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()}),this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],n=this.queue.filter((function(n){return n.retryAt<e||(t.push(n),!1)}));if(this.queue=t,n.length>0){var r,i=g(n);try{for(i.s();!(r=i.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(e){i.e(e)}finally{i.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,n=g(this.queue);try{for(n.s();!(e=n.n()).done;){var r=e.value.requestOptions;try{this.instance._send_request(t(t({},r),{},{transport:"sendBeacon"}))}catch(e){fn.error(e)}}}catch(e){n.e(e)}finally{n.f()}this.queue=[]}}]),e}(),za=1800,Ya=function(){function e(t,n,r,i){a(this,e),c(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||pi,this._windowIdGenerator=i||pi;var o=t.persistence_name||t.token,s=t.session_idle_timeout_seconds||za;if($t(s)?s>za?fn.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):s<60&&fn.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(fn.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),s=za),this._sessionTimeoutMs=1e3*Math.min(Math.max(s,60),za),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var u=Fi.parse(this._window_id_storage_key),l=Fi.parse(this._primary_window_exists_storage_key);u&&!l?this._windowId=u:Fi.remove(this._window_id_storage_key),Fi.set(this._primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return u(e,[{key:"onSessionId",value:function(e){var t=this;return Ht(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter((function(t){return t!==e}))}}},{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&Fi.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Fi.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Fi.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(c({},Wr,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Wr];return qt(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;null==Jt||Jt.addEventListener("beforeunload",(function(){e._canUseSessionStorage()&&Fi.remove(e._primary_window_exists_storage_key)}))}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),n=d(this._getSessionId(),3),r=n[0],i=n[1],o=n[2],a=this._getWindowId(),s=o&&o>0&&Math.abs(t-o)>864e5,u=!1,c=!i,l=!e&&Math.abs(t-r)>this._sessionTimeoutMs;c||l||s?(i=this._sessionIdGenerator(),a=this._windowIdGenerator(),fn.info("[SessionId] new session ID generated",{sessionId:i,windowId:a,changeReason:{noSessionId:c,activityTimeout:l,sessionPastMaximumLength:s}}),o=t,u=!0):a||(a=this._windowIdGenerator(),u=!0);var f=0===r||!e||s?t:r,p=0===o?(new Date).getTime():o;return this._setWindowId(a),this._setSessionId(i,f,p),u&&this._sessionIdChangedHandlers.forEach((function(e){return e(i,a)})),{sessionId:i,windowId:a,sessionStartTimestamp:p}}}]),e}();!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(Za||(Za={}));var Ja=function(){function e(t){a(this,e),c(this,"_regionCache",{}),this.instance=t}return u(e,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e;return null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"")}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Za.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Za.EU:this._regionCache[this.apiHost]=Za.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return(this.uiHost||this.apiHost)+t;if(this.region===Za.CUSTOM)return this.apiHost+t;var n="i.posthog.com"+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,".").concat(n)}}}]),e}(),Qa=u((function e(t,n,r,i){a(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var o,a,s,u,c;if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var l=t.requestRouter.endpointFor("ui","/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=l,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var d=(null===(o=e.exception)||void 0===o?void 0:o.values)||[],f={$exception_message:null===(a=d[0])||void 0===a?void 0:a.value,$exception_type:null===(s=d[0])||void 0===s?void 0:s.type,$exception_personURL:l,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:null===(u=d[0])||void 0===u?void 0:u.value,$sentry_exception_type:null===(c=d[0])||void 0===c?void 0:c.type,$sentry_tags:e.tags};return n&&r&&(f.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",f),e}))}})),Xa=function(){function e(t){var n=this;a(this,e),c(this,"_hasSeenPageView",!1),c(this,"_updateScrollData",(function(){var e,t,r,i;n._pageViewData||(n._pageViewData=n._createPageViewData());var o=n._pageViewData,a=n._scrollY(),s=n._scrollHeight(),u=n._contentY(),c=n._contentHeight();o.lastScrollY=a,o.maxScrollY=Math.max(a,null!==(e=o.maxScrollY)&&void 0!==e?e:0),o.maxScrollHeight=Math.max(s,null!==(t=o.maxScrollHeight)&&void 0!==t?t:0),o.lastContentY=u,o.maxContentY=Math.max(u,null!==(r=o.maxContentY)&&void 0!==r?r:0),o.maxContentHeight=Math.max(c,null!==(i=o.maxContentHeight)&&void 0!==i?i:0)})),this._instance=t}return u(e,[{key:"_createPageViewData",value:function(){var e;return{pathname:null!==(e=null==Jt?void 0:Jt.location.pathname)&&void 0!==e?e:""}}},{key:"doPageView",value:function(){var e,n;return this._hasSeenPageView?(n=this._pageViewData,this._pageViewData=this._createPageViewData()):(this._hasSeenPageView=!0,n=void 0,this._pageViewData||(this._pageViewData=this._createPageViewData())),setTimeout(this._updateScrollData,0),t({$prev_pageview_pathname:null===(e=n)||void 0===e?void 0:e.pathname},this._calculatePrevPageScrollProperties(n))}},{key:"doPageLeave",value:function(){var e=this._pageViewData;return t({$prev_pageview_pathname:null==e?void 0:e.pathname},this._calculatePrevPageScrollProperties(e))}},{key:"_calculatePrevPageScrollProperties",value:function(e){if(!e||null==e.maxScrollHeight||null==e.lastScrollY||null==e.maxScrollY||null==e.maxContentHeight||null==e.lastContentY||null==e.maxContentY)return{};var t=e.maxScrollHeight,n=e.lastScrollY,r=e.maxScrollY,i=e.maxContentHeight,o=e.lastContentY,a=e.maxContentY;return t=Math.ceil(t),n=Math.ceil(n),r=Math.ceil(r),i=Math.ceil(i),o=Math.ceil(o),a=Math.ceil(a),{$prev_pageview_last_scroll:n,$prev_pageview_last_scroll_percentage:t<=1?1:es(n/t,0,1),$prev_pageview_max_scroll:r,$prev_pageview_max_scroll_percentage:t<=1?1:es(r/t,0,1),$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:i<=1?1:es(o/i,0,1),$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:i<=1?1:es(a/i,0,1)}}},{key:"startMeasuringScrollPosition",value:function(){null==Jt||Jt.addEventListener("scroll",this._updateScrollData,!0),null==Jt||Jt.addEventListener("scrollend",this._updateScrollData,!0),null==Jt||Jt.addEventListener("resize",this._updateScrollData)}},{key:"stopMeasuringScrollPosition",value:function(){null==Jt||Jt.removeEventListener("scroll",this._updateScrollData),null==Jt||Jt.removeEventListener("scrollend",this._updateScrollData),null==Jt||Jt.removeEventListener("resize",this._updateScrollData)}},{key:"_scrollElement",value:function(){if(!this._instance.config.scroll_root_selector)return null==Jt?void 0:Jt.document.documentElement;var e,t=g(qt(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var n=e.value,r=null==Jt?void 0:Jt.document.querySelector(n);if(r)return r}}catch(e){t.e(e)}finally{t.f()}}},{key:"_scrollHeight",value:function(){var e=this._scrollElement();return e?Math.max(0,e.scrollHeight-e.clientHeight):0}},{key:"_scrollY",value:function(){if(this._instance.config.scroll_root_selector){var e=this._scrollElement();return e&&e.scrollTop||0}return Jt&&(Jt.scrollY||Jt.pageYOffset||Jt.document.documentElement.scrollTop)||0}},{key:"_contentHeight",value:function(){var e=this._scrollElement();return(null==e?void 0:e.scrollHeight)||0}},{key:"_contentY",value:function(){var e=this._scrollElement(),t=(null==e?void 0:e.clientHeight)||0;return this._scrollY()+t}}]),e}();function es(e,t,n){return Math.max(t,Math.min(e,n))}var ts={icontains:function(e){return!!Jt&&Jt.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},regex:function(e){return!!Jt&&Tn(Jt.location.href,e)},exact:function(e){return(null==Jt?void 0:Jt.location.href)===e}},ns=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"getSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property($r);if(r&&!n)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:function(n){var r;if(200!==n.statusCode||!n.json)return e([]);var i=n.json.surveys||[];return null===(r=t.instance.persistence)||void 0===r||r.register(c({},$r,i)),e(i)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((function(n){var r=n.filter((function(e){return!(!e.start_date||e.end_date)})).filter((function(e){var t,n,r,i;if(!e.conditions)return!0;var o=null===(t=e.conditions)||void 0===t||!t.url||ts[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),a=null===(i=e.conditions)||void 0===i||!i.selector||(null==rn?void 0:rn.querySelector(e.conditions.selector));return o&&a})).filter((function(e){if(!e.linked_flag_key&&!e.targeting_flag_key)return!0;var n=!e.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),r=!e.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key);return n&&r}));return e(r)}),n)}}]),e}(),rs=function(){function e(){var t=this;a(this,e),c(this,"limits",{}),c(this,"checkForLimiting",(function(e){var n=e.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach((function(e){fn.info("[RateLimiter] ".concat(e||"events"," is quota limited.")),t.limits[e]=(new Date).getTime()+6e4}))}catch(e){return void fn.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:n})}}))}return u(e,[{key:"isRateLimited",value:function(e){var t=this.limits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),is=function(){return t({initialPathName:(null==on?void 0:on.pathname)||"",referringDomain:Ao.referringDomain()},Ao.campaignParams())},os=function(){function e(t,n,r){var i=this;a(this,e),c(this,"_onSessionIdCallback",(function(e){var t=i._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:i._sessionSourceParamGenerator()};i._persistence.register(c({},Yr,n))}})),this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||is,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return u(e,[{key:"_getStoredProps",value:function(){return this._persistence.props[Yr]}},{key:"getSessionProps",value:function(){var e,t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}]),e}(),as=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"],ss=function(e,t){if(!e)return!1;var n=e.toLowerCase();return as.concat(t||[]).some((function(e){var t=e.toLowerCase();return n.includes?n.includes(t):-1!==n.indexOf(t)}))},us={},cs=function(){},ls="posthog",ds=!Pa&&-1===(null==cn?void 0:cn.indexOf("MSIE"))&&-1===(null==cn?void 0:cn.indexOf("Mozilla")),fs=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(t=null==rn?void 0:rn.location,n=null==t?void 0:t.hostname,!!Gt(n)&&"herokuapp.com"!==n.split(".").slice(-2).join(".")),persistence:"localStorage+cookie",persistence_name:"",cookie_name:"",loaded:cs,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:!0,debug:!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Jt||null===(e=Jt.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:function(e){var t="Bad HTTP status: "+e.statusCode+" "+e.text;fn.error(t)},get_device_id:function(e){return e},_onCapture:cs,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800}},ps=function(){function e(){a(this,e),c(this,"__forceAllowLocalhost",!1)}return u(e,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){fn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),e}(),hs=function(){function e(){var t=this;a(this,e),c(this,"webPerformance",new ps),this.config=fs(),this.decideEndpointWasHit=!1,this.SentryIntegration=Qa,this.segmentIntegration=function(){return function(e){Promise&&Promise.resolve||fn.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(t,n){t.event.userId||t.event.anonymousId===e.get_distinct_id()||e.reset(),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:t.event.userId}),e.reloadFeatureFlags());var r=e._calculate_event_properties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}}(t)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this.analyticsDefaultEndpoint="/e/",this.elementsChainAsString=!1,this.featureFlags=new ai(this),this.toolbar=new ea(this),this.pageViewManager=new Xa(this),this.surveys=new ns(this),this.rateLimiter=new rs,this.requestRouter=new Ja(this),this.people={set:function(e,n,r){var i=Gt(e)?c({},e,n):e;t.setPersonProperties(i),null==r||r({})},set_once:function(e,n,r){var i=Gt(e)?c({},e,n):e;t.setPersonProperties(void 0,i),null==r||r({})}}}return u(e,[{key:"init",value:function(t,n,r){if(r&&r!==ls){var i,o=null!==(i=us[r])&&void 0!==i?i:new e;return o._init(t,n,r),us[r]=o,us[ls][r]=o,o}return this._init(t,n,r)}},{key:"_init",value:function(e){var n,r,i,o=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;if(Ht(e)||function(e){return Gt(e)&&0===e.trim().length}(e))fn.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()");else{if(!this.__loaded){var u;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],a.request_headers=a.request_headers||a.xhr_headers,this.set_config(mn({},fs(),a,{name:s,token:e})),null!=Jt&&null!==(n=Jt.rrweb)&&void 0!==n&&n.record||null!=Jt&&Jt.rrwebRecord)this.__loaded_recorder_version=null==Jt||null===(u=Jt.rrweb)||void 0===u?void 0:u.version;if(this.compression=a.disable_compression?void 0:ei.Base64,this.persistence=new Fo(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new Fo(t(t({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new ta((function(e){return o._send_request(e)})),this._retryQueue=new Ka(this),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new Ya(this.config,this.persistence),this.sessionPropsManager=new os(this.sessionManager,this.persistence),this.sessionRecording=new Yo(this),this.sessionRecording.startRecordingIfEnabled(),this.config.disable_scroll_properties||this.pageViewManager.startMeasuringScrollPosition(),this.__autocapture=this.config.autocapture,ti._setIsAutocaptureEnabled(this),ti._isAutocaptureEnabled){this.__autocapture=this.config.autocapture;ti.enabledForProject(this.config.token,100,100)?ti.isBrowserSupported()?ti.init(this):(this.__autocapture=!1,fn.info("Disabling Automatic Event Collection because this browser is not supported")):(this.__autocapture=!1,fn.info("Not in active bucket: disabling Automatic Event Collection."))}if(Yt.DEBUG=Yt.DEBUG||this.config.debug,this._gdpr_init(),a.segment&&(this.config.get_device_id=function(){return a.segment.user().anonymousId()},a.segment.user().id()&&(this.register({distinct_id:a.segment.user().id()}),this.persistence.set_user_state("identified"))),void 0!==(null===(r=a.bootstrap)||void 0===r?void 0:r.distinctID)){var c,l,d=this.config.get_device_id(pi()),f=null!==(c=a.bootstrap)&&void 0!==c&&c.isIdentifiedID?d:a.bootstrap.distinctID;this.persistence.set_user_state(null!==(l=a.bootstrap)&&void 0!==l&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:f})}if(this._hasBootstrappedFeatureFlags()){var p,h,g=Object.keys((null===(p=a.bootstrap)||void 0===p?void 0:p.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=a.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,r;return e[t]=(null===(n=a.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),v=Object.keys((null===(h=a.bootstrap)||void 0===h?void 0:h.featureFlagPayloads)||{}).filter((function(e){return g[e]})).reduce((function(e,t){var n,r,i,o;null!==(n=a.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=a.bootstrap)||void 0===i||null===(o=i.featureFlagPayloads)||void 0===o?void 0:o[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:v})}if(!this.get_distinct_id()){var m=this.config.get_device_id(pi());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_user_state("anonymous")}return null==Jt||null===(i=Jt.addEventListener)||void 0===i||i.call(Jt,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),a.segment?a.segment.register(this.segmentIntegration()).then((function(){o._loaded()})):this._loaded(),this}fn.warn("You have already initialized PostHog! Re-initialising is a no-op")}}},{key:"_afterDecideResponse",value:function(e){var t;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=yn(e.supportedCompression,ei.GZipJS)?ei.GZipJS:yn(e.supportedCompression,ei.Base64)?ei.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),e.elementsChainAsString&&(this.elementsChainAsString=e.elementsChainAsString)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){fn.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((function(){rn&&e.capture("$pageview",{title:rn.title},{send_instantly:!0})}),1),t||(new Jo(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||gn(this.__request_queue,(function(t){return e._send_retriable_request(t)})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var n=this;this.__loaded&&(ds?this.__request_queue.push(e):this.rateLimiter.isRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=qa(e.url,{ip:this.config.ip?1:0}),e.headers=this.config.request_headers,e.compression="best-available"===e.compression?this.compression:e.compression,function(e){var n=t({},e);n.timeout=n.timeout||6e4,n.url=qa(n.url,{_:(new Date).getTime().toString(),ver:Yt.LIB_VERSION,compression:n.compression}),"sendBeacon"===n.transport&&null!=nn&&nn.sendBeacon?Ua(n):"fetch"===n.transport&&an?Ga(n):sn||!rn?Ha(n):ja(n)}(t(t({},e),{},{callback:function(t){var r,i,o;(n.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(i=(o=n.config).on_request_error)||void 0===i||i.call(o,t));null===(r=e.callback)||void 0===r||r.call(e,t)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];gn(e,(function(e){e&&(t=e[0],qt(t)?o.push(e):Wt(e)?e.call(n):qt(e)&&"alias"===t?r.push(e):qt(e)&&-1!==t.indexOf("capture")&&Wt(n[t])?o.push(e):i.push(e))}));var a=function(e,t){gn(e,(function(e){if(qt(e[0])){var n=t;vn(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};a(r,this),a(i,this),a(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,n,r){var i;if(!this.__loaded||!this.sessionPersistence||!this._requestQueue)return fn.uninitializedWarning("posthog.capture");if(!Go(this))if(!Ht(e)&&Gt(e)){if(!cn||this.config.opt_out_useragent_filter||!ss(cn,this.config.custom_blocked_useragents)){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info();var o={uuid:pi(),event:e,properties:this._calculate_event_properties(e,n||{})};"$identify"===e&&(o.$set=null==r?void 0:r.$set,o.$set_once=null==r?void 0:r.$set_once),(o=Cn(o,null!=r&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=(null==r?void 0:r.timestamp)||new Date,Ht(null==r?void 0:r.timestamp)||(o.properties.$event_time_override_provided=!0,o.properties.$event_time_override_system_time=new Date);var a=t(t({},o.properties.$set),o.$set);(function(e){if(Vt(e)){for(var t in e)if(Pt.call(e,t))return!1;return!0}return!1})(a)||this.setPersonPropertiesForFlags(a),fn.info("send",o);var s={method:"POST",url:null!==(i=null==r?void 0:r._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:o,compression:"best-available",batchKey:null==r?void 0:r._batchKey};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this._send_retriable_request(s):this._requestQueue.enqueue(s),this._invokeCaptureHooks(e,o),o}}else fn.error("No event name provided to posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,t){this.config._onCapture(e,t),vn(this.__captureHooks,(function(t){return t(e)}))}},{key:"_calculate_event_properties",value:function(e,n){if(!this.persistence||!this.sessionPersistence)return n;var r=this.persistence.remove_event_timer(e),i=t({},n);if(i.token=this.config.token,"$snapshot"===e){var o=t(t({},this.persistence.properties()),this.sessionPersistence.properties());return i.distinct_id=o.distinct_id,i}var a=Ao.properties();if(this.sessionManager){var s=this.sessionManager.checkAndGetSessionAndWindowId(),u=s.sessionId,c=s.windowId;i.$session_id=u,i.$window_id=c}if(this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){var l=this.sessionPropsManager.getSessionProps();i=mn(i,l)}if(!this.config.disable_scroll_properties){var d={};"$pageview"===e?d=this.pageViewManager.doPageView():"$pageleave"===e&&(d=this.pageViewManager.doPageLeave()),i=mn(i,d)}if("$pageview"===e&&rn&&(i.title=rn.title),"$performance_event"===e){var p=this.persistence.properties();return i.distinct_id=p.distinct_id,i.$current_url=a.$current_url,i}if(!Ht(r)){var h=(new Date).getTime()-r;i.$duration=parseFloat((h/1e3).toFixed(3))}(cn&&this.config.opt_out_useragent_filter&&(i.$browser_type=ss(cn,this.config.custom_blocked_useragents)?"bot":"browser"),i=mn({},Ao.properties(),this.persistence.properties(),this.sessionPersistence.properties(),i),qt(this.config.property_denylist)&&qt(this.config.property_blacklist))?vn([].concat(f(this.config.property_blacklist),f(this.config.property_denylist)),(function(e){delete i[e]})):fn.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;return g&&(i=g(i,e)),i}},{key:"register",value:function(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}},{key:"register_once",value:function(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}},{key:"register_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}},{key:"unregister",value:function(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(c({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"identify",value:function(e,t,n){if(!this.__loaded||!this.persistence)return fn.uninitializedWarning("posthog.identify");if($t(e)&&(e=e.toString(),fn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))fn.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else{var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(Or)&&(this.unregister(Or),this.register({distinct_id:e}));var o="anonymous"===this.persistence.get_user_state();e!==r&&o?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(Zr))}else fn.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,n,r){if(e&&n){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:t(t({},i),{},c({},e,n))}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags(c({},e,r))),i[e]===n||r||this.reloadFeatureFlags()}else fn.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,n,r,i;if(!this.__loaded)return fn.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(r=this.persistence)||void 0===r||r.set_user_state("anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId();var a=this.config.get_device_id(pi());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionId,r=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/replay/"+n);if(null!=e&&e.withTimestamp&&r){var o,a=null!==(o=e.timestampLookBack)&&void 0!==o?o:10;if(!r)return i;var s=Math.max(Math.floor(((new Date).getTime()-r)/1e3)-a,0);i+="?t=".concat(s)}return i}},{key:"alias",value:function(e,t){return e===this.get_property(Mr)?(fn.critical("Attempting to create alias for existing People user - aborting."),-2):(Ht(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Or,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(fn.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var n,r=t({},this.config);if(Vt(e)&&(mn(this.config,e),this.config.persistence_name||(this.config.persistence_name=this.config.cookie_name),this.config.disable_persistence||(this.config.disable_persistence=this.config.disable_cookie),null===(n=this.persistence)||void 0===n||n.update_config(this.config,r),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new Fo(t(t({},this.config),{},{persistence:"sessionStorage"})),wi.is_supported()&&"true"===wi.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(Yt.DEBUG=!0),this.sessionRecording&&!Ht(e.disable_session_recording))){var i=r.disable_session_recording!==e.disable_session_recording,o=!Go(this)&&!e.disable_session_recording&&!this.sessionRecording.started;(i||o)&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled())}}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:ls;return t!==ls&&(t=ls+"."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.config.opt_out_capturing_persistence_type&&wi.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.config.opt_out_capturing_by_default&&!bi.get("ph_optout")||(bi.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.config.opt_out_persistence_by_default}))}},{key:"_gdpr_update_persistence",value:function(e){var t,n,r,i,o;if(e&&e.clear_persistence)r=!0;else{if(!e||!e.enable_persistence)return;r=!1}this.config.disable_persistence||(null===(t=this.persistence)||void 0===t?void 0:t.disabled)===r||(null===(i=this.persistence)||void 0===i||i.set_disabled(r));this.config.disable_persistence||(null===(n=this.sessionPersistence)||void 0===n?void 0:n.disabled)===r||(null===(o=this.sessionPersistence)||void 0===o||o.set_disabled(r))}},{key:"_gdpr_call_func",value:function(e,t){return t=mn({capture:this.capture.bind(this),persistence_type:this.config.opt_out_capturing_persistence_type,cookie_prefix:this.config.opt_out_capturing_cookie_prefix,cookie_expiration:this.config.cookie_expiration,cross_subdomain_cookie:this.config.cross_subdomain_cookie,secure_cookie:this.config.secure_cookie},t||{}),wi.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.config.token,{capture:t.capture,captureEventName:t.capture_event_name,captureProperties:t.capture_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieExpiration:t.cookie_expiration,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=mn({enable_persistence:!0},e||{}),this._gdpr_call_func(No,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=mn({clear_persistence:!0},e||{});this._gdpr_call_func(Lo,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(Do,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(Po,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=mn({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Bo,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(null==Jt||Jt.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==Jt||Jt.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=wn(e.prototype[t[n]])}(hs,["identify"]);var gs,vs;gs=us[ls]=new hs,(vs=ln.posthog)&&vn(vs._i,(function(e){if(e&&qt(e)){var t=gs.init(e[0],e[1],e[2]),n=vs[e[2]]||vs;t&&(t._execute_array.call(t.people,n.people),t._execute_array(n))}})),ln.posthog=gs,function(){function e(){e.done||(e.done=!0,ds=!1,vn(us,(function(e){e._dom_loaded()})))}null!=rn&&rn.addEventListener&&("complete"===rn.readyState?e():rn.addEventListener("DOMContentLoaded",e,!1)),Jt&&An(Jt,"load",e,!0)}()}();
16
17
  //# sourceMappingURL=array.full.js.map