posthog-js 1.232.2 → 1.232.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,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 F(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?R(t):null}function N(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 P=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,O=/^(?:[a-z+]+:)?\/\//i,L=/^www\..*/i,D=/^(data:)([^,]*),(.*)/i;function B(e,t){return(e||"").replace(P,((e,r,n,i,o,s)=>{var a,l=n||o||s,c=r||i||"";if(!l)return e;if(O.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 j=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/;var G=new WeakMap;function U(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=G.get(e);if(r||(r=e.createElement("a"),G.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]?U(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(z),!(r>=t.length);){var o=n(j);if(","===o.slice(-1))o=U(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=U(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?U(e,n):n:U(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 N=e.value,P=e.checked;"radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&N?_.value=M({element:e,type:F(e),tagName:m,value:N,maskInputOptions:a,maskInputFn:l}):P&&(_.checked=P)}"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 O=e.toDataURL(c.type,c.quality),L=n.createElement("canvas");L.width=e.width,L.height=e.height,O!==L.toDataURL(c.type,c.quality)&&(_.rr_dataURL=O)}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:j,height:z}=e.getBoundingClientRect();_={class:_.class,rr_width:"".concat(j,"px"),rr_height:"".concat(z,"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,F=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(!F)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"===N(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}(F,v)&&(R||F.type!==h.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?Z():V;var P=Object.assign(F,{id:A});if(n.add(e,P),A===V)return null;_&&_(e);var O=!l;if(P.type===h.Element){O=O&&!P.needBlock,delete P.needBlock;var L=w.shadowRoot(e);L&&I(L)&&(P.isShadowHost=!0)}if((P.type===h.Document||P.type===h.Element)&&O){v.headWhitespace&&P.type===h.Element&&"head"===P.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(P.type===h.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else for(var B of Array.from(w.childNodes(e))){var q=ne(B,D);q&&P.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),P.childNodes.push(W))}}var j=w.parentNode(e);return j&&C(j)&&I(j)&&(P.isShadow=!0),P.type===h.Element&&"iframe"===P.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),P.type===h.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===N(P.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),P}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 Fe(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 Ne=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 Pe(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 Oe(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Pe(r);)r=t;return r}(e);return ve.contains(t,r)}function Le(e){var t=e.ownerDocument;return!!t&&(ve.contains(t,e)||Oe(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 je,ze=(e,t)=>"".concat(e,"@").concat(t);class Ge{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(Pe(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),Fe(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=F(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)?(Ue(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[ze(r,n)]?Ue(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[ze(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))),Fe(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 Ue(e,t){e.delete(t),ve.childNodes(t).forEach((t=>Ue(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(!je)return e;return function(){try{return e(...arguments)}catch(e){if(je&&!0===je(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 Ge;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=F(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 Ft{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 Nt{constructor(e){c(this,"trackedLinkElements",new WeakSet),c(this,"mutationCb"),c(this,"adoptedStyleSheetCb"),c(this,"styleMirror",new Ne),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 Pt{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 Ot=!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:F=new Set([]),errorHandler:N}=e;je=N;var P=!I||window.parent===window,O=!1;if(!P)try{window.parent.document&&(O=!1)}catch(e){O=!0}if(P&&!r)throw new Error("emit function is required");if(!P&&!O)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 _&&!O&&(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())),P)null==r||r(H(s),t);else if(O){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 Nt({mutationCb:$,adoptedStyleSheetCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.AdoptedStyleSheet},e)})}),j=new pt({mirror:qt,mutationCb:$,stylesheetManager:Z,recordCrossOriginIframes:I,wrappedEmit:Et});for(var z of R||[])z.getMirror&&z.getMirror({nodeMirror:qt,crossOriginIframeMirror:j.crossOriginIframeMirror,crossOriginIframeStyleMirror:j.crossOriginIframeStyleMirror});var G=new Pt;Tt=new Ft({recordCanvas:C,mutationCb:V,win:window,blockClass:o,blockSelector:s,mirror:qt,sampling:y.canvas,dataURLOptions:b});var U=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:j,stylesheetManager:Z,canvasManager:Tt,keepIframeSrcFn:A,processedNodeManager:G},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(),U.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)&&j.addIframe(e),Ae(e,qt)&&Z.trackLinkElement(e),Fe(e)&&U.addShadowRoot(ve.shadowRoot(e),document)},onIframeLoad:(e,t)=>{j.attachIframe(e,t),U.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:j,stylesheetManager:Z,shadowDomManager:U,processedNodeManager:G,canvasManager:Tt,ignoreCSSAttributes:F,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)};j.addLoadListener((e=>{try{Y.push(X(e.contentDocument))}catch(e){console.warn(e)}}));var J=()=>{xt(),Y.push(X(document)),Ot=!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())),G.destroy(),Ot=!1,je=void 0}}catch(e){console.warn(e)}}Ht.addCustomEvent=(e,t)=>{if(!Ot)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(!Ot)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,jt=(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),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),Ut={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 Ut?Ut[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(){Gt(this,"idNodeMap",new Map),Gt(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(){jt(this,"id",1),jt(this,"styleIDMap",new WeakMap),jt(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])?$/,Fr={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 Nr(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 Pr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Or(e,t){if(0===t)return!0;var r=Object.keys(e);for(var n of r)if(Pr(e[n])&&Or(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(Pr(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Pr(e)&&Or(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]=Nr(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=Fr.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=Fr.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=Fr.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,jr=Vr.indexOf,zr=null==Wr?void 0:Wr.navigator,Gr=null==Wr?void 0:Wr.document,Ur=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==zr?void 0:zr.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"];function nn(e,t){return-1!==e.indexOf(t)}var on=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},sn=function(e){return e.replace(/^\$/,"")};var an=Array.isArray,ln=Object.prototype,cn=ln.hasOwnProperty,un=ln.toString,dn=an||function(e){return"[object Array]"===un.call(e)},hn=e=>"function"==typeof e,pn=e=>hn(e)&&-1!==e.toString().indexOf("[native code]"),vn=()=>!!$r.Zone,gn=e=>e===Object(e)&&!dn(e),fn=e=>{if(gn(e)){for(var t in e)if(cn.call(e,t))return!1;return!0}return!1},mn=e=>void 0===e,_n=e=>"[object String]"==un.call(e),yn=e=>_n(e)&&0===e.trim().length,bn=e=>null===e,wn=e=>mn(e)||bn(e),Sn=e=>"[object Number]"==un.call(e),Cn=e=>"[object Boolean]"===un.call(e),In=e=>e instanceof Document,kn=e=>e instanceof FormData,En=e=>e instanceof Error,xn=e=>nn(tn,e),Tn={DEBUG:!1,LIB_VERSION:"1.232.2"},Mn=e=>{var t={_log:function(t){if($r&&(Tn.DEBUG||Qr.POSTHOG_DEBUG)&&!mn($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=>Mn("".concat(e," ").concat(t))};return t},Rn=Mn("[PostHog.js]"),An=Rn.createLogger,Fn={};function Nn(e,t,r){if(dn(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)===Fn)return}function Pn(e,t,r){if(!wn(e)){if(dn(e))return Nn(e,t,r);if(kn(e)){for(var n of e.entries())if(t.call(r,n[1],n[0])===Fn)return}else for(var i in e)if(cn.call(e,i)&&t.call(r,e[i],i)===Fn)return}}var On=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 Nn(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e},Ln=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 Nn(r,(function(t){Nn(t,(function(t){e.push(t)}))})),e};function Dn(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 Bn=function(e){try{return e()}catch(e){return}},qn=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){Rn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Rn.critical(e)}}},Hn=function(e){var t={};return Pn(e,(function(e,r){_n(e)&&e.length>0&&(t[r]=e)})),t};function $n(e,t){return r=e,n=e=>_n(e)&&!bn(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),dn(t)?(o=[],Nn(t,(t=>{o.push(e(t))}))):(o={},Pn(t,((t,r)=>{i.has(t)||(o[r]=e(t,r))}))),o);var o}(r);var r,n,i}var Wn=["herokuapp.com","vercel.app","netlify.app"];function Vn(e){var t=null==e?void 0:e.hostname;if(!_n(t))return!1;var r=t.split(".").slice(-2).join(".");for(var n of Wn)if(r===n)return!1;return!0}function Zn(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}function jn(e,t,r,n){var{capture:i=!1,passive:o=!0}=null!=n?n:{};null==e||e.addEventListener(t,r,{capture:i,passive:o})}var zn=["localhost","127.0.0.1"],Gn=e=>{var t=null==Gr?void 0:Gr.createElement("a");return mn(t)?null:(t.href=e,t)},Un=function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return Pn(e,(function(e,n){mn(e)||mn(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)},Yn=function(e,t){for(var r,n=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<n.length;i++){var o=n[i].split("=");if(o[0]===t){r=o;break}}if(!dn(r)||r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(e){Rn.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Xn=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("=");dn(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},Jn=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null};function Kn(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return hn(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}function Qn(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 ei="$people_distinct_id",ti="__alias",ri="__timers",ni="$autocapture_disabled_server_side",ii="$heatmaps_enabled_server_side",oi="$exception_capture_enabled_server_side",si="$web_vitals_enabled_server_side",ai="$dead_clicks_enabled_server_side",li="$web_vitals_allowed_metrics",ci="$session_recording_enabled_server_side",ui="$console_log_recording_enabled_server_side",di="$session_recording_network_payload_capture",hi="$session_recording_masking",pi="$session_recording_canvas_recording",vi="$replay_sample_rate",gi="$replay_minimum_duration",fi="$replay_script_config",mi="$sesid",_i="$session_is_sampled",yi="$session_recording_url_trigger_activated_session",bi="$session_recording_event_trigger_activated_session",wi="$enabled_feature_flags",Si="$early_access_features",Ci="$feature_flag_details",Ii="$stored_person_properties",ki="$stored_group_properties",Ei="$surveys",xi="$surveys_activated",Ti="$flag_call_reported",Mi="$user_state",Ri="$client_session_props",Ai="$capture_rate_limit",Fi="$initial_campaign_params",Ni="$initial_referrer_info",Pi="$initial_person_info",Oi="$epp",Li="__POSTHOG_TOOLBAR__",Di="$posthog_cookieless",Bi=[ei,ti,"__cmpns",ri,ci,ii,mi,wi,Mi,Si,Ci,ki,Ii,Ei,Ti,Ri,Ai,Fi,Ni,Oi];function qi(e){var t;return e instanceof Element&&(e.id===Li||!(null===(t=e.closest)||void 0===t||!t.call(e,".toolbar-global-fade-container")))}function Hi(e){return!!e&&1===e.nodeType}function $i(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Wi(e){return!!e&&3===e.nodeType}function Vi(e){return!!e&&11===e.nodeType}function Zi(e){return e?on(e).split(/\s+/):[]}function ji(e){var t=null==$r?void 0:$r.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function zi(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 Zi(t)}function Gi(e){return wn(e)?null:on(e).split(/(\s+)/).filter((e=>ao(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ui(e){var t="";return Qi(e)&&!eo(e)&&e.childNodes&&e.childNodes.length&&Pn(e.childNodes,(function(e){var r;Wi(e)&&e.textContent&&(t+=null!==(r=Gi(e.textContent))&&void 0!==r?r:"")})),on(t)}function Yi(e){return mn(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Xi=["a","button","form","input","select","textarea","label"];function Ji(e){var t=e.parentNode;return!(!t||!Hi(t))&&t}function Ki(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||$i(e,"html")||!Hi(e))return!1;if(null!=r&&r.url_allowlist&&!ji(r.url_allowlist))return!1;if(null!=r&&r.url_ignorelist&&ji(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&&!$i(c,"body");)if(Vi(c.parentNode))a.push(c.parentNode.host),c=c.parentNode.host;else{if(!(l=Ji(c)))break;if(n||Xi.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(mn(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(mn(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&&(Xi.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}function Qi(e){for(var t=e;t.parentNode&&!$i(t,"body");t=t.parentNode){var r=zi(t);if(nn(r,"ph-sensitive")||nn(r,"ph-no-capture"))return!1}if(nn(zi(e),"ph-include"))return!0;var n=e.type||"";if(_n(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(_n(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 eo(e){return!!($i(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||$i(e,"select")||$i(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var to="(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})",ro=new RegExp("^(?:".concat(to,")$")),no=new RegExp(to),io="\\d{3}-?\\d{2}-?\\d{4}",oo=new RegExp("^(".concat(io,")$")),so=new RegExp("(".concat(io,")"));function ao(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(wn(e))return!1;if(_n(e)){if(e=on(e),(t?ro:no).test((e||"").replace(/[- ]/g,"")))return!1;if((t?oo:so).test(e))return!1}return!0}function lo(e){var t=Ui(e);return ao(t="".concat(t," ").concat(co(e)).trim())?t:""}function co(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Pn(e.childNodes,(function(e){var r;if(e&&"span"===(null===(r=e.tagName)||void 0===r?void 0:r.toLowerCase()))try{var n=Ui(e);t="".concat(t," ").concat(n).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(co(e)).trim())}catch(e){Rn.error("[AutoCapture]",e)}})),t}function uo(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 Dn(s).sort(((e,t)=>{var[r]=e,[n]=t;return r.localeCompare(n)})).forEach((e=>{var[t,r]=e;return a[ho(t.toString())]=ho(r.toString())})),i+=":",i+=Dn(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:po(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Dn(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 ho(e){return e.replace(/"|\\"/g,'\\"')}function po(e){var t=e.attr__class;return t?dn(t)?t:Zi(t):void 0}var vo="[SessionRecording]",go="redacted",fo={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"]},mo=["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"],_o=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],yo=["/s/","/e/","/i/"];function bo(e,t,r,n){if(wn(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return _n(i)&&(i=parseInt(i)),i>r?vo+" ".concat(n," body too large to record (").concat(i," bytes)"):e}function wo(e,t){if(wn(e))return e;var r=e;return ao(r,!1)||(r=vo+" "+t+" body "+go),Pn(_o,(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=vo+" "+t+" body "+go+" as might contain: "+e)})),r}var So=(e,r)=>{var n,i,o,s={payloadSizeLimitBytes:fo.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...fo.performanceEntryTypeToObserve],payloadHostDenyList:[...r.payloadHostDenyList||[],...fo.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=bo(e.requestBody,e.requestHeaders,o,"Request")),null!=e&&e.responseBody&&(e.responseBody=bo(e.responseBody,e.responseHeaders,o,"Response")),e)),d=t=>{return u(((e,t)=>{var r,n=Gn(e.name),i=0===t.indexOf("http")?null===(r=Gn(t))||void 0===r?void 0:r.pathname:t;"/"===i&&(i="");var o=null==n?void 0:n.pathname.replace(i||"","");if(!(n&&o&&yo.some((e=>0===o.indexOf(e)))))return e})((n=(r=t).requestHeaders,wn(n)||Pn(Object.keys(null!=n?n:{}),(e=>{mo.includes(e.toLowerCase())&&(n[e]=go)})),r),e.api_host));var r,n},h=hn(e.session_recording.maskNetworkRequestFn);return h&&hn(e.session_recording.maskCapturedNetworkRequestFn)&&Rn.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=hn(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(!mn(e))return e.requestBody=wo(e.requestBody,"Request"),e.responseBody=wo(e.responseBody,"Response"),e}(d(e)),t(t(t({},fo),s),{},{recordHeaders:a,recordBody:l,recordPerformance:c,recordInitialRequests:c})},Co=An("[Recorder]"),Io=e=>"navigation"===e.entryType,ko=e=>"resource"===e.entryType;function Eo(e,t,r){if(r.recordInitialRequests){var n=t.performance.getEntries().filter((e=>Io(e)||ko(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=>Io(e)||ko(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 xo(e,t){return!!t&&(Cn(t)||t[e])}function To(e){var{type:t,recordBody:r,headers:n,url:i}=e;function o(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(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:t instanceof Request&&e(t.url)}catch(e){return!1}}(i))return!1;if(Cn(r))return!0;if(dn(r))return o(r);var s=r[t];return Cn(s)?s:o(s)}function Mo(e,t,r,n,i){return Ro.apply(this,arguments)}function Ro(){return Ro=n((function*(e,t,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(o>10)return Co.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=>ko(e)&&e.initiatorType===t&&(mn(n)||e.startTime>=n)&&(mn(i)||e.startTime<=i)));return s||(yield new Promise((e=>setTimeout(e,50*o))),Mo(e,t,r,n,i,o+1))})),Ro.apply(this,arguments)}function Ao(e){var{body:t,options:r,url:n}=e;if(wn(t))return null;var{hostname:i,isHostDenied:o}=Qn(n,r);if(o)return i+" is in deny list";if(_n(t))return t;if(In(t))return t.textContent;if(kn(t))return Un(t);if(gn(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 Fo=e=>!bn(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:mn(a)?void 0:Math.round(a),endTime:mn(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(Fo(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 Po=["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 Lo(){return Lo=n((function*(e){var{r:t,options:r,url:n}=e,{hostname:i,isHostDenied:o}=Qn(n,r);return o?Promise.resolve(i+" is in deny list"):Oo(t)})),Lo.apply(this,arguments)}function Do(){return Do=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=Po.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}=Qn(i,n);return l?a+" is in deny list":null}({r:t,options:r,url:n});return bn(i)?Oo(t):Promise.resolve(i)})),Do.apply(this,arguments)}function Bo(e,t,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=xo("request",r.recordHeaders),o=xo("response",r.recordHeaders),s=Kn(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),To({type:"request",headers:p,url:n,recordBody:r.recordBody})&&(h.requestBody=yield function(e){return Lo.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),To({type:"response",headers:v,url:n,recordBody:r.recordBody})&&(h.responseBody=yield function(e){return Do.apply(this,arguments)}({r:l,options:r,url:n})),l}finally{Mo(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 qo=null;function Ho(e,r,n){if(!("performance"in r))return()=>{};if(qo)return Co.warn("Network observer already initialised, doing nothing"),()=>{};var i=n?Object.assign({},fo,n):fo,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=Eo(o,r,i),a=()=>{},l=()=>{};return(i.recordHeaders||i.recordBody)&&(a=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=xo("request",r.recordHeaders),i=xo("response",r.recordHeaders),o=Kn(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=>(To({type:"request",headers:f,url:a,recordBody:r.recordBody})&&(g.requestBody=Ao({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),To({type:"response",headers:n,url:a,recordBody:r.recordBody})&&(g.responseBody=Ao({body:p.response,options:r,url:a})),Mo(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=Bo(o,r,i)),qo=()=>{s(),a(),l()}}var $o=e=>({name:"rrweb/network@1",observer:Ho,options:e});Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Hr,getRecordNetworkPlugin:$o},Qr.__PosthogExtensions__.rrweb={record:Ht,version:"v2"},Qr.rrweb={record:Ht,version:"v2"},Qr.rrwebConsoleRecord={getRecordConsolePlugin:Hr},Qr.getRecordNetworkPlugin=$o;var Wo,Vo,Zo,jo,zo,Go,Uo,Yo,Xo,Jo,Ko,Qo,es={},ts=[],rs=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ns=Array.isArray;function is(e,t){for(var r in t)e[r]=t[r];return e}function os(e){var t=e.parentNode;t&&t.removeChild(e)}function ss(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?Wo.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 as(e,s,n,i,null)}function as(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?++Zo:i,__i:-1,__u:0};return null==i&&null!=Vo.vnode&&Vo.vnode(o),o}function ls(e){return e.children}function cs(e,t){this.props=e,this.context=t}function us(e,t){if(null==t)return e.__?us(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?us(e):null}function ds(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 ds(e)}}function hs(e){(!e.__d&&(e.__d=!0)&&jo.push(e)&&!ps.__r++||zo!==Vo.debounceRendering)&&((zo=Vo.debounceRendering)||Go)(ps)}function ps(){var e,t,r,n,i,o,s,a,l;for(jo.sort(Uo);e=jo.shift();)e.__d&&(t=jo.length,n=void 0,o=(i=(r=e).__v).__e,a=[],l=[],(s=r.__P)&&((n=is({},i)).__v=i.__v+1,Vo.vnode&&Vo.vnode(n),ws(s,n,i,r.__n,void 0!==s.ownerSVGElement,32&i.__u?[o]:null,a,null==o?us(i):o,!!(32&i.__u),l),n.__.__k[n.__i]=n,Ss(a,n,l),n.__e!=o&&ds(n)),jo.length>t&&jo.sort(Uo));ps.__r=0}function vs(e,t,r,n,i,o,s,a,l,c,u){var d,h,p,v,g,f=n&&n.__k||ts,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?as(null,i,null,null,i):ns(i)?as(ls,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?as(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,a=fs(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=us(o)),Is(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=us(o)),Is(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?es:f[p.__i]||es,p.__i=d,ws(e,p,h,i,o,s,a,l,c,u),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Cs(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=gs(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 gs(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=gs(n[i],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function fs(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 ms(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||rs.test(t)?r:r+"px"}function _s(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||ms(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||ms(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?bs:ys,o)):e.removeEventListener(t,o?bs:ys,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 ys(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Vo.event?Vo.event(e):e)}function bs(e){return this.l[e.type+!0](Vo.event?Vo.event(e):e)}function ws(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=Vo.__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 cs(m,y),d.constructor=k,d.render=ks),_&&_.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=is({},d.__s)),is(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=Vo.__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=is(is({},n),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(p,v)),vs(e,ns(I=null!=u&&u.type===ls&&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),Vo.__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&&Wo.call(e.childNodes),f=r.props||es,!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||_s(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||_s(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=""),vs(e,ns(h)?h:[h],t,r,n,i&&"foreignObject"!==_,o,s,o?o[0]:r.__k&&us(r,0),a,l),null!=o)for(c=o.length;c--;)null!=o[c]&&os(o[c]);a||(c="value",void 0!==v&&(v!==e[c]||"progress"===_&&!v||"option"===_&&v!==f[c])&&_s(e,c,v,f[c],!1),c="checked",void 0!==g&&g!==e[c]&&_s(e,c,g,f[c],!1))}return e}(r.__e,t,r,n,i,o,s,l,c);(u=Vo.diffed)&&u(t)}function Ss(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)Cs(r[n],r[++n],r[++n]);Vo.__c&&Vo.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Vo.__e(e,t.__v)}}))}function Cs(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){Vo.__e(e,r)}}function Is(e,t,r){var n,i;if(Vo.unmount&&Vo.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Cs(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){Vo.__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]&&Is(n[i],t,r||"function"!=typeof e.type);r||null==e.__e||os(e.__e),e.__=e.__e=e.__d=void 0}function ks(e,t,r){return this.constructor(e,r)}function Es(e,t,r){var n,i,o,s;Vo.__&&Vo.__(e,t),i=(n="function"==typeof r)?null:t.__k,o=[],s=[],ws(t,e=(!n&&r||t).__k=ss(ls,null,[e]),i||es,es,void 0!==t.ownerSVGElement,!n&&r?[r]:i?null:t.firstChild?Wo.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,s),Ss(o,e,s)}function xs(e,t,r){var n,i,o,s,a=is({},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?Wo.call(arguments,2):r),as(e.type,a,n||e.key,i||e.ref,null)}Wo=ts.slice,Vo={__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}},Zo=0,cs.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=is({},this.state),"function"==typeof e&&(e=e(is({},r),this.props)),e&&is(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),hs(this))},cs.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),hs(this))},cs.prototype.render=ls,jo=[],Go="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Uo=function(e,t){return e.__v.__b-t.__v.__b},ps.__r=0,Yo=0,function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(Xo||(Xo={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(Jo||(Jo={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(Ko||(Ko={})),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}(Qo||(Qo={}));var Ts=An("[Stylesheet Loader]"),Ms=(e,t,r)=>{var n,i=e.createElement("style");return i.innerText=t,null!=r&&null!==(n=r.config)&&void 0!==n&&n.prepare_external_dependency_stylesheet&&(i=r.config.prepare_external_dependency_stylesheet(i)),i||(Ts.error("prepare_external_dependency_stylesheet returned null"),null)},Rs=$r,As=Gr,Fs="seenSurvey_",Ns=An("[Surveys]"),Ps=2147483647;function Os(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?"".concat(e,", ").concat(t):"-apple-system, ".concat(t)}var Ls=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(Os(null==e?void 0:e.fontFamily),";\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)||Ps.toString()),";\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: ").concat((null==e?void 0:e.disabledButtonOpacity)||"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(Os(null==e?void 0:e.fontFamily),";\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(Bs((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 .limit-height {\n max-height: 300px;\n overflow: auto;\n scrollbar-width: thin;\n scrollbar-color: ").concat((null==e?void 0:e.borderColor)||"#c9c6c6"," ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\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 Ds(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 Bs(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hs;"#"===t[0]&&(e=Ds(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=Ds(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 qs={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"},Hs="#eeeded",$s=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(Gs(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,t)=>({id:e.id,question:e.question,index:t}))),sessionRecordingUrl:null===(e=i.get_session_replay_url)||void 0===e?void 0:e.call(i)},r),{},{$set:{[Us(n,"responded")]:!0}})),Rs.dispatchEvent(new Event("PHSurveySent"))):Ns.error("[survey sent] event not captured, PostHog instance not found.")},Ws=(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:{[Us(e,"dismissed")]:!0}}),localStorage.setItem(Gs(e),"true"),Rs.dispatchEvent(new Event("PHSurveyClosed"))):Ns.error("[survey dismissed] event not captured, PostHog instance not found.")},Vs=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Zs=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,js=e=>e.appearance&&e.appearance.shuffleQuestions?Zs(e.questions,Vs(e.questions)):e.questions,zs=e=>{var t,r;return e.schedule===Qo.Always&&e.type===Xo.Widget||!(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))},Gs=e=>{var t="".concat(Fs).concat(e.id);return e.current_iteration&&e.current_iteration>0&&(t="".concat(Fs).concat(e.id,"_").concat(e.current_iteration)),t},Us=(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},Ys=function(e,t){var r={__c:t="__cC"+Yo++,__: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,hs(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,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},onPopupSurveySent:()=>{}}),Xs=e=>{var{component:t,children:r,renderAsHtml:n,style:i}=e;return xs(t,n?{dangerouslySetInnerHTML:{__html:r},style:i}:{children:r,style:i})},Js="Mobile",Ks="iOS",Qs="Android",ea="Tablet",ta=Qs+" "+ea,ra="iPad",na="Apple",ia=na+" Watch",oa="Safari",sa="BlackBerry",aa="Samsung",la=aa+"Browser",ca=aa+" Internet",ua="Chrome",da=ua+" OS",ha=ua+" "+Ks,pa="Internet Explorer",va=pa+" "+Js,ga="Opera",fa=ga+" Mini",ma="Edge",_a="Microsoft "+ma,ya="Firefox",ba=ya+" "+Ks,wa="Nintendo",Sa="PlayStation",Ca="Xbox",Ia=Qs+" "+Js,ka=Js+" "+oa,Ea="Windows",xa=Ea+" Phone",Ta="Nokia",Ma="Ouya",Ra="Generic",Aa=Ra+" "+Js.toLowerCase(),Fa=Ra+" "+ea.toLowerCase(),Na="Konqueror",Pa="(\\d+(\\.\\d+)?)",Oa=new RegExp("Version/"+Pa),La=new RegExp(Ca,"i"),Da=new RegExp(Sa+" \\w+","i"),Ba=new RegExp(wa+" \\w+","i"),qa=new RegExp(sa+"|PlayBook|BB10","i"),Ha={"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 $a=(e,t)=>t&&nn(t,na)||function(e){return nn(e,oa)&&!nn(e,ua)&&!nn(e,Qs)}(e),Wa=function(e,t){return t=t||"",nn(e," OPR/")&&nn(e,"Mini")?fa:nn(e," OPR/")?ga:qa.test(e)?sa:nn(e,"IE"+Js)||nn(e,"WPDesktop")?va:nn(e,la)?ca:nn(e,ma)||nn(e,"Edg/")?_a:nn(e,"FBIOS")?"Facebook "+Js:nn(e,"UCWEB")||nn(e,"UCBrowser")?"UC Browser":nn(e,"CriOS")?ha:nn(e,"CrMo")||nn(e,ua)?ua:nn(e,Qs)&&nn(e,oa)?Ia:nn(e,"FxiOS")?ba:nn(e.toLowerCase(),Na.toLowerCase())?Na:$a(e,t)?nn(e,Js)?ka:oa:nn(e,ya)?ya:nn(e,"MSIE")||nn(e,"Trident/")?pa:nn(e,"Gecko")?ya:""},Va={[va]:[new RegExp("rv:"+Pa)],[_a]:[new RegExp(ma+"?\\/"+Pa)],[ua]:[new RegExp("("+ua+"|CrMo)\\/"+Pa)],[ha]:[new RegExp("CriOS\\/"+Pa)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Pa)],[oa]:[Oa],[ka]:[Oa],[ga]:[new RegExp("(Opera|OPR)\\/"+Pa)],[ya]:[new RegExp(ya+"\\/"+Pa)],[ba]:[new RegExp("FxiOS\\/"+Pa)],[Na]:[new RegExp("Konqueror[:/]?"+Pa,"i")],[sa]:[new RegExp(sa+" "+Pa),Oa],[Ia]:[new RegExp("android\\s"+Pa,"i")],[ca]:[new RegExp(la+"\\/"+Pa)],[pa]:[new RegExp("(rv:|MSIE )"+Pa)],Mozilla:[new RegExp("rv:"+Pa)]},Za=[[new RegExp(Ca+"; "+Ca+" (.*?)[);]","i"),e=>[Ca,e&&e[1]||""]],[new RegExp(wa,"i"),[wa,""]],[new RegExp(Sa,"i"),[Sa,""]],[qa,[sa,""]],[new RegExp(Ea,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[xa,""];if(new RegExp(Js).test(t)&&!/IEMobile\b/.test(t))return[Ea+" "+Js,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var n=r[1],i=Ha[n]||"";return/arm/i.test(t)&&(i="RT"),[Ea,i]}return[Ea,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Ks,t.join(".")]}return[Ks,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=mn(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Qs+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Qs+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Qs,t.join(".")]}return[Qs,""]}],[/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/,[da,""]],[/Linux|debian/i,["Linux",""]]],ja=function(e){return Ba.test(e)?wa:Da.test(e)?Sa:La.test(e)?Ca:new RegExp(Ma,"i").test(e)?Ma:new RegExp("("+xa+"|WPDesktop)","i").test(e)?xa:/iPad/.test(e)?ra:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ia:qa.test(e)?sa:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Ta,"i").test(e)?Ta:/(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(Js).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)?Qs:ta:Qs:new RegExp("(pda|"+Js+")","i").test(e)?Aa:new RegExp(ea,"i").test(e)&&!new RegExp(ea+" pc","i").test(e)?Fa:""},za="https?://(.*)",Ga=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","irclid","_kx"],Ua=Ln(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Ga),Ya="<masked>",Xa={campaignParams:function(){var{customTrackedParams:e,maskPersonalDataProperties:t,customPersonalDataProperties:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Gr)return{};var n=t?Ln([],Ga,r||[]):[];return this._campaignParamsFromUrl(Xn(Gr.URL,n,Ya),e)},_campaignParamsFromUrl:function(e,t){var r=Ua.concat(t||[]),n={};return Pn(r,(function(t){var r=Yn(e,t);n[t]=r||null})),n},_searchEngine:function(e){return e?0===e.search(za+"google.([^/?]*)")?"google":0===e.search(za+"bing.com")?"bing":0===e.search(za+"yahoo.com")?"yahoo":0===e.search(za+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=Xa._searchEngine(e),r="yahoo"!=t?"q":"p",n={};if(!bn(t)){n.$search_engine=t;var i=Gr?Yn(Gr.referrer,r):"";i.length&&(n.ph_keyword=i)}return n},searchInfo:function(){var e=null==Gr?void 0:Gr.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:Wa,browserVersion:function(e,t){var r=Wa(e,t),n=Va[r];if(mn(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<Za.length;t++){var[r,n]=Za[t],i=r.exec(e),o=i&&(hn(n)?n(i,e):n);if(o)return o}return["",""]},device:ja,deviceType:function(e){var t=ja(e);return t===ra||t===ta||"Kobo"===t||"Kindle Fire"===t||t===Fa?ea:t===wa||t===Ca||t===Sa||t===Ma?"Console":t===ia?"Wearable":t?Js:"Desktop"},referrer:function(){return(null==Gr?void 0:Gr.referrer)||"$direct"},referringDomain:function(){var e;return null!=Gr&&Gr.referrer&&(null===(e=Gn(Gr.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},personInfo:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e?Ln([],Ga,t||[]):[],n=null==Ur?void 0:Ur.href.substring(0,1e3);return{r:this.referrer().substring(0,1e3),u:n?Xn(n,r,Ya):void 0}},personPropsFromInfo:function(e){var t,{r:r,u:n}=e,i={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null===(t=Gn(r))||void 0===t?void 0:t.host};if(n){i.$current_url=n;var o=Gn(n);i.$host=null==o?void 0:o.host,i.$pathname=null==o?void 0:o.pathname;var s=this._campaignParamsFromUrl(n);On(i,s)}if(r){var a=this._searchInfoFromReferrer(r);On(i,a)}return i},initialPersonPropsFromInfo:function(e){var t=this.personPropsFromInfo(e),r={};return Pn(t,(function(e,t){r["$initial_".concat(sn(t))]=e})),r},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?Ln([],Ga,t||[]):[],[n,i]=Xa.os(Kr);return On(Hn({$os:n,$os_version:i,$browser:Xa.browser(Kr,navigator.vendor),$device:Xa.device(Kr),$device_type:Xa.deviceType(Kr),$timezone:Xa.timezone(),$timezone_offset:Xa.timezoneOffset()}),{$current_url:Xn(null==Ur?void 0:Ur.href,r,Ya),$host:null==Ur?void 0:Ur.host,$pathname:null==Ur?void 0:Ur.pathname,$raw_user_agent:Kr.length>1e3?Kr.substring(0,997)+"...":Kr,$browser_version:Xa.browserVersion(Kr,navigator.vendor),$browser_language:Xa.browserLanguage(),$browser_language_prefix:Xa.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:Tn.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]=Xa.os(Kr);return On(Hn({$os:e,$os_version:t,$browser:Xa.browser(Kr,navigator.vendor)}),{$browser_version:Xa.browserVersion(Kr,navigator.vendor)})}},Ja=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}};class Ka{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 Qa{constructor(e){i(this,"_debugEventEmitter",new Ka),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(!mn(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(!mn(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(!Qa.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&&Ja(e,t);case"exact":return t===e;case"contains":var n=Qa.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return Ja(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&&!Qa.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&&!Qa.matchString(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!Qa.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 el{constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;mn(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 Qa(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[xi])||[];if(el.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[xi])||[];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({[xi]:[...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[xi];return r||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}i(el,"SURVEY_SHOWN_EVENT_NAME","survey shown");var tl=An("[Surveys]"),rl={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=>Ja(t,e))),not_regex:(e,t)=>e.every((e=>!Ja(t,e))),exact:(e,t)=>e.some((e=>t===e)),is_not:(e,t)=>e.every((e=>t!==e))};function nl(e){return null!=e?e:"icontains"}function il(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 rl[nl(null===(n=e.conditions)||void 0===n?void 0:n.urlMatchType)](o,i)}class ol{constructor(e){i(this,"_isFetchingSurveys",!1),i(this,"_isInitializingSurveys",!1),this.instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){this._decideServerResponse=!!e.surveys,tl.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(Fs)&&e.push(r)}return e})();e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this._isInitializingSurveys)tl.info("Already initializing surveys, skipping...");else if(this.instance.config.disable_surveys)tl.info("Disabled. Not loading surveys.");else{var e=null==Qr?void 0:Qr.__PosthogExtensions__;if(e)if(this._decideServerResponse){this._isInitializingSurveys=!0;try{var t=e.generateSurveys;if(t)this._surveyManager=t(this.instance),this._isInitializingSurveys=!1,this._surveyEventReceiver=new el(this.instance),tl.info("Surveys loaded successfully");else{var r=e.loadExternalDependency;r?r(this.instance,"surveys",(t=>{if(t||!e.generateSurveys)return tl.error("Could not load surveys script",t),void(this._isInitializingSurveys=!1);this._surveyManager=e.generateSurveys(this.instance),this._isInitializingSurveys=!1,this._surveyEventReceiver=new el(this.instance),tl.info("Surveys loaded successfully")})):(tl.error("PostHog loadExternalDependency extension not found. Cannot load remote config."),this._isInitializingSurveys=!1)}}catch(e){throw tl.error("Error initializing surveys",e),this._isInitializingSurveys=!1,e}}else tl.warn("Decide not loaded yet. Not loading surveys.");else tl.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 tl.info("Disabled. Not loading surveys."),e([]);var r=this.instance.get_property(Ei);if(r&&!t)return e(r);if(this._isFetchingSurveys)return e([]);try{this._isFetchingSurveys=!0,this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",timeout:this.instance.config.surveys_request_timeout_ms,callback:t=>{var r;this._isFetchingSurveys=!1;var n=t.statusCode;if(200!==n||!t.json)return tl.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({[Ei]:o}),e(o)}})}catch(e){throw this._isFetchingSurveys=!1,e}}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=il(e),n=null===(t=e.conditions)||void 0===t||!t.selector||(null==Gr?void 0:Gr.querySelector(e.conditions.selector)),i=function(e){var t,r,n;if(null===(t=e.conditions)||void 0===t||!t.deviceTypes||0===(null===(r=e.conditions)||void 0===r?void 0:r.deviceTypes.length))return!0;if(!Kr)return!1;var i=Xa.deviceType(Kr);return rl[nl(null===(n=e.conditions)||void 0===n?void 0:n.deviceTypesMatchType)](e.conditions.deviceTypes,i)}(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 wn(null===(t=Qr.__PosthogExtensions__)||void 0===t?void 0:t.canActivateRepeatedly)?(tl.warn("init was not called"),!1):Qr.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){wn(this._surveyManager)?tl.warn("init was not called"):this.getSurveys((t=>{var r=t.filter((t=>t.id===e))[0];this._surveyManager.canRenderSurvey(r)}))}renderSurvey(e,t){wn(this._surveyManager)?tl.warn("init was not called"):this.getSurveys((r=>{var n=r.filter((t=>t.id===e))[0];this._surveyManager.renderSurvey(n,null==Gr?void 0:Gr.querySelector(t))}))}}var sl,al,ll,cl,ul=0,dl=[],hl=[],pl=Vo.__b,vl=Vo.__r,gl=Vo.diffed,fl=Vo.__c,ml=Vo.unmount;function _l(e,t){Vo.__h&&Vo.__h(al,e,ul||t),ul=0;var r=al.__H||(al.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:hl}),r.__[e]}function yl(e){return ul=1,function(e,t,r){var n=_l(sl++,2);if(n.t=e,!n.__c&&(n.__=[Rl(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=al,!al.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))};al.u=!0;var o=al.shouldComponentUpdate,s=al.componentWillUpdate;al.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)},al.shouldComponentUpdate=i}return n.__N||n.__}(Rl,e)}function bl(e,t){var r=_l(sl++,3);!Vo.__s&&Ml(r.__H,t)&&(r.__=e,r.i=t,al.__H.__h.push(r))}function wl(e){return ul=5,Sl((function(){return{current:e}}),[])}function Sl(e,t){var r=_l(sl++,7);return Ml(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Cl(e){var t=al.context[e.__c],r=_l(sl++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(al)),t.props.value):e.__}function Il(){for(var e;e=dl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(xl),e.__H.__h.forEach(Tl),e.__H.__h=[]}catch(t){e.__H.__h=[],Vo.__e(t,e.__v)}}Vo.__b=function(e){al=null,pl&&pl(e)},Vo.__r=function(e){vl&&vl(e),sl=0;var t=(al=e.__c).__H;t&&(ll===al?(t.__h=[],al.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=hl,e.__N=e.i=void 0}))):(t.__h.forEach(xl),t.__h.forEach(Tl),t.__h=[],sl=0)),ll=al},Vo.diffed=function(e){gl&&gl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==dl.push(t)&&cl===Vo.requestAnimationFrame||((cl=Vo.requestAnimationFrame)||El)(Il)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==hl&&(e.__=e.__V),e.i=void 0,e.__V=hl}))),ll=al=null},Vo.__c=function(e,t){t.some((function(e){try{e.__h.forEach(xl),e.__h=e.__h.filter((function(e){return!e.__||Tl(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Vo.__e(r,e.__v)}})),fl&&fl(e,t)},Vo.unmount=function(e){ml&&ml(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{xl(e)}catch(e){t=e}})),r.__H=void 0,t&&Vo.__e(t,r.__v))};var kl="function"==typeof requestAnimationFrame;function El(e){var t,r=function(){clearTimeout(n),kl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);kl&&(t=requestAnimationFrame(r))}function xl(e){var t=al,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),al=t}function Tl(e){var t=al;e.__c=e.__(),al=t}function Ml(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function Rl(e,t){return"function"==typeof t?t(e):t}var Al=Gr;function Fl(e,t){var r,n=Al.createElement("div");n.className="PostHogWidget".concat(e.id);var i,o=n.attachShadow({mode:"open"}),s=(i=null===(r=e.appearance)||void 0===r?void 0:r.widgetColor,"\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ".concat(i||"#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: ").concat(Ps,";\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n ")),a=Ms(Al,s,t);return a&&o.append(a),Al.body.appendChild(n),o}var Nl=0;function Pl(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:--Nl,__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 Vo.vnode&&Vo.vnode(c),c}var Ol=Pl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pl("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"})}),Ll=Pl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pl("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"})}),Dl=Pl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pl("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"})}),Bl=Pl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pl("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"})}),ql=Pl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pl("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"})}),Hl=Pl("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Pl("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"})}),$l=Pl("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Pl("g",{"clip-path":"url(#clip0_2415_6911)",children:[Pl("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Pl("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Pl("g",{mask:"url(#mask0_2415_6911)",children:[Pl("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"}),Pl("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"}),Pl("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"}),Pl("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"}),Pl("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"}),Pl("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"})]})]}),Pl("defs",{children:Pl("clipPath",{id:"clip0_2415_6911",children:Pl("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),Wl=Pl("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Pl("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 Vl(){return Pl("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",$l]})}function Zl(e){var{text:t,submitDisabled:r,appearance:n,onSubmit:i,link:o,onPreviewSubmit:s}=e,{isPreviewMode:a,isPopup:l}=Cl(Ys),c=n.submitButtonTextColor||Bs(n.submitButtonColor||qs.submitButtonColor);return Pl("div",{className:"bottom-section",children:[Pl("div",{className:"buttons",children:Pl("button",{className:"form-submit",disabled:r,type:"button",style:l?{color:c}:{},onClick:()=>{o&&(null==$r||$r.open(o)),a?null==s||s():i()},children:t})}),!n.whiteLabel&&Pl(Vl,{})]})}function jl(e){var{question:t,description:r,descriptionContentType:n,backgroundColor:i,forceDisableHtml:o}=e,{isPopup:s}=Cl(Ys);return Pl("div",{style:s?{backgroundColor:i||qs.backgroundColor}:{},children:[Pl("div",{className:"survey-question",children:t}),r&&Xs({component:ss("div",{className:"survey-question-description"}),children:r,renderAsHtml:!o&&"text"!==n})]})}function zl(e){var{onClick:t}=e,{isPreviewMode:r}=Cl(Ys);return Pl("div",{className:"cancel-btn-wrapper",onClick:t,disabled:r,children:Pl("button",{className:"form-cancel",onClick:t,disabled:r,children:Hl})})}function Gl(e){var{header:r,description:n,contentType:i,forceDisableHtml:o,appearance:s,onClose:a,styleOverrides:l}=e,c=Bs(s.backgroundColor||qs.backgroundColor),{isPopup:u}=Cl(Ys);return Pl(ls,{children:Pl("div",{className:"thank-you-message",style:t({},l),children:Pl("div",{className:"thank-you-message-container",children:[u&&Pl(zl,{onClick:()=>a()}),Pl("h3",{className:"thank-you-message-header",style:{color:c},children:r}),n&&Xs({component:ss("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!o&&"text"!==i,style:{color:c}}),u&&Pl(Zl,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})})})}function Ul(e){var t,r=wl(null),[n,i]=yl(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return bl((()=>{if(r.current){var e=function(e){var t=Rs.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 Yl(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o}=e,s=wl(null),[a,l]=yl("");return Pl("div",{ref:s,children:[Pl(jl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:n.backgroundColor,forceDisableHtml:r}),Pl("textarea",{rows:4,placeholder:null==n?void 0:n.placeholder,onInput:e=>l(e.currentTarget.value)}),Pl(Zl,{text:t.buttonText||"Submit",submitDisabled:!a&&!t.optional,appearance:n,onSubmit:()=>i(a),onPreviewSubmit:()=>o(a)})]})}function Xl(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o}=e;return Pl(ls,{children:[Pl(jl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r}),Pl(Zl,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function Jl(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]=yl(null);return Pl(ls,{children:[Pl(jl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r,backgroundColor:i.backgroundColor}),Pl("div",{className:"rating-section",children:[Pl("div",{className:"rating-options",children:["emoji"===t.display&&Pl("div",{className:"rating-options-emoji",children:(3===t.scale?ec:tc).map(((e,t)=>{var r=t+1===c;return Pl("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&&Pl("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat(".concat(a-l+1,", minmax(0, 1fr))")},children:oc(t.scale).map(((e,t)=>Pl(Kl,{displayQuestionIndex:n,active:c===e,appearance:i,num:e,setActiveNumber:e=>{u(e)}},t)))})]}),Pl("div",{className:"rating-text",children:[Pl("div",{children:t.lowerBoundLabel}),Pl("div",{children:t.upperBoundLabel})]})]}),Pl(Zl,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:bn(c)&&!t.optional,appearance:i,onSubmit:()=>o(c),onPreviewSubmit:()=>s(c)})]})}function Kl(e){var{num:t,active:r,displayQuestionIndex:n,appearance:i,setActiveNumber:o}=e,{textColor:s,ref:a}=Ul({appearance:i,defaultTextColor:"black",forceUpdate:r});return Pl("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 Ql(e){var{question:t,forceDisableHtml:r,displayQuestionIndex:n,appearance:i,onSubmit:o,onPreviewSubmit:s}=e,a=wl(null),l=Sl((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var n=Zs(t,Vs(t));return e.hasOpenChoice&&(e.choices.push(r),n.push(r)),n})(t)),[t]),[c,u]=yl(t.type===Jo.MultipleChoice?[]:null),[d,h]=yl(!1),[p,v]=yl(""),g=t.type===Jo.SingleChoice?"radio":"checkbox";return Pl("div",{ref:a,children:[Pl(jl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r,backgroundColor:i.backgroundColor}),Pl("div",{className:"multiple-choice-options limit-height",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"),Pl("div",{className:i,children:[Pl("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===Jo.SingleChoice?u(o):t.type===Jo.MultipleChoice&&dn(c)?c.includes(o)?u(c.filter((e=>e!==o))):u([...c,o]):void 0}),Pl("label",{htmlFor:"surveyQuestion".concat(n,"Choice").concat(r),style:{color:"black"},children:t.hasOpenChoice&&r===t.choices.length-1?Pl(ls,{children:[Pl("span",{children:[s,":"]}),Pl("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===Jo.SingleChoice?u(r):t.type===Jo.MultipleChoice&&dn(c)?v(r):void 0}})]}):s}),Pl("span",{className:"choice-check",style:{color:"black"},children:Wl})]})}))}),Pl(Zl,{text:t.buttonText||"Submit",submitDisabled:(bn(c)||dn(c)&&!d&&0===c.length||dn(c)&&d&&!p&&0===c.length&&!t.optional)&&!t.optional,appearance:i,onSubmit:()=>{d&&t.type===Jo.MultipleChoice?dn(c)&&o([...c,p]):o(c)},onPreviewSubmit:()=>{d&&t.type===Jo.MultipleChoice?dn(c)&&s([...c,p]):s(c)}})]})}var ec=[Dl,Ll,Ol],tc=[Bl,Dl,Ll,Ol,ql],rc=[1,2,3,4,5],nc=[1,2,3,4,5,6,7],ic=[0,1,2,3,4,5,6,7,8,9,10];function oc(e){switch(e){case 5:default:return rc;case 7:return nc;case 10:return ic}}var sc=An("[Surveys]"),ac=$r,lc=Gr;function cc(e){return".PostHogWidget".concat(e)}function uc(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?Ko.End:o;if(i.branching.type===Ko.End)return Ko.End;if(i.branching.type===Ko.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===Ko.ResponseBased){if(i.type===Jo.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===Ko.End?Ko.End:o}}else if(i.type===Jo.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===Ko.End?Ko.End:o}}return o}return sc.warn("Falling back to next question index due to unexpected branching type"),o}class dc{constructor(e){var r=this;i(this,"surveyTimeouts",new Map),i(this,"canShowNextEventBasedSurvey",(()=>{var e,t=lc.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 r,n=null===(r=e.conditions)||void 0===r?void 0:r.seenSurveyWaitPeriodInDays;if(((e,t)=>{if(!t||!e)return!0;var r=new Date,n=Math.abs(r.getTime()-new Date(e).getTime());return Math.ceil(n/864e5)>t})(localStorage.getItem("lastSeenSurveyDate"),n)){var i=(e=>!!localStorage.getItem(Gs(e))&&!zs(e))(e);if(!i){var o;this.clearSurveyTimeout(e.id),this.addSurveyToFocus(e.id);var s=(null===(o=e.appearance)||void 0===o?void 0:o.surveyPopupDelaySeconds)||0,a=((e,t,r,n)=>{var i=As.createElement("div");i.className="PostHogSurvey".concat(t);var o=i.attachShadow({mode:"open"});if(e){var s=Ms(As,e,n);s&&o.appendChild(s)}return As.body.appendChild(i),o})(Ls(null==e?void 0:e.appearance),e.id,0,this.posthog);if(s<=0)return Es(Pl(vc,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),a);var l=setTimeout((()=>{if(!il(e))return this.removeSurveyFromFocus(e.id);Es(Pl(vc,{posthog:this.posthog,survey:t(t({},e),{},{appearance:t(t({},e.appearance),{},{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),a)}),1e3*s);this.surveyTimeouts.set(e.id,l)}}})),i(this,"handleWidget",(e=>{var t=Fl(e,this.posthog),r=Ls(e.appearance),n=Ms(lc,r,this.posthog);n&&t.appendChild(n),Es(Pl(fc,{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)&&lc.querySelector(e.appearance.widgetSelector);if(r)if(0===lc.querySelectorAll(".PostHogWidget".concat(e.id)).length)this.handleWidget(e);else if(1===lc.querySelectorAll(".PostHogWidget".concat(e.id)).length&&!r.getAttribute("PHWidgetSurveyClickListener")){var n,i,o=null===(n=lc.querySelector(cc(e.id)))||void 0===n||null===(i=n.shadowRoot)||void 0===i?void 0:i.querySelector(".survey-form");jn(r,"click",(()=>{o&&(o.style.display="none"===o.style.display?"block":"none",jn(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!=Xo.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)=>{Es(Pl(vc,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)})),i(this,"callSurveysAndEvaluateDisplayLogic",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=r.posthog)||void 0===e||e.getActiveMatchingSurveys((e=>{var t=e.filter((e=>"api"!==e.type));r.sortSurveysByAppearanceDelay(t).forEach((e=>{if(bn(r.surveyInFocus)){var t,n,i;if(e.type===Xo.Widget)"tab"===(null===(t=e.appearance)||void 0===t?void 0:t.widgetType)&&0===lc.querySelectorAll(".PostHogWidget".concat(e.id)).length&&r.handleWidget(e),"selector"===(null===(n=e.appearance)||void 0===n?void 0:n.widgetType)&&null!==(i=e.appearance)&&void 0!==i&&i.widgetSelector&&r.handleWidgetSelector(e);e.type===Xo.Popover&&r.canShowNextEventBasedSurvey()&&r.handlePopoverSurvey(e)}}))}),t)})),i(this,"addSurveyToFocus",(e=>{bn(this.surveyInFocus)||sc.error("Survey ".concat([...this.surveyInFocus]," already in focus. Cannot add survey ").concat(e,".")),this.surveyInFocus=e})),i(this,"removeSurveyFromFocus",(e=>{this.surveyInFocus!==e&&sc.error("Survey ".concat(e," is not in focus. Cannot remove survey ").concat(e,".")),this.clearSurveyTimeout(e),this.surveyInFocus=null})),this.posthog=e,this.surveyInFocus=null}clearSurveyTimeout(e){var t=this.surveyTimeouts.get(e);t&&(clearTimeout(t),this.surveyTimeouts.delete(e))}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,surveyTimeouts:this.surveyTimeouts,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}function hc(e){if(lc&&ac){var t=new dc(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}}function pc(e){var{survey:t,removeSurveyFromFocus:r,setSurveyVisible:n,isPreviewMode:i=!1}=e;bl((()=>{var e;if(!i&&null!==(e=t.conditions)&&void 0!==e&&e.url){var o=()=>{if(!il(t))return n(!1),r(t.id)};jn(ac,"popstate",o),jn(ac,"hashchange",o);var s=ac.history.pushState,a=ac.history.replaceState;return ac.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.apply(this,t),o()},ac.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t),o()},()=>{ac.removeEventListener("popstate",o),ac.removeEventListener("hashchange",o),ac.history.pushState=s,ac.history.replaceState=a}}}),[i,t,r,n])}function vc(e){var r,n,i,o,s,a,{survey:l,forceDisableHtml:c,posthog:u,style:d,previewPageIndex:h,removeSurveyFromFocus:p,isPopup:v,onPreviewSubmit:g=(()=>{}),onPopupSurveyDismissed:f=(()=>{}),onPopupSurveySent:m=(()=>{})}=e,_=Number.isInteger(h),y=null!==(r=l.appearance)&&void 0!==r&&r.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:b,isSurveySent:w,setIsPopupVisible:S}=function(e,t,r,n,i){var[o,s]=yl(n||0===r),[a,l]=yl(!1);return bl((()=>{if(t){if(!n){var o=()=>{i(e.id),s(!1)},a=()=>{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))},c=()=>{var r;il(e)&&(s(!0),ac.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()),setTimeout((()=>{var t,r,n=null===(t=lc.querySelector(cc(e.id)))||void 0===t||null===(r=t.shadowRoot)||void 0===r?void 0:r.querySelector('textarea, input[type="text"]');n&&n.focus()}),100))};if(jn(ac,"PHSurveyClosed",o),jn(ac,"PHSurveySent",a),r>0){var u=setTimeout(c,r);return()=>{clearTimeout(u),ac.removeEventListener("PHSurveyClosed",o),ac.removeEventListener("PHSurveySent",a)}}return c(),()=>{ac.removeEventListener("PHSurveyClosed",o),ac.removeEventListener("PHSurveySent",a)}}}else sc.error("usePopupVisibility hook called without a PostHog instance.")}),[]),pc({survey:e,removeSurveyFromFocus:i,setSurveyVisible:s,isPreviewMode:n}),{isPopupVisible:o,isSurveySent:a,setIsPopupVisible:s}}(l,u,y,_,p),C=w||h===l.questions.length,I=null!==(n=d)&&void 0!==n&&n.left&&Sn(null===(i=d)||void 0===i?void 0:i.left)?{left:d.left-40}:{};return _&&((d=d||{}).left="unset",d.right="unset",d.transform="unset"),b?Pl(Ys.Provider,{value:{isPreviewMode:_,previewPageIndex:h,onPopupSurveyDismissed:()=>{Ws(l,u,_),f()},isPopup:v||!1,onPreviewSubmit:g,onPopupSurveySent:()=>{m()}},children:C?Pl(Gl,{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||qs,styleOverrides:t(t({},d),I),onClose:()=>S(!1)}):Pl(gc,{survey:l,forceDisableHtml:!!c,posthog:u,styleOverrides:d})}):null}function gc(e){var r,n,{survey:i,forceDisableHtml:o,posthog:s,styleOverrides:a}=e,l=Bs((null===(r=i.appearance)||void 0===r?void 0:r.backgroundColor)||qs.backgroundColor),[c,u]=yl({}),{previewPageIndex:d,onPopupSurveyDismissed:h,isPopup:p,onPreviewSubmit:v,onPopupSurveySent:g}=Cl(Ys),[f,m]=yl(d||0),_=Sl((()=>js(i)),[i]);bl((()=>{m(null!=d?d:0)}),[d]);return Pl("form",{className:"survey-form",style:p?t({color:l,borderColor:null===(n=i.appearance)||void 0===n?void 0:n.borderColor},a):{},children:_.map(((e,r)=>{var n;return f===r&&Pl("div",{className:"survey-box",style:p?{backgroundColor:(null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||qs.backgroundColor}:{},children:[p&&Pl(zl,{onClick:()=>{h()}}),mc({question:e,forceDisableHtml:o,displayQuestionIndex:r,appearance:i.appearance||qs,onSubmit:n=>(e=>{var{res:r,displayQuestionIndex:n,questionId:o}=e;if(s)if(o){var a=function(e){return"$survey_response_".concat(e)}(o);u(t(t({},c),{},{[a]:r}));var l=uc(i,n,r);l===Ko.End?($s(t(t({},c),{},{[a]:r}),i,s),g()):m(l)}else sc.error("onNextButtonClick called without a questionId.");else sc.error("onNextButtonClick called without a PostHog instance.")})({res:n,displayQuestionIndex:r,questionId:e.id}),onPreviewSubmit:v})]})}))})}function fc(e){var t,r,{survey:n,forceDisableHtml:i,posthog:o,readOnly:s,removeSurveyFromFocus:a}=e,[l,c]=yl(!0),[u,d]=yl(!1),[h,p]=yl({}),v=wl(null);if(bl((()=>{var e,t;if(o){if(!s){if("tab"===(null===(e=n.appearance)||void 0===e?void 0:e.widgetType)&&v.current){var r,i=v.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")};p(a)}if("selector"===(null===(t=n.appearance)||void 0===t?void 0:t.widgetType)){var l,c=null!==(l=lc.querySelector(n.appearance.widgetSelector||""))&&void 0!==l?l:void 0;jn(c,"click",(e=>{var t,r,i=e.currentTarget.getBoundingClientRect(),o=ac.innerHeight,s=parseInt((null===(t=n.appearance)||void 0===t?void 0:t.maxWidth)||"300"),a=i.left+i.width/2-s/2;a+s>ac.innerWidth&&(a=ac.innerWidth-s-20),a<20&&(a=20);var l=!1;i.bottom+300>o&&(l=!0);var c;c=l?null:i.bottom+ac.scrollY+12,p({position:"fixed",top:l?"auto":c+"px",left:a+"px",right:"auto",bottom:l?ac.innerHeight-i.top+12+"px":"auto",transform:"none",border:"1.5px solid ".concat((null===(r=n.appearance)||void 0===r?void 0:r.borderColor)||"#c9c6c6"),borderRadius:"10px",width:"".concat(s,"px"),zIndex:Ps,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",maxHeight:l?"calc(100vh - 40px - ".concat(24,"px)"):"calc(100vh - ".concat(c,"px - 20px)")}),d(!u)})),null==c||c.setAttribute("PHWidgetSurveyClickListener","true")}}}else sc.error("FeedbackWidget called without a PostHog instance.")}),[]),pc({survey:n,removeSurveyFromFocus:a,setSurveyVisible:c}),!l)return null;var g=()=>{d(!1)};return Pl(ls,{children:["tab"===(null===(t=n.appearance)||void 0===t?void 0:t.widgetType)&&Pl("div",{className:"ph-survey-widget-tab",ref:v,onClick:()=>!s&&d(!u),style:{color:Bs(n.appearance.widgetColor)},children:[Pl("div",{className:"ph-survey-widget-tab-icon"}),(null===(r=n.appearance)||void 0===r?void 0:r.widgetLabel)||""]}),u&&Pl(vc,{posthog:o,survey:n,forceDisableHtml:i,style:h,removeSurveyFromFocus:a,isPopup:!0,onPopupSurveyDismissed:g,onPopupSurveySent:g},"feedback-widget-survey")]})}var mc=e=>{var{question:r,forceDisableHtml:n,displayQuestionIndex:i,appearance:o,onSubmit:s,onPreviewSubmit:a}=e,l={[Jo.Open]:Yl,[Jo.Link]:Xl,[Jo.Rating]:Jl,[Jo.SingleChoice]:Ql,[Jo.MultipleChoice]:Ql},c={question:r,forceDisableHtml:n,appearance:o,onPreviewSubmit:e=>{a(e)},onSubmit:e=>{s(e)}},u={[Jo.Open]:{},[Jo.Link]:{},[Jo.Rating]:{displayQuestionIndex:i},[Jo.SingleChoice]:{displayQuestionIndex:i},[Jo.MultipleChoice]:{displayQuestionIndex:i}},d=l[r.type],h=t(t({},c),u[r.type]);return Pl(d,t({},h))};function _c(e){return!mn(Event)&&yc(e,Event)}function yc(e,t){try{return e instanceof t}catch(e){return!1}}function bc(e){return bn(e)||!gn(e)&&!hn(e)}function wc(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function Sc(e){return wc(e,"DOMError")}Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.canActivateRepeatedly=zs,Qr.__PosthogExtensions__.generateSurveys=hc,Qr.extendPostHogWithSurveys=hc;var Cc=/\(error: (.*)\)/,Ic=50,kc="?";function Ec(e,t,r,n){var i={platform:"web:javascript",filename:e,function:"<anonymous>"===t?kc:t,in_app:!0};return mn(r)||(i.lineno=r),mn(n)||(i.colno=n),i}var xc=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Tc=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Mc=/\((\S*)(?::(\d+))(?::(\d+))\)/,Rc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ac=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Fc=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=Cc.test(a)?a.replace(Cc,"$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>=Ic)break}}}return function(e){if(!e.length)return[];var r=Array.from(e);return r.reverse(),r.slice(0,Ic).map((e=>t(t({},e),{},{filename:e.filename||Nc(r).filename,function:e.function||kc})))}(n)}}(...[[30,e=>{var t=xc.exec(e);if(t){var[,r,n,i]=t;return Ec(r,kc,+n,+i)}var o=Tc.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var s=Mc.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[a,l]=Dc(o[1]||kc,o[2]);return Ec(l,a,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,e=>{var t=Rc.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var r=Ac.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]||kc;return[i,n]=Dc(i,n),Ec(n,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function Nc(e){return e[e.length-1]||{}}var Pc,Oc,Lc,Dc=(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]:kc,r?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]};var Bc=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function qc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.stacktrace||e.stack||"",n=function(e){if(e&&Hc.test(e.message))return 1;return 0}(e);try{var i=Fc,o=function(e,t){var r=function(e){var t=globalThis._posthogChunkIds;if(!t)return{};var r=Object.keys(t);return Lc&&r.length===Oc||(Oc=r.length,Lc=r.reduce(((r,n)=>{Pc||(Pc={});var i=Pc[n];if(i)r[i[0]]=i[1];else for(var o=e(n),s=o.length-1;s>=0;s--){var a=o[s],l=null==a?void 0:a.filename,c=t[n];if(l&&c){r[l]=c,Pc[n]=[l,c];break}}return r}),{})),Lc}(t);return e.forEach((e=>{e.filename&&(e.chunk_id=r[e.filename])})),e}(i(r,n),i);return o.slice(0,o.length-t)}catch(e){}return[]}var Hc=/Minified React error #\d+;/i;function $c(e,t){var r,n,i=qc(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 Wc(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=qc(t.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function Vc(e){return _n(e)&&!yn(e)&&rn.indexOf(e)>=0}function Zc(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:_c(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=qc(null==t?void 0:t.syntheticException,1);c.length&&(l.stacktrace={frames:c,type:"raw"})}return{$exception_list:[l],$exception_level:Vc(e.level)?e.level:"error"}}function jc(e,r){var{error:n,event:i}=e,o={$exception_list:[]},s=n||i;if(Sc(s)||function(e){return wc(e,"DOMException")}(s)){var a=s;if(function(e){return"stack"in e}(s))o=$c(s,r);else{var l=a.name||(Sc(a)?"DOMError":"DOMException"),c=a.message?"".concat(l,": ").concat(a.message):l,u=Sc(a)?"DOMError":"DOMException";o=Wc(c,t(t({},r),{},{overrideExceptionType:u,defaultExceptionMessage:c}))}return"code"in a&&(o.$exception_DOMException_code="".concat(a.code)),o}if(function(e){return wc(e,"ErrorEvent")}(s)&&s.error)return $c(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 yc(e,Error)}}(s))return $c(s,r);if(function(e){return wc(e,"Object")}(s)||_c(s))return Zc(s,r);if(mn(n)&&_n(i)){var d="Error",h=i,p=i.match(Bc);return p&&(d=p[1],h=p[2]),Wc(h,t(t({},r),{},{overrideExceptionType:d,defaultExceptionMessage:h}))}return Wc(s,r)}function zc(e){var[t]=e,r=function(e){if(bc(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 bc(r)?Wc("Non-Error promise rejection captured with value: ".concat(String(r)),{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):jc({event:r},{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(r)})}var Gc=An("[ExceptionAutocapture]"),Uc={wrapOnError:e=>{var t=$r;t||Gc.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=jc({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||Gc.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=zc(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=Uc,Qr.__PosthogExtensions__.parseErrorAsProperties=jc,Qr.posthogErrorWrappingFunctions=Uc,Qr.parseErrorAsProperties=jc;var Yc=(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 Xc={_patchFetch:e=>Kn($r,"fetch",(t=>function(){var r=n((function*(r,n){var i=new Request(r,n);return Yc(e,i),t(i)}));return function(e,t){return r.apply(this,arguments)}}())),_patchXHR:e=>Kn($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 Yc(e,a),t.call(this,r,a.url,i,o,s)}))};Qr.__PosthogExtensions__.tracingHeadersPatchFns=Xc,Qr.postHogTracingHeadersPatchFns=Xc;var Jc,Kc,Qc=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},eu=function(e){if("loading"===document.readyState)return"loading";var t=Qc();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"},tu=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},ru=function(e,t){var r="";try{for(;e&&9!==e.nodeType;){var n=e,i=n.id?"#"+n.id:tu(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},nu=-1,iu=function(){return nu},ou=function(e){addEventListener("pageshow",(function(t){t.persisted&&(nu=t.timeStamp,e(t))}),!0)},su=function(){var e=Qc();return e&&e.activationStart||0},au=function(e,t){var r=Qc(),n="navigate";return iu()>=0?n="back-forward-cache":r&&(document.prerendering||su()>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}},lu=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){}},cu=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))}},uu=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},du=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},hu=function(e){var t=!1;return function(){t||(e(),t=!0)}},pu=-1,vu=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},gu=function(e){"hidden"===document.visibilityState&&pu>-1&&(pu="visibilitychange"===e.type?e.timeStamp:0,mu())},fu=function(){addEventListener("visibilitychange",gu,!0),addEventListener("prerenderingchange",gu,!0)},mu=function(){removeEventListener("visibilitychange",gu,!0),removeEventListener("prerenderingchange",gu,!0)},_u=function(){return pu<0&&(pu=vu(),fu(),ou((function(){setTimeout((function(){pu=vu(),fu()}),0)}))),{get firstHiddenTime(){return pu}}},yu=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},bu=[1800,3e3],wu=function(e,t){t=t||{},yu((function(){var r,n=_u(),i=au("FCP"),o=lu("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-su(),0),i.entries.push(e),r(!0)))}))}));o&&(r=cu(e,i,bu,t.reportAllChanges),ou((function(n){i=au("FCP"),r=cu(e,i,bu,t.reportAllChanges),uu((function(){i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},Su=[.1,.25],Cu=0,Iu=1/0,ku=0,Eu=function(e){e.forEach((function(e){e.interactionId&&(Iu=Math.min(Iu,e.interactionId),ku=Math.max(ku,e.interactionId),Cu=ku?(ku-Iu)/7+1:0)}))},xu=function(){return Jc?Cu:performance.interactionCount||0},Tu=function(){"interactionCount"in performance||Jc||(Jc=lu("event",Eu,{type:"event",buffered:!0,durationThreshold:0}))},Mu=[],Ru=new Map,Au=0,Fu=[],Nu=function(e){if(Fu.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Mu[Mu.length-1],r=Ru.get(e.interactionId);if(r||Mu.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]};Ru.set(n.id,n),Mu.push(n)}Mu.sort((function(e,t){return t.latency-e.latency})),Mu.length>10&&Mu.splice(10).forEach((function(e){return Ru.delete(e.id)}))}}},Pu=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=hu(e),"hidden"===document.visibilityState?e():(r=t(e),du(e)),r},Ou=[200,500],Lu=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},yu((function(){var r;Tu();var n,i=au("INP"),o=function(e){Pu((function(){e.forEach(Nu);var t=function(){var e=Math.min(Mu.length-1,Math.floor((xu()-Au)/50));return Mu[e]}();t&&t.latency!==i.value&&(i.value=t.latency,i.entries=t.entries,n())}))},s=lu("event",o,{durationThreshold:null!==(r=t.durationThreshold)&&void 0!==r?r:40});n=cu(e,i,Ou,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),du((function(){o(s.takeRecords()),n(!0)})),ou((function(){Au=xu(),Mu.length=0,Ru.clear(),i=au("INP"),n=cu(e,i,Ou,t.reportAllChanges)})))})))},Du=[],Bu=[],qu=0,Hu=new WeakMap,$u=new Map,Wu=-1,Vu=function(e){Du=Du.concat(e),Zu()},Zu=function(){Wu<0&&(Wu=Pu(ju))},ju=function(){$u.size>10&&$u.forEach((function(e,t){Ru.has(t)||$u.delete(t)}));var e=Mu.map((function(e){return Hu.get(e.entries[0])})),t=Bu.length-50;Bu=Bu.filter((function(r,n){return n>=t||e.includes(r)}));for(var r=new Set,n=0;n<Bu.length;n++){var i=Bu[n];zu(i.startTime,i.processingEnd).forEach((function(e){r.add(e)}))}var o=Du.length-1-50;Du=Du.filter((function(e,t){return e.startTime>qu&&t>o||r.has(e)})),Wu=-1};Fu.push((function(e){e.interactionId&&e.target&&!$u.has(e.interactionId)&&$u.set(e.interactionId,e.target)}),(function(e){var t,r=e.startTime+e.duration;qu=Math.max(qu,e.processingEnd);for(var n=Bu.length-1;n>=0;n--){var i=Bu[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]},Bu.push(t)),(e.interactionId||"first-input"===e.entryType)&&Hu.set(e,t),Zu()}));var zu=function(e,t){for(var r,n=[],i=0;r=Du[i];i++)if(!(r.startTime+r.duration<e)){if(r.startTime>t)break;n.push(r)}return n},Gu=[2500,4e3],Uu={},Yu={onLCP:function(e,t){!function(e,t){t=t||{},yu((function(){var r,n=_u(),i=au("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-su(),0),i.entries=[e],r())}))},s=lu("largest-contentful-paint",o);if(s){r=cu(e,i,Gu,t.reportAllChanges);var a=hu((function(){Uu[i.id]||(o(s.takeRecords()),s.disconnect(),Uu[i.id]=!0,r(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Pu(a)}),{once:!0,capture:!0})})),du(a),ou((function(n){i=au("LCP"),r=cu(e,i,Gu,t.reportAllChanges),uu((function(){i.value=performance.now()-n.timeStamp,Uu[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=Qc();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:ru(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||{},wu(hu((function(){var r,n=au("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=lu("layout-shift",s);a&&(r=cu(e,n,Su,t.reportAllChanges),du((function(){s(a.takeRecords()),r(!0)})),ou((function(){i=0,n=au("CLS",0),r=cu(e,n,Su,t.reportAllChanges),uu((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:ru(i.node),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:i,largestShiftEntry:n,loadState:eu(n.startTime)})}}return Object.assign(e,{attribution:r})}(t);e(r)}),t)},onFCP:function(e,t){wu((function(t){var r=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:eu(iu())};if(e.entries.length){var r=Qc(),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:eu(e.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onINP:function(e,t){Kc||(Kc=lu("long-animation-frame",Vu)),Lu((function(t){var r=function(e){var t=e.entries[0],r=Hu.get(t),n=t.processingStart,i=r.processingEnd,o=r.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=zu(t.startTime,i),a=e.entries.find((function(e){return e.target})),l=a&&a.target||$u.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:ru(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:eu(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(r)}),t)}};Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.postHogWebVitalsCallbacks=Yu,Qr.postHogWebVitalsCallbacks=Yu;class Xu{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 Ju=An("[AutoCapture]");function Ku(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&&!Hi(t));return t}function ed(e,t,r,n){var i=e.tagName.toLowerCase(),o={tag_name:i};Xi.indexOf(i)>-1&&!r&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Ku(1024,lo(e)):o.$el_text=Ku(1024,Ui(e)));var s=zi(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),Pn(e.attributes,(function(r){var i;if((!eo(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==n||!n.includes(r.name))&&!t&&ao(r.value)&&(i=r.name,!_n(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){var s=r.value;"class"===r.name&&(s=Zi(s).join(" ")),o["attr__"+r.name]=Ku(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 td(e,t){for(var r,n,{e:i,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,c=[e],u=e;u.parentNode&&!$i(u,"body");)Vi(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(Pn(c,(e=>{var t=Qi(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&ao(v)&&v),nn(zi(e),"ph-no-capture")&&(g=!0),h.push(ed(e,o,s,a));var r=function(e){if(!Qi(e))return{};var t={};return Pn(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&&ao(n)&&(t[r]=n)}})),t}(e);On(p,r)})),g)return{props:{},explicitNoCapture:g};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?h[0].$el_text=lo(e):h[0].$el_text=Ui(e)),v){var f,m;h[0].attr__href=v;var _=null===(f=Gn(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:On({$event_type:i.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:uo(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 rd{constructor(e){i(this,"_initialized",!1),i(this,"_isDisabledServerSide",null),i(this,"rageclicks",new Xu),i(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,r=gn(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&&Gr){var e=e=>{e=e||(null==$r?void 0:$r.event);try{this._captureEvent(e)}catch(e){Ju.error("Failed to capture event",e)}};if(jn(Gr,"submit",e,{capture:!0}),jn(Gr,"change",e,{capture:!0}),jn(Gr,"click",e,{capture:!0}),this.config.capture_copied_text){var t=e=>{e=e||(null==$r?void 0:$r.event),this._captureEvent(e,en)};jn(Gr,"copy",t,{capture:!0}),jn(Gr,"cut",t,{capture:!0})}}}else Ju.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({[ni]:!!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==Gr?void 0:Gr.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[ni],n=this._isDisabledServerSide;if(bn(n)&&!Cn(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=Yi(e);if(Wi(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&&Ki(n,e,this.config,i,i?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=td(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=Gi(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 hn(null==Gr?void 0:Gr.querySelectorAll)}}var nd={};function id(e){return function(e,t){var r=nd[e];if(r)return r;var n=t[e];if(pn(n)&&!vn())return nd[e]=n.bind(t);var i=t.document;if(i&&hn(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){Rn.warn("Could not create sandbox iframe for ".concat(e," check, bailing to assignableWindow.").concat(e,": "),t)}return n&&hn(n)?nd[e]=n.bind(t):n}("MutationObserver",e)}function od(e,t){return Sn(e)&&e>=t}class sd{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=Yi(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);bn(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&mn(this._checkClickTimer)&&(this._checkClickTimer=Qr.setTimeout((()=>{this._checkClicks()}),1e3))})),i(this,"_onScroll",(()=>{var e=Date.now();e%50==0&&this._clicks.forEach((t=>{mn(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=id(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(){jn(Qr,"click",this._onClick)}_startScrollObserver(){jn(Qr,"scroll",this._onScroll,{capture:!0})}_startSelectionChangedObserver(){jn(Qr,"selectionchange",this._onSelectionChange)}_ignoreClick(e){if(!e)return!0;if(qi(e.node))return!0;var t=this._clicks.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!t||!(!$i(e.node,"html")&&Hi(e.node)&&!Xi.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=od(t.scrollDelayMs,this._config.scroll_threshold_ms),i=od(t.selectionChangedDelayMs,this._config.selection_change_threshold_ms),o=od(t.mutationDelayMs,this._config.mutation_threshold_ms),s=od(t.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),a=Sn(t.scrollDelayMs)&&t.scrollDelayMs<this._config.scroll_threshold_ms,l=Sn(t.mutationDelayMs)&&t.mutationDelayMs<this._config.mutation_threshold_ms,c=Sn(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&&mn(this._checkClickTimer)&&(this._checkClickTimer=Qr.setTimeout((()=>{this._checkClicks()}),1e3))}}_captureDeadClick(e,r){this.instance.capture("$dead_click",t(t(t({},r),td(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 sd(e,t);var ad=An("[ExternalScriptsLoader]"),ld=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return ad.warn("".concat(t," was requested but loading of external scripts is disabled.")),r("Loading of external scripts is disabled");var n=null==Gr?void 0:Gr.querySelectorAll("script");if(n)for(var i=0;i<n.length;i++)if(n[i].src===t)return r();var o=()=>{if(!Gr)return r("document not found");var n=Gr.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=Gr.querySelectorAll("body > script");o.length>0?null===(i=o[0].parentNode)||void 0===i||i.insertBefore(n,o[0]):Gr.body.appendChild(n)};null!=Gr&&Gr.body?o():null==Gr||Gr.addEventListener("DOMContentLoaded",o)};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);ld(e,s,r)},Qr.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var n=e.requestRouter.endpointFor("api",t);ld(e,n,r)},Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Sn(e)&&isFinite(e)&&Math.floor(e)===e});var cd="0123456789abcdef";class ud{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 ud(i)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+cd.charAt(this.bytes[t]>>>4)+cd.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 ud(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 dd{constructor(){i(this,"timestamp",0),i(this,"counter",0),i(this,"random",new vd)}generate(){var e=this.generateOrAbort();if(mn(e)){this.timestamp=0;var t=this.generateOrAbort();if(mn(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 ud.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 hd,pd=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&&!mn($r.crypto)&&crypto.getRandomValues&&(pd=e=>crypto.getRandomValues(e));class vd{constructor(){i(this,"buffer",new Uint32Array(8)),i(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(pd(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}var gd=()=>fd().toString(),fd=()=>(hd||(hd=new dd)).generate(),md="Thu, 01 Jan 1970 00:00:00 GMT",_d="";var yd=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function bd(e,t){if(t){var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gr;if(_d)return _d;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_"+gd(),o=new RegExp("(^|;)\\s*"+i+"=1");!_d&&n--;){var s=r.slice(n).join("."),a=i+"=1;domain=."+s;t.cookie=a,o.test(t.cookie)&&(t.cookie=a+";expires="+md,_d=s)}return _d}(e);if(!r){var n=(e=>{var t=e.match(yd);return t?t[0]:""})(e);n!==r&&Rn.info("Warning: cookie subdomain discovery mismatch",n,r),r=n}return r?"; domain=."+r:""}return""}var wd,Sd={is_supported:()=>!!Gr,error:function(e){Rn.error("cookieStore error: "+e)},get:function(e){if(Gr){try{for(var t=e+"=",r=Gr.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(Sd.get(e))||{}}catch(e){}return t},set:function(e,t,r,n,i){if(Gr)try{var o="",s="",a=bd(Gr.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&&Rn.warn("cookieStore warning: large cookie, len="+c.length),Gr.cookie=c,c}catch(e){return}},remove:function(e,t){try{Sd.set(e,"",-1,t)}catch(e){return}}},Cd=null,Id={is_supported:function(){if(!bn(Cd))return Cd;var e=!0;if(mn($r))e=!1;else try{var t="__mplssupport__";Id.set(t,"xyz"),'"xyz"'!==Id.get(t)&&(e=!1),Id.remove(t)}catch(t){e=!1}return e||Rn.error("localStorage unsupported; falling back to cookie store"),Cd=e,e},error:function(e){Rn.error("localStorage error: "+e)},get:function(e){try{return null==$r?void 0:$r.localStorage.getItem(e)}catch(e){Id.error(e)}return null},parse:function(e){try{return JSON.parse(Id.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==$r||$r.localStorage.setItem(e,JSON.stringify(t))}catch(e){Id.error(e)}},remove:function(e){try{null==$r||$r.localStorage.removeItem(e)}catch(e){Id.error(e)}}},kd=["distinct_id",mi,_i,Oi,Pi],Ed=t(t({},Id),{},{parse:function(e){try{var t={};try{t=Sd.parse(e)||{}}catch(e){}var r=On(t,JSON.parse(Id.get(e)||"{}"));return Id.set(e,r),r}catch(e){}return null},set:function(e,t,r,n,i,o){try{Id.set(e,t,void 0,void 0,o);var s={};kd.forEach((e=>{t[e]&&(s[e]=t[e])})),Object.keys(s).length&&Sd.set(e,s,r,n,i,o)}catch(e){Id.error(e)}},remove:function(e,t){try{null==$r||$r.localStorage.removeItem(e),Sd.remove(e,t)}catch(e){Id.error(e)}}}),xd={},Td={is_supported:function(){return!0},error:function(e){Rn.error("memoryStorage error: "+e)},get:function(e){return xd[e]||null},parse:function(e){return xd[e]||null},set:function(e,t){xd[e]=t},remove:function(e){delete xd[e]}},Md=null,Rd={is_supported:function(){if(!bn(Md))return Md;if(Md=!0,mn($r))Md=!1;else try{var e="__support__";Rd.set(e,"xyz"),'"xyz"'!==Rd.get(e)&&(Md=!1),Rd.remove(e)}catch(e){Md=!1}return Md},error:function(e){Rn.error("sessionStorage error: ",e)},get:function(e){try{return null==$r?void 0:$r.sessionStorage.getItem(e)}catch(e){Rd.error(e)}return null},parse:function(e){try{return JSON.parse(Rd.get(e))||null}catch(e){}return null},set:function(e,t){try{null==$r||$r.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Rd.error(e)}},remove:function(e){try{null==$r||$r.sessionStorage.removeItem(e)}catch(e){Rd.error(e)}}};!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(wd||(wd={}));class Ad{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?wd.DENIED:this.storedConsent}isOptedOut(){return this.consent===wd.DENIED||this.consent===wd.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?wd.GRANTED:"0"===e?wd.DENIED:wd.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?Id:Sd;var t="localStorage"===e?Sd:Id;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&&!!Zn([null==zr?void 0:zr.doNotTrack,null==zr?void 0:zr.msDoNotTrack,Qr.doNotTrack],(e=>nn([!0,1,"1","yes"],e)))}}var Fd=An("[Dead Clicks]"),Nd=()=>!0,Pd=e=>{var t,r=!(null===(t=e.instance.persistence)||void 0===t||!t.get_property(ai)),n=e.instance.config.capture_dead_clicks;return Cn(n)?n:r};class Od{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({[ai]: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?Fd.error("failed to load script",t):e()}))}start(){var e;if(Gr){if(!this._lazyLoadedDeadClicksAutocapture&&null!==(e=Qr.__PosthogExtensions__)&&void 0!==e&&e.initDeadClicksAutocapture){var t=gn(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(Gr),Fd.info("starting...")}}else Fd.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Fd.info("stopping..."))}}var Ld=An("[ExceptionAutocapture]");class Dd{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){Ld.error("failed to start",e),this.stopCapturing()}else Ld.error("failed to load error wrapping functions - cannot start")}})),this.instance=e,this.remoteEnabled=!(null===(t=this.instance.persistence)||void 0===t||!t.props[oi]),this.startIfEnabled()}get isEnabled(){var e;return Cn(this.instance.config.capture_exceptions)?this.instance.config.capture_exceptions:null!==(e=this.remoteEnabled)&&void 0!==e&&e}get hasHandlers(){return!mn(this.unwrapOnError)}startIfEnabled(){this.isEnabled&&!this.hasHandlers&&(Ld.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 Ld.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({[oi]: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)}}function Bd(e){var t,r;return(null===(t=JSON.stringify(e,(r=[],function(e,t){if(gn(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 qd(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[qd({size:Bd(n),data:n,sessionId:e.sessionId,windowId:e.windowId}),qd({size:Bd(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var Hd=(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))(Hd||{}),$d=(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))($d||{});function Wd(e,t,r,n,i){return t>r&&(Rn.warn("min cannot be greater than max."),t=r),Sn(e)?e>r?(n&&Rn.warn(n+" cannot be greater than max: "+r+". Using max value instead."),r):e<t?(n&&Rn.warn(n+" cannot be less than min: "+t+". Using min value instead."),t):e:(n&&Rn.warn(n+" must be a number. using max or fallback. max: "+r+", fallback: "+i),Wd(i||r,t,r,n))}class Vd{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=Wd(null!==(t=this.options.refillRate)&&void 0!==t?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=Wd(null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval((()=>{this.refillBuckets()}),1e3)}}var Zd=Uint8Array,jd=Uint16Array,zd=Uint32Array,Gd=new Zd([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]),Ud=new Zd([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]),Yd=new Zd([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Xd=function(e,t){for(var r=new jd(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new zd(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]},Jd=Xd(Gd,2),Kd=Jd[0],Qd=Jd[1];Kd[28]=258,Qd[258]=28;for(var eh=Xd(Ud,0)[1],th=new jd(32768),rh=0;rh<32768;++rh){var nh=(43690&rh)>>>1|(21845&rh)<<1;nh=(61680&(nh=(52428&nh)>>>2|(13107&nh)<<2))>>>4|(3855&nh)<<4,th[rh]=((65280&nh)>>>8|(255&nh)<<8)>>>1}var ih=function(e,t,r){for(var n=e.length,i=0,o=new jd(t);i<n;++i)++o[e[i]-1];var s,a=new jd(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new jd(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[th[d]>>>l]=c}else for(s=new jd(n),i=0;i<n;++i)s[i]=th[a[e[i]-1]++]>>>15-e[i];return s},oh=new Zd(288);for(rh=0;rh<144;++rh)oh[rh]=8;for(rh=144;rh<256;++rh)oh[rh]=9;for(rh=256;rh<280;++rh)oh[rh]=7;for(rh=280;rh<288;++rh)oh[rh]=8;var sh=new Zd(32);for(rh=0;rh<32;++rh)sh[rh]=5;var ah=ih(oh,9,0),lh=ih(sh,5,0),ch=function(e){return(e/8>>0)+(7&e&&1)},uh=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof jd?jd:e instanceof zd?zd:Zd)(r-t);return n.set(e.subarray(t,r)),n},dh=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},hh=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},ph=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 Zd(0),0];if(1==i){var s=new Zd(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 jd(h+1),v=vh(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 Zd(p),v]},vh=function(e,t,r){return-1==e.s?Math.max(vh(e.l,t,r+1),vh(e.r,t,r+1)):t[e.s]=r},gh=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new jd(++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]},fh=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},mh=function(e,t,r){var n=r.length,i=ch(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)},_h=function(e,t,r,n,i,o,s,a,l,c,u){dh(t,u++,r),++i[256];for(var d=ph(i,15),h=d[0],p=d[1],v=ph(o,15),g=v[0],f=v[1],m=gh(h),_=m[0],y=m[1],b=gh(g),w=b[0],S=b[1],C=new jd(19),I=0;I<_.length;++I)C[31&_[I]]++;for(I=0;I<w.length;++I)C[31&w[I]]++;for(var k=ph(C,7),E=k[0],x=k[1],T=19;T>4&&!E[Yd[T-1]];--T);var M,R,A,F,N=c+5<<3,P=fh(i,oh)+fh(o,sh)+s,O=fh(i,h)+fh(o,g)+s+14+3*T+fh(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(N<=P&&N<=O)return mh(t,u,e.subarray(l,l+c));if(dh(t,u,1+(O<P)),u+=2,O<P){M=ih(h,p,0),R=h,A=ih(g,f,0),F=g;var L=ih(E,x,0);dh(t,u,y-257),dh(t,u+5,S-1),dh(t,u+10,T-4),u+=14;for(I=0;I<T;++I)dh(t,u+3*I,E[Yd[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];dh(t,u,L[H]),u+=E[H],H>15&&(dh(t,u,q[I]>>>5&127),u+=q[I]>>>12)}}}else M=ah,R=oh,A=lh,F=sh;for(I=0;I<a;++I)if(n[I]>255){H=n[I]>>>18&31;hh(t,u,M[H+257]),u+=R[H+257],H>7&&(dh(t,u,n[I]>>>23&31),u+=Gd[H]);var $=31&n[I];hh(t,u,A[$]),u+=F[$],$>3&&(hh(t,u,n[I]>>>5&8191),u+=Ud[$])}else hh(t,u,M[n[I]]),u+=R[n[I]];return hh(t,u,M[256]),u+R[256]},yh=new zd([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bh=function(){for(var e=new zd(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),wh=function(){var e=4294967295;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=bh[255&r^t[n]]^r>>>8;e=r},d:function(){return 4294967295^e}}},Sh=function(e,t,r,n,i){return function(e,t,r,n,i,o){var s=e.length,a=new Zd(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=mh(l,c,e.subarray(u,d)):(l[u]=o,c=mh(l,c,e.subarray(u,s)))}else{for(var h=yh[t-1],p=h>>>13,v=8191&h,g=(1<<r)-1,f=new jd(32768),m=new jd(g+1),_=Math.ceil(r/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&g},w=new zd(25e3),S=new jd(288),C=new jd(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 F=s-u;if((I>7e3||E>24576)&&F>423){c=_h(e,l,0,w,S,C,k,E,T,u-T,c),E=I=k=0,T=u;for(var N=0;N<286;++N)S[N]=0;for(N=0;N<30;++N)C[N]=0}var P=2,O=0,L=v,D=R-A&32767;if(F>2&&M==b(u-D))for(var B=Math.min(p,F)-1,q=Math.min(32767,u),H=Math.min(258,F);D<=q&&--L&&R!=A;){if(e[u+P]==e[u+P-D]){for(var $=0;$<H&&e[u+$]==e[u+$-D];++$);if($>P){if(P=$,O=D,$>B)break;var W=Math.min(D,$-2),V=0;for(N=0;N<W;++N){var Z=u-D+N+32768&32767,j=Z-f[Z]+32768&32767;j>V&&(V=j,A=Z)}}}D+=(R=A)-(A=f[R])+32768&32767}if(O){w[E++]=268435456|Qd[P]<<18|eh[O];var z=31&Qd[P],G=31&eh[O];k+=Gd[z]+Ud[G],++S[257+z],++C[G],x=u+P,++I}else w[E++]=e[u],++S[e[u]]}}c=_h(e,l,o,w,S,C,k,E,T,u-T,c)}return uh(a,0,n+ch(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)},Ch=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ih=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&&Ch(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)}},kh=function(e){return 10+(e.filename&&e.filename.length+1||0)};function Eh(e,t){void 0===t&&(t={});var r=wh(),n=e.length;r.p(e);var i=Sh(e,t,kh(t),8),o=i.length;return Ih(i,t),Ch(i,o-8,r.d()),Ch(i,o-4,n),i}function xh(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Zd(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 Zd(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 uh(n,0,i)}function Th(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<Wd(100*t,0,100)}var Mh="[SessionRecording]",Rh=An(Mh);function Ah(){var e,t;return null==Qr||null===(e=Qr.__PosthogExtensions__)||void 0===e||null===(t=e.rrweb)||void 0===t?void 0:t.record}var Fh=3e5,Nh=[$d.MouseMove,$d.MouseInteraction,$d.Scroll,$d.ViewportResize,$d.Input,$d.TouchMove,$d.MediaInteraction,$d.Drag],Ph=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function Oh(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}(Eh(xh(JSON.stringify(e))),!0)}function Lh(e){return e.type===Hd.Custom&&"sessionIdle"===e.data.tag}function Dh(e,t){return t.some((t=>"regex"===t.matching&&new RegExp(t.url).test(e)))}class Bh{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(Mh+" 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:Fh}get isSampled(){var e=this.instance.get_property(_i);return Cn(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(ci),t=!this.instance.config.disable_session_recording;return $r&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(ui),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(pi),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:Wd(c,0,12,"canvas recording fps",4),quality:Wd(u,0,1,"canvas recording quality",.4)}}get networkPayloadCapture(){var e,t,r=this.instance.get_property(di),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=gn(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(Cn(s)?s:null==r?void 0:r.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}get masking(){var e,t,r,n,i,o,s=this.instance.get_property(hi),a={maskAllInputs:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.maskAllInputs,maskTextSelector:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.maskTextSelector,blockSelector:null===(r=this.instance.config.session_recording)||void 0===r?void 0:r.blockSelector},l=null!==(n=null==a?void 0:a.maskAllInputs)&&void 0!==n?n:null==s?void 0:s.maskAllInputs,c=null!==(i=null==a?void 0:a.maskTextSelector)&&void 0!==i?i:null==s?void 0:s.maskTextSelector,u=null!==(o=null==a?void 0:a.blockSelector)&&void 0!==o?o:null==s?void 0:s.blockSelector;return mn(l)&&mn(c)&&mn(u)?void 0:{maskAllInputs:null==l||l,maskTextSelector:c,blockSelector:u}}get sampleRate(){var e=this.instance.get_property(vi);return Sn(e)?e:null}get minimumDuration(){var e=this.instance.get_property(gi);return Sn(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?!1===this.isSampled?"disabled":this._urlBlocked?"paused":wn(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.triggerStatus?"buffering":Cn(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(yi))===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(bi))===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","unknown"),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!=Gr&&Gr.visibilityState){var e="window "+Gr.visibilityState;this._tryAddCustomEvent(e,{})}})),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Rh.error("started without valid sessionManager"),new Error(Mh+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(Mh+" 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&&Rh.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),jn($r,"beforeunload",this._onBeforeUnload),jn($r,"offline",this._onOffline),jn($r,"online",this._onOnline),jn($r,"visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),wn(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){Rh.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(bi),null===(o=this.instance)||void 0===o||null===(s=o.persistence)||void 0===s||s.unregister(yi))})))):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,Rh.info("stopped"))}makeSamplingDecision(e){var t,r=this.sessionId!==e,n=this.sampleRate;if(Sn(n)){var i=this.isSampled,o=r||!Cn(i),s=o?Th(e,n):i;o&&(s?this._reportStarted("sampled"):Rh.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({[_i]:s})}else{var a;null===(a=this.instance.persistence)||void 0===a||a.register({[_i]: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(),!wn(this._linkedFlag)&&!this._linkedFlagSeen){var a=_n(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,l=_n(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(((e,t)=>{var r=gn(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(){Sn(this.sampleRate)&&wn(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,h=null===(r=e.sessionRecording)||void 0===r?void 0:r.sampleRate,p=wn(h)?null:parseFloat(h),v=null===(i=e.sessionRecording)||void 0===i?void 0:i.minimumDurationMilliseconds;n.register({[ci]:!!e.sessionRecording,[ui]:null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled,[di]:t({capturePerformance:e.capturePerformance},null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture),[hi]:null===(a=e.sessionRecording)||void 0===a?void 0:a.masking,[pi]:{enabled:null===(l=e.sessionRecording)||void 0===l?void 0:l.recordCanvas,fps:null===(c=e.sessionRecording)||void 0===c?void 0:c.canvasFps,quality:null===(u=e.sessionRecording)||void 0===u?void 0:u.canvasQuality},[vi]:p,[gi]:mn(v)?null:v,[fi]:null===(d=e.sessionRecording)||void 0===d?void 0:d.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(!mn(Object.assign)&&!mn(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,r;if(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),Ah())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 Rh.error("could not load recorder",e);this._onScriptLoaded()}));Rh.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(fi))||void 0===r?void 0:r.script)||"recorder"}isInteractiveEvent(e){var t;return 3===e.type&&-1!==Nh.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)){var n="unknown"===this.isIdle;this.isIdle=!1,n||(this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!0)}if(!this.isIdle){var{windowId:i,sessionId:o}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),s=this.sessionId!==o,a=this.windowId!==i;this.windowId=i,this.sessionId=o,s||a?(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}):Rh.warn("could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(Ph((()=>Ah().addCustomEvent(e,t))))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(Ph((()=>Ah().takeFullSnapshot())))}_onScriptLoaded(){var e,r,n,i,o={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},s=this.instance.config.session_recording;for(var[a,l]of Object.entries(s||{}))a in o&&("maskInputOptions"===a?o.maskInputOptions=t({password:!0},l):o[a]=l);(this.canvasRecording&&this.canvasRecording.enabled&&(o.recordCanvas=!0,o.sampling={canvas:this.canvasRecording.fps},o.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.masking)&&(o.maskAllInputs=null===(r=this.masking.maskAllInputs)||void 0===r||r,o.maskTextSelector=null!==(n=this.masking.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(i=this.masking.blockSelector)&&void 0!==i?i:void 0);var c=Ah();if(c){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new Vd(c,{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");Rh.info(r,{node:t}),this.log(Mh+" "+r,"warn")}});var u=this._gatherRRWebPlugins();this.stopRrweb=c(t({emit:e=>{this.onRRwebEmit(e)},plugins:u},o)),this._lastActivityTimestamp=Date.now(),this.isIdle=Cn(this.isIdle)?this.isIdle:"unknown",this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:o,activePlugins:u.map((e=>null==e?void 0:e.name))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else Rh.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!0!==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&&hn(s)&&(!zn.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(s(So(this.instance.config,this.networkPayloadCapture))):Rh.info("NetworkCapture not started because we are on localhost."));return i}onRRwebEmit(e){var r;if(this._processQueuedEvents(),e&&gn(e)){if(e.type===Hd.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===Hd.Custom&&"recording paused"===e.data.tag}(e)){e.type===Hd.FullSnapshot&&this._scheduleFullSnapshot(),e.type===Hd.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&&gn(t)&&6===t.type&&gn(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),!0!==this.isIdle||Lh(o)){if(Lh(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(Bd(e)<1024)return e;try{if(e.type===Hd.FullSnapshot)return t(t({},e),{},{data:Oh(e.data),cv:"2024-10"});if(e.type===Hd.IncrementalSnapshot&&e.data.source===$d.Mutation)return t(t({},e),{},{cv:"2024-10",data:t(t({},e.data),{},{texts:Oh(e.data.texts),attributes:Oh(e.data.attributes),removes:Oh(e.data.removes),adds:Oh(e.data.adds)})});if(e.type===Hd.IncrementalSnapshot&&e.data.source===$d.StyleSheetRule)return t(t({},e),{},{cv:"2024-10",data:t(t({},e.data),{},{adds:e.data.adds?Oh(e.data.adds):void 0,removes:e.data.removes?Oh(e.data.removes):void 0})})}catch(e){Rh.error("could not compress event - will use uncompressed event",e)}return e}(o):o,u={$snapshot_bytes:Bd(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=Sn(t)&&t>=0,n=Sn(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&&qd(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:Tn.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=Dh(e,this._urlBlocklist);r&&!t?this._pauseRecording():!r&&t&&this._resumeRecording(),Dh(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?yi:bi]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){this._urlBlocked||(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Rh.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"}),Rh.info("recording resumed"))}_addEventTriggerListener(){0!==this._eventTriggers.length&&wn(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",(e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(e){Rh.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({[_i]:!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}),Rh.info(e.replace("_"," "),t),nn(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}}var qh=An("[SegmentIntegration]");function Hh(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()||gd();e.config.get_device_id=n,r.id()&&(e.register({distinct_id:r.id(),$device_id:n()}),e.persistence.set_property(Mi,"identified")),t()},i=r.user();"then"in i&&hn(i.then)?i.then((e=>n(e))):n(i)}(e,(()=>{r.register((e=>{Promise&&Promise.resolve||qh.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()||(qh.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(qh.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()}))}))}var $h="posthog-js";function Wh(e){var{organization:r,projectId:n,prefix:i,severityAllowList:o=["error"]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s=>{var a,l,c,u,d;if(!("*"===o||o.includes(s.level))||!e.__loaded)return s;s.tags||(s.tags={});var h=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));s.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=(null===(a=s.exception)||void 0===a?void 0:a.values)||[],v=p.map((e=>t(t({},e),{},{stacktrace:e.stacktrace?t(t({},e.stacktrace),{},{type:"raw",frames:(e.stacktrace.frames||[]).map((e=>t(t({},e),{},{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null===(l=p[0])||void 0===l?void 0:l.value)||s.message,$exception_type:null===(c=p[0])||void 0===c?void 0:c.type,$exception_personURL:h,$exception_level:s.level,$exception_list:v,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:(null===(u=p[0])||void 0===u?void 0:u.value)||s.message,$sentry_exception_type:null===(d=p[0])||void 0===d?void 0:d.type,$sentry_tags:s.tags};return r&&n&&(g.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+s.event_id),e.exceptions.sendExceptionEvent(g),s}}class Vh{constructor(e,t,r,n,i){this.name=$h,this.setupOnce=function(o){o(Wh(e,{organization:t,projectId:r,prefix:n,severityAllowList:i}))}}}var Zh,jh=null!=$r&&$r.location?Jn($r.location.hash,"__posthog")||Jn(location.hash,"state"):null,zh="_postHogToolbarParams",Gh=An("[Toolbar]");!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(Zh||(Zh={}));class Uh{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:Zh.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||!Gr)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=jh||Jn(r.hash,"__posthog")||Jn(r.hash,"state"),a=s?Bn((()=>JSON.parse(atob(decodeURIComponent(s)))))||Bn((()=>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(zh)||"{}")).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;!wn(t)&&hn(t)?t(e,this.instance):Gh.warn("No toolbar load function found")}loadToolbar(e){var r=!(null==Gr||!Gr.getElementById(Li));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(zh,JSON.stringify(t(t({},i),{},{source:void 0}))),this.getToolbarState()===Zh.LOADED)this._callLoadToolbar(i);else if(this.getToolbarState()===Zh.UNINITIALIZED){var o,s;this.setToolbarState(Zh.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 Gh.error("[Toolbar] Failed to load",e),void this.setToolbarState(Zh.UNINITIALIZED);this.setToolbarState(Zh.LOADED),this._callLoadToolbar(i)})),jn($r,"turbolinks:load",(()=>{this.setToolbarState(Zh.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 Yh=An("[TracingHeaders]");class Xh{constructor(e){i(this,"_restoreXHRPatch",void 0),i(this,"_restoreFetchPatch",void 0),i(this,"_startCapturing",(()=>{var e,t,r,n;mn(this._restoreXHRPatch)&&(null===(e=Qr.__PosthogExtensions__)||void 0===e||null===(t=e.tracingHeadersPatchFns)||void 0===t||t._patchXHR(this.instance.sessionManager));mn(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 Yh.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 Jh=An("[Web Vitals]"),Kh=9e5;class Qh{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(mn(n))Jh.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(!mn(i))if(wn(null==e?void 0:e.name)||wn(null==e?void 0:e.value))Jh.error("Invalid metric received",e);else if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)Jh.error("Ignoring metric with value >= "+this._maxAllowedValue,e);else this.buffer.url!==i&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),mn(this.buffer.url)&&(this.buffer.url=i),this.buffer.firstMetricTimestamp=mn(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__;mn(i)||mn(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):Jh.error("web vitals callbacks not loaded - not starting")})),this.instance=e,this._enabledServerSide=!(null===(r=this.instance.persistence)||void 0===r||!r.props[si]),this.startIfEnabled()}get allowedMetrics(){var e,t,r=gn(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 mn(r)?(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[li])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(gn(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=gn(this.instance.config.capture_performance)&&Sn(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:Kh;return 0<e&&e<=6e4?Kh:e}get isEnabled(){var e=gn(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Cn(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(Jh.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(e){var t=gn(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=gn(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[si]:t}),this.instance.persistence.register({[li]: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?Jh.error("failed to load script",t):e()}))}_currentURL(){var e=$r?$r.location.href:void 0;return e||Jh.error("Could not determine current URL"),e}}var ep=An("[Heatmaps]");function tp(e){return gn(e)&&"clientX"in e&&"clientY"in e&&Sn(e.clientX)&&Sn(e.clientY)}class rp{constructor(e){var t;i(this,"rageclicks",new Xu),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[ii])}get flushIntervalMilliseconds(){var e=5e3;return gn(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 mn(this.instance.config.capture_heatmaps)?mn(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;ep.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({[ii]: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&&Gr&&(jn($r,"beforeunload",this.flush.bind(this)),jn(Gr,"click",(e=>this._onClick(e||(null==$r?void 0:$r.event))),{capture:!0}),jn(Gr,"mousemove",(e=>this._onMouseMove(e||(null==$r?void 0:$r.event))),{capture:!0}),this.deadClicksCapture=new Od(this.instance,Nd,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&&Hi(n)&&!$i(n,"body");){if(n===r)return!1;if(nn(t,null==$r?void 0:$r.getComputedStyle(n).position))return!0;n=Ji(n)}return!1}(Yi(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(!qi(e.target)&&tp(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){!qi(e.target)&&tp(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&&!fn(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class np{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(!(mn(o)||mn(s)||mn(a)||mn(l)||mn(c)||mn(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:Wd(s/o,0,1),h=o<=1?1:Wd(a/o,0,1),p=l<=1?1:Wd(c/l,0,1),v=l<=1?1:Wd(u/l,0,1);n=On(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}}class ip{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}var op,sp=An("[FeatureFlags]"),ap="$active_feature_flags",lp="$override_feature_flags",cp="$feature_flag_payloads",up="$override_feature_flag_payloads",dp="$feature_flag_request_id",hp=e=>{var t={};for(var[r,n]of Dn(e||{}))n&&(t[r]=n);return t},pp=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>{var r;return[e,null!==(r=t[e].variant)&&void 0!==r?r:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>{var r;return null===(r=t[e].metadata)||void 0===r?void 0:r.payload})).map((e=>{var r;return[e,null===(r=t[e].metadata)||void 0===r?void 0:r.payload]})))):sp.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e};!function(e){e.FeatureFlags="feature_flags",e.Recordings="recordings"}(op||(op={}));class vp{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())}getFlagsWithDetails(){var e=this.instance.get_property(Ci),r=this.instance.get_property(lp),n=this.instance.get_property(up);if(!n&&!r)return e||{};var i=On({},e||{}),o=[...new Set([...Object.keys(n||{}),...Object.keys(r||{})])];for(var s of o){var a,l,c=i[s],u=null==r?void 0:r[s],d=mn(u)?null!==(a=null==c?void 0:c.enabled)&&void 0!==a&&a:!!u,h=mn(u)?c.variant:"string"==typeof u?u:void 0,p=null==n?void 0:n[s],v=t(t({},c),{},{enabled:d,variant:d?null!=h?h:null==c?void 0:c.variant:void 0});if(d!==(null==c?void 0:c.enabled)&&(v.original_enabled=null==c?void 0:c.enabled),h!==(null==c?void 0:c.variant)&&(v.original_variant=null==c?void 0:c.variant),p)v.metadata=t(t({},null==c?void 0:c.metadata),{},{payload:p,original_payload:null==c||null===(l=c.metadata)||void 0===l?void 0:l.payload});i[s]=v}return this._override_warning||(sp.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:i}),this._override_warning=!0),i}getFlagVariants(){var e=this.instance.get_property(wi),t=this.instance.get_property(lp);if(!t)return e||{};for(var r=On({},e),n=Object.keys(t),i=0;i<n.length;i++)r[n[i]]=t[n[i]];return this._override_warning||(sp.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){var e=this.instance.get_property(cp),t=this.instance.get_property(up);if(!t)return e||{};for(var r=On({},e||{}),n=Object.keys(t),i=0;i<n.length;i++)r[n[i]]=t[n[i]];return this._override_warning||(sp.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){var r;if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var n={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:t(t({},(null===(r=this.instance.persistence)||void 0===r?void 0:r.get_initial_props())||{}),this.instance.get_property(Ii)||{}),group_properties:this.instance.get_property(ki)};(null!=e&&e.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(n.disable_flags=!0),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=4"),data:n,compression:this.instance.config.disable_compression?void 0:qr.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,r,i,o=!0;(200===e.statusCode&&(this._additionalReloadRequested||(this.$anon_distinct_id=void 0),o=!1),this._requestInFlight=!1,this._decideCalled)||(this._decideCalled=!0,this.instance._onRemoteConfig(null!==(i=e.json)&&void 0!==i?i:{}));n.disable_flags&&!this._additionalReloadRequested||(this._flagsLoadedFromRemote=!o,e.json&&null!==(t=e.json.quotaLimited)&&void 0!==t&&t.includes(op.FeatureFlags)?sp.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(this.receivedFeatureFlags(null!==(r=e.json)&&void 0!==r?r:{},o),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=this.getFlagVariants()[e],n="".concat(r),i=this.instance.get_property(dp)||void 0,o=this.instance.get_property(Ti)||{};if((t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(n))){var s,a,l,c,u,d,h,p,v,g,f;dn(o[e])?o[e].push(n):o[e]=[n],null===(s=this.instance.persistence)||void 0===s||s.register({[Ti]:o});var m=this.getFeatureFlagDetails(e),_={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:i,$feature_flag_bootstrapped_response:(null===(a=this.instance.config.bootstrap)||void 0===a||null===(l=a.featureFlags)||void 0===l?void 0:l[e])||null,$feature_flag_bootstrapped_payload:(null===(c=this.instance.config.bootstrap)||void 0===c||null===(u=c.featureFlagPayloads)||void 0===u?void 0:u[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};mn(null==m||null===(d=m.metadata)||void 0===d?void 0:d.version)||(_.$feature_flag_version=m.metadata.version);var y,b=null!==(h=null==m||null===(p=m.reason)||void 0===p?void 0:p.description)&&void 0!==h?h:null==m||null===(v=m.reason)||void 0===v?void 0:v.code;if(b&&(_.$feature_flag_reason=b),null!=m&&null!==(g=m.metadata)&&void 0!==g&&g.id&&(_.$feature_flag_id=m.metadata.id),mn(null==m?void 0:m.original_variant)&&mn(null==m?void 0:m.original_enabled)||(_.$feature_flag_original_response=mn(m.original_variant)?m.original_enabled:m.original_variant),null!=m&&null!==(f=m.metadata)&&void 0!==f&&f.original_payload)_.$feature_flag_original_payload=null==m||null===(y=m.metadata)||void 0===y?void 0:y.original_payload;this.instance.capture("$feature_flag_called",_)}return r}sp.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var r=this.instance.config.token;this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=4"),data:{distinct_id:this.instance.get_distinct_id(),token:r},compression:this.instance.config.disable_compression?void 0:qr.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:r=>{var n,i=null===(n=r.json)||void 0===n?void 0:n.featureFlagPayloads;t((null==i?void 0:i[e])||void 0)}})}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);sp.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(),o=this.getFlagsWithDetails();!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=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=pp(e),a=s.flags,l=s.featureFlags,c=s.featureFlagPayloads;if(l){var u=e.requestId;if(dn(l)){sp.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(l)for(var h=0;h<l.length;h++)d[l[h]]=!0;r&&r.register({[ap]:l,[wi]:d})}else{var p=l,v=c,g=a;e.errorsWhileComputingFlags&&(p=t(t({},n),p),v=t(t({},i),v),g=t(t({},o),g)),r&&r.register(t({[ap]:Object.keys(hp(p)),[wi]:p||{},[cp]:v||{},[Ci]:g||{}},u?{[dp]:u}:{}))}}}(e,this.instance.persistence,n,i,o),this._fireFeatureFlagsCallbacks(r)}}override(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];sp.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this.instance.__loaded||!this.instance.persistence)return sp.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.instance.persistence.unregister(lp),this.instance.persistence.unregister(up),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(lp);else if(r.flags)if(dn(r.flags)){for(var n={},i=0;i<r.flags.length;i++)n[r.flags[i]]=!0;this.instance.persistence.register({[lp]:n})}else this.instance.persistence.register({[lp]:r.flags});return"payloads"in r&&(!1===r.payloads?this.instance.persistence.unregister(up):r.payloads&&this.instance.persistence.register({[up]: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(Si)||[]).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({[ap]:Object.keys(hp(a)),[wi]:a}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0,n=this.instance.get_property(Si),i=r?"&".concat(r.map((e=>"stage=".concat(e))).join("&")):"";if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token).concat(i)),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({[Si]: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(Ii)||{};this.instance.register({[Ii]:t(t({},n),e)}),r&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(Ii)}setGroupPropertiesForFlags(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(ki)||{};0!==Object.keys(n).length&&Object.keys(n).forEach((r=>{n[r]=t(t({},n[r]),e[r]),delete e[r]})),this.instance.register({[ki]:t(t({},n),e)}),r&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var r=this.instance.get_property(ki)||{};this.instance.register({[ki]:t(t({},r),{},{[e]:{}})})}else this.instance.unregister(ki)}}var gp=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class fp{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&&Rn.info("Persistence loaded",e.persistence,t({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){-1===gp.indexOf(e.persistence.toLowerCase())&&(Rn.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&Id.is_supported()?Id:"localstorage+cookie"===t&&Ed.is_supported()?Ed:"sessionstorage"===t&&Rd.is_supported()?Rd:"memory"===t?Td:"cookie"===t?Sd:Ed.is_supported()?Ed:Sd}properties(){var e={};return Pn(this.props,(function(t,r){if(r===wi&&gn(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,(bn(o=Bi)?a:jr&&o.indexOf===jr?-1!=o.indexOf(s):(Pn(o,(function(e){if(a||(a=e===s))return Fn})),a))||(e[r]=t);var o,s,a})),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=On({},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(gn(e)){mn(t)&&(t="None"),this.expire_days=mn(r)?this.default_expiry:r;var n=!1;if(Pn(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(gn(e)){this.expire_days=mn(t)?this.default_expiry:t;var r=!1;if(Pn(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=Xa.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});fn(Hn(e))||this.register(e),this.campaign_params_saved=!0}}update_search_keyword(){this.register(Xa.searchInfo())}update_referrer_info(){this.register_once(Xa.referrerInfo(),void 0)}set_initial_person_info(){this.props[Fi]||this.props[Ni]||this.register_once({[Pi]:Xa.personInfo({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties})},void 0)}get_referrer_info(){return Hn({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};Pn([Ni,Fi],(t=>{var r=this.props[t];r&&Pn(r,(function(t,r){e["$initial_"+sn(r)]=t}))}));var t=this.props[Pi];if(t){var r=Xa.initialPersonPropsFromInfo(t);On(e,r)}return e}safe_merge(e){return Pn(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[ri]||{};r[e]=t,this.props[ri]=r,this.save()}remove_event_timer(e){var t=(this.props[ri]||{})[e];return mn(t)||(delete this.props[ri][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var mp=An("[RateLimiter]");class _p{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=>{mp.info("".concat(e||"events"," is quota limited.")),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void mp.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(Ai))&&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(Ai,o),{isRateLimited:s,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var yp=An("[RemoteConfig]");class bp{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))):(yp.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 yp.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void yp.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((e=>{if(!e)return yp.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){yp.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()):yp.info("__preview_remote_config is disabled. Logging config instead",e):yp.error("Failed to fetch remote config from PostHog.")}}var wp=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),bn(a)||(r>t&&(o+=e.substring(t,r)),o+=a,t=r=i+1)}return r>t&&(o+=e.substring(t,e.length)),o},Sp=!!Xr||!!Yr,Cp="text/plain",Ip=(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=Un(o);return s=s?(i?i+"&":"")+s:i,"".concat(n,"?").concat(s)},kp=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),Ep=e=>{var{data:t,compression:r}=e;if(t){if(r===qr.GZipJS){var n=Eh(xh(kp(t)),{mtime:0}),i=new Blob([n],{type:Cp});return{contentType:Cp,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=wp(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}(kp(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:kp(e)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=kp(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},xp=[];Yr&&xp.push({transport:"fetch",method:e=>{var r,n,{contentType:i,body:o,estimatedSize:s}=null!==(r=Ep(e))&&void 0!==r?r:{},a=new Headers;Pn(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){Rn.error(e)}null===(n=e.callback)||void 0===n||n.call(e,i)})))).catch((t=>{var r;Rn.error(t),null===(r=e.callback)||void 0===r||r.call(e,{statusCode:0,text:t})})).finally((()=>c?clearTimeout(c.timeout):null))}}),Xr&&xp.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=Ep(e))&&void 0!==t?t:{};Pn(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!=zr&&zr.sendBeacon&&xp.push({transport:"sendBeacon",method:e=>{var t=Ip(e.url,{beacon:"1"});try{var r,{contentType:n,body:i}=null!==(r=Ep(e))&&void 0!==r?r:{},o="string"==typeof i?new Blob([i],{type:n}):i;zr.sendBeacon(t,o)}catch(e){}}});var Tp=3e3;class Mp{constructor(e,t){i(this,"isPaused",!0),i(this,"queue",[]),this.flushTimeoutMs=Wd((null==t?void 0:t.flush_interval_ms)||Tp,250,5e3,"flush interval",Tp),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&&dn(n.data)&&Pn(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 Pn(this.queue,(r=>{var n,i=r,o=(i?i.batchKey:null)||i.url;mn(e[o])&&(e[o]=t(t({},i),{},{data:[]})),null===(n=e[o].data)||void 0===n||n.push(i.data)})),this.queue=[],e}}var Rp=["retriesPerformedSoFar"];class Ap{constructor(e){i(this,"isPolling",!1),i(this,"pollIntervalMs",3e3),i(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!mn($r)&&"onLine"in $r.navigator&&(this.areWeOnline=$r.navigator.onLine,jn($r,"online",(()=>{this.areWeOnline=!0,this.flush()})),jn($r,"offline",(()=>{this.areWeOnline=!1})))}retriableRequest(e){var{retriesPerformedSoFar:r}=e,n=o(e,Rp);Sn(r)&&r>0&&(n.url=Ip(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)"),Rn.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){Rn.error(e)}this.queue=[]}}class Fp{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(){jn($r,"scroll",this._updateScrollData,{capture:!0}),jn($r,"scrollend",this._updateScrollData,{capture:!0}),jn($r,"resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return null==$r?void 0:$r.document.documentElement;var e=dn(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 Np=e=>Xa.personInfo({maskPersonalDataProperties:null==e?void 0:e.config.mask_personal_data_properties,customPersonalDataProperties:null==e?void 0:e.config.custom_personal_data_properties});class Pp{constructor(e,t,r,n){i(this,"_onSessionIdCallback",(e=>{var t=this._getStored();if(!t||t.sessionId!==e){var r={sessionId:e,props:this._sessionSourceParamGenerator(this.instance)};this._persistence.register({[Ri]:r})}})),this.instance=e,this._sessionIdManager=t,this._persistence=r,this._sessionSourceParamGenerator=n||Np,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[Ri]}getSetOnceProps(){var e,t=null===(e=this._getStored())||void 0===e?void 0:e.props;return t?"r"in t?Xa.personPropsFromInfo(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return Pn(Hn(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_".concat(sn(r))]=t})),e}}var Op=An("[SessionId]");class Lp{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||gd,this._windowIdGenerator=r||gd;var o=this.config.persistence_name||this.config.token,s=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Wd(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=Rd.parse(this._window_id_storage_key),l=Rd.parse(this._primary_window_exists_storage_key);a&&!l?this._windowId=a:Rd.remove(this._window_id_storage_key),Rd.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){Op.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return mn(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&&Rd.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Rd.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Rd.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({[mi]:[t,e,r]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[mi];return dn(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){jn($r,"beforeunload",(()=>{this._canUseSessionStorage()&&Rd.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=Sn(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(),Op.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)}}var Dp=["$set_once","$set"],Bp=An("[SiteApps]");class qp{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,Dp)),{},{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=this.apps[e.id],r=()=>{var r;(!t.errored&&this.bufferedInvocations.length&&(Bp.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)})),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored)))&&(null===(r=this.stopBuffering)||void 0===r||r.call(this))},n=!1,i=i=>{t.errored=!i,t.loaded=!0,Bp.info("Site app with id ".concat(e.id," ").concat(i?"loaded":"errored")),n&&r()};try{var{processEvent:o}=e.init({posthog:this.instance,callback:e=>{i(e)}});o&&(t.processEvent=o),n=!0}catch(t){Bp.error("Error while initializing PostHog app with config id ".concat(e.id),t),i(!1)}if(n&&t.loaded)try{r()}catch(r){Bp.error("Error while processing buffered events PostHog app with config id ".concat(e.id),r),t.errored=!0}}setupSiteApps(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}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){Bp.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)return this.isEnabled?(this.setupSiteApps(),void this.instance.on("eventCaptured",(e=>this.onCapturedEvent(e)))):void Bp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null===(r=this.stopBuffering)||void 0===r||r.call(this),null!==(n=e.siteApps)&&void 0!==n&&n.length)if(this.isEnabled){var o=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 Bp.error("Error while initializing PostHog app with config id ".concat(e),t)}))};for(var{id:s,url:a}of e.siteApps)o(s,a)}else Bp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Hp,$p=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","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"],Wp=function(e,t){if(!e)return!1;var r=e.toLowerCase();return $p.concat(t||[]).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))},Vp=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&Wp(r,t))return!0;try{var n=null==e?void 0:e.userAgentData;if(null!=n&&n.brands&&n.brands.some((e=>Wp(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver};function Zp(e,t,r){return kp({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(Hp||(Hp={}));var jp="i.posthog.com";class zp{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(jp),".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]=Hp.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Hp.EU:this._regionCache[this.apiHost]=Hp.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===Hp.CUSTOM)return this.apiHost+t;var r=jp+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(r);case"api":return"https://".concat(this.region,".").concat(r)}}}var Gp={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&&Ja(t.href,e),not_regex:(e,t)=>!!$r&&!Ja(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Up{constructor(e){var t=this;i(this,"getWebExperimentsAndEvaluateDisplayLogic",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t.getWebExperiments((e=>{Up.logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;if(t._flagToExperiments)Up.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);_n(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];Up.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())Up.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(wn(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Up.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=Up.getWindowLocation();if(null!=e&&e.search){var t=Yn(null==e?void 0:e.search,"__experiment_id"),r=Yn(null==e?void 0:e.search,"__experiment_variant");t&&r&&(Up.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&&(Up.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!wn(e.conditions)&&(Up.matchUrlConditions(e)&&Up.matchUTMConditions(e))}static matchUrlConditions(e){var t;if(wn(e.conditions)||wn(null===(t=e.conditions)||void 0===t?void 0:t.url))return!0;var r,n,i,o=Up.getWindowLocation();return!!o&&(null===(r=e.conditions)||void 0===r||!r.url||Gp[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(wn(e.conditions)||wn(null===(t=e.conditions)||void 0===t?void 0:t.utm))return!0;var r=Xa.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];Rn.info("[WebExperiments] ".concat(e),r)}applyTransforms(e,t,r){this._is_bot()?Up.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?r.forEach((r=>{if(r.selector){var n;Up.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)}))}})):Up.logInfo("Control variants leave the page unmodified.")}_is_bot(){return zr&&this.instance?Vp(zr,this.instance.config.custom_blocked_useragents):void 0}}var Yp={},Xp=()=>{},Jp="posthog",Kp=!Sp&&-1===(null==Kr?void 0:Kr.indexOf("MSIE"))&&-1===(null==Kr?void 0:Kr.indexOf("Mozilla")),Qp=()=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:Vn(null==Gr?void 0:Gr.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Xp,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Ur&&_n(null==Ur?void 0:Ur.search)&&-1!==Ur.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,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;Rn.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:Tp},_onCapture:Xp}},ev=e=>{var t={};mn(e.process_person)||(t.person_profiles=e.process_person),mn(e.xhr_headers)||(t.request_headers=e.xhr_headers),mn(e.cookie_name)||(t.persistence_name=e.cookie_name),mn(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),mn(e.store_google)||(t.save_campaign_params=e.store_google),mn(e.verbose)||(t.debug=e.verbose);var r=On({},t,e);return dn(e.property_blacklist)&&(mn(e.property_denylist)?r.property_denylist=e.property_blacklist:dn(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:Rn.error("Invalid value for property_denylist config: "+e.property_denylist)),r};class tv{constructor(){i(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){Rn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class rv{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 tv),i(this,"_personProcessingSetOncePropertiesSent",!1),i(this,"version",Tn.LIB_VERSION),i(this,"_internalEventEmitter",new Ka),this.config=Qp(),this.SentryIntegration=Vh,this.sentryIntegration=e=>function(e,t){var r=Wh(e,t);return{name:$h,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 vp(this),this.toolbar=new Uh(this),this.scrollManager=new Fp(this),this.pageViewManager=new np(this),this.surveys=new ol(this),this.experiments=new Up(this),this.exceptions=new ip(this),this.rateLimiter=new _p(this),this.requestRouter=new zp(this),this.consent=new Ad(this),this.people={set:(e,t,r)=>{var n=_n(e)?{[e]:t}:e;this.setPersonProperties(n),null==r||r({})},set_once:(e,t,r)=>{var n=_n(e)?{[e]:t}:e;this.setPersonProperties(void 0,n),null==r||r({})}},this.on("eventCaptured",(e=>Rn.info('send "'.concat(null==e?void 0:e.event,'"'),e)))}init(e,t,r){if(r&&r!==Jp){var n,i=null!==(n=Yp[r])&&void 0!==n?n:new rv;return i._init(e,t,r),Yp[r]=i,Yp[Jp][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(mn(e)||yn(e))return Rn.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 Rn.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(On({},Qp(),ev(i),{name:o,token:e})),this.config.on_xhr_error&&Rn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:qr.GZipJS,this.persistence=new fp(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new fp(t(t({},this.config),{},{persistence:"sessionStorage"}));var s=t({},this.persistence.props),a=t({},this.sessionPersistence.props);if(this._requestQueue=new Mp((e=>this._send_retriable_request(e)),this.config.request_queue_config),this._retryQueue=new Ap(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new Lp(this),this.sessionPropsManager=new Pp(this,this.sessionManager,this.persistence)),new Xh(this).startIfEnabledOrStop(),this.siteApps=new qp(this),null===(r=this.siteApps)||void 0===r||r.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new Bh(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new rd(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new rp(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Qh(this),this.exceptionObserver=new Dd(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new Od(this,Pd),this.deadClicksAutocapture.startIfEnabled(),Tn.DEBUG=Tn.DEBUG||this.config.debug,Tn.DEBUG&&Rn.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(gd()),d=null!==(l=i.bootstrap)&&void 0!==l&&l.isIdentifiedID?u:i.bootstrap.distinctID;this.persistence.set_property(Mi,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:Di,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(gd());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(Mi,"anonymous")}return jn($r,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),i.segment?Hh(this,(()=>this._loaded())):this._loaded(),hn(this.config._onCapture)&&this.config._onCapture!==Xp&&(Rn.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(!Gr||!Gr.body)return Rn.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=nn(e.supportedCompression,qr.GZipJS)?qr.GZipJS:nn(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){Rn.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((()=>{this.consent.isOptedIn()&&this._captureInitialPageview()}),1),new bp(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()||Nn(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&&(Kp?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Ip(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=Ip(o.url,{_:(new Date).getTime().toString(),ver:Tn.LIB_VERSION,compression:o.compression});var s=null!==(r=o.transport)&&void 0!==r?r:"fetch",a=null!==(n=null===(i=Zn(xp,(e=>e.transport===s)))||void 0===i?void 0:i.method)&&void 0!==n?n:xp[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=[];Nn(e,(e=>{e&&(t=e[0],dn(t)?i.push(e):hn(e)?e.call(this):dn(e)&&"alias"===t?r.push(e):dn(e)&&-1!==t.indexOf("capture")&&hn(this[t])?i.push(e):n.push(e))}));var o=function(e,t){Nn(e,(function(e){if(dn(e[0])){var r=t;Pn(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(!mn(e)&&_n(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){null!=r&&r.$current_url&&!_n(null==r?void 0:r.$current_url)&&(Rn.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==r||delete r.$current_url),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=gd(),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=$n(c,null!=n&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,mn(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(fn(d)||this.setPersonPropertiesForFlags(d),!wn(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}Rn.critical("This capture call is ignored due to client rate limiting.")}}else Rn.error("No event name provided to posthog.capture")}else Rn.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,(!_n(s.distinct_id)&&!Sn(s.distinct_id)||yn(s.distinct_id))&&Rn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var l,c=Xa.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}this.sessionPropsManager&&On(s,this.sessionPropsManager.getSessionProps());try{var h,p;this.sessionRecording&&(s.$recording_status=this.sessionRecording.status,s.$sdk_debug_replay_internal_buffer_length=this.sessionRecording.buffer.data.length,s.$sdk_debug_replay_internal_buffer_size=this.sessionRecording.buffer.size),s.$sdk_debug_retry_queue_size=null===(h=this._retryQueue)||void 0===h||null===(p=h.queue)||void 0===p?void 0:p.length}catch(e){s.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Hp.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=On(s,l),"$pageview"===e&&Gr&&(s.title=Gr.title),!mn(o)){var v=n.getTime()-o;s.$duration=parseFloat((v/1e3).toFixed(3))}Kr&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=On({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),dn(this.config.property_denylist)?Pn(this.config.property_denylist,(function(e){delete s[e]})):Rn.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(Rn.error("sanitize_properties is deprecated. Use before_send instead"),s=g(s,e));var f=this._hasPersonProcessing();return s.$process_person_profile=f,f&&this._requirePersonProcessing("_calculate_event_properties"),s}_calculate_set_once_properties(e){var t;if(!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent)return e;var r=this.persistence.get_initial_props(),n=null===(t=this.sessionPropsManager)||void 0===t?void 0:t.getSetOnceProps(),i=On({},r,n||{},e||{}),o=this.config.sanitize_properties;return o&&(Rn.error("sanitize_properties is deprecated. Use before_send instead"),i=o(i,"$set_once")),this._personProcessingSetOncePropertiesSent=!0,fn(i)?void 0:i}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],r=arguments.length>2?arguments[2]:void 0;return this.featureFlags.getEarlyAccessFeatures(e,t,r)}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)}identify(e,r,n){if(!this.__loaded||!this.persistence)return Rn.uninitializedWarning("posthog.identify");if(Sn(e)&&(e=e.toString(),Rn.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()))Rn.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(ti)&&(this.unregister(ti),this.register({distinct_id:e}));var s="anonymous"===(this.persistence.get_property(Mi)||"anonymous");e!==i&&s?(this.persistence.set_property(Mi,"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=Zp(e,r,n)):(r||n)&&(this._cachedIdentify!==Zp(e,r,n)?(this.setPersonProperties(r,n),this._cachedIdentify=Zp(e,r,n)):Rn.info("A duplicate posthog.identify call was made with the same properties. It has been ignored.")),e!==i&&(this.reloadFeatureFlags(),this.unregister(Ti))}}else Rn.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 Rn.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(Rn.info("reset"),!this.__loaded)return Rn.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(Mi,"anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId(),this._cachedIdentify=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Di,$device_id:null},"");else{var s=this.config.get_device_id(gd());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(ei)?(Rn.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(mn(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(ti,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Rn.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);gn(e)&&(On(this.config,ev(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 fp(t(t({},this.config),{},{persistence:"sessionStorage"})),Id.is_supported()&&"true"===Id.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(Tn.DEBUG=!0,Rn.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=hn(null===(n=Qr.__PosthogExtensions__)||void 0===n?void 0:n.parseErrorAsProperties)?t(t({},Qr.__PosthogExtensions__.parseErrorAsProperties(En(e)?{error:e,event:e.message}:{event:e},{syntheticException:i})),r):t({$exception_level:"error",$exception_list:[{type:En(e)?e.name:"Error",value:En(e)?e.message:gn(e)&&"message"in e?String(e.message):String(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:Jp;return t!==Jp&&(t=Jp+"."+t),t}_isIdentified(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(Mi))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(Mi))}_hasPersonProcessing(){var e,t,r,n;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&fn(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[ti])&&(null===(r=this.persistence)||void 0===r||null===(n=r.props)||void 0===n||!n[Oi]))}_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?(Rn.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Oi,!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(),mn(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 zr?Vp(zr,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Gr&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:Gr.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(wn(this.config.before_send))return e;var t=dn(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of t){if(r=n(r),wn(r)){var i="Event '".concat(e.event,"' was rejected in beforeSend function");return xn(e.event)?Rn.warn("".concat(i,". This can cause unexpected behavior.")):Rn.info(i),null}r.properties&&!fn(r.properties)||Rn.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}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(r)})}}!function(e,t){for(var r=0;r<t.length;r++)e.prototype[t[r]]=qn(e.prototype[t[r]])}(rv,["identify"]);var nv,iv;nv=Yp[Jp]=new rv,(iv=Qr.posthog)&&Pn(iv._i,(function(e){if(e&&dn(e)){var t=nv.init(e[0],e[1],e[2]),r=iv[e[2]]||iv;t&&(t._execute_array.call(t.people,r.people),t._execute_array(r))}})),Qr.posthog=nv,function(){function e(){e.done||(e.done=!0,Kp=!1,Pn(Yp,(function(e){e._dom_loaded()})))}null!=Gr&&Gr.addEventListener?"complete"===Gr.readyState?e():jn(Gr,"DOMContentLoaded",e,{capture:!1}):$r&&Rn.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 F(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?R(t):null}function N(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 P=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,O=/^(?:[a-z+]+:)?\/\//i,L=/^www\..*/i,D=/^(data:)([^,]*),(.*)/i;function B(e,t){return(e||"").replace(P,((e,r,n,i,o,s)=>{var a,l=n||o||s,c=r||i||"";if(!l)return e;if(O.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 j=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/;var G=new WeakMap;function U(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=G.get(e);if(r||(r=e.createElement("a"),G.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]?U(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(z),!(r>=t.length);){var o=n(j);if(","===o.slice(-1))o=U(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=U(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?U(e,n):n:U(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 N=e.value,P=e.checked;"radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&N?_.value=M({element:e,type:F(e),tagName:m,value:N,maskInputOptions:a,maskInputFn:l}):P&&(_.checked=P)}"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 O=e.toDataURL(c.type,c.quality),L=n.createElement("canvas");L.width=e.width,L.height=e.height,O!==L.toDataURL(c.type,c.quality)&&(_.rr_dataURL=O)}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:j,height:z}=e.getBoundingClientRect();_={class:_.class,rr_width:"".concat(j,"px"),rr_height:"".concat(z,"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,F=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(!F)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"===N(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}(F,v)&&(R||F.type!==h.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?Z():V;var P=Object.assign(F,{id:A});if(n.add(e,P),A===V)return null;_&&_(e);var O=!l;if(P.type===h.Element){O=O&&!P.needBlock,delete P.needBlock;var L=w.shadowRoot(e);L&&I(L)&&(P.isShadowHost=!0)}if((P.type===h.Document||P.type===h.Element)&&O){v.headWhitespace&&P.type===h.Element&&"head"===P.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(P.type===h.Element&&"textarea"===P.tagName&&void 0!==P.attributes.value);else for(var B of Array.from(w.childNodes(e))){var q=ne(B,D);q&&P.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),P.childNodes.push(W))}}var j=w.parentNode(e);return j&&C(j)&&I(j)&&(P.isShadow=!0),P.type===h.Element&&"iframe"===P.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),P.type===h.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===N(P.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),P}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 Fe(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 Ne=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 Pe(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 Oe(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Pe(r);)r=t;return r}(e);return ve.contains(t,r)}function Le(e){var t=e.ownerDocument;return!!t&&(ve.contains(t,e)||Oe(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 je,ze=(e,t)=>"".concat(e,"@").concat(t);class Ge{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(Pe(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),Fe(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=F(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)?(Ue(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[ze(r,n)]?Ue(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[ze(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))),Fe(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 Ue(e,t){e.delete(t),ve.childNodes(t).forEach((t=>Ue(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(!je)return e;return function(){try{return e(...arguments)}catch(e){if(je&&!0===je(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 Ge;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=F(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 Ft{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 Nt{constructor(e){c(this,"trackedLinkElements",new WeakSet),c(this,"mutationCb"),c(this,"adoptedStyleSheetCb"),c(this,"styleMirror",new Ne),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 Pt{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 Ot=!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:F=new Set([]),errorHandler:N}=e;je=N;var P=!I||window.parent===window,O=!1;if(!P)try{window.parent.document&&(O=!1)}catch(e){O=!0}if(P&&!r)throw new Error("emit function is required");if(!P&&!O)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 _&&!O&&(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())),P)null==r||r(H(s),t);else if(O){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 Nt({mutationCb:$,adoptedStyleSheetCb:e=>Et({type:De.IncrementalSnapshot,data:t({source:Be.AdoptedStyleSheet},e)})}),j=new pt({mirror:qt,mutationCb:$,stylesheetManager:Z,recordCrossOriginIframes:I,wrappedEmit:Et});for(var z of R||[])z.getMirror&&z.getMirror({nodeMirror:qt,crossOriginIframeMirror:j.crossOriginIframeMirror,crossOriginIframeStyleMirror:j.crossOriginIframeStyleMirror});var G=new Pt;Tt=new Ft({recordCanvas:C,mutationCb:V,win:window,blockClass:o,blockSelector:s,mirror:qt,sampling:y.canvas,dataURLOptions:b});var U=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:j,stylesheetManager:Z,canvasManager:Tt,keepIframeSrcFn:A,processedNodeManager:G},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(),U.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)&&j.addIframe(e),Ae(e,qt)&&Z.trackLinkElement(e),Fe(e)&&U.addShadowRoot(ve.shadowRoot(e),document)},onIframeLoad:(e,t)=>{j.attachIframe(e,t),U.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:j,stylesheetManager:Z,shadowDomManager:U,processedNodeManager:G,canvasManager:Tt,ignoreCSSAttributes:F,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)};j.addLoadListener((e=>{try{Y.push(X(e.contentDocument))}catch(e){console.warn(e)}}));var J=()=>{xt(),Y.push(X(document)),Ot=!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())),G.destroy(),Ot=!1,je=void 0}}catch(e){console.warn(e)}}Ht.addCustomEvent=(e,t)=>{if(!Ot)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(!Ot)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,jt=(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),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),Ut={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 Ut?Ut[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(){Gt(this,"idNodeMap",new Map),Gt(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(){jt(this,"id",1),jt(this,"styleIDMap",new WeakMap),jt(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])?$/,Fr={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 Nr(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 Pr(e){return"[object Object]"===Object.prototype.toString.call(e)}function Or(e,t){if(0===t)return!0;var r=Object.keys(e);for(var n of r)if(Pr(e[n])&&Or(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(Pr(e)&&Object.keys(e).length>r.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Pr(e)&&Or(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]=Nr(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=Fr.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=Fr.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=Fr.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,jr=Vr.indexOf,zr=null==Wr?void 0:Wr.navigator,Gr=null==Wr?void 0:Wr.document,Ur=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==zr?void 0:zr.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"];function nn(e,t){return-1!==e.indexOf(t)}var on=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},sn=function(e){return e.replace(/^\$/,"")};var an=Array.isArray,ln=Object.prototype,cn=ln.hasOwnProperty,un=ln.toString,dn=an||function(e){return"[object Array]"===un.call(e)},hn=e=>"function"==typeof e,pn=e=>hn(e)&&-1!==e.toString().indexOf("[native code]"),vn=()=>!!$r.Zone,gn=e=>e===Object(e)&&!dn(e),fn=e=>{if(gn(e)){for(var t in e)if(cn.call(e,t))return!1;return!0}return!1},mn=e=>void 0===e,_n=e=>"[object String]"==un.call(e),yn=e=>_n(e)&&0===e.trim().length,bn=e=>null===e,wn=e=>mn(e)||bn(e),Sn=e=>"[object Number]"==un.call(e),Cn=e=>"[object Boolean]"===un.call(e),In=e=>e instanceof Document,kn=e=>e instanceof FormData,En=e=>e instanceof Error,xn=e=>nn(tn,e),Tn={DEBUG:!1,LIB_VERSION:"1.232.4"},Mn=e=>{var t={_log:function(t){if($r&&(Tn.DEBUG||Qr.POSTHOG_DEBUG)&&!mn($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=>Mn("".concat(e," ").concat(t))};return t},Rn=Mn("[PostHog.js]"),An=Rn.createLogger,Fn={};function Nn(e,t,r){if(dn(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)===Fn)return}function Pn(e,t,r){if(!wn(e)){if(dn(e))return Nn(e,t,r);if(kn(e)){for(var n of e.entries())if(t.call(r,n[1],n[0])===Fn)return}else for(var i in e)if(cn.call(e,i)&&t.call(r,e[i],i)===Fn)return}}var On=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 Nn(r,(function(t){for(var r in t)void 0!==t[r]&&(e[r]=t[r])})),e},Ln=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 Nn(r,(function(t){Nn(t,(function(t){e.push(t)}))})),e};function Dn(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 Bn=function(e){try{return e()}catch(e){return}},qn=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){Rn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Rn.critical(e)}}},Hn=function(e){var t={};return Pn(e,(function(e,r){_n(e)&&e.length>0&&(t[r]=e)})),t};function $n(e,t){return r=e,n=e=>_n(e)&&!bn(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),dn(t)?(o=[],Nn(t,(t=>{o.push(e(t))}))):(o={},Pn(t,((t,r)=>{i.has(t)||(o[r]=e(t,r))}))),o);var o}(r);var r,n,i}var Wn=["herokuapp.com","vercel.app","netlify.app"];function Vn(e){var t=null==e?void 0:e.hostname;if(!_n(t))return!1;var r=t.split(".").slice(-2).join(".");for(var n of Wn)if(r===n)return!1;return!0}function Zn(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return e[r]}function jn(e,t,r,n){var{capture:i=!1,passive:o=!0}=null!=n?n:{};null==e||e.addEventListener(t,r,{capture:i,passive:o})}var zn=["localhost","127.0.0.1"],Gn=e=>{var t=null==Gr?void 0:Gr.createElement("a");return mn(t)?null:(t.href=e,t)},Un=function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return Pn(e,(function(e,n){mn(e)||mn(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)},Yn=function(e,t){for(var r,n=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<n.length;i++){var o=n[i].split("=");if(o[0]===t){r=o;break}}if(!dn(r)||r.length<2)return"";var s=r[1];try{s=decodeURIComponent(s)}catch(e){Rn.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Xn=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("=");dn(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},Jn=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null};function Kn(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return hn(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=n}}catch(e){return()=>{}}}function Qn(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 ei="$people_distinct_id",ti="__alias",ri="__timers",ni="$autocapture_disabled_server_side",ii="$heatmaps_enabled_server_side",oi="$exception_capture_enabled_server_side",si="$web_vitals_enabled_server_side",ai="$dead_clicks_enabled_server_side",li="$web_vitals_allowed_metrics",ci="$session_recording_enabled_server_side",ui="$console_log_recording_enabled_server_side",di="$session_recording_network_payload_capture",hi="$session_recording_masking",pi="$session_recording_canvas_recording",vi="$replay_sample_rate",gi="$replay_minimum_duration",fi="$replay_script_config",mi="$sesid",_i="$session_is_sampled",yi="$session_recording_url_trigger_activated_session",bi="$session_recording_event_trigger_activated_session",wi="$enabled_feature_flags",Si="$early_access_features",Ci="$feature_flag_details",Ii="$stored_person_properties",ki="$stored_group_properties",Ei="$surveys",xi="$surveys_activated",Ti="$flag_call_reported",Mi="$user_state",Ri="$client_session_props",Ai="$capture_rate_limit",Fi="$initial_campaign_params",Ni="$initial_referrer_info",Pi="$initial_person_info",Oi="$epp",Li="__POSTHOG_TOOLBAR__",Di="$posthog_cookieless",Bi=[ei,ti,"__cmpns",ri,ci,ii,mi,wi,Mi,Si,Ci,ki,Ii,Ei,Ti,Ri,Ai,Fi,Ni,Oi];function qi(e){var t;return e instanceof Element&&(e.id===Li||!(null===(t=e.closest)||void 0===t||!t.call(e,".toolbar-global-fade-container")))}function Hi(e){return!!e&&1===e.nodeType}function $i(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Wi(e){return!!e&&3===e.nodeType}function Vi(e){return!!e&&11===e.nodeType}function Zi(e){return e?on(e).split(/\s+/):[]}function ji(e){var t=null==$r?void 0:$r.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function zi(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 Zi(t)}function Gi(e){return wn(e)?null:on(e).split(/(\s+)/).filter((e=>ao(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ui(e){var t="";return Qi(e)&&!eo(e)&&e.childNodes&&e.childNodes.length&&Pn(e.childNodes,(function(e){var r;Wi(e)&&e.textContent&&(t+=null!==(r=Gi(e.textContent))&&void 0!==r?r:"")})),on(t)}function Yi(e){return mn(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Xi=["a","button","form","input","select","textarea","label"];function Ji(e){var t=e.parentNode;return!(!t||!Hi(t))&&t}function Ki(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||$i(e,"html")||!Hi(e))return!1;if(null!=r&&r.url_allowlist&&!ji(r.url_allowlist))return!1;if(null!=r&&r.url_ignorelist&&ji(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&&!$i(c,"body");)if(Vi(c.parentNode))a.push(c.parentNode.host),c=c.parentNode.host;else{if(!(l=Ji(c)))break;if(n||Xi.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(mn(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(mn(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&&(Xi.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}function Qi(e){for(var t=e;t.parentNode&&!$i(t,"body");t=t.parentNode){var r=zi(t);if(nn(r,"ph-sensitive")||nn(r,"ph-no-capture"))return!1}if(nn(zi(e),"ph-include"))return!0;var n=e.type||"";if(_n(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(_n(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 eo(e){return!!($i(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||$i(e,"select")||$i(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var to="(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})",ro=new RegExp("^(?:".concat(to,")$")),no=new RegExp(to),io="\\d{3}-?\\d{2}-?\\d{4}",oo=new RegExp("^(".concat(io,")$")),so=new RegExp("(".concat(io,")"));function ao(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(wn(e))return!1;if(_n(e)){if(e=on(e),(t?ro:no).test((e||"").replace(/[- ]/g,"")))return!1;if((t?oo:so).test(e))return!1}return!0}function lo(e){var t=Ui(e);return ao(t="".concat(t," ").concat(co(e)).trim())?t:""}function co(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Pn(e.childNodes,(function(e){var r;if(e&&"span"===(null===(r=e.tagName)||void 0===r?void 0:r.toLowerCase()))try{var n=Ui(e);t="".concat(t," ").concat(n).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(co(e)).trim())}catch(e){Rn.error("[AutoCapture]",e)}})),t}function uo(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 Dn(s).sort(((e,t)=>{var[r]=e,[n]=t;return r.localeCompare(n)})).forEach((e=>{var[t,r]=e;return a[ho(t.toString())]=ho(r.toString())})),i+=":",i+=Dn(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:po(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Dn(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 ho(e){return e.replace(/"|\\"/g,'\\"')}function po(e){var t=e.attr__class;return t?dn(t)?t:Zi(t):void 0}var vo="[SessionRecording]",go="redacted",fo={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"]},mo=["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"],_o=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],yo=["/s/","/e/","/i/"];function bo(e,t,r,n){if(wn(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return _n(i)&&(i=parseInt(i)),i>r?vo+" ".concat(n," body too large to record (").concat(i," bytes)"):e}function wo(e,t){if(wn(e))return e;var r=e;return ao(r,!1)||(r=vo+" "+t+" body "+go),Pn(_o,(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=vo+" "+t+" body "+go+" as might contain: "+e)})),r}var So=(e,r)=>{var n,i,o,s={payloadSizeLimitBytes:fo.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...fo.performanceEntryTypeToObserve],payloadHostDenyList:[...r.payloadHostDenyList||[],...fo.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=bo(e.requestBody,e.requestHeaders,o,"Request")),null!=e&&e.responseBody&&(e.responseBody=bo(e.responseBody,e.responseHeaders,o,"Response")),e)),d=t=>{return u(((e,t)=>{var r,n=Gn(e.name),i=0===t.indexOf("http")?null===(r=Gn(t))||void 0===r?void 0:r.pathname:t;"/"===i&&(i="");var o=null==n?void 0:n.pathname.replace(i||"","");if(!(n&&o&&yo.some((e=>0===o.indexOf(e)))))return e})((n=(r=t).requestHeaders,wn(n)||Pn(Object.keys(null!=n?n:{}),(e=>{mo.includes(e.toLowerCase())&&(n[e]=go)})),r),e.api_host));var r,n},h=hn(e.session_recording.maskNetworkRequestFn);return h&&hn(e.session_recording.maskCapturedNetworkRequestFn)&&Rn.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=hn(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(!mn(e))return e.requestBody=wo(e.requestBody,"Request"),e.responseBody=wo(e.responseBody,"Response"),e}(d(e)),t(t(t({},fo),s),{},{recordHeaders:a,recordBody:l,recordPerformance:c,recordInitialRequests:c})},Co=An("[Recorder]"),Io=e=>"navigation"===e.entryType,ko=e=>"resource"===e.entryType;function Eo(e,t,r){if(r.recordInitialRequests){var n=t.performance.getEntries().filter((e=>Io(e)||ko(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=>Io(e)||ko(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 xo(e,t){return!!t&&(Cn(t)||t[e])}function To(e){var{type:t,recordBody:r,headers:n,url:i}=e;function o(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(function e(t){try{return"string"==typeof t?t.startsWith("blob:"):t instanceof URL?"blob:"===t.protocol:t instanceof Request&&e(t.url)}catch(e){return!1}}(i))return!1;if(Cn(r))return!0;if(dn(r))return o(r);var s=r[t];return Cn(s)?s:o(s)}function Mo(e,t,r,n,i){return Ro.apply(this,arguments)}function Ro(){return Ro=n((function*(e,t,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(o>10)return Co.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=>ko(e)&&e.initiatorType===t&&(mn(n)||e.startTime>=n)&&(mn(i)||e.startTime<=i)));return s||(yield new Promise((e=>setTimeout(e,50*o))),Mo(e,t,r,n,i,o+1))})),Ro.apply(this,arguments)}function Ao(e){var{body:t,options:r,url:n}=e;if(wn(t))return null;var{hostname:i,isHostDenied:o}=Qn(n,r);if(o)return i+" is in deny list";if(_n(t))return t;if(In(t))return t.textContent;if(kn(t))return Un(t);if(gn(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 Fo=e=>!bn(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:mn(a)?void 0:Math.round(a),endTime:mn(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(Fo(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 Po=["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 Lo(){return Lo=n((function*(e){var{r:t,options:r,url:n}=e,{hostname:i,isHostDenied:o}=Qn(n,r);return o?Promise.resolve(i+" is in deny list"):Oo(t)})),Lo.apply(this,arguments)}function Do(){return Do=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=Po.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}=Qn(i,n);return l?a+" is in deny list":null}({r:t,options:r,url:n});return bn(i)?Oo(t):Promise.resolve(i)})),Do.apply(this,arguments)}function Bo(e,t,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var i=xo("request",r.recordHeaders),o=xo("response",r.recordHeaders),s=Kn(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),To({type:"request",headers:p,url:n,recordBody:r.recordBody})&&(h.requestBody=yield function(e){return Lo.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),To({type:"response",headers:v,url:n,recordBody:r.recordBody})&&(h.responseBody=yield function(e){return Do.apply(this,arguments)}({r:l,options:r,url:n})),l}finally{Mo(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 qo=null;function Ho(e,r,n){if(!("performance"in r))return()=>{};if(qo)return Co.warn("Network observer already initialised, doing nothing"),()=>{};var i=n?Object.assign({},fo,n):fo,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=Eo(o,r,i),a=()=>{},l=()=>{};return(i.recordHeaders||i.recordBody)&&(a=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var n=xo("request",r.recordHeaders),i=xo("response",r.recordHeaders),o=Kn(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=>(To({type:"request",headers:f,url:a,recordBody:r.recordBody})&&(g.requestBody=Ao({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),To({type:"response",headers:n,url:a,recordBody:r.recordBody})&&(g.responseBody=Ao({body:p.response,options:r,url:a})),Mo(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=Bo(o,r,i)),qo=()=>{s(),a(),l()}}var $o=e=>({name:"rrweb/network@1",observer:Ho,options:e});Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Hr,getRecordNetworkPlugin:$o},Qr.__PosthogExtensions__.rrweb={record:Ht,version:"v2"},Qr.rrweb={record:Ht,version:"v2"},Qr.rrwebConsoleRecord={getRecordConsolePlugin:Hr},Qr.getRecordNetworkPlugin=$o;var Wo,Vo,Zo,jo,zo,Go,Uo,Yo,Xo,Jo,Ko,Qo,es={},ts=[],rs=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ns=Array.isArray;function is(e,t){for(var r in t)e[r]=t[r];return e}function os(e){var t=e.parentNode;t&&t.removeChild(e)}function ss(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?Wo.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 as(e,s,n,i,null)}function as(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?++Zo:i,__i:-1,__u:0};return null==i&&null!=Vo.vnode&&Vo.vnode(o),o}function ls(e){return e.children}function cs(e,t){this.props=e,this.context=t}function us(e,t){if(null==t)return e.__?us(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?us(e):null}function ds(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 ds(e)}}function hs(e){(!e.__d&&(e.__d=!0)&&jo.push(e)&&!ps.__r++||zo!==Vo.debounceRendering)&&((zo=Vo.debounceRendering)||Go)(ps)}function ps(){var e,t,r,n,i,o,s,a,l;for(jo.sort(Uo);e=jo.shift();)e.__d&&(t=jo.length,n=void 0,o=(i=(r=e).__v).__e,a=[],l=[],(s=r.__P)&&((n=is({},i)).__v=i.__v+1,Vo.vnode&&Vo.vnode(n),ws(s,n,i,r.__n,void 0!==s.ownerSVGElement,32&i.__u?[o]:null,a,null==o?us(i):o,!!(32&i.__u),l),n.__.__k[n.__i]=n,Ss(a,n,l),n.__e!=o&&ds(n)),jo.length>t&&jo.sort(Uo));ps.__r=0}function vs(e,t,r,n,i,o,s,a,l,c,u){var d,h,p,v,g,f=n&&n.__k||ts,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?as(null,i,null,null,i):ns(i)?as(ls,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?as(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,a=fs(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=us(o)),Is(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=us(o)),Is(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?es:f[p.__i]||es,p.__i=d,ws(e,p,h,i,o,s,a,l,c,u),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Cs(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=gs(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 gs(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=gs(n[i],t,r));return t}return e.__e!=t&&(r.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function fs(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 ms(e,t,r){"-"===t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||rs.test(t)?r:r+"px"}function _s(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||ms(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||ms(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?bs:ys,o)):e.removeEventListener(t,o?bs:ys,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 ys(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Vo.event?Vo.event(e):e)}function bs(e){return this.l[e.type+!0](Vo.event?Vo.event(e):e)}function ws(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=Vo.__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 cs(m,y),d.constructor=k,d.render=ks),_&&_.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=is({},d.__s)),is(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=Vo.__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=is(is({},n),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(p,v)),vs(e,ns(I=null!=u&&u.type===ls&&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),Vo.__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&&Wo.call(e.childNodes),f=r.props||es,!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||_s(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||_s(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=""),vs(e,ns(h)?h:[h],t,r,n,i&&"foreignObject"!==_,o,s,o?o[0]:r.__k&&us(r,0),a,l),null!=o)for(c=o.length;c--;)null!=o[c]&&os(o[c]);a||(c="value",void 0!==v&&(v!==e[c]||"progress"===_&&!v||"option"===_&&v!==f[c])&&_s(e,c,v,f[c],!1),c="checked",void 0!==g&&g!==e[c]&&_s(e,c,g,f[c],!1))}return e}(r.__e,t,r,n,i,o,s,l,c);(u=Vo.diffed)&&u(t)}function Ss(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)Cs(r[n],r[++n],r[++n]);Vo.__c&&Vo.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Vo.__e(e,t.__v)}}))}function Cs(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){Vo.__e(e,r)}}function Is(e,t,r){var n,i;if(Vo.unmount&&Vo.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Cs(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){Vo.__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]&&Is(n[i],t,r||"function"!=typeof e.type);r||null==e.__e||os(e.__e),e.__=e.__e=e.__d=void 0}function ks(e,t,r){return this.constructor(e,r)}function Es(e,t,r){var n,i,o,s;Vo.__&&Vo.__(e,t),i=(n="function"==typeof r)?null:t.__k,o=[],s=[],ws(t,e=(!n&&r||t).__k=ss(ls,null,[e]),i||es,es,void 0!==t.ownerSVGElement,!n&&r?[r]:i?null:t.firstChild?Wo.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,s),Ss(o,e,s)}function xs(e,t,r){var n,i,o,s,a=is({},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?Wo.call(arguments,2):r),as(e.type,a,n||e.key,i||e.ref,null)}Wo=ts.slice,Vo={__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}},Zo=0,cs.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=is({},this.state),"function"==typeof e&&(e=e(is({},r),this.props)),e&&is(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),hs(this))},cs.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),hs(this))},cs.prototype.render=ls,jo=[],Go="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Uo=function(e,t){return e.__v.__b-t.__v.__b},ps.__r=0,Yo=0,function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(Xo||(Xo={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(Jo||(Jo={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(Ko||(Ko={})),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}(Qo||(Qo={}));var Ts=An("[Stylesheet Loader]"),Ms=(e,t,r)=>{var n,i=e.createElement("style");return i.innerText=t,null!=r&&null!==(n=r.config)&&void 0!==n&&n.prepare_external_dependency_stylesheet&&(i=r.config.prepare_external_dependency_stylesheet(i)),i||(Ts.error("prepare_external_dependency_stylesheet returned null"),null)},Rs=$r,As=Gr,Fs="seenSurvey_",Ns=An("[Surveys]"),Ps=2147483647;function Os(e){if("inherit"===e)return"inherit";var t='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return e?"".concat(e,", ").concat(t):"-apple-system, ".concat(t)}var Ls=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(Os(null==e?void 0:e.fontFamily),";\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)||Ps.toString()),";\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: ").concat((null==e?void 0:e.disabledButtonOpacity)||"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(Os(null==e?void 0:e.fontFamily),";\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(Bs((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 .limit-height {\n max-height: 300px;\n overflow: auto;\n scrollbar-width: thin;\n scrollbar-color: ").concat((null==e?void 0:e.borderColor)||"#c9c6c6"," ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\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 Ds(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 Bs(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hs;"#"===t[0]&&(e=Ds(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=Ds(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 qs={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"},Hs="#eeeded",$s=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(Gs(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,t)=>({id:e.id,question:e.question,index:t}))),sessionRecordingUrl:null===(e=i.get_session_replay_url)||void 0===e?void 0:e.call(i)},r),{},{$set:{[Us(n,"responded")]:!0}})),Rs.dispatchEvent(new Event("PHSurveySent"))):Ns.error("[survey sent] event not captured, PostHog instance not found.")},Ws=(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:{[Us(e,"dismissed")]:!0}}),localStorage.setItem(Gs(e),"true"),Rs.dispatchEvent(new Event("PHSurveyClosed"))):Ns.error("[survey dismissed] event not captured, PostHog instance not found.")},Vs=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Zs=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,js=e=>e.appearance&&e.appearance.shuffleQuestions?Zs(e.questions,Vs(e.questions)):e.questions,zs=e=>{var t,r;return e.schedule===Qo.Always&&e.type===Xo.Widget||!(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))},Gs=e=>{var t="".concat(Fs).concat(e.id);return e.current_iteration&&e.current_iteration>0&&(t="".concat(Fs).concat(e.id,"_").concat(e.current_iteration)),t},Us=(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},Ys=function(e,t){var r={__c:t="__cC"+Yo++,__: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,hs(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,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},onPopupSurveySent:()=>{}}),Xs=e=>{var{component:t,children:r,renderAsHtml:n,style:i}=e;return xs(t,n?{dangerouslySetInnerHTML:{__html:r},style:i}:{children:r,style:i})},Js="Mobile",Ks="iOS",Qs="Android",ea="Tablet",ta=Qs+" "+ea,ra="iPad",na="Apple",ia=na+" Watch",oa="Safari",sa="BlackBerry",aa="Samsung",la=aa+"Browser",ca=aa+" Internet",ua="Chrome",da=ua+" OS",ha=ua+" "+Ks,pa="Internet Explorer",va=pa+" "+Js,ga="Opera",fa=ga+" Mini",ma="Edge",_a="Microsoft "+ma,ya="Firefox",ba=ya+" "+Ks,wa="Nintendo",Sa="PlayStation",Ca="Xbox",Ia=Qs+" "+Js,ka=Js+" "+oa,Ea="Windows",xa=Ea+" Phone",Ta="Nokia",Ma="Ouya",Ra="Generic",Aa=Ra+" "+Js.toLowerCase(),Fa=Ra+" "+ea.toLowerCase(),Na="Konqueror",Pa="(\\d+(\\.\\d+)?)",Oa=new RegExp("Version/"+Pa),La=new RegExp(Ca,"i"),Da=new RegExp(Sa+" \\w+","i"),Ba=new RegExp(wa+" \\w+","i"),qa=new RegExp(sa+"|PlayBook|BB10","i"),Ha={"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 $a=(e,t)=>t&&nn(t,na)||function(e){return nn(e,oa)&&!nn(e,ua)&&!nn(e,Qs)}(e),Wa=function(e,t){return t=t||"",nn(e," OPR/")&&nn(e,"Mini")?fa:nn(e," OPR/")?ga:qa.test(e)?sa:nn(e,"IE"+Js)||nn(e,"WPDesktop")?va:nn(e,la)?ca:nn(e,ma)||nn(e,"Edg/")?_a:nn(e,"FBIOS")?"Facebook "+Js:nn(e,"UCWEB")||nn(e,"UCBrowser")?"UC Browser":nn(e,"CriOS")?ha:nn(e,"CrMo")||nn(e,ua)?ua:nn(e,Qs)&&nn(e,oa)?Ia:nn(e,"FxiOS")?ba:nn(e.toLowerCase(),Na.toLowerCase())?Na:$a(e,t)?nn(e,Js)?ka:oa:nn(e,ya)?ya:nn(e,"MSIE")||nn(e,"Trident/")?pa:nn(e,"Gecko")?ya:""},Va={[va]:[new RegExp("rv:"+Pa)],[_a]:[new RegExp(ma+"?\\/"+Pa)],[ua]:[new RegExp("("+ua+"|CrMo)\\/"+Pa)],[ha]:[new RegExp("CriOS\\/"+Pa)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Pa)],[oa]:[Oa],[ka]:[Oa],[ga]:[new RegExp("(Opera|OPR)\\/"+Pa)],[ya]:[new RegExp(ya+"\\/"+Pa)],[ba]:[new RegExp("FxiOS\\/"+Pa)],[Na]:[new RegExp("Konqueror[:/]?"+Pa,"i")],[sa]:[new RegExp(sa+" "+Pa),Oa],[Ia]:[new RegExp("android\\s"+Pa,"i")],[ca]:[new RegExp(la+"\\/"+Pa)],[pa]:[new RegExp("(rv:|MSIE )"+Pa)],Mozilla:[new RegExp("rv:"+Pa)]},Za=[[new RegExp(Ca+"; "+Ca+" (.*?)[);]","i"),e=>[Ca,e&&e[1]||""]],[new RegExp(wa,"i"),[wa,""]],[new RegExp(Sa,"i"),[Sa,""]],[qa,[sa,""]],[new RegExp(Ea,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[xa,""];if(new RegExp(Js).test(t)&&!/IEMobile\b/.test(t))return[Ea+" "+Js,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var n=r[1],i=Ha[n]||"";return/arm/i.test(t)&&(i="RT"),[Ea,i]}return[Ea,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[Ks,t.join(".")]}return[Ks,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=mn(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Qs+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Qs+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[Qs,t.join(".")]}return[Qs,""]}],[/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/,[da,""]],[/Linux|debian/i,["Linux",""]]],ja=function(e){return Ba.test(e)?wa:Da.test(e)?Sa:La.test(e)?Ca:new RegExp(Ma,"i").test(e)?Ma:new RegExp("("+xa+"|WPDesktop)","i").test(e)?xa:/iPad/.test(e)?ra:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ia:qa.test(e)?sa:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Ta,"i").test(e)?Ta:/(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(Js).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)?Qs:ta:Qs:new RegExp("(pda|"+Js+")","i").test(e)?Aa:new RegExp(ea,"i").test(e)&&!new RegExp(ea+" pc","i").test(e)?Fa:""},za="https?://(.*)",Ga=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","irclid","_kx"],Ua=Ln(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Ga),Ya="<masked>",Xa={campaignParams:function(){var{customTrackedParams:e,maskPersonalDataProperties:t,customPersonalDataProperties:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Gr)return{};var n=t?Ln([],Ga,r||[]):[];return this._campaignParamsFromUrl(Xn(Gr.URL,n,Ya),e)},_campaignParamsFromUrl:function(e,t){var r=Ua.concat(t||[]),n={};return Pn(r,(function(t){var r=Yn(e,t);n[t]=r||null})),n},_searchEngine:function(e){return e?0===e.search(za+"google.([^/?]*)")?"google":0===e.search(za+"bing.com")?"bing":0===e.search(za+"yahoo.com")?"yahoo":0===e.search(za+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=Xa._searchEngine(e),r="yahoo"!=t?"q":"p",n={};if(!bn(t)){n.$search_engine=t;var i=Gr?Yn(Gr.referrer,r):"";i.length&&(n.ph_keyword=i)}return n},searchInfo:function(){var e=null==Gr?void 0:Gr.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:Wa,browserVersion:function(e,t){var r=Wa(e,t),n=Va[r];if(mn(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<Za.length;t++){var[r,n]=Za[t],i=r.exec(e),o=i&&(hn(n)?n(i,e):n);if(o)return o}return["",""]},device:ja,deviceType:function(e){var t=ja(e);return t===ra||t===ta||"Kobo"===t||"Kindle Fire"===t||t===Fa?ea:t===wa||t===Ca||t===Sa||t===Ma?"Console":t===ia?"Wearable":t?Js:"Desktop"},referrer:function(){return(null==Gr?void 0:Gr.referrer)||"$direct"},referringDomain:function(){var e;return null!=Gr&&Gr.referrer&&(null===(e=Gn(Gr.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},personInfo:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e?Ln([],Ga,t||[]):[],n=null==Ur?void 0:Ur.href.substring(0,1e3);return{r:this.referrer().substring(0,1e3),u:n?Xn(n,r,Ya):void 0}},personPropsFromInfo:function(e){var t,{r:r,u:n}=e,i={$referrer:r,$referring_domain:null==r?void 0:"$direct"==r?"$direct":null===(t=Gn(r))||void 0===t?void 0:t.host};if(n){i.$current_url=n;var o=Gn(n);i.$host=null==o?void 0:o.host,i.$pathname=null==o?void 0:o.pathname;var s=this._campaignParamsFromUrl(n);On(i,s)}if(r){var a=this._searchInfoFromReferrer(r);On(i,a)}return i},initialPersonPropsFromInfo:function(e){var t=this.personPropsFromInfo(e),r={};return Pn(t,(function(e,t){r["$initial_".concat(sn(t))]=e})),r},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?Ln([],Ga,t||[]):[],[n,i]=Xa.os(Kr);return On(Hn({$os:n,$os_version:i,$browser:Xa.browser(Kr,navigator.vendor),$device:Xa.device(Kr),$device_type:Xa.deviceType(Kr),$timezone:Xa.timezone(),$timezone_offset:Xa.timezoneOffset()}),{$current_url:Xn(null==Ur?void 0:Ur.href,r,Ya),$host:null==Ur?void 0:Ur.host,$pathname:null==Ur?void 0:Ur.pathname,$raw_user_agent:Kr.length>1e3?Kr.substring(0,997)+"...":Kr,$browser_version:Xa.browserVersion(Kr,navigator.vendor),$browser_language:Xa.browserLanguage(),$browser_language_prefix:Xa.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:Tn.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]=Xa.os(Kr);return On(Hn({$os:e,$os_version:t,$browser:Xa.browser(Kr,navigator.vendor)}),{$browser_version:Xa.browserVersion(Kr,navigator.vendor)})}},Ja=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}};class Ka{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 Qa{constructor(e){i(this,"_debugEventEmitter",new Ka),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(!mn(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(!mn(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(!Qa.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&&Ja(e,t);case"exact":return t===e;case"contains":var n=Qa.escapeStringRegexp(t).replace(/_/g,".").replace(/%/g,".*");return Ja(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&&!Qa.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&&!Qa.matchString(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!Qa.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 el{constructor(e){this.instance=e,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(e){var t;mn(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 Qa(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[xi])||[];if(el.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[xi])||[];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({[xi]:[...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[xi];return r||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}i(el,"SURVEY_SHOWN_EVENT_NAME","survey shown");var tl=An("[Surveys]"),rl={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=>Ja(t,e))),not_regex:(e,t)=>e.every((e=>!Ja(t,e))),exact:(e,t)=>e.some((e=>t===e)),is_not:(e,t)=>e.every((e=>t!==e))};function nl(e){return null!=e?e:"icontains"}function il(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 rl[nl(null===(n=e.conditions)||void 0===n?void 0:n.urlMatchType)](o,i)}class ol{constructor(e){i(this,"_isFetchingSurveys",!1),i(this,"_isInitializingSurveys",!1),this.instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){this._decideServerResponse=!!e.surveys,tl.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(Fs)&&e.push(r)}return e})();e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this._isInitializingSurveys)tl.info("Already initializing surveys, skipping...");else if(this.instance.config.disable_surveys)tl.info("Disabled. Not loading surveys.");else{var e=null==Qr?void 0:Qr.__PosthogExtensions__;if(e)if(this._decideServerResponse){this._isInitializingSurveys=!0;try{var t=e.generateSurveys;if(t)this._surveyManager=t(this.instance),this._isInitializingSurveys=!1,this._surveyEventReceiver=new el(this.instance),tl.info("Surveys loaded successfully");else{var r=e.loadExternalDependency;r?r(this.instance,"surveys",(t=>{if(t||!e.generateSurveys)return tl.error("Could not load surveys script",t),void(this._isInitializingSurveys=!1);this._surveyManager=e.generateSurveys(this.instance),this._isInitializingSurveys=!1,this._surveyEventReceiver=new el(this.instance),tl.info("Surveys loaded successfully")})):(tl.error("PostHog loadExternalDependency extension not found. Cannot load remote config."),this._isInitializingSurveys=!1)}}catch(e){throw tl.error("Error initializing surveys",e),this._isInitializingSurveys=!1,e}}else tl.warn("Decide not loaded yet. Not loading surveys.");else tl.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 tl.info("Disabled. Not loading surveys."),e([]);var r=this.instance.get_property(Ei);if(r&&!t)return e(r);if(this._isFetchingSurveys)return e([]);try{this._isFetchingSurveys=!0,this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",timeout:this.instance.config.surveys_request_timeout_ms,callback:t=>{var r;this._isFetchingSurveys=!1;var n=t.statusCode;if(200!==n||!t.json)return tl.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({[Ei]:o}),e(o)}})}catch(e){throw this._isFetchingSurveys=!1,e}}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=il(e),n=null===(t=e.conditions)||void 0===t||!t.selector||(null==Gr?void 0:Gr.querySelector(e.conditions.selector)),i=function(e){var t,r,n;if(null===(t=e.conditions)||void 0===t||!t.deviceTypes||0===(null===(r=e.conditions)||void 0===r?void 0:r.deviceTypes.length))return!0;if(!Kr)return!1;var i=Xa.deviceType(Kr);return rl[nl(null===(n=e.conditions)||void 0===n?void 0:n.deviceTypesMatchType)](e.conditions.deviceTypes,i)}(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 wn(null===(t=Qr.__PosthogExtensions__)||void 0===t?void 0:t.canActivateRepeatedly)?(tl.warn("init was not called"),!1):Qr.__PosthogExtensions__.canActivateRepeatedly(e)}canRenderSurvey(e){wn(this._surveyManager)?tl.warn("init was not called"):this.getSurveys((t=>{var r=t.filter((t=>t.id===e))[0];this._surveyManager.canRenderSurvey(r)}))}renderSurvey(e,t){wn(this._surveyManager)?tl.warn("init was not called"):this.getSurveys((r=>{var n=r.filter((t=>t.id===e))[0];this._surveyManager.renderSurvey(n,null==Gr?void 0:Gr.querySelector(t))}))}}var sl,al,ll,cl,ul=0,dl=[],hl=[],pl=Vo.__b,vl=Vo.__r,gl=Vo.diffed,fl=Vo.__c,ml=Vo.unmount;function _l(e,t){Vo.__h&&Vo.__h(al,e,ul||t),ul=0;var r=al.__H||(al.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:hl}),r.__[e]}function yl(e){return ul=1,function(e,t,r){var n=_l(sl++,2);if(n.t=e,!n.__c&&(n.__=[Rl(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=al,!al.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))};al.u=!0;var o=al.shouldComponentUpdate,s=al.componentWillUpdate;al.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)},al.shouldComponentUpdate=i}return n.__N||n.__}(Rl,e)}function bl(e,t){var r=_l(sl++,3);!Vo.__s&&Ml(r.__H,t)&&(r.__=e,r.i=t,al.__H.__h.push(r))}function wl(e){return ul=5,Sl((function(){return{current:e}}),[])}function Sl(e,t){var r=_l(sl++,7);return Ml(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Cl(e){var t=al.context[e.__c],r=_l(sl++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(al)),t.props.value):e.__}function Il(){for(var e;e=dl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(xl),e.__H.__h.forEach(Tl),e.__H.__h=[]}catch(t){e.__H.__h=[],Vo.__e(t,e.__v)}}Vo.__b=function(e){al=null,pl&&pl(e)},Vo.__r=function(e){vl&&vl(e),sl=0;var t=(al=e.__c).__H;t&&(ll===al?(t.__h=[],al.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=hl,e.__N=e.i=void 0}))):(t.__h.forEach(xl),t.__h.forEach(Tl),t.__h=[],sl=0)),ll=al},Vo.diffed=function(e){gl&&gl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==dl.push(t)&&cl===Vo.requestAnimationFrame||((cl=Vo.requestAnimationFrame)||El)(Il)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==hl&&(e.__=e.__V),e.i=void 0,e.__V=hl}))),ll=al=null},Vo.__c=function(e,t){t.some((function(e){try{e.__h.forEach(xl),e.__h=e.__h.filter((function(e){return!e.__||Tl(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Vo.__e(r,e.__v)}})),fl&&fl(e,t)},Vo.unmount=function(e){ml&&ml(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{xl(e)}catch(e){t=e}})),r.__H=void 0,t&&Vo.__e(t,r.__v))};var kl="function"==typeof requestAnimationFrame;function El(e){var t,r=function(){clearTimeout(n),kl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);kl&&(t=requestAnimationFrame(r))}function xl(e){var t=al,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),al=t}function Tl(e){var t=al;e.__c=e.__(),al=t}function Ml(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function Rl(e,t){return"function"==typeof t?t(e):t}var Al=Gr;function Fl(e,t){var r,n=Al.createElement("div");n.className="PostHogWidget".concat(e.id);var i,o=n.attachShadow({mode:"open"}),s=(i=null===(r=e.appearance)||void 0===r?void 0:r.widgetColor,"\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ".concat(i||"#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: ").concat(Ps,";\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n ")),a=Ms(Al,s,t);return a&&o.append(a),Al.body.appendChild(n),o}var Nl=0;function Pl(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:--Nl,__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 Vo.vnode&&Vo.vnode(c),c}var Ol=Pl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pl("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"})}),Ll=Pl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pl("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"})}),Dl=Pl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pl("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"})}),Bl=Pl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pl("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"})}),ql=Pl("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Pl("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"})}),Hl=Pl("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Pl("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"})}),$l=Pl("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Pl("g",{"clip-path":"url(#clip0_2415_6911)",children:[Pl("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Pl("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Pl("g",{mask:"url(#mask0_2415_6911)",children:[Pl("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"}),Pl("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"}),Pl("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"}),Pl("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"}),Pl("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"}),Pl("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"})]})]}),Pl("defs",{children:Pl("clipPath",{id:"clip0_2415_6911",children:Pl("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),Wl=Pl("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Pl("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 Vl(){return Pl("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",$l]})}function Zl(e){var{text:t,submitDisabled:r,appearance:n,onSubmit:i,link:o,onPreviewSubmit:s}=e,{isPreviewMode:a,isPopup:l}=Cl(Ys),c=n.submitButtonTextColor||Bs(n.submitButtonColor||qs.submitButtonColor);return Pl("div",{className:"bottom-section",children:[Pl("div",{className:"buttons",children:Pl("button",{className:"form-submit",disabled:r,type:"button",style:l?{color:c}:{},onClick:()=>{o&&(null==$r||$r.open(o)),a?null==s||s():i()},children:t})}),!n.whiteLabel&&Pl(Vl,{})]})}function jl(e){var{question:t,description:r,descriptionContentType:n,backgroundColor:i,forceDisableHtml:o}=e,{isPopup:s}=Cl(Ys);return Pl("div",{style:s?{backgroundColor:i||qs.backgroundColor}:{},children:[Pl("div",{className:"survey-question",children:t}),r&&Xs({component:ss("div",{className:"survey-question-description"}),children:r,renderAsHtml:!o&&"text"!==n})]})}function zl(e){var{onClick:t}=e,{isPreviewMode:r}=Cl(Ys);return Pl("div",{className:"cancel-btn-wrapper",onClick:t,disabled:r,children:Pl("button",{className:"form-cancel",onClick:t,disabled:r,children:Hl})})}function Gl(e){var{header:r,description:n,contentType:i,forceDisableHtml:o,appearance:s,onClose:a,styleOverrides:l}=e,c=Bs(s.backgroundColor||qs.backgroundColor),{isPopup:u}=Cl(Ys);return Pl(ls,{children:Pl("div",{className:"thank-you-message",style:t({},l),children:Pl("div",{className:"thank-you-message-container",children:[u&&Pl(zl,{onClick:()=>a()}),Pl("h3",{className:"thank-you-message-header",style:{color:c},children:r}),n&&Xs({component:ss("div",{className:"thank-you-message-body"}),children:n,renderAsHtml:!o&&"text"!==i,style:{color:c}}),u&&Pl(Zl,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})})})}function Ul(e){var t,r=wl(null),[n,i]=yl(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black");return bl((()=>{if(r.current){var e=function(e){var t=Rs.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 Yl(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o}=e,s=wl(null),[a,l]=yl("");return Pl("div",{ref:s,children:[Pl(jl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:n.backgroundColor,forceDisableHtml:r}),Pl("textarea",{rows:4,placeholder:null==n?void 0:n.placeholder,onInput:e=>l(e.currentTarget.value)}),Pl(Zl,{text:t.buttonText||"Submit",submitDisabled:!a&&!t.optional,appearance:n,onSubmit:()=>i(a),onPreviewSubmit:()=>o(a)})]})}function Xl(e){var{question:t,forceDisableHtml:r,appearance:n,onSubmit:i,onPreviewSubmit:o}=e;return Pl(ls,{children:[Pl(jl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r}),Pl(Zl,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:n,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>o("link clicked")})]})}function Jl(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]=yl(null);return Pl(ls,{children:[Pl(jl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r,backgroundColor:i.backgroundColor}),Pl("div",{className:"rating-section",children:[Pl("div",{className:"rating-options",children:["emoji"===t.display&&Pl("div",{className:"rating-options-emoji",children:(3===t.scale?ec:tc).map(((e,t)=>{var r=t+1===c;return Pl("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&&Pl("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat(".concat(a-l+1,", minmax(0, 1fr))")},children:oc(t.scale).map(((e,t)=>Pl(Kl,{displayQuestionIndex:n,active:c===e,appearance:i,num:e,setActiveNumber:e=>{u(e)}},t)))})]}),Pl("div",{className:"rating-text",children:[Pl("div",{children:t.lowerBoundLabel}),Pl("div",{children:t.upperBoundLabel})]})]}),Pl(Zl,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:bn(c)&&!t.optional,appearance:i,onSubmit:()=>o(c),onPreviewSubmit:()=>s(c)})]})}function Kl(e){var{num:t,active:r,displayQuestionIndex:n,appearance:i,setActiveNumber:o}=e,{textColor:s,ref:a}=Ul({appearance:i,defaultTextColor:"black",forceUpdate:r});return Pl("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 Ql(e){var{question:t,forceDisableHtml:r,displayQuestionIndex:n,appearance:i,onSubmit:o,onPreviewSubmit:s}=e,a=wl(null),l=Sl((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var n=Zs(t,Vs(t));return e.hasOpenChoice&&(e.choices.push(r),n.push(r)),n})(t)),[t]),[c,u]=yl(t.type===Jo.MultipleChoice?[]:null),[d,h]=yl(!1),[p,v]=yl(""),g=t.type===Jo.SingleChoice?"radio":"checkbox";return Pl("div",{ref:a,children:[Pl(jl,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:r,backgroundColor:i.backgroundColor}),Pl("div",{className:"multiple-choice-options limit-height",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"),Pl("div",{className:i,children:[Pl("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===Jo.SingleChoice?u(o):t.type===Jo.MultipleChoice&&dn(c)?c.includes(o)?u(c.filter((e=>e!==o))):u([...c,o]):void 0}),Pl("label",{htmlFor:"surveyQuestion".concat(n,"Choice").concat(r),style:{color:"black"},children:t.hasOpenChoice&&r===t.choices.length-1?Pl(ls,{children:[Pl("span",{children:[s,":"]}),Pl("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===Jo.SingleChoice?u(r):t.type===Jo.MultipleChoice&&dn(c)?v(r):void 0}})]}):s}),Pl("span",{className:"choice-check",style:{color:"black"},children:Wl})]})}))}),Pl(Zl,{text:t.buttonText||"Submit",submitDisabled:(bn(c)||dn(c)&&!d&&0===c.length||dn(c)&&d&&!p&&0===c.length&&!t.optional)&&!t.optional,appearance:i,onSubmit:()=>{d&&t.type===Jo.MultipleChoice?dn(c)&&o([...c,p]):o(c)},onPreviewSubmit:()=>{d&&t.type===Jo.MultipleChoice?dn(c)&&s([...c,p]):s(c)}})]})}var ec=[Dl,Ll,Ol],tc=[Bl,Dl,Ll,Ol,ql],rc=[1,2,3,4,5],nc=[1,2,3,4,5,6,7],ic=[0,1,2,3,4,5,6,7,8,9,10];function oc(e){switch(e){case 5:default:return rc;case 7:return nc;case 10:return ic}}var sc=An("[Surveys]"),ac=$r,lc=Gr;function cc(e){return".PostHogWidget".concat(e)}function uc(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?Ko.End:o;if(i.branching.type===Ko.End)return Ko.End;if(i.branching.type===Ko.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===Ko.ResponseBased){if(i.type===Jo.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===Ko.End?Ko.End:o}}else if(i.type===Jo.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===Ko.End?Ko.End:o}}return o}return sc.warn("Falling back to next question index due to unexpected branching type"),o}class dc{constructor(e){var r=this;i(this,"surveyTimeouts",new Map),i(this,"canShowNextEventBasedSurvey",(()=>{var e,t=lc.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 r,n=null===(r=e.conditions)||void 0===r?void 0:r.seenSurveyWaitPeriodInDays;if(((e,t)=>{if(!t||!e)return!0;var r=new Date,n=Math.abs(r.getTime()-new Date(e).getTime());return Math.ceil(n/864e5)>t})(localStorage.getItem("lastSeenSurveyDate"),n)){var i=(e=>!!localStorage.getItem(Gs(e))&&!zs(e))(e);if(!i){var o;this.clearSurveyTimeout(e.id),this.addSurveyToFocus(e.id);var s=(null===(o=e.appearance)||void 0===o?void 0:o.surveyPopupDelaySeconds)||0,a=((e,t,r,n)=>{var i=As.createElement("div");i.className="PostHogSurvey".concat(t);var o=i.attachShadow({mode:"open"});if(e){var s=Ms(As,e,n);s&&o.appendChild(s)}return As.body.appendChild(i),o})(Ls(null==e?void 0:e.appearance),e.id,0,this.posthog);if(s<=0)return Es(Pl(vc,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),a);var l=setTimeout((()=>{if(!il(e))return this.removeSurveyFromFocus(e.id);Es(Pl(vc,{posthog:this.posthog,survey:t(t({},e),{},{appearance:t(t({},e.appearance),{},{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!0},"popover-survey"),a)}),1e3*s);this.surveyTimeouts.set(e.id,l)}}})),i(this,"handleWidget",(e=>{var t=Fl(e,this.posthog),r=Ls(e.appearance),n=Ms(lc,r,this.posthog);n&&t.appendChild(n),Es(Pl(fc,{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)&&lc.querySelector(e.appearance.widgetSelector);if(r)if(0===lc.querySelectorAll(".PostHogWidget".concat(e.id)).length)this.handleWidget(e);else if(1===lc.querySelectorAll(".PostHogWidget".concat(e.id)).length&&!r.getAttribute("PHWidgetSurveyClickListener")){var n,i,o=null===(n=lc.querySelector(cc(e.id)))||void 0===n||null===(i=n.shadowRoot)||void 0===i?void 0:i.querySelector(".survey-form");jn(r,"click",(()=>{o&&(o.style.display="none"===o.style.display?"block":"none",jn(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!=Xo.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)=>{Es(Pl(vc,{posthog:this.posthog,survey:e,removeSurveyFromFocus:this.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)})),i(this,"callSurveysAndEvaluateDisplayLogic",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=r.posthog)||void 0===e||e.getActiveMatchingSurveys((e=>{var t=e.filter((e=>"api"!==e.type));r.sortSurveysByAppearanceDelay(t).forEach((e=>{if(bn(r.surveyInFocus)){var t,n,i;if(e.type===Xo.Widget)"tab"===(null===(t=e.appearance)||void 0===t?void 0:t.widgetType)&&0===lc.querySelectorAll(".PostHogWidget".concat(e.id)).length&&r.handleWidget(e),"selector"===(null===(n=e.appearance)||void 0===n?void 0:n.widgetType)&&null!==(i=e.appearance)&&void 0!==i&&i.widgetSelector&&r.handleWidgetSelector(e);e.type===Xo.Popover&&r.canShowNextEventBasedSurvey()&&r.handlePopoverSurvey(e)}}))}),t)})),i(this,"addSurveyToFocus",(e=>{bn(this.surveyInFocus)||sc.error("Survey ".concat([...this.surveyInFocus]," already in focus. Cannot add survey ").concat(e,".")),this.surveyInFocus=e})),i(this,"removeSurveyFromFocus",(e=>{this.surveyInFocus!==e&&sc.error("Survey ".concat(e," is not in focus. Cannot remove survey ").concat(e,".")),this.clearSurveyTimeout(e),this.surveyInFocus=null})),this.posthog=e,this.surveyInFocus=null}clearSurveyTimeout(e){var t=this.surveyTimeouts.get(e);t&&(clearTimeout(t),this.surveyTimeouts.delete(e))}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,surveyTimeouts:this.surveyTimeouts,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}function hc(e){if(lc&&ac){var t=new dc(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((()=>{t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}}function pc(e){var{survey:t,removeSurveyFromFocus:r,setSurveyVisible:n,isPreviewMode:i=!1}=e;bl((()=>{var e;if(!i&&null!==(e=t.conditions)&&void 0!==e&&e.url){var o=()=>{if(!il(t))return n(!1),r(t.id)};jn(ac,"popstate",o),jn(ac,"hashchange",o);var s=ac.history.pushState,a=ac.history.replaceState;return ac.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.apply(this,t),o()},ac.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t),o()},()=>{ac.removeEventListener("popstate",o),ac.removeEventListener("hashchange",o),ac.history.pushState=s,ac.history.replaceState=a}}}),[i,t,r,n])}function vc(e){var r,n,i,o,s,a,{survey:l,forceDisableHtml:c,posthog:u,style:d,previewPageIndex:h,removeSurveyFromFocus:p,isPopup:v,onPreviewSubmit:g=(()=>{}),onPopupSurveyDismissed:f=(()=>{}),onPopupSurveySent:m=(()=>{})}=e,_=Number.isInteger(h),y=null!==(r=l.appearance)&&void 0!==r&&r.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:b,isSurveySent:w,setIsPopupVisible:S}=function(e,t,r,n,i){var[o,s]=yl(n||0===r),[a,l]=yl(!1);return bl((()=>{if(t){if(!n){var o=()=>{i(e.id),s(!1)},a=()=>{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))},c=()=>{var r;il(e)&&(s(!0),ac.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()),setTimeout((()=>{var t,r,n=null===(t=lc.querySelector(cc(e.id)))||void 0===t||null===(r=t.shadowRoot)||void 0===r?void 0:r.querySelector('textarea, input[type="text"]');n&&n.focus()}),100))};if(jn(ac,"PHSurveyClosed",o),jn(ac,"PHSurveySent",a),r>0){var u=setTimeout(c,r);return()=>{clearTimeout(u),ac.removeEventListener("PHSurveyClosed",o),ac.removeEventListener("PHSurveySent",a)}}return c(),()=>{ac.removeEventListener("PHSurveyClosed",o),ac.removeEventListener("PHSurveySent",a)}}}else sc.error("usePopupVisibility hook called without a PostHog instance.")}),[]),pc({survey:e,removeSurveyFromFocus:i,setSurveyVisible:s,isPreviewMode:n}),{isPopupVisible:o,isSurveySent:a,setIsPopupVisible:s}}(l,u,y,_,p),C=w||h===l.questions.length,I=null!==(n=d)&&void 0!==n&&n.left&&Sn(null===(i=d)||void 0===i?void 0:i.left)?{left:d.left-40}:{};return _&&((d=d||{}).left="unset",d.right="unset",d.transform="unset"),b?Pl(Ys.Provider,{value:{isPreviewMode:_,previewPageIndex:h,onPopupSurveyDismissed:()=>{Ws(l,u,_),f()},isPopup:v||!1,onPreviewSubmit:g,onPopupSurveySent:()=>{m()}},children:C?Pl(Gl,{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||qs,styleOverrides:t(t({},d),I),onClose:()=>S(!1)}):Pl(gc,{survey:l,forceDisableHtml:!!c,posthog:u,styleOverrides:d})}):null}function gc(e){var r,n,{survey:i,forceDisableHtml:o,posthog:s,styleOverrides:a}=e,l=Bs((null===(r=i.appearance)||void 0===r?void 0:r.backgroundColor)||qs.backgroundColor),[c,u]=yl({}),{previewPageIndex:d,onPopupSurveyDismissed:h,isPopup:p,onPreviewSubmit:v,onPopupSurveySent:g}=Cl(Ys),[f,m]=yl(d||0),_=Sl((()=>js(i)),[i]);bl((()=>{m(null!=d?d:0)}),[d]);return Pl("form",{className:"survey-form",style:p?t({color:l,borderColor:null===(n=i.appearance)||void 0===n?void 0:n.borderColor},a):{},children:_.map(((e,r)=>{var n;return f===r&&Pl("div",{className:"survey-box",style:p?{backgroundColor:(null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||qs.backgroundColor}:{},children:[p&&Pl(zl,{onClick:()=>{h()}}),mc({question:e,forceDisableHtml:o,displayQuestionIndex:r,appearance:i.appearance||qs,onSubmit:n=>(e=>{var{res:r,displayQuestionIndex:n,questionId:o}=e;if(s)if(o){var a=function(e){return"$survey_response_".concat(e)}(o);u(t(t({},c),{},{[a]:r}));var l=uc(i,n,r);l===Ko.End?($s(t(t({},c),{},{[a]:r}),i,s),g()):m(l)}else sc.error("onNextButtonClick called without a questionId.");else sc.error("onNextButtonClick called without a PostHog instance.")})({res:n,displayQuestionIndex:r,questionId:e.id}),onPreviewSubmit:v})]})}))})}function fc(e){var t,r,{survey:n,forceDisableHtml:i,posthog:o,readOnly:s,removeSurveyFromFocus:a}=e,[l,c]=yl(!0),[u,d]=yl(!1),[h,p]=yl({}),v=wl(null);if(bl((()=>{var e,t;if(o){if(!s){if("tab"===(null===(e=n.appearance)||void 0===e?void 0:e.widgetType)&&v.current){var r,i=v.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")};p(a)}if("selector"===(null===(t=n.appearance)||void 0===t?void 0:t.widgetType)){var l,c=null!==(l=lc.querySelector(n.appearance.widgetSelector||""))&&void 0!==l?l:void 0;jn(c,"click",(e=>{var t,r,i=e.currentTarget.getBoundingClientRect(),o=ac.innerHeight,s=parseInt((null===(t=n.appearance)||void 0===t?void 0:t.maxWidth)||"300"),a=i.left+i.width/2-s/2;a+s>ac.innerWidth&&(a=ac.innerWidth-s-20),a<20&&(a=20);var l=!1;i.bottom+300>o&&(l=!0);var c;c=l?null:i.bottom+ac.scrollY+12,p({position:"fixed",top:l?"auto":c+"px",left:a+"px",right:"auto",bottom:l?ac.innerHeight-i.top+12+"px":"auto",transform:"none",border:"1.5px solid ".concat((null===(r=n.appearance)||void 0===r?void 0:r.borderColor)||"#c9c6c6"),borderRadius:"10px",width:"".concat(s,"px"),zIndex:Ps,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",maxHeight:l?"calc(100vh - 40px - ".concat(24,"px)"):"calc(100vh - ".concat(c,"px - 20px)")}),d(!u)})),null==c||c.setAttribute("PHWidgetSurveyClickListener","true")}}}else sc.error("FeedbackWidget called without a PostHog instance.")}),[]),pc({survey:n,removeSurveyFromFocus:a,setSurveyVisible:c}),!l)return null;var g=()=>{d(!1)};return Pl(ls,{children:["tab"===(null===(t=n.appearance)||void 0===t?void 0:t.widgetType)&&Pl("div",{className:"ph-survey-widget-tab",ref:v,onClick:()=>!s&&d(!u),style:{color:Bs(n.appearance.widgetColor)},children:[Pl("div",{className:"ph-survey-widget-tab-icon"}),(null===(r=n.appearance)||void 0===r?void 0:r.widgetLabel)||""]}),u&&Pl(vc,{posthog:o,survey:n,forceDisableHtml:i,style:h,removeSurveyFromFocus:a,isPopup:!0,onPopupSurveyDismissed:g,onPopupSurveySent:g},"feedback-widget-survey")]})}var mc=e=>{var{question:r,forceDisableHtml:n,displayQuestionIndex:i,appearance:o,onSubmit:s,onPreviewSubmit:a}=e,l={[Jo.Open]:Yl,[Jo.Link]:Xl,[Jo.Rating]:Jl,[Jo.SingleChoice]:Ql,[Jo.MultipleChoice]:Ql},c={question:r,forceDisableHtml:n,appearance:o,onPreviewSubmit:e=>{a(e)},onSubmit:e=>{s(e)}},u={[Jo.Open]:{},[Jo.Link]:{},[Jo.Rating]:{displayQuestionIndex:i},[Jo.SingleChoice]:{displayQuestionIndex:i},[Jo.MultipleChoice]:{displayQuestionIndex:i}},d=l[r.type],h=t(t({},c),u[r.type]);return Pl(d,t({},h))};function _c(e){return!mn(Event)&&yc(e,Event)}function yc(e,t){try{return e instanceof t}catch(e){return!1}}function bc(e){return bn(e)||!gn(e)&&!hn(e)}function wc(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function Sc(e){return wc(e,"DOMError")}Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.canActivateRepeatedly=zs,Qr.__PosthogExtensions__.generateSurveys=hc,Qr.extendPostHogWithSurveys=hc;var Cc=/\(error: (.*)\)/,Ic=50,kc="?";function Ec(e,t,r,n){var i={platform:"web:javascript",filename:e,function:"<anonymous>"===t?kc:t,in_app:!0};return mn(r)||(i.lineno=r),mn(n)||(i.colno=n),i}var xc=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Tc=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Mc=/\((\S*)(?::(\d+))(?::(\d+))\)/,Rc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ac=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Fc=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=Cc.test(a)?a.replace(Cc,"$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>=Ic)break}}}return function(e){if(!e.length)return[];var r=Array.from(e);return r.reverse(),r.slice(0,Ic).map((e=>t(t({},e),{},{filename:e.filename||Nc(r).filename,function:e.function||kc})))}(n)}}(...[[30,e=>{var t=xc.exec(e);if(t){var[,r,n,i]=t;return Ec(r,kc,+n,+i)}var o=Tc.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var s=Mc.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[a,l]=Dc(o[1]||kc,o[2]);return Ec(l,a,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,e=>{var t=Rc.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var r=Ac.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]||kc;return[i,n]=Dc(i,n),Ec(n,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]);function Nc(e){return e[e.length-1]||{}}var Pc,Oc,Lc,Dc=(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]:kc,r?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]};var Bc=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function qc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.stacktrace||e.stack||"",n=function(e){if(e&&Hc.test(e.message))return 1;return 0}(e);try{var i=Fc,o=function(e,t){var r=function(e){var t=globalThis._posthogChunkIds;if(!t)return{};var r=Object.keys(t);return Lc&&r.length===Oc||(Oc=r.length,Lc=r.reduce(((r,n)=>{Pc||(Pc={});var i=Pc[n];if(i)r[i[0]]=i[1];else for(var o=e(n),s=o.length-1;s>=0;s--){var a=o[s],l=null==a?void 0:a.filename,c=t[n];if(l&&c){r[l]=c,Pc[n]=[l,c];break}}return r}),{})),Lc}(t);return e.forEach((e=>{e.filename&&(e.chunk_id=r[e.filename])})),e}(i(r,n),i);return o.slice(0,o.length-t)}catch(e){}return[]}var Hc=/Minified React error #\d+;/i;function $c(e,t){var r,n,i=qc(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 Wc(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=qc(t.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function Vc(e){return _n(e)&&!yn(e)&&rn.indexOf(e)>=0}function Zc(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:_c(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=qc(null==t?void 0:t.syntheticException,1);c.length&&(l.stacktrace={frames:c,type:"raw"})}return{$exception_list:[l],$exception_level:Vc(e.level)?e.level:"error"}}function jc(e,r){var{error:n,event:i}=e,o={$exception_list:[]},s=n||i;if(Sc(s)||function(e){return wc(e,"DOMException")}(s)){var a=s;if(function(e){return"stack"in e}(s))o=$c(s,r);else{var l=a.name||(Sc(a)?"DOMError":"DOMException"),c=a.message?"".concat(l,": ").concat(a.message):l,u=Sc(a)?"DOMError":"DOMException";o=Wc(c,t(t({},r),{},{overrideExceptionType:u,defaultExceptionMessage:c}))}return"code"in a&&(o.$exception_DOMException_code="".concat(a.code)),o}if(function(e){return wc(e,"ErrorEvent")}(s)&&s.error)return $c(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 yc(e,Error)}}(s))return $c(s,r);if(function(e){return wc(e,"Object")}(s)||_c(s))return Zc(s,r);if(mn(n)&&_n(i)){var d="Error",h=i,p=i.match(Bc);return p&&(d=p[1],h=p[2]),Wc(h,t(t({},r),{},{overrideExceptionType:d,defaultExceptionMessage:h}))}return Wc(s,r)}function zc(e){var[t]=e,r=function(e){if(bc(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 bc(r)?Wc("Non-Error promise rejection captured with value: ".concat(String(r)),{handled:!1,synthetic:!1,overrideExceptionType:"UnhandledRejection"}):jc({event:r},{handled:!1,overrideExceptionType:"UnhandledRejection",defaultExceptionMessage:String(r)})}var Gc=An("[ExceptionAutocapture]"),Uc={wrapOnError:e=>{var t=$r;t||Gc.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=jc({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||Gc.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=zc(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=Uc,Qr.__PosthogExtensions__.parseErrorAsProperties=jc,Qr.posthogErrorWrappingFunctions=Uc,Qr.parseErrorAsProperties=jc;var Yc=(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 Xc={_patchFetch:e=>Kn($r,"fetch",(t=>function(){var r=n((function*(r,n){var i=new Request(r,n);return Yc(e,i),t(i)}));return function(e,t){return r.apply(this,arguments)}}())),_patchXHR:e=>Kn($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 Yc(e,a),t.call(this,r,a.url,i,o,s)}))};Qr.__PosthogExtensions__.tracingHeadersPatchFns=Xc,Qr.postHogTracingHeadersPatchFns=Xc;var Jc,Kc,Qc=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},eu=function(e){if("loading"===document.readyState)return"loading";var t=Qc();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"},tu=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},ru=function(e,t){var r="";try{for(;e&&9!==e.nodeType;){var n=e,i=n.id?"#"+n.id:tu(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},nu=-1,iu=function(){return nu},ou=function(e){addEventListener("pageshow",(function(t){t.persisted&&(nu=t.timeStamp,e(t))}),!0)},su=function(){var e=Qc();return e&&e.activationStart||0},au=function(e,t){var r=Qc(),n="navigate";return iu()>=0?n="back-forward-cache":r&&(document.prerendering||su()>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}},lu=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){}},cu=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))}},uu=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},du=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},hu=function(e){var t=!1;return function(){t||(e(),t=!0)}},pu=-1,vu=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},gu=function(e){"hidden"===document.visibilityState&&pu>-1&&(pu="visibilitychange"===e.type?e.timeStamp:0,mu())},fu=function(){addEventListener("visibilitychange",gu,!0),addEventListener("prerenderingchange",gu,!0)},mu=function(){removeEventListener("visibilitychange",gu,!0),removeEventListener("prerenderingchange",gu,!0)},_u=function(){return pu<0&&(pu=vu(),fu(),ou((function(){setTimeout((function(){pu=vu(),fu()}),0)}))),{get firstHiddenTime(){return pu}}},yu=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},bu=[1800,3e3],wu=function(e,t){t=t||{},yu((function(){var r,n=_u(),i=au("FCP"),o=lu("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-su(),0),i.entries.push(e),r(!0)))}))}));o&&(r=cu(e,i,bu,t.reportAllChanges),ou((function(n){i=au("FCP"),r=cu(e,i,bu,t.reportAllChanges),uu((function(){i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},Su=[.1,.25],Cu=0,Iu=1/0,ku=0,Eu=function(e){e.forEach((function(e){e.interactionId&&(Iu=Math.min(Iu,e.interactionId),ku=Math.max(ku,e.interactionId),Cu=ku?(ku-Iu)/7+1:0)}))},xu=function(){return Jc?Cu:performance.interactionCount||0},Tu=function(){"interactionCount"in performance||Jc||(Jc=lu("event",Eu,{type:"event",buffered:!0,durationThreshold:0}))},Mu=[],Ru=new Map,Au=0,Fu=[],Nu=function(e){if(Fu.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Mu[Mu.length-1],r=Ru.get(e.interactionId);if(r||Mu.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]};Ru.set(n.id,n),Mu.push(n)}Mu.sort((function(e,t){return t.latency-e.latency})),Mu.length>10&&Mu.splice(10).forEach((function(e){return Ru.delete(e.id)}))}}},Pu=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=hu(e),"hidden"===document.visibilityState?e():(r=t(e),du(e)),r},Ou=[200,500],Lu=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},yu((function(){var r;Tu();var n,i=au("INP"),o=function(e){Pu((function(){e.forEach(Nu);var t=function(){var e=Math.min(Mu.length-1,Math.floor((xu()-Au)/50));return Mu[e]}();t&&t.latency!==i.value&&(i.value=t.latency,i.entries=t.entries,n())}))},s=lu("event",o,{durationThreshold:null!==(r=t.durationThreshold)&&void 0!==r?r:40});n=cu(e,i,Ou,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),du((function(){o(s.takeRecords()),n(!0)})),ou((function(){Au=xu(),Mu.length=0,Ru.clear(),i=au("INP"),n=cu(e,i,Ou,t.reportAllChanges)})))})))},Du=[],Bu=[],qu=0,Hu=new WeakMap,$u=new Map,Wu=-1,Vu=function(e){Du=Du.concat(e),Zu()},Zu=function(){Wu<0&&(Wu=Pu(ju))},ju=function(){$u.size>10&&$u.forEach((function(e,t){Ru.has(t)||$u.delete(t)}));var e=Mu.map((function(e){return Hu.get(e.entries[0])})),t=Bu.length-50;Bu=Bu.filter((function(r,n){return n>=t||e.includes(r)}));for(var r=new Set,n=0;n<Bu.length;n++){var i=Bu[n];zu(i.startTime,i.processingEnd).forEach((function(e){r.add(e)}))}var o=Du.length-1-50;Du=Du.filter((function(e,t){return e.startTime>qu&&t>o||r.has(e)})),Wu=-1};Fu.push((function(e){e.interactionId&&e.target&&!$u.has(e.interactionId)&&$u.set(e.interactionId,e.target)}),(function(e){var t,r=e.startTime+e.duration;qu=Math.max(qu,e.processingEnd);for(var n=Bu.length-1;n>=0;n--){var i=Bu[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]},Bu.push(t)),(e.interactionId||"first-input"===e.entryType)&&Hu.set(e,t),Zu()}));var zu=function(e,t){for(var r,n=[],i=0;r=Du[i];i++)if(!(r.startTime+r.duration<e)){if(r.startTime>t)break;n.push(r)}return n},Gu=[2500,4e3],Uu={},Yu={onLCP:function(e,t){!function(e,t){t=t||{},yu((function(){var r,n=_u(),i=au("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-su(),0),i.entries=[e],r())}))},s=lu("largest-contentful-paint",o);if(s){r=cu(e,i,Gu,t.reportAllChanges);var a=hu((function(){Uu[i.id]||(o(s.takeRecords()),s.disconnect(),Uu[i.id]=!0,r(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Pu(a)}),{once:!0,capture:!0})})),du(a),ou((function(n){i=au("LCP"),r=cu(e,i,Gu,t.reportAllChanges),uu((function(){i.value=performance.now()-n.timeStamp,Uu[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=Qc();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:ru(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||{},wu(hu((function(){var r,n=au("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=lu("layout-shift",s);a&&(r=cu(e,n,Su,t.reportAllChanges),du((function(){s(a.takeRecords()),r(!0)})),ou((function(){i=0,n=au("CLS",0),r=cu(e,n,Su,t.reportAllChanges),uu((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:ru(i.node),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:i,largestShiftEntry:n,loadState:eu(n.startTime)})}}return Object.assign(e,{attribution:r})}(t);e(r)}),t)},onFCP:function(e,t){wu((function(t){var r=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:eu(iu())};if(e.entries.length){var r=Qc(),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:eu(e.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)},onINP:function(e,t){Kc||(Kc=lu("long-animation-frame",Vu)),Lu((function(t){var r=function(e){var t=e.entries[0],r=Hu.get(t),n=t.processingStart,i=r.processingEnd,o=r.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=zu(t.startTime,i),a=e.entries.find((function(e){return e.target})),l=a&&a.target||$u.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:ru(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:eu(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(r)}),t)}};Qr.__PosthogExtensions__=Qr.__PosthogExtensions__||{},Qr.__PosthogExtensions__.postHogWebVitalsCallbacks=Yu,Qr.postHogWebVitalsCallbacks=Yu;class Xu{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 Ju=An("[AutoCapture]");function Ku(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&&!Hi(t));return t}function ed(e,t,r,n){var i=e.tagName.toLowerCase(),o={tag_name:i};Xi.indexOf(i)>-1&&!r&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Ku(1024,lo(e)):o.$el_text=Ku(1024,Ui(e)));var s=zi(e);s.length>0&&(o.classes=s.filter((function(e){return""!==e}))),Pn(e.attributes,(function(r){var i;if((!eo(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&((null==n||!n.includes(r.name))&&!t&&ao(r.value)&&(i=r.name,!_n(i)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7)))){var s=r.value;"class"===r.name&&(s=Zi(s).join(" ")),o["attr__"+r.name]=Ku(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 td(e,t){for(var r,n,{e:i,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,c=[e],u=e;u.parentNode&&!$i(u,"body");)Vi(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(Pn(c,(e=>{var t=Qi(e);"a"===e.tagName.toLowerCase()&&(v=e.getAttribute("href"),v=t&&v&&ao(v)&&v),nn(zi(e),"ph-no-capture")&&(g=!0),h.push(ed(e,o,s,a));var r=function(e){if(!Qi(e))return{};var t={};return Pn(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&&ao(n)&&(t[r]=n)}})),t}(e);On(p,r)})),g)return{props:{},explicitNoCapture:g};if(s||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?h[0].$el_text=lo(e):h[0].$el_text=Ui(e)),v){var f,m;h[0].attr__href=v;var _=null===(f=Gn(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:On({$event_type:i.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:uo(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 rd{constructor(e){i(this,"_initialized",!1),i(this,"_isDisabledServerSide",null),i(this,"rageclicks",new Xu),i(this,"_elementsChainAsString",!1),this.instance=e,this._elementSelectors=null}get config(){var e,t,r=gn(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&&Gr){var e=e=>{e=e||(null==$r?void 0:$r.event);try{this._captureEvent(e)}catch(e){Ju.error("Failed to capture event",e)}};if(jn(Gr,"submit",e,{capture:!0}),jn(Gr,"change",e,{capture:!0}),jn(Gr,"click",e,{capture:!0}),this.config.capture_copied_text){var t=e=>{e=e||(null==$r?void 0:$r.event),this._captureEvent(e,en)};jn(Gr,"copy",t,{capture:!0}),jn(Gr,"cut",t,{capture:!0})}}}else Ju.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({[ni]:!!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==Gr?void 0:Gr.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[ni],n=this._isDisabledServerSide;if(bn(n)&&!Cn(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=Yi(e);if(Wi(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&&Ki(n,e,this.config,i,i?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:s}=td(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=Gi(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 hn(null==Gr?void 0:Gr.querySelectorAll)}}var nd={};function id(e){return function(e,t){var r=nd[e];if(r)return r;var n=t[e];if(pn(n)&&!vn())return nd[e]=n.bind(t);var i=t.document;if(i&&hn(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){Rn.warn("Could not create sandbox iframe for ".concat(e," check, bailing to assignableWindow.").concat(e,": "),t)}return n&&hn(n)?nd[e]=n.bind(t):n}("MutationObserver",e)}function od(e,t){return Sn(e)&&e>=t}class sd{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=Yi(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);bn(t)||this._ignoreClick(t)||this._clicks.push(t),this._clicks.length&&mn(this._checkClickTimer)&&(this._checkClickTimer=Qr.setTimeout((()=>{this._checkClicks()}),1e3))})),i(this,"_onScroll",(()=>{var e=Date.now();e%50==0&&this._clicks.forEach((t=>{mn(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=id(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(){jn(Qr,"click",this._onClick)}_startScrollObserver(){jn(Qr,"scroll",this._onScroll,{capture:!0})}_startSelectionChangedObserver(){jn(Qr,"selectionchange",this._onSelectionChange)}_ignoreClick(e){if(!e)return!0;if(qi(e.node))return!0;var t=this._clicks.some((t=>t.node===e.node&&Math.abs(t.timestamp-e.timestamp)<1e3));return!!t||!(!$i(e.node,"html")&&Hi(e.node)&&!Xi.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=od(t.scrollDelayMs,this._config.scroll_threshold_ms),i=od(t.selectionChangedDelayMs,this._config.selection_change_threshold_ms),o=od(t.mutationDelayMs,this._config.mutation_threshold_ms),s=od(t.absoluteDelayMs,1.1*this._config.mutation_threshold_ms),a=Sn(t.scrollDelayMs)&&t.scrollDelayMs<this._config.scroll_threshold_ms,l=Sn(t.mutationDelayMs)&&t.mutationDelayMs<this._config.mutation_threshold_ms,c=Sn(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&&mn(this._checkClickTimer)&&(this._checkClickTimer=Qr.setTimeout((()=>{this._checkClicks()}),1e3))}}_captureDeadClick(e,r){this.instance.capture("$dead_click",t(t(t({},r),td(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 sd(e,t);var ad=An("[ExternalScriptsLoader]"),ld=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return ad.warn("".concat(t," was requested but loading of external scripts is disabled.")),r("Loading of external scripts is disabled");var n=null==Gr?void 0:Gr.querySelectorAll("script");if(n)for(var i=0;i<n.length;i++)if(n[i].src===t)return r();var o=()=>{if(!Gr)return r("document not found");var n=Gr.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=Gr.querySelectorAll("body > script");o.length>0?null===(i=o[0].parentNode)||void 0===i||i.insertBefore(n,o[0]):Gr.body.appendChild(n)};null!=Gr&&Gr.body?o():null==Gr||Gr.addEventListener("DOMContentLoaded",o)};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);ld(e,s,r)},Qr.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var n=e.requestRouter.endpointFor("api",t);ld(e,n,r)},Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Sn(e)&&isFinite(e)&&Math.floor(e)===e});var cd="0123456789abcdef";class ud{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 ud(i)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+cd.charAt(this.bytes[t]>>>4)+cd.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 ud(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 dd{constructor(){i(this,"timestamp",0),i(this,"counter",0),i(this,"random",new vd)}generate(){var e=this.generateOrAbort();if(mn(e)){this.timestamp=0;var t=this.generateOrAbort();if(mn(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 ud.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 hd,pd=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&&!mn($r.crypto)&&crypto.getRandomValues&&(pd=e=>crypto.getRandomValues(e));class vd{constructor(){i(this,"buffer",new Uint32Array(8)),i(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(pd(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}var gd=()=>fd().toString(),fd=()=>(hd||(hd=new dd)).generate(),md="Thu, 01 Jan 1970 00:00:00 GMT",_d="";var yd=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function bd(e,t){if(t){var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gr;if(_d)return _d;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_"+gd(),o=new RegExp("(^|;)\\s*"+i+"=1");!_d&&n--;){var s=r.slice(n).join("."),a=i+"=1;domain=."+s;t.cookie=a,o.test(t.cookie)&&(t.cookie=a+";expires="+md,_d=s)}return _d}(e);if(!r){var n=(e=>{var t=e.match(yd);return t?t[0]:""})(e);n!==r&&Rn.info("Warning: cookie subdomain discovery mismatch",n,r),r=n}return r?"; domain=."+r:""}return""}var wd,Sd={is_supported:()=>!!Gr,error:function(e){Rn.error("cookieStore error: "+e)},get:function(e){if(Gr){try{for(var t=e+"=",r=Gr.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(Sd.get(e))||{}}catch(e){}return t},set:function(e,t,r,n,i){if(Gr)try{var o="",s="",a=bd(Gr.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&&Rn.warn("cookieStore warning: large cookie, len="+c.length),Gr.cookie=c,c}catch(e){return}},remove:function(e,t){try{Sd.set(e,"",-1,t)}catch(e){return}}},Cd=null,Id={is_supported:function(){if(!bn(Cd))return Cd;var e=!0;if(mn($r))e=!1;else try{var t="__mplssupport__";Id.set(t,"xyz"),'"xyz"'!==Id.get(t)&&(e=!1),Id.remove(t)}catch(t){e=!1}return e||Rn.error("localStorage unsupported; falling back to cookie store"),Cd=e,e},error:function(e){Rn.error("localStorage error: "+e)},get:function(e){try{return null==$r?void 0:$r.localStorage.getItem(e)}catch(e){Id.error(e)}return null},parse:function(e){try{return JSON.parse(Id.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==$r||$r.localStorage.setItem(e,JSON.stringify(t))}catch(e){Id.error(e)}},remove:function(e){try{null==$r||$r.localStorage.removeItem(e)}catch(e){Id.error(e)}}},kd=["distinct_id",mi,_i,Oi,Pi],Ed=t(t({},Id),{},{parse:function(e){try{var t={};try{t=Sd.parse(e)||{}}catch(e){}var r=On(t,JSON.parse(Id.get(e)||"{}"));return Id.set(e,r),r}catch(e){}return null},set:function(e,t,r,n,i,o){try{Id.set(e,t,void 0,void 0,o);var s={};kd.forEach((e=>{t[e]&&(s[e]=t[e])})),Object.keys(s).length&&Sd.set(e,s,r,n,i,o)}catch(e){Id.error(e)}},remove:function(e,t){try{null==$r||$r.localStorage.removeItem(e),Sd.remove(e,t)}catch(e){Id.error(e)}}}),xd={},Td={is_supported:function(){return!0},error:function(e){Rn.error("memoryStorage error: "+e)},get:function(e){return xd[e]||null},parse:function(e){return xd[e]||null},set:function(e,t){xd[e]=t},remove:function(e){delete xd[e]}},Md=null,Rd={is_supported:function(){if(!bn(Md))return Md;if(Md=!0,mn($r))Md=!1;else try{var e="__support__";Rd.set(e,"xyz"),'"xyz"'!==Rd.get(e)&&(Md=!1),Rd.remove(e)}catch(e){Md=!1}return Md},error:function(e){Rn.error("sessionStorage error: ",e)},get:function(e){try{return null==$r?void 0:$r.sessionStorage.getItem(e)}catch(e){Rd.error(e)}return null},parse:function(e){try{return JSON.parse(Rd.get(e))||null}catch(e){}return null},set:function(e,t){try{null==$r||$r.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Rd.error(e)}},remove:function(e){try{null==$r||$r.sessionStorage.removeItem(e)}catch(e){Rd.error(e)}}};!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(wd||(wd={}));class Ad{constructor(e){this.instance=e}get config(){return this.instance.config}get consent(){return this.getDnt()?wd.DENIED:this.storedConsent}isOptedOut(){return this.consent===wd.DENIED||this.consent===wd.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?wd.GRANTED:"0"===e?wd.DENIED:wd.PENDING}get storage(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?Id:Sd;var t="localStorage"===e?Sd:Id;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&&!!Zn([null==zr?void 0:zr.doNotTrack,null==zr?void 0:zr.msDoNotTrack,Qr.doNotTrack],(e=>nn([!0,1,"1","yes"],e)))}}var Fd=An("[Dead Clicks]"),Nd=()=>!0,Pd=e=>{var t,r=!(null===(t=e.instance.persistence)||void 0===t||!t.get_property(ai)),n=e.instance.config.capture_dead_clicks;return Cn(n)?n:r};class Od{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({[ai]: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?Fd.error("failed to load script",t):e()}))}start(){var e;if(Gr){if(!this._lazyLoadedDeadClicksAutocapture&&null!==(e=Qr.__PosthogExtensions__)&&void 0!==e&&e.initDeadClicksAutocapture){var t=gn(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(Gr),Fd.info("starting...")}}else Fd.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,Fd.info("stopping..."))}}var Ld=An("[ExceptionAutocapture]");class Dd{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){Ld.error("failed to start",e),this.stopCapturing()}else Ld.error("failed to load error wrapping functions - cannot start")}})),this.instance=e,this.remoteEnabled=!(null===(t=this.instance.persistence)||void 0===t||!t.props[oi]),this.startIfEnabled()}get isEnabled(){var e;return Cn(this.instance.config.capture_exceptions)?this.instance.config.capture_exceptions:null!==(e=this.remoteEnabled)&&void 0!==e&&e}get hasHandlers(){return!mn(this.unwrapOnError)}startIfEnabled(){this.isEnabled&&!this.hasHandlers&&(Ld.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 Ld.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({[oi]: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)}}function Bd(e){var t,r;return(null===(t=JSON.stringify(e,(r=[],function(e,t){if(gn(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 qd(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[qd({size:Bd(n),data:n,sessionId:e.sessionId,windowId:e.windowId}),qd({size:Bd(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((e=>e))}return[e]}var Hd=(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))(Hd||{}),$d=(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))($d||{});function Wd(e,t,r,n,i){return t>r&&(Rn.warn("min cannot be greater than max."),t=r),Sn(e)?e>r?(n&&Rn.warn(n+" cannot be greater than max: "+r+". Using max value instead."),r):e<t?(n&&Rn.warn(n+" cannot be less than min: "+t+". Using min value instead."),t):e:(n&&Rn.warn(n+" must be a number. using max or fallback. max: "+r+", fallback: "+i),Wd(i||r,t,r,n))}class Vd{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=Wd(null!==(t=this.options.refillRate)&&void 0!==t?t:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=Wd(null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval((()=>{this.refillBuckets()}),1e3)}}var Zd=Uint8Array,jd=Uint16Array,zd=Uint32Array,Gd=new Zd([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]),Ud=new Zd([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]),Yd=new Zd([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Xd=function(e,t){for(var r=new jd(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new zd(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]},Jd=Xd(Gd,2),Kd=Jd[0],Qd=Jd[1];Kd[28]=258,Qd[258]=28;for(var eh=Xd(Ud,0)[1],th=new jd(32768),rh=0;rh<32768;++rh){var nh=(43690&rh)>>>1|(21845&rh)<<1;nh=(61680&(nh=(52428&nh)>>>2|(13107&nh)<<2))>>>4|(3855&nh)<<4,th[rh]=((65280&nh)>>>8|(255&nh)<<8)>>>1}var ih=function(e,t,r){for(var n=e.length,i=0,o=new jd(t);i<n;++i)++o[e[i]-1];var s,a=new jd(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(r){s=new jd(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[th[d]>>>l]=c}else for(s=new jd(n),i=0;i<n;++i)s[i]=th[a[e[i]-1]++]>>>15-e[i];return s},oh=new Zd(288);for(rh=0;rh<144;++rh)oh[rh]=8;for(rh=144;rh<256;++rh)oh[rh]=9;for(rh=256;rh<280;++rh)oh[rh]=7;for(rh=280;rh<288;++rh)oh[rh]=8;var sh=new Zd(32);for(rh=0;rh<32;++rh)sh[rh]=5;var ah=ih(oh,9,0),lh=ih(sh,5,0),ch=function(e){return(e/8>>0)+(7&e&&1)},uh=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof jd?jd:e instanceof zd?zd:Zd)(r-t);return n.set(e.subarray(t,r)),n},dh=function(e,t,r){r<<=7&t;var n=t/8>>0;e[n]|=r,e[n+1]|=r>>>8},hh=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},ph=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 Zd(0),0];if(1==i){var s=new Zd(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 jd(h+1),v=vh(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 Zd(p),v]},vh=function(e,t,r){return-1==e.s?Math.max(vh(e.l,t,r+1),vh(e.r,t,r+1)):t[e.s]=r},gh=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new jd(++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]},fh=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},mh=function(e,t,r){var n=r.length,i=ch(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)},_h=function(e,t,r,n,i,o,s,a,l,c,u){dh(t,u++,r),++i[256];for(var d=ph(i,15),h=d[0],p=d[1],v=ph(o,15),g=v[0],f=v[1],m=gh(h),_=m[0],y=m[1],b=gh(g),w=b[0],S=b[1],C=new jd(19),I=0;I<_.length;++I)C[31&_[I]]++;for(I=0;I<w.length;++I)C[31&w[I]]++;for(var k=ph(C,7),E=k[0],x=k[1],T=19;T>4&&!E[Yd[T-1]];--T);var M,R,A,F,N=c+5<<3,P=fh(i,oh)+fh(o,sh)+s,O=fh(i,h)+fh(o,g)+s+14+3*T+fh(C,E)+(2*C[16]+3*C[17]+7*C[18]);if(N<=P&&N<=O)return mh(t,u,e.subarray(l,l+c));if(dh(t,u,1+(O<P)),u+=2,O<P){M=ih(h,p,0),R=h,A=ih(g,f,0),F=g;var L=ih(E,x,0);dh(t,u,y-257),dh(t,u+5,S-1),dh(t,u+10,T-4),u+=14;for(I=0;I<T;++I)dh(t,u+3*I,E[Yd[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];dh(t,u,L[H]),u+=E[H],H>15&&(dh(t,u,q[I]>>>5&127),u+=q[I]>>>12)}}}else M=ah,R=oh,A=lh,F=sh;for(I=0;I<a;++I)if(n[I]>255){H=n[I]>>>18&31;hh(t,u,M[H+257]),u+=R[H+257],H>7&&(dh(t,u,n[I]>>>23&31),u+=Gd[H]);var $=31&n[I];hh(t,u,A[$]),u+=F[$],$>3&&(hh(t,u,n[I]>>>5&8191),u+=Ud[$])}else hh(t,u,M[n[I]]),u+=R[n[I]];return hh(t,u,M[256]),u+R[256]},yh=new zd([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bh=function(){for(var e=new zd(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),wh=function(){var e=4294967295;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=bh[255&r^t[n]]^r>>>8;e=r},d:function(){return 4294967295^e}}},Sh=function(e,t,r,n,i){return function(e,t,r,n,i,o){var s=e.length,a=new Zd(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=mh(l,c,e.subarray(u,d)):(l[u]=o,c=mh(l,c,e.subarray(u,s)))}else{for(var h=yh[t-1],p=h>>>13,v=8191&h,g=(1<<r)-1,f=new jd(32768),m=new jd(g+1),_=Math.ceil(r/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&g},w=new zd(25e3),S=new jd(288),C=new jd(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 F=s-u;if((I>7e3||E>24576)&&F>423){c=_h(e,l,0,w,S,C,k,E,T,u-T,c),E=I=k=0,T=u;for(var N=0;N<286;++N)S[N]=0;for(N=0;N<30;++N)C[N]=0}var P=2,O=0,L=v,D=R-A&32767;if(F>2&&M==b(u-D))for(var B=Math.min(p,F)-1,q=Math.min(32767,u),H=Math.min(258,F);D<=q&&--L&&R!=A;){if(e[u+P]==e[u+P-D]){for(var $=0;$<H&&e[u+$]==e[u+$-D];++$);if($>P){if(P=$,O=D,$>B)break;var W=Math.min(D,$-2),V=0;for(N=0;N<W;++N){var Z=u-D+N+32768&32767,j=Z-f[Z]+32768&32767;j>V&&(V=j,A=Z)}}}D+=(R=A)-(A=f[R])+32768&32767}if(O){w[E++]=268435456|Qd[P]<<18|eh[O];var z=31&Qd[P],G=31&eh[O];k+=Gd[z]+Ud[G],++S[257+z],++C[G],x=u+P,++I}else w[E++]=e[u],++S[e[u]]}}c=_h(e,l,o,w,S,C,k,E,T,u-T,c)}return uh(a,0,n+ch(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)},Ch=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},Ih=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&&Ch(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)}},kh=function(e){return 10+(e.filename&&e.filename.length+1||0)};function Eh(e,t){void 0===t&&(t={});var r=wh(),n=e.length;r.p(e);var i=Sh(e,t,kh(t),8),o=i.length;return Ih(i,t),Ch(i,o-8,r.d()),Ch(i,o-4,n),i}function xh(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new Zd(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 Zd(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 uh(n,0,i)}function Th(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<Wd(100*t,0,100)}var Mh="[SessionRecording]",Rh=An(Mh);function Ah(){var e,t;return null==Qr||null===(e=Qr.__PosthogExtensions__)||void 0===e||null===(t=e.rrweb)||void 0===t?void 0:t.record}var Fh=3e5,Nh=[$d.MouseMove,$d.MouseInteraction,$d.Scroll,$d.ViewportResize,$d.Input,$d.TouchMove,$d.MediaInteraction,$d.Drag],Ph=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function Oh(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}(Eh(xh(JSON.stringify(e))),!0)}function Lh(e){return e.type===Hd.Custom&&"sessionIdle"===e.data.tag}function Dh(e,t){return t.some((t=>"regex"===t.matching&&new RegExp(t.url).test(e)))}class Bh{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(Mh+" 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:Fh}get isSampled(){var e=this.instance.get_property(_i);return Cn(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(ci),t=!this.instance.config.disable_session_recording;return $r&&e&&t}get isConsoleLogCaptureEnabled(){var e=!!this.instance.get_property(ui),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(pi),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:Wd(c,0,12,"canvas recording fps",4),quality:Wd(u,0,1,"canvas recording quality",.4)}}get networkPayloadCapture(){var e,t,r=this.instance.get_property(di),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=gn(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(Cn(s)?s:null==r?void 0:r.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}get masking(){var e,t,r,n,i,o,s=this.instance.get_property(hi),a={maskAllInputs:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.maskAllInputs,maskTextSelector:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.maskTextSelector,blockSelector:null===(r=this.instance.config.session_recording)||void 0===r?void 0:r.blockSelector},l=null!==(n=null==a?void 0:a.maskAllInputs)&&void 0!==n?n:null==s?void 0:s.maskAllInputs,c=null!==(i=null==a?void 0:a.maskTextSelector)&&void 0!==i?i:null==s?void 0:s.maskTextSelector,u=null!==(o=null==a?void 0:a.blockSelector)&&void 0!==o?o:null==s?void 0:s.blockSelector;return mn(l)&&mn(c)&&mn(u)?void 0:{maskAllInputs:null==l||l,maskTextSelector:c,blockSelector:u}}get sampleRate(){var e=this.instance.get_property(vi);return Sn(e)?e:null}get minimumDuration(){var e=this.instance.get_property(gi);return Sn(e)?e:null}get status(){return this.receivedDecide?this.isRecordingEnabled?!1===this.isSampled?"disabled":this._urlBlocked?"paused":wn(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.triggerStatus?"buffering":Cn(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(yi))===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(bi))===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","unknown"),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!=Gr&&Gr.visibilityState){var e="window "+Gr.visibilityState;this._tryAddCustomEvent(e,{})}})),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Rh.error("started without valid sessionManager"),new Error(Mh+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(Mh+" 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&&Rh.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),jn($r,"beforeunload",this._onBeforeUnload),jn($r,"offline",this._onOffline),jn($r,"online",this._onOnline),jn($r,"visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),wn(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){Rh.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(bi),null===(o=this.instance)||void 0===o||null===(s=o.persistence)||void 0===s||s.unregister(yi))})))):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,Rh.info("stopped"))}makeSamplingDecision(e){var t,r=this.sessionId!==e,n=this.sampleRate;if(Sn(n)){var i=this.isSampled,o=r||!Cn(i),s=o?Th(e,n):i;o&&(s?this._reportStarted("sampled"):Rh.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({[_i]:s})}else{var a;null===(a=this.instance.persistence)||void 0===a||a.register({[_i]: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(),!wn(this._linkedFlag)&&!this._linkedFlagSeen){var a=_n(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,l=_n(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(((e,t)=>{var r=gn(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(){Sn(this.sampleRate)&&wn(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,h=null===(r=e.sessionRecording)||void 0===r?void 0:r.sampleRate,p=wn(h)?null:parseFloat(h),v=null===(i=e.sessionRecording)||void 0===i?void 0:i.minimumDurationMilliseconds;n.register({[ci]:!!e.sessionRecording,[ui]:null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled,[di]:t({capturePerformance:e.capturePerformance},null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture),[hi]:null===(a=e.sessionRecording)||void 0===a?void 0:a.masking,[pi]:{enabled:null===(l=e.sessionRecording)||void 0===l?void 0:l.recordCanvas,fps:null===(c=e.sessionRecording)||void 0===c?void 0:c.canvasFps,quality:null===(u=e.sessionRecording)||void 0===u?void 0:u.canvasQuality},[vi]:p,[gi]:mn(v)?null:v,[fi]:null===(d=e.sessionRecording)||void 0===d?void 0:d.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(!mn(Object.assign)&&!mn(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var t,r;if(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),Ah())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 Rh.error("could not load recorder",e);this._onScriptLoaded()}));Rh.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(fi))||void 0===r?void 0:r.script)||"recorder"}isInteractiveEvent(e){var t;return 3===e.type&&-1!==Nh.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)){var n="unknown"===this.isIdle;this.isIdle=!1,n||(this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),r=!0)}if(!this.isIdle){var{windowId:i,sessionId:o}=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),s=this.sessionId!==o,a=this.windowId!==i;this.windowId=i,this.sessionId=o,s||a?(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}):Rh.warn("could not emit queued rrweb event.",t,e),!1}}_tryAddCustomEvent(e,t){return this._tryRRWebMethod(Ph((()=>Ah().addCustomEvent(e,t))))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(Ph((()=>Ah().takeFullSnapshot())))}_onScriptLoaded(){var e,r,n,i,o={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},s=this.instance.config.session_recording;for(var[a,l]of Object.entries(s||{}))a in o&&("maskInputOptions"===a?o.maskInputOptions=t({password:!0},l):o[a]=l);(this.canvasRecording&&this.canvasRecording.enabled&&(o.recordCanvas=!0,o.sampling={canvas:this.canvasRecording.fps},o.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.masking)&&(o.maskAllInputs=null===(r=this.masking.maskAllInputs)||void 0===r||r,o.maskTextSelector=null!==(n=this.masking.maskTextSelector)&&void 0!==n?n:void 0,o.blockSelector=null!==(i=this.masking.blockSelector)&&void 0!==i?i:void 0);var c=Ah();if(c){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new Vd(c,{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");Rh.info(r,{node:t}),this.log(Mh+" "+r,"warn")}});var u=this._gatherRRWebPlugins();this.stopRrweb=c(t({emit:e=>{this.onRRwebEmit(e)},plugins:u},o)),this._lastActivityTimestamp=Date.now(),this.isIdle=Cn(this.isIdle)?this.isIdle:"unknown",this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:o,activePlugins:u.map((e=>null==e?void 0:e.name))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else Rh.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!0!==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&&hn(s)&&(!zn.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(s(So(this.instance.config,this.networkPayloadCapture))):Rh.info("NetworkCapture not started because we are on localhost."));return i}onRRwebEmit(e){var r;if(this._processQueuedEvents(),e&&gn(e)){if(e.type===Hd.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===Hd.Custom&&"recording paused"===e.data.tag}(e)){e.type===Hd.FullSnapshot&&this._scheduleFullSnapshot(),e.type===Hd.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&&gn(t)&&6===t.type&&gn(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),!0!==this.isIdle||Lh(o)){if(Lh(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(Bd(e)<1024)return e;try{if(e.type===Hd.FullSnapshot)return t(t({},e),{},{data:Oh(e.data),cv:"2024-10"});if(e.type===Hd.IncrementalSnapshot&&e.data.source===$d.Mutation)return t(t({},e),{},{cv:"2024-10",data:t(t({},e.data),{},{texts:Oh(e.data.texts),attributes:Oh(e.data.attributes),removes:Oh(e.data.removes),adds:Oh(e.data.adds)})});if(e.type===Hd.IncrementalSnapshot&&e.data.source===$d.StyleSheetRule)return t(t({},e),{},{cv:"2024-10",data:t(t({},e.data),{},{adds:e.data.adds?Oh(e.data.adds):void 0,removes:e.data.removes?Oh(e.data.removes):void 0})})}catch(e){Rh.error("could not compress event - will use uncompressed event",e)}return e}(o):o,u={$snapshot_bytes:Bd(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=Sn(t)&&t>=0,n=Sn(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&&qd(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:Tn.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=Dh(e,this._urlBlocklist);r&&!t?this._pauseRecording():!r&&t&&this._resumeRecording(),Dh(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?yi:bi]:this.sessionId}),this._flushBuffer(),this._reportStarted(e+"_trigger_matched"))}_pauseRecording(){this._urlBlocked||(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Rh.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"}),Rh.info("recording resumed"))}_addEventTriggerListener(){0!==this._eventTriggers.length&&wn(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",(e=>{try{this._eventTriggers.includes(e.event)&&this._activateTrigger("event")}catch(e){Rh.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({[_i]:!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}),Rh.info(e.replace("_"," "),t),nn(["recording_initialized","session_id_changed"],e)||this._tryAddCustomEvent(e,t)}}var qh=An("[SegmentIntegration]");function Hh(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()||gd();e.config.get_device_id=n,r.id()&&(e.register({distinct_id:r.id(),$device_id:n()}),e.persistence.set_property(Mi,"identified")),t()},i=r.user();"then"in i&&hn(i.then)?i.then((e=>n(e))):n(i)}(e,(()=>{r.register((e=>{Promise&&Promise.resolve||qh.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()||(qh.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(qh.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()}))}))}var $h="posthog-js";function Wh(e){var{organization:r,projectId:n,prefix:i,severityAllowList:o=["error"]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s=>{var a,l,c,u,d;if(!("*"===o||o.includes(s.level))||!e.__loaded)return s;s.tags||(s.tags={});var h=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));s.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=(null===(a=s.exception)||void 0===a?void 0:a.values)||[],v=p.map((e=>t(t({},e),{},{stacktrace:e.stacktrace?t(t({},e.stacktrace),{},{type:"raw",frames:(e.stacktrace.frames||[]).map((e=>t(t({},e),{},{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null===(l=p[0])||void 0===l?void 0:l.value)||s.message,$exception_type:null===(c=p[0])||void 0===c?void 0:c.type,$exception_personURL:h,$exception_level:s.level,$exception_list:v,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:(null===(u=p[0])||void 0===u?void 0:u.value)||s.message,$sentry_exception_type:null===(d=p[0])||void 0===d?void 0:d.type,$sentry_tags:s.tags};return r&&n&&(g.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+s.event_id),e.exceptions.sendExceptionEvent(g),s}}class Vh{constructor(e,t,r,n,i){this.name=$h,this.setupOnce=function(o){o(Wh(e,{organization:t,projectId:r,prefix:n,severityAllowList:i}))}}}var Zh,jh=null!=$r&&$r.location?Jn($r.location.hash,"__posthog")||Jn(location.hash,"state"):null,zh="_postHogToolbarParams",Gh=An("[Toolbar]");!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(Zh||(Zh={}));class Uh{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:Zh.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||!Gr)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=jh||Jn(r.hash,"__posthog")||Jn(r.hash,"state"),a=s?Bn((()=>JSON.parse(atob(decodeURIComponent(s)))))||Bn((()=>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(zh)||"{}")).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;!wn(t)&&hn(t)?t(e,this.instance):Gh.warn("No toolbar load function found")}loadToolbar(e){var r=!(null==Gr||!Gr.getElementById(Li));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(zh,JSON.stringify(t(t({},i),{},{source:void 0}))),this.getToolbarState()===Zh.LOADED)this._callLoadToolbar(i);else if(this.getToolbarState()===Zh.UNINITIALIZED){var o,s;this.setToolbarState(Zh.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 Gh.error("[Toolbar] Failed to load",e),void this.setToolbarState(Zh.UNINITIALIZED);this.setToolbarState(Zh.LOADED),this._callLoadToolbar(i)})),jn($r,"turbolinks:load",(()=>{this.setToolbarState(Zh.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 Yh=An("[TracingHeaders]");class Xh{constructor(e){i(this,"_restoreXHRPatch",void 0),i(this,"_restoreFetchPatch",void 0),i(this,"_startCapturing",(()=>{var e,t,r,n;mn(this._restoreXHRPatch)&&(null===(e=Qr.__PosthogExtensions__)||void 0===e||null===(t=e.tracingHeadersPatchFns)||void 0===t||t._patchXHR(this.instance.sessionManager));mn(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 Yh.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 Jh=An("[Web Vitals]"),Kh=9e5;class Qh{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(mn(n))Jh.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(!mn(i))if(wn(null==e?void 0:e.name)||wn(null==e?void 0:e.value))Jh.error("Invalid metric received",e);else if(this._maxAllowedValue&&e.value>=this._maxAllowedValue)Jh.error("Ignoring metric with value >= "+this._maxAllowedValue,e);else this.buffer.url!==i&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),mn(this.buffer.url)&&(this.buffer.url=i),this.buffer.firstMetricTimestamp=mn(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__;mn(i)||mn(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):Jh.error("web vitals callbacks not loaded - not starting")})),this.instance=e,this._enabledServerSide=!(null===(r=this.instance.persistence)||void 0===r||!r.props[si]),this.startIfEnabled()}get allowedMetrics(){var e,t,r=gn(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 mn(r)?(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[li])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(gn(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var e=gn(this.instance.config.capture_performance)&&Sn(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:Kh;return 0<e&&e<=6e4?Kh:e}get isEnabled(){var e=gn(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Cn(e)?e:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(Jh.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(e){var t=gn(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=gn(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[si]:t}),this.instance.persistence.register({[li]: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?Jh.error("failed to load script",t):e()}))}_currentURL(){var e=$r?$r.location.href:void 0;return e||Jh.error("Could not determine current URL"),e}}var ep=An("[Heatmaps]");function tp(e){return gn(e)&&"clientX"in e&&"clientY"in e&&Sn(e.clientX)&&Sn(e.clientY)}class rp{constructor(e){var t;i(this,"rageclicks",new Xu),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[ii])}get flushIntervalMilliseconds(){var e=5e3;return gn(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 mn(this.instance.config.capture_heatmaps)?mn(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;ep.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({[ii]: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&&Gr&&(jn($r,"beforeunload",this.flush.bind(this)),jn(Gr,"click",(e=>this._onClick(e||(null==$r?void 0:$r.event))),{capture:!0}),jn(Gr,"mousemove",(e=>this._onMouseMove(e||(null==$r?void 0:$r.event))),{capture:!0}),this.deadClicksCapture=new Od(this.instance,Nd,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&&Hi(n)&&!$i(n,"body");){if(n===r)return!1;if(nn(t,null==$r?void 0:$r.getComputedStyle(n).position))return!0;n=Ji(n)}return!1}(Yi(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(!qi(e.target)&&tp(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){!qi(e.target)&&tp(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&&!fn(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class np{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(!(mn(o)||mn(s)||mn(a)||mn(l)||mn(c)||mn(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:Wd(s/o,0,1),h=o<=1?1:Wd(a/o,0,1),p=l<=1?1:Wd(c/l,0,1),v=l<=1?1:Wd(u/l,0,1);n=On(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}}class ip{constructor(e){this.instance=e}sendExceptionEvent(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}var op,sp=An("[FeatureFlags]"),ap="$active_feature_flags",lp="$override_feature_flags",cp="$feature_flag_payloads",up="$override_feature_flag_payloads",dp="$feature_flag_request_id",hp=e=>{var t={};for(var[r,n]of Dn(e||{}))n&&(t[r]=n);return t},pp=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>{var r;return[e,null!==(r=t[e].variant)&&void 0!==r?r:t[e].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>{var r;return null===(r=t[e].metadata)||void 0===r?void 0:r.payload})).map((e=>{var r;return[e,null===(r=t[e].metadata)||void 0===r?void 0:r.payload]})))):sp.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e};!function(e){e.FeatureFlags="feature_flags",e.Recordings="recordings"}(op||(op={}));class vp{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())}getFlagsWithDetails(){var e=this.instance.get_property(Ci),r=this.instance.get_property(lp),n=this.instance.get_property(up);if(!n&&!r)return e||{};var i=On({},e||{}),o=[...new Set([...Object.keys(n||{}),...Object.keys(r||{})])];for(var s of o){var a,l,c=i[s],u=null==r?void 0:r[s],d=mn(u)?null!==(a=null==c?void 0:c.enabled)&&void 0!==a&&a:!!u,h=mn(u)?c.variant:"string"==typeof u?u:void 0,p=null==n?void 0:n[s],v=t(t({},c),{},{enabled:d,variant:d?null!=h?h:null==c?void 0:c.variant:void 0});if(d!==(null==c?void 0:c.enabled)&&(v.original_enabled=null==c?void 0:c.enabled),h!==(null==c?void 0:c.variant)&&(v.original_variant=null==c?void 0:c.variant),p)v.metadata=t(t({},null==c?void 0:c.metadata),{},{payload:p,original_payload:null==c||null===(l=c.metadata)||void 0===l?void 0:l.payload});i[s]=v}return this._override_warning||(sp.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:i}),this._override_warning=!0),i}getFlagVariants(){var e=this.instance.get_property(wi),t=this.instance.get_property(lp);if(!t)return e||{};for(var r=On({},e),n=Object.keys(t),i=0;i<n.length;i++)r[n[i]]=t[n[i]];return this._override_warning||(sp.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){var e=this.instance.get_property(cp),t=this.instance.get_property(up);if(!t)return e||{};for(var r=On({},e||{}),n=Object.keys(t),i=0;i<n.length;i++)r[n[i]]=t[n[i]];return this._override_warning||(sp.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){var r;if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var n={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:t(t({},(null===(r=this.instance.persistence)||void 0===r?void 0:r.get_initial_props())||{}),this.instance.get_property(Ii)||{}),group_properties:this.instance.get_property(ki)};(null!=e&&e.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(n.disable_flags=!0),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=4"),data:n,compression:this.instance.config.disable_compression?void 0:qr.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,r,i,o=!0;(200===e.statusCode&&(this._additionalReloadRequested||(this.$anon_distinct_id=void 0),o=!1),this._requestInFlight=!1,this._decideCalled)||(this._decideCalled=!0,this.instance._onRemoteConfig(null!==(i=e.json)&&void 0!==i?i:{}));n.disable_flags&&!this._additionalReloadRequested||(this._flagsLoadedFromRemote=!o,e.json&&null!==(t=e.json.quotaLimited)&&void 0!==t&&t.includes(op.FeatureFlags)?sp.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(this.receivedFeatureFlags(null!==(r=e.json)&&void 0!==r?r:{},o),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=this.getFlagVariants()[e],n="".concat(r),i=this.instance.get_property(dp)||void 0,o=this.instance.get_property(Ti)||{};if((t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(n))){var s,a,l,c,u,d,h,p,v,g,f;dn(o[e])?o[e].push(n):o[e]=[n],null===(s=this.instance.persistence)||void 0===s||s.register({[Ti]:o});var m=this.getFeatureFlagDetails(e),_={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:i,$feature_flag_bootstrapped_response:(null===(a=this.instance.config.bootstrap)||void 0===a||null===(l=a.featureFlags)||void 0===l?void 0:l[e])||null,$feature_flag_bootstrapped_payload:(null===(c=this.instance.config.bootstrap)||void 0===c||null===(u=c.featureFlagPayloads)||void 0===u?void 0:u[e])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};mn(null==m||null===(d=m.metadata)||void 0===d?void 0:d.version)||(_.$feature_flag_version=m.metadata.version);var y,b=null!==(h=null==m||null===(p=m.reason)||void 0===p?void 0:p.description)&&void 0!==h?h:null==m||null===(v=m.reason)||void 0===v?void 0:v.code;if(b&&(_.$feature_flag_reason=b),null!=m&&null!==(g=m.metadata)&&void 0!==g&&g.id&&(_.$feature_flag_id=m.metadata.id),mn(null==m?void 0:m.original_variant)&&mn(null==m?void 0:m.original_enabled)||(_.$feature_flag_original_response=mn(m.original_variant)?m.original_enabled:m.original_variant),null!=m&&null!==(f=m.metadata)&&void 0!==f&&f.original_payload)_.$feature_flag_original_payload=null==m||null===(y=m.metadata)||void 0===y?void 0:y.original_payload;this.instance.capture("$feature_flag_called",_)}return r}sp.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var r=this.instance.config.token;this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=4"),data:{distinct_id:this.instance.get_distinct_id(),token:r},compression:this.instance.config.disable_compression?void 0:qr.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:r=>{var n,i=null===(n=r.json)||void 0===n?void 0:n.featureFlagPayloads;t((null==i?void 0:i[e])||void 0)}})}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);sp.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(),o=this.getFlagsWithDetails();!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=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=pp(e),a=s.flags,l=s.featureFlags,c=s.featureFlagPayloads;if(l){var u=e.requestId;if(dn(l)){sp.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(l)for(var h=0;h<l.length;h++)d[l[h]]=!0;r&&r.register({[ap]:l,[wi]:d})}else{var p=l,v=c,g=a;e.errorsWhileComputingFlags&&(p=t(t({},n),p),v=t(t({},i),v),g=t(t({},o),g)),r&&r.register(t({[ap]:Object.keys(hp(p)),[wi]:p||{},[cp]:v||{},[Ci]:g||{}},u?{[dp]:u}:{}))}}}(e,this.instance.persistence,n,i,o),this._fireFeatureFlagsCallbacks(r)}}override(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];sp.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this.instance.__loaded||!this.instance.persistence)return sp.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.instance.persistence.unregister(lp),this.instance.persistence.unregister(up),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(lp);else if(r.flags)if(dn(r.flags)){for(var n={},i=0;i<r.flags.length;i++)n[r.flags[i]]=!0;this.instance.persistence.register({[lp]:n})}else this.instance.persistence.register({[lp]:r.flags});return"payloads"in r&&(!1===r.payloads?this.instance.persistence.unregister(up):r.payloads&&this.instance.persistence.register({[up]: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(Si)||[]).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({[ap]:Object.keys(hp(a)),[wi]:a}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0,n=this.instance.get_property(Si),i=r?"&".concat(r.map((e=>"stage=".concat(e))).join("&")):"";if(n&&!t)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token).concat(i)),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({[Si]: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(Ii)||{};this.instance.register({[Ii]:t(t({},n),e)}),r&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(Ii)}setGroupPropertiesForFlags(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(ki)||{};0!==Object.keys(n).length&&Object.keys(n).forEach((r=>{n[r]=t(t({},n[r]),e[r]),delete e[r]})),this.instance.register({[ki]:t(t({},n),e)}),r&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var r=this.instance.get_property(ki)||{};this.instance.register({[ki]:t(t({},r),{},{[e]:{}})})}else this.instance.unregister(ki)}}var gp=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class fp{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&&Rn.info("Persistence loaded",e.persistence,t({},this.props)),this.update_config(e,e),this.save()}buildStorage(e){-1===gp.indexOf(e.persistence.toLowerCase())&&(Rn.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&Id.is_supported()?Id:"localstorage+cookie"===t&&Ed.is_supported()?Ed:"sessionstorage"===t&&Rd.is_supported()?Rd:"memory"===t?Td:"cookie"===t?Sd:Ed.is_supported()?Ed:Sd}properties(){var e={};return Pn(this.props,(function(t,r){if(r===wi&&gn(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,(bn(o=Bi)?a:jr&&o.indexOf===jr?-1!=o.indexOf(s):(Pn(o,(function(e){if(a||(a=e===s))return Fn})),a))||(e[r]=t);var o,s,a})),e}load(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=On({},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(gn(e)){mn(t)&&(t="None"),this.expire_days=mn(r)?this.default_expiry:r;var n=!1;if(Pn(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(gn(e)){this.expire_days=mn(t)?this.default_expiry:t;var r=!1;if(Pn(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=Xa.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});fn(Hn(e))||this.register(e),this.campaign_params_saved=!0}}update_search_keyword(){this.register(Xa.searchInfo())}update_referrer_info(){this.register_once(Xa.referrerInfo(),void 0)}set_initial_person_info(){this.props[Fi]||this.props[Ni]||this.register_once({[Pi]:Xa.personInfo({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties})},void 0)}get_referrer_info(){return Hn({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var e={};Pn([Ni,Fi],(t=>{var r=this.props[t];r&&Pn(r,(function(t,r){e["$initial_"+sn(r)]=t}))}));var t=this.props[Pi];if(t){var r=Xa.initialPersonPropsFromInfo(t);On(e,r)}return e}safe_merge(e){return Pn(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[ri]||{};r[e]=t,this.props[ri]=r,this.save()}remove_event_timer(e){var t=(this.props[ri]||{})[e];return mn(t)||(delete this.props[ri][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var mp=An("[RateLimiter]");class _p{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=>{mp.info("".concat(e||"events"," is quota limited.")),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void mp.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(Ai))&&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(Ai,o),{isRateLimited:s,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var yp=An("[RemoteConfig]");class bp{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))):(yp.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 yp.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void yp.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((e=>{if(!e)return yp.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){yp.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()):yp.info("__preview_remote_config is disabled. Logging config instead",e):yp.error("Failed to fetch remote config from PostHog.")}}var wp=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),bn(a)||(r>t&&(o+=e.substring(t,r)),o+=a,t=r=i+1)}return r>t&&(o+=e.substring(t,e.length)),o},Sp=!!Xr||!!Yr,Cp="text/plain",Ip=(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=Un(o);return s=s?(i?i+"&":"")+s:i,"".concat(n,"?").concat(s)},kp=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),Ep=e=>{var{data:t,compression:r}=e;if(t){if(r===qr.GZipJS){var n=Eh(xh(kp(t)),{mtime:0}),i=new Blob([n],{type:Cp});return{contentType:Cp,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=wp(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}(kp(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:kp(e)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=kp(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},xp=[];Yr&&xp.push({transport:"fetch",method:e=>{var r,n,{contentType:i,body:o,estimatedSize:s}=null!==(r=Ep(e))&&void 0!==r?r:{},a=new Headers;Pn(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){Rn.error(e)}null===(n=e.callback)||void 0===n||n.call(e,i)})))).catch((t=>{var r;Rn.error(t),null===(r=e.callback)||void 0===r||r.call(e,{statusCode:0,text:t})})).finally((()=>c?clearTimeout(c.timeout):null))}}),Xr&&xp.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=Ep(e))&&void 0!==t?t:{};Pn(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!=zr&&zr.sendBeacon&&xp.push({transport:"sendBeacon",method:e=>{var t=Ip(e.url,{beacon:"1"});try{var r,{contentType:n,body:i}=null!==(r=Ep(e))&&void 0!==r?r:{},o="string"==typeof i?new Blob([i],{type:n}):i;zr.sendBeacon(t,o)}catch(e){}}});var Tp=3e3;class Mp{constructor(e,t){i(this,"isPaused",!0),i(this,"queue",[]),this.flushTimeoutMs=Wd((null==t?void 0:t.flush_interval_ms)||Tp,250,5e3,"flush interval",Tp),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&&dn(n.data)&&Pn(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 Pn(this.queue,(r=>{var n,i=r,o=(i?i.batchKey:null)||i.url;mn(e[o])&&(e[o]=t(t({},i),{},{data:[]})),null===(n=e[o].data)||void 0===n||n.push(i.data)})),this.queue=[],e}}var Rp=["retriesPerformedSoFar"];class Ap{constructor(e){i(this,"isPolling",!1),i(this,"pollIntervalMs",3e3),i(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!mn($r)&&"onLine"in $r.navigator&&(this.areWeOnline=$r.navigator.onLine,jn($r,"online",(()=>{this.areWeOnline=!0,this.flush()})),jn($r,"offline",(()=>{this.areWeOnline=!1})))}retriableRequest(e){var{retriesPerformedSoFar:r}=e,n=o(e,Rp);Sn(r)&&r>0&&(n.url=Ip(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)"),Rn.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){Rn.error(e)}this.queue=[]}}class Fp{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(){jn($r,"scroll",this._updateScrollData,{capture:!0}),jn($r,"scrollend",this._updateScrollData,{capture:!0}),jn($r,"resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return null==$r?void 0:$r.document.documentElement;var e=dn(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 Np=e=>Xa.personInfo({maskPersonalDataProperties:null==e?void 0:e.config.mask_personal_data_properties,customPersonalDataProperties:null==e?void 0:e.config.custom_personal_data_properties});class Pp{constructor(e,t,r,n){i(this,"_onSessionIdCallback",(e=>{var t=this._getStored();if(!t||t.sessionId!==e){var r={sessionId:e,props:this._sessionSourceParamGenerator(this.instance)};this._persistence.register({[Ri]:r})}})),this.instance=e,this._sessionIdManager=t,this._persistence=r,this._sessionSourceParamGenerator=n||Np,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[Ri]}getSetOnceProps(){var e,t=null===(e=this._getStored())||void 0===e?void 0:e.props;return t?"r"in t?Xa.personPropsFromInfo(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return Pn(Hn(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_".concat(sn(r))]=t})),e}}var Op=An("[SessionId]");class Lp{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||gd,this._windowIdGenerator=r||gd;var o=this.config.persistence_name||this.config.token,s=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Wd(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=Rd.parse(this._window_id_storage_key),l=Rd.parse(this._primary_window_exists_storage_key);a&&!l?this._windowId=a:Rd.remove(this._window_id_storage_key),Rd.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){Op.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return mn(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&&Rd.is_supported()}_setWindowId(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&Rd.set(this._window_id_storage_key,e))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Rd.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({[mi]:[t,e,r]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[mi];return dn(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){jn($r,"beforeunload",(()=>{this._canUseSessionStorage()&&Rd.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=Sn(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(),Op.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)}}var Dp=["$set_once","$set"],Bp=An("[SiteApps]");class qp{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,Dp)),{},{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=this.apps[e.id],r=()=>{var r;(!t.errored&&this.bufferedInvocations.length&&(Bp.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)})),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored)))&&(null===(r=this.stopBuffering)||void 0===r||r.call(this))},n=!1,i=i=>{t.errored=!i,t.loaded=!0,Bp.info("Site app with id ".concat(e.id," ").concat(i?"loaded":"errored")),n&&r()};try{var{processEvent:o}=e.init({posthog:this.instance,callback:e=>{i(e)}});o&&(t.processEvent=o),n=!0}catch(t){Bp.error("Error while initializing PostHog app with config id ".concat(e.id),t),i(!1)}if(n&&t.loaded)try{r()}catch(r){Bp.error("Error while processing buffered events PostHog app with config id ".concat(e.id),r),t.errored=!0}}setupSiteApps(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}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){Bp.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)return this.isEnabled?(this.setupSiteApps(),void this.instance.on("eventCaptured",(e=>this.onCapturedEvent(e)))):void Bp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null===(r=this.stopBuffering)||void 0===r||r.call(this),null!==(n=e.siteApps)&&void 0!==n&&n.length)if(this.isEnabled){var o=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 Bp.error("Error while initializing PostHog app with config id ".concat(e),t)}))};for(var{id:s,url:a}of e.siteApps)o(s,a)}else Bp.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Hp,$p=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","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"],Wp=function(e,t){if(!e)return!1;var r=e.toLowerCase();return $p.concat(t||[]).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))},Vp=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&Wp(r,t))return!0;try{var n=null==e?void 0:e.userAgentData;if(null!=n&&n.brands&&n.brands.some((e=>Wp(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver};function Zp(e,t,r){return kp({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(Hp||(Hp={}));var jp="i.posthog.com";class zp{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(jp),".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]=Hp.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=Hp.EU:this._regionCache[this.apiHost]=Hp.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===Hp.CUSTOM)return this.apiHost+t;var r=jp+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(r);case"api":return"https://".concat(this.region,".").concat(r)}}}var Gp={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&&Ja(t.href,e),not_regex:(e,t)=>!!$r&&!Ja(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Up{constructor(e){var t=this;i(this,"getWebExperimentsAndEvaluateDisplayLogic",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t.getWebExperiments((e=>{Up.logInfo("retrieved web experiments from the server"),t._flagToExperiments=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;if(t._flagToExperiments)Up.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);_n(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];Up.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())Up.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(wn(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Up.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=Up.getWindowLocation();if(null!=e&&e.search){var t=Yn(null==e?void 0:e.search,"__experiment_id"),r=Yn(null==e?void 0:e.search,"__experiment_variant");t&&r&&(Up.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&&(Up.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!wn(e.conditions)&&(Up.matchUrlConditions(e)&&Up.matchUTMConditions(e))}static matchUrlConditions(e){var t;if(wn(e.conditions)||wn(null===(t=e.conditions)||void 0===t?void 0:t.url))return!0;var r,n,i,o=Up.getWindowLocation();return!!o&&(null===(r=e.conditions)||void 0===r||!r.url||Gp[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(wn(e.conditions)||wn(null===(t=e.conditions)||void 0===t?void 0:t.utm))return!0;var r=Xa.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];Rn.info("[WebExperiments] ".concat(e),r)}applyTransforms(e,t,r){this._is_bot()?Up.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?r.forEach((r=>{if(r.selector){var n;Up.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)}))}})):Up.logInfo("Control variants leave the page unmodified.")}_is_bot(){return zr&&this.instance?Vp(zr,this.instance.config.custom_blocked_useragents):void 0}}var Yp={},Xp=()=>{},Jp="posthog",Kp=!Sp&&-1===(null==Kr?void 0:Kr.indexOf("MSIE"))&&-1===(null==Kr?void 0:Kr.indexOf("Mozilla")),Qp=()=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:Vn(null==Gr?void 0:Gr.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Xp,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Ur&&_n(null==Ur?void 0:Ur.search)&&-1!==Ur.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,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;Rn.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:Tp},_onCapture:Xp}},ev=e=>{var t={};mn(e.process_person)||(t.person_profiles=e.process_person),mn(e.xhr_headers)||(t.request_headers=e.xhr_headers),mn(e.cookie_name)||(t.persistence_name=e.cookie_name),mn(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),mn(e.store_google)||(t.save_campaign_params=e.store_google),mn(e.verbose)||(t.debug=e.verbose);var r=On({},t,e);return dn(e.property_blacklist)&&(mn(e.property_denylist)?r.property_denylist=e.property_blacklist:dn(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:Rn.error("Invalid value for property_denylist config: "+e.property_denylist)),r};class tv{constructor(){i(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(e){Rn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class rv{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 tv),i(this,"_personProcessingSetOncePropertiesSent",!1),i(this,"version",Tn.LIB_VERSION),i(this,"_internalEventEmitter",new Ka),this.config=Qp(),this.SentryIntegration=Vh,this.sentryIntegration=e=>function(e,t){var r=Wh(e,t);return{name:$h,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 vp(this),this.toolbar=new Uh(this),this.scrollManager=new Fp(this),this.pageViewManager=new np(this),this.surveys=new ol(this),this.experiments=new Up(this),this.exceptions=new ip(this),this.rateLimiter=new _p(this),this.requestRouter=new zp(this),this.consent=new Ad(this),this.people={set:(e,t,r)=>{var n=_n(e)?{[e]:t}:e;this.setPersonProperties(n),null==r||r({})},set_once:(e,t,r)=>{var n=_n(e)?{[e]:t}:e;this.setPersonProperties(void 0,n),null==r||r({})}},this.on("eventCaptured",(e=>Rn.info('send "'.concat(null==e?void 0:e.event,'"'),e)))}init(e,t,r){if(r&&r!==Jp){var n,i=null!==(n=Yp[r])&&void 0!==n?n:new rv;return i._init(e,t,r),Yp[r]=i,Yp[Jp][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(mn(e)||yn(e))return Rn.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 Rn.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(On({},Qp(),ev(i),{name:o,token:e})),this.config.on_xhr_error&&Rn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:qr.GZipJS,this.persistence=new fp(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new fp(t(t({},this.config),{},{persistence:"sessionStorage"}));var s=t({},this.persistence.props),a=t({},this.sessionPersistence.props);if(this._requestQueue=new Mp((e=>this._send_retriable_request(e)),this.config.request_queue_config),this._retryQueue=new Ap(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new Lp(this),this.sessionPropsManager=new Pp(this,this.sessionManager,this.persistence)),new Xh(this).startIfEnabledOrStop(),this.siteApps=new qp(this),null===(r=this.siteApps)||void 0===r||r.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new Bh(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new rd(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new rp(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Qh(this),this.exceptionObserver=new Dd(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new Od(this,Pd),this.deadClicksAutocapture.startIfEnabled(),Tn.DEBUG=Tn.DEBUG||this.config.debug,Tn.DEBUG&&Rn.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(gd()),d=null!==(l=i.bootstrap)&&void 0!==l&&l.isIdentifiedID?u:i.bootstrap.distinctID;this.persistence.set_property(Mi,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:Di,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(gd());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(Mi,"anonymous")}return jn($r,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),i.segment?Hh(this,(()=>this._loaded())):this._loaded(),hn(this.config._onCapture)&&this.config._onCapture!==Xp&&(Rn.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(!Gr||!Gr.body)return Rn.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=nn(e.supportedCompression,qr.GZipJS)?qr.GZipJS:nn(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){Rn.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((()=>{this.consent.isOptedIn()&&this._captureInitialPageview()}),1),new bp(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()||Nn(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&&(Kp?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Ip(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=Ip(o.url,{_:(new Date).getTime().toString(),ver:Tn.LIB_VERSION,compression:o.compression});var s=null!==(r=o.transport)&&void 0!==r?r:"fetch",a=null!==(n=null===(i=Zn(xp,(e=>e.transport===s)))||void 0===i?void 0:i.method)&&void 0!==n?n:xp[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=[];Nn(e,(e=>{e&&(t=e[0],dn(t)?i.push(e):hn(e)?e.call(this):dn(e)&&"alias"===t?r.push(e):dn(e)&&-1!==t.indexOf("capture")&&hn(this[t])?i.push(e):n.push(e))}));var o=function(e,t){Nn(e,(function(e){if(dn(e[0])){var r=t;Pn(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(!mn(e)&&_n(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){null!=r&&r.$current_url&&!_n(null==r?void 0:r.$current_url)&&(Rn.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==r||delete r.$current_url),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=gd(),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=$n(c,null!=n&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,mn(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(fn(d)||this.setPersonPropertiesForFlags(d),!wn(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}Rn.critical("This capture call is ignored due to client rate limiting.")}}else Rn.error("No event name provided to posthog.capture")}else Rn.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,(!_n(s.distinct_id)&&!Sn(s.distinct_id)||yn(s.distinct_id))&&Rn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var l,c=Xa.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}this.sessionPropsManager&&On(s,this.sessionPropsManager.getSessionProps());try{var h,p;this.sessionRecording&&(s.$recording_status=this.sessionRecording.status,s.$sdk_debug_replay_internal_buffer_length=this.sessionRecording.buffer.data.length,s.$sdk_debug_replay_internal_buffer_size=this.sessionRecording.buffer.size),s.$sdk_debug_retry_queue_size=null===(h=this._retryQueue)||void 0===h||null===(p=h.queue)||void 0===p?void 0:p.length}catch(e){s.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Hp.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=On(s,l),"$pageview"===e&&Gr&&(s.title=Gr.title),!mn(o)){var v=n.getTime()-o;s.$duration=parseFloat((v/1e3).toFixed(3))}Kr&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=On({},c,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),dn(this.config.property_denylist)?Pn(this.config.property_denylist,(function(e){delete s[e]})):Rn.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(Rn.error("sanitize_properties is deprecated. Use before_send instead"),s=g(s,e));var f=this._hasPersonProcessing();return s.$process_person_profile=f,f&&this._requirePersonProcessing("_calculate_event_properties"),s}_calculate_set_once_properties(e){var t;if(!this.persistence||!this._hasPersonProcessing())return e;if(this._personProcessingSetOncePropertiesSent)return e;var r=this.persistence.get_initial_props(),n=null===(t=this.sessionPropsManager)||void 0===t?void 0:t.getSetOnceProps(),i=On({},r,n||{},e||{}),o=this.config.sanitize_properties;return o&&(Rn.error("sanitize_properties is deprecated. Use before_send instead"),i=o(i,"$set_once")),this._personProcessingSetOncePropertiesSent=!0,fn(i)?void 0:i}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],r=arguments.length>2?arguments[2]:void 0;return this.featureFlags.getEarlyAccessFeatures(e,t,r)}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)}identify(e,r,n){if(!this.__loaded||!this.persistence)return Rn.uninitializedWarning("posthog.identify");if(Sn(e)&&(e=e.toString(),Rn.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()))Rn.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(ti)&&(this.unregister(ti),this.register({distinct_id:e}));var s="anonymous"===(this.persistence.get_property(Mi)||"anonymous");e!==i&&s?(this.persistence.set_property(Mi,"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=Zp(e,r,n)):(r||n)&&(this._cachedIdentify!==Zp(e,r,n)?(this.setPersonProperties(r,n),this._cachedIdentify=Zp(e,r,n)):Rn.info("A duplicate posthog.identify call was made with the same properties. It has been ignored.")),e!==i&&(this.reloadFeatureFlags(),this.unregister(Ti))}}else Rn.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 Rn.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(Rn.info("reset"),!this.__loaded)return Rn.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(Mi,"anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId(),this._cachedIdentify=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Di,$device_id:null},"");else{var s=this.config.get_device_id(gd());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(ei)?(Rn.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(mn(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(ti,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Rn.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);gn(e)&&(On(this.config,ev(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 fp(t(t({},this.config),{},{persistence:"sessionStorage"})),Id.is_supported()&&"true"===Id.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(Tn.DEBUG=!0,Rn.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=hn(null===(n=Qr.__PosthogExtensions__)||void 0===n?void 0:n.parseErrorAsProperties)?t(t({},Qr.__PosthogExtensions__.parseErrorAsProperties(En(e)?{error:e,event:e.message}:{event:e},{syntheticException:i})),r):t({$exception_level:"error",$exception_list:[{type:En(e)?e.name:"Error",value:En(e)?e.message:gn(e)&&"message"in e?String(e.message):String(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:Jp;return t!==Jp&&(t=Jp+"."+t),t}_isIdentified(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(Mi))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(Mi))}_hasPersonProcessing(){var e,t,r,n;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&fn(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[ti])&&(null===(r=this.persistence)||void 0===r||null===(n=r.props)||void 0===n||!n[Oi]))}_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?(Rn.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Oi,!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(),mn(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 zr?Vp(zr,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Gr&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:Gr.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(wn(this.config.before_send))return e;var t=dn(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of t){if(r=n(r),wn(r)){var i="Event '".concat(e.event,"' was rejected in beforeSend function");return xn(e.event)?Rn.warn("".concat(i,". This can cause unexpected behavior.")):Rn.info(i),null}r.properties&&!fn(r.properties)||Rn.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}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(r)})}}!function(e,t){for(var r=0;r<t.length;r++)e.prototype[t[r]]=qn(e.prototype[t[r]])}(rv,["identify"]);var nv,iv;nv=Yp[Jp]=new rv,(iv=Qr.posthog)&&Pn(iv._i,(function(e){if(e&&dn(e)){var t=nv.init(e[0],e[1],e[2]),r=iv[e[2]]||iv;t&&(t._execute_array.call(t.people,r.people),t._execute_array(r))}})),Qr.posthog=nv,function(){function e(){e.done||(e.done=!0,Kp=!1,Pn(Yp,(function(e){e._dom_loaded()})))}null!=Gr&&Gr.addEventListener?"complete"===Gr.readyState?e():jn(Gr,"DOMContentLoaded",e,{capture:!1}):$r&&Rn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
2
2
  //# sourceMappingURL=array.full.js.map