posthog-js 1.217.1 → 1.217.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.
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/src/web-experiments.js +1 -26
- package/lib/src/web-experiments.js.map +1 -1
- package/package.json +1 -1
package/dist/array.full.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?e(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(e,t,r,n,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,i)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var s=e.apply(t,n);function a(e){r(s,i,o,a,l,"next",e)}function l(e){r(s,i,o,a,l,"throw",e)}a(void 0)}))}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var s,a=["type"],l=Object.defineProperty,c=(e,t,r)=>((e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),u=Object.defineProperty,d=(e,t,r)=>((e,t,r)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),h=(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))(h||{}),p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},v={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var g={};function f(e){if(g[e])return g[e];var t=function(e){var t,r,n=null===globalThis||void 0===globalThis||null===(t=globalThis.Zone)||void 0===t||null===(r=t.__symbol__)||void 0===r?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in p?p[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in v?v[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return g[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?g[e]=c:t.prototype}catch(e){return t.prototype}}var m={};function _(e,t,r){var n,i="".concat(e,".").concat(String(r));if(m[i])return m[i].call(t);var o=f(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(m[i]=s,s.call(t)):t[r]}var y={};function b(e,t,r){var n="".concat(e,".").concat(String(r));if(y[n])return y[n].bind(t);var i=f(e)[r];return"function"!=typeof i?t[r]:(y[n]=i,i.bind(t))}var w={childNodes:function(e){return _("Node",e,"childNodes")},parentNode:function(e){return _("Node",e,"parentNode")},parentElement:function(e){return _("Node",e,"parentElement")},textContent:function(e){return _("Node",e,"textContent")},contains:function(e,t){return b("Node",e,"contains")(t)},getRootNode:function(e){return b("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?_("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?_("Element",e,"shadowRoot"):null},querySelector:function(e,t){return _("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return _("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return f("MutationObserver").constructor}};function S(e){return e.nodeType===e.ELEMENT_NODE}function C(e){var t=e&&"host"in e&&"mode"in e&&w.host(e)||null;return Boolean(t&&"shadowRoot"in t&&w.shadowRoot(t)===e)}function I(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function k(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=Array.from(t,(t=>E(t,e.href))).join("");return(n=r).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}catch(e){return null}var n}function E(e,t){if(function(e){return"styleSheet"in e}(e)){var r;try{r=k(e.styleSheet)||function(e){var{cssText:t}=e;if(t.split('"').length<3)return t;var r=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer(".concat(e.layerName,")")),e.supportsText&&r.push("supports(".concat(e.supportsText,")")),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){r=e.cssText}return e.styleSheet.href?B(r,e.styleSheet.href):r}var n,i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(n,"$1\\$2")),t?B(i,t):i}function x(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let T=class{constructor(){d(this,"idNodeMap",new Map),d(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function M(e){var{element:t,maskInputOptions:r,tagName:n,type:i,value:o,maskInputFn:s}=e,a=o||"",l=i&&R(i);return(r[n.toLowerCase()]||l&&r[l])&&(a=s?s(a,t):"*".repeat(a.length)),a}function R(e){return e.toLowerCase()}var A="__rrweb_original__";function N(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?R(t):null}function F(e,t){var r,n;try{n=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}var O=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,P=/^(?:[a-z+]+:)?\/\//i,L=/^www\..*/i,D=/^(data:)([^,]*),(.*)/i;function B(e,t){return(e||"").replace(O,((e,r,n,i,o,s)=>{var a,l=n||o||s,c=r||i||"";if(!l)return e;if(P.test(l)||L.test(l))return"url(".concat(c).concat(l).concat(c,")");if(D.test(l))return"url(".concat(c).concat(l).concat(c,")");if("/"===l[0])return"url(".concat(c).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)).concat(c,")");var u=t.split("/"),d=l.split("/");for(var h of(u.pop(),d))"."!==h&&(".."===h?u.pop():u.push(h));return"url(".concat(c).concat(u.join("/")).concat(c,")")}))}var q,H,$=1,W=new RegExp("[^a-z0-9-_:]"),V=-2;function Z(){return $++}var G=/^[^ \t\n\r\u000c]+/,j=/^[, \t\n\r\u000c]+/;var U=new WeakMap;function z(e,t){return t&&""!==t.trim()?X(e,t):t}function Y(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function X(e,t){var r=U.get(e);if(r||(r=e.createElement("a"),U.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function J(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?z(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,i=e.exec(t.substring(r));return i?(n=i[0],r+=n.length,n):""}for(var i=[];n(j),!(r>=t.length);){var o=n(G);if(","===o.slice(-1))o=z(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=z(e,o);for(var a=!1;;){var l=t.charAt(r);if(""===l){i.push((o+s).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,i.push((o+s).trim());break}"("===l&&(a=!0)}s+=l,r+=1}}}return i.join(", ")}(e,n):"style"===r?B(n,X(e)):"object"===t&&"data"===r?z(e,n):n:z(e,n):n}function K(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Q(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Q(w.parentNode(e),t,r);for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return!!r&&Q(w.parentNode(e),t,r)}function ee(e,t,r,n){var i;if(S(e)){if(i=e,!w.childNodes(i).length)return!1}else{if(null===w.parentElement(e))return!1;i=w.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest(".".concat(t)))return!0}else if(i.classList.contains(t))return!0}else if(Q(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}function te(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:f=!1}=t,m=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:h.Document,childNodes:[],compatMode:e.compatMode}:{type:h.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:m};case e.ELEMENT_NODE:return function(e,t){for(var r,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:d,keepIframeSrcFn:p,newlyAddedElement:v=!1,rootId:g}=t,f=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,i,o),m=function(e){if(e instanceof HTMLFormElement)return"form";var t=R(e.tagName);return W.test(t)?"div":t}(e),_={},y=e.attributes.length,b=0;b<y;b++){var S=e.attributes[b];K(m,S.name,S.value)||(_[S.name]=J(n,m,R(S.name),S.value))}if("link"===m&&s){var C=function(e){return null==e?void 0:e.href}(e);if(C){var I=x(n,C);if(!I&&C.includes(".css"))I=x(n,window.location.origin+"/"+C.replace(window.location.href,""));var E=null;I&&(E=k(I)),E&&(delete _.rel,delete _.href,_._cssText=E)}}if("style"===m&&e.sheet&&!(e.innerText||w.textContent(e)||"").trim().length){var T=k(e.sheet);T&&(_._cssText=T)}if("input"===m||"textarea"===m||"select"===m){var F=e.value,O=e.checked;"radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&F?_.value=M({element:e,type:N(e),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(_.checked=O)}"option"===m&&(e.selected&&!a.select?_.selected=!0:delete _.selected);if("dialog"===m&&e.open)try{_.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){_.rr_open_mode="modal",_.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var i=t.getImageData,o=A in i?i[A]:i;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(_.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var P=e.toDataURL(c.type,c.quality),L=n.createElement("canvas");L.width=e.width,L.height=e.height,P!==L.toDataURL(c.type,c.quality)&&(_.rr_dataURL=P)}if("img"===m&&u){q||(q=n.createElement("canvas"),H=q.getContext("2d"));var D=e,B=D.currentSrc||D.getAttribute("src")||"<unknown-src>",$=D.crossOrigin,V=()=>{D.removeEventListener("load",V);try{q.width=D.naturalWidth,q.height=D.naturalHeight,H.drawImage(D,0,0),_.rr_dataURL=q.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==D.crossOrigin)return D.crossOrigin="anonymous",void(D.complete&&0!==D.naturalWidth?V():D.addEventListener("load",V));console.warn("Cannot inline img src=".concat(B,"! Error: ").concat(e))}"anonymous"===D.crossOrigin&&($?_.crossOrigin=$:D.removeAttribute("crossorigin"))};D.complete&&0!==D.naturalWidth?V():D.addEventListener("load",V)}if("audio"===m||"video"===m){var Z=_;Z.rr_mediaState=e.paused?"paused":"played",Z.rr_mediaCurrentTime=e.currentTime,Z.rr_mediaPlaybackRate=e.playbackRate,Z.rr_mediaMuted=e.muted,Z.rr_mediaLoop=e.loop,Z.rr_mediaVolume=e.volume}v||(e.scrollLeft&&(_.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(_.rr_scrollTop=e.scrollTop));if(f){var{width:G,height:j}=e.getBoundingClientRect();_={class:_.class,rr_width:"".concat(G,"px"),rr_height:"".concat(j,"px")}}"iframe"!==m||p(_.src)||(e.contentDocument||(_.rr_src=_.src),delete _.src);try{customElements.get(m)&&(r=!0)}catch(e){}return{type:h.Element,tagName:m,attributes:_,childNodes:[],isSVG:Y(e)||void 0,needBlock:f,rootId:g,isCustom:r}}(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:f,rootId:m});case e.TEXT_NODE:return function(e,t){var r,{needsMask:n,maskTextFn:i,rootId:o}=t,s=w.parentNode(e),a=s&&s.tagName,l=w.textContent(e),c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;if(c&&l){try{e.nextSibling||e.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(l=k(s.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}l=B(l,X(t.doc))}u&&(l="SCRIPT_PLACEHOLDER");!c&&!u&&l&&n&&(l=i?i(l,w.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:h.Text,textContent:l||"",isStyle:c,rootId:o}}(e,{doc:r,needsMask:s,maskTextFn:c,rootId:m});case e.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case e.COMMENT_NODE:return{type:h.Comment,textContent:w.textContent(e)||"",rootId:m};default:return!1}}function re(e){return null==e?"":e.toLowerCase()}function ne(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g={},inlineImages:f=!1,recordCanvas:m=!1,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:T=!1}=t,{needsMask:M}=t,{preserveWhiteSpace:R=!0}=t;M||(M=ee(e,s,a,void 0===M));var A,N=te(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:g,inlineImages:f,recordCanvas:m,keepIframeSrcFn:x,newlyAddedElement:T});if(!N)return console.warn(e,"not serialized"),null;A=n.hasNode(e)?n.getId(e):!function(e,t){if(t.comment&&e.type===h.Comment)return!0;if(e.type===h.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&&"js"===F(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(re(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===re(e.attributes.name)||"icon"===re(e.attributes.rel)||"apple-touch-icon"===re(e.attributes.rel)||"shortcut icon"===re(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&re(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(re(e.attributes.property).match(/^(og|twitter|fb):/)||re(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===re(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===re(e.attributes.name)||"googlebot"===re(e.attributes.name)||"bingbot"===re(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===re(e.attributes.name)||"generator"===re(e.attributes.name)||"framework"===re(e.attributes.name)||"publisher"===re(e.attributes.name)||"progid"===re(e.attributes.name)||re(e.attributes.property).match(/^article:/)||re(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===re(e.attributes.name)||"yandex-verification"===re(e.attributes.name)||"csrf-token"===re(e.attributes.name)||"p:domain_verify"===re(e.attributes.name)||"verify-v1"===re(e.attributes.name)||"verification"===re(e.attributes.name)||"shopify-checkout-api-token"===re(e.attributes.name)))return!0}}return!1}(N,v)&&(R||N.type!==h.Text||N.isStyle||N.textContent.replace(/^\s+|\s+$/gm,"").length)?Z():V;var O=Object.assign(N,{id:A});if(n.add(e,O),A===V)return null;_&&_(e);var P=!l;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=w.shadowRoot(e);L&&I(L)&&(O.isShadowHost=!0)}if((O.type===h.Document||O.type===h.Element)&&P){v.headWhitespace&&O.type===h.Element&&"head"===O.tagName&&(R=!1);var D={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:R,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x};if(O.type===h.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(w.childNodes(e))){var q=ne(B,D);q&&O.childNodes.push(q)}var H=null;if(S(e)&&(H=w.shadowRoot(e)))for(var $ of Array.from(w.childNodes(H))){var W=ne($,D);W&&(I(H)&&(W.isShadow=!0),O.childNodes.push(W))}}var G=w.parentNode(e);return G&&C(G)&&I(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var i,o=!1;try{i=n.document.readyState}catch(e){return}if("complete"===i){var s="about:blank";if(n.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout((()=>{o||(t(),o=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(a),o=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&y){var r=ne(t,{doc:t,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:R,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x});r&&y(e,r)}}),b),O.type===h.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===F(O.attributes.href))&&function(e,t,r){var n,i=!1;try{n=e.sheet}catch(e){return}if(!n){var o=setTimeout((()=>{i||(t(),i=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(o),i=!0,t()}))}}(e,(()=>{if(k){var t=ne(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:R,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x});t&&k(e,t)}}),E),O}let ie=class e{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var oe={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},se={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var ae={};function le(e){if(ae[e])return ae[e];var t=function(e){var t,r,n=null===globalThis||void 0===globalThis||null===(t=globalThis.Zone)||void 0===t||null===(r=t.__symbol__)||void 0===r?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in oe?oe[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in se?se[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return ae[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?ae[e]=c:r}catch(e){return r}}var ce={};function ue(e,t,r){var n,i="".concat(e,".").concat(String(r));if(ce[i])return ce[i].call(t);var o=le(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(ce[i]=s,s.call(t)):t[r]}var de={};function he(e,t,r){var n="".concat(e,".").concat(String(r));if(de[n])return de[n].bind(t);var i=le(e)[r];return"function"!=typeof i?t[r]:(de[n]=i,i.bind(t))}function pe(){return le("MutationObserver").constructor}var ve={childNodes:function(e){return ue("Node",e,"childNodes")},parentNode:function(e){return ue("Node",e,"parentNode")},parentElement:function(e){return ue("Node",e,"parentElement")},textContent:function(e){return ue("Node",e,"textContent")},contains:function(e,t){return he("Node",e,"contains")(t)},getRootNode:function(e){return he("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ue("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ue("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ue("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ue("Element",e,"querySelectorAll")(t)},mutationObserver:pe};function ge(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var fe="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.",me={map:{},getId:()=>(console.error(fe),-1),getNode:()=>(console.error(fe),null),removeNodeFromMap(){console.error(fe)},has:()=>(console.error(fe),!1),reset(){console.error(fe)}};function _e(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=null,i=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var l=Date.now();i||!1!==r.leading||(i=l);var c=t-(l-i),u=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),i=l,e.apply(u,s)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(u,s)}),c))}}function ye(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>ye(e,t,o||{},!0)}function be(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(me=new Proxy(me,{get:(e,t,r)=>("map"===t&&console.error(fe),Reflect.get(e,t,r))}));var we=Date.now;function Se(e){var t,r,n,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=ve.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=ve.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function Ce(){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 ke(e){return e?e.nodeType===e.ELEMENT_NODE?e:ve.parentElement(e):null}function Ee(e,t,r,n){if(!e)return!1;var i=ke(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(Q(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function xe(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===V}function Te(e,t){if(C(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var n=ve.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Te(n,t))}function Me(e){return Boolean(e.changedTouches)}function Re(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ae(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ne(e){return!!e&&(e instanceof ie&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ve.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(we=()=>(new Date).getTime());let Fe=class{constructor(){c(this,"id",1),c(this,"styleIDMap",new WeakMap),c(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Oe(e){var t,r=null;return"getRootNode"in e&&(null==(t=ve.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ve.host(ve.getRootNode(e))&&(r=ve.host(ve.getRootNode(e))),r}function Pe(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Oe(r);)r=t;return r}(e);return ve.contains(t,r)}function Le(e){var t=e.ownerDocument;return!!t&&(ve.contains(t,e)||Pe(e))}var De=(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",e))(De||{}),Be=(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",e[e.CustomElement=16]="CustomElement",e))(Be||{}),qe=(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",e))(qe||{}),He=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(He||{}),$e=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))($e||{}),We=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(We||{});function Ve(e){return"__ln"in e}class Ze{constructor(){c(this,"length",0),c(this,"head",null),c(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ve(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Ve(e.nextSibling)&&e.nextSibling.__ln.previous){var 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;null===t.next&&(this.tail=t),this.length++}removeNode(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--)}}var Ge,je=(e,t)=>"".concat(e,"@").concat(t);class Ue{constructor(){c(this,"frozen",!1),c(this,"locked",!1),c(this,"texts",[]),c(this,"attributes",[]),c(this,"attributeMap",new WeakMap),c(this,"removes",[]),c(this,"mapRemoves",[]),c(this,"movedMap",{}),c(this,"addedSet",new Set),c(this,"movedSet",new Set),c(this,"droppedSet",new Set),c(this,"mutationCb"),c(this,"blockClass"),c(this,"blockSelector"),c(this,"maskTextClass"),c(this,"maskTextSelector"),c(this,"inlineStylesheet"),c(this,"maskInputOptions"),c(this,"maskTextFn"),c(this,"maskInputFn"),c(this,"keepIframeSrcFn"),c(this,"recordCanvas"),c(this,"inlineImages"),c(this,"slimDOMOptions"),c(this,"dataURLOptions"),c(this,"doc"),c(this,"mirror"),c(this,"iframeManager"),c(this,"stylesheetManager"),c(this,"shadowDomManager"),c(this,"canvasManager"),c(this,"processedNodeManager"),c(this,"unattachedDoc"),c(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),c(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new Ze,n=e=>{for(var t=e,r=V;r===V;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},i=i=>{var o=ve.parentNode(i);if(o&&Le(i)&&"TEXTAREA"!==o.tagName){var s=C(o)?this.mirror.getId(Oe(i)):this.mirror.getId(o),a=n(i);if(-1===s||-1===a)return r.addNode(i);var l=ne(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Re(e,this.mirror)&&this.iframeManager.addIframe(e),Ae(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ne(i)&&this.shadowDomManager.addShadowRoot(ve.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:s,nextId:a,node:l}),t.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)Ye(this.removes,o,this.mirror)&&!this.movedSet.has(ve.parentNode(o))||i(o);for(var s of this.addedSet)Xe(this.droppedSet,s)||Ye(this.removes,s,this.mirror)?Xe(this.movedSet,s)?i(s):this.droppedSet.add(s):i(s);for(var a=null;r.length;){var l=null;if(a){var c=this.mirror.getId(ve.parentNode(a.value)),u=n(a.value);-1!==c&&-1!==u&&(l=a)}if(!l)for(var d=r.tail;d;){var h=d;if(d=d.previous,h){var p=this.mirror.getId(ve.parentNode(h.value));if(-1===n(h.value))continue;if(-1!==p){l=h;break}var v=h.value,g=ve.parentNode(v);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var f=ve.host(g);if(-1!==this.mirror.getId(f)){l=h;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),i(l.value)}var m={texts:this.texts.map((e=>{var t=e.node,r=ve.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(m))}})),c(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(ve.childNodes(e),(e=>ve.textContent(e)||"")).join("")})),c(this,"processMutation",(e=>{if(!xe(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=ve.textContent(e.target);Ee(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ee(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,ke(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,n=e.attributeName,i=e.target.getAttribute(n);if("value"===n){var o=N(r);i=M({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(Ee(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;var s=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(r.contentDocument)return;n="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),"type"===n&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!K(r.tagName,n))if(s.attributes[n]=J(this.doc,R(r.tagName),R(n),i),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(e.oldValue&&a.setAttribute("style",e.oldValue),Array.from(r.style))){var c=r.style.getPropertyValue(l),u=r.style.getPropertyPriority(l);c!==a.style.getPropertyValue(l)||u!==a.style.getPropertyPriority(l)?s.styleDiff[l]=""===u?c:[c,u]:s._unchangedStyles[l]=[c,u]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(s.styleDiff[d]=!1)}else"open"===n&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(Ee(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),n=C(e.target)?this.mirror.getId(ve.host(e.target)):this.mirror.getId(e.target);Ee(e.target,this.blockClass,this.blockSelector,!1)||xe(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(ze(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Te(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[je(r,n)]?ze(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:!(!C(e.target)||!I(e.target))||void 0})),this.mapRemoves.push(t))}))}})),c(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(xe(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[je(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ee(e,this.blockClass,this.blockSelector,!1)||(ve.childNodes(e).forEach((e=>this.genAdds(e))),Ne(e)&&ve.childNodes(ve.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ze(e,t){e.delete(t),ve.childNodes(t).forEach((t=>ze(e,t)))}function Ye(e,t,r){return 0!==e.length&&function(e,t,r){var n=ve.parentNode(t),i=function(){var t=r.getId(n);if(e.some((e=>e.id===t)))return{v:!0};n=ve.parentNode(n)};for(;n;){var o=i();if("object"==typeof o)return o.v}return!1}(e,t,r)}function Xe(e,t){return 0!==e.size&&Je(e,t)}function Je(e,t){var r=ve.parentNode(t);return!!r&&(!!e.has(r)||Je(e,r))}var Ke=e=>{if(!Ge)return e;return function(){try{return e(...arguments)}catch(e){if(Ge&&!0===Ge(e))return;throw e}}},Qe=[];function et(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 tt(e,t){var r=new Ue;Qe.push(r),r.init(e);var n=new(pe())(Ke(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function rt(e){var{mouseInteractionCb:r,doc:n,mirror:i,blockClass:o,blockSelector:s,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,c=[],u=null;return Object.keys(qe).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=R(e),l=(e=>n=>{var a=et(n);if(!Ee(a,o,s,!0)){var l=null,c=e;if("pointerType"in n){switch(n.pointerType){case"mouse":l=He.Mouse;break;case"touch":l=He.Touch;break;case"pen":l=He.Pen}l===He.Touch?qe[e]===qe.MouseDown?c="TouchStart":qe[e]===qe.MouseUp&&(c="TouchEnd"):He.Pen}else Me(n)&&(l=He.Touch);null!==l?(u=l,(c.startsWith("Touch")&&l===He.Touch||c.startsWith("Mouse")&&l===He.Mouse)&&(l=null)):qe[e]===qe.Click&&(l=u,u=null);var d=Me(n)?n.changedTouches[0]:n;if(d){var h=i.getId(a),{clientX:p,clientY:v}=d;Ke(r)(t({type:qe[c],id:h,x:p,y:v},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(qe[e]){case qe.MouseDown:case qe.MouseUp:a=a.replace("mouse","pointer");break;case qe.TouchStart:case qe.TouchEnd:return}c.push(ge(a,l,n))})),Ke((()=>{c.forEach((e=>e()))}))}function nt(e){var{scrollCb:t,doc:r,mirror:n,blockClass:i,blockSelector:o,sampling:s}=e;return ge("scroll",Ke(_e(Ke((e=>{var s=et(e);if(s&&!Ee(s,i,o,!0)){var a=n.getId(s);if(s===r&&r.defaultView){var l=Se(r.defaultView);t({id:a,x:l.left,y:l.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var it=["INPUT","TEXTAREA","SELECT"],ot=new WeakMap;function st(e){return function(e,t){if(ut("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ut("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ut("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ut("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function at(e,t,r){var n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function lt(e,t){var r,n,i,{mirror:o,stylesheetManager:s}=e,a=null;a="#document"===t.nodeName?o.getId(t):o.getId(ve.host(t));var l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.ShadowRoot,c=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var t,r=null==(t=c.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{s.adoptStyleSheets(e,a)}catch(e){}return r}}),Ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function ct(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.doc.defaultView;if(!i)return()=>{};!function(e,t){var{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:v}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),n(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),i(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),o(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),s(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),c(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),u(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),v(...arguments)}}(e,n),e.recordDOM&&(r=tt(e,e.doc));var o=function(e){var{mousemoveCb:t,sampling:r,doc:n,mirror:i}=e;if(!1===r.mousemove)return()=>{};var o,s="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],c=_e(Ke((e=>{var r=Date.now()-o;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],o=null})),a),u=Ke(_e(Ke((e=>{var t=et(e),{clientX:r,clientY:n}=Me(e)?e.changedTouches[0]:e;o||(o=we()),l.push({x:r,y:n,id:i.getId(t),timeOffset:we()-o}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?Be.Drag:e instanceof MouseEvent?Be.MouseMove:Be.TouchMove)})),s,{trailing:!1})),d=[ge("mousemove",u,n),ge("touchmove",u,n),ge("drag",u,n)];return Ke((()=>{d.forEach((e=>e()))}))}(e),s=rt(e),a=nt(e),l=function(e,t){var{viewportResizeCb:r}=e,{win:n}=t,i=-1,o=-1;return ge("resize",Ke(_e(Ke((()=>{var e=Ce(),t=Ie();i===e&&o===t||(r({width:Number(t),height:Number(e)}),i=e,o=t)})),200)),n)}(e,{win:i}),c=function(e){var{inputCb:r,doc:n,mirror:i,blockClass:o,blockSelector:s,ignoreClass:a,ignoreSelector:l,maskInputOptions:c,maskInputFn:u,sampling:d,userTriggeredOnInput:h}=e;function p(e){var t=et(e),r=e.isTrusted,i=t&&t.tagName;if(t&&"OPTION"===i&&(t=ve.parentElement(t)),t&&i&&!(it.indexOf(i)<0)&&!Ee(t,o,s,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var d=t.value,p=!1,g=N(t)||"";"radio"===g||"checkbox"===g?p=t.checked:(c[i.toLowerCase()]||c[g])&&(d=M({element:t,maskInputOptions:c,tagName:i,type:g,value:d,maskInputFn:u})),v(t,h?{text:d,isChecked:p,userTriggered:r}:{text:d,isChecked:p});var f=t.name;"radio"===g&&f&&p&&n.querySelectorAll('input[type="radio"][name="'.concat(f,'"]')).forEach((e=>{if(e!==t){var r=e.value;v(e,h?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}function v(e,n){var o=ot.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){ot.set(e,n);var s=i.getId(e);Ke(r)(t(t({},n),{},{id:s}))}}var g=("last"===d.input?["change"]:["input","change"]).map((e=>ge(e,Ke(p),n))),f=n.defaultView;if(!f)return()=>{g.forEach((e=>e()))};var m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),_=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&g.push(..._.map((e=>ye(e[0],e[1],{set(){Ke(p)({target:this,isTrusted:!1})}},!1,f)))),Ke((()=>{g.forEach((e=>e()))}))}(e),u=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:n,mirror:i,sampling:o,doc:s}=e,a=Ke((e=>_e(Ke((o=>{var s=et(o);if(s&&!Ee(s,r,n,!0)){var{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=s;t({type:e,id:i.getId(s),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})}})),o.media||500))),l=[ge("play",a(We.Play),s),ge("pause",a(We.Pause),s),ge("seeked",a(We.Seeked),s),ge("volumechange",a(We.VolumeChange),s),ge("ratechange",a(We.RateChange),s)];return Ke((()=>{l.forEach((e=>e()))}))}(e),d=()=>{},h=()=>{},p=()=>{},v=()=>{};e.recordDOM&&(d=function(e,t){var{styleSheetRuleCb:r,mirror:n,stylesheetManager:i}=e,{win:o}=t;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Ke(((e,t,o)=>{var[s,a]=o,{id:l,styleId:c}=at(t,n,i.styleMirror);return(l&&-1!==l||c&&-1!==c)&&r({id:l,styleId:c,adds:[{rule:s,index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.addRule=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.cssRules.length,n="".concat(e," { ").concat(t," }");return o.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};var a,l,c=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t,n,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:s}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t,n,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replace:s}),e.apply(t,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(l=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t,n,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:s}),e.apply(t,o)}))}));var u={};dt("CSSGroupingRule")?u.CSSGroupingRule=o.CSSGroupingRule:(dt("CSSMediaRule")&&(u.CSSMediaRule=o.CSSMediaRule),dt("CSSConditionRule")&&(u.CSSConditionRule=o.CSSConditionRule),dt("CSSSupportsRule")&&(u.CSSSupportsRule=o.CSSSupportsRule));var d={};return Object.entries(u).forEach((e=>{var[t,o]=e;d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ke(((e,t,o)=>{var[s,a]=o,{id:l,styleId:c}=at(t.parentStyleSheet,n,i.styleMirror);return(l&&-1!==l||c&&-1!==c)&&r({id:l,styleId:c,adds:[{rule:s,index:[...st(t),a||0]}]}),e.apply(t,o)}))}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t.parentStyleSheet,n,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...st(t),s]}]}),e.apply(t,o)}))})})),Ke((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=c,a&&(o.CSSStyleSheet.prototype.replace=a),l&&(o.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach((e=>{var[t,r]=e;r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:i}),h=lt(e,e.doc),p=function(e,t){var{styleDeclarationCb:r,mirror:n,ignoreCSSAttributes:i,stylesheetManager:o}=e,{win:s}=t,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ke(((e,t,s)=>{var l,[c,u,d]=s;if(i.has(c))return a.apply(t,[c,u,d]);var{id:h,styleId:p}=at(null==(l=t.parentRule)?void 0:l.parentStyleSheet,n,o.styleMirror);return(h&&-1!==h||p&&-1!==p)&&r({id:h,styleId:p,set:{property:c,value:u,priority:d},index:st(t.parentRule)}),e.apply(t,s)}))});var l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ke(((e,t,s)=>{var a,[c]=s;if(i.has(c))return l.apply(t,[c]);var{id:u,styleId:d}=at(null==(a=t.parentRule)?void 0:a.parentStyleSheet,n,o.styleMirror);return(u&&-1!==u||d&&-1!==d)&&r({id:u,styleId:d,remove:{property:c},index:st(t.parentRule)}),e.apply(t,s)}))}),Ke((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:i}),e.collectFonts&&(v=function(e){var{fontCb:t,doc:r}=e,n=r.defaultView;if(!n)return()=>{};var i=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(e,t,r){var n=new s(e,t,r);return o.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var a=be(r.fonts,"add",(function(e){return function(r){return setTimeout(Ke((()=>{var e=o.get(r);e&&(t(e),o.delete(r))})),0),e.apply(this,[r])}}));return i.push((()=>{n.FontFace=s})),i.push(a),Ke((()=>{i.forEach((e=>e()))}))}(e)));var g=function(e){var{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e,s=!0,a=Ke((()=>{var e=t.getSelection();if(!(!e||s&&(null==e?void 0:e.isCollapsed))){s=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,c=0;c<l;c++){var u=e.getRangeAt(c),{startContainer:d,startOffset:h,endContainer:p,endOffset:v}=u;Ee(d,n,i,!0)||Ee(p,n,i,!0)||a.push({start:r.getId(d),startOffset:h,end:r.getId(p),endOffset:v})}o({ranges:a})}}));return a(),ge("selectionchange",a)}(e),f=function(e){var{doc:t,customElementCb:r}=e,n=t.defaultView;if(!n||!n.customElements)return()=>{};var i=be(n.customElements,"define",(function(e){return function(t,n,i){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return e.apply(this,[t,n,i])}}));return i}(e),m=[];for(var _ of e.plugins)m.push(_.observer(_.callback,i,_.options));return Ke((()=>{Qe.forEach((e=>e.reset())),null==r||r.disconnect(),o(),s(),a(),l(),c(),u(),d(),h(),p(),v(),g(),f(),m.forEach((e=>e()))}))}function ut(e){return void 0!==window[e]}function dt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class ht{constructor(e){c(this,"iframeIdToRemoteIdMap",new WeakMap),c(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){var i=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e),s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){var r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){var n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var i=n.get(t);return i||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class pt{constructor(e){c(this,"iframes",new WeakMap),c(this,"crossOriginIframeMap",new WeakMap),c(this,"crossOriginIframeMirror",new ht(Z)),c(this,"crossOriginIframeStyleMirror"),c(this,"crossOriginIframeRootIdMap",new WeakMap),c(this,"mirror"),c(this,"mutationCb"),c(this,"wrappedEmit"),c(this,"loadListener"),c(this,"stylesheetManager"),c(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ht(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||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))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case De.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:De.IncrementalSnapshot,data:{source:Be.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case De.Meta:case De.Load:case De.DomContentLoaded:return!1;case De.Plugin:return t;case De.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case De.IncrementalSnapshot:switch(t.data.source){case Be.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Be.Drag:case Be.TouchMove:case Be.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Be.ViewportResize:return!1;case Be.MediaInteraction:case Be.MouseInteraction:case Be.Scroll:case Be.CanvasMutation:case Be.Input:return this.replaceIds(t.data,e,["id"]),t;case Be.StyleSheetRule:case Be.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Be.Font:return t;case Be.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Be.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(var i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===h.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class vt{constructor(e){c(this,"shadowDoms",new WeakSet),c(this,"mutationCb"),c(this,"scrollCb"),c(this,"bypassOptions"),c(this,"mirror"),c(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,r){if(I(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var n=tt(t(t({},this.bypassOptions),{},{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(nt(t(t({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(ve.host(e))),this.restoreHandlers.push(lt({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push(be(e.prototype,"attachShadow",(function(e){return function(n){var i=e.call(this,n),o=ve.shadowRoot(this);return o&&Le(this)&&r.addShadowRoot(o,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ft="undefined"==typeof Uint8Array?[]:new Uint8Array(256),mt=0;mt<64;mt++)ft[gt.charCodeAt(mt)]=mt;var _t=new Map;var yt=(e,t,r)=>{if(e&&(St(e,t)||"object"==typeof e)){var n=function(e,t){var r=_t.get(e);return r||(r=new Map,_t.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i}};function bt(e,t,r){if(e instanceof Array)return e.map((e=>bt(e,t,r)));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)return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;t<n;t+=3)i+=gt[r[t]>>2],i+=gt[(3&r[t])<<4|r[t+1]>>4],i+=gt[(15&r[t+1])<<2|r[t+2]>>6],i+=gt[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[bt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[bt(e.data,t,r),e.width,e.height]}:St(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:yt(e,t,r)}:e}var wt=(e,t,r)=>e.map((e=>bt(e,t,r))),St=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function Ct(e,t,r,n){var i=[];try{var o=be(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!Ee(this,t,r,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=l),n&&["webgl","webgl2"].includes(l))if(s[0]&&"object"==typeof s[0]){var c=s[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...s])}}));i.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((e=>e()))}}function It(e,t,r,n,i,o){var s=[],a=Object.getOwnPropertyNames(e),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return"continue";try{if("function"!=typeof e[a])return"continue";var l=be(e,a,(function(e){return function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];var u=e.apply(this,l);if(yt(u,o,this),"tagName"in this.canvas&&!Ee(this.canvas,n,i,!0)){var d=wt(l,o,this),h={type:t,property:a,args:d};r(this.canvas,h)}return u}}));s.push(l)}catch(n){var c=ye(e,a,{set(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});s.push(c)}};for(var c of a)l(c);return s}var kt,Et,xt,Tt,Mt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Rt="undefined"!=typeof window&&window.Blob&&new Blob([(kt=Mt,Uint8Array.from(atob(kt),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function At(e){var t;try{if(!(t=Rt&&(window.URL||window.webkitURL).createObjectURL(Rt)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;base64,"+Mt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Nt{constructor(e){c(this,"pendingCanvasMutations",new Map),c(this,"rafStamps",{latestId:0,invokeId:null}),c(this,"mirror"),c(this,"mutationCb"),c(this,"resetObservers"),c(this,"frozen",!1),c(this,"locked",!1),c(this,"processMutation",((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)}));var{sampling:t="all",win:r,blockClass:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,o){var s=this,a=Ct(t,r,i,!0),l=new Map,c=new At;c.onmessage=e=>{var{id:t}=e.data;if(l.set(t,!1),"base64"in e.data){var{base64:r,type:n,width:i,height:o}=e.data;this.mutationCb({id:t,type:$e["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})}};var u,d=1e3/e,h=0,p=e=>{var a,v;h&&e-h<d?u=requestAnimationFrame(p):(h=e,(a=[],v=e=>{e.querySelectorAll("canvas").forEach((e=>{Ee(e,r,i,!0)||a.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&v(e.shadowRoot)}))},v(t.document),a).forEach(function(){var e=n((function*(e){var t,r=s.mirror.getId(e);if(!l.get(r)&&0!==e.width&&0!==e.height){if(l.set(r,!0),["webgl","webgl2"].includes(e.__context)){var n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var i=e.clientWidth||e.width,a=e.clientHeight||e.height,u=yield createImageBitmap(e,{resizeWidth:i,resizeHeight:a});c.postMessage({id:r,bitmap:u,width:i,height:a,dataURLOptions:o.dataURLOptions},[u])}}));return function(t){return e.apply(this,arguments)}}()),u=requestAnimationFrame(p))};u=requestAnimationFrame(p),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Ct(e,t,r,!1),i=function(e,t,r,n){var i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return"continue";var s=be(t.CanvasRenderingContext2D.prototype,o,(function(i){return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return Ee(this.canvas,r,n,!0)||setTimeout((()=>{var r=wt(a,t,this);e(this.canvas,{type:$e["2D"],property:o,args:r})}),0),i.apply(this,a)}}));i.push(s)}catch(r){var a=ye(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:$e["2D"],property:o,args:[t],setter:!0})}});i.push(a)}};for(var a of o)s(a);return()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){var i=[];return i.push(...It(t.WebGLRenderingContext.prototype,$e.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...It(t.WebGL2RenderingContext.prototype,$e.WebGL2,e,r,n,t)),()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>o(e,a))),{type:i}=r[0];this.mutationCb({id:t,type:i,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class Ft{constructor(e){c(this,"trackedLinkElements",new WeakSet),c(this,"mutationCb"),c(this,"adoptedStyleSheetCb"),c(this,"styleMirror",new Fe),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var n={id:t,styleIds:[]},i=[],o=function(e){var t=void 0;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),i.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:E(t,e.href),index:r})))})),n.styleIds.push(t)};for(var s of e)o(s);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Ot{constructor(){c(this,"nodeMap",new WeakMap),c(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Pt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Lt=document.createElement("iframe");document.body.appendChild(Lt),Array.from=(null==(s=Lt.contentWindow)?void 0:s.Array.from)||Array.from,document.body.removeChild(Lt)}}catch(e){console.debug("Unable to override Array.from",e)}var Dt,Bt,qt=new T;function Ht(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{emit:r,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:c="rr-mask",maskTextSelector:u=null,inlineStylesheet:d=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:v,maskInputFn:g,maskTextFn:f,hooks:m,packFn:_,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:x=!1,inlineImages:M=!1,plugins:R,keepIframeSrcFn:A=(()=>!1),ignoreCSSAttributes:N=new Set([]),errorHandler:F}=e;Ge=F;var O=!I||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(e){P=!0}if(O&&!r)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),qt.reset();var L,D=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},B=!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===v,headMetaDescKeywords:"all"===v,headTitleMutations:"all"===v}:v||{};!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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)}();var q=0,H=e=>{for(var t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!P&&(e=_(e)),e};Et=(e,t)=>{var o,s=e;if(s.timestamp=we(),!(null==(o=Qe[0])?void 0:o.isFrozen())||s.type===De.FullSnapshot||s.type===De.IncrementalSnapshot&&s.data.source===Be.Mutation||Qe.forEach((e=>e.unfreeze())),O)null==r||r(H(s),t);else if(P){var a={type:"rrweb",event:H(s),origin:window.location.origin,isCheckout:t};window.parent.postMessage(a,"*")}if(s.type===De.FullSnapshot)L=s,q=0;else if(s.type===De.IncrementalSnapshot){if(s.data.source===Be.Mutation&&s.data.isAttachIframe)return;q++;var l=i&&q>=i,c=n&&s.timestamp-L.timestamp>n;(l||c)&&xt(!0)}};var $=e=>{Et({type:De.IncrementalSnapshot,data:t({source:Be.Mutation},e)})},W=e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.Scroll},e)}),V=e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.CanvasMutation},e)}),Z=new Ft({mutationCb:$,adoptedStyleSheetCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.AdoptedStyleSheet},e)})}),G=new pt({mirror:qt,mutationCb:$,stylesheetManager:Z,recordCrossOriginIframes:I,wrappedEmit:Et});for(var j of R||[])j.getMirror&&j.getMirror({nodeMirror:qt,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var U=new Ot;Tt=new Nt({recordCanvas:C,mutationCb:V,win:window,blockClass:o,blockSelector:s,mirror:qt,sampling:y.canvas,dataURLOptions:b});var z=new vt({mutationCb:$,scrollCb:W,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:u,inlineStylesheet:d,maskInputOptions:D,dataURLOptions:b,maskTextFn:f,maskInputFn:g,recordCanvas:C,inlineImages:M,sampling:y,slimDOMOptions:B,iframeManager:G,stylesheetManager:Z,canvasManager:Tt,keepIframeSrcFn:A,processedNodeManager:U},mirror:qt});xt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(S){Et({type:De.Meta,data:{href:window.location.href,width:Ie(),height:Ce()}},e),Z.reset(),z.init(),Qe.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new T,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:h,slimDOM:p=!1,dataURLOptions:v,preserveWhiteSpace:g,onSerialize:f,onIframeLoad:m,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w=(()=>!1)}=t||{};return ne(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:v,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:f,onIframeLoad:m,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w,newlyAddedElement:!1})}(document,{mirror:qt,blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:u,inlineStylesheet:d,maskAllInputs:D,maskTextFn:f,maskInputFn:g,slimDOM:B,dataURLOptions:b,recordCanvas:C,inlineImages:M,onSerialize:e=>{Re(e,qt)&&G.addIframe(e),Ae(e,qt)&&Z.trackLinkElement(e),Ne(e)&&z.addShadowRoot(ve.shadowRoot(e),document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Z.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");Et({type:De.FullSnapshot,data:{node:t,initialOffset:Se(window)}},e),Qe.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Z.adoptStyleSheets(document.adoptedStyleSheets,qt.getId(document))}};try{var Y=[],X=e=>{var r;return Ke(ct)({mutationCb:$,mousemoveCb:(e,t)=>Et({type:De.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.MouseInteraction},e)}),scrollCb:W,viewportResizeCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.ViewportResize},e)}),inputCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.Input},e)}),mediaInteractionCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.MediaInteraction},e)}),styleSheetRuleCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.StyleSheetRule},e)}),styleDeclarationCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.StyleDeclaration},e)}),canvasMutationCb:V,fontCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.Font},e)}),selectionCb:e=>{Et({type:De.IncrementalSnapshot,data:t({source:Be.Selection},e)})},customElementCb:e=>{Et({type:De.IncrementalSnapshot,data:t({source:Be.CustomElement},e)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:c,maskTextSelector:u,maskInputOptions:D,inlineStylesheet:d,sampling:y,recordDOM:S,recordCanvas:C,inlineImages:M,userTriggeredOnInput:E,collectFonts:x,doc:e,maskInputFn:g,maskTextFn:f,keepIframeSrcFn:A,blockSelector:s,slimDOMOptions:B,dataURLOptions:b,mirror:qt,iframeManager:G,stylesheetManager:Z,shadowDomManager:z,processedNodeManager:U,canvasManager:Tt,ignoreCSSAttributes:N,plugins:(null==(r=null==R?void 0:R.filter((e=>e.observer)))?void 0:r.map((e=>({observer:e.observer,options:e.options,callback:t=>Et({type:De.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};G.addLoadListener((e=>{try{Y.push(X(e.contentDocument))}catch(e){console.warn(e)}}));var J=()=>{xt(),Y.push(X(document)),Pt=!0};return"interactive"===document.readyState||"complete"===document.readyState?J():(Y.push(ge("DOMContentLoaded",(()=>{Et({type:De.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&J()}))),Y.push(ge("load",(()=>{Et({type:De.Load,data:{}}),"load"===k&&J()}),window))),()=>{Y.forEach((e=>e())),U.destroy(),Pt=!1,Ge=void 0}}catch(e){console.warn(e)}}Ht.addCustomEvent=(e,t)=>{if(!Pt)throw new Error("please add custom event after start recording");Et({type:De.Custom,data:{tag:e,payload:t}})},Ht.freezePage=()=>{Qe.forEach((e=>e.freeze()))},Ht.takeFullSnapshot=e=>{if(!Pt)throw new Error("please take full snapshot after start recording");xt(e)},Ht.mirror=qt,(Bt=Dt||(Dt={}))[Bt.NotStarted=0]="NotStarted",Bt[Bt.Running=1]="Running",Bt[Bt.Stopped=2]="Stopped";var $t,Wt=Object.defineProperty,Vt=(e,t,r)=>((e,t,r)=>t in e?Wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Zt=Object.defineProperty,Gt=(e,t,r)=>((e,t,r)=>t in e?Zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),jt=Object.defineProperty,Ut=(e,t,r)=>((e,t,r)=>t in e?jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),zt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Yt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Xt={};function Jt(e){if(Xt[e])return Xt[e];var t=globalThis[e],r=t.prototype,n=e in zt?zt[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in Yt?Yt[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return Xt[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?Xt[e]=c:r}catch(e){return r}}var Kt={};function Qt(e,t,r){var n,i="".concat(e,".").concat(String(r));if(Kt[i])return Kt[i].call(t);var o=Jt(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Kt[i]=s,s.call(t)):t[r]}var er={};function tr(e,t,r){var n="".concat(e,".").concat(String(r));if(er[n])return er[n].bind(t);var i=Jt(e)[r];return"function"!=typeof i?t[r]:(er[n]=i,i.bind(t))}var rr={childNodes:function(e){return Qt("Node",e,"childNodes")},parentNode:function(e){return Qt("Node",e,"parentNode")},parentElement:function(e){return Qt("Node",e,"parentElement")},textContent:function(e){return Qt("Node",e,"textContent")},contains:function(e,t){return tr("Node",e,"contains")(t)},getRootNode:function(e){return tr("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Qt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Qt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Qt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Qt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Jt("MutationObserver").constructor}};class nr{constructor(){Ut(this,"idNodeMap",new Map),Ut(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ir(rr.parentNode(e),t,r);for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return!!r&&ir(rr.parentNode(e),t,r)}class or{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof or))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var sr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ar={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},lr={};function cr(e){if(lr[e])return lr[e];var t=globalThis[e],r=t.prototype,n=e in sr?sr[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in ar?ar[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return lr[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?lr[e]=c:r}catch(e){return r}}var ur={};function dr(e,t,r){var n,i="".concat(e,".").concat(String(r));if(ur[i])return ur[i].call(t);var o=cr(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(ur[i]=s,s.call(t)):t[r]}var hr={};function pr(e,t,r){var n="".concat(e,".").concat(String(r));if(hr[n])return hr[n].bind(t);var i=cr(e)[r];return"function"!=typeof i?t[r]:(hr[n]=i,i.bind(t))}var vr={childNodes:function(e){return dr("Node",e,"childNodes")},parentNode:function(e){return dr("Node",e,"parentNode")},parentElement:function(e){return dr("Node",e,"parentElement")},textContent:function(e){return dr("Node",e,"textContent")},contains:function(e,t){return pr("Node",e,"contains")(t)},getRootNode:function(e){return pr("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?dr("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?dr("Element",e,"shadowRoot"):null},querySelector:function(e,t){return dr("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return dr("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return cr("MutationObserver").constructor}};var gr="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.",fr={map:{},getId:()=>(console.error(gr),-1),getNode:()=>(console.error(gr),null),removeNodeFromMap(){console.error(gr)},has:()=>(console.error(gr),!1),reset(){console.error(gr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(fr=new Proxy(fr,{get:(e,t,r)=>("map"===t&&console.error(gr),Reflect.get(e,t,r))}));var mr=Date.now;function _r(e){return e?e.nodeType===e.ELEMENT_NODE?e:vr.parentElement(e):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(mr=()=>(new Date).getTime());function yr(e){var t,r=null;return"getRootNode"in e&&(null==(t=vr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vr.host(vr.getRootNode(e))&&(r=vr.host(vr.getRootNode(e))),r}function br(e){for(var t,r=e;t=yr(r);)r=t;return r}function wr(e){var t=e.ownerDocument;if(!t)return!1;var r=br(e);return vr.contains(t,r)}for(var Sr=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Gt(this,"id",1),Gt(this,"styleIDMap",new WeakMap),Gt(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return fr},closestElementOfNode:_r,getBaseDimension:function e(t,r){var n,i,o=null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=e(o,r),l=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){var n=t[r[0]];return 1===r.length?n:e(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:br,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,n,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=vr.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=vr.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof or&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(vr.shadowRoot(e)))},hookSetter:function e(t,r,n,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,s=o.Object.getOwnPropertyDescriptor(t,r);return o.Object.defineProperty(t,r,i?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>e(t,r,s||{},!0)},inDom:function(e){var t=e.ownerDocument;return!!t&&(vr.contains(t,e)||wr(e))},isAncestorRemoved:function e(t,r){if(i=(n=t)&&"host"in n&&"mode"in n&&rr.host(n)||null,Boolean(i&&"shadowRoot"in i&&rr.shadowRoot(i)===n))return!1;var n,i,o=r.getId(t);if(!r.has(o))return!0;var s=vr.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r))},isBlocked:function(e,t,r,n){if(!e)return!1;var i=_r(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(ir(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(var n=t.children.length-1;n>=0;n--)e(t.children[n],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return mr},on:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)},patch:function(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}},polyfill:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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)},queueToResolveTrees:function(e){var t={},r=(e,r)=>{var n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(var i of e){var{nextId:o,parentId:s}=i;if(o&&o in t){var a=t[o];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,r(i,a.parent))}else{var c=n.indexOf(a);n.splice(c,0,r(i,null))}}else if(s in t){var u=t[s];u.children.push(r(i,u))}else n.push(r(i,null))}return n},shadowHostInDom:wr,throttle:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=null,i=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var l=Date.now();i||!1!==r.leading||(i=l);var c=t-(l-i),u=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),i=l,e.apply(u,s)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(u,s)}),c))}},uniqueTextMutations:function(e){for(var t=new Set,r=[],n=e.length;n--;){var i=e[n];t.has(i.id)||(r.push(i),t.add(i.id))}return r}},Symbol.toStringTag,{value:"Module"})),Cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ir="undefined"==typeof Uint8Array?[]:new Uint8Array(256),kr=0;kr<64;kr++)Ir[Cr.charCodeAt(kr)]=kr;var Er;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==($t=xr.contentWindow)?void 0:$t.Array.from)||Array.from,document.body.removeChild(xr)}}catch(e){console.debug("Unable to override Array.from",e)}new nr,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Er||(Er={}));class Tr{constructor(e){Vt(this,"fileName"),Vt(this,"functionName"),Vt(this,"lineNumber"),Vt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){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)}}var Mr=/(^|@)\S+:\d+/,Rr=/^\s*at .*(\S+:\d+|\(native\))/m,Ar=/^(eval@)?(\[native code])?$/,Nr={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Rr)?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(Rr)}),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,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Tr({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Ar)}),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 Tr({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Tr({functionName:n,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,r=e.message.split("\n"),n=[],i=2,o=r.length;i<o;i+=2){var s=t.exec(r[i]);s&&n.push(new Tr({fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],i=0,o=r.length;i<o;i+=2){var s=t.exec(r[i]);s&&n.push(new Tr({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Mr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Tr({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Fr(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(var o=0;o<n.children.length;o++){var s=n.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&i.push(s)}i.length>1&&(r+=":eq(".concat(i.indexOf(e),")")),t=r+(t?">"+t:""),e=n}return t}function Or(e){return"[object Object]"===Object.prototype.toString.call(e)}function Pr(e,t){if(0===t)return!0;var r=Object.keys(e);for(var n of r)if(Or(e[n])&&Pr(e[n],t-1))return!0;return!1}function Lr(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],i=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var o=n.indexOf(this);~o?n.splice(o+1):n.push(this),~o?i.splice(o,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Or(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Or(e)&&Pr(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t="".concat(t.slice(0,r.stringLengthLimit),"..."));return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var s={};for(var a in t){var l=t[a];Array.isArray(l)?s[a]=Fr(l.length?l[0]:null):s[a]=l}return s}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 Dr={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 Br(e,t,r){var n,i=r?Object.assign({},Dr,r):Dr,o=i.logger;if(!o)return()=>{};n="string"==typeof o?t[o]:o;var s=0,a=!1,l=[];if(i.level.includes("error")){var c=t=>{var r=t.message,n=t.error,o=Nr.parse(n).map((e=>e.toString())),s=[Lr(r,i.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",c),l.push((()=>{t.removeEventListener("error",c)}));var u=t=>{var r,n;t.reason instanceof Error?(r=t.reason,n=[Lr("Uncaught (in promise) ".concat(r.name,": ").concat(r.message),i.stringifyOptions)]):(r=new Error,n=[Lr("Uncaught (in promise)",i.stringifyOptions),Lr(t.reason,i.stringifyOptions)]);var o=Nr.parse(r).map((e=>e.toString()));e({level:"error",trace:o,payload:n})};t.addEventListener("unhandledrejection",u),l.push((()=>{t.removeEventListener("unhandledrejection",u)}))}for(var d of i.level)l.push(h(n,d));return()=>{l.forEach((e=>e()))};function h(t,r){var n=this;return t[r]?Sr.patch(t,r,(t=>function(){for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];if(t.apply(n,l),!("assert"===r&&l[0]||a)){a=!0;try{var u=Nr.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((e=>Lr(e,i.stringifyOptions)));++s<i.lengthThreshold?e({level:r,trace:u,payload:d}):s===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Lr("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}var qr,Hr=e=>({name:"rrweb/console@1",observer:Br,options:e}),$r="undefined"!=typeof window?window:void 0,Wr="undefined"!=typeof globalThis?globalThis:$r,Vr=Array.prototype,Zr=Vr.forEach,Gr=Vr.indexOf,jr=null==Wr?void 0:Wr.navigator,Ur=null==Wr?void 0:Wr.document,zr=null==Wr?void 0:Wr.location,Yr=null==Wr?void 0:Wr.fetch,Xr=null!=Wr&&Wr.XMLHttpRequest&&"withCredentials"in new Wr.XMLHttpRequest?Wr.XMLHttpRequest:void 0,Jr=null==Wr?void 0:Wr.AbortController,Kr=null==jr?void 0:jr.userAgent,Qr=null!=$r?$r:{},en="$copy_autocapture",tn=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(qr||(qr={}));var rn=["fatal","error","warning","log","info","debug"],nn={DEBUG:!1,LIB_VERSION:"1.217.1"},on=e=>{var t={_log:function(t){if($r&&(nn.DEBUG||Qr.POSTHOG_DEBUG)&&!Ln($r.console)&&$r.console){for(var r=("__rrweb_original__"in $r.console[t]?$r.console[t].__rrweb_original__:$r.console[t]),n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r(e,...i)}},info:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t._log("log",...r)},warn:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t._log("warn",...r)},error:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t._log("error",...r)},critical:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning:e=>{t.error("You must initialize PostHog before calling ".concat(e))},createLogger:t=>on("".concat(e," ").concat(t))};return t},sn=on("[PostHog.js]"),an=sn.createLogger,ln={};function cn(e,t,r){if(Rn(e))if(Zr&&e.forEach===Zr)e.forEach(t,r);else if("length"in e&&e.length===+e.length)for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n)===ln)return}function un(e,t,r){if(!Hn(e)){if(Rn(e))return cn(e,t,r);if(Zn(e)){for(var n of e.entries())if(t.call(r,n[1],n[0])===ln)return}else for(var i in e)if(Tn.call(e,i)&&t.call(r,e[i],i)===ln)return}}var dn=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return cn(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e},hn=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return cn(r,(function(t){cn(t,(function(t){e.push(t)}))})),e};function pn(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n}var vn=function(e){try{return e()}catch(e){return}},gn=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.apply(this,r)}catch(e){sn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),sn.critical(e)}}},fn=function(e){var t={};return un(e,(function(e,r){Dn(e)&&e.length>0&&(t[r]=e)})),t};function mn(e,t){return r=e,n=e=>Dn(e)&&!qn(t)?e.slice(0,t):e,i=new Set,function e(t,r){return t!==Object(t)?n?n(t,r):t:i.has(t)?void 0:(i.add(t),Rn(t)?(o=[],cn(t,(t=>{o.push(e(t))}))):(o={},un(t,((t,r)=>{i.has(t)||(o[r]=e(t,r))}))),o);var o}(r);var r,n,i}var _n=["herokuapp.com","vercel.app","netlify.app"];function yn(e){var t=null==e?void 0:e.hostname;if(!Dn(t))return!1;var r=t.split(".").slice(-2).join(".");for(var n of _n)if(r===n)return!1;return!0}function bn(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}function wn(e,t,r,n){var{capture:i=!1,passive:o=!0}=null!=n?n:{};null==e||e.addEventListener(t,r,{capture:i,passive:o})}function Sn(e,t){return-1!==e.indexOf(t)}var Cn=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},In=function(e){return e.replace(/^\$/,"")};var kn=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},En=Array.isArray,xn=Object.prototype,Tn=xn.hasOwnProperty,Mn=xn.toString,Rn=En||function(e){return"[object Array]"===Mn.call(e)},An=e=>"function"==typeof e,Nn=e=>An(e)&&-1!==e.toString().indexOf("[native code]"),Fn=()=>!!$r.Zone,On=e=>e===Object(e)&&!Rn(e),Pn=e=>{if(On(e)){for(var t in e)if(Tn.call(e,t))return!1;return!0}return!1},Ln=e=>void 0===e,Dn=e=>"[object String]"==Mn.call(e),Bn=e=>Dn(e)&&0===e.trim().length,qn=e=>null===e,Hn=e=>Ln(e)||qn(e),$n=e=>"[object Number]"==Mn.call(e),Wn=e=>"[object Boolean]"===Mn.call(e),Vn=e=>e instanceof Document,Zn=e=>e instanceof FormData,Gn=e=>e instanceof Error,jn=e=>Sn(tn,e),Un=["localhost","127.0.0.1"],zn=e=>{var t=null==Ur?void 0:Ur.createElement("a");return Ln(t)?null:(t.href=e,t)},Yn=function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return un(e,(function(e,n){Ln(e)||Ln(n)||"undefined"===n||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),r=encodeURIComponent(n),i[i.length]=r+"="+t)})),i.join(n)},Xn=function(e,t){for(var r,n=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<n.length;i++){var o=n[i].split("=");if(o[0]===t){r=o;break}}if(!Rn(r)||r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(e){sn.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Jn=function(e,t,r){if(!e||!t||!t.length)return e;for(var n=e.split("#"),i=n[0]||"",o=n[1],s=i.split("?"),a=s[1],l=s[0],c=(a||"").split("&"),u=[],d=0;d<c.length;d++){var h=c[d].split("=");Rn(h)&&(t.includes(h[0])?u.push(h[0]+"="+r):u.push(c[d]))}var p=l;return null!=a&&(p+="?"+u.join("&")),null!=o&&(p+="#"+o),p},Kn=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null},Qn="$people_distinct_id",ei="__alias",ti="__timers",ri="$autocapture_disabled_server_side",ni="$heatmaps_enabled_server_side",ii="$exception_capture_enabled_server_side",oi="$web_vitals_enabled_server_side",si="$dead_clicks_enabled_server_side",ai="$web_vitals_allowed_metrics",li="$session_recording_enabled_server_side",ci="$console_log_recording_enabled_server_side",ui="$session_recording_network_payload_capture",di="$session_recording_canvas_recording",hi="$replay_sample_rate",pi="$replay_minimum_duration",vi="$replay_script_config",gi="$sesid",fi="$session_is_sampled",mi="$session_recording_url_trigger_activated_session",_i="$session_recording_event_trigger_activated_session",yi="$enabled_feature_flags",bi="$early_access_features",wi="$stored_person_properties",Si="$stored_group_properties",Ci="$surveys",Ii="$surveys_activated",ki="$flag_call_reported",Ei="$user_state",xi="$client_session_props",Ti="$capture_rate_limit",Mi="$initial_campaign_params",Ri="$initial_referrer_info",Ai="$initial_person_info",Ni="$epp",Fi="__POSTHOG_TOOLBAR__",Oi="$posthog_cookieless",Pi=[Qn,ei,"__cmpns",ti,li,ni,gi,yi,Ei,bi,Si,wi,Ci,ki,xi,Ti,Mi,Ri,Ni];function Li(e){var t;return e instanceof Element&&(e.id===Fi||!(null===(t=e.closest)||void 0===t||!t.call(e,".toolbar-global-fade-container")))}function Di(e){return!!e&&1===e.nodeType}function Bi(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function qi(e){return!!e&&3===e.nodeType}function Hi(e){return!!e&&11===e.nodeType}function $i(e){return e?Cn(e).split(/\s+/):[]}function Wi(e){var t=null==$r?void 0:$r.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function Vi(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return $i(t)}function Zi(e){return Hn(e)?null:Cn(e).split(/(\s+)/).filter((e=>io(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Gi(e){var t="";return Xi(e)&&!Ji(e)&&e.childNodes&&e.childNodes.length&&un(e.childNodes,(function(e){var r;qi(e)&&e.textContent&&(t+=null!==(r=Zi(e.textContent))&&void 0!==r?r:"")})),Cn(t)}function ji(e){return Ln(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Ui=["a","button","form","input","select","textarea","label"];function zi(e){var t=e.parentNode;return!(!t||!Di(t))&&t}function Yi(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!$r||!e||Bi(e,"html")||!Di(e))return!1;if(null!=r&&r.url_allowlist&&!Wi(r.url_allowlist))return!1;if(null!=r&&r.url_ignorelist&&Wi(r.url_ignorelist))return!1;if(null!=r&&r.dom_event_allowlist){var o=r.dom_event_allowlist;if(o&&!o.some((e=>t.type===e)))return!1}for(var s=!1,a=[e],l=!0,c=e;c.parentNode&&!Bi(c,"body");)if(Hi(c.parentNode))a.push(c.parentNode.host),c=c.parentNode.host;else{if(!(l=zi(c)))break;if(n||Ui.indexOf(l.tagName.toLowerCase())>-1)s=!0;else{var u=$r.getComputedStyle(l);u&&"pointer"===u.getPropertyValue("cursor")&&(s=!0)}a.push(l),c=l}if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(Ln(r))return!0;var n=function(e){if(r.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var i of e){var o=n(i);if("object"==typeof o)return o.v}return!1}(a,r))return!1;if(!function(e,t){var r=null==t?void 0:t.css_selector_allowlist;if(Ln(r))return!0;var n=function(e){if(r.some((t=>e.matches(t))))return{v:!0}};for(var i of e){var o=n(i);if("object"==typeof o)return o.v}return!1}(a,r))return!1;var d=$r.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){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 s?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(Ui.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}function Xi(e){for(var t=e;t.parentNode&&!Bi(t,"body");t=t.parentNode){var r=Vi(t);if(Sn(r,"ph-sensitive")||Sn(r,"ph-no-capture"))return!1}if(Sn(Vi(e),"ph-include"))return!0;var n=e.type||"";if(Dn(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(Dn(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 Ji(e){return!!(Bi(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Bi(e,"select")||Bi(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Ki="(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})",Qi=new RegExp("^(?:".concat(Ki,")$")),eo=new RegExp(Ki),to="\\d{3}-?\\d{2}-?\\d{4}",ro=new RegExp("^(".concat(to,")$")),no=new RegExp("(".concat(to,")"));function io(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Hn(e))return!1;if(Dn(e)){if(e=Cn(e),(t?Qi:eo).test((e||"").replace(/[- ]/g,"")))return!1;if((t?ro:no).test(e))return!1}return!0}function oo(e){var t=Gi(e);return io(t="".concat(t," ").concat(so(e)).trim())?t:""}function so(e){var t="";return e&&e.childNodes&&e.childNodes.length&&un(e.childNodes,(function(e){var r;if(e&&"span"===(null===(r=e.tagName)||void 0===r?void 0:r.toLowerCase()))try{var n=Gi(e);t="".concat(t," ").concat(n).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(so(e)).trim())}catch(e){sn.error("[AutoCapture]",e)}})),t}function ao(e){return function(e){var r=e.map((e=>{var r,n,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var o of(e.attr_class.sort(),e.attr_class))i+=".".concat(o.replace(/"/g,""));var s=t(t(t(t({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(r=e.nth_child)&&void 0!==r?r: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),a={};return pn(s).sort(((e,t)=>{var[r]=e,[n]=t;return r.localeCompare(n)})).forEach((e=>{var[t,r]=e;return a[lo(t.toString())]=lo(r.toString())})),i+=":",i+=pn(s).map((e=>{var[t,r]=e;return"".concat(t,'="').concat(r,'"')})).join("")}));return r.join(";")}(function(e){return e.map((e=>{var t,r,n={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(r=e.attr__href)||void 0===r?void 0:r.slice(0,2048),attr_class:co(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return pn(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return n.attributes[t]=r})),n}))}(e))}function lo(e){return e.replace(/"|\\"/g,'\\"')}function co(e){var t=e.attr__class;return t?Rn(t)?t:$i(t):void 0}var uo="[SessionRecording]",ho="redacted",po={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com"]},vo=["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"],go=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],fo=["/s/","/e/","/i/"];function mo(e,t,r,n){if(Hn(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return Dn(i)&&(i=parseInt(i)),i>r?uo+" ".concat(n," body too large to record (").concat(i," bytes)"):e}function _o(e,t){if(Hn(e))return e;var r=e;return io(r,!1)||(r=uo+" "+t+" body "+ho),un(go,(e=>{var n,i;null!==(n=r)&&void 0!==n&&n.length&&-1!==(null===(i=r)||void 0===i?void 0:i.indexOf(e))&&(r=uo+" "+t+" body "+ho+" as might contain: "+e)})),r}var yo=(e,r)=>{var n,i,o,s={payloadSizeLimitBytes:po.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...po.performanceEntryTypeToObserve],payloadHostDenyList:[...r.payloadHostDenyList||[],...po.payloadHostDenyList]},a=!1!==e.session_recording.recordHeaders&&r.recordHeaders,l=!1!==e.session_recording.recordBody&&r.recordBody,c=!1!==e.capture_performance&&r.recordPerformance,u=(n=s,o=Math.min(1e6,null!==(i=n.payloadSizeLimitBytes)&&void 0!==i?i:1e6),e=>(null!=e&&e.requestBody&&(e.requestBody=mo(e.requestBody,e.requestHeaders,o,"Request")),null!=e&&e.responseBody&&(e.responseBody=mo(e.responseBody,e.responseHeaders,o,"Response")),e)),d=t=>{return u(((e,t)=>{var r,n=zn(e.name),i=0===t.indexOf("http")?null===(r=zn(t))||void 0===r?void 0:r.pathname:t;"/"===i&&(i="");var o=null==n?void 0:n.pathname.replace(i||"","");if(!(n&&o&&fo.some((e=>0===o.indexOf(e)))))return e})((n=(r=t).requestHeaders,Hn(n)||un(Object.keys(null!=n?n:{}),(e=>{vo.includes(e.toLowerCase())&&(n[e]=ho)})),r),e.api_host));var r,n},h=An(e.session_recording.maskNetworkRequestFn);return h&&An(e.session_recording.maskCapturedNetworkRequestFn)&&sn.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(e.session_recording.maskCapturedNetworkRequestFn=r=>{var n=e.session_recording.maskNetworkRequestFn({url:r.name});return t(t({},r),{},{name:null==n?void 0:n.url})}),s.maskRequestFn=An(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var r,n,i,o=d(t);return o&&null!==(r=null===(n=(i=e.session_recording).maskCapturedNetworkRequestFn)||void 0===n?void 0:n.call(i,o))&&void 0!==r?r:void 0}:e=>function(e){if(!Ln(e))return e.requestBody=_o(e.requestBody,"Request"),e.responseBody=_o(e.responseBody,"Response"),e}(d(e)),t(t(t({},po),s),{},{recordHeaders:a,recordBody:l,recordPerformance:c,recordInitialRequests:c})};function bo(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return An(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}function wo(e,t){var r,n=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:n,isHostDenied:!1};if(null===(r=t.payloadHostDenyList)||void 0===r||!r.length||null==n||!n.trim().length)return i;for(var o of t.payloadHostDenyList)if(n.endsWith(o))return{hostname:n,isHostDenied:!0};return i}var So=an("[Recorder]"),Co=e=>"navigation"===e.entryType,Io=e=>"resource"===e.entryType;function ko(e,t,r){if(r.recordInitialRequests){var n=t.performance.getEntries().filter((e=>Co(e)||Io(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:n.flatMap((e=>No({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new t.PerformanceObserver((t=>{var n=t.getEntries().filter((e=>Co(e)||Io(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:n.flatMap((e=>No({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:o}),()=>{i.disconnect()}}function Eo(e,t){return!!t&&(Wn(t)||t[e])}function xo(e){var{type:t,recordBody:r,headers:n}=e;function i(e){var t=Object.keys(n).find((e=>"content-type"===e.toLowerCase())),r=t&&n[t];return e.some((e=>null==r?void 0:r.includes(e)))}if(!r)return!1;if(Wn(r))return!0;if(Rn(r))return i(r);var o=r[t];return Wn(o)?o:i(o)}function To(e,t,r,n,i){return Mo.apply(this,arguments)}function Mo(){return Mo=n((function*(e,t,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(o>10)return So.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var s=function(e,t){for(var r=e.length-1;r>=0;r-=1)if(t(e[r]))return e[r]}(e.performance.getEntriesByName(r),(e=>Io(e)&&e.initiatorType===t&&(Ln(n)||e.startTime>=n)&&(Ln(i)||e.startTime<=i)));return s||(yield new Promise((e=>setTimeout(e,50*o))),To(e,t,r,n,i,o+1))})),Mo.apply(this,arguments)}function Ro(e){var{body:t,options:r,url:n}=e;if(Hn(t))return null;var{hostname:i,isHostDenied:o}=wo(n,r);if(o)return i+" is in deny list";if(Dn(t))return t;if(Vn(t))return t.textContent;if(Zn(t))return Yn(t);if(On(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var Ao=e=>!qn(e)&&("navigation"===e.entryType||"resource"===e.entryType);function No(e){var{entry:r,method:n,status:i,networkRequest:o,isInitial:s,start:a,end:l,url:c,initiatorType:u}=e;a=r?r.startTime:a,l=r?r.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),h=Math.floor(d+(a||0)),p=[t(t({},r?r.toJSON():{name:c}),{},{startTime:Ln(a)?void 0:Math.round(a),endTime:Ln(l)?void 0:Math.round(l),timeOrigin:d,timestamp:h,method:n,initiatorType:u||(r?r.initiatorType:void 0),status:i,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s})];if(Ao(r))for(var v of r.serverTiming||[])p.push({timeOrigin:d,timestamp:h,startTime:Math.round(r.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return p}var Fo=["video/","audio/"];function Oo(e){return new Promise(((t,r)=>{var n=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>r(e))).finally((()=>clearTimeout(n)))}catch(e){clearTimeout(n),t("[SessionReplay] Failed to read body")}}))}function Po(){return Po=n((function*(e){var{r:t,options:r,url:n}=e,{hostname:i,isHostDenied:o}=wo(n,r);return o?Promise.resolve(i+" is in deny list"):Oo(t)})),Po.apply(this,arguments)}function Lo(){return Lo=n((function*(e){var{r:t,options:r,url:n}=e,i=function(e){var t,{r:r,options:n,url:i}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null===(t=r.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),s=Fo.some((e=>null==o?void 0:o.startsWith(e)));if(o&&s)return"Content-Type ".concat(o," is not supported");var{hostname:a,isHostDenied:l}=wo(i,n);return l?a+" is in deny list":null}({r:t,options:r,url:n});return qn(i)?Oo(t):Promise.resolve(i)})),Lo.apply(this,arguments)}function Do(e,t,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=Eo("request",r.recordHeaders),o=Eo("response",r.recordHeaders),s=bo(t,"fetch",(s=>function(){var a=n((function*(n,a){var l,c,u,d=new Request(n,a),h={};try{var p={};d.headers.forEach(((e,t)=>{p[t]=e})),i&&(h.requestHeaders=p),xo({type:"request",headers:p,url:n,recordBody:r.recordBody})&&(h.requestBody=yield function(e){return Po.apply(this,arguments)}({r:d,options:r,url:n})),c=t.performance.now(),l=yield s(d),u=t.performance.now();var v={};return l.headers.forEach(((e,t)=>{v[t]=e})),o&&(h.responseHeaders=v),xo({type:"response",headers:v,url:n,recordBody:r.recordBody})&&(h.responseBody=yield function(e){return Lo.apply(this,arguments)}({r:l,options:r,url:n})),l}finally{To(t,"fetch",d.url,c,u).then((t=>{var r,n=No({entry:t,method:d.method,status:null===(r=l)||void 0===r?void 0:r.status,networkRequest:h,start:c,end:u,url:d.url,initiatorType:"fetch"});e({requests:n})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{s()}}var Bo=null;function qo(e,r,n){if(!("performance"in r))return()=>{};if(Bo)return So.warn("Network observer already initialised, doing nothing"),()=>{};var i=n?Object.assign({},po,n):po,o=r=>{var n=[];r.requests.forEach((e=>{var t=i.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e(t(t({},r),{},{requests:n}))},s=ko(o,r,i),a=()=>{},l=()=>{};return(i.recordHeaders||i.recordBody)&&(a=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=Eo("request",r.recordHeaders),i=Eo("response",r.recordHeaders),o=bo(t.XMLHttpRequest.prototype,"open",(o=>function(s,a){var l,c,u=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,h=arguments.length>4?arguments[4]:void 0,p=this,v=new Request(a),g={},f={},m=p.setRequestHeader.bind(p);p.setRequestHeader=(e,t)=>(f[e]=t,m(e,t)),n&&(g.requestHeaders=f);var _=p.send.bind(p);p.send=e=>(xo({type:"request",headers:f,url:a,recordBody:r.recordBody})&&(g.requestBody=Ro({body:e,options:r,url:a})),l=t.performance.now(),_(e)),p.addEventListener("readystatechange",(()=>{if(p.readyState===p.DONE){c=t.performance.now();var n={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),i=t.join(": ");r&&(n[r]=i)})),i&&(g.responseHeaders=n),xo({type:"response",headers:n,url:a,recordBody:r.recordBody})&&(g.responseBody=Ro({body:p.response,options:r,url:a})),To(t,"xmlhttprequest",v.url,l,c).then((t=>{var r=No({entry:t,method:s,status:null==p?void 0:p.status,networkRequest:g,start:l,end:c,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}})),o.call(p,s,a,u,d,h)}));return()=>{o()}}(o,r,i),l=Do(o,r,i)),Bo=()=>{s(),a(),l()}}var Ho=e=>({name:"rrweb/network@1",observer:qo,options:e});Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Hr,getRecordNetworkPlugin:Ho},Qr.__PosthogExtensions__.rrweb={record:Ht,version:"v2"},Qr.rrweb={record:Ht,version:"v2"},Qr.rrwebConsoleRecord={getRecordConsolePlugin:Hr},Qr.getRecordNetworkPlugin=Ho;var $o,Wo,Vo,Zo,Go,jo,Uo,zo,Yo={},Xo=[],Jo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ko=Array.isArray;function Qo(e,t){for(var r in t)e[r]=t[r];return e}function es(e){var t=e.parentNode;t&&t.removeChild(e)}function ts(e,t,r){var n,i,o,s={};for(o in t)"key"==o?n=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?$o.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return rs(e,s,n,i,null)}function rs(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++Vo:i,__i:-1,__u:0};return null==i&&null!=Wo.vnode&&Wo.vnode(o),o}function ns(e){return e.children}function is(e,t){this.props=e,this.context=t}function os(e,t){if(null==t)return e.__?os(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?os(e):null}function ss(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return ss(e)}}function as(e){(!e.__d&&(e.__d=!0)&&Zo.push(e)&&!ls.__r++||Go!==Wo.debounceRendering)&&((Go=Wo.debounceRendering)||jo)(ls)}function ls(){var e,t,r,n,i,o,s,a,l;for(Zo.sort(Uo);e=Zo.shift();)e.__d&&(t=Zo.length,n=void 0,o=(i=(r=e).__v).__e,a=[],l=[],(s=r.__P)&&((n=Qo({},i)).__v=i.__v+1,Wo.vnode&&Wo.vnode(n),fs(s,n,i,r.__n,void 0!==s.ownerSVGElement,32&i.__u?[o]:null,a,null==o?os(i):o,!!(32&i.__u),l),n.__.__k[n.__i]=n,ms(a,n,l),n.__e!=o&&ss(n)),Zo.length>t&&Zo.sort(Uo));ls.__r=0}function cs(e,t,r,n,i,o,s,a,l,c,u){var d,h,p,v,g,f=n&&n.__k||Xo,m=t.length;for(r.__d=l,function(e,t,r){var n,i,o,s,a,l=t.length,c=r.length,u=c,d=0;for(e.__k=[],n=0;n<l;n++)null!=(i=e.__k[n]=null==(i=t[n])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?rs(null,i,null,null,i):Ko(i)?rs(ns,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?rs(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,a=ds(i,r,s=n+d,u),i.__i=a,o=null,-1!==a&&(u--,(o=r[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&d--,"function"!=typeof i.type&&(i.__u|=65536)):a!==s&&(a===s+1?d++:a>s?u>l-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==n+d&&(i.__u|=65536))):(o=r[n])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=os(o)),ys(o,o,!1),r[n]=null,u--);if(u)for(n=0;n<c;n++)null!=(o=r[n])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=os(o)),ys(o,o))}(r,t,f),l=r.__d,d=0;d<m;d++)null!=(p=r.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(h=-1===p.__i?Yo:f[p.__i]||Yo,p.__i=d,fs(e,p,h,i,o,s,a,l,c,u),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&_s(h.ref,null,p),u.push(p.ref,p.__c||v,p)),null==g&&null!=v&&(g=v),65536&p.__u||h.__k===p.__k?l=us(p,l,e):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:v&&(l=v.nextSibling),p.__d=void 0,p.__u&=-196609);r.__d=l,r.__e=g}function us(e,t,r){var n,i;if("function"==typeof e.type){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=us(n[i],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function ds(e,t,r,n){var i=e.key,o=e.type,s=r-1,a=r+1,l=t[r];if(null===l||l&&i==l.key&&o===l.type)return r;if(n>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((l=t[s])&&0==(131072&l.__u)&&i==l.key&&o===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&i==l.key&&o===l.type)return a;a++}}return-1}function hs(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||Jo.test(t)?r:r+"px"}function ps(e,t,r,n,i){var o;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||hs(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||hs(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.u=n.u:(r.u=Date.now(),e.addEventListener(t,o?gs:vs,o)):e.removeEventListener(t,o?gs:vs,o);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,r))}}function vs(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Wo.event?Wo.event(e):e)}function gs(e){return this.l[e.type+!0](Wo.event?Wo.event(e):e)}function fs(e,t,r,n,i,o,s,a,l,c){var u,d,h,p,v,g,f,m,_,y,b,w,S,C,I,k=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),o=[a=t.__e=r.__e]),(u=Wo.__b)&&u(t);e:if("function"==typeof k)try{if(m=t.props,_=(u=k.contextType)&&n[u.__c],y=u?_?_.props.value:u.__:n,r.__c?f=(d=t.__c=r.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(m,y):(t.__c=d=new is(m,y),d.constructor=k,d.render=bs),_&&_.sub(d),d.props=m,d.state||(d.state={}),d.context=y,d.__n=n,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Qo({},d.__s)),Qo(d.__s,k.getDerivedStateFromProps(m,d.__s))),p=d.props,v=d.state,d.__v=t,h)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&m!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(m,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(m,d.__s,y)||t.__v===r.__v)){for(t.__v!==r.__v&&(d.props=m,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(m,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,v,g)}))}if(d.context=y,d.props=m,d.__P=e,d.__e=!1,w=Wo.__r,S=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do{d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(n=Qo(Qo({},n),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(p,v)),cs(e,Ko(I=null!=u&&u.type===ns&&null==u.key?u.props.children:u)?I:[I],t,r,n,i,o,s,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),f&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=o?(t.__e=a,t.__u|=l?160:32,o[o.indexOf(a)]=null):(t.__e=r.__e,t.__k=r.__k),Wo.__e(e,t,r)}else null==o&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=function(e,t,r,n,i,o,s,a,l){var c,u,d,h,p,v,g,f=r.props,m=t.props,_=t.type;if("svg"===_&&(i=!0),null!=o)for(c=0;c<o.length;c++)if((p=o[c])&&"setAttribute"in p==!!_&&(_?p.localName===_:3===p.nodeType)){e=p,o[c]=null;break}if(null==e){if(null===_)return document.createTextNode(m);e=i?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,m.is&&m),o=null,a=!1}if(null===_)f===m||a&&e.data===m||(e.data=m);else{if(o=o&&$o.call(e.childNodes),f=r.props||Yo,!a&&null!=o)for(f={},c=0;c<e.attributes.length;c++)f[(p=e.attributes[c]).name]=p.value;for(c in f)p=f[c],"children"==c||("dangerouslySetInnerHTML"==c?d=p:"key"===c||c in m||ps(e,c,null,p,i));for(c in m)p=m[c],"children"==c?h=p:"dangerouslySetInnerHTML"==c?u=p:"value"==c?v=p:"checked"==c?g=p:"key"===c||a&&"function"!=typeof p||f[c]===p||ps(e,c,p,f[c],i);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),cs(e,Ko(h)?h:[h],t,r,n,i&&"foreignObject"!==_,o,s,o?o[0]:r.__k&&os(r,0),a,l),null!=o)for(c=o.length;c--;)null!=o[c]&&es(o[c]);a||(c="value",void 0!==v&&(v!==e[c]||"progress"===_&&!v||"option"===_&&v!==f[c])&&ps(e,c,v,f[c],!1),c="checked",void 0!==g&&g!==e[c]&&ps(e,c,g,f[c],!1))}return e}(r.__e,t,r,n,i,o,s,l,c);(u=Wo.diffed)&&u(t)}function ms(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)_s(r[n],r[++n],r[++n]);Wo.__c&&Wo.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Wo.__e(e,t.__v)}}))}function _s(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){Wo.__e(e,r)}}function ys(e,t,r){var n,i;if(Wo.unmount&&Wo.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||_s(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){Wo.__e(e,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&ys(n[i],t,r||"function"!=typeof e.type);r||null==e.__e||es(e.__e),e.__=e.__e=e.__d=void 0}function bs(e,t,r){return this.constructor(e,r)}function ws(e,t,r){var n,i,o,s;Wo.__&&Wo.__(e,t),i=(n="function"==typeof r)?null:t.__k,o=[],s=[],fs(t,e=(!n&&r||t).__k=ts(ns,null,[e]),i||Yo,Yo,void 0!==t.ownerSVGElement,!n&&r?[r]:i?null:t.firstChild?$o.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,s),ms(o,e,s)}function Ss(e,t,r){var n,i,o,s,a=Qo({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?n=t[o]:"ref"==o?i=t[o]:a[o]=void 0===t[o]&&void 0!==s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?$o.call(arguments,2):r),rs(e.type,a,n||e.key,i||e.ref,null)}$o=Xo.slice,Wo={__e:function(e,t,r,n){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},Vo=0,is.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Qo({},this.state),"function"==typeof e&&(e=e(Qo({},r),this.props)),e&&Qo(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),as(this))},is.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),as(this))},is.prototype.render=ns,Zo=[],jo="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Uo=function(e,t){return e.__v.__b-t.__v.__b},ls.__r=0,zo=0;var Cs=$r,Is=Ur,ks="seenSurvey_",Es=an("[Surveys]"),xs=e=>"\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: ".concat((null==e?void 0:e.fontFamily)||"-apple-system",', BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n text-align: left;\n max-width: ').concat(parseInt((null==e?void 0:e.maxWidth)||"300"),"px;\n width: 100%;\n z-index: ").concat(parseInt((null==e?void 0:e.zIndex)||"99999"),";\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n border-bottom: 0px;\n ").concat({left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "}[(null==e?void 0:e.position)||"right"]||"right: 30px;","\n flex-direction: column;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n box-shadow: -6px 0 16px -8px rgb(0 0 0 / 8%), -9px 0 28px 0 rgb(0 0 0 / 5%), -12px 0 48px 16px rgb(0 0 0 / 3%);\n }\n\n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: 0.6;\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: ").concat((null==e?void 0:e.fontFamily)||"-apple-system",', BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ').concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ").concat((null==e?void 0:e.submitButtonColor)||"black"," !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n text-decoration: none;\n backgroundColor: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n color: ").concat(Ms((null==e?void 0:e.backgroundColor)||"#eeeded"),";\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n opacity: .60;\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n ");function Ts(e){if("#"===e[0]){var t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function Ms(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Os;"#"===t[0]&&(e=Ts(t)),t.startsWith("rgb")&&(e=t);var r=function(e){return{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()]}(t);if(r&&(e=Ts(r)),!e)return"black";var n=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(n){var i=parseInt(n[1]),o=parseInt(n[2]),s=parseInt(n[3]);return Math.sqrt(i*i*.299+o*o*.587+s*s*.114)>127.5?"black":"white"}return"black"}var Rs,As,Ns,Fs={backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:"right"},Os="#eeeded",Ps=function(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;i?(localStorage.setItem($s(n),"true"),i.capture("survey sent",t(t({$survey_name:n.name,$survey_id:n.id,$survey_iteration:n.current_iteration,$survey_iteration_start_date:n.current_iteration_start_date,$survey_questions:n.questions.map((e=>e.question)),sessionRecordingUrl:null===(e=i.get_session_replay_url)||void 0===e?void 0:e.call(i)},r),{},{$set:{[Ws(n,"responded")]:!0}})),Cs.dispatchEvent(new Event("PHSurveySent"))):Es.error("[survey sent] event not captured, PostHog instance not found.")},Ls=(e,t,r)=>{var n;t?r||(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t),$set:{[Ws(e,"dismissed")]:!0}}),localStorage.setItem($s(e),"true"),Cs.dispatchEvent(new Event("PHSurveyClosed"))):Es.error("[survey dismissed] event not captured, PostHog instance not found.")},Ds=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Bs=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,qs=e=>(e.questions.forEach(((e,t)=>{e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?Bs(e.questions,Ds(e.questions)):e.questions),Hs=e=>{var t,r;return!(null===(t=e.conditions)||void 0===t||null===(r=t.events)||void 0===r||!r.repeatedActivation||!(e=>{var t,r,n,i,o,s;return null!=(null===(t=e.conditions)||void 0===t||null===(r=t.events)||void 0===r||null===(n=r.values)||void 0===n?void 0:n.length)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0})(e))},$s=e=>{var t="".concat(ks).concat(e.id);return e.current_iteration&&e.current_iteration>0&&(t="".concat(ks).concat(e.id,"_").concat(e.current_iteration)),t},Ws=(e,t)=>{var r="$survey_".concat(t,"/").concat(e.id);return e.current_iteration&&e.current_iteration>0&&(r="$survey_".concat(t,"/").concat(e.id,"/").concat(e.current_iteration)),r},Vs=function(e,t){var r={__c:t="__cC"+zo++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,n;return this.getChildContext||(r=[],(n={})[t]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some((function(e){e.__e=!0,as(e)}))},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0,onPreviewSubmit:()=>{}}),Zs=e=>{var{component:t,children:r,renderAsHtml:n,style:i}=e;return Ss(t,n?{dangerouslySetInnerHTML:{__html:r},style:i}:{children:r,style:i})};!function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(Rs||(Rs={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(As||(As={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(Ns||(Ns={}));var Gs="Mobile",js="iOS",Us="Android",zs="Tablet",Ys=Us+" "+zs,Xs="iPad",Js="Apple",Ks=Js+" Watch",Qs="Safari",ea="BlackBerry",ta="Samsung",ra=ta+"Browser",na=ta+" Internet",ia="Chrome",oa=ia+" OS",sa=ia+" "+js,aa="Internet Explorer",la=aa+" "+Gs,ca="Opera",ua=ca+" Mini",da="Edge",ha="Microsoft "+da,pa="Firefox",va=pa+" "+js,ga="Nintendo",fa="PlayStation",ma="Xbox",_a=Us+" "+Gs,ya=Gs+" "+Qs,ba="Windows",wa=ba+" Phone",Sa="Nokia",Ca="Ouya",Ia="Generic",ka=Ia+" "+Gs.toLowerCase(),Ea=Ia+" "+zs.toLowerCase(),xa="Konqueror",Ta="(\\d+(\\.\\d+)?)",Ma=new RegExp("Version/"+Ta),Ra=new RegExp(ma,"i"),Aa=new RegExp(fa+" \\w+","i"),Na=new RegExp(ga+" \\w+","i"),Fa=new RegExp(ea+"|PlayBook|BB10","i"),Oa={"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 Pa=(e,t)=>t&&Sn(t,Js)||function(e){return Sn(e,Qs)&&!Sn(e,ia)&&!Sn(e,Us)}(e),La=function(e,t){return t=t||"",Sn(e," OPR/")&&Sn(e,"Mini")?ua:Sn(e," OPR/")?ca:Fa.test(e)?ea:Sn(e,"IE"+Gs)||Sn(e,"WPDesktop")?la:Sn(e,ra)?na:Sn(e,da)||Sn(e,"Edg/")?ha:Sn(e,"FBIOS")?"Facebook "+Gs:Sn(e,"UCWEB")||Sn(e,"UCBrowser")?"UC Browser":Sn(e,"CriOS")?sa:Sn(e,"CrMo")||Sn(e,ia)?ia:Sn(e,Us)&&Sn(e,Qs)?_a:Sn(e,"FxiOS")?va:Sn(e.toLowerCase(),xa.toLowerCase())?xa:Pa(e,t)?Sn(e,Gs)?ya:Qs:Sn(e,pa)?pa:Sn(e,"MSIE")||Sn(e,"Trident/")?aa:Sn(e,"Gecko")?pa:""},Da={[la]:[new RegExp("rv:"+Ta)],[ha]:[new RegExp(da+"?\\/"+Ta)],[ia]:[new RegExp("("+ia+"|CrMo)\\/"+Ta)],[sa]:[new RegExp("CriOS\\/"+Ta)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ta)],[Qs]:[Ma],[ya]:[Ma],[ca]:[new RegExp("(Opera|OPR)\\/"+Ta)],[pa]:[new RegExp(pa+"\\/"+Ta)],[va]:[new RegExp("FxiOS\\/"+Ta)],[xa]:[new RegExp("Konqueror[:/]?"+Ta,"i")],[ea]:[new RegExp(ea+" "+Ta),Ma],[_a]:[new RegExp("android\\s"+Ta,"i")],[na]:[new RegExp(ra+"\\/"+Ta)],[aa]:[new RegExp("(rv:|MSIE )"+Ta)],Mozilla:[new RegExp("rv:"+Ta)]},Ba=[[new RegExp(ma+"; "+ma+" (.*?)[);]","i"),e=>[ma,e&&e[1]||""]],[new RegExp(ga,"i"),[ga,""]],[new RegExp(fa,"i"),[fa,""]],[Fa,[ea,""]],[new RegExp(ba,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[wa,""];if(new RegExp(Gs).test(t)&&!/IEMobile\b/.test(t))return[ba+" "+Gs,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var n=r[1],i=Oa[n]||"";return/arm/i.test(t)&&(i="RT"),[ba,i]}return[ba,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[js,t.join(".")]}return[js,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Ln(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Us+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Us+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Us,t.join(".")]}return[Us,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var r=[e[1],e[2],e[3]||"0"];t[1]=r.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[oa,""]],[/Linux|debian/i,["Linux",""]]],qa=function(e){return Na.test(e)?ga:Aa.test(e)?fa:Ra.test(e)?ma:new RegExp(Ca,"i").test(e)?Ca:new RegExp("("+wa+"|WPDesktop)","i").test(e)?wa:/iPad/.test(e)?Xs:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Ks:Fa.test(e)?ea:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Sa,"i").test(e)?Sa:/(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(Gs).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)?Us:Ys:Us:new RegExp("(pda|"+Gs+")","i").test(e)?ka:new RegExp(zs,"i").test(e)&&!new RegExp(zs+" pc","i").test(e)?Ea:""},Ha="https?://(.*)",$a=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","irclid","_kx"],Wa=hn(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],$a),Va="<masked>",Za={campaignParams:function(){var{customTrackedParams:e,maskPersonalDataProperties:t,customPersonalDataProperties:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ur)return{};var n=t?hn([],$a,r||[]):[];return this._campaignParamsFromUrl(Jn(Ur.URL,n,Va),e)},_campaignParamsFromUrl:function(e,t){var r=Wa.concat(t||[]),n={};return un(r,(function(t){var r=Xn(e,t);n[t]=r||null})),n},_searchEngine:function(e){return e?0===e.search(Ha+"google.([^/?]*)")?"google":0===e.search(Ha+"bing.com")?"bing":0===e.search(Ha+"yahoo.com")?"yahoo":0===e.search(Ha+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=Za._searchEngine(e),r="yahoo"!=t?"q":"p",n={};if(!qn(t)){n.$search_engine=t;var i=Ur?Xn(Ur.referrer,r):"";i.length&&(n.ph_keyword=i)}return n},searchInfo:function(){var e=null==Ur?void 0:Ur.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:La,browserVersion:function(e,t){var r=La(e,t),n=Da[r];if(Ln(n))return null;for(var i=0;i<n.length;i++){var o=n[i],s=e.match(o);if(s)return parseFloat(s[s.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var e=this.browserLanguage();return"string"==typeof e?e.split("-")[0]:void 0},os:function(e){for(var t=0;t<Ba.length;t++){var[r,n]=Ba[t],i=r.exec(e),o=i&&(An(n)?n(i,e):n);if(o)return o}return["",""]},device:qa,deviceType:function(e){var t=qa(e);return t===Xs||t===Ys||"Kobo"===t||"Kindle Fire"===t||t===Ea?zs:t===ga||t===ma||t===fa||t===Ca?"Console":t===Ks?"Wearable":t?Gs:"Desktop"},referrer:function(){return(null==Ur?void 0:Ur.referrer)||"$direct"},referringDomain:function(){var e;return null!=Ur&&Ur.referrer&&(null===(e=zn(Ur.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer().substring(0,1e3),u:null==zr?void 0:zr.href.substring(0,1e3)}},initialPersonPropsFromInfo:function(e){var t,{r:r,u:n}=e,i={$initial_referrer:r,$initial_referring_domain:null==r?void 0:"$direct"==r?"$direct":null===(t=zn(r))||void 0===t?void 0:t.host};if(n){i.$initial_current_url=n;var o=zn(n);i.$initial_host=null==o?void 0:o.host,i.$initial_pathname=null==o?void 0:o.pathname,un(this._campaignParamsFromUrl(n),(function(e,t){i["$initial_"+In(t)]=e}))}r&&un(this._searchInfoFromReferrer(r),(function(e,t){i["$initial_"+In(t)]=e}));return i},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}},timezoneOffset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}},properties:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Kr)return{};var r=e?hn([],$a,t||[]):[],[n,i]=Za.os(Kr);return dn(fn({$os:n,$os_version:i,$browser:Za.browser(Kr,navigator.vendor),$device:Za.device(Kr),$device_type:Za.deviceType(Kr),$timezone:Za.timezone(),$timezone_offset:Za.timezoneOffset()}),{$current_url:Jn(null==zr?void 0:zr.href,r,Va),$host:null==zr?void 0:zr.host,$pathname:null==zr?void 0:zr.pathname,$raw_user_agent:Kr.length>1e3?Kr.substring(0,997)+"...":Kr,$browser_version:Za.browserVersion(Kr,navigator.vendor),$browser_language:Za.browserLanguage(),$browser_language_prefix:Za.browserLanguagePrefix(),$screen_height:null==$r?void 0:$r.screen.height,$screen_width:null==$r?void 0:$r.screen.width,$viewport_height:null==$r?void 0:$r.innerHeight,$viewport_width:null==$r?void 0:$r.innerWidth,$lib:"web",$lib_version:nn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!Kr)return{};var[e,t]=Za.os(Kr);return dn(fn({$os:e,$os_version:t,$browser:Za.browser(Kr,navigator.vendor)}),{$browser_version:Za.browserVersion(Kr,navigator.vendor)})}};class Ga{constructor(){i(this,"events",{}),this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter((e=>e!==t))}}emit(e,t){for(var r of this.events[e]||[])r(t);for(var n of this.events["*"]||[])n(e,t)}}class ja{constructor(e){i(this,"_debugEventEmitter",new Ga),i(this,"checkStep",((e,t)=>this.checkStepEvent(e,t)&&this.checkStepUrl(e,t)&&this.checkStepElement(e,t))),i(this,"checkStepEvent",((e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event))),this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e;if(!Ln(null===(e=this.instance)||void 0===e?void 0:e._addCaptureHook)){var t;null===(t=this.instance)||void 0===t||t._addCaptureHook(((e,t)=>{this.on(e,t)}))}}register(e){var t,r;if(!Ln(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,r;null===(t=this.actionRegistry)||void 0===t||t.add(e),null===(r=e.steps)||void 0===r||r.forEach((e=>{var t;null===(t=this.actionEvents)||void 0===t||t.add((null==e?void 0:e.event)||"")}))})),null!==(r=this.instance)&&void 0!==r&&r.autocapture)){var n,i=new Set;e.forEach((e=>{var t;null===(t=e.steps)||void 0===t||t.forEach((e=>{null!=e&&e.selector&&i.add(null==e?void 0:e.selector)}))})),null===(n=this.instance)||void 0===n||n.autocapture.setElementSelectors(i)}}on(e,t){var r;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null===(r=this.actionRegistry)||void 0===r?void 0:r.size)>0&&this.actionRegistry.forEach((e=>{this.checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)}))}_addActionHook(e){this.onAction("actionCaptured",(t=>e(t)))}checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this.checkStep(e,r))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStepUrl(e,t){if(null!=t&&t.url){var r,n=null==e||null===(r=e.properties)||void 0===r?void 0:r.$current_url;if(!n||"string"!=typeof n)return!1;if(!ja.matchString(n,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static matchString(e,t,r){switch(r){case"regex":return!!$r&&kn(e,t);case"exact":return t===e;case"contains":var n=ja.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return kn(e,n);default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.getElementsList(e).some((e=>!(null!=t&&t.href&&!ja.matchString(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact"))&&((null==t||!t.tag_name||e.tag_name===(null==t?void 0:t.tag_name))&&!(null!=t&&t.text&&!ja.matchString(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!ja.matchString(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))))return!1;if(null!=t&&t.selector){var r,n=null==e||null===(r=e.properties)||void 0===r?void 0:r.$element_selectors;if(!n)return!1;if(!n.includes(null==t?void 0:t.selector))return!1}return!0}getElementsList(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}class Ua{constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;Ln(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){var t=e.filter((e=>{var t,r,n,i;return(null===(t=e.conditions)||void 0===t?void 0:t.actions)&&(null===(r=e.conditions)||void 0===r||null===(n=r.actions)||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)>0}));if(0!==t.length){if(null==this.actionMatcher){this.actionMatcher=new ja(this.instance),this.actionMatcher.init();this.actionMatcher._addActionHook((e=>{this.onAction(e)}))}t.forEach((e=>{var t,r,n,i,o,s,a,l,c,u;e.conditions&&null!==(t=e.conditions)&&void 0!==t&&t.actions&&null!==(r=e.conditions)&&void 0!==r&&null!==(n=r.actions)&&void 0!==n&&n.values&&(null===(i=e.conditions)||void 0===i||null===(o=i.actions)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0&&(null===(a=this.actionMatcher)||void 0===a||a.register(e.conditions.actions.values),null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(u=c.values)||void 0===u||u.forEach((t=>{if(t&&t.name){var r=this.actionToSurveys.get(t.name);r&&r.push(e.id),this.actionToSurveys.set(t.name,r||[e.id])}})))}))}}setupEventBasedSurveys(e){var t;if(0!==e.filter((e=>{var t,r,n,i;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(r=e.conditions)||void 0===r||null===(n=r.events)||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)>0})).length){null===(t=this.instance)||void 0===t||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),e.forEach((e=>{var t,r,n;null===(t=e.conditions)||void 0===t||null===(r=t.events)||void 0===r||null===(n=r.values)||void 0===n||n.forEach((t=>{if(t&&t.name){var r=this.eventToSurveys.get(t.name);r&&r.push(e.id),this.eventToSurveys.set(t.name,r||[e.id])}}))}))}}onEvent(e,t){var r,n,i=(null===(r=this.instance)||void 0===r||null===(n=r.persistence)||void 0===n?void 0:n.props[Ii])||[];if(Ua.SURVEY_SHOWN_EVENT_NAME==e&&t&&i.length>0){var o,s=null==t||null===(o=t.properties)||void 0===o?void 0:o.$survey_id;if(s){var a=i.indexOf(s);a>=0&&(i.splice(a,1),this._updateActivatedSurveys(i))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(i.concat(this.eventToSurveys.get(e)||[]))}onAction(e){var t,r,n=(null===(t=this.instance)||void 0===t||null===(r=t.persistence)||void 0===r?void 0:r.props[Ii])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(n.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,r;null===(t=this.instance)||void 0===t||null===(r=t.persistence)||void 0===r||r.register({[Ii]:[...new Set(e)]})}getSurveys(){var e,t,r=null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t?void 0:t.props[Ii];return r||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}i(Ua,"SURVEY_SHOWN_EVENT_NAME","survey shown");var za=an("[Surveys]"),Ya={icontains:(e,t)=>e.some((e=>t.toLowerCase().includes(e.toLowerCase()))),not_icontains:(e,t)=>e.every((e=>!t.toLowerCase().includes(e.toLowerCase()))),regex:(e,t)=>e.some((e=>kn(t,e))),not_regex:(e,t)=>e.every((e=>!kn(t,e))),exact:(e,t)=>e.some((e=>t===e)),is_not:(e,t)=>e.every((e=>t!==e))};function Xa(e,t,r){var n,i=e.questions[t],o=t+1;if(null===(n=i.branching)||void 0===n||!n.type)return t===e.questions.length-1?Ns.End:o;if(i.branching.type===Ns.End)return Ns.End;if(i.branching.type===Ns.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===Ns.ResponseBased){if(i.type===As.SingleChoice){var s,a,l=i.choices.indexOf("".concat(r));if(null!==(s=i.branching)&&void 0!==s&&null!==(a=s.responseValues)&&void 0!==a&&a.hasOwnProperty(l)){var c=i.branching.responseValues[l];return Number.isInteger(c)?c:c===Ns.End?Ns.End:o}}else if(i.type===As.Rating){var u,d;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(e,t){if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(r,i.scale);if(null!==(u=i.branching)&&void 0!==u&&null!==(d=u.responseValues)&&void 0!==d&&d.hasOwnProperty(h)){var p=i.branching.responseValues[h];return Number.isInteger(p)?p:p===Ns.End?Ns.End:o}}return o}return za.warn("Falling back to next question index due to unexpected branching type"),o}function Ja(e){return null!=e?e:"icontains"}function Ka(e){var t,r,n;if(null===(t=e.conditions)||void 0===t||!t.url)return!0;var i=null==$r||null===(r=$r.location)||void 0===r?void 0:r.href;if(!i)return!1;var o=[e.conditions.url];return Ya[Ja(null===(n=e.conditions)||void 0===n?void 0:n.urlMatchType)](o,i)}class Qa{constructor(e){i(this,"getNextSurveyStep",Xa),this.instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){this._decideServerResponse=!!e.surveys,za.info("decideServerResponse set to ".concat(this._decideServerResponse)),this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var e=(()=>{for(var e=[],t=0;t<localStorage.length;t++){var r=localStorage.key(t);null!=r&&r.startsWith(ks)&&e.push(r)}return e})();e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this.instance.config.disable_surveys)za.info("Disabled. Not loading surveys.");else{var e=null==Qr?void 0:Qr.__PosthogExtensions__;if(e){var t=e.generateSurveys;if(this._decideServerResponse)if(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new Ua(this.instance)),t)this._surveyManager=t(this.instance);else{var r=e.loadExternalDependency;r?r(this.instance,"surveys",(t=>{var r;t?za.error("Could not load surveys script",t):this._surveyManager=null===(r=e.generateSurveys)||void 0===r?void 0:r.call(e,this.instance)})):za.error("PostHog loadExternalDependency extension not found. Cannot load remote config.")}else za.warn("Decide not loaded yet. Not loading surveys.")}else za.error("PostHog Extensions not found.")}}getSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return za.info("Disabled. Not loading surveys."),e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new Ua(this.instance));var r=this.instance.get_property(Ci);if(r&&!t)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",callback:t=>{var r,n=t.statusCode;if(200!==n||!t.json)return za.error("Surveys API could not be loaded, status: ".concat(n)),e([]);var i,o=t.json.surveys||[],s=o.filter((e=>{var t,r,n,i,o,s,a,l,c,u,d,h;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(r=e.conditions)||void 0===r||null===(n=r.events)||void 0===n?void 0:n.values)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0||(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c?void 0:c.values)&&(null===(u=e.conditions)||void 0===u||null===(d=u.actions)||void 0===d||null===(h=d.values)||void 0===h?void 0:h.length)>0}));s.length>0&&(null===(i=this._surveyEventReceiver)||void 0===i||i.register(s));return null===(r=this.instance.persistence)||void 0===r||r.register({[Ci]:o}),e(o)}})}isSurveyFeatureFlagEnabled(e){return!e||this.instance.featureFlags.isFeatureEnabled(e)}getActiveMatchingSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((t=>{var r,n=t.filter((e=>!(!e.start_date||e.end_date))).filter((e=>{var t;if(!e.conditions)return!0;var r=Ka(e),n=null===(t=e.conditions)||void 0===t||!t.selector||(null==Ur?void 0:Ur.querySelector(e.conditions.selector)),i=function(e){var t,r;if(null===(t=e.conditions)||void 0===t||!t.deviceTypes)return!0;if(!Kr)return!1;var n=Za.deviceType(Kr);return Ya[Ja(null===(r=e.conditions)||void 0===r?void 0:r.deviceTypesMatchType)](e.conditions.deviceTypes,n)}(e);return r&&n&&i})),i=null===(r=this._surveyEventReceiver)||void 0===r?void 0:r.getSurveys(),o=n.filter((e=>{var t,r,n,o,s,a,l,c,u;if(!(e.linked_flag_key||e.targeting_flag_key||e.internal_targeting_flag_key||null!==(t=e.feature_flag_keys)&&void 0!==t&&t.length))return!0;var d=this.isSurveyFeatureFlagEnabled(e.linked_flag_key),h=this.isSurveyFeatureFlagEnabled(e.targeting_flag_key),p=(null!==(r=null===(n=e.conditions)||void 0===n||null===(o=n.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)&&void 0!==r?r:0)>0,v=(null!==(a=null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(u=c.values)||void 0===u?void 0:u.length)&&void 0!==a?a:0)>0,g=!p&&!v||(null==i?void 0:i.includes(e.id)),f=this._canActivateRepeatedly(e)||this.isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key),m=this.checkFlags(e);return d&&h&&f&&g&&m}));return e(o)}),t)}checkFlags(e){var t;return null===(t=e.feature_flag_keys)||void 0===t||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this.instance.featureFlags.isFeatureEnabled(r)}))}_canActivateRepeatedly(e){var t;return Hn(null===(t=Qr.__PosthogExtensions__)||void 0===t?void 0:t.canActivateRepeatedly)?(za.warn("init was not called"),!1):Qr.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){Hn(this._surveyManager)?za.warn("init was not called"):this.getSurveys((t=>{var r=t.filter((t=>t.id===e))[0];this._surveyManager.canRenderSurvey(r)}))}renderSurvey(e,t){Hn(this._surveyManager)?za.warn("init was not called"):this.getSurveys((r=>{var n=r.filter((t=>t.id===e))[0];this._surveyManager.renderSurvey(n,null==Ur?void 0:Ur.querySelector(t))}))}}var el,tl,rl,nl,il=0,ol=[],sl=[],al=Wo.__b,ll=Wo.__r,cl=Wo.diffed,ul=Wo.__c,dl=Wo.unmount;function hl(e,t){Wo.__h&&Wo.__h(tl,e,il||t),il=0;var r=tl.__H||(tl.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:sl}),r.__[e]}function pl(e){return il=1,function(e,t,r){var n=hl(el++,2);if(n.t=e,!n.__c&&(n.__=[Il(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=tl,!tl.u)){var i=function(e,t,r){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,r);var s=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&n.__c.props===e)&&(!o||o.call(this,e,t,r))};tl.u=!0;var o=tl.shouldComponentUpdate,s=tl.componentWillUpdate;tl.componentWillUpdate=function(e,t,r){if(this.__e){var n=o;o=void 0,i(e,t,r),o=n}s&&s.call(this,e,t,r)},tl.shouldComponentUpdate=i}return n.__N||n.__}(Il,e)}function vl(e,t){var r=hl(el++,3);!Wo.__s&&Cl(r.__H,t)&&(r.__=e,r.i=t,tl.__H.__h.push(r))}function gl(e){return il=5,fl((function(){return{current:e}}),[])}function fl(e,t){var r=hl(el++,7);return Cl(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function ml(e){var t=tl.context[e.__c],r=hl(el++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(tl)),t.props.value):e.__}function _l(){for(var e;e=ol.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(wl),e.__H.__h.forEach(Sl),e.__H.__h=[]}catch(t){e.__H.__h=[],Wo.__e(t,e.__v)}}Wo.__b=function(e){tl=null,al&&al(e)},Wo.__r=function(e){ll&&ll(e),el=0;var t=(tl=e.__c).__H;t&&(rl===tl?(t.__h=[],tl.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=sl,e.__N=e.i=void 0}))):(t.__h.forEach(wl),t.__h.forEach(Sl),t.__h=[],el=0)),rl=tl},Wo.diffed=function(e){cl&&cl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ol.push(t)&&nl===Wo.requestAnimationFrame||((nl=Wo.requestAnimationFrame)||bl)(_l)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==sl&&(e.__=e.__V),e.i=void 0,e.__V=sl}))),rl=tl=null},Wo.__c=function(e,t){t.some((function(e){try{e.__h.forEach(wl),e.__h=e.__h.filter((function(e){return!e.__||Sl(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Wo.__e(r,e.__v)}})),ul&&ul(e,t)},Wo.unmount=function(e){dl&&dl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{wl(e)}catch(e){t=e}})),r.__H=void 0,t&&Wo.__e(t,r.__v))};var yl="function"==typeof requestAnimationFrame;function bl(e){var t,r=function(){clearTimeout(n),yl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);yl&&(t=requestAnimationFrame(r))}function wl(e){var t=tl,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),tl=t}function Sl(e){var t=tl;e.__c=e.__(),tl=t}function Cl(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function Il(e,t){return"function"==typeof t?t(e):t}var kl=Ur;var El=0;function xl(e,t,r,n,i,o){var s,a,l={};for(a in t)"ref"==a?s=t[a]:l[a]=t[a];var c={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--El,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return Wo.vnode&&Wo.vnode(c),c}var Tl=xl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:xl("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Ml=xl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:xl("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Rl=xl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:xl("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Al=xl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:xl("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Nl=xl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:xl("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Fl=xl("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:xl("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"black"})}),Ol=xl("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl("g",{"clip-path":"url(#clip0_2415_6911)",children:[xl("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:xl("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),xl("g",{mask:"url(#mask0_2415_6911)",children:[xl("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),xl("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),xl("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),xl("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),xl("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),xl("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),xl("defs",{children:xl("clipPath",{id:"clip0_2415_6911",children:xl("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),Pl=xl("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:xl("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});function Ll(){return xl("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Ol]})}function Dl(e){var{text:t,submitDisabled:r,appearance:n,onSubmit:i,link:o,onPreviewSubmit:s}=e,{isPreviewMode:a,isPopup:l}=ml(Vs),c=n.submitButtonTextColor||Ms(n.submitButtonColor||Fs.submitButtonColor);return xl("div",{className:"bottom-section",children:[xl("div",{className:"buttons",children:xl("button",{className:"form-submit",disabled:r&&!a,type:"button",style:l?{color:c}:{},onClick:()=>{a?null==s||s():(o&&(null==$r||$r.open(o)),i())},children:t})}),!n.whiteLabel&&xl(Ll,{})]})}function Bl(e){var{question:t,description:r,descriptionContentType:n,backgroundColor:i,forceDisableHtml:o}=e,{isPopup:s}=ml(Vs);return xl("div",{style:s?{backgroundColor:i||Fs.backgroundColor}:{},children:[xl("div",{className:"survey-question",children:t}),r&&Zs({component:ts("div",{className:"survey-question-description"}),children:r,renderAsHtml:!o&&"text"!==n})]})}function ql(e){var{onClick:t}=e,{isPreviewMode:r}=ml(Vs);return xl("div",{className:"cancel-btn-wrapper",onClick:t,disabled:r,children:xl("button",{className:"form-cancel",onClick:t,disabled:r,children:Fl})})}function Hl(e){var{header:r,description:n,contentType:i,forceDisableHtml:o,appearance:s,onClose:a,styleOverrides:l}=e,c=Ms(s.backgroundColor||Fs.backgroundColor),{isPopup:u}=ml(Vs);return xl(ns,{children:xl("div",{className:"thank-you-message",style:t({},l),children:xl("div",{className:"thank-you-message-container",children:[u&&xl(ql,{onClick:()=>a()}),xl("h3",{className:"thank-you-message-header",style:{color:c},children:r}),n&&Zs({component:ts("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!o&&"text"!==i,style:{color:c}}),u&&xl(Dl,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})})})}function $l(e){var t,r=gl(null),[n,i]=pl(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return vl((()=>{if(r.current){var e=function(e){var t=Cs.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";var r=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!r)return"black";var n=parseInt(r[1]),i=parseInt(r[2]),o=parseInt(r[3]);return Math.sqrt(n*n*.299+i*i*.587+o*o*.114)>127.5?"black":"white"}(r.current);i(e)}}),[e.appearance,e.forceUpdate]),{ref:r,textColor:n}}function Wl(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o}=e,s=gl(null),[a,l]=pl("");return xl("div",{ref:s,children:[xl(Bl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:n.backgroundColor,forceDisableHtml:r}),xl("textarea",{rows:4,placeholder:null==n?void 0:n.placeholder,onInput:e=>l(e.currentTarget.value)}),xl(Dl,{text:t.buttonText||"Submit",submitDisabled:!a&&!t.optional,appearance:n,onSubmit:()=>i(a),onPreviewSubmit:()=>o(a)})]})}function Vl(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o}=e;return xl(ns,{children:[xl(Bl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r}),xl(Dl,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function Zl(e){var{question:t,forceDisableHtml:r,displayQuestionIndex:n,appearance:i,onSubmit:o,onPreviewSubmit:s}=e,a=t.scale,l=10===t.scale?0:1,[c,u]=pl(null);return xl(ns,{children:[xl(Bl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r,backgroundColor:i.backgroundColor}),xl("div",{className:"rating-section",children:[xl("div",{className:"rating-options",children:["emoji"===t.display&&xl("div",{className:"rating-options-emoji",children:(3===t.scale?Ul:zl).map(((e,t)=>{var r=t+1===c;return xl("button",{className:"ratings-emoji question-".concat(n,"-rating-").concat(t," ").concat(r?"rating-active":null),value:t+1,type:"button",onClick:()=>{u(t+1)},style:{fill:r?i.ratingButtonActiveColor:i.ratingButtonColor,borderColor:i.borderColor},children:e},t)}))}),"number"===t.display&&xl("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat(".concat(a-l+1,", minmax(0, 1fr))")},children:Kl(t.scale).map(((e,t)=>xl(Gl,{displayQuestionIndex:n,active:c===e,appearance:i,num:e,setActiveNumber:e=>{u(e)}},t)))})]}),xl("div",{className:"rating-text",children:[xl("div",{children:t.lowerBoundLabel}),xl("div",{children:t.upperBoundLabel})]})]}),xl(Dl,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:qn(c)&&!t.optional,appearance:i,onSubmit:()=>o(c),onPreviewSubmit:()=>s(c)})]})}function Gl(e){var{num:t,active:r,displayQuestionIndex:n,appearance:i,setActiveNumber:o}=e,{textColor:s,ref:a}=$l({appearance:i,defaultTextColor:"black",forceUpdate:r});return xl("button",{ref:a,className:"ratings-number question-".concat(n,"-rating-").concat(t," ").concat(r?"rating-active":null),type:"button",onClick:()=>{o(t)},style:{color:s,backgroundColor:r?i.ratingButtonActiveColor:i.ratingButtonColor,borderColor:i.borderColor},children:t})}function jl(e){var{question:t,forceDisableHtml:r,displayQuestionIndex:n,appearance:i,onSubmit:o,onPreviewSubmit:s}=e,a=gl(null),l=fl((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var n=Bs(t,Ds(t));return e.hasOpenChoice&&(e.choices.push(r),n.push(r)),n})(t)),[t]),[c,u]=pl(t.type===As.MultipleChoice?[]:null),[d,h]=pl(!1),[p,v]=pl(""),g=t.type===As.SingleChoice?"radio":"checkbox";return xl("div",{ref:a,children:[xl(Bl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r,backgroundColor:i.backgroundColor}),xl("div",{className:"multiple-choice-options",children:l.map(((e,r)=>{var i="choice-option",o=e,s=e;return t.hasOpenChoice&&r===t.choices.length-1&&(i+=" choice-option-open"),xl("div",{className:i,children:[xl("input",{type:g,id:"surveyQuestion".concat(n,"Choice").concat(r),name:"question".concat(n),value:o,disabled:!o,onInput:()=>t.hasOpenChoice&&r===t.choices.length-1?h(!d):t.type===As.SingleChoice?u(o):t.type===As.MultipleChoice&&Rn(c)?c.includes(o)?u(c.filter((e=>e!==o))):u([...c,o]):void 0}),xl("label",{htmlFor:"surveyQuestion".concat(n,"Choice").concat(r),style:{color:"black"},children:t.hasOpenChoice&&r===t.choices.length-1?xl(ns,{children:[xl("span",{children:[s,":"]}),xl("input",{type:"text",id:"surveyQuestion".concat(n,"Choice").concat(r,"Open"),name:"question".concat(n),onInput:e=>{var r=e.currentTarget.value;return t.type===As.SingleChoice?u(r):t.type===As.MultipleChoice&&Rn(c)?v(r):void 0}})]}):s}),xl("span",{className:"choice-check",style:{color:"black"},children:Pl})]})}))}),xl(Dl,{text:t.buttonText||"Submit",submitDisabled:(qn(c)||Rn(c)&&!d&&0===c.length||Rn(c)&&d&&!p&&0===c.length&&!t.optional)&&!t.optional,appearance:i,onSubmit:()=>{d&&t.type===As.MultipleChoice?Rn(c)&&o([...c,p]):o(c)},onPreviewSubmit:()=>{d&&t.type===As.MultipleChoice?Rn(c)&&s([...c,p]):s(c)}})]})}var Ul=[Rl,Ml,Tl],zl=[Al,Rl,Ml,Tl,Nl],Yl=[1,2,3,4,5],Xl=[1,2,3,4,5,6,7],Jl=[0,1,2,3,4,5,6,7,8,9,10];function Kl(e){switch(e){case 5:default:return Yl;case 7:return Xl;case 10:return Jl}}var Ql=an("[Surveys]"),ec=$r,tc=Ur;class rc{constructor(e){var t=this;i(this,"canShowNextEventBasedSurvey",(()=>{var e,t=tc.querySelectorAll("div[class^=PostHogSurvey]");return!(t.length>0)||1===(null===(e=t[t.length-1].shadowRoot)||void 0===e?void 0:e.childElementCount)})),i(this,"handlePopoverSurvey",(e=>{var t,r=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,n=localStorage.getItem("lastSeenSurveyDate");if(r&&n){var i=new Date,o=Math.abs(i.getTime()-new Date(n).getTime());if(Math.ceil(o/864e5)<r)return}var s=(e=>!!localStorage.getItem($s(e))&&!Hs(e))(e);if(!s){this.addSurveyToFocus(e.id);var a=((e,t,r)=>{var n=Is.createElement("div");n.className="PostHogSurvey".concat(t);var i=n.attachShadow({mode:"open"});if(e){var o=Object.assign(Is.createElement("style"),{innerText:e});i.appendChild(o)}return Is.body.appendChild(n),i})(xs(null==e?void 0:e.appearance),e.id);ws(xl(ic,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),a)}})),i(this,"handleWidget",(e=>{var t=function(e){var t,r=kl.createElement("div");r.className="PostHogWidget".concat(e.id);var n,i=r.attachShadow({mode:"open"}),o=(n=null===(t=e.appearance)||void 0===t?void 0:t.widgetColor,"\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ".concat(n||"#e0a045",";\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: 9999999;\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n "));return i.append(Object.assign(kl.createElement("style"),{innerText:o})),kl.body.appendChild(r),i}(e),r=xs(e.appearance);t.appendChild(Object.assign(tc.createElement("style"),{innerText:r})),ws(xl(sc,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus},"feedback-survey"),t)})),i(this,"handleWidgetSelector",(e=>{var t,r=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&tc.querySelector(e.appearance.widgetSelector);if(r)if(0===tc.querySelectorAll(".PostHogWidget".concat(e.id)).length)this.handleWidget(e);else if(1===tc.querySelectorAll(".PostHogWidget".concat(e.id)).length&&!r.getAttribute("PHWidgetSurveyClickListener")){var n,i,o=null===(n=tc.querySelector(".PostHogWidget".concat(e.id)))||void 0===n||null===(i=n.shadowRoot)||void 0===i?void 0:i.querySelector(".survey-form");wn(r,"click",(()=>{o&&(o.style.display="none"===o.style.display?"block":"none",wn(o,"PHSurveyClosed",(()=>{this.removeSurveyFromFocus(e.id),o.style.display="none"})))})),r.setAttribute("PHWidgetSurveyClickListener","true")}})),i(this,"canRenderSurvey",(e=>{var t={visible:!1};return e.end_date?(t.disabledReason="survey was completed on ".concat(e.end_date),t):e.type!=Rs.Popover?(t.disabledReason="Only Popover survey types can be rendered",t):!e.linked_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)?!e.targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)?!e.internal_targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason="internal targeting feature flag ".concat(e.internal_targeting_flag_key," is false"),t):(t.disabledReason="targeting feature flag ".concat(e.targeting_flag_key," is false"),t):(t.disabledReason="linked feature flag ".concat(e.linked_flag_key," is false"),t)})),i(this,"renderSurvey",((e,t)=>{ws(xl(ic,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)})),i(this,"callSurveysAndEvaluateDisplayLogic",(function(){var e,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=t.posthog)||void 0===e||e.getActiveMatchingSurveys((e=>{var r=e.filter((e=>"api"!==e.type));t.sortSurveysByAppearanceDelay(r).forEach((e=>{if(qn(t.surveyInFocus)&&Ka(e)){var r,n,i;if(e.type===Rs.Widget)"tab"===(null===(r=e.appearance)||void 0===r?void 0:r.widgetType)&&0===tc.querySelectorAll(".PostHogWidget".concat(e.id)).length&&t.handleWidget(e),"selector"===(null===(n=e.appearance)||void 0===n?void 0:n.widgetType)&&null!==(i=e.appearance)&&void 0!==i&&i.widgetSelector&&t.handleWidgetSelector(e);e.type===Rs.Popover&&t.canShowNextEventBasedSurvey()&&t.handlePopoverSurvey(e)}}))}),r)})),i(this,"addSurveyToFocus",(e=>{qn(this.surveyInFocus)||Ql.error("Survey ".concat([...this.surveyInFocus]," already in focus. Cannot add survey ").concat(e,".")),this.surveyInFocus=e})),i(this,"removeSurveyFromFocus",(e=>{this.surveyInFocus!==e&&Ql.error("Survey ".concat(e," is not in focus. Cannot remove survey ").concat(e,".")),this.surveyInFocus=null})),this.posthog=e,this.surveyInFocus=null}sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var r,n;return((null===(r=e.appearance)||void 0===r?void 0:r.surveyPopupDelaySeconds)||0)-((null===(n=t.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)}))}getTestAPI(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}function nc(e){if(tc&&ec){var t=new rc(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}}function ic(e){var r,n,i,o,s,a,{survey:l,forceDisableHtml:c,posthog:u,style:d,previewPageIndex:h,removeSurveyFromFocus:p,isPopup:v,onPreviewSubmit:g=(()=>{})}=e,f=Number.isInteger(h),m=null!==(r=l.appearance)&&void 0!==r&&r.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:_,isSurveySent:y,setIsPopupVisible:b}=function(e,t,r,n,i){var[o,s]=pl(n||0===r),[a,l]=pl(!1);return vl((()=>{if(t){if(!n){var o,a=()=>{i(e.id),s(!1)},c=()=>{var t,r;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(l(!0),i(e.id),null!==(r=e.appearance)&&void 0!==r&&r.autoDisappear&&setTimeout((()=>{s(!1)}),5e3)):(i(e.id),s(!1))},u=()=>{var r;s(!0),ec.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(r=t.get_session_replay_url)||void 0===r?void 0:r.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())};return wn(ec,"PHSurveyClosed",a),wn(ec,"PHSurveySent",c),r>0?(o=setTimeout((()=>{u()}),r),()=>{clearTimeout(o),ec.removeEventListener("PHSurveyClosed",a),ec.removeEventListener("PHSurveySent",c)}):(u(),()=>{ec.removeEventListener("PHSurveyClosed",a),ec.removeEventListener("PHSurveySent",c)})}}else Ql.error("usePopupVisibility hook called without a PostHog instance.")}),[]),vl((()=>{var t;if(!n&&null!==(t=e.conditions)&&void 0!==t&&t.url){var r=()=>{Ka(e)||(s(!1),i(e.id))};wn(ec,"popstate",r),wn(ec,"hashchange",r);var o=ec.history.pushState,a=ec.history.replaceState;return ec.history.pushState=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];o.apply(this,t),r()},ec.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];a.apply(this,t),r()},()=>{ec.removeEventListener("popstate",r),ec.removeEventListener("hashchange",r),ec.history.pushState=o,ec.history.replaceState=a}}}),[n,e,i]),{isPopupVisible:o,isSurveySent:a,setIsPopupVisible:s}}(l,u,m,f,p),w=y||h===l.questions.length,S=null!==(n=d)&&void 0!==n&&n.left&&$n(null===(i=d)||void 0===i?void 0:i.left)?{left:d.left-40}:{};return f&&((d=d||{}).left="unset",d.right="unset",d.transform="unset"),_?xl(Vs.Provider,{value:{isPreviewMode:f,previewPageIndex:h,handleCloseSurveyPopup:()=>Ls(l,u,f),isPopup:v||!1,onPreviewSubmit:g},children:w?xl(Hl,{header:(null===(o=l.appearance)||void 0===o?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null===(s=l.appearance)||void 0===s?void 0:s.thankYouMessageDescription)||"",forceDisableHtml:!!c,contentType:null===(a=l.appearance)||void 0===a?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||Fs,styleOverrides:t(t({},d),S),onClose:()=>b(!1)}):xl(oc,{survey:l,forceDisableHtml:!!c,posthog:u,styleOverrides:d})}):null}function oc(e){var r,n,{survey:i,forceDisableHtml:o,posthog:s,styleOverrides:a}=e,l=Ms((null===(r=i.appearance)||void 0===r?void 0:r.backgroundColor)||Fs.backgroundColor),[c,u]=pl({}),{isPreviewMode:d,previewPageIndex:h,handleCloseSurveyPopup:p,isPopup:v,onPreviewSubmit:g}=ml(Vs),[f,m]=pl(h||0),_=fl((()=>qs(i)),[i]);vl((()=>{m(null!=h?h:0)}),[h]);return xl("form",{className:"survey-form",style:v?t({color:l,borderColor:null===(n=i.appearance)||void 0===n?void 0:n.borderColor},a):{},children:_.map(((e,r)=>{var n,{originalQuestionIndex:a}=e;return(d?f===a:f===r)&&xl("div",{className:"survey-box",style:v?{backgroundColor:(null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||Fs.backgroundColor}:{},children:[v&&xl(ql,{onClick:()=>p()}),ac({question:e,forceDisableHtml:o,displayQuestionIndex:r,appearance:i.appearance||Fs,onSubmit:e=>(e=>{var{res:r,originalQuestionIndex:n,displayQuestionIndex:o}=e;if(s){var a=0===n?"$survey_response":"$survey_response_".concat(n);if(u(t(t({},c),{},{[a]:r})),s.getNextSurveyStep){var l=s.getNextSurveyStep(i,o,r);l===Ns.End?Ps(t(t({},c),{},{[a]:r}),i,s):m(l)}else o===i.questions.length-1?Ps(t(t({},c),{},{[a]:r}),i,s):m(o+1)}else Ql.error("onNextButtonClick called without a PostHog instance.")})({res:e,originalQuestionIndex:a,displayQuestionIndex:r}),onPreviewSubmit:g})]})}))})}function sc(e){var t,r,{survey:n,forceDisableHtml:i,posthog:o,readOnly:s,removeSurveyFromFocus:a}=e,[l,c]=pl(!1),[u,d]=pl({}),h=gl(null);return vl((()=>{var e,t;if(o){if(!s){if("tab"===(null===(e=n.appearance)||void 0===e?void 0:e.widgetType)&&h.current){var r,i=h.current.getBoundingClientRect(),a={top:"50%",left:parseInt("".concat(i.right-360)),bottom:"auto",borderRadius:10,borderBottom:"1.5px solid ".concat((null===(r=n.appearance)||void 0===r?void 0:r.borderColor)||"#c9c6c6")};d(a)}if("selector"===(null===(t=n.appearance)||void 0===t?void 0:t.widgetType)){var u,p=null!==(u=tc.querySelector(n.appearance.widgetSelector||""))&&void 0!==u?u:void 0;wn(p,"click",(()=>{c(!l)})),null==p||p.setAttribute("PHWidgetSurveyClickListener","true")}}}else Ql.error("FeedbackWidget called without a PostHog instance.")}),[]),xl(ns,{children:["tab"===(null===(t=n.appearance)||void 0===t?void 0:t.widgetType)&&xl("div",{className:"ph-survey-widget-tab",ref:h,onClick:()=>!s&&c(!l),style:{color:Ms(n.appearance.widgetColor)},children:[xl("div",{className:"ph-survey-widget-tab-icon"}),(null===(r=n.appearance)||void 0===r?void 0:r.widgetLabel)||""]}),l&&xl(ic,{posthog:o,survey:n,forceDisableHtml:i,style:u,removeSurveyFromFocus:a,isPopup:!0},"feedback-widget-survey")]})}var ac=e=>{var{question:r,forceDisableHtml:n,displayQuestionIndex:i,appearance:o,onSubmit:s,onPreviewSubmit:a}=e,l={[As.Open]:Wl,[As.Link]:Vl,[As.Rating]:Zl,[As.SingleChoice]:jl,[As.MultipleChoice]:jl},c={question:r,forceDisableHtml:n,appearance:o,onPreviewSubmit:e=>{a(e)},onSubmit:e=>{s(e)}},u={[As.Open]:{},[As.Link]:{},[As.Rating]:{displayQuestionIndex:i},[As.SingleChoice]:{displayQuestionIndex:i},[As.MultipleChoice]:{displayQuestionIndex:i}},d=l[r.type],h=t(t({},c),u[r.type]);return xl(d,t({},h))};function lc(e){return!Ln(Event)&&cc(e,Event)}function cc(e,t){try{return e instanceof t}catch(e){return!1}}function uc(e){return qn(e)||!On(e)&&!An(e)}function dc(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function hc(e){return dc(e,"DOMError")}Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.canActivateRepeatedly=Hs,Qr.__PosthogExtensions__.generateSurveys=nc,Qr.extendPostHogWithSurveys=nc;var pc=/\(error: (.*)\)/,vc=50,gc="?";function fc(e,t,r,n){var i={platform:"web:javascript",filename:e,function:"<anonymous>"===t?gc:t,in_app:!0};return Ln(r)||(i.lineno=r),Ln(n)||(i.colno=n),i}var mc=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,_c=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,yc=/\((\S*)(?::(\d+))(?::(\d+))\)/,bc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,wc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Sc=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],o=e.split("\n"),s=r;s<o.length;s++){var a=o[s];if(!(a.length>1024)){var l=pc.test(a)?a.replace(pc,"$1"):a;if(!l.match(/\S*Error: /)){for(var c of i){var u=c(l);if(u){n.push(u);break}}if(n.length>=vc)break}}}return function(e){if(!e.length)return[];var r=Array.from(e);return r.reverse(),r.slice(0,vc).map((e=>t(t({},e),{},{filename:e.filename||Cc(r).filename,function:e.function||gc})))}(n)}}(...[[30,e=>{var t=mc.exec(e);if(t){var[,r,n,i]=t;return fc(r,gc,+n,+i)}var o=_c.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var s=yc.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[a,l]=Ic(o[1]||gc,o[2]);return fc(l,a,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,e=>{var t=bc.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var r=wc.exec(t[3]);r&&(t[1]=t[1]||"eval",t[3]=r[1],t[4]=r[2],t[5]="")}var n=t[3],i=t[1]||gc;return[i,n]=Ic(i,n),fc(n,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function Cc(e){return e[e.length-1]||{}}var Ic=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:gc,r?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]},kc=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Ec(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.stacktrace||e.stack||"",n=function(e){if(e&&xc.test(e.message))return 1;return 0}(e);try{var i=Sc(r,n);return i.slice(0,i.length-t)}catch(e){}return[]}var xc=/Minified React error #\d+;/i;function Tc(e,t){var r,n,i=Ec(e),o=null===(r=null==t?void 0:t.handled)||void 0===r||r,s=null!==(n=null==t?void 0:t.synthetic)&&void 0!==n&&n;return{$exception_list:[{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:function(e){var t=e.message;if(t.error&&"string"==typeof t.error.message)return t.error.message;return t}(e),stacktrace:{frames:i,type:"raw"},mechanism:{handled:o,synthetic:s}}],$exception_level:"error"}}function Mc(e,t){var r,n,i,o=null===(r=null==t?void 0:t.handled)||void 0===r||r,s=null===(n=null==t?void 0:t.synthetic)||void 0===n||n,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(i=null==t?void 0:t.defaultExceptionType)&&void 0!==i?i:"Error",value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:s}};if(null!=t&&t.syntheticException){var l=Ec(t.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function Rc(e){return Dn(e)&&!Bn(e)&&rn.indexOf(e)>=0}function Ac(e,t){var r,n,i=null===(r=null==t?void 0:t.handled)||void 0===r||r,o=null===(n=null==t?void 0:t.synthetic)||void 0===n||n,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:lc(e)?e.constructor.name:"Error",a=null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:"Non-Error ".concat("exception"," captured with keys: ",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var n=r.length;n>0;n--){var i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length||i.length<=t?i:"".concat(i.slice(0,t),"...")}return""}(e)),l={type:s,value:a,mechanism:{handled:i,synthetic:o}};if(null!=t&&t.syntheticException){var c=Ec(null==t?void 0:t.syntheticException,1);c.length&&(l.stacktrace={frames:c,type:"raw"})}return{$exception_list:[l],$exception_level:Rc(e.level)?e.level:"error"}}function Nc(e,r){var{error:n,event:i}=e,o={$exception_list:[]},s=n||i;if(hc(s)||function(e){return dc(e,"DOMException")}(s)){var a=s;if(function(e){return"stack"in e}(s))o=Tc(s,r);else{var l=a.name||(hc(a)?"DOMError":"DOMException"),c=a.message?"".concat(l,": ").concat(a.message):l,u=hc(a)?"DOMError":"DOMException";o=Mc(c,t(t({},r),{},{overrideExceptionType:u,defaultExceptionMessage:c}))}return"code"in a&&(o.$exception_DOMException_code="".concat(a.code)),o}if(function(e){return dc(e,"ErrorEvent")}(s)&&s.error)return Tc(s.error,r);if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return cc(e,Error)}}(s))return Tc(s,r);if(function(e){return dc(e,"Object")}(s)||lc(s))return Ac(s,r);if(Ln(n)&&Dn(i)){var d="Error",h=i,p=i.match(kc);return p&&(d=p[1],h=p[2]),Mc(h,t(t({},r),{},{overrideExceptionType:d,defaultExceptionMessage:h}))}return Mc(s,r)}function Fc(e){var[t]=e,r=function(e){if(uc(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}(t);return uc(r)?Mc("Non-Error promise rejection captured with value: ".concat(String(r)),{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):Nc({event:r},{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(r)})}var Oc=an("[ExceptionAutocapture]"),Pc={wrapOnError:e=>{var t=$r;t||Oc.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var s=Nc({event:i[0],error:i[4]});return e(s),null!==(t=null==r?void 0:r(...i))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection:e=>{var t=$r;t||Oc.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var n,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];var a=Fc(o);return e(a),null!==(n=null==r?void 0:r.apply(t,o))&&void 0!==n&&n},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}}};Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.errorWrappingFunctions=Pc,Qr.__PosthogExtensions__.parseErrorAsProperties=Nc,Qr.posthogErrorWrappingFunctions=Pc,Qr.parseErrorAsProperties=Nc;var Lc=(e,t)=>{if(e){var{sessionId:r,windowId:n}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",r),t.headers.set("X-POSTHOG-WINDOW-ID",n)}};Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{};var Dc={_patchFetch:e=>bo($r,"fetch",(t=>function(){var r=n((function*(r,n){var i=new Request(r,n);return Lc(e,i),t(i)}));return function(e,t){return r.apply(this,arguments)}}())),_patchXHR:e=>bo($r.XMLHttpRequest.prototype,"open",(t=>function(r,n){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,a=new Request(n);return Lc(e,a),t.call(this,r,a.url,i,o,s)}))};Qr.__PosthogExtensions__.tracingHeadersPatchFns=Dc,Qr.postHogTracingHeadersPatchFns=Dc;var Bc,qc,Hc,$c=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Wc=function(e){if("loading"===document.readyState)return"loading";var t=$c();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},Vc=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Zc=function(e,t){var r="";try{for(;e&&9!==e.nodeType;){var n=e,i=n.id?"#"+n.id:Vc(n)+(n.classList&&n.classList.value&&n.classList.value.trim()&&n.classList.value.trim().length?"."+n.classList.value.trim().replace(/\s+/g,"."):"");if(r.length+i.length>(t||100)-1)return r||i;if(r=r?i+">"+r:i,n.id)break;e=n.parentNode}}catch(e){}return r},Gc=-1,jc=function(){return Gc},Uc=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Gc=t.timeStamp,e(t))}),!0)},zc=function(){var e=$c();return e&&e.activationStart||0},Yc=function(e,t){var r=$c(),n="navigate";return jc()>=0?n="back-forward-cache":r&&(document.prerendering||zc()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},Xc=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(e){}},Jc=function(e,t,r,n){var i,o;return function(s){t.value>=0&&(s||n)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Kc=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Qc=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},eu=function(e){var t=!1;return function(){t||(e(),t=!0)}},tu=-1,ru=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},nu=function(e){"hidden"===document.visibilityState&&tu>-1&&(tu="visibilitychange"===e.type?e.timeStamp:0,ou())},iu=function(){addEventListener("visibilitychange",nu,!0),addEventListener("prerenderingchange",nu,!0)},ou=function(){removeEventListener("visibilitychange",nu,!0),removeEventListener("prerenderingchange",nu,!0)},su=function(){return tu<0&&(tu=ru(),iu(),Uc((function(){setTimeout((function(){tu=ru(),iu()}),0)}))),{get firstHiddenTime(){return tu}}},au=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},lu=[1800,3e3],cu=function(e,t){t=t||{},au((function(){var r,n=su(),i=Yc("FCP"),o=Xc("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-zc(),0),i.entries.push(e),r(!0)))}))}));o&&(r=Jc(e,i,lu,t.reportAllChanges),Uc((function(n){i=Yc("FCP"),r=Jc(e,i,lu,t.reportAllChanges),Kc((function(){i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},uu=[.1,.25],du=0,hu=1/0,pu=0,vu=function(e){e.forEach((function(e){e.interactionId&&(hu=Math.min(hu,e.interactionId),pu=Math.max(pu,e.interactionId),du=pu?(pu-hu)/7+1:0)}))},gu=function(){"interactionCount"in performance||Bc||(Bc=Xc("event",vu,{type:"event",buffered:!0,durationThreshold:0}))},fu=[],mu=new Map,_u=0,yu=function(){return(Bc?du:performance.interactionCount||0)-_u},bu=[],wu=function(e){if(bu.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=fu[fu.length-1],r=mu.get(e.interactionId);if(r||fu.length<10||e.duration>t.latency){if(r)e.duration>r.latency?(r.entries=[e],r.latency=e.duration):e.duration===r.latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e);else{var n={id:e.interactionId,latency:e.duration,entries:[e]};mu.set(n.id,n),fu.push(n)}fu.sort((function(e,t){return t.latency-e.latency})),fu.length>10&&fu.splice(10).forEach((function(e){return mu.delete(e.id)}))}}},Su=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=eu(e),"hidden"===document.visibilityState?e():(r=t(e),Qc(e)),r},Cu=[200,500],Iu=[],ku=[],Eu=new WeakMap,xu=new Map,Tu=-1,Mu=function(e){Iu=Iu.concat(e),Ru()},Ru=function(){Tu<0&&(Tu=Su(Au))},Au=function(){xu.size>10&&xu.forEach((function(e,t){mu.has(t)||xu.delete(t)}));var e=fu.map((function(e){return Eu.get(e.entries[0])})),t=ku.length-50;ku=ku.filter((function(r,n){return n>=t||e.includes(r)}));for(var r=new Set,n=0;n<ku.length;n++){var i=ku[n];Nu(i.startTime,i.processingEnd).forEach((function(e){r.add(e)}))}for(var o=0;o<50;o++){var s=Iu[Iu.length-1-o];if(!s||s.startTime<Hc)break;r.add(s)}Iu=Array.from(r),Tu=-1};bu.push((function(e){e.interactionId&&e.target&&!xu.has(e.interactionId)&&xu.set(e.interactionId,e.target)}),(function(e){var t,r=e.startTime+e.duration;Hc=Math.max(Hc,e.processingEnd);for(var n=ku.length-1;n>=0;n--){var i=ku[n];if(Math.abs(r-i.renderTime)<=8){(t=i).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:r,entries:[e]},ku.push(t)),(e.interactionId||"first-input"===e.entryType)&&Eu.set(e,t),Ru()}));var Nu=function(e,t){for(var r,n=[],i=0;r=Iu[i];i++)if(!(r.startTime+r.duration<e)){if(r.startTime>t)break;n.push(r)}return n},Fu=[2500,4e3],Ou={},Pu={onLCP:function(e,t){!function(e,t){t=t||{},au((function(){var r,n=su(),i=Yc("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-zc(),0),i.entries=[e],r())}))},s=Xc("largest-contentful-paint",o);if(s){r=Jc(e,i,Fu,t.reportAllChanges);var a=eu((function(){Ou[i.id]||(o(s.takeRecords()),s.disconnect(),Ou[i.id]=!0,r(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Su(a)}),!0)})),Qc(a),Uc((function(n){i=Yc("LCP"),r=Jc(e,i,Fu,t.reportAllChanges),Kc((function(){i.value=performance.now()-n.timeStamp,Ou[i.id]=!0,r(!0)}))}))}}))}((function(t){var r=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var r=$c();if(r){var n=r.activationStart||0,i=e.entries[e.entries.length-1],o=i.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===i.url}))[0],s=Math.max(0,r.responseStart-n),a=Math.max(s,o?(o.requestStart||o.startTime)-n:0),l=Math.max(a,o?o.responseEnd-n:0),c=Math.max(l,i.startTime-n);t={element:Zc(i.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:l-a,elementRenderDelay:c-l,navigationEntry:r,lcpEntry:i},i.url&&(t.url=i.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onCLS:function(e,t){!function(e,t){t=t||{},cu(eu((function(){var r,n=Yc("CLS",0),i=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],r=o[o.length-1];i&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>n.value&&(n.value=i,n.entries=o,r())},a=Xc("layout-shift",s);a&&(r=Jc(e,n,uu,t.reportAllChanges),Qc((function(){s(a.takeRecords()),r(!0)})),Uc((function(){i=0,n=Yc("CLS",0),r=Jc(e,n,uu,t.reportAllChanges),Kc((function(){return r()}))})),setTimeout(r,0))})))}((function(t){var r=function(e){var t,r={};if(e.entries.length){var n=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(n&&n.sources&&n.sources.length){var i=(t=n.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];i&&(r={largestShiftTarget:Zc(i.node),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:i,largestShiftEntry:n,loadState:Wc(n.startTime)})}}return Object.assign(e,{attribution:r})}(t);e(r)}),t)},onFCP:function(e,t){cu((function(t){var r=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:Wc(jc())};if(e.entries.length){var r=$c(),n=e.entries[e.entries.length-1];if(r){var i=r.activationStart||0,o=Math.max(0,r.responseStart-i);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:Wc(e.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onINP:function(e,t){qc||(qc=Xc("long-animation-frame",Mu)),function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},au((function(){var r;gu();var n,i=Yc("INP"),o=function(e){Su((function(){e.forEach(wu);var t,r=(t=Math.min(fu.length-1,Math.floor(yu()/50)),fu[t]);r&&r.latency!==i.value&&(i.value=r.latency,i.entries=r.entries,n())}))},s=Xc("event",o,{durationThreshold:null!==(r=t.durationThreshold)&&void 0!==r?r:40});n=Jc(e,i,Cu,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Qc((function(){o(s.takeRecords()),n(!0)})),Uc((function(){_u=0,fu.length=0,mu.clear(),i=Yc("INP"),n=Jc(e,i,Cu,t.reportAllChanges)})))})))}((function(t){var r=function(e){var t=e.entries[0],r=Eu.get(t),n=t.processingStart,i=r.processingEnd,o=r.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=Nu(t.startTime,i),a=e.entries.find((function(e){return e.target})),l=a&&a.target||xu.get(t.interactionId),c=[t.startTime+t.duration,i].concat(s.map((function(e){return e.startTime+e.duration}))),u=Math.max.apply(Math,c),d={interactionTarget:Zc(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:u,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:n-t.startTime,processingDuration:i-n,presentationDelay:Math.max(u-i,0),loadState:Wc(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(r)}),t)}};Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.postHogWebVitalsCallbacks=Pu,Qr.postHogWebVitalsCallbacks=Pu;class Lu{constructor(){this.clicks=[]}isRageClick(e,t,r){var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(t-n.y)<30&&r-n.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:r}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var Du=an("[AutoCapture]");function Bu(e,t){return t.length>e?t.slice(0,e)+"...":t}function qu(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Di(t));return t}function Hu(e,t,r,n){var i=e.tagName.toLowerCase(),o={tag_name:i};Ui.indexOf(i)>-1&&!r&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Bu(1024,oo(e)):o.$el_text=Bu(1024,Gi(e)));var s=Vi(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),un(e.attributes,(function(r){var i;if((!Ji(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==n||!n.includes(r.name))&&!t&&io(r.value)&&(i=r.name,!Dn(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){var s=r.value;"class"===r.name&&(s=$i(s).join(" ")),o["attr__"+r.name]=Bu(1024,s)}}));for(var a=1,l=1,c=e;c=qu(c);)a++,c.tagName===e.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function $u(e,t){for(var r,n,{e:i,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,c=[e],u=e;u.parentNode&&!Bi(u,"body");)Hi(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,h=[],p={},v=!1,g=!1;if(un(c,(e=>{var t=Xi(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&io(v)&&v),Sn(Vi(e),"ph-no-capture")&&(g=!0),h.push(Hu(e,o,s,a));var r=function(e){if(!Xi(e))return{};var t={};return un(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),n=e.value;r&&n&&io(n)&&(t[r]=n)}})),t}(e);dn(p,r)})),g)return{props:{},explicitNoCapture:g};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?h[0].$el_text=oo(e):h[0].$el_text=Gi(e)),v){var f,m;h[0].attr__href=v;var _=null===(f=zn(v))||void 0===f?void 0:f.host,y=null==$r||null===(m=$r.location)||void 0===m?void 0:m.host;_&&y&&_!==y&&(d=v)}return{props:dn({$event_type:i.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:ao(h)},null!==(r=h[0])&&void 0!==r&&r.$el_text?{$el_text:null===(n=h[0])||void 0===n?void 0:n.$el_text}:{},d&&"click"===i.type?{$external_click_url:d}:{},p)}}class Wu{constructor(e){i(this,"_initialized",!1),i(this,"_isDisabledServerSide",null),i(this,"rageclicks",new Lu),i(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,r=On(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null===(e=r.url_allowlist)||void 0===e?void 0:e.map((e=>new RegExp(e))),r.url_ignorelist=null===(t=r.url_ignorelist)||void 0===t?void 0:t.map((e=>new RegExp(e))),r}_addDomEventHandlers(){if(this.isBrowserSupported()){if($r&&Ur){var e=e=>{e=e||(null==$r?void 0:$r.event);try{this._captureEvent(e)}catch(e){Du.error("Failed to capture event",e)}};if(wn(Ur,"submit",e,{capture:!0}),wn(Ur,"change",e,{capture:!0}),wn(Ur,"click",e,{capture:!0}),this.config.capture_copied_text){var t=e=>{e=e||(null==$r?void 0:$r.event),this._captureEvent(e,en)};wn(Ur,"copy",t,{capture:!0}),wn(Ur,"cut",t,{capture:!0})}}}else Du.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ri]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,r=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach((t=>{var n=null==Ur?void 0:Ur.querySelectorAll(t);null==n||n.forEach((n=>{e===n&&r.push(t)}))})),r}get isEnabled(){var e,t,r=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[ri],n=this._isDisabledServerSide;if(qn(n)&&!Wn(r)&&!this.instance.config.advanced_disable_decide)return!1;var i=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!i}_captureEvent(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(this.isEnabled){var r,n=ji(e);if(qi(n)&&(n=n.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!==(r=this.rageclicks)&&void 0!==r&&r.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var i=t===en;if(n&&Yi(n,e,this.config,i,i?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=$u(n,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(s)return!1;var a=this.getElementSelectors(n);if(a&&a.length>0&&(o.$element_selectors=a),t===en){var l,c=Zi(null==$r||null===(l=$r.getSelection())||void 0===l?void 0:l.toString()),u=e.type||"clipboard";if(!c)return!1;o.$selected_content=c,o.$copy_type=u}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return An(null==Ur?void 0:Ur.querySelectorAll)}}var Vu={};function Zu(e){return function(e,t){var r=Vu[e];if(r)return r;var n=t[e];if(Nn(n)&&!Fn())return Vu[e]=n.bind(t);var i=t.document;if(i&&An(i.createElement))try{var o=i.createElement("iframe");o.hidden=!0,i.head.appendChild(o);var s=o.contentWindow;s&&s[e]&&(n=s[e]),i.head.removeChild(o)}catch(t){sn.warn("Could not create sandbox iframe for ".concat(e," check, bailing to assignableWindow.").concat(e,": "),t)}return n&&An(n)?Vu[e]=n.bind(t):n}("MutationObserver",e)}function Gu(e,t){return $n(e)&&e>=t}class ju{asRequiredConfig(e){var t,r,n,i,o=this._defaultConfig((null==e?void 0:e.__onCapture)||this._captureDeadClick.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(n=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==n?n:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(i=null==e?void 0:e.mutation_threshold_ms)&&void 0!==i?i:o.mutation_threshold_ms,__onCapture:o.__onCapture}}constructor(e,t){i(this,"_clicks",[]),i(this,"_defaultConfig",(e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,__onCapture:e}))),i(this,"_onClick",(e=>{var t=function(e){var t=ji(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);qn(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&Ln(this._checkClickTimer)&&(this._checkClickTimer=Qr.setTimeout((()=>{this._checkClicks()}),1e3))})),i(this,"_onScroll",(()=>{var e=Date.now();e%50==0&&this._clicks.forEach((t=>{Ln(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))})),i(this,"_onSelectionChange",(()=>{this._lastSelectionChanged=Date.now()})),this.instance=e,this._config=this.asRequiredConfig(t),this._onCapture=this._config.__onCapture}start(e){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startMutationObserver(e)}_startMutationObserver(e){if(!this._mutationObserver){var t=Zu(Qr);this._mutationObserver=new t((e=>{this.onMutation(e)})),this._mutationObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null===(e=this._mutationObserver)||void 0===e||e.disconnect(),this._mutationObserver=void 0,Qr.removeEventListener("click",this._onClick),Qr.removeEventListener("scroll",this._onScroll,{capture:!0}),Qr.removeEventListener("selectionchange",this._onSelectionChange)}onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){wn(Qr,"click",this._onClick)}_startScrollObserver(){wn(Qr,"scroll",this._onScroll,{capture:!0})}_startSelectionChangedObserver(){wn(Qr,"selectionchange",this._onSelectionChange)}_ignoreClick(e){if(!e)return!0;if(Li(e.node))return!0;var t=this._clicks.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!t||!(!Bi(e.node,"html")&&Di(e.node)&&!Ui.includes(e.node.tagName.toLowerCase()))}_checkClicks(){if(this._clicks.length){clearTimeout(this._checkClickTimer),this._checkClickTimer=void 0;var e=this._clicks;for(var t of(this._clicks=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this._lastMutation&&t.timestamp<=this._lastMutation?this._lastMutation-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this._lastSelectionChanged&&t.timestamp<=this._lastSelectionChanged?this._lastSelectionChanged-t.timestamp:void 0;var n=Gu(t.scrollDelayMs,this._config.scroll_threshold_ms),i=Gu(t.selectionChangedDelayMs,this._config.selection_change_threshold_ms),o=Gu(t.mutationDelayMs,this._config.mutation_threshold_ms),s=Gu(t.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),a=$n(t.scrollDelayMs)&&t.scrollDelayMs<this._config.scroll_threshold_ms,l=$n(t.mutationDelayMs)&&t.mutationDelayMs<this._config.mutation_threshold_ms,c=$n(t.selectionChangedDelayMs)&&t.selectionChangedDelayMs<this._config.selection_change_threshold_ms;a||l||c||(n||o||s||i?this._onCapture(t,{$dead_click_last_mutation_timestamp:this._lastMutation,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:n,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:s,$dead_click_selection_changed_timeout:i}):t.absoluteDelayMs<this._config.mutation_threshold_ms&&this._clicks.push(t))}this._clicks.length&&Ln(this._checkClickTimer)&&(this._checkClickTimer=Qr.setTimeout((()=>{this._checkClicks()}),1e3))}}_captureDeadClick(e,r){this.instance.capture("$dead_click",t(t(t({},r),$u(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:!1}).props),{},{$dead_click_scroll_delay_ms:e.scrollDelayMs,$dead_click_mutation_delay_ms:e.mutationDelayMs,$dead_click_absolute_delay_ms:e.absoluteDelayMs,$dead_click_selection_changed_delay_ms:e.selectionChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new ju(e,t);var Uu=an("[ExternalScriptsLoader]"),zu=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return Uu.warn("".concat(t," was requested but loading of external scripts is disabled.")),r("Loading of external scripts is disabled");var n=()=>{if(!Ur)return r("document not found");var n=Ur.createElement("script");if(n.type="text/javascript",n.crossOrigin="anonymous",n.src=t,n.onload=e=>r(void 0,e),n.onerror=e=>r(e),e.config.prepare_external_dependency_script&&(n=e.config.prepare_external_dependency_script(n)),!n)return r("prepare_external_dependency_script returned null");var i,o=Ur.querySelectorAll("body > script");o.length>0?null===(i=o[0].parentNode)||void 0===i||i.insertBefore(n,o[0]):Ur.body.appendChild(n)};null!=Ur&&Ur.body?n():null==Ur||Ur.addEventListener("DOMContentLoaded",n)};Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{var n="/static/".concat(t,".js")+"?v=".concat(e.version);if("remote-config"===t&&(n="/array/".concat(e.config.token,"/config.js")),"toolbar"===t){var i=3e5,o=Math.floor(Date.now()/i)*i;n="".concat(n,"&t=").concat(o)}var s=e.requestRouter.endpointFor("assets",n);zu(e,s,r)},Qr.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var n=e.requestRouter.endpointFor("api",t);zu(e,n,r)};var Yu=an("[FeatureFlags]"),Xu="$active_feature_flags",Ju="$override_feature_flags",Ku="$feature_flag_payloads",Qu="$override_feature_flag_payloads",ed=e=>{var t={};for(var[r,n]of pn(e||{}))n&&(t[r]=n);return t};class td{constructor(e){i(this,"_override_warning",!1),i(this,"_hasLoadedFlags",!1),i(this,"_requestInFlight",!1),i(this,"_reloadingDisabled",!1),i(this,"_additionalReloadRequested",!1),i(this,"_decideCalled",!1),i(this,"_flagsLoadedFromRemote",!1),this.instance=e,this.featureFlagEventHandlers=[]}decide(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var e=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:e})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var e=this.instance.get_property(yi),t=this.instance.get_property(Ju);if(!t)return e||{};for(var r=dn({},e),n=Object.keys(t),i=0;i<n.length;i++)r[n[i]]=t[n[i]];return this._override_warning||(Yu.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){var e=this.instance.get_property(Ku),t=this.instance.get_property(Qu);if(!t)return e||{};for(var r=dn({},e||{}),n=Object.keys(t),i=0;i<n.length;i++)r[n[i]]=t[n[i]];return this._override_warning||(Yu.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this._override_warning=!0),r}reloadFeatureFlags(){this._reloadingDisabled||this.instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout((()=>{this._callDecideEndpoint()}),5))}clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this._reloadingDisabled=e}_callDecideEndpoint(e){if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:this.instance.get_property(wi),group_properties:this.instance.get_property(Si)};(null!=e&&e.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(t.disable_flags=!0),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:qr.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var r,n,i=!0;(200===e.statusCode&&(this.$anon_distinct_id=void 0,i=!1),this._requestInFlight=!1,this._decideCalled)||(this._decideCalled=!0,this.instance._onRemoteConfig(null!==(n=e.json)&&void 0!==n?n:{}));t.disable_flags||(this._flagsLoadedFromRemote=!i,this.receivedFeatureFlags(null!==(r=e.json)&&void 0!==r?r:{},i),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callDecideEndpoint()))}})}}getFeatureFlag(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r,n,i,o,s,a=this.getFlagVariants()[e],l="".concat(a),c=this.instance.get_property(ki)||{};if(t.send_event||!("send_event"in t))if(!(e in c)||!c[e].includes(l))Rn(c[e])?c[e].push(l):c[e]=[l],null===(r=this.instance.persistence)||void 0===r||r.register({[ki]:c}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:a,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_bootstrapped_response:(null===(n=this.instance.config.bootstrap)||void 0===n||null===(i=n.featureFlags)||void 0===i?void 0:i[e])||null,$feature_flag_bootstrapped_payload:(null===(o=this.instance.config.bootstrap)||void 0===o||null===(s=o.featureFlagPayloads)||void 0===s?void 0:s[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote});return a}Yu.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Yu.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,r){if(this.instance.persistence){this._hasLoadedFlags=!0;var n=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,r){var n=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(Rn(o)){var a={};if(o)for(var l=0;l<o.length;l++)a[o[l]]=!0;r&&r.register({[Xu]:o,[yi]:a})}else{var c=o,u=s;e.errorsWhileComputingFlags&&(c=t(t({},n),c),u=t(t({},i),u)),r&&r.register({[Xu]:Object.keys(ed(c)),[yi]:c||{},[Ku]:u||{}})}}(e,this.instance.persistence,n,i),this._fireFeatureFlagsCallbacks(r)}}override(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Yu.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this.instance.__loaded||!this.instance.persistence)return Yu.uninitializedWarning("posthog.feature_flags.overrideFeatureFlags");if(!1===e)return this.instance.persistence.unregister(Ju),this.instance.persistence.unregister(Qu),void this._fireFeatureFlagsCallbacks();if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,r=e;if(this._override_warning=Boolean(null!==(t=r.suppressWarning)&&void 0!==t&&t),"flags"in r)if(!1===r.flags)this.instance.persistence.unregister(Ju);else if(r.flags)if(Rn(r.flags)){for(var n={},i=0;i<r.flags.length;i++)n[r.flags[i]]=!0;this.instance.persistence.register({[Ju]:n})}else this.instance.persistence.register({[Ju]:r.flags});return"payloads"in r&&(!1===r.payloads?this.instance.persistence.unregister(Qu):r.payloads&&this.instance.persistence.register({[Qu]:r.payloads})),void this._fireFeatureFlagsCallbacks()}this._fireFeatureFlagsCallbacks()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,r){var n,i=(this.instance.get_property(bi)||[]).find((t=>t.flagKey===e)),o={["$feature_enrollment/".concat(e)]:r},s={$feature_flag:e,$feature_enrollment:r,$set:o};i&&(s.$early_access_feature_name=i.name),this.instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(o,!1);var a=t(t({},this.getFlagVariants()),{},{[e]:r});null===(n=this.instance.persistence)||void 0===n||n.register({[Xu]:Object.keys(ed(a)),[yi]:a}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(bi);if(r&&!t)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:t=>{var r;if(t.json){var n=t.json.earlyAccessFeatures;return null===(r=this.instance.persistence)||void 0===r||r.register({[bi]:n}),e(n)}}})}_prepareFeatureFlagsForCallbacks(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,r)=>(e[r]=t[r],e)),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((n=>n(t,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(wi)||{};this.instance.register({[wi]:t(t({},n),e)}),r&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(wi)}setGroupPropertiesForFlags(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(Si)||{};0!==Object.keys(n).length&&Object.keys(n).forEach((r=>{n[r]=t(t({},n[r]),e[r]),delete e[r]})),this.instance.register({[Si]:t(t({},n),e)}),r&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var r=this.instance.get_property(Si)||{};this.instance.register({[Si]:t(t({},r),{},{[e]:{}})})}else this.instance.unregister(Si)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return $n(e)&&isFinite(e)&&Math.floor(e)===e});var rd="0123456789abcdef";class nd{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||e<0||t<0||r<0||n<0||e>0xffffffffffff||t>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=n>>>24,i[13]=n>>>16,i[14]=n>>>8,i[15]=n,new nd(i)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+rd.charAt(this.bytes[t]>>>4)+rd.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}clone(){return new nd(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class id{constructor(){i(this,"timestamp",0),i(this,"counter",0),i(this,"random",new ad)}generate(){var e=this.generateOrAbort();if(Ln(e)){this.timestamp=0;var t=this.generateOrAbort();if(Ln(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){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 nd.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}var od,sd=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};$r&&!Ln($r.crypto)&&crypto.getRandomValues&&(sd=e=>crypto.getRandomValues(e));class ad{constructor(){i(this,"buffer",new Uint32Array(8)),i(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(sd(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}var ld=()=>cd().toString(),cd=()=>(od||(od=new id)).generate(),ud="Thu, 01 Jan 1970 00:00:00 GMT",dd="";var hd=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function pd(e,t){if(t){var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ur;if(dd)return dd;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),n=Math.min(r.length,8),i="dmn_chk_"+ld(),o=new RegExp("(^|;)\\s*"+i+"=1");!dd&&n--;){var s=r.slice(n).join("."),a=i+"=1;domain=."+s;t.cookie=a,o.test(t.cookie)&&(t.cookie=a+";expires="+ud,dd=s)}return dd}(e);if(!r){var n=(e=>{var t=e.match(hd);return t?t[0]:""})(e);n!==r&&sn.info("Warning: cookie subdomain discovery mismatch",n,r),r=n}return r?"; domain=."+r:""}return""}var vd={is_supported:()=>!!Ur,error:function(e){sn.error("cookieStore error: "+e)},get:function(e){if(Ur){try{for(var t=e+"=",r=Ur.cookie.split(";").filter((e=>e.length)),n=0;n<r.length;n++){for(var i=r[n];" "==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(vd.get(e))||{}}catch(e){}return t},set:function(e,t,r,n,i){if(Ur)try{var o="",s="",a=pd(Ur.location.hostname,n);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),o="; expires="+l.toUTCString()}i&&(s="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+a+s;return c.length>3686.4&&sn.warn("cookieStore warning: large cookie, len="+c.length),Ur.cookie=c,c}catch(e){return}},remove:function(e,t){try{vd.set(e,"",-1,t)}catch(e){return}}},gd=null,fd={is_supported:function(){if(!qn(gd))return gd;var e=!0;if(Ln($r))e=!1;else try{var t="__mplssupport__";fd.set(t,"xyz"),'"xyz"'!==fd.get(t)&&(e=!1),fd.remove(t)}catch(t){e=!1}return e||sn.error("localStorage unsupported; falling back to cookie store"),gd=e,e},error:function(e){sn.error("localStorage error: "+e)},get:function(e){try{return null==$r?void 0:$r.localStorage.getItem(e)}catch(e){fd.error(e)}return null},parse:function(e){try{return JSON.parse(fd.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==$r||$r.localStorage.setItem(e,JSON.stringify(t))}catch(e){fd.error(e)}},remove:function(e){try{null==$r||$r.localStorage.removeItem(e)}catch(e){fd.error(e)}}},md=["distinct_id",gi,fi,Ni,Ai],_d=t(t({},fd),{},{parse:function(e){try{var t={};try{t=vd.parse(e)||{}}catch(e){}var r=dn(t,JSON.parse(fd.get(e)||"{}"));return fd.set(e,r),r}catch(e){}return null},set:function(e,t,r,n,i,o){try{fd.set(e,t,void 0,void 0,o);var s={};md.forEach((e=>{t[e]&&(s[e]=t[e])})),Object.keys(s).length&&vd.set(e,s,r,n,i,o)}catch(e){fd.error(e)}},remove:function(e,t){try{null==$r||$r.localStorage.removeItem(e),vd.remove(e,t)}catch(e){fd.error(e)}}}),yd={},bd={is_supported:function(){return!0},error:function(e){sn.error("memoryStorage error: "+e)},get:function(e){return yd[e]||null},parse:function(e){return yd[e]||null},set:function(e,t){yd[e]=t},remove:function(e){delete yd[e]}},wd=null,Sd={is_supported:function(){if(!qn(wd))return wd;if(wd=!0,Ln($r))wd=!1;else try{var e="__support__";Sd.set(e,"xyz"),'"xyz"'!==Sd.get(e)&&(wd=!1),Sd.remove(e)}catch(e){wd=!1}return wd},error:function(e){sn.error("sessionStorage error: ",e)},get:function(e){try{return null==$r?void 0:$r.sessionStorage.getItem(e)}catch(e){Sd.error(e)}return null},parse:function(e){try{return JSON.parse(Sd.get(e))||null}catch(e){}return null},set:function(e,t){try{null==$r||$r.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Sd.error(e)}},remove:function(e){try{null==$r||$r.sessionStorage.removeItem(e)}catch(e){Sd.error(e)}}},Cd=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Id{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(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"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&sn.info("Persistence loaded",e.persistence,t({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){-1===Cd.indexOf(e.persistence.toLowerCase())&&(sn.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&fd.is_supported()?fd:"localstorage+cookie"===t&&_d.is_supported()?_d:"sessionstorage"===t&&Sd.is_supported()?Sd:"memory"===t?bd:"cookie"===t?vd:_d.is_supported()?_d:vd}properties(){var e={};return un(this.props,(function(t,r){if(r===yi&&On(t))for(var n=Object.keys(t),i=0;i<n.length;i++)e["$feature/".concat(n[i])]=t[n[i]];else s=r,a=!1,(qn(o=Pi)?a:Gr&&o.indexOf===Gr?-1!=o.indexOf(s):(un(o,(function(e){if(a||(a=e===s))return ln})),a))||(e[r]=t);var o,s,a})),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=dn({},e))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,r){if(On(e)){Ln(t)&&(t="None"),this.expire_days=Ln(r)?this.default_expiry:r;var n=!1;if(un(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.props[r]=e,n=!0)})),n)return this.save(),!0}return!1}register(e,t){if(On(e)){this.expire_days=Ln(t)?this.default_expiry:t;var r=!1;if(un(e,((t,n)=>{e.hasOwnProperty(n)&&this.props[n]!==t&&(this.props[n]=t,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var e=Za.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});Pn(fn(e))||this.register(e),this.campaign_params_saved=!0}}update_search_keyword(){this.register(Za.searchInfo())}update_referrer_info(){this.register_once(Za.referrerInfo(),void 0)}set_initial_person_info(){this.props[Mi]||this.props[Ri]||this.register_once({[Ai]:Za.initialPersonInfo()},void 0)}get_referrer_info(){return fn({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};un([Ri,Mi],(t=>{var r=this.props[t];r&&un(r,(function(t,r){e["$initial_"+In(r)]=t}))}));var t=this.props[Ai];if(t){var r=Za.initialPersonPropsFromInfo(t);dn(e,r)}return e}safe_merge(e){return un(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(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 r=this.buildStorage(e),n=this.props;this.clear(),this.storage=r,this.props=n,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){var r=this.props[ti]||{};r[e]=t,this.props[ti]=r,this.save()}remove_event_timer(e){var t=(this.props[ti]||{})[e];return Ln(t)||(delete this.props[ti][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}function kd(e){var t,r;return(null===(t=JSON.stringify(e,(r=[],function(e,t){if(On(t)){for(;r.length>0&&r[r.length-1]!==this;)r.pop();return r.includes(t)?"[Circular]":(r.push(t),t)}return t})))||void 0===t?void 0:t.length)||0}function Ed(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(e.size>=t&&e.data.length>1){var r=Math.floor(e.data.length/2),n=e.data.slice(0,r),i=e.data.slice(r);return[Ed({size:kd(n),data:n,sessionId:e.sessionId,windowId:e.windowId}),Ed({size:kd(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var xd=(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",e))(xd||{}),Td=(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",e[e.CustomElement=16]="CustomElement",e))(Td||{});function Md(e,t,r,n,i){return t>r&&(sn.warn("min cannot be greater than max."),t=r),$n(e)?e>r?(n&&sn.warn(n+" cannot be greater than max: "+r+". Using max value instead."),r):e<t?(n&&sn.warn(n+" cannot be less than min: "+t+". Using min value instead."),t):e:(n&&sn.warn(n+" must be a number. using max or fallback. max: "+r+", fallback: "+i),Md(i||r,t,r,n))}class Rd{constructor(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,"bucketSize",100),i(this,"refillRate",10),i(this,"mutationBuckets",{}),i(this,"loggedTracker",{}),i(this,"refillBuckets",(()=>{Object.keys(this.mutationBuckets).forEach((e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]}))})),i(this,"getNodeOrRelevantParent",(e=>{var t=this.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var r=t.closest("svg");if(r)return[this.rrweb.mirror.getId(r),r]}return[e,t]})),i(this,"numberOfChanges",(e=>{var t,r,n,i,o,s,a,l;return(null!==(t=null===(r=e.removes)||void 0===r?void 0:r.length)&&void 0!==t?t:0)+(null!==(n=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==n?n:0)+(null!==(o=null===(s=e.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(l=e.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)})),i(this,"throttleMutations",(e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,r=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((e=>{var t,r,n,[i,o]=this.getNodeOrRelevantParent(e.id);if(0===this.mutationBuckets[i])return!1;(this.mutationBuckets[i]=null!==(t=this.mutationBuckets[i])&&void 0!==t?t:this.bucketSize,this.mutationBuckets[i]=Math.max(this.mutationBuckets[i]-1,0),0===this.mutationBuckets[i])&&(this.loggedTracker[i]||(this.loggedTracker[i]=!0,null===(r=(n=this.options).onBlockedNode)||void 0===r||r.call(n,i,o)));return e})));var n=this.numberOfChanges(t);return 0!==n||r===n?e:void 0})),this.rrweb=e,this.options=n,this.refillRate=Md(null!==(t=this.options.refillRate)&&void 0!==t?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=Md(null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval((()=>{this.refillBuckets()}),1e3)}}var Ad=Uint8Array,Nd=Uint16Array,Fd=Uint32Array,Od=new Ad([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]),Pd=new Ad([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]),Ld=new Ad([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Dd=function(e,t){for(var r=new Nd(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new Fd(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},Bd=Dd(Od,2),qd=Bd[0],Hd=Bd[1];qd[28]=258,Hd[258]=28;for(var $d=Dd(Pd,0)[1],Wd=new Nd(32768),Vd=0;Vd<32768;++Vd){var Zd=(43690&Vd)>>>1|(21845&Vd)<<1;Zd=(61680&(Zd=(52428&Zd)>>>2|(13107&Zd)<<2))>>>4|(3855&Zd)<<4,Wd[Vd]=((65280&Zd)>>>8|(255&Zd)<<8)>>>1}var Gd=function(e,t,r){for(var n=e.length,i=0,o=new Nd(t);i<n;++i)++o[e[i]-1];var s,a=new Nd(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new Nd(1<<t);var l=15-t;for(i=0;i<n;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)s[Wd[d]>>>l]=c}else for(s=new Nd(n),i=0;i<n;++i)s[i]=Wd[a[e[i]-1]++]>>>15-e[i];return s},jd=new Ad(288);for(Vd=0;Vd<144;++Vd)jd[Vd]=8;for(Vd=144;Vd<256;++Vd)jd[Vd]=9;for(Vd=256;Vd<280;++Vd)jd[Vd]=7;for(Vd=280;Vd<288;++Vd)jd[Vd]=8;var Ud=new Ad(32);for(Vd=0;Vd<32;++Vd)Ud[Vd]=5;var zd=Gd(jd,9,0),Yd=Gd(Ud,5,0),Xd=function(e){return(e/8>>0)+(7&e&&1)},Jd=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof Nd?Nd:e instanceof Fd?Fd:Ad)(r-t);return n.set(e.subarray(t,r)),n},Kd=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},Qd=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},eh=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,o=r.slice();if(!i)return[new Ad(0),0];if(1==i){var s=new Ad(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=r[r[c].f<r[d].f?c++:d++],l=r[c!=u&&r[c].f<r[d].f?c++:d++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=o[0].s;for(n=1;n<i;++n)o[n].s>h&&(h=o[n].s);var p=new Nd(h+1),v=th(r[u-1],p,0);if(v>t){n=0;var g=0,f=v-t,m=1<<f;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));n<i;++n){var _=o[n].s;if(!(p[_]>t))break;g+=m-(1<<v-p[_]),p[_]=t}for(g>>>=f;g>0;){var y=o[n].s;p[y]<t?g-=1<<t-p[y]++-1:++n}for(;n>=0&&g;--n){var b=o[n].s;p[b]==t&&(--p[b],++g)}v=t}return[new Ad(p),v]},th=function(e,t,r){return-1==e.s?Math.max(th(e.l,t,r+1),th(e.r,t,r+1)):t[e.s]=r},rh=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Nd(++t),n=0,i=e[0],o=1,s=function(e){r[n++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[r.subarray(0,n),t]},nh=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},ih=function(e,t,r){var n=r.length,i=Xd(t+2);e[i]=255&n,e[i+1]=n>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<n;++o)e[i+o+4]=r[o];return 8*(i+4+n)},oh=function(e,t,r,n,i,o,s,a,l,c,u){Kd(t,u++,r),++i[256];for(var d=eh(i,15),h=d[0],p=d[1],v=eh(o,15),g=v[0],f=v[1],m=rh(h),_=m[0],y=m[1],b=rh(g),w=b[0],S=b[1],C=new Nd(19),I=0;I<_.length;++I)C[31&_[I]]++;for(I=0;I<w.length;++I)C[31&w[I]]++;for(var k=eh(C,7),E=k[0],x=k[1],T=19;T>4&&!E[Ld[T-1]];--T);var M,R,A,N,F=c+5<<3,O=nh(i,jd)+nh(o,Ud)+s,P=nh(i,h)+nh(o,g)+s+14+3*T+nh(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(F<=O&&F<=P)return ih(t,u,e.subarray(l,l+c));if(Kd(t,u,1+(P<O)),u+=2,P<O){M=Gd(h,p,0),R=h,A=Gd(g,f,0),N=g;var L=Gd(E,x,0);Kd(t,u,y-257),Kd(t,u+5,S-1),Kd(t,u+10,T-4),u+=14;for(I=0;I<T;++I)Kd(t,u+3*I,E[Ld[I]]);u+=3*T;for(var D=[_,w],B=0;B<2;++B){var q=D[B];for(I=0;I<q.length;++I){var H=31&q[I];Kd(t,u,L[H]),u+=E[H],H>15&&(Kd(t,u,q[I]>>>5&127),u+=q[I]>>>12)}}}else M=zd,R=jd,A=Yd,N=Ud;for(I=0;I<a;++I)if(n[I]>255){H=n[I]>>>18&31;Qd(t,u,M[H+257]),u+=R[H+257],H>7&&(Kd(t,u,n[I]>>>23&31),u+=Od[H]);var $=31&n[I];Qd(t,u,A[$]),u+=N[$],$>3&&(Qd(t,u,n[I]>>>5&8191),u+=Pd[$])}else Qd(t,u,M[n[I]]),u+=R[n[I]];return Qd(t,u,M[256]),u+R[256]},sh=new Fd([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ah=function(){for(var e=new Fd(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),lh=function(){var e=4294967295;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=ah[255&r^t[n]]^r>>>8;e=r},d:function(){return 4294967295^e}}},ch=function(e,t,r,n,i){return function(e,t,r,n,i,o){var s=e.length,a=new Ad(n+s+5*(1+Math.floor(s/7e3))+i),l=a.subarray(n,a.length-i),c=0;if(!t||s<8)for(var u=0;u<=s;u+=65535){var d=u+65535;d<s?c=ih(l,c,e.subarray(u,d)):(l[u]=o,c=ih(l,c,e.subarray(u,s)))}else{for(var h=sh[t-1],p=h>>>13,v=8191&h,g=(1<<r)-1,f=new Nd(32768),m=new Nd(g+1),_=Math.ceil(r/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&g},w=new Fd(25e3),S=new Nd(288),C=new Nd(32),I=0,k=0,E=(u=0,0),x=0,T=0;u<s;++u){var M=b(u),R=32767&u,A=m[M];if(f[R]=A,m[M]=R,x<=u){var N=s-u;if((I>7e3||E>24576)&&N>423){c=oh(e,l,0,w,S,C,k,E,T,u-T,c),E=I=k=0,T=u;for(var F=0;F<286;++F)S[F]=0;for(F=0;F<30;++F)C[F]=0}var O=2,P=0,L=v,D=R-A&32767;if(N>2&&M==b(u-D))for(var B=Math.min(p,N)-1,q=Math.min(32767,u),H=Math.min(258,N);D<=q&&--L&&R!=A;){if(e[u+O]==e[u+O-D]){for(var $=0;$<H&&e[u+$]==e[u+$-D];++$);if($>O){if(O=$,P=D,$>B)break;var W=Math.min(D,$-2),V=0;for(F=0;F<W;++F){var Z=u-D+F+32768&32767,G=Z-f[Z]+32768&32767;G>V&&(V=G,A=Z)}}}D+=(R=A)-(A=f[R])+32768&32767}if(P){w[E++]=268435456|Hd[O]<<18|$d[P];var j=31&Hd[O],U=31&$d[P];k+=Od[j]+Pd[U],++S[257+j],++C[U],x=u+O,++I}else w[E++]=e[u],++S[e[u]]}}c=oh(e,l,o,w,S,C,k,E,T,u-T,c)}return Jd(a,0,n+Xd(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,r,n,!i)},uh=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},dh=function(e,t){var r=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&&uh(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}},hh=function(e){return 10+(e.filename&&e.filename.length+1||0)};function ph(e,t){void 0===t&&(t={});var r=lh(),n=e.length;r.p(e);var i=ch(e,t,hh(t),8),o=i.length;return dh(i,t),uh(i,o-8,r.d()),uh(i,o-4,n),i}function vh(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Ad(e.length+(e.length>>>1)),i=0,o=function(e){n[i++]=e},s=0;s<r;++s){if(i+5>n.length){var a=new Ad(i+8+(r-s<<1));a.set(n),n=a}var l=e.charCodeAt(s);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++s))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return Jd(n,0,i)}function gh(e,t){return function(e){for(var t=0,r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)}(e)%100<Md(100*t,0,100)}var fh="[SessionRecording]",mh=an(fh),_h=3e5,yh=[Td.MouseMove,Td.MouseInteraction,Td.Scroll,Td.ViewportResize,Td.Input,Td.TouchMove,Td.MediaInteraction,Td.Drag],bh=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function wh(e){return function(e,t){for(var r="",n=0;n<e.length;){var i=e[n++];i<128||t?r+=String.fromCharCode(i):i<224?r+=String.fromCharCode((31&i)<<6|63&e[n++]):i<240?r+=String.fromCharCode((15&i)<<12|(63&e[n++])<<6|63&e[n++]):(i=((15&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}return r}(ph(vh(JSON.stringify(e))),!0)}function Sh(e){return e.type===xd.Custom&&"sessionIdle"===e.data.tag}function Ch(e,t){return t.some((t=>"regex"===t.matching&&new RegExp(t.url).test(e)))}class Ih{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return null==Qr||null===(e=Qr.__PosthogExtensions__)||void 0===e||null===(t=e.rrweb)||void 0===t?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(fh+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var e,t;return"trigger_pending"===this.triggerStatus?6e4:null!==(e=null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:_h}get isSampled(){var e=this.instance.get_property(fi);return Wn(e)?e:null}get sessionDuration(){var e,t,r=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],{sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-n:null}get isRecordingEnabled(){var e=!!this.instance.get_property(li),t=!this.instance.config.disable_session_recording;return $r&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(ci),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}get canvasRecording(){var e,t,r,n,i,o,s=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(di),l=null!==(e=null!==(t=null==s?void 0:s.recordCanvas)&&void 0!==t?t:null==a?void 0:a.enabled)&&void 0!==e&&e,c=null!==(r=null!==(n=null==s?void 0:s.canvasFps)&&void 0!==n?n:null==a?void 0:a.fps)&&void 0!==r?r:4,u=null!==(i=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==a?void 0:a.quality)&&void 0!==i?i:.4;if("string"==typeof u){var d=parseFloat(u);u=isNaN(d)?.4:d}return{enabled:l,fps:Md(c,0,12,"canvas recording fps",4),quality:Md(u,0,1,"canvas recording quality",.4)}}get networkPayloadCapture(){var e,t,r=this.instance.get_property(ui),n={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==n?void 0:n.recordHeaders)||(null==r?void 0:r.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),s=On(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(Wn(s)?s:null==r?void 0:r.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(hi);return $n(e)?e:null}get minimumDuration(){var e=this.instance.get_property(pi);return $n(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?!1===this.isSampled?"disabled":this._urlBlocked?"paused":Hn(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.triggerStatus?"buffering":Wn(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var e;return 0===this._urlTriggers.length?"trigger_disabled":(null===(e=this.instance)||void 0===e?void 0:e.get_property(mi))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var e;return 0===this._eventTriggers.length?"trigger_disabled":(null===(e=this.instance)||void 0===e?void 0:e.get_property(_i))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var e="trigger_activated"===this.eventTriggerStatus||"trigger_activated"===this.urlTriggerStatus,t="trigger_pending"===this.eventTriggerStatus||"trigger_pending"===this.urlTriggerStatus;return e?"trigger_activated":t?"trigger_pending":"trigger_disabled"}constructor(e){if(i(this,"queuedRRWebEvents",[]),i(this,"isIdle",!1),i(this,"_linkedFlagSeen",!1),i(this,"_lastActivityTimestamp",Date.now()),i(this,"_linkedFlag",null),i(this,"_removePageViewCaptureHook",void 0),i(this,"_onSessionIdListener",void 0),i(this,"_persistDecideOnSessionListener",void 0),i(this,"_samplingSessionListener",void 0),i(this,"_urlTriggers",[]),i(this,"_urlBlocklist",[]),i(this,"_urlBlocked",!1),i(this,"_eventTriggers",[]),i(this,"_removeEventTriggerCaptureHook",void 0),i(this,"_forceAllowLocalhostNetworkCapture",!1),i(this,"_onBeforeUnload",(()=>{this._flushBuffer()})),i(this,"_onOffline",(()=>{this._tryAddCustomEvent("browser offline",{})})),i(this,"_onOnline",(()=>{this._tryAddCustomEvent("browser online",{})})),i(this,"_onVisibilityChange",(()=>{if(null!=Ur&&Ur.visibilityState){var e="window "+Ur.visibilityState;this._tryAddCustomEvent(e,{})}})),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw mh.error("started without valid sessionManager"),new Error(fh+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(fh+" cannot be used with __preview_experimental_cookieless_mode.");var{sessionId:t,windowId:r}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=r,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&mh.warn("session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),wn($r,"beforeunload",this._onBeforeUnload),wn($r,"offline",this._onOffline),wn($r,"online",this._onOnline),wn($r,"visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),Hn(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",(e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this._maskUrl(null==e?void 0:e.properties.$current_url):"";if(!t)return;this._tryAddCustomEvent("$pageview",{href:t})}}catch(e){mh.error("Could not add $pageview to rrweb session",e)}}))),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId(((e,t,r)=>{var n,i,o,s;r&&(this._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:t,changeReason:r}),null===(n=this.instance)||void 0===n||null===(i=n.persistence)||void 0===i||i.unregister(_i),null===(o=this.instance)||void 0===o||null===(s=o.persistence)||void 0===s||s.unregister(mi))})))):this.stopRecording()}stopRecording(){var e,t,r,n;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==$r||$r.removeEventListener("beforeunload",this._onBeforeUnload),null==$r||$r.removeEventListener("offline",this._onOffline),null==$r||$r.removeEventListener("online",this._onOnline),null==$r||$r.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),null===(e=this._removePageViewCaptureHook)||void 0===e||e.call(this),this._removePageViewCaptureHook=void 0,null===(t=this._removeEventTriggerCaptureHook)||void 0===t||t.call(this),this._removeEventTriggerCaptureHook=void 0,null===(r=this._onSessionIdListener)||void 0===r||r.call(this),this._onSessionIdListener=void 0,null===(n=this._samplingSessionListener)||void 0===n||n.call(this),this._samplingSessionListener=void 0,mh.info("stopped"))}makeSamplingDecision(e){var t,r=this.sessionId!==e,n=this.sampleRate;if($n(n)){var i=this.isSampled,o=r||!Wn(i),s=o?gh(e,n):i;o&&(s?this._reportStarted("sampled"):mh.warn("Sample rate (".concat(n,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:n,isSampled:s})),null===(t=this.instance.persistence)||void 0===t||t.register({[fi]:s})}else{var a;null===(a=this.instance.persistence)||void 0===a||a.register({[fi]:null})}}onRemoteConfig(e){var t,r,n,i,o,s;(this._tryAddCustomEvent("$remote_config_received",e),this._persistRemoteConfig(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(r=e.sessionRecording)&&void 0!==r&&r.endpoint)&&(this._endpoint=null===(s=e.sessionRecording)||void 0===s?void 0:s.endpoint);if(this._setupSampling(),!Hn(this._linkedFlag)&&!this._linkedFlagSeen){var a=Dn(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,l=Dn(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(((e,t)=>{var r=On(t)&&a in t,n=l?t[a]===l:r;n&&this._reportStarted("linked_flag_matched",{linkedFlag:a,linkedVariant:l}),this._linkedFlagSeen=n}))}null!==(n=e.sessionRecording)&&void 0!==n&&n.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),null!==(i=e.sessionRecording)&&void 0!==i&&i.urlBlocklist&&(this._urlBlocklist=e.sessionRecording.urlBlocklist),null!==(o=e.sessionRecording)&&void 0!==o&&o.eventTriggers&&(this._eventTriggers=e.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){$n(this.sampleRate)&&Hn(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((e=>{this.makeSamplingDecision(e)})))}_persistRemoteConfig(e){if(this.instance.persistence){var r,n=this.instance.persistence,i=()=>{var r,i,o,s,a,l,c,u,d=null===(r=e.sessionRecording)||void 0===r?void 0:r.sampleRate,h=Hn(d)?null:parseFloat(d),p=null===(i=e.sessionRecording)||void 0===i?void 0:i.minimumDurationMilliseconds;n.register({[li]:!!e.sessionRecording,[ci]:null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled,[ui]:t({capturePerformance:e.capturePerformance},null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture),[di]:{enabled:null===(a=e.sessionRecording)||void 0===a?void 0:a.recordCanvas,fps:null===(l=e.sessionRecording)||void 0===l?void 0:l.canvasFps,quality:null===(c=e.sessionRecording)||void 0===c?void 0:c.canvasQuality},[hi]:h,[pi]:Ln(p)?null:p,[vi]:null===(u=e.sessionRecording)||void 0===u?void 0:u.scriptConfig})};i(),null===(r=this._persistDecideOnSessionListener)||void 0===r||r.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(i)}}log(e){var t,r=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:r,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!Ln(Object.assign)&&!Ln(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,r;if(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord)this._onScriptLoaded();else null===(t=Qr.__PosthogExtensions__)||void 0===t||null===(r=t.loadExternalDependency)||void 0===r||r.call(t,this.instance,this.scriptName,(e=>{if(e)return mh.error("could not load recorder",e);this._onScriptLoaded()}));mh.info("starting"),"active"===this.status&&this._reportStarted(e||"recording_initialized")}}get scriptName(){var e,t,r;return(null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t||null===(r=t.get_property(vi))||void 0===r?void 0:r.script)||"recorder"}isInteractiveEvent(e){var t;return 3===e.type&&-1!==yh.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}_updateWindowAndSessionIds(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var r=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!0)),!this.isIdle){var{windowId:n,sessionId:i}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this.sessionId!==i,s=this.windowId!==n;this.windowId=n,this.sessionId=i,o||s?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):r&&this._scheduleFullSnapshot()}}_tryRRWebMethod(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}):mh.warn("could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(bh((()=>this.rrwebRecord.addCustomEvent(e,t))))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(bh((()=>this.rrwebRecord.takeFullSnapshot())))}_onScriptLoaded(){var e,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},n=this.instance.config.session_recording;for(var[i,o]of Object.entries(n||{}))i in r&&("maskInputOptions"===i?r.maskInputOptions=t({password:!0},o):r[i]=o);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 Rd(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(e,t)=>{var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");mh.info(r,{node:t}),this.log(fh+" "+r,"warn")}});var s=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(t({emit:e=>{this.onRRwebEmit(e)},plugins:s},r)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:r,activePlugins:s.map((e=>null==e?void 0:e.name))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else mh.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval((()=>{this._tryTakeFullSnapshot()}),e))}}_gatherRRWebPlugins(){var e,t,r,n,i=[],o=null===(e=Qr.__PosthogExtensions__)||void 0===e||null===(t=e.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&i.push(o());var s=null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.rrwebPlugins)||void 0===n?void 0:n.getRecordNetworkPlugin;this.networkPayloadCapture&&An(s)&&(!Un.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(s(yo(this.instance.config,this.networkPayloadCapture))):mh.info("NetworkCapture not started because we are on localhost."));return i}onRRwebEmit(e){var r;if(this._processQueuedEvents(),e&&On(e)){if(e.type===xd.Meta){var n=this._maskUrl(e.data.href);if(this._lastHref=n,!n)return;e.data.href=n}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),!this._urlBlocked||function(e){return e.type===xd.Custom&&"recording paused"===e.data.tag}(e)){e.type===xd.FullSnapshot&&this._scheduleFullSnapshot(),e.type===xd.FullSnapshot&&"trigger_pending"===this.triggerStatus&&this.clearBuffer();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var o=function(e){var t=e;if(t&&On(t)&&6===t.type&&On(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 r=[],n=0;n<t.data.payload.payload.length;n++)t.data.payload.payload[n]&&t.data.payload.payload[n].length>2e3?r.push(t.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):r.push(t.data.payload.payload[n]);return t.data.payload.payload=r,e}return e}(i);if(this._updateWindowAndSessionIds(o),!this.isIdle||Sh(o)){if(Sh(o)){var s=o.data.payload;if(s){var a=s.lastActivityTimestamp,l=s.threshold;o.timestamp=a+l}}var c=null===(r=this.instance.config.session_recording.compress_events)||void 0===r||r?function(e){if(kd(e)<1024)return e;try{if(e.type===xd.FullSnapshot)return t(t({},e),{},{data:wh(e.data),cv:"2024-10"});if(e.type===xd.IncrementalSnapshot&&e.data.source===Td.Mutation)return t(t({},e),{},{cv:"2024-10",data:t(t({},e.data),{},{texts:wh(e.data.texts),attributes:wh(e.data.attributes),removes:wh(e.data.removes),adds:wh(e.data.adds)})});if(e.type===xd.IncrementalSnapshot&&e.data.source===Td.StyleSheetRule)return t(t({},e),{},{cv:"2024-10",data:t(t({},e.data),{},{adds:wh(e.data.adds),removes:wh(e.data.removes)})})}catch(e){mh.error("could not compress event - will use uncompressed event",e)}return e}(o):o,u={$snapshot_bytes:kd(c),$snapshot_data:c,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(u):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&$r){var e=this._maskUrl($r.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var e=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],e.forEach((e=>{Date.now()-e.enqueuedAt<=2e3&&this._tryRRWebMethod(e)}))}}_maskUrl(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var r,n={url:e};return null===(r=n=t.maskNetworkRequestFn(n))||void 0===r?void 0:r.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var e=this.minimumDuration,t=this.sessionDuration,r=$n(t)&&t>=0,n=$n(e)&&r&&t<e;if("buffering"===this.status||"paused"===this.status||"disabled"===this.status||n)return this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3),this.buffer;this.buffer.data.length>0&&Ed(this.buffer).forEach((e=>{this._captureSnapshot({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:"web",$lib_version:nn.LIB_VERSION})}));return this.clearBuffer()}_captureSnapshotBuffered(e){var t,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3))}_captureSnapshot(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(void 0!==$r&&$r.location.href){var e=$r.location.href,t=this._urlBlocked,r=Ch(e,this._urlBlocklist);r&&!t?this._pauseRecording():!r&&t&&this._resumeRecording(),Ch(e,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(e){var t,r;"trigger_pending"===this.triggerStatus&&(null===(t=this.instance)||void 0===t||null===(r=t.persistence)||void 0===r||r.register({["url"===e?mi:_i]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){this._urlBlocked||(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),mh.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){this._urlBlocked&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),mh.info("recording resumed"))}_addEventTriggerListener(){0!==this._eventTriggers.length&&Hn(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",(e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(e){mh.error("Could not activate event trigger",e)}})))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}overrideSampling(){var e;null===(e=this.instance.persistence)||void 0===e||e.register({[fi]:!0}),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),mh.info(e.replace("_"," "),t),Sn(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}}var kh=an("[RemoteConfig]");class Eh{constructor(e){this.instance=e}get remoteConfig(){var e,t;return null===(e=Qr._POSTHOG_REMOTE_CONFIG)||void 0===e||null===(t=e[this.instance.config.token])||void 0===t?void 0:t.config}_loadRemoteConfigJs(e){var t,r,n;null!==(t=Qr.__PosthogExtensions__)&&void 0!==t&&t.loadExternalDependency?null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.loadExternalDependency)||void 0===n||n.call(r,this.instance,"remote-config",(()=>e(this.remoteConfig))):(kh.error("PostHog Extensions not found. Cannot load remote config."),e())}_loadRemoteConfigJSON(e){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return kh.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void kh.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((e=>{if(!e)return kh.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON((e=>{this.onRemoteConfig(e)}));this.onRemoteConfig(e)}))}catch(e){kh.error("Error loading remote config",e)}}onRemoteConfig(e){e?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(e),!1!==e.hasFeatureFlags&&this.instance.featureFlags.ensureFlagsLoaded()):kh.info("__preview_remote_config is disabled. Logging config instead",e):kh.error("Failed to fetch remote config from PostHog.")}}var xh,Th=null!=$r&&$r.location?Kn($r.location.hash,"__posthog")||Kn(location.hash,"state"):null,Mh="_postHogToolbarParams",Rh=an("[Toolbar]");!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(xh||(xh={}));class Ah{constructor(e){this.instance=e}setToolbarState(e){Qr.ph_toolbar_state=e}getToolbarState(){var e;return null!==(e=Qr.ph_toolbar_state)&&void 0!==e?e:xh.UNINITIALIZED}maybeLoadToolbar(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!$r||!Ur)return!1;r=null!==(e=r)&&void 0!==e?e:$r.location,i=null!==(t=i)&&void 0!==t?t:$r.history;try{if(!n){try{$r.localStorage.setItem("test","test"),$r.localStorage.removeItem("test")}catch(e){return!1}n=null==$r?void 0:$r.localStorage}var o,s=Th||Kn(r.hash,"__posthog")||Kn(r.hash,"state"),a=s?vn((()=>JSON.parse(atob(decodeURIComponent(s)))))||vn((()=>JSON.parse(decodeURIComponent(s)))):null;return a&&"ph_authorize"===a.action?((o=a).source="url",o&&Object.keys(o).length>0&&(a.desiredHash?r.hash=a.desiredHash:i?i.replaceState(i.state,"",r.pathname+r.search):r.hash="")):((o=JSON.parse(n.getItem(Mh)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}_callLoadToolbar(e){var t=Qr.ph_load_toolbar||Qr.ph_load_editor;!Hn(t)&&An(t)?t(e,this.instance):Rh.warn("No toolbar load function found")}loadToolbar(e){var r=!(null==Ur||!Ur.getElementById(Fi));if(!$r||r)return!1;var n="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i=t(t({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if($r.localStorage.setItem(Mh,JSON.stringify(t(t({},i),{},{source:void 0}))),this.getToolbarState()===xh.LOADED)this._callLoadToolbar(i);else if(this.getToolbarState()===xh.UNINITIALIZED){var o,s;this.setToolbarState(xh.LOADING),null===(o=Qr.__PosthogExtensions__)||void 0===o||null===(s=o.loadExternalDependency)||void 0===s||s.call(o,this.instance,"toolbar",(e=>{if(e)return Rh.error("[Toolbar] Failed to load",e),void this.setToolbarState(xh.UNINITIALIZED);this.setToolbarState(xh.LOADED),this._callLoadToolbar(i)})),wn($r,"turbolinks:load",(()=>{this.setToolbarState(xh.UNINITIALIZED),this.loadToolbar(i)}))}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){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,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,r)}}var Nh=3e3;class Fh{constructor(e,t){i(this,"isPaused",!0),i(this,"queue",[]),this.flushTimeoutMs=Md((null==t?void 0:t.flush_interval_ms)||Nh,250,5e3,"flush interval",Nh),this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var e=this.queue.length>0?this.formatQueue():{},r=Object.values(e),n=[...r.filter((e=>0===e.url.indexOf("/e"))),...r.filter((e=>0!==e.url.indexOf("/e")))];n.map((e=>{this.sendRequest(t(t({},e),{},{transport:"sendBeacon"}))}))}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((()=>{if(this.clearFlushTimeout(),this.queue.length>0){var t=this.formatQueue(),r=function(r){var n=t[r],i=(new Date).getTime();n.data&&Rn(n.data)&&un(n.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.sendRequest(n)};for(var n in t)r(n)}}),this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var e={};return un(this.queue,(r=>{var n,i=r,o=(i?i.batchKey:null)||i.url;Ln(e[o])&&(e[o]=t(t({},i),{},{data:[]})),null===(n=e[o].data)||void 0===n||n.push(i.data)})),this.queue=[],e}}var Oh=function(e){var t,r,n,i,o="";for(t=r=0,n=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<n;i++){var s=e.charCodeAt(i),a=null;s<128?r++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),qn(a)||(r>t&&(o+=e.substring(t,r)),o+=a,t=r=i+1)}return r>t&&(o+=e.substring(t,e.length)),o},Ph=!!Xr||!!Yr,Lh="text/plain",Dh=(e,r)=>{var[n,i]=e.split("?"),o=t({},r);null==i||i.split("&").forEach((e=>{var[t]=e.split("=");delete o[t]}));var s=Yn(o);return s=s?(i?i+"&":"")+s:i,"".concat(n,"?").concat(s)},Bh=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),qh=e=>{var{data:t,compression:r}=e;if(t){if(r===qr.GZipJS){var n=ph(vh(Bh(t)),{mtime:0}),i=new Blob([n],{type:Lh});return{contentType:Lh,body:i,estimatedSize:i.size}}if(r===qr.Base64){var o=function(e){var t,r,n,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=Oh(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,r=o>>12&63,n=o>>6&63,i=63&o,u[l++]=s.charAt(t)+s.charAt(r)+s.charAt(n)+s.charAt(i)}while(a<e.length);switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(Bh(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:Bh(e)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Bh(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Hh=[];Yr&&Hh.push({transport:"fetch",method:e=>{var r,n,{contentType:i,body:o,estimatedSize:s}=null!==(r=qh(e))&&void 0!==r?r:{},a=new Headers;un(e.headers,(function(e,t){a.append(t,e)})),i&&a.append("Content-Type",i);var l=e.url,c=null;if(Jr){var u=new Jr;c={signal:u.signal,timeout:setTimeout((()=>u.abort()),e.timeout)}}Yr(l,t({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&(s||0)<52428.8,body:o,signal:null===(n=c)||void 0===n?void 0:n.signal},e.fetchOptions)).then((t=>t.text().then((r=>{var n,i={statusCode:t.status,text:r};if(200===t.status)try{i.json=JSON.parse(r)}catch(e){sn.error(e)}null===(n=e.callback)||void 0===n||n.call(e,i)})))).catch((t=>{var r;sn.error(t),null===(r=e.callback)||void 0===r||r.call(e,{statusCode:0,text:t})})).finally((()=>c?clearTimeout(c.timeout):null))}}),Xr&&Hh.push({transport:"XHR",method:e=>{var t,r=new Xr;r.open(e.method||"GET",e.url,!0);var{contentType:n,body:i}=null!==(t=qh(e))&&void 0!==t?t:{};un(e.headers,(function(e,t){r.setRequestHeader(t,e)})),n&&r.setRequestHeader("Content-Type",n),e.timeout&&(r.timeout=e.timeout),r.withCredentials=!0,r.onreadystatechange=()=>{if(4===r.readyState){var t,n={statusCode:r.status,text:r.responseText};if(200===r.status)try{n.json=JSON.parse(r.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,n)}},r.send(i)}}),null!=jr&&jr.sendBeacon&&Hh.push({transport:"sendBeacon",method:e=>{var t=Dh(e.url,{beacon:"1"});try{var r,{contentType:n,body:i}=null!==(r=qh(e))&&void 0!==r?r:{},o="string"==typeof i?new Blob([i],{type:n}):i;jr.sendBeacon(t,o)}catch(e){}}});var $h=["retriesPerformedSoFar"];class Wh{constructor(e){i(this,"isPolling",!1),i(this,"pollIntervalMs",3e3),i(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!Ln($r)&&"onLine"in $r.navigator&&(this.areWeOnline=$r.navigator.onLine,wn($r,"online",(()=>{this.areWeOnline=!0,this.flush()})),wn($r,"offline",(()=>{this.areWeOnline=!1})))}retriableRequest(e){var{retriesPerformedSoFar:r}=e,n=o(e,$h);$n(r)&&r>0&&(n.url=Dh(n.url,{retry_count:r})),this.instance._send_request(t(t({},n),{},{callback:e=>{var i;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=r?r:0)<10?this.enqueue(t({retriesPerformedSoFar:r},n)):null===(i=n.callback)||void 0===i||i.call(n,e)}}))}enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(e){var t=3e3*Math.pow(2,e),r=t/2,n=Math.min(18e5,t),i=(Math.random()-.5)*(n-r);return Math.ceil(n+i)}(t),n=Date.now()+r;this.queue.push({retryAt:n,requestOptions:e});var i="Enqueued failed request for retry in ".concat(r);navigator.onLine||(i+=" (Browser is offline)"),sn.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout((()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()}),this.pollIntervalMs)}flush(){var e=Date.now(),t=[],r=this.queue.filter((r=>r.retryAt<e||(t.push(r),!1)));if(this.queue=t,r.length>0)for(var{requestOptions:n}of r)this.retriableRequest(n)}unload(){for(var{requestOptions:e}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(t(t({},e),{},{transport:"sendBeacon"}))}catch(e){sn.error(e)}this.queue=[]}}var Vh,Zh=an("[SessionId]");class Gh{constructor(e,t,r){var n;if(i(this,"_sessionIdChangedHandlers",[]),!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.config=e.config,this.persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||ld,this._windowIdGenerator=r||ld;var o=this.config.persistence_name||this.config.token,s=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Md(s,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var a=Sd.parse(this._window_id_storage_key),l=Sd.parse(this._primary_window_exists_storage_key);a&&!l?this._windowId=a:Sd.remove(this._window_id_storage_key),Sd.set(this._primary_window_exists_storage_key,!0)}if(null!==(n=this.config.bootstrap)&&void 0!==n&&n.sessionID)try{var c=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),c)}catch(e){Zh.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Ln(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((t=>t!==e))}}_canUseSessionStorage(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&Sd.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Sd.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Sd.parse(this._window_id_storage_key):null}_setSessionId(e,t,r){e===this._sessionId&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[gi]:[t,e,r]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[gi];return Rn(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){wn($r,"beforeunload",(()=>{this._canUseSessionStorage()&&Sd.remove(this._primary_window_exists_storage_key)}),{capture:!1})}checkAndGetSessionAndWindowId(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var r=t||(new Date).getTime(),[n,i,o]=this._getSessionId(),s=this._getWindowId(),a=$n(o)&&o>0&&Math.abs(r-o)>864e5,l=!1,c=!i,u=!e&&Math.abs(r-n)>this.sessionTimeoutMs;c||u||a?(i=this._sessionIdGenerator(),s=this._windowIdGenerator(),Zh.info("new session ID generated",{sessionId:i,windowId:s,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}}),o=r,l=!0):s||(s=this._windowIdGenerator(),l=!0);var d=0===n||!e||a?r:n,h=0===o?(new Date).getTime():o;return this._setWindowId(s),this._setSessionId(i,d,h),e||this.resetIdleTimer(),l&&this._sessionIdChangedHandlers.forEach((e=>e(i,s,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0))),{sessionId:i,windowId:s,sessionStartTimestamp:h,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:n}}resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((()=>{this.resetSessionId()}),1.1*this.sessionTimeoutMs)}}!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(Vh||(Vh={}));var jh="i.posthog.com";class Uh{constructor(e){i(this,"_regionCache",{}),this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e,t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(jh),".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Vh.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Vh.EU:this._regionCache[this.apiHost]=Vh.CUSTOM),this._regionCache[this.apiHost]}endpointFor(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+t;if(this.region===Vh.CUSTOM)return this.apiHost+t;var r=jh+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(r);case"api":return"https://".concat(this.region,".").concat(r)}}}var zh="posthog-js";function Yh(e){var{organization:t,projectId:r,prefix:n,severityAllowList:i=["error"]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o=>{var s,a,l,c,u;if(!("*"===i||i.includes(o.level))||!e.__loaded)return o;o.tags||(o.tags={});var d=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));o.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var h=(null===(s=o.exception)||void 0===s?void 0:s.values)||[];h.forEach((e=>{e.stacktrace&&(e.stacktrace.type="raw",e.stacktrace.frames.forEach((e=>{e.platform="web:javascript"})))}));var p={$exception_message:(null===(a=h[0])||void 0===a?void 0:a.value)||o.message,$exception_type:null===(l=h[0])||void 0===l?void 0:l.type,$exception_personURL:d,$exception_level:o.level,$exception_list:h,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(null===(c=h[0])||void 0===c?void 0:c.value)||o.message,$sentry_exception_type:null===(u=h[0])||void 0===u?void 0:u.type,$sentry_tags:o.tags};return t&&r&&(p.$sentry_url=(n||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+o.event_id),e.exceptions.sendExceptionEvent(p),o}}class Xh{constructor(e,t,r,n,i){this.name=zh,this.setupOnce=function(o){o(Yh(e,{organization:t,projectId:r,prefix:n,severityAllowList:i}))}}}var Jh=an("[SegmentIntegration]");function Kh(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var n=r=>{var n=()=>r.anonymousId()||ld();e.config.get_device_id=n,r.id()&&(e.register({distinct_id:r.id(),$device_id:n()}),e.persistence.set_property(Ei,"identified")),t()},i=r.user();"then"in i&&An(i.then)?i.then((e=>n(e))):n(i)}(e,(()=>{r.register((e=>{Promise&&Promise.resolve||Jh.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,r)=>{var n;if(!r)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Jh.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Jh.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e._calculate_event_properties(r,null!==(n=t.event.properties)&&void 0!==n?n:{},new Date);return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}class Qh{constructor(e){this._instance=e}doPageView(e,t){var r,n=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(r=null==$r?void 0:$r.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){var t;return this._previousPageViewProperties(e,null===(t=this._currentPageview)||void 0===t?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null===(e=this._currentPageview)||void 0===e?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var r=this._currentPageview;if(!r)return{$pageview_id:t};var n={$pageview_id:t,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:s,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=i;if(!(Ln(o)||Ln(s)||Ln(a)||Ln(l)||Ln(c)||Ln(u))){o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var d=o<=1?1:Md(s/o,0,1),h=o<=1?1:Md(a/o,0,1),p=l<=1?1:Md(c/l,0,1),v=l<=1?1:Md(u/l,0,1);n=dn(n,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:v})}}return r.pathname&&(n.$prev_pageview_pathname=r.pathname),r.timestamp&&(n.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),n}}var ep=an("[RateLimiter]");class tp{constructor(e){var t,r;i(this,"serverLimits",{}),i(this,"lastEventRateLimited",!1),i(this,"checkForLimiting",(e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{ep.info("".concat(e||"events"," is quota limited.")),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void ep.warn('could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:t})}})),this.instance=e,this.captureEventsPerSecond=(null===(t=e.config.rate_limiting)||void 0===t?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(r=e.config.rate_limiting)||void 0===r?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,r,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=(new Date).getTime(),o=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(Ti))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:i};o.tokens+=(i-o.last)/1e3*this.captureEventsPerSecond,o.last=i,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var s=o.tokens<1;return s||n||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||n||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,null===(r=this.instance.persistence)||void 0===r||r.set_property(Ti,o),{isRateLimited:s,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var rp=e=>{var r=null==e?void 0:e.config;return t({initialPathName:(null==zr?void 0:zr.pathname)||"",referringDomain:Za.referringDomain()},Za.campaignParams({customTrackedParams:null==r?void 0:r.custom_campaign_params,maskPersonalDataProperties:null==r?void 0:r.mask_personal_data_properties,customPersonalDataProperties:null==r?void 0:r.custom_personal_data_properties}))};class np{constructor(e,t,r,n){i(this,"_onSessionIdCallback",(e=>{var t=this._getStoredProps();if(!t||t.sessionId!==e){var r={sessionId:e,props:this._sessionSourceParamGenerator(this.instance)};this._persistence.register({[xi]:r})}})),this.instance=e,this._sessionIdManager=t,this._persistence=r,this._sessionSourceParamGenerator=n||rp,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[xi]}getSessionProps(){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}:{}}}var ip=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","better uptime bot","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","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","gptbot","oai-searchbot","chatgpt-user","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],op=function(e,t){if(!e)return!1;var r=e.toLowerCase();return ip.concat(t||[]).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))},sp=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&op(r,t))return!0;try{var n=null==e?void 0:e.userAgentData;if(null!=n&&n.brands&&n.brands.some((e=>op(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},ap=an("[Dead Clicks]"),lp=()=>!0,cp=e=>{var t,r=!(null===(t=e.instance.persistence)||void 0===t||!t.get_property(si)),n=e.instance.config.capture_dead_clicks;return Wn(n)?n:r};class up{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[si]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript((()=>{this.start()}))}loadScript(e){var t,r,n;null!==(t=Qr.__PosthogExtensions__)&&void 0!==t&&t.initDeadClicksAutocapture&&e(),null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.loadExternalDependency)||void 0===n||n.call(r,this.instance,"dead-clicks-autocapture",(t=>{t?ap.error("failed to load script",t):e()}))}start(){var e;if(Ur){if(!this._lazyLoadedDeadClicksAutocapture&&null!==(e=Qr.__PosthogExtensions__)&&void 0!==e&&e.initDeadClicksAutocapture){var t=On(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=Qr.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Ur),ap.info("starting...")}}else ap.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,ap.info("stopping..."))}}var dp=an("[Heatmaps]");function hp(e){return On(e)&&"clientX"in e&&"clientY"in e&&$n(e.clientX)&&$n(e.clientY)}class pp{constructor(e){var t;i(this,"rageclicks",new Lu),i(this,"_enabledServerSide",!1),i(this,"_initialized",!1),i(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!(null===(t=this.instance.persistence)||void 0===t||!t.props[ni]),wn($r,"beforeunload",this.flush)}get flushIntervalMilliseconds(){var e=5e3;return On(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Ln(this.instance.config.capture_heatmaps)?Ln(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;dp.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),null===(t=this.deadClicksCapture)||void 0===t||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ni]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.buffer;return this.buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,"deadclick")}_setupListeners(){$r&&Ur&&(wn(Ur,"click",(e=>this._onClick(e||(null==$r?void 0:$r.event))),{capture:!0}),wn(Ur,"mousemove",(e=>this._onMouseMove(e||(null==$r?void 0:$r.event))),{capture:!0}),this.deadClicksCapture=new up(this.instance,lp,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(e,t){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),o=function(e,t,r){for(var n=e;n&&Di(n)&&!Bi(n,"body");){if(n===r)return!1;if(Sn(t,null==$r?void 0:$r.getComputedStyle(n).position))return!0;n=zi(n)}return!1}(ji(e),["fixed","sticky"],i);return{x:e.clientX+(o?0:n),y:e.clientY+(o?0:r),target_fixed:o,type:t}}_onClick(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"click";if(!Li(e.target)&&hp(e)){var i=this._getProperties(e,n);null!==(r=this.rageclicks)&&void 0!==r&&r.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(t(t({},i),{},{type:"rageclick"})),this._capture(i)}}_onMouseMove(e){!Li(e.target)&&hp(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((()=>{this._capture(this._getProperties(e,"mousemove"))}),500))}_capture(e){if($r){var t=$r.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}flush(){this.buffer&&!Pn(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class vp{constructor(e){i(this,"_updateScrollData",(()=>{var e,t,r,n;this.context||(this.context={});var i=this.scrollElement(),o=this.scrollY(),s=i?Math.max(0,i.scrollHeight-i.clientHeight):0,a=o+((null==i?void 0:i.clientHeight)||0),l=(null==i?void 0:i.scrollHeight)||0;this.context.lastScrollY=Math.ceil(o),this.context.maxScrollY=Math.max(o,null!==(e=this.context.maxScrollY)&&void 0!==e?e:0),this.context.maxScrollHeight=Math.max(s,null!==(t=this.context.maxScrollHeight)&&void 0!==t?t:0),this.context.lastContentY=a,this.context.maxContentY=Math.max(a,null!==(r=this.context.maxContentY)&&void 0!==r?r:0),this.context.maxContentHeight=Math.max(l,null!==(n=this.context.maxContentHeight)&&void 0!==n?n:0)})),this.instance=e}getContext(){return this.context}resetContext(){var e=this.context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){wn($r,"scroll",this._updateScrollData,{capture:!0}),wn($r,"scrollend",this._updateScrollData,{capture:!0}),wn($r,"resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return null==$r?void 0:$r.document.documentElement;var e=Rn(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var t of e){var r=null==$r?void 0:$r.document.querySelector(t);if(r)return r}}scrollY(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return $r&&($r.scrollY||$r.pageYOffset||$r.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return $r&&($r.scrollX||$r.pageXOffset||$r.document.documentElement.scrollLeft)||0}}var gp=an("[TracingHeaders]");class fp{constructor(e){i(this,"_restoreXHRPatch",void 0),i(this,"_restoreFetchPatch",void 0),i(this,"_startCapturing",(()=>{var e,t,r,n;Ln(this._restoreXHRPatch)&&(null===(e=Qr.__PosthogExtensions__)||void 0===e||null===(t=e.tracingHeadersPatchFns)||void 0===t||t._patchXHR(this.instance.sessionManager));Ln(this._restoreFetchPatch)&&(null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.tracingHeadersPatchFns)||void 0===n||n._patchFetch(this.instance.sessionManager))})),this.instance=e}_loadScript(e){var t,r,n;null!==(t=Qr.__PosthogExtensions__)&&void 0!==t&&t.tracingHeadersPatchFns&&e(),null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.loadExternalDependency)||void 0===n||n.call(r,this.instance,"tracing-headers",(t=>{if(t)return gp.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(e=this._restoreXHRPatch)||void 0===e||e.call(this),null===(t=this._restoreFetchPatch)||void 0===t||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}var mp;!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(mp||(mp={}));class _p{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?mp.DENIED:this.storedConsent}isOptedOut(){return this.consent===mp.DENIED||this.consent===mp.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||"__ph_opt_in_out_")+e}get storedConsent(){var e=this.storage.get(this.storageKey);return"1"===e?mp.GRANTED:"0"===e?mp.DENIED:mp.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?fd:vd;var t="localStorage"===e?vd:fd;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!bn([null==jr?void 0:jr.doNotTrack,null==jr?void 0:jr.msDoNotTrack,Qr.doNotTrack],(e=>Sn([!0,1,"1","yes"],e)))}}var yp=an("[ExceptionAutocapture]");class bp{constructor(e){var t;i(this,"startCapturing",(()=>{var e,t,r,n;if($r&&this.isEnabled&&!this.hasHandlers){var i=null===(e=Qr.__PosthogExtensions__)||void 0===e||null===(t=e.errorWrappingFunctions)||void 0===t?void 0:t.wrapOnError,o=null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.errorWrappingFunctions)||void 0===n?void 0:n.wrapUnhandledRejection;if(i&&o)try{this.unwrapOnError=i(this.captureException.bind(this)),this.unwrapUnhandledRejection=o(this.captureException.bind(this))}catch(e){yp.error("failed to start",e),this.stopCapturing()}else yp.error("failed to load error wrapping functions - cannot start")}})),this.instance=e,this.remoteEnabled=!(null===(t=this.instance.persistence)||void 0===t||!t.props[ii]),this.startIfEnabled()}get isEnabled(){var e;return Wn(this.instance.config.capture_exceptions)?this.instance.config.capture_exceptions:null!==(e=this.remoteEnabled)&&void 0!==e&&e}get hasHandlers(){return!Ln(this.unwrapOnError)}startIfEnabled(){this.isEnabled&&!this.hasHandlers&&(yp.info("enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,r;this.hasHandlers&&e(),null===(t=Qr.__PosthogExtensions__)||void 0===t||null===(r=t.loadExternalDependency)||void 0===r||r.call(t,this.instance,"exception-autocapture",(t=>{if(t)return yp.error("failed to load script",t);e()}))}stopCapturing(){var e,t;null===(e=this.unwrapOnError)||void 0===e||e.call(this),this.unwrapOnError=void 0,null===(t=this.unwrapUnhandledRejection)||void 0===t||t.call(this),this.unwrapUnhandledRejection=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register({[ii]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(e)}}var wp=an("[Web Vitals]"),Sp=9e5;class Cp{constructor(e){var r;i(this,"_enabledServerSide",!1),i(this,"_initialized",!1),i(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),i(this,"_flushToCapture",(()=>{clearTimeout(this._delayedFlushTimer),0!==this.buffer.metrics.length&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce(((e,r)=>t(t({},e),{},{["$web_vitals_".concat(r.name,"_event")]:t({},r),["$web_vitals_".concat(r.name,"_value")]:r.value})),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})})),i(this,"_addToBuffer",(e=>{var r,n=null===(r=this.instance.sessionManager)||void 0===r?void 0:r.checkAndGetSessionAndWindowId(!0);if(Ln(n))wp.error("Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this._currentURL();if(!Ln(i))if(Hn(null==e?void 0:e.name)||Hn(null==e?void 0:e.value))wp.error("Invalid metric received",e);else if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)wp.error("Ignoring metric with value >= "+this._maxAllowedValue,e);else this.buffer.url!==i&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),Ln(this.buffer.url)&&(this.buffer.url=i),this.buffer.firstMetricTimestamp=Ln(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(t(t({},e),{},{$current_url:i,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()}})),i(this,"_startCapturing",(()=>{var e,t,r,n,i=Qr.__PosthogExtensions__;Ln(i)||Ln(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:r,onINP:n}=i.postHogWebVitalsCallbacks),e&&t&&r&&n?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&n(this._addToBuffer.bind(this)),this._initialized=!0):wp.error("web vitals callbacks not loaded - not starting")})),this.instance=e,this._enabledServerSide=!(null===(r=this.instance.persistence)||void 0===r||!r.props[oi]),this.startIfEnabled()}get allowedMetrics(){var e,t,r=On(this.instance.config.capture_performance)?null===(e=this.instance.config.capture_performance)||void 0===e?void 0:e.web_vitals_allowed_metrics:void 0;return Ln(r)?(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[ai])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(On(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=On(this.instance.config.capture_performance)&&$n(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:Sp;return 0<e&&e<=6e4?Sp:e}get isEnabled(){var e=On(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Wn(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(wp.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(e){var t=On(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=On(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[oi]:t}),this.instance.persistence.register({[ai]:r})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,r,n;null!==(t=Qr.__PosthogExtensions__)&&void 0!==t&&t.postHogWebVitalsCallbacks&&e(),null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.loadExternalDependency)||void 0===n||n.call(r,this.instance,"web-vitals",(t=>{t?wp.error("failed to load script",t):e()}))}_currentURL(){var e=$r?$r.location.href:void 0;return e||wp.error("Could not determine current URL"),e}}var Ip={icontains:(e,t)=>!!$r&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!$r&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!$r&&kn(t.href,e),not_regex:(e,t)=>!!$r&&!kn(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class kp{constructor(e){var t=this;i(this,"getWebExperimentsAndEvaluateDisplayLogic",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t.getWebExperiments((e=>{kp.logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;if(t._flagToExperiments)kp.logInfo("setting flag key ",e.feature_flag_key," to web experiment ",e),null===(r=t._flagToExperiments)||void 0===r||r.set(e.feature_flag_key,e);var n=t.instance.getFeatureFlag(e.feature_flag_key);Dn(n)&&e.variants[n]&&t.applyTransforms(e.name,n,e.variants[n].transforms)}else if(e.variants)for(var i in e.variants){var o=e.variants[i];kp.matchesTestVariant(o)&&t.applyTransforms(e.name,i,o.transforms)}}))}),e)})),this.instance=e,this.instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}onFeatureFlags(e){if(this._is_bot())kp.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(Hn(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();kp.logInfo("applying feature flags",e),e.forEach((e=>{var t;if(this._flagToExperiments&&null!==(t=this._flagToExperiments)&&void 0!==t&&t.has(e)){var r,n=this.instance.getFeatureFlag(e),i=null===(r=this._flagToExperiments)||void 0===r?void 0:r.get(e);n&&null!=i&&i.variants[n]&&this.applyTransforms(i.name,n,i.variants[n].transforms)}}))}}previewWebExperiment(){var e=kp.getWindowLocation();if(null!=e&&e.search){var t=Xn(null==e?void 0:e.search,"__experiment_id"),r=Xn(null==e?void 0:e.search,"__experiment_variant");t&&r&&(kp.logInfo("previewing web experiments ".concat(t," && ").concat(r)),this.getWebExperiments((e=>{this.showPreviewWebExperiment(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.instance.config.disable_web_experiments&&!r)return e([]);var n=this.instance.get_property("$web_experiments");if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var r=t.json.experiments||[];return e(r)}})}showPreviewWebExperiment(e,t,r){var n=r.filter((t=>t.id===e));n&&n.length>0&&(kp.logInfo("Previewing web experiment [".concat(n[0].name,"] with variant [").concat(t,"]")),this.applyTransforms(n[0].name,t,n[0].variants[t].transforms))}static matchesTestVariant(e){return!Hn(e.conditions)&&(kp.matchUrlConditions(e)&&kp.matchUTMConditions(e))}static matchUrlConditions(e){var t;if(Hn(e.conditions)||Hn(null===(t=e.conditions)||void 0===t?void 0:t.url))return!0;var r,n,i,o=kp.getWindowLocation();return!!o&&(null===(r=e.conditions)||void 0===r||!r.url||Ip[null!==(n=null===(i=e.conditions)||void 0===i?void 0:i.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url,o))}static getWindowLocation(){return null==$r?void 0:$r.location}static matchUTMConditions(e){var t;if(Hn(e.conditions)||Hn(null===(t=e.conditions)||void 0===t?void 0:t.utm))return!0;var r=Za.campaignParams();if(r.utm_source){var n,i,o,s,a,l,c,u,d,h,p,v,g,f,m,_,y=null===(n=e.conditions)||void 0===n||null===(i=n.utm)||void 0===i||!i.utm_campaign||(null===(o=e.conditions)||void 0===o||null===(s=o.utm)||void 0===s?void 0:s.utm_campaign)==r.utm_campaign,b=null===(a=e.conditions)||void 0===a||null===(l=a.utm)||void 0===l||!l.utm_source||(null===(c=e.conditions)||void 0===c||null===(u=c.utm)||void 0===u?void 0:u.utm_source)==r.utm_source,w=null===(d=e.conditions)||void 0===d||null===(h=d.utm)||void 0===h||!h.utm_medium||(null===(p=e.conditions)||void 0===p||null===(v=p.utm)||void 0===v?void 0:v.utm_medium)==r.utm_medium,S=null===(g=e.conditions)||void 0===g||null===(f=g.utm)||void 0===f||!f.utm_term||(null===(m=e.conditions)||void 0===m||null===(_=m.utm)||void 0===_?void 0:_.utm_term)==r.utm_term;return y&&w&&S&&b}return!1}static logInfo(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];sn.info("[WebExperiments] ".concat(e),r)}applyTransforms(e,t,r){this._is_bot()?kp.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?r.forEach((r=>{if(r.selector){var n;kp.logInfo("applying transform of variant ".concat(t," for experiment ").concat(e," "),r);var i=null===(n=document)||void 0===n?void 0:n.querySelectorAll(r.selector);null==i||i.forEach((e=>{var t=e;r.attributes&&r.attributes.forEach((e=>{switch(e.name){case"text":t.innerText=e.value;break;case"html":t.innerHTML=e.value;break;case"cssClass":t.className=e.value;break;default:t.setAttribute(e.name,e.value)}})),r.text&&(t.innerText=r.text),r.html&&(t.parentElement?t.parentElement.innerHTML=r.html:t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}})):kp.logInfo("Control variants leave the page unmodified.")}_is_bot(){return jr&&this.instance?sp(jr,this.instance.config.custom_blocked_useragents):void 0}}class Ep{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}var xp=["$set_once","$set"],Tp=an("[SiteApps]");class Mp{constructor(e){this.instance=e,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(e,t){if(t){var r=this.globalsForEvent(t);this.bufferedInvocations.push(r),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}get siteAppLoaders(){var e,t;return null===(e=Qr._POSTHOG_REMOTE_CONFIG)||void 0===e||null===(t=e[this.instance.config.token])||void 0===t?void 0:t.siteApps}init(){if(this.isEnabled){var e=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{e(),this.bufferedInvocations=[],this.stopBuffering=void 0}}}globalsForEvent(e){var r,n,i,s,a,l,c;if(!e)throw new Error("Event payload is required");var u={},d=this.instance.get_property("$groups")||[],h=this.instance.get_property("$stored_group_properties")||{};for(var[p,v]of Object.entries(h))u[p]={id:d[p],type:p,properties:v};var{$set_once:g,$set:f}=e;return{event:t(t({},o(e,xp)),{},{properties:t(t(t({},e.properties),f?{$set:t(t({},null!==(r=null===(n=e.properties)||void 0===n?void 0:n.$set)&&void 0!==r?r:{}),f)}:{}),g?{$set_once:t(t({},null!==(i=null===(s=e.properties)||void 0===s?void 0:s.$set_once)&&void 0!==i?i:{}),g)}:{}),elements_chain:null!==(a=null===(l=e.properties)||void 0===l?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null===(c=e.properties)||void 0===c?void 0:c.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var t={id:e.id,loaded:!1,errored:!1};this.apps[e.id]=t;var r=r=>{var n;for(var i of(this.apps[e.id].errored=!r,this.apps[e.id].loaded=!0,Tp.info("Site app with id ".concat(e.id," ").concat(r?"loaded":"errored")),r&&this.bufferedInvocations.length&&(Tp.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(e.id)),this.bufferedInvocations.forEach((e=>{var r;return null===(r=t.processEvent)||void 0===r?void 0:r.call(t,e)}))),Object.values(this.apps)))if(!i.loaded)return;null===(n=this.stopBuffering)||void 0===n||n.call(this)};try{var{processEvent:n}=e.init({posthog:this.instance,callback:e=>{r(e)}});n&&(t.processEvent=n)}catch(t){Tp.error("Error while initializing PostHog app with config id ".concat(e.id),t),r(!1)}}onCapturedEvent(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{var n;null===(n=r.processEvent)||void 0===n||n.call(r,t)}catch(t){Tp.error("Error while processing event ".concat(e.event," for site app ").concat(r.id),t)}}}onRemoteConfig(e){var t,r,n,i=this;if(null!==(t=this.siteAppLoaders)&&void 0!==t&&t.length){if(!this.isEnabled)return void Tp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');for(var o of this.siteAppLoaders)this.setupSiteApp(o);this.instance.on("eventCaptured",(e=>this.onCapturedEvent(e)))}else if(null===(r=this.stopBuffering)||void 0===r||r.call(this),null!==(n=e.siteApps)&&void 0!==n&&n.length)if(this.isEnabled){var s=function(e,t){var r,n;Qr["__$$ph_site_app_".concat(e)]=i.instance,null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.loadSiteApp)||void 0===n||n.call(r,i.instance,t,(t=>{if(t)return Tp.error("Error while initializing PostHog app with config id ".concat(e),t)}))};for(var{id:a,url:l}of e.siteApps)s(a,l)}else Tp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}function Rp(e,t,r){return Bh({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var Ap={},Np=()=>{},Fp="posthog",Op=!Ph&&-1===(null==Kr?void 0:Kr.indexOf("MSIE"))&&-1===(null==Kr?void 0:Kr.indexOf("Mozilla")),Pp=()=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:yn(null==Ur?void 0:Ur.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Np,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:zr&&Dn(null==zr?void 0:zr.search)&&-1!==zr.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==$r||null===(e=$r.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_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],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:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;sn.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Nh},_onCapture:Np}},Lp=e=>{var t={};Ln(e.process_person)||(t.person_profiles=e.process_person),Ln(e.xhr_headers)||(t.request_headers=e.xhr_headers),Ln(e.cookie_name)||(t.persistence_name=e.cookie_name),Ln(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),Ln(e.store_google)||(t.save_campaign_params=e.store_google),Ln(e.verbose)||(t.debug=e.verbose);var r=dn({},t,e);return Rn(e.property_blacklist)&&(Ln(e.property_denylist)?r.property_denylist=e.property_blacklist:Rn(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:sn.error("Invalid value for property_denylist config: "+e.property_denylist)),r};class Dp{constructor(){i(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){sn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Bp{get decideEndpointWasHit(){var e,t;return null!==(e=null===(t=this.featureFlags)||void 0===t?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){i(this,"webPerformance",new Dp),i(this,"version",nn.LIB_VERSION),i(this,"_internalEventEmitter",new Ga),this.config=Pp(),this.SentryIntegration=Xh,this.sentryIntegration=e=>function(e,t){var r=Yh(e,t);return{name:zh,processEvent:e=>r(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this._cachedIdentify=null,this.featureFlags=new td(this),this.toolbar=new Ah(this),this.scrollManager=new vp(this),this.pageViewManager=new Qh(this),this.surveys=new Qa(this),this.experiments=new kp(this),this.exceptions=new Ep(this),this.rateLimiter=new tp(this),this.requestRouter=new Uh(this),this.consent=new _p(this),this.people={set:(e,t,r)=>{var n=Dn(e)?{[e]:t}:e;this.setPersonProperties(n),null==r||r({})},set_once:(e,t,r)=>{var n=Dn(e)?{[e]:t}:e;this.setPersonProperties(void 0,n),null==r||r({})}},this.on("eventCaptured",(e=>sn.info('send "'.concat(null==e?void 0:e.event,'"'),e)))}init(e,t,r){if(r&&r!==Fp){var n,i=null!==(n=Ap[r])&&void 0!==n?n:new Bp;return i._init(e,t,r),Ap[r]=i,Ap[Fp][r]=i,i}return this._init(e,t,r)}_init(e){var r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(Ln(e)||Bn(e))return sn.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return sn.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],i.person_profiles&&(this._initialPersonProfilesConfig=i.person_profiles),this.set_config(dn({},Pp(),Lp(i),{name:o,token:e})),this.config.on_xhr_error&&sn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:qr.GZipJS,this.persistence=new Id(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Id(t(t({},this.config),{},{persistence:"sessionStorage"}));var s=t({},this.persistence.props),a=t({},this.sessionPersistence.props);if(this._requestQueue=new Fh((e=>this._send_retriable_request(e)),this.config.request_queue_config),this._retryQueue=new Wh(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new Gh(this),this.sessionPropsManager=new np(this,this.sessionManager,this.persistence)),new fp(this).startIfEnabledOrStop(),this.siteApps=new Mp(this),null===(r=this.siteApps)||void 0===r||r.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new Ih(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Wu(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new pp(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Cp(this),this.exceptionObserver=new bp(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new up(this,cp),this.deadClicksAutocapture.startIfEnabled(),nn.DEBUG=nn.DEBUG||this.config.debug,nn.DEBUG&&sn.info("Starting in debug mode",{this:this,config:i,thisC:t({},this.config),p:s,s:a}),this._sync_opt_out_with_persistence(),void 0!==(null===(n=i.bootstrap)||void 0===n?void 0:n.distinctID)){var l,c,u=this.config.get_device_id(ld()),d=null!==(l=i.bootstrap)&&void 0!==l&&l.isIdentifiedID?u:i.bootstrap.distinctID;this.persistence.set_property(Ei,null!==(c=i.bootstrap)&&void 0!==c&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.bootstrap.distinctID,$device_id:d})}if(this._hasBootstrappedFeatureFlags()){var h,p,v=Object.keys((null===(h=i.bootstrap)||void 0===h?void 0:h.featureFlags)||{}).filter((e=>{var t,r;return!(null===(t=i.bootstrap)||void 0===t||null===(r=t.featureFlags)||void 0===r||!r[e])})).reduce(((e,t)=>{var r,n;return e[t]=(null===(r=i.bootstrap)||void 0===r||null===(n=r.featureFlags)||void 0===n?void 0:n[t])||!1,e}),{}),g=Object.keys((null===(p=i.bootstrap)||void 0===p?void 0:p.featureFlagPayloads)||{}).filter((e=>v[e])).reduce(((e,t)=>{var r,n,o,s;null!==(r=i.bootstrap)&&void 0!==r&&null!==(n=r.featureFlagPayloads)&&void 0!==n&&n[t]&&(e[t]=null===(o=i.bootstrap)||void 0===o||null===(s=o.featureFlagPayloads)||void 0===s?void 0:s[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:g})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Oi,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(ld());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(Ei,"anonymous")}return wn($r,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),i.segment?Kh(this,(()=>this._loaded())):this._loaded(),An(this.config._onCapture)&&this.config._onCapture!==Np&&(sn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this}_onRemoteConfig(e){var t,r,n,i,o,s,a,l;if(!Ur||!Ur.body)return sn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this._onRemoteConfig(e)}),500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Sn(e.supportedCompression,qr.GZipJS)?qr.GZipJS:Sn(e.supportedCompression,qr.Base64)?qr.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),null===(r=this.siteApps)||void 0===r||r.onRemoteConfig(e),null===(n=this.sessionRecording)||void 0===n||n.onRemoteConfig(e),null===(i=this.autocapture)||void 0===i||i.onRemoteConfig(e),null===(o=this.heatmaps)||void 0===o||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null===(s=this.webVitalsAutocapture)||void 0===s||s.onRemoteConfig(e),null===(a=this.exceptionObserver)||void 0===a||a.onRemoteConfig(e),null===(l=this.deadClicksAutocapture)||void 0===l||l.onRemoteConfig(e)}_loaded(){try{this.config.loaded(this)}catch(e){sn.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((()=>{this.consent.isOptedIn()&&this._captureInitialPageview()}),1),new Eh(this).load(),this.featureFlags.decide()}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||cn(this.__request_queue,(e=>this._send_retriable_request(e))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Op?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Dh(e.url,{ip:this.config.ip?1:0}),e.headers=t({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var r,n,i,o=t({},e);o.timeout=o.timeout||6e4,o.url=Dh(o.url,{_:(new Date).getTime().toString(),ver:nn.LIB_VERSION,compression:o.compression});var s=null!==(r=o.transport)&&void 0!==r?r:"fetch",a=null!==(n=null===(i=bn(Hh,(e=>e.transport===s)))||void 0===i?void 0:i.method)&&void 0!==n?n:Hh[0].method;if(!a)throw new Error("No available transport method");a(o)})(t(t({},e),{},{callback:t=>{var r,n,i;(this.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(n=(i=this.config).on_request_error)||void 0===n||n.call(i,t));null===(r=e.callback)||void 0===r||r.call(e,t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,r=[],n=[],i=[];cn(e,(e=>{e&&(t=e[0],Rn(t)?i.push(e):An(e)?e.call(this):Rn(e)&&"alias"===t?r.push(e):Rn(e)&&-1!==t.indexOf("capture")&&An(this[t])?i.push(e):n.push(e))}));var o=function(e,t){cn(e,(function(e){if(Rn(e[0])){var r=t;un(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};o(r,this),o(n,this),o(i,this)}_hasBootstrappedFeatureFlags(){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}push(e){this._execute_array([e])}capture(e,r,n){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!Ln(e)&&Dn(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,a=(null==n?void 0:n.timestamp)||s,l=ld(),c={uuid:l,event:e,properties:this._calculate_event_properties(e,r||{},a,l)};o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==n?void 0:n.$set)&&(c.$set=null==n?void 0:n.$set);var u=this._calculate_set_once_properties(null==n?void 0:n.$set_once);u&&(c.$set_once=u),(c=mn(c,null!=n&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,Ln(null==n?void 0:n.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=s);var d=t(t({},c.properties.$set),c.$set);if(Pn(d)||this.setPersonPropertiesForFlags(d),!Hn(this.config.before_send)){var h=this._runBeforeSend(c);if(!h)return;c=h}this._internalEventEmitter.emit("eventCaptured",c);var p={method:"POST",url:null!==(i=null==n?void 0:n._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,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(p):this._requestQueue.enqueue(p),c}sn.critical("This capture call is ignored due to client rate limiting.")}}else sn.error("No event name provided to posthog.capture")}else sn.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}_calculate_event_properties(e,r,n,i){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return r;var o=this.persistence.remove_event_timer(e),s=t({},r);if(s.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(s.$cookieless_mode=!0),"$snapshot"===e){var a=t(t({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=a.distinct_id,(!Dn(s.distinct_id)&&!$n(s.distinct_id)||Bn(s.distinct_id))&&sn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var l,c=Za.properties({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});if(this.sessionManager){var{sessionId:u,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId();s.$session_id=u,s.$window_id=d}if(this.sessionRecording&&(s.$recording_status=this.sessionRecording.status),this.requestRouter.region===Vh.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),l="$pageview"===e?this.pageViewManager.doPageView(n,i):"$pageleave"===e?this.pageViewManager.doPageLeave(n):this.pageViewManager.doEvent(),s=dn(s,l),"$pageview"===e&&Ur&&(s.title=Ur.title),!Ln(o)){var h=n.getTime()-o;s.$duration=parseFloat((h/1e3).toFixed(3))}Kr&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=dn({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Rn(this.config.property_denylist)?un(this.config.property_denylist,(function(e){delete s[e]})):sn.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(sn.error("sanitize_properties is deprecated. Use before_send instead"),s=p(s,e));var v=this._hasPersonProcessing();return s.$process_person_profile=v,v&&this._requirePersonProcessing("_calculate_event_properties"),s}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=dn({},this.persistence.get_initial_props(),e||{}),r=this.config.sanitize_properties;return r&&(sn.error("sanitize_properties is deprecated. Use before_send instead"),t=r(t,"$set_once")),Pn(t)?void 0:t}register(e,t){var r;null===(r=this.persistence)||void 0===r||r.register(e,t)}register_once(e,t,r){var n;null===(n=this.persistence)||void 0===n||n.register_once(e,t,r)}register_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}unregister(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}unregister_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){var t,r;return null!==(t=null===(r=this.sessionManager)||void 0===r?void 0:r.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,r){return this.surveys.getNextSurveyStep(e,t,r)}identify(e,r,n){if(!this.__loaded||!this.persistence)return sn.uninitializedWarning("posthog.identify");if($n(e)&&(e=e.toString(),sn.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()))sn.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 if(this._requirePersonProcessing("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==i&&e!==this.get_property(ei)&&(this.unregister(ei),this.register({distinct_id:e}));var s="anonymous"===(this.persistence.get_property(Ei)||"anonymous");e!==i&&s?(this.persistence.set_property(Ei,"identified"),this.setPersonPropertiesForFlags(t(t({},n||{}),r||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:r||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(i),this._cachedIdentify=Rp(e,r,n)):(r||n)&&(this._cachedIdentify!==Rp(e,r,n)?(this.setPersonProperties(r,n),this._cachedIdentify=Rp(e,r,n)):sn.info("A duplicate posthog.identify call was made with the same properties. It has been ignored.")),e!==i&&(this.reloadFeatureFlags(),this.unregister(ki))}}else sn.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,r){(e||r)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(t(t({},r||{}),e||{})),this.capture("$set",{$set:e||{},$set_once:r||{}}))}group(e,r,n){if(e&&r){if(this._requirePersonProcessing("posthog.group")){var i=this.getGroups();i[e]!==r&&this.resetGroupPropertiesForFlags(e),this.register({$groups:t(t({},i),{},{[e]:r})}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:r,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),i[e]===r||n||this.reloadFeatureFlags()}}else sn.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,r,n,i;if(sn.info("reset"),!this.__loaded)return sn.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(r=this.sessionPersistence)||void 0===r||r.clear(),this.surveys.reset(),null===(n=this.persistence)||void 0===n||n.set_property(Ei,"anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId(),this._cachedIdentify=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Oi,$device_id:null},"");else{var s=this.config.get_device_id(ld());this.register_once({distinct_id:s,$device_id:e?s:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(t));if(null!=e&&e.withTimestamp&&r){var i,o=null!==(i=e.timestampLookBack)&&void 0!==i?i:10;if(!r)return n;var s=Math.max(Math.floor(((new Date).getTime()-r)/1e3)-o,0);n+="?t=".concat(s)}return n}alias(e,t){return e===this.get_property(Qn)?(sn.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Ln(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(ei,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(sn.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var r,n,i,o,s=t({},this.config);On(e)&&(dn(this.config,Lp(e)),null===(r=this.persistence)||void 0===r||r.update_config(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Id(t(t({},this.config),{},{persistence:"sessionStorage"})),fd.is_supported()&&"true"===fd.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(nn.DEBUG=!0,sn.info("set_config",{config:e,oldConfig:s,newConfig:t({},this.config)})),null===(n=this.sessionRecording)||void 0===n||n.startIfEnabledOrStop(),null===(i=this.autocapture)||void 0===i||i.startIfEnabled(),null===(o=this.heatmaps)||void 0===o||o.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){var t=!0===e,r={sampling:t||!(null==e||!e.sampling),linked_flag:t||!(null==e||!e.linked_flag),url_trigger:t||!(null==e||!e.url_trigger),event_trigger:t||!(null==e||!e.event_trigger)};if(Object.values(r).some(Boolean)){var n,i,o,s,a;if(null===(n=this.sessionManager)||void 0===n||n.checkAndGetSessionAndWindowId(),r.sampling)null===(i=this.sessionRecording)||void 0===i||i.overrideSampling();if(r.linked_flag)null===(o=this.sessionRecording)||void 0===o||o.overrideLinkedFlag();if(r.url_trigger)null===(s=this.sessionRecording)||void 0===s||s.overrideTrigger("url");if(r.event_trigger)null===(a=this.sessionRecording)||void 0===a||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}captureException(e,r){var n,i=new Error("PostHog syntheticException"),o=An(null===(n=Qr.__PosthogExtensions__)||void 0===n?void 0:n.parseErrorAsProperties)?t(t({},Qr.__PosthogExtensions__.parseErrorAsProperties(Gn(e)?{error:e,event:e.message}:{event:e},{syntheticException:i})),r):t({$exception_level:"error",$exception_list:[{type:Gn(e)?e.name:"Error",value:Gn(e)?e.message:e,mechanism:{handled:!0,synthetic:!1}}]},r);this.exceptions.sendExceptionEvent(o)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}getSessionProperty(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:Fp;return t!==Fp&&(t=Fp+"."+t),t}_isIdentified(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(Ei))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(Ei))}_hasPersonProcessing(){var e,t,r,n;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Pn(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[ei])&&(null===(r=this.persistence)||void 0===r||null===(n=r.props)||void 0===n||!n[Ni]))}_shouldCapturePageleave(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(sn.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Ni,!0),!0)}_sync_opt_out_with_persistence(){var e,t,r,n,i=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,s=this.config.disable_persistence||i&&!!o;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==s&&(null===(r=this.persistence)||void 0===r||r.set_disabled(s));(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==s&&(null===(n=this.sessionPersistence)||void 0===n||n.set_disabled(s))}opt_in_capturing(e){var t;(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),Ln(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return jr?sp(jr,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Ur&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:Ur.title},{send_instantly:!0}))}debug(e){!1===e?(null==$r||$r.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==$r||$r.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}))}_runBeforeSend(e){if(Hn(this.config.before_send))return e;var t=Rn(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of t){if(r=n(r),Hn(r)){var i="Event '".concat(e.event,"' was rejected in beforeSend function");return jn(e.event)?sn.warn("".concat(i,". This can cause unexpected behavior.")):sn.info(i),null}r.properties&&!Pn(r.properties)||sn.warn("Event '".concat(e.event,"' has no properties after beforeSend function, this is likely an error."))}return r}getPageViewId(){var e;return null===(e=this.pageViewManager._currentPageview)||void 0===e?void 0:e.pageViewId}}!function(e,t){for(var r=0;r<t.length;r++)e.prototype[t[r]]=gn(e.prototype[t[r]])}(Bp,["identify"]);var qp,Hp;qp=Ap[Fp]=new Bp,(Hp=Qr.posthog)&&un(Hp._i,(function(e){if(e&&Rn(e)){var t=qp.init(e[0],e[1],e[2]),r=Hp[e[2]]||Hp;t&&(t._execute_array.call(t.people,r.people),t._execute_array(r))}})),Qr.posthog=qp,function(){function e(){e.done||(e.done=!0,Op=!1,un(Ap,(function(e){e._dom_loaded()})))}null!=Ur&&Ur.addEventListener?"complete"===Ur.readyState?e():wn(Ur,"DOMContentLoaded",e,{capture:!1}):$r&&sn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
|
|
1
|
+
!function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?e(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(e,t,r,n,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,i)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var s=e.apply(t,n);function a(e){r(s,i,o,a,l,"next",e)}function l(e){r(s,i,o,a,l,"throw",e)}a(void 0)}))}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var s,a=["type"],l=Object.defineProperty,c=(e,t,r)=>((e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),u=Object.defineProperty,d=(e,t,r)=>((e,t,r)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),h=(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))(h||{}),p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},v={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var g={};function f(e){if(g[e])return g[e];var t=function(e){var t,r,n=null===globalThis||void 0===globalThis||null===(t=globalThis.Zone)||void 0===t||null===(r=t.__symbol__)||void 0===r?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in p?p[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in v?v[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return g[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?g[e]=c:t.prototype}catch(e){return t.prototype}}var m={};function _(e,t,r){var n,i="".concat(e,".").concat(String(r));if(m[i])return m[i].call(t);var o=f(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(m[i]=s,s.call(t)):t[r]}var y={};function b(e,t,r){var n="".concat(e,".").concat(String(r));if(y[n])return y[n].bind(t);var i=f(e)[r];return"function"!=typeof i?t[r]:(y[n]=i,i.bind(t))}var w={childNodes:function(e){return _("Node",e,"childNodes")},parentNode:function(e){return _("Node",e,"parentNode")},parentElement:function(e){return _("Node",e,"parentElement")},textContent:function(e){return _("Node",e,"textContent")},contains:function(e,t){return b("Node",e,"contains")(t)},getRootNode:function(e){return b("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?_("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?_("Element",e,"shadowRoot"):null},querySelector:function(e,t){return _("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return _("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return f("MutationObserver").constructor}};function S(e){return e.nodeType===e.ELEMENT_NODE}function C(e){var t=e&&"host"in e&&"mode"in e&&w.host(e)||null;return Boolean(t&&"shadowRoot"in t&&w.shadowRoot(t)===e)}function I(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function k(e){try{var t=e.rules||e.cssRules;if(!t)return null;var r=Array.from(t,(t=>E(t,e.href))).join("");return(n=r).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}catch(e){return null}var n}function E(e,t){if(function(e){return"styleSheet"in e}(e)){var r;try{r=k(e.styleSheet)||function(e){var{cssText:t}=e;if(t.split('"').length<3)return t;var r=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer(".concat(e.layerName,")")),e.supportsText&&r.push("supports(".concat(e.supportsText,")")),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){r=e.cssText}return e.styleSheet.href?B(r,e.styleSheet.href):r}var n,i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(n,"$1\\$2")),t?B(i,t):i}function x(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let T=class{constructor(){d(this,"idNodeMap",new Map),d(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function M(e){var{element:t,maskInputOptions:r,tagName:n,type:i,value:o,maskInputFn:s}=e,a=o||"",l=i&&R(i);return(r[n.toLowerCase()]||l&&r[l])&&(a=s?s(a,t):"*".repeat(a.length)),a}function R(e){return e.toLowerCase()}var A="__rrweb_original__";function N(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?R(t):null}function F(e,t){var r,n;try{n=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==i?void 0:i[1])&&void 0!==r?r:null}var O=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,P=/^(?:[a-z+]+:)?\/\//i,L=/^www\..*/i,D=/^(data:)([^,]*),(.*)/i;function B(e,t){return(e||"").replace(O,((e,r,n,i,o,s)=>{var a,l=n||o||s,c=r||i||"";if(!l)return e;if(P.test(l)||L.test(l))return"url(".concat(c).concat(l).concat(c,")");if(D.test(l))return"url(".concat(c).concat(l).concat(c,")");if("/"===l[0])return"url(".concat(c).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)).concat(c,")");var u=t.split("/"),d=l.split("/");for(var h of(u.pop(),d))"."!==h&&(".."===h?u.pop():u.push(h));return"url(".concat(c).concat(u.join("/")).concat(c,")")}))}var q,H,$=1,W=new RegExp("[^a-z0-9-_:]"),V=-2;function Z(){return $++}var G=/^[^ \t\n\r\u000c]+/,j=/^[, \t\n\r\u000c]+/;var U=new WeakMap;function z(e,t){return t&&""!==t.trim()?X(e,t):t}function Y(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function X(e,t){var r=U.get(e);if(r||(r=e.createElement("a"),U.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function J(e,t,r,n){return n?"src"===r||"href"===r&&("use"!==t||"#"!==n[0])||"xlink:href"===r&&"#"!==n[0]?z(e,n):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function n(e){var n,i=e.exec(t.substring(r));return i?(n=i[0],r+=n.length,n):""}for(var i=[];n(j),!(r>=t.length);){var o=n(G);if(","===o.slice(-1))o=z(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=z(e,o);for(var a=!1;;){var l=t.charAt(r);if(""===l){i.push((o+s).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,i.push((o+s).trim());break}"("===l&&(a=!0)}s+=l,r+=1}}}return i.join(", ")}(e,n):"style"===r?B(n,X(e)):"object"===t&&"data"===r?z(e,n):n:z(e,n):n}function K(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Q(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Q(w.parentNode(e),t,r);for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return!!r&&Q(w.parentNode(e),t,r)}function ee(e,t,r,n){var i;if(S(e)){if(i=e,!w.childNodes(i).length)return!1}else{if(null===w.parentElement(e))return!1;i=w.parentElement(e)}try{if("string"==typeof t){if(n){if(i.closest(".".concat(t)))return!0}else if(i.classList.contains(t))return!0}else if(Q(i,t,n))return!0;if(r)if(n){if(i.closest(r))return!0}else if(i.matches(r))return!0}catch(e){}return!1}function te(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:s,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:f=!1}=t,m=function(e,t){if(!t.hasNode(e))return;var r=t.getId(e);return 1===r?void 0:r}(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:h.Document,childNodes:[],compatMode:e.compatMode}:{type:h.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:m};case e.ELEMENT_NODE:return function(e,t){for(var r,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:c={},inlineImages:u,recordCanvas:d,keepIframeSrcFn:p,newlyAddedElement:v=!1,rootId:g}=t,f=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,i,o),m=function(e){if(e instanceof HTMLFormElement)return"form";var t=R(e.tagName);return W.test(t)?"div":t}(e),_={},y=e.attributes.length,b=0;b<y;b++){var S=e.attributes[b];K(m,S.name,S.value)||(_[S.name]=J(n,m,R(S.name),S.value))}if("link"===m&&s){var C=function(e){return null==e?void 0:e.href}(e);if(C){var I=x(n,C);if(!I&&C.includes(".css"))I=x(n,window.location.origin+"/"+C.replace(window.location.href,""));var E=null;I&&(E=k(I)),E&&(delete _.rel,delete _.href,_._cssText=E)}}if("style"===m&&e.sheet&&!(e.innerText||w.textContent(e)||"").trim().length){var T=k(e.sheet);T&&(_._cssText=T)}if("input"===m||"textarea"===m||"select"===m){var F=e.value,O=e.checked;"radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&F?_.value=M({element:e,type:N(e),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(_.checked=O)}"option"===m&&(e.selected&&!a.select?_.selected=!0:delete _.selected);if("dialog"===m&&e.open)try{_.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){_.rr_open_mode="modal",_.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var r=0;r<e.width;r+=50)for(var n=0;n<e.height;n+=50){var i=t.getImageData,o=A in i?i[A]:i;if(new Uint32Array(o.call(t,r,n,Math.min(50,e.width-r),Math.min(50,e.height-n)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(_.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var P=e.toDataURL(c.type,c.quality),L=n.createElement("canvas");L.width=e.width,L.height=e.height,P!==L.toDataURL(c.type,c.quality)&&(_.rr_dataURL=P)}if("img"===m&&u){q||(q=n.createElement("canvas"),H=q.getContext("2d"));var D=e,B=D.currentSrc||D.getAttribute("src")||"<unknown-src>",$=D.crossOrigin,V=()=>{D.removeEventListener("load",V);try{q.width=D.naturalWidth,q.height=D.naturalHeight,H.drawImage(D,0,0),_.rr_dataURL=q.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==D.crossOrigin)return D.crossOrigin="anonymous",void(D.complete&&0!==D.naturalWidth?V():D.addEventListener("load",V));console.warn("Cannot inline img src=".concat(B,"! Error: ").concat(e))}"anonymous"===D.crossOrigin&&($?_.crossOrigin=$:D.removeAttribute("crossorigin"))};D.complete&&0!==D.naturalWidth?V():D.addEventListener("load",V)}if("audio"===m||"video"===m){var Z=_;Z.rr_mediaState=e.paused?"paused":"played",Z.rr_mediaCurrentTime=e.currentTime,Z.rr_mediaPlaybackRate=e.playbackRate,Z.rr_mediaMuted=e.muted,Z.rr_mediaLoop=e.loop,Z.rr_mediaVolume=e.volume}v||(e.scrollLeft&&(_.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(_.rr_scrollTop=e.scrollTop));if(f){var{width:G,height:j}=e.getBoundingClientRect();_={class:_.class,rr_width:"".concat(G,"px"),rr_height:"".concat(j,"px")}}"iframe"!==m||p(_.src)||(e.contentDocument||(_.rr_src=_.src),delete _.src);try{customElements.get(m)&&(r=!0)}catch(e){}return{type:h.Element,tagName:m,attributes:_,childNodes:[],isSVG:Y(e)||void 0,needBlock:f,rootId:g,isCustom:r}}(e,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:v,keepIframeSrcFn:g,newlyAddedElement:f,rootId:m});case e.TEXT_NODE:return function(e,t){var r,{needsMask:n,maskTextFn:i,rootId:o}=t,s=w.parentNode(e),a=s&&s.tagName,l=w.textContent(e),c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;if(c&&l){try{e.nextSibling||e.previousSibling||(null==(r=s.sheet)?void 0:r.cssRules)&&(l=k(s.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}l=B(l,X(t.doc))}u&&(l="SCRIPT_PLACEHOLDER");!c&&!u&&l&&n&&(l=i?i(l,w.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:h.Text,textContent:l||"",isStyle:c,rootId:o}}(e,{doc:r,needsMask:s,maskTextFn:c,rootId:m});case e.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case e.COMMENT_NODE:return{type:h.Comment,textContent:w.textContent(e)||"",rootId:m};default:return!1}}function re(e){return null==e?"":e.toLowerCase()}function ne(e,t){var{doc:r,mirror:n,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g={},inlineImages:f=!1,recordCanvas:m=!1,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:E=5e3,keepIframeSrcFn:x=(()=>!1),newlyAddedElement:T=!1}=t,{needsMask:M}=t,{preserveWhiteSpace:R=!0}=t;M||(M=ee(e,s,a,void 0===M));var A,N=te(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:g,inlineImages:f,recordCanvas:m,keepIframeSrcFn:x,newlyAddedElement:T});if(!N)return console.warn(e,"not serialized"),null;A=n.hasNode(e)?n.getId(e):!function(e,t){if(t.comment&&e.type===h.Comment)return!0;if(e.type===h.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&&"js"===F(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(re(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===re(e.attributes.name)||"icon"===re(e.attributes.rel)||"apple-touch-icon"===re(e.attributes.rel)||"shortcut icon"===re(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&re(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(re(e.attributes.property).match(/^(og|twitter|fb):/)||re(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===re(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===re(e.attributes.name)||"googlebot"===re(e.attributes.name)||"bingbot"===re(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===re(e.attributes.name)||"generator"===re(e.attributes.name)||"framework"===re(e.attributes.name)||"publisher"===re(e.attributes.name)||"progid"===re(e.attributes.name)||re(e.attributes.property).match(/^article:/)||re(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===re(e.attributes.name)||"yandex-verification"===re(e.attributes.name)||"csrf-token"===re(e.attributes.name)||"p:domain_verify"===re(e.attributes.name)||"verify-v1"===re(e.attributes.name)||"verification"===re(e.attributes.name)||"shopify-checkout-api-token"===re(e.attributes.name)))return!0}}return!1}(N,v)&&(R||N.type!==h.Text||N.isStyle||N.textContent.replace(/^\s+|\s+$/gm,"").length)?Z():V;var O=Object.assign(N,{id:A});if(n.add(e,O),A===V)return null;_&&_(e);var P=!l;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=w.shadowRoot(e);L&&I(L)&&(O.isShadowHost=!0)}if((O.type===h.Document||O.type===h.Element)&&P){v.headWhitespace&&O.type===h.Element&&"head"===O.tagName&&(R=!1);var D={doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:R,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x};if(O.type===h.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(w.childNodes(e))){var q=ne(B,D);q&&O.childNodes.push(q)}var H=null;if(S(e)&&(H=w.shadowRoot(e)))for(var $ of Array.from(w.childNodes(H))){var W=ne($,D);W&&(I(H)&&(W.isShadow=!0),O.childNodes.push(W))}}var G=w.parentNode(e);return G&&C(G)&&I(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(e,t,r){var n=e.contentWindow;if(n){var i,o=!1;try{i=n.document.readyState}catch(e){return}if("complete"===i){var s="about:blank";if(n.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout((()=>{o||(t(),o=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(a),o=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&y){var r=ne(t,{doc:t,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:R,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x});r&&y(e,r)}}),b),O.type===h.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===F(O.attributes.href))&&function(e,t,r){var n,i=!1;try{n=e.sheet}catch(e){return}if(!n){var o=setTimeout((()=>{i||(t(),i=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(o),i=!0,t()}))}}(e,(()=>{if(k){var t=ne(e,{doc:r,mirror:n,blockClass:i,blockSelector:o,needsMask:M,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:v,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:R,onSerialize:_,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:E,keepIframeSrcFn:x});t&&k(e,t)}}),E),O}let ie=class e{constructor(){__publicField2(this,"parentElement",null),__publicField2(this,"parentNode",null),__publicField2(this,"ownerDocument"),__publicField2(this,"firstChild",null),__publicField2(this,"lastChild",null),__publicField2(this,"previousSibling",null),__publicField2(this,"nextSibling",null),__publicField2(this,"ELEMENT_NODE",1),__publicField2(this,"TEXT_NODE",3),__publicField2(this,"nodeType"),__publicField2(this,"nodeName"),__publicField2(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var oe={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},se={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var ae={};function le(e){if(ae[e])return ae[e];var t=function(e){var t,r,n=null===globalThis||void 0===globalThis||null===(t=globalThis.Zone)||void 0===t||null===(r=t.__symbol__)||void 0===r?void 0:r.call(t,e);return n&&globalThis[n]?globalThis[n]:void 0}(e)||globalThis[e],r=t.prototype,n=e in oe?oe[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in se?se[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return ae[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?ae[e]=c:r}catch(e){return r}}var ce={};function ue(e,t,r){var n,i="".concat(e,".").concat(String(r));if(ce[i])return ce[i].call(t);var o=le(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(ce[i]=s,s.call(t)):t[r]}var de={};function he(e,t,r){var n="".concat(e,".").concat(String(r));if(de[n])return de[n].bind(t);var i=le(e)[r];return"function"!=typeof i?t[r]:(de[n]=i,i.bind(t))}function pe(){return le("MutationObserver").constructor}var ve={childNodes:function(e){return ue("Node",e,"childNodes")},parentNode:function(e){return ue("Node",e,"parentNode")},parentElement:function(e){return ue("Node",e,"parentElement")},textContent:function(e){return ue("Node",e,"textContent")},contains:function(e,t){return he("Node",e,"contains")(t)},getRootNode:function(e){return he("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ue("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ue("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ue("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ue("Element",e,"querySelectorAll")(t)},mutationObserver:pe};function ge(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}var fe="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.",me={map:{},getId:()=>(console.error(fe),-1),getNode:()=>(console.error(fe),null),removeNodeFromMap(){console.error(fe)},has:()=>(console.error(fe),!1),reset(){console.error(fe)}};function _e(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=null,i=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var l=Date.now();i||!1!==r.leading||(i=l);var c=t-(l-i),u=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),i=l,e.apply(u,s)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(u,s)}),c))}}function ye(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,n?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>ye(e,t,o||{},!0)}function be(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(me=new Proxy(me,{get:(e,t,r)=>("map"===t&&console.error(fe),Reflect.get(e,t,r))}));var we=Date.now;function Se(e){var t,r,n,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=ve.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=ve.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function Ce(){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 ke(e){return e?e.nodeType===e.ELEMENT_NODE?e:ve.parentElement(e):null}function Ee(e,t,r,n){if(!e)return!1;var i=ke(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(Q(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1}function xe(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===V}function Te(e,t){if(C(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var n=ve.parentNode(e);return(!n||n.nodeType!==e.DOCUMENT_NODE)&&(!n||Te(n,t))}function Me(e){return Boolean(e.changedTouches)}function Re(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ae(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ne(e){return!!e&&(e instanceof ie&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ve.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(we=()=>(new Date).getTime());let Fe=class{constructor(){c(this,"id",1),c(this,"styleIDMap",new WeakMap),c(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Oe(e){var t,r=null;return"getRootNode"in e&&(null==(t=ve.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ve.host(ve.getRootNode(e))&&(r=ve.host(ve.getRootNode(e))),r}function Pe(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Oe(r);)r=t;return r}(e);return ve.contains(t,r)}function Le(e){var t=e.ownerDocument;return!!t&&(ve.contains(t,e)||Pe(e))}var De=(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",e))(De||{}),Be=(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",e[e.CustomElement=16]="CustomElement",e))(Be||{}),qe=(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",e))(qe||{}),He=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(He||{}),$e=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))($e||{}),We=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(We||{});function Ve(e){return"__ln"in e}class Ze{constructor(){c(this,"length",0),c(this,"head",null),c(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ve(e.previousSibling)){var r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Ve(e.nextSibling)&&e.nextSibling.__ln.previous){var 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;null===t.next&&(this.tail=t),this.length++}removeNode(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--)}}var Ge,je=(e,t)=>"".concat(e,"@").concat(t);class Ue{constructor(){c(this,"frozen",!1),c(this,"locked",!1),c(this,"texts",[]),c(this,"attributes",[]),c(this,"attributeMap",new WeakMap),c(this,"removes",[]),c(this,"mapRemoves",[]),c(this,"movedMap",{}),c(this,"addedSet",new Set),c(this,"movedSet",new Set),c(this,"droppedSet",new Set),c(this,"mutationCb"),c(this,"blockClass"),c(this,"blockSelector"),c(this,"maskTextClass"),c(this,"maskTextSelector"),c(this,"inlineStylesheet"),c(this,"maskInputOptions"),c(this,"maskTextFn"),c(this,"maskInputFn"),c(this,"keepIframeSrcFn"),c(this,"recordCanvas"),c(this,"inlineImages"),c(this,"slimDOMOptions"),c(this,"dataURLOptions"),c(this,"doc"),c(this,"mirror"),c(this,"iframeManager"),c(this,"stylesheetManager"),c(this,"shadowDomManager"),c(this,"canvasManager"),c(this,"processedNodeManager"),c(this,"unattachedDoc"),c(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),c(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new Ze,n=e=>{for(var t=e,r=V;r===V;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},i=i=>{var o=ve.parentNode(i);if(o&&Le(i)&&"TEXTAREA"!==o.tagName){var s=C(o)?this.mirror.getId(Oe(i)):this.mirror.getId(o),a=n(i);if(-1===s||-1===a)return r.addNode(i);var l=ne(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Re(e,this.mirror)&&this.iframeManager.addIframe(e),Ae(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ne(i)&&this.shadowDomManager.addShadowRoot(ve.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});l&&(e.push({parentId:s,nextId:a,node:l}),t.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)Ye(this.removes,o,this.mirror)&&!this.movedSet.has(ve.parentNode(o))||i(o);for(var s of this.addedSet)Xe(this.droppedSet,s)||Ye(this.removes,s,this.mirror)?Xe(this.movedSet,s)?i(s):this.droppedSet.add(s):i(s);for(var a=null;r.length;){var l=null;if(a){var c=this.mirror.getId(ve.parentNode(a.value)),u=n(a.value);-1!==c&&-1!==u&&(l=a)}if(!l)for(var d=r.tail;d;){var h=d;if(d=d.previous,h){var p=this.mirror.getId(ve.parentNode(h.value));if(-1===n(h.value))continue;if(-1!==p){l=h;break}var v=h.value,g=ve.parentNode(v);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var f=ve.host(g);if(-1!==this.mirror.getId(f)){l=h;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),i(l.value)}var m={texts:this.texts.map((e=>{var t=e.node,r=ve.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{var{attributes:t}=e;if("string"==typeof t.style){var r=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+n).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(m))}})),c(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(ve.childNodes(e),(e=>ve.textContent(e)||"")).join("")})),c(this,"processMutation",(e=>{if(!xe(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=ve.textContent(e.target);Ee(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ee(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,ke(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,n=e.attributeName,i=e.target.getAttribute(n);if("value"===n){var o=N(r);i=M({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(Ee(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;var s=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===n&&!this.keepIframeSrcFn(i)){if(r.contentDocument)return;n="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),"type"===n&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!K(r.tagName,n))if(s.attributes[n]=J(this.doc,R(r.tagName),R(n),i),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(e.oldValue&&a.setAttribute("style",e.oldValue),Array.from(r.style))){var c=r.style.getPropertyValue(l),u=r.style.getPropertyPriority(l);c!==a.style.getPropertyValue(l)||u!==a.style.getPropertyPriority(l)?s.styleDiff[l]=""===u?c:[c,u]:s._unchangedStyles[l]=[c,u]}for(var d of Array.from(a.style))""===r.style.getPropertyValue(d)&&(s.styleDiff[d]=!1)}else"open"===n&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(Ee(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{var r=this.mirror.getId(t),n=C(e.target)?this.mirror.getId(ve.host(e.target)):this.mirror.getId(e.target);Ee(e.target,this.blockClass,this.blockSelector,!1)||xe(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(ze(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Te(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[je(r,n)]?ze(this.movedSet,t):this.removes.push({parentId:n,id:r,isShadow:!(!C(e.target)||!I(e.target))||void 0})),this.mapRemoves.push(t))}))}})),c(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(xe(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);var r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[je(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ee(e,this.blockClass,this.blockSelector,!1)||(ve.childNodes(e).forEach((e=>this.genAdds(e))),Ne(e)&&ve.childNodes(ve.shadowRoot(e)).forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function ze(e,t){e.delete(t),ve.childNodes(t).forEach((t=>ze(e,t)))}function Ye(e,t,r){return 0!==e.length&&function(e,t,r){var n=ve.parentNode(t),i=function(){var t=r.getId(n);if(e.some((e=>e.id===t)))return{v:!0};n=ve.parentNode(n)};for(;n;){var o=i();if("object"==typeof o)return o.v}return!1}(e,t,r)}function Xe(e,t){return 0!==e.size&&Je(e,t)}function Je(e,t){var r=ve.parentNode(t);return!!r&&(!!e.has(r)||Je(e,r))}var Ke=e=>{if(!Ge)return e;return function(){try{return e(...arguments)}catch(e){if(Ge&&!0===Ge(e))return;throw e}}},Qe=[];function et(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 tt(e,t){var r=new Ue;Qe.push(r),r.init(e);var n=new(pe())(Ke(r.processMutations.bind(r)));return n.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),n}function rt(e){var{mouseInteractionCb:r,doc:n,mirror:i,blockClass:o,blockSelector:s,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,c=[],u=null;return Object.keys(qe).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=R(e),l=(e=>n=>{var a=et(n);if(!Ee(a,o,s,!0)){var l=null,c=e;if("pointerType"in n){switch(n.pointerType){case"mouse":l=He.Mouse;break;case"touch":l=He.Touch;break;case"pen":l=He.Pen}l===He.Touch?qe[e]===qe.MouseDown?c="TouchStart":qe[e]===qe.MouseUp&&(c="TouchEnd"):He.Pen}else Me(n)&&(l=He.Touch);null!==l?(u=l,(c.startsWith("Touch")&&l===He.Touch||c.startsWith("Mouse")&&l===He.Mouse)&&(l=null)):qe[e]===qe.Click&&(l=u,u=null);var d=Me(n)?n.changedTouches[0]:n;if(d){var h=i.getId(a),{clientX:p,clientY:v}=d;Ke(r)(t({type:qe[c],id:h,x:p,y:v},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(qe[e]){case qe.MouseDown:case qe.MouseUp:a=a.replace("mouse","pointer");break;case qe.TouchStart:case qe.TouchEnd:return}c.push(ge(a,l,n))})),Ke((()=>{c.forEach((e=>e()))}))}function nt(e){var{scrollCb:t,doc:r,mirror:n,blockClass:i,blockSelector:o,sampling:s}=e;return ge("scroll",Ke(_e(Ke((e=>{var s=et(e);if(s&&!Ee(s,i,o,!0)){var a=n.getId(s);if(s===r&&r.defaultView){var l=Se(r.defaultView);t({id:a,x:l.left,y:l.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})}})),s.scroll||100)),r)}var it=["INPUT","TEXTAREA","SELECT"],ot=new WeakMap;function st(e){return function(e,t){if(ut("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ut("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ut("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ut("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function at(e,t,r){var n,i;return e?(e.ownerNode?n=t.getId(e.ownerNode):i=r.getId(e),{styleId:i,id:n}):{}}function lt(e,t){var r,n,i,{mirror:o,stylesheetManager:s}=e,a=null;a="#document"===t.nodeName?o.getId(t):o.getId(ve.host(t));var l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.ShadowRoot,c=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&l&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var t,r=null==(t=c.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{s.adoptStyleSheets(e,a)}catch(e){}return r}}),Ke((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))):()=>{}}function ct(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.doc.defaultView;if(!i)return()=>{};!function(e,t){var{mutationCb:r,mousemoveCb:n,mouseInteractionCb:i,scrollCb:o,viewportResizeCb:s,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:d,fontCb:h,selectionCb:p,customElementCb:v}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),n(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),i(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),o(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),s(...arguments)},e.inputCb=function(){t.input&&t.input(...arguments),a(...arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction(...arguments),l(...arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule(...arguments),c(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),u(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),d(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),h(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),p(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),v(...arguments)}}(e,n),e.recordDOM&&(r=tt(e,e.doc));var o=function(e){var{mousemoveCb:t,sampling:r,doc:n,mirror:i}=e;if(!1===r.mousemove)return()=>{};var o,s="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],c=_e(Ke((e=>{var r=Date.now()-o;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],o=null})),a),u=Ke(_e(Ke((e=>{var t=et(e),{clientX:r,clientY:n}=Me(e)?e.changedTouches[0]:e;o||(o=we()),l.push({x:r,y:n,id:i.getId(t),timeOffset:we()-o}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?Be.Drag:e instanceof MouseEvent?Be.MouseMove:Be.TouchMove)})),s,{trailing:!1})),d=[ge("mousemove",u,n),ge("touchmove",u,n),ge("drag",u,n)];return Ke((()=>{d.forEach((e=>e()))}))}(e),s=rt(e),a=nt(e),l=function(e,t){var{viewportResizeCb:r}=e,{win:n}=t,i=-1,o=-1;return ge("resize",Ke(_e(Ke((()=>{var e=Ce(),t=Ie();i===e&&o===t||(r({width:Number(t),height:Number(e)}),i=e,o=t)})),200)),n)}(e,{win:i}),c=function(e){var{inputCb:r,doc:n,mirror:i,blockClass:o,blockSelector:s,ignoreClass:a,ignoreSelector:l,maskInputOptions:c,maskInputFn:u,sampling:d,userTriggeredOnInput:h}=e;function p(e){var t=et(e),r=e.isTrusted,i=t&&t.tagName;if(t&&"OPTION"===i&&(t=ve.parentElement(t)),t&&i&&!(it.indexOf(i)<0)&&!Ee(t,o,s,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var d=t.value,p=!1,g=N(t)||"";"radio"===g||"checkbox"===g?p=t.checked:(c[i.toLowerCase()]||c[g])&&(d=M({element:t,maskInputOptions:c,tagName:i,type:g,value:d,maskInputFn:u})),v(t,h?{text:d,isChecked:p,userTriggered:r}:{text:d,isChecked:p});var f=t.name;"radio"===g&&f&&p&&n.querySelectorAll('input[type="radio"][name="'.concat(f,'"]')).forEach((e=>{if(e!==t){var r=e.value;v(e,h?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}}))}}function v(e,n){var o=ot.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){ot.set(e,n);var s=i.getId(e);Ke(r)(t(t({},n),{},{id:s}))}}var g=("last"===d.input?["change"]:["input","change"]).map((e=>ge(e,Ke(p),n))),f=n.defaultView;if(!f)return()=>{g.forEach((e=>e()))};var m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),_=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&g.push(..._.map((e=>ye(e[0],e[1],{set(){Ke(p)({target:this,isTrusted:!1})}},!1,f)))),Ke((()=>{g.forEach((e=>e()))}))}(e),u=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:n,mirror:i,sampling:o,doc:s}=e,a=Ke((e=>_e(Ke((o=>{var s=et(o);if(s&&!Ee(s,r,n,!0)){var{currentTime:a,volume:l,muted:c,playbackRate:u,loop:d}=s;t({type:e,id:i.getId(s),currentTime:a,volume:l,muted:c,playbackRate:u,loop:d})}})),o.media||500))),l=[ge("play",a(We.Play),s),ge("pause",a(We.Pause),s),ge("seeked",a(We.Seeked),s),ge("volumechange",a(We.VolumeChange),s),ge("ratechange",a(We.RateChange),s)];return Ke((()=>{l.forEach((e=>e()))}))}(e),d=()=>{},h=()=>{},p=()=>{},v=()=>{};e.recordDOM&&(d=function(e,t){var{styleSheetRuleCb:r,mirror:n,stylesheetManager:i}=e,{win:o}=t;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Ke(((e,t,o)=>{var[s,a]=o,{id:l,styleId:c}=at(t,n,i.styleMirror);return(l&&-1!==l||c&&-1!==c)&&r({id:l,styleId:c,adds:[{rule:s,index:a}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.addRule=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.cssRules.length,n="".concat(e," { ").concat(t," }");return o.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};var a,l,c=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t,n,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:s}]}),e.apply(t,o)}))}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t,n,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replace:s}),e.apply(t,o)}))})),o.CSSStyleSheet.prototype.replaceSync&&(l=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t,n,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:s}),e.apply(t,o)}))}));var u={};dt("CSSGroupingRule")?u.CSSGroupingRule=o.CSSGroupingRule:(dt("CSSMediaRule")&&(u.CSSMediaRule=o.CSSMediaRule),dt("CSSConditionRule")&&(u.CSSConditionRule=o.CSSConditionRule),dt("CSSSupportsRule")&&(u.CSSSupportsRule=o.CSSSupportsRule));var d={};return Object.entries(u).forEach((e=>{var[t,o]=e;d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Ke(((e,t,o)=>{var[s,a]=o,{id:l,styleId:c}=at(t.parentStyleSheet,n,i.styleMirror);return(l&&-1!==l||c&&-1!==c)&&r({id:l,styleId:c,adds:[{rule:s,index:[...st(t),a||0]}]}),e.apply(t,o)}))}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Ke(((e,t,o)=>{var[s]=o,{id:a,styleId:l}=at(t.parentStyleSheet,n,i.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...st(t),s]}]}),e.apply(t,o)}))})})),Ke((()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=c,a&&(o.CSSStyleSheet.prototype.replace=a),l&&(o.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach((e=>{var[t,r]=e;r.prototype.insertRule=d[t].insertRule,r.prototype.deleteRule=d[t].deleteRule}))}))}(e,{win:i}),h=lt(e,e.doc),p=function(e,t){var{styleDeclarationCb:r,mirror:n,ignoreCSSAttributes:i,stylesheetManager:o}=e,{win:s}=t,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ke(((e,t,s)=>{var l,[c,u,d]=s;if(i.has(c))return a.apply(t,[c,u,d]);var{id:h,styleId:p}=at(null==(l=t.parentRule)?void 0:l.parentStyleSheet,n,o.styleMirror);return(h&&-1!==h||p&&-1!==p)&&r({id:h,styleId:p,set:{property:c,value:u,priority:d},index:st(t.parentRule)}),e.apply(t,s)}))});var l=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ke(((e,t,s)=>{var a,[c]=s;if(i.has(c))return l.apply(t,[c]);var{id:u,styleId:d}=at(null==(a=t.parentRule)?void 0:a.parentStyleSheet,n,o.styleMirror);return(u&&-1!==u||d&&-1!==d)&&r({id:u,styleId:d,remove:{property:c},index:st(t.parentRule)}),e.apply(t,s)}))}),Ke((()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:i}),e.collectFonts&&(v=function(e){var{fontCb:t,doc:r}=e,n=r.defaultView;if(!n)return()=>{};var i=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(e,t,r){var n=new s(e,t,r);return o.set(n,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),n};var a=be(r.fonts,"add",(function(e){return function(r){return setTimeout(Ke((()=>{var e=o.get(r);e&&(t(e),o.delete(r))})),0),e.apply(this,[r])}}));return i.push((()=>{n.FontFace=s})),i.push(a),Ke((()=>{i.forEach((e=>e()))}))}(e)));var g=function(e){var{doc:t,mirror:r,blockClass:n,blockSelector:i,selectionCb:o}=e,s=!0,a=Ke((()=>{var e=t.getSelection();if(!(!e||s&&(null==e?void 0:e.isCollapsed))){s=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,c=0;c<l;c++){var u=e.getRangeAt(c),{startContainer:d,startOffset:h,endContainer:p,endOffset:v}=u;Ee(d,n,i,!0)||Ee(p,n,i,!0)||a.push({start:r.getId(d),startOffset:h,end:r.getId(p),endOffset:v})}o({ranges:a})}}));return a(),ge("selectionchange",a)}(e),f=function(e){var{doc:t,customElementCb:r}=e,n=t.defaultView;if(!n||!n.customElements)return()=>{};var i=be(n.customElements,"define",(function(e){return function(t,n,i){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return e.apply(this,[t,n,i])}}));return i}(e),m=[];for(var _ of e.plugins)m.push(_.observer(_.callback,i,_.options));return Ke((()=>{Qe.forEach((e=>e.reset())),null==r||r.disconnect(),o(),s(),a(),l(),c(),u(),d(),h(),p(),v(),g(),f(),m.forEach((e=>e()))}))}function ut(e){return void 0!==window[e]}function dt(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class ht{constructor(e){c(this,"iframeIdToRemoteIdMap",new WeakMap),c(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,n){var i=r||this.getIdToRemoteIdMap(e),o=n||this.getRemoteIdToIdMap(e),s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s}getIds(e,t){var r=this.getIdToRemoteIdMap(e),n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,n)))}getRemoteId(e,t,r){var n=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var i=n.get(t);return i||-1}getRemoteIds(e,t){var r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,r)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class pt{constructor(e){c(this,"iframes",new WeakMap),c(this,"crossOriginIframeMap",new WeakMap),c(this,"crossOriginIframeMirror",new ht(Z)),c(this,"crossOriginIframeStyleMirror"),c(this,"crossOriginIframeRootIdMap",new WeakMap),c(this,"mirror"),c(this,"mutationCb"),c(this,"wrappedEmit"),c(this,"loadListener"),c(this,"stylesheetManager"),c(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ht(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(n=this.loadListener)||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))}handleMessage(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var r=this.crossOriginIframeMap.get(e.source);if(r){var n=this.transformCrossOriginEvent(r,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case De.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:De.IncrementalSnapshot,data:{source:Be.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case De.Meta:case De.Load:case De.DomContentLoaded:return!1;case De.Plugin:return t;case De.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case De.IncrementalSnapshot:switch(t.data.source){case Be.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);var r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Be.Drag:case Be.TouchMove:case Be.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Be.ViewportResize:return!1;case Be.MediaInteraction:case Be.MouseInteraction:case Be.Scroll:case Be.CanvasMutation:case Be.Input:return this.replaceIds(t.data,e,["id"]),t;case Be.StyleSheetRule:case Be.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Be.Font:return t;case Be.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Be.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach((t=>{this.replaceStyleIds(t,e,["styleId"])})),t}}return!1}replace(e,t,r,n){for(var i of n)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(r,t[i]):t[i]=e.getId(r,t[i]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===h.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class vt{constructor(e){c(this,"shadowDoms",new WeakSet),c(this,"mutationCb"),c(this,"scrollCb"),c(this,"bypassOptions"),c(this,"mirror"),c(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,r){if(I(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var n=tt(t(t({},this.bypassOptions),{},{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(nt(t(t({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(ve.host(e))),this.restoreHandlers.push(lt({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){var r=this;this.restoreHandlers.push(be(e.prototype,"attachShadow",(function(e){return function(n){var i=e.call(this,n),o=ve.shadowRoot(this);return o&&Le(this)&&r.addShadowRoot(o,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ft="undefined"==typeof Uint8Array?[]:new Uint8Array(256),mt=0;mt<64;mt++)ft[gt.charCodeAt(mt)]=mt;var _t=new Map;var yt=(e,t,r)=>{if(e&&(St(e,t)||"object"==typeof e)){var n=function(e,t){var r=_t.get(e);return r||(r=new Map,_t.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),i=n.indexOf(e);return-1===i&&(i=n.length,n.push(e)),i}};function bt(e,t,r){if(e instanceof Array)return e.map((e=>bt(e,t,r)));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)return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),n=r.length,i="";for(t=0;t<n;t+=3)i+=gt[r[t]>>2],i+=gt[(3&r[t])<<4|r[t+1]>>4],i+=gt[(15&r[t+1])<<2|r[t+2]>>6],i+=gt[63&r[t+2]];return n%3==2?i=i.substring(0,i.length-1)+"=":n%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[bt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var n=e.constructor.name,{src:i}=e;return{rr_type:n,src:i}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[bt(e.data,t,r),e.width,e.height]}:St(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:yt(e,t,r)}:e}var wt=(e,t,r)=>e.map((e=>bt(e,t,r))),St=(e,t)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof t[e]));return Boolean(r.find((r=>e instanceof t[r])))};function Ct(e,t,r,n){var i=[];try{var o=be(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!Ee(this,t,r,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=l),n&&["webgl","webgl2"].includes(l))if(s[0]&&"object"==typeof s[0]){var c=s[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...s])}}));i.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach((e=>e()))}}function It(e,t,r,n,i,o){var s=[],a=Object.getOwnPropertyNames(e),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return"continue";try{if("function"!=typeof e[a])return"continue";var l=be(e,a,(function(e){return function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];var u=e.apply(this,l);if(yt(u,o,this),"tagName"in this.canvas&&!Ee(this.canvas,n,i,!0)){var d=wt(l,o,this),h={type:t,property:a,args:d};r(this.canvas,h)}return u}}));s.push(l)}catch(n){var c=ye(e,a,{set(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});s.push(c)}};for(var c of a)l(c);return s}var kt,Et,xt,Tt,Mt="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Rt="undefined"!=typeof window&&window.Blob&&new Blob([(kt=Mt,Uint8Array.from(atob(kt),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function At(e){var t;try{if(!(t=Rt&&(window.URL||window.webkitURL).createObjectURL(Rt)))throw"";var r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(t)})),r}catch(t){return new Worker("data:text/javascript;base64,"+Mt,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Nt{constructor(e){c(this,"pendingCanvasMutations",new Map),c(this,"rafStamps",{latestId:0,invokeId:null}),c(this,"mirror"),c(this,"mutationCb"),c(this,"resetObservers"),c(this,"frozen",!1),c(this,"locked",!1),c(this,"processMutation",((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)}));var{sampling:t="all",win:r,blockClass:n,blockSelector:i,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,n,i),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,n,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,o){var s=this,a=Ct(t,r,i,!0),l=new Map,c=new At;c.onmessage=e=>{var{id:t}=e.data;if(l.set(t,!1),"base64"in e.data){var{base64:r,type:n,width:i,height:o}=e.data;this.mutationCb({id:t,type:$e["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:n}]},0,0]}]})}};var u,d=1e3/e,h=0,p=e=>{var a,v;h&&e-h<d?u=requestAnimationFrame(p):(h=e,(a=[],v=e=>{e.querySelectorAll("canvas").forEach((e=>{Ee(e,r,i,!0)||a.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&v(e.shadowRoot)}))},v(t.document),a).forEach(function(){var e=n((function*(e){var t,r=s.mirror.getId(e);if(!l.get(r)&&0!==e.width&&0!==e.height){if(l.set(r,!0),["webgl","webgl2"].includes(e.__context)){var n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var i=e.clientWidth||e.width,a=e.clientHeight||e.height,u=yield createImageBitmap(e,{resizeWidth:i,resizeHeight:a});c.postMessage({id:r,bitmap:u,width:i,height:a,dataURLOptions:o.dataURLOptions},[u])}}));return function(t){return e.apply(this,arguments)}}()),u=requestAnimationFrame(p))};u=requestAnimationFrame(p),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=Ct(e,t,r,!1),i=function(e,t,r,n){var i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),s=function(o){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return"continue";var s=be(t.CanvasRenderingContext2D.prototype,o,(function(i){return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return Ee(this.canvas,r,n,!0)||setTimeout((()=>{var r=wt(a,t,this);e(this.canvas,{type:$e["2D"],property:o,args:r})}),0),i.apply(this,a)}}));i.push(s)}catch(r){var a=ye(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:$e["2D"],property:o,args:[t],setter:!0})}});i.push(a)}};for(var a of o)s(a);return()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,n){var i=[];return i.push(...It(t.WebGLRenderingContext.prototype,$e.WebGL,e,r,n,t)),void 0!==t.WebGL2RenderingContext&&i.push(...It(t.WebGL2RenderingContext.prototype,$e.WebGL2,e,r,n,t)),()=>{i.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{n(),i(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(e);if(r&&-1!==t){var n=r.map((e=>o(e,a))),{type:i}=r[0];this.mutationCb({id:t,type:i,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class Ft{constructor(e){c(this,"trackedLinkElements",new WeakSet),c(this,"mutationCb"),c(this,"adoptedStyleSheetCb"),c(this,"styleMirror",new Fe),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){var r=this;if(0!==e.length){var n={id:t,styleIds:[]},i=[],o=function(e){var t=void 0;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),i.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:E(t,e.href),index:r})))})),n.styleIds.push(t)};for(var s of e)o(s);i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Ot{constructor(){c(this,"nodeMap",new WeakMap),c(this,"active",!1)}inOtherBuffer(e,t){var r=this.nodeMap.get(e);return r&&Array.from(r).some((e=>e!==t))}add(e,t){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}var Pt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Lt=document.createElement("iframe");document.body.appendChild(Lt),Array.from=(null==(s=Lt.contentWindow)?void 0:s.Array.from)||Array.from,document.body.removeChild(Lt)}}catch(e){console.debug("Unable to override Array.from",e)}var Dt,Bt,qt=new T;function Ht(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{emit:r,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:c="rr-mask",maskTextSelector:u=null,inlineStylesheet:d=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:v,maskInputFn:g,maskTextFn:f,hooks:m,packFn:_,sampling:y={},dataURLOptions:b={},mousemoveWait:w,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:x=!1,inlineImages:M=!1,plugins:R,keepIframeSrcFn:A=(()=>!1),ignoreCSSAttributes:N=new Set([]),errorHandler:F}=e;Ge=F;var O=!I||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(e){P=!0}if(O&&!r)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),qt.reset();var L,D=!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},B=!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===v,headMetaDescKeywords:"all"===v,headTitleMutations:"all"===v}:v||{};!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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)}();var q=0,H=e=>{for(var t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!P&&(e=_(e)),e};Et=(e,t)=>{var o,s=e;if(s.timestamp=we(),!(null==(o=Qe[0])?void 0:o.isFrozen())||s.type===De.FullSnapshot||s.type===De.IncrementalSnapshot&&s.data.source===Be.Mutation||Qe.forEach((e=>e.unfreeze())),O)null==r||r(H(s),t);else if(P){var a={type:"rrweb",event:H(s),origin:window.location.origin,isCheckout:t};window.parent.postMessage(a,"*")}if(s.type===De.FullSnapshot)L=s,q=0;else if(s.type===De.IncrementalSnapshot){if(s.data.source===Be.Mutation&&s.data.isAttachIframe)return;q++;var l=i&&q>=i,c=n&&s.timestamp-L.timestamp>n;(l||c)&&xt(!0)}};var $=e=>{Et({type:De.IncrementalSnapshot,data:t({source:Be.Mutation},e)})},W=e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.Scroll},e)}),V=e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.CanvasMutation},e)}),Z=new Ft({mutationCb:$,adoptedStyleSheetCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.AdoptedStyleSheet},e)})}),G=new pt({mirror:qt,mutationCb:$,stylesheetManager:Z,recordCrossOriginIframes:I,wrappedEmit:Et});for(var j of R||[])j.getMirror&&j.getMirror({nodeMirror:qt,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var U=new Ot;Tt=new Nt({recordCanvas:C,mutationCb:V,win:window,blockClass:o,blockSelector:s,mirror:qt,sampling:y.canvas,dataURLOptions:b});var z=new vt({mutationCb:$,scrollCb:W,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:u,inlineStylesheet:d,maskInputOptions:D,dataURLOptions:b,maskTextFn:f,maskInputFn:g,recordCanvas:C,inlineImages:M,sampling:y,slimDOMOptions:B,iframeManager:G,stylesheetManager:Z,canvasManager:Tt,keepIframeSrcFn:A,processedNodeManager:U},mirror:qt});xt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(S){Et({type:De.Meta,data:{href:window.location.href,width:Ie(),height:Ce()}},e),Z.reset(),z.init(),Qe.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new T,blockClass:n="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:h,slimDOM:p=!1,dataURLOptions:v,preserveWhiteSpace:g,onSerialize:f,onIframeLoad:m,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w=(()=>!1)}=t||{};return ne(e,{doc:e,mirror:r,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===u?{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===u?{password:!0}:u,maskTextFn:d,maskInputFn:h,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:v,inlineImages:l,recordCanvas:c,preserveWhiteSpace:g,onSerialize:f,onIframeLoad:m,iframeLoadTimeout:_,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:w,newlyAddedElement:!1})}(document,{mirror:qt,blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:u,inlineStylesheet:d,maskAllInputs:D,maskTextFn:f,maskInputFn:g,slimDOM:B,dataURLOptions:b,recordCanvas:C,inlineImages:M,onSerialize:e=>{Re(e,qt)&&G.addIframe(e),Ae(e,qt)&&Z.trackLinkElement(e),Ne(e)&&z.addShadowRoot(ve.shadowRoot(e),document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{Z.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");Et({type:De.FullSnapshot,data:{node:t,initialOffset:Se(window)}},e),Qe.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Z.adoptStyleSheets(document.adoptedStyleSheets,qt.getId(document))}};try{var Y=[],X=e=>{var r;return Ke(ct)({mutationCb:$,mousemoveCb:(e,t)=>Et({type:De.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.MouseInteraction},e)}),scrollCb:W,viewportResizeCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.ViewportResize},e)}),inputCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.Input},e)}),mediaInteractionCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.MediaInteraction},e)}),styleSheetRuleCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.StyleSheetRule},e)}),styleDeclarationCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.StyleDeclaration},e)}),canvasMutationCb:V,fontCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.Font},e)}),selectionCb:e=>{Et({type:De.IncrementalSnapshot,data:t({source:Be.Selection},e)})},customElementCb:e=>{Et({type:De.IncrementalSnapshot,data:t({source:Be.CustomElement},e)})},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:c,maskTextSelector:u,maskInputOptions:D,inlineStylesheet:d,sampling:y,recordDOM:S,recordCanvas:C,inlineImages:M,userTriggeredOnInput:E,collectFonts:x,doc:e,maskInputFn:g,maskTextFn:f,keepIframeSrcFn:A,blockSelector:s,slimDOMOptions:B,dataURLOptions:b,mirror:qt,iframeManager:G,stylesheetManager:Z,shadowDomManager:z,processedNodeManager:U,canvasManager:Tt,ignoreCSSAttributes:N,plugins:(null==(r=null==R?void 0:R.filter((e=>e.observer)))?void 0:r.map((e=>({observer:e.observer,options:e.options,callback:t=>Et({type:De.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};G.addLoadListener((e=>{try{Y.push(X(e.contentDocument))}catch(e){console.warn(e)}}));var J=()=>{xt(),Y.push(X(document)),Pt=!0};return"interactive"===document.readyState||"complete"===document.readyState?J():(Y.push(ge("DOMContentLoaded",(()=>{Et({type:De.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&J()}))),Y.push(ge("load",(()=>{Et({type:De.Load,data:{}}),"load"===k&&J()}),window))),()=>{Y.forEach((e=>e())),U.destroy(),Pt=!1,Ge=void 0}}catch(e){console.warn(e)}}Ht.addCustomEvent=(e,t)=>{if(!Pt)throw new Error("please add custom event after start recording");Et({type:De.Custom,data:{tag:e,payload:t}})},Ht.freezePage=()=>{Qe.forEach((e=>e.freeze()))},Ht.takeFullSnapshot=e=>{if(!Pt)throw new Error("please take full snapshot after start recording");xt(e)},Ht.mirror=qt,(Bt=Dt||(Dt={}))[Bt.NotStarted=0]="NotStarted",Bt[Bt.Running=1]="Running",Bt[Bt.Stopped=2]="Stopped";var $t,Wt=Object.defineProperty,Vt=(e,t,r)=>((e,t,r)=>t in e?Wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Zt=Object.defineProperty,Gt=(e,t,r)=>((e,t,r)=>t in e?Zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),jt=Object.defineProperty,Ut=(e,t,r)=>((e,t,r)=>t in e?jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),zt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Yt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Xt={};function Jt(e){if(Xt[e])return Xt[e];var t=globalThis[e],r=t.prototype,n=e in zt?zt[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in Yt?Yt[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return Xt[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?Xt[e]=c:r}catch(e){return r}}var Kt={};function Qt(e,t,r){var n,i="".concat(e,".").concat(String(r));if(Kt[i])return Kt[i].call(t);var o=Jt(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(Kt[i]=s,s.call(t)):t[r]}var er={};function tr(e,t,r){var n="".concat(e,".").concat(String(r));if(er[n])return er[n].bind(t);var i=Jt(e)[r];return"function"!=typeof i?t[r]:(er[n]=i,i.bind(t))}var rr={childNodes:function(e){return Qt("Node",e,"childNodes")},parentNode:function(e){return Qt("Node",e,"parentNode")},parentElement:function(e){return Qt("Node",e,"parentElement")},textContent:function(e){return Qt("Node",e,"textContent")},contains:function(e,t){return tr("Node",e,"contains")(t)},getRootNode:function(e){return tr("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Qt("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Qt("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Qt("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Qt("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Jt("MutationObserver").constructor}};class nr{constructor(){Ut(this,"idNodeMap",new Map),Ut(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;var r=null==(t=this.getMeta(e))?void 0:t.id;return null!=r?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var n=this.nodeMetaMap.get(r);n&&this.nodeMetaMap.set(t,n)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ir(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ir(rr.parentNode(e),t,r);for(var n=e.classList.length;n--;){var i=e.classList[n];if(t.test(i))return!0}return!!r&&ir(rr.parentNode(e),t,r)}class or{constructor(){__publicField22(this,"parentElement",null),__publicField22(this,"parentNode",null),__publicField22(this,"ownerDocument"),__publicField22(this,"firstChild",null),__publicField22(this,"lastChild",null),__publicField22(this,"previousSibling",null),__publicField22(this,"nextSibling",null),__publicField22(this,"ELEMENT_NODE",1),__publicField22(this,"TEXT_NODE",3),__publicField22(this,"nodeType"),__publicField22(this,"nodeName"),__publicField22(this,"RRNodeType")}get childNodes(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof or))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var sr={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ar={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},lr={};function cr(e){if(lr[e])return lr[e];var t=globalThis[e],r=t.prototype,n=e in sr?sr[e]:void 0,i=Boolean(n&&n.every((e=>{var t,n;return Boolean(null==(n=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:n.toString().includes("[native code]"))}))),o=e in ar?ar[e]:void 0,s=Boolean(o&&o.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(i&&s)return lr[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(a),c?lr[e]=c:r}catch(e){return r}}var ur={};function dr(e,t,r){var n,i="".concat(e,".").concat(String(r));if(ur[i])return ur[i].call(t);var o=cr(e),s=null==(n=Object.getOwnPropertyDescriptor(o,r))?void 0:n.get;return s?(ur[i]=s,s.call(t)):t[r]}var hr={};function pr(e,t,r){var n="".concat(e,".").concat(String(r));if(hr[n])return hr[n].bind(t);var i=cr(e)[r];return"function"!=typeof i?t[r]:(hr[n]=i,i.bind(t))}var vr={childNodes:function(e){return dr("Node",e,"childNodes")},parentNode:function(e){return dr("Node",e,"parentNode")},parentElement:function(e){return dr("Node",e,"parentElement")},textContent:function(e){return dr("Node",e,"textContent")},contains:function(e,t){return pr("Node",e,"contains")(t)},getRootNode:function(e){return pr("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?dr("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?dr("Element",e,"shadowRoot"):null},querySelector:function(e,t){return dr("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return dr("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return cr("MutationObserver").constructor}};var gr="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.",fr={map:{},getId:()=>(console.error(gr),-1),getNode:()=>(console.error(gr),null),removeNodeFromMap(){console.error(gr)},has:()=>(console.error(gr),!1),reset(){console.error(gr)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(fr=new Proxy(fr,{get:(e,t,r)=>("map"===t&&console.error(gr),Reflect.get(e,t,r))}));var mr=Date.now;function _r(e){return e?e.nodeType===e.ELEMENT_NODE?e:vr.parentElement(e):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(mr=()=>(new Date).getTime());function yr(e){var t,r=null;return"getRootNode"in e&&(null==(t=vr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vr.host(vr.getRootNode(e))&&(r=vr.host(vr.getRootNode(e))),r}function br(e){for(var t,r=e;t=yr(r);)r=t;return r}function wr(e){var t=e.ownerDocument;if(!t)return!1;var r=br(e);return vr.contains(t,r)}for(var Sr=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){Gt(this,"id",1),Gt(this,"styleIDMap",new WeakMap),Gt(this,"idStyleMap",new Map)}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){return this.has(e)?this.getId(e):(r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r);var r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return fr},closestElementOfNode:_r,getBaseDimension:function e(t,r){var n,i,o=null==(i=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:i.frameElement;if(!o||o===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var s=o.getBoundingClientRect(),a=e(o,r),l=s.height/o.clientHeight;return{x:s.x*a.relativeScale+a.x,y:s.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){var n=t[r[0]];return 1===r.length?n:e(n.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex:function(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:br,getShadowHost:yr,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,r,n,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=vr.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(n=vr.parentElement(o.body))?void 0:n.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof or&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(vr.shadowRoot(e)))},hookSetter:function e(t,r,n,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,s=o.Object.getOwnPropertyDescriptor(t,r);return o.Object.defineProperty(t,r,i?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>e(t,r,s||{},!0)},inDom:function(e){var t=e.ownerDocument;return!!t&&(vr.contains(t,e)||wr(e))},isAncestorRemoved:function e(t,r){if(i=(n=t)&&"host"in n&&"mode"in n&&rr.host(n)||null,Boolean(i&&"shadowRoot"in i&&rr.shadowRoot(i)===n))return!1;var n,i,o=r.getId(t);if(!r.has(o))return!0;var s=vr.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r))},isBlocked:function(e,t,r,n){if(!e)return!1;var i=_r(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(n&&null!==i.closest("."+t))return!0}else if(ir(i,t,n))return!0}catch(e){}if(r){if(i.matches(r))return!0;if(n&&null!==i.closest(r))return!0}return!1},isIgnored:function(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,r){r(t.value);for(var n=t.children.length-1;n>=0;n--)e(t.children[n],r)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return mr},on:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)},patch:function(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}},polyfill:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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)},queueToResolveTrees:function(e){var t={},r=(e,r)=>{var n={value:e,parent:r,children:[]};return t[e.node.id]=n,n},n=[];for(var i of e){var{nextId:o,parentId:s}=i;if(o&&o in t){var a=t[o];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,r(i,a.parent))}else{var c=n.indexOf(a);n.splice(c,0,r(i,null))}}else if(s in t){var u=t[s];u.children.push(r(i,u))}else n.push(r(i,null))}return n},shadowHostInDom:wr,throttle:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=null,i=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var l=Date.now();i||!1!==r.leading||(i=l);var c=t-(l-i),u=this;c<=0||c>t?(n&&(clearTimeout(n),n=null),i=l,e.apply(u,s)):n||!1===r.trailing||(n=setTimeout((()=>{i=!1===r.leading?0:Date.now(),n=null,e.apply(u,s)}),c))}},uniqueTextMutations:function(e){for(var t=new Set,r=[],n=e.length;n--;){var i=e[n];t.has(i.id)||(r.push(i),t.add(i.id))}return r}},Symbol.toStringTag,{value:"Module"})),Cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ir="undefined"==typeof Uint8Array?[]:new Uint8Array(256),kr=0;kr<64;kr++)Ir[Cr.charCodeAt(kr)]=kr;var Er;"undefined"!=typeof window&&window.Blob&&new Blob([(e=>Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var xr=document.createElement("iframe");document.body.appendChild(xr),Array.from=(null==($t=xr.contentWindow)?void 0:$t.Array.from)||Array.from,document.body.removeChild(xr)}}catch(e){console.debug("Unable to override Array.from",e)}new nr,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Er||(Er={}));class Tr{constructor(e){Vt(this,"fileName"),Vt(this,"functionName"),Vt(this,"lineNumber"),Vt(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){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)}}var Mr=/(^|@)\S+:\d+/,Rr=/^\s*at .*(\S+:\d+|\(native\))/m,Ar=/^(eval@)?(\[native code])?$/,Nr={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Rr)?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(Rr)}),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,"("),r=t.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(r?r[1]:n.pop()),o=n.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new Tr({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Ar)}),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 Tr({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,i=this.extractLocation(e.replace(t,""));return new Tr({functionName:n,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,r=e.message.split("\n"),n=[],i=2,o=r.length;i<o;i+=2){var s=t.exec(r[i]);s&&n.push(new Tr({fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],i=0,o=r.length;i<o;i+=2){var s=t.exec(r[i]);s&&n.push(new Tr({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return n},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Mr)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),n=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Tr({functionName:n,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function Fr(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var n=e.parentElement,i=[];if(n.children&&n.children.length>0)for(var o=0;o<n.children.length;o++){var s=n.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===r&&i.push(s)}i.length>1&&(r+=":eq(".concat(i.indexOf(e),")")),t=r+(t?">"+t:""),e=n}return t}function Or(e){return"[object Object]"===Object.prototype.toString.call(e)}function Pr(e,t){if(0===t)return!0;var r=Object.keys(e);for(var n of r)if(Or(e[n])&&Pr(e[n],t-1))return!0;return!1}function Lr(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var n=[],i=[];return JSON.stringify(e,(function(e,t){if(n.length>0){var o=n.indexOf(this);~o?n.splice(o+1):n.push(this),~o?i.splice(o,1/0,e):i.push(e),~n.indexOf(t)&&(t=n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]")}else n.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Or(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Or(e)&&Pr(e,r.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t="".concat(t.slice(0,r.stringLengthLimit),"..."));return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var s={};for(var a in t){var l=t[a];Array.isArray(l)?s[a]=Fr(l.length?l[0]:null):s[a]=l}return s}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 Dr={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 Br(e,t,r){var n,i=r?Object.assign({},Dr,r):Dr,o=i.logger;if(!o)return()=>{};n="string"==typeof o?t[o]:o;var s=0,a=!1,l=[];if(i.level.includes("error")){var c=t=>{var r=t.message,n=t.error,o=Nr.parse(n).map((e=>e.toString())),s=[Lr(r,i.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",c),l.push((()=>{t.removeEventListener("error",c)}));var u=t=>{var r,n;t.reason instanceof Error?(r=t.reason,n=[Lr("Uncaught (in promise) ".concat(r.name,": ").concat(r.message),i.stringifyOptions)]):(r=new Error,n=[Lr("Uncaught (in promise)",i.stringifyOptions),Lr(t.reason,i.stringifyOptions)]);var o=Nr.parse(r).map((e=>e.toString()));e({level:"error",trace:o,payload:n})};t.addEventListener("unhandledrejection",u),l.push((()=>{t.removeEventListener("unhandledrejection",u)}))}for(var d of i.level)l.push(h(n,d));return()=>{l.forEach((e=>e()))};function h(t,r){var n=this;return t[r]?Sr.patch(t,r,(t=>function(){for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];if(t.apply(n,l),!("assert"===r&&l[0]||a)){a=!0;try{var u=Nr.parse(new Error).map((e=>e.toString())).splice(1),d=("assert"===r?l.slice(1):l).map((e=>Lr(e,i.stringifyOptions)));++s<i.lengthThreshold?e({level:r,trace:u,payload:d}):s===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Lr("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}var qr,Hr=e=>({name:"rrweb/console@1",observer:Br,options:e}),$r="undefined"!=typeof window?window:void 0,Wr="undefined"!=typeof globalThis?globalThis:$r,Vr=Array.prototype,Zr=Vr.forEach,Gr=Vr.indexOf,jr=null==Wr?void 0:Wr.navigator,Ur=null==Wr?void 0:Wr.document,zr=null==Wr?void 0:Wr.location,Yr=null==Wr?void 0:Wr.fetch,Xr=null!=Wr&&Wr.XMLHttpRequest&&"withCredentials"in new Wr.XMLHttpRequest?Wr.XMLHttpRequest:void 0,Jr=null==Wr?void 0:Wr.AbortController,Kr=null==jr?void 0:jr.userAgent,Qr=null!=$r?$r:{},en="$copy_autocapture",tn=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(qr||(qr={}));var rn=["fatal","error","warning","log","info","debug"],nn={DEBUG:!1,LIB_VERSION:"1.217.2"},on=e=>{var t={_log:function(t){if($r&&(nn.DEBUG||Qr.POSTHOG_DEBUG)&&!Ln($r.console)&&$r.console){for(var r=("__rrweb_original__"in $r.console[t]?$r.console[t].__rrweb_original__:$r.console[t]),n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r(e,...i)}},info:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t._log("log",...r)},warn:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t._log("warn",...r)},error:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t._log("error",...r)},critical:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning:e=>{t.error("You must initialize PostHog before calling ".concat(e))},createLogger:t=>on("".concat(e," ").concat(t))};return t},sn=on("[PostHog.js]"),an=sn.createLogger,ln={};function cn(e,t,r){if(Rn(e))if(Zr&&e.forEach===Zr)e.forEach(t,r);else if("length"in e&&e.length===+e.length)for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n)===ln)return}function un(e,t,r){if(!Hn(e)){if(Rn(e))return cn(e,t,r);if(Zn(e)){for(var n of e.entries())if(t.call(r,n[1],n[0])===ln)return}else for(var i in e)if(Tn.call(e,i)&&t.call(r,e[i],i)===ln)return}}var dn=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return cn(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e},hn=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return cn(r,(function(t){cn(t,(function(t){e.push(t)}))})),e};function pn(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n}var vn=function(e){try{return e()}catch(e){return}},gn=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.apply(this,r)}catch(e){sn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),sn.critical(e)}}},fn=function(e){var t={};return un(e,(function(e,r){Dn(e)&&e.length>0&&(t[r]=e)})),t};function mn(e,t){return r=e,n=e=>Dn(e)&&!qn(t)?e.slice(0,t):e,i=new Set,function e(t,r){return t!==Object(t)?n?n(t,r):t:i.has(t)?void 0:(i.add(t),Rn(t)?(o=[],cn(t,(t=>{o.push(e(t))}))):(o={},un(t,((t,r)=>{i.has(t)||(o[r]=e(t,r))}))),o);var o}(r);var r,n,i}var _n=["herokuapp.com","vercel.app","netlify.app"];function yn(e){var t=null==e?void 0:e.hostname;if(!Dn(t))return!1;var r=t.split(".").slice(-2).join(".");for(var n of _n)if(r===n)return!1;return!0}function bn(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}function wn(e,t,r,n){var{capture:i=!1,passive:o=!0}=null!=n?n:{};null==e||e.addEventListener(t,r,{capture:i,passive:o})}function Sn(e,t){return-1!==e.indexOf(t)}var Cn=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},In=function(e){return e.replace(/^\$/,"")};var kn=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},En=Array.isArray,xn=Object.prototype,Tn=xn.hasOwnProperty,Mn=xn.toString,Rn=En||function(e){return"[object Array]"===Mn.call(e)},An=e=>"function"==typeof e,Nn=e=>An(e)&&-1!==e.toString().indexOf("[native code]"),Fn=()=>!!$r.Zone,On=e=>e===Object(e)&&!Rn(e),Pn=e=>{if(On(e)){for(var t in e)if(Tn.call(e,t))return!1;return!0}return!1},Ln=e=>void 0===e,Dn=e=>"[object String]"==Mn.call(e),Bn=e=>Dn(e)&&0===e.trim().length,qn=e=>null===e,Hn=e=>Ln(e)||qn(e),$n=e=>"[object Number]"==Mn.call(e),Wn=e=>"[object Boolean]"===Mn.call(e),Vn=e=>e instanceof Document,Zn=e=>e instanceof FormData,Gn=e=>e instanceof Error,jn=e=>Sn(tn,e),Un=["localhost","127.0.0.1"],zn=e=>{var t=null==Ur?void 0:Ur.createElement("a");return Ln(t)?null:(t.href=e,t)},Yn=function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return un(e,(function(e,n){Ln(e)||Ln(n)||"undefined"===n||(t=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),r=encodeURIComponent(n),i[i.length]=r+"="+t)})),i.join(n)},Xn=function(e,t){for(var r,n=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<n.length;i++){var o=n[i].split("=");if(o[0]===t){r=o;break}}if(!Rn(r)||r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(e){sn.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Jn=function(e,t,r){if(!e||!t||!t.length)return e;for(var n=e.split("#"),i=n[0]||"",o=n[1],s=i.split("?"),a=s[1],l=s[0],c=(a||"").split("&"),u=[],d=0;d<c.length;d++){var h=c[d].split("=");Rn(h)&&(t.includes(h[0])?u.push(h[0]+"="+r):u.push(c[d]))}var p=l;return null!=a&&(p+="?"+u.join("&")),null!=o&&(p+="#"+o),p},Kn=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null},Qn="$people_distinct_id",ei="__alias",ti="__timers",ri="$autocapture_disabled_server_side",ni="$heatmaps_enabled_server_side",ii="$exception_capture_enabled_server_side",oi="$web_vitals_enabled_server_side",si="$dead_clicks_enabled_server_side",ai="$web_vitals_allowed_metrics",li="$session_recording_enabled_server_side",ci="$console_log_recording_enabled_server_side",ui="$session_recording_network_payload_capture",di="$session_recording_canvas_recording",hi="$replay_sample_rate",pi="$replay_minimum_duration",vi="$replay_script_config",gi="$sesid",fi="$session_is_sampled",mi="$session_recording_url_trigger_activated_session",_i="$session_recording_event_trigger_activated_session",yi="$enabled_feature_flags",bi="$early_access_features",wi="$stored_person_properties",Si="$stored_group_properties",Ci="$surveys",Ii="$surveys_activated",ki="$flag_call_reported",Ei="$user_state",xi="$client_session_props",Ti="$capture_rate_limit",Mi="$initial_campaign_params",Ri="$initial_referrer_info",Ai="$initial_person_info",Ni="$epp",Fi="__POSTHOG_TOOLBAR__",Oi="$posthog_cookieless",Pi=[Qn,ei,"__cmpns",ti,li,ni,gi,yi,Ei,bi,Si,wi,Ci,ki,xi,Ti,Mi,Ri,Ni];function Li(e){var t;return e instanceof Element&&(e.id===Fi||!(null===(t=e.closest)||void 0===t||!t.call(e,".toolbar-global-fade-container")))}function Di(e){return!!e&&1===e.nodeType}function Bi(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function qi(e){return!!e&&3===e.nodeType}function Hi(e){return!!e&&11===e.nodeType}function $i(e){return e?Cn(e).split(/\s+/):[]}function Wi(e){var t=null==$r?void 0:$r.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function Vi(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return $i(t)}function Zi(e){return Hn(e)?null:Cn(e).split(/(\s+)/).filter((e=>io(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Gi(e){var t="";return Xi(e)&&!Ji(e)&&e.childNodes&&e.childNodes.length&&un(e.childNodes,(function(e){var r;qi(e)&&e.textContent&&(t+=null!==(r=Zi(e.textContent))&&void 0!==r?r:"")})),Cn(t)}function ji(e){return Ln(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Ui=["a","button","form","input","select","textarea","label"];function zi(e){var t=e.parentNode;return!(!t||!Di(t))&&t}function Yi(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!$r||!e||Bi(e,"html")||!Di(e))return!1;if(null!=r&&r.url_allowlist&&!Wi(r.url_allowlist))return!1;if(null!=r&&r.url_ignorelist&&Wi(r.url_ignorelist))return!1;if(null!=r&&r.dom_event_allowlist){var o=r.dom_event_allowlist;if(o&&!o.some((e=>t.type===e)))return!1}for(var s=!1,a=[e],l=!0,c=e;c.parentNode&&!Bi(c,"body");)if(Hi(c.parentNode))a.push(c.parentNode.host),c=c.parentNode.host;else{if(!(l=zi(c)))break;if(n||Ui.indexOf(l.tagName.toLowerCase())>-1)s=!0;else{var u=$r.getComputedStyle(l);u&&"pointer"===u.getPropertyValue("cursor")&&(s=!0)}a.push(l),c=l}if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(Ln(r))return!0;var n=function(e){if(r.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var i of e){var o=n(i);if("object"==typeof o)return o.v}return!1}(a,r))return!1;if(!function(e,t){var r=null==t?void 0:t.css_selector_allowlist;if(Ln(r))return!0;var n=function(e){if(r.some((t=>e.matches(t))))return{v:!0}};for(var i of e){var o=n(i);if("object"==typeof o)return o.v}return!1}(a,r))return!1;var d=$r.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){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 s?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(Ui.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}function Xi(e){for(var t=e;t.parentNode&&!Bi(t,"body");t=t.parentNode){var r=Vi(t);if(Sn(r,"ph-sensitive")||Sn(r,"ph-no-capture"))return!1}if(Sn(Vi(e),"ph-include"))return!0;var n=e.type||"";if(Dn(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(Dn(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 Ji(e){return!!(Bi(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Bi(e,"select")||Bi(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Ki="(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})",Qi=new RegExp("^(?:".concat(Ki,")$")),eo=new RegExp(Ki),to="\\d{3}-?\\d{2}-?\\d{4}",ro=new RegExp("^(".concat(to,")$")),no=new RegExp("(".concat(to,")"));function io(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Hn(e))return!1;if(Dn(e)){if(e=Cn(e),(t?Qi:eo).test((e||"").replace(/[- ]/g,"")))return!1;if((t?ro:no).test(e))return!1}return!0}function oo(e){var t=Gi(e);return io(t="".concat(t," ").concat(so(e)).trim())?t:""}function so(e){var t="";return e&&e.childNodes&&e.childNodes.length&&un(e.childNodes,(function(e){var r;if(e&&"span"===(null===(r=e.tagName)||void 0===r?void 0:r.toLowerCase()))try{var n=Gi(e);t="".concat(t," ").concat(n).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(so(e)).trim())}catch(e){sn.error("[AutoCapture]",e)}})),t}function ao(e){return function(e){var r=e.map((e=>{var r,n,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class)for(var o of(e.attr_class.sort(),e.attr_class))i+=".".concat(o.replace(/"/g,""));var s=t(t(t(t({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(r=e.nth_child)&&void 0!==r?r: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),a={};return pn(s).sort(((e,t)=>{var[r]=e,[n]=t;return r.localeCompare(n)})).forEach((e=>{var[t,r]=e;return a[lo(t.toString())]=lo(r.toString())})),i+=":",i+=pn(s).map((e=>{var[t,r]=e;return"".concat(t,'="').concat(r,'"')})).join("")}));return r.join(";")}(function(e){return e.map((e=>{var t,r,n={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(r=e.attr__href)||void 0===r?void 0:r.slice(0,2048),attr_class:co(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return pn(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return n.attributes[t]=r})),n}))}(e))}function lo(e){return e.replace(/"|\\"/g,'\\"')}function co(e){var t=e.attr__class;return t?Rn(t)?t:$i(t):void 0}var uo="[SessionRecording]",ho="redacted",po={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com"]},vo=["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"],go=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],fo=["/s/","/e/","/i/"];function mo(e,t,r,n){if(Hn(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return Dn(i)&&(i=parseInt(i)),i>r?uo+" ".concat(n," body too large to record (").concat(i," bytes)"):e}function _o(e,t){if(Hn(e))return e;var r=e;return io(r,!1)||(r=uo+" "+t+" body "+ho),un(go,(e=>{var n,i;null!==(n=r)&&void 0!==n&&n.length&&-1!==(null===(i=r)||void 0===i?void 0:i.indexOf(e))&&(r=uo+" "+t+" body "+ho+" as might contain: "+e)})),r}var yo=(e,r)=>{var n,i,o,s={payloadSizeLimitBytes:po.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...po.performanceEntryTypeToObserve],payloadHostDenyList:[...r.payloadHostDenyList||[],...po.payloadHostDenyList]},a=!1!==e.session_recording.recordHeaders&&r.recordHeaders,l=!1!==e.session_recording.recordBody&&r.recordBody,c=!1!==e.capture_performance&&r.recordPerformance,u=(n=s,o=Math.min(1e6,null!==(i=n.payloadSizeLimitBytes)&&void 0!==i?i:1e6),e=>(null!=e&&e.requestBody&&(e.requestBody=mo(e.requestBody,e.requestHeaders,o,"Request")),null!=e&&e.responseBody&&(e.responseBody=mo(e.responseBody,e.responseHeaders,o,"Response")),e)),d=t=>{return u(((e,t)=>{var r,n=zn(e.name),i=0===t.indexOf("http")?null===(r=zn(t))||void 0===r?void 0:r.pathname:t;"/"===i&&(i="");var o=null==n?void 0:n.pathname.replace(i||"","");if(!(n&&o&&fo.some((e=>0===o.indexOf(e)))))return e})((n=(r=t).requestHeaders,Hn(n)||un(Object.keys(null!=n?n:{}),(e=>{vo.includes(e.toLowerCase())&&(n[e]=ho)})),r),e.api_host));var r,n},h=An(e.session_recording.maskNetworkRequestFn);return h&&An(e.session_recording.maskCapturedNetworkRequestFn)&&sn.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(e.session_recording.maskCapturedNetworkRequestFn=r=>{var n=e.session_recording.maskNetworkRequestFn({url:r.name});return t(t({},r),{},{name:null==n?void 0:n.url})}),s.maskRequestFn=An(e.session_recording.maskCapturedNetworkRequestFn)?t=>{var r,n,i,o=d(t);return o&&null!==(r=null===(n=(i=e.session_recording).maskCapturedNetworkRequestFn)||void 0===n?void 0:n.call(i,o))&&void 0!==r?r:void 0}:e=>function(e){if(!Ln(e))return e.requestBody=_o(e.requestBody,"Request"),e.responseBody=_o(e.responseBody,"Response"),e}(d(e)),t(t(t({},po),s),{},{recordHeaders:a,recordBody:l,recordPerformance:c,recordInitialRequests:c})};function bo(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return An(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}function wo(e,t){var r,n=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:n,isHostDenied:!1};if(null===(r=t.payloadHostDenyList)||void 0===r||!r.length||null==n||!n.trim().length)return i;for(var o of t.payloadHostDenyList)if(n.endsWith(o))return{hostname:n,isHostDenied:!0};return i}var So=an("[Recorder]"),Co=e=>"navigation"===e.entryType,Io=e=>"resource"===e.entryType;function ko(e,t,r){if(r.recordInitialRequests){var n=t.performance.getEntries().filter((e=>Co(e)||Io(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:n.flatMap((e=>No({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var i=new t.PerformanceObserver((t=>{var n=t.getEntries().filter((e=>Co(e)||Io(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:n.flatMap((e=>No({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),o=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return i.observe({entryTypes:o}),()=>{i.disconnect()}}function Eo(e,t){return!!t&&(Wn(t)||t[e])}function xo(e){var{type:t,recordBody:r,headers:n}=e;function i(e){var t=Object.keys(n).find((e=>"content-type"===e.toLowerCase())),r=t&&n[t];return e.some((e=>null==r?void 0:r.includes(e)))}if(!r)return!1;if(Wn(r))return!0;if(Rn(r))return i(r);var o=r[t];return Wn(o)?o:i(o)}function To(e,t,r,n,i){return Mo.apply(this,arguments)}function Mo(){return Mo=n((function*(e,t,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(o>10)return So.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var s=function(e,t){for(var r=e.length-1;r>=0;r-=1)if(t(e[r]))return e[r]}(e.performance.getEntriesByName(r),(e=>Io(e)&&e.initiatorType===t&&(Ln(n)||e.startTime>=n)&&(Ln(i)||e.startTime<=i)));return s||(yield new Promise((e=>setTimeout(e,50*o))),To(e,t,r,n,i,o+1))})),Mo.apply(this,arguments)}function Ro(e){var{body:t,options:r,url:n}=e;if(Hn(t))return null;var{hostname:i,isHostDenied:o}=wo(n,r);if(o)return i+" is in deny list";if(Dn(t))return t;if(Vn(t))return t.textContent;if(Zn(t))return Yn(t);if(On(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var Ao=e=>!qn(e)&&("navigation"===e.entryType||"resource"===e.entryType);function No(e){var{entry:r,method:n,status:i,networkRequest:o,isInitial:s,start:a,end:l,url:c,initiatorType:u}=e;a=r?r.startTime:a,l=r?r.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),h=Math.floor(d+(a||0)),p=[t(t({},r?r.toJSON():{name:c}),{},{startTime:Ln(a)?void 0:Math.round(a),endTime:Ln(l)?void 0:Math.round(l),timeOrigin:d,timestamp:h,method:n,initiatorType:u||(r?r.initiatorType:void 0),status:i,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:s})];if(Ao(r))for(var v of r.serverTiming||[])p.push({timeOrigin:d,timestamp:h,startTime:Math.round(r.startTime),name:v.name,duration:v.duration,entryType:"serverTiming"});return p}var Fo=["video/","audio/"];function Oo(e){return new Promise(((t,r)=>{var n=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>r(e))).finally((()=>clearTimeout(n)))}catch(e){clearTimeout(n),t("[SessionReplay] Failed to read body")}}))}function Po(){return Po=n((function*(e){var{r:t,options:r,url:n}=e,{hostname:i,isHostDenied:o}=wo(n,r);return o?Promise.resolve(i+" is in deny list"):Oo(t)})),Po.apply(this,arguments)}function Lo(){return Lo=n((function*(e){var{r:t,options:r,url:n}=e,i=function(e){var t,{r:r,options:n,url:i}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null===(t=r.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),s=Fo.some((e=>null==o?void 0:o.startsWith(e)));if(o&&s)return"Content-Type ".concat(o," is not supported");var{hostname:a,isHostDenied:l}=wo(i,n);return l?a+" is in deny list":null}({r:t,options:r,url:n});return qn(i)?Oo(t):Promise.resolve(i)})),Lo.apply(this,arguments)}function Do(e,t,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=Eo("request",r.recordHeaders),o=Eo("response",r.recordHeaders),s=bo(t,"fetch",(s=>function(){var a=n((function*(n,a){var l,c,u,d=new Request(n,a),h={};try{var p={};d.headers.forEach(((e,t)=>{p[t]=e})),i&&(h.requestHeaders=p),xo({type:"request",headers:p,url:n,recordBody:r.recordBody})&&(h.requestBody=yield function(e){return Po.apply(this,arguments)}({r:d,options:r,url:n})),c=t.performance.now(),l=yield s(d),u=t.performance.now();var v={};return l.headers.forEach(((e,t)=>{v[t]=e})),o&&(h.responseHeaders=v),xo({type:"response",headers:v,url:n,recordBody:r.recordBody})&&(h.responseBody=yield function(e){return Lo.apply(this,arguments)}({r:l,options:r,url:n})),l}finally{To(t,"fetch",d.url,c,u).then((t=>{var r,n=No({entry:t,method:d.method,status:null===(r=l)||void 0===r?void 0:r.status,networkRequest:h,start:c,end:u,url:d.url,initiatorType:"fetch"});e({requests:n})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{s()}}var Bo=null;function qo(e,r,n){if(!("performance"in r))return()=>{};if(Bo)return So.warn("Network observer already initialised, doing nothing"),()=>{};var i=n?Object.assign({},po,n):po,o=r=>{var n=[];r.requests.forEach((e=>{var t=i.maskRequestFn(e);t&&n.push(t)})),n.length>0&&e(t(t({},r),{},{requests:n}))},s=ko(o,r,i),a=()=>{},l=()=>{};return(i.recordHeaders||i.recordBody)&&(a=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=Eo("request",r.recordHeaders),i=Eo("response",r.recordHeaders),o=bo(t.XMLHttpRequest.prototype,"open",(o=>function(s,a){var l,c,u=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,h=arguments.length>4?arguments[4]:void 0,p=this,v=new Request(a),g={},f={},m=p.setRequestHeader.bind(p);p.setRequestHeader=(e,t)=>(f[e]=t,m(e,t)),n&&(g.requestHeaders=f);var _=p.send.bind(p);p.send=e=>(xo({type:"request",headers:f,url:a,recordBody:r.recordBody})&&(g.requestBody=Ro({body:e,options:r,url:a})),l=t.performance.now(),_(e)),p.addEventListener("readystatechange",(()=>{if(p.readyState===p.DONE){c=t.performance.now();var n={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),i=t.join(": ");r&&(n[r]=i)})),i&&(g.responseHeaders=n),xo({type:"response",headers:n,url:a,recordBody:r.recordBody})&&(g.responseBody=Ro({body:p.response,options:r,url:a})),To(t,"xmlhttprequest",v.url,l,c).then((t=>{var r=No({entry:t,method:s,status:null==p?void 0:p.status,networkRequest:g,start:l,end:c,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}})),o.call(p,s,a,u,d,h)}));return()=>{o()}}(o,r,i),l=Do(o,r,i)),Bo=()=>{s(),a(),l()}}var Ho=e=>({name:"rrweb/network@1",observer:qo,options:e});Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Hr,getRecordNetworkPlugin:Ho},Qr.__PosthogExtensions__.rrweb={record:Ht,version:"v2"},Qr.rrweb={record:Ht,version:"v2"},Qr.rrwebConsoleRecord={getRecordConsolePlugin:Hr},Qr.getRecordNetworkPlugin=Ho;var $o,Wo,Vo,Zo,Go,jo,Uo,zo,Yo={},Xo=[],Jo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ko=Array.isArray;function Qo(e,t){for(var r in t)e[r]=t[r];return e}function es(e){var t=e.parentNode;t&&t.removeChild(e)}function ts(e,t,r){var n,i,o,s={};for(o in t)"key"==o?n=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?$o.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return rs(e,s,n,i,null)}function rs(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++Vo:i,__i:-1,__u:0};return null==i&&null!=Wo.vnode&&Wo.vnode(o),o}function ns(e){return e.children}function is(e,t){this.props=e,this.context=t}function os(e,t){if(null==t)return e.__?os(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?os(e):null}function ss(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return ss(e)}}function as(e){(!e.__d&&(e.__d=!0)&&Zo.push(e)&&!ls.__r++||Go!==Wo.debounceRendering)&&((Go=Wo.debounceRendering)||jo)(ls)}function ls(){var e,t,r,n,i,o,s,a,l;for(Zo.sort(Uo);e=Zo.shift();)e.__d&&(t=Zo.length,n=void 0,o=(i=(r=e).__v).__e,a=[],l=[],(s=r.__P)&&((n=Qo({},i)).__v=i.__v+1,Wo.vnode&&Wo.vnode(n),fs(s,n,i,r.__n,void 0!==s.ownerSVGElement,32&i.__u?[o]:null,a,null==o?os(i):o,!!(32&i.__u),l),n.__.__k[n.__i]=n,ms(a,n,l),n.__e!=o&&ss(n)),Zo.length>t&&Zo.sort(Uo));ls.__r=0}function cs(e,t,r,n,i,o,s,a,l,c,u){var d,h,p,v,g,f=n&&n.__k||Xo,m=t.length;for(r.__d=l,function(e,t,r){var n,i,o,s,a,l=t.length,c=r.length,u=c,d=0;for(e.__k=[],n=0;n<l;n++)null!=(i=e.__k[n]=null==(i=t[n])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?rs(null,i,null,null,i):Ko(i)?rs(ns,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?rs(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,a=ds(i,r,s=n+d,u),i.__i=a,o=null,-1!==a&&(u--,(o=r[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&d--,"function"!=typeof i.type&&(i.__u|=65536)):a!==s&&(a===s+1?d++:a>s?u>l-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==n+d&&(i.__u|=65536))):(o=r[n])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=os(o)),ys(o,o,!1),r[n]=null,u--);if(u)for(n=0;n<c;n++)null!=(o=r[n])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=os(o)),ys(o,o))}(r,t,f),l=r.__d,d=0;d<m;d++)null!=(p=r.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(h=-1===p.__i?Yo:f[p.__i]||Yo,p.__i=d,fs(e,p,h,i,o,s,a,l,c,u),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&_s(h.ref,null,p),u.push(p.ref,p.__c||v,p)),null==g&&null!=v&&(g=v),65536&p.__u||h.__k===p.__k?l=us(p,l,e):"function"==typeof p.type&&void 0!==p.__d?l=p.__d:v&&(l=v.nextSibling),p.__d=void 0,p.__u&=-196609);r.__d=l,r.__e=g}function us(e,t,r){var n,i;if("function"==typeof e.type){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=us(n[i],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function ds(e,t,r,n){var i=e.key,o=e.type,s=r-1,a=r+1,l=t[r];if(null===l||l&&i==l.key&&o===l.type)return r;if(n>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((l=t[s])&&0==(131072&l.__u)&&i==l.key&&o===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&i==l.key&&o===l.type)return a;a++}}return-1}function hs(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||Jo.test(t)?r:r+"px"}function ps(e,t,r,n,i){var o;e:if("style"===t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||hs(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||hs(e.style,t,r[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.u=n.u:(r.u=Date.now(),e.addEventListener(t,o?gs:vs,o)):e.removeEventListener(t,o?gs:vs,o);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==r?"":r;break e}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,r))}}function vs(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Wo.event?Wo.event(e):e)}function gs(e){return this.l[e.type+!0](Wo.event?Wo.event(e):e)}function fs(e,t,r,n,i,o,s,a,l,c){var u,d,h,p,v,g,f,m,_,y,b,w,S,C,I,k=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),o=[a=t.__e=r.__e]),(u=Wo.__b)&&u(t);e:if("function"==typeof k)try{if(m=t.props,_=(u=k.contextType)&&n[u.__c],y=u?_?_.props.value:u.__:n,r.__c?f=(d=t.__c=r.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(m,y):(t.__c=d=new is(m,y),d.constructor=k,d.render=bs),_&&_.sub(d),d.props=m,d.state||(d.state={}),d.context=y,d.__n=n,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Qo({},d.__s)),Qo(d.__s,k.getDerivedStateFromProps(m,d.__s))),p=d.props,v=d.state,d.__v=t,h)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&m!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(m,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(m,d.__s,y)||t.__v===r.__v)){for(t.__v!==r.__v&&(d.props=m,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(m,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,v,g)}))}if(d.context=y,d.props=m,d.__P=e,d.__e=!1,w=Wo.__r,S=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do{d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++S<25);d.state=d.__s,null!=d.getChildContext&&(n=Qo(Qo({},n),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(p,v)),cs(e,Ko(I=null!=u&&u.type===ns&&null==u.key?u.props.children:u)?I:[I],t,r,n,i,o,s,a,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),f&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=o?(t.__e=a,t.__u|=l?160:32,o[o.indexOf(a)]=null):(t.__e=r.__e,t.__k=r.__k),Wo.__e(e,t,r)}else null==o&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=function(e,t,r,n,i,o,s,a,l){var c,u,d,h,p,v,g,f=r.props,m=t.props,_=t.type;if("svg"===_&&(i=!0),null!=o)for(c=0;c<o.length;c++)if((p=o[c])&&"setAttribute"in p==!!_&&(_?p.localName===_:3===p.nodeType)){e=p,o[c]=null;break}if(null==e){if(null===_)return document.createTextNode(m);e=i?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,m.is&&m),o=null,a=!1}if(null===_)f===m||a&&e.data===m||(e.data=m);else{if(o=o&&$o.call(e.childNodes),f=r.props||Yo,!a&&null!=o)for(f={},c=0;c<e.attributes.length;c++)f[(p=e.attributes[c]).name]=p.value;for(c in f)p=f[c],"children"==c||("dangerouslySetInnerHTML"==c?d=p:"key"===c||c in m||ps(e,c,null,p,i));for(c in m)p=m[c],"children"==c?h=p:"dangerouslySetInnerHTML"==c?u=p:"value"==c?v=p:"checked"==c?g=p:"key"===c||a&&"function"!=typeof p||f[c]===p||ps(e,c,p,f[c],i);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),cs(e,Ko(h)?h:[h],t,r,n,i&&"foreignObject"!==_,o,s,o?o[0]:r.__k&&os(r,0),a,l),null!=o)for(c=o.length;c--;)null!=o[c]&&es(o[c]);a||(c="value",void 0!==v&&(v!==e[c]||"progress"===_&&!v||"option"===_&&v!==f[c])&&ps(e,c,v,f[c],!1),c="checked",void 0!==g&&g!==e[c]&&ps(e,c,g,f[c],!1))}return e}(r.__e,t,r,n,i,o,s,l,c);(u=Wo.diffed)&&u(t)}function ms(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)_s(r[n],r[++n],r[++n]);Wo.__c&&Wo.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Wo.__e(e,t.__v)}}))}function _s(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){Wo.__e(e,r)}}function ys(e,t,r){var n,i;if(Wo.unmount&&Wo.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||_s(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){Wo.__e(e,t)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&ys(n[i],t,r||"function"!=typeof e.type);r||null==e.__e||es(e.__e),e.__=e.__e=e.__d=void 0}function bs(e,t,r){return this.constructor(e,r)}function ws(e,t,r){var n,i,o,s;Wo.__&&Wo.__(e,t),i=(n="function"==typeof r)?null:t.__k,o=[],s=[],fs(t,e=(!n&&r||t).__k=ts(ns,null,[e]),i||Yo,Yo,void 0!==t.ownerSVGElement,!n&&r?[r]:i?null:t.firstChild?$o.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,s),ms(o,e,s)}function Ss(e,t,r){var n,i,o,s,a=Qo({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==o?n=t[o]:"ref"==o?i=t[o]:a[o]=void 0===t[o]&&void 0!==s?s[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?$o.call(arguments,2):r),rs(e.type,a,n||e.key,i||e.ref,null)}$o=Xo.slice,Wo={__e:function(e,t,r,n){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},Vo=0,is.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Qo({},this.state),"function"==typeof e&&(e=e(Qo({},r),this.props)),e&&Qo(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),as(this))},is.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),as(this))},is.prototype.render=ns,Zo=[],jo="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Uo=function(e,t){return e.__v.__b-t.__v.__b},ls.__r=0,zo=0;var Cs=$r,Is=Ur,ks="seenSurvey_",Es=an("[Surveys]"),xs=e=>"\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: ".concat((null==e?void 0:e.fontFamily)||"-apple-system",', BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n text-align: left;\n max-width: ').concat(parseInt((null==e?void 0:e.maxWidth)||"300"),"px;\n width: 100%;\n z-index: ").concat(parseInt((null==e?void 0:e.zIndex)||"99999"),";\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n border-bottom: 0px;\n ").concat({left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "}[(null==e?void 0:e.position)||"right"]||"right: 30px;","\n flex-direction: column;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n box-shadow: -6px 0 16px -8px rgb(0 0 0 / 8%), -9px 0 28px 0 rgb(0 0 0 / 5%), -12px 0 48px 16px rgb(0 0 0 / 3%);\n }\n\n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: 0.6;\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: ").concat((null==e?void 0:e.fontFamily)||"-apple-system",', BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ').concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ").concat((null==e?void 0:e.submitButtonColor)||"black"," !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n text-decoration: none;\n backgroundColor: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n color: ").concat(Ms((null==e?void 0:e.backgroundColor)||"#eeeded"),";\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n opacity: .60;\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n ");function Ts(e){if("#"===e[0]){var t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function Ms(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Os;"#"===t[0]&&(e=Ts(t)),t.startsWith("rgb")&&(e=t);var r=function(e){return{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[e.toLowerCase()]}(t);if(r&&(e=Ts(r)),!e)return"black";var n=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(n){var i=parseInt(n[1]),o=parseInt(n[2]),s=parseInt(n[3]);return Math.sqrt(i*i*.299+o*o*.587+s*s*.114)>127.5?"black":"white"}return"black"}var Rs,As,Ns,Fs={backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:"right"},Os="#eeeded",Ps=function(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;i?(localStorage.setItem($s(n),"true"),i.capture("survey sent",t(t({$survey_name:n.name,$survey_id:n.id,$survey_iteration:n.current_iteration,$survey_iteration_start_date:n.current_iteration_start_date,$survey_questions:n.questions.map((e=>e.question)),sessionRecordingUrl:null===(e=i.get_session_replay_url)||void 0===e?void 0:e.call(i)},r),{},{$set:{[Ws(n,"responded")]:!0}})),Cs.dispatchEvent(new Event("PHSurveySent"))):Es.error("[survey sent] event not captured, PostHog instance not found.")},Ls=(e,t,r)=>{var n;t?r||(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t),$set:{[Ws(e,"dismissed")]:!0}}),localStorage.setItem($s(e),"true"),Cs.dispatchEvent(new Event("PHSurveyClosed"))):Es.error("[survey dismissed] event not captured, PostHog instance not found.")},Ds=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Bs=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,qs=e=>(e.questions.forEach(((e,t)=>{e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?Bs(e.questions,Ds(e.questions)):e.questions),Hs=e=>{var t,r;return!(null===(t=e.conditions)||void 0===t||null===(r=t.events)||void 0===r||!r.repeatedActivation||!(e=>{var t,r,n,i,o,s;return null!=(null===(t=e.conditions)||void 0===t||null===(r=t.events)||void 0===r||null===(n=r.values)||void 0===n?void 0:n.length)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0})(e))},$s=e=>{var t="".concat(ks).concat(e.id);return e.current_iteration&&e.current_iteration>0&&(t="".concat(ks).concat(e.id,"_").concat(e.current_iteration)),t},Ws=(e,t)=>{var r="$survey_".concat(t,"/").concat(e.id);return e.current_iteration&&e.current_iteration>0&&(r="$survey_".concat(t,"/").concat(e.id,"/").concat(e.current_iteration)),r},Vs=function(e,t){var r={__c:t="__cC"+zo++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,n;return this.getChildContext||(r=[],(n={})[t]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some((function(e){e.__e=!0,as(e)}))},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:()=>{},isPopup:!0,onPreviewSubmit:()=>{}}),Zs=e=>{var{component:t,children:r,renderAsHtml:n,style:i}=e;return Ss(t,n?{dangerouslySetInnerHTML:{__html:r},style:i}:{children:r,style:i})};!function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(Rs||(Rs={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(As||(As={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(Ns||(Ns={}));var Gs="Mobile",js="iOS",Us="Android",zs="Tablet",Ys=Us+" "+zs,Xs="iPad",Js="Apple",Ks=Js+" Watch",Qs="Safari",ea="BlackBerry",ta="Samsung",ra=ta+"Browser",na=ta+" Internet",ia="Chrome",oa=ia+" OS",sa=ia+" "+js,aa="Internet Explorer",la=aa+" "+Gs,ca="Opera",ua=ca+" Mini",da="Edge",ha="Microsoft "+da,pa="Firefox",va=pa+" "+js,ga="Nintendo",fa="PlayStation",ma="Xbox",_a=Us+" "+Gs,ya=Gs+" "+Qs,ba="Windows",wa=ba+" Phone",Sa="Nokia",Ca="Ouya",Ia="Generic",ka=Ia+" "+Gs.toLowerCase(),Ea=Ia+" "+zs.toLowerCase(),xa="Konqueror",Ta="(\\d+(\\.\\d+)?)",Ma=new RegExp("Version/"+Ta),Ra=new RegExp(ma,"i"),Aa=new RegExp(fa+" \\w+","i"),Na=new RegExp(ga+" \\w+","i"),Fa=new RegExp(ea+"|PlayBook|BB10","i"),Oa={"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 Pa=(e,t)=>t&&Sn(t,Js)||function(e){return Sn(e,Qs)&&!Sn(e,ia)&&!Sn(e,Us)}(e),La=function(e,t){return t=t||"",Sn(e," OPR/")&&Sn(e,"Mini")?ua:Sn(e," OPR/")?ca:Fa.test(e)?ea:Sn(e,"IE"+Gs)||Sn(e,"WPDesktop")?la:Sn(e,ra)?na:Sn(e,da)||Sn(e,"Edg/")?ha:Sn(e,"FBIOS")?"Facebook "+Gs:Sn(e,"UCWEB")||Sn(e,"UCBrowser")?"UC Browser":Sn(e,"CriOS")?sa:Sn(e,"CrMo")||Sn(e,ia)?ia:Sn(e,Us)&&Sn(e,Qs)?_a:Sn(e,"FxiOS")?va:Sn(e.toLowerCase(),xa.toLowerCase())?xa:Pa(e,t)?Sn(e,Gs)?ya:Qs:Sn(e,pa)?pa:Sn(e,"MSIE")||Sn(e,"Trident/")?aa:Sn(e,"Gecko")?pa:""},Da={[la]:[new RegExp("rv:"+Ta)],[ha]:[new RegExp(da+"?\\/"+Ta)],[ia]:[new RegExp("("+ia+"|CrMo)\\/"+Ta)],[sa]:[new RegExp("CriOS\\/"+Ta)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ta)],[Qs]:[Ma],[ya]:[Ma],[ca]:[new RegExp("(Opera|OPR)\\/"+Ta)],[pa]:[new RegExp(pa+"\\/"+Ta)],[va]:[new RegExp("FxiOS\\/"+Ta)],[xa]:[new RegExp("Konqueror[:/]?"+Ta,"i")],[ea]:[new RegExp(ea+" "+Ta),Ma],[_a]:[new RegExp("android\\s"+Ta,"i")],[na]:[new RegExp(ra+"\\/"+Ta)],[aa]:[new RegExp("(rv:|MSIE )"+Ta)],Mozilla:[new RegExp("rv:"+Ta)]},Ba=[[new RegExp(ma+"; "+ma+" (.*?)[);]","i"),e=>[ma,e&&e[1]||""]],[new RegExp(ga,"i"),[ga,""]],[new RegExp(fa,"i"),[fa,""]],[Fa,[ea,""]],[new RegExp(ba,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[wa,""];if(new RegExp(Gs).test(t)&&!/IEMobile\b/.test(t))return[ba+" "+Gs,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var n=r[1],i=Oa[n]||"";return/arm/i.test(t)&&(i="RT"),[ba,i]}return[ba,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[js,t.join(".")]}return[js,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Ln(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Us+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Us+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Us,t.join(".")]}return[Us,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var r=[e[1],e[2],e[3]||"0"];t[1]=r.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[oa,""]],[/Linux|debian/i,["Linux",""]]],qa=function(e){return Na.test(e)?ga:Aa.test(e)?fa:Ra.test(e)?ma:new RegExp(Ca,"i").test(e)?Ca:new RegExp("("+wa+"|WPDesktop)","i").test(e)?wa:/iPad/.test(e)?Xs:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Ks:Fa.test(e)?ea:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Sa,"i").test(e)?Sa:/(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(Gs).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)?Us:Ys:Us:new RegExp("(pda|"+Gs+")","i").test(e)?ka:new RegExp(zs,"i").test(e)&&!new RegExp(zs+" pc","i").test(e)?Ea:""},Ha="https?://(.*)",$a=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","irclid","_kx"],Wa=hn(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],$a),Va="<masked>",Za={campaignParams:function(){var{customTrackedParams:e,maskPersonalDataProperties:t,customPersonalDataProperties:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ur)return{};var n=t?hn([],$a,r||[]):[];return this._campaignParamsFromUrl(Jn(Ur.URL,n,Va),e)},_campaignParamsFromUrl:function(e,t){var r=Wa.concat(t||[]),n={};return un(r,(function(t){var r=Xn(e,t);n[t]=r||null})),n},_searchEngine:function(e){return e?0===e.search(Ha+"google.([^/?]*)")?"google":0===e.search(Ha+"bing.com")?"bing":0===e.search(Ha+"yahoo.com")?"yahoo":0===e.search(Ha+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=Za._searchEngine(e),r="yahoo"!=t?"q":"p",n={};if(!qn(t)){n.$search_engine=t;var i=Ur?Xn(Ur.referrer,r):"";i.length&&(n.ph_keyword=i)}return n},searchInfo:function(){var e=null==Ur?void 0:Ur.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:La,browserVersion:function(e,t){var r=La(e,t),n=Da[r];if(Ln(n))return null;for(var i=0;i<n.length;i++){var o=n[i],s=e.match(o);if(s)return parseFloat(s[s.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var e=this.browserLanguage();return"string"==typeof e?e.split("-")[0]:void 0},os:function(e){for(var t=0;t<Ba.length;t++){var[r,n]=Ba[t],i=r.exec(e),o=i&&(An(n)?n(i,e):n);if(o)return o}return["",""]},device:qa,deviceType:function(e){var t=qa(e);return t===Xs||t===Ys||"Kobo"===t||"Kindle Fire"===t||t===Ea?zs:t===ga||t===ma||t===fa||t===Ca?"Console":t===Ks?"Wearable":t?Gs:"Desktop"},referrer:function(){return(null==Ur?void 0:Ur.referrer)||"$direct"},referringDomain:function(){var e;return null!=Ur&&Ur.referrer&&(null===(e=zn(Ur.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer().substring(0,1e3),u:null==zr?void 0:zr.href.substring(0,1e3)}},initialPersonPropsFromInfo:function(e){var t,{r:r,u:n}=e,i={$initial_referrer:r,$initial_referring_domain:null==r?void 0:"$direct"==r?"$direct":null===(t=zn(r))||void 0===t?void 0:t.host};if(n){i.$initial_current_url=n;var o=zn(n);i.$initial_host=null==o?void 0:o.host,i.$initial_pathname=null==o?void 0:o.pathname,un(this._campaignParamsFromUrl(n),(function(e,t){i["$initial_"+In(t)]=e}))}r&&un(this._searchInfoFromReferrer(r),(function(e,t){i["$initial_"+In(t)]=e}));return i},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}},timezoneOffset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}},properties:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Kr)return{};var r=e?hn([],$a,t||[]):[],[n,i]=Za.os(Kr);return dn(fn({$os:n,$os_version:i,$browser:Za.browser(Kr,navigator.vendor),$device:Za.device(Kr),$device_type:Za.deviceType(Kr),$timezone:Za.timezone(),$timezone_offset:Za.timezoneOffset()}),{$current_url:Jn(null==zr?void 0:zr.href,r,Va),$host:null==zr?void 0:zr.host,$pathname:null==zr?void 0:zr.pathname,$raw_user_agent:Kr.length>1e3?Kr.substring(0,997)+"...":Kr,$browser_version:Za.browserVersion(Kr,navigator.vendor),$browser_language:Za.browserLanguage(),$browser_language_prefix:Za.browserLanguagePrefix(),$screen_height:null==$r?void 0:$r.screen.height,$screen_width:null==$r?void 0:$r.screen.width,$viewport_height:null==$r?void 0:$r.innerHeight,$viewport_width:null==$r?void 0:$r.innerWidth,$lib:"web",$lib_version:nn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!Kr)return{};var[e,t]=Za.os(Kr);return dn(fn({$os:e,$os_version:t,$browser:Za.browser(Kr,navigator.vendor)}),{$browser_version:Za.browserVersion(Kr,navigator.vendor)})}};class Ga{constructor(){i(this,"events",{}),this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter((e=>e!==t))}}emit(e,t){for(var r of this.events[e]||[])r(t);for(var n of this.events["*"]||[])n(e,t)}}class ja{constructor(e){i(this,"_debugEventEmitter",new Ga),i(this,"checkStep",((e,t)=>this.checkStepEvent(e,t)&&this.checkStepUrl(e,t)&&this.checkStepElement(e,t))),i(this,"checkStepEvent",((e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event))),this.instance=e,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var e;if(!Ln(null===(e=this.instance)||void 0===e?void 0:e._addCaptureHook)){var t;null===(t=this.instance)||void 0===t||t._addCaptureHook(((e,t)=>{this.on(e,t)}))}}register(e){var t,r;if(!Ln(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,r;null===(t=this.actionRegistry)||void 0===t||t.add(e),null===(r=e.steps)||void 0===r||r.forEach((e=>{var t;null===(t=this.actionEvents)||void 0===t||t.add((null==e?void 0:e.event)||"")}))})),null!==(r=this.instance)&&void 0!==r&&r.autocapture)){var n,i=new Set;e.forEach((e=>{var t;null===(t=e.steps)||void 0===t||t.forEach((e=>{null!=e&&e.selector&&i.add(null==e?void 0:e.selector)}))})),null===(n=this.instance)||void 0===n||n.autocapture.setElementSelectors(i)}}on(e,t){var r;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null===(r=this.actionRegistry)||void 0===r?void 0:r.size)>0&&this.actionRegistry.forEach((e=>{this.checkAction(t,e)&&this._debugEventEmitter.emit("actionCaptured",e.name)}))}_addActionHook(e){this.onAction("actionCaptured",(t=>e(t)))}checkAction(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this.checkStep(e,r))return!0;return!1}onAction(e,t){return this._debugEventEmitter.on(e,t)}checkStepUrl(e,t){if(null!=t&&t.url){var r,n=null==e||null===(r=e.properties)||void 0===r?void 0:r.$current_url;if(!n||"string"!=typeof n)return!1;if(!ja.matchString(n,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static matchString(e,t,r){switch(r){case"regex":return!!$r&&kn(e,t);case"exact":return t===e;case"contains":var n=ja.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return kn(e,n);default:return!1}}static escapeStringRegexp(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.getElementsList(e).some((e=>!(null!=t&&t.href&&!ja.matchString(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact"))&&((null==t||!t.tag_name||e.tag_name===(null==t?void 0:t.tag_name))&&!(null!=t&&t.text&&!ja.matchString(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!ja.matchString(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))))return!1;if(null!=t&&t.selector){var r,n=null==e||null===(r=e.properties)||void 0===r?void 0:r.$element_selectors;if(!n)return!1;if(!n.includes(null==t?void 0:t.selector))return!1}return!0}getElementsList(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}class Ua{constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;Ln(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}setupActionBasedSurveys(e){var t=e.filter((e=>{var t,r,n,i;return(null===(t=e.conditions)||void 0===t?void 0:t.actions)&&(null===(r=e.conditions)||void 0===r||null===(n=r.actions)||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)>0}));if(0!==t.length){if(null==this.actionMatcher){this.actionMatcher=new ja(this.instance),this.actionMatcher.init();this.actionMatcher._addActionHook((e=>{this.onAction(e)}))}t.forEach((e=>{var t,r,n,i,o,s,a,l,c,u;e.conditions&&null!==(t=e.conditions)&&void 0!==t&&t.actions&&null!==(r=e.conditions)&&void 0!==r&&null!==(n=r.actions)&&void 0!==n&&n.values&&(null===(i=e.conditions)||void 0===i||null===(o=i.actions)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0&&(null===(a=this.actionMatcher)||void 0===a||a.register(e.conditions.actions.values),null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(u=c.values)||void 0===u||u.forEach((t=>{if(t&&t.name){var r=this.actionToSurveys.get(t.name);r&&r.push(e.id),this.actionToSurveys.set(t.name,r||[e.id])}})))}))}}setupEventBasedSurveys(e){var t;if(0!==e.filter((e=>{var t,r,n,i;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(r=e.conditions)||void 0===r||null===(n=r.events)||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)>0})).length){null===(t=this.instance)||void 0===t||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),e.forEach((e=>{var t,r,n;null===(t=e.conditions)||void 0===t||null===(r=t.events)||void 0===r||null===(n=r.values)||void 0===n||n.forEach((t=>{if(t&&t.name){var r=this.eventToSurveys.get(t.name);r&&r.push(e.id),this.eventToSurveys.set(t.name,r||[e.id])}}))}))}}onEvent(e,t){var r,n,i=(null===(r=this.instance)||void 0===r||null===(n=r.persistence)||void 0===n?void 0:n.props[Ii])||[];if(Ua.SURVEY_SHOWN_EVENT_NAME==e&&t&&i.length>0){var o,s=null==t||null===(o=t.properties)||void 0===o?void 0:o.$survey_id;if(s){var a=i.indexOf(s);a>=0&&(i.splice(a,1),this._updateActivatedSurveys(i))}}else this.eventToSurveys.has(e)&&this._updateActivatedSurveys(i.concat(this.eventToSurveys.get(e)||[]))}onAction(e){var t,r,n=(null===(t=this.instance)||void 0===t||null===(r=t.persistence)||void 0===r?void 0:r.props[Ii])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(n.concat(this.actionToSurveys.get(e)||[]))}_updateActivatedSurveys(e){var t,r;null===(t=this.instance)||void 0===t||null===(r=t.persistence)||void 0===r||r.register({[Ii]:[...new Set(e)]})}getSurveys(){var e,t,r=null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t?void 0:t.props[Ii];return r||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}i(Ua,"SURVEY_SHOWN_EVENT_NAME","survey shown");var za=an("[Surveys]"),Ya={icontains:(e,t)=>e.some((e=>t.toLowerCase().includes(e.toLowerCase()))),not_icontains:(e,t)=>e.every((e=>!t.toLowerCase().includes(e.toLowerCase()))),regex:(e,t)=>e.some((e=>kn(t,e))),not_regex:(e,t)=>e.every((e=>!kn(t,e))),exact:(e,t)=>e.some((e=>t===e)),is_not:(e,t)=>e.every((e=>t!==e))};function Xa(e,t,r){var n,i=e.questions[t],o=t+1;if(null===(n=i.branching)||void 0===n||!n.type)return t===e.questions.length-1?Ns.End:o;if(i.branching.type===Ns.End)return Ns.End;if(i.branching.type===Ns.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===Ns.ResponseBased){if(i.type===As.SingleChoice){var s,a,l=i.choices.indexOf("".concat(r));if(null!==(s=i.branching)&&void 0!==s&&null!==(a=s.responseValues)&&void 0!==a&&a.hasOwnProperty(l)){var c=i.branching.responseValues[l];return Number.isInteger(c)?c:c===Ns.End?Ns.End:o}}else if(i.type===As.Rating){var u,d;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(e,t){if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(7===t){if(e<1||e>7)throw new Error("The response must be in range 1-7");return e<=3?"negative":4===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(r,i.scale);if(null!==(u=i.branching)&&void 0!==u&&null!==(d=u.responseValues)&&void 0!==d&&d.hasOwnProperty(h)){var p=i.branching.responseValues[h];return Number.isInteger(p)?p:p===Ns.End?Ns.End:o}}return o}return za.warn("Falling back to next question index due to unexpected branching type"),o}function Ja(e){return null!=e?e:"icontains"}function Ka(e){var t,r,n;if(null===(t=e.conditions)||void 0===t||!t.url)return!0;var i=null==$r||null===(r=$r.location)||void 0===r?void 0:r.href;if(!i)return!1;var o=[e.conditions.url];return Ya[Ja(null===(n=e.conditions)||void 0===n?void 0:n.urlMatchType)](o,i)}class Qa{constructor(e){i(this,"getNextSurveyStep",Xa),this.instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){this._decideServerResponse=!!e.surveys,za.info("decideServerResponse set to ".concat(this._decideServerResponse)),this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var e=(()=>{for(var e=[],t=0;t<localStorage.length;t++){var r=localStorage.key(t);null!=r&&r.startsWith(ks)&&e.push(r)}return e})();e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this.instance.config.disable_surveys)za.info("Disabled. Not loading surveys.");else{var e=null==Qr?void 0:Qr.__PosthogExtensions__;if(e){var t=e.generateSurveys;if(this._decideServerResponse)if(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new Ua(this.instance)),t)this._surveyManager=t(this.instance);else{var r=e.loadExternalDependency;r?r(this.instance,"surveys",(t=>{var r;t?za.error("Could not load surveys script",t):this._surveyManager=null===(r=e.generateSurveys)||void 0===r?void 0:r.call(e,this.instance)})):za.error("PostHog loadExternalDependency extension not found. Cannot load remote config.")}else za.warn("Decide not loaded yet. Not loading surveys.")}else za.error("PostHog Extensions not found.")}}getSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return za.info("Disabled. Not loading surveys."),e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new Ua(this.instance));var r=this.instance.get_property(Ci);if(r&&!t)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",callback:t=>{var r,n=t.statusCode;if(200!==n||!t.json)return za.error("Surveys API could not be loaded, status: ".concat(n)),e([]);var i,o=t.json.surveys||[],s=o.filter((e=>{var t,r,n,i,o,s,a,l,c,u,d,h;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(r=e.conditions)||void 0===r||null===(n=r.events)||void 0===n?void 0:n.values)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0||(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c?void 0:c.values)&&(null===(u=e.conditions)||void 0===u||null===(d=u.actions)||void 0===d||null===(h=d.values)||void 0===h?void 0:h.length)>0}));s.length>0&&(null===(i=this._surveyEventReceiver)||void 0===i||i.register(s));return null===(r=this.instance.persistence)||void 0===r||r.register({[Ci]:o}),e(o)}})}isSurveyFeatureFlagEnabled(e){return!e||this.instance.featureFlags.isFeatureEnabled(e)}getActiveMatchingSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((t=>{var r,n=t.filter((e=>!(!e.start_date||e.end_date))).filter((e=>{var t;if(!e.conditions)return!0;var r=Ka(e),n=null===(t=e.conditions)||void 0===t||!t.selector||(null==Ur?void 0:Ur.querySelector(e.conditions.selector)),i=function(e){var t,r;if(null===(t=e.conditions)||void 0===t||!t.deviceTypes)return!0;if(!Kr)return!1;var n=Za.deviceType(Kr);return Ya[Ja(null===(r=e.conditions)||void 0===r?void 0:r.deviceTypesMatchType)](e.conditions.deviceTypes,n)}(e);return r&&n&&i})),i=null===(r=this._surveyEventReceiver)||void 0===r?void 0:r.getSurveys(),o=n.filter((e=>{var t,r,n,o,s,a,l,c,u;if(!(e.linked_flag_key||e.targeting_flag_key||e.internal_targeting_flag_key||null!==(t=e.feature_flag_keys)&&void 0!==t&&t.length))return!0;var d=this.isSurveyFeatureFlagEnabled(e.linked_flag_key),h=this.isSurveyFeatureFlagEnabled(e.targeting_flag_key),p=(null!==(r=null===(n=e.conditions)||void 0===n||null===(o=n.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)&&void 0!==r?r:0)>0,v=(null!==(a=null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(u=c.values)||void 0===u?void 0:u.length)&&void 0!==a?a:0)>0,g=!p&&!v||(null==i?void 0:i.includes(e.id)),f=this._canActivateRepeatedly(e)||this.isSurveyFeatureFlagEnabled(e.internal_targeting_flag_key),m=this.checkFlags(e);return d&&h&&f&&g&&m}));return e(o)}),t)}checkFlags(e){var t;return null===(t=e.feature_flag_keys)||void 0===t||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this.instance.featureFlags.isFeatureEnabled(r)}))}_canActivateRepeatedly(e){var t;return Hn(null===(t=Qr.__PosthogExtensions__)||void 0===t?void 0:t.canActivateRepeatedly)?(za.warn("init was not called"),!1):Qr.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){Hn(this._surveyManager)?za.warn("init was not called"):this.getSurveys((t=>{var r=t.filter((t=>t.id===e))[0];this._surveyManager.canRenderSurvey(r)}))}renderSurvey(e,t){Hn(this._surveyManager)?za.warn("init was not called"):this.getSurveys((r=>{var n=r.filter((t=>t.id===e))[0];this._surveyManager.renderSurvey(n,null==Ur?void 0:Ur.querySelector(t))}))}}var el,tl,rl,nl,il=0,ol=[],sl=[],al=Wo.__b,ll=Wo.__r,cl=Wo.diffed,ul=Wo.__c,dl=Wo.unmount;function hl(e,t){Wo.__h&&Wo.__h(tl,e,il||t),il=0;var r=tl.__H||(tl.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:sl}),r.__[e]}function pl(e){return il=1,function(e,t,r){var n=hl(el++,2);if(n.t=e,!n.__c&&(n.__=[Il(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=tl,!tl.u)){var i=function(e,t,r){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,r);var s=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&n.__c.props===e)&&(!o||o.call(this,e,t,r))};tl.u=!0;var o=tl.shouldComponentUpdate,s=tl.componentWillUpdate;tl.componentWillUpdate=function(e,t,r){if(this.__e){var n=o;o=void 0,i(e,t,r),o=n}s&&s.call(this,e,t,r)},tl.shouldComponentUpdate=i}return n.__N||n.__}(Il,e)}function vl(e,t){var r=hl(el++,3);!Wo.__s&&Cl(r.__H,t)&&(r.__=e,r.i=t,tl.__H.__h.push(r))}function gl(e){return il=5,fl((function(){return{current:e}}),[])}function fl(e,t){var r=hl(el++,7);return Cl(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function ml(e){var t=tl.context[e.__c],r=hl(el++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(tl)),t.props.value):e.__}function _l(){for(var e;e=ol.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(wl),e.__H.__h.forEach(Sl),e.__H.__h=[]}catch(t){e.__H.__h=[],Wo.__e(t,e.__v)}}Wo.__b=function(e){tl=null,al&&al(e)},Wo.__r=function(e){ll&&ll(e),el=0;var t=(tl=e.__c).__H;t&&(rl===tl?(t.__h=[],tl.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=sl,e.__N=e.i=void 0}))):(t.__h.forEach(wl),t.__h.forEach(Sl),t.__h=[],el=0)),rl=tl},Wo.diffed=function(e){cl&&cl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ol.push(t)&&nl===Wo.requestAnimationFrame||((nl=Wo.requestAnimationFrame)||bl)(_l)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==sl&&(e.__=e.__V),e.i=void 0,e.__V=sl}))),rl=tl=null},Wo.__c=function(e,t){t.some((function(e){try{e.__h.forEach(wl),e.__h=e.__h.filter((function(e){return!e.__||Sl(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Wo.__e(r,e.__v)}})),ul&&ul(e,t)},Wo.unmount=function(e){dl&&dl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{wl(e)}catch(e){t=e}})),r.__H=void 0,t&&Wo.__e(t,r.__v))};var yl="function"==typeof requestAnimationFrame;function bl(e){var t,r=function(){clearTimeout(n),yl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);yl&&(t=requestAnimationFrame(r))}function wl(e){var t=tl,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),tl=t}function Sl(e){var t=tl;e.__c=e.__(),tl=t}function Cl(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function Il(e,t){return"function"==typeof t?t(e):t}var kl=Ur;var El=0;function xl(e,t,r,n,i,o){var s,a,l={};for(a in t)"ref"==a?s=t[a]:l[a]=t[a];var c={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--El,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return Wo.vnode&&Wo.vnode(c),c}var Tl=xl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:xl("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Ml=xl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:xl("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Rl=xl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:xl("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Al=xl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:xl("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Nl=xl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:xl("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Fl=xl("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:xl("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"black"})}),Ol=xl("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[xl("g",{"clip-path":"url(#clip0_2415_6911)",children:[xl("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:xl("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),xl("g",{mask:"url(#mask0_2415_6911)",children:[xl("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),xl("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),xl("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),xl("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),xl("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),xl("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),xl("defs",{children:xl("clipPath",{id:"clip0_2415_6911",children:xl("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),Pl=xl("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:xl("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});function Ll(){return xl("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Ol]})}function Dl(e){var{text:t,submitDisabled:r,appearance:n,onSubmit:i,link:o,onPreviewSubmit:s}=e,{isPreviewMode:a,isPopup:l}=ml(Vs),c=n.submitButtonTextColor||Ms(n.submitButtonColor||Fs.submitButtonColor);return xl("div",{className:"bottom-section",children:[xl("div",{className:"buttons",children:xl("button",{className:"form-submit",disabled:r&&!a,type:"button",style:l?{color:c}:{},onClick:()=>{a?null==s||s():(o&&(null==$r||$r.open(o)),i())},children:t})}),!n.whiteLabel&&xl(Ll,{})]})}function Bl(e){var{question:t,description:r,descriptionContentType:n,backgroundColor:i,forceDisableHtml:o}=e,{isPopup:s}=ml(Vs);return xl("div",{style:s?{backgroundColor:i||Fs.backgroundColor}:{},children:[xl("div",{className:"survey-question",children:t}),r&&Zs({component:ts("div",{className:"survey-question-description"}),children:r,renderAsHtml:!o&&"text"!==n})]})}function ql(e){var{onClick:t}=e,{isPreviewMode:r}=ml(Vs);return xl("div",{className:"cancel-btn-wrapper",onClick:t,disabled:r,children:xl("button",{className:"form-cancel",onClick:t,disabled:r,children:Fl})})}function Hl(e){var{header:r,description:n,contentType:i,forceDisableHtml:o,appearance:s,onClose:a,styleOverrides:l}=e,c=Ms(s.backgroundColor||Fs.backgroundColor),{isPopup:u}=ml(Vs);return xl(ns,{children:xl("div",{className:"thank-you-message",style:t({},l),children:xl("div",{className:"thank-you-message-container",children:[u&&xl(ql,{onClick:()=>a()}),xl("h3",{className:"thank-you-message-header",style:{color:c},children:r}),n&&Zs({component:ts("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!o&&"text"!==i,style:{color:c}}),u&&xl(Dl,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})})})}function $l(e){var t,r=gl(null),[n,i]=pl(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return vl((()=>{if(r.current){var e=function(e){var t=Cs.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";var r=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!r)return"black";var n=parseInt(r[1]),i=parseInt(r[2]),o=parseInt(r[3]);return Math.sqrt(n*n*.299+i*i*.587+o*o*.114)>127.5?"black":"white"}(r.current);i(e)}}),[e.appearance,e.forceUpdate]),{ref:r,textColor:n}}function Wl(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o}=e,s=gl(null),[a,l]=pl("");return xl("div",{ref:s,children:[xl(Bl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:n.backgroundColor,forceDisableHtml:r}),xl("textarea",{rows:4,placeholder:null==n?void 0:n.placeholder,onInput:e=>l(e.currentTarget.value)}),xl(Dl,{text:t.buttonText||"Submit",submitDisabled:!a&&!t.optional,appearance:n,onSubmit:()=>i(a),onPreviewSubmit:()=>o(a)})]})}function Vl(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o}=e;return xl(ns,{children:[xl(Bl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r}),xl(Dl,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function Zl(e){var{question:t,forceDisableHtml:r,displayQuestionIndex:n,appearance:i,onSubmit:o,onPreviewSubmit:s}=e,a=t.scale,l=10===t.scale?0:1,[c,u]=pl(null);return xl(ns,{children:[xl(Bl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r,backgroundColor:i.backgroundColor}),xl("div",{className:"rating-section",children:[xl("div",{className:"rating-options",children:["emoji"===t.display&&xl("div",{className:"rating-options-emoji",children:(3===t.scale?Ul:zl).map(((e,t)=>{var r=t+1===c;return xl("button",{className:"ratings-emoji question-".concat(n,"-rating-").concat(t," ").concat(r?"rating-active":null),value:t+1,type:"button",onClick:()=>{u(t+1)},style:{fill:r?i.ratingButtonActiveColor:i.ratingButtonColor,borderColor:i.borderColor},children:e},t)}))}),"number"===t.display&&xl("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat(".concat(a-l+1,", minmax(0, 1fr))")},children:Kl(t.scale).map(((e,t)=>xl(Gl,{displayQuestionIndex:n,active:c===e,appearance:i,num:e,setActiveNumber:e=>{u(e)}},t)))})]}),xl("div",{className:"rating-text",children:[xl("div",{children:t.lowerBoundLabel}),xl("div",{children:t.upperBoundLabel})]})]}),xl(Dl,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:qn(c)&&!t.optional,appearance:i,onSubmit:()=>o(c),onPreviewSubmit:()=>s(c)})]})}function Gl(e){var{num:t,active:r,displayQuestionIndex:n,appearance:i,setActiveNumber:o}=e,{textColor:s,ref:a}=$l({appearance:i,defaultTextColor:"black",forceUpdate:r});return xl("button",{ref:a,className:"ratings-number question-".concat(n,"-rating-").concat(t," ").concat(r?"rating-active":null),type:"button",onClick:()=>{o(t)},style:{color:s,backgroundColor:r?i.ratingButtonActiveColor:i.ratingButtonColor,borderColor:i.borderColor},children:t})}function jl(e){var{question:t,forceDisableHtml:r,displayQuestionIndex:n,appearance:i,onSubmit:o,onPreviewSubmit:s}=e,a=gl(null),l=fl((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var n=Bs(t,Ds(t));return e.hasOpenChoice&&(e.choices.push(r),n.push(r)),n})(t)),[t]),[c,u]=pl(t.type===As.MultipleChoice?[]:null),[d,h]=pl(!1),[p,v]=pl(""),g=t.type===As.SingleChoice?"radio":"checkbox";return xl("div",{ref:a,children:[xl(Bl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r,backgroundColor:i.backgroundColor}),xl("div",{className:"multiple-choice-options",children:l.map(((e,r)=>{var i="choice-option",o=e,s=e;return t.hasOpenChoice&&r===t.choices.length-1&&(i+=" choice-option-open"),xl("div",{className:i,children:[xl("input",{type:g,id:"surveyQuestion".concat(n,"Choice").concat(r),name:"question".concat(n),value:o,disabled:!o,onInput:()=>t.hasOpenChoice&&r===t.choices.length-1?h(!d):t.type===As.SingleChoice?u(o):t.type===As.MultipleChoice&&Rn(c)?c.includes(o)?u(c.filter((e=>e!==o))):u([...c,o]):void 0}),xl("label",{htmlFor:"surveyQuestion".concat(n,"Choice").concat(r),style:{color:"black"},children:t.hasOpenChoice&&r===t.choices.length-1?xl(ns,{children:[xl("span",{children:[s,":"]}),xl("input",{type:"text",id:"surveyQuestion".concat(n,"Choice").concat(r,"Open"),name:"question".concat(n),onInput:e=>{var r=e.currentTarget.value;return t.type===As.SingleChoice?u(r):t.type===As.MultipleChoice&&Rn(c)?v(r):void 0}})]}):s}),xl("span",{className:"choice-check",style:{color:"black"},children:Pl})]})}))}),xl(Dl,{text:t.buttonText||"Submit",submitDisabled:(qn(c)||Rn(c)&&!d&&0===c.length||Rn(c)&&d&&!p&&0===c.length&&!t.optional)&&!t.optional,appearance:i,onSubmit:()=>{d&&t.type===As.MultipleChoice?Rn(c)&&o([...c,p]):o(c)},onPreviewSubmit:()=>{d&&t.type===As.MultipleChoice?Rn(c)&&s([...c,p]):s(c)}})]})}var Ul=[Rl,Ml,Tl],zl=[Al,Rl,Ml,Tl,Nl],Yl=[1,2,3,4,5],Xl=[1,2,3,4,5,6,7],Jl=[0,1,2,3,4,5,6,7,8,9,10];function Kl(e){switch(e){case 5:default:return Yl;case 7:return Xl;case 10:return Jl}}var Ql=an("[Surveys]"),ec=$r,tc=Ur;class rc{constructor(e){var t=this;i(this,"canShowNextEventBasedSurvey",(()=>{var e,t=tc.querySelectorAll("div[class^=PostHogSurvey]");return!(t.length>0)||1===(null===(e=t[t.length-1].shadowRoot)||void 0===e?void 0:e.childElementCount)})),i(this,"handlePopoverSurvey",(e=>{var t,r=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,n=localStorage.getItem("lastSeenSurveyDate");if(r&&n){var i=new Date,o=Math.abs(i.getTime()-new Date(n).getTime());if(Math.ceil(o/864e5)<r)return}var s=(e=>!!localStorage.getItem($s(e))&&!Hs(e))(e);if(!s){this.addSurveyToFocus(e.id);var a=((e,t,r)=>{var n=Is.createElement("div");n.className="PostHogSurvey".concat(t);var i=n.attachShadow({mode:"open"});if(e){var o=Object.assign(Is.createElement("style"),{innerText:e});i.appendChild(o)}return Is.body.appendChild(n),i})(xs(null==e?void 0:e.appearance),e.id);ws(xl(ic,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),a)}})),i(this,"handleWidget",(e=>{var t=function(e){var t,r=kl.createElement("div");r.className="PostHogWidget".concat(e.id);var n,i=r.attachShadow({mode:"open"}),o=(n=null===(t=e.appearance)||void 0===t?void 0:t.widgetColor,"\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ".concat(n||"#e0a045",";\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: 9999999;\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n "));return i.append(Object.assign(kl.createElement("style"),{innerText:o})),kl.body.appendChild(r),i}(e),r=xs(e.appearance);t.appendChild(Object.assign(tc.createElement("style"),{innerText:r})),ws(xl(sc,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus},"feedback-survey"),t)})),i(this,"handleWidgetSelector",(e=>{var t,r=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&tc.querySelector(e.appearance.widgetSelector);if(r)if(0===tc.querySelectorAll(".PostHogWidget".concat(e.id)).length)this.handleWidget(e);else if(1===tc.querySelectorAll(".PostHogWidget".concat(e.id)).length&&!r.getAttribute("PHWidgetSurveyClickListener")){var n,i,o=null===(n=tc.querySelector(".PostHogWidget".concat(e.id)))||void 0===n||null===(i=n.shadowRoot)||void 0===i?void 0:i.querySelector(".survey-form");wn(r,"click",(()=>{o&&(o.style.display="none"===o.style.display?"block":"none",wn(o,"PHSurveyClosed",(()=>{this.removeSurveyFromFocus(e.id),o.style.display="none"})))})),r.setAttribute("PHWidgetSurveyClickListener","true")}})),i(this,"canRenderSurvey",(e=>{var t={visible:!1};return e.end_date?(t.disabledReason="survey was completed on ".concat(e.end_date),t):e.type!=Rs.Popover?(t.disabledReason="Only Popover survey types can be rendered",t):!e.linked_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)?!e.targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)?!e.internal_targeting_flag_key||this.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason="internal targeting feature flag ".concat(e.internal_targeting_flag_key," is false"),t):(t.disabledReason="targeting feature flag ".concat(e.targeting_flag_key," is false"),t):(t.disabledReason="linked feature flag ".concat(e.linked_flag_key," is false"),t)})),i(this,"renderSurvey",((e,t)=>{ws(xl(ic,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)})),i(this,"callSurveysAndEvaluateDisplayLogic",(function(){var e,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=t.posthog)||void 0===e||e.getActiveMatchingSurveys((e=>{var r=e.filter((e=>"api"!==e.type));t.sortSurveysByAppearanceDelay(r).forEach((e=>{if(qn(t.surveyInFocus)&&Ka(e)){var r,n,i;if(e.type===Rs.Widget)"tab"===(null===(r=e.appearance)||void 0===r?void 0:r.widgetType)&&0===tc.querySelectorAll(".PostHogWidget".concat(e.id)).length&&t.handleWidget(e),"selector"===(null===(n=e.appearance)||void 0===n?void 0:n.widgetType)&&null!==(i=e.appearance)&&void 0!==i&&i.widgetSelector&&t.handleWidgetSelector(e);e.type===Rs.Popover&&t.canShowNextEventBasedSurvey()&&t.handlePopoverSurvey(e)}}))}),r)})),i(this,"addSurveyToFocus",(e=>{qn(this.surveyInFocus)||Ql.error("Survey ".concat([...this.surveyInFocus]," already in focus. Cannot add survey ").concat(e,".")),this.surveyInFocus=e})),i(this,"removeSurveyFromFocus",(e=>{this.surveyInFocus!==e&&Ql.error("Survey ".concat(e," is not in focus. Cannot remove survey ").concat(e,".")),this.surveyInFocus=null})),this.posthog=e,this.surveyInFocus=null}sortSurveysByAppearanceDelay(e){return e.sort(((e,t)=>{var r,n;return((null===(r=e.appearance)||void 0===r?void 0:r.surveyPopupDelaySeconds)||0)-((null===(n=t.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)}))}getTestAPI(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}function nc(e){if(tc&&ec){var t=new rc(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}}function ic(e){var r,n,i,o,s,a,{survey:l,forceDisableHtml:c,posthog:u,style:d,previewPageIndex:h,removeSurveyFromFocus:p,isPopup:v,onPreviewSubmit:g=(()=>{})}=e,f=Number.isInteger(h),m=null!==(r=l.appearance)&&void 0!==r&&r.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:_,isSurveySent:y,setIsPopupVisible:b}=function(e,t,r,n,i){var[o,s]=pl(n||0===r),[a,l]=pl(!1);return vl((()=>{if(t){if(!n){var o,a=()=>{i(e.id),s(!1)},c=()=>{var t,r;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(l(!0),i(e.id),null!==(r=e.appearance)&&void 0!==r&&r.autoDisappear&&setTimeout((()=>{s(!1)}),5e3)):(i(e.id),s(!1))},u=()=>{var r;s(!0),ec.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(r=t.get_session_replay_url)||void 0===r?void 0:r.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())};return wn(ec,"PHSurveyClosed",a),wn(ec,"PHSurveySent",c),r>0?(o=setTimeout((()=>{u()}),r),()=>{clearTimeout(o),ec.removeEventListener("PHSurveyClosed",a),ec.removeEventListener("PHSurveySent",c)}):(u(),()=>{ec.removeEventListener("PHSurveyClosed",a),ec.removeEventListener("PHSurveySent",c)})}}else Ql.error("usePopupVisibility hook called without a PostHog instance.")}),[]),vl((()=>{var t;if(!n&&null!==(t=e.conditions)&&void 0!==t&&t.url){var r=()=>{Ka(e)||(s(!1),i(e.id))};wn(ec,"popstate",r),wn(ec,"hashchange",r);var o=ec.history.pushState,a=ec.history.replaceState;return ec.history.pushState=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];o.apply(this,t),r()},ec.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];a.apply(this,t),r()},()=>{ec.removeEventListener("popstate",r),ec.removeEventListener("hashchange",r),ec.history.pushState=o,ec.history.replaceState=a}}}),[n,e,i]),{isPopupVisible:o,isSurveySent:a,setIsPopupVisible:s}}(l,u,m,f,p),w=y||h===l.questions.length,S=null!==(n=d)&&void 0!==n&&n.left&&$n(null===(i=d)||void 0===i?void 0:i.left)?{left:d.left-40}:{};return f&&((d=d||{}).left="unset",d.right="unset",d.transform="unset"),_?xl(Vs.Provider,{value:{isPreviewMode:f,previewPageIndex:h,handleCloseSurveyPopup:()=>Ls(l,u,f),isPopup:v||!1,onPreviewSubmit:g},children:w?xl(Hl,{header:(null===(o=l.appearance)||void 0===o?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null===(s=l.appearance)||void 0===s?void 0:s.thankYouMessageDescription)||"",forceDisableHtml:!!c,contentType:null===(a=l.appearance)||void 0===a?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||Fs,styleOverrides:t(t({},d),S),onClose:()=>b(!1)}):xl(oc,{survey:l,forceDisableHtml:!!c,posthog:u,styleOverrides:d})}):null}function oc(e){var r,n,{survey:i,forceDisableHtml:o,posthog:s,styleOverrides:a}=e,l=Ms((null===(r=i.appearance)||void 0===r?void 0:r.backgroundColor)||Fs.backgroundColor),[c,u]=pl({}),{isPreviewMode:d,previewPageIndex:h,handleCloseSurveyPopup:p,isPopup:v,onPreviewSubmit:g}=ml(Vs),[f,m]=pl(h||0),_=fl((()=>qs(i)),[i]);vl((()=>{m(null!=h?h:0)}),[h]);return xl("form",{className:"survey-form",style:v?t({color:l,borderColor:null===(n=i.appearance)||void 0===n?void 0:n.borderColor},a):{},children:_.map(((e,r)=>{var n,{originalQuestionIndex:a}=e;return(d?f===a:f===r)&&xl("div",{className:"survey-box",style:v?{backgroundColor:(null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||Fs.backgroundColor}:{},children:[v&&xl(ql,{onClick:()=>p()}),ac({question:e,forceDisableHtml:o,displayQuestionIndex:r,appearance:i.appearance||Fs,onSubmit:e=>(e=>{var{res:r,originalQuestionIndex:n,displayQuestionIndex:o}=e;if(s){var a=0===n?"$survey_response":"$survey_response_".concat(n);if(u(t(t({},c),{},{[a]:r})),s.getNextSurveyStep){var l=s.getNextSurveyStep(i,o,r);l===Ns.End?Ps(t(t({},c),{},{[a]:r}),i,s):m(l)}else o===i.questions.length-1?Ps(t(t({},c),{},{[a]:r}),i,s):m(o+1)}else Ql.error("onNextButtonClick called without a PostHog instance.")})({res:e,originalQuestionIndex:a,displayQuestionIndex:r}),onPreviewSubmit:g})]})}))})}function sc(e){var t,r,{survey:n,forceDisableHtml:i,posthog:o,readOnly:s,removeSurveyFromFocus:a}=e,[l,c]=pl(!1),[u,d]=pl({}),h=gl(null);return vl((()=>{var e,t;if(o){if(!s){if("tab"===(null===(e=n.appearance)||void 0===e?void 0:e.widgetType)&&h.current){var r,i=h.current.getBoundingClientRect(),a={top:"50%",left:parseInt("".concat(i.right-360)),bottom:"auto",borderRadius:10,borderBottom:"1.5px solid ".concat((null===(r=n.appearance)||void 0===r?void 0:r.borderColor)||"#c9c6c6")};d(a)}if("selector"===(null===(t=n.appearance)||void 0===t?void 0:t.widgetType)){var u,p=null!==(u=tc.querySelector(n.appearance.widgetSelector||""))&&void 0!==u?u:void 0;wn(p,"click",(()=>{c(!l)})),null==p||p.setAttribute("PHWidgetSurveyClickListener","true")}}}else Ql.error("FeedbackWidget called without a PostHog instance.")}),[]),xl(ns,{children:["tab"===(null===(t=n.appearance)||void 0===t?void 0:t.widgetType)&&xl("div",{className:"ph-survey-widget-tab",ref:h,onClick:()=>!s&&c(!l),style:{color:Ms(n.appearance.widgetColor)},children:[xl("div",{className:"ph-survey-widget-tab-icon"}),(null===(r=n.appearance)||void 0===r?void 0:r.widgetLabel)||""]}),l&&xl(ic,{posthog:o,survey:n,forceDisableHtml:i,style:u,removeSurveyFromFocus:a,isPopup:!0},"feedback-widget-survey")]})}var ac=e=>{var{question:r,forceDisableHtml:n,displayQuestionIndex:i,appearance:o,onSubmit:s,onPreviewSubmit:a}=e,l={[As.Open]:Wl,[As.Link]:Vl,[As.Rating]:Zl,[As.SingleChoice]:jl,[As.MultipleChoice]:jl},c={question:r,forceDisableHtml:n,appearance:o,onPreviewSubmit:e=>{a(e)},onSubmit:e=>{s(e)}},u={[As.Open]:{},[As.Link]:{},[As.Rating]:{displayQuestionIndex:i},[As.SingleChoice]:{displayQuestionIndex:i},[As.MultipleChoice]:{displayQuestionIndex:i}},d=l[r.type],h=t(t({},c),u[r.type]);return xl(d,t({},h))};function lc(e){return!Ln(Event)&&cc(e,Event)}function cc(e,t){try{return e instanceof t}catch(e){return!1}}function uc(e){return qn(e)||!On(e)&&!An(e)}function dc(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function hc(e){return dc(e,"DOMError")}Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.canActivateRepeatedly=Hs,Qr.__PosthogExtensions__.generateSurveys=nc,Qr.extendPostHogWithSurveys=nc;var pc=/\(error: (.*)\)/,vc=50,gc="?";function fc(e,t,r,n){var i={platform:"web:javascript",filename:e,function:"<anonymous>"===t?gc:t,in_app:!0};return Ln(r)||(i.lineno=r),Ln(n)||(i.colno=n),i}var mc=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,_c=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,yc=/\((\S*)(?::(\d+))(?::(\d+))\)/,bc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,wc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Sc=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],o=e.split("\n"),s=r;s<o.length;s++){var a=o[s];if(!(a.length>1024)){var l=pc.test(a)?a.replace(pc,"$1"):a;if(!l.match(/\S*Error: /)){for(var c of i){var u=c(l);if(u){n.push(u);break}}if(n.length>=vc)break}}}return function(e){if(!e.length)return[];var r=Array.from(e);return r.reverse(),r.slice(0,vc).map((e=>t(t({},e),{},{filename:e.filename||Cc(r).filename,function:e.function||gc})))}(n)}}(...[[30,e=>{var t=mc.exec(e);if(t){var[,r,n,i]=t;return fc(r,gc,+n,+i)}var o=_c.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var s=yc.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[a,l]=Ic(o[1]||gc,o[2]);return fc(l,a,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,e=>{var t=bc.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var r=wc.exec(t[3]);r&&(t[1]=t[1]||"eval",t[3]=r[1],t[4]=r[2],t[5]="")}var n=t[3],i=t[1]||gc;return[i,n]=Ic(i,n),fc(n,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function Cc(e){return e[e.length-1]||{}}var Ic=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:gc,r?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]},kc=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Ec(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.stacktrace||e.stack||"",n=function(e){if(e&&xc.test(e.message))return 1;return 0}(e);try{var i=Sc(r,n);return i.slice(0,i.length-t)}catch(e){}return[]}var xc=/Minified React error #\d+;/i;function Tc(e,t){var r,n,i=Ec(e),o=null===(r=null==t?void 0:t.handled)||void 0===r||r,s=null!==(n=null==t?void 0:t.synthetic)&&void 0!==n&&n;return{$exception_list:[{type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:function(e){var t=e.message;if(t.error&&"string"==typeof t.error.message)return t.error.message;return t}(e),stacktrace:{frames:i,type:"raw"},mechanism:{handled:o,synthetic:s}}],$exception_level:"error"}}function Mc(e,t){var r,n,i,o=null===(r=null==t?void 0:t.handled)||void 0===r||r,s=null===(n=null==t?void 0:t.synthetic)||void 0===n||n,a={type:null!=t&&t.overrideExceptionType?t.overrideExceptionType:null!==(i=null==t?void 0:t.defaultExceptionType)&&void 0!==i?i:"Error",value:null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:e||(null==t?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:s}};if(null!=t&&t.syntheticException){var l=Ec(t.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function Rc(e){return Dn(e)&&!Bn(e)&&rn.indexOf(e)>=0}function Ac(e,t){var r,n,i=null===(r=null==t?void 0:t.handled)||void 0===r||r,o=null===(n=null==t?void 0:t.synthetic)||void 0===n||n,s=null!=t&&t.overrideExceptionType?t.overrideExceptionType:lc(e)?e.constructor.name:"Error",a=null!=t&&t.overrideExceptionMessage?t.overrideExceptionMessage:"Non-Error ".concat("exception"," captured with keys: ",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var n=r.length;n>0;n--){var i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length||i.length<=t?i:"".concat(i.slice(0,t),"...")}return""}(e)),l={type:s,value:a,mechanism:{handled:i,synthetic:o}};if(null!=t&&t.syntheticException){var c=Ec(null==t?void 0:t.syntheticException,1);c.length&&(l.stacktrace={frames:c,type:"raw"})}return{$exception_list:[l],$exception_level:Rc(e.level)?e.level:"error"}}function Nc(e,r){var{error:n,event:i}=e,o={$exception_list:[]},s=n||i;if(hc(s)||function(e){return dc(e,"DOMException")}(s)){var a=s;if(function(e){return"stack"in e}(s))o=Tc(s,r);else{var l=a.name||(hc(a)?"DOMError":"DOMException"),c=a.message?"".concat(l,": ").concat(a.message):l,u=hc(a)?"DOMError":"DOMException";o=Mc(c,t(t({},r),{},{overrideExceptionType:u,defaultExceptionMessage:c}))}return"code"in a&&(o.$exception_DOMException_code="".concat(a.code)),o}if(function(e){return dc(e,"ErrorEvent")}(s)&&s.error)return Tc(s.error,r);if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return cc(e,Error)}}(s))return Tc(s,r);if(function(e){return dc(e,"Object")}(s)||lc(s))return Ac(s,r);if(Ln(n)&&Dn(i)){var d="Error",h=i,p=i.match(kc);return p&&(d=p[1],h=p[2]),Mc(h,t(t({},r),{},{overrideExceptionType:d,defaultExceptionMessage:h}))}return Mc(s,r)}function Fc(e){var[t]=e,r=function(e){if(uc(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}(t);return uc(r)?Mc("Non-Error promise rejection captured with value: ".concat(String(r)),{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):Nc({event:r},{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(r)})}var Oc=an("[ExceptionAutocapture]"),Pc={wrapOnError:e=>{var t=$r;t||Oc.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];var s=Nc({event:i[0],error:i[4]});return e(s),null!==(t=null==r?void 0:r(...i))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection:e=>{var t=$r;t||Oc.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var n,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];var a=Fc(o);return e(a),null!==(n=null==r?void 0:r.apply(t,o))&&void 0!==n&&n},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}}};Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.errorWrappingFunctions=Pc,Qr.__PosthogExtensions__.parseErrorAsProperties=Nc,Qr.posthogErrorWrappingFunctions=Pc,Qr.parseErrorAsProperties=Nc;var Lc=(e,t)=>{if(e){var{sessionId:r,windowId:n}=e.checkAndGetSessionAndWindowId(!0);t.headers.set("X-POSTHOG-SESSION-ID",r),t.headers.set("X-POSTHOG-WINDOW-ID",n)}};Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{};var Dc={_patchFetch:e=>bo($r,"fetch",(t=>function(){var r=n((function*(r,n){var i=new Request(r,n);return Lc(e,i),t(i)}));return function(e,t){return r.apply(this,arguments)}}())),_patchXHR:e=>bo($r.XMLHttpRequest.prototype,"open",(t=>function(r,n){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,a=new Request(n);return Lc(e,a),t.call(this,r,a.url,i,o,s)}))};Qr.__PosthogExtensions__.tracingHeadersPatchFns=Dc,Qr.postHogTracingHeadersPatchFns=Dc;var Bc,qc,Hc,$c=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Wc=function(e){if("loading"===document.readyState)return"loading";var t=$c();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},Vc=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Zc=function(e,t){var r="";try{for(;e&&9!==e.nodeType;){var n=e,i=n.id?"#"+n.id:Vc(n)+(n.classList&&n.classList.value&&n.classList.value.trim()&&n.classList.value.trim().length?"."+n.classList.value.trim().replace(/\s+/g,"."):"");if(r.length+i.length>(t||100)-1)return r||i;if(r=r?i+">"+r:i,n.id)break;e=n.parentNode}}catch(e){}return r},Gc=-1,jc=function(){return Gc},Uc=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Gc=t.timeStamp,e(t))}),!0)},zc=function(){var e=$c();return e&&e.activationStart||0},Yc=function(e,t){var r=$c(),n="navigate";return jc()>=0?n="back-forward-cache":r&&(document.prerendering||zc()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},Xc=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(e){}},Jc=function(e,t,r,n){var i,o;return function(s){t.value>=0&&(s||n)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Kc=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Qc=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},eu=function(e){var t=!1;return function(){t||(e(),t=!0)}},tu=-1,ru=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},nu=function(e){"hidden"===document.visibilityState&&tu>-1&&(tu="visibilitychange"===e.type?e.timeStamp:0,ou())},iu=function(){addEventListener("visibilitychange",nu,!0),addEventListener("prerenderingchange",nu,!0)},ou=function(){removeEventListener("visibilitychange",nu,!0),removeEventListener("prerenderingchange",nu,!0)},su=function(){return tu<0&&(tu=ru(),iu(),Uc((function(){setTimeout((function(){tu=ru(),iu()}),0)}))),{get firstHiddenTime(){return tu}}},au=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},lu=[1800,3e3],cu=function(e,t){t=t||{},au((function(){var r,n=su(),i=Yc("FCP"),o=Xc("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-zc(),0),i.entries.push(e),r(!0)))}))}));o&&(r=Jc(e,i,lu,t.reportAllChanges),Uc((function(n){i=Yc("FCP"),r=Jc(e,i,lu,t.reportAllChanges),Kc((function(){i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},uu=[.1,.25],du=0,hu=1/0,pu=0,vu=function(e){e.forEach((function(e){e.interactionId&&(hu=Math.min(hu,e.interactionId),pu=Math.max(pu,e.interactionId),du=pu?(pu-hu)/7+1:0)}))},gu=function(){"interactionCount"in performance||Bc||(Bc=Xc("event",vu,{type:"event",buffered:!0,durationThreshold:0}))},fu=[],mu=new Map,_u=0,yu=function(){return(Bc?du:performance.interactionCount||0)-_u},bu=[],wu=function(e){if(bu.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=fu[fu.length-1],r=mu.get(e.interactionId);if(r||fu.length<10||e.duration>t.latency){if(r)e.duration>r.latency?(r.entries=[e],r.latency=e.duration):e.duration===r.latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e);else{var n={id:e.interactionId,latency:e.duration,entries:[e]};mu.set(n.id,n),fu.push(n)}fu.sort((function(e,t){return t.latency-e.latency})),fu.length>10&&fu.splice(10).forEach((function(e){return mu.delete(e.id)}))}}},Su=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=eu(e),"hidden"===document.visibilityState?e():(r=t(e),Qc(e)),r},Cu=[200,500],Iu=[],ku=[],Eu=new WeakMap,xu=new Map,Tu=-1,Mu=function(e){Iu=Iu.concat(e),Ru()},Ru=function(){Tu<0&&(Tu=Su(Au))},Au=function(){xu.size>10&&xu.forEach((function(e,t){mu.has(t)||xu.delete(t)}));var e=fu.map((function(e){return Eu.get(e.entries[0])})),t=ku.length-50;ku=ku.filter((function(r,n){return n>=t||e.includes(r)}));for(var r=new Set,n=0;n<ku.length;n++){var i=ku[n];Nu(i.startTime,i.processingEnd).forEach((function(e){r.add(e)}))}for(var o=0;o<50;o++){var s=Iu[Iu.length-1-o];if(!s||s.startTime<Hc)break;r.add(s)}Iu=Array.from(r),Tu=-1};bu.push((function(e){e.interactionId&&e.target&&!xu.has(e.interactionId)&&xu.set(e.interactionId,e.target)}),(function(e){var t,r=e.startTime+e.duration;Hc=Math.max(Hc,e.processingEnd);for(var n=ku.length-1;n>=0;n--){var i=ku[n];if(Math.abs(r-i.renderTime)<=8){(t=i).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:r,entries:[e]},ku.push(t)),(e.interactionId||"first-input"===e.entryType)&&Eu.set(e,t),Ru()}));var Nu=function(e,t){for(var r,n=[],i=0;r=Iu[i];i++)if(!(r.startTime+r.duration<e)){if(r.startTime>t)break;n.push(r)}return n},Fu=[2500,4e3],Ou={},Pu={onLCP:function(e,t){!function(e,t){t=t||{},au((function(){var r,n=su(),i=Yc("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-zc(),0),i.entries=[e],r())}))},s=Xc("largest-contentful-paint",o);if(s){r=Jc(e,i,Fu,t.reportAllChanges);var a=eu((function(){Ou[i.id]||(o(s.takeRecords()),s.disconnect(),Ou[i.id]=!0,r(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Su(a)}),!0)})),Qc(a),Uc((function(n){i=Yc("LCP"),r=Jc(e,i,Fu,t.reportAllChanges),Kc((function(){i.value=performance.now()-n.timeStamp,Ou[i.id]=!0,r(!0)}))}))}}))}((function(t){var r=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var r=$c();if(r){var n=r.activationStart||0,i=e.entries[e.entries.length-1],o=i.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===i.url}))[0],s=Math.max(0,r.responseStart-n),a=Math.max(s,o?(o.requestStart||o.startTime)-n:0),l=Math.max(a,o?o.responseEnd-n:0),c=Math.max(l,i.startTime-n);t={element:Zc(i.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:l-a,elementRenderDelay:c-l,navigationEntry:r,lcpEntry:i},i.url&&(t.url=i.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onCLS:function(e,t){!function(e,t){t=t||{},cu(eu((function(){var r,n=Yc("CLS",0),i=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],r=o[o.length-1];i&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>n.value&&(n.value=i,n.entries=o,r())},a=Xc("layout-shift",s);a&&(r=Jc(e,n,uu,t.reportAllChanges),Qc((function(){s(a.takeRecords()),r(!0)})),Uc((function(){i=0,n=Yc("CLS",0),r=Jc(e,n,uu,t.reportAllChanges),Kc((function(){return r()}))})),setTimeout(r,0))})))}((function(t){var r=function(e){var t,r={};if(e.entries.length){var n=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(n&&n.sources&&n.sources.length){var i=(t=n.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];i&&(r={largestShiftTarget:Zc(i.node),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:i,largestShiftEntry:n,loadState:Wc(n.startTime)})}}return Object.assign(e,{attribution:r})}(t);e(r)}),t)},onFCP:function(e,t){cu((function(t){var r=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:Wc(jc())};if(e.entries.length){var r=$c(),n=e.entries[e.entries.length-1];if(r){var i=r.activationStart||0,o=Math.max(0,r.responseStart-i);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:Wc(e.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onINP:function(e,t){qc||(qc=Xc("long-animation-frame",Mu)),function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},au((function(){var r;gu();var n,i=Yc("INP"),o=function(e){Su((function(){e.forEach(wu);var t,r=(t=Math.min(fu.length-1,Math.floor(yu()/50)),fu[t]);r&&r.latency!==i.value&&(i.value=r.latency,i.entries=r.entries,n())}))},s=Xc("event",o,{durationThreshold:null!==(r=t.durationThreshold)&&void 0!==r?r:40});n=Jc(e,i,Cu,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Qc((function(){o(s.takeRecords()),n(!0)})),Uc((function(){_u=0,fu.length=0,mu.clear(),i=Yc("INP"),n=Jc(e,i,Cu,t.reportAllChanges)})))})))}((function(t){var r=function(e){var t=e.entries[0],r=Eu.get(t),n=t.processingStart,i=r.processingEnd,o=r.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=Nu(t.startTime,i),a=e.entries.find((function(e){return e.target})),l=a&&a.target||xu.get(t.interactionId),c=[t.startTime+t.duration,i].concat(s.map((function(e){return e.startTime+e.duration}))),u=Math.max.apply(Math,c),d={interactionTarget:Zc(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:u,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:n-t.startTime,processingDuration:i-n,presentationDelay:Math.max(u-i,0),loadState:Wc(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(r)}),t)}};Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.postHogWebVitalsCallbacks=Pu,Qr.postHogWebVitalsCallbacks=Pu;class Lu{constructor(){this.clicks=[]}isRageClick(e,t,r){var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(t-n.y)<30&&r-n.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:r}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var Du=an("[AutoCapture]");function Bu(e,t){return t.length>e?t.slice(0,e)+"...":t}function qu(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Di(t));return t}function Hu(e,t,r,n){var i=e.tagName.toLowerCase(),o={tag_name:i};Ui.indexOf(i)>-1&&!r&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Bu(1024,oo(e)):o.$el_text=Bu(1024,Gi(e)));var s=Vi(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),un(e.attributes,(function(r){var i;if((!Ji(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==n||!n.includes(r.name))&&!t&&io(r.value)&&(i=r.name,!Dn(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){var s=r.value;"class"===r.name&&(s=$i(s).join(" ")),o["attr__"+r.name]=Bu(1024,s)}}));for(var a=1,l=1,c=e;c=qu(c);)a++,c.tagName===e.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function $u(e,t){for(var r,n,{e:i,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,c=[e],u=e;u.parentNode&&!Bi(u,"body");)Hi(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,h=[],p={},v=!1,g=!1;if(un(c,(e=>{var t=Xi(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&io(v)&&v),Sn(Vi(e),"ph-no-capture")&&(g=!0),h.push(Hu(e,o,s,a));var r=function(e){if(!Xi(e))return{};var t={};return un(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),n=e.value;r&&n&&io(n)&&(t[r]=n)}})),t}(e);dn(p,r)})),g)return{props:{},explicitNoCapture:g};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?h[0].$el_text=oo(e):h[0].$el_text=Gi(e)),v){var f,m;h[0].attr__href=v;var _=null===(f=zn(v))||void 0===f?void 0:f.host,y=null==$r||null===(m=$r.location)||void 0===m?void 0:m.host;_&&y&&_!==y&&(d=v)}return{props:dn({$event_type:i.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:ao(h)},null!==(r=h[0])&&void 0!==r&&r.$el_text?{$el_text:null===(n=h[0])||void 0===n?void 0:n.$el_text}:{},d&&"click"===i.type?{$external_click_url:d}:{},p)}}class Wu{constructor(e){i(this,"_initialized",!1),i(this,"_isDisabledServerSide",null),i(this,"rageclicks",new Lu),i(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,r=On(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null===(e=r.url_allowlist)||void 0===e?void 0:e.map((e=>new RegExp(e))),r.url_ignorelist=null===(t=r.url_ignorelist)||void 0===t?void 0:t.map((e=>new RegExp(e))),r}_addDomEventHandlers(){if(this.isBrowserSupported()){if($r&&Ur){var e=e=>{e=e||(null==$r?void 0:$r.event);try{this._captureEvent(e)}catch(e){Du.error("Failed to capture event",e)}};if(wn(Ur,"submit",e,{capture:!0}),wn(Ur,"change",e,{capture:!0}),wn(Ur,"click",e,{capture:!0}),this.config.capture_copied_text){var t=e=>{e=e||(null==$r?void 0:$r.event),this._captureEvent(e,en)};wn(Ur,"copy",t,{capture:!0}),wn(Ur,"cut",t,{capture:!0})}}}else Du.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ri]:!!e.autocapture_opt_out}),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this._elementSelectors=e}getElementSelectors(e){var t,r=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach((t=>{var n=null==Ur?void 0:Ur.querySelectorAll(t);null==n||n.forEach((n=>{e===n&&r.push(t)}))})),r}get isEnabled(){var e,t,r=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[ri],n=this._isDisabledServerSide;if(qn(n)&&!Wn(r)&&!this.instance.config.advanced_disable_decide)return!1;var i=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!i}_captureEvent(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(this.isEnabled){var r,n=ji(e);if(qi(n)&&(n=n.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!==(r=this.rageclicks)&&void 0!==r&&r.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var i=t===en;if(n&&Yi(n,e,this.config,i,i?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=$u(n,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsChainAsString});if(s)return!1;var a=this.getElementSelectors(n);if(a&&a.length>0&&(o.$element_selectors=a),t===en){var l,c=Zi(null==$r||null===(l=$r.getSelection())||void 0===l?void 0:l.toString()),u=e.type||"clipboard";if(!c)return!1;o.$selected_content=c,o.$copy_type=u}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return An(null==Ur?void 0:Ur.querySelectorAll)}}var Vu={};function Zu(e){return function(e,t){var r=Vu[e];if(r)return r;var n=t[e];if(Nn(n)&&!Fn())return Vu[e]=n.bind(t);var i=t.document;if(i&&An(i.createElement))try{var o=i.createElement("iframe");o.hidden=!0,i.head.appendChild(o);var s=o.contentWindow;s&&s[e]&&(n=s[e]),i.head.removeChild(o)}catch(t){sn.warn("Could not create sandbox iframe for ".concat(e," check, bailing to assignableWindow.").concat(e,": "),t)}return n&&An(n)?Vu[e]=n.bind(t):n}("MutationObserver",e)}function Gu(e,t){return $n(e)&&e>=t}class ju{asRequiredConfig(e){var t,r,n,i,o=this._defaultConfig((null==e?void 0:e.__onCapture)||this._captureDeadClick.bind(this));return{element_attribute_ignorelist:null!==(t=null==e?void 0:e.element_attribute_ignorelist)&&void 0!==t?t:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==e?void 0:e.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(n=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==n?n:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(i=null==e?void 0:e.mutation_threshold_ms)&&void 0!==i?i:o.mutation_threshold_ms,__onCapture:o.__onCapture}}constructor(e,t){i(this,"_clicks",[]),i(this,"_defaultConfig",(e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,__onCapture:e}))),i(this,"_onClick",(e=>{var t=function(e){var t=ji(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);qn(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&Ln(this._checkClickTimer)&&(this._checkClickTimer=Qr.setTimeout((()=>{this._checkClicks()}),1e3))})),i(this,"_onScroll",(()=>{var e=Date.now();e%50==0&&this._clicks.forEach((t=>{Ln(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))})),i(this,"_onSelectionChange",(()=>{this._lastSelectionChanged=Date.now()})),this.instance=e,this._config=this.asRequiredConfig(t),this._onCapture=this._config.__onCapture}start(e){this._startClickObserver(),this._startScrollObserver(),this._startSelectionChangedObserver(),this._startMutationObserver(e)}_startMutationObserver(e){if(!this._mutationObserver){var t=Zu(Qr);this._mutationObserver=new t((e=>{this.onMutation(e)})),this._mutationObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null===(e=this._mutationObserver)||void 0===e||e.disconnect(),this._mutationObserver=void 0,Qr.removeEventListener("click",this._onClick),Qr.removeEventListener("scroll",this._onScroll,{capture:!0}),Qr.removeEventListener("selectionchange",this._onSelectionChange)}onMutation(e){this._lastMutation=Date.now()}_startClickObserver(){wn(Qr,"click",this._onClick)}_startScrollObserver(){wn(Qr,"scroll",this._onScroll,{capture:!0})}_startSelectionChangedObserver(){wn(Qr,"selectionchange",this._onSelectionChange)}_ignoreClick(e){if(!e)return!0;if(Li(e.node))return!0;var t=this._clicks.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!t||!(!Bi(e.node,"html")&&Di(e.node)&&!Ui.includes(e.node.tagName.toLowerCase()))}_checkClicks(){if(this._clicks.length){clearTimeout(this._checkClickTimer),this._checkClickTimer=void 0;var e=this._clicks;for(var t of(this._clicks=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this._lastMutation&&t.timestamp<=this._lastMutation?this._lastMutation-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this._lastSelectionChanged&&t.timestamp<=this._lastSelectionChanged?this._lastSelectionChanged-t.timestamp:void 0;var n=Gu(t.scrollDelayMs,this._config.scroll_threshold_ms),i=Gu(t.selectionChangedDelayMs,this._config.selection_change_threshold_ms),o=Gu(t.mutationDelayMs,this._config.mutation_threshold_ms),s=Gu(t.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),a=$n(t.scrollDelayMs)&&t.scrollDelayMs<this._config.scroll_threshold_ms,l=$n(t.mutationDelayMs)&&t.mutationDelayMs<this._config.mutation_threshold_ms,c=$n(t.selectionChangedDelayMs)&&t.selectionChangedDelayMs<this._config.selection_change_threshold_ms;a||l||c||(n||o||s||i?this._onCapture(t,{$dead_click_last_mutation_timestamp:this._lastMutation,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:n,$dead_click_mutation_timeout:o,$dead_click_absolute_timeout:s,$dead_click_selection_changed_timeout:i}):t.absoluteDelayMs<this._config.mutation_threshold_ms&&this._clicks.push(t))}this._clicks.length&&Ln(this._checkClickTimer)&&(this._checkClickTimer=Qr.setTimeout((()=>{this._checkClicks()}),1e3))}}_captureDeadClick(e,r){this.instance.capture("$dead_click",t(t(t({},r),$u(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._config.element_attribute_ignorelist,elementsChainAsString:!1}).props),{},{$dead_click_scroll_delay_ms:e.scrollDelayMs,$dead_click_mutation_delay_ms:e.mutationDelayMs,$dead_click_absolute_delay_ms:e.absoluteDelayMs,$dead_click_selection_changed_delay_ms:e.selectionChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new ju(e,t);var Uu=an("[ExternalScriptsLoader]"),zu=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return Uu.warn("".concat(t," was requested but loading of external scripts is disabled.")),r("Loading of external scripts is disabled");var n=()=>{if(!Ur)return r("document not found");var n=Ur.createElement("script");if(n.type="text/javascript",n.crossOrigin="anonymous",n.src=t,n.onload=e=>r(void 0,e),n.onerror=e=>r(e),e.config.prepare_external_dependency_script&&(n=e.config.prepare_external_dependency_script(n)),!n)return r("prepare_external_dependency_script returned null");var i,o=Ur.querySelectorAll("body > script");o.length>0?null===(i=o[0].parentNode)||void 0===i||i.insertBefore(n,o[0]):Ur.body.appendChild(n)};null!=Ur&&Ur.body?n():null==Ur||Ur.addEventListener("DOMContentLoaded",n)};Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{var n="/static/".concat(t,".js")+"?v=".concat(e.version);if("remote-config"===t&&(n="/array/".concat(e.config.token,"/config.js")),"toolbar"===t){var i=3e5,o=Math.floor(Date.now()/i)*i;n="".concat(n,"&t=").concat(o)}var s=e.requestRouter.endpointFor("assets",n);zu(e,s,r)},Qr.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var n=e.requestRouter.endpointFor("api",t);zu(e,n,r)};var Yu=an("[FeatureFlags]"),Xu="$active_feature_flags",Ju="$override_feature_flags",Ku="$feature_flag_payloads",Qu="$override_feature_flag_payloads",ed=e=>{var t={};for(var[r,n]of pn(e||{}))n&&(t[r]=n);return t};class td{constructor(e){i(this,"_override_warning",!1),i(this,"_hasLoadedFlags",!1),i(this,"_requestInFlight",!1),i(this,"_reloadingDisabled",!1),i(this,"_additionalReloadRequested",!1),i(this,"_decideCalled",!1),i(this,"_flagsLoadedFromRemote",!1),this.instance=e,this.featureFlagEventHandlers=[]}decide(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var e=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:e})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){var e=this.instance.get_property(yi),t=this.instance.get_property(Ju);if(!t)return e||{};for(var r=dn({},e),n=Object.keys(t),i=0;i<n.length;i++)r[n[i]]=t[n[i]];return this._override_warning||(Yu.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){var e=this.instance.get_property(Ku),t=this.instance.get_property(Qu);if(!t)return e||{};for(var r=dn({},e||{}),n=Object.keys(t),i=0;i<n.length;i++)r[n[i]]=t[n[i]];return this._override_warning||(Yu.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this._override_warning=!0),r}reloadFeatureFlags(){this._reloadingDisabled||this.instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout((()=>{this._callDecideEndpoint()}),5))}clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this._reloadingDisabled=e}_callDecideEndpoint(e){if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:this.instance.get_property(wi),group_properties:this.instance.get_property(Si)};(null!=e&&e.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(t.disable_flags=!0),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:qr.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var r,n,i=!0;(200===e.statusCode&&(this.$anon_distinct_id=void 0,i=!1),this._requestInFlight=!1,this._decideCalled)||(this._decideCalled=!0,this.instance._onRemoteConfig(null!==(n=e.json)&&void 0!==n?n:{}));t.disable_flags||(this._flagsLoadedFromRemote=!i,this.receivedFeatureFlags(null!==(r=e.json)&&void 0!==r?r:{},i),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callDecideEndpoint()))}})}}getFeatureFlag(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r,n,i,o,s,a=this.getFlagVariants()[e],l="".concat(a),c=this.instance.get_property(ki)||{};if(t.send_event||!("send_event"in t))if(!(e in c)||!c[e].includes(l))Rn(c[e])?c[e].push(l):c[e]=[l],null===(r=this.instance.persistence)||void 0===r||r.register({[ki]:c}),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:a,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_bootstrapped_response:(null===(n=this.instance.config.bootstrap)||void 0===n||null===(i=n.featureFlags)||void 0===i?void 0:i[e])||null,$feature_flag_bootstrapped_payload:(null===(o=this.instance.config.bootstrap)||void 0===o||null===(s=o.featureFlagPayloads)||void 0===s?void 0:s[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote});return a}Yu.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}isFeatureEnabled(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Yu.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,r){if(this.instance.persistence){this._hasLoadedFlags=!0;var n=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,r){var n=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(Rn(o)){var a={};if(o)for(var l=0;l<o.length;l++)a[o[l]]=!0;r&&r.register({[Xu]:o,[yi]:a})}else{var c=o,u=s;e.errorsWhileComputingFlags&&(c=t(t({},n),c),u=t(t({},i),u)),r&&r.register({[Xu]:Object.keys(ed(c)),[yi]:c||{},[Ku]:u||{}})}}(e,this.instance.persistence,n,i),this._fireFeatureFlagsCallbacks(r)}}override(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Yu.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this.instance.__loaded||!this.instance.persistence)return Yu.uninitializedWarning("posthog.feature_flags.overrideFeatureFlags");if(!1===e)return this.instance.persistence.unregister(Ju),this.instance.persistence.unregister(Qu),void this._fireFeatureFlagsCallbacks();if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t,r=e;if(this._override_warning=Boolean(null!==(t=r.suppressWarning)&&void 0!==t&&t),"flags"in r)if(!1===r.flags)this.instance.persistence.unregister(Ju);else if(r.flags)if(Rn(r.flags)){for(var n={},i=0;i<r.flags.length;i++)n[r.flags[i]]=!0;this.instance.persistence.register({[Ju]:n})}else this.instance.persistence.register({[Ju]:r.flags});return"payloads"in r&&(!1===r.payloads?this.instance.persistence.unregister(Qu):r.payloads&&this.instance.persistence.register({[Qu]:r.payloads})),void this._fireFeatureFlagsCallbacks()}this._fireFeatureFlagsCallbacks()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this._hasLoadedFlags){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,r){var n,i=(this.instance.get_property(bi)||[]).find((t=>t.flagKey===e)),o={["$feature_enrollment/".concat(e)]:r},s={$feature_flag:e,$feature_enrollment:r,$set:o};i&&(s.$early_access_feature_name=i.name),this.instance.capture("$feature_enrollment_update",s),this.setPersonPropertiesForFlags(o,!1);var a=t(t({},this.getFlagVariants()),{},{[e]:r});null===(n=this.instance.persistence)||void 0===n||n.register({[Xu]:Object.keys(ed(a)),[yi]:a}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(bi);if(r&&!t)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:t=>{var r;if(t.json){var n=t.json.earlyAccessFeatures;return null===(r=this.instance.persistence)||void 0===r||r.register({[bi]:n}),e(n)}}})}_prepareFeatureFlagsForCallbacks(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,r)=>(e[r]=t[r],e)),{})}}_fireFeatureFlagsCallbacks(e){var{flags:t,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach((n=>n(t,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(wi)||{};this.instance.register({[wi]:t(t({},n),e)}),r&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(wi)}setGroupPropertiesForFlags(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(Si)||{};0!==Object.keys(n).length&&Object.keys(n).forEach((r=>{n[r]=t(t({},n[r]),e[r]),delete e[r]})),this.instance.register({[Si]:t(t({},n),e)}),r&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var r=this.instance.get_property(Si)||{};this.instance.register({[Si]:t(t({},r),{},{[e]:{}})})}else this.instance.unregister(Si)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return $n(e)&&isFinite(e)&&Math.floor(e)===e});var rd="0123456789abcdef";class nd{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||e<0||t<0||r<0||n<0||e>0xffffffffffff||t>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|t>>>8,i[7]=t,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=n>>>24,i[13]=n>>>16,i[14]=n>>>8,i[15]=n,new nd(i)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+rd.charAt(this.bytes[t]>>>4)+rd.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}clone(){return new nd(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class id{constructor(){i(this,"timestamp",0),i(this,"counter",0),i(this,"random",new ad)}generate(){var e=this.generateOrAbort();if(Ln(e)){this.timestamp=0;var t=this.generateOrAbort();if(Ln(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){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 nd.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}var od,sd=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};$r&&!Ln($r.crypto)&&crypto.getRandomValues&&(sd=e=>crypto.getRandomValues(e));class ad{constructor(){i(this,"buffer",new Uint32Array(8)),i(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(sd(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}var ld=()=>cd().toString(),cd=()=>(od||(od=new id)).generate(),ud="Thu, 01 Jan 1970 00:00:00 GMT",dd="";var hd=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function pd(e,t){if(t){var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ur;if(dd)return dd;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),n=Math.min(r.length,8),i="dmn_chk_"+ld(),o=new RegExp("(^|;)\\s*"+i+"=1");!dd&&n--;){var s=r.slice(n).join("."),a=i+"=1;domain=."+s;t.cookie=a,o.test(t.cookie)&&(t.cookie=a+";expires="+ud,dd=s)}return dd}(e);if(!r){var n=(e=>{var t=e.match(hd);return t?t[0]:""})(e);n!==r&&sn.info("Warning: cookie subdomain discovery mismatch",n,r),r=n}return r?"; domain=."+r:""}return""}var vd={is_supported:()=>!!Ur,error:function(e){sn.error("cookieStore error: "+e)},get:function(e){if(Ur){try{for(var t=e+"=",r=Ur.cookie.split(";").filter((e=>e.length)),n=0;n<r.length;n++){for(var i=r[n];" "==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(vd.get(e))||{}}catch(e){}return t},set:function(e,t,r,n,i){if(Ur)try{var o="",s="",a=pd(Ur.location.hostname,n);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),o="; expires="+l.toUTCString()}i&&(s="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+a+s;return c.length>3686.4&&sn.warn("cookieStore warning: large cookie, len="+c.length),Ur.cookie=c,c}catch(e){return}},remove:function(e,t){try{vd.set(e,"",-1,t)}catch(e){return}}},gd=null,fd={is_supported:function(){if(!qn(gd))return gd;var e=!0;if(Ln($r))e=!1;else try{var t="__mplssupport__";fd.set(t,"xyz"),'"xyz"'!==fd.get(t)&&(e=!1),fd.remove(t)}catch(t){e=!1}return e||sn.error("localStorage unsupported; falling back to cookie store"),gd=e,e},error:function(e){sn.error("localStorage error: "+e)},get:function(e){try{return null==$r?void 0:$r.localStorage.getItem(e)}catch(e){fd.error(e)}return null},parse:function(e){try{return JSON.parse(fd.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==$r||$r.localStorage.setItem(e,JSON.stringify(t))}catch(e){fd.error(e)}},remove:function(e){try{null==$r||$r.localStorage.removeItem(e)}catch(e){fd.error(e)}}},md=["distinct_id",gi,fi,Ni,Ai],_d=t(t({},fd),{},{parse:function(e){try{var t={};try{t=vd.parse(e)||{}}catch(e){}var r=dn(t,JSON.parse(fd.get(e)||"{}"));return fd.set(e,r),r}catch(e){}return null},set:function(e,t,r,n,i,o){try{fd.set(e,t,void 0,void 0,o);var s={};md.forEach((e=>{t[e]&&(s[e]=t[e])})),Object.keys(s).length&&vd.set(e,s,r,n,i,o)}catch(e){fd.error(e)}},remove:function(e,t){try{null==$r||$r.localStorage.removeItem(e),vd.remove(e,t)}catch(e){fd.error(e)}}}),yd={},bd={is_supported:function(){return!0},error:function(e){sn.error("memoryStorage error: "+e)},get:function(e){return yd[e]||null},parse:function(e){return yd[e]||null},set:function(e,t){yd[e]=t},remove:function(e){delete yd[e]}},wd=null,Sd={is_supported:function(){if(!qn(wd))return wd;if(wd=!0,Ln($r))wd=!1;else try{var e="__support__";Sd.set(e,"xyz"),'"xyz"'!==Sd.get(e)&&(wd=!1),Sd.remove(e)}catch(e){wd=!1}return wd},error:function(e){sn.error("sessionStorage error: ",e)},get:function(e){try{return null==$r?void 0:$r.sessionStorage.getItem(e)}catch(e){Sd.error(e)}return null},parse:function(e){try{return JSON.parse(Sd.get(e))||null}catch(e){}return null},set:function(e,t){try{null==$r||$r.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Sd.error(e)}},remove:function(e){try{null==$r||$r.sessionStorage.removeItem(e)}catch(e){Sd.error(e)}}},Cd=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Id{constructor(e){this.config=e,this.props={},this.campaign_params_saved=!1,this.name=(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"})(e),this.storage=this.buildStorage(e),this.load(),e.debug&&sn.info("Persistence loaded",e.persistence,t({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){-1===Cd.indexOf(e.persistence.toLowerCase())&&(sn.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&fd.is_supported()?fd:"localstorage+cookie"===t&&_d.is_supported()?_d:"sessionstorage"===t&&Sd.is_supported()?Sd:"memory"===t?bd:"cookie"===t?vd:_d.is_supported()?_d:vd}properties(){var e={};return un(this.props,(function(t,r){if(r===yi&&On(t))for(var n=Object.keys(t),i=0;i<n.length;i++)e["$feature/".concat(n[i])]=t[n[i]];else s=r,a=!1,(qn(o=Pi)?a:Gr&&o.indexOf===Gr?-1!=o.indexOf(s):(un(o,(function(e){if(a||(a=e===s))return ln})),a))||(e[r]=t);var o,s,a})),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=dn({},e))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(e,t,r){if(On(e)){Ln(t)&&(t="None"),this.expire_days=Ln(r)?this.default_expiry:r;var n=!1;if(un(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.props[r]=e,n=!0)})),n)return this.save(),!0}return!1}register(e,t){if(On(e)){this.expire_days=Ln(t)?this.default_expiry:t;var r=!1;if(un(e,((t,n)=>{e.hasOwnProperty(n)&&this.props[n]!==t&&(this.props[n]=t,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var e=Za.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});Pn(fn(e))||this.register(e),this.campaign_params_saved=!0}}update_search_keyword(){this.register(Za.searchInfo())}update_referrer_info(){this.register_once(Za.referrerInfo(),void 0)}set_initial_person_info(){this.props[Mi]||this.props[Ri]||this.register_once({[Ai]:Za.initialPersonInfo()},void 0)}get_referrer_info(){return fn({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};un([Ri,Mi],(t=>{var r=this.props[t];r&&un(r,(function(t,r){e["$initial_"+In(r)]=t}))}));var t=this.props[Ai];if(t){var r=Za.initialPersonPropsFromInfo(t);dn(e,r)}return e}safe_merge(e){return un(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(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 r=this.buildStorage(e),n=this.props;this.clear(),this.storage=r,this.props=n,this.save()}}set_disabled(e){this.disabled=e,this.disabled?this.remove():this.save()}set_cross_subdomain(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}set_event_timer(e,t){var r=this.props[ti]||{};r[e]=t,this.props[ti]=r,this.save()}remove_event_timer(e){var t=(this.props[ti]||{})[e];return Ln(t)||(delete this.props[ti][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}function kd(e){var t,r;return(null===(t=JSON.stringify(e,(r=[],function(e,t){if(On(t)){for(;r.length>0&&r[r.length-1]!==this;)r.pop();return r.includes(t)?"[Circular]":(r.push(t),t)}return t})))||void 0===t?void 0:t.length)||0}function Ed(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(e.size>=t&&e.data.length>1){var r=Math.floor(e.data.length/2),n=e.data.slice(0,r),i=e.data.slice(r);return[Ed({size:kd(n),data:n,sessionId:e.sessionId,windowId:e.windowId}),Ed({size:kd(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var xd=(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",e))(xd||{}),Td=(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",e[e.CustomElement=16]="CustomElement",e))(Td||{});function Md(e,t,r,n,i){return t>r&&(sn.warn("min cannot be greater than max."),t=r),$n(e)?e>r?(n&&sn.warn(n+" cannot be greater than max: "+r+". Using max value instead."),r):e<t?(n&&sn.warn(n+" cannot be less than min: "+t+". Using min value instead."),t):e:(n&&sn.warn(n+" must be a number. using max or fallback. max: "+r+", fallback: "+i),Md(i||r,t,r,n))}class Rd{constructor(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(this,"bucketSize",100),i(this,"refillRate",10),i(this,"mutationBuckets",{}),i(this,"loggedTracker",{}),i(this,"refillBuckets",(()=>{Object.keys(this.mutationBuckets).forEach((e=>{this.mutationBuckets[e]=this.mutationBuckets[e]+this.refillRate,this.mutationBuckets[e]>=this.bucketSize&&delete this.mutationBuckets[e]}))})),i(this,"getNodeOrRelevantParent",(e=>{var t=this.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var r=t.closest("svg");if(r)return[this.rrweb.mirror.getId(r),r]}return[e,t]})),i(this,"numberOfChanges",(e=>{var t,r,n,i,o,s,a,l;return(null!==(t=null===(r=e.removes)||void 0===r?void 0:r.length)&&void 0!==t?t:0)+(null!==(n=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==n?n:0)+(null!==(o=null===(s=e.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(l=e.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)})),i(this,"throttleMutations",(e=>{if(3!==e.type||0!==e.data.source)return e;var t=e.data,r=this.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((e=>{var t,r,n,[i,o]=this.getNodeOrRelevantParent(e.id);if(0===this.mutationBuckets[i])return!1;(this.mutationBuckets[i]=null!==(t=this.mutationBuckets[i])&&void 0!==t?t:this.bucketSize,this.mutationBuckets[i]=Math.max(this.mutationBuckets[i]-1,0),0===this.mutationBuckets[i])&&(this.loggedTracker[i]||(this.loggedTracker[i]=!0,null===(r=(n=this.options).onBlockedNode)||void 0===r||r.call(n,i,o)));return e})));var n=this.numberOfChanges(t);return 0!==n||r===n?e:void 0})),this.rrweb=e,this.options=n,this.refillRate=Md(null!==(t=this.options.refillRate)&&void 0!==t?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=Md(null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval((()=>{this.refillBuckets()}),1e3)}}var Ad=Uint8Array,Nd=Uint16Array,Fd=Uint32Array,Od=new Ad([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]),Pd=new Ad([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]),Ld=new Ad([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Dd=function(e,t){for(var r=new Nd(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new Fd(r[30]);for(n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return[r,i]},Bd=Dd(Od,2),qd=Bd[0],Hd=Bd[1];qd[28]=258,Hd[258]=28;for(var $d=Dd(Pd,0)[1],Wd=new Nd(32768),Vd=0;Vd<32768;++Vd){var Zd=(43690&Vd)>>>1|(21845&Vd)<<1;Zd=(61680&(Zd=(52428&Zd)>>>2|(13107&Zd)<<2))>>>4|(3855&Zd)<<4,Wd[Vd]=((65280&Zd)>>>8|(255&Zd)<<8)>>>1}var Gd=function(e,t,r){for(var n=e.length,i=0,o=new Nd(t);i<n;++i)++o[e[i]-1];var s,a=new Nd(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new Nd(1<<t);var l=15-t;for(i=0;i<n;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],d=a[e[i]-1]++<<u,h=d|(1<<u)-1;d<=h;++d)s[Wd[d]>>>l]=c}else for(s=new Nd(n),i=0;i<n;++i)s[i]=Wd[a[e[i]-1]++]>>>15-e[i];return s},jd=new Ad(288);for(Vd=0;Vd<144;++Vd)jd[Vd]=8;for(Vd=144;Vd<256;++Vd)jd[Vd]=9;for(Vd=256;Vd<280;++Vd)jd[Vd]=7;for(Vd=280;Vd<288;++Vd)jd[Vd]=8;var Ud=new Ad(32);for(Vd=0;Vd<32;++Vd)Ud[Vd]=5;var zd=Gd(jd,9,0),Yd=Gd(Ud,5,0),Xd=function(e){return(e/8>>0)+(7&e&&1)},Jd=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof Nd?Nd:e instanceof Fd?Fd:Ad)(r-t);return n.set(e.subarray(t,r)),n},Kd=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},Qd=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},eh=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,o=r.slice();if(!i)return[new Ad(0),0];if(1==i){var s=new Ad(r[0].s+1);return s[r[0].s]=1,[s,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],c=0,u=1,d=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=r[r[c].f<r[d].f?c++:d++],l=r[c!=u&&r[c].f<r[d].f?c++:d++],r[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=o[0].s;for(n=1;n<i;++n)o[n].s>h&&(h=o[n].s);var p=new Nd(h+1),v=th(r[u-1],p,0);if(v>t){n=0;var g=0,f=v-t,m=1<<f;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));n<i;++n){var _=o[n].s;if(!(p[_]>t))break;g+=m-(1<<v-p[_]),p[_]=t}for(g>>>=f;g>0;){var y=o[n].s;p[y]<t?g-=1<<t-p[y]++-1:++n}for(;n>=0&&g;--n){var b=o[n].s;p[b]==t&&(--p[b],++g)}v=t}return[new Ad(p),v]},th=function(e,t,r){return-1==e.s?Math.max(th(e.l,t,r+1),th(e.r,t,r+1)):t[e.s]=r},rh=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Nd(++t),n=0,i=e[0],o=1,s=function(e){r[n++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[r.subarray(0,n),t]},nh=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},ih=function(e,t,r){var n=r.length,i=Xd(t+2);e[i]=255&n,e[i+1]=n>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<n;++o)e[i+o+4]=r[o];return 8*(i+4+n)},oh=function(e,t,r,n,i,o,s,a,l,c,u){Kd(t,u++,r),++i[256];for(var d=eh(i,15),h=d[0],p=d[1],v=eh(o,15),g=v[0],f=v[1],m=rh(h),_=m[0],y=m[1],b=rh(g),w=b[0],S=b[1],C=new Nd(19),I=0;I<_.length;++I)C[31&_[I]]++;for(I=0;I<w.length;++I)C[31&w[I]]++;for(var k=eh(C,7),E=k[0],x=k[1],T=19;T>4&&!E[Ld[T-1]];--T);var M,R,A,N,F=c+5<<3,O=nh(i,jd)+nh(o,Ud)+s,P=nh(i,h)+nh(o,g)+s+14+3*T+nh(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(F<=O&&F<=P)return ih(t,u,e.subarray(l,l+c));if(Kd(t,u,1+(P<O)),u+=2,P<O){M=Gd(h,p,0),R=h,A=Gd(g,f,0),N=g;var L=Gd(E,x,0);Kd(t,u,y-257),Kd(t,u+5,S-1),Kd(t,u+10,T-4),u+=14;for(I=0;I<T;++I)Kd(t,u+3*I,E[Ld[I]]);u+=3*T;for(var D=[_,w],B=0;B<2;++B){var q=D[B];for(I=0;I<q.length;++I){var H=31&q[I];Kd(t,u,L[H]),u+=E[H],H>15&&(Kd(t,u,q[I]>>>5&127),u+=q[I]>>>12)}}}else M=zd,R=jd,A=Yd,N=Ud;for(I=0;I<a;++I)if(n[I]>255){H=n[I]>>>18&31;Qd(t,u,M[H+257]),u+=R[H+257],H>7&&(Kd(t,u,n[I]>>>23&31),u+=Od[H]);var $=31&n[I];Qd(t,u,A[$]),u+=N[$],$>3&&(Qd(t,u,n[I]>>>5&8191),u+=Pd[$])}else Qd(t,u,M[n[I]]),u+=R[n[I]];return Qd(t,u,M[256]),u+R[256]},sh=new Fd([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ah=function(){for(var e=new Fd(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),lh=function(){var e=4294967295;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=ah[255&r^t[n]]^r>>>8;e=r},d:function(){return 4294967295^e}}},ch=function(e,t,r,n,i){return function(e,t,r,n,i,o){var s=e.length,a=new Ad(n+s+5*(1+Math.floor(s/7e3))+i),l=a.subarray(n,a.length-i),c=0;if(!t||s<8)for(var u=0;u<=s;u+=65535){var d=u+65535;d<s?c=ih(l,c,e.subarray(u,d)):(l[u]=o,c=ih(l,c,e.subarray(u,s)))}else{for(var h=sh[t-1],p=h>>>13,v=8191&h,g=(1<<r)-1,f=new Nd(32768),m=new Nd(g+1),_=Math.ceil(r/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&g},w=new Fd(25e3),S=new Nd(288),C=new Nd(32),I=0,k=0,E=(u=0,0),x=0,T=0;u<s;++u){var M=b(u),R=32767&u,A=m[M];if(f[R]=A,m[M]=R,x<=u){var N=s-u;if((I>7e3||E>24576)&&N>423){c=oh(e,l,0,w,S,C,k,E,T,u-T,c),E=I=k=0,T=u;for(var F=0;F<286;++F)S[F]=0;for(F=0;F<30;++F)C[F]=0}var O=2,P=0,L=v,D=R-A&32767;if(N>2&&M==b(u-D))for(var B=Math.min(p,N)-1,q=Math.min(32767,u),H=Math.min(258,N);D<=q&&--L&&R!=A;){if(e[u+O]==e[u+O-D]){for(var $=0;$<H&&e[u+$]==e[u+$-D];++$);if($>O){if(O=$,P=D,$>B)break;var W=Math.min(D,$-2),V=0;for(F=0;F<W;++F){var Z=u-D+F+32768&32767,G=Z-f[Z]+32768&32767;G>V&&(V=G,A=Z)}}}D+=(R=A)-(A=f[R])+32768&32767}if(P){w[E++]=268435456|Hd[O]<<18|$d[P];var j=31&Hd[O],U=31&$d[P];k+=Od[j]+Pd[U],++S[257+j],++C[U],x=u+O,++I}else w[E++]=e[u],++S[e[u]]}}c=oh(e,l,o,w,S,C,k,E,T,u-T,c)}return Jd(a,0,n+Xd(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,r,n,!i)},uh=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},dh=function(e,t){var r=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&&uh(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}},hh=function(e){return 10+(e.filename&&e.filename.length+1||0)};function ph(e,t){void 0===t&&(t={});var r=lh(),n=e.length;r.p(e);var i=ch(e,t,hh(t),8),o=i.length;return dh(i,t),uh(i,o-8,r.d()),uh(i,o-4,n),i}function vh(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Ad(e.length+(e.length>>>1)),i=0,o=function(e){n[i++]=e},s=0;s<r;++s){if(i+5>n.length){var a=new Ad(i+8+(r-s<<1));a.set(n),n=a}var l=e.charCodeAt(s);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++s))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return Jd(n,0,i)}function gh(e,t){return function(e){for(var t=0,r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)}(e)%100<Md(100*t,0,100)}var fh="[SessionRecording]",mh=an(fh),_h=3e5,yh=[Td.MouseMove,Td.MouseInteraction,Td.Scroll,Td.ViewportResize,Td.Input,Td.TouchMove,Td.MediaInteraction,Td.Drag],bh=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function wh(e){return function(e,t){for(var r="",n=0;n<e.length;){var i=e[n++];i<128||t?r+=String.fromCharCode(i):i<224?r+=String.fromCharCode((31&i)<<6|63&e[n++]):i<240?r+=String.fromCharCode((15&i)<<12|(63&e[n++])<<6|63&e[n++]):(i=((15&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}return r}(ph(vh(JSON.stringify(e))),!0)}function Sh(e){return e.type===xd.Custom&&"sessionIdle"===e.data.tag}function Ch(e,t){return t.some((t=>"regex"===t.matching&&new RegExp(t.url).test(e)))}class Ih{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var e,t;return null==Qr||null===(e=Qr.__PosthogExtensions__)||void 0===e||null===(t=e.rrweb)||void 0===t?void 0:t.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(fh+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var e,t;return"trigger_pending"===this.triggerStatus?6e4:null!==(e=null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.full_snapshot_interval_millis)&&void 0!==e?e:_h}get isSampled(){var e=this.instance.get_property(fi);return Wn(e)?e:null}get sessionDuration(){var e,t,r=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],{sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-n:null}get isRecordingEnabled(){var e=!!this.instance.get_property(li),t=!this.instance.config.disable_session_recording;return $r&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(ci),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}get canvasRecording(){var e,t,r,n,i,o,s=this.instance.config.session_recording.captureCanvas,a=this.instance.get_property(di),l=null!==(e=null!==(t=null==s?void 0:s.recordCanvas)&&void 0!==t?t:null==a?void 0:a.enabled)&&void 0!==e&&e,c=null!==(r=null!==(n=null==s?void 0:s.canvasFps)&&void 0!==n?n:null==a?void 0:a.fps)&&void 0!==r?r:4,u=null!==(i=null!==(o=null==s?void 0:s.canvasQuality)&&void 0!==o?o:null==a?void 0:a.quality)&&void 0!==i?i:.4;if("string"==typeof u){var d=parseFloat(u);u=isNaN(d)?.4:d}return{enabled:l,fps:Md(c,0,12,"canvas recording fps",4),quality:Md(u,0,1,"canvas recording quality",.4)}}get networkPayloadCapture(){var e,t,r=this.instance.get_property(ui),n={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==n?void 0:n.recordHeaders)||(null==r?void 0:r.recordHeaders),o=(null==n?void 0:n.recordBody)||(null==r?void 0:r.recordBody),s=On(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(Wn(s)?s:null==r?void 0:r.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}get sampleRate(){var e=this.instance.get_property(hi);return $n(e)?e:null}get minimumDuration(){var e=this.instance.get_property(pi);return $n(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?!1===this.isSampled?"disabled":this._urlBlocked?"paused":Hn(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.triggerStatus?"buffering":Wn(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var e;return 0===this._urlTriggers.length?"trigger_disabled":(null===(e=this.instance)||void 0===e?void 0:e.get_property(mi))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var e;return 0===this._eventTriggers.length?"trigger_disabled":(null===(e=this.instance)||void 0===e?void 0:e.get_property(_i))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var e="trigger_activated"===this.eventTriggerStatus||"trigger_activated"===this.urlTriggerStatus,t="trigger_pending"===this.eventTriggerStatus||"trigger_pending"===this.urlTriggerStatus;return e?"trigger_activated":t?"trigger_pending":"trigger_disabled"}constructor(e){if(i(this,"queuedRRWebEvents",[]),i(this,"isIdle",!1),i(this,"_linkedFlagSeen",!1),i(this,"_lastActivityTimestamp",Date.now()),i(this,"_linkedFlag",null),i(this,"_removePageViewCaptureHook",void 0),i(this,"_onSessionIdListener",void 0),i(this,"_persistDecideOnSessionListener",void 0),i(this,"_samplingSessionListener",void 0),i(this,"_urlTriggers",[]),i(this,"_urlBlocklist",[]),i(this,"_urlBlocked",!1),i(this,"_eventTriggers",[]),i(this,"_removeEventTriggerCaptureHook",void 0),i(this,"_forceAllowLocalhostNetworkCapture",!1),i(this,"_onBeforeUnload",(()=>{this._flushBuffer()})),i(this,"_onOffline",(()=>{this._tryAddCustomEvent("browser offline",{})})),i(this,"_onOnline",(()=>{this._tryAddCustomEvent("browser online",{})})),i(this,"_onVisibilityChange",(()=>{if(null!=Ur&&Ur.visibilityState){var e="window "+Ur.visibilityState;this._tryAddCustomEvent(e,{})}})),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw mh.error("started without valid sessionManager"),new Error(fh+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(fh+" cannot be used with __preview_experimental_cookieless_mode.");var{sessionId:t,windowId:r}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=t,this.windowId=r,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&mh.warn("session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as idle"))}startIfEnabledOrStop(e){this.isRecordingEnabled?(this._startCapture(e),wn($r,"beforeunload",this._onBeforeUnload),wn($r,"offline",this._onOffline),wn($r,"online",this._onOnline),wn($r,"visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),Hn(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",(e=>{try{if("$pageview"===e.event){var t=null!=e&&e.properties.$current_url?this._maskUrl(null==e?void 0:e.properties.$current_url):"";if(!t)return;this._tryAddCustomEvent("$pageview",{href:t})}}catch(e){mh.error("Could not add $pageview to rrweb session",e)}}))),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId(((e,t,r)=>{var n,i,o,s;r&&(this._tryAddCustomEvent("$session_id_change",{sessionId:e,windowId:t,changeReason:r}),null===(n=this.instance)||void 0===n||null===(i=n.persistence)||void 0===i||i.unregister(_i),null===(o=this.instance)||void 0===o||null===(s=o.persistence)||void 0===s||s.unregister(mi))})))):this.stopRecording()}stopRecording(){var e,t,r,n;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==$r||$r.removeEventListener("beforeunload",this._onBeforeUnload),null==$r||$r.removeEventListener("offline",this._onOffline),null==$r||$r.removeEventListener("online",this._onOnline),null==$r||$r.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),null===(e=this._removePageViewCaptureHook)||void 0===e||e.call(this),this._removePageViewCaptureHook=void 0,null===(t=this._removeEventTriggerCaptureHook)||void 0===t||t.call(this),this._removeEventTriggerCaptureHook=void 0,null===(r=this._onSessionIdListener)||void 0===r||r.call(this),this._onSessionIdListener=void 0,null===(n=this._samplingSessionListener)||void 0===n||n.call(this),this._samplingSessionListener=void 0,mh.info("stopped"))}makeSamplingDecision(e){var t,r=this.sessionId!==e,n=this.sampleRate;if($n(n)){var i=this.isSampled,o=r||!Wn(i),s=o?gh(e,n):i;o&&(s?this._reportStarted("sampled"):mh.warn("Sample rate (".concat(n,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:n,isSampled:s})),null===(t=this.instance.persistence)||void 0===t||t.register({[fi]:s})}else{var a;null===(a=this.instance.persistence)||void 0===a||a.register({[fi]:null})}}onRemoteConfig(e){var t,r,n,i,o,s;(this._tryAddCustomEvent("$remote_config_received",e),this._persistRemoteConfig(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(r=e.sessionRecording)&&void 0!==r&&r.endpoint)&&(this._endpoint=null===(s=e.sessionRecording)||void 0===s?void 0:s.endpoint);if(this._setupSampling(),!Hn(this._linkedFlag)&&!this._linkedFlagSeen){var a=Dn(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,l=Dn(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(((e,t)=>{var r=On(t)&&a in t,n=l?t[a]===l:r;n&&this._reportStarted("linked_flag_matched",{linkedFlag:a,linkedVariant:l}),this._linkedFlagSeen=n}))}null!==(n=e.sessionRecording)&&void 0!==n&&n.urlTriggers&&(this._urlTriggers=e.sessionRecording.urlTriggers),null!==(i=e.sessionRecording)&&void 0!==i&&i.urlBlocklist&&(this._urlBlocklist=e.sessionRecording.urlBlocklist),null!==(o=e.sessionRecording)&&void 0!==o&&o.eventTriggers&&(this._eventTriggers=e.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){$n(this.sampleRate)&&Hn(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((e=>{this.makeSamplingDecision(e)})))}_persistRemoteConfig(e){if(this.instance.persistence){var r,n=this.instance.persistence,i=()=>{var r,i,o,s,a,l,c,u,d=null===(r=e.sessionRecording)||void 0===r?void 0:r.sampleRate,h=Hn(d)?null:parseFloat(d),p=null===(i=e.sessionRecording)||void 0===i?void 0:i.minimumDurationMilliseconds;n.register({[li]:!!e.sessionRecording,[ci]:null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled,[ui]:t({capturePerformance:e.capturePerformance},null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture),[di]:{enabled:null===(a=e.sessionRecording)||void 0===a?void 0:a.recordCanvas,fps:null===(l=e.sessionRecording)||void 0===l?void 0:l.canvasFps,quality:null===(c=e.sessionRecording)||void 0===c?void 0:c.canvasQuality},[hi]:h,[pi]:Ln(p)?null:p,[vi]:null===(u=e.sessionRecording)||void 0===u?void 0:u.scriptConfig})};i(),null===(r=this._persistDecideOnSessionListener)||void 0===r||r.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(i)}}log(e){var t,r=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:r,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}_startCapture(e){if(!Ln(Object.assign)&&!Ln(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,r;if(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord)this._onScriptLoaded();else null===(t=Qr.__PosthogExtensions__)||void 0===t||null===(r=t.loadExternalDependency)||void 0===r||r.call(t,this.instance,this.scriptName,(e=>{if(e)return mh.error("could not load recorder",e);this._onScriptLoaded()}));mh.info("starting"),"active"===this.status&&this._reportStarted(e||"recording_initialized")}}get scriptName(){var e,t,r;return(null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t||null===(r=t.get_property(vi))||void 0===r?void 0:r.script)||"recorder"}isInteractiveEvent(e){var t;return 3===e.type&&-1!==yh.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}_updateWindowAndSessionIds(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var r=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!0)),!this.isIdle){var{windowId:n,sessionId:i}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this.sessionId!==i,s=this.windowId!==n;this.windowId=n,this.sessionId=i,o||s?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):r&&this._scheduleFullSnapshot()}}_tryRRWebMethod(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}):mh.warn("could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(bh((()=>this.rrwebRecord.addCustomEvent(e,t))))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(bh((()=>this.rrwebRecord.takeFullSnapshot())))}_onScriptLoaded(){var e,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},n=this.instance.config.session_recording;for(var[i,o]of Object.entries(n||{}))i in r&&("maskInputOptions"===i?r.maskInputOptions=t({password:!0},o):r[i]=o);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 Rd(this.rrwebRecord,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(e,t)=>{var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");mh.info(r,{node:t}),this.log(fh+" "+r,"warn")}});var s=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(t({emit:e=>{this.onRRwebEmit(e)},plugins:s},r)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:r,activePlugins:s.map((e=>null==e?void 0:e.name))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else mh.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var e=this.fullSnapshotIntervalMillis;e&&(this._fullSnapshotTimer=setInterval((()=>{this._tryTakeFullSnapshot()}),e))}}_gatherRRWebPlugins(){var e,t,r,n,i=[],o=null===(e=Qr.__PosthogExtensions__)||void 0===e||null===(t=e.rrwebPlugins)||void 0===t?void 0:t.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&i.push(o());var s=null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.rrwebPlugins)||void 0===n?void 0:n.getRecordNetworkPlugin;this.networkPayloadCapture&&An(s)&&(!Un.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(s(yo(this.instance.config,this.networkPayloadCapture))):mh.info("NetworkCapture not started because we are on localhost."));return i}onRRwebEmit(e){var r;if(this._processQueuedEvents(),e&&On(e)){if(e.type===xd.Meta){var n=this._maskUrl(e.data.href);if(this._lastHref=n,!n)return;e.data.href=n}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),!this._urlBlocked||function(e){return e.type===xd.Custom&&"recording paused"===e.data.tag}(e)){e.type===xd.FullSnapshot&&this._scheduleFullSnapshot(),e.type===xd.FullSnapshot&&"trigger_pending"===this.triggerStatus&&this.clearBuffer();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var o=function(e){var t=e;if(t&&On(t)&&6===t.type&&On(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 r=[],n=0;n<t.data.payload.payload.length;n++)t.data.payload.payload[n]&&t.data.payload.payload[n].length>2e3?r.push(t.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):r.push(t.data.payload.payload[n]);return t.data.payload.payload=r,e}return e}(i);if(this._updateWindowAndSessionIds(o),!this.isIdle||Sh(o)){if(Sh(o)){var s=o.data.payload;if(s){var a=s.lastActivityTimestamp,l=s.threshold;o.timestamp=a+l}}var c=null===(r=this.instance.config.session_recording.compress_events)||void 0===r||r?function(e){if(kd(e)<1024)return e;try{if(e.type===xd.FullSnapshot)return t(t({},e),{},{data:wh(e.data),cv:"2024-10"});if(e.type===xd.IncrementalSnapshot&&e.data.source===Td.Mutation)return t(t({},e),{},{cv:"2024-10",data:t(t({},e.data),{},{texts:wh(e.data.texts),attributes:wh(e.data.attributes),removes:wh(e.data.removes),adds:wh(e.data.adds)})});if(e.type===xd.IncrementalSnapshot&&e.data.source===Td.StyleSheetRule)return t(t({},e),{},{cv:"2024-10",data:t(t({},e.data),{},{adds:wh(e.data.adds),removes:wh(e.data.removes)})})}catch(e){mh.error("could not compress event - will use uncompressed event",e)}return e}(o):o,u={$snapshot_bytes:kd(c),$snapshot_data:c,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(u):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&$r){var e=this._maskUrl($r.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var e=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],e.forEach((e=>{Date.now()-e.enqueuedAt<=2e3&&this._tryRRWebMethod(e)}))}}_maskUrl(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var r,n={url:e};return null===(r=n=t.maskNetworkRequestFn(n))||void 0===r?void 0:r.url}return e}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var e=this.minimumDuration,t=this.sessionDuration,r=$n(t)&&t>=0,n=$n(e)&&r&&t<e;if("buffering"===this.status||"paused"===this.status||"disabled"===this.status||n)return this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3),this.buffer;this.buffer.data.length>0&&Ed(this.buffer).forEach((e=>{this._captureSnapshot({$snapshot_bytes:e.size,$snapshot_data:e.data,$session_id:e.sessionId,$window_id:e.windowId,$lib:"web",$lib_version:nn.LIB_VERSION})}));return this.clearBuffer()}_captureSnapshotBuffered(e){var t,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3))}_captureSnapshot(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(void 0!==$r&&$r.location.href){var e=$r.location.href,t=this._urlBlocked,r=Ch(e,this._urlBlocklist);r&&!t?this._pauseRecording():!r&&t&&this._resumeRecording(),Ch(e,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(e){var t,r;"trigger_pending"===this.triggerStatus&&(null===(t=this.instance)||void 0===t||null===(r=t.persistence)||void 0===r||r.register({["url"===e?mi:_i]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){this._urlBlocked||(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),mh.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){this._urlBlocked&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),mh.info("recording resumed"))}_addEventTriggerListener(){0!==this._eventTriggers.length&&Hn(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",(e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(e){mh.error("Could not activate event trigger",e)}})))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}overrideSampling(){var e;null===(e=this.instance.persistence)||void 0===e||e.register({[fi]:!0}),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}overrideTrigger(e){this._activateTrigger(e)}_reportStarted(e,t){this.instance.register_for_session({$session_recording_start_reason:e}),mh.info(e.replace("_"," "),t),Sn(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}}var kh=an("[RemoteConfig]");class Eh{constructor(e){this.instance=e}get remoteConfig(){var e,t;return null===(e=Qr._POSTHOG_REMOTE_CONFIG)||void 0===e||null===(t=e[this.instance.config.token])||void 0===t?void 0:t.config}_loadRemoteConfigJs(e){var t,r,n;null!==(t=Qr.__PosthogExtensions__)&&void 0!==t&&t.loadExternalDependency?null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.loadExternalDependency)||void 0===n||n.call(r,this.instance,"remote-config",(()=>e(this.remoteConfig))):(kh.error("PostHog Extensions not found. Cannot load remote config."),e())}_loadRemoteConfigJSON(e){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return kh.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void kh.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((e=>{if(!e)return kh.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON((e=>{this.onRemoteConfig(e)}));this.onRemoteConfig(e)}))}catch(e){kh.error("Error loading remote config",e)}}onRemoteConfig(e){e?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(e),!1!==e.hasFeatureFlags&&this.instance.featureFlags.ensureFlagsLoaded()):kh.info("__preview_remote_config is disabled. Logging config instead",e):kh.error("Failed to fetch remote config from PostHog.")}}var xh,Th=null!=$r&&$r.location?Kn($r.location.hash,"__posthog")||Kn(location.hash,"state"):null,Mh="_postHogToolbarParams",Rh=an("[Toolbar]");!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(xh||(xh={}));class Ah{constructor(e){this.instance=e}setToolbarState(e){Qr.ph_toolbar_state=e}getToolbarState(){var e;return null!==(e=Qr.ph_toolbar_state)&&void 0!==e?e:xh.UNINITIALIZED}maybeLoadToolbar(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!$r||!Ur)return!1;r=null!==(e=r)&&void 0!==e?e:$r.location,i=null!==(t=i)&&void 0!==t?t:$r.history;try{if(!n){try{$r.localStorage.setItem("test","test"),$r.localStorage.removeItem("test")}catch(e){return!1}n=null==$r?void 0:$r.localStorage}var o,s=Th||Kn(r.hash,"__posthog")||Kn(r.hash,"state"),a=s?vn((()=>JSON.parse(atob(decodeURIComponent(s)))))||vn((()=>JSON.parse(decodeURIComponent(s)))):null;return a&&"ph_authorize"===a.action?((o=a).source="url",o&&Object.keys(o).length>0&&(a.desiredHash?r.hash=a.desiredHash:i?i.replaceState(i.state,"",r.pathname+r.search):r.hash="")):((o=JSON.parse(n.getItem(Mh)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}_callLoadToolbar(e){var t=Qr.ph_load_toolbar||Qr.ph_load_editor;!Hn(t)&&An(t)?t(e,this.instance):Rh.warn("No toolbar load function found")}loadToolbar(e){var r=!(null==Ur||!Ur.getElementById(Fi));if(!$r||r)return!1;var n="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,i=t(t({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if($r.localStorage.setItem(Mh,JSON.stringify(t(t({},i),{},{source:void 0}))),this.getToolbarState()===xh.LOADED)this._callLoadToolbar(i);else if(this.getToolbarState()===xh.UNINITIALIZED){var o,s;this.setToolbarState(xh.LOADING),null===(o=Qr.__PosthogExtensions__)||void 0===o||null===(s=o.loadExternalDependency)||void 0===s||s.call(o,this.instance,"toolbar",(e=>{if(e)return Rh.error("[Toolbar] Failed to load",e),void this.setToolbarState(xh.UNINITIALIZED);this.setToolbarState(xh.LOADED),this._callLoadToolbar(i)})),wn($r,"turbolinks:load",(()=>{this.setToolbarState(xh.UNINITIALIZED),this.loadToolbar(i)}))}return!0}_loadEditor(e){return this.loadToolbar(e)}maybeLoadEditor(){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,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,r)}}var Nh=3e3;class Fh{constructor(e,t){i(this,"isPaused",!0),i(this,"queue",[]),this.flushTimeoutMs=Md((null==t?void 0:t.flush_interval_ms)||Nh,250,5e3,"flush interval",Nh),this.sendRequest=e}enqueue(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var e=this.queue.length>0?this.formatQueue():{},r=Object.values(e),n=[...r.filter((e=>0===e.url.indexOf("/e"))),...r.filter((e=>0!==e.url.indexOf("/e")))];n.map((e=>{this.sendRequest(t(t({},e),{},{transport:"sendBeacon"}))}))}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((()=>{if(this.clearFlushTimeout(),this.queue.length>0){var t=this.formatQueue(),r=function(r){var n=t[r],i=(new Date).getTime();n.data&&Rn(n.data)&&un(n.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.sendRequest(n)};for(var n in t)r(n)}}),this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var e={};return un(this.queue,(r=>{var n,i=r,o=(i?i.batchKey:null)||i.url;Ln(e[o])&&(e[o]=t(t({},i),{},{data:[]})),null===(n=e[o].data)||void 0===n||n.push(i.data)})),this.queue=[],e}}var Oh=function(e){var t,r,n,i,o="";for(t=r=0,n=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<n;i++){var s=e.charCodeAt(i),a=null;s<128?r++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),qn(a)||(r>t&&(o+=e.substring(t,r)),o+=a,t=r=i+1)}return r>t&&(o+=e.substring(t,e.length)),o},Ph=!!Xr||!!Yr,Lh="text/plain",Dh=(e,r)=>{var[n,i]=e.split("?"),o=t({},r);null==i||i.split("&").forEach((e=>{var[t]=e.split("=");delete o[t]}));var s=Yn(o);return s=s?(i?i+"&":"")+s:i,"".concat(n,"?").concat(s)},Bh=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),qh=e=>{var{data:t,compression:r}=e;if(t){if(r===qr.GZipJS){var n=ph(vh(Bh(t)),{mtime:0}),i=new Blob([n],{type:Lh});return{contentType:Lh,body:i,estimatedSize:i.size}}if(r===qr.Base64){var o=function(e){var t,r,n,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,c="",u=[];if(!e)return e;e=Oh(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,r=o>>12&63,n=o>>6&63,i=63&o,u[l++]=s.charAt(t)+s.charAt(r)+s.charAt(n)+s.charAt(i)}while(a<e.length);switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(Bh(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:Bh(e)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Bh(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Hh=[];Yr&&Hh.push({transport:"fetch",method:e=>{var r,n,{contentType:i,body:o,estimatedSize:s}=null!==(r=qh(e))&&void 0!==r?r:{},a=new Headers;un(e.headers,(function(e,t){a.append(t,e)})),i&&a.append("Content-Type",i);var l=e.url,c=null;if(Jr){var u=new Jr;c={signal:u.signal,timeout:setTimeout((()=>u.abort()),e.timeout)}}Yr(l,t({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&(s||0)<52428.8,body:o,signal:null===(n=c)||void 0===n?void 0:n.signal},e.fetchOptions)).then((t=>t.text().then((r=>{var n,i={statusCode:t.status,text:r};if(200===t.status)try{i.json=JSON.parse(r)}catch(e){sn.error(e)}null===(n=e.callback)||void 0===n||n.call(e,i)})))).catch((t=>{var r;sn.error(t),null===(r=e.callback)||void 0===r||r.call(e,{statusCode:0,text:t})})).finally((()=>c?clearTimeout(c.timeout):null))}}),Xr&&Hh.push({transport:"XHR",method:e=>{var t,r=new Xr;r.open(e.method||"GET",e.url,!0);var{contentType:n,body:i}=null!==(t=qh(e))&&void 0!==t?t:{};un(e.headers,(function(e,t){r.setRequestHeader(t,e)})),n&&r.setRequestHeader("Content-Type",n),e.timeout&&(r.timeout=e.timeout),r.withCredentials=!0,r.onreadystatechange=()=>{if(4===r.readyState){var t,n={statusCode:r.status,text:r.responseText};if(200===r.status)try{n.json=JSON.parse(r.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,n)}},r.send(i)}}),null!=jr&&jr.sendBeacon&&Hh.push({transport:"sendBeacon",method:e=>{var t=Dh(e.url,{beacon:"1"});try{var r,{contentType:n,body:i}=null!==(r=qh(e))&&void 0!==r?r:{},o="string"==typeof i?new Blob([i],{type:n}):i;jr.sendBeacon(t,o)}catch(e){}}});var $h=["retriesPerformedSoFar"];class Wh{constructor(e){i(this,"isPolling",!1),i(this,"pollIntervalMs",3e3),i(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!Ln($r)&&"onLine"in $r.navigator&&(this.areWeOnline=$r.navigator.onLine,wn($r,"online",(()=>{this.areWeOnline=!0,this.flush()})),wn($r,"offline",(()=>{this.areWeOnline=!1})))}retriableRequest(e){var{retriesPerformedSoFar:r}=e,n=o(e,$h);$n(r)&&r>0&&(n.url=Dh(n.url,{retry_count:r})),this.instance._send_request(t(t({},n),{},{callback:e=>{var i;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=r?r:0)<10?this.enqueue(t({retriesPerformedSoFar:r},n)):null===(i=n.callback)||void 0===i||i.call(n,e)}}))}enqueue(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(e){var t=3e3*Math.pow(2,e),r=t/2,n=Math.min(18e5,t),i=(Math.random()-.5)*(n-r);return Math.ceil(n+i)}(t),n=Date.now()+r;this.queue.push({retryAt:n,requestOptions:e});var i="Enqueued failed request for retry in ".concat(r);navigator.onLine||(i+=" (Browser is offline)"),sn.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout((()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()}),this.pollIntervalMs)}flush(){var e=Date.now(),t=[],r=this.queue.filter((r=>r.retryAt<e||(t.push(r),!1)));if(this.queue=t,r.length>0)for(var{requestOptions:n}of r)this.retriableRequest(n)}unload(){for(var{requestOptions:e}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(t(t({},e),{},{transport:"sendBeacon"}))}catch(e){sn.error(e)}this.queue=[]}}var Vh,Zh=an("[SessionId]");class Gh{constructor(e,t,r){var n;if(i(this,"_sessionIdChangedHandlers",[]),!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.config=e.config,this.persistence=e.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=t||ld,this._windowIdGenerator=r||ld;var o=this.config.persistence_name||this.config.token,s=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Md(s,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var a=Sd.parse(this._window_id_storage_key),l=Sd.parse(this._primary_window_exists_storage_key);a&&!l?this._windowId=a:Sd.remove(this._window_id_storage_key),Sd.set(this._primary_window_exists_storage_key,!0)}if(null!==(n=this.config.bootstrap)&&void 0!==n&&n.sessionID)try{var c=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),c)}catch(e){Zh.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Ln(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((t=>t!==e))}}_canUseSessionStorage(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&Sd.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Sd.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Sd.parse(this._window_id_storage_key):null}_setSessionId(e,t,r){e===this._sessionId&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register({[gi]:[t,e,r]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[gi];return Rn(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){wn($r,"beforeunload",(()=>{this._canUseSessionStorage()&&Sd.remove(this._primary_window_exists_storage_key)}),{capture:!1})}checkAndGetSessionAndWindowId(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var r=t||(new Date).getTime(),[n,i,o]=this._getSessionId(),s=this._getWindowId(),a=$n(o)&&o>0&&Math.abs(r-o)>864e5,l=!1,c=!i,u=!e&&Math.abs(r-n)>this.sessionTimeoutMs;c||u||a?(i=this._sessionIdGenerator(),s=this._windowIdGenerator(),Zh.info("new session ID generated",{sessionId:i,windowId:s,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}}),o=r,l=!0):s||(s=this._windowIdGenerator(),l=!0);var d=0===n||!e||a?r:n,h=0===o?(new Date).getTime():o;return this._setWindowId(s),this._setSessionId(i,d,h),e||this.resetIdleTimer(),l&&this._sessionIdChangedHandlers.forEach((e=>e(i,s,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0))),{sessionId:i,windowId:s,sessionStartTimestamp:h,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:n}}resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((()=>{this.resetSessionId()}),1.1*this.sessionTimeoutMs)}}!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(Vh||(Vh={}));var jh="i.posthog.com";class Uh{constructor(e){i(this,"_regionCache",{}),this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e,t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(jh),".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Vh.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Vh.EU:this._regionCache[this.apiHost]=Vh.CUSTOM),this._regionCache[this.apiHost]}endpointFor(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+t;if(this.region===Vh.CUSTOM)return this.apiHost+t;var r=jh+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(r);case"api":return"https://".concat(this.region,".").concat(r)}}}var zh="posthog-js";function Yh(e){var{organization:t,projectId:r,prefix:n,severityAllowList:i=["error"]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o=>{var s,a,l,c,u;if(!("*"===i||i.includes(o.level))||!e.__loaded)return o;o.tags||(o.tags={});var d=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));o.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var h=(null===(s=o.exception)||void 0===s?void 0:s.values)||[];h.forEach((e=>{e.stacktrace&&(e.stacktrace.type="raw",e.stacktrace.frames.forEach((e=>{e.platform="web:javascript"})))}));var p={$exception_message:(null===(a=h[0])||void 0===a?void 0:a.value)||o.message,$exception_type:null===(l=h[0])||void 0===l?void 0:l.type,$exception_personURL:d,$exception_level:o.level,$exception_list:h,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(null===(c=h[0])||void 0===c?void 0:c.value)||o.message,$sentry_exception_type:null===(u=h[0])||void 0===u?void 0:u.type,$sentry_tags:o.tags};return t&&r&&(p.$sentry_url=(n||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+o.event_id),e.exceptions.sendExceptionEvent(p),o}}class Xh{constructor(e,t,r,n,i){this.name=zh,this.setupOnce=function(o){o(Yh(e,{organization:t,projectId:r,prefix:n,severityAllowList:i}))}}}var Jh=an("[SegmentIntegration]");function Kh(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var n=r=>{var n=()=>r.anonymousId()||ld();e.config.get_device_id=n,r.id()&&(e.register({distinct_id:r.id(),$device_id:n()}),e.persistence.set_property(Ei,"identified")),t()},i=r.user();"then"in i&&An(i.then)?i.then((e=>n(e))):n(i)}(e,(()=>{r.register((e=>{Promise&&Promise.resolve||Jh.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,r)=>{var n;if(!r)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Jh.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Jh.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e._calculate_event_properties(r,null!==(n=t.event.properties)&&void 0!==n?n:{},new Date);return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,"$pageview"),identify:e=>t(e,"$identify"),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}class Qh{constructor(e){this._instance=e}doPageView(e,t){var r,n=this._previousPageViewProperties(e,t);return this._currentPageview={pathname:null!==(r=null==$r?void 0:$r.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){var t;return this._previousPageViewProperties(e,null===(t=this._currentPageview)||void 0===t?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null===(e=this._currentPageview)||void 0===e?void 0:e.pageViewId}}_previousPageViewProperties(e,t){var r=this._currentPageview;if(!r)return{$pageview_id:t};var n={$pageview_id:t,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:s,maxScrollY:a,maxContentHeight:l,lastContentY:c,maxContentY:u}=i;if(!(Ln(o)||Ln(s)||Ln(a)||Ln(l)||Ln(c)||Ln(u))){o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var d=o<=1?1:Md(s/o,0,1),h=o<=1?1:Md(a/o,0,1),p=l<=1?1:Md(c/l,0,1),v=l<=1?1:Md(u/l,0,1);n=dn(n,{$prev_pageview_last_scroll:s,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:v})}}return r.pathname&&(n.$prev_pageview_pathname=r.pathname),r.timestamp&&(n.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),n}}var ep=an("[RateLimiter]");class tp{constructor(e){var t,r;i(this,"serverLimits",{}),i(this,"lastEventRateLimited",!1),i(this,"checkForLimiting",(e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{ep.info("".concat(e||"events"," is quota limited.")),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void ep.warn('could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:t})}})),this.instance=e,this.captureEventsPerSecond=(null===(t=e.config.rate_limiting)||void 0===t?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(r=e.config.rate_limiting)||void 0===r?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var e,t,r,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=(new Date).getTime(),o=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(Ti))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:i};o.tokens+=(i-o.last)/1e3*this.captureEventsPerSecond,o.last=i,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var s=o.tokens<1;return s||n||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||n||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,null===(r=this.instance.persistence)||void 0===r||r.set_property(Ti,o),{isRateLimited:s,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var rp=e=>{var r=null==e?void 0:e.config;return t({initialPathName:(null==zr?void 0:zr.pathname)||"",referringDomain:Za.referringDomain()},Za.campaignParams({customTrackedParams:null==r?void 0:r.custom_campaign_params,maskPersonalDataProperties:null==r?void 0:r.mask_personal_data_properties,customPersonalDataProperties:null==r?void 0:r.custom_personal_data_properties}))};class np{constructor(e,t,r,n){i(this,"_onSessionIdCallback",(e=>{var t=this._getStoredProps();if(!t||t.sessionId!==e){var r={sessionId:e,props:this._sessionSourceParamGenerator(this.instance)};this._persistence.register({[xi]:r})}})),this.instance=e,this._sessionIdManager=t,this._persistence=r,this._sessionSourceParamGenerator=n||rp,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[xi]}getSessionProps(){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}:{}}}var ip=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","better uptime bot","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","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","gptbot","oai-searchbot","chatgpt-user","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],op=function(e,t){if(!e)return!1;var r=e.toLowerCase();return ip.concat(t||[]).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))},sp=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&op(r,t))return!0;try{var n=null==e?void 0:e.userAgentData;if(null!=n&&n.brands&&n.brands.some((e=>op(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},ap=an("[Dead Clicks]"),lp=()=>!0,cp=e=>{var t,r=!(null===(t=e.instance.persistence)||void 0===t||!t.get_property(si)),n=e.instance.config.capture_dead_clicks;return Wn(n)?n:r};class up{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[si]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript((()=>{this.start()}))}loadScript(e){var t,r,n;null!==(t=Qr.__PosthogExtensions__)&&void 0!==t&&t.initDeadClicksAutocapture&&e(),null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.loadExternalDependency)||void 0===n||n.call(r,this.instance,"dead-clicks-autocapture",(t=>{t?ap.error("failed to load script",t):e()}))}start(){var e;if(Ur){if(!this._lazyLoadedDeadClicksAutocapture&&null!==(e=Qr.__PosthogExtensions__)&&void 0!==e&&e.initDeadClicksAutocapture){var t=On(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=Qr.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this._lazyLoadedDeadClicksAutocapture.start(Ur),ap.info("starting...")}}else ap.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,ap.info("stopping..."))}}var dp=an("[Heatmaps]");function hp(e){return On(e)&&"clientX"in e&&"clientY"in e&&$n(e.clientX)&&$n(e.clientY)}class pp{constructor(e){var t;i(this,"rageclicks",new Lu),i(this,"_enabledServerSide",!1),i(this,"_initialized",!1),i(this,"_flushInterval",null),this.instance=e,this._enabledServerSide=!(null===(t=this.instance.persistence)||void 0===t||!t.props[ni]),wn($r,"beforeunload",this.flush)}get flushIntervalMilliseconds(){var e=5e3;return On(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Ln(this.instance.config.capture_heatmaps)?Ln(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;dp.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),null===(t=this.deadClicksCapture)||void 0===t||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ni]:t}),this._enabledServerSide=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.buffer;return this.buffer=void 0,e}_onDeadClick(e){this._onClick(e.originalEvent,"deadclick")}_setupListeners(){$r&&Ur&&(wn(Ur,"click",(e=>this._onClick(e||(null==$r?void 0:$r.event))),{capture:!0}),wn(Ur,"mousemove",(e=>this._onMouseMove(e||(null==$r?void 0:$r.event))),{capture:!0}),this.deadClicksCapture=new up(this.instance,lp,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(e,t){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),o=function(e,t,r){for(var n=e;n&&Di(n)&&!Bi(n,"body");){if(n===r)return!1;if(Sn(t,null==$r?void 0:$r.getComputedStyle(n).position))return!0;n=zi(n)}return!1}(ji(e),["fixed","sticky"],i);return{x:e.clientX+(o?0:n),y:e.clientY+(o?0:r),target_fixed:o,type:t}}_onClick(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"click";if(!Li(e.target)&&hp(e)){var i=this._getProperties(e,n);null!==(r=this.rageclicks)&&void 0!==r&&r.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(t(t({},i),{},{type:"rageclick"})),this._capture(i)}}_onMouseMove(e){!Li(e.target)&&hp(e)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((()=>{this._capture(this._getProperties(e,"mousemove"))}),500))}_capture(e){if($r){var t=$r.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}flush(){this.buffer&&!Pn(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class vp{constructor(e){i(this,"_updateScrollData",(()=>{var e,t,r,n;this.context||(this.context={});var i=this.scrollElement(),o=this.scrollY(),s=i?Math.max(0,i.scrollHeight-i.clientHeight):0,a=o+((null==i?void 0:i.clientHeight)||0),l=(null==i?void 0:i.scrollHeight)||0;this.context.lastScrollY=Math.ceil(o),this.context.maxScrollY=Math.max(o,null!==(e=this.context.maxScrollY)&&void 0!==e?e:0),this.context.maxScrollHeight=Math.max(s,null!==(t=this.context.maxScrollHeight)&&void 0!==t?t:0),this.context.lastContentY=a,this.context.maxContentY=Math.max(a,null!==(r=this.context.maxContentY)&&void 0!==r?r:0),this.context.maxContentHeight=Math.max(l,null!==(n=this.context.maxContentHeight)&&void 0!==n?n:0)})),this.instance=e}getContext(){return this.context}resetContext(){var e=this.context;return setTimeout(this._updateScrollData,0),e}startMeasuringScrollPosition(){wn($r,"scroll",this._updateScrollData,{capture:!0}),wn($r,"scrollend",this._updateScrollData,{capture:!0}),wn($r,"resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return null==$r?void 0:$r.document.documentElement;var e=Rn(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var t of e){var r=null==$r?void 0:$r.document.querySelector(t);if(r)return r}}scrollY(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return $r&&($r.scrollY||$r.pageYOffset||$r.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return $r&&($r.scrollX||$r.pageXOffset||$r.document.documentElement.scrollLeft)||0}}var gp=an("[TracingHeaders]");class fp{constructor(e){i(this,"_restoreXHRPatch",void 0),i(this,"_restoreFetchPatch",void 0),i(this,"_startCapturing",(()=>{var e,t,r,n;Ln(this._restoreXHRPatch)&&(null===(e=Qr.__PosthogExtensions__)||void 0===e||null===(t=e.tracingHeadersPatchFns)||void 0===t||t._patchXHR(this.instance.sessionManager));Ln(this._restoreFetchPatch)&&(null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.tracingHeadersPatchFns)||void 0===n||n._patchFetch(this.instance.sessionManager))})),this.instance=e}_loadScript(e){var t,r,n;null!==(t=Qr.__PosthogExtensions__)&&void 0!==t&&t.tracingHeadersPatchFns&&e(),null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.loadExternalDependency)||void 0===n||n.call(r,this.instance,"tracing-headers",(t=>{if(t)return gp.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(e=this._restoreXHRPatch)||void 0===e||e.call(this),null===(t=this._restoreFetchPatch)||void 0===t||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}var mp;!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(mp||(mp={}));class _p{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?mp.DENIED:this.storedConsent}isOptedOut(){return this.consent===mp.DENIED||this.consent===mp.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:e,opt_out_capturing_cookie_prefix:t}=this.instance.config;return(t||"__ph_opt_in_out_")+e}get storedConsent(){var e=this.storage.get(this.storageKey);return"1"===e?mp.GRANTED:"0"===e?mp.DENIED:mp.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?fd:vd;var t="localStorage"===e?vd:fd;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!bn([null==jr?void 0:jr.doNotTrack,null==jr?void 0:jr.msDoNotTrack,Qr.doNotTrack],(e=>Sn([!0,1,"1","yes"],e)))}}var yp=an("[ExceptionAutocapture]");class bp{constructor(e){var t;i(this,"startCapturing",(()=>{var e,t,r,n;if($r&&this.isEnabled&&!this.hasHandlers){var i=null===(e=Qr.__PosthogExtensions__)||void 0===e||null===(t=e.errorWrappingFunctions)||void 0===t?void 0:t.wrapOnError,o=null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.errorWrappingFunctions)||void 0===n?void 0:n.wrapUnhandledRejection;if(i&&o)try{this.unwrapOnError=i(this.captureException.bind(this)),this.unwrapUnhandledRejection=o(this.captureException.bind(this))}catch(e){yp.error("failed to start",e),this.stopCapturing()}else yp.error("failed to load error wrapping functions - cannot start")}})),this.instance=e,this.remoteEnabled=!(null===(t=this.instance.persistence)||void 0===t||!t.props[ii]),this.startIfEnabled()}get isEnabled(){var e;return Wn(this.instance.config.capture_exceptions)?this.instance.config.capture_exceptions:null!==(e=this.remoteEnabled)&&void 0!==e&&e}get hasHandlers(){return!Ln(this.unwrapOnError)}startIfEnabled(){this.isEnabled&&!this.hasHandlers&&(yp.info("enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(e){var t,r;this.hasHandlers&&e(),null===(t=Qr.__PosthogExtensions__)||void 0===t||null===(r=t.loadExternalDependency)||void 0===r||r.call(t,this.instance,"exception-autocapture",(t=>{if(t)return yp.error("failed to load script",t);e()}))}stopCapturing(){var e,t;null===(e=this.unwrapOnError)||void 0===e||e.call(this),this.unwrapOnError=void 0,null===(t=this.unwrapUnhandledRejection)||void 0===t||t.call(this),this.unwrapUnhandledRejection=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this.instance.persistence&&this.instance.persistence.register({[ii]:this.remoteEnabled}),this.startIfEnabled()}captureException(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(e)}}var wp=an("[Web Vitals]"),Sp=9e5;class Cp{constructor(e){var r;i(this,"_enabledServerSide",!1),i(this,"_initialized",!1),i(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),i(this,"_flushToCapture",(()=>{clearTimeout(this._delayedFlushTimer),0!==this.buffer.metrics.length&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce(((e,r)=>t(t({},e),{},{["$web_vitals_".concat(r.name,"_event")]:t({},r),["$web_vitals_".concat(r.name,"_value")]:r.value})),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})})),i(this,"_addToBuffer",(e=>{var r,n=null===(r=this.instance.sessionManager)||void 0===r?void 0:r.checkAndGetSessionAndWindowId(!0);if(Ln(n))wp.error("Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this._currentURL();if(!Ln(i))if(Hn(null==e?void 0:e.name)||Hn(null==e?void 0:e.value))wp.error("Invalid metric received",e);else if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)wp.error("Ignoring metric with value >= "+this._maxAllowedValue,e);else this.buffer.url!==i&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),Ln(this.buffer.url)&&(this.buffer.url=i),this.buffer.firstMetricTimestamp=Ln(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(t(t({},e),{},{$current_url:i,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()}})),i(this,"_startCapturing",(()=>{var e,t,r,n,i=Qr.__PosthogExtensions__;Ln(i)||Ln(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:r,onINP:n}=i.postHogWebVitalsCallbacks),e&&t&&r&&n?(this.allowedMetrics.indexOf("LCP")>-1&&e(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&n(this._addToBuffer.bind(this)),this._initialized=!0):wp.error("web vitals callbacks not loaded - not starting")})),this.instance=e,this._enabledServerSide=!(null===(r=this.instance.persistence)||void 0===r||!r.props[oi]),this.startIfEnabled()}get allowedMetrics(){var e,t,r=On(this.instance.config.capture_performance)?null===(e=this.instance.config.capture_performance)||void 0===e?void 0:e.web_vitals_allowed_metrics:void 0;return Ln(r)?(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[ai])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(On(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=On(this.instance.config.capture_performance)&&$n(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:Sp;return 0<e&&e<=6e4?Sp:e}get isEnabled(){var e=On(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Wn(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(wp.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(e){var t=On(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=On(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[oi]:t}),this.instance.persistence.register({[ai]:r})),this._enabledServerSide=t,this.startIfEnabled()}loadScript(e){var t,r,n;null!==(t=Qr.__PosthogExtensions__)&&void 0!==t&&t.postHogWebVitalsCallbacks&&e(),null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.loadExternalDependency)||void 0===n||n.call(r,this.instance,"web-vitals",(t=>{t?wp.error("failed to load script",t):e()}))}_currentURL(){var e=$r?$r.location.href:void 0;return e||wp.error("Could not determine current URL"),e}}var Ip={icontains:(e,t)=>!!$r&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!$r&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!$r&&kn(t.href,e),not_regex:(e,t)=>!!$r&&!kn(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class kp{constructor(e){var t=this;i(this,"getWebExperimentsAndEvaluateDisplayLogic",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t.getWebExperiments((e=>{kp.logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;if(t._flagToExperiments)kp.logInfo("setting flag key ",e.feature_flag_key," to web experiment ",e),null===(r=t._flagToExperiments)||void 0===r||r.set(e.feature_flag_key,e);var n=t.instance.getFeatureFlag(e.feature_flag_key);Dn(n)&&e.variants[n]&&t.applyTransforms(e.name,n,e.variants[n].transforms)}else if(e.variants)for(var i in e.variants){var o=e.variants[i];kp.matchesTestVariant(o)&&t.applyTransforms(e.name,i,o.transforms)}}))}),e)})),this.instance=e,this.instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}onFeatureFlags(e){if(this._is_bot())kp.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(Hn(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();kp.logInfo("applying feature flags",e),e.forEach((e=>{var t;if(this._flagToExperiments&&null!==(t=this._flagToExperiments)&&void 0!==t&&t.has(e)){var r,n=this.instance.getFeatureFlag(e),i=null===(r=this._flagToExperiments)||void 0===r?void 0:r.get(e);n&&null!=i&&i.variants[n]&&this.applyTransforms(i.name,n,i.variants[n].transforms)}}))}}previewWebExperiment(){var e=kp.getWindowLocation();if(null!=e&&e.search){var t=Xn(null==e?void 0:e.search,"__experiment_id"),r=Xn(null==e?void 0:e.search,"__experiment_variant");t&&r&&(kp.logInfo("previewing web experiments ".concat(t," && ").concat(r)),this.getWebExperiments((e=>{this.showPreviewWebExperiment(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.instance.config.disable_web_experiments&&!r)return e([]);var n=this.instance.get_property("$web_experiments");if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",callback:t=>{if(200!==t.statusCode||!t.json)return e([]);var r=t.json.experiments||[];return e(r)}})}showPreviewWebExperiment(e,t,r){var n=r.filter((t=>t.id===e));n&&n.length>0&&(kp.logInfo("Previewing web experiment [".concat(n[0].name,"] with variant [").concat(t,"]")),this.applyTransforms(n[0].name,t,n[0].variants[t].transforms))}static matchesTestVariant(e){return!Hn(e.conditions)&&(kp.matchUrlConditions(e)&&kp.matchUTMConditions(e))}static matchUrlConditions(e){var t;if(Hn(e.conditions)||Hn(null===(t=e.conditions)||void 0===t?void 0:t.url))return!0;var r,n,i,o=kp.getWindowLocation();return!!o&&(null===(r=e.conditions)||void 0===r||!r.url||Ip[null!==(n=null===(i=e.conditions)||void 0===i?void 0:i.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url,o))}static getWindowLocation(){return null==$r?void 0:$r.location}static matchUTMConditions(e){var t;if(Hn(e.conditions)||Hn(null===(t=e.conditions)||void 0===t?void 0:t.utm))return!0;var r=Za.campaignParams();if(r.utm_source){var n,i,o,s,a,l,c,u,d,h,p,v,g,f,m,_,y=null===(n=e.conditions)||void 0===n||null===(i=n.utm)||void 0===i||!i.utm_campaign||(null===(o=e.conditions)||void 0===o||null===(s=o.utm)||void 0===s?void 0:s.utm_campaign)==r.utm_campaign,b=null===(a=e.conditions)||void 0===a||null===(l=a.utm)||void 0===l||!l.utm_source||(null===(c=e.conditions)||void 0===c||null===(u=c.utm)||void 0===u?void 0:u.utm_source)==r.utm_source,w=null===(d=e.conditions)||void 0===d||null===(h=d.utm)||void 0===h||!h.utm_medium||(null===(p=e.conditions)||void 0===p||null===(v=p.utm)||void 0===v?void 0:v.utm_medium)==r.utm_medium,S=null===(g=e.conditions)||void 0===g||null===(f=g.utm)||void 0===f||!f.utm_term||(null===(m=e.conditions)||void 0===m||null===(_=m.utm)||void 0===_?void 0:_.utm_term)==r.utm_term;return y&&w&&S&&b}return!1}static logInfo(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];sn.info("[WebExperiments] ".concat(e),r)}applyTransforms(e,t,r){this._is_bot()?kp.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?r.forEach((r=>{if(r.selector){var n;kp.logInfo("applying transform of variant ".concat(t," for experiment ").concat(e," "),r);var i=null===(n=document)||void 0===n?void 0:n.querySelectorAll(r.selector);null==i||i.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}})):kp.logInfo("Control variants leave the page unmodified.")}_is_bot(){return jr&&this.instance?sp(jr,this.instance.config.custom_blocked_useragents):void 0}}class Ep{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}var xp=["$set_once","$set"],Tp=an("[SiteApps]");class Mp{constructor(e){this.instance=e,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(e,t){if(t){var r=this.globalsForEvent(t);this.bufferedInvocations.push(r),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}get siteAppLoaders(){var e,t;return null===(e=Qr._POSTHOG_REMOTE_CONFIG)||void 0===e||null===(t=e[this.instance.config.token])||void 0===t?void 0:t.siteApps}init(){if(this.isEnabled){var e=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{e(),this.bufferedInvocations=[],this.stopBuffering=void 0}}}globalsForEvent(e){var r,n,i,s,a,l,c;if(!e)throw new Error("Event payload is required");var u={},d=this.instance.get_property("$groups")||[],h=this.instance.get_property("$stored_group_properties")||{};for(var[p,v]of Object.entries(h))u[p]={id:d[p],type:p,properties:v};var{$set_once:g,$set:f}=e;return{event:t(t({},o(e,xp)),{},{properties:t(t(t({},e.properties),f?{$set:t(t({},null!==(r=null===(n=e.properties)||void 0===n?void 0:n.$set)&&void 0!==r?r:{}),f)}:{}),g?{$set_once:t(t({},null!==(i=null===(s=e.properties)||void 0===s?void 0:s.$set_once)&&void 0!==i?i:{}),g)}:{}),elements_chain:null!==(a=null===(l=e.properties)||void 0===l?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null===(c=e.properties)||void 0===c?void 0:c.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var t={id:e.id,loaded:!1,errored:!1};this.apps[e.id]=t;var r=r=>{var n;for(var i of(this.apps[e.id].errored=!r,this.apps[e.id].loaded=!0,Tp.info("Site app with id ".concat(e.id," ").concat(r?"loaded":"errored")),r&&this.bufferedInvocations.length&&(Tp.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(e.id)),this.bufferedInvocations.forEach((e=>{var r;return null===(r=t.processEvent)||void 0===r?void 0:r.call(t,e)}))),Object.values(this.apps)))if(!i.loaded)return;null===(n=this.stopBuffering)||void 0===n||n.call(this)};try{var{processEvent:n}=e.init({posthog:this.instance,callback:e=>{r(e)}});n&&(t.processEvent=n)}catch(t){Tp.error("Error while initializing PostHog app with config id ".concat(e.id),t),r(!1)}}onCapturedEvent(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{var n;null===(n=r.processEvent)||void 0===n||n.call(r,t)}catch(t){Tp.error("Error while processing event ".concat(e.event," for site app ").concat(r.id),t)}}}onRemoteConfig(e){var t,r,n,i=this;if(null!==(t=this.siteAppLoaders)&&void 0!==t&&t.length){if(!this.isEnabled)return void Tp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');for(var o of this.siteAppLoaders)this.setupSiteApp(o);this.instance.on("eventCaptured",(e=>this.onCapturedEvent(e)))}else if(null===(r=this.stopBuffering)||void 0===r||r.call(this),null!==(n=e.siteApps)&&void 0!==n&&n.length)if(this.isEnabled){var s=function(e,t){var r,n;Qr["__$$ph_site_app_".concat(e)]=i.instance,null===(r=Qr.__PosthogExtensions__)||void 0===r||null===(n=r.loadSiteApp)||void 0===n||n.call(r,i.instance,t,(t=>{if(t)return Tp.error("Error while initializing PostHog app with config id ".concat(e),t)}))};for(var{id:a,url:l}of e.siteApps)s(a,l)}else Tp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}function Rp(e,t,r){return Bh({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var Ap={},Np=()=>{},Fp="posthog",Op=!Ph&&-1===(null==Kr?void 0:Kr.indexOf("MSIE"))&&-1===(null==Kr?void 0:Kr.indexOf("Mozilla")),Pp=()=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:yn(null==Ur?void 0:Ur.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Np,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:zr&&Dn(null==zr?void 0:zr.search)&&-1!==zr.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==$r||null===(e=$r.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_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],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:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;sn.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Nh},_onCapture:Np}},Lp=e=>{var t={};Ln(e.process_person)||(t.person_profiles=e.process_person),Ln(e.xhr_headers)||(t.request_headers=e.xhr_headers),Ln(e.cookie_name)||(t.persistence_name=e.cookie_name),Ln(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),Ln(e.store_google)||(t.save_campaign_params=e.store_google),Ln(e.verbose)||(t.debug=e.verbose);var r=dn({},t,e);return Rn(e.property_blacklist)&&(Ln(e.property_denylist)?r.property_denylist=e.property_blacklist:Rn(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:sn.error("Invalid value for property_denylist config: "+e.property_denylist)),r};class Dp{constructor(){i(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){sn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Bp{get decideEndpointWasHit(){var e,t;return null!==(e=null===(t=this.featureFlags)||void 0===t?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){i(this,"webPerformance",new Dp),i(this,"version",nn.LIB_VERSION),i(this,"_internalEventEmitter",new Ga),this.config=Pp(),this.SentryIntegration=Xh,this.sentryIntegration=e=>function(e,t){var r=Yh(e,t);return{name:zh,processEvent:e=>r(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this._cachedIdentify=null,this.featureFlags=new td(this),this.toolbar=new Ah(this),this.scrollManager=new vp(this),this.pageViewManager=new Qh(this),this.surveys=new Qa(this),this.experiments=new kp(this),this.exceptions=new Ep(this),this.rateLimiter=new tp(this),this.requestRouter=new Uh(this),this.consent=new _p(this),this.people={set:(e,t,r)=>{var n=Dn(e)?{[e]:t}:e;this.setPersonProperties(n),null==r||r({})},set_once:(e,t,r)=>{var n=Dn(e)?{[e]:t}:e;this.setPersonProperties(void 0,n),null==r||r({})}},this.on("eventCaptured",(e=>sn.info('send "'.concat(null==e?void 0:e.event,'"'),e)))}init(e,t,r){if(r&&r!==Fp){var n,i=null!==(n=Ap[r])&&void 0!==n?n:new Bp;return i._init(e,t,r),Ap[r]=i,Ap[Fp][r]=i,i}return this._init(e,t,r)}_init(e){var r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(Ln(e)||Bn(e))return sn.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return sn.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],i.person_profiles&&(this._initialPersonProfilesConfig=i.person_profiles),this.set_config(dn({},Pp(),Lp(i),{name:o,token:e})),this.config.on_xhr_error&&sn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:qr.GZipJS,this.persistence=new Id(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Id(t(t({},this.config),{},{persistence:"sessionStorage"}));var s=t({},this.persistence.props),a=t({},this.sessionPersistence.props);if(this._requestQueue=new Fh((e=>this._send_retriable_request(e)),this.config.request_queue_config),this._retryQueue=new Wh(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new Gh(this),this.sessionPropsManager=new np(this,this.sessionManager,this.persistence)),new fp(this).startIfEnabledOrStop(),this.siteApps=new Mp(this),null===(r=this.siteApps)||void 0===r||r.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new Ih(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Wu(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new pp(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Cp(this),this.exceptionObserver=new bp(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new up(this,cp),this.deadClicksAutocapture.startIfEnabled(),nn.DEBUG=nn.DEBUG||this.config.debug,nn.DEBUG&&sn.info("Starting in debug mode",{this:this,config:i,thisC:t({},this.config),p:s,s:a}),this._sync_opt_out_with_persistence(),void 0!==(null===(n=i.bootstrap)||void 0===n?void 0:n.distinctID)){var l,c,u=this.config.get_device_id(ld()),d=null!==(l=i.bootstrap)&&void 0!==l&&l.isIdentifiedID?u:i.bootstrap.distinctID;this.persistence.set_property(Ei,null!==(c=i.bootstrap)&&void 0!==c&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.bootstrap.distinctID,$device_id:d})}if(this._hasBootstrappedFeatureFlags()){var h,p,v=Object.keys((null===(h=i.bootstrap)||void 0===h?void 0:h.featureFlags)||{}).filter((e=>{var t,r;return!(null===(t=i.bootstrap)||void 0===t||null===(r=t.featureFlags)||void 0===r||!r[e])})).reduce(((e,t)=>{var r,n;return e[t]=(null===(r=i.bootstrap)||void 0===r||null===(n=r.featureFlags)||void 0===n?void 0:n[t])||!1,e}),{}),g=Object.keys((null===(p=i.bootstrap)||void 0===p?void 0:p.featureFlagPayloads)||{}).filter((e=>v[e])).reduce(((e,t)=>{var r,n,o,s;null!==(r=i.bootstrap)&&void 0!==r&&null!==(n=r.featureFlagPayloads)&&void 0!==n&&n[t]&&(e[t]=null===(o=i.bootstrap)||void 0===o||null===(s=o.featureFlagPayloads)||void 0===s?void 0:s[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:g})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Oi,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(ld());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(Ei,"anonymous")}return wn($r,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),i.segment?Kh(this,(()=>this._loaded())):this._loaded(),An(this.config._onCapture)&&this.config._onCapture!==Np&&(sn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this}_onRemoteConfig(e){var t,r,n,i,o,s,a,l;if(!Ur||!Ur.body)return sn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this._onRemoteConfig(e)}),500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Sn(e.supportedCompression,qr.GZipJS)?qr.GZipJS:Sn(e.supportedCompression,qr.Base64)?qr.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),null===(r=this.siteApps)||void 0===r||r.onRemoteConfig(e),null===(n=this.sessionRecording)||void 0===n||n.onRemoteConfig(e),null===(i=this.autocapture)||void 0===i||i.onRemoteConfig(e),null===(o=this.heatmaps)||void 0===o||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null===(s=this.webVitalsAutocapture)||void 0===s||s.onRemoteConfig(e),null===(a=this.exceptionObserver)||void 0===a||a.onRemoteConfig(e),null===(l=this.deadClicksAutocapture)||void 0===l||l.onRemoteConfig(e)}_loaded(){try{this.config.loaded(this)}catch(e){sn.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((()=>{this.consent.isOptedIn()&&this._captureInitialPageview()}),1),new Eh(this).load(),this.featureFlags.decide()}_start_queue_if_opted_in(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||cn(this.__request_queue,(e=>this._send_retriable_request(e))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Op?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Dh(e.url,{ip:this.config.ip?1:0}),e.headers=t({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var r,n,i,o=t({},e);o.timeout=o.timeout||6e4,o.url=Dh(o.url,{_:(new Date).getTime().toString(),ver:nn.LIB_VERSION,compression:o.compression});var s=null!==(r=o.transport)&&void 0!==r?r:"fetch",a=null!==(n=null===(i=bn(Hh,(e=>e.transport===s)))||void 0===i?void 0:i.method)&&void 0!==n?n:Hh[0].method;if(!a)throw new Error("No available transport method");a(o)})(t(t({},e),{},{callback:t=>{var r,n,i;(this.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(n=(i=this.config).on_request_error)||void 0===n||n.call(i,t));null===(r=e.callback)||void 0===r||r.call(e,t)}}))))}_send_retriable_request(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,r=[],n=[],i=[];cn(e,(e=>{e&&(t=e[0],Rn(t)?i.push(e):An(e)?e.call(this):Rn(e)&&"alias"===t?r.push(e):Rn(e)&&-1!==t.indexOf("capture")&&An(this[t])?i.push(e):n.push(e))}));var o=function(e,t){cn(e,(function(e){if(Rn(e[0])){var r=t;un(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};o(r,this),o(n,this),o(i,this)}_hasBootstrappedFeatureFlags(){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}push(e){this._execute_array([e])}capture(e,r,n){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!Ln(e)&&Dn(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s=new Date,a=(null==n?void 0:n.timestamp)||s,l=ld(),c={uuid:l,event:e,properties:this._calculate_event_properties(e,r||{},a,l)};o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==n?void 0:n.$set)&&(c.$set=null==n?void 0:n.$set);var u=this._calculate_set_once_properties(null==n?void 0:n.$set_once);u&&(c.$set_once=u),(c=mn(c,null!=n&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,Ln(null==n?void 0:n.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=s);var d=t(t({},c.properties.$set),c.$set);if(Pn(d)||this.setPersonPropertiesForFlags(d),!Hn(this.config.before_send)){var h=this._runBeforeSend(c);if(!h)return;c=h}this._internalEventEmitter.emit("eventCaptured",c);var p={method:"POST",url:null!==(i=null==n?void 0:n._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,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(p):this._requestQueue.enqueue(p),c}sn.critical("This capture call is ignored due to client rate limiting.")}}else sn.error("No event name provided to posthog.capture")}else sn.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}_calculate_event_properties(e,r,n,i){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return r;var o=this.persistence.remove_event_timer(e),s=t({},r);if(s.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(s.$cookieless_mode=!0),"$snapshot"===e){var a=t(t({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=a.distinct_id,(!Dn(s.distinct_id)&&!$n(s.distinct_id)||Bn(s.distinct_id))&&sn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var l,c=Za.properties({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});if(this.sessionManager){var{sessionId:u,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId();s.$session_id=u,s.$window_id=d}if(this.sessionRecording&&(s.$recording_status=this.sessionRecording.status),this.requestRouter.region===Vh.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),l="$pageview"===e?this.pageViewManager.doPageView(n,i):"$pageleave"===e?this.pageViewManager.doPageLeave(n):this.pageViewManager.doEvent(),s=dn(s,l),"$pageview"===e&&Ur&&(s.title=Ur.title),!Ln(o)){var h=n.getTime()-o;s.$duration=parseFloat((h/1e3).toFixed(3))}Kr&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=dn({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),Rn(this.config.property_denylist)?un(this.config.property_denylist,(function(e){delete s[e]})):sn.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(sn.error("sanitize_properties is deprecated. Use before_send instead"),s=p(s,e));var v=this._hasPersonProcessing();return s.$process_person_profile=v,v&&this._requirePersonProcessing("_calculate_event_properties"),s}_calculate_set_once_properties(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=dn({},this.persistence.get_initial_props(),e||{}),r=this.config.sanitize_properties;return r&&(sn.error("sanitize_properties is deprecated. Use before_send instead"),t=r(t,"$set_once")),Pn(t)?void 0:t}register(e,t){var r;null===(r=this.persistence)||void 0===r||r.register(e,t)}register_once(e,t,r){var n;null===(n=this.persistence)||void 0===n||n.register_once(e,t,r)}register_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}unregister(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}unregister_for_session(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}_register_single(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}on(e,t){return this._internalEventEmitter.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSessionId(e){var t,r;return null!==(t=null===(r=this.sessionManager)||void 0===r?void 0:r.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){this.surveys.canRenderSurvey(e)}getNextSurveyStep(e,t,r){return this.surveys.getNextSurveyStep(e,t,r)}identify(e,r,n){if(!this.__loaded||!this.persistence)return sn.uninitializedWarning("posthog.identify");if($n(e)&&(e=e.toString(),sn.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()))sn.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 if(this._requirePersonProcessing("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==i&&e!==this.get_property(ei)&&(this.unregister(ei),this.register({distinct_id:e}));var s="anonymous"===(this.persistence.get_property(Ei)||"anonymous");e!==i&&s?(this.persistence.set_property(Ei,"identified"),this.setPersonPropertiesForFlags(t(t({},n||{}),r||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:r||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(i),this._cachedIdentify=Rp(e,r,n)):(r||n)&&(this._cachedIdentify!==Rp(e,r,n)?(this.setPersonProperties(r,n),this._cachedIdentify=Rp(e,r,n)):sn.info("A duplicate posthog.identify call was made with the same properties. It has been ignored.")),e!==i&&(this.reloadFeatureFlags(),this.unregister(ki))}}else sn.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,r){(e||r)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(t(t({},r||{}),e||{})),this.capture("$set",{$set:e||{},$set_once:r||{}}))}group(e,r,n){if(e&&r){if(this._requirePersonProcessing("posthog.group")){var i=this.getGroups();i[e]!==r&&this.resetGroupPropertiesForFlags(e),this.register({$groups:t(t({},i),{},{[e]:r})}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:r,$group_set:n}),this.setGroupPropertiesForFlags({[e]:n})),i[e]===r||n||this.reloadFeatureFlags()}}else sn.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,r,n,i;if(sn.info("reset"),!this.__loaded)return sn.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(r=this.sessionPersistence)||void 0===r||r.clear(),this.surveys.reset(),null===(n=this.persistence)||void 0===n||n.set_property(Ei,"anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId(),this._cachedIdentify=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Oi,$device_id:null},"");else{var s=this.config.get_device_id(ld());this.register_once({distinct_id:s,$device_id:e?s:o},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(t));if(null!=e&&e.withTimestamp&&r){var i,o=null!==(i=e.timestampLookBack)&&void 0!==i?i:10;if(!r)return n;var s=Math.max(Math.floor(((new Date).getTime()-r)/1e3)-o,0);n+="?t=".concat(s)}return n}alias(e,t){return e===this.get_property(Qn)?(sn.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Ln(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(ei,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(sn.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var r,n,i,o,s=t({},this.config);On(e)&&(dn(this.config,Lp(e)),null===(r=this.persistence)||void 0===r||r.update_config(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Id(t(t({},this.config),{},{persistence:"sessionStorage"})),fd.is_supported()&&"true"===fd.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(nn.DEBUG=!0,sn.info("set_config",{config:e,oldConfig:s,newConfig:t({},this.config)})),null===(n=this.sessionRecording)||void 0===n||n.startIfEnabledOrStop(),null===(i=this.autocapture)||void 0===i||i.startIfEnabled(),null===(o=this.heatmaps)||void 0===o||o.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(e){var t=!0===e,r={sampling:t||!(null==e||!e.sampling),linked_flag:t||!(null==e||!e.linked_flag),url_trigger:t||!(null==e||!e.url_trigger),event_trigger:t||!(null==e||!e.event_trigger)};if(Object.values(r).some(Boolean)){var n,i,o,s,a;if(null===(n=this.sessionManager)||void 0===n||n.checkAndGetSessionAndWindowId(),r.sampling)null===(i=this.sessionRecording)||void 0===i||i.overrideSampling();if(r.linked_flag)null===(o=this.sessionRecording)||void 0===o||o.overrideLinkedFlag();if(r.url_trigger)null===(s=this.sessionRecording)||void 0===s||s.overrideTrigger("url");if(r.event_trigger)null===(a=this.sessionRecording)||void 0===a||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}captureException(e,r){var n,i=new Error("PostHog syntheticException"),o=An(null===(n=Qr.__PosthogExtensions__)||void 0===n?void 0:n.parseErrorAsProperties)?t(t({},Qr.__PosthogExtensions__.parseErrorAsProperties(Gn(e)?{error:e,event:e.message}:{event:e},{syntheticException:i})),r):t({$exception_level:"error",$exception_list:[{type:Gn(e)?e.name:"Error",value:Gn(e)?e.message:e,mechanism:{handled:!0,synthetic:!1}}]},r);this.exceptions.sendExceptionEvent(o)}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}getSessionProperty(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:Fp;return t!==Fp&&(t=Fp+"."+t),t}_isIdentified(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(Ei))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(Ei))}_hasPersonProcessing(){var e,t,r,n;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Pn(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[ei])&&(null===(r=this.persistence)||void 0===r||null===(n=r.props)||void 0===n||!n[Ni]))}_shouldCapturePageleave(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(e){return"never"===this.config.person_profiles?(sn.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Ni,!0),!0)}_sync_opt_out_with_persistence(){var e,t,r,n,i=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,s=this.config.disable_persistence||i&&!!o;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==s&&(null===(r=this.persistence)||void 0===r||r.set_disabled(s));(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==s&&(null===(n=this.sessionPersistence)||void 0===n||n.set_disabled(s))}opt_in_capturing(e){var t;(this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),Ln(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return jr?sp(jr,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Ur&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:Ur.title},{send_instantly:!0}))}debug(e){!1===e?(null==$r||$r.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==$r||$r.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}))}_runBeforeSend(e){if(Hn(this.config.before_send))return e;var t=Rn(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of t){if(r=n(r),Hn(r)){var i="Event '".concat(e.event,"' was rejected in beforeSend function");return jn(e.event)?sn.warn("".concat(i,". This can cause unexpected behavior.")):sn.info(i),null}r.properties&&!Pn(r.properties)||sn.warn("Event '".concat(e.event,"' has no properties after beforeSend function, this is likely an error."))}return r}getPageViewId(){var e;return null===(e=this.pageViewManager._currentPageview)||void 0===e?void 0:e.pageViewId}}!function(e,t){for(var r=0;r<t.length;r++)e.prototype[t[r]]=gn(e.prototype[t[r]])}(Bp,["identify"]);var qp,Hp;qp=Ap[Fp]=new Bp,(Hp=Qr.posthog)&&un(Hp._i,(function(e){if(e&&Rn(e)){var t=qp.init(e[0],e[1],e[2]),r=Hp[e[2]]||Hp;t&&(t._execute_array.call(t.people,r.people),t._execute_array(r))}})),Qr.posthog=qp,function(){function e(){e.done||(e.done=!0,Op=!1,un(Ap,(function(e){e._dom_loaded()})))}null!=Ur&&Ur.addEventListener?"complete"===Ur.readyState?e():wn(Ur,"DOMContentLoaded",e,{capture:!1}):$r&&sn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
|
|
2
2
|
//# sourceMappingURL=array.full.js.map
|