posthog-js 1.372.6 → 1.372.7

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,r,i,n,s,o){try{var a=e[s](o),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(i,n)}function t(t){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=t.apply(r,i);function a(t){e(o,n,s,a,l,"next",t)}function l(t){e(o,n,s,a,l,"throw",t)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},r.apply(null,arguments)}function i(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=Object.defineProperty,u=(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),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||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},v={};function f(e){if(v[e])return v[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in c?c[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in d?d[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return v[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 u=l[e].prototype;return document.body.removeChild(a),u?v[e]=u:t.prototype}catch(e){return t.prototype}}var p={};function g(e,t,r){var i,n=e+"."+String(r);if(p[n])return p[n].call(t);var s=f(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(p[n]=o,o.call(t)):t[r]}var m={};function y(e,t,r){var i=e+"."+String(r);if(m[i])return m[i].bind(t);var n=f(e)[r];return"function"!=typeof n?t[r]:(m[i]=n,n.bind(t))}var b={childNodes:e=>g("Node",e,"childNodes"),parentNode:e=>g("Node",e,"parentNode"),parentElement:e=>g("Node",e,"parentElement"),textContent:e=>g("Node",e,"textContent"),contains:(e,t)=>y("Node",e,"contains")(t),getRootNode:e=>y("Node",e,"getRootNode")(),host:e=>e&&"host"in e?g("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?g("Element",e,"shadowRoot"):null,querySelector:(e,t)=>g("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>g("Element",e,"querySelectorAll")(t),mutationObserver:()=>f("MutationObserver").constructor};function w(e){return e.nodeType===e.ELEMENT_NODE}function _(e){var t=e&&"host"in e&&"mode"in e&&b.host(e)||null;return Boolean(t&&"shadowRoot"in t&&b.shadowRoot(t)===e)}function I(e){return"[object ShadowRoot]"==={}.toString.call(e)}function C(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t,(t=>S(t,e.href))).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function S(e,t){if(function(e){return"styleSheet"in e}(e)){var r;try{r=C(e.styleSheet)||function(e){var{cssText:t}=e;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){r=e.cssText}return e.styleSheet.href?L(r,e.styleSheet.href):r}var i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(i=i.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?L(i,t):i}function x(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let k=class{constructor(){u(this,"idNodeMap",new Map),u(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){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function T(e){var{element:t,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=e,a=s||"",l=n&&A(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=o?o(a,t):"*".repeat(a.length)),a}function A(e){return e.toLowerCase()}var E="__rrweb_original__";function R(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?A(t):null}function N(e,t){var r,i;try{i=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}var M=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(e,t){return(e||"").replace(M,((e,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return e;if(F.test(l)||O.test(l))return"url("+u+l+u+")";if(P.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=t.split("/"),c=l.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+u+h.join("/")+u+")"}))}var D,B,j=1,q=new RegExp("[^a-z0-9-_:]"),Z=-2;function H(){return j++}var V=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/,U=new WeakMap;function Y(e,t){return t&&""!==t.trim()?G(e,t):t}function G(e,t){var r=U.get(e);if(r||(r=e.createElement("a"),U.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function W(e,t,r,i){return i?"src"===r||"href"===r&&("use"!==t||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?Y(e,i):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function i(e){var i,n=e.exec(t.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(z),t.length>r;){var s=i(V);if(","===s.slice(-1))s=Y(e,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Y(e,s);for(var a=!1;;){var l=t.charAt(r);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,r+=1}}}return n.join(", ")}(e,i):"style"===r?L(i,G(e)):"object"===t&&"data"===r?Y(e,i):i:Y(e,i):i}function X(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function J(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&J(b.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&J(b.parentNode(e),t,r)}function K(e,t,r,i){var n;if(w(e)){if(!b.childNodes(n=e).length)return!1}else{if(null===b.parentElement(e))return!1;n=b.parentElement(e)}try{if("string"==typeof t){if(i){if(n.closest("."+t))return!0}else if(n.classList.contains(t))return!0}else if(J(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function Q(e){return null==e?"":e.toLowerCase()}function ee(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:k=5e3,onStylesheetLoad:M,stylesheetLoadTimeout:F=5e3,keepIframeSrcFn:O=(()=>!1),newlyAddedElement:P=!1}=t,{needsMask:j}=t,{preserveWhiteSpace:V=!0}=t;j||(j=K(e,o,a,void 0===j));var z,U=function(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g=!1}=t,m=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,i);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:i,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=t,g=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,n,s),m=function(e){if(e instanceof HTMLFormElement)return"form";var t=A(e.tagName);return q.test(t)?"div":t}(e),y={},w=e.attributes.length,_=0;w>_;_++){var I=e.attributes[_];X(m,I.name)||(y[I.name]=W(i,m,A(I.name),I.value))}if("link"===m&&o){var S=function(e){return null==e?void 0:e.href}(e);if(S){var k=x(i,S);!k&&S.includes(".css")&&(k=x(i,window.location.origin+"/"+S.replace(window.location.href,"")));var N=null;k&&(N=C(k)),N&&(delete y.rel,delete y.href,y._cssText=N)}}if("style"===m&&e.sheet&&!(e.innerText||b.textContent(e)||"").trim().length){var M=C(e.sheet);M&&(y._cssText=M)}if("input"===m||"textarea"===m||"select"===m){var F=e.value,O=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=T({element:e,type:R(e),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(y.checked=O)}if("option"===m&&(e.selected&&!a.select?y.selected=!0:delete y.selected),"dialog"===m&&e.open)try{y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){y.rr_open_mode="modal",y.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;e.width>r;r+=50)for(var i=0;e.height>i;i+=50){var n=t.getImageData;if(new Uint32Array((E in n?n[E]:n).call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(y.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var P=e.toDataURL(u.type,u.quality),L=i.createElement("canvas");L.width=e.width,L.height=e.height,P!==L.toDataURL(u.type,u.quality)&&(y.rr_dataURL=P)}if("img"===m&&c){D||(D=i.createElement("canvas"),B=D.getContext("2d"));var j=e,Z=j.currentSrc||j.getAttribute("src")||"<unknown-src>",H=j.crossOrigin,V=()=>{j.removeEventListener("load",V);try{D.width=j.naturalWidth,D.height=j.naturalHeight,B.drawImage(j,0,0),y.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==j.crossOrigin)return j.crossOrigin="anonymous",void(j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V));console.warn("Cannot inline img src="+Z+"! Error: "+e)}"anonymous"===j.crossOrigin&&(H?y.crossOrigin=H:j.removeAttribute("crossorigin"))};j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V)}if("audio"===m||"video"===m){var z=y;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}if(f||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),g){var{width:U,height:Y}=e.getBoundingClientRect();y={class:y.class,rr_width:U+"px",rr_height:Y+"px"}}"iframe"!==m||v(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(r=!0)}catch(e){}return{type:h.Element,tagName:m,attributes:y,childNodes:[],isSVG:(G=e,Boolean("svg"===G.tagName||G.ownerSVGElement)||void 0),needBlock:g,rootId:p,isCustom:r};var G}(e,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case e.TEXT_NODE:return function(e,t){var r,{needsMask:i,maskTextFn:n,rootId:s}=t,o=b.parentNode(e),a=o&&o.tagName,l=b.textContent(e),u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(u&&l){try{e.nextSibling||e.previousSibling||(null==(r=o.sheet)?void 0:r.cssRules)&&(l=C(o.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}l=L(l,G(t.doc))}return c&&(l="SCRIPT_PLACEHOLDER"),!u&&!c&&l&&i&&(l=n?n(l,b.parentElement(e)):l.replace(/[\S]/g,"*")),{type:h.Text,textContent:l||"",isStyle:u,rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:u,rootId:m});case e.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case e.COMMENT_NODE:return{type:h.Comment,textContent:b.textContent(e)||"",rootId:m};default:return!1}}(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:j,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:O,newlyAddedElement:P});if(!U)return console.warn(e,"not serialized"),null;z=i.hasNode(e)?i.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&&(Q(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Q(e.attributes.name)||"icon"===Q(e.attributes.rel)||"apple-touch-icon"===Q(e.attributes.rel)||"shortcut icon"===Q(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Q(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Q(e.attributes.property).match(/^(og|twitter|fb):/)||Q(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Q(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Q(e.attributes.name)||"googlebot"===Q(e.attributes.name)||"bingbot"===Q(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Q(e.attributes.name)||"generator"===Q(e.attributes.name)||"framework"===Q(e.attributes.name)||"publisher"===Q(e.attributes.name)||"progid"===Q(e.attributes.name)||Q(e.attributes.property).match(/^article:/)||Q(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Q(e.attributes.name)||"yandex-verification"===Q(e.attributes.name)||"csrf-token"===Q(e.attributes.name)||"p:domain_verify"===Q(e.attributes.name)||"verify-v1"===Q(e.attributes.name)||"verification"===Q(e.attributes.name)||"shopify-checkout-api-token"===Q(e.attributes.name)))return!0}}return!1}(U,f)&&(V||U.type!==h.Text||U.isStyle||U.textContent.replace(/^\s+|\s+$/gm,"").length)?H():Z;var Y=Object.assign(U,{id:z});if(i.add(e,Y),z===Z)return null;y&&y(e);var J=!l;if(Y.type===h.Element){J=J&&!Y.needBlock,delete Y.needBlock;var te=b.shadowRoot(e);te&&I(te)&&(Y.isShadowHost=!0)}if((Y.type===h.Document||Y.type===h.Element)&&J){f.headWhitespace&&Y.type===h.Element&&"head"===Y.tagName&&(V=!1);var re={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:j,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:V,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:O};if(Y.type===h.Element&&"textarea"===Y.tagName&&void 0!==Y.attributes.value);else for(var ie of Array.from(b.childNodes(e))){var ne=ee(ie,re);ne&&Y.childNodes.push(ne)}var se=null;if(w(e)&&(se=b.shadowRoot(e)))for(var oe of Array.from(b.childNodes(se))){var ae=ee(oe,re);ae&&(I(se)&&(ae.isShadow=!0),Y.childNodes.push(ae))}}var le=b.parentNode(e);return le&&_(le)&&I(le)&&(Y.isShadow=!0),Y.type===h.Element&&"iframe"===Y.tagName&&function(e,t,r){var i=e.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(e){return}if("complete"===n){var o="about:blank";if(i.location.href!==o||e.src===o||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout((()=>{s||(t(),s=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(a),s=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&S){var r=ee(t,{doc:t,mirror:i,blockClass:n,blockSelector:s,needsMask:j,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:V,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:O});r&&S(e,r)}}),k),Y.type===h.Element&&"link"===Y.tagName&&"string"==typeof Y.attributes.rel&&("stylesheet"===Y.attributes.rel||"preload"===Y.attributes.rel&&"string"==typeof Y.attributes.href&&"css"===N(Y.attributes.href))&&function(e,t,r){var i,n=!1;try{i=e.sheet}catch(e){return}if(!i){var s=setTimeout((()=>{n||(t(),n=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(s),n=!0,t()}))}}(e,(()=>{if(M){var t=ee(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:j,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:V,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:O});t&&M(e,t)}}),F),Y}let te=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 re={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ie={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ne={};function se(e){if(ne[e])return ne[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in re?re[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in ie?ie[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return ne[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 u=l[e].prototype;return document.body.removeChild(a),u?ne[e]=u:r}catch(e){return r}}var oe={};function ae(e,t,r){var i,n=e+"."+String(r);if(oe[n])return oe[n].call(t);var s=se(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(oe[n]=o,o.call(t)):t[r]}var le={};function ue(e,t,r){var i=e+"."+String(r);if(le[i])return le[i].bind(t);var n=se(e)[r];return"function"!=typeof n?t[r]:(le[i]=n,n.bind(t))}function he(){return se("MutationObserver").constructor}var ce={childNodes:e=>ae("Node",e,"childNodes"),parentNode:e=>ae("Node",e,"parentNode"),parentElement:e=>ae("Node",e,"parentElement"),textContent:e=>ae("Node",e,"textContent"),contains:(e,t)=>ue("Node",e,"contains")(t),getRootNode:e=>ue("Node",e,"getRootNode")(),host:e=>e&&"host"in e?ae("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?ae("Element",e,"shadowRoot"):null,querySelector:(e,t)=>ae("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>ae("Element",e,"querySelectorAll")(t),mutationObserver:he};function de(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)}var ve="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.",fe={map:{},getId(){return console.error(ve),-1},getNode(){return console.error(ve),null},removeNodeFromMap(){console.error(ve)},has(){return console.error(ve),!1},reset(){console.error(ve)}};function pe(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),h=this;0>=u||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,o)}),u))}}function ge(e,t,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,i?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>ge(e,t,s||{},!0)}function me(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(fe=new Proxy(fe,{get(e,t,r){return"map"===t&&console.error(ve),Reflect.get(e,t,r)}}));var ye=Date.now;function be(e){var t,r,i,n,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=ce.parentElement(s.body))?void 0:t.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=ce.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function we(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _e(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ie(e){return e?e.nodeType===e.ELEMENT_NODE?e:ce.parentElement(e):null}function Ce(e,t,r,i){if(!e)return!1;var n=Ie(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(J(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Se(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===Z}function xe(e,t){if(_(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=ce.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||xe(i,t))}function ke(e){return Boolean(e.changedTouches)}function Te(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 Ee(e){return!!e&&(e instanceof te&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ce.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ye=()=>(new Date).getTime());let Re=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(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 Ne(e){var t,r=null;return"getRootNode"in e&&(null==(t=ce.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ce.host(ce.getRootNode(e))&&(r=ce.host(ce.getRootNode(e))),r}function Me(e){var t=e.ownerDocument;return!!t&&(ce.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Ne(r);)r=t;return r}(e);return ce.contains(t,r)}(e))}var Fe=(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))(Fe||{}),Oe=(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))(Oe||{}),Pe=(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))(Pe||{}),Le=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Le||{}),De=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(De||{}),Be=(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))(Be||{});function je(e){return"__ln"in e}class $e{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;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&&je(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&&je(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.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 qe,Ze=(e,t)=>e+"@"+t;class He{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new $e,i=e=>{for(var t=e,r=Z;r===Z;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var s=ce.parentNode(n);if(s&&Me(n)&&"TEXTAREA"!==s.tagName){var o=_(s)?this.mirror.getId(Ne(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=ee(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Te(e,this.mirror)&&this.iframeManager.addIframe(e),Ae(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ee(n)&&this.shadowDomManager.addShadowRoot(ce.shadowRoot(n),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:o,nextId:a,node:l}),t.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)ze(this.removes,s,this.mirror)&&!this.movedSet.has(ce.parentNode(s))||n(s);for(var o of this.addedSet)Ue(this.droppedSet,o)||ze(this.removes,o,this.mirror)?Ue(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(ce.parentNode(a.value)),h=i(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(ce.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){l=d;break}var f=ce.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=ce.host(f);if(-1!==this.mirror.getId(p)){l=d;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((e=>{var t=e.node,r=ce.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),i=JSON.stringify(e._unchangedStyles);t.style.length>r.length&&(r+i).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};(g.texts.length||g.attributes.length||g.removes.length||g.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(g))}})),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t)),t.attributes.value=Array.from(ce.childNodes(e),(e=>ce.textContent(e)||"")).join("")})),a(this,"processMutation",(e=>{if(!Se(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=ce.textContent(e.target);Ce(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:K(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ie(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,n=e.target.getAttribute(i);if("value"===i){var s=R(r);n=T({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Ce(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;var o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!X(r.tagName,i))if(o.attributes[i]=W(this.doc,A(r.tagName),A(i),n),"style"===i){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 u=r.style.getPropertyValue(l),h=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||h!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===h?u:[u,h]:o._unchangedStyles[l]=[u,h]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(o.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ce(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),i=_(e.target)?this.mirror.getId(ce.host(e.target)):this.mirror.getId(e.target);Ce(e.target,this.blockClass,this.blockSelector,!1)||Se(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ve(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||xe(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ze(r,i)]?Ve(this.movedSet,t):this.removes.push({parentId:i,id:r,isShadow:!(!_(e.target)||!I(e.target))||void 0})),this.mapRemoves.push(t))}))}})),a(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Se(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);Ce(e,this.blockClass,this.blockSelector,!1)||(ce.childNodes(e).forEach((e=>this.genAdds(e))),Ee(e)&&ce.childNodes(ce.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 Ve(e,t){e.delete(t),ce.childNodes(t).forEach((t=>Ve(e,t)))}function ze(e,t,r){return 0!==e.length&&function(e,t,r){for(var i,n=ce.parentNode(t),s=function(){var t=r.getId(n);if(e.some((e=>e.id===t)))return{v:!0};n=ce.parentNode(n)};n;)if(i=s())return i.v;return!1}(e,t,r)}function Ue(e,t){return 0!==e.size&&Ye(e,t)}function Ye(e,t){var r=ce.parentNode(t);return!!r&&(!!e.has(r)||Ye(e,r))}var Ge=e=>qe?function(){try{return e(...arguments)}catch(e){if(qe&&!0===qe(e))return;throw e}}:e,We=[];function Xe(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 Je(e,t){var r=new He;We.push(r),r.init(e);var i=new(he())(Ge(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Ke(e){var{scrollCb:t,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=e;return de("scroll",Ge(pe(Ge((e=>{var o=Xe(e);if(o&&!Ce(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var l=be(r.defaultView);t({id:a,x:l.left,y:l.top})}else t({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),r)}var Qe=["INPUT","TEXTAREA","SELECT"],et=new WeakMap;function tt(e){return function(e,t){if(st("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||st("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||st("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||st("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var i=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(i)}return t}(e,[])}function rt(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}function it(e,t){var r,i,n,s,{mirror:o,stylesheetManager:a}=e;s=o.getId("#document"===t.nodeName?t:ce.host(t));var l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&l&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r=null==(t=u.set)?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(e){}return r}}),Ge((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function nt(e,t){void 0===t&&(t={});var i,n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:h,canvasMutationCb:c,fontCb:d,selectionCb:v,customElementCb:f}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),n(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),s(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...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),u(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),h(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),c(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),d(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM&&(i=Je(e,e.doc));var s=function(e){var{mousemoveCb:t,sampling:r,doc:i,mirror:n}=e;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],u=pe(Ge((e=>{var r=Date.now()-s;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],s=null})),a),h=Ge(pe(Ge((e=>{var t=Xe(e),{clientX:r,clientY:i}=ke(e)?e.changedTouches[0]:e;s||(s=ye()),l.push({x:r,y:i,id:n.getId(t),timeOffset:ye()-s}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?Oe.Drag:e instanceof MouseEvent?Oe.MouseMove:Oe.TouchMove)})),o,{trailing:!1})),c=[de("mousemove",h,i),de("touchmove",h,i),de("drag",h,i)];return Ge((()=>{c.forEach((e=>e()))}))}(e),o=function(e){var{mouseInteractionCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(Pe).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=A(e),l=(e=>i=>{var a=Xe(i);if(!Ce(a,s,o,!0)){var l=null,u=e;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Le.Mouse;break;case"touch":l=Le.Touch;break;case"pen":l=Le.Pen}l===Le.Touch&&(Pe[e]===Pe.MouseDown?u="TouchStart":Pe[e]===Pe.MouseUp&&(u="TouchEnd"))}else ke(i)&&(l=Le.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Le.Touch||u.startsWith("Mouse")&&l===Le.Mouse)&&(l=null)):Pe[e]===Pe.Click&&(l=h,h=null);var c=ke(i)?i.changedTouches[0]:i;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Ge(t)(r({type:Pe[u],id:d,x:v,y:f},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(Pe[e]){case Pe.MouseDown:case Pe.MouseUp:a=a.replace("mouse","pointer");break;case Pe.TouchStart:case Pe.TouchEnd:return}u.push(de(a,l,i))})),Ge((()=>{u.forEach((e=>e()))}))}(e),a=Ke(e),l=function(e,t){var{viewportResizeCb:r}=e,{win:i}=t,n=-1,s=-1;return de("resize",Ge(pe(Ge((()=>{var e=we(),t=_e();n===e&&s===t||(r({width:Number(t),height:Number(e)}),n=e,s=t)})),200)),i)}(e,{win:n}),u=function(e){var{inputCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=e;function v(e){var t=Xe(e),r=e.isTrusted,n=t&&t.tagName;if(t&&"OPTION"===n&&(t=ce.parentElement(t)),t&&n&&Qe.indexOf(n)>=0&&!Ce(t,s,o,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var c=t.value,v=!1,p=R(t)||"";"radio"===p||"checkbox"===p?v=t.checked:(u[n.toLowerCase()]||u[p])&&(c=T({element:t,maskInputOptions:u,tagName:n,type:p,value:c,maskInputFn:h})),f(t,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=t.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((e=>{if(e!==t){var r=e.value;f(e,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(e,i){var s=et.get(e);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){et.set(e,i);var o=n.getId(e);Ge(t)(r({},i,{id:o}))}}var p=("last"===c.input?["change"]:["input","change"]).map((e=>de(e,Ge(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((e=>e()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value");return m&&m.set&&p.push(...[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]].map((e=>ge(e[0],e[1],{set(){Ge(v)({target:this,isTrusted:!1})}},!1,g)))),Ge((()=>{p.forEach((e=>e()))}))}(e),h=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=e,a=Ge((e=>pe(Ge((s=>{var o=Xe(s);if(o&&!Ce(o,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:h,loop:c}=o;t({type:e,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:c})}})),s.media||500))),l=[de("play",a(Be.Play),o),de("pause",a(Be.Pause),o),de("seeked",a(Be.Seeked),o),de("volumechange",a(Be.VolumeChange),o),de("ratechange",a(Be.RateChange),o)];return Ge((()=>{l.forEach((e=>e()))}))}(e),c=()=>{},d=()=>{},v=()=>{},f=()=>{};e.recordDOM&&(c=function(e,t){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=e,{win:s}=t;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ge(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=rt(t,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:a}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Ge(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:o}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(e){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ge(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replace:o}),e.apply(t,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ge(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:o}),e.apply(t,s)}))}));var h={};ot("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(ot("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),ot("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),ot("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var c={};return Object.entries(h).forEach((e=>{var[t,s]=e;c[t]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[t].insertRule,{apply:Ge(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=rt(t.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:[...tt(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(c[t].deleteRule,{apply:Ge(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(t.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...tt(t),o]}]}),e.apply(t,s)}))})})),Ge((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((e=>{var[t,r]=e;r.prototype.insertRule=c[t].insertRule,r.prototype.deleteRule=c[t].deleteRule}))}))}(e,{win:n}),d=it(e,e.doc),v=function(e,t){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=e,{win:o}=t,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ge(((e,t,o)=>{var l,[u,h,c]=o;if(n.has(u))return a.apply(t,[u,h,c]);var{id:d,styleId:v}=rt(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror);return(d&&-1!==d||v&&-1!==v)&&r({id:d,styleId:v,set:{property:u,value:h,priority:c},index:tt(t.parentRule)}),e.apply(t,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ge(((e,t,o)=>{var a,[u]=o;if(n.has(u))return l.apply(t,[u]);var{id:h,styleId:c}=rt(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||c&&-1!==c)&&r({id:h,styleId:c,remove:{property:u},index:tt(t.parentRule)}),e.apply(t,o)}))}),Ge((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(f=function(e){var{fontCb:t,doc:r}=e,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(e,t,r){var i=new o(e,t,r);return s.set(i,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var a=me(r.fonts,"add",(function(e){return function(r){return setTimeout(Ge((()=>{var e=s.get(r);e&&(t(e),s.delete(r))})),0),e.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Ge((()=>{n.forEach((e=>e()))}))}(e)));var p=function(e){var{doc:t,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=e,o=!0,a=Ge((()=>{var e=t.getSelection();if(!(!e||o&&(null==e?void 0:e.isCollapsed))){o=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,u=0;l>u;u++){var h=e.getRangeAt(u),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;Ce(c,i,n,!0)||Ce(v,i,n,!0)||a.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),de("selectionchange",a)}(e),g=function(e){var{doc:t,customElementCb:r}=e,i=t.defaultView;return i&&i.customElements?me(i.customElements,"define",(function(e){return function(t,i,n){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,i,n])}})):()=>{}}(e),m=[];for(var y of e.plugins)m.push(y.observer(y.callback,n,y.options));return Ge((()=>{We.forEach((e=>e.reset())),null==i||i.disconnect(),s(),o(),a(),l(),u(),h(),c(),d(),v(),f(),p(),g(),m.forEach((e=>e()))}))}function st(e){return void 0!==window[e]}function ot(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class at{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){var n=r||this.getIdToRemoteIdMap(e),s=i||this.getRemoteIdToIdMap(e),o=n.get(t);return o||(o=this.generateIdFn(),n.set(t,o),s.set(o,t)),o}getIds(e,t){var r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i=r||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:i.get(t)||-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||this.iframeIdToRemoteIdMap.set(e,t=new Map),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||this.iframeRemoteIdToIdMap.set(e,t=new Map),t}}class lt{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new at(H)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new at(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,i;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==(i=this.loadListener)||i.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 i=this.transformCrossOriginEvent(r,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case Fe.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:Fe.IncrementalSnapshot,data:{source:Oe.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Fe.Meta:case Fe.Load:case Fe.DomContentLoaded:return!1;case Fe.Plugin:return t;case Fe.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Fe.IncrementalSnapshot:switch(t.data.source){case Oe.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 Oe.Drag:case Oe.TouchMove:case Oe.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Oe.ViewportResize:return!1;case Oe.MediaInteraction:case Oe.MouseInteraction:case Oe.Scroll:case Oe.CanvasMutation:case Oe.Input:return this.replaceIds(t.data,e,["id"]),t;case Oe.StyleSheetRule:case Oe.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Oe.Font:return t;case Oe.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Oe.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,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(t[n]=Array.isArray(t[n])?e.getIds(r,t[n]):e.getId(r,t[n]));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 ut{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(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,t){if(I(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var i=Je(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(Ke(r({},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(ce.host(e))),this.restoreHandlers.push(it({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(me(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),s=ce.shadowRoot(this);return s&&Me(this)&&r.addShadowRoot(s,t),n}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ct="undefined"==typeof Uint8Array?[]:new Uint8Array(256),dt=0;64>dt;dt++)ct[ht.charCodeAt(dt)]=dt;var vt=new Map,ft=(e,t,r)=>{if(e&&(mt(e,t)||"object"==typeof e)){var i=function(e,t){var r=vt.get(e);return r||vt.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function pt(e,t,r){if(e instanceof Array)return e.map((e=>pt(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),i=r.length,n="";for(t=0;i>t;t+=3)n+=ht[r[t]>>2],n+=ht[(3&r[t])<<4|r[t+1]>>4],n+=ht[(15&r[t+1])<<2|r[t+2]>>6],n+=ht[63&r[t+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[pt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var i=e.constructor.name,{src:n}=e;return{rr_type:i,src:n}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[pt(e.data,t,r),e.width,e.height]}:mt(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:ft(e,t,r)}:e}var gt=(e,t,r)=>e.map((e=>pt(e,t,r))),mt=(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 yt(e,t,r,i){var n=[];try{var s=me(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;s>a;a++)o[a-1]=arguments[a];if(!Ce(this,t,r,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(n);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...o])}}));n.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((e=>e()))}}function bt(e,t,r,i,n,s){var o=[],a=Object.getOwnPropertyNames(e),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof e[a])return 0;var l=me(e,a,(function(e){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];var h=e.apply(this,l);if(ft(h,s,this),"tagName"in this.canvas&&!Ce(this.canvas,i,n,!0)){var c=gt(l,s,this);r(this.canvas,{type:t,property:a,args:c})}return h}}));o.push(l)}catch(i){var u=ge(e,a,{set(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});o.push(u)}};for(var u of a)l(u);return o}var wt,_t,It,Ct,St="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",xt="undefined"!=typeof window&&window.Blob&&new Blob([(wt=St,Uint8Array.from(atob(wt),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function kt(e){var t;try{if(!(t=xt&&(window.URL||window.webkitURL).createObjectURL(xt)))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,"+St,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Tt{constructor(e){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"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:i,blockSelector:n,recordCanvas:s,dataURLOptions:o}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(r,i,n),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:o})}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,r,i,n,s){var o=this,a=yt(r,i,n,!0),l=new Map,u=new kt;u.onmessage=e=>{var{id:t}=e.data;if(l.set(t,!1),"base64"in e.data){var{base64:r,type:i,width:n,height:s}=e.data;this.mutationCb({id:t,type:De["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var h,c=1e3/e,d=0,v=e=>{var a,f;d&&c>e-d||(d=e,(a=[],f=e=>{e.querySelectorAll("canvas").forEach((e=>{Ce(e,i,n,!0)||a.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&f(e.shadowRoot)}))},f(r.document),a).forEach(function(){var e=t((function*(e){var t,r=o.mirror.getId(e);if(!l.get(r)&&0!==e.width&&0!==e.height){if(l.set(r,!0),["webgl","webgl2"].includes(e.__context)){var i=e.getContext(e.__context);!1===(null==(t=null==i?void 0:i.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=e.clientWidth||e.width,a=e.clientHeight||e.height,h=yield createImageBitmap(e,{resizeWidth:n,resizeHeight:a});u.postMessage({id:r,bitmap:h,width:n,height:a,dataURLOptions:s.dataURLOptions},[h])}}));return function(t){return e.apply(this,arguments)}}())),h=requestAnimationFrame(v)};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=yt(e,t,r,!1),n=function(e,t,r,i){var n=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),o=function(s){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])return 1;var o=me(t.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];return Ce(this.canvas,r,i,!0)||setTimeout((()=>{var r=gt(a,t,this);e(this.canvas,{type:De["2D"],property:s,args:r})}),0),n.apply(this,a)}}));n.push(o)}catch(r){var a=ge(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:De["2D"],property:s,args:[t],setter:!0})}});n.push(a)}};for(var a of s)o(a);return()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),s=function(e,t,r,i){var n=[];return n.push(...bt(t.WebGLRenderingContext.prototype,De.WebGL,e,r,i,t)),void 0!==t.WebGL2RenderingContext&&n.push(...bt(t.WebGL2RenderingContext.prototype,De.WebGL2,e,r,i,t)),()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),s()}}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=>i(e,s))),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class At{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Re),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 i={id:t,styleIds:[]},n=[],s=function(e){var t;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),n.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:S(t,e.href),index:r})))})),i.styleIds.push(t)};for(var o of e)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Et{constructor(){a(this,"nodeMap",new WeakMap),a(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 Rt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Nt=document.createElement("iframe");document.body.appendChild(Nt),Array.from=(null==(n=Nt.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Nt)}}catch(e){console.debug("Unable to override Array.from",e)}var Mt,Ft,Ot=new k;function Pt(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:h=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:g,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:_,recordDOM:I=!0,recordCanvas:C=!1,recordCrossOriginIframes:S=!1,recordAfter:x=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:T=!1,collectFonts:A=!1,inlineImages:E=!1,plugins:R,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:M=new Set([]),errorHandler:F}=e;qe=F;var O=!S||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(e){P=!0}if(O&&!t)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==_&&void 0===b.mousemove&&(b.mousemove=_),Ot.reset();var L,D=!0===d?{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!==v?v:{password:!0},B=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var j=0,q=e=>{for(var t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!P&&(e=y(e)),e};_t=(e,r)=>{var s,o=e;if(o.timestamp=ye(),!(null==(s=We[0])?void 0:s.isFrozen())||o.type===Fe.FullSnapshot||o.type===Fe.IncrementalSnapshot&&o.data.source===Oe.Mutation||We.forEach((e=>e.unfreeze())),O)null==t||t(q(o),r);else if(P){var a={type:"rrweb",event:q(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===Fe.FullSnapshot)L=o,j=0;else if(o.type===Fe.IncrementalSnapshot){if(o.data.source===Oe.Mutation&&o.data.isAttachIframe)return;j++,(n&&j>=n||i&&o.timestamp-L.timestamp>i)&&It(!0)}};var Z=e=>{_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.Mutation},e)})},H=e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.Scroll},e)}),V=e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.CanvasMutation},e)}),z=new At({mutationCb:Z,adoptedStyleSheetCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.AdoptedStyleSheet},e)})}),U=new lt({mirror:Ot,mutationCb:Z,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:_t});for(var Y of R||[])Y.getMirror&&Y.getMirror({nodeMirror:Ot,crossOriginIframeMirror:U.crossOriginIframeMirror,crossOriginIframeStyleMirror:U.crossOriginIframeStyleMirror});var G=new Et;Ct=new Tt({recordCanvas:C,mutationCb:V,win:window,blockClass:s,blockSelector:o,mirror:Ot,sampling:b.canvas,dataURLOptions:w});var W=new ut({mutationCb:Z,scrollCb:H,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:p,recordCanvas:C,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:U,stylesheetManager:z,canvasManager:Ct,keepIframeSrcFn:N,processedNodeManager:G},mirror:Ot});It=function(e){if(void 0===e&&(e=!1),I){_t({type:Fe.Meta,data:{href:window.location.href,width:_e(),height:we()}},e),z.reset(),W.init(),We.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new k,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:h=!1,maskTextFn:c,maskInputFn:d,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_=(()=>!1)}=t||{};return ee(e,{doc:e,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_,newlyAddedElement:!1})}(document,{mirror:Ot,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:w,recordCanvas:C,inlineImages:E,onSerialize(e){Te(e,Ot)&&U.addIframe(e),Ae(e,Ot)&&z.trackLinkElement(e),Ee(e)&&W.addShadowRoot(ce.shadowRoot(e),document)},onIframeLoad(e,t){U.attachIframe(e,t),W.observeAttachShadow(e)},onStylesheetLoad(e,t){z.attachLinkElement(e,t)},keepIframeSrcFn:N});if(!t)return console.warn("Failed to snapshot the document");_t({type:Fe.FullSnapshot,data:{node:t,initialOffset:be(window)}},e),We.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Ot.getId(document))}};try{var X=[],J=e=>{var t;return Ge(nt)({mutationCb:Z,mousemoveCb:(e,t)=>_t({type:Fe.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.MouseInteraction},e)}),scrollCb:H,viewportResizeCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.ViewportResize},e)}),inputCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.Input},e)}),mediaInteractionCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.MediaInteraction},e)}),styleSheetRuleCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.StyleSheetRule},e)}),styleDeclarationCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.StyleDeclaration},e)}),canvasMutationCb:V,fontCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.Font},e)}),selectionCb(e){_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.Selection},e)})},customElementCb(e){_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.CustomElement},e)})},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:h,maskInputOptions:D,inlineStylesheet:c,sampling:b,recordDOM:I,recordCanvas:C,inlineImages:E,userTriggeredOnInput:T,collectFonts:A,doc:e,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:o,slimDOMOptions:B,dataURLOptions:w,mirror:Ot,iframeManager:U,stylesheetManager:z,shadowDomManager:W,processedNodeManager:G,canvasManager:Ct,ignoreCSSAttributes:M,plugins:(null==(t=null==R?void 0:R.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>_t({type:Fe.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};U.addLoadListener((e=>{try{X.push(J(e.contentDocument))}catch(e){console.warn(e)}}));var K=()=>{It(),X.push(J(document)),Rt=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(de("DOMContentLoaded",(()=>{_t({type:Fe.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&K()}))),X.push(de("load",(()=>{_t({type:Fe.Load,data:{}}),"load"===x&&K()}),window))),()=>{X.forEach((e=>e())),G.destroy(),Rt=!1,qe=void 0}}catch(e){console.warn(e)}}Pt.addCustomEvent=(e,t)=>{if(!Rt)throw new Error("please add custom event after start recording");_t({type:Fe.Custom,data:{tag:e,payload:t}})},Pt.freezePage=()=>{We.forEach((e=>e.freeze()))},Pt.takeFullSnapshot=e=>{if(!Rt)throw new Error("please take full snapshot after start recording");It(e)},Pt.mirror=Ot,(Ft=Mt||(Mt={}))[Ft.NotStarted=0]="NotStarted",Ft[Ft.Running=1]="Running",Ft[Ft.Stopped=2]="Stopped";var Lt,Dt=Object.defineProperty,Bt=(e,t,r)=>((e,t,r)=>t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),jt=Object.defineProperty,$t=(e,t,r)=>((e,t,r)=>t in e?jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),qt=Object.defineProperty,Zt=(e,t,r)=>((e,t,r)=>t in e?qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ht={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Vt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},zt={};function Ut(e){if(zt[e])return zt[e];var t=globalThis[e],r=t.prototype,i=e in Ht?Ht[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in Vt?Vt[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return zt[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 u=l[e].prototype;return document.body.removeChild(a),u?zt[e]=u:r}catch(e){return r}}var Yt={};function Gt(e,t,r){var i,n=e+"."+String(r);if(Yt[n])return Yt[n].call(t);var s=Ut(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Yt[n]=o,o.call(t)):t[r]}var Wt={};function Xt(e,t,r){var i=e+"."+String(r);if(Wt[i])return Wt[i].bind(t);var n=Ut(e)[r];return"function"!=typeof n?t[r]:(Wt[i]=n,n.bind(t))}var Jt={childNodes:e=>Gt("Node",e,"childNodes"),parentNode:e=>Gt("Node",e,"parentNode"),parentElement:e=>Gt("Node",e,"parentElement"),textContent:e=>Gt("Node",e,"textContent"),contains:(e,t)=>Xt("Node",e,"contains")(t),getRootNode:e=>Xt("Node",e,"getRootNode")(),host:e=>e&&"host"in e?Gt("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?Gt("Element",e,"shadowRoot"):null,querySelector:(e,t)=>Gt("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>Gt("Element",e,"querySelectorAll")(t),mutationObserver:()=>Ut("MutationObserver").constructor};function Kt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Kt(Jt.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&Kt(Jt.parentNode(e),t,r)}class Qt{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 Qt))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 er={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},tr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},rr={};function ir(e){if(rr[e])return rr[e];var t=globalThis[e],r=t.prototype,i=e in er?er[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in tr?tr[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return rr[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 u=l[e].prototype;return document.body.removeChild(a),u?rr[e]=u:r}catch(e){return r}}var nr={};function sr(e,t,r){var i,n=e+"."+String(r);if(nr[n])return nr[n].call(t);var s=ir(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(nr[n]=o,o.call(t)):t[r]}var or={};function ar(e,t,r){var i=e+"."+String(r);if(or[i])return or[i].bind(t);var n=ir(e)[r];return"function"!=typeof n?t[r]:(or[i]=n,n.bind(t))}var lr={childNodes:e=>sr("Node",e,"childNodes"),parentNode:e=>sr("Node",e,"parentNode"),parentElement:e=>sr("Node",e,"parentElement"),textContent:e=>sr("Node",e,"textContent"),contains:(e,t)=>ar("Node",e,"contains")(t),getRootNode:e=>ar("Node",e,"getRootNode")(),host:e=>e&&"host"in e?sr("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?sr("Element",e,"shadowRoot"):null,querySelector:(e,t)=>sr("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>sr("Element",e,"querySelectorAll")(t),mutationObserver:()=>ir("MutationObserver").constructor},ur="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.",hr={map:{},getId(){return console.error(ur),-1},getNode(){return console.error(ur),null},removeNodeFromMap(){console.error(ur)},has(){return console.error(ur),!1},reset(){console.error(ur)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(hr=new Proxy(hr,{get(e,t,r){return"map"===t&&console.error(ur),Reflect.get(e,t,r)}}));var cr,dr=Date.now;function vr(e){return e?e.nodeType===e.ELEMENT_NODE?e:lr.parentElement(e):null}function fr(e){var t,r=null;return"getRootNode"in e&&(null==(t=lr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&lr.host(lr.getRootNode(e))&&(r=lr.host(lr.getRootNode(e))),r}function pr(e){for(var t,r=e;t=fr(r);)r=t;return r}function gr(e){var t=e.ownerDocument;if(!t)return!1;var r=pr(e);return lr.contains(t,r)}/[1-9][0-9]{12}/.test(Date.now().toString())||(dr=()=>(new Date).getTime());for(var mr=(Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){$t(this,"id",1),$t(this,"styleIDMap",new WeakMap),$t(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 hr},closestElementOfNode:vr,getBaseDimension:function e(t,r){var i,n,s=null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!s||s===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=s.getBoundingClientRect(),a=e(s,r),l=o.height/s.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){var i=t[r[0]];return 1===r.length?i:e(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:pr,getShadowHost:fr,getWindowHeight:()=>window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight,getWindowScroll(e){var t,r,i,n,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=lr.parentElement(s.body))?void 0:t.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=lr.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:()=>window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth,hasShadowRoot:e=>!!e&&(e instanceof Qt&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(lr.shadowRoot(e))),hookSetter:function e(t,r,i,n,s){void 0===s&&(s=window);var o=s.Object.getOwnPropertyDescriptor(t,r);return s.Object.defineProperty(t,r,n?i:{set(e){setTimeout((()=>{i.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>e(t,r,o||{},!0)},inDom(e){var t=e.ownerDocument;return!!t&&(lr.contains(t,e)||gr(e))},isAncestorRemoved:function e(t,r){if(n=(i=t)&&"host"in i&&"mode"in i&&Jt.host(i)||null,Boolean(n&&"shadowRoot"in n&&Jt.shadowRoot(n)===i))return!1;var i,n,s=r.getId(t);if(!r.has(s))return!0;var o=lr.parentNode(t);return(!o||o.nodeType!==t.DOCUMENT_NODE)&&(!o||e(o,r))},isBlocked(e,t,r,i){if(!e)return!1;var n=vr(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(Kt(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:(e,t,r)=>!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e),isSerialized:(e,t)=>-1!==t.getId(e),isSerializedIframe:(e,t)=>Boolean("IFRAME"===e.nodeName&&t.getMeta(e)),isSerializedStylesheet:(e,t)=>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 i=t.children.length-1;i>=0;i--)e(t.children[i],r)},legacy_isTouchEvent:e=>Boolean(e.changedTouches),get nowTimestamp(){return dr},on(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)},patch(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}},polyfill(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)},queueToResolveTrees(e){var t={},r=(e,r)=>{var i={value:e,parent:r,children:[]};return t[e.node.id]=i,i},i=[];for(var n of e){var{nextId:s,parentId:o}=n;if(s&&s in t){var a=t[s];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,r(n,a.parent))}else{var u=i.indexOf(a);i.splice(u,0,r(n,null))}}else if(o in t){var h=t[o];h.children.push(r(n,h))}else i.push(r(n,null))}return i},shadowHostInDom:gr,throttle(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),h=this;0>=u||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,o)}),u))}},uniqueTextMutations(e){for(var t=new Set,r=[],i=e.length;i--;){var n=e[i];t.has(n.id)||(r.push(n),t.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"}))),yr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),br=0;64>br;br++)yr["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(br)]=br;"undefined"!=typeof window&&window.Blob&&new Blob([Uint8Array.from(atob("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo="),(e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var wr=document.createElement("iframe");document.body.appendChild(wr),Array.from=(null==(Lt=wr.contentWindow)?void 0:Lt.Array.from)||Array.from,document.body.removeChild(wr)}}catch(e){console.debug("Unable to override Array.from",e)}new class{constructor(){Zt(this,"idNodeMap",new Map),Zt(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){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}},function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(cr||(cr={}));class _r{constructor(e){Bt(this,"fileName"),Bt(this,"functionName"),Bt(this,"lineNumber"),Bt(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?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Ir=/(^|@)\S+:\d+/,Cr=/^\s*at .*(\S+:\d+|\(native\))/m,Sr=/^(eval@)?(\[native code])?$/,xr={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Cr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(Cr)}),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+)\)$)/),i=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new _r({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(Sr)}),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 _r({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new _r({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(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(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new _r({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new _r({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ir)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new _r({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function kr(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(e)+")"),t=r+(t?">"+t:""),e=i}return t}function Tr(e){return"[object Object]"==={}.toString.call(e)}function Ar(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Tr(e[i])&&Ar(e[i],t-1))return!0;return!1}function Er(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var i=[],n=[];return JSON.stringify(e,(function(e,t){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,e):n.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(Tr(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Tr(o)&&Ar(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var l in t){var u=t[l];a[l]=Array.isArray(u)?kr(u.length?u[0]:null):u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Rr={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 Nr(e,t,r){var i,n=r?Object.assign({},Rr,r):Rr,s=n.logger;if(!s)return()=>{};i="string"==typeof s?t[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=t=>{var r=t.message,i=xr.parse(t.error).map((e=>e.toString())),s=[Er(r,n.stringifyOptions)];e({level:"error",trace:i,payload:s})};t.addEventListener("error",u),l.push((()=>{t.removeEventListener("error",u)}));var h=t=>{var r,i;t.reason instanceof Error?i=[Er("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Er("Uncaught (in promise)",n.stringifyOptions),Er(t.reason,n.stringifyOptions)]);var s=xr.parse(r).map((e=>e.toString()));e({level:"error",trace:s,payload:i})};t.addEventListener("unhandledrejection",h),l.push((()=>{t.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)l.push(d(i,c));return()=>{l.forEach((e=>e()))};function d(t,r){var i=this;return t[r]?mr.patch(t,r,(t=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(t.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=xr.parse(new Error).map((e=>e.toString())).splice(1),c=("assert"===r?l.slice(1):l).map((e=>Er(e,n.stringifyOptions)));o++,n.lengthThreshold>o?e({level:r,trace:h,payload:c}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Er("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}var Mr=e=>({name:"rrweb/console@1",observer:Nr,options:e});function Fr(){return Fr=t((function*(e,r,i){void 0===r&&(r=!0);try{var n=new CompressionStream("gzip"),s=n.writable.getWriter(),o=s.write((new TextEncoder).encode(e)).then((()=>s.close())).catch(function(){var e=t((function*(e){try{yield s.abort(e)}catch(e){}throw e}));return function(t){return e.apply(this,arguments)}}()),a=new Response(n.readable).blob(),[l]=yield Promise.all([a,o]);return l}catch(e){if(null!=i&&i.rethrow)throw e;return r&&console.error("Failed to gzip compress data",e),null}})),Fr.apply(this,arguments)}var Or=["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","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","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","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Pr=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return Or.concat(t).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))},Lr=function(e){return e.MinLength="min_length",e.MaxLength="max_length",e}({}),Dr=["$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 Br(e,t){return-1!==e.indexOf(t)}var jr=function(e){return e.trim()},$r=function(e){return e.replace(/^\$/,"")},qr=Object.prototype,Zr=qr.hasOwnProperty,Hr=qr.toString,Vr=Array.isArray||function(e){return"[object Array]"===Hr.call(e)},zr=e=>"function"==typeof e,Ur=e=>e===Object(e)&&!Vr(e),Yr=e=>{if(Ur(e)){for(var t in e)if(Zr.call(e,t))return!1;return!0}return!1},Gr=e=>void 0===e,Wr=e=>"[object String]"==Hr.call(e),Xr=e=>Wr(e)&&0===e.trim().length,Jr=e=>null===e,Kr=e=>Gr(e)||Jr(e),Qr=e=>"[object Number]"==Hr.call(e)&&e==e,ei=e=>Qr(e)&&e>0,ti=e=>"[object Boolean]"===Hr.call(e),ri=e=>e instanceof FormData;function ii(e){return null===e||"object"!=typeof e}function ni(e,t){return{}.toString.call(e)==="[object "+t+"]"}function si(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var oi=[!0,"true",1,"1","yes"],ai=e=>Br(oi,e),li=[!1,"false",0,"0","no"];function ui(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),Qr(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t>e?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),ui(n||r,t,r,i))}class hi{constructor(e){this.$t={},this.zt=e.zt,this.Ut=ui(e.bucketSize,0,100,e.Gt),this.Wt=ui(e.refillRate,0,this.Ut,e.Gt),this.Xt=ui(e.refillInterval,0,864e5,e.Gt)}Jt(e,t){var r=Math.floor((t-e.lastAccess)/this.Xt);r>0&&(e.tokens=Math.min(e.tokens+r*this.Wt,this.Ut),e.lastAccess=e.lastAccess+r*this.Xt)}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this.$t[i];return n?this.Jt(n,r):this.$t[i]=n={tokens:this.Ut,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this.zt)||t.call(this,e)),0===n.tokens)}stop(){this.$t={}}}var ci,di,vi,fi=(e,t,r)=>{function i(i){for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];t((()=>{(0,r[i])(e,...s)}))}var n={debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i("error",...t)},critical(){for(var t=arguments.length,i=new Array(t),n=0;t>n;n++)i[n]=arguments[n];r.error(e,...i)},createLogger:i=>fi(e+" "+i,t,r)};return n},pi="Mobile",gi="iOS",mi="Android",yi="Tablet",bi=mi+" "+yi,wi="iPad",_i="Apple",Ii=_i+" Watch",Ci="Safari",Si="BlackBerry",xi="Samsung",ki=xi+"Browser",Ti=xi+" Internet",Ai="Chrome",Ei=Ai+" OS",Ri=Ai+" "+gi,Ni="Internet Explorer",Mi=Ni+" "+pi,Fi="Opera",Oi=Fi+" Mini",Pi="Edge",Li="Microsoft "+Pi,Di="Firefox",Bi=Di+" "+gi,ji="Nintendo",$i="PlayStation",qi="Xbox",Zi=mi+" "+pi,Hi=pi+" "+Ci,Vi="Windows",zi=Vi+" Phone",Ui="Nokia",Yi="Ouya",Gi="Generic",Wi=Gi+" "+pi.toLowerCase(),Xi=Gi+" "+yi.toLowerCase(),Ji="Konqueror",Ki="(\\d+(\\.\\d+)?)",Qi=new RegExp("Version/"+Ki),en=new RegExp(qi,"i"),tn=new RegExp($i+" \\w+","i"),rn=new RegExp(ji+" \\w+","i"),nn=new RegExp(Si+"|PlayBook|BB10","i"),sn={"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"},on=function(e,t){return t=t||"",Br(e," OPR/")&&Br(e,"Mini")?Oi:Br(e," OPR/")?Fi:nn.test(e)?Si:Br(e,"IE"+pi)||Br(e,"WPDesktop")?Mi:Br(e,ki)?Ti:Br(e,Pi)||Br(e,"Edg/")?Li:Br(e,"FBIOS")?"Facebook "+pi:Br(e,"UCWEB")||Br(e,"UCBrowser")?"UC Browser":Br(e,"CriOS")?Ri:Br(e,"CrMo")||Br(e,Ai)?Ai:Br(e,mi)&&Br(e,Ci)?Zi:Br(e,"FxiOS")?Bi:Br(e.toLowerCase(),Ji.toLowerCase())?Ji:((e,t)=>t&&Br(t,_i)||function(e){return Br(e,Ci)&&!Br(e,Ai)&&!Br(e,mi)}(e))(e,t)?Br(e,pi)?Hi:Ci:Br(e,Di)?Di:Br(e,"MSIE")||Br(e,"Trident/")?Ni:Br(e,"Gecko")?Di:""},an={[Mi]:[new RegExp("rv:"+Ki)],[Li]:[new RegExp(Pi+"?\\/"+Ki)],[Ai]:[new RegExp("("+Ai+"|CrMo)\\/"+Ki)],[Ri]:[new RegExp("CriOS\\/"+Ki)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ki)],[Ci]:[Qi],[Hi]:[Qi],[Fi]:[new RegExp("(Opera|OPR)\\/"+Ki)],[Di]:[new RegExp(Di+"\\/"+Ki)],[Bi]:[new RegExp("FxiOS\\/"+Ki)],[Ji]:[new RegExp("Konqueror[:/]?"+Ki,"i")],[Si]:[new RegExp(Si+" "+Ki),Qi],[Zi]:[new RegExp("android\\s"+Ki,"i")],[Ti]:[new RegExp(ki+"\\/"+Ki)],[Ni]:[new RegExp("(rv:|MSIE )"+Ki)],Mozilla:[new RegExp("rv:"+Ki)]},ln=function(e,t){var r=on(e,t),i=an[r];if(Gr(i))return null;for(var n=0;i.length>n;n++){var s=e.match(i[n]);if(s)return parseFloat(s[s.length-2])}return null},un=[[new RegExp(qi+"; "+qi+" (.*?)[);]","i"),e=>[qi,e&&e[1]||""]],[new RegExp(ji,"i"),[ji,""]],[new RegExp($i,"i"),[$i,""]],[nn,[Si,""]],[new RegExp(Vi,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[zi,""];if(new RegExp(pi).test(t)&&!/IEMobile\b/.test(t))return[Vi+" "+pi,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=sn[r[1]]||"";return/arm/i.test(t)&&(i="RT"),[Vi,i]}return[Vi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[gi,[e[3],e[4],e[5]||"0"].join(".")]:[gi,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Gr(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+mi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+mi+")","i"),e=>e&&e[2]?[mi,[e[2],e[3],e[4]||"0"].join(".")]:[mi,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ei,""]],[/Linux|debian/i,["Linux",""]]],hn=function(e){return rn.test(e)?ji:tn.test(e)?$i:en.test(e)?qi:new RegExp(Yi,"i").test(e)?Yi:new RegExp("("+zi+"|WPDesktop)","i").test(e)?zi:/iPad/.test(e)?wi:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Ii:nn.test(e)?Si:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Ui,"i").test(e)?Ui:/(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(pi).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)?mi:bi:new RegExp("(pda|"+pi+")","i").test(e)?Wi:new RegExp(yi,"i").test(e)&&!new RegExp(yi+" pc","i").test(e)?Xi:""},cn=function(e,t){var r,i,n,s,o=hn(e);return o===wi||o===bi||"Kobo"===o||"Kindle Fire"===o||o===Xi?yi:o===ji||o===qi||o===$i||o===Yi?"Console":o===Ii?"Wearable":o?pi:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!==(r=null==t?void 0:t.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==t?void 0:t.screenWidth)&&void 0!==i?i:0,null!==(n=null==t?void 0:t.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==t?void 0:t.devicePixelRatio)&&void 0!==s?s:1)?pi:yi:"Desktop"},dn={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},vn=dn.info;function fn(e){if(ti(e))return{boolValue:e};if("number"==typeof e)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if("string"==typeof e)return{stringValue:e};if(Vr(e))return{arrayValue:{values:e.map((e=>fn(e)))}};try{return{stringValue:JSON.stringify(e)}}catch(t){return{stringValue:String(e)}}}function pn(e){var t=[];for(var r in e){var i=e[r];Jr(i)||Gr(i)||t.push({key:r,value:fn(i)})}return t}function gn(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}function mn(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return vi&&r.length===di||(di=r.length,vi=r.reduce(((r,i)=>{ci||(ci={});var n=ci[i];if(n)r[n[0]]=n[1];else for(var s=e(i),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=t[i];if(l&&u){r[l]=u,ci[i]=[l,u];break}}return r}),{})),vi}}class yn{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&Vr(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,n;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),r({},e,{cause:i,stack:n})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var i of r.modifiers)t=yield i(t);return t}))()}convertToExceptionList(e,t){var i,n,s,o={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(n=t.handled)||void 0===n||n,synthetic:null!==(s=e.synthetic)&&void 0!==s&&s}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:mn(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return r({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>n(e,i),next:e=>n(e,i+1)})}}var bn="?";function wn(e,t,r,i,n){var s={platform:e,filename:t,function:"<anonymous>"===r?bn:r,in_app:!0};return Gr(i)||(s.lineno=i),Gr(n)||(s.colno=n),s}var _n=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:bn,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},In=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Cn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Sn=/\((\S*)(?::(\d+))(?::(\d+))\)/,xn=(e,t)=>{var r=In.exec(e);if(r){var[,i,n,s]=r;return wn(t,i,bn,+n,+s)}var o=Cn.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=Sn.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=_n(o[1]||bn,o[2]);return wn(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},kn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Tn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,An=(e,t)=>{var r=kn.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Tn.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],s=r[1]||bn;return[s,n]=_n(s,n),wn(t,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},En=/\(error: (.*)\)/,Rn=50;class Nn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=Wr(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return ni(e,"DOMException")}isDOMError(e){return ni(e,"DOMError")}}class Mn{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class Fn{constructor(){}match(e){return ni(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var On=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Pn{match(e){return"string"==typeof e}coerce(e,t){var r,[i,n]=this.getInfos(e);return{type:null!=i?i:"Error",value:null!=n?n:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,i=e.match(On);return i&&(t=i[1],r=i[2]),[t,r]}}var Ln=["fatal","error","warning","log","info","debug"];function Dn(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(t>=n.length)return i===r.length?n:n.length>t?n.slice(0,t)+"...":n}return""}class Bn{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return si(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Dn(e)}isSeverityLevel(e){return Wr(e)&&!Xr(e)&&Ln.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(r instanceof Error)return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class jn{match(e){return si(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Dn(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class $n{match(e){return ii(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class qn{match(e){return ni(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!si(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return ii(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var Zn="$message",Hn="$timestamp",Vn=new Set([Zn,Hn]),zn={enabled:!0,max_bytes:32768};function Un(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:zn.enabled,max_bytes:Gn(e.max_bytes,zn.max_bytes)}:r({},zn)}class Yn{constructor(e){this.Kt=[],this.Qt=0,this.Bt=Un(e)}setConfig(e){this.Bt=Un(e),this.er()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,((e,r)=>{if("bigint"==typeof r)return r.toString();if("function"!=typeof r&&"symbol"!=typeof r){if(r instanceof Date)return r.toISOString();if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&"object"==typeof r){if(t.has(r))return"[Circular]";t.add(r)}return r}}))}catch(e){return}}(e);if(t)try{var r=JSON.parse(t);if(!Ur(r))return;var i=r,n=i[Zn],s=i[Hn];if(!Wr(n)||0===n.trim().length)return;if(!Wr(s)&&!Qr(s))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var r=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),r=0,i=0;t.length>i;i++)"%"===t[i]?(r+=1,i+=2):r+=1;return r}(t.json);r>this.Bt.max_bytes||(this.Kt.push({step:t.step,bytes:r}),this.Qt+=r,this.er())}}getAttachable(){return this.Kt.map((e=>e.step))}clear(){this.Kt=[],this.Qt=0}size(){return this.Kt.length}er(){for(;this.Qt>this.Bt.max_bytes&&this.Kt.length>0;){var e=this.Kt.shift();e&&(this.Qt-=e.bytes)}}}function Gn(e,t){if(!Qr(e)||e===1/0||e===-1/0)return t;var r=Math.floor(e);return 0>r?t:r}var Wn="undefined"!=typeof window?window:void 0,Xn="undefined"!=typeof globalThis?globalThis:Wn;"undefined"==typeof self&&(Xn.self=Xn),"undefined"==typeof File&&(Xn.File=function(){});var Jn=null==Xn?void 0:Xn.navigator,Kn=null==Xn?void 0:Xn.document,Qn=null==Xn?void 0:Xn.location,es=null==Xn?void 0:Xn.fetch,ts=null!=Xn&&Xn.XMLHttpRequest&&"withCredentials"in new Xn.XMLHttpRequest?Xn.XMLHttpRequest:void 0,rs=null==Xn?void 0:Xn.AbortController,is=null==Xn?void 0:Xn.CompressionStream,ns=null==Jn?void 0:Jn.userAgent,ss=null!=Wn?Wn:{},os=e=>e instanceof Document,as="1.372.6",ls={DEBUG:!1,LIB_VERSION:as,LIB_NAME:"web",JS_SDK_VERSION:as},us=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,i={C(t){if(Wn&&(ls.DEBUG||ss.POSTHOG_DEBUG||r)&&!Gr(Wn.console)&&Wn.console){for(var i=("__rrweb_original__"in Wn.console[t]?Wn.console[t].__rrweb_original__:Wn.console[t]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(e,...s)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.C("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.C("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.C("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.C("error",...t)},critical(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning(e){i.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>us(e+" "+t,r)};return i},hs=us("[PostHog.js]"),cs=hs.createLogger;function ds(e,t){Vr(e)&&e.forEach(t)}function vs(e,t){if(!Kr(e))if(Vr(e))e.forEach(t);else if(ri(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)Zr.call(e,r)&&t(e[r],r)}var fs=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(e[s]=n[s]);return e};function ps(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}var gs=function(e){try{return e()}catch(e){return}},ms=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,r)}catch(e){hs.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),hs.critical(e)}}},ys=function(e){var t={};return vs(e,(function(e,r){(Wr(e)&&e.length>0||Qr(e))&&(t[r]=e)})),t};var bs=["herokuapp.com","vercel.app","netlify.app"];function ws(e){var t=null==e?void 0:e.hostname;if(!Wr(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of bs)if(r===i)return!1;return!0}function _s(e,t,r,i){var{capture:n=!1,passive:s=!0}=null!=i?i:{};null==e||e.addEventListener(t,r,{capture:n,passive:s})}function Is(e){return"ph_toolbar_internal"===e.name}var Cs=e=>{var t=null==Kn?void 0:Kn.createElement("a");return Gr(t)?null:(t.href=e,t)},Ss=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return vs(e,(function(e,t){Gr(e)||Gr(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)},xs=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===t){r=s;break}}if(!Vr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(e){hs.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},ks=function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var c=l[h].split("=");Vr(c)&&(t.includes(c[0])?u.push(c[0]+"="+r):u.push(l[h]))}var d=a;return null!=o&&(d+="?"+u.join("&")),null!=n&&(d+="#"+n),d},Ts=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null};function As(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return zr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}function Es(e,t){var r,i=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),n={hostname:i,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of t.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}var Rs="$people_distinct_id",Ns="$device_id",Ms="__alias",Fs="__timers",Os="$autocapture_disabled_server_side",Ps="$heatmaps_enabled_server_side",Ls="$exception_capture_enabled_server_side",Ds="$error_tracking_suppression_rules",Bs="$error_tracking_capture_extension_exceptions",js="$web_vitals_enabled_server_side",$s="$dead_clicks_enabled_server_side",qs="$product_tours_enabled_server_side",Zs="$web_vitals_allowed_metrics",Hs="$session_recording_remote_config",Vs="$replay_override_sampling",zs="$replay_override_linked_flag",Us="$replay_override_url_trigger",Ys="$replay_override_event_trigger",Gs="$sesid",Ws="$session_is_sampled",Xs="$enabled_feature_flags",Js="$active_feature_flags",Ks="$early_access_features",Qs="$feature_flag_details",eo="$feature_flag_payloads",to="$feature_flag_request_id",ro="$override_feature_flags",io="$override_feature_flag_payloads",no="$stored_person_properties",so="$stored_group_properties",oo="$surveys",ao="$surveys_activated",lo="ph_product_tours",uo="$flag_call_reported",ho="$flag_call_reported_session_id",co="$feature_flag_errors",vo="$feature_flag_evaluated_at",fo="$user_state",po="$client_session_props",go="$capture_rate_limit",mo="$initial_campaign_params",yo="$initial_referrer_info",bo="$initial_person_info",wo="$epp",_o="__POSTHOG_TOOLBAR__",Io="$posthog_cookieless",Co="$sdk_debug_extensions_init_method",So="$sdk_debug_extensions_init_time_ms",xo="$sdk_debug_recording_script_not_loaded",ko="PostHog loadExternalDependency extension not found.",To="on_reject",Ao="always",Eo="anonymous",Ro="identified",No="identified_only",Mo="visibilitychange",Fo="beforeunload",Oo="$pageview",Po="$pageleave",Lo="$identify",Do="$groupidentify",Bo=1,jo=3,$o=11;function qo(e){return e instanceof Element&&(e.id===_o||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Zo(e){return!!e&&e.nodeType===Bo}function Ho(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Vo(e){return!!e&&e.nodeType===jo}function zo(e){return!!e&&e.nodeType===$o&&Zo(e.host)}function Uo(e){return e?jr(e).split(/\s+/):[]}function Yo(e){var t=null==Wn?void 0:Wn.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function Go(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 Uo(t)}function Wo(e){return Kr(e)?null:jr(e).split(/(\s+)/).filter((e=>va(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Xo(e){var t="";return sa(e)&&!oa(e)&&e.childNodes&&e.childNodes.length&&vs(e.childNodes,(function(e){var r;Vo(e)&&e.textContent&&(t+=null!==(r=Wo(e.textContent))&&void 0!==r?r:"")})),jr(t)}function Jo(e){return Gr(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Ko=["a","button","form","input","select","textarea","label"];function Qo(e,t){if(Gr(t))return!0;var r,i=function(e){if(t.some((t=>e.matches(t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}function ea(e){var t=e.parentNode;return!(!t||!Zo(t))&&t}var ta=["next","previous","prev",">","<"],ra=[".ph-no-rageclick",".ph-no-capture"];var ia=e=>!e||Ho(e,"html")||!Zo(e),na=(e,t)=>{if(!Wn||ia(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],n=e;n.parentNode&&!Ho(n,"body");)if(zo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=ea(n);if(!s)break;if(t||Ko.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=Wn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function sa(e){for(var t=e;t.parentNode&&!Ho(t,"body");t=t.parentNode){var r=Go(t);if(Br(r,"ph-sensitive")||Br(r,"ph-no-capture"))return!1}if(Br(Go(e),"ph-include"))return!0;var i=e.type||"";if(Wr(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";return!Wr(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function oa(e){return!!(Ho(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Ho(e,"select")||Ho(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var aa="(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})",la=new RegExp("^(?:"+aa+")$"),ua=new RegExp(aa),ha="\\d{3}-?\\d{2}-?\\d{4}",ca=new RegExp("^("+ha+")$"),da=new RegExp("("+ha+")");function va(e,t){if(void 0===t&&(t=!0),Kr(e))return!1;if(Wr(e)){if(e=jr(e),(t?la:ua).test((e||"").replace(/[- ]/g,"")))return!1;if((t?ca:da).test(e))return!1}return!0}function fa(e){var t=Xo(e);return va(t=(t+" "+pa(e)).trim())?t:""}function pa(e){var t="";return e&&e.childNodes&&e.childNodes.length&&vs(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Xo(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+pa(e)).trim())}catch(e){hs.error("[AutoCapture]",e)}})),t}function ga(e){return e.replace(/"|\\"/g,'\\"')}function ma(e){var t=e.attr__class;return t?Vr(t)?t:Uo(t):void 0}var ya={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","bam.nr-data.net"]},ba=cs("[Recorder]"),wa=e=>"navigation"===e.entryType,_a=e=>"resource"===e.entryType;function Ia(e,t){return!!t&&(ti(t)||t[e])}function Ca(e){var{type:t,recordBody:r,headers:i,url:n}=e;function s(e){var t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),r=t&&i[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}}(n))return!1;if(ti(r))return!0;if(Vr(r))return s(r);var o=r[t];return ti(o)?o:s(o)}function Sa(e,t,r,i,n,s){return xa.apply(this,arguments)}function xa(){return xa=t((function*(e,t,r,i,n,s){if(void 0===s&&(s=0),s>10)return ba.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var s=e.length-1;s>=0;s-=1)if(_a(o=e[s])&&o.initiatorType===t&&(Gr(i)||o.startTime>=i)&&(Gr(n)||n>=o.startTime))return e[s];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*s))),Sa(e,t,r,i,n,s+1))})),xa.apply(this,arguments)}function ka(e){var{body:t,options:r,url:i}=e;if(Kr(t))return null;var{hostname:n,isHostDenied:s}=Es(i,r);if(s)return n+" is in deny list";if(Wr(t))return t;if(os(t))return t.textContent;if(ri(t))return Ss(t);if(Ur(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 Ta=e=>!Jr(e)&&("navigation"===e.entryType||"resource"===e.entryType);function Aa(e){var{entry:t,method:i,status:n,networkRequest:s,isInitial:o,start:a,end:l,url:u,initiatorType:h}=e;a=t?t.startTime:a,l=t?t.responseEnd:l;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[r({},t?t.toJSON():{name:u},{startTime:Gr(a)?void 0:Math.round(a),endTime:Gr(l)?void 0:Math.round(l),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(t?t.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(Ta(t))for(var f of t.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Ea=["video/","audio/"];function Ra(e){return new Promise((t=>{var r=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>t("[SessionReplay] Failed to read body: "+e))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t("[SessionReplay] Failed to read body")}}))}function Na(){return Na=t((function*(e){var{r:t,options:r,url:i}=e,{hostname:n,isHostDenied:s}=Es(i,r);return s?Promise.resolve(n+" is in deny list"):Ra(t)})),Na.apply(this,arguments)}function Ma(){return Ma=t((function*(e){var{r:t,options:r,url:i}=e,n=function(e){var t,{r:r,options:i,url:n}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=Ea.some((e=>null==s?void 0:s.startsWith(e)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:l}=Es(n,i);return l?a+" is in deny list":null}({r:t,options:r,url:i});return Jr(n)?Ra(t):Promise.resolve(n)})),Ma.apply(this,arguments)}var Fa=null;function Oa(e,i,n){if(!("performance"in i))return()=>{};if(Fa)return ba.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},ya,n):ya,o=t=>{var i=[];t.requests.forEach((e=>{var t=s.maskRequestFn(e);t&&i.push(t)})),i.length>0&&e(r({},t,{requests:i}))},a=function(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>wa(e)||_a(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>Aa({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new t.PerformanceObserver((t=>{var i=t.getEntries().filter((e=>wa(e)||_a(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>Aa({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Ia("request",r.recordHeaders),n=Ia("response",r.recordHeaders),s=As(t.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,h){void 0===l&&(l=!0);var c,d,v=this,f=new Request(a),p={},g={},m=v.setRequestHeader.bind(v);v.setRequestHeader=(e,t)=>(g[e]=t,m(e,t)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=e=>(Ca({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=ka({body:e,options:r,url:a})),c=t.performance.now(),y(e));var b=()=>{v.removeEventListener("readystatechange",w),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},w=()=>{if(v.readyState===v.DONE){b(),d=t.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),Ca({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=ka({body:v.response,options:r,url:a})),Sa(t,"xmlhttprequest",f.url,c,d).then((t=>{var r=Aa({entry:t,method:o,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),s.call(v,o,a.toString(),l,u,h)}));return()=>{s()}}(o,i,s),u=function(e,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Ia("request",i.recordHeaders),s=Ia("response",i.recordHeaders),o=As(r,"fetch",(o=>function(){var a=t((function*(t,a){var l,u,h,c=new Request(t,a),d={};try{var v={};c.headers.forEach(((e,t)=>{v[t]=e})),n&&(d.requestHeaders=v),Ca({type:"request",headers:v,url:t,recordBody:i.recordBody})&&(d.requestBody=yield function(e){return Na.apply(this,arguments)}({r:c,options:i,url:t})),u=r.performance.now(),l=yield o(c),h=r.performance.now();var f={};return l.headers.forEach(((e,t)=>{f[t]=e})),s&&(d.responseHeaders=f),Ca({type:"response",headers:f,url:t,recordBody:i.recordBody})&&(d.responseBody=yield function(e){return Ma.apply(this,arguments)}({r:l,options:i,url:t})),l}finally{Sa(r,"fetch",c.url,u,h).then((t=>{var r,i=Aa({entry:t,method:c.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:u,end:h,url:c.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),Fa=()=>{a(),l(),u(),Fa=null}}var Pa=e=>({name:"rrweb/network@1",observer:Oa,options:e});ss.__PosthogExtensions__=ss.__PosthogExtensions__||{},ss.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Mr,getRecordNetworkPlugin:Pa},ss.__PosthogExtensions__.rrweb={record:Pt,version:"v2"},ss.rrweb={record:Pt,version:"v2"},ss.rrwebConsoleRecord={getRecordConsolePlugin:Mr},ss.getRecordNetworkPlugin=Pa;var La,Da,Ba,ja,$a,qa,Za,Ha,Va,za,Ua,Ya,Ga={},Wa=[],Xa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ja=Array.isArray;function Ka(e,t){for(var r in t)e[r]=t[r];return e}function Qa(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function el(e,t,r){var i,n,s,o={};for(s in t)"key"==s?i=t[s]:"ref"==s?n=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?La.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===o[s]&&(o[s]=e.defaultProps[s]);return tl(e,o,i,n,null)}function tl(e,t,r,i,n){var s={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Ba:n,__i:-1,__u:0};return null==n&&null!=Da.vnode&&Da.vnode(s),s}function rl(e){return e.children}function il(e,t){this.props=e,this.context=t}function nl(e,t){if(null==t)return e.__?nl(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?nl(e):null}function sl(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return sl(e)}}function ol(e){(!e.__d&&(e.__d=!0)&&ja.push(e)&&!$.__r++||$a!=Da.debounceRendering)&&(($a=Da.debounceRendering)||qa)($)}function $(){for(var e,t,r,i,n,s,o,a=1;ja.length;)ja.length>a&&ja.sort(Za),e=ja.shift(),a=ja.length,e.__d&&(r=void 0,i=void 0,n=(i=(t=e).__v).__e,s=[],o=[],t.__P&&((r=Ka({},i)).__v=i.__v+1,Da.vnode&&Da.vnode(r),vl(t.__P,r,i,t.__n,t.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?nl(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,pl(s,r,o),i.__e=i.__=null,r.__e!=n&&sl(r)));$.__r=0}function al(e,t,r,i,n,s,o,a,l,u,h){var c,d,v,f,p,g,m,y=i&&i.__k||Wa,b=t.length;for(l=function(e,t,r,i,n){var s,o,a,l,u,h=r.length,c=h,d=0;for(e.__k=new Array(n),s=0;n>s;s++)null!=(o=t[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[s]=tl(null,o,null,null,null):Ja(o)?o=e.__k[s]=tl(rl,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[s]=tl(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[s]=o,l=s+d,o.__=e,o.__b=e.__b+1,a=null,-1!=(u=o.__i=ul(o,r,l,c))&&(c--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?d--:h>n&&d++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?d--:u==l+1?d++:(u>l?d--:d++,o.__u|=4))):e.__k[s]=null;if(c)for(s=0;h>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=nl(a)),yl(a,a));return i}(r,t,y,l,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1==v.__i?Ga:y[v.__i]||Ga,v.__i=c,g=vl(e,v,d,n,s,o,a,l,u,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&ml(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||d.__k===v.__k?l=ll(v,l,e,m):"function"==typeof v.type&&void 0!==g?l=g:f&&(l=f.nextSibling),v.__u&=-7);return r.__e=p,l}function ll(e,t,r,i){var n,s;if("function"==typeof e.type){for(n=e.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=e,t=ll(n[s],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=nl(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function ul(e,t,r,i){var n,s,o,a=e.key,l=e.type,u=t[r],h=null!=u&&0==(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||t.length>s;)if(null!=(u=t[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function hl(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||Xa.test(t)?r:r+"px"}function cl(e,t,r,i,n){var s,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||hl(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||hl(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(Ha,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?i?r.u=i.u:(r.u=Va,e.addEventListener(t,s?Ua:za,s)):e.removeEventListener(t,s?Ua:za,s);else{if("http://www.w3.org/2000/svg"==n)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&&"popover"!=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,"popover"==t&&1==r?"":r))}}function dl(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=Va++;else if(r.u>t.t)return;return r(Da.event?Da.event(t):t)}}}function vl(e,t,r,i,n,s,o,a,l,u){var h,c,d,v,f,p,g,m,y,b,w,$,_,I,C,S,x,k=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=t.__e=r.__e]),(h=Da.__b)&&h(t);e:if("function"==typeof k)try{if(m=t.props,y="prototype"in k&&k.prototype.render,b=(h=k.contextType)&&i[h.__c],w=h?b?b.props.value:h.__:i,r.__c?g=(c=t.__c=r.__c).__=c.__E:(y?t.__c=c=new k(m,w):(t.__c=c=new il(m,w),c.constructor=k,c.render=bl),b&&b.sub(c),c.state||(c.state={}),c.__n=i,d=c.__d=!0,c.__h=[],c._sb=[]),y&&null==c.__s&&(c.__s=c.state),y&&null!=k.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Ka({},c.__s)),Ka(c.__s,k.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=t,d)y&&null==k.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),y&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(y&&null==k.getDerivedStateFromProps&&m!==v&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(m,w),t.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(m,c.__s,w)){for(t.__v!=r.__v&&(c.props=m,c.state=c.__s,c.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),$=0;c._sb.length>$;$++)c.__h.push(c._sb[$]);c._sb=[],c.__h.length&&o.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(m,c.__s,w),y&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(v,f,p)}))}if(c.context=w,c.props=m,c.__P=e,c.__e=!1,_=Da.__r,I=0,y){for(c.state=c.__s,c.__d=!1,_&&_(t),h=c.render(c.props,c.state,c.context),C=0;c._sb.length>C;C++)c.__h.push(c._sb[C]);c._sb=[]}else do{c.__d=!1,_&&_(t),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&25>++I);c.state=c.__s,null!=c.getChildContext&&(i=Ka(Ka({},i),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),S=h,null!=h&&h.type===rl&&null==h.key&&(S=gl(h.props.children)),a=al(e,Ja(S)?S:[S],t,r,i,n,s,o,a,l,u),c.base=t.__e,t.__u&=-161,c.__h.length&&o.push(c),g&&(c.__E=c.__=null)}catch(e){if(t.__v=null,l||null!=s)if(e.then){for(t.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(x=s.length;x--;)Qa(s[x]);fl(t)}else t.__e=r.__e,t.__k=r.__k,e.then||fl(t);Da.__e(e,t,r)}else null==s&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=function(e,t,r,i,n,s,o,a,l){var u,h,c,d,v,f,p,g=r.props||Ga,m=t.props,y=t.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((v=s[u])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){e=v,s[u]=null;break}if(null==e){if(null==y)return document.createTextNode(m);e=document.createElementNS(n,y,m.is&&m),a&&(Da.__m&&Da.__m(t,s),a=!1),s=null}if(null==y)g===m||a&&e.data==m||(e.data=m);else{if(s=s&&La.call(e.childNodes),!a&&null!=s)for(g={},u=0;e.attributes.length>u;u++)g[(v=e.attributes[u]).name]=v.value;for(u in g)if(v=g[u],"children"==u);else if("dangerouslySetInnerHTML"==u)c=v;else if(!(u in m)){if("value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m)continue;cl(e,u,null,v,n)}for(u in m)v=m[u],"children"==u?d=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?f=v:"checked"==u?p=v:a&&"function"!=typeof v||g[u]===v||cl(e,u,v,g[u],n);if(h)a||c&&(h.__html==c.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),al("template"==t.type?e.content:e,Ja(d)?d:[d],t,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&nl(r,0),a,l),null!=s)for(u=s.length;u--;)Qa(s[u]);a||(u="value","progress"==y&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&cl(e,u,f,g[u],n),u="checked",null!=p&&p!=e[u]&&cl(e,u,p,g[u],n))}return e}(r.__e,t,r,i,n,s,o,l,u);return(h=Da.diffed)&&h(t),128&t.__u?void 0:a}function fl(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(fl)}function pl(e,t,r){for(var i=0;r.length>i;i++)ml(r[i],r[++i],r[++i]);Da.__c&&Da.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Da.__e(e,t.__v)}}))}function gl(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:Ja(e)?e.map(gl):Ka({},e)}function ml(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){Da.__e(e,r)}}function yl(e,t,r){var i,n;if(Da.unmount&&Da.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||ml(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Da.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(n=0;i.length>n;n++)i[n]&&yl(i[n],t,r||"function"!=typeof e.type);r||Qa(e.__e),e.__c=e.__=e.__e=void 0}function bl(e,t,r){return this.constructor(e,r)}function wl(e,t,r){var i,n,s;t==document&&(t=document.documentElement),Da.__&&Da.__(e,t),i=t.__k,n=[],s=[],vl(t,e=t.__k=el(rl,null,[e]),i||Ga,Ga,t.namespaceURI,i?null:t.firstChild?La.call(t.childNodes):null,n,i?i.__e:t.firstChild,!1,s),pl(n,e,s)}La=Wa.slice,Da={__e(e,t,r,i){for(var n,s,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},Ba=0,il.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Ka({},this.state),"function"==typeof e&&(e=e(Ka({},r),this.props)),e&&Ka(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),ol(this))},il.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ol(this))},il.prototype.render=rl,ja=[],qa="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Za=function(e,t){return e.__v.__b-t.__v.__b},$.__r=0,Ha=/(PointerCapture)$|Capture$/i,Va=0,za=dl(!1),Ua=dl(!0),Ya=0;var _l,Il,Cl,Sl,xl=0,kl=[],Tl=Da,Al=Tl.__b,El=Tl.__r,Rl=Tl.diffed,Nl=Tl.__c,Ml=Tl.unmount,Fl=Tl.__;function Ol(e,t){Tl.__h&&Tl.__h(Il,e,xl||t),xl=0;var r=Il.__H||(Il.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Pl(e){return xl=1,function(e,t,r){var i=Ol(_l++,2);if(i.t=e,!i.__c&&(i.__=[Ul(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Il,!Il.__f)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(e){return!!e.__c}));if(n.every((function(e){return!e.__N})))return!s||s.call(this,e,t,r);var o=i.__c.props!==e;return n.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),s&&s.call(this,e,t,r)||o};Il.__f=!0;var s=Il.shouldComponentUpdate,o=Il.componentWillUpdate;Il.componentWillUpdate=function(e,t,r){if(this.__e){var i=s;s=void 0,n(e,t,r),s=i}o&&o.call(this,e,t,r)},Il.shouldComponentUpdate=n}return i.__N||i.__}(Ul,e)}function Ll(e,t){var r=Ol(_l++,3);!Tl.__s&&zl(r.__H,t)&&(r.__=e,r.u=t,Il.__H.__h.push(r))}function Dl(e){return xl=5,Bl((function(){return{current:e}}),[])}function Bl(e,t){var r=Ol(_l++,7);return zl(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function jl(e){var t=Il.context[e.__c],r=Ol(_l++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Il)),t.props.value):e.__}function $l(){for(var e;e=kl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Hl),e.__H.__h.forEach(Vl),e.__H.__h=[]}catch(t){e.__H.__h=[],Tl.__e(t,e.__v)}}Tl.__b=function(e){Il=null,Al&&Al(e)},Tl.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Fl&&Fl(e,t)},Tl.__r=function(e){El&&El(e),_l=0;var t=(Il=e.__c).__H;t&&(Cl===Il?(t.__h=[],Il.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(Hl),t.__h.forEach(Vl),t.__h=[],_l=0)),Cl=Il},Tl.diffed=function(e){Rl&&Rl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==kl.push(t)&&Sl===Tl.requestAnimationFrame||((Sl=Tl.requestAnimationFrame)||Zl)($l)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),Cl=Il=null},Tl.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Hl),e.__h=e.__h.filter((function(e){return!e.__||Vl(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Tl.__e(r,e.__v)}})),Nl&&Nl(e,t)},Tl.unmount=function(e){Ml&&Ml(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{Hl(e)}catch(e){t=e}})),r.__H=void 0,t&&Tl.__e(t,r.__v))};var ql="function"==typeof requestAnimationFrame;function Zl(e){var t,r=function(){clearTimeout(i),ql&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);ql&&(t=requestAnimationFrame(r))}function Hl(e){var t=Il,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Il=t}function Vl(e){var t=Il;e.__c=e.__(),Il=t}function zl(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function Ul(e,t){return"function"==typeof t?t(e):t}var Yl="events",Gl="cancelEvents",Wl={Tab:"tab",Selector:"selector"},Xl={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Jl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Kl={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Ql={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},eu={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},tu="always",ru={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},iu={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},nu="popover";function su(e){return"$survey_response_"+e}function ou(e,t){if(!t)return null;var r=e[su(t)];return Vr(r)?[...r]:r}function au(e,t){void 0===e&&(e={});var i={};return t.questions.forEach((t=>{if(!Gr(t.originalQuestionIndex)){var r,n=0===(r=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=ou(e,t.id);Gr(s)||(i[n]=s)}})),r({$survey_questions:t.questions.map((t=>({id:t.id,question:t.question,response:ou(e,t.id)})))},e,i)}function lu(e,t){var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r}var uu,hu,cu=(void 0===uu&&(uu=e=>e()),fi("[SurveyTranslations]",uu,(void 0===hu&&(hu=console),{log:hu.log.bind(hu),warn:hu.warn.bind(hu),error:hu.error.bind(hu),debug:hu.debug.bind(hu)})));function du(e){return"string"==typeof e&&e.trim()?e.trim():null}function vu(e){return e.toLowerCase()}function fu(e,t){if(!e||!t)return null;var r=vu(t),i=Object.keys(e).find((e=>vu(e)===r));if(i)return cu.debug("Found exact translation match: "+i),i;if(r.includes("-")){var n=r.split("-")[0],s=Object.keys(e).find((e=>vu(e)===n));if(s)return cu.debug("Found base language translation match: "+s+" (from "+t+")"),s}return null}function pu(e,t){var i,n=fu(e.translations,t),s=r({},e),o=!1;if(n){var a,l=null==(a=e.translations)?void 0:a[n];l&&(cu.info("Applying survey-level translation for language: "+n),Gr(l.name)||(s.name=l.name,o=!0),s.appearance?(s.appearance=r({},s.appearance),Gr(l.thankYouMessageHeader)||(s.appearance.thankYouMessageHeader=l.thankYouMessageHeader,o=!0),Gr(l.thankYouMessageDescription)||(s.appearance.thankYouMessageDescription=l.thankYouMessageDescription,o=!0),Gr(l.thankYouMessageCloseButtonText)||(s.appearance.thankYouMessageCloseButtonText=l.thankYouMessageCloseButtonText,o=!0)):function(e){return!Gr(e.thankYouMessageHeader)||!Gr(e.thankYouMessageDescription)||!Gr(e.thankYouMessageCloseButtonText)}(l)&&(o=!0))}var u=e.questions.map((e=>function(e,t){var i,n=fu(e.translations,t);if(!n)return{question:e,matchedKey:null,hasChanges:!1};var s=null==(i=e.translations)?void 0:i[n];if(!s)return{question:e,matchedKey:null,hasChanges:!1};var o=r({},e),a=!1;return Gr(s.question)||(o.question=s.question,a=!0),Gr(s.description)||(o.description=s.description,a=!0),Gr(s.buttonText)||(o.buttonText=s.buttonText,a=!0),"link"in o&&!Gr(s.link)&&(o.link=s.link,a=!0),"lowerBoundLabel"in o&&!Gr(s.lowerBoundLabel)&&(o.lowerBoundLabel=s.lowerBoundLabel,a=!0),"upperBoundLabel"in o&&!Gr(s.upperBoundLabel)&&(o.upperBoundLabel=s.upperBoundLabel,a=!0),"choices"in o&&function(e){return Vr(e.choices)}(s)&&(o.choices=s.choices,a=!0),{question:a?o:e,matchedKey:a?n:null,hasChanges:a}}(e,t))),h=u.map((e=>e.question)),c=u.some((e=>e.hasChanges)),d=null;return n||(d=(null==(i=u.find((e=>e.matchedKey)))?void 0:i.matchedKey)||null),c&&(s.questions=h,o=!0,cu.info("Applied question-level translations for language: "+t)),{survey:s,matchedKey:o?n||d:null}}var gu=cs("[Surveys]");function mu(e){return!(!e.start_date||e.end_date)}function yu(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function bu(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var wu="seenSurvey_",_u="inProgressSurvey_",Iu=(e,t)=>{var r=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(r=""+e+t.id+"_"+t.current_iteration),r},Cu=e=>Iu(wu,e),Su=e=>{try{var t=Cu(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){gu.error("Failed to persist survey seen state",e)}},xu=[Kl.Popover,Kl.Widget,Kl.API],ku={ignoreConditions:!1,ignoreDelay:!1,displayType:nu};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Qr(e)&&isFinite(e)&&Math.floor(e)===e});class Tu{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||0>e||0>t||0>r||0>i||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new Tu(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),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 Tu(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Au{constructor(){this.I=0,this.S=0,this.k=new Nu}generate(){var e=this.generateOrAbort();if(Gr(e)){this.I=0;var t=this.generateOrAbort();if(Gr(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.I)this.I=e,this.A();else{if(this.I>=e+1e4)return;this.S++,this.S>4398046511103&&(this.I++,this.A())}return Tu.fromFieldsV7(this.I,Math.trunc(this.S/Math.pow(2,30)),this.S&Math.pow(2,30)-1,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}}var Eu,Ru=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Wn&&!Gr(Wn.crypto)&&crypto.getRandomValues&&(Ru=e=>crypto.getRandomValues(e));class Nu{constructor(){this.T=new Uint32Array(8),this.N=1/0}nextUint32(){return this.T.length>this.N||(Ru(this.T),this.N=0),this.T[this.N++]}}var Mu=()=>Fu().toString(),Fu=()=>(Eu||(Eu=new Au)).generate(),Ou="gzip-js",Pu="base64",Lu=Uint8Array,Du=Uint16Array,Bu=Uint32Array,ju=new Lu([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]),$u=new Lu([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]),qu=new Lu([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Zu=function(e,t){for(var r=new Du(31),i=0;31>i;++i)r[i]=t+=1<<e[i-1];var n=new Bu(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},Hu=Zu(ju,2),Vu=Hu[1];Hu[0][28]=258,Vu[258]=28;for(var zu=Zu($u,0)[1],Uu=new Du(32768),Yu=0;32768>Yu;++Yu){var Gu=(43690&Yu)>>>1|(21845&Yu)<<1;Uu[Yu]=((65280&(Gu=(61680&(Gu=(52428&Gu)>>>2|(13107&Gu)<<2))>>>4|(3855&Gu)<<4))>>>8|(255&Gu)<<8)>>>1}var Wu=function(e,t,r){for(var i=e.length,n=0,s=new Du(t);i>n;++n)++s[e[n]-1];var o,a=new Du(t);for(n=0;t>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Du(1<<t);var l=15-t;for(n=0;i>n;++n)if(e[n])for(var u=n<<4|e[n],h=t-e[n],c=a[e[n]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)o[Uu[c]>>>l]=u}else for(o=new Du(i),n=0;i>n;++n)o[n]=Uu[a[e[n]-1]++]>>>15-e[n];return o},Xu=new Lu(288);for(Yu=0;144>Yu;++Yu)Xu[Yu]=8;for(Yu=144;256>Yu;++Yu)Xu[Yu]=9;for(Yu=256;280>Yu;++Yu)Xu[Yu]=7;for(Yu=280;288>Yu;++Yu)Xu[Yu]=8;var Ju=new Lu(32);for(Yu=0;32>Yu;++Yu)Ju[Yu]=5;var Ku=Wu(Xu,9,0),Qu=Wu(Ju,5,0),eh=function(e){return(e/8>>0)+(7&e&&1)},th=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof Du?Du:e instanceof Bu?Bu:Lu)(r-t);return i.set(e.subarray(t,r)),i},rh=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8},ih=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8,e[i+2]|=r>>>16},nh=function(e,t){for(var r=[],i=0;e.length>i;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,s=r.slice();if(!n)return[new Lu(0),0];if(1==n){var o=new Lu(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,h=1,c=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=r[r[c].f>r[u].f?u++:c++],l=r[u!=h&&r[c].f>r[u].f?u++:c++],r[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=s[0].s;for(i=1;n>i;++i)s[i].s>d&&(d=s[i].s);var v=new Du(d+1),f=sh(r[h-1],v,0);if(f>t){i=0;var p=0,g=f-t,m=1<<g;for(s.sort((function(e,t){return v[t.s]-v[e.s]||e.f-t.f}));n>i;++i){var y=s[i].s;if(t>=v[y])break;p+=m-(1<<f-v[y]),v[y]=t}for(p>>>=g;p>0;){var b=s[i].s;t>v[b]?p-=1<<t-v[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;v[w]==t&&(--v[w],++p)}f=t}return[new Lu(v),f]},sh=function(e,t,r){return-1==e.s?Math.max(sh(e.l,t,r+1),sh(e.r,t,r+1)):t[e.s]=r},oh=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Du(++t),i=0,n=e[0],s=1,o=function(e){r[i++]=e},a=1;t>=a;++a)if(e[a]==n&&a!=t)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=e[a]}return[r.subarray(0,i),t]},ah=function(e,t){for(var r=0,i=0;t.length>i;++i)r+=e[i]*t[i];return r},lh=function(e,t,r){var i=r.length,n=eh(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var s=0;i>s;++s)e[n+s+4]=r[s];return 8*(n+4+i)},uh=function(e,t,r,i,n,s,o,a,l,u,h){rh(t,h++,r),++n[256];for(var c=nh(n,15),d=c[0],v=c[1],f=nh(s,15),p=f[0],g=f[1],m=oh(d),y=m[0],b=m[1],w=oh(p),_=w[0],I=w[1],C=new Du(19),S=0;y.length>S;++S)C[31&y[S]]++;for(S=0;_.length>S;++S)C[31&_[S]]++;for(var x=nh(C,7),k=x[0],T=x[1],A=19;A>4&&!k[qu[A-1]];--A);var E,R,N,M,F=u+5<<3,O=ah(n,Xu)+ah(s,Ju)+o,P=ah(n,d)+ah(s,p)+o+14+3*A+ah(C,k)+(2*C[16]+3*C[17]+7*C[18]);if(O>=F&&P>=F)return lh(t,h,e.subarray(l,l+u));if(rh(t,h,1+(O>P)),h+=2,O>P){E=Wu(d,v,0),R=d,N=Wu(p,g,0),M=p;var L=Wu(k,T,0);for(rh(t,h,b-257),rh(t,h+5,I-1),rh(t,h+10,A-4),h+=14,S=0;A>S;++S)rh(t,h+3*S,k[qu[S]]);h+=3*A;for(var D=[y,_],B=0;2>B;++B){var j=D[B];for(S=0;j.length>S;++S)rh(t,h,L[q=31&j[S]]),h+=k[q],q>15&&(rh(t,h,j[S]>>>5&127),h+=j[S]>>>12)}}else E=Ku,R=Xu,N=Qu,M=Ju;for(S=0;a>S;++S)if(i[S]>255){var q;ih(t,h,E[257+(q=i[S]>>>18&31)]),h+=R[q+257],q>7&&(rh(t,h,i[S]>>>23&31),h+=ju[q]);var Z=31&i[S];ih(t,h,N[Z]),h+=M[Z],Z>3&&(ih(t,h,i[S]>>>5&8191),h+=$u[Z])}else ih(t,h,E[i[S]]),h+=R[i[S]];return ih(t,h,E[256]),h+R[256]},hh=new Bu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ch=function(){for(var e=new Bu(256),t=0;256>t;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),dh=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function vh(e,t){void 0===t&&(t={});var r=function(){var e=4294967295;return{p(t){for(var r=e,i=0;t.length>i;++i)r=ch[255&r^t[i]]^r>>>8;e=r},d(){return 4294967295^e}}}(),i=e.length;r.p(e);var n,s,o,a,l=(n=e,s=t,o=function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),a=8,function(e,t,r,i,n,s){var o=e.length,a=new Lu(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!t||8>o)for(var h=0;o>=h;h+=65535){var c=h+65535;o>c?u=lh(l,u,e.subarray(h,c)):(l[h]=!0,u=lh(l,u,e.subarray(h,o)))}else{for(var d=hh[t-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new Du(32768),m=new Du(p+1),y=Math.ceil(r/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&p},_=new Bu(25e3),I=new Du(288),C=new Du(32),S=0,x=0,k=(h=0,0),T=0,A=0;o>h;++h){var E=w(h),R=32767&h,N=m[E];if(g[R]=N,m[E]=R,h>=T){var M=o-h;if((S>7e3||k>24576)&&M>423){u=uh(e,l,0,_,I,C,x,k,A,h-A,u),k=S=x=0,A=h;for(var F=0;286>F;++F)I[F]=0;for(F=0;30>F;++F)C[F]=0}var O=2,P=0,L=f,D=R-N&32767;if(M>2&&E==w(h-D))for(var B=Math.min(v,M)-1,j=Math.min(32767,h),q=Math.min(258,M);j>=D&&--L&&R!=N;){if(e[h+O]==e[h+O-D]){for(var Z=0;q>Z&&e[h+Z]==e[h+Z-D];++Z);if(Z>O){if(O=Z,P=D,Z>B)break;var H=Math.min(D,Z-2),V=0;for(F=0;H>F;++F){var z=h-D+F+32768&32767,U=z-g[z]+32768&32767;U>V&&(V=U,N=z)}}}D+=(R=N)-(N=g[R])+32768&32767}if(P){_[k++]=268435456|Vu[O]<<18|zu[P];var Y=31&Vu[O],G=31&zu[P];x+=ju[Y]+$u[G],++I[257+Y],++C[G],T=h+O,++S}else _[k++]=e[h],++I[e[h]]}}u=uh(e,l,!0,_,I,C,x,k,A,h-A,u)}return th(a,0,i+eh(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a)),u=l.length;return function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&dh(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;r.length>=i;++i)e[i+10]=r.charCodeAt(i)}}(l,t),dh(l,u-8,r.d()),dh(l,u-4,i),l}var fh=!!ts||!!es,ph="text/plain",gh=!1,mh=function(e,t,i){var n;void 0===i&&(i=!0);var[s,o]=e.split("?"),a=r({},t),l=null!==(n=null==o?void 0:o.split("&").map((e=>{var t,[r,n]=e.split("="),s=i&&null!==(t=a[r])&&void 0!==t?t:n;return delete a[r],r+"="+s})))&&void 0!==n?n:[],u=Ss(a);return u&&l.push(u),s+"?"+l.join("&")},yh=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),bh=e=>{if(e.tr)return e.tr;var{data:t,compression:r}=e;if(t){if(r===Ou){var i=vh(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Lu(e.length+(e.length>>>1)),n=0,s=function(e){i[n++]=e},o=0;r>o;++o){if(n+5>i.length){var a=new Lu(n+8+(r-o<<1));a.set(i),i=a}var l=e.charCodeAt(o);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return th(i,0,n)}(yh(t)),{mtime:0});return{contentType:ph,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===Pu){var n=function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))):e}(yh(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:yh(e)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=yh(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},wh=function(){var e=t((function*(e){var t=yh(e.data),i=yield function(e,t,r){return Fr.apply(this,arguments)}(t,ls.DEBUG,{rethrow:!0});if(!i)return e;var n=yield i.arrayBuffer();return r({},e,{tr:{contentType:ph,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),_h=(e,t)=>mh(e,{_:(new Date).getTime().toString(),ver:ls.JS_SDK_VERSION,compression:t}),Ih=[];es&&Ih.push({transport:"fetch",method(e){var t,i,{contentType:n,body:s,estimatedSize:o}=null!==(t=bh(e))&&void 0!==t?t:{},a=new Headers;vs(e.headers,(function(e,t){a.append(t,e)})),n&&a.append("Content-Type",n);var l=e.url,u=null;if(rs){var h=new rs;u={signal:h.signal,timeout:setTimeout((()=>h.abort()),e.timeout)}}es(l,r({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&52428.8>(o||0),body:s,signal:null==(i=u)?void 0:i.signal},e.fetchOptions)).then((t=>t.text().then((r=>{var i={statusCode:t.status,text:r};if(200===t.status)try{i.json=JSON.parse(r)}catch(e){hs.error(e)}null==e.callback||e.callback(i)})))).catch((t=>{hs.error(t),null==e.callback||e.callback({statusCode:0,error:t})})).finally((()=>u?clearTimeout(u.timeout):null))}}),ts&&Ih.push({transport:"XHR",method(e){var t,r=new ts;r.open(e.method||"GET",e.url,!0);var{contentType:i,body:n}=null!==(t=bh(e))&&void 0!==t?t:{};vs(e.headers,(function(e,t){r.setRequestHeader(t,e)})),i&&r.setRequestHeader("Content-Type",i),e.timeout&&(r.timeout=e.timeout),e.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var t={statusCode:r.status,text:r.responseText};if(200===r.status)try{t.json=JSON.parse(r.responseText)}catch(e){}null==e.callback||e.callback(t)}},r.send(n)}}),null!=Jn&&Jn.sendBeacon&&Ih.push({transport:"sendBeacon",method(e){var t=mh(e.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=bh(e))&&void 0!==r?r:{};if(!n)return;var s=n instanceof Blob?n:new Blob([n],{type:i});Jn.sendBeacon(t,s)}catch(e){}}});var Ch=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}};function Sh(e,t,r){return yh({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var xh={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>Ch(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!Ch(t,e))))),icontains:(e,t)=>t.map(kh).some((t=>e.map(kh).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(kh).every((t=>e.map(kh).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},kh=e=>e.toLowerCase();function Th(e,t){return!e||Object.entries(e).every((e=>{var[r,i]=e,n=null==t?void 0:t[r];if(Gr(n)||Jr(n))return!1;var s=[String(n)],o=xh[i.operator];return!!o&&o(i.values,s)}))}var Ah="",Eh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Rh={R:()=>!!Kn,B(e){hs.error("cookieStore error: "+e)},O(e){if(Kn){try{for(var t=e+"=",r=Kn.cookie.split(";").filter((e=>e.length)),i=0;r.length>i;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}},Z(e){var t;try{t=JSON.parse(Rh.O(e))||{}}catch(e){}return t},M(e,t,r,i,n){if(Kn)try{var s="",o="",a=function(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=Kn),Ah)return Ah;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),i=Math.min(r.length,8),n="dmn_chk_"+Mu();!Ah&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(n)&&(t.cookie=o+";max-age=0",Ah=s)}return Ah}(e);if(!r){var i=(e=>{var t=e.match(Eh);return t?t[0]:""})(e);i!==r&&hs.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(Kn.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&hs.warn("cookieStore warning: large cookie, len="+u.length),Kn.cookie=u,u}catch(e){return}},F(e,t){if(null!=Kn&&Kn.cookie)try{Rh.M(e,"",-1,t)}catch(e){return}}},Nh=null,Mh={R(){if(!Jr(Nh))return Nh;var e=!0;if(Gr(Wn))e=!1;else try{var t="__mplssupport__";Mh.M(t,"xyz"),'"xyz"'!==Mh.O(t)&&(e=!1),Mh.F(t)}catch(t){e=!1}return e||hs.error("localStorage unsupported; falling back to cookie store"),Nh=e,e},B(e){hs.error("localStorage error: "+e)},O(e){try{return null==Wn?void 0:Wn.localStorage.getItem(e)}catch(e){Mh.B(e)}return null},Z(e){try{return JSON.parse(Mh.O(e))||{}}catch(e){}return null},M(e,t){try{null==Wn||Wn.localStorage.setItem(e,JSON.stringify(t))}catch(e){Mh.B(e)}},F(e){try{null==Wn||Wn.localStorage.removeItem(e)}catch(e){Mh.B(e)}}},Fh=[Ns,"distinct_id",Gs,Ws,wo,bo,fo],Oh={},Ph={R:()=>!0,B(e){hs.error("memoryStorage error: "+e)},O:e=>Oh[e]||null,Z:e=>Oh[e]||null,M(e,t){Oh[e]=t},F(e){delete Oh[e]}},Lh=null,Dh={R(){if(!Jr(Lh))return Lh;if(Lh=!0,Gr(Wn))Lh=!1;else try{var e="__support__";Dh.M(e,"xyz"),'"xyz"'!==Dh.O(e)&&(Lh=!1),Dh.F(e)}catch(e){Lh=!1}return Lh},B(e){hs.error("sessionStorage error: ",e)},O(e){try{return null==Wn?void 0:Wn.sessionStorage.getItem(e)}catch(e){Dh.B(e)}return null},Z(e){try{return JSON.parse(Dh.O(e))||null}catch(e){}return null},M(e,t){try{null==Wn||Wn.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Dh.B(e)}},F(e){try{null==Wn||Wn.sessionStorage.removeItem(e)}catch(e){Dh.B(e)}}},Bh=cs("[Stylesheet Loader]"),jh=Wn,$h=Kn,qh="#020617",Zh={fontFamily:"inherit",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:Xl.Right,widgetType:Wl.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:qh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Hh=[Xl.Center,Xl.Left,Xl.Right];function Vh(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function zh(e){var t;void 0===e&&(e=Zh.backgroundColor),"#"===e[0]&&(t=Vh(e)),e.startsWith("rgb")&&(t=e);var r={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()];if(r&&(t=Vh(r)),!t)return qh;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?qh:"white"}return qh}var Uh=(e,t,i)=>{var n=hc(e),s=$h.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=$h.createElement("div");((e,t,i)=>{var n=r({},Zh,i),s=e.style,o=!Hh.includes(n.position)||t===Kl.Widget&&(null==i?void 0:i.widgetType)===Wl.Tab;s.setProperty("--ph-survey-font-family",function(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?e+", "+t:"-apple-system, "+t}(n.fontFamily)),s.setProperty("--ph-survey-box-padding",n.boxPadding),s.setProperty("--ph-survey-max-width",n.maxWidth),s.setProperty("--ph-survey-z-index",n.zIndex),s.setProperty("--ph-survey-border-color",n.borderColor),o?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||zh(n.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",zh(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||zh(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",zh(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||n.inputBackground;a||"white"!==n.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||zh(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,e.type,e.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(e){var t=((e,t,r)=>{var i,n=e.createElement("style");return n.innerText=':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Bh.error("prepare_external_dependency_stylesheet returned null"),null)})($h,0,e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return $h.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},Yh=e=>{var{responses:t,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a,surveyLanguage:l}=e;s?(Su(i),s.capture(ru.SENT,r({[iu.SURVEY_NAME]:i.name,[iu.SURVEY_ID]:i.id,[iu.SURVEY_ITERATION]:i.current_iteration,[iu.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[iu.SURVEY_SUBMISSION_ID]:n,[iu.SURVEY_COMPLETED]:o},l&&{[iu.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},au(t,i),a,{$set:{[lu(i,"responded")]:!0}})),o&&(jh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),uc(i))):gu.error("[survey sent] event not captured, PostHog instance not found.")},Gh=(e,t,i)=>{return r({[iu.SURVEY_NAME]:e.name,[iu.SURVEY_ID]:e.id,[iu.SURVEY_ITERATION]:e.current_iteration,[iu.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[iu.SURVEY_PARTIALLY_COMPLETED]:(n=null==t?void 0:t.responses,void 0===n&&(n={}),Object.values(n).some((e=>!Kr(e))))},(null==t?void 0:t.surveyLanguage)&&{[iu.SURVEY_LANGUAGE]:t.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[iu.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId},au(null==t?void 0:t.responses,e));var n},Wh=(e,t,i,n)=>{if(t){if(!i){var s=ac(e);t.capture(ru.DISMISSED,r({},Gh(e,s,t),n&&{[iu.SURVEY_LANGUAGE]:n},{$set:{[lu(e,"dismissed")]:!0}})),uc(e),Su(e),jh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else gu.error("[survey dismissed] event not captured, PostHog instance not found.")},Xh=(e,t)=>{if(t){var r=(e=>Iu("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=ac(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(ru.ABANDONED,Gh(e,i,t),{transport:"sendBeacon"})}}else gu.error("[survey abandoned] event not captured, PostHog instance not found.")},Jh=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Kh=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,Qh=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?Kh(e.questions,Jh(e.questions)):e.questions,ec=e=>{var t;return!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation||!(e=>{var t,r;return null!=(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(e))||e.schedule===tu||lc(e)},tc=function(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,ol(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Ya++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),rc=()=>jl(tc),ic=e=>{var{component:t,children:r,renderAsHtml:i,style:n}=e;return function(e,t,r){var i,n,s,o,a=Ka({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?n=t[s]:a[s]=void 0===t[s]&&null!=o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?La.call(arguments,2):r),tl(e.type,a,i||e.key,n||e.ref,null)}(t,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function nc(e){var t,r,i;if(null==(t=e.conditions)||!t.url)return!0;var n=null==jh||null==(r=jh.location)?void 0:r.href;if(!n)return!1;var s=[e.conditions.url],o=function(e){return null!=e?e:"icontains"}(null==(i=e.conditions)?void 0:i.urlMatchType);return xh[o](s,[n])}var sc=e=>{var t=""+_u+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+_u+e.id+"_"+e.current_iteration),t},oc=(e,t)=>{try{localStorage.setItem(sc(e),JSON.stringify(t))}catch(e){gu.error("Error setting in-progress survey state in localStorage",e)}},ac=e=>{try{var t=localStorage.getItem(sc(e));if(t)return JSON.parse(t)}catch(e){gu.error("Error getting in-progress survey state from localStorage",e)}return null},lc=e=>{var t=ac(e);return!Kr(null==t?void 0:t.surveySubmissionId)},uc=e=>{try{localStorage.removeItem(sc(e))}catch(e){gu.error("Error clearing in-progress survey state from localStorage",e)}};function hc(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function cc(e,t,r){if(void 0===t&&(t=Xl.Right),e===Kl.ExternalSurvey)return{};switch(t){case Xl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Xl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Xl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Xl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Xl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Xl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Xl.Left:return{left:"30px"};case Xl.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===Kl.Widget&&r===Wl.Tab?"60px":"30px"}}}var dc=0;function vc(e,t,r,i,n,s){t||(t={});var o,a,l=t;if("ref"in l)for(a in l={},t)"ref"==a?o=t[a]:l[a]=t[a];var u={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--dc,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return Da.vnode&&Da.vnode(u),u}var fc=vc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vc("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"})}),pc=vc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vc("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"})}),gc=vc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vc("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"})}),mc=vc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vc("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"})}),yc=vc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vc("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"})}),bc=vc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:vc("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),wc=vc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:vc("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),_c=function(e){var{fill:t="currentColor"}=void 0===e?{}:e;return vc("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[vc("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),vc("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:t})]})},Ic=vc("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[vc("g",{"clip-path":"url(#clip0_2415_6911)",children:[vc("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:vc("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),vc("g",{mask:"url(#mask0_2415_6911)",children:[vc("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"}),vc("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"}),vc("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"}),vc("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"}),vc("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"}),vc("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"})]})]}),vc("defs",{children:vc("clipPath",{id:"clip0_2415_6911",children:vc("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Cc(e){var{urlParams:t}=e,r=t?Object.entries(t).map((e=>{var[t,r]=e;return encodeURIComponent(t)+"="+encodeURIComponent(r)})).join("&"):"";return vc("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Ic]})}function Sc(e){var{text:t,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=e,{isPreviewMode:l}=jl(tc);return vc("div",{className:"bottom-section",children:[!a&&vc("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==Wn||Wn.open(s)),l?null==o||o():n()},children:t}),!i.whiteLabel&&vc(Cc,{urlParams:{utm_source:"survey-footer"}})]})}function xc(e){var{question:t,forceDisableHtml:r,htmlFor:i}=e;return vc("div",{class:"question-header",children:[vc(t.type===Ql.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:t.question}),t.description&&ic({component:el("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function kc(e){var{onClick:t}=e,{isPreviewMode:r}=jl(tc);return vc("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:_c({fill:"black"})})}vc("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vc("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"})});var Tc=Wn;function Ac(e){var{header:t,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=e,{isPopup:a}=jl(tc);return Ll((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return _s(Tc,"keydown",e),()=>{Tc.removeEventListener("keydown",e)}}),[o]),vc("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&vc(kc,{onClick:()=>o()}),vc("h3",{className:"thank-you-message-header",children:t}),r&&ic({component:el("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&vc(Sc,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Ec=e=>Vr(e)&&e.every((e=>Wr(e)));function Rc(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=e,{isPreviewMode:l}=rc(),u=Dl(null),[h,c]=Pl((()=>Wr(a)?a:""));Ll((()=>{setTimeout((()=>{var e;l||null==(e=u.current)||e.focus()}),100)}),[l]);var d="surveyQuestion"+o,v=Bl((()=>function(e,t,r){var i,n,s=e.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case Lr.MinLength:if(void 0!==o.value&&o.value>s.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case Lr.MaxLength:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(h,t.validation,t.optional)),[h,t.validation,t.optional]),f=gn(t.validation,Lr.MinLength),p=gn(t.validation,Lr.MaxLength),g=Bl((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(f,p)),[f,p]);return vc(rl,{children:[vc("div",{className:"question-container",children:[vc(xc,{question:t,forceDisableHtml:r,htmlFor:d}),vc("textarea",{ref:u,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:f,maxLength:p,onInput(e){c(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation()},value:h}),g&&vc("div",{className:"validation-hint",children:g})]}),vc(Sc,{text:t.buttonText||"Submit",submitDisabled:!!v,appearance:i,onSubmit(){v||n(h.trim())},onPreviewSubmit(){v||s(h.trim())}})]})}function Nc(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=e;return vc(rl,{children:[vc("div",{className:"question-container",children:vc(xc,{question:t,forceDisableHtml:r})}),vc(Sc,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function Mc(e){var t,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u=r.scale,h=10===r.scale?0:1,[c,d]=Pl((()=>Qr(l)?l:Vr(l)&&l.length>0&&Qr(parseInt(l[0]))?parseInt(l[0]):Wr(l)&&Qr(parseInt(l))?parseInt(l):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=rc(),p=e=>f?a(e):o(e);return vc(rl,{children:[vc("div",{className:"question-container",children:[vc(xc,{question:r,forceDisableHtml:i}),vc("div",{className:"rating-section",children:[vc("div",{className:"rating-options",children:["emoji"===r.display&&vc("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(t=Bc[r.scale])?void 0:t.map(((e,t)=>vc("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+n+"-rating-"+t+" "+(t+1===c?"rating-active":""),value:t+1,type:"button",onClick(){var e=t+1;d(e),r.skipSubmitButton&&p(e)},children:e},t)))}),"number"===r.display&&vc("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(u-h+1)+", minmax(0, 1fr))"},children:jc(r.scale).map(((e,t)=>vc(Fc,{displayQuestionIndex:n,active:c===e,appearance:s,num:e,setActiveNumber(e){d(e),r.skipSubmitButton&&p(e)}},t)))})]}),!v&&vc("div",{className:"rating-text",children:[vc("div",{children:r.lowerBoundLabel}),vc("div",{children:r.upperBoundLabel})]})]})]}),vc(Sc,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Jr(c)&&!r.optional,appearance:s,onSubmit:()=>o(c),onPreviewSubmit:()=>a(c),skipSubmitButton:r.skipSubmitButton})]})}function Fc(e){var{num:t,active:r,displayQuestionIndex:i,setActiveNumber:n}=e;return vc("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+i+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick(){n(t)},children:t})}function Oc(e){var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u=Dl(null),h=Bl((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=Kh(t,Jh(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),[c,d]=Pl((()=>((e,t)=>Wr(e)||Ec(e)?e:t===Ql.SingleChoice?null:[])(l,t.type))),[v,f]=Pl((()=>((e,t)=>{if(Wr(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Ec(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,h))),{isPreviewMode:p}=rc(),g=t.type===Ql.SingleChoice,m=t.type===Ql.MultipleChoice,y=t.skipSubmitButton&&g&&!t.hasOpenChoice,b=(e,t)=>{if(t){var i=!v.isSelected;return f((e=>r({},e,{isSelected:i,inputValue:i?e.inputValue:""}))),g&&d(""),void(i&&setTimeout((()=>{var e;return null==(e=u.current)?void 0:e.focus()}),75))}if(g)return d(e),f((e=>r({},e,{isSelected:!1,inputValue:""}))),void(y&&(o(e),p&&a(e)));m&&Vr(c)&&(c.includes(e)?d(c.filter((t=>t!==e))):d([...c,e]))},w=e=>{e.stopPropagation();var t=e.currentTarget.value;f((e=>r({},e,{inputValue:t}))),g&&d(t)},_=e=>{e.stopPropagation(),"Enter"!==e.key||I()||(e.preventDefault(),C()),"Escape"===e.key&&(e.preventDefault(),f((e=>r({},e,{isSelected:!1,inputValue:""}))),g&&d(null))},I=()=>!(t.optional||!Jr(c)&&(!Vr(c)||v.isSelected||0!==c.length)&&(!v.isSelected||""!==v.inputValue.trim())),C=()=>{v.isSelected&&m?Vr(c)&&(p?a([...c,v.inputValue]):o([...c,v.inputValue])):p?a(c):o(c)};return vc(rl,{children:[vc("div",{className:"question-container",children:[vc(xc,{question:t,forceDisableHtml:i}),vc("fieldset",{className:"multiple-choice-options limit-height",children:[vc("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((e,r)=>{var i=!!t.hasOpenChoice&&r===t.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?v.isSelected:g?c===e:Vr(c)&&c.includes(e);return vc("label",{className:i?"choice-option-open":"",children:[vc("div",{className:"response-choice",children:[vc("input",{type:g?"radio":"checkbox",name:s,checked:a,onChange:()=>b(e,i),id:s,"aria-controls":o}),vc("span",{children:i?e+":":e})]}),i&&vc("input",{type:"text",ref:u,id:o,name:"question"+n+"Open",value:v.inputValue,onKeyDown:_,onInput:w,onClick(t){v.isSelected||b(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),vc(Sc,{text:t.buttonText||"Submit",submitDisabled:I(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:y})]})}var Pc=[1,2,3,4,5],Lc=[1,2,3,4,5,6,7],Dc=[0,1,2,3,4,5,6,7,8,9,10],Bc={2:[bc,wc],3:[gc,pc,fc],5:[mc,gc,pc,fc,yc]};function jc(e){switch(e){case 5:default:return Pc;case 7:return Lc;case 10:return Dc}}var $c=cs("[Surveys]");function qc(e,t,r){var i,n=e.questions[t],s=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?eu.End:s;if(n.branching.type===eu.End)return eu.End;if(n.branching.type===eu.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===eu.ResponseBased){if(n.type===Ql.SingleChoice){var o,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===eu.End?eu.End:s}}else if(n.type===Ql.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||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(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===eu.End?eu.End:s}}return s}return $c.warn("Falling back to next question index due to unexpected branching type"),s}var Zc="https?://(.*)",Hc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Vc=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Hc],zc="<masked>",Uc=["li_fat_id"];function Yc(e,t,r){if(!Kn)return{};var i,n=t?[...Hc,...r||[]]:[],s=Gc(ks(Kn.URL,n,zc),e),o=(i={},vs(Uc,(function(e){var t=Rh.O(e);i[e]=t||null})),i);return fs(o,s)}function Gc(e,t){var r=Vc.concat(t||[]),i={};return vs(r,(function(t){var r=xs(e,t);i[t]=r||null})),i}function Wc(e){var t=function(e){return e?0===e.search(Zc+"google.([^/?]*)")?"google":0===e.search(Zc+"bing.com")?"bing":0===e.search(Zc+"yahoo.com")?"yahoo":0===e.search(Zc+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!Jr(t)){i.$search_engine=t;var n=Kn?xs(Kn.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function Xc(){return navigator.language||navigator.userLanguage}var Jc="$direct";function Kc(){return(null==Kn?void 0:Kn.referrer)||Jc}function Qc(e,t){var r=e?[...Hc,...t||[]]:[],i=null==Qn?void 0:Qn.href.substring(0,1e3);return{r:Kc().substring(0,1e3),u:i?ks(i,r,zc):void 0}}function ed(e){var t,{r:r,u:i}=e,n={$referrer:r,$referring_domain:null==r?void 0:r==Jc?Jc:null==(t=Cs(r))?void 0:t.host};if(i){n.$current_url=i;var s=Cs(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=Gc(i);fs(n,o)}if(r){var a=Wc(r);fs(n,a)}return n}function td(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function rd(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var id=cs("[SurveyTranslations]");function nd(e,t){var r=function(e){return function(e){var{overrideLanguage:t,storedPersonProperties:r,locale:i}=e,n=du(t);if(n)return cu.info("Using override display language: "+n),n;var s=function(e){return e&&"object"==typeof e&&"language"in e?du(e.language):null}(r);if(s)return cu.info("Using person property language: "+s),s;var o=du(i);return o?(cu.info("Using detected locale: "+o),o):(cu.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:zr(e.get_property)?e.get_property(no):void 0,locale:Xc()})}(t);if(!r)return id.info("No user language detected"),{survey:e,language:null};var i=pu(e,r);return{survey:i.survey,language:i.matchedKey}}var sd=Wn,od=Kn,ad="ph:show_survey_widget",ld="PHWidgetSurveyClickListener";function ud(e,t){try{var r=e.getBoundingClientRect(),i=sd.innerHeight,n=sd.innerWidth,s=r.left+r.width/2-t/2;s+t>n-20&&(s=n-t-20),20>s&&(s=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:Zh.zIndex}}catch(e){return gu.warn("Failed to calculate trigger position:",e),null}}class hd{constructor(e){var t=this;this.D=new Map,this.q=new Map,this.V=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property(oo);if(e)for(var t of e)lc(t)&&Xh(t,this._posthog)},this.handlePopoverSurvey=(e,t)=>{var i,n,s,o,{survey:a,language:l}=this.j(e),u=null!=t&&t.position||null!=t&&t.selector?r({},a,{appearance:r({},a.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):a;this.H(u.id);var{properties:h,initialResponses:c}=null!=t?t:{},d=!(!c||0>=Object.keys(c).length)&&this.Y(u,c,h,l);if(!d||null!=(i=u.appearance)&&i.displayThankYouMessage){this.G(u);var v={};if((null==(n=u.appearance)?void 0:n.position)===Xl.NextToTrigger&&null!=(s=u.appearance)&&s.widgetSelector){var f,p=od.querySelector(u.appearance.widgetSelector);p&&(v=ud(p,parseInt((null==(f=u.appearance)?void 0:f.maxWidth)||Zh.maxWidth))||{})}var g=(null==(o=u.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:m}=Uh(u,this._posthog),y={posthog:this._posthog,survey:u,removeSurveyFromFocus:this.W,properties:h,style:v,isSurveyCompleted:d,skipShownEvent:null==t?void 0:t.skipShownEvent,surveyLanguage:l};if(0>=g)return wl(vc(fd,r({},y)),m);var b=setTimeout((()=>{if(this.D.delete(u.id),!nc(u))return this.W(u);wl(vc(fd,r({},y,{survey:r({},u,{appearance:r({},u.appearance,{surveyPopupDelaySeconds:0})})})),m)}),1e3*g);this.D.set(u.id,b)}},this.U=e=>{var{survey:t,language:r}=this.j(e),{shadow:i,isNewlyCreated:n}=Uh(t,this._posthog);n&&wl(vc(gd,{posthog:this._posthog,survey:t,surveyLanguage:r},e.id),i)},this.X=e=>{this.K(e);var t=this.q.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(ld),this.q.delete(e.id),gu.info("Removed click listener for survey "+e.id))},this.J=(e,t)=>{var r=od.querySelector(t),i=this.q.get(e.id);if(r){if(this.U(e),i){if(r===i.element)return;gu.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.X(e)}if(!r.hasAttribute(ld)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===Xl.NextToTrigger?ud(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||Zh.maxWidth)):{};sd.dispatchEvent(new CustomEvent(ad,{detail:{surveyId:e.id,position:n}}))};_s(r,"click",n),r.setAttribute(ld,"true"),this.q.set(e.id,{element:r,listener:n,survey:e}),gu.info("Attached click listener for feedback button survey "+e.id)}}else i&&this.X(e)},this.renderPopover=e=>{var{survey:t,language:r}=this.j(e),{shadow:i}=Uh(t,this._posthog);wl(vc(fd,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.W,surveyLanguage:r}),i)},this.renderSurvey=(e,t,r)=>{var i,{survey:n,language:s}=this.j(e),o=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(o=this.$(n,s)),wl(vc(fd,{posthog:this._posthog,survey:n,removeSurveyFromFocus:this.W,isPopup:!1,properties:r,isSurveyCompleted:o,surveyLanguage:s}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((e=>t.checkSurveyEligibility(e).eligible&&t.ee(e)&&t.te(e)&&t.re(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===Kl.Popover||e.type===Kl.Widget)),i=t.ne(r),n=new Set;i.forEach((e=>{if(e.type===Kl.Widget){var r,i,s,o;if((null==(r=e.appearance)?void 0:r.widgetType)===Wl.Tab)return void t.U(e);(null==(i=e.appearance)?void 0:i.widgetType)===Wl.Selector&&null!=(s=e.appearance)&&s.widgetSelector&&(n.add(e.id),t.J(e,null==(o=e.appearance)?void 0:o.widgetSelector))}Jr(t.ie)&&e.type===Kl.Popover&&t.handlePopoverSurvey(e)})),t.q.forEach((e=>{var{survey:r}=e;n.has(r.id)||t.X(r)}))}),e)},this.G=e=>{Jr(this.ie)||gu.error("Survey "+this.ie+" already in focus. Cannot add survey "+e.id+"."),this.ie=e.id},this.W=e=>{this.ie!==e.id&&gu.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.H(e.id),this.ie=null,this.K(e)},this._posthog=e,this.ie=null}H(e){var t=this.D.get(e);t&&(clearTimeout(t),this.D.delete(e))}cancelSurvey(e){this.D.has(e)&&(gu.info("Cancelled pending survey "+e),this.H(e),this.ie===e&&(this.ie=null))}ne(e){return e.sort(((e,t)=>{var r,i,n=lc(e),s=lc(t);if(n&&!s)return-1;if(!n&&s)return 1;var o=e.schedule===tu,a=t.schedule===tu;return o&&!a?1:!o&&a?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}j(e){return nd(e,this._posthog)}$(e,t){if(this.V.has(e.id))return!1;var{params:r}=function(e){var t={},r=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:r};var n=i.split("&");for(var s of n){var[o,a]=s.split("=");if(o&&!Gr(a)){var l=decodeURIComponent(o),u=decodeURIComponent(a);if("auto_submit"!==l||"true"!==u){var h=l.match(/^q(\d+)$/);if(h){var c=parseInt(h[1],10);t[c]||(t[c]=[]),t[c].push(u)}}else r=!0}}return{params:t,autoSubmit:r}}(sd.location.search);if(0===Object.keys(r).length)return!1;gu.info("[Survey Prefill] Detected URL prefill parameters");var i=this.oe(e,r,t);if(!i)return!1;var{responses:n,submissionId:s,isSurveyCompleted:o,skippedResponses:a}=i;return(Object.keys(a).length>0&&e.enable_partial_responses||o)&&Yh({responses:o?n:a,survey:e,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,surveyLanguage:t}),this.V.add(e.id),o}Y(e,t,r,i){var n={};for(var[s,o]of Object.entries(t))n[parseInt(s)]=Vr(o)?o.map(String):[String(o)];gu.info("[Survey] Processing initial responses");var a=this.oe(e,n,i);if(!a)return!1;var{responses:l,submissionId:u,isSurveyCompleted:h}=a;return Yh({responses:l,survey:e,surveySubmissionId:u,posthog:this._posthog,isSurveyCompleted:h,properties:r,surveyLanguage:i}),h}oe(e,t,r){try{var i=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],s=su(e.id);try{switch(e.type){case Ql.SingleChoice:if(!e.choices||0===e.choices.length)return void hs.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void hs.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=e.choices[o];break;case Ql.MultipleChoice:if(!e.choices||0===e.choices.length)return void hs.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&e.choices.length>t));if(0===a.length)return void hs.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((t=>e.choices[t])))];a.length>l.length&&hs.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case Ql.Rating:var u=parseInt(n[0],10),h=e.scale||10;if(isNaN(u)||0>u||u>h)return void hs.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=u;break;default:hs.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){hs.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(i).length)return gu.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Mu(),s=Object.keys(t).map((e=>parseInt(e,10))),{startQuestionIndex:o,skippedResponses:a}=function(e,t,r){for(var i=0,n={},s=e.questions.length+1;e.questions.length>i&&s>0&&t.includes(i);){var o=e.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=su(o.id);Gr(r[a])||(n[a]=r[a])}var l=qc(e,i,o.id?r[su(o.id)]:null);if(l===eu.End)return{startQuestionIndex:e.questions.length,skippedResponses:n};i=l}return{startQuestionIndex:i,skippedResponses:n}}(e,s,i),l=o>=e.questions.length;return oc(e,{surveySubmissionId:n,responses:i,lastQuestionIndex:o,surveyLanguage:r}),gu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:a}}catch(e){return gu.error("[Survey Prefill] Error handling prefill:",e),null}}ae(e,t){var r;if(void 0===t&&(t=void 0),!e)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),s=!0;return t&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),n&&s}ee(e){return!e.conditions||nc(e)&&function(e){var t,r;return function(e,t){var r,i,n;if(!e||0===e.length)return!0;if(!ns)return!1;var s=cn(ns,{userAgentDataPlatform:null==Jn||null==(r=Jn.userAgentData)?void 0:r.platform,maxTouchPoints:null==Jn?void 0:Jn.maxTouchPoints,screenWidth:null==Wn||null==(i=Wn.screen)?void 0:i.width,screenHeight:null==Wn||null==(n=Wn.screen)?void 0:n.height,devicePixelRatio:null==Wn?void 0:Wn.devicePixelRatio});return xh[null!=t?t:"icontains"](e,[s])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(r=e.conditions)?void 0:r.deviceTypesMatchType)}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==$h||!$h.querySelector(e.conditions.selector))}(e)}se(e){return ec(e)||this.ae(e.internal_targeting_flag_key)||lc(e)}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!mu(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!xu.includes(e.type))return i.eligible=!1,i.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",i;var n=null==(t=e.conditions)?void 0:t.linkedFlagVariant;return this.ae(e.linked_flag_key,n)?this.ae(e.targeting_flag_key)?this.se(e)?function(e,t){if(!e||!t)return!0;var r="string"==typeof t?new Date(t):t,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>e}(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Mh.O("lastSeenSurveyDate"))?(e=>!!Mh.O(Cu(e))&&!ec(e))(e)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i):(i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i):(i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i)}te(e){var t;if(!yu(e)&&!bu(e))return!0;var r=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}re(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this.ae(r)}))}K(e){try{var t=od.querySelector(hc(e,!0));null!=t&&t.shadowRoot&&wl(null,t.shadowRoot),null==t||t.remove()}catch(t){gu.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this.G,removeSurveyFromFocus:this.W,surveyInFocus:this.ie,surveyTimeouts:this.D,handleWidget:this.U,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.J,sortSurveysByAppearanceDelay:this.ne,checkFlags:this.re.bind(this),isSurveyFeatureFlagEnabled:this.ae.bind(this)}}}function cd(e,t){if(od&&sd){var r,i=new hd(e);if(e.config.disable_surveys_automatic_display)return gu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return gu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Gr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),_s(od,"visibilitychange",(()=>{od.hidden?Gr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function dd(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=e;Ll((()=>{var e;if(!n&&null!=(e=t.conditions)&&e.url){var s=()=>{var e,n=t.type===Kl.Widget,s=nc(t),o=(null==(e=t.appearance)?void 0:e.widgetType)===Wl.Tab&&n;if(!s)return gu.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);o&&(gu.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};_s(sd,"popstate",s),_s(sd,"hashchange",s);var o=sd.history.pushState,a=sd.history.replaceState;return sd.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];o.apply(this,t),s()},sd.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];a.apply(this,t),s()},()=>{sd.removeEventListener("popstate",s),sd.removeEventListener("hashchange",s),sd.history.pushState=o,sd.history.replaceState=a}}}),[n,t,r,i])}function vd(e){switch(void 0===e&&(e=Jl.Right),e){case Jl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Jl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Jl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function fd(e){var t,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:h,style:c={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{}),properties:y,isSurveyCompleted:b,skipShownEvent:w,surveyLanguage:_}=e,I=Dl(null),C=Number.isInteger(d),S=null!=(t=l.appearance)&&t.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:x,isSurveySent:k,hidePopupWithViewTransition:T}=function(e,t,i,n,s,o,a,l,u){var[h,c]=Pl(n||0===i||e.type===Kl.ExternalSurvey),[d,v]=Pl(!1),f=()=>{var t=()=>{o&&s(e),c(!1)};od.startViewTransition?od.startViewTransition((()=>{var e;null==a||null==(e=a.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},p=t=>{t.detail.surveyId===e.id&&f()};return Ll((()=>{if(t){if(!n){var s=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return f();v(!0),null!=(i=e.appearance)&&i.autoDisappear&&setTimeout((()=>{f()}),5e3)}},o=()=>{nc(e)&&(c(!0),sd.dispatchEvent(new Event("PHSurveyShown")),l||t.capture(ru.SHOWN,r({[iu.SURVEY_NAME]:e.name,[iu.SURVEY_ID]:e.id,[iu.SURVEY_ITERATION]:e.current_iteration,[iu.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date},u&&{[iu.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()})),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(_s(sd,"PHSurveyClosed",p),_s(sd,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),sd.removeEventListener("PHSurveyClosed",p),sd.removeEventListener("PHSurveySent",s)}}return o(),()=>{sd.removeEventListener("PHSurveyClosed",p),sd.removeEventListener("PHSurveySent",s)}}}else gu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),dd({survey:e,removeSurveyFromFocus:s,setSurveyVisible:c,isPreviewMode:n}),{isPopupVisible:h,isSurveySent:d,setIsPopupVisible:c,hidePopupWithViewTransition:f}}(l,h,S,C,v,f,I,w,_),A=k||d===l.questions.length||!0===b,E=Bl((()=>{var e=ac(l),t=(null==e?void 0:e.surveySubmissionId)||Mu();return{isPreviewMode:C,previewPageIndex:d,onPopupSurveyDismissed(){_?Wh(l,h,C,_):Wh(l,h,C),g()},isPopup:f||!1,surveySubmissionId:t,onPreviewSubmit:p,posthog:h,properties:y,surveyLanguage:_}}),[C,d,f,h,l,g,p,y,_]);return x?vc(tc.Provider,{value:E,children:vc("div",{className:"ph-survey",style:r({},cc(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:I,children:A?vc(Ac,{header:(null==(s=l.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=l.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(a=l.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||Zh,onClose(){T(),m()}}):vc(pd,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function pd(e){var t,{survey:i,forceDisableHtml:n,posthog:s}=e,[o,a]=Pl((()=>{var e=ac(i);return null!=e&&e.responses&&gu.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:l,onPopupSurveyDismissed:u,isPopup:h,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:v,properties:f,surveyLanguage:p}=jl(tc),[g,m]=Pl((()=>{var e=ac(i);return l||(null==e?void 0:e.lastQuestionIndex)||0})),y=Bl((()=>Qh(i)),[i]);Ll((()=>{v&&!Gr(l)&&m(l)}),[l,v]);var b=y.at(g);return b?vc("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(t=i.appearance)?void 0:t.hideCancelButton)&&vc(kc,{onClick(){u()}}),vc("div",{className:"survey-box","data-question-index":g,children:md({question:b,forceDisableHtml:n,displayQuestionIndex:g,appearance:i.appearance||Zh,onSubmit:e=>(e=>{var{res:t,displayQuestionIndex:n,questionId:l}=e;if(s)if(l){var u=su(l),h=r({},o,{[u]:t});a(h);var c=qc(i,n,t),v=c===eu.End;v||(m(c),oc(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c,surveyLanguage:p})),(i.enable_partial_responses||v)&&Yh({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:s,properties:f,surveyLanguage:p})}else gu.error("onNextButtonClick called without a questionId.");else gu.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:g,questionId:b.id}),onPreviewSubmit:c,initialValue:b.id?o[su(b.id)]:void 0})})]}):null}function gd(e){var t,r,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:h,readOnly:c,surveyLanguage:d}=e,[v,f]=Pl(!0),[p,g]=Pl(!1),[m,y]=Pl({}),b=()=>{g(!p)};if(Ll((()=>{var e;if(h){if(!c){"tab"===(null==(e=l.appearance)?void 0:e.widgetType)&&y({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===l.id&&(gu.info("Received show event for feedback button survey "+l.id),y(r.detail.position||{}),b())};return _s(sd,ad,t),()=>{sd.removeEventListener(ad,t)}}}else gu.error("FeedbackWidget called without a PostHog instance.")}),[h,c,l.id,null==(t=l.appearance)?void 0:t.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),dd({survey:l,setSurveyVisible:f}),!v)return null;var w=()=>{l.schedule!==tu&&f(!1),setTimeout((()=>{g(!1)}),200)};return vc(rl,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&vc("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Jl.Top?"widget-tab-top":""),onClick:b,disabled:c,style:vd(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),p&&vc(fd,{posthog:h,survey:l,forceDisableHtml:u,style:m,onPopupSurveyDismissed:w,onCloseConfirmationMessage:w,surveyLanguage:d})]})}var md=e=>{var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u={forceDisableHtml:i,appearance:s,onPreviewSubmit(e){a(e)},onSubmit(e){o(e)},initialValue:l,displayQuestionIndex:n};switch(t.type){case Ql.Open:return el(Rc,r({},u,{question:t,key:t.id}));case Ql.Link:return el(Nc,r({},u,{question:t,key:t.id}));case Ql.Rating:return el(Mc,r({},u,{question:t,key:t.id}));case Ql.SingleChoice:case Ql.MultipleChoice:return el(Oc,r({},u,{question:t,key:t.id}));default:return gu.error("Unsupported question type: "+t.type),null}};ss.__PosthogExtensions__=ss.__PosthogExtensions__||{},ss.__PosthogExtensions__.generateSurveys=cd,ss.extendPostHogWithSurveys=cd;class yd{emit(e){}}var bd=new yd,wd=new class{getLogger(e,t,r){return new yd}};class _d{constructor(e,t,r,i){this.ue=e,this.name=t,this.version=r,this.options=i}emit(e){this.le().emit(e)}le(){if(this.ce)return this.ce;var e=this.ue.de(this.name,this.version,this.options);return e?(this.ce=e,this.ce):bd}}class Id{getLogger(e,t,r){var i;return null!==(i=this.de(e,t,r))&&void 0!==i?i:new _d(this,e,t,r)}he(){var e;return null!==(e=this.ce)&&void 0!==e?e:wd}ve(e){this.ce=e}de(e,t,r){var i;return null===(i=this.ce)||void 0===i?void 0:i.getLogger(e,t,r)}}var Cd="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Sd=Symbol.for("io.opentelemetry.js.api.logs"),xd=Cd;class kd{constructor(){this.fe=new Id}static getInstance(){return this._instance||(this._instance=new kd),this._instance}setGlobalLoggerProvider(e){return xd[Sd]?this.getLoggerProvider():(xd[Sd]=(1,t=e,r=wd,e=>1===e?t:r),this.fe.ve(e),e);var t,r}getLoggerProvider(){var e,t;return null!==(t=null===(e=xd[Sd])||void 0===e?void 0:e.call(xd,1))&&void 0!==t?t:this.fe}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete xd[Sd],this.fe=new Id}}var Td=kd.getInstance();class Ad{constructor(e){this.ce=void 0,this.ce=e}export(e,t){this.ce.export(e,t)}forceFlush(){return this.ce.forceFlush()}shutdown(){return this.ce.shutdown()}}class Ed extends Error{constructor(e,t,r){super(e),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=r,this.code=t}}function Rd(e){if(Number.isFinite(e)&&e>0)return e;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+e+"')")}class Nd{constructor(e){this.pe=void 0,this.me=[],this.pe=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this.me.push(e);var t=()=>{var t=this.me.indexOf(e);this.me.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this.me.length>=this.pe}awaitAll(){var e=this;return t((function*(){yield Promise.all(e.me)}))()}}function Md(e){return new Nd(e.concurrencyLimit)}var Fd="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Od="1.9.0",Pd=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,Ld=function(e){var t=new Set([e]),r=new Set,i=e.match(Pd);if(!i)return function(){return!1};var n=+i[1],s=+i[2],o=+i[3];if(null!=i[4])return function(t){return t===e};function a(e){return r.add(e),!1}function l(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;var i=e.match(Pd);if(!i)return a(e);var u=+i[2],h=+i[3];return null!=i[4]||n!==+i[1]?a(e):0===n?s!==u||o>h?a(e):l(e):s>u?a(e):l(e)}}(Od),Dd=Od.split(".")[0],Bd=Symbol.for("opentelemetry.js.api."+Dd),jd=Fd;function $d(e,t,r,i){var n;void 0===i&&(i=!1);var s=jd[Bd]=null!==(n=jd[Bd])&&void 0!==n?n:{version:Od};if(!i&&s[e]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(o.stack||o.message),!1}return s.version!==Od?(o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+Od),r.error(o.stack||o.message),!1):(s[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+Od+"."),!0)}function qd(e){var t,r,i=null===(t=jd[Bd])||void 0===t?void 0:t.version;if(i&&Ld(i))return null===(r=jd[Bd])||void 0===r?void 0:r[e]}function Zd(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Od+".");var r=jd[Bd];r&&delete r[e]}var Hd,Vd=function(){function e(e){this.ge=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return zd("debug",this.ge,e)},e.prototype.error=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return zd("error",this.ge,e)},e.prototype.info=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return zd("info",this.ge,e)},e.prototype.warn=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return zd("warn",this.ge,e)},e.prototype.verbose=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return zd("verbose",this.ge,e)},e}();function zd(e,t,r){var i=qd("diag");if(i)return r.unshift(t),i[e].apply(i,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(r),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(Hd||(Hd={}));var Ud=function(){function e(){function e(e){return function(){for(var t=[],r=0;arguments.length>r;r++)t[r]=arguments[r];var i=qd("diag");if(i)return i[e].apply(i,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(t),!1))}}var t=this;t.setLogger=function(e,r){var i,n,s;if(void 0===r&&(r={logLevel:Hd.INFO}),e===t){var o=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(i=o.stack)&&void 0!==i?i:o.message),!1}"number"==typeof r&&(r={logLevel:r});var a=qd("diag"),l=function(e,t){function r(r,i){var n=t[r];return"function"!=typeof n||i>e?function(){}:n.bind(t)}return Hd.NONE>e?e=Hd.NONE:e>Hd.ALL&&(e=Hd.ALL),t=t||{},{error:r("error",Hd.ERROR),warn:r("warn",Hd.WARN),info:r("info",Hd.INFO),debug:r("debug",Hd.DEBUG),verbose:r("verbose",Hd.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:Hd.INFO,e);if(a&&!r.suppressOverrideMessage){var u=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+u),l.warn("Current logger will overwrite one already registered from "+u)}return $d("diag",l,t,!0)},t.disable=function(){Zd("diag",t)},t.createComponentLogger=function(e){return new Vd(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}();function Yd(e){return Symbol.for(e)}var Gd,Wd=new function e(t){var r=this;r.ye=t?new Map(t):new Map,r.getValue=function(e){return r.ye.get(e)},r.setValue=function(t,i){var n=new e(r.ye);return n.ye.set(t,i),n},r.deleteValue=function(t){var i=new e(r.ye);return i.ye.delete(t),i}},Xd=function(){function e(){}return e.prototype.active=function(){return Wd},e.prototype.with=function(e,t,r){for(var i=[],n=3;arguments.length>n;n++)i[n-3]=arguments[n];return t.call.apply(t,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([r],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(i),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),Jd="context",Kd=new Xd,Qd=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return $d(Jd,e,Ud.instance())},e.prototype.active=function(){return this.be().active()},e.prototype.with=function(e,t,r){for(var i,n=[],s=3;arguments.length>s;s++)n[s-3]=arguments[s];return(i=this.be()).with.apply(i,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([e,t,r],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(n),!1))},e.prototype.bind=function(e,t){return this.be().bind(e,t)},e.prototype.be=function(){return qd(Jd)||Kd},e.prototype.disable=function(){this.be().disable(),Zd(Jd,Ud.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(Gd||(Gd={}));var ev="0000000000000000",tv="00000000000000000000000000000000",rv={traceId:tv,spanId:ev,traceFlags:Gd.NONE},iv=function(){function e(e){void 0===e&&(e=rv),this.we=e}return e.prototype.spanContext=function(){return this.we},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),nv=Yd("OpenTelemetry Context Key SPAN");function sv(e){return e.getValue(nv)||void 0}function ov(){return sv(Qd.getInstance().active())}function av(e,t){return e.setValue(nv,t)}function lv(e){return e.deleteValue(nv)}function uv(e,t){return av(e,new iv(t))}function hv(e){var t;return null===(t=sv(e))||void 0===t?void 0:t.spanContext()}var cv=/^([0-9a-f]{32})$/i,dv=/^[0-9a-f]{16}$/i;function vv(e){return cv.test(r=e.traceId)&&r!==tv&&dv.test(t=e.spanId)&&t!==ev;var t,r}function fv(e){return new iv(e)}var pv=Qd.getInstance(),gv=function(){function e(){}return e.prototype.startSpan=function(e,t,r){if(void 0===r&&(r=pv.active()),Boolean(null==t?void 0:t.root))return new iv;var i,n=r&&hv(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&vv(n)?new iv(n):new iv},e.prototype.startActiveSpan=function(e,t,r,i){var n,s,o;if(arguments.length>=2){2===arguments.length?o=t:3===arguments.length?(n=t,o=r):(n=t,s=r,o=i);var a=null!=s?s:pv.active(),l=this.startSpan(e,n,a),u=av(a,l);return pv.with(u,o,void 0,l)}},e}(),mv=new gv,yv=function(){function e(e,t,r,i){this.ue=e,this.name=t,this.version=r,this.options=i}return e.prototype.startSpan=function(e,t,r){return this.Ce().startSpan(e,t,r)},e.prototype.startActiveSpan=function(e,t,r,i){var n=this.Ce();return Reflect.apply(n.startActiveSpan,n,arguments)},e.prototype.Ce=function(){if(this.ce)return this.ce;var e=this.ue.getDelegateTracer(this.name,this.version,this.options);return e?(this.ce=e,this.ce):mv},e}(),bv=new(function(){function e(){}return e.prototype.getTracer=function(e,t,r){return new gv},e}()),wv=function(){function e(){}return e.prototype.getTracer=function(e,t,r){var i;return null!==(i=this.getDelegateTracer(e,t,r))&&void 0!==i?i:new yv(this,e,t,r)},e.prototype.getDelegate=function(){var e;return null!==(e=this.ce)&&void 0!==e?e:bv},e.prototype.setDelegate=function(e){this.ce=e},e.prototype.getDelegateTracer=function(e,t,r){var i;return null===(i=this.ce)||void 0===i?void 0:i.getTracer(e,t,r)},e}(),_v=Qd.getInstance(),Iv=Ud.instance(),Cv="trace",Sv=function(){function e(){this.Ie=new wv,this.wrapSpanContext=fv,this.isSpanContextValid=vv,this.deleteSpan=lv,this.getSpan=sv,this.getActiveSpan=ov,this.getSpanContext=hv,this.setSpan=av,this.setSpanContext=uv}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=$d(Cv,this.Ie,Ud.instance());return t&&this.Ie.setDelegate(e),t},e.prototype.getTracerProvider=function(){return qd(Cv)||this.Ie},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){Zd(Cv,Ud.instance()),this.Ie=new wv},e}().getInstance(),xv=Yd("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function kv(e){return null==e||(Array.isArray(e)?function(e){var t;for(var r of e)if(null!=r){var i=typeof r;if(i!==t){if(!t){if(Tv(i)){t=i;continue}return!1}return!1}}return!0}(e):Tv(typeof e))}function Tv(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}function Av(e){try{(e=>{Iv.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){for(var t={},r=e;null!==r;)Object.getOwnPropertyNames(r).forEach((e=>{if(!t[e]){var i=r[e];i&&(t[e]=String(i))}})),r=Object.getPrototypeOf(r);return t}(e))}(e))})(e)}catch(e){}}var Ev,Rv=performance,Nv="telemetry.sdk.language",Mv="telemetry.sdk.name",Fv="telemetry.sdk.version",Ov={[Mv]:"opentelemetry","process.runtime.name":"browser",[Nv]:"webjs",[Fv]:"2.2.0"},Pv=Math.pow(10,6),Lv=Math.pow(10,9);function Dv(e){return[Math.trunc(e/1e3),Math.round(e%1e3*Pv)]}function Bv(){var e=Rv.timeOrigin;return"number"!=typeof e&&(e=Rv.timing&&Rv.timing.fetchStart),e}function jv(e){if(s=e,Array.isArray(s)&&2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1])return e;if("number"==typeof e)return e<Bv()?(t=e,r=Dv(Bv()),i=Dv("number"==typeof t?t:Rv.now()),Lv>(n=[r[0]+i[0],r[1]+i[1]])[1]||(n[1]-=Lv,n[0]+=1),n):Dv(e);var t,r,i,n,s;if(e instanceof Date)return Dv(e.getTime());throw TypeError("Invalid input type")}!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(Ev||(Ev={}));var $v="[object Object]",qv="[object Null]",Zv="[object Undefined]",Hv=function(){}.toString,Vv=Hv.call(Object),zv=Object.getPrototypeOf,Uv=Object.prototype,Yv=Uv.hasOwnProperty,Gv=Symbol?Symbol.toStringTag:void 0,Wv=Uv.toString;function Xv(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||function(e){return null==e?void 0===e?Zv:qv:Gv&&Gv in Object(e)?function(e){var t=Yv.call(e,Gv),r=e[Gv],i=!1;try{e[Gv]=void 0,i=!0}catch(e){}var n=Wv.call(e);return i&&(t?e[Gv]=r:delete e[Gv]),n}(e):function(e){return Wv.call(e)}(e)}(e)!==$v)return!1;var t=zv(e);if(null===t)return!0;var r=Yv.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Hv.call(r)===Vv}function Jv(e){return ef(e)?e.slice():e}function Kv(e,t,r,i){var n;if(void 0===r&&(r=0),20>=r){if(r++,nf(e)||nf(t)||tf(t))n=Jv(t);else if(ef(e)){if(n=e.slice(),ef(t))for(var s=0,o=t.length;o>s;s++)n.push(Jv(t[s]));else if(rf(t))for(var a=Object.keys(t),l=0,u=a.length;u>l;l++){var h=a[l];n[h]=Jv(t[h])}}else if(rf(e))if(rf(t)){if(!function(e,t){return!(!Xv(e)||!Xv(t))}(e,t))return t;n=Object.assign({},e);for(var c=Object.keys(t),d=0,v=c.length;v>d;d++){var f=c[d],p=t[f];if(nf(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(Qv(e,f,i)||Qv(t,f,i))delete n[f];else{if(rf(g)&&rf(m)){var y=i.get(g)||[],b=i.get(m)||[];y.push({obj:e,key:f}),b.push({obj:t,key:f}),i.set(g,y),i.set(m,b)}n[f]=Kv(n[f],p,r,i)}}}}else n=t;return n}}function Qv(e,t,r){for(var i=r.get(e[t])||[],n=0,s=i.length;s>n;n++){var o=i[n];if(o.key===t&&o.obj===e)return!0}return!1}function ef(e){return Array.isArray(e)}function tf(e){return"function"==typeof e}function rf(e){return!nf(e)&&!ef(e)&&!tf(e)&&"object"==typeof e}function nf(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}class sf extends Error{constructor(e){super(e),Object.setPrototypeOf(this,sf.prototype)}}function of(e,t){var r,i=new Promise((function(e,i){r=setTimeout((function(){i(new sf("Operation timed out."))}),t)}));return Promise.race([e,i]).then((e=>(clearTimeout(r),e)),(e=>{throw clearTimeout(r),e}))}class af{constructor(){this.Se=void 0,this.ke=void 0,this.xe=void 0,this.Se=new Promise(((e,t)=>{this.ke=e,this.xe=t}))}get promise(){return this.Se}resolve(e){this.ke(e)}reject(e){this.xe(e)}}class lf{constructor(e,t){this.Ae=void 0,this.Te=void 0,this.Ne=!1,this.Re=new af,this.Ae=e,this.Te=t}get isCalled(){return this.Ne}get promise(){return this.Re.promise}call(){if(!this.Ne){this.Ne=!0;try{for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];Promise.resolve(this.Ae.call(this.Te,...t)).then((e=>this.Re.resolve(e)),(e=>this.Re.reject(e)))}catch(e){this.Re.reject(e)}}return this.Re.promise}}var uf={Me:(e,t)=>new Promise((r=>{_v.with(function(e){return e.setValue(xv,!0)}(_v.active()),(()=>{e.export(t,(e=>{r(e)}))}))}))};class hf{constructor(e,t,r,i,n){this._e=void 0,this.Ee=void 0,this.Oe=void 0,this.Le=void 0,this.Fe=void 0,this.Be=void 0,this._e=e,this.Ee=t,this.Oe=r,this.Le=i,this.Fe=n,this.Be=Iv.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this.Be.debug("items to be sent",e),this.Le.hasReachedLimit())t({code:Ev.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this.Ee.serializeRequest(e);null!=r?this.Le.pushPromise(this._e.send(r,this.Fe).then((e=>{if("success"!==e.status)t("failure"===e.status&&e.error?{code:Ev.FAILED,error:e.error}:"retryable"===e.status?{code:Ev.FAILED,error:new Ed("Export failed with retryable status")}:{code:Ev.FAILED,error:new Ed("Export failed with unknown error")});else{if(null!=e.data)try{this.Oe.handleResponse(this.Ee.deserializeResponse(e.data))}catch(t){this.Be.warn("Export succeeded but could not deserialize response - is the response specification compliant?",t,e.data)}t({code:Ev.SUCCESS})}}),(e=>t({code:Ev.FAILED,error:e})))):t({code:Ev.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.Le.awaitAll()}shutdown(){var e=this;return t((function*(){e.Be.debug("shutdown started"),yield e.forceFlush(),e._e.shutdown()}))()}}function cf(e,t,r){return i={transport:r,serializer:t,promiseHandler:Md(e)},new hf(i.transport,i.serializer,{handleResponse(e){null!=e&&function(e){return{}.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&Iv.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}},i.promiseHandler,{timeout:e.timeoutMillis}.timeout);var i}function df(e){return 48>e||e>57?97>e||e>102?e-55:e-87:e-48}function vf(e){for(var t=new Uint8Array(e.length/2),r=0,i=0;e.length>i;i+=2){var n=df(e.charCodeAt(i)),s=df(e.charCodeAt(i+1));t[r++]=n<<4|s}return t}function ff(e){var t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function pf(e){var t;return t=ff(e),{low:Number(BigInt.asUintN(32,t)),high:Number(BigInt.asUintN(32,t>>BigInt(32)))}}var gf="undefined"!=typeof BigInt?function(e){return ff(e).toString()}:function(e){return e[0]*Lv+e[1]};function mf(e){return e}function yf(e){if(void 0!==e)return vf(e)}var bf={encodeHrTime:pf,encodeSpanContext:vf,encodeOptionalSpanContext:yf};function wf(e,t){return{key:e,value:_f(t)}}function _f(e){var t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(_f)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map((e=>{var[t,r]=e;return wf(t,r)}))}}:{}}function If(e,t){var r=function(e){var t=new Map;for(var r of e){var{resource:i,instrumentationScope:{name:n,version:s="",schemaUrl:o=""}}=r,a=t.get(i);a||(a=new Map,t.set(i,a));var l=n+"@"+s+":"+o,u=a.get(l);u||a.set(l,u=[]),u.push(r)}return t}(e);return Array.from(r,(e=>{var[r,i]=e,n=function(e){var t,r={attributes:(t=e.attributes,Object.keys(t).map((e=>wf(e,t[e])))),droppedAttributesCount:0},i=e.schemaUrl;return i&&""!==i&&(r.schemaUrl=i),r}(r);return{resource:n,scopeLogs:Array.from(i,(e=>{var r,[,i]=e;return{scope:(r=i[0].instrumentationScope,{name:r.name,version:r.version}),logRecords:i.map((e=>function(e,t){var r,i,n,s;return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:e.severityNumber,severityText:e.severityText,body:_f(e.body),eventName:e.eventName,attributes:(s=e.attributes,Object.keys(s).map((e=>wf(e,s[e])))),droppedAttributesCount:e.droppedAttributesCount,flags:null==(r=e.spanContext)?void 0:r.traceFlags,traceId:t.encodeOptionalSpanContext(null==(i=e.spanContext)?void 0:i.traceId),spanId:t.encodeOptionalSpanContext(null==(n=e.spanContext)?void 0:n.spanId)}}(e,t))),schemaUrl:i[0].instrumentationScope.schemaUrl}})),schemaUrl:n.schemaUrl}}))}var Cf=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class Sf{static FromAttributeList(e,t){var r=new Sf({},t);return r.Ze=kf(e),r.Pe=e.filter((e=>{var[t,r]=e;return Cf(r)})).length>0,r}constructor(e,t){var r;this.Ze=void 0,this.Pe=!1,this.De=void 0,this.qe=void 0;var i=null!==(r=e.attributes)&&void 0!==r?r:{};this.Ze=Object.entries(i).map((e=>{var[t,r]=e;return Cf(r)&&(this.Pe=!0),[t,r]})),this.Ze=kf(this.Ze),this.De=function(e){if("string"==typeof e||void 0===e)return e;Iv.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}(null==t?void 0:t.schemaUrl)}get asyncAttributesPending(){return this.Pe}waitForAsyncAttributes(){var e=this;return t((function*(){if(e.asyncAttributesPending){for(var t=0;e.Ze.length>t;t++){var[r,i]=e.Ze[t];e.Ze[t]=[r,Cf(i)?yield i:i]}e.Pe=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Iv.error("Accessing resource attributes before async attributes settled"),this.qe)return this.qe;var e={};for(var[t,r]of this.Ze){var i;Cf(r)?Iv.debug("Unsettled resource attribute "+t+" skipped"):null!=r&&(null!==(i=e[t])&&void 0!==i||(e[t]=r))}return this.Pe||(this.qe=e),e}getRawAttributes(){return this.Ze}get schemaUrl(){return this.De}merge(e){if(null==e)return this;var t,r,i,n,s=(n=null==(r=e)?void 0:r.schemaUrl,void 0===(i=null==(t=this)?void 0:t.schemaUrl)||""===i?n:void 0===n||""===n||i===n?i:void Iv.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',i,n)),o=s?{schemaUrl:s}:void 0;return Sf.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],o)}}function xf(e,t){return Sf.FromAttributeList(Object.entries(e),t)}function kf(e){return e.map((e=>{var[t,r]=e;return Cf(r)?[t,r.catch((e=>{Iv.debug("promise rejection for resource attribute: %s - %s",t,e)}))]:[t,r]}))}var Tf={serializeRequest(e){var t,r,i=(t=e,r=function(e){var t,r;if(void 0===e)return bf;var i=null===(t=e.useLongBits)||void 0===t||t,n=null!==(r=e.useHex)&&void 0!==r&&r;return{encodeHrTime:i?pf:gf,encodeSpanContext:n?mf:vf,encodeOptionalSpanContext:n?mf:yf}}({useHex:!0,useLongBits:!1}),{resourceLogs:If(t,r)});return(new TextEncoder).encode(JSON.stringify(i))},deserializeResponse(e){if(0===e.length)return{};var t=new TextDecoder;return JSON.parse(t.decode(e))}};class Af{constructor(e){this._e=void 0,this._e=e}retry(e,t,r){return new Promise(((i,n)=>{setTimeout((()=>{this._e.send(e,t).then(i,n)}),r)}))}send(e,r){var i=this;return t((function*(){for(var t=Date.now()+r,n=yield i._e.send(e,r),s=5,o=1e3;"retryable"===n.status&&s>0;){var a;s--;var l=Math.max(Math.min(o,5e3)+(.4*Math.random()-.2),0);o*=1.5;var u=null!==(a=n.retryInMillis)&&void 0!==a?a:l,h=t-Date.now();if(u>h)return n;n=yield i.retry(e,h,u)}return n}))()}shutdown(){return this._e.shutdown()}}function Ef(e){return new Af(e.transport)}function Rf(e){return[429,502,503,504].includes(e)}function Nf(e){if(null!=e){var t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;var r=new Date(e).getTime()-Date.now();return 0>r?0:r}}class Mf{constructor(e){this.Ve=void 0,this.Ve=e}send(e,r){var i=this;return t((function*(){var t=yield i.Ve.headers(),n=yield new Promise((n=>{var s=new XMLHttpRequest;s.timeout=r,s.open("POST",i.Ve.url),Object.entries(t).forEach((e=>{var[t,r]=e;s.setRequestHeader(t,r)})),s.ontimeout=e=>{n({status:"failure",error:new Error("XHR request timed out")})},s.onreadystatechange=()=>{200>s.status||s.status>299?s.status&&Rf(s.status)?n({status:"retryable",retryInMillis:Nf(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")}):(Iv.debug("XHR success"),n({status:"success"}))},s.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},s.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},s.send(e)}));return n}))()}shutdown(){}}class Ff{constructor(e){this.je=void 0,this.je=e}send(e){var r=this;return t((function*(){var t=(yield r.je.headers())["Content-Type"];return new Promise((i=>{navigator.sendBeacon(r.je.url,new Blob([e],{type:t}))?(Iv.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Of{constructor(e){this.Ve=void 0,this.Ve=e}send(e,r){var i=this;return t((function*(){var t=new AbortController,n=setTimeout((()=>t.abort()),r);try{var s,o=!!globalThis.location,a=new URL(i.Ve.url),l=yield fetch(a.href,{method:"POST",headers:yield i.Ve.headers(),body:e,signal:t.signal,keepalive:o,mode:o?(null==(s=globalThis.location)?void 0:s.origin)===a.origin?"same-origin":"cors":"no-cors"});return 200>l.status||l.status>299?Rf(l.status)?{status:"retryable",retryInMillis:Nf(l.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}:(Iv.debug("response success"),{status:"success"})}catch(e){return"AbortError"===(null==e?void 0:e.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:e})}:{status:"failure",error:new Error("Fetch request errored",{cause:e})}}finally{clearTimeout(n)}}))()}shutdown(){}}function Pf(e,t){return cf(e,t,Ef({transport:(r=e,new Mf(r))}));var r}function Lf(e,t){return cf(e,t,Ef({transport:(r=e,new Of(r))}));var r}function Df(e,t){return cf(e,t,Ef({transport:(r={url:e.url,headers:e.headers},new Ff(r))}));var r}function Bf(e){if(null!=e)try{var t,r=null==(t=globalThis.location)?void 0:t.href;return new URL(e,r).href}catch(t){throw new Error("Configuration: Could not parse user-provided export URL: '"+e+"'")}}function jf(e){return"function"==typeof e.headers?e.headers:function(e){if(null!=e)return t((function*(){return e}))}(e.headers)}function $f(e,i,n){return s={url:e.url,timeoutMillis:e.timeoutMillis,headers:jf(e),concurrencyLimit:e.concurrencyLimit},o={},a=function(e,i){return r({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(n=t((function*(){return e})),function(){return n.apply(this,arguments)}),url:"http://localhost:4318/"+i});var n}(n,i),r({},function(e,t,r){var i,n,s,o,a,l;return{timeoutMillis:Rd(null!==(i=null!==(n=e.timeoutMillis)&&void 0!==n?n:t.timeoutMillis)&&void 0!==i?i:r.timeoutMillis),concurrencyLimit:null!==(s=null!==(o=e.concurrencyLimit)&&void 0!==o?o:t.concurrencyLimit)&&void 0!==s?s:r.concurrencyLimit,compression:null!==(a=null!==(l=e.compression)&&void 0!==l?l:t.compression)&&void 0!==a?a:r.compression}}(s,o,a),{headers:(h=s.headers,c=o.headers,d=a.headers,t((function*(){var e=r({},yield d()),t={};return null!=c&&Object.assign(t,yield c()),null!=h&&Object.assign(t,function(e){var t={};return Object.entries(null!=e?e:{}).forEach((e=>{var[r,i]=e;void 0!==i?t[r]=String(i):Iv.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),t}(yield h())),Object.assign(t,e)}))),url:null!==(l=null!==(u=Bf(s.url))&&void 0!==u?u:o.url)&&void 0!==l?l:a.url});var s,o,a,l,u,h,c,d}function qf(e,t,r,i){return(e.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?Lf:Pf:Df)($f(e,r,i),t)}class Zf extends Ad{constructor(e){void 0===e&&(e={}),super(qf(e,Tf,"v1/logs",{"Content-Type":"application/json"}))}}class Hf{set severityText(e){this.He()||(this.Ye=e)}get severityText(){return this.Ye}set severityNumber(e){this.He()||(this.Ge=e)}get severityNumber(){return this.Ge}set body(e){this.He()||(this.We=e)}get body(){return this.We}get eventName(){return this.Ue}set eventName(e){this.He()||(this.Ue=e)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(e,t,r){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this.Ye=void 0,this.Ge=void 0,this.We=void 0,this.Ue=void 0,this.totalAttributesCount=0,this.ze=!1,this.Xe=void 0;var{timestamp:i,observedTimestamp:n,eventName:s,severityNumber:o,severityText:a,body:l,attributes:u={},context:h}=r,c=Date.now();if(this.hrTime=jv(null!=i?i:c),this.hrTimeObserved=jv(null!=n?n:c),h){var d=Sv.getSpanContext(h);d&&vv(d)&&(this.spanContext=d)}this.severityNumber=o,this.severityText=a,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this.Xe=e.logRecordLimits,this.Ue=s,this.setAttributes(u)}setAttribute(e,t){return this.He()||null===t?this:0===e.length?(Iv.warn("Invalid attribute key: "+e),this):kv(t)||"object"==typeof t&&!Array.isArray(t)&&Object.keys(t).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length<this.Xe.attributeCountLimit||{}.hasOwnProperty.call(this.attributes,e)?(this.attributes[e]=kv(t)?this.Ke(t):t,this):(1===this.droppedAttributesCount&&Iv.warn("Dropping extra attributes."),this)):(Iv.warn("Invalid attribute value set for key: "+e),this)}setAttributes(e){for(var[t,r]of Object.entries(e))this.setAttribute(t,r);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}Je(){this.ze=!0}Ke(e){var t=this.Xe.attributeValueLengthLimit;return t>0?"string"==typeof e?this.Qe(e,t):Array.isArray(e)?e.map((e=>"string"==typeof e?this.Qe(e,t):e)):e:(Iv.warn("Attribute value limit must be positive, got "+t),e)}Qe(e,t){return e.length>t?e.substring(0,t):e}He(){return this.ze&&Iv.warn("Can not execute the operation on emitted log record"),this.ze}}class Vf{constructor(e,t){this.instrumentationScope=void 0,this.$e=void 0,this.instrumentationScope=e,this.$e=t}emit(e){var t=e.context||_v.active(),i=new Hf(this.$e,this.instrumentationScope,r({context:t},e));this.$e.activeProcessor.onEmit(i,t),i.Je()}}class zf{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}}class Uf{constructor(e,t){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=e,this.forceFlushTimeoutMillis=t}forceFlush(){var e=this;return t((function*(){var t=e.forceFlushTimeoutMillis;yield Promise.all(e.processors.map((e=>of(e.forceFlush(),t))))}))()}onEmit(e,t){this.processors.forEach((r=>r.onEmit(e,t)))}shutdown(){var e=this;return t((function*(){yield Promise.all(e.processors.map((e=>e.shutdown())))}))()}}class Yf{constructor(e,t,r,i){this.resource=void 0,this.forceFlushTimeoutMillis=void 0,this.logRecordLimits=void 0,this.processors=void 0,this.loggers=new Map,this.activeProcessor=void 0,this.registeredLogRecordProcessors=[],this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=r,this.processors=i,i.length>0?(this.registeredLogRecordProcessors=i,this.activeProcessor=new Uf(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new zf}}class Gf{constructor(e){var t,r,i;void 0===e&&(e={}),this.et=void 0,this.$e=void 0;var n,s,o,a,l,u,h,c=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];for(var i=t.shift(),n=new WeakMap;t.length>0;)i=Kv(i,t.shift(),0,n);return i}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},e),d=null!==(t=e.resource)&&void 0!==t?t:xf({"service.name":"unknown_service",[Nv]:Ov[Nv],[Mv]:Ov[Mv],[Fv]:Ov[Fv]});this.$e=new Yf(d,c.forceFlushTimeoutMillis,{attributeCountLimit:null!==(s=null!==(o=null!==(a=(n=c.logRecordLimits).attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==o?o:void 0)&&void 0!==s?s:128,attributeValueLengthLimit:null!==(l=null!==(u=null!==(h=n.attributeValueLengthLimit)&&void 0!==h?h:void 0)&&void 0!==u?u:void 0)&&void 0!==l?l:1/0},null!==(r=null==(i=e)?void 0:i.processors)&&void 0!==r?r:[]),this.et=new lf(this.tt,this)}getLogger(e,t,r){if(this.et.isCalled)return Iv.warn("A shutdown LoggerProvider cannot provide a Logger"),bd;e||Iv.warn("Logger requested without instrumentation scope name.");var i=e||"unknown",n=i+"@"+(t||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this.$e.loggers.has(n)||this.$e.loggers.set(n,new Vf({name:i,version:t,schemaUrl:null==r?void 0:r.schemaUrl},this.$e)),this.$e.loggers.get(n)}forceFlush(){return this.et.isCalled?(Iv.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.et.promise):this.$e.activeProcessor.forceFlush()}shutdown(){return this.et.isCalled?(Iv.warn("shutdown may only be called once per LoggerProvider"),this.et.promise):this.et.call()}tt(){return this.$e.activeProcessor.shutdown()}}class Wf{constructor(e,t){var r,i,n,s,o,a,l,u;this.rt=void 0,this.nt=void 0,this.it=void 0,this.ot=void 0,this.st=void 0,this.ut=!1,this.ct=[],this.dt=void 0,this.et=void 0,this.rt=e,this.nt=null!==(r=null!==(i=null==t?void 0:t.maxExportBatchSize)&&void 0!==i?i:void 0)&&void 0!==r?r:512,this.it=null!==(n=null!==(s=null==t?void 0:t.maxQueueSize)&&void 0!==s?s:void 0)&&void 0!==n?n:2048,this.ot=null!==(o=null!==(a=null==t?void 0:t.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==o?o:5e3,this.st=null!==(l=null!==(u=null==t?void 0:t.exportTimeoutMillis)&&void 0!==u?u:void 0)&&void 0!==l?l:3e4,this.et=new lf(this.tt,this),this.nt>this.it&&(Iv.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this.nt=this.it)}onEmit(e){this.et.isCalled||this.ht(e)}forceFlush(){return this.et.isCalled?this.et.promise:this.vt()}shutdown(){return this.et.call()}tt(){var e=this;return t((function*(){e.onShutdown(),yield e.vt(),yield e.rt.shutdown()}))()}ht(e){this.it>this.ct.length&&(this.ct.push(e),this.ft())}vt(){return new Promise(((e,t)=>{for(var r=[],i=Math.ceil(this.ct.length/this.nt),n=0;i>n;n++)r.push(this.yt());Promise.all(r).then((()=>{e()})).catch(t)}))}yt(){return this.bt(),0===this.ct.length?Promise.resolve():new Promise(((e,t)=>{of(this.Me(this.ct.splice(0,this.nt)),this.st).then((()=>e())).catch(t)}))}ft(){if(!this.ut){var e=()=>{this.ut=!0,this.yt().then((()=>{this.ut=!1,this.ct.length>0&&(this.bt(),this.ft())})).catch((e=>{this.ut=!1,Av(e)}))};if(this.ct.length>=this.nt)return e();void 0===this.dt&&(this.dt=setTimeout((()=>e()),this.ot),"number"!=typeof this.dt&&this.dt.unref())}}bt(){void 0!==this.dt&&(clearTimeout(this.dt),this.dt=void 0)}Me(e){var t=()=>uf.Me(this.rt,e).then((e=>{var t;e.code!==Ev.SUCCESS&&Av(null!==(t=e.error)&&void 0!==t?t:new Error("BatchLogRecordProcessor: log record export failed (status "+e+")"))})).catch(Av),r=e.map((e=>e.resource)).filter((e=>e.asyncAttributesPending));return 0===r.length?t():Promise.all(r.map((e=>null==e.waitForAsyncAttributes?void 0:e.waitForAsyncAttributes()))).then(t,Av)}}class Xf extends Wf{constructor(e,t){super(e,t),this.wt=void 0,this.Ct=void 0,this.It(t)}onShutdown(){"undefined"!=typeof document&&(this.wt&&document.removeEventListener("visibilitychange",this.wt),this.Ct&&document.removeEventListener("pagehide",this.Ct))}It(e){!0!==(null==e?void 0:e.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this.wt=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this.Ct=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this.wt),document.addEventListener("pagehide",this.Ct))}}var Jf=1e4,Kf=function(e,t,r,i,n,s){if(void 0===t&&(t=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=Jf),void 0===s&&(s=new WeakSet),s.has(e))return r[t||"circular"]="[Circular]",r;for(var o in s.add(e),e)if({}.hasOwnProperty.call(e,o)){var a=e[o],l=t?t+"."+o:o;if(Ur(a))Kf(a,l,r,i,n,s);else{if(i-=1,n-=String(a).length,n-=l.length,0>=i||0>=n)return void(r.attributes_truncated=!0);r[l]=a}}return r},Qf={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};ss.__PosthogExtensions__=ss.__PosthogExtensions__||{},ss.__PosthogExtensions__.logs={initializeLogs(e){(e=>{var t,i={"service.name":(null==(t=e.config.logs)?void 0:t.serviceName)||"posthog-browser-logs",host:ss.location.host};if(e.sessionManager){var{sessionId:n,windowId:s}=e.sessionManager.checkAndGetSessionAndWindowId(!0);i=r({},i,{"session.id":n,"window.id":s})}Td.setGlobalLoggerProvider(new Gf({resource:xf(i),processors:[new Xf(new Zf({url:e.config.api_host+"/i/v1/logs?token="+e.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(e);var t=Td.getLogger("console"),i={};if(e.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:s}=e.sessionManager.checkAndGetSessionAndWindowId(!0);i={sessionStartTimestamp:n.toString(),lastActivityTimestamp:s.toString()}}var o=function(n){var s;ss.console[n]=(s=ss.console[n],function(){for(var o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];if(a.length>0){var u=a.map((e=>{return JSON.stringify(e,(t=new WeakSet,(e,i)=>{if(i instanceof Error)return r({},i,{name:i.name,message:i.message,stack:i.stack});if("object"==typeof i&&!Jr(i)){if(t.has(i))return"[Circular]";t.add(i)}return i}));var t})).join(" ");u.length>Jf&&(u=u.slice(0,Jf)+"...",i.body_truncated="true"),t.emit({severityText:Qf[n],body:u,attributes:r({"log.source":"console."+n,distinct_id:e.get_distinct_id(),"location.href":ss.location.href},i,Ur(a[0])?Kf(a[0]):{})}),s.apply(ss.console,a)}})};for(var a of["debug","log","warn","error","info"])o(a)}};var ep=cs("[Error tracking]");function tp(){return new yn([new Nn,new qn,new Fn,new Mn,new jn,new Bn,new Pn,new $n],function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;t>n;n++)i[n-1]=arguments[n];return function(t,n){void 0===n&&(n=0);for(var s=[],o=t.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=En.test(l)?l.replace(En,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var c=h(u,e);if(c){s.push(c);break}}if(s.length>=Rn)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,Rn).map((e=>{return r({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||bn});var i}))}(s)}}("web:javascript",xn,An))}var rp=cs("[ExceptionAutocapture]"),ip=tp(),np={wrapOnError(e){var t=Wn;t||rp.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var o=ip.buildFromUnknown(n[4]||n[0],{mechanism:{handled:!1}});return e(o),null!==(t=null==r?void 0:r(...n))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection(e){var t=Wn;t||rp.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(t){var i,n=ip.buildFromUnknown(t,{mechanism:{handled:!1}});return e(n),null!==(i=null==r?void 0:r(t))&&void 0!==i&&i},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError(e){var t=console;t||rp.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];t=1==n.length?n[0]:n.join(" ");var o=n.find((e=>e instanceof Error)),a=ip.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return e(a),null==r?void 0:r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};ss.__PosthogExtensions__=ss.__PosthogExtensions__||{},ss.__PosthogExtensions__.errorWrappingFunctions=np,ss.posthogErrorWrappingFunctions=np;var sp=(e,t,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(e){return}if(!Vr(e)||e.includes(n)){if(r){var{sessionId:s,windowId:o}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",s),i.headers.set("X-POSTHOG-WINDOW-ID",o)}t!==Io&&i.headers.set("X-POSTHOG-DISTINCT-ID",t)}};ss.__PosthogExtensions__=ss.__PosthogExtensions__||{};var op={_patchFetch:(e,r,i)=>As(Wn,"fetch",(n=>function(){var s=t((function*(t,s){var o=new Request(t,s);return sp(e,r,i,o),n(o)}));return function(e,t){return s.apply(this,arguments)}}())),_patchXHR:(e,t,r)=>As(Wn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=new Request(s);return sp(e,t,r,u),i.call(this,n,u.url,o,a,l)}))};ss.__PosthogExtensions__.tracingHeadersPatchFns=op,ss.postHogTracingHeadersPatchFns=op;var ap=-1,lp=e=>{addEventListener("pageshow",(t=>{t.persisted&&(ap=t.timeStamp,e(t))}),!0)},up=(e,t,r,i)=>{var n,s;return o=>{t.value>=0&&(o||i)&&((s=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},hp=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},cp=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},dp=()=>{var e,t=cp();return null!==(e=null==t?void 0:t.activationStart)&&void 0!==e?e:0},vp=function(e,t){void 0===t&&(t=-1);var r=cp(),i="navigate";return 0>ap?r&&(document.prerendering||dp()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},fp=new WeakMap;function pp(e,t){return fp.get(e)||fp.set(e,new t),fp.get(e)}class gp{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var mp,yp=function(e,t,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return n.observe(r({type:e,buffered:!0},i)),n}}catch(e){}},bp=e=>{var t=!1;return()=>{t||(e(),t=!0)}},wp=-1,_p=new Set,Ip=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Cp=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of _p)t();isFinite(wp)||(wp="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Cp,!0))}},Sp=()=>{if(0>wp){var e,t=dp(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").filter((e=>"hidden"===e.name&&e.startTime>t))[0])?void 0:e.startTime;wp=null!=r?r:Ip(),addEventListener("visibilitychange",Cp,!0),addEventListener("prerenderingchange",Cp,!0),lp((()=>{setTimeout((()=>{wp=Ip()}))}))}return{get firstHiddenTime(){return wp},onHidden(e){_p.add(e)}}},xp=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},kp=[1800,3e3],Tp=function(e,t){void 0===t&&(t={}),xp((()=>{var r,i=Sp(),n=vp("FCP"),s=yp("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-dp(),0),n.entries.push(t),r(!0)))}));s&&(r=up(e,n,kp,t.reportAllChanges),lp((i=>{n=vp("FCP"),r=up(e,n,kp,t.reportAllChanges),hp((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Ap=[.1,.25],Ep=0,Rp=1/0,Np=0,Mp=e=>{for(var t of e)t.interactionId&&(Rp=Math.min(Rp,t.interactionId),Np=Math.max(Np,t.interactionId),Ep=Np?(Np-Rp)/7+1:0)},Fp=()=>{var e;return mp?Ep:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Op=0;class Pp{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){Op=Fp(),this.u.length=0,this.l.clear()}L(){var e=Math.min(this.u.length-1,Math.floor((Fp()-Op)/50));return this.u[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.u.at(-1),i=this.l.get(e.interactionId);if(i||10>this.u.length||e.duration>r.P){var n;if(i?e.duration>i.P?(i.entries=[e],i.P=e.duration):e.duration===i.P&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.l.set((i={id:e.interactionId,entries:[e],P:e.duration}).id,i),this.u.push(i)),this.u.sort(((e,t)=>t.P-e.P)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.l.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var Lp=e=>{var t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=bp(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},Dp=[200,500];class Bp{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var jp=[2500,4e3],$p={onLCP(e,t){void 0===t&&(t={}),xp((()=>{var r,i=Sp(),n=vp("LCP"),s=pp(t,Bp),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-dp(),0),n.entries=[o],r())},a=yp("largest-contentful-paint",o);if(a){r=up(e,n,jp,t.reportAllChanges);var l=bp((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=e=>{e.isTrusted&&(Lp(l),removeEventListener(e.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});lp((i=>{n=vp("LCP"),r=up(e,n,jp,t.reportAllChanges),hp((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(e,t){void 0===t&&(t={});var r=Sp();Tp(bp((()=>{var i,n=vp("CLS",0),s=pp(t,gp),o=e=>{for(var t of e)s.h(t);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=yp("layout-shift",o);a&&(i=up(e,n,Ap,t.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),lp((()=>{s.i=0,n=vp("CLS",0),i=up(e,n,Ap,t.reportAllChanges),hp((()=>i()))})),setTimeout(i))})))},onFCP:Tp,onINP(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Sp();xp((()=>{var i;"interactionCount"in performance||mp||(mp=yp("event",Mp,{type:"event",buffered:!0,durationThreshold:0}));var n,s=vp("INP"),o=pp(t,Pp),a=e=>{Lp((()=>{for(var t of e)o.h(t);var r=o.L();r&&r.P!==s.value&&(s.value=r.P,s.entries=r.entries,n())}))},l=yp("event",a,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=up(e,s,Dp,t.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),lp((()=>{o.v(),s=vp("INP"),n=up(e,s,Dp,t.reportAllChanges)})))}))}}};ss.__PosthogExtensions__=ss.__PosthogExtensions__||{},ss.__PosthogExtensions__.postHogWebVitalsCallbacks=$p,ss.postHogWebVitalsCallbacks=$p,ss.__PosthogExtensions__.loadWebVitalsCallbacks=()=>$p;class qp{constructor(e){this.disabled=!1===e;var t=Ur(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var Zp="$copy_autocapture",Hp=cs("[AutoCapture]");function Vp(e,t){return t.length>e?t.slice(0,e)+"...":t}function zp(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Zo(t));return t}function Up(e,t){var i,n,{e:s,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u}=t;if(!Zo(e))return{props:{}};for(var h=[e],c=e;c.parentNode&&!Ho(c,"body");)if(zo(c.parentNode))h.push(c.parentNode.host),c=c.parentNode.host;else{if(!Zo(c.parentNode))break;h.push(c.parentNode),c=c.parentNode}var d,v,f=[],p={},g=!1,m=!1;if(vs(h,(e=>{var t=sa(e);if(Ho(e,"a")){var r=e.getAttribute("href");g=t&&!!r&&va(r)&&r}Br(Go(e),"ph-no-capture")&&(m=!0),f.push(function(e,t,r,i){var n=e.tagName.toLowerCase(),s={tag_name:n};Ko.indexOf(n)>-1&&!r&&(s.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?Vp(1024,fa(e)):Vp(1024,Xo(e)));var o=Go(e);o.length>0&&(s.classes=o.filter((function(e){return""!==e}))),vs(e.attributes,(function(r){var n;if((!oa(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!t&&va(r.value)&&(!Wr(n=r.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=r.value;"class"===r.name&&(o=Uo(o).join(" ")),s["attr__"+r.name]=Vp(1024,o)}}));for(var a=1,l=1,u=e;u=zp(u);)a++,u.tagName===e.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}(e,o,a,l));var i=function(e){if(!sa(e))return{};var t={};return vs(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&va(i)&&(t[r]=i)}})),t}(e);fs(p,i)})),m)return{props:{},explicitNoCapture:m};if(a||(f[0].$el_text=Ho(e,"a")||Ho(e,"button")?fa(e):Xo(e)),g){var y,b;f[0].attr__href=g;var w=null==(y=Cs(g))?void 0:y.host,_=null==Wn||null==(b=Wn.location)?void 0:b.host;w&&_&&w!==_&&(d=g)}return{props:fs({$event_type:s.type,$ce_version:1},u?{}:{$elements:f},{$elements_chain:(v=f,function(e){var t=e.map((e=>{var t,i,n="";if(e.tag_name&&(n+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))n+="."+s.replace(/"/g,"");var o=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return ps(o).sort(((e,t)=>{var[r]=e,[i]=t;return r.localeCompare(i)})).forEach((e=>{var[t,r]=e;return a[ga(t.toString())]=ga(r.toString())})),(n+=":")+ps(a).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:ma(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return ps(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return i.attributes[t]=r})),i}))}(v)))},null!=(i=f[0])&&i.$el_text?{$el_text:null==(n=f[0])?void 0:n.$el_text}:{},d&&"click"===s.type?{$external_click_url:d}:{},p)}}var Yp={};function Gp(e){return function(e,t){var r=Yp[e];if(r)return r;var i,n=t[e];if(zr(i=n)&&-1!==i.toString().indexOf("[native code]")&&!Wn.Zone)return Yp[e]=n.bind(t);var s=t.document;if(s&&zr(s.createElement))try{var o=s.createElement("iframe");o.hidden=!0,s.head.appendChild(o);var a=o.contentWindow;a&&a[e]&&(n=a[e]),s.head.removeChild(o)}catch(t){hs.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return n&&zr(n)?Yp[e]=n.bind(t):n}("MutationObserver",e)}function Wp(e,t){return Qr(e)&&e>=t}class Xp{St(e){var t,r,i,n,s,o=this.kt((null==e?void 0:e.__onCapture)||this.xt.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!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==e?void 0:e.mutation_threshold_ms)&&void 0!==n?n:o.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==s?s:o.capture_clicks_with_modifier_keys,__onCapture:o.__onCapture}}constructor(e,t){this.At=[],this.kt=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:e}),this.Tt=e=>{var t=function(e){var t=Jo(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);Jr(t)||this.Nt(t)||this.At.push(t),this.At.length&&Gr(this.Rt)&&(this.Rt=ss.setTimeout((()=>{this.Mt()}),1e3))},this._t=()=>{var e=Date.now();e%50==0&&this.At.forEach((t=>{Gr(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.Et=()=>{this.Ot=Date.now()},this.Lt=()=>{"visible"===(null==Kn?void 0:Kn.visibilityState)&&(this.Ft=Date.now())},this.instance=e,this.Bt=this.St(t),this._onCapture=this.Bt.__onCapture}start(e){this.Zt(),this.Pt(),this.Dt(),this.qt(),this.Vt(e)}Vt(e){if(!this.jt){var t=Gp(ss);this.jt=new t((e=>{this.Ht(e)})),this.jt.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.jt)||e.disconnect(),this.jt=void 0,ss.removeEventListener("click",this.Tt),ss.removeEventListener("scroll",this._t,{capture:!0}),ss.removeEventListener("selectionchange",this.Et),null==Kn||Kn.removeEventListener("visibilitychange",this.Lt)}Ht(e){this.Yt=Date.now()}Zt(){_s(ss,"click",this.Tt)}Pt(){_s(ss,"scroll",this._t,{capture:!0})}Dt(){_s(ss,"selectionchange",this.Et)}qt(){_s(Kn,"visibilitychange",this.Lt)}Nt(e){if(!e)return!0;if(!this.Bt.capture_clicks_with_modifier_keys&&((t=e.originalEvent).ctrlKey||t.metaKey||t.altKey||t.shiftKey))return!0;var t;if(qo(e.node))return!0;var r=this.At.some((t=>t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!!r||!(!Ho(e.node,"html")&&Zo(e.node)&&!Ko.includes(e.node.tagName.toLowerCase()))}Mt(){if(this.At.length){clearTimeout(this.Rt),this.Rt=void 0;var e=this.At;for(var t of(this.At=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.Yt&&this.Yt>=t.timestamp?this.Yt-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.Ot&&this.Ot>=t.timestamp?this.Ot-t.timestamp:void 0,t.visibilityChangedDelayMs=this.Ft?Math.abs(t.timestamp-this.Ft):void 0;var i=Wp(t.scrollDelayMs,this.Bt.scroll_threshold_ms),n=Wp(t.selectionChangedDelayMs,this.Bt.selection_change_threshold_ms),s=Wp(t.mutationDelayMs,this.Bt.mutation_threshold_ms),o=Wp(t.absoluteDelayMs,1.1*this.Bt.mutation_threshold_ms),a=Qr(t.scrollDelayMs)&&this.Bt.scroll_threshold_ms>t.scrollDelayMs,l=Qr(t.mutationDelayMs)&&this.Bt.mutation_threshold_ms>t.mutationDelayMs,u=Qr(t.selectionChangedDelayMs)&&this.Bt.selection_change_threshold_ms>t.selectionChangedDelayMs,h=Qr(t.visibilityChangedDelayMs)&&this.Bt.selection_change_threshold_ms>t.visibilityChangedDelayMs;if(!(a||l||u||h)){var c=Wp(t.visibilityChangedDelayMs,this.Bt.selection_change_threshold_ms);i||s||o||n||c?this._onCapture(t,{$dead_click_last_mutation_timestamp:this.Yt,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:n,$dead_click_visibility_changed_timeout:c}):this.Bt.mutation_threshold_ms>t.absoluteDelayMs&&this.At.push(t)}}this.At.length&&Gr(this.Rt)&&(this.Rt=ss.setTimeout((()=>{this.Mt()}),1e3))}}xt(e,t){this.instance.capture("$dead_click",r({},t,Up(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Bt.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,$dead_click_visibility_changed_delay_ms:e.visibilityChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}ss.__PosthogExtensions__=ss.__PosthogExtensions__||{},ss.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Xp(e,t);var Jp=cs("[ExternalScriptsLoader]"),Kp=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return Jp.warn(t+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==Kn?void 0:Kn.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===t){var e=i[o];return e.__posthog_loading_callback_fired?{v:r()}:(e.addEventListener("load",(t=>{e.__posthog_loading_callback_fired=!0,r(void 0,t)})),e.onerror=e=>r(e),{v:void 0})}},o=0;i.length>o;o++)if(n=s())return n.v;var a=()=>{if(!Kn)return r("document not found");var i=Kn.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=t,i.onload=e=>{i.__posthog_loading_callback_fired=!0,r(void 0,e)},i.onerror=e=>r(e),e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)Kn.head.appendChild(i);else{var n,s=Kn.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):Kn.body.appendChild(i)}};null!=Kn&&Kn.body?a():null==Kn||Kn.addEventListener("DOMContentLoaded",a)};ss.__PosthogExtensions__=ss.__PosthogExtensions__||{},ss.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{if("remote-config"!==t){var i;if(e.config.__preview_external_dependency_versioned_paths)i=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var n="/static/"+t+".js?v="+e.version;if("toolbar"===t){var s=3e5;n=n+"&t="+Math.floor(Date.now()/s)*s}i=e.requestRouter.endpointFor("assets",n)}Kp(e,i,r)}else{var o=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");Kp(e,o,r)}},ss.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var i=e.requestRouter.endpointFor("api",t);Kp(e,i,r)};class Qp{constructor(e){this._instance=e}get Bt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.Bt.cookieless_mode===Ao||this.isRejected()||-1===this.consent&&this.Bt.cookieless_mode===To}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Bt.opt_out_capturing_by_default}optInOut(e){this.nr.M(this.sr,e?1:0,this.Bt.cookie_expiration,this.Bt.cross_subdomain_cookie,this.Bt.secure_cookie)}reset(){this.nr.F(this.sr,this.Bt.cross_subdomain_cookie)}get sr(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:r}=this._instance.config;return r||(t?t+e:"__ph_opt_in_out_"+e)}get ir(){var e=this.nr.O(this.sr);return ai(e)?1:Br(li,e)?0:-1}get nr(){var e=this.Bt.opt_out_capturing_persistence_type,t="localStorage"===e?Mh:Rh;if(!this.ar||this.ar!==t){this.ar=t;var r="localStorage"===e?Rh:Mh;r.O(this.sr)&&(this.ar.O(this.sr)||this.optInOut(ai(r.O(this.sr))),r.F(this.sr,this.Bt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.Bt.respect_dnt&&[null==Jn?void 0:Jn.doNotTrack,null==Jn?void 0:Jn.msDoNotTrack,ss.doNotTrack].some((e=>ai(e)))}}var eg=cs("[Dead Clicks]"),tg=()=>!0,rg=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property($s)),i=e.instance.config.capture_dead_clicks;return ti(i)?i:!!Ur(i)||r};class ig{get lazyLoadedDeadClicksAutocapture(){return this.lr}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[$s]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.ur((()=>{this.hr()})):this.stop()}ur(e){var t,r;null!=(t=ss.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(r=ss.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(t=>{t?eg.error("failed to load script",t):e()}))}hr(){var e;if(Kn){if(!this.lr&&null!=(e=ss.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Ur(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.lr=ss.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.lr.start(Kn),eg.info("starting...")}}else eg.error("`document` not found. Cannot start.")}stop(){this.lr&&(this.lr.stop(),this.lr=void 0,eg.info("stopping..."))}}var ng=cs("[SegmentIntegration]");var sg="posthog-js";function og(e,t){var{organization:i,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{var l,u,h,c,d;if("*"!==o&&!o.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=v,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f,p=(null==(l=t.exception)?void 0:l.values)||[],g=p.map((e=>r({},e,{stacktrace:e.stacktrace?r({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((e=>r({},e,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(u=p[0])?void 0:u.value)||t.message,$exception_type:null==(h=p[0])?void 0:h.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=p[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=p[0])?void 0:d.type,$sentry_tags:t.tags};return i&&n&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+t.event_id),a&&(null==(f=e.exceptions)||f.sendExceptionEvent(m)),t}}class ag{constructor(e,t,r,i,n,s){this.name=sg,this.setupOnce=function(o){o(og(e,{organization:t,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class lg{constructor(e){this.cr=(e,t,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(hs.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.vr()}vr(){var e;this.pr=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.cr)}destroy(){var e;null==(e=this.pr)||e.call(this),this.pr=void 0}doPageView(e,t){var r,i=this.gr(e,t);return this.dr={pathname:null!==(r=null==Wn?void 0:Wn.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this.gr(e,null==(t=this.dr)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.dr)?void 0:e.pageViewId}}gr(e,t){var r=this.dr;if(!r)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:h}=n;if(!(Gr(s)||Gr(o)||Gr(a)||Gr(l)||Gr(u)||Gr(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var c=s>1?ui(o/s,0,1,hs):1,d=s>1?ui(a/s,0,1,hs):1,v=l>1?ui(u/l,0,1,hs):1,f=l>1?ui(h/l,0,1,hs):1;i=fs(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var ug={[Rs]:{exposure:"hidden"},[Ms]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Fs]:{exposure:"hidden"},[Os]:{exposure:"event"},[Ps]:{exposure:"hidden"},[Ls]:{exposure:"event"},[Ds]:{exposure:"hidden"},[Bs]:{exposure:"event"},[js]:{exposure:"event"},[$s]:{exposure:"event"},[qs]:{exposure:"hidden"},[Zs]:{exposure:"event"},[Hs]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Gs]:{exposure:"hidden"},[Ws]:{exposure:"event"},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},[Xs]:{exposure:"derived",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!Ur(e))return{};for(var t={},r=Object.keys(e),i=0;r.length>i;i++)t["$feature/"+r[i]]=e[r[i]];return t}},[Js]:{exposure:"event"},[Ks]:{exposure:"hidden"},[Qs]:{exposure:"hidden"},[eo]:{exposure:"event"},[to]:{exposure:"event"},[ro]:{exposure:"event"},[io]:{exposure:"hidden"},[no]:{exposure:"hidden"},[so]:{exposure:"hidden"},[oo]:{exposure:"hidden"},[ao]:{exposure:"event"},[lo]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[uo]:{exposure:"hidden"},[ho]:{exposure:"hidden"},[co]:{exposure:"hidden"},[vo]:{exposure:"hidden"},[fo]:{exposure:"hidden"},[po]:{exposure:"hidden"},[go]:{exposure:"hidden"},[mo]:{exposure:"hidden"},[yo]:{exposure:"hidden"},[bo]:{exposure:"hidden"},[wo]:{exposure:"hidden"},[Vs]:{exposure:"event"},[zs]:{exposure:"event"},[Us]:{exposure:"event"},[Ys]:{exposure:"event"},[Co]:{exposure:"event"},[So]:{exposure:"event"},[xo]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},hg=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],cg=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class dg{constructor(e,t){this.Bt=e,this.props={},this.mr=!1,this.yr=(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.nr=this.br(e),this.load(),e.debug&&hs.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.wr}br(e){-1===cg.indexOf(e.persistence.toLowerCase())&&(hs.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=function(e){void 0===e&&(e=[]);var t=[...Fh,...e];return r({},Mh,{Z(e){try{var t={};try{t=Rh.Z(e)||{}}catch(e){}var r=fs(t,JSON.parse(Mh.O(e)||"{}"));return Mh.M(e,r),r}catch(e){}return null},M(e,r,i,n,s,o){try{Mh.M(e,r,void 0,void 0,o);var a={};t.forEach((e=>{r[e]&&(a[e]=r[e])})),Object.keys(a).length&&Rh.M(e,a,i,n,s,o)}catch(e){Mh.B(e)}},F(e,t){try{null==Wn||Wn.localStorage.removeItem(e),Rh.F(e,t)}catch(e){Mh.B(e)}}})}(e.cookie_persisted_properties||[]),i=e.persistence.toLowerCase();return"localstorage"===i&&Mh.R()?Mh:"localstorage+cookie"===i&&t.R()?t:"sessionstorage"===i&&Dh.R()?Dh:"memory"===i?Ph:"cookie"===i?Rh:t.R()?t:Rh}_r(e){var t=null!=e?e:this.Bt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var r=this.props[vo];return!r||"number"!=typeof r||Date.now()-r>t}properties(){var e={};return vs(this.props,((t,r)=>{var i=(e=>{var t=ug[e];if(t)return t;for(var[r,i]of hg)if(0===e.indexOf(r))return i})(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t,r===Xs?()=>this._r():()=>!1))return;i.transformToEventProperties&&fs(e,i.transformToEventProperties(t))}else i&&"event"!==i.exposure||(e[r]=t)})),e}load(){if(!this.wr){var e=this.nr.Z(this.yr);e&&(this.props=fs({},e))}}save(){this.wr||this.nr.M(this.yr,this.props,this.Ir,this.Cr,this.Sr,this.Bt.debug)}remove(){this.nr.F(this.yr,!1),this.nr.F(this.yr,!0)}clear(){this.remove(),this.props={}}register_once(e,t,r){if(Ur(e)){Gr(t)&&(t="None"),this.Ir=Gr(r)?this.kr:r;var i=!1;if(vs(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.Tr(r,e),i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(Ur(e)){this.Ir=Gr(t)?this.kr:t;var r=!1;if(vs(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.Tr(i,t),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Ar(e),this.save())}update_campaign_params(){if(!this.mr){var e=Yc(this.Bt.custom_campaign_params,this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties);Yr(ys(e))||this.register(e),this.mr=!0}}update_search_keyword(){var e;this.register((e=null==Kn?void 0:Kn.referrer)?Wc(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Kc(),$referring_domain:null!=Kn&&Kn.referrer&&(null==(e=Cs(Kn.referrer))?void 0:e.host)||Jc},void 0)}set_initial_person_info(){this.props[mo]||this.props[yo]||this.register_once({[bo]:Qc(this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};vs([yo,mo],(t=>{var r=this.props[t];r&&vs(r,(function(t,r){e["$initial_"+$r(r)]=t}))}));var t,r,i=this.props[bo];if(i){var n=(t=ed(i),r={},vs(t,(function(e,t){r["$initial_"+$r(t)]=e})),r);fs(e,n)}return e}safe_merge(e){return vs(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(e,t,r){if(this.kr=this.Ir=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var r=[...e].sort(),i=[...t].sort();return r.every(((e,t)=>e===i[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var i=this.br(e),n=this.props;this.clear(),this.nr=i,this.props=n,this.save()}}set_disabled(e){this.wr=e,this.wr?this.remove():this.save()}set_cross_subdomain(e){e!==this.Cr&&(this.Cr=e,this.remove(),this.save())}set_secure(e){e!==this.Sr&&(this.Sr=e,this.remove(),this.save())}set_event_timer(e,t){var r=this.props[Fs]||{};r[e]=t,this.Tr(Fs,r),this.save()}remove_event_timer(e){var t=this.props[Fs]||{},r=t[e];return Gr(r)||(delete t[e],this.Tr(Fs,t),this.save()),r}get_property(e){return this.props[e]}set_property(e,t){this.Tr(e,t),this.save()}Tr(e,t){this.props[e]=t}Ar(e){delete this.props[e]}}var vg=cs("[RateLimiter]");class fg{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{vg.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void vg.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,r,i;void 0===e&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(t=null==(r=this.instance.persistence)?void 0:r.get_property(go))&&void 0!==t?t:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(go,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var pg=cs("[RemoteConfig]");class gg{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=ss._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Er(e){var t,r;null!=(t=ss.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=ss.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}Rr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return pg.info("Using preloaded remote config",this.remoteConfig),this.Nr(this.remoteConfig),void this.Mr();if(this._instance.Fr())return void pg.warn("Remote config is disabled. Falling back to local config.");this.Er((e=>{if(!e)return pg.info("No config found after loading remote JS config. Falling back to JSON."),void this.Rr((e=>{this.Nr(e),this.Mr()}));this.Nr(e),this.Mr()}))}catch(e){pg.error("Error loading remote config",e)}}stop(){this.Or&&(clearInterval(this.Or),this.Or=void 0)}refresh(){this._instance.Fr()||"hidden"===(null==Kn?void 0:Kn.visibilityState)||this._instance.reloadFeatureFlags()}Mr(){var e;if(!this.Or){var t=null!==(e=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==e?e:3e5;0!==t&&(this.Or=setInterval((()=>{this.refresh()}),t))}}Nr(e){var t;e||pg.error("Failed to fetch remote config from PostHog."),this._instance.Nr(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}var mg=3e3;class yg{constructor(e,t){this.Pr=!0,this.Lr=[],this.Dr=ui((null==t?void 0:t.flush_interval_ms)||mg,250,5e3,hs.createLogger("flush interval"),mg),this.Br=e}enqueue(e){this.Lr.push(e),this.jr||this.$r()}unload(){this.qr();var e=this.Lr.length>0?this.Zr():{},t=Object.values(e),i=[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))];i.map((e=>{this.Br(r({},e,{transport:"sendBeacon"}))}))}enable(){this.Pr=!1,this.$r()}$r(){var e=this;this.Pr||(this.jr=setTimeout((()=>{if(this.qr(),this.Lr.length>0){var t=this.Zr(),r=function(){var r=t[i],n=(new Date).getTime();r.data&&Vr(r.data)&&vs(r.data,(e=>{e.offset=Math.abs(e.timestamp-n),delete e.timestamp})),e.Br(r)};for(var i in t)r()}}),this.Dr))}qr(){clearTimeout(this.jr),this.jr=void 0}Zr(){var e={};return vs(this.Lr,(t=>{var i,n=t,s=(n?n.batchKey:null)||n.url;Gr(e[s])&&(e[s]=r({},n,{data:[]})),null==(i=e[s].data)||i.push(n.data)})),this.Lr=[],e}}var bg=["retriesPerformedSoFar"];class wg{constructor(e){this.Hr=!1,this.Vr=3e3,this.Lr=[],this._instance=e,this.Lr=[],this.zr=!0,!Gr(Wn)&&"onLine"in Wn.navigator&&(this.zr=Wn.navigator.onLine,this.Ur=()=>{this.zr=!0,this.Yr()},this.Gr=()=>{this.zr=!1},_s(Wn,"online",this.Ur),_s(Wn,"offline",this.Gr))}get length(){return this.Lr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=i(e,bg);ei(t)&&(n.url=mh(n.url,{retry_count:t})),this._instance._send_request(r({},n,{callback:e=>{200===e.statusCode||e.statusCode>=400&&500>e.statusCode||(null!=t?t:0)>=10?null==n.callback||n.callback(e):this.Wr(r({retriesPerformedSoFar:t},n))}}))}Wr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(e){var t=3e3*Math.pow(2,e),r=t/2,i=Math.min(18e5,t),n=Math.random()-.5;return Math.ceil(i+n*(i-r))}(t),i=Date.now()+r;this.Lr.push({retryAt:i,requestOptions:e});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),hs.warn(n),this.Hr||(this.Hr=!0,this.Xr())}Xr(){if(this.Jr&&clearTimeout(this.Jr),0===this.Lr.length)return this.Hr=!1,void(this.Jr=void 0);this.Jr=setTimeout((()=>{this.zr&&this.Lr.length>0&&this.Yr(),this.Xr()}),this.Vr)}Yr(){var e=Date.now(),t=[],r=this.Lr.filter((r=>e>r.retryAt||(t.push(r),!1)));if(this.Lr=t,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.Jr&&(clearTimeout(this.Jr),this.Jr=void 0),this.Hr=!1,Gr(Wn)||(this.Ur&&(Wn.removeEventListener("online",this.Ur),this.Ur=void 0),this.Gr&&(Wn.removeEventListener("offline",this.Gr),this.Gr=void 0)),this.Lr))try{this._instance._send_request(r({},e,{transport:"sendBeacon"}))}catch(e){hs.error(e)}this.Lr=[]}}class _g{constructor(e){this.Kr=()=>{var e,t,r,i;this.Qr||(this.Qr={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.Qr.lastScrollY=Math.ceil(s),this.Qr.maxScrollY=Math.max(s,null!==(e=this.Qr.maxScrollY)&&void 0!==e?e:0),this.Qr.maxScrollHeight=Math.max(o,null!==(t=this.Qr.maxScrollHeight)&&void 0!==t?t:0),this.Qr.lastContentY=a,this.Qr.maxContentY=Math.max(a,null!==(r=this.Qr.maxContentY)&&void 0!==r?r:0),this.Qr.maxContentHeight=Math.max(l,null!==(i=this.Qr.maxContentHeight)&&void 0!==i?i:0)},this._instance=e}get ei(){return this._instance.config.scroll_root_selector}getContext(){return this.Qr}resetContext(){var e=this.Qr;return setTimeout(this.Kr,0),e}startMeasuringScrollPosition(){_s(Wn,"scroll",this.Kr,{capture:!0}),_s(Wn,"scrollend",this.Kr,{capture:!0}),_s(Wn,"resize",this.Kr)}scrollElement(){if(!this.ei)return null==Wn?void 0:Wn.document.documentElement;var e=Vr(this.ei)?this.ei:[this.ei];for(var t of e){var r=null==Wn?void 0:Wn.document.querySelector(t);if(r)return r}}scrollY(){if(this.ei){var e=this.scrollElement();return e&&e.scrollTop||0}return Wn&&(Wn.scrollY||Wn.pageYOffset||Wn.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var e=this.scrollElement();return e&&e.scrollLeft||0}return Wn&&(Wn.scrollX||Wn.pageXOffset||Wn.document.documentElement.scrollLeft)||0}}var Ig=e=>Qc(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class Cg{constructor(e,t,r,i){this.ti=e=>{var t=this.ri();if(!t||t.sessionId!==e){var r={sessionId:e,props:this.ii(this._instance)};this.ni.register({[po]:r})}},this._instance=e,this.si=t,this.ni=r,this.ii=i||Ig,this.si.onSessionId(this.ti)}ri(){return this.ni.props[po]}getSetOnceProps(){var e,t=null==(e=this.ri())?void 0:e.props;return t?"r"in t?ed(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 vs(ys(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+$r(r)]=t})),e}}class Sg{constructor(){this.oi={}}on(e,t){return this.oi[e]||(this.oi[e]=[]),this.oi[e].push(t),()=>{this.oi[e]=this.oi[e].filter((e=>e!==t))}}emit(e,t){for(var r of this.oi[e]||[])r(t);for(var i of this.oi["*"]||[])i(e,t)}}var xg=cs("[SessionId]");class kg{on(e,t){return this.ai.on(e,t)}constructor(e,t,r){var i;if(this.li=[],this.ui=void 0,this.ai=new Sg,this.hi=(e,t)=>!(!ei(e)||!ei(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Ao)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Bt=e.config,this.ni=e.persistence,this.ci=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=t||Mu,this.fi=r||Mu;var n=this.Bt.persistence_name||this.Bt.token;if(this._sessionTimeoutMs=1e3*ui(this.Bt.session_idle_timeout_seconds||1800,60,36e3,xg.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi="ph_"+n+"_window_id",this.mi="ph_"+n+"_primary_window_exists",this.yi()){var s=Dh.Z(this.gi),o=Dh.Z(this.mi);s&&!o?this.ci=s:Dh.F(this.gi),Dh.M(this.mi,!0)}if(null!=(i=this.Bt.bootstrap)&&i.sessionID)try{var a=(e=>{var t=this.Bt.bootstrap.sessionID.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.bi(this.Bt.bootstrap.sessionID,(new Date).getTime(),a)}catch(e){xg.error("Invalid sessionID in bootstrap",e)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Gr(this.li)&&(this.li=[]),this.li.push(e),this.di&&e(this.di,this.ci),()=>{this.li=this.li.filter((t=>t!==e))}}yi(){return"memory"!==this.Bt.persistence&&!this.ni.wr&&Dh.R()}Ii(e){e!==this.ci&&(this.ci=e,this.yi()&&Dh.M(this.gi,e))}Ci(){return this.ci?this.ci:this.yi()?Dh.Z(this.gi):null}bi(e,t,r){e===this.di&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this.di=e,this.ni.register({[Gs]:[t,e,r]}))}Si(){var e=this.ni.props[Gs];return Vr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.bi(null,null,null)}destroy(){clearTimeout(this.xi),this.xi=void 0,this.ui&&Wn&&(Wn.removeEventListener(Fo,this.ui,{capture:!1}),this.ui=void 0),this.li=[]}wi(){this.ui=()=>{this.yi()&&Dh.F(this.mi)},_s(Wn,Fo,this.ui,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Bt.cookieless_mode===Ao)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),[i,n,s]=this.Si(),o=this.Ci(),a=ei(s)&&Math.abs(r-s)>864e5,l=!1,u=!n,h=!u&&!e&&this.hi(r,i);u||h||a?(n=this.vi(),o=this.fi(),xg.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}}),s=r,l=!0):o||(o=this.fi(),l=!0);var c=ei(i)&&e&&!a?i:r,d=ei(s)?s:(new Date).getTime();return this.Ii(o),this.bi(n,c,d),e||this.pi(),l&&this.li.forEach((e=>e(n,o,l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:d,changeReason:l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}pi(){clearTimeout(this.xi),this.xi=setTimeout((()=>{var[e]=this.Si();if(this.hi((new Date).getTime(),e)){var t=this.di;this.resetSessionId(),this.ai.emit("forcedIdleReset",{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}}var Tg=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&Pr(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>Pr(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},Ag="custom",Eg="i.posthog.com",Rg=/^\/static\//;class Ng{constructor(e){this.ki={},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 flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Eg,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.ki[this.apiHost]||(this.ki[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Ag),this.ki[this.apiHost]}Ti(e){var t=this.instance.config.__preview_external_dependency_versioned_paths;if("string"==typeof t&&Rg.test(e))return t.trim().replace(/\/$/,"")||void 0}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var r=this.Ti(t);if(r)return""+r+t}if(this.region===Ag)return this.apiHost+t;var i=Eg+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var Mg=cs("[PostHog ExternalIntegrations]"),Fg={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Og{constructor(e){this._instance=e}ur(e,t){var r;null==(r=ss.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,(e=>{if(e)return Mg.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var r,n,s;!i||null!=(r=ss.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[t]||e.ur(Fg[t],(()=>{var r;null==(r=ss.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[t])||r.start(e._instance)})),!i&&null!=(n=ss.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[t]&&(null==(s=ss.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[t])||s.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;t(r)}}}var Pg,Lg={},Dg=0,Bg=()=>{},jg='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',$g="Surveys module not available",qg="sanitize_properties is deprecated. Use before_send instead",Zg="Invalid value for property_denylist config: ",Hg="posthog",Vg=!fh&&-1===(null==ns?void 0:ns.indexOf("MSIE"))&&-1===(null==ns?void 0:ns.indexOf("Mozilla")),zg=e=>{var t;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:ws(null==Kn?void 0:Kn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Bg,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,debug:Qn&&Wr(null==Qn?void 0:Qn.search)&&-1!==Qn.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_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Wn||null==(t=Wn.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,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,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){hs.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:No,before_send:void 0,request_queue_config:{flush_interval_ms:mg},error_tracking:{},_onCapture:Bg,__preview_eager_load_replay:!1},(e=>({rageclick:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},Ug=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],Yg=e=>{var t={};for(var[r,i]of Ug)Gr(e[r])||(t[i]=e[r]);var n=fs({},t,e);return Vr(e.property_blacklist)&&(Gr(e.property_denylist)?n.property_denylist=e.property_blacklist:Vr(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:hs.error(Zg+e.property_denylist)),n};class Gg{constructor(){this.__forceAllowLocalhost=!1}get Ai(){return this.__forceAllowLocalhost}set Ai(e){hs.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Wg{Ei(e,t){if(e){var r=this.Ri.indexOf(e);-1!==r&&this.Ri.splice(r,1)}return this.Ri.push(t),null==t.initialize||t.initialize(),t}Ni(){return this.config.cookieless_mode===Ao||this.config.cookieless_mode===To&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){var e;this.webPerformance=new Gg,this.Mi=!1,this.version=ls.LIB_VERSION,this.Fi=new Sg,this.Ri=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=zg(),this.SentryIntegration=ag,this.sentryIntegration=e=>function(e,t){var r=og(e,t);return{name:sg,processEvent:e=>r(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Oi=!1,this.Pi=null,this.Li=null,this.Di=null,this.scrollManager=new _g(this),this.pageViewManager=new lg(this),this.rateLimiter=new fg(this),this.requestRouter=new Ng(this),this.consent=new Qp(this),this.externalIntegrations=new Og(this);var t=null!==(e=Wg.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,r)=>{var i=Wr(e)?{[e]:t}:e;this.setPersonProperties(i),null==r||r({})},set_once:(e,t,r)=>{var i=Wr(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(e=>hs.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,r){if(r&&r!==Hg){var i,n=null!==(i=Lg[r])&&void 0!==i?i:new Wg;return n._init(e,t,r),Lg[r]=n,Lg[Hg][r]=n,n}return this._init(e,t,r)}_init(e,t,i){var n,s;if(void 0===t&&(t={}),Gr(e)||Xr(e))return hs.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 console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Bi(t.debug),this.ji=t,this.$i=[],t.person_profiles?this.Li=t.person_profiles:t.process_person&&(this.Li=t.process_person),this.set_config(fs({},zg(t.defaults),Yg(t),{name:i,token:e})),this.config.on_xhr_error&&hs.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Ou;var o=this.qi();this.persistence=new dg(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new dg(r({},this.config,{persistence:"sessionStorage"}),o);var a=r({},this.persistence.props),l=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Zi=new yg((e=>this.Hi(e)),this.config.request_queue_config),this.Vi=new wg(this),this.__request_queue=[];var u=this.Ni();if(u||(this.sessionManager=new kg(this),this.sessionPropsManager=new Cg(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(hs.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.zi(u)}),0)):(hs.info("Initializing extensions synchronously"),this.zi(u)),ls.DEBUG=ls.DEBUG||this.config.debug,ls.DEBUG&&hs.info("Starting in debug mode",{this:this,config:t,thisC:r({},this.config),p:a,s:l}),!this.config.identity_distinct_id||null!=(n=t.bootstrap)&&n.distinctID||(t.bootstrap=r({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=t.bootstrap)?void 0:s.distinctID)){var h=t.bootstrap.distinctID,c=this.get_distinct_id(),d=this.persistence.get_property(fo);if(t.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===Eo)this.identify(h);else if(t.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===Ro)hs.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var v=this.config.get_device_id(Mu()),f=t.bootstrap.isIdentifiedID?v:h;this.persistence.set_property(fo,t.bootstrap.isIdentifiedID?Ro:Eo),this.register({distinct_id:h,$device_id:f})}}if(u)this.register_once({distinct_id:Io,$device_id:null},"");else if(!this.get_distinct_id()){var p=this.config.get_device_id(Mu());this.register_once({distinct_id:p,$device_id:p},""),this.persistence.set_property(fo,Eo)}return _s(Wn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var i=r=>{var i=()=>r.anonymousId()||Mu();e.config.get_device_id=i,r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(fo,Ro)),t()},n=r.user();"then"in n&&zr(n.then)?n.then(i):i(n)}(e,(()=>{r.register((e=>{Promise&&Promise.resolve||ng.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,r)=>{if(!r)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(ng.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(ng.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e.calculateEventProperties(r,t.event.properties);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,Oo),identify:e=>t(e,Lo),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}(this,(()=>this.Ui())):this.Ui(),zr(this.config._onCapture)&&this.config._onCapture!==Bg&&(hs.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&hs.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}zi(e){var t,i,n,s,o,a,l,u=performance.now(),h=r({},Wg.__defaultExtensionClasses,this.config.__extensionClasses),c=[];h.featureFlags&&this.Ri.push(this.featureFlags=null!==(t=this.featureFlags)&&void 0!==t?t:new h.featureFlags(this)),h.exceptions&&this.Ri.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new h.exceptions(this)),h.historyAutocapture&&this.Ri.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.Ri.push(new h.tracingHeaders(this)),h.siteApps&&this.Ri.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!e&&this.Ri.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||c.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),h.autocapture&&this.Ri.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.Ri.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new h.surveys(this)),h.logs&&this.Ri.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new h.logs(this)),h.conversations&&this.Ri.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new h.conversations(this)),h.productTours&&this.Ri.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.Ri.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.Ri.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.Ri.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.Ri.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,rg)),h.toolbar&&this.Ri.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new h.toolbar(this)),h.experiments&&this.Ri.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new h.experiments(this)),this.Ri.forEach((e=>{e.initialize&&c.push((()=>{null==e.initialize||e.initialize()}))})),c.push((()=>{if(this.Yi){var e=this.Yi;this.Yi=void 0,this.Nr(e)}})),this.Gi(c,u)}Gi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Gi(e,t)}),0);var r=e.shift();if(r)try{r()}catch(e){hs.error("Error initializing extension:",e)}}var i=Math.round(performance.now()-t);this.register_for_session({[Co]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[So]:i}),this.config.__preview_deferred_init_extensions&&hs.info("PostHog extensions initialized ("+i+"ms)")}Nr(e){var t;if(!Kn||!Kn.body)return hs.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Nr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Yi=e),this.Wi=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Br(e.supportedCompression,Ou)?Ou:Br(e.supportedCompression,Pu)?Pu:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Li?this.Li:No}),this.Ri.forEach((t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)))}Ui(){try{this.config.loaded(this)}catch(e){hs.critical("`loaded` function failed",e)}if(this.Xi(),this.config.internal_or_test_user_hostname&&null!=Qn&&Qn.hostname){var e=Qn.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ni())&&this.Ji()}),1),this.Ki=new gg(this),this.Ki.load()}Xi(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Zi)||e.enable())}_dom_loaded(){this.is_capturing()&&ds(this.__request_queue,(e=>this.Hi(e))),this.__request_queue=[],this.Xi()}_handle_unload(){var e,t,r,i;null==(e=this.surveys)||e.handlePageUnload(),this.config.request_batching?(this.Qi()&&this.capture(Po),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(r=this.Zi)||r.unload(),null==(i=this.Vi)||i.unload()):this.Qi()&&this.capture(Po,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Vg?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=mh(e.url,{ip:this.config.ip?1:0}),e.headers=r({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,n,s=r({},e);s.timeout=s.timeout||6e4,s.url=_h(s.url,s.compression);var o=null!==(t=s.transport)&&void 0!==t?t:"fetch",a=Ih.filter((e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport))),l=null!==(i=null==(n=function(e,t){for(var r=0;e.length>r;r++)if(t(e[r]))return e[r]}(a,(e=>e.transport===o)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!l)throw new Error("No available transport method");"sendBeacon"!==o&&s.data&&s.compression===Ou&&is&&!gh?wh(s).then((e=>{l(e)})).catch((t=>{if((e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""))(t))return gh=!0,void l(r({},s,{compression:void 0,url:_h(e.url,void 0)}));l(s)})):l(s)})(r({},e,{callback:t=>{var r,i;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,t),null==e.callback||e.callback(t)}}))))}Hi(e){this.Vi?this.Vi.retriableRequest(e):this._send_request(e)}_execute_array(e){Dg++;try{var t,r=[],i=[],n=[];ds(e,(e=>{e&&(Vr(t=e[0])?n.push(e):zr(e)?e.call(this):Vr(e)&&"alias"===t?r.push(e):Vr(e)&&-1!==t.indexOf("capture")&&zr(this[t])?n.push(e):i.push(e))}));var s=function(e,t){ds(e,(function(e){if(Vr(e[0])){var r=t;vs(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}))};s(r,this),s(i,this),s(n,this)}finally{Dg--}}push(e){if(Dg>0&&Vr(e)&&Wr(e[0])){var t=Wg.prototype[e[0]];zr(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var n,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Zi){if(this.is_capturing())if(!Gr(e)&&Wr(e)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var h=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==h||!h.isRateLimited){null!=t&&t.$current_url&&!Wr(null==t?void 0:t.$current_url)&&(hs.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.en||hs.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),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 c=new Date,d=(null==i?void 0:i.timestamp)||c,v=Mu(),f={uuid:v,event:e,properties:this.calculateEventProperties(e,t||{},d,v)};e===Oo&&this.config.__preview_capture_bot_pageviews&&u&&(f.event="$bot_pageview",f.properties.$browser_type="bot"),h&&(f.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens),(null==i?void 0:i.$set)&&(f.$set=null==i?void 0:i.$set);var p=this.tn(null==i?void 0:i.$set_once,e!==Do,e===Lo);if(p&&(f.$set_once=p),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=f,a=e=>Wr(e)?e.slice(0,s):e,l=new Set,f=function e(t,r){return t!==Object(t)?a?a(t):t:l.has(t)?void 0:(l.add(t),Vr(t)?(i=[],ds(t,(t=>{i.push(e(t))}))):(i={},vs(t,((t,r)=>{l.has(t)||(i[r]=e(t,r))}))),i);var i}(o)),f.timestamp=d,Gr(null==i?void 0:i.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=c),e===ru.DISMISSED||e===ru.SENT){var g=null==t?void 0:t[iu.SURVEY_ID],m=null==t?void 0:t[iu.SURVEY_ITERATION];Su({id:g,current_iteration:m}),f.$set=r({},f.$set,{[lu({id:g,current_iteration:m},e===ru.SENT?"responded":"dismissed")]:!0})}else e===ru.SHOWN&&(f.$set=r({},f.$set,{[iu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===e){var y=null==t?void 0:t.$product_tour_type;y&&(f.$set=r({},f.$set,{["$product_tour_last_seen_date/"+y]:(new Date).toISOString()}))}var b=r({},f.properties.$set,f.$set);if(Yr(b)||this.setPersonPropertiesForFlags(b),!Kr(this.config.before_send)){var w=this.rn(f);if(!w)return;f=w}this.Fi.emit("eventCaptured",f);var _={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:f,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Hi(_):this.Zi.enqueue(_),f}hs.critical("This capture call is ignored due to client rate limiting.")}}else hs.error("No event name provided to posthog.capture")}else hs.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var o=s?void 0:this.persistence.remove_event_timer(e),a=r({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Ni()&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Wr(a.distinct_id)&&!Qr(a.distinct_id)||Xr(a.distinct_id))&&hs.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=function(e,t){var r,i,n,s;if(!ns)return{};var o,a=e?[...Hc,...t||[]]:[],[l,u]=function(e){for(var t=0;un.length>t;t++){var[r,i]=un[t],n=r.exec(e),s=n&&(zr(i)?i(n,e):i);if(s)return s}return["",""]}(ns);return fs(ys({$os:l,$os_version:u,$browser:on(ns,navigator.vendor),$device:hn(ns),$device_type:cn(ns,{userAgentDataPlatform:null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,maxTouchPoints:null==(i=navigator)?void 0:i.maxTouchPoints,screenWidth:null==Wn||null==(n=Wn.screen)?void 0:n.width,screenHeight:null==Wn||null==(s=Wn.screen)?void 0:s.height,devicePixelRatio:null==Wn?void 0:Wn.devicePixelRatio}),$timezone:td(),$timezone_offset:rd()}),{$current_url:ks(null==Qn?void 0:Qn.href,a,zc),$host:null==Qn?void 0:Qn.host,$pathname:null==Qn?void 0:Qn.pathname,$raw_user_agent:ns.length>1e3?ns.substring(0,997)+"...":ns,$browser_version:ln(ns,navigator.vendor),$browser_language:Xc(),$browser_language_prefix:(o=Xc(),"string"==typeof o?o.split("-")[0]:void 0),$screen_height:null==Wn?void 0:Wn.screen.height,$screen_width:null==Wn?void 0:Wn.screen.width,$viewport_height:null==Wn?void 0:Wn.innerHeight,$viewport_width:null==Wn?void 0:Wn.innerWidth,$lib:ls.LIB_NAME,$lib_version:ls.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&fs(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&fs(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.Vi)?void 0:v.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Ag&&(a.$lib_custom_api_host=this.config.api_host),u=e!==Oo||s?e!==Po||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=fs(a,u),e===Oo&&Kn&&(a.title=Kn.title),!Gr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}ns&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=fs({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Vr(this.config.property_denylist)?vs(this.config.property_denylist,(function(e){delete a[e]})):hs.error(Zg+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(hs.error(qg),a=p(a,e));var g=this.nn();return a.$process_person_profile=g,g&&!s&&this.sn("_calculate_event_properties"),a}tn(e,t,r){var i;if(void 0===t&&(t=!0),void 0===r&&(r=!1),!this.persistence||!this.nn())return e;if(this.Mi&&!r)return e;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=fs({},n,s||{},e||{}),a=this.config.sanitize_properties;return a&&(hs.error(qg),o=a(o,"$set_once")),t&&(this.Mi=!0),Yr(o)?void 0:o}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var i;null==(i=this.persistence)||i.register_once(e,t,r)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}an(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){var r;return null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,r){var i;null==(i=this.featureFlags)||i.updateFlags(e,t,r)}updateEarlyAccessFeatureEnrollment(e,t,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){var i;return void 0===t&&(t=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(e,t,r)}on(e,t){return this.Fi.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:$g}),()=>{})}onSessionId(e){var t,r;return null!==(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:$g})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:$g})}renderSurvey(e,t){var r;null==(r=this.surveys)||r.renderSurvey(e,t)}displaySurvey(e,t){var r;void 0===t&&(t=ku),null==(r=this.surveys)||r.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,r;return null!==(t=null==(r=this.surveys)?void 0:r.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:$g}}canRenderSurveyAsync(e,t){var r,i;return void 0===t&&(t=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(e,t))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:$g})}ln(e){return!e||Xr(e)?(hs.critical("Unique user id has not been set in posthog.identify"),!1):e===Io?(hs.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(hs.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,r){if(!this.__loaded||!this.persistence)return hs.uninitializedWarning("posthog.identify");if(Qr(e)&&(e=e.toString(),hs.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.ln(e)&&this.sn("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Ns)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),e!==i&&e!==this.get_property(Ms)&&(this.unregister(Ms),this.register({distinct_id:e}));var n,s=(this.persistence.get_property(fo)||Eo)===Eo;e!==i&&s?(this.persistence.set_property(fo,Ro),this.setPersonPropertiesForFlags({$set:t||{},$set_once:r||{}},!1),this.capture(Lo,{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:r||{}}),this.Di=Sh(e,t,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(t||r)&&this.setPersonProperties(t,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(uo))}}setPersonProperties(e,t){if((e||t)&&this.sn("posthog.setPersonProperties")){var r=Sh(this.get_distinct_id(),e,t);this.Di!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Di=r):hs.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){var n=this.getGroups(),s=n[e]!==t;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r({},n,{[e]:t})}),s||i){var o={$group_type:e,$group_key:t};i&&(o.$group_set=i),this.capture(Do,o)}i&&this.setGroupPropertiesForFlags({[e]:i}),s&&!i&&this.reloadFeatureFlags()}else hs.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){var e;null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),this.sn("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t,r,i,n,s,o,a,l;if(hs.info("reset"),!this.__loaded)return hs.uninitializedWarning("posthog.reset");var u=this.get_property(Ns);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),null==(i=this.surveys)||i.reset(),null==(n=this.Ki)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.persistence)||a.set_property(fo,Eo),null==(l=this.sessionManager)||l.resetSessionId(),this.Di=null,this.config.cookieless_mode===Ao)this.register_once({distinct_id:Io,$device_id:null},"");else{var h=this.config.get_device_id(Mu());this.register_once({distinct_id:h,$device_id:e?h:u},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var r;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(r=this.conversations)||r.un()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.hn()}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.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),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&r){var n,s=null!==(n=e.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i}alias(e,t){return e===this.get_property(Rs)?(hs.critical("Attempting to create alias for existing People user - aborting."),-2):this.sn("posthog.alias")?(Gr(t)&&(t=this.get_distinct_id()),e!==t?(this.an(Ms,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(hs.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=r({},this.config);if(Ur(e)){var i,n,s,o,a,l,u,h,c,d;fs(this.config,Yg(e));var v=this.qi();null==(i=this.persistence)||i.update_config(this.config,t,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new dg(r({},this.config,{persistence:"sessionStorage"}),v);var f=this.Bi(this.config.debug);ti(f)&&(this.config.debug=f),ti(this.config.debug)&&(this.config.debug?(ls.DEBUG=!0,Mh.R()&&Mh.M("ph_debug",!0),hs.info("set_config",{config:e,oldConfig:t,newConfig:r({},this.config)})):(ls.DEBUG=!1,Mh.R()&&Mh.F("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(h=this.deadClicksAutocapture)||h.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.cn(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){ls.LIB_NAME=e,ls.LIB_VERSION=t}startSessionRecording(e){var t,r,i,n,s,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.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)||!e.started)}captureException(e,t){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,t))}}addExceptionStep(e,t){var r;null==(r=this.exceptions)||r.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!==(e=null==(t=this.logs)?void 0:t.logger)&&void 0!==e?e:Wg.dn}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,r;return null!==(t=null==(r=this.toolbar)?void 0:r.loadToolbar(e))&&void 0!==t&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:Hg;return t!==Hg&&(t=Hg+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(fo))===Ro||(null==(t=this.sessionPersistence)?void 0:t.get_property(fo))===Ro}nn(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===No&&!this._isIdentified()&&Yr(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Ms])&&(null==(t=this.persistence)||null==(t=t.props)||!t[wo]))}Qi(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.nn()||this.sn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.sn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}sn(e){return"never"===this.config.person_profiles?(hs.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.an(wo,!0),!0)}qi(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==To)}cn(){var e,t,r,i,n=this.qi();return(null==(e=this.persistence)?void 0:e.wr)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(t=this.sessionPersistence)?void 0:t.wr)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==Ao){if(this.Ni()){var r,i,n,s,o;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new kg(this),this.pageViewManager=new lg(this),this.persistence&&(this.sessionPropsManager=new Cg(this,this.sessionManager,this.persistence));var a,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=Wg.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this.Ei(this.sessionRecording,new l(this)),this.Wi&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.Wi)))}var u,h;this.consent.optInOut(!0),this.cn(),this.Xi(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==To&&(null==(u=this.surveys)||u.loadIfEnabled()),(Gr(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(h=null==e?void 0:e.captureEventName)&&void 0!==h?h:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ji()}else hs.warn(jg)}opt_out_capturing(){var e,t,r;this.config.cookieless_mode!==Ao?(this.config.cookieless_mode===To&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===To&&(this.register({distinct_id:Io,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(r=this.sessionRecording)||r.stopRecording(),this.sessionRecording=void 0,this.Ji())):hs.warn(jg)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Ao||(this.config.cookieless_mode===To?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return Jn?Tg(Jn,this.config.custom_blocked_useragents):void 0}Ji(){Kn&&("visible"===Kn.visibilityState?this.Oi||(this.Oi=!0,this.capture(Oo,{title:Kn.title},{send_instantly:!0}),this.Pi&&(Kn.removeEventListener(Mo,this.Pi),this.Pi=null)):this.Pi||(this.Pi=this.Ji.bind(this),_s(Kn,Mo,this.Pi)))}debug(e){!1===e?(null==Wn||Wn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Wn||Wn.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)`."),this.set_config({debug:!0}))}Fr(){var e,t,r,i,n,s,o=this.ji||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(hs.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",!1,i=hs,n=(t="advanced_disable_flags")in(e=o)&&!Kr(e[t]),s=r in e&&!Kr(e[r]),n?e[t]:!!s&&(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[r]))}rn(e){if(Kr(this.config.before_send))return e;var t=Vr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of t){if(r=i(r),Kr(r)){var n="Event '"+e.event+"' was rejected in beforeSend function";return Br(Dr,e.event)?hs.warn(n+". This can cause unexpected behavior."):hs.info(n),null}r.properties&&!Yr(r.properties)||hs.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return null==(e=this.pageViewManager.dr)?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)})}Bi(e){var t=ti(e)&&!e,r=Mh.R()&&"true"===Mh.O("ph_debug");return!t&&(!!r||e)}}Wg.__defaultExtensionClasses={},Wg.dn={trace:Pg=()=>{},debug:Pg,info:Pg,warn:Pg,error:Pg,fatal:Pg},function(e,t){for(var r=0;t.length>r;r++)e.prototype[t[r]]=ms(e.prototype[t[r]])}(Wg,["identify"]);var Xg=cs("[ExceptionAutocapture]"),Jg=cs("[TracingHeaders]"),Kg=cs("[Web Vitals]"),Qg=9e5,em="disabled",tm="lazy_loading",rm="awaiting_config",im="missing_config";cs("[SessionRecording]"),cs("[SessionRecording]");var nm="[SessionRecording]",sm=cs(nm),om=cs("[Heatmaps]");function am(e){return Ur(e)&&"clientX"in e&&"clientY"in e&&Qr(e.clientX)&&Qr(e.clientY)}var lm=cs("[Product Tours]"),um=["$set_once","$set"],hm=cs("[SiteApps]"),cm="Error while initializing PostHog app with config id ";function dm(e,t,r){if(Kr(e))return!1;switch(r){case"exact":return e===t;case"contains":var i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class vm{constructor(e){this.vn=new Sg,this.fn=(e,t)=>this.pn(e,t)&&this.gn(e,t)&&this.mn(e,t)&&this.yn(e,t),this.pn=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.bn=new Set,this.wn=new Set}init(){var e,t;Gr(null==(e=this._instance)?void 0:e._addCaptureHook)||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.on(e,t)})))}register(e){var t,r;if(!Gr(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,r;null==(t=this.wn)||t.add(e),null==(r=e.steps)||r.forEach((e=>{var t;null==(t=this.bn)||t.add((null==e?void 0:e.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;e.forEach((e=>{var t;null==(t=e.steps)||t.forEach((e=>{null!=e&&e.selector&&n.add(null==e?void 0:e.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(e,t){var r;null!=t&&0!=e.length&&(this.bn.has(e)||this.bn.has(null==t?void 0:t.event))&&this.wn&&(null==(r=this.wn)?void 0:r.size)>0&&this.wn.forEach((e=>{this._n(t,e)&&this.vn.emit("actionCaptured",e.name)}))}In(e){this.onAction("actionCaptured",(t=>e(t)))}_n(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this.fn(e,r))return!0;return!1}onAction(e,t){return this.vn.on(e,t)}gn(e,t){if(null!=t&&t.url){var r,i=null==e||null==(r=e.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!dm(i,t.url,t.url_matching||"contains"))return!1}return!0}mn(e,t){return!!this.Cn(e,t)&&!!this.Sn(e,t)&&!!this.xn(e,t)}Cn(e,t){var r;if(null==t||!t.href)return!0;var i=this.kn(e);if(i.length>0)return i.some((e=>dm(e.href,t.href,t.href_matching||"exact")));var n,s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!s&&dm((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}Sn(e,t){var r;if(null==t||!t.text)return!0;var i=this.kn(e);if(i.length>0)return i.some((e=>dm(e.text,t.text,t.text_matching||"exact")||dm(e.$el_text,t.text,t.text_matching||"exact")));var n,s,o,a=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(e){for(var t,r=[],i=/(?::|")text="(.*?)"/g;!Kr(t=i.exec(e));)r.includes(t[1])||r.push(t[1]);return r}(a),s=t.text,o=t.text_matching||"exact",n.some((e=>dm(e,s,o))))}xn(e,t){var r,i;if(null==t||!t.selector)return!0;var n=null==e||null==(r=e.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(t.selector))return!0;var s=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";if(t.selector_regex&&s)try{return new RegExp(t.selector_regex).test(s)}catch(e){return!1}return!1}kn(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}yn(e,t){return null==t||!t.properties||0===t.properties.length||Th(t.properties.reduce(((e,t)=>{var r=Vr(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:r,operator:t.operator||"exact"},e}),{}),null==e?void 0:e.properties)}}class fm{constructor(e){this._instance=e,this.Tn=new Map,this.An=new Map,this.En=new Map}Rn(e,t){return!!e&&Th(e.propertyFilters,null==t?void 0:t.properties)}Nn(e,t){var r=new Map;return e.forEach((e=>{var i;null==(i=e.conditions)||null==(i=i[t])||null==(i=i.values)||i.forEach((t=>{if(null!=t&&t.name){var i=r.get(t.name)||[];i.push(e.id),r.set(t.name,i)}}))})),r}Mn(e,t,r){var i=(r===Yl?this.Tn:this.An).get(e),n=[];return this.Fn((e=>{n=e.filter((e=>null==i?void 0:i.includes(e.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((t=>t.name===e));return this.Rn(s,t)}))}register(e){var t;Gr(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.On(e),this.Pn(e))}Pn(e){var t=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));0!==t.length&&(null==this.Ln&&(this.Ln=new vm(this._instance),this.Ln.init(),this.Ln.In((e=>{this.onAction(e)}))),t.forEach((e=>{var t,r,i,n,s;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(r=e.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Ln)||n.register(e.conditions.actions.values),null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((t=>{if(t&&t.name){var r=this.En.get(t.name);r&&r.push(e.id),this.En.set(t.name,r||[e.id])}})))})))}On(e){var t,r=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.events)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(r=e.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));0===r.length&&0===i.length||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this.Tn=this.Nn(e,Yl),this.An=this.Nn(e,Gl))}onEvent(e,t){var r,i=this.le(),n=this.Dn(),s=this.Bn(),o=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(s===e&&t&&o.length>0){var a,l;i.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:o});var u=(null==t||null==(a=t.properties)?void 0:a.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(u){var h=o.indexOf(u);0>h||(o.splice(h,1),this.jn(o))}}else{if(this.An.has(e)){var c=this.Mn(e,t,Gl);c.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:c.map((e=>e.id))}),c.forEach((e=>{var t=o.indexOf(e.id);0>t||o.splice(t,1),this.$n(e.id)})),this.jn(o))}if(this.Tn.has(e)){i.info("event name matched",{event:e,eventPayload:t,items:this.Tn.get(e)});var d=this.Mn(e,t,Yl);this.jn(o.concat(d.map((e=>e.id))||[]))}}}onAction(e){var t,r=this.Dn(),i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[r])||[];this.En.has(e)&&this.jn(i.concat(this.En.get(e)||[]))}jn(e){var t=this.le(),r=[...new Set(e)].filter((e=>!this.qn(e)));t.info("updating activated items",{activatedItems:r}),this.Zn(r)}getActivatedIds(){var e,t=this.Dn();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getEventToItemsMap(){return this.Tn}Hn(){return this.Ln}}class pm extends fm{constructor(e){super(e)}Dn(){return ao}Bn(){return ru.SHOWN}Fn(e){var t;null==(t=this._instance)||t.getSurveys(e)}$n(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}le(){return gu}Zn(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[ao]:e})}qn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var gm="SDK is not enabled or survey functionality is not yet loaded",mm="Disabled. Not loading surveys.",ym=null!=Wn&&Wn.location?Ts(Wn.location.hash,"__posthog")||Ts(location.hash,"state"):null,bm="_postHogToolbarParams",wm=cs("[Toolbar]"),_m=cs("[FeatureFlags]"),Im=cs("[FeatureFlags]",{debugEnabled:!0}),Cm="\" failed. Feature flags didn't load in time.",Sm=e=>{for(var t={},r=0;e.length>r;r++)t[e[r]]=!0;return t},xm=e=>{var t={};for(var[r,i]of ps(e||{}))i&&(t[r]=i);return t},km="Refusing to render web experiment since the viewer is a likely bot",Tm={icontains:(e,t)=>!!Wn&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Wn&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!Wn&&Ch(t.href,e),not_regex:(e,t)=>!!Wn&&!Ch(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Am{get Bt(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments((e=>{Am.Vn("retrieved web experiments from the server"),t.zn=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;t.zn&&(Am.Vn("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=t.zn)||r.set(e.feature_flag_key,e));var i=t._instance.getFeatureFlag(e.feature_flag_key);Wr(i)&&e.variants[i]&&t.Un(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var n in e.variants){var s=e.variants[n];Am.Yn(s)&&t.Un(e.name,n,s.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Am.Vn(km);else if(!this.Bt.disable_web_experiments){if(Kr(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Am.Vn("applying feature flags",e),e.forEach((e=>{var t;if(this.zn&&null!=(t=this.zn)&&t.has(e)){var r,i=this._instance.getFeatureFlag(e),n=null==(r=this.zn)?void 0:r.get(e);i&&null!=n&&n.variants[i]&&this.Un(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var e=Am.getWindowLocation();if(null!=e&&e.search){var t=xs(null==e?void 0:e.search,"__experiment_id"),r=xs(null==e?void 0:e.search,"__experiment_variant");t&&r&&(Am.Vn("previewing web experiments "+t+" && "+r),this.getWebExperiments((e=>{this.Gn(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this.Bt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.Bt.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Bt.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Gn(e,t,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(Am.Vn("Previewing web experiment ["+i[0].name+"] with variant ["+t+"]"),this.Un(i[0].name,t,i[0].variants[t].transforms))}static Yn(e){return!Kr(e.conditions)&&Am.Wn(e)&&Am.Xn(e)}static Wn(e){var t;if(Kr(e.conditions)||Kr(null==(t=e.conditions)?void 0:t.url))return!0;var r,i,n,s=Am.getWindowLocation();return!!s&&(null==(r=e.conditions)||!r.url||Tm[null!==(i=null==(n=e.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](e.conditions.url,s))}static getWindowLocation(){return null==Wn?void 0:Wn.location}static Xn(e){var t;if(Kr(e.conditions)||Kr(null==(t=e.conditions)?void 0:t.utm))return!0;var r=Yc();if(r.utm_source){var i,n,s,o,a,l,u,h,c=null==(i=e.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=e.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,d=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,v=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return c&&v&&f&&d}return!1}static Vn(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];hs.info("[WebExperiments] "+e,r)}Un(e,t,r){this._is_bot()?Am.Vn(km):"control"!==t?r.forEach((r=>{if(r.selector){var i;Am.Vn("applying transform of variant "+t+" for experiment "+e+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}})):Am.Vn("Control variants leave the page unmodified.")}_is_bot(){return Jn&&this._instance?Tg(Jn,this.Bt.custom_blocked_useragents):void 0}}var Em,Rm,Nm=cs("[Conversations]"),Mm="Conversations not available yet.",Fm={featureFlags:class{constructor(e){this.Jn=!1,this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Bt(){return this._instance.config}get ni(){return this._instance.persistence}os(e){return this._instance.get_property(e)}ls(){var e,t;return null!==(e=null==(t=this.ni)?void 0:t._r(this.Bt.feature_flag_cache_ttl_ms))&&void 0!==e&&e}us(){return!!this.ls()&&(this.ss||this.Qn||(this.ss=!0,_m.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}hs(){var e,t=null!==(e=this.Bt.evaluation_contexts)&&void 0!==e?e:this.Bt.evaluation_environments;return!this.Bt.evaluation_environments||this.Bt.evaluation_contexts||this.ns||(_m.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ns=!0),null!=t&&t.length?t.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||_m.error("Invalid evaluation context found:",e,"Expected non-empty string"),t})):[]}cs(){return this.hs().length>0}initialize(){var e,t,{config:r}=this._instance,i=null!==(e=null==(t=r.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((e=>!!i[e])).reduce(((e,t)=>(e[t]=i[t]||!1,e)),{}),l=Object.keys(o).filter((e=>a[e])).reduce(((e,t)=>(o[t]&&(e[t]=o[t]),e)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,i){var n=null!=i&&i.merge?this.getFlagVariants():{},s=null!=i&&i.merge?this.getFlagPayloads():{},o=r({},n,e),a=r({},s,t),l={};for(var[u,h]of Object.entries(o)){var c="string"==typeof h;l[u]={key:u,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:Gr(null==a?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.receivedFeatureFlags({flags:l})}get hasLoadedFlags(){return this.Kn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.os(Qs),t=this.os(ro),i=this.os(io);if(!i&&!t)return e||{};var n=fs({},e||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var o of s){var a,l,u=n[o],h=null==t?void 0:t[o],c=Gr(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,d=Gr(h)?u.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[o],f=r({},u,{enabled:c,variant:c?null!=d?d:null==u?void 0:u.variant:void 0});c!==(null==u?void 0:u.enabled)&&(f.original_enabled=null==u?void 0:u.enabled),d!==(null==u?void 0:u.variant)&&(f.original_variant=null==u?void 0:u.variant),v&&(f.metadata=r({},null==u?void 0:u.metadata,{payload:v,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload})),n[o]=f}return this.Jn||(_m.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:n}),this.Jn=!0),n}getFlagVariants(){var e=this.os(Xs),t=this.os(ro);if(!t)return e||{};for(var r=fs({},e),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this.Jn||(_m.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this.Jn=!0),r}getFlagPayloads(){var e=this.os(eo),t=this.os(io);if(!t)return e||{};for(var r=fs({},e||{}),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this.Jn||(_m.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this.Jn=!0),r}reloadFeatureFlags(){this.es||this.Bt.advanced_disable_feature_flags||this.ds||(this._instance.Fi.emit("featureFlagsReloading",!0),this.ds=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.ds),this.ds=void 0}ensureFlagsLoaded(){this.Kn||this.Qn||this.ds||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.es=e}vs(e){var t;if(this.fs(),!this._instance.Fr())if(this.Qn)this.ts=!0;else{var i=this.Bt.token,n=this.os(Ns),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(t=this.ni)?void 0:t.get_initial_props())||{},this.os(no)||{}),group_properties:this.os(so),timezone:td()};Jr(n)||Gr(n)||(s.$device_id=n),(null!=e&&e.disableFlags||this.Bt.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.cs()&&(s.evaluation_contexts=this.hs());var o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Bt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Qn=!0,this._instance._send_request({method:"POST",url:o,data:s,compression:this.Bt.disable_compression?void 0:Pu,timeout:this.Bt.feature_flag_request_timeout_ms,callback:e=>{var t,r,i,n=!0;if(200===e.statusCode&&(this.ts||(this.$anon_distinct_id=void 0),n=!1),this.Qn=!1,!s.disable_flags||this.ts){this.rs=!n;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var a,l=!(null==(r=e.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(l&&o.push("quota_limited"),null==(i=this.ni)||i.register({[co]:o}),l)_m.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.");else s.disable_flags||this.receivedFeatureFlags(null!==(a=e.json)&&void 0!==a?a:{},n,{partialResponse:!!this.Bt.advanced_only_evaluate_survey_feature_flags}),this.ts&&(this.ts=!1,this.vs())}}})}}getFeatureFlag(e,t){var r;if(void 0===t&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var i=this.getFeatureFlagResult(e,t);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else _m.warn('getFeatureFlag for key "'+e+Cm)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var r=this.getFlagVariants(),i=e in r,n=r[e],s=this.getFlagPayloads()[e],o=String(n),a=this.os(to)||void 0,l=this.os(vo)||void 0,u=this.os(uo)||{};if(this.Bt.advanced_feature_flags_dedup_per_session){var h,c=this._instance.get_session_id(),d=this.os(ho);c&&c!==d&&(u={},null==(h=this.ni)||h.register({[uo]:u,[ho]:c}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){var v,f,p,g,m,y,b,w,_,I;Vr(u[e])?u[e].push(o):u[e]=[o],null==(v=this.ni)||v.register({[uo]:u});var C=this.getFeatureFlagDetails(e),S=[...null!==(f=this.os(co))&&void 0!==f?f:[]];Gr(n)&&S.push("flag_missing");var x={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this.Bt.bootstrap)||null==(p=p.featureFlags)?void 0:p[e])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Bt.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[e])||null,$used_bootstrap_value:!this.rs};Gr(null==C||null==(m=C.metadata)?void 0:m.version)||(x.$feature_flag_version=C.metadata.version);var k,T=null!==(y=null==C||null==(b=C.reason)?void 0:b.description)&&void 0!==y?y:null==C||null==(w=C.reason)?void 0:w.code;T&&(x.$feature_flag_reason=T),null!=C&&null!=(_=C.metadata)&&_.id&&(x.$feature_flag_id=C.metadata.id),Gr(null==C?void 0:C.original_variant)&&Gr(null==C?void 0:C.original_enabled)||(x.$feature_flag_original_response=Gr(C.original_variant)?C.original_enabled:C.original_variant),null!=C&&null!=(I=C.metadata)&&I.original_payload&&(x.$feature_flag_original_payload=null==C||null==(k=C.metadata)?void 0:k.original_payload),S.length&&(x.$feature_flag_error=S.join(",")),this._instance.capture("$feature_flag_called",x)}if(i){var A=s;if(!Gr(s))try{A=JSON.parse(s)}catch(e){}return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:A}}}}else _m.warn('getFeatureFlagResult for key "'+e+Cm)}getRemoteConfigPayload(e,t){var r=this.Bt.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.cs()&&(i.evaluation_contexts=this.hs()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.Bt.disable_compression?void 0:Pu,timeout:this.Bt.feature_flag_request_timeout_ms,callback(r){var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;t((null==n?void 0:n[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.rs){if(this.Kn||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,t);return Gr(r)?void 0:!!r}_m.warn('isFeatureEnabled for key "'+e+Cm)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,i){if(this.ni){this.Kn=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(e,t,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(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.payload})).map((e=>{var r;return[e,null==(r=t[e].metadata)?void 0:r.payload]})))):_m.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var c=e.requestId,d=e.evaluatedAt;if(Vr(u)){_m.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(u)for(var f=0;u.length>f;f++)v[u[f]]=!0;t&&t.register({[Js]:u,[Xs]:v})}else{var p=u,g=h,m=l;if(null!=o&&o.partialResponse)p=r({},i,p),g=r({},n,g),m=r({},s,m);else if(e.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter((e=>{var t;return!(null!=(t=l[e])&&t.failed)})));p=r({},i,Object.fromEntries(Object.entries(p).filter((e=>{var[t]=e;return y.has(t)})))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((e=>{var[t]=e;return y.has(t)})))),m=r({},s,Object.fromEntries(Object.entries(m||{}).filter((e=>{var[t]=e;return y.has(t)}))))}else p=r({},i,p),g=r({},n,g),m=r({},s,m);t&&t.register(r({[Js]:Object.keys(xm(p)),[Xs]:p||{},[eo]:g||{},[Qs]:m||{}},c?{[to]:c}:{},d?{[vo]:d}:{}))}}}(e,this.ni,n,s,o,i),t||(this.ss=!1),this.ps(t)}}override(e,t){void 0===t&&(t=!1),_m.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.ni)return _m.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.ni.unregister(ro),this.ni.unregister(io),this.ps(),Im.info("All overrides cleared");if(Vr(e)){var t=Sm(e);return this.ni.register({[ro]:t}),this.ps(),Im.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var r,i=e;if(this.Jn=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.ni.unregister(ro),Im.info("Flag overrides cleared");else if(i.flags){if(Vr(i.flags)){var n=Sm(i.flags);this.ni.register({[ro]:n})}else this.ni.register({[ro]:i.flags});Im.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.ni.unregister(io),Im.info("Payload overrides cleared")):i.payloads&&(this.ni.register({[io]:i.payloads}),Im.info("Payload overrides set",{payloads:i.payloads}))),void this.ps()}if(e&&"object"==typeof e)return this.ni.register({[ro]:e}),this.ps(),Im.info("Flag overrides set",{flags:e});_m.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Kn){var{flags:t,flagVariants:r}=this.gs();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var n,s=(this.os(Ks)||[]).find((t=>t.flagKey===e)),o={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=r({},this.getFlagVariants(),{[e]:t});null==(n=this.ni)||n.register({[Js]:Object.keys(xm(l)),[Xs]:l}),this.ps()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var i=this.os(Ks),n=r?"&"+r.map((e=>"stage="+e)).join("&"):"";if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Bt.token+n),method:"GET",callback:t=>{var r,i;if(t.json){var n=t.json.earlyAccessFeatures;return null==(r=this.ni)||r.unregister(Ks),null==(i=this.ni)||i.register({[Ks]:n}),e(n)}}})}gs(){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)),{})}}ps(e){var{flags:t,flagVariants:r}=this.gs();this.featureFlagEventHandlers.forEach((i=>i(t,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.os(no)||{},n=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._instance.register({[no]:r({},i,o,n)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(no)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.os(so)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((t=>{i[t]=r({},i[t],e[t]),delete e[t]})),this._instance.register({[so]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.os(so)||{};this._instance.register({[so]:r({},t,{[e]:{}})})}else this._instance.unregister(so)}reset(){this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.fs(),this.Jn=!1}}},Om={sessionRecording:class{get Bt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var e;return!(null==(e=this.ys)||!e.isStarted)}get status(){var e,t;return this.bs===rm||this.bs===im?this.bs:null!==(e=null==(t=this.ys)?void 0:t.status)&&void 0!==e?e:this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=em,this.ws=void 0,this._instance=e,!this._instance.sessionManager)throw sm.error("started without valid sessionManager"),new Error(nm+" started without valid sessionManager. This is a bug.");if(this.Bt.cookieless_mode===Ao)throw new Error(nm+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get _s(){var e,t=!(null==(e=this._instance.get_property(Hs))||!e.enabled),r=!this.Bt.disable_session_recording,i=this.Bt.disable_session_recording||this._instance.consent.isOptedOut();return Wn&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this._s||null==(t=this.ys)||!t.isStarted){var r=!Gr(Object.assign)&&!Gr(Array.from);this._s&&r?(this.Is(e),sm.info("starting")):(this.bs=em,this.stopRecording())}}Is(e){var t,r,i;this._s&&(this.bs!==rm&&this.bs!==im&&(this.bs=tm),null!=ss&&null!=(t=ss.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=ss.__PosthogExtensions__)&&r.initSessionRecording?this.Cs(e):null==(i=ss.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Ss,(t=>{if(t)return sm.error("could not load recorder",t);this.Cs(e)})))}stopRecording(){var e,t;null==(e=this.ws)||e.call(this),this.ws=void 0,null==(t=this.ys)||t.stop()}xs(){var e,t;null==(e=this.ws)||e.call(this),this.ws=void 0,null==(t=this.ys)||t.discard()}ks(){var e;null==(e=this.ni)||e.unregister(Ws)}Ts(e,t){if(Kr(e))return null;var r,i=Qr(e)?e:parseFloat(e);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(sm.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}As(e){if(this.ni){var t,i,n=this.ni,s=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this.Ts(null==(t=this.Bt.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),o=this.Ts(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Kr(a)&&this.ks();var l=null==i?void 0:i.minimumDurationMilliseconds;n.register({[Hs]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Gr(l)?null:l,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(t=this.ws)||t.call(this),this.ws=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.As(e),void this.xs()):(this.As(e),void this.startIfEnabledOrStop()):(this.bs===rm&&(this.bs=im,sm.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this.ys)&&r.log?this.ys.log(e,t):sm.warn("log called before recorder was ready")}get Ss(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(Hs);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}Es(){var e,t=this._instance.get_property(Hs);if(!t)return!1;var r=null!==(e=("object"==typeof t?t:JSON.parse(t)).cache_timestamp)&&void 0!==e?e:Date.now();return 36e5>=Date.now()-r}Cs(e){var t,r;if(null==(t=ss.__PosthogExtensions__)||!t.initSessionRecording)return sm.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[xo]:!0});if(this.ys||(this.ys=null==(r=ss.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Es()){if(this.bs===im||this.bs===rm)return;return this.bs=rm,sm.info("persisted remote config is stale, requesting fresh config before starting"),void new gg(this._instance).load()}this.bs=tm,this.ys.start(e)}onRRwebEmit(e){var t;null==(t=this.ys)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.ys||null==(t=this.ni)||t.register({[zs]:!0}),null==(e=this.ys)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||null==(t=this.ni)||t.register({[Vs]:!0}),null==(e=this.ys)||e.overrideSampling()}overrideTrigger(e){var t,r;this.ys||null==(r=this.ni)||r.register({["url"===e?Us:Ys]:!0}),null==(t=this.ys)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.ys)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!(null==(r=this.ys)||!r.tryAddCustomEvent(e,t))}}},Pm={autocapture:class{constructor(e){this.Rs=!1,this.Ns=null,this.Ms=!1,this.instance=e,this.rageclicks=new qp(e.config.rageclick),this.Fs=null}initialize(){this.startIfEnabled()}get Bt(){var e,t,r=Ur(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(e=r.url_allowlist)?void 0:e.map((e=>new RegExp(e))),r.url_ignorelist=null==(t=r.url_ignorelist)?void 0:t.map((e=>new RegExp(e))),r}Os(){if(this.isBrowserSupported()){if(Wn&&Kn){var e=e=>{e=e||(null==Wn?void 0:Wn.event);try{this.Ps(e)}catch(e){Hp.error("Failed to capture event",e)}};if(_s(Kn,"submit",e,{capture:!0}),_s(Kn,"change",e,{capture:!0}),_s(Kn,"click",e,{capture:!0}),this.Bt.capture_copied_text){var t=e=>{e=e||(null==Wn?void 0:Wn.event);try{this.Ps(e,Zp)}catch(e){Hp.error("Failed to capture copy/cut event",e)}};_s(Kn,"copy",t,{capture:!0}),_s(Kn,"cut",t,{capture:!0})}}}else Hp.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Rs&&(this.Os(),this.Rs=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Ms=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Os]:!!e.autocapture_opt_out}),this.Ns=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Fs=e}getElementSelectors(e){var t,r=[];return null==(t=this.Fs)||t.forEach((t=>{var i=null==Kn?void 0:Kn.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&r.push(t)}))})),r}get isEnabled(){var e,t,r=null==(e=this.instance.persistence)?void 0:e.props[Os];if(Jr(this.Ns)&&!ti(r)&&!this.instance.Fr())return!1;var i=null!==(t=this.Ns)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!i}Ps(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=Jo(e);Vo(i)&&(i=i.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&function(e,t){if(!Wn||ia(e))return!1;var r,i,n;if(ti(t)?(r=!!t&&ra,i=void 0):(r=null!==(n=null==t?void 0:t.css_selector_ignorelist)&&void 0!==n?n:ra,i=null==t?void 0:t.content_ignorelist),!1===r)return!1;var{targetElementList:s}=na(e,!1);return!function(e,t){if(!1===e||Gr(e))return!1;var r;if(!0===e)r=ta;else{if(!Vr(e))return!1;if(e.length>10)return hs.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:i}=e;return r.some((e=>t.includes(e)||i.includes(e)))}))}(i,s.map((e=>{var t;return{safeText:Xo(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!Qo(s,r)}(i,this.instance.config.rageclick)&&this.Ps(e,"$rageclick");var n=t===Zp;if(i&&function(e,t,r,i,n){var s,o,a,l;if(void 0===r&&(r=void 0),!Wn||ia(e))return!1;if(null!=(s=r)&&s.url_allowlist&&!Yo(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&Yo(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=na(e,i);if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(Gr(r))return!0;var i,n=function(e){if(r.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var s of e)if(i=n(s))return i.v;return!1}(c,r))return!1;if(!Qo(c,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var d=Wn.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0;var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(Ko.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e,this.Bt,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=Up(i,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Bt.element_attribute_ignorelist,elementsChainAsString:this.Ms});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),t===Zp){var l,u=Wo(null==Wn||null==(l=Wn.getSelection())?void 0:l.toString()),h=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=h}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return zr(null==Kn?void 0:Kn.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Ls=(null==Wn||null==(t=Wn.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(hs.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ds&&this.Ds(),this.Ds=void 0,hs.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(Wn&&Wn.history){var r=this;null!=(e=Wn.history.pushState)&&e.__posthog_wrapped__||As(Wn.history,"pushState",(e=>function(t,i,n){e.call(this,t,i,n),r.Bs("pushState")})),null!=(t=Wn.history.replaceState)&&t.__posthog_wrapped__||As(Wn.history,"replaceState",(e=>function(t,i,n){e.call(this,t,i,n),r.Bs("replaceState")})),this.js()}}Bs(e){try{var t,r=null==Wn||null==(t=Wn.location)?void 0:t.pathname;if(!r)return;r!==this.Ls&&this.isEnabled&&this._instance.capture(Oo,{navigation_type:e}),this.Ls=r}catch(t){hs.error("Error capturing "+e+" pageview",t)}}js(){if(!this.Ds){var e=()=>{this.Bs("popstate")};_s(Wn,"popstate",e),this.Ds=()=>{Wn&&Wn.removeEventListener("popstate",e)}}}},heatmaps:class{get Bt(){return this.instance.config}constructor(e){var t;this.$s=!1,this.Rs=!1,this.qs=null,this.instance=e,this.$s=!(null==(t=this.instance.persistence)||!t.props[Ps]),this.rageclicks=new qp(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return Ur(this.Bt.capture_heatmaps)&&this.Bt.capture_heatmaps.flush_interval_milliseconds&&(e=this.Bt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Kr(this.Bt.capture_heatmaps)?Kr(this.Bt.enable_heatmaps)?this.$s:this.Bt.enable_heatmaps:!1!==this.Bt.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Rs)return;om.info("starting..."),this.Zs(),this.Lt()}else{var e;clearInterval(null!==(e=this.qs)&&void 0!==e?e:void 0),this.Hs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ps]:t}),this.$s=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.T;return this.T=void 0,e}Vs(e){this.Tt(e.originalEvent,"deadclick")}Lt(){this.qs&&clearInterval(this.qs),this.qs=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(Kn)?setInterval(this.Yr.bind(this),this.flushIntervalMilliseconds):null}Zs(){Wn&&Kn&&(this.zs=this.Yr.bind(this),_s(Wn,Fo,this.zs),this.Us=e=>this.Tt(e||(null==Wn?void 0:Wn.event)),_s(Kn,"click",this.Us,{capture:!0}),this.Ys=e=>this.Gs(e||(null==Wn?void 0:Wn.event)),_s(Kn,"mousemove",this.Ys,{capture:!0}),this.Ws=new ig(this.instance,tg,this.Vs.bind(this)),this.Ws.startIfEnabledOrStop(),this.Xs=this.Lt.bind(this),_s(Kn,Mo,this.Xs),this.Rs=!0)}Hs(){var e;Wn&&Kn&&(this.zs&&Wn.removeEventListener(Fo,this.zs),this.Us&&Kn.removeEventListener("click",this.Us,{capture:!0}),this.Ys&&Kn.removeEventListener("mousemove",this.Ys,{capture:!0}),this.Xs&&Kn.removeEventListener(Mo,this.Xs),clearTimeout(this.Js),null==(e=this.Ws)||e.stop(),this.Rs=!1)}Ks(e,t){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(e,t,r){for(var i=e;i&&Zo(i)&&!Ho(i,"body");){if(i===r)return!1;if(Br(t,null==Wn?void 0:Wn.getComputedStyle(i).position))return!0;i=ea(i)}return!1}(Jo(e),["fixed","sticky"],n);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:t}}Tt(e,t){var i;if(void 0===t&&(t="click"),!qo(e.target)&&am(e)){var n=this.Ks(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.Qs(r({},n,{type:"rageclick"})),this.Qs(n)}}Gs(e){!qo(e.target)&&am(e)&&(clearTimeout(this.Js),this.Js=setTimeout((()=>{this.Qs(this.Ks(e,"mousemove"))}),500))}Qs(e){if(Wn){var t=Wn.location.href,r=this.Bt.custom_personal_data_properties,i=this.Bt.mask_personal_data_properties?[...Hc,...r||[]]:[],n=ks(t,i,zc);this.T=this.T||{},this.T[n]||(this.T[n]=[]),this.T[n].push(e)}}Yr(){this.T&&!Yr(this.T)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:ig,webVitalsAutocapture:class{constructor(e){var t;this.$s=!1,this.Rs=!1,this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.eo=()=>{clearTimeout(this.ro),0!==this.T.metrics.length&&(this._instance.capture("$web_vitals",this.T.metrics.reduce(((e,t)=>r({},e,{["$web_vitals_"+t.name+"_event"]:r({},t),["$web_vitals_"+t.name+"_value"]:t.value})),{})),this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(Gr(i))Kg.error("Could not read session ID. Dropping metrics!");else{this.T=this.T||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.io();Gr(n)||(Kr(null==e?void 0:e.name)||Kr(null==e?void 0:e.value)?Kg.error("Invalid metric received",e):!this.no||this.no>e.value?(this.T.url!==n&&(this.eo(),this.ro=setTimeout(this.eo,this.flushToCaptureTimeoutMs)),Gr(this.T.url)&&(this.T.url=n),this.T.firstMetricTimestamp=Gr(this.T.firstMetricTimestamp)?Date.now():this.T.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.T.metrics.push(r({},e,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.T.metrics.length===this.allowedMetrics.length&&this.eo()):Kg.error("Ignoring metric with value >= "+this.no,e))}},this.so=()=>{if(!this.Rs){var e,t,r,i,n=ss.__PosthogExtensions__;Gr(n)||Gr(n.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),e&&t&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.ht.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.ht.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.ht.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.ht.bind(this)),this.Rs=!0):Kg.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.$s=!(null==(t=this._instance.persistence)||!t.props[js]),this.startIfEnabled()}get oo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,r=Ur(this.oo)?null==(e=this.oo)?void 0:e.web_vitals_allowed_metrics:void 0;return Kr(r)?(null==(t=this._instance.persistence)?void 0:t.props[Zs])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Ur(this.oo)?this.oo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Ur(this.oo)?this.oo.web_vitals_attribution:void 0;return null!=e&&e}get no(){var e=Ur(this.oo)&&Qr(this.oo.__web_vitals_max_value)?this.oo.__web_vitals_max_value:Qg;return e>0&&6e4>=e?Qg:e}get isEnabled(){var e=null==Qn?void 0:Qn.protocol;if("http:"!==e&&"https:"!==e)return Kg.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Ur(this.oo)?this.oo.web_vitals:ti(this.oo)?this.oo:void 0;return ti(t)?t:this.$s}startIfEnabled(){this.isEnabled&&!this.Rs&&(Kg.info("enabled, starting..."),this.ur(this.so))}onRemoteConfig(e){if("capturePerformance"in e){var t=Ur(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Ur(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[js]:t}),this._instance.persistence.register({[Zs]:r})),this.$s=t,this.startIfEnabled()}}ur(e){var t,r;null!=(t=ss.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(r=ss.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(t=>{t?Kg.error("failed to load script",t):e()}))}io(){var e=Wn?Wn.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...Hc,...t||[]]:[];return ks(e,r,zc)}Kg.error("Could not determine current URL")}}},Lm={exceptionObserver:class{constructor(e){var t,r,i;this.so=()=>{var e;if(Wn&&this.isEnabled&&null!=(e=ss.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=ss.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=ss.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=ss.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ao&&this.Bt.capture_unhandled_errors&&(this.ao=t(this.captureException.bind(this))),!this.lo&&this.Bt.capture_unhandled_rejections&&(this.lo=r(this.captureException.bind(this))),!this.uo&&this.Bt.capture_console_errors&&(this.uo=i(this.captureException.bind(this)))}catch(e){Xg.error("failed to start",e),this.ho()}}},this._instance=e,this.co=!(null==(t=this._instance.persistence)||!t.props[Ls]),this.do=new hi({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10,refillInterval:1e4,Gt:Xg}),this.Bt=this.vo(),this.startIfEnabledOrStop()}vo(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ur(e)?t=r({},t,e):(Gr(e)?this.co:e)&&(t=r({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Bt.capture_console_errors||this.Bt.capture_unhandled_errors||this.Bt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Xg.info("enabled"),this.ho(),this.ur(this.so)):this.ho()}ur(e){var t,r;null!=(t=ss.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(r=ss.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(t=>{if(t)return Xg.error("failed to load script",t);e()}))}ho(){var e,t,r;null==(e=this.ao)||e.call(this),this.ao=void 0,null==(t=this.lo)||t.call(this),this.lo=void 0,null==(r=this.uo)||r.call(this),this.uo=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.co=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Ls]:this.co}),this.Bt=this.vo(),this.startIfEnabledOrStop())}onConfigChange(){this.Bt=this.vo()}captureException(e){var t,r,i,n=null!==(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==t?t:"Exception";this.do.consumeRateLimit(n)?Xg.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,r;this.fo=[],this.po=tp(),this._instance=e,this.fo=null!==(t=null==(r=this._instance.persistence)?void 0:r.get_property(Ds))&&void 0!==t?t:[],this.mo=Un(this.yo()),this.bo=new Yn(this.mo)}onConfigChange(){this.mo=Un(this.yo()),this.bo.setConfig(this.mo)}onRemoteConfig(e){var t,r,i;if("errorTracking"in e){var n=null!==(t=null==(r=e.errorTracking)?void 0:r.suppressionRules)&&void 0!==t?t:[],s=null==(i=e.errorTracking)?void 0:i.captureExtensionExceptions;this.fo=n,this._instance.persistence&&this._instance.persistence.register({[Ds]:this.fo,[Bs]:s})}}get wo(){var e,t=!!this._instance.get_property(Bs),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=r?r:t)&&void 0!==e&&e}buildProperties(e,t){return this.po.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.mo.enabled)try{if(!Wr(e)||0===e.trim().length)return void ep.warn("Ignoring exception step because message must be a non-empty string");var i=this._o(t),{sanitizedProperties:n,droppedKeys:s}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((r,i)=>Vn.has(i)?(t.push(i),r):(r[i]=e[i],r)),{}),droppedKeys:t}}(i);s.length>0&&ep.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.bo.add(r({[Zn]:e,[Hn]:(new Date).toISOString()},n))}catch(e){ep.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Io(t)){if(this.Co(t))return this.So("Exception dropped: matched a suppression rule"),void ep.info("Skipping exception capture because a suppression rule matched");if(!this.wo&&this.xo(t))return this.So("Exception dropped: thrown by a browser extension"),void ep.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ko(t))return this.So("Exception dropped: thrown by the PostHog SDK"),void ep.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.mo.enabled&&Kr(e.$exception_steps)?this.To(e):e;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",en:!0});return i&&this.bo.clear(),i}catch(e){return ep.error("Failed to capture exception event. Dropping this exception.",e),void this.bo.clear()}}catch(e){return void ep.error("Failed to process exception event. Ignoring this exception.",e)}}To(e){try{var t=this.bo.getAttachable();return 0===t.length?e:r({},e,{$exception_steps:t})}catch(t){return ep.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}So(e){this.mo.enabled&&this.bo.add({[Zn]:e,[Hn]:(new Date).toISOString()})}_o(e){return Ur(e)?r({},e):{}}yo(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}Co(e){if(0===e.length)return!1;var t=e.reduce(((e,t)=>{var{type:r,value:i}=t;return Wr(r)&&r.length>0&&e.$exception_types.push(r),Wr(i)&&i.length>0&&e.$exception_values.push(i),e}),{$exception_types:[],$exception_values:[]});return this.fo.some((e=>{var r=e.values.map((e=>{var r,i=xh[e.operator],n=Vr(e.value)?e.value:[e.value],s=null!==(r=t[e.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===e.type?r.some(Boolean):r.every(Boolean)}))}xo(e){var t=e.flatMap((e=>{var t,r;return null!==(t=null==(r=e.stacktrace)?void 0:r.frames)&&void 0!==t?t:[]}));return t.some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}ko(e){if(e.length>0){var t,r,i,n,s=null!==(t=null==(r=e[0].stacktrace)?void 0:r.frames)&&void 0!==t?t:[],o=s[s.length-1];return null!==(i=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}Io(e){return!Kr(e)&&Vr(e)}}},Dm=r({productTours:class{get ni(){return this._instance.persistence}constructor(e){this.Ao=null,this.Eo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this.ni&&this.ni.register({[qs]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Ao||(e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property(qs)||this.ur((()=>this.Ro()))}ur(e){var t,r;null!=(t=ss.__PosthogExtensions__)&&t.generateProductTours?e():null==(r=ss.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(t=>{t?lm.error("Could not load product tours script",t):e()}))}Ro(){var e;!this.Ao&&null!=(e=ss.__PosthogExtensions__)&&e.generateProductTours&&(this.Ao=ss.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!Vr(this.Eo)||t){var r=this.ni;if(r){var i=r.props[lo];if(Vr(i)&&!t)return this.Eo=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:t=>{var i=t.statusCode;if(200!==i||!t.json){var n="Product Tours API could not be loaded, status: "+i;return lm.error(n),void e([],{isLoaded:!1,error:n})}var s=Vr(t.json.product_tours)?t.json.product_tours:[];this.Eo=s,r&&r.register({[lo]:s}),e(s,{isLoaded:!0})}})}else e(this.Eo,{isLoaded:!0})}getActiveProductTours(e){Kr(this.Ao)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ao.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Ao)||t.showTourById(e)}previewTour(e){this.Ao?this.Ao.previewTour(e):this.ur((()=>{var t;this.Ro(),null==(t=this.Ao)||t.previewTour(e)}))}dismissProductTour(){var e;null==(e=this.Ao)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Ao)||e.nextStep()}previousStep(){var e;null==(e=this.Ao)||e.previousStep()}clearCache(){var e;this.Eo=null,null==(e=this.ni)||e.unregister(lo)}resetTour(e){var t;null==(t=this.Ao)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Ao)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Ao)||t.cancelPendingTour(e)}}},Fm),Bm={siteApps:class{constructor(e){this._instance=e,this.No=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Mo(e,t){if(t){var r=this.globalsForEvent(t);this.No.push(r),this.No.length>1e3&&(this.No=this.No.slice(10))}}get siteAppLoaders(){var e;return null==(e=ss._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Mo.bind(this));this.Fo=()=>{e(),this.No=[],this.Fo=void 0}}}globalsForEvent(e){var t,n,s,o,a,l,u;if(!e)throw new Error("Event payload is required");var h={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[v,f]of Object.entries(d))h[v]={id:c[v],type:v,properties:f};var{$set_once:p,$set:g}=e;return{event:r({},i(e,um),{properties:r({},e.properties,g?{$set:r({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=e.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(l=e.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=e.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var r;!t.errored&&this.No.length&&(hm.info("Processing "+this.No.length+" events for site app with id "+e.id),this.No.forEach((e=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&(null==(r=this.Fo)||r.call(this))},i=!1,n=n=>{t.errored=!n,t.loaded=!0,hm.info("Site app with id "+e.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:s}=e.init({posthog:this._instance,callback(e){n(e)}});s&&(t.processEvent=s),i=!0}catch(t){hm.error(cm+e.id,t),n(!1)}if(i&&t.loaded)try{r()}catch(r){hm.error("Error while processing buffered events PostHog app with config id "+e.id,r),t.errored=!0}}Oo(){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)}Po(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(t)}catch(t){hm.error("Error while processing event "+e.event+" for site app "+r.id,t)}}}onRemoteConfig(e){var t,r,i,n=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Oo(),void this._instance.on("eventCaptured",(e=>this.Po(e)))):void hm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.Fo)||r.call(this),null!=(i=e.siteApps)&&i.length)if(this.isEnabled){var s=function(e){var t;ss["__$$ph_site_app_"+e]=n._instance,null==(t=ss.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,a,(t=>{if(t)return hm.error(cm+e,t)}))};for(var{id:o,url:a}of e.siteApps)s(o)}else hm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},jm={tracingHeaders:class{constructor(e){this.Lo=void 0,this.Do=void 0,this.so=()=>{var e,t,r=this.Bo()||[];Gr(this.Lo)&&(null==(e=ss.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(r,this._instance.get_distinct_id(),this._instance.sessionManager)),Gr(this.Do)&&(null==(t=ss.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(r,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}ur(e){var t,r;null!=(t=ss.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(r=ss.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(t=>{if(t)return Jg.error("failed to load script",t);e()}))}Bo(){var e;return null!==(e=this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var e,t;this.Bo()?this.ur(this.so):(null==(e=this.Lo)||e.call(this),null==(t=this.Do)||t.call(this),this.Lo=void 0,this.Do=void 0)}}},$m=r({surveys:class{get Bt(){return this._instance.config}constructor(e){this.jo=void 0,this._surveyManager=null,this.$o=!1,this.qo=[],this.Zo=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Bt.disable_surveys){var t=e.surveys;if(Kr(t))return gu.warn("Flags not loaded yet. Not loading surveys.");var r=Vr(t);this.jo=r?t.length>0:t,gu.info("flags response received, isSurveysEnabled: "+this.jo),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var r=localStorage.key(t);(null!=r&&r.startsWith(wu)||null!=r&&r.startsWith(_u))&&e.push(r)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this.$o)gu.info("Already initializing surveys, skipping...");else if(this.Bt.disable_surveys)gu.info(mm);else if(this.Bt.cookieless_mode&&this._instance.consent.isOptedOut())gu.info("Not loading surveys in cookieless mode without consent.");else{var e=null==ss?void 0:ss.__PosthogExtensions__;if(e){if(!Gr(this.jo)||this.Bt.advanced_enable_surveys){var t=this.jo||this.Bt.advanced_enable_surveys;this.$o=!0;try{var r=e.generateSurveys;if(r)return void this.Ho(r,t);var i=e.loadExternalDependency;if(!i)return void this.Vo(ko);i(this._instance,"surveys",(r=>{r||!e.generateSurveys?this.Vo("Could not load surveys script",r):this.Ho(e.generateSurveys,t)}))}catch(e){throw this.Vo("Error initializing surveys",e),e}finally{this.$o=!1}}}else gu.error("PostHog Extensions not found.")}}Ho(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new pm(this._instance),gu.info("Surveys loaded successfully"),this.zo({isLoaded:!0})}Vo(e,t){gu.error(e,t),this.zo({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.qo.push(e),this._surveyManager&&this.zo({isLoaded:!0}),()=>{this.qo=this.qo.filter((t=>t!==e))}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Bt.disable_surveys)return gu.info(mm),e([]);var r,i=this._instance.get_property(oo);if(i&&!t)return e(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.Zo?this.Zo.then((t=>{var{surveys:r,context:i}=t;return e(r,i)})):("undefined"!=typeof Promise&&(this.Zo=new Promise((e=>{r=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Bt.token),method:"GET",timeout:this.Bt.surveys_request_timeout_ms,callback:t=>{var i;this.Zo=null;var n=t.statusCode;if(200!==n||!t.json){var s="Surveys API could not be loaded, status: "+n;gu.error(s);var o={isLoaded:!1,error:s};return e([],o),void(null==r||r({surveys:[],context:o}))}var a,l=t.json.surveys||[],u=l.filter((e=>mu(e)&&(yu(e)||bu(e))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(i=this._instance.persistence)||i.register({[oo]:l});var h={isLoaded:!0};e(l,h),null==r||r({surveys:l,context:h})}}))}zo(e){for(var t of this.qo)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){gu.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!Kr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);gu.warn("init was not called")}Uo(e){var t=null;return this.getSurveys((r=>{var i;t=null!==(i=r.find((t=>t.id===e)))&&void 0!==i?i:null})),t}Yo(e){if(Kr(this._surveyManager))return{eligible:!1,reason:gm};var t="string"==typeof e?this.Uo(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Kr(this._surveyManager))return gu.warn("init was not called"),{visible:!1,disabledReason:gm};var t=this.Yo(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Kr(this._surveyManager)?(gu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:gm})):new Promise((r=>{this.getSurveys((t=>{var i,n=null!==(i=t.find((t=>t.id===e)))&&void 0!==i?i:null;if(n){var s=this.Yo(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,r){var i;if(Kr(this._surveyManager))gu.warn("init was not called");else{var n="string"==typeof e?this.Uo(e):e;if(null!=n&&n.id)if(xu.includes(n.type)){var s=null==Kn?void 0:Kn.querySelector(t);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(gu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var e,t;gu.info("Rendering survey "+n.id+" with delay of "+(null==(e=n.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(n,s,r),gu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);gu.warn("Survey element not found")}else gu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else gu.warn("Survey not found")}}displaySurvey(e,t){var i;if(Kr(this._surveyManager))gu.warn("init was not called");else{var n=this.Uo(e);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==nu&&t.initialResponses&&gu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void gu.warn("Survey is not eligible to be displayed: ",o.disabledReason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else gu.warn("Survey not found")}}cancelPendingSurvey(e){Kr(this._surveyManager)?gu.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}},Fm),qm={toolbar:class{constructor(e){this.instance=e}Go(e){ss.ph_toolbar_state=e}Wo(){var e;return null!==(e=ss.ph_toolbar_state)&&void 0!==e?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),Is(this.instance.config))return!1;if(!Wn||!Kn)return!1;e=null!=e?e:Wn.location,r=null!=r?r:Wn.history;try{if(!t){try{Wn.localStorage.setItem("test","test"),Wn.localStorage.removeItem("test")}catch(e){return!1}t=null==Wn?void 0:Wn.localStorage}var i,n=ym||Ts(e.hash,"__posthog")||Ts(e.hash,"state"),s=n?gs((()=>JSON.parse(atob(decodeURIComponent(n)))))||gs((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(t.getItem(bm)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(e){return!1}}Xo(e){var t=ss.ph_load_toolbar||ss.ph_load_editor;!Kr(t)&&zr(t)?t(e,this.instance):wm.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==Kn||!Kn.getElementById(_o));if(!Wn||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Wn.localStorage.setItem(bm,JSON.stringify(r({},n,{source:void 0}))),2===this.Wo())this.Xo(n);else if(0===this.Wo()){var s;this.Go(1),null==(s=ss.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(e=>{if(e)return wm.error("[Toolbar] Failed to load",e),void this.Go(0);this.Go(2),this.Xo(n)})),_s(Wn,"turbolinks:load",(()=>{this.Go(0),this.loadToolbar(n)}))}return!0}Jo(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,r){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(e,t,r)}}},Zm=r({experiments:Am},Fm),Hm={conversations:class{constructor(e){this.Ko=void 0,this._conversationsManager=null,this.Qo=!1,this.ea=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;Kr(t)||(ti(t)?this.Ko=t:(this.Ko=t.enabled,this.ea=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Ko=void 0,this.ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Qo||this._instance.config.disable_conversations||Is(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==ss?void 0:ss.__PosthogExtensions__;if(e&&!Gr(this.Ko)&&this.Ko)if(this.ea&&this.ea.token){this.Qo=!0;try{var t=e.initConversations;if(t)return this.ta(t),void(this.Qo=!1);var r=e.loadExternalDependency;if(!r)return void this.ra(ko);r(this._instance,"conversations",(t=>{t||!e.initConversations?this.ra("Could not load conversations script",t):this.ta(e.initConversations),this.Qo=!1}))}catch(e){this.ra("Error initializing conversations",e),this.Qo=!1}}else Nm.error("Conversations enabled but missing token in remote config.")}}ta(e){if(this.ea)try{this._conversationsManager=e(this.ea,this._instance),Nm.info("Conversations loaded successfully")}catch(e){this.ra("Error completing conversations initialization",e)}else Nm.error("Cannot complete initialization: remote config is null")}ra(e,t){Nm.error(e,t),this._conversationsManager=null,this.Qo=!1}show(){this._conversationsManager?this._conversationsManager.show():Nm.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ko&&!Jr(this._conversationsManager)}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}sendMessage(e,r,i){var n=this;return t((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,r,i):(Nm.warn(Mm),null)}))()}getMessages(e,r){var i=this;return t((function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,r):(Nm.warn(Mm),null)}))()}markAsRead(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(e):(Nm.warn(Mm),null)}))()}getTickets(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.getTickets(e):(Nm.warn(Mm),null)}))()}requestRestoreLink(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(e):(Nm.warn(Mm),null)}))()}restoreFromToken(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(e):(Nm.warn(Mm),null)}))()}restoreFromUrlToken(){var e=this;return t((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Nm.warn(Mm),null)}))()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}un(){var e;null==(e=this._conversationsManager)||e.setIdentity()}hn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},Vm={logs:class{constructor(e){var t;this.ia=!1,this.na=!1,this.Gt=cs("[logs]"),this.sa=[],this.oa=0,this.aa=0,this.la=!1,this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.ia=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,r=null==(t=e.logs)?void 0:t.captureConsoleLogs;!Kr(r)&&r&&(this.ia=!0,this.loadIfEnabled())}reset(){this.sa=[],this.jr&&(clearTimeout(this.jr),this.jr=void 0),this.oa=0,this.aa=0,this.la=!1}loadIfEnabled(){if(this.ia&&!this.na){var e=null==ss?void 0:ss.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",(t=>{var r;t||null==(r=e.logs)||!r.initializeLogs?this.Gt.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.na=!0)})):this.Gt.error(ko)}else this.Gt.error("PostHog Extensions not found.")}}captureLog(e){var t,i,n,s,o,a;if(this._instance.is_capturing())if(e&&e.body){var l=null!==(t=null==(i=this._instance.config.logs)?void 0:i.flushIntervalMs)&&void 0!==t?t:3e3,u=null!==(n=null==(s=this._instance.config.logs)?void 0:s.maxLogsPerInterval)&&void 0!==n?n:1e3,h=Date.now();if(l>h-this.aa||(this.aa=h,this.oa=0,this.la=!1),u>this.oa){this.oa++;var c=function(e,t){var i=e.level||"info",{text:n,number:s}=dn[i]||vn,o=String(Date.now())+"000000",a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var l=r({},a,e.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:e.body},attributes:pn(l)};return e.trace_id&&(u.traceId=e.trace_id),e.span_id&&(u.spanId=e.span_id),Gr(e.trace_flags)||(u.flags=e.trace_flags),u}(e,this.ua());this.sa.push({record:c}),(null!==(o=null==(a=this._instance.config.logs)?void 0:a.maxBufferSize)&&void 0!==o?o:100)>this.sa.length?this.ha():this.flushLogs()}else this.la||(this.Gt.warn("captureLog dropping logs: exceeded "+u+" logs per "+l+"ms"),this.la=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.ca||(this.ca={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.ca}flushLogs(e){if(this.jr&&(clearTimeout(this.jr),this.jr=void 0),0!==this.sa.length){var t=this.sa;this.sa=[];var i=this._instance.config.logs,n=r({"service.name":(null==i?void 0:i.serviceName)||"unknown_service"},(null==i?void 0:i.environment)&&{"deployment.environment":i.environment},(null==i?void 0:i.serviceVersion)&&{"service.version":i.serviceVersion},null==i?void 0:i.resourceAttributes),s=function(e,t,r,i){return{resourceLogs:[{resource:{attributes:pn(t)},scopeLogs:[{scope:{name:r,version:i},logRecords:e}]}]}}(t.map((e=>e.record)),n,ls.LIB_NAME,ls.LIB_VERSION),o=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.Hi({method:"POST",url:o,data:s,compression:"best-available",batchKey:"logs",transport:e})}}ha(){var e,t;this.jr||(this.jr=setTimeout((()=>{this.jr=void 0,this.flushLogs()}),null!==(e=null==(t=this._instance.config.logs)?void 0:t.flushIntervalMs)&&void 0!==e?e:3e3))}ua(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:r}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=r}if(null!=ss&&null!=(e=ss.location)&&e.href&&(t.currentUrl=ss.location.href),this._instance.featureFlags){var i=this._instance.featureFlags.getFlags();i&&i.length>0&&(t.activeFeatureFlags=i)}return t}}},zm=r({},Fm,Om,Pm,Lm,Dm,Bm,$m,jm,qm,Zm,Hm,Vm);Wg.__defaultExtensionClasses=r({},zm),Em=Lg[Hg]=new Wg,(Rm=ss.posthog)&&vs(Rm._i,(function(e){if(e&&Vr(e)){var t=Em.init(e[0],e[1],e[2]),r=Rm[e[2]]||Rm;t&&(t._execute_array.call(t.people,r.people),t._execute_array(r))}})),ss.posthog=Em,function(){function e(){e.done||(e.done=!0,Vg=!1,vs(Lg,(function(e){e._dom_loaded()})))}null!=Kn&&Kn.addEventListener?"complete"===Kn.readyState?e():_s(Kn,"DOMContentLoaded",e,{capture:!1}):Wn&&hs.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
1
+ !function(){"use strict";function e(e,t,r,i,n,s,o){try{var a=e[s](o),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(i,n)}function t(t){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=t.apply(r,i);function a(t){e(o,n,s,a,l,"next",t)}function l(t){e(o,n,s,a,l,"throw",t)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},r.apply(null,arguments)}function i(e,t){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;r[i]=e[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(e,t,r)=>((e,t,r)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),l=Object.defineProperty,u=(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),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||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},v={};function f(e){if(v[e])return v[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in c?c[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in d?d[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return v[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 u=l[e].prototype;return document.body.removeChild(a),u?v[e]=u:t.prototype}catch(e){return t.prototype}}var p={};function g(e,t,r){var i,n=e+"."+String(r);if(p[n])return p[n].call(t);var s=f(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(p[n]=o,o.call(t)):t[r]}var m={};function y(e,t,r){var i=e+"."+String(r);if(m[i])return m[i].bind(t);var n=f(e)[r];return"function"!=typeof n?t[r]:(m[i]=n,n.bind(t))}var b={childNodes:e=>g("Node",e,"childNodes"),parentNode:e=>g("Node",e,"parentNode"),parentElement:e=>g("Node",e,"parentElement"),textContent:e=>g("Node",e,"textContent"),contains:(e,t)=>y("Node",e,"contains")(t),getRootNode:e=>y("Node",e,"getRootNode")(),host:e=>e&&"host"in e?g("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?g("Element",e,"shadowRoot"):null,querySelector:(e,t)=>g("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>g("Element",e,"querySelectorAll")(t),mutationObserver:()=>f("MutationObserver").constructor};function w(e){return e.nodeType===e.ELEMENT_NODE}function _(e){var t=e&&"host"in e&&"mode"in e&&b.host(e)||null;return Boolean(t&&"shadowRoot"in t&&b.shadowRoot(t)===e)}function I(e){return"[object ShadowRoot]"==={}.toString.call(e)}function C(e){try{var t=e.rules||e.cssRules;return t?((r=Array.from(t,(t=>S(t,e.href))).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r):null}catch(e){return null}var r}function S(e,t){if(function(e){return"styleSheet"in e}(e)){var r;try{r=C(e.styleSheet)||function(e){var{cssText:t}=e;if(3>t.split('"').length)return t;var r=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?r.push("layer"):e.layerName&&r.push("layer("+e.layerName+")"),e.supportsText&&r.push("supports("+e.supportsText+")"),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(t){r=e.cssText}return e.styleSheet.href?L(r,e.styleSheet.href):r}var i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(i=i.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?L(i,t):i}function x(e,t){return Array.from(e.styleSheets).find((e=>e.href===t))}let k=class{constructor(){u(this,"idNodeMap",new Map),u(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){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function T(e){var{element:t,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=e,a=s||"",l=n&&A(n);return(r[i.toLowerCase()]||l&&r[l])&&(a=o?o(a,t):"*".repeat(a.length)),a}function A(e){return e.toLowerCase()}var E="__rrweb_original__";function R(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?A(t):null}function N(e,t){var r,i;try{i=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}var M=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(e,t){return(e||"").replace(M,((e,r,i,n,s,o)=>{var a,l=i||s||o,u=r||n||"";if(!l)return e;if(F.test(l)||O.test(l))return"url("+u+l+u+")";if(P.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=t.split("/"),c=l.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+u+h.join("/")+u+")"}))}var D,B,j=1,q=new RegExp("[^a-z0-9-_:]"),Z=-2;function H(){return j++}var V=/^[^ \t\n\r\u000c]+/,z=/^[, \t\n\r\u000c]+/,U=new WeakMap;function Y(e,t){return t&&""!==t.trim()?G(e,t):t}function G(e,t){var r=U.get(e);if(r||(r=e.createElement("a"),U.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function W(e,t,r,i){return i?"src"===r||"href"===r&&("use"!==t||"#"!==i[0])||"xlink:href"===r&&"#"!==i[0]?Y(e,i):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;var r=0;function i(e){var i,n=e.exec(t.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(z),t.length>r;){var s=i(V);if(","===s.slice(-1))s=Y(e,s.substring(0,s.length-1)),n.push(s);else{var o="";s=Y(e,s);for(var a=!1;;){var l=t.charAt(r);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){r+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,r+=1}}}return n.join(", ")}(e,i):"style"===r?L(i,G(e)):"object"===t&&"data"===r?Y(e,i):i:Y(e,i):i}function X(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function J(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&J(b.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&J(b.parentNode(e),t,r)}function K(e,t,r,i){var n;if(w(e)){if(!b.childNodes(n=e).length)return!1}else{if(null===b.parentElement(e))return!1;n=b.parentElement(e)}try{if("string"==typeof t){if(i){if(n.closest("."+t))return!0}else if(n.classList.contains(t))return!0}else if(J(n,t,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function Q(e){return null==e?"":e.toLowerCase()}function ee(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:k=5e3,onStylesheetLoad:M,stylesheetLoadTimeout:F=5e3,keepIframeSrcFn:O=(()=>!1),newlyAddedElement:P=!1}=t,{needsMask:j}=t,{preserveWhiteSpace:V=!0}=t;j||(j=K(e,o,a,void 0===j));var z,U=function(e,t){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:d={},inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g=!1}=t,m=function(e,t){if(t.hasNode(e)){var r=t.getId(e);return 1===r?void 0:r}}(r,i);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:i,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=t,g=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;if(r)return e.matches(r)}catch(e){}return!1}(e,n,s),m=function(e){if(e instanceof HTMLFormElement)return"form";var t=A(e.tagName);return q.test(t)?"div":t}(e),y={},w=e.attributes.length,_=0;w>_;_++){var I=e.attributes[_];X(m,I.name)||(y[I.name]=W(i,m,A(I.name),I.value))}if("link"===m&&o){var S=function(e){return null==e?void 0:e.href}(e);if(S){var k=x(i,S);!k&&S.includes(".css")&&(k=x(i,window.location.origin+"/"+S.replace(window.location.href,"")));var N=null;k&&(N=C(k)),N&&(delete y.rel,delete y.href,y._cssText=N)}}if("style"===m&&e.sheet&&!(e.innerText||b.textContent(e)||"").trim().length){var M=C(e.sheet);M&&(y._cssText=M)}if("input"===m||"textarea"===m||"select"===m){var F=e.value,O=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=T({element:e,type:R(e),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(y.checked=O)}if("option"===m&&(e.selected&&!a.select?y.selected=!0:delete y.selected),"dialog"===m&&e.open)try{y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"}catch(e){y.rr_open_mode="modal",y.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;e.width>r;r+=50)for(var i=0;e.height>i;i+=50){var n=t.getImageData;if(new Uint32Array((E in n?n[E]:n).call(t,r,i,Math.min(50,e.width-r),Math.min(50,e.height-i)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(y.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var P=e.toDataURL(u.type,u.quality),L=i.createElement("canvas");L.width=e.width,L.height=e.height,P!==L.toDataURL(u.type,u.quality)&&(y.rr_dataURL=P)}if("img"===m&&c){D||(D=i.createElement("canvas"),B=D.getContext("2d"));var j=e,Z=j.currentSrc||j.getAttribute("src")||"<unknown-src>",H=j.crossOrigin,V=()=>{j.removeEventListener("load",V);try{D.width=j.naturalWidth,D.height=j.naturalHeight,B.drawImage(j,0,0),y.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==j.crossOrigin)return j.crossOrigin="anonymous",void(j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V));console.warn("Cannot inline img src="+Z+"! Error: "+e)}"anonymous"===j.crossOrigin&&(H?y.crossOrigin=H:j.removeAttribute("crossorigin"))};j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V)}if("audio"===m||"video"===m){var z=y;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}if(f||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),g){var{width:U,height:Y}=e.getBoundingClientRect();y={class:y.class,rr_width:U+"px",rr_height:Y+"px"}}"iframe"!==m||v(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(r=!0)}catch(e){}return{type:h.Element,tagName:m,attributes:y,childNodes:[],isSVG:(G=e,Boolean("svg"===G.tagName||G.ownerSVGElement)||void 0),needBlock:g,rootId:p,isCustom:r};var G}(e,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case e.TEXT_NODE:return function(e,t){var r,{needsMask:i,maskTextFn:n,rootId:s}=t,o=b.parentNode(e),a=o&&o.tagName,l=b.textContent(e),u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(u&&l){try{e.nextSibling||e.previousSibling||(null==(r=o.sheet)?void 0:r.cssRules)&&(l=C(o.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: "+t,e)}l=L(l,G(t.doc))}return c&&(l="SCRIPT_PLACEHOLDER"),!u&&!c&&l&&i&&(l=n?n(l,b.parentElement(e)):l.replace(/[\S]/g,"*")),{type:h.Text,textContent:l||"",isStyle:u,rootId:s}}(e,{doc:r,needsMask:o,maskTextFn:u,rootId:m});case e.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case e.COMMENT_NODE:return{type:h.Comment,textContent:b.textContent(e)||"",rootId:m};default:return!1}}(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:j,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:O,newlyAddedElement:P});if(!U)return console.warn(e,"not serialized"),null;z=i.hasNode(e)?i.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&&(Q(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Q(e.attributes.name)||"icon"===Q(e.attributes.rel)||"apple-touch-icon"===Q(e.attributes.rel)||"shortcut icon"===Q(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Q(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Q(e.attributes.property).match(/^(og|twitter|fb):/)||Q(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Q(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Q(e.attributes.name)||"googlebot"===Q(e.attributes.name)||"bingbot"===Q(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Q(e.attributes.name)||"generator"===Q(e.attributes.name)||"framework"===Q(e.attributes.name)||"publisher"===Q(e.attributes.name)||"progid"===Q(e.attributes.name)||Q(e.attributes.property).match(/^article:/)||Q(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Q(e.attributes.name)||"yandex-verification"===Q(e.attributes.name)||"csrf-token"===Q(e.attributes.name)||"p:domain_verify"===Q(e.attributes.name)||"verify-v1"===Q(e.attributes.name)||"verification"===Q(e.attributes.name)||"shopify-checkout-api-token"===Q(e.attributes.name)))return!0}}return!1}(U,f)&&(V||U.type!==h.Text||U.isStyle||U.textContent.replace(/^\s+|\s+$/gm,"").length)?H():Z;var Y=Object.assign(U,{id:z});if(i.add(e,Y),z===Z)return null;y&&y(e);var J=!l;if(Y.type===h.Element){J=J&&!Y.needBlock,delete Y.needBlock;var te=b.shadowRoot(e);te&&I(te)&&(Y.isShadowHost=!0)}if((Y.type===h.Document||Y.type===h.Element)&&J){f.headWhitespace&&Y.type===h.Element&&"head"===Y.tagName&&(V=!1);var re={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:j,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:V,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:O};if(Y.type===h.Element&&"textarea"===Y.tagName&&void 0!==Y.attributes.value);else for(var ie of Array.from(b.childNodes(e))){var ne=ee(ie,re);ne&&Y.childNodes.push(ne)}var se=null;if(w(e)&&(se=b.shadowRoot(e)))for(var oe of Array.from(b.childNodes(se))){var ae=ee(oe,re);ae&&(I(se)&&(ae.isShadow=!0),Y.childNodes.push(ae))}}var le=b.parentNode(e);return le&&_(le)&&I(le)&&(Y.isShadow=!0),Y.type===h.Element&&"iframe"===Y.tagName&&function(e,t,r){var i=e.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(e){return}if("complete"===n){var o="about:blank";if(i.location.href!==o||e.src===o||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout((()=>{s||(t(),s=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(a),s=!0,t()}))}}}(e,(()=>{var t=e.contentDocument;if(t&&S){var r=ee(t,{doc:t,mirror:i,blockClass:n,blockSelector:s,needsMask:j,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:V,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:O});r&&S(e,r)}}),k),Y.type===h.Element&&"link"===Y.tagName&&"string"==typeof Y.attributes.rel&&("stylesheet"===Y.attributes.rel||"preload"===Y.attributes.rel&&"string"==typeof Y.attributes.href&&"css"===N(Y.attributes.href))&&function(e,t,r){var i,n=!1;try{i=e.sheet}catch(e){return}if(!i){var s=setTimeout((()=>{n||(t(),n=!0)}),r);e.addEventListener("load",(()=>{clearTimeout(s),n=!0,t()}))}}(e,(()=>{if(M){var t=ee(e,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:j,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:V,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:M,stylesheetLoadTimeout:F,keepIframeSrcFn:O});t&&M(e,t)}}),F),Y}let te=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 re={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ie={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ne={};function se(e){if(ne[e])return ne[e];var t=function(e){var t,r=null==globalThis||null==(t=globalThis.Zone)||null==t.__symbol__?void 0:t.__symbol__(e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],r=t.prototype,i=e in re?re[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in ie?ie[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return ne[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 u=l[e].prototype;return document.body.removeChild(a),u?ne[e]=u:r}catch(e){return r}}var oe={};function ae(e,t,r){var i,n=e+"."+String(r);if(oe[n])return oe[n].call(t);var s=se(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(oe[n]=o,o.call(t)):t[r]}var le={};function ue(e,t,r){var i=e+"."+String(r);if(le[i])return le[i].bind(t);var n=se(e)[r];return"function"!=typeof n?t[r]:(le[i]=n,n.bind(t))}function he(){return se("MutationObserver").constructor}var ce={childNodes:e=>ae("Node",e,"childNodes"),parentNode:e=>ae("Node",e,"parentNode"),parentElement:e=>ae("Node",e,"parentElement"),textContent:e=>ae("Node",e,"textContent"),contains:(e,t)=>ue("Node",e,"contains")(t),getRootNode:e=>ue("Node",e,"getRootNode")(),host:e=>e&&"host"in e?ae("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?ae("Element",e,"shadowRoot"):null,querySelector:(e,t)=>ae("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>ae("Element",e,"querySelectorAll")(t),mutationObserver:he};function de(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)}var ve="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.",fe={map:{},getId(){return console.error(ve),-1},getNode(){return console.error(ve),null},removeNodeFromMap(){console.error(ve)},has(){return console.error(ve),!1},reset(){console.error(ve)}};function pe(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),h=this;0>=u||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,o)}),u))}}function ge(e,t,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,i?r:{set(e){setTimeout((()=>{r.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>ge(e,t,s||{},!0)}function me(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(fe=new Proxy(fe,{get(e,t,r){return"map"===t&&console.error(ve),Reflect.get(e,t,r)}}));var ye=Date.now;function be(e){var t,r,i,n,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=ce.parentElement(s.body))?void 0:t.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=ce.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function we(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function _e(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ie(e){return e?e.nodeType===e.ELEMENT_NODE?e:ce.parentElement(e):null}function Ce(e,t,r,i){if(!e)return!1;var n=Ie(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(J(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Se(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||t.getId(e)===Z}function xe(e,t){if(_(e))return!1;var r=t.getId(e);if(!t.has(r))return!0;var i=ce.parentNode(e);return(!i||i.nodeType!==e.DOCUMENT_NODE)&&(!i||xe(i,t))}function ke(e){return Boolean(e.changedTouches)}function Te(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 Ee(e){return!!e&&(e instanceof te&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(ce.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ye=()=>(new Date).getTime());let Re=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(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 Ne(e){var t,r=null;return"getRootNode"in e&&(null==(t=ce.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ce.host(ce.getRootNode(e))&&(r=ce.host(ce.getRootNode(e))),r}function Me(e){var t=e.ownerDocument;return!!t&&(ce.contains(t,e)||function(e){var t=e.ownerDocument;if(!t)return!1;var r=function(e){for(var t,r=e;t=Ne(r);)r=t;return r}(e);return ce.contains(t,r)}(e))}var Fe=(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))(Fe||{}),Oe=(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))(Oe||{}),Pe=(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))(Pe||{}),Le=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Le||{}),De=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(De||{}),Be=(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))(Be||{});function je(e){return"__ln"in e}class $e{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,r=0;e>r;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&&je(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&&je(e.nextSibling)&&e.nextSibling.__ln.previous){var i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.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 qe,Ze=(e,t)=>e+"@"+t;class He{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var e=[],t=new Set,r=new $e,i=e=>{for(var t=e,r=Z;r===Z;)r=(t=t&&t.nextSibling)&&this.mirror.getId(t);return r},n=n=>{var s=ce.parentNode(n);if(s&&Me(n)&&"TEXTAREA"!==s.tagName){var o=_(s)?this.mirror.getId(Ne(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var l=ee(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Te(e,this.mirror)&&this.iframeManager.addIframe(e),Ae(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ee(n)&&this.shadowDomManager.addShadowRoot(ce.shadowRoot(n),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:o,nextId:a,node:l}),t.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)ze(this.removes,s,this.mirror)&&!this.movedSet.has(ce.parentNode(s))||n(s);for(var o of this.addedSet)Ue(this.droppedSet,o)||ze(this.removes,o,this.mirror)?Ue(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var l=null;if(a){var u=this.mirror.getId(ce.parentNode(a.value)),h=i(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(ce.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){l=d;break}var f=ce.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=ce.host(f);if(-1!==this.mirror.getId(p)){l=d;break}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}a=l.previous,r.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((e=>{var t=e.node,r=ce.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),i=JSON.stringify(e._unchangedStyles);t.style.length>r.length&&(r+i).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};(g.texts.length||g.attributes.length||g.removes.length||g.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(g))}})),a(this,"genTextAreaValueMutation",(e=>{var t=this.attributeMap.get(e);t||(this.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e,t)),t.attributes.value=Array.from(ce.childNodes(e),(e=>ce.textContent(e)||"")).join("")})),a(this,"processMutation",(e=>{if(!Se(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":var t=ce.textContent(e.target);Ce(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:K(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ie(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break;case"attributes":var r=e.target,i=e.attributeName,n=e.target.getAttribute(i);if("value"===i){var s=R(r);n=T({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Ce(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;var o=this.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(e.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!X(r.tagName,i))if(o.attributes[i]=W(this.doc,A(r.tagName),A(i),n),"style"===i){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 u=r.style.getPropertyValue(l),h=r.style.getPropertyPriority(l);u!==a.style.getPropertyValue(l)||h!==a.style.getPropertyPriority(l)?o.styleDiff[l]=""===h?u:[u,h]:o._unchangedStyles[l]=[u,h]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(o.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ce(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),i=_(e.target)?this.mirror.getId(ce.host(e.target)):this.mirror.getId(e.target);Ce(e.target,this.blockClass,this.blockSelector,!1)||Se(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ve(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||xe(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ze(r,i)]?Ve(this.movedSet,t):this.removes.push({parentId:i,id:r,isShadow:!(!_(e.target)||!I(e.target))||void 0})),this.mapRemoves.push(t))}))}})),a(this,"genAdds",((e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Se(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);Ce(e,this.blockClass,this.blockSelector,!1)||(ce.childNodes(e).forEach((e=>this.genAdds(e))),Ee(e)&&ce.childNodes(ce.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 Ve(e,t){e.delete(t),ce.childNodes(t).forEach((t=>Ve(e,t)))}function ze(e,t,r){return 0!==e.length&&function(e,t,r){for(var i,n=ce.parentNode(t),s=function(){var t=r.getId(n);if(e.some((e=>e.id===t)))return{v:!0};n=ce.parentNode(n)};n;)if(i=s())return i.v;return!1}(e,t,r)}function Ue(e,t){return 0!==e.size&&Ye(e,t)}function Ye(e,t){var r=ce.parentNode(t);return!!r&&(!!e.has(r)||Ye(e,r))}var Ge=e=>qe?function(){try{return e(...arguments)}catch(e){if(qe&&!0===qe(e))return;throw e}}:e,We=[];function Xe(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 Je(e,t){var r=new He;We.push(r),r.init(e);var i=new(he())(Ge(r.processMutations.bind(r)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Ke(e){var{scrollCb:t,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=e;return de("scroll",Ge(pe(Ge((e=>{var o=Xe(e);if(o&&!Ce(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var l=be(r.defaultView);t({id:a,x:l.left,y:l.top})}else t({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),r)}var Qe=["INPUT","TEXTAREA","SELECT"],et=new WeakMap;function tt(e){return function(e,t){if(st("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||st("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||st("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||st("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){var i=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(i)}return t}(e,[])}function rt(e,t,r){var i,n;return e?(e.ownerNode?i=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:i}):{}}function it(e,t){var r,i,n,s,{mirror:o,stylesheetManager:a}=e;s=o.getId("#document"===t.nodeName?t:ce.host(t));var l="#document"===t.nodeName?null==(r=t.defaultView)?void 0:r.Document:null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,u=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&l&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var e;return null==(e=u.get)?void 0:e.call(this)},set(e){var t,r=null==(t=u.set)?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(e){}return r}}),Ge((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function nt(e,t){void 0===t&&(t={});var i,n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:h,canvasMutationCb:c,fontCb:d,selectionCb:v,customElementCb:f}=e;e.mutationCb=function(){t.mutation&&t.mutation(...arguments),r(...arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove(...arguments),i(...arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction(...arguments),n(...arguments)},e.scrollCb=function(){t.scroll&&t.scroll(...arguments),s(...arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize(...arguments),o(...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),u(...arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration(...arguments),h(...arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation(...arguments),c(...arguments)},e.fontCb=function(){t.font&&t.font(...arguments),d(...arguments)},e.selectionCb=function(){t.selection&&t.selection(...arguments),v(...arguments)},e.customElementCb=function(){t.customElement&&t.customElement(...arguments),f(...arguments)}}(e,t),e.recordDOM&&(i=Je(e,e.doc));var s=function(e){var{mousemoveCb:t,sampling:r,doc:i,mirror:n}=e;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,l=[],u=pe(Ge((e=>{var r=Date.now()-s;t(l.map((e=>(e.timeOffset-=r,e))),e),l=[],s=null})),a),h=Ge(pe(Ge((e=>{var t=Xe(e),{clientX:r,clientY:i}=ke(e)?e.changedTouches[0]:e;s||(s=ye()),l.push({x:r,y:i,id:n.getId(t),timeOffset:ye()-s}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?Oe.Drag:e instanceof MouseEvent?Oe.MouseMove:Oe.TouchMove)})),o,{trailing:!1})),c=[de("mousemove",h,i),de("touchmove",h,i),de("drag",h,i)];return Ge((()=>{c.forEach((e=>e()))}))}(e),o=function(e){var{mouseInteractionCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(Pe).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==l[e])).forEach((e=>{var a=A(e),l=(e=>i=>{var a=Xe(i);if(!Ce(a,s,o,!0)){var l=null,u=e;if("pointerType"in i){switch(i.pointerType){case"mouse":l=Le.Mouse;break;case"touch":l=Le.Touch;break;case"pen":l=Le.Pen}l===Le.Touch&&(Pe[e]===Pe.MouseDown?u="TouchStart":Pe[e]===Pe.MouseUp&&(u="TouchEnd"))}else ke(i)&&(l=Le.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Le.Touch||u.startsWith("Mouse")&&l===Le.Mouse)&&(l=null)):Pe[e]===Pe.Click&&(l=h,h=null);var c=ke(i)?i.changedTouches[0]:i;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Ge(t)(r({type:Pe[u],id:d,x:v,y:f},null!==l&&{pointerType:l}))}}})(e);if(window.PointerEvent)switch(Pe[e]){case Pe.MouseDown:case Pe.MouseUp:a=a.replace("mouse","pointer");break;case Pe.TouchStart:case Pe.TouchEnd:return}u.push(de(a,l,i))})),Ge((()=>{u.forEach((e=>e()))}))}(e),a=Ke(e),l=function(e,t){var{viewportResizeCb:r}=e,{win:i}=t,n=-1,s=-1;return de("resize",Ge(pe(Ge((()=>{var e=we(),t=_e();n===e&&s===t||(r({width:Number(t),height:Number(e)}),n=e,s=t)})),200)),i)}(e,{win:n}),u=function(e){var{inputCb:t,doc:i,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=e;function v(e){var t=Xe(e),r=e.isTrusted,n=t&&t.tagName;if(t&&"OPTION"===n&&(t=ce.parentElement(t)),t&&n&&Qe.indexOf(n)>=0&&!Ce(t,s,o,!0)&&!(t.classList.contains(a)||l&&t.matches(l))){var c=t.value,v=!1,p=R(t)||"";"radio"===p||"checkbox"===p?v=t.checked:(u[n.toLowerCase()]||u[p])&&(c=T({element:t,maskInputOptions:u,tagName:n,type:p,value:c,maskInputFn:h})),f(t,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=t.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((e=>{if(e!==t){var r=e.value;f(e,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(e,i){var s=et.get(e);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){et.set(e,i);var o=n.getId(e);Ge(t)(r({},i,{id:o}))}}var p=("last"===c.input?["change"]:["input","change"]).map((e=>de(e,Ge(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((e=>e()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value");return m&&m.set&&p.push(...[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]].map((e=>ge(e[0],e[1],{set(){Ge(v)({target:this,isTrusted:!1})}},!1,g)))),Ge((()=>{p.forEach((e=>e()))}))}(e),h=function(e){var{mediaInteractionCb:t,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=e,a=Ge((e=>pe(Ge((s=>{var o=Xe(s);if(o&&!Ce(o,r,i,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:h,loop:c}=o;t({type:e,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:c})}})),s.media||500))),l=[de("play",a(Be.Play),o),de("pause",a(Be.Pause),o),de("seeked",a(Be.Seeked),o),de("volumechange",a(Be.VolumeChange),o),de("ratechange",a(Be.RateChange),o)];return Ge((()=>{l.forEach((e=>e()))}))}(e),c=()=>{},d=()=>{},v=()=>{},f=()=>{};e.recordDOM&&(c=function(e,t){var{styleSheetRuleCb:r,mirror:i,stylesheetManager:n}=e,{win:s}=t;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Ge(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=rt(t,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:a}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.addRule=function(e,t,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[e+" { "+t+" }",r])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Ge(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:o}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(e){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Ge(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replace:o}),e.apply(t,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ge(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(t,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,replaceSync:o}),e.apply(t,s)}))}));var h={};ot("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(ot("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),ot("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),ot("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var c={};return Object.entries(h).forEach((e=>{var[t,s]=e;c[t]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[t].insertRule,{apply:Ge(((e,t,s)=>{var[o,a]=s,{id:l,styleId:u}=rt(t.parentStyleSheet,i,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&r({id:l,styleId:u,adds:[{rule:o,index:[...tt(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(c[t].deleteRule,{apply:Ge(((e,t,s)=>{var[o]=s,{id:a,styleId:l}=rt(t.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&r({id:a,styleId:l,removes:[{index:[...tt(t),o]}]}),e.apply(t,s)}))})})),Ge((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=u,a&&(s.CSSStyleSheet.prototype.replace=a),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((e=>{var[t,r]=e;r.prototype.insertRule=c[t].insertRule,r.prototype.deleteRule=c[t].deleteRule}))}))}(e,{win:n}),d=it(e,e.doc),v=function(e,t){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=e,{win:o}=t,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Ge(((e,t,o)=>{var l,[u,h,c]=o;if(n.has(u))return a.apply(t,[u,h,c]);var{id:d,styleId:v}=rt(null==(l=t.parentRule)?void 0:l.parentStyleSheet,i,s.styleMirror);return(d&&-1!==d||v&&-1!==v)&&r({id:d,styleId:v,set:{property:u,value:h,priority:c},index:tt(t.parentRule)}),e.apply(t,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ge(((e,t,o)=>{var a,[u]=o;if(n.has(u))return l.apply(t,[u]);var{id:h,styleId:c}=rt(null==(a=t.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||c&&-1!==c)&&r({id:h,styleId:c,remove:{property:u},index:tt(t.parentRule)}),e.apply(t,o)}))}),Ge((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(e,{win:n}),e.collectFonts&&(f=function(e){var{fontCb:t,doc:r}=e,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(e,t,r){var i=new o(e,t,r);return s.set(i,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),i};var a=me(r.fonts,"add",(function(e){return function(r){return setTimeout(Ge((()=>{var e=s.get(r);e&&(t(e),s.delete(r))})),0),e.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),Ge((()=>{n.forEach((e=>e()))}))}(e)));var p=function(e){var{doc:t,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=e,o=!0,a=Ge((()=>{var e=t.getSelection();if(!(!e||o&&(null==e?void 0:e.isCollapsed))){o=e.isCollapsed||!1;for(var a=[],l=e.rangeCount||0,u=0;l>u;u++){var h=e.getRangeAt(u),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;Ce(c,i,n,!0)||Ce(v,i,n,!0)||a.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),de("selectionchange",a)}(e),g=function(e){var{doc:t,customElementCb:r}=e,i=t.defaultView;return i&&i.customElements?me(i.customElements,"define",(function(e){return function(t,i,n){try{r({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,i,n])}})):()=>{}}(e),m=[];for(var y of e.plugins)m.push(y.observer(y.callback,n,y.options));return Ge((()=>{We.forEach((e=>e.reset())),null==i||i.disconnect(),s(),o(),a(),l(),u(),h(),c(),d(),v(),f(),p(),g(),m.forEach((e=>e()))}))}function st(e){return void 0!==window[e]}function ot(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class at{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){var n=r||this.getIdToRemoteIdMap(e),s=i||this.getRemoteIdToIdMap(e),o=n.get(t);return o||(o=this.generateIdFn(),n.set(t,o),s.set(o,t)),o}getIds(e,t){var r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,r,i)))}getRemoteId(e,t,r){var i=r||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:i.get(t)||-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||this.iframeIdToRemoteIdMap.set(e,t=new Map),t}getRemoteIdToIdMap(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||this.iframeRemoteIdToIdMap.set(e,t=new Map),t}}class lt{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new at(H)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new at(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,i;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==(i=this.loadListener)||i.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 i=this.transformCrossOriginEvent(r,t.data.event);i&&this.wrappedEmit(i,t.data.isCheckout)}}}transformCrossOriginEvent(e,t){var r;switch(t.type){case Fe.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:Fe.IncrementalSnapshot,data:{source:Oe.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Fe.Meta:case Fe.Load:case Fe.DomContentLoaded:return!1;case Fe.Plugin:return t;case Fe.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Fe.IncrementalSnapshot:switch(t.data.source){case Oe.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 Oe.Drag:case Oe.TouchMove:case Oe.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case Oe.ViewportResize:return!1;case Oe.MediaInteraction:case Oe.MouseInteraction:case Oe.Scroll:case Oe.CanvasMutation:case Oe.Input:return this.replaceIds(t.data,e,["id"]),t;case Oe.StyleSheetRule:case Oe.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Oe.Font:return t;case Oe.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case Oe.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,i){for(var n of i)(Array.isArray(t[n])||"number"==typeof t[n])&&(t[n]=Array.isArray(t[n])?e.getIds(r,t[n]):e.getId(r,t[n]));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 ut{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(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,t){if(I(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var i=Je(r({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((()=>i.disconnect())),this.restoreHandlers.push(Ke(r({},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(ce.host(e))),this.restoreHandlers.push(it({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(me(e.prototype,"attachShadow",(function(e){return function(i){var n=e.call(this,i),s=ce.shadowRoot(this);return s&&Me(this)&&r.addShadowRoot(s,t),n}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ct="undefined"==typeof Uint8Array?[]:new Uint8Array(256),dt=0;64>dt;dt++)ct[ht.charCodeAt(dt)]=dt;var vt=new Map,ft=(e,t,r)=>{if(e&&(mt(e,t)||"object"==typeof e)){var i=function(e,t){var r=vt.get(e);return r||vt.set(e,r=new Map),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name),n=i.indexOf(e);return-1===n&&(n=i.length,i.push(e)),n}};function pt(e,t,r){if(e instanceof Array)return e.map((e=>pt(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),i=r.length,n="";for(t=0;i>t;t+=3)n+=ht[r[t]>>2],n+=ht[(3&r[t])<<4|r[t+1]>>4],n+=ht[(15&r[t+1])<<2|r[t+2]>>6],n+=ht[63&r[t+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[pt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){var i=e.constructor.name,{src:n}=e;return{rr_type:i,src:n}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[pt(e.data,t,r),e.width,e.height]}:mt(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:ft(e,t,r)}:e}var gt=(e,t,r)=>e.map((e=>pt(e,t,r))),mt=(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 yt(e,t,r,i){var n=[];try{var s=me(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;s>a;a++)o[a-1]=arguments[a];if(!Ce(this,t,r,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(n);if("__context"in this||(this.__context=l),i&&["webgl","webgl2"].includes(l))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...o])}}));n.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((e=>e()))}}function bt(e,t,r,i,n,s){var o=[],a=Object.getOwnPropertyNames(e),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof e[a])return 0;var l=me(e,a,(function(e){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];var h=e.apply(this,l);if(ft(h,s,this),"tagName"in this.canvas&&!Ce(this.canvas,i,n,!0)){var c=gt(l,s,this);r(this.canvas,{type:t,property:a,args:c})}return h}}));o.push(l)}catch(i){var u=ge(e,a,{set(e){r(this.canvas,{type:t,property:a,args:[e],setter:!0})}});o.push(u)}};for(var u of a)l(u);return o}var wt,_t,It,Ct,St="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",xt="undefined"!=typeof window&&window.Blob&&new Blob([(wt=St,Uint8Array.from(atob(wt),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function kt(e){var t;try{if(!(t=xt&&(window.URL||window.webkitURL).createObjectURL(xt)))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,"+St,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Tt{constructor(e){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"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:i,blockSelector:n,recordCanvas:s,dataURLOptions:o}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(r,i,n),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:o})}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,r,i,n,s){var o=this,a=yt(r,i,n,!0),l=new Map,u=new kt;u.onmessage=e=>{var{id:t}=e.data;if(l.set(t,!1),"base64"in e.data){var{base64:r,type:i,width:n,height:s}=e.data;this.mutationCb({id:t,type:De["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var h,c=1e3/e,d=0,v=e=>{var a,f;d&&c>e-d||(d=e,(a=[],f=e=>{e.querySelectorAll("canvas").forEach((e=>{Ce(e,i,n,!0)||a.push(e)})),e.querySelectorAll("*").forEach((e=>{e.shadowRoot&&f(e.shadowRoot)}))},f(r.document),a).forEach(function(){var e=t((function*(e){var t,r=o.mirror.getId(e);if(!l.get(r)&&0!==e.width&&0!==e.height){if(l.set(r,!0),["webgl","webgl2"].includes(e.__context)){var i=e.getContext(e.__context);!1===(null==(t=null==i?void 0:i.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}var n=e.clientWidth||e.width,a=e.clientHeight||e.height,h=yield createImageBitmap(e,{resizeWidth:n,resizeHeight:a});u.postMessage({id:r,bitmap:h,width:n,height:a,dataURLOptions:s.dataURLOptions},[h])}}));return function(t){return e.apply(this,arguments)}}())),h=requestAnimationFrame(v)};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var i=yt(e,t,r,!1),n=function(e,t,r,i){var n=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),o=function(s){try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])return 1;var o=me(t.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];return Ce(this.canvas,r,i,!0)||setTimeout((()=>{var r=gt(a,t,this);e(this.canvas,{type:De["2D"],property:s,args:r})}),0),n.apply(this,a)}}));n.push(o)}catch(r){var a=ge(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:De["2D"],property:s,args:[t],setter:!0})}});n.push(a)}};for(var a of s)o(a);return()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r),s=function(e,t,r,i){var n=[];return n.push(...bt(t.WebGLRenderingContext.prototype,De.WebGL,e,r,i,t)),void 0!==t.WebGL2RenderingContext&&n.push(...bt(t.WebGL2RenderingContext.prototype,De.WebGL2,e,r,i,t)),()=>{n.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),s()}}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=>i(e,s))),{type:o}=r[0];this.mutationCb({id:t,type:o,commands:n}),this.pendingCanvasMutations.delete(e)}}}}class At{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Re),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 i={id:t,styleIds:[]},n=[],s=function(e){var t;r.styleMirror.has(e)?t=r.styleMirror.getId(e):(t=r.styleMirror.add(e),n.push({styleId:t,rules:Array.from(e.rules||CSSRule,((t,r)=>({rule:S(t,e.href),index:r})))})),i.styleIds.push(t)};for(var o of e)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Et{constructor(){a(this,"nodeMap",new WeakMap),a(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 Rt=!1;try{if(2!==Array.from([1],(e=>2*e))[0]){var Nt=document.createElement("iframe");document.body.appendChild(Nt),Array.from=(null==(n=Nt.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Nt)}}catch(e){console.debug("Unable to override Array.from",e)}var Mt,Ft,Ot=new k;function Pt(e){void 0===e&&(e={});var{emit:t,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:u="rr-mask",maskTextSelector:h=null,inlineStylesheet:c=!0,maskAllInputs:d,maskInputOptions:v,slimDOMOptions:f,maskInputFn:p,maskTextFn:g,hooks:m,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:_,recordDOM:I=!0,recordCanvas:C=!1,recordCrossOriginIframes:S=!1,recordAfter:x=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:T=!1,collectFonts:A=!1,inlineImages:E=!1,plugins:R,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:M=new Set([]),errorHandler:F}=e;qe=F;var O=!S||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(e){P=!0}if(O&&!t)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==_&&void 0===b.mousemove&&(b.mousemove=_),Ot.reset();var L,D=!0===d?{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!==v?v:{password:!0},B=!0===f||"all"===f?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===f,headMetaDescKeywords:"all"===f,headTitleMutations:"all"===f}:f||{};!function(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)}();var j=0,q=e=>{for(var t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!P&&(e=y(e)),e};_t=(e,r)=>{var s,o=e;if(o.timestamp=ye(),!(null==(s=We[0])?void 0:s.isFrozen())||o.type===Fe.FullSnapshot||o.type===Fe.IncrementalSnapshot&&o.data.source===Oe.Mutation||We.forEach((e=>e.unfreeze())),O)null==t||t(q(o),r);else if(P){var a={type:"rrweb",event:q(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===Fe.FullSnapshot)L=o,j=0;else if(o.type===Fe.IncrementalSnapshot){if(o.data.source===Oe.Mutation&&o.data.isAttachIframe)return;j++,(n&&j>=n||i&&o.timestamp-L.timestamp>i)&&It(!0)}};var Z=e=>{_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.Mutation},e)})},H=e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.Scroll},e)}),V=e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.CanvasMutation},e)}),z=new At({mutationCb:Z,adoptedStyleSheetCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.AdoptedStyleSheet},e)})}),U=new lt({mirror:Ot,mutationCb:Z,stylesheetManager:z,recordCrossOriginIframes:S,wrappedEmit:_t});for(var Y of R||[])Y.getMirror&&Y.getMirror({nodeMirror:Ot,crossOriginIframeMirror:U.crossOriginIframeMirror,crossOriginIframeStyleMirror:U.crossOriginIframeStyleMirror});var G=new Et;Ct=new Tt({recordCanvas:C,mutationCb:V,win:window,blockClass:s,blockSelector:o,mirror:Ot,sampling:b.canvas,dataURLOptions:w});var W=new ut({mutationCb:Z,scrollCb:H,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:w,maskTextFn:g,maskInputFn:p,recordCanvas:C,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:U,stylesheetManager:z,canvasManager:Ct,keepIframeSrcFn:N,processedNodeManager:G},mirror:Ot});It=function(e){if(void 0===e&&(e=!1),I){_t({type:Fe.Meta,data:{href:window.location.href,width:_e(),height:we()}},e),z.reset(),W.init(),We.forEach((e=>e.lock()));var t=function(e,t){var{mirror:r=new k,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:h=!1,maskTextFn:c,maskInputFn:d,slimDOM:v=!1,dataURLOptions:f,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_=(()=>!1)}=t||{};return ee(e,{doc:e,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:f,inlineImages:l,recordCanvas:u,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:_,newlyAddedElement:!1})}(document,{mirror:Ot,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:w,recordCanvas:C,inlineImages:E,onSerialize(e){Te(e,Ot)&&U.addIframe(e),Ae(e,Ot)&&z.trackLinkElement(e),Ee(e)&&W.addShadowRoot(ce.shadowRoot(e),document)},onIframeLoad(e,t){U.attachIframe(e,t),W.observeAttachShadow(e)},onStylesheetLoad(e,t){z.attachLinkElement(e,t)},keepIframeSrcFn:N});if(!t)return console.warn("Failed to snapshot the document");_t({type:Fe.FullSnapshot,data:{node:t,initialOffset:be(window)}},e),We.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Ot.getId(document))}};try{var X=[],J=e=>{var t;return Ge(nt)({mutationCb:Z,mousemoveCb:(e,t)=>_t({type:Fe.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.MouseInteraction},e)}),scrollCb:H,viewportResizeCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.ViewportResize},e)}),inputCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.Input},e)}),mediaInteractionCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.MediaInteraction},e)}),styleSheetRuleCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.StyleSheetRule},e)}),styleDeclarationCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.StyleDeclaration},e)}),canvasMutationCb:V,fontCb:e=>_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.Font},e)}),selectionCb(e){_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.Selection},e)})},customElementCb(e){_t({type:Fe.IncrementalSnapshot,data:r({source:Oe.CustomElement},e)})},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:h,maskInputOptions:D,inlineStylesheet:c,sampling:b,recordDOM:I,recordCanvas:C,inlineImages:E,userTriggeredOnInput:T,collectFonts:A,doc:e,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:o,slimDOMOptions:B,dataURLOptions:w,mirror:Ot,iframeManager:U,stylesheetManager:z,shadowDomManager:W,processedNodeManager:G,canvasManager:Ct,ignoreCSSAttributes:M,plugins:(null==(t=null==R?void 0:R.filter((e=>e.observer)))?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>_t({type:Fe.Plugin,data:{plugin:e.name,payload:t}})}))))||[]},m)};U.addLoadListener((e=>{try{X.push(J(e.contentDocument))}catch(e){console.warn(e)}}));var K=()=>{It(),X.push(J(document)),Rt=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(de("DOMContentLoaded",(()=>{_t({type:Fe.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&K()}))),X.push(de("load",(()=>{_t({type:Fe.Load,data:{}}),"load"===x&&K()}),window))),()=>{X.forEach((e=>e())),G.destroy(),Rt=!1,qe=void 0}}catch(e){console.warn(e)}}Pt.addCustomEvent=(e,t)=>{if(!Rt)throw new Error("please add custom event after start recording");_t({type:Fe.Custom,data:{tag:e,payload:t}})},Pt.freezePage=()=>{We.forEach((e=>e.freeze()))},Pt.takeFullSnapshot=e=>{if(!Rt)throw new Error("please take full snapshot after start recording");It(e)},Pt.mirror=Ot,(Ft=Mt||(Mt={}))[Ft.NotStarted=0]="NotStarted",Ft[Ft.Running=1]="Running",Ft[Ft.Stopped=2]="Stopped";var Lt,Dt=Object.defineProperty,Bt=(e,t,r)=>((e,t,r)=>t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),jt=Object.defineProperty,$t=(e,t,r)=>((e,t,r)=>t in e?jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),qt=Object.defineProperty,Zt=(e,t,r)=>((e,t,r)=>t in e?qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),Ht={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Vt={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},zt={};function Ut(e){if(zt[e])return zt[e];var t=globalThis[e],r=t.prototype,i=e in Ht?Ht[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in Vt?Vt[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return zt[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 u=l[e].prototype;return document.body.removeChild(a),u?zt[e]=u:r}catch(e){return r}}var Yt={};function Gt(e,t,r){var i,n=e+"."+String(r);if(Yt[n])return Yt[n].call(t);var s=Ut(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(Yt[n]=o,o.call(t)):t[r]}var Wt={};function Xt(e,t,r){var i=e+"."+String(r);if(Wt[i])return Wt[i].bind(t);var n=Ut(e)[r];return"function"!=typeof n?t[r]:(Wt[i]=n,n.bind(t))}var Jt={childNodes:e=>Gt("Node",e,"childNodes"),parentNode:e=>Gt("Node",e,"parentNode"),parentElement:e=>Gt("Node",e,"parentElement"),textContent:e=>Gt("Node",e,"textContent"),contains:(e,t)=>Xt("Node",e,"contains")(t),getRootNode:e=>Xt("Node",e,"getRootNode")(),host:e=>e&&"host"in e?Gt("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?Gt("Element",e,"shadowRoot"):null,querySelector:(e,t)=>Gt("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>Gt("Element",e,"querySelectorAll")(t),mutationObserver:()=>Ut("MutationObserver").constructor};function Kt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Kt(Jt.parentNode(e),t,r);for(var i=e.classList.length;i--;)if(t.test(e.classList[i]))return!0;return!!r&&Kt(Jt.parentNode(e),t,r)}class Qt{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 Qt))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 er={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},tr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},rr={};function ir(e){if(rr[e])return rr[e];var t=globalThis[e],r=t.prototype,i=e in er?er[e]:void 0,n=Boolean(i&&i.every((e=>{var t,i;return Boolean(null==(i=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:i.toString().includes("[native code]"))}))),s=e in tr?tr[e]:void 0,o=Boolean(s&&s.every((e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))})));if(n&&o)return rr[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 u=l[e].prototype;return document.body.removeChild(a),u?rr[e]=u:r}catch(e){return r}}var nr={};function sr(e,t,r){var i,n=e+"."+String(r);if(nr[n])return nr[n].call(t);var s=ir(e),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(nr[n]=o,o.call(t)):t[r]}var or={};function ar(e,t,r){var i=e+"."+String(r);if(or[i])return or[i].bind(t);var n=ir(e)[r];return"function"!=typeof n?t[r]:(or[i]=n,n.bind(t))}var lr={childNodes:e=>sr("Node",e,"childNodes"),parentNode:e=>sr("Node",e,"parentNode"),parentElement:e=>sr("Node",e,"parentElement"),textContent:e=>sr("Node",e,"textContent"),contains:(e,t)=>ar("Node",e,"contains")(t),getRootNode:e=>ar("Node",e,"getRootNode")(),host:e=>e&&"host"in e?sr("ShadowRoot",e,"host"):null,styleSheets:e=>e.styleSheets,shadowRoot:e=>e&&"shadowRoot"in e?sr("Element",e,"shadowRoot"):null,querySelector:(e,t)=>sr("Element",e,"querySelector")(t),querySelectorAll:(e,t)=>sr("Element",e,"querySelectorAll")(t),mutationObserver:()=>ir("MutationObserver").constructor},ur="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.",hr={map:{},getId(){return console.error(ur),-1},getNode(){return console.error(ur),null},removeNodeFromMap(){console.error(ur)},has(){return console.error(ur),!1},reset(){console.error(ur)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(hr=new Proxy(hr,{get(e,t,r){return"map"===t&&console.error(ur),Reflect.get(e,t,r)}}));var cr,dr=Date.now;function vr(e){return e?e.nodeType===e.ELEMENT_NODE?e:lr.parentElement(e):null}function fr(e){var t,r=null;return"getRootNode"in e&&(null==(t=lr.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&lr.host(lr.getRootNode(e))&&(r=lr.host(lr.getRootNode(e))),r}function pr(e){for(var t,r=e;t=fr(r);)r=t;return r}function gr(e){var t=e.ownerDocument;if(!t)return!1;var r=pr(e);return lr.contains(t,r)}/[1-9][0-9]{12}/.test(Date.now().toString())||(dr=()=>(new Date).getTime());for(var mr=(Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){$t(this,"id",1),$t(this,"styleIDMap",new WeakMap),$t(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 hr},closestElementOfNode:vr,getBaseDimension:function e(t,r){var i,n,s=null==(n=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:n.frameElement;if(!s||s===r)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=s.getBoundingClientRect(),a=e(s,r),l=o.height/s.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},getNestedRule:function e(t,r){var i=t[r[0]];return 1===r.length?i:e(i.cssRules[r[1]].cssRules,r.slice(2))},getPositionsAndIndex(e){var t=[...e],r=t.pop();return{positions:t,index:r}},getRootShadowHost:pr,getShadowHost:fr,getWindowHeight:()=>window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight,getWindowScroll(e){var t,r,i,n,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=lr.parentElement(s.body))?void 0:t.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(i=lr.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:()=>window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth,hasShadowRoot:e=>!!e&&(e instanceof Qt&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(lr.shadowRoot(e))),hookSetter:function e(t,r,i,n,s){void 0===s&&(s=window);var o=s.Object.getOwnPropertyDescriptor(t,r);return s.Object.defineProperty(t,r,n?i:{set(e){setTimeout((()=>{i.set.call(this,e)}),0),o&&o.set&&o.set.call(this,e)}}),()=>e(t,r,o||{},!0)},inDom(e){var t=e.ownerDocument;return!!t&&(lr.contains(t,e)||gr(e))},isAncestorRemoved:function e(t,r){if(n=(i=t)&&"host"in i&&"mode"in i&&Jt.host(i)||null,Boolean(n&&"shadowRoot"in n&&Jt.shadowRoot(n)===i))return!1;var i,n,s=r.getId(t);if(!r.has(s))return!0;var o=lr.parentNode(t);return(!o||o.nodeType!==t.DOCUMENT_NODE)&&(!o||e(o,r))},isBlocked(e,t,r,i){if(!e)return!1;var n=vr(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(i&&null!==n.closest("."+t))return!0}else if(Kt(n,t,i))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1},isIgnored:(e,t,r)=>!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e),isSerialized:(e,t)=>-1!==t.getId(e),isSerializedIframe:(e,t)=>Boolean("IFRAME"===e.nodeName&&t.getMeta(e)),isSerializedStylesheet:(e,t)=>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 i=t.children.length-1;i>=0;i--)e(t.children[i],r)},legacy_isTouchEvent:e=>Boolean(e.changedTouches),get nowTimestamp(){return dr},on(e,t,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)},patch(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}},polyfill(e){void 0===e&&(e=window),"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=[].forEach)},queueToResolveTrees(e){var t={},r=(e,r)=>{var i={value:e,parent:r,children:[]};return t[e.node.id]=i,i},i=[];for(var n of e){var{nextId:s,parentId:o}=n;if(s&&s in t){var a=t[s];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,r(n,a.parent))}else{var u=i.indexOf(a);i.splice(u,0,r(n,null))}}else if(o in t){var h=t[o];h.children.push(r(n,h))}else i.push(r(n,null))}return i},shadowHostInDom:gr,throttle(e,t,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var l=Date.now();n||!1!==r.leading||(n=l);var u=t-(l-n),h=this;0>=u||u>t?(i&&(clearTimeout(i),i=null),n=l,e.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,e.apply(h,o)}),u))}},uniqueTextMutations(e){for(var t=new Set,r=[],i=e.length;i--;){var n=e[i];t.has(n.id)||(r.push(n),t.add(n.id))}return r}},Symbol.toStringTag,{value:"Module"}))),yr="undefined"==typeof Uint8Array?[]:new Uint8Array(256),br=0;64>br;br++)yr["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(br)]=br;"undefined"!=typeof window&&window.Blob&&new Blob([Uint8Array.from(atob("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo="),(e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(e=>2*e))[0]){var wr=document.createElement("iframe");document.body.appendChild(wr),Array.from=(null==(Lt=wr.contentWindow)?void 0:Lt.Array.from)||Array.from,document.body.removeChild(wr)}}catch(e){console.debug("Unable to override Array.from",e)}new class{constructor(){Zt(this,"idNodeMap",new Map),Zt(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){this.idNodeMap.set(t.id,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}},function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(cr||(cr={}));class _r{constructor(e){Bt(this,"fileName"),Bt(this,"functionName"),Bt(this,"lineNumber"),Bt(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?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t}}var Ir=/(^|@)\S+:\d+/,Cr=/^\s*at .*(\S+:\d+|\(native\))/m,Sr=/^(eval@)?(\[native code])?$/,xr={parse(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Cr)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE(e){return e.stack.split("\n").filter((function(e){return!!e.match(Cr)}),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+)\)$)/),i=(t=r?t.replace(r[0],""):t).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new _r({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(e){return e.stack.split("\n").filter((function(e){return!e.match(Sr)}),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 _r({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(e.replace(t,""));return new _r({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(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(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new _r({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=t.exec(r[n]);o&&i.push(new _r({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(e){return e.stack.split("\n").filter((function(e){return!!e.match(Ir)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),r=this.extractLocation(t.pop()),i=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new _r({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function kr(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var r=e.localName;if(!r)break;r=r.toLowerCase();var i=e.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(e)+")"),t=r+(t?">"+t:""),e=i}return t}function Tr(e){return"[object Object]"==={}.toString.call(e)}function Ar(e,t){if(0===t)return!0;var r=Object.keys(e);for(var i of r)if(Tr(e[i])&&Ar(e[i],t-1))return!0;return!1}function Er(e,t){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,t);var i=[],n=[];return JSON.stringify(e,(function(e,t){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,e):n.push(e),~i.indexOf(t)&&(t=i[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(t)).join(".")+"]")}else i.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(Tr(o=t)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Tr(o)&&Ar(o,r.depthOfLimit))return function(e){var t=e.toString();return r.stringLengthLimit&&t.length>r.stringLengthLimit&&(t=t.slice(0,r.stringLengthLimit)+"..."),t}(t);var o;if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var l in t){var u=t[l];a[l]=Array.isArray(u)?kr(u.length?u[0]:null):u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Rr={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 Nr(e,t,r){var i,n=r?Object.assign({},Rr,r):Rr,s=n.logger;if(!s)return()=>{};i="string"==typeof s?t[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=t=>{var r=t.message,i=xr.parse(t.error).map((e=>e.toString())),s=[Er(r,n.stringifyOptions)];e({level:"error",trace:i,payload:s})};t.addEventListener("error",u),l.push((()=>{t.removeEventListener("error",u)}));var h=t=>{var r,i;t.reason instanceof Error?i=[Er("Uncaught (in promise) "+(r=t.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Er("Uncaught (in promise)",n.stringifyOptions),Er(t.reason,n.stringifyOptions)]);var s=xr.parse(r).map((e=>e.toString()));e({level:"error",trace:s,payload:i})};t.addEventListener("unhandledrejection",h),l.push((()=>{t.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)l.push(d(i,c));return()=>{l.forEach((e=>e()))};function d(t,r){var i=this;return t[r]?mr.patch(t,r,(t=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(t.apply(i,l),!("assert"===r&&l[0]||a)){a=!0;try{var h=xr.parse(new Error).map((e=>e.toString())).splice(1),c=("assert"===r?l.slice(1):l).map((e=>Er(e,n.stringifyOptions)));o++,n.lengthThreshold>o?e({level:r,trace:h,payload:c}):o===n.lengthThreshold&&e({level:"warn",trace:[],payload:[Er("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...l)}finally{a=!1}}})):()=>{}}}var Mr=e=>({name:"rrweb/console@1",observer:Nr,options:e});function Fr(){return Fr=t((function*(e,r,i){void 0===r&&(r=!0);try{var n=new CompressionStream("gzip"),s=n.writable.getWriter(),o=s.write((new TextEncoder).encode(e)).then((()=>s.close())).catch(function(){var e=t((function*(e){try{yield s.abort(e)}catch(e){}throw e}));return function(t){return e.apply(this,arguments)}}()),a=new Response(n.readable).blob(),[l]=yield Promise.all([a,o]);return l}catch(e){if(null!=i&&i.rethrow)throw e;return r&&console.error("Failed to gzip compress data",e),null}})),Fr.apply(this,arguments)}var Or=["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","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","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","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Pr=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return Or.concat(t).some((e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)}))},Lr=function(e){return e.MinLength="min_length",e.MaxLength="max_length",e}({}),Dr=["$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 Br(e,t){return-1!==e.indexOf(t)}var jr=function(e){return e.trim()},$r=function(e){return e.replace(/^\$/,"")},qr=Object.prototype,Zr=qr.hasOwnProperty,Hr=qr.toString,Vr=Array.isArray||function(e){return"[object Array]"===Hr.call(e)},zr=e=>"function"==typeof e,Ur=e=>e===Object(e)&&!Vr(e),Yr=e=>{if(Ur(e)){for(var t in e)if(Zr.call(e,t))return!1;return!0}return!1},Gr=e=>void 0===e,Wr=e=>"[object String]"==Hr.call(e),Xr=e=>Wr(e)&&0===e.trim().length,Jr=e=>null===e,Kr=e=>Gr(e)||Jr(e),Qr=e=>"[object Number]"==Hr.call(e)&&e==e,ei=e=>Qr(e)&&e>0,ti=e=>"[object Boolean]"===Hr.call(e),ri=e=>e instanceof FormData;function ii(e){return null===e||"object"!=typeof e}function ni(e,t){return{}.toString.call(e)==="[object "+t+"]"}function si(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var oi=[!0,"true",1,"1","yes"],ai=e=>Br(oi,e),li=[!1,"false",0,"0","no"];function ui(e,t,r,i,n){return t>r&&(i.warn("min cannot be greater than max."),t=r),Qr(e)?e>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t>e?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),ui(n||r,t,r,i))}class hi{constructor(e){this.$t={},this.zt=e.zt,this.Ut=ui(e.bucketSize,0,100,e.Gt),this.Wt=ui(e.refillRate,0,this.Ut,e.Gt),this.Xt=ui(e.refillInterval,0,864e5,e.Gt)}Jt(e,t){var r=Math.floor((t-e.lastAccess)/this.Xt);r>0&&(e.tokens=Math.min(e.tokens+r*this.Wt,this.Ut),e.lastAccess=e.lastAccess+r*this.Xt)}consumeRateLimit(e){var t,r=Date.now(),i=String(e),n=this.$t[i];return n?this.Jt(n,r):this.$t[i]=n={tokens:this.Ut,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(t=this.zt)||t.call(this,e)),0===n.tokens)}stop(){this.$t={}}}var ci,di,vi,fi=(e,t,r)=>{function i(i){for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];t((()=>{(0,r[i])(e,...s)}))}var n={debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i("error",...t)},critical(){for(var t=arguments.length,i=new Array(t),n=0;t>n;n++)i[n]=arguments[n];r.error(e,...i)},createLogger:i=>fi(e+" "+i,t,r)};return n},pi="Mobile",gi="iOS",mi="Android",yi="Tablet",bi=mi+" "+yi,wi="iPad",_i="Apple",Ii=_i+" Watch",Ci="Safari",Si="BlackBerry",xi="Samsung",ki=xi+"Browser",Ti=xi+" Internet",Ai="Chrome",Ei=Ai+" OS",Ri=Ai+" "+gi,Ni="Internet Explorer",Mi=Ni+" "+pi,Fi="Opera",Oi=Fi+" Mini",Pi="Edge",Li="Microsoft "+Pi,Di="Firefox",Bi=Di+" "+gi,ji="Nintendo",$i="PlayStation",qi="Xbox",Zi=mi+" "+pi,Hi=pi+" "+Ci,Vi="Windows",zi=Vi+" Phone",Ui="Nokia",Yi="Ouya",Gi="Generic",Wi=Gi+" "+pi.toLowerCase(),Xi=Gi+" "+yi.toLowerCase(),Ji="Konqueror",Ki="(\\d+(\\.\\d+)?)",Qi=new RegExp("Version/"+Ki),en=new RegExp(qi,"i"),tn=new RegExp($i+" \\w+","i"),rn=new RegExp(ji+" \\w+","i"),nn=new RegExp(Si+"|PlayBook|BB10","i"),sn={"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"},on=function(e,t){return t=t||"",Br(e," OPR/")&&Br(e,"Mini")?Oi:Br(e," OPR/")?Fi:nn.test(e)?Si:Br(e,"IE"+pi)||Br(e,"WPDesktop")?Mi:Br(e,ki)?Ti:Br(e,Pi)||Br(e,"Edg/")?Li:Br(e,"FBIOS")?"Facebook "+pi:Br(e,"UCWEB")||Br(e,"UCBrowser")?"UC Browser":Br(e,"CriOS")?Ri:Br(e,"CrMo")||Br(e,Ai)?Ai:Br(e,mi)&&Br(e,Ci)?Zi:Br(e,"FxiOS")?Bi:Br(e.toLowerCase(),Ji.toLowerCase())?Ji:((e,t)=>t&&Br(t,_i)||function(e){return Br(e,Ci)&&!Br(e,Ai)&&!Br(e,mi)}(e))(e,t)?Br(e,pi)?Hi:Ci:Br(e,Di)?Di:Br(e,"MSIE")||Br(e,"Trident/")?Ni:Br(e,"Gecko")?Di:""},an={[Mi]:[new RegExp("rv:"+Ki)],[Li]:[new RegExp(Pi+"?\\/"+Ki)],[Ai]:[new RegExp("("+Ai+"|CrMo)\\/"+Ki)],[Ri]:[new RegExp("CriOS\\/"+Ki)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ki)],[Ci]:[Qi],[Hi]:[Qi],[Fi]:[new RegExp("(Opera|OPR)\\/"+Ki)],[Di]:[new RegExp(Di+"\\/"+Ki)],[Bi]:[new RegExp("FxiOS\\/"+Ki)],[Ji]:[new RegExp("Konqueror[:/]?"+Ki,"i")],[Si]:[new RegExp(Si+" "+Ki),Qi],[Zi]:[new RegExp("android\\s"+Ki,"i")],[Ti]:[new RegExp(ki+"\\/"+Ki)],[Ni]:[new RegExp("(rv:|MSIE )"+Ki)],Mozilla:[new RegExp("rv:"+Ki)]},ln=function(e,t){var r=on(e,t),i=an[r];if(Gr(i))return null;for(var n=0;i.length>n;n++){var s=e.match(i[n]);if(s)return parseFloat(s[s.length-2])}return null},un=[[new RegExp(qi+"; "+qi+" (.*?)[);]","i"),e=>[qi,e&&e[1]||""]],[new RegExp(ji,"i"),[ji,""]],[new RegExp($i,"i"),[$i,""]],[nn,[Si,""]],[new RegExp(Vi,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[zi,""];if(new RegExp(pi).test(t)&&!/IEMobile\b/.test(t))return[Vi+" "+pi,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var i=sn[r[1]]||"";return/arm/i.test(t)&&(i="RT"),[Vi,i]}return[Vi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[gi,[e[3],e[4],e[5]||"0"].join(".")]:[gi,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Gr(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+mi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+mi+")","i"),e=>e&&e[2]?[mi,[e[2],e[3],e[4]||"0"].join(".")]:[mi,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ei,""]],[/Linux|debian/i,["Linux",""]]],hn=function(e){return rn.test(e)?ji:tn.test(e)?$i:en.test(e)?qi:new RegExp(Yi,"i").test(e)?Yi:new RegExp("("+zi+"|WPDesktop)","i").test(e)?zi:/iPad/.test(e)?wi:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Ii:nn.test(e)?Si:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Ui,"i").test(e)?Ui:/(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(pi).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)?mi:bi:new RegExp("(pda|"+pi+")","i").test(e)?Wi:new RegExp(yi,"i").test(e)&&!new RegExp(yi+" pc","i").test(e)?Xi:""},cn=function(e,t){var r,i,n,s,o=hn(e);return o===wi||o===bi||"Kobo"===o||"Kindle Fire"===o||o===Xi?yi:o===ji||o===qi||o===$i||o===Yi?"Console":o===Ii?"Wearable":o?pi:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!==(r=null==t?void 0:t.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==t?void 0:t.screenWidth)&&void 0!==i?i:0,null!==(n=null==t?void 0:t.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==t?void 0:t.devicePixelRatio)&&void 0!==s?s:1)?pi:yi:"Desktop"},dn={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},vn=dn.info;function fn(e){if(ti(e))return{boolValue:e};if("number"==typeof e)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if("string"==typeof e)return{stringValue:e};if(Vr(e))return{arrayValue:{values:e.map((e=>fn(e)))}};try{return{stringValue:JSON.stringify(e)}}catch(t){return{stringValue:String(e)}}}function pn(e){var t=[];for(var r in e){var i=e[r];Jr(i)||Gr(i)||t.push({key:r,value:fn(i)})}return t}function gn(e,t){if(e){var r=e.find((e=>e.type===t));return null==r?void 0:r.value}}function mn(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return vi&&r.length===di||(di=r.length,vi=r.reduce(((r,i)=>{ci||(ci={});var n=ci[i];if(n)r[n[0]]=n[1];else for(var s=e(i),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=t[i];if(l&&u){r[l]=u,ci[i]=[l,u];break}}return r}),{})),vi}}class yn{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var r=this;return t((function*(){for(var t of e)t.stacktrace&&t.stacktrace.frames&&Vr(t.stacktrace.frames)&&(t.stacktrace.frames=yield r.applyModifiers(t.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,n;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),r({},e,{cause:i,stack:n})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var r=this;return t((function*(){var t=e;for(var i of r.modifiers)t=yield i(t);return t}))()}convertToExceptionList(e,t){var i,n,s,o={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(n=t.handled)||void 0===n||n,synthetic:null!==(s=e.synthetic)&&void 0!==s&&s}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,r({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:mn(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,n)}};return r({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>n(e,i),next:e=>n(e,i+1)})}}var bn="?";function wn(e,t,r,i,n){var s={platform:e,filename:t,function:"<anonymous>"===r?bn:r,in_app:!0};return Gr(i)||(s.lineno=i),Gr(n)||(s.colno=n),s}var _n=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:bn,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},In=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Cn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Sn=/\((\S*)(?::(\d+))(?::(\d+))\)/,xn=(e,t)=>{var r=In.exec(e);if(r){var[,i,n,s]=r;return wn(t,i,bn,+n,+s)}var o=Cn.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=Sn.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=_n(o[1]||bn,o[2]);return wn(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},kn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Tn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,An=(e,t)=>{var r=kn.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Tn.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],s=r[1]||bn;return[s,n]=_n(s,n),wn(t,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},En=/\(error: (.*)\)/,Rn=50;class Nn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=Wr(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return ni(e,"DOMException")}isDOMError(e){return ni(e,"DOMError")}}class Mn{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class Fn{constructor(){}match(e){return ni(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var On=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Pn{match(e){return"string"==typeof e}coerce(e,t){var r,[i,n]=this.getInfos(e);return{type:null!=i?i:"Error",value:null!=n?n:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,i=e.match(On);return i&&(t=i[1],r=i[2]),[t,r]}}var Ln=["fatal","error","warning","log","info","debug"];function Dn(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(t>=n.length)return i===r.length?n:n.length>t?n.slice(0,t)+"...":n}return""}class Bn{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,i=this.getErrorPropertyFromObject(e);return i?t.apply(i):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return si(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Dn(e)}isSeverityLevel(e){return Wr(e)&&!Xr(e)&&Ln.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(r instanceof Error)return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class jn{match(e){return si(e)}coerce(e,t){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Dn(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class $n{match(e){return ii(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class qn{match(e){return ni(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!si(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,i=this.getUnhandledRejectionReason(e);return ii(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var Zn="$message",Hn="$timestamp",Vn=new Set([Zn,Hn]),zn={enabled:!0,max_bytes:32768};function Un(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:zn.enabled,max_bytes:Gn(e.max_bytes,zn.max_bytes)}:r({},zn)}class Yn{constructor(e){this.Kt=[],this.Qt=0,this.Bt=Un(e)}setConfig(e){this.Bt=Un(e),this.er()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,((e,r)=>{if("bigint"==typeof r)return r.toString();if("function"!=typeof r&&"symbol"!=typeof r){if(r instanceof Date)return r.toISOString();if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&"object"==typeof r){if(t.has(r))return"[Circular]";t.add(r)}return r}}))}catch(e){return}}(e);if(t)try{var r=JSON.parse(t);if(!Ur(r))return;var i=r,n=i[Zn],s=i[Hn];if(!Wr(n)||0===n.trim().length)return;if(!Wr(s)&&!Qr(s))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var r=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),r=0,i=0;t.length>i;i++)"%"===t[i]?(r+=1,i+=2):r+=1;return r}(t.json);r>this.Bt.max_bytes||(this.Kt.push({step:t.step,bytes:r}),this.Qt+=r,this.er())}}getAttachable(){return this.Kt.map((e=>e.step))}clear(){this.Kt=[],this.Qt=0}size(){return this.Kt.length}er(){for(;this.Qt>this.Bt.max_bytes&&this.Kt.length>0;){var e=this.Kt.shift();e&&(this.Qt-=e.bytes)}}}function Gn(e,t){if(!Qr(e)||e===1/0||e===-1/0)return t;var r=Math.floor(e);return 0>r?t:r}var Wn="undefined"!=typeof window?window:void 0,Xn="undefined"!=typeof globalThis?globalThis:Wn;"undefined"==typeof self&&(Xn.self=Xn),"undefined"==typeof File&&(Xn.File=function(){});var Jn=null==Xn?void 0:Xn.navigator,Kn=null==Xn?void 0:Xn.document,Qn=null==Xn?void 0:Xn.location,es=null==Xn?void 0:Xn.fetch,ts=null!=Xn&&Xn.XMLHttpRequest&&"withCredentials"in new Xn.XMLHttpRequest?Xn.XMLHttpRequest:void 0,rs=null==Xn?void 0:Xn.AbortController,is=null==Xn?void 0:Xn.CompressionStream,ns=null==Jn?void 0:Jn.userAgent,ss=null!=Wn?Wn:{},os=e=>e instanceof Document,as="1.372.7",ls={DEBUG:!1,LIB_VERSION:as,LIB_NAME:"web",JS_SDK_VERSION:as},us=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,i={C(t){if(Wn&&(ls.DEBUG||ss.POSTHOG_DEBUG||r)&&!Gr(Wn.console)&&Wn.console){for(var i=("__rrweb_original__"in Wn.console[t]?Wn.console[t].__rrweb_original__:Wn.console[t]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(e,...s)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.C("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.C("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.C("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];i.C("error",...t)},critical(){for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning(e){i.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>us(e+" "+t,r)};return i},hs=us("[PostHog.js]"),cs=hs.createLogger;function ds(e,t){Vr(e)&&e.forEach(t)}function vs(e,t){if(!Kr(e))if(Vr(e))e.forEach(t);else if(ri(e))e.forEach(((e,r)=>t(e,r)));else for(var r in e)Zr.call(e,r)&&t(e[r],r)}var fs=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(e[s]=n[s]);return e};function ps(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i}var gs=function(e){try{return e()}catch(e){return}},ms=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),i=0;t>i;i++)r[i]=arguments[i];return e.apply(this,r)}catch(e){hs.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),hs.critical(e)}}},ys=function(e){var t={};return vs(e,(function(e,r){(Wr(e)&&e.length>0||Qr(e))&&(t[r]=e)})),t};var bs=["herokuapp.com","vercel.app","netlify.app"];function ws(e){var t=null==e?void 0:e.hostname;if(!Wr(t))return!1;var r=t.split(".").slice(-2).join(".");for(var i of bs)if(r===i)return!1;return!0}function _s(e,t,r,i){var{capture:n=!1,passive:s=!0}=null!=i?i:{};null==e||e.addEventListener(t,r,{capture:n,passive:s})}function Is(e){return"ph_toolbar_internal"===e.name}var Cs=e=>{var t=null==Kn?void 0:Kn.createElement("a");return Gr(t)?null:(t.href=e,t)},Ss=function(e,t){var r,i;void 0===t&&(t="&");var n=[];return vs(e,(function(e,t){Gr(e)||Gr(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),i=encodeURIComponent(t),n[n.length]=i+"="+r)})),n.join(t)},xs=function(e,t){for(var r,i=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===t){r=s;break}}if(!Vr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(e){hs.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},ks=function(e,t,r){if(!e||!t||!t.length)return e;for(var i=e.split("#"),n=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),u=[],h=0;l.length>h;h++){var c=l[h].split("=");Vr(c)&&(t.includes(c[0])?u.push(c[0]+"="+r):u.push(l[h]))}var d=a;return null!=o&&(d+="?"+u.join("&")),null!=n&&(d+="#"+n),d},Ts=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null};function As(e,t,r){try{if(!(t in e))return()=>{};var i=e[t],n=r(i);return zr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=n,()=>{e[t]=i}}catch(e){return()=>{}}}function Es(e,t){var r,i=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),n={hostname:i,isHostDenied:!1};if(null==(r=t.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of t.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}var Rs="$people_distinct_id",Ns="$device_id",Ms="__alias",Fs="__timers",Os="$autocapture_disabled_server_side",Ps="$heatmaps_enabled_server_side",Ls="$exception_capture_enabled_server_side",Ds="$error_tracking_suppression_rules",Bs="$error_tracking_capture_extension_exceptions",js="$web_vitals_enabled_server_side",$s="$dead_clicks_enabled_server_side",qs="$product_tours_enabled_server_side",Zs="$web_vitals_allowed_metrics",Hs="$session_recording_remote_config",Vs="$replay_override_sampling",zs="$replay_override_linked_flag",Us="$replay_override_url_trigger",Ys="$replay_override_event_trigger",Gs="$sesid",Ws="$session_is_sampled",Xs="$enabled_feature_flags",Js="$active_feature_flags",Ks="$early_access_features",Qs="$feature_flag_details",eo="$feature_flag_payloads",to="$feature_flag_request_id",ro="$override_feature_flags",io="$override_feature_flag_payloads",no="$stored_person_properties",so="$stored_group_properties",oo="$surveys",ao="$surveys_activated",lo="ph_product_tours",uo="$flag_call_reported",ho="$flag_call_reported_session_id",co="$feature_flag_errors",vo="$feature_flag_evaluated_at",fo="$user_state",po="$client_session_props",go="$capture_rate_limit",mo="$initial_campaign_params",yo="$initial_referrer_info",bo="$initial_person_info",wo="$epp",_o="__POSTHOG_TOOLBAR__",Io="$posthog_cookieless",Co="$sdk_debug_extensions_init_method",So="$sdk_debug_extensions_init_time_ms",xo="$sdk_debug_recording_script_not_loaded",ko="PostHog loadExternalDependency extension not found.",To="on_reject",Ao="always",Eo="anonymous",Ro="identified",No="identified_only",Mo="visibilitychange",Fo="beforeunload",Oo="$pageview",Po="$pageleave",Lo="$identify",Do="$groupidentify",Bo=1,jo=3,$o=11;function qo(e){return e instanceof Element&&(e.id===_o||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Zo(e){return!!e&&e.nodeType===Bo}function Ho(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Vo(e){return!!e&&e.nodeType===jo}function zo(e){return!!e&&e.nodeType===$o&&Zo(e.host)}function Uo(e){return e?jr(e).split(/\s+/):[]}function Yo(e){var t=null==Wn?void 0:Wn.location.href;return!!(t&&e&&e.some((e=>t.match(e))))}function Go(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 Uo(t)}function Wo(e){return Kr(e)?null:jr(e).split(/(\s+)/).filter((e=>va(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Xo(e){var t="";return sa(e)&&!oa(e)&&e.childNodes&&e.childNodes.length&&vs(e.childNodes,(function(e){var r;Vo(e)&&e.textContent&&(t+=null!==(r=Wo(e.textContent))&&void 0!==r?r:"")})),jr(t)}function Jo(e){return Gr(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Ko=["a","button","form","input","select","textarea","label"];function Qo(e,t){if(Gr(t))return!0;var r,i=function(e){if(t.some((t=>e.matches(t))))return{v:!0}};for(var n of e)if(r=i(n))return r.v;return!1}function ea(e){var t=e.parentNode;return!(!t||!Zo(t))&&t}var ta=["next","previous","prev",">","<"],ra=[".ph-no-rageclick",".ph-no-capture"];var ia=e=>!e||Ho(e,"html")||!Zo(e),na=(e,t)=>{if(!Wn||ia(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[e],n=e;n.parentNode&&!Ho(n,"body");)if(zo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=ea(n);if(!s)break;if(t||Ko.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=Wn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function sa(e){for(var t=e;t.parentNode&&!Ho(t,"body");t=t.parentNode){var r=Go(t);if(Br(r,"ph-sensitive")||Br(r,"ph-no-capture"))return!1}if(Br(Go(e),"ph-include"))return!0;var i=e.type||"";if(Wr(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=e.name||e.id||"";return!Wr(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function oa(e){return!!(Ho(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Ho(e,"select")||Ho(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var aa="(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})",la=new RegExp("^(?:"+aa+")$"),ua=new RegExp(aa),ha="\\d{3}-?\\d{2}-?\\d{4}",ca=new RegExp("^("+ha+")$"),da=new RegExp("("+ha+")");function va(e,t){if(void 0===t&&(t=!0),Kr(e))return!1;if(Wr(e)){if(e=jr(e),(t?la:ua).test((e||"").replace(/[- ]/g,"")))return!1;if((t?ca:da).test(e))return!1}return!0}function fa(e){var t=Xo(e);return va(t=(t+" "+pa(e)).trim())?t:""}function pa(e){var t="";return e&&e.childNodes&&e.childNodes.length&&vs(e.childNodes,(function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var i=Xo(e);t=(t+" "+i).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+pa(e)).trim())}catch(e){hs.error("[AutoCapture]",e)}})),t}function ga(e){return e.replace(/"|\\"/g,'\\"')}function ma(e){var t=e.attr__class;return t?Vr(t)?t:Uo(t):void 0}var ya={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","bam.nr-data.net"]},ba=cs("[Recorder]"),wa=e=>"navigation"===e.entryType,_a=e=>"resource"===e.entryType;function Ia(e,t){return!!t&&(ti(t)||t[e])}function Ca(e){var{type:t,recordBody:r,headers:i,url:n}=e;function s(e){var t=Object.keys(i).find((e=>"content-type"===e.toLowerCase())),r=t&&i[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}}(n))return!1;if(ti(r))return!0;if(Vr(r))return s(r);var o=r[t];return ti(o)?o:s(o)}function Sa(e,t,r,i,n,s){return xa.apply(this,arguments)}function xa(){return xa=t((function*(e,t,r,i,n,s){if(void 0===s&&(s=0),s>10)return ba.warn("Failed to get performance entry for request",{url:r,initiatorType:t}),null;var o=function(e,r){for(var s=e.length-1;s>=0;s-=1)if(_a(o=e[s])&&o.initiatorType===t&&(Gr(i)||o.startTime>=i)&&(Gr(n)||n>=o.startTime))return e[s];var o}(e.performance.getEntriesByName(r));return o||(yield new Promise((e=>setTimeout(e,50*s))),Sa(e,t,r,i,n,s+1))})),xa.apply(this,arguments)}function ka(e){var{body:t,options:r,url:i}=e;if(Kr(t))return null;var{hostname:n,isHostDenied:s}=Es(i,r);if(s)return n+" is in deny list";if(Wr(t))return t;if(os(t))return t.textContent;if(ri(t))return Ss(t);if(Ur(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 Ta=e=>!Jr(e)&&("navigation"===e.entryType||"resource"===e.entryType);function Aa(e){var{entry:t,method:i,status:n,networkRequest:s,isInitial:o,start:a,end:l,url:u,initiatorType:h}=e;a=t?t.startTime:a,l=t?t.responseEnd:l;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[r({},t?t.toJSON():{name:u},{startTime:Gr(a)?void 0:Math.round(a),endTime:Gr(l)?void 0:Math.round(l),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(t?t.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(Ta(t))for(var f of t.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(t.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var Ea=["video/","audio/"];function Ra(e){return new Promise((t=>{var r=setTimeout((()=>t("[SessionReplay] Timeout while trying to read body")),500);try{e.clone().text().then((e=>t(e)),(e=>t("[SessionReplay] Failed to read body: "+e))).finally((()=>clearTimeout(r)))}catch(e){clearTimeout(r),t("[SessionReplay] Failed to read body")}}))}function Na(){return Na=t((function*(e){var{r:t,options:r,url:i}=e,{hostname:n,isHostDenied:s}=Es(i,r);return s?Promise.resolve(n+" is in deny list"):Ra(t)})),Na.apply(this,arguments)}function Ma(){return Ma=t((function*(e){var{r:t,options:r,url:i}=e,n=function(e){var t,{r:r,options:i,url:n}=e;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(t=r.headers.get("Content-Type"))?void 0:t.toLowerCase(),o=Ea.some((e=>null==s?void 0:s.startsWith(e)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:l}=Es(n,i);return l?a+" is in deny list":null}({r:t,options:r,url:i});return Jr(n)?Ra(t):Promise.resolve(n)})),Ma.apply(this,arguments)}var Fa=null;function Oa(e,i,n){if(!("performance"in i))return()=>{};if(Fa)return ba.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},ya,n):ya,o=t=>{var i=[];t.requests.forEach((e=>{var t=s.maskRequestFn(e);t&&i.push(t)})),i.length>0&&e(r({},t,{requests:i}))},a=function(e,t,r){if(r.recordInitialRequests){var i=t.performance.getEntries().filter((e=>wa(e)||_a(e)&&r.initiatorTypes.includes(e.initiatorType)));e({requests:i.flatMap((e=>Aa({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new t.PerformanceObserver((t=>{var i=t.getEntries().filter((e=>wa(e)||_a(e)&&r.initiatorTypes.includes(e.initiatorType)&&(e=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType)(e)));e({requests:i.flatMap((e=>Aa({entry:e,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((e=>r.performanceEntryTypeToObserve.includes(e)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(e,t,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Ia("request",r.recordHeaders),n=Ia("response",r.recordHeaders),s=As(t.XMLHttpRequest.prototype,"open",(s=>function(o,a,l,u,h){void 0===l&&(l=!0);var c,d,v=this,f=new Request(a),p={},g={},m=v.setRequestHeader.bind(v);v.setRequestHeader=(e,t)=>(g[e]=t,m(e,t)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=e=>(Ca({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=ka({body:e,options:r,url:a})),c=t.performance.now(),y(e));var b=()=>{v.removeEventListener("readystatechange",w),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},w=()=>{if(v.readyState===v.DONE){b(),d=t.performance.now();var i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((e=>{var t=e.split(": "),r=t.shift(),n=t.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),Ca({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=ka({body:v.response,options:r,url:a})),Sa(t,"xmlhttprequest",f.url,c,d).then((t=>{var r=Aa({entry:t,method:o,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});e({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",w),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),s.call(v,o,a.toString(),l,u,h)}));return()=>{s()}}(o,i,s),u=function(e,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Ia("request",i.recordHeaders),s=Ia("response",i.recordHeaders),o=As(r,"fetch",(o=>function(){var a=t((function*(t,a){var l,u,h,c=new Request(t,a),d={};try{var v={};c.headers.forEach(((e,t)=>{v[t]=e})),n&&(d.requestHeaders=v),Ca({type:"request",headers:v,url:t,recordBody:i.recordBody})&&(d.requestBody=yield function(e){return Na.apply(this,arguments)}({r:c,options:i,url:t})),u=r.performance.now(),l=yield o(c),h=r.performance.now();var f={};return l.headers.forEach(((e,t)=>{f[t]=e})),s&&(d.responseHeaders=f),Ca({type:"response",headers:f,url:t,recordBody:i.recordBody})&&(d.responseBody=yield function(e){return Ma.apply(this,arguments)}({r:l,options:i,url:t})),l}finally{Sa(r,"fetch",c.url,u,h).then((t=>{var r,i=Aa({entry:t,method:c.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:u,end:h,url:c.url,initiatorType:"fetch"});e({requests:i})})).catch((()=>{}))}}));return function(e,t){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),Fa=()=>{a(),l(),u(),Fa=null}}var Pa=e=>({name:"rrweb/network@1",observer:Oa,options:e});ss.__PosthogExtensions__=ss.__PosthogExtensions__||{},ss.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Mr,getRecordNetworkPlugin:Pa},ss.__PosthogExtensions__.rrweb={record:Pt,version:"v2"},ss.rrweb={record:Pt,version:"v2"},ss.rrwebConsoleRecord={getRecordConsolePlugin:Mr},ss.getRecordNetworkPlugin=Pa;var La,Da,Ba,ja,$a,qa,Za,Ha,Va,za,Ua,Ya,Ga={},Wa=[],Xa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ja=Array.isArray;function Ka(e,t){for(var r in t)e[r]=t[r];return e}function Qa(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function el(e,t,r){var i,n,s,o={};for(s in t)"key"==s?i=t[s]:"ref"==s?n=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?La.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===o[s]&&(o[s]=e.defaultProps[s]);return tl(e,o,i,n,null)}function tl(e,t,r,i,n){var s={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Ba:n,__i:-1,__u:0};return null==n&&null!=Da.vnode&&Da.vnode(s),s}function rl(e){return e.children}function il(e,t){this.props=e,this.context=t}function nl(e,t){if(null==t)return e.__?nl(e.__,e.__i+1):null;for(var r;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?nl(e):null}function sl(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;e.__k.length>t;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return sl(e)}}function ol(e){(!e.__d&&(e.__d=!0)&&ja.push(e)&&!$.__r++||$a!=Da.debounceRendering)&&(($a=Da.debounceRendering)||qa)($)}function $(){for(var e,t,r,i,n,s,o,a=1;ja.length;)ja.length>a&&ja.sort(Za),e=ja.shift(),a=ja.length,e.__d&&(r=void 0,i=void 0,n=(i=(t=e).__v).__e,s=[],o=[],t.__P&&((r=Ka({},i)).__v=i.__v+1,Da.vnode&&Da.vnode(r),vl(t.__P,r,i,t.__n,t.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?nl(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,pl(s,r,o),i.__e=i.__=null,r.__e!=n&&sl(r)));$.__r=0}function al(e,t,r,i,n,s,o,a,l,u,h){var c,d,v,f,p,g,m,y=i&&i.__k||Wa,b=t.length;for(l=function(e,t,r,i,n){var s,o,a,l,u,h=r.length,c=h,d=0;for(e.__k=new Array(n),s=0;n>s;s++)null!=(o=t[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=e.__k[s]=tl(null,o,null,null,null):Ja(o)?o=e.__k[s]=tl(rl,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=e.__k[s]=tl(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[s]=o,l=s+d,o.__=e,o.__b=e.__b+1,a=null,-1!=(u=o.__i=ul(o,r,l,c))&&(c--,(a=r[u])&&(a.__u|=2)),null==a||null==a.__v?(-1==u&&(n>h?d--:h>n&&d++),"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?d--:u==l+1?d++:(u>l?d--:d++,o.__u|=4))):e.__k[s]=null;if(c)for(s=0;h>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=nl(a)),yl(a,a));return i}(r,t,y,l,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1==v.__i?Ga:y[v.__i]||Ga,v.__i=c,g=vl(e,v,d,n,s,o,a,l,u,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&ml(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||d.__k===v.__k?l=ll(v,l,e,m):"function"==typeof v.type&&void 0!==g?l=g:f&&(l=f.nextSibling),v.__u&=-7);return r.__e=p,l}function ll(e,t,r,i){var n,s;if("function"==typeof e.type){for(n=e.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=e,t=ll(n[s],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=nl(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function ul(e,t,r,i){var n,s,o,a=e.key,l=e.type,u=t[r],h=null!=u&&0==(2&u.__u);if(null===u&&null==a||h&&a==u.key&&l==u.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||t.length>s;)if(null!=(u=t[o=0>n?s++:n--])&&0==(2&u.__u)&&a==u.key&&l==u.type)return o;return-1}function hl(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||Xa.test(t)?r:r+"px"}function cl(e,t,r,i,n){var s,o;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||hl(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||hl(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(Ha,"$1")),o=t.toLowerCase(),t=o in e||"onFocusOut"==t||"onFocusIn"==t?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?i?r.u=i.u:(r.u=Va,e.addEventListener(t,s?Ua:za,s)):e.removeEventListener(t,s?Ua:za,s);else{if("http://www.w3.org/2000/svg"==n)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&&"popover"!=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,"popover"==t&&1==r?"":r))}}function dl(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=Va++;else if(r.u>t.t)return;return r(Da.event?Da.event(t):t)}}}function vl(e,t,r,i,n,s,o,a,l,u){var h,c,d,v,f,p,g,m,y,b,w,$,_,I,C,S,x,k=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[a=t.__e=r.__e]),(h=Da.__b)&&h(t);e:if("function"==typeof k)try{if(m=t.props,y="prototype"in k&&k.prototype.render,b=(h=k.contextType)&&i[h.__c],w=h?b?b.props.value:h.__:i,r.__c?g=(c=t.__c=r.__c).__=c.__E:(y?t.__c=c=new k(m,w):(t.__c=c=new il(m,w),c.constructor=k,c.render=bl),b&&b.sub(c),c.state||(c.state={}),c.__n=i,d=c.__d=!0,c.__h=[],c._sb=[]),y&&null==c.__s&&(c.__s=c.state),y&&null!=k.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Ka({},c.__s)),Ka(c.__s,k.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=t,d)y&&null==k.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),y&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(y&&null==k.getDerivedStateFromProps&&m!==v&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(m,w),t.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(m,c.__s,w)){for(t.__v!=r.__v&&(c.props=m,c.state=c.__s,c.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),$=0;c._sb.length>$;$++)c.__h.push(c._sb[$]);c._sb=[],c.__h.length&&o.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(m,c.__s,w),y&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(v,f,p)}))}if(c.context=w,c.props=m,c.__P=e,c.__e=!1,_=Da.__r,I=0,y){for(c.state=c.__s,c.__d=!1,_&&_(t),h=c.render(c.props,c.state,c.context),C=0;c._sb.length>C;C++)c.__h.push(c._sb[C]);c._sb=[]}else do{c.__d=!1,_&&_(t),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&25>++I);c.state=c.__s,null!=c.getChildContext&&(i=Ka(Ka({},i),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),S=h,null!=h&&h.type===rl&&null==h.key&&(S=gl(h.props.children)),a=al(e,Ja(S)?S:[S],t,r,i,n,s,o,a,l,u),c.base=t.__e,t.__u&=-161,c.__h.length&&o.push(c),g&&(c.__E=c.__=null)}catch(e){if(t.__v=null,l||null!=s)if(e.then){for(t.__u|=l?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,t.__e=a}else{for(x=s.length;x--;)Qa(s[x]);fl(t)}else t.__e=r.__e,t.__k=r.__k,e.then||fl(t);Da.__e(e,t,r)}else null==s&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):a=t.__e=function(e,t,r,i,n,s,o,a,l){var u,h,c,d,v,f,p,g=r.props||Ga,m=t.props,y=t.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;s.length>u;u++)if((v=s[u])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){e=v,s[u]=null;break}if(null==e){if(null==y)return document.createTextNode(m);e=document.createElementNS(n,y,m.is&&m),a&&(Da.__m&&Da.__m(t,s),a=!1),s=null}if(null==y)g===m||a&&e.data==m||(e.data=m);else{if(s=s&&La.call(e.childNodes),!a&&null!=s)for(g={},u=0;e.attributes.length>u;u++)g[(v=e.attributes[u]).name]=v.value;for(u in g)if(v=g[u],"children"==u);else if("dangerouslySetInnerHTML"==u)c=v;else if(!(u in m)){if("value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m)continue;cl(e,u,null,v,n)}for(u in m)v=m[u],"children"==u?d=v:"dangerouslySetInnerHTML"==u?h=v:"value"==u?f=v:"checked"==u?p=v:a&&"function"!=typeof v||g[u]===v||cl(e,u,v,g[u],n);if(h)a||c&&(h.__html==c.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(c&&(e.innerHTML=""),al("template"==t.type?e.content:e,Ja(d)?d:[d],t,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&nl(r,0),a,l),null!=s)for(u=s.length;u--;)Qa(s[u]);a||(u="value","progress"==y&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&cl(e,u,f,g[u],n),u="checked",null!=p&&p!=e[u]&&cl(e,u,p,g[u],n))}return e}(r.__e,t,r,i,n,s,o,l,u);return(h=Da.diffed)&&h(t),128&t.__u?void 0:a}function fl(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(fl)}function pl(e,t,r){for(var i=0;r.length>i;i++)ml(r[i],r[++i],r[++i]);Da.__c&&Da.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Da.__e(e,t.__v)}}))}function gl(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:Ja(e)?e.map(gl):Ka({},e)}function ml(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){Da.__e(e,r)}}function yl(e,t,r){var i,n;if(Da.unmount&&Da.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||ml(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Da.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(n=0;i.length>n;n++)i[n]&&yl(i[n],t,r||"function"!=typeof e.type);r||Qa(e.__e),e.__c=e.__=e.__e=void 0}function bl(e,t,r){return this.constructor(e,r)}function wl(e,t,r){var i,n,s;t==document&&(t=document.documentElement),Da.__&&Da.__(e,t),i=t.__k,n=[],s=[],vl(t,e=t.__k=el(rl,null,[e]),i||Ga,Ga,t.namespaceURI,i?null:t.firstChild?La.call(t.childNodes):null,n,i?i.__e:t.firstChild,!1,s),pl(n,e,s)}La=Wa.slice,Da={__e(e,t,r,i){for(var n,s,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},Ba=0,il.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Ka({},this.state),"function"==typeof e&&(e=e(Ka({},r),this.props)),e&&Ka(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),ol(this))},il.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ol(this))},il.prototype.render=rl,ja=[],qa="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Za=function(e,t){return e.__v.__b-t.__v.__b},$.__r=0,Ha=/(PointerCapture)$|Capture$/i,Va=0,za=dl(!1),Ua=dl(!0),Ya=0;var _l,Il,Cl,Sl,xl=0,kl=[],Tl=Da,Al=Tl.__b,El=Tl.__r,Rl=Tl.diffed,Nl=Tl.__c,Ml=Tl.unmount,Fl=Tl.__;function Ol(e,t){Tl.__h&&Tl.__h(Il,e,xl||t),xl=0;var r=Il.__H||(Il.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Pl(e){return xl=1,function(e,t,r){var i=Ol(_l++,2);if(i.t=e,!i.__c&&(i.__=[Ul(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Il,!Il.__f)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(e){return!!e.__c}));if(n.every((function(e){return!e.__N})))return!s||s.call(this,e,t,r);var o=i.__c.props!==e;return n.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),s&&s.call(this,e,t,r)||o};Il.__f=!0;var s=Il.shouldComponentUpdate,o=Il.componentWillUpdate;Il.componentWillUpdate=function(e,t,r){if(this.__e){var i=s;s=void 0,n(e,t,r),s=i}o&&o.call(this,e,t,r)},Il.shouldComponentUpdate=n}return i.__N||i.__}(Ul,e)}function Ll(e,t){var r=Ol(_l++,3);!Tl.__s&&zl(r.__H,t)&&(r.__=e,r.u=t,Il.__H.__h.push(r))}function Dl(e){return xl=5,Bl((function(){return{current:e}}),[])}function Bl(e,t){var r=Ol(_l++,7);return zl(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function jl(e){var t=Il.context[e.__c],r=Ol(_l++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(Il)),t.props.value):e.__}function $l(){for(var e;e=kl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Hl),e.__H.__h.forEach(Vl),e.__H.__h=[]}catch(t){e.__H.__h=[],Tl.__e(t,e.__v)}}Tl.__b=function(e){Il=null,Al&&Al(e)},Tl.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Fl&&Fl(e,t)},Tl.__r=function(e){El&&El(e),_l=0;var t=(Il=e.__c).__H;t&&(Cl===Il?(t.__h=[],Il.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(Hl),t.__h.forEach(Vl),t.__h=[],_l=0)),Cl=Il},Tl.diffed=function(e){Rl&&Rl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==kl.push(t)&&Sl===Tl.requestAnimationFrame||((Sl=Tl.requestAnimationFrame)||Zl)($l)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),Cl=Il=null},Tl.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Hl),e.__h=e.__h.filter((function(e){return!e.__||Vl(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Tl.__e(r,e.__v)}})),Nl&&Nl(e,t)},Tl.unmount=function(e){Ml&&Ml(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{Hl(e)}catch(e){t=e}})),r.__H=void 0,t&&Tl.__e(t,r.__v))};var ql="function"==typeof requestAnimationFrame;function Zl(e){var t,r=function(){clearTimeout(i),ql&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);ql&&(t=requestAnimationFrame(r))}function Hl(e){var t=Il,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),Il=t}function Vl(e){var t=Il;e.__c=e.__(),Il=t}function zl(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function Ul(e,t){return"function"==typeof t?t(e):t}var Yl="events",Gl="cancelEvents",Wl={Tab:"tab",Selector:"selector"},Xl={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Jl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Kl={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Ql={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},eu={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},tu="always",ru={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},iu={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},nu="popover";function su(e){return"$survey_response_"+e}function ou(e,t){if(!t)return null;var r=e[su(t)];return Vr(r)?[...r]:r}function au(e,t){void 0===e&&(e={});var i={};return t.questions.forEach((t=>{if(!Gr(t.originalQuestionIndex)){var r,n=0===(r=t.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=ou(e,t.id);Gr(s)||(i[n]=s)}})),r({$survey_questions:t.questions.map((t=>({id:t.id,question:t.question,response:ou(e,t.id)})))},e,i)}function lu(e,t){var r="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(r="$survey_"+t+"/"+e.id+"/"+e.current_iteration),r}var uu,hu,cu=(void 0===uu&&(uu=e=>e()),fi("[SurveyTranslations]",uu,(void 0===hu&&(hu=console),{log:hu.log.bind(hu),warn:hu.warn.bind(hu),error:hu.error.bind(hu),debug:hu.debug.bind(hu)})));function du(e){return"string"==typeof e&&e.trim()?e.trim():null}function vu(e){return e.toLowerCase()}function fu(e,t){if(!e||!t)return null;var r=vu(t),i=Object.keys(e).find((e=>vu(e)===r));if(i)return cu.debug("Found exact translation match: "+i),i;if(r.includes("-")){var n=r.split("-")[0],s=Object.keys(e).find((e=>vu(e)===n));if(s)return cu.debug("Found base language translation match: "+s+" (from "+t+")"),s}return null}function pu(e,t){var i,n=fu(e.translations,t),s=r({},e),o=!1;if(n){var a,l=null==(a=e.translations)?void 0:a[n];l&&(cu.info("Applying survey-level translation for language: "+n),Gr(l.name)||(s.name=l.name,o=!0),s.appearance?(s.appearance=r({},s.appearance),Gr(l.thankYouMessageHeader)||(s.appearance.thankYouMessageHeader=l.thankYouMessageHeader,o=!0),Gr(l.thankYouMessageDescription)||(s.appearance.thankYouMessageDescription=l.thankYouMessageDescription,o=!0),Gr(l.thankYouMessageCloseButtonText)||(s.appearance.thankYouMessageCloseButtonText=l.thankYouMessageCloseButtonText,o=!0)):function(e){return!Gr(e.thankYouMessageHeader)||!Gr(e.thankYouMessageDescription)||!Gr(e.thankYouMessageCloseButtonText)}(l)&&(o=!0))}var u=e.questions.map((e=>function(e,t){var i,n=fu(e.translations,t);if(!n)return{question:e,matchedKey:null,hasChanges:!1};var s=null==(i=e.translations)?void 0:i[n];if(!s)return{question:e,matchedKey:null,hasChanges:!1};var o=r({},e),a=!1;return Gr(s.question)||(o.question=s.question,a=!0),Gr(s.description)||(o.description=s.description,a=!0),Gr(s.buttonText)||(o.buttonText=s.buttonText,a=!0),"link"in o&&!Gr(s.link)&&(o.link=s.link,a=!0),"lowerBoundLabel"in o&&!Gr(s.lowerBoundLabel)&&(o.lowerBoundLabel=s.lowerBoundLabel,a=!0),"upperBoundLabel"in o&&!Gr(s.upperBoundLabel)&&(o.upperBoundLabel=s.upperBoundLabel,a=!0),"choices"in o&&function(e){return Vr(e.choices)}(s)&&(o.choices=s.choices,a=!0),{question:a?o:e,matchedKey:a?n:null,hasChanges:a}}(e,t))),h=u.map((e=>e.question)),c=u.some((e=>e.hasChanges)),d=null;return n||(d=(null==(i=u.find((e=>e.matchedKey)))?void 0:i.matchedKey)||null),c&&(s.questions=h,o=!0,cu.info("Applied question-level translations for language: "+t)),{survey:s,matchedKey:o?n||d:null}}var gu=cs("[Surveys]");function mu(e){return!(!e.start_date||e.end_date)}function yu(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}function bu(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}var wu="seenSurvey_",_u="inProgressSurvey_",Iu=(e,t)=>{var r=""+e+t.id;return t.current_iteration&&t.current_iteration>0&&(r=""+e+t.id+"_"+t.current_iteration),r},Cu=e=>Iu(wu,e),Su=e=>{try{var t=Cu(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){gu.error("Failed to persist survey seen state",e)}},xu=[Kl.Popover,Kl.Widget,Kl.API],ku={ignoreConditions:!1,ignoreDelay:!1,displayType:nu};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Qr(e)&&isFinite(e)&&Math.floor(e)===e});class Tu{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||0>e||0>t||0>r||0>i||e>0xffffffffffff||t>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new Tu(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),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 Tu(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Au{constructor(){this.I=0,this.S=0,this.k=new Nu}generate(){var e=this.generateOrAbort();if(Gr(e)){this.I=0;var t=this.generateOrAbort();if(Gr(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.I)this.I=e,this.A();else{if(this.I>=e+1e4)return;this.S++,this.S>4398046511103&&(this.I++,this.A())}return Tu.fromFieldsV7(this.I,Math.trunc(this.S/Math.pow(2,30)),this.S&Math.pow(2,30)-1,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}}var Eu,Ru=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Wn&&!Gr(Wn.crypto)&&crypto.getRandomValues&&(Ru=e=>crypto.getRandomValues(e));class Nu{constructor(){this.T=new Uint32Array(8),this.N=1/0}nextUint32(){return this.T.length>this.N||(Ru(this.T),this.N=0),this.T[this.N++]}}var Mu=()=>Fu().toString(),Fu=()=>(Eu||(Eu=new Au)).generate(),Ou="gzip-js",Pu="base64",Lu=Uint8Array,Du=Uint16Array,Bu=Uint32Array,ju=new Lu([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]),$u=new Lu([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]),qu=new Lu([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Zu=function(e,t){for(var r=new Du(31),i=0;31>i;++i)r[i]=t+=1<<e[i-1];var n=new Bu(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},Hu=Zu(ju,2),Vu=Hu[1];Hu[0][28]=258,Vu[258]=28;for(var zu=Zu($u,0)[1],Uu=new Du(32768),Yu=0;32768>Yu;++Yu){var Gu=(43690&Yu)>>>1|(21845&Yu)<<1;Uu[Yu]=((65280&(Gu=(61680&(Gu=(52428&Gu)>>>2|(13107&Gu)<<2))>>>4|(3855&Gu)<<4))>>>8|(255&Gu)<<8)>>>1}var Wu=function(e,t,r){for(var i=e.length,n=0,s=new Du(t);i>n;++n)++s[e[n]-1];var o,a=new Du(t);for(n=0;t>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Du(1<<t);var l=15-t;for(n=0;i>n;++n)if(e[n])for(var u=n<<4|e[n],h=t-e[n],c=a[e[n]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)o[Uu[c]>>>l]=u}else for(o=new Du(i),n=0;i>n;++n)o[n]=Uu[a[e[n]-1]++]>>>15-e[n];return o},Xu=new Lu(288);for(Yu=0;144>Yu;++Yu)Xu[Yu]=8;for(Yu=144;256>Yu;++Yu)Xu[Yu]=9;for(Yu=256;280>Yu;++Yu)Xu[Yu]=7;for(Yu=280;288>Yu;++Yu)Xu[Yu]=8;var Ju=new Lu(32);for(Yu=0;32>Yu;++Yu)Ju[Yu]=5;var Ku=Wu(Xu,9,0),Qu=Wu(Ju,5,0),eh=function(e){return(e/8>>0)+(7&e&&1)},th=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var i=new(e instanceof Du?Du:e instanceof Bu?Bu:Lu)(r-t);return i.set(e.subarray(t,r)),i},rh=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8},ih=function(e,t,r){var i=t/8>>0;e[i]|=r<<=7&t,e[i+1]|=r>>>8,e[i+2]|=r>>>16},nh=function(e,t){for(var r=[],i=0;e.length>i;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,s=r.slice();if(!n)return[new Lu(0),0];if(1==n){var o=new Lu(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var a=r[0],l=r[1],u=0,h=1,c=2;for(r[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=r[r[c].f>r[u].f?u++:c++],l=r[u!=h&&r[c].f>r[u].f?u++:c++],r[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=s[0].s;for(i=1;n>i;++i)s[i].s>d&&(d=s[i].s);var v=new Du(d+1),f=sh(r[h-1],v,0);if(f>t){i=0;var p=0,g=f-t,m=1<<g;for(s.sort((function(e,t){return v[t.s]-v[e.s]||e.f-t.f}));n>i;++i){var y=s[i].s;if(t>=v[y])break;p+=m-(1<<f-v[y]),v[y]=t}for(p>>>=g;p>0;){var b=s[i].s;t>v[b]?p-=1<<t-v[b]++-1:++i}for(;i>=0&&p;--i){var w=s[i].s;v[w]==t&&(--v[w],++p)}f=t}return[new Lu(v),f]},sh=function(e,t,r){return-1==e.s?Math.max(sh(e.l,t,r+1),sh(e.r,t,r+1)):t[e.s]=r},oh=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Du(++t),i=0,n=e[0],s=1,o=function(e){r[i++]=e},a=1;t>=a;++a)if(e[a]==n&&a!=t)++s;else{if(!n&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(n),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(n);s=1,n=e[a]}return[r.subarray(0,i),t]},ah=function(e,t){for(var r=0,i=0;t.length>i;++i)r+=e[i]*t[i];return r},lh=function(e,t,r){var i=r.length,n=eh(t+2);e[n]=255&i,e[n+1]=i>>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var s=0;i>s;++s)e[n+s+4]=r[s];return 8*(n+4+i)},uh=function(e,t,r,i,n,s,o,a,l,u,h){rh(t,h++,r),++n[256];for(var c=nh(n,15),d=c[0],v=c[1],f=nh(s,15),p=f[0],g=f[1],m=oh(d),y=m[0],b=m[1],w=oh(p),_=w[0],I=w[1],C=new Du(19),S=0;y.length>S;++S)C[31&y[S]]++;for(S=0;_.length>S;++S)C[31&_[S]]++;for(var x=nh(C,7),k=x[0],T=x[1],A=19;A>4&&!k[qu[A-1]];--A);var E,R,N,M,F=u+5<<3,O=ah(n,Xu)+ah(s,Ju)+o,P=ah(n,d)+ah(s,p)+o+14+3*A+ah(C,k)+(2*C[16]+3*C[17]+7*C[18]);if(O>=F&&P>=F)return lh(t,h,e.subarray(l,l+u));if(rh(t,h,1+(O>P)),h+=2,O>P){E=Wu(d,v,0),R=d,N=Wu(p,g,0),M=p;var L=Wu(k,T,0);for(rh(t,h,b-257),rh(t,h+5,I-1),rh(t,h+10,A-4),h+=14,S=0;A>S;++S)rh(t,h+3*S,k[qu[S]]);h+=3*A;for(var D=[y,_],B=0;2>B;++B){var j=D[B];for(S=0;j.length>S;++S)rh(t,h,L[q=31&j[S]]),h+=k[q],q>15&&(rh(t,h,j[S]>>>5&127),h+=j[S]>>>12)}}else E=Ku,R=Xu,N=Qu,M=Ju;for(S=0;a>S;++S)if(i[S]>255){var q;ih(t,h,E[257+(q=i[S]>>>18&31)]),h+=R[q+257],q>7&&(rh(t,h,i[S]>>>23&31),h+=ju[q]);var Z=31&i[S];ih(t,h,N[Z]),h+=M[Z],Z>3&&(ih(t,h,i[S]>>>5&8191),h+=$u[Z])}else ih(t,h,E[i[S]]),h+=R[i[S]];return ih(t,h,E[256]),h+R[256]},hh=new Bu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ch=function(){for(var e=new Bu(256),t=0;256>t;++t){for(var r=t,i=9;--i;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),dh=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function vh(e,t){void 0===t&&(t={});var r=function(){var e=4294967295;return{p(t){for(var r=e,i=0;t.length>i;++i)r=ch[255&r^t[i]]^r>>>8;e=r},d(){return 4294967295^e}}}(),i=e.length;r.p(e);var n,s,o,a,l=(n=e,s=t,o=function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),a=8,function(e,t,r,i,n,s){var o=e.length,a=new Lu(i+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(i,a.length-n),u=0;if(!t||8>o)for(var h=0;o>=h;h+=65535){var c=h+65535;o>c?u=lh(l,u,e.subarray(h,c)):(l[h]=!0,u=lh(l,u,e.subarray(h,o)))}else{for(var d=hh[t-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new Du(32768),m=new Du(p+1),y=Math.ceil(r/3),b=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&p},_=new Bu(25e3),I=new Du(288),C=new Du(32),S=0,x=0,k=(h=0,0),T=0,A=0;o>h;++h){var E=w(h),R=32767&h,N=m[E];if(g[R]=N,m[E]=R,h>=T){var M=o-h;if((S>7e3||k>24576)&&M>423){u=uh(e,l,0,_,I,C,x,k,A,h-A,u),k=S=x=0,A=h;for(var F=0;286>F;++F)I[F]=0;for(F=0;30>F;++F)C[F]=0}var O=2,P=0,L=f,D=R-N&32767;if(M>2&&E==w(h-D))for(var B=Math.min(v,M)-1,j=Math.min(32767,h),q=Math.min(258,M);j>=D&&--L&&R!=N;){if(e[h+O]==e[h+O-D]){for(var Z=0;q>Z&&e[h+Z]==e[h+Z-D];++Z);if(Z>O){if(O=Z,P=D,Z>B)break;var H=Math.min(D,Z-2),V=0;for(F=0;H>F;++F){var z=h-D+F+32768&32767,U=z-g[z]+32768&32767;U>V&&(V=U,N=z)}}}D+=(R=N)-(N=g[R])+32768&32767}if(P){_[k++]=268435456|Vu[O]<<18|zu[P];var Y=31&Vu[O],G=31&zu[P];x+=ju[Y]+$u[G],++I[257+Y],++C[G],T=h+O,++S}else _[k++]=e[h],++I[e[h]]}}u=uh(e,l,!0,_,I,C,x,k,A,h-A,u)}return th(a,0,i+eh(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a)),u=l.length;return function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&dh(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var i=0;r.length>=i;++i)e[i+10]=r.charCodeAt(i)}}(l,t),dh(l,u-8,r.d()),dh(l,u-4,i),l}var fh=!!ts||!!es,ph="text/plain",gh=!1,mh=function(e,t,i){var n;void 0===i&&(i=!0);var[s,o]=e.split("?"),a=r({},t),l=null!==(n=null==o?void 0:o.split("&").map((e=>{var t,[r,n]=e.split("="),s=i&&null!==(t=a[r])&&void 0!==t?t:n;return delete a[r],r+"="+s})))&&void 0!==n?n:[],u=Ss(a);return u&&l.push(u),s+"?"+l.join("&")},yh=(e,t)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t),bh=e=>{if(e.tr)return e.tr;var{data:t,compression:r}=e;if(t){if(r===Ou){var i=vh(function(e,t){var r=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Lu(e.length+(e.length>>>1)),n=0,s=function(e){i[n++]=e},o=0;r>o;++o){if(n+5>i.length){var a=new Lu(n+8+(r-o<<1));a.set(i),i=a}var l=e.charCodeAt(o);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return th(i,0,n)}(yh(t)),{mtime:0});return{contentType:ph,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===Pu){var n=function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))):e}(yh(t)),s=(e=>"data="+encodeURIComponent("string"==typeof e?e:yh(e)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=yh(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},wh=function(){var e=t((function*(e){var t=yh(e.data),i=yield function(e,t,r){return Fr.apply(this,arguments)}(t,ls.DEBUG,{rethrow:!0});if(!i)return e;var n=yield i.arrayBuffer();return r({},e,{tr:{contentType:ph,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),_h=(e,t)=>mh(e,{_:(new Date).getTime().toString(),ver:ls.JS_SDK_VERSION,compression:t}),Ih=[];es&&Ih.push({transport:"fetch",method(e){var t,i,{contentType:n,body:s,estimatedSize:o}=null!==(t=bh(e))&&void 0!==t?t:{},a=new Headers;vs(e.headers,(function(e,t){a.append(t,e)})),n&&a.append("Content-Type",n);var l=e.url,u=null;if(rs){var h=new rs;u={signal:h.signal,timeout:setTimeout((()=>h.abort()),e.timeout)}}es(l,r({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&52428.8>(o||0),body:s,signal:null==(i=u)?void 0:i.signal},e.fetchOptions)).then((t=>t.text().then((r=>{var i={statusCode:t.status,text:r};if(200===t.status)try{i.json=JSON.parse(r)}catch(e){hs.error(e)}null==e.callback||e.callback(i)})))).catch((t=>{hs.error(t),null==e.callback||e.callback({statusCode:0,error:t})})).finally((()=>u?clearTimeout(u.timeout):null))}}),ts&&Ih.push({transport:"XHR",method(e){var t,r=new ts;r.open(e.method||"GET",e.url,!0);var{contentType:i,body:n}=null!==(t=bh(e))&&void 0!==t?t:{};vs(e.headers,(function(e,t){r.setRequestHeader(t,e)})),i&&r.setRequestHeader("Content-Type",i),e.timeout&&(r.timeout=e.timeout),e.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var t={statusCode:r.status,text:r.responseText};if(200===r.status)try{t.json=JSON.parse(r.responseText)}catch(e){}null==e.callback||e.callback(t)}},r.send(n)}}),null!=Jn&&Jn.sendBeacon&&Ih.push({transport:"sendBeacon",method(e){var t=mh(e.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=bh(e))&&void 0!==r?r:{};if(!n)return;var s=n instanceof Blob?n:new Blob([n],{type:i});Jn.sendBeacon(t,s)}catch(e){}}});var Ch=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}};function Sh(e,t,r){return yh({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var xh={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>Ch(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!Ch(t,e))))),icontains:(e,t)=>t.map(kh).some((t=>e.map(kh).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(kh).every((t=>e.map(kh).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var r=parseFloat(t);return!isNaN(r)&&e.some((e=>r<parseFloat(e)))}))},kh=e=>e.toLowerCase();function Th(e,t){return!e||Object.entries(e).every((e=>{var[r,i]=e,n=null==t?void 0:t[r];if(Gr(n)||Jr(n))return!1;var s=[String(n)],o=xh[i.operator];return!!o&&o(i.values,s)}))}var Ah="",Eh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Rh={R:()=>!!Kn,B(e){hs.error("cookieStore error: "+e)},O(e){if(Kn){try{for(var t=e+"=",r=Kn.cookie.split(";").filter((e=>e.length)),i=0;r.length>i;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return decodeURIComponent(n.substring(t.length,n.length))}}catch(e){}return null}},Z(e){var t;try{t=JSON.parse(Rh.O(e))||{}}catch(e){}return t},M(e,t,r,i,n){if(Kn)try{var s="",o="",a=function(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=Kn),Ah)return Ah;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),i=Math.min(r.length,8),n="dmn_chk_"+Mu();!Ah&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(n)&&(t.cookie=o+";max-age=0",Ah=s)}return Ah}(e);if(!r){var i=(e=>{var t=e.match(Eh);return t?t[0]:""})(e);i!==r&&hs.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(Kn.location.hostname,i);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&hs.warn("cookieStore warning: large cookie, len="+u.length),Kn.cookie=u,u}catch(e){return}},F(e,t){if(null!=Kn&&Kn.cookie)try{Rh.M(e,"",-1,t)}catch(e){return}}},Nh=null,Mh={R(){if(!Jr(Nh))return Nh;var e=!0;if(Gr(Wn))e=!1;else try{var t="__mplssupport__";Mh.M(t,"xyz"),'"xyz"'!==Mh.O(t)&&(e=!1),Mh.F(t)}catch(t){e=!1}return e||hs.error("localStorage unsupported; falling back to cookie store"),Nh=e,e},B(e){hs.error("localStorage error: "+e)},O(e){try{return null==Wn?void 0:Wn.localStorage.getItem(e)}catch(e){Mh.B(e)}return null},Z(e){try{return JSON.parse(Mh.O(e))||{}}catch(e){}return null},M(e,t){try{null==Wn||Wn.localStorage.setItem(e,JSON.stringify(t))}catch(e){Mh.B(e)}},F(e){try{null==Wn||Wn.localStorage.removeItem(e)}catch(e){Mh.B(e)}}},Fh=[Ns,"distinct_id",Gs,Ws,wo,bo,fo],Oh={},Ph={R:()=>!0,B(e){hs.error("memoryStorage error: "+e)},O:e=>Oh[e]||null,Z:e=>Oh[e]||null,M(e,t){Oh[e]=t},F(e){delete Oh[e]}},Lh=null,Dh={R(){if(!Jr(Lh))return Lh;if(Lh=!0,Gr(Wn))Lh=!1;else try{var e="__support__";Dh.M(e,"xyz"),'"xyz"'!==Dh.O(e)&&(Lh=!1),Dh.F(e)}catch(e){Lh=!1}return Lh},B(e){hs.error("sessionStorage error: ",e)},O(e){try{return null==Wn?void 0:Wn.sessionStorage.getItem(e)}catch(e){Dh.B(e)}return null},Z(e){try{return JSON.parse(Dh.O(e))||null}catch(e){}return null},M(e,t){try{null==Wn||Wn.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Dh.B(e)}},F(e){try{null==Wn||Wn.sessionStorage.removeItem(e)}catch(e){Dh.B(e)}}},Bh=cs("[Stylesheet Loader]"),jh=Wn,$h=Kn,qh="#020617",Zh={fontFamily:"inherit",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:Xl.Right,widgetType:Wl.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:qh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Hh=[Xl.Center,Xl.Left,Xl.Right];function Vh(e){if(e.startsWith("#")){var t=e.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(t)&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),/^[0-9A-Fa-f]{6}$/.test(t)?"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function zh(e){var t;void 0===e&&(e=Zh.backgroundColor),"#"===e[0]&&(t=Vh(e)),e.startsWith("rgb")&&(t=e);var r={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()];if(r&&(t=Vh(r)),!t)return qh;var i=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?qh:"white"}return qh}var Uh=(e,t,i)=>{var n=hc(e),s=$h.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=$h.createElement("div");((e,t,i)=>{var n=r({},Zh,i),s=e.style,o=!Hh.includes(n.position)||t===Kl.Widget&&(null==i?void 0:i.widgetType)===Wl.Tab;s.setProperty("--ph-survey-font-family",function(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?e+", "+t:"-apple-system, "+t}(n.fontFamily)),s.setProperty("--ph-survey-box-padding",n.boxPadding),s.setProperty("--ph-survey-max-width",n.maxWidth),s.setProperty("--ph-survey-z-index",n.zIndex),s.setProperty("--ph-survey-border-color",n.borderColor),o?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||zh(n.submitButtonColor)),s.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),s.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),s.setProperty("--ph-survey-rating-active-text-color",zh(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||zh(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",zh(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),l=a||n.inputBackground;a||"white"!==n.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==i?void 0:i.inputTextColor)||zh(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(o,e.type,e.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=function(e){var t=((e,t,r)=>{var i,n=e.createElement("style");return n.innerText=':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(Bh.error("prepare_external_dependency_stylesheet returned null"),null)})($h,0,e);return null==t||t.setAttribute("data-ph-survey-style","true"),t}(t);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return $h.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},Yh=e=>{var{responses:t,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a,surveyLanguage:l}=e;s?(Su(i),s.capture(ru.SENT,r({[iu.SURVEY_NAME]:i.name,[iu.SURVEY_ID]:i.id,[iu.SURVEY_ITERATION]:i.current_iteration,[iu.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[iu.SURVEY_SUBMISSION_ID]:n,[iu.SURVEY_COMPLETED]:o},l&&{[iu.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},au(t,i),a,{$set:{[lu(i,"responded")]:!0}})),o&&(jh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),uc(i))):gu.error("[survey sent] event not captured, PostHog instance not found.")},Gh=(e,t,i)=>{return r({[iu.SURVEY_NAME]:e.name,[iu.SURVEY_ID]:e.id,[iu.SURVEY_ITERATION]:e.current_iteration,[iu.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date,[iu.SURVEY_PARTIALLY_COMPLETED]:(n=null==t?void 0:t.responses,void 0===n&&(n={}),Object.values(n).some((e=>!Kr(e))))},(null==t?void 0:t.surveyLanguage)&&{[iu.SURVEY_LANGUAGE]:t.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[iu.SURVEY_SUBMISSION_ID]:null==t?void 0:t.surveySubmissionId},au(null==t?void 0:t.responses,e));var n},Wh=(e,t,i,n)=>{if(t){if(!i){var s=ac(e);t.capture(ru.DISMISSED,r({},Gh(e,s,t),n&&{[iu.SURVEY_LANGUAGE]:n},{$set:{[lu(e,"dismissed")]:!0}})),uc(e),Su(e),jh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:e.id}}))}}else gu.error("[survey dismissed] event not captured, PostHog instance not found.")},Xh=(e,t)=>{if(t){var r=(e=>Iu("abandonedSurvey_",e))(e);try{if("true"===localStorage.getItem(r))return}catch(e){return}var i=ac(e);if(i){try{localStorage.setItem(r,"true")}catch(e){}t.capture(ru.ABANDONED,Gh(e,i,t),{transport:"sendBeacon"})}}else gu.error("[survey abandoned] event not captured, PostHog instance not found.")},Jh=e=>e.map((e=>({sort:Math.floor(10*Math.random()),value:e}))).sort(((e,t)=>e.sort-t.sort)).map((e=>e.value)),Kh=(e,t)=>e.length===t.length&&e.every(((e,r)=>e===t[r]))?t.reverse():t,Qh=e=>e.appearance&&e.appearance.shuffleQuestions&&!e.enable_partial_responses?Kh(e.questions,Jh(e.questions)):e.questions,ec=e=>{var t;return!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation||!(e=>{var t,r;return null!=(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(e))||e.schedule===tu||lc(e)},tc=function(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,ol(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Ya++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),rc=()=>jl(tc),ic=e=>{var{component:t,children:r,renderAsHtml:i,style:n}=e;return function(e,t,r){var i,n,s,o,a=Ka({},e.props);for(s in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?n=t[s]:a[s]=void 0===t[s]&&null!=o?o[s]:t[s];return arguments.length>2&&(a.children=arguments.length>3?La.call(arguments,2):r),tl(e.type,a,i||e.key,n||e.ref,null)}(t,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function nc(e){var t,r,i;if(null==(t=e.conditions)||!t.url)return!0;var n=null==jh||null==(r=jh.location)?void 0:r.href;if(!n)return!1;var s=[e.conditions.url],o=function(e){return null!=e?e:"icontains"}(null==(i=e.conditions)?void 0:i.urlMatchType);return xh[o](s,[n])}var sc=e=>{var t=""+_u+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+_u+e.id+"_"+e.current_iteration),t},oc=(e,t)=>{try{localStorage.setItem(sc(e),JSON.stringify(t))}catch(e){gu.error("Error setting in-progress survey state in localStorage",e)}},ac=e=>{try{var t=localStorage.getItem(sc(e));if(t)return JSON.parse(t)}catch(e){gu.error("Error getting in-progress survey state from localStorage",e)}return null},lc=e=>{var t=ac(e);return!Kr(null==t?void 0:t.surveySubmissionId)},uc=e=>{try{localStorage.removeItem(sc(e))}catch(e){gu.error("Error clearing in-progress survey state from localStorage",e)}};function hc(e,t){void 0===t&&(t=!1);var r="PostHogSurvey-"+e.id;return t?"."+r:r}function cc(e,t,r){if(void 0===t&&(t=Xl.Right),e===Kl.ExternalSurvey)return{};switch(t){case Xl.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Xl.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Xl.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Xl.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Xl.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Xl.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Xl.Left:return{left:"30px"};case Xl.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:e===Kl.Widget&&r===Wl.Tab?"60px":"30px"}}}var dc=0;function vc(e,t,r,i,n,s){t||(t={});var o,a,l=t;if("ref"in l)for(a in l={},t)"ref"==a?o=t[a]:l[a]=t[a];var u={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--dc,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof e&&(o=e.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return Da.vnode&&Da.vnode(u),u}var fc=vc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vc("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"})}),pc=vc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vc("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"})}),gc=vc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vc("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"})}),mc=vc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vc("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"})}),yc=vc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:vc("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"})}),bc=vc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:vc("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),wc=vc("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:vc("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),_c=function(e){var{fill:t="currentColor"}=void 0===e?{}:e;return vc("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[vc("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),vc("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:t})]})},Ic=vc("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[vc("g",{"clip-path":"url(#clip0_2415_6911)",children:[vc("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:vc("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),vc("g",{mask:"url(#mask0_2415_6911)",children:[vc("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"}),vc("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"}),vc("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"}),vc("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"}),vc("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"}),vc("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"})]})]}),vc("defs",{children:vc("clipPath",{id:"clip0_2415_6911",children:vc("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Cc(e){var{urlParams:t}=e,r=t?Object.entries(t).map((e=>{var[t,r]=e;return encodeURIComponent(t)+"="+encodeURIComponent(r)})).join("&"):"";return vc("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Ic]})}function Sc(e){var{text:t,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=e,{isPreviewMode:l}=jl(tc);return vc("div",{className:"bottom-section",children:[!a&&vc("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==Wn||Wn.open(s)),l?null==o||o():n()},children:t}),!i.whiteLabel&&vc(Cc,{urlParams:{utm_source:"survey-footer"}})]})}function xc(e){var{question:t,forceDisableHtml:r,htmlFor:i}=e;return vc("div",{class:"question-header",children:[vc(t.type===Ql.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:t.question}),t.description&&ic({component:el("p",{className:"survey-question-description"}),children:t.description,renderAsHtml:!r&&"text"!==t.descriptionContentType})]})}function kc(e){var{onClick:t}=e,{isPreviewMode:r}=jl(tc);return vc("button",{className:"form-cancel",onClick:t,disabled:r,"aria-label":"Close survey",type:"button",children:_c({fill:"black"})})}vc("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:vc("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"})});var Tc=Wn;function Ac(e){var{header:t,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=e,{isPopup:a}=jl(tc);return Ll((()=>{var e=e=>{"Enter"!==e.key&&"Escape"!==e.key||(e.preventDefault(),o())};return _s(Tc,"keydown",e),()=>{Tc.removeEventListener("keydown",e)}}),[o]),vc("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&vc(kc,{onClick:()=>o()}),vc("h3",{className:"thank-you-message-header",children:t}),r&&ic({component:el("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&vc(Sc,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Ec=e=>Vr(e)&&e.every((e=>Wr(e)));function Rc(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=e,{isPreviewMode:l}=rc(),u=Dl(null),[h,c]=Pl((()=>Wr(a)?a:""));Ll((()=>{setTimeout((()=>{var e;l||null==(e=u.current)||e.focus()}),100)}),[l]);var d="surveyQuestion"+o,v=Bl((()=>function(e,t,r){var i,n,s=e.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(t&&t.length>0)for(var o of t)switch(o.type){case Lr.MinLength:if(void 0!==o.value&&o.value>s.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case Lr.MaxLength:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(h,t.validation,t.optional)),[h,t.validation,t.optional]),f=gn(t.validation,Lr.MinLength),p=gn(t.validation,Lr.MaxLength),g=Bl((()=>function(e,t){var r=1===e?void 0:e;return r&&t?"Enter "+r+"-"+t+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):t?"Maximum "+t+" "+(1===t?"character":"characters"):void 0}(f,p)),[f,p]);return vc(rl,{children:[vc("div",{className:"question-container",children:[vc(xc,{question:t,forceDisableHtml:r,htmlFor:d}),vc("textarea",{ref:u,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:f,maxLength:p,onInput(e){c(e.currentTarget.value),e.stopPropagation()},onKeyDown(e){e.stopPropagation()},value:h}),g&&vc("div",{className:"validation-hint",children:g})]}),vc(Sc,{text:t.buttonText||"Submit",submitDisabled:!!v,appearance:i,onSubmit(){v||n(h.trim())},onPreviewSubmit(){v||s(h.trim())}})]})}function Nc(e){var{question:t,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=e;return vc(rl,{children:[vc("div",{className:"question-container",children:vc(xc,{question:t,forceDisableHtml:r})}),vc(Sc,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function Mc(e){var t,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u=r.scale,h=10===r.scale?0:1,[c,d]=Pl((()=>Qr(l)?l:Vr(l)&&l.length>0&&Qr(parseInt(l[0]))?parseInt(l[0]):Wr(l)&&Qr(parseInt(l))?parseInt(l):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=rc(),p=e=>f?a(e):o(e);return vc(rl,{children:[vc("div",{className:"question-container",children:[vc(xc,{question:r,forceDisableHtml:i}),vc("div",{className:"rating-section",children:[vc("div",{className:"rating-options",children:["emoji"===r.display&&vc("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(t=Bc[r.scale])?void 0:t.map(((e,t)=>vc("button",{"aria-label":"Rate "+(t+1),className:"ratings-emoji question-"+n+"-rating-"+t+" "+(t+1===c?"rating-active":""),value:t+1,type:"button",onClick(){var e=t+1;d(e),r.skipSubmitButton&&p(e)},children:e},t)))}),"number"===r.display&&vc("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(u-h+1)+", minmax(0, 1fr))"},children:jc(r.scale).map(((e,t)=>vc(Fc,{displayQuestionIndex:n,active:c===e,appearance:s,num:e,setActiveNumber(e){d(e),r.skipSubmitButton&&p(e)}},t)))})]}),!v&&vc("div",{className:"rating-text",children:[vc("div",{children:r.lowerBoundLabel}),vc("div",{children:r.upperBoundLabel})]})]})]}),vc(Sc,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Jr(c)&&!r.optional,appearance:s,onSubmit:()=>o(c),onPreviewSubmit:()=>a(c),skipSubmitButton:r.skipSubmitButton})]})}function Fc(e){var{num:t,active:r,displayQuestionIndex:i,setActiveNumber:n}=e;return vc("button",{"aria-label":"Rate "+t,className:"ratings-number question-"+i+"-rating-"+t+" "+(r?"rating-active":""),type:"button",onClick(){n(t)},children:t})}function Oc(e){var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u=Dl(null),h=Bl((()=>(e=>{if(!e.shuffleOptions)return e.choices;var t=e.choices,r="";e.hasOpenChoice&&(r=t.pop());var i=Kh(t,Jh(t));return e.hasOpenChoice&&(e.choices.push(r),i.push(r)),i})(t)),[t]),[c,d]=Pl((()=>((e,t)=>Wr(e)||Ec(e)?e:t===Ql.SingleChoice?null:[])(l,t.type))),[v,f]=Pl((()=>((e,t)=>{if(Wr(e)&&!t.includes(e))return{isSelected:!0,inputValue:e};if(Ec(e)){var r=e.find((e=>!t.includes(e)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(l,h))),{isPreviewMode:p}=rc(),g=t.type===Ql.SingleChoice,m=t.type===Ql.MultipleChoice,y=t.skipSubmitButton&&g&&!t.hasOpenChoice,b=(e,t)=>{if(t){var i=!v.isSelected;return f((e=>r({},e,{isSelected:i,inputValue:i?e.inputValue:""}))),g&&d(""),void(i&&setTimeout((()=>{var e;return null==(e=u.current)?void 0:e.focus()}),75))}if(g)return d(e),f((e=>r({},e,{isSelected:!1,inputValue:""}))),void(y&&(o(e),p&&a(e)));m&&Vr(c)&&(c.includes(e)?d(c.filter((t=>t!==e))):d([...c,e]))},w=e=>{e.stopPropagation();var t=e.currentTarget.value;f((e=>r({},e,{inputValue:t}))),g&&d(t)},_=e=>{e.stopPropagation(),"Enter"!==e.key||I()||(e.preventDefault(),C()),"Escape"===e.key&&(e.preventDefault(),f((e=>r({},e,{isSelected:!1,inputValue:""}))),g&&d(null))},I=()=>!(t.optional||!Jr(c)&&(!Vr(c)||v.isSelected||0!==c.length)&&(!v.isSelected||""!==v.inputValue.trim())),C=()=>{v.isSelected&&m?Vr(c)&&(p?a([...c,v.inputValue]):o([...c,v.inputValue])):p?a(c):o(c)};return vc(rl,{children:[vc("div",{className:"question-container",children:[vc(xc,{question:t,forceDisableHtml:i}),vc("fieldset",{className:"multiple-choice-options limit-height",children:[vc("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((e,r)=>{var i=!!t.hasOpenChoice&&r===t.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?v.isSelected:g?c===e:Vr(c)&&c.includes(e);return vc("label",{className:i?"choice-option-open":"",children:[vc("div",{className:"response-choice",children:[vc("input",{type:g?"radio":"checkbox",name:s,checked:a,onChange:()=>b(e,i),id:s,"aria-controls":o}),vc("span",{children:i?e+":":e})]}),i&&vc("input",{type:"text",ref:u,id:o,name:"question"+n+"Open",value:v.inputValue,onKeyDown:_,onInput:w,onClick(t){v.isSelected||b(e,!0),t.stopPropagation()},"aria-label":e+" - please specify"})]},r)}))]})]}),vc(Sc,{text:t.buttonText||"Submit",submitDisabled:I(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:y})]})}var Pc=[1,2,3,4,5],Lc=[1,2,3,4,5,6,7],Dc=[0,1,2,3,4,5,6,7,8,9,10],Bc={2:[bc,wc],3:[gc,pc,fc],5:[mc,gc,pc,fc,yc]};function jc(e){switch(e){case 5:default:return Pc;case 7:return Lc;case 10:return Dc}}var $c=cs("[Surveys]");function qc(e,t,r){var i,n=e.questions[t],s=t+1;if(null==(i=n.branching)||!i.type)return t===e.questions.length-1?eu.End:s;if(n.branching.type===eu.End)return eu.End;if(n.branching.type===eu.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===eu.ResponseBased){if(n.type===Ql.SingleChoice){var o,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var l=n.branching.responseValues[a];return Number.isInteger(l)?l:l===eu.End?eu.End:s}}else if(n.type===Ql.Rating){var u;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(e,t){if(2===t){if(1>e||e>2)throw new Error("The response must be in range 1-2");return 1===e?"positive":"negative"}if(3===t){if(1>e||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(1>e||e>5)throw new Error("The response must be in range 1-5");return e>2?3===e?"neutral":"positive":"negative"}if(7===t){if(1>e||e>7)throw new Error("The response must be in range 1-7");return e>3?4===e?"neutral":"positive":"negative"}if(10===t){if(0>e||e>10)throw new Error("The response must be in range 0-10");return e>6?e>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===eu.End?eu.End:s}}return s}return $c.warn("Falling back to next question index due to unexpected branching type"),s}var Zc="https?://(.*)",Hc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Vc=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Hc],zc="<masked>",Uc=["li_fat_id"];function Yc(e,t,r){if(!Kn)return{};var i,n=t?[...Hc,...r||[]]:[],s=Gc(ks(Kn.URL,n,zc),e),o=(i={},vs(Uc,(function(e){var t=Rh.O(e);i[e]=t||null})),i);return fs(o,s)}function Gc(e,t){var r=Vc.concat(t||[]),i={};return vs(r,(function(t){var r=xs(e,t);i[t]=r||null})),i}function Wc(e){var t=function(e){return e?0===e.search(Zc+"google.([^/?]*)")?"google":0===e.search(Zc+"bing.com")?"bing":0===e.search(Zc+"yahoo.com")?"yahoo":0===e.search(Zc+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",i={};if(!Jr(t)){i.$search_engine=t;var n=Kn?xs(Kn.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function Xc(){return navigator.language||navigator.userLanguage}var Jc="$direct";function Kc(){return(null==Kn?void 0:Kn.referrer)||Jc}function Qc(e,t){var r=e?[...Hc,...t||[]]:[],i=null==Qn?void 0:Qn.href.substring(0,1e3);return{r:Kc().substring(0,1e3),u:i?ks(i,r,zc):void 0}}function ed(e){var t,{r:r,u:i}=e,n={$referrer:r,$referring_domain:null==r?void 0:r==Jc?Jc:null==(t=Cs(r))?void 0:t.host};if(i){n.$current_url=i;var s=Cs(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=Gc(i);fs(n,o)}if(r){var a=Wc(r);fs(n,a)}return n}function td(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function rd(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var id=cs("[SurveyTranslations]");function nd(e,t){var r=function(e){return function(e){var{overrideLanguage:t,storedPersonProperties:r,locale:i}=e,n=du(t);if(n)return cu.info("Using override display language: "+n),n;var s=function(e){return e&&"object"==typeof e&&"language"in e?du(e.language):null}(r);if(s)return cu.info("Using person property language: "+s),s;var o=du(i);return o?(cu.info("Using detected locale: "+o),o):(cu.info("No user language detected"),null)}({overrideLanguage:e.config.override_display_language,storedPersonProperties:zr(e.get_property)?e.get_property(no):void 0,locale:Xc()})}(t);if(!r)return id.info("No user language detected"),{survey:e,language:null};var i=pu(e,r);return{survey:i.survey,language:i.matchedKey}}var sd=Wn,od=Kn,ad="ph:show_survey_widget",ld="PHWidgetSurveyClickListener";function ud(e,t){try{var r=e.getBoundingClientRect(),i=sd.innerHeight,n=sd.innerWidth,s=r.left+r.width/2-t/2;s+t>n-20&&(s=n-t-20),20>s&&(s=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:Zh.zIndex}}catch(e){return gu.warn("Failed to calculate trigger position:",e),null}}class hd{constructor(e){var t=this;this.D=new Map,this.q=new Map,this.V=new Set,this.handlePageUnload=()=>{var e=this._posthog.get_property(oo);if(e)for(var t of e)lc(t)&&Xh(t,this._posthog)},this.handlePopoverSurvey=(e,t)=>{var i,n,s,o,{survey:a,language:l}=this.j(e),u=null!=t&&t.position||null!=t&&t.selector?r({},a,{appearance:r({},a.appearance,t.position&&{position:t.position},t.selector&&{widgetSelector:t.selector})}):a;this.H(u.id);var{properties:h,initialResponses:c}=null!=t?t:{},d=!(!c||0>=Object.keys(c).length)&&this.Y(u,c,h,l);if(!d||null!=(i=u.appearance)&&i.displayThankYouMessage){this.G(u);var v={};if((null==(n=u.appearance)?void 0:n.position)===Xl.NextToTrigger&&null!=(s=u.appearance)&&s.widgetSelector){var f,p=od.querySelector(u.appearance.widgetSelector);p&&(v=ud(p,parseInt((null==(f=u.appearance)?void 0:f.maxWidth)||Zh.maxWidth))||{})}var g=(null==(o=u.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:m}=Uh(u,this._posthog),y={posthog:this._posthog,survey:u,removeSurveyFromFocus:this.W,properties:h,style:v,isSurveyCompleted:d,skipShownEvent:null==t?void 0:t.skipShownEvent,surveyLanguage:l};if(0>=g)return wl(vc(fd,r({},y)),m);var b=setTimeout((()=>{if(this.D.delete(u.id),!nc(u))return this.W(u);wl(vc(fd,r({},y,{survey:r({},u,{appearance:r({},u.appearance,{surveyPopupDelaySeconds:0})})})),m)}),1e3*g);this.D.set(u.id,b)}},this.U=e=>{var{survey:t,language:r}=this.j(e),{shadow:i,isNewlyCreated:n}=Uh(t,this._posthog);n&&wl(vc(gd,{posthog:this._posthog,survey:t,surveyLanguage:r},e.id),i)},this.X=e=>{this.K(e);var t=this.q.get(e.id);t&&(t.element.removeEventListener("click",t.listener),t.element.removeAttribute(ld),this.q.delete(e.id),gu.info("Removed click listener for survey "+e.id))},this.J=(e,t)=>{var r=od.querySelector(t),i=this.q.get(e.id);if(r){if(this.U(e),i){if(r===i.element)return;gu.info("Selector element changed for survey "+e.id+". Re-attaching listener."),this.X(e)}if(!r.hasAttribute(ld)){var n=t=>{var r,i;t.stopPropagation();var n=(null==(r=e.appearance)?void 0:r.position)===Xl.NextToTrigger?ud(t.currentTarget,parseInt((null==(i=e.appearance)?void 0:i.maxWidth)||Zh.maxWidth)):{};sd.dispatchEvent(new CustomEvent(ad,{detail:{surveyId:e.id,position:n}}))};_s(r,"click",n),r.setAttribute(ld,"true"),this.q.set(e.id,{element:r,listener:n,survey:e}),gu.info("Attached click listener for feedback button survey "+e.id)}}else i&&this.X(e)},this.renderPopover=e=>{var{survey:t,language:r}=this.j(e),{shadow:i}=Uh(t,this._posthog);wl(vc(fd,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.W,surveyLanguage:r}),i)},this.renderSurvey=(e,t,r)=>{var i,{survey:n,language:s}=this.j(e),o=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(o=this.$(n,s)),wl(vc(fd,{posthog:this._posthog,survey:n,removeSurveyFromFocus:this.W,isPopup:!1,properties:r,isSurveyCompleted:o,surveyLanguage:s}),t)},this.getActiveMatchingSurveys=function(e,r){var i;void 0===r&&(r=!1),null==(i=t._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((e=>t.checkSurveyEligibility(e).eligible&&t.ee(e)&&t.te(e)&&t.re(e)));e(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getActiveMatchingSurveys((e=>{var r=e.filter((e=>e.type===Kl.Popover||e.type===Kl.Widget)),i=t.ne(r),n=new Set;i.forEach((e=>{if(e.type===Kl.Widget){var r,i,s,o;if((null==(r=e.appearance)?void 0:r.widgetType)===Wl.Tab)return void t.U(e);(null==(i=e.appearance)?void 0:i.widgetType)===Wl.Selector&&null!=(s=e.appearance)&&s.widgetSelector&&(n.add(e.id),t.J(e,null==(o=e.appearance)?void 0:o.widgetSelector))}Jr(t.ie)&&e.type===Kl.Popover&&t.handlePopoverSurvey(e)})),t.q.forEach((e=>{var{survey:r}=e;n.has(r.id)||t.X(r)}))}),e)},this.G=e=>{Jr(this.ie)||gu.error("Survey "+this.ie+" already in focus. Cannot add survey "+e.id+"."),this.ie=e.id},this.W=e=>{this.ie!==e.id&&gu.error("Survey "+e.id+" is not in focus. Cannot remove survey "+e.id+"."),this.H(e.id),this.ie=null,this.K(e)},this._posthog=e,this.ie=null}H(e){var t=this.D.get(e);t&&(clearTimeout(t),this.D.delete(e))}cancelSurvey(e){this.D.has(e)&&(gu.info("Cancelled pending survey "+e),this.H(e),this.ie===e&&(this.ie=null))}ne(e){return e.sort(((e,t)=>{var r,i,n=lc(e),s=lc(t);if(n&&!s)return-1;if(!n&&s)return 1;var o=e.schedule===tu,a=t.schedule===tu;return o&&!a?1:!o&&a?-1:((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}j(e){return nd(e,this._posthog)}$(e,t){if(this.V.has(e.id))return!1;var{params:r}=function(e){var t={},r=!1,i=e.replace(/^\?/,"");if(!i)return{params:t,autoSubmit:r};var n=i.split("&");for(var s of n){var[o,a]=s.split("=");if(o&&!Gr(a)){var l=decodeURIComponent(o),u=decodeURIComponent(a);if("auto_submit"!==l||"true"!==u){var h=l.match(/^q(\d+)$/);if(h){var c=parseInt(h[1],10);t[c]||(t[c]=[]),t[c].push(u)}}else r=!0}}return{params:t,autoSubmit:r}}(sd.location.search);if(0===Object.keys(r).length)return!1;gu.info("[Survey Prefill] Detected URL prefill parameters");var i=this.oe(e,r,t);if(!i)return!1;var{responses:n,submissionId:s,isSurveyCompleted:o,skippedResponses:a}=i;return(Object.keys(a).length>0&&e.enable_partial_responses||o)&&Yh({responses:o?n:a,survey:e,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,surveyLanguage:t}),this.V.add(e.id),o}Y(e,t,r,i){var n={};for(var[s,o]of Object.entries(t))n[parseInt(s)]=Vr(o)?o.map(String):[String(o)];gu.info("[Survey] Processing initial responses");var a=this.oe(e,n,i);if(!a)return!1;var{responses:l,submissionId:u,isSurveyCompleted:h}=a;return Yh({responses:l,survey:e,surveySubmissionId:u,posthog:this._posthog,isSurveyCompleted:h,properties:r,surveyLanguage:i}),h}oe(e,t,r){try{var i=function(e,t){var r={};return e.questions.forEach(((e,i)=>{if(t[i]&&e.id){var n=t[i],s=su(e.id);try{switch(e.type){case Ql.SingleChoice:if(!e.choices||0===e.choices.length)return void hs.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=e.choices.length)return void hs.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=e.choices[o];break;case Ql.MultipleChoice:if(!e.choices||0===e.choices.length)return void hs.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((e=>parseInt(e,10))).filter((t=>!isNaN(t)&&t>=0&&e.choices.length>t));if(0===a.length)return void hs.warn("[Survey Prefill] No valid choices for q"+i);var l=[...new Set(a.map((t=>e.choices[t])))];a.length>l.length&&hs.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=l;break;case Ql.Rating:var u=parseInt(n[0],10),h=e.scale||10;if(isNaN(u)||0>u||u>h)return void hs.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=u;break;default:hs.info("[Survey Prefill] Question type "+e.type+" does not support prefill")}}catch(e){hs.error("[Survey Prefill] Error converting q"+i+":",e)}}})),r}(e,t);if(0===Object.keys(i).length)return gu.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Mu(),s=Object.keys(t).map((e=>parseInt(e,10))),{startQuestionIndex:o,skippedResponses:a}=function(e,t,r){for(var i=0,n={},s=e.questions.length+1;e.questions.length>i&&s>0&&t.includes(i);){var o=e.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=su(o.id);Gr(r[a])||(n[a]=r[a])}var l=qc(e,i,o.id?r[su(o.id)]:null);if(l===eu.End)return{startQuestionIndex:e.questions.length,skippedResponses:n};i=l}return{startQuestionIndex:i,skippedResponses:n}}(e,s,i),l=o>=e.questions.length;return oc(e,{surveySubmissionId:n,responses:i,lastQuestionIndex:o,surveyLanguage:r}),gu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:o,isSurveyCompleted:l,skippedResponses:a}}catch(e){return gu.error("[Survey Prefill] Error handling prefill:",e),null}}ae(e,t){var r;if(void 0===t&&(t=void 0),!e)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(e,{send_event:!e.startsWith("survey-targeting-")})),s=!0;return t&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(e,{send_event:!1}))===t||"any"===t),n&&s}ee(e){return!e.conditions||nc(e)&&function(e){var t,r;return function(e,t){var r,i,n;if(!e||0===e.length)return!0;if(!ns)return!1;var s=cn(ns,{userAgentDataPlatform:null==Jn||null==(r=Jn.userAgentData)?void 0:r.platform,maxTouchPoints:null==Jn?void 0:Jn.maxTouchPoints,screenWidth:null==Wn||null==(i=Wn.screen)?void 0:i.width,screenHeight:null==Wn||null==(n=Wn.screen)?void 0:n.height,devicePixelRatio:null==Wn?void 0:Wn.devicePixelRatio});return xh[null!=t?t:"icontains"](e,[s])}(null==(t=e.conditions)?void 0:t.deviceTypes,null==(r=e.conditions)?void 0:r.deviceTypesMatchType)}(e)&&function(e){var t;return null==(t=e.conditions)||!t.selector||!(null==$h||!$h.querySelector(e.conditions.selector))}(e)}se(e){return ec(e)||this.ae(e.internal_targeting_flag_key)||lc(e)}checkSurveyEligibility(e){var t,r,i={eligible:!0,reason:void 0};if(!mu(e))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+e.end_date,i;if(!xu.includes(e.type))return i.eligible=!1,i.reason="Surveys of type "+e.type+" are never eligible to be shown in the app",i;var n=null==(t=e.conditions)?void 0:t.linkedFlagVariant;return this.ae(e.linked_flag_key,n)?this.ae(e.targeting_flag_key)?this.se(e)?function(e,t){if(!e||!t)return!0;var r="string"==typeof t?new Date(t):t,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>e}(null==(r=e.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Mh.O("lastSeenSurveyDate"))?(e=>!!Mh.O(Cu(e))&&!ec(e))(e)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i):(i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i):(i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i)}te(e){var t;if(!yu(e)&&!bu(e))return!0;var r=null==(t=this._posthog.surveys)||null==(t=t._surveyEventReceiver)?void 0:t.getSurveys();return!(null==r||!r.includes(e.id))}re(e){var t;return null==(t=e.feature_flag_keys)||!t.length||e.feature_flag_keys.every((e=>{var{key:t,value:r}=e;return!t||!r||this.ae(r)}))}K(e){try{var t=od.querySelector(hc(e,!0));null!=t&&t.shadowRoot&&wl(null,t.shadowRoot),null==t||t.remove()}catch(t){gu.warn("Failed to remove survey "+e.id+" from DOM:",t)}}getTestAPI(){return{addSurveyToFocus:this.G,removeSurveyFromFocus:this.W,surveyInFocus:this.ie,surveyTimeouts:this.D,handleWidget:this.U,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.J,sortSurveysByAppearanceDelay:this.ne,checkFlags:this.re.bind(this),isSurveyFeatureFlagEnabled:this.ae.bind(this)}}}function cd(e,t){if(od&&sd){var r,i=new hd(e);if(e.config.disable_surveys_automatic_display)return gu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===t)return gu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Gr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),_s(od,"visibilitychange",(()=>{od.hidden?Gr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function dd(e){var{survey:t,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=e;Ll((()=>{var e;if(!n&&null!=(e=t.conditions)&&e.url){var s=()=>{var e,n=t.type===Kl.Widget,s=nc(t),o=(null==(e=t.appearance)?void 0:e.widgetType)===Wl.Tab&&n;if(!s)return gu.info("Hiding survey "+t.id+" because URL does not match"),i(!1),r(t);o&&(gu.info("Showing survey "+t.id+" because it is a feedback button tab and URL matches"),i(!0))};_s(sd,"popstate",s),_s(sd,"hashchange",s);var o=sd.history.pushState,a=sd.history.replaceState;return sd.history.pushState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];o.apply(this,t),s()},sd.history.replaceState=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];a.apply(this,t),s()},()=>{sd.removeEventListener("popstate",s),sd.removeEventListener("hashchange",s),sd.history.pushState=o,sd.history.replaceState=a}}}),[n,t,r,i])}function vd(e){switch(void 0===e&&(e=Jl.Right),e){case Jl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Jl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Jl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function fd(e){var t,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:h,style:c={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{}),properties:y,isSurveyCompleted:b,skipShownEvent:w,surveyLanguage:_}=e,I=Dl(null),C=Number.isInteger(d),S=null!=(t=l.appearance)&&t.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:x,isSurveySent:k,hidePopupWithViewTransition:T}=function(e,t,i,n,s,o,a,l,u){var[h,c]=Pl(n||0===i||e.type===Kl.ExternalSurvey),[d,v]=Pl(!1),f=()=>{var t=()=>{o&&s(e),c(!1)};od.startViewTransition?od.startViewTransition((()=>{var e;null==a||null==(e=a.current)||e.remove()})).finished.then((()=>{setTimeout((()=>{t()}),100)})):t()},p=t=>{t.detail.surveyId===e.id&&f()};return Ll((()=>{if(t){if(!n){var s=t=>{var r,i;if(t.detail.surveyId===e.id){if(null==(r=e.appearance)||!r.displayThankYouMessage)return f();v(!0),null!=(i=e.appearance)&&i.autoDisappear&&setTimeout((()=>{f()}),5e3)}},o=()=>{nc(e)&&(c(!0),sd.dispatchEvent(new Event("PHSurveyShown")),l||t.capture(ru.SHOWN,r({[iu.SURVEY_NAME]:e.name,[iu.SURVEY_ID]:e.id,[iu.SURVEY_ITERATION]:e.current_iteration,[iu.SURVEY_ITERATION_START_DATE]:e.current_iteration_start_date},u&&{[iu.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==t.get_session_replay_url?void 0:t.get_session_replay_url()})),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(_s(sd,"PHSurveyClosed",p),_s(sd,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),sd.removeEventListener("PHSurveyClosed",p),sd.removeEventListener("PHSurveySent",s)}}return o(),()=>{sd.removeEventListener("PHSurveyClosed",p),sd.removeEventListener("PHSurveySent",s)}}}else gu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),dd({survey:e,removeSurveyFromFocus:s,setSurveyVisible:c,isPreviewMode:n}),{isPopupVisible:h,isSurveySent:d,setIsPopupVisible:c,hidePopupWithViewTransition:f}}(l,h,S,C,v,f,I,w,_),A=k||d===l.questions.length||!0===b,E=Bl((()=>{var e=ac(l),t=(null==e?void 0:e.surveySubmissionId)||Mu();return{isPreviewMode:C,previewPageIndex:d,onPopupSurveyDismissed(){_?Wh(l,h,C,_):Wh(l,h,C),g()},isPopup:f||!1,surveySubmissionId:t,onPreviewSubmit:p,posthog:h,properties:y,surveyLanguage:_}}),[C,d,f,h,l,g,p,y,_]);return x?vc(tc.Provider,{value:E,children:vc("div",{className:"ph-survey",style:r({},cc(l.type,null==(i=l.appearance)?void 0:i.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:I,children:A?vc(Ac,{header:(null==(s=l.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=l.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(a=l.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:l.appearance||Zh,onClose(){T(),m()}}):vc(pd,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function pd(e){var t,{survey:i,forceDisableHtml:n,posthog:s}=e,[o,a]=Pl((()=>{var e=ac(i);return null!=e&&e.responses&&gu.info("Survey is already in progress, filling in initial responses"),(null==e?void 0:e.responses)||{}})),{previewPageIndex:l,onPopupSurveyDismissed:u,isPopup:h,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:v,properties:f,surveyLanguage:p}=jl(tc),[g,m]=Pl((()=>{var e=ac(i);return l||(null==e?void 0:e.lastQuestionIndex)||0})),y=Bl((()=>Qh(i)),[i]);Ll((()=>{v&&!Gr(l)&&m(l)}),[l,v]);var b=y.at(g);return b?vc("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(t=i.appearance)?void 0:t.hideCancelButton)&&vc(kc,{onClick(){u()}}),vc("div",{className:"survey-box","data-question-index":g,children:md({question:b,forceDisableHtml:n,displayQuestionIndex:g,appearance:i.appearance||Zh,onSubmit:e=>(e=>{var{res:t,displayQuestionIndex:n,questionId:l}=e;if(s)if(l){var u=su(l),h=r({},o,{[u]:t});a(h);var c=qc(i,n,t),v=c===eu.End;v||(m(c),oc(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c,surveyLanguage:p})),(i.enable_partial_responses||v)&&Yh({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:s,properties:f,surveyLanguage:p})}else gu.error("onNextButtonClick called without a questionId.");else gu.error("onNextButtonClick called without a PostHog instance.")})({res:e,displayQuestionIndex:g,questionId:b.id}),onPreviewSubmit:c,initialValue:b.id?o[su(b.id)]:void 0})})]}):null}function gd(e){var t,r,i,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:h,readOnly:c,surveyLanguage:d}=e,[v,f]=Pl(!0),[p,g]=Pl(!1),[m,y]=Pl({}),b=()=>{g(!p)};if(Ll((()=>{var e;if(h){if(!c){"tab"===(null==(e=l.appearance)?void 0:e.widgetType)&&y({top:"50%",bottom:"auto"});var t=e=>{var t,r=e;(null==(t=r.detail)?void 0:t.surveyId)===l.id&&(gu.info("Received show event for feedback button survey "+l.id),y(r.detail.position||{}),b())};return _s(sd,ad,t),()=>{sd.removeEventListener(ad,t)}}}else gu.error("FeedbackWidget called without a PostHog instance.")}),[h,c,l.id,null==(t=l.appearance)?void 0:t.widgetType,null==(r=l.appearance)?void 0:r.widgetSelector,null==(i=l.appearance)?void 0:i.borderColor]),dd({survey:l,setSurveyVisible:f}),!v)return null;var w=()=>{l.schedule!==tu&&f(!1),setTimeout((()=>{g(!1)}),200)};return vc(rl,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&vc("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Jl.Top?"widget-tab-top":""),onClick:b,disabled:c,style:vd(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),p&&vc(fd,{posthog:h,survey:l,forceDisableHtml:u,style:m,onPopupSurveyDismissed:w,onCloseConfirmationMessage:w,surveyLanguage:d})]})}var md=e=>{var{question:t,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=e,u={forceDisableHtml:i,appearance:s,onPreviewSubmit(e){a(e)},onSubmit(e){o(e)},initialValue:l,displayQuestionIndex:n};switch(t.type){case Ql.Open:return el(Rc,r({},u,{question:t,key:t.id}));case Ql.Link:return el(Nc,r({},u,{question:t,key:t.id}));case Ql.Rating:return el(Mc,r({},u,{question:t,key:t.id}));case Ql.SingleChoice:case Ql.MultipleChoice:return el(Oc,r({},u,{question:t,key:t.id}));default:return gu.error("Unsupported question type: "+t.type),null}};ss.__PosthogExtensions__=ss.__PosthogExtensions__||{},ss.__PosthogExtensions__.generateSurveys=cd,ss.extendPostHogWithSurveys=cd;class yd{emit(e){}}var bd=new yd,wd=new class{getLogger(e,t,r){return new yd}};class _d{constructor(e,t,r,i){this.ue=e,this.name=t,this.version=r,this.options=i}emit(e){this.le().emit(e)}le(){if(this.ce)return this.ce;var e=this.ue.de(this.name,this.version,this.options);return e?(this.ce=e,this.ce):bd}}class Id{getLogger(e,t,r){var i;return null!==(i=this.de(e,t,r))&&void 0!==i?i:new _d(this,e,t,r)}he(){var e;return null!==(e=this.ce)&&void 0!==e?e:wd}ve(e){this.ce=e}de(e,t,r){var i;return null===(i=this.ce)||void 0===i?void 0:i.getLogger(e,t,r)}}var Cd="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Sd=Symbol.for("io.opentelemetry.js.api.logs"),xd=Cd;class kd{constructor(){this.fe=new Id}static getInstance(){return this._instance||(this._instance=new kd),this._instance}setGlobalLoggerProvider(e){return xd[Sd]?this.getLoggerProvider():(xd[Sd]=(1,t=e,r=wd,e=>1===e?t:r),this.fe.ve(e),e);var t,r}getLoggerProvider(){var e,t;return null!==(t=null===(e=xd[Sd])||void 0===e?void 0:e.call(xd,1))&&void 0!==t?t:this.fe}getLogger(e,t,r){return this.getLoggerProvider().getLogger(e,t,r)}disable(){delete xd[Sd],this.fe=new Id}}var Td=kd.getInstance();class Ad{constructor(e){this.ce=void 0,this.ce=e}export(e,t){this.ce.export(e,t)}forceFlush(){return this.ce.forceFlush()}shutdown(){return this.ce.shutdown()}}class Ed extends Error{constructor(e,t,r){super(e),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=r,this.code=t}}function Rd(e){if(Number.isFinite(e)&&e>0)return e;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+e+"')")}class Nd{constructor(e){this.pe=void 0,this.me=[],this.pe=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this.me.push(e);var t=()=>{var t=this.me.indexOf(e);this.me.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this.me.length>=this.pe}awaitAll(){var e=this;return t((function*(){yield Promise.all(e.me)}))()}}function Md(e){return new Nd(e.concurrencyLimit)}var Fd="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Od="1.9.0",Pd=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,Ld=function(e){var t=new Set([e]),r=new Set,i=e.match(Pd);if(!i)return function(){return!1};var n=+i[1],s=+i[2],o=+i[3];if(null!=i[4])return function(t){return t===e};function a(e){return r.add(e),!1}function l(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;var i=e.match(Pd);if(!i)return a(e);var u=+i[2],h=+i[3];return null!=i[4]||n!==+i[1]?a(e):0===n?s!==u||o>h?a(e):l(e):s>u?a(e):l(e)}}(Od),Dd=Od.split(".")[0],Bd=Symbol.for("opentelemetry.js.api."+Dd),jd=Fd;function $d(e,t,r,i){var n;void 0===i&&(i=!1);var s=jd[Bd]=null!==(n=jd[Bd])&&void 0!==n?n:{version:Od};if(!i&&s[e]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(o.stack||o.message),!1}return s.version!==Od?(o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+Od),r.error(o.stack||o.message),!1):(s[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+Od+"."),!0)}function qd(e){var t,r,i=null===(t=jd[Bd])||void 0===t?void 0:t.version;if(i&&Ld(i))return null===(r=jd[Bd])||void 0===r?void 0:r[e]}function Zd(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Od+".");var r=jd[Bd];r&&delete r[e]}var Hd,Vd=function(){function e(e){this.ge=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return zd("debug",this.ge,e)},e.prototype.error=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return zd("error",this.ge,e)},e.prototype.info=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return zd("info",this.ge,e)},e.prototype.warn=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return zd("warn",this.ge,e)},e.prototype.verbose=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return zd("verbose",this.ge,e)},e}();function zd(e,t,r){var i=qd("diag");if(i)return r.unshift(t),i[e].apply(i,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(r),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(Hd||(Hd={}));var Ud=function(){function e(){function e(e){return function(){for(var t=[],r=0;arguments.length>r;r++)t[r]=arguments[r];var i=qd("diag");if(i)return i[e].apply(i,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(t),!1))}}var t=this;t.setLogger=function(e,r){var i,n,s;if(void 0===r&&(r={logLevel:Hd.INFO}),e===t){var o=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(i=o.stack)&&void 0!==i?i:o.message),!1}"number"==typeof r&&(r={logLevel:r});var a=qd("diag"),l=function(e,t){function r(r,i){var n=t[r];return"function"!=typeof n||i>e?function(){}:n.bind(t)}return Hd.NONE>e?e=Hd.NONE:e>Hd.ALL&&(e=Hd.ALL),t=t||{},{error:r("error",Hd.ERROR),warn:r("warn",Hd.WARN),info:r("info",Hd.INFO),debug:r("debug",Hd.DEBUG),verbose:r("verbose",Hd.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:Hd.INFO,e);if(a&&!r.suppressOverrideMessage){var u=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+u),l.warn("Current logger will overwrite one already registered from "+u)}return $d("diag",l,t,!0)},t.disable=function(){Zd("diag",t)},t.createComponentLogger=function(e){return new Vd(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}();function Yd(e){return Symbol.for(e)}var Gd,Wd=new function e(t){var r=this;r.ye=t?new Map(t):new Map,r.getValue=function(e){return r.ye.get(e)},r.setValue=function(t,i){var n=new e(r.ye);return n.ye.set(t,i),n},r.deleteValue=function(t){var i=new e(r.ye);return i.ye.delete(t),i}},Xd=function(){function e(){}return e.prototype.active=function(){return Wd},e.prototype.with=function(e,t,r){for(var i=[],n=3;arguments.length>n;n++)i[n-3]=arguments[n];return t.call.apply(t,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([r],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(i),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),Jd="context",Kd=new Xd,Qd=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return $d(Jd,e,Ud.instance())},e.prototype.active=function(){return this.be().active()},e.prototype.with=function(e,t,r){for(var i,n=[],s=3;arguments.length>s;s++)n[s-3]=arguments[s];return(i=this.be()).with.apply(i,function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;s>n;n++)!i&&n in t||(i||(i=[].slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||[].slice.call(t))}([e,t,r],function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(n),!1))},e.prototype.bind=function(e,t){return this.be().bind(e,t)},e.prototype.be=function(){return qd(Jd)||Kd},e.prototype.disable=function(){this.be().disable(),Zd(Jd,Ud.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(Gd||(Gd={}));var ev="0000000000000000",tv="00000000000000000000000000000000",rv={traceId:tv,spanId:ev,traceFlags:Gd.NONE},iv=function(){function e(e){void 0===e&&(e=rv),this.we=e}return e.prototype.spanContext=function(){return this.we},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),nv=Yd("OpenTelemetry Context Key SPAN");function sv(e){return e.getValue(nv)||void 0}function ov(){return sv(Qd.getInstance().active())}function av(e,t){return e.setValue(nv,t)}function lv(e){return e.deleteValue(nv)}function uv(e,t){return av(e,new iv(t))}function hv(e){var t;return null===(t=sv(e))||void 0===t?void 0:t.spanContext()}var cv=/^([0-9a-f]{32})$/i,dv=/^[0-9a-f]{16}$/i;function vv(e){return cv.test(r=e.traceId)&&r!==tv&&dv.test(t=e.spanId)&&t!==ev;var t,r}function fv(e){return new iv(e)}var pv=Qd.getInstance(),gv=function(){function e(){}return e.prototype.startSpan=function(e,t,r){if(void 0===r&&(r=pv.active()),Boolean(null==t?void 0:t.root))return new iv;var i,n=r&&hv(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&vv(n)?new iv(n):new iv},e.prototype.startActiveSpan=function(e,t,r,i){var n,s,o;if(arguments.length>=2){2===arguments.length?o=t:3===arguments.length?(n=t,o=r):(n=t,s=r,o=i);var a=null!=s?s:pv.active(),l=this.startSpan(e,n,a),u=av(a,l);return pv.with(u,o,void 0,l)}},e}(),mv=new gv,yv=function(){function e(e,t,r,i){this.ue=e,this.name=t,this.version=r,this.options=i}return e.prototype.startSpan=function(e,t,r){return this.Ce().startSpan(e,t,r)},e.prototype.startActiveSpan=function(e,t,r,i){var n=this.Ce();return Reflect.apply(n.startActiveSpan,n,arguments)},e.prototype.Ce=function(){if(this.ce)return this.ce;var e=this.ue.getDelegateTracer(this.name,this.version,this.options);return e?(this.ce=e,this.ce):mv},e}(),bv=new(function(){function e(){}return e.prototype.getTracer=function(e,t,r){return new gv},e}()),wv=function(){function e(){}return e.prototype.getTracer=function(e,t,r){var i;return null!==(i=this.getDelegateTracer(e,t,r))&&void 0!==i?i:new yv(this,e,t,r)},e.prototype.getDelegate=function(){var e;return null!==(e=this.ce)&&void 0!==e?e:bv},e.prototype.setDelegate=function(e){this.ce=e},e.prototype.getDelegateTracer=function(e,t,r){var i;return null===(i=this.ce)||void 0===i?void 0:i.getTracer(e,t,r)},e}(),_v=Qd.getInstance(),Iv=Ud.instance(),Cv="trace",Sv=function(){function e(){this.Ie=new wv,this.wrapSpanContext=fv,this.isSpanContextValid=vv,this.deleteSpan=lv,this.getSpan=sv,this.getActiveSpan=ov,this.getSpanContext=hv,this.setSpan=av,this.setSpanContext=uv}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=$d(Cv,this.Ie,Ud.instance());return t&&this.Ie.setDelegate(e),t},e.prototype.getTracerProvider=function(){return qd(Cv)||this.Ie},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){Zd(Cv,Ud.instance()),this.Ie=new wv},e}().getInstance(),xv=Yd("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function kv(e){return null==e||(Array.isArray(e)?function(e){var t;for(var r of e)if(null!=r){var i=typeof r;if(i!==t){if(!t){if(Tv(i)){t=i;continue}return!1}return!1}}return!0}(e):Tv(typeof e))}function Tv(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}function Av(e){try{(e=>{Iv.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){for(var t={},r=e;null!==r;)Object.getOwnPropertyNames(r).forEach((e=>{if(!t[e]){var i=r[e];i&&(t[e]=String(i))}})),r=Object.getPrototypeOf(r);return t}(e))}(e))})(e)}catch(e){}}var Ev,Rv=performance,Nv="telemetry.sdk.language",Mv="telemetry.sdk.name",Fv="telemetry.sdk.version",Ov={[Mv]:"opentelemetry","process.runtime.name":"browser",[Nv]:"webjs",[Fv]:"2.2.0"},Pv=Math.pow(10,6),Lv=Math.pow(10,9);function Dv(e){return[Math.trunc(e/1e3),Math.round(e%1e3*Pv)]}function Bv(){var e=Rv.timeOrigin;return"number"!=typeof e&&(e=Rv.timing&&Rv.timing.fetchStart),e}function jv(e){if(s=e,Array.isArray(s)&&2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1])return e;if("number"==typeof e)return e<Bv()?(t=e,r=Dv(Bv()),i=Dv("number"==typeof t?t:Rv.now()),Lv>(n=[r[0]+i[0],r[1]+i[1]])[1]||(n[1]-=Lv,n[0]+=1),n):Dv(e);var t,r,i,n,s;if(e instanceof Date)return Dv(e.getTime());throw TypeError("Invalid input type")}!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(Ev||(Ev={}));var $v="[object Object]",qv="[object Null]",Zv="[object Undefined]",Hv=function(){}.toString,Vv=Hv.call(Object),zv=Object.getPrototypeOf,Uv=Object.prototype,Yv=Uv.hasOwnProperty,Gv=Symbol?Symbol.toStringTag:void 0,Wv=Uv.toString;function Xv(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||function(e){return null==e?void 0===e?Zv:qv:Gv&&Gv in Object(e)?function(e){var t=Yv.call(e,Gv),r=e[Gv],i=!1;try{e[Gv]=void 0,i=!0}catch(e){}var n=Wv.call(e);return i&&(t?e[Gv]=r:delete e[Gv]),n}(e):function(e){return Wv.call(e)}(e)}(e)!==$v)return!1;var t=zv(e);if(null===t)return!0;var r=Yv.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Hv.call(r)===Vv}function Jv(e){return ef(e)?e.slice():e}function Kv(e,t,r,i){var n;if(void 0===r&&(r=0),20>=r){if(r++,nf(e)||nf(t)||tf(t))n=Jv(t);else if(ef(e)){if(n=e.slice(),ef(t))for(var s=0,o=t.length;o>s;s++)n.push(Jv(t[s]));else if(rf(t))for(var a=Object.keys(t),l=0,u=a.length;u>l;l++){var h=a[l];n[h]=Jv(t[h])}}else if(rf(e))if(rf(t)){if(!function(e,t){return!(!Xv(e)||!Xv(t))}(e,t))return t;n=Object.assign({},e);for(var c=Object.keys(t),d=0,v=c.length;v>d;d++){var f=c[d],p=t[f];if(nf(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(Qv(e,f,i)||Qv(t,f,i))delete n[f];else{if(rf(g)&&rf(m)){var y=i.get(g)||[],b=i.get(m)||[];y.push({obj:e,key:f}),b.push({obj:t,key:f}),i.set(g,y),i.set(m,b)}n[f]=Kv(n[f],p,r,i)}}}}else n=t;return n}}function Qv(e,t,r){for(var i=r.get(e[t])||[],n=0,s=i.length;s>n;n++){var o=i[n];if(o.key===t&&o.obj===e)return!0}return!1}function ef(e){return Array.isArray(e)}function tf(e){return"function"==typeof e}function rf(e){return!nf(e)&&!ef(e)&&!tf(e)&&"object"==typeof e}function nf(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}class sf extends Error{constructor(e){super(e),Object.setPrototypeOf(this,sf.prototype)}}function of(e,t){var r,i=new Promise((function(e,i){r=setTimeout((function(){i(new sf("Operation timed out."))}),t)}));return Promise.race([e,i]).then((e=>(clearTimeout(r),e)),(e=>{throw clearTimeout(r),e}))}class af{constructor(){this.Se=void 0,this.ke=void 0,this.xe=void 0,this.Se=new Promise(((e,t)=>{this.ke=e,this.xe=t}))}get promise(){return this.Se}resolve(e){this.ke(e)}reject(e){this.xe(e)}}class lf{constructor(e,t){this.Ae=void 0,this.Te=void 0,this.Ne=!1,this.Re=new af,this.Ae=e,this.Te=t}get isCalled(){return this.Ne}get promise(){return this.Re.promise}call(){if(!this.Ne){this.Ne=!0;try{for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];Promise.resolve(this.Ae.call(this.Te,...t)).then((e=>this.Re.resolve(e)),(e=>this.Re.reject(e)))}catch(e){this.Re.reject(e)}}return this.Re.promise}}var uf={Me:(e,t)=>new Promise((r=>{_v.with(function(e){return e.setValue(xv,!0)}(_v.active()),(()=>{e.export(t,(e=>{r(e)}))}))}))};class hf{constructor(e,t,r,i,n){this._e=void 0,this.Ee=void 0,this.Oe=void 0,this.Le=void 0,this.Fe=void 0,this.Be=void 0,this._e=e,this.Ee=t,this.Oe=r,this.Le=i,this.Fe=n,this.Be=Iv.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this.Be.debug("items to be sent",e),this.Le.hasReachedLimit())t({code:Ev.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this.Ee.serializeRequest(e);null!=r?this.Le.pushPromise(this._e.send(r,this.Fe).then((e=>{if("success"!==e.status)t("failure"===e.status&&e.error?{code:Ev.FAILED,error:e.error}:"retryable"===e.status?{code:Ev.FAILED,error:new Ed("Export failed with retryable status")}:{code:Ev.FAILED,error:new Ed("Export failed with unknown error")});else{if(null!=e.data)try{this.Oe.handleResponse(this.Ee.deserializeResponse(e.data))}catch(t){this.Be.warn("Export succeeded but could not deserialize response - is the response specification compliant?",t,e.data)}t({code:Ev.SUCCESS})}}),(e=>t({code:Ev.FAILED,error:e})))):t({code:Ev.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.Le.awaitAll()}shutdown(){var e=this;return t((function*(){e.Be.debug("shutdown started"),yield e.forceFlush(),e._e.shutdown()}))()}}function cf(e,t,r){return i={transport:r,serializer:t,promiseHandler:Md(e)},new hf(i.transport,i.serializer,{handleResponse(e){null!=e&&function(e){return{}.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&Iv.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}},i.promiseHandler,{timeout:e.timeoutMillis}.timeout);var i}function df(e){return 48>e||e>57?97>e||e>102?e-55:e-87:e-48}function vf(e){for(var t=new Uint8Array(e.length/2),r=0,i=0;e.length>i;i+=2){var n=df(e.charCodeAt(i)),s=df(e.charCodeAt(i+1));t[r++]=n<<4|s}return t}function ff(e){var t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function pf(e){var t;return t=ff(e),{low:Number(BigInt.asUintN(32,t)),high:Number(BigInt.asUintN(32,t>>BigInt(32)))}}var gf="undefined"!=typeof BigInt?function(e){return ff(e).toString()}:function(e){return e[0]*Lv+e[1]};function mf(e){return e}function yf(e){if(void 0!==e)return vf(e)}var bf={encodeHrTime:pf,encodeSpanContext:vf,encodeOptionalSpanContext:yf};function wf(e,t){return{key:e,value:_f(t)}}function _f(e){var t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(_f)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map((e=>{var[t,r]=e;return wf(t,r)}))}}:{}}function If(e,t){var r=function(e){var t=new Map;for(var r of e){var{resource:i,instrumentationScope:{name:n,version:s="",schemaUrl:o=""}}=r,a=t.get(i);a||(a=new Map,t.set(i,a));var l=n+"@"+s+":"+o,u=a.get(l);u||a.set(l,u=[]),u.push(r)}return t}(e);return Array.from(r,(e=>{var[r,i]=e,n=function(e){var t,r={attributes:(t=e.attributes,Object.keys(t).map((e=>wf(e,t[e])))),droppedAttributesCount:0},i=e.schemaUrl;return i&&""!==i&&(r.schemaUrl=i),r}(r);return{resource:n,scopeLogs:Array.from(i,(e=>{var r,[,i]=e;return{scope:(r=i[0].instrumentationScope,{name:r.name,version:r.version}),logRecords:i.map((e=>function(e,t){var r,i,n,s;return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:e.severityNumber,severityText:e.severityText,body:_f(e.body),eventName:e.eventName,attributes:(s=e.attributes,Object.keys(s).map((e=>wf(e,s[e])))),droppedAttributesCount:e.droppedAttributesCount,flags:null==(r=e.spanContext)?void 0:r.traceFlags,traceId:t.encodeOptionalSpanContext(null==(i=e.spanContext)?void 0:i.traceId),spanId:t.encodeOptionalSpanContext(null==(n=e.spanContext)?void 0:n.spanId)}}(e,t))),schemaUrl:i[0].instrumentationScope.schemaUrl}})),schemaUrl:n.schemaUrl}}))}var Cf=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class Sf{static FromAttributeList(e,t){var r=new Sf({},t);return r.Ze=kf(e),r.Pe=e.filter((e=>{var[t,r]=e;return Cf(r)})).length>0,r}constructor(e,t){var r;this.Ze=void 0,this.Pe=!1,this.De=void 0,this.qe=void 0;var i=null!==(r=e.attributes)&&void 0!==r?r:{};this.Ze=Object.entries(i).map((e=>{var[t,r]=e;return Cf(r)&&(this.Pe=!0),[t,r]})),this.Ze=kf(this.Ze),this.De=function(e){if("string"==typeof e||void 0===e)return e;Iv.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}(null==t?void 0:t.schemaUrl)}get asyncAttributesPending(){return this.Pe}waitForAsyncAttributes(){var e=this;return t((function*(){if(e.asyncAttributesPending){for(var t=0;e.Ze.length>t;t++){var[r,i]=e.Ze[t];e.Ze[t]=[r,Cf(i)?yield i:i]}e.Pe=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Iv.error("Accessing resource attributes before async attributes settled"),this.qe)return this.qe;var e={};for(var[t,r]of this.Ze){var i;Cf(r)?Iv.debug("Unsettled resource attribute "+t+" skipped"):null!=r&&(null!==(i=e[t])&&void 0!==i||(e[t]=r))}return this.Pe||(this.qe=e),e}getRawAttributes(){return this.Ze}get schemaUrl(){return this.De}merge(e){if(null==e)return this;var t,r,i,n,s=(n=null==(r=e)?void 0:r.schemaUrl,void 0===(i=null==(t=this)?void 0:t.schemaUrl)||""===i?n:void 0===n||""===n||i===n?i:void Iv.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',i,n)),o=s?{schemaUrl:s}:void 0;return Sf.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],o)}}function xf(e,t){return Sf.FromAttributeList(Object.entries(e),t)}function kf(e){return e.map((e=>{var[t,r]=e;return Cf(r)?[t,r.catch((e=>{Iv.debug("promise rejection for resource attribute: %s - %s",t,e)}))]:[t,r]}))}var Tf={serializeRequest(e){var t,r,i=(t=e,r=function(e){var t,r;if(void 0===e)return bf;var i=null===(t=e.useLongBits)||void 0===t||t,n=null!==(r=e.useHex)&&void 0!==r&&r;return{encodeHrTime:i?pf:gf,encodeSpanContext:n?mf:vf,encodeOptionalSpanContext:n?mf:yf}}({useHex:!0,useLongBits:!1}),{resourceLogs:If(t,r)});return(new TextEncoder).encode(JSON.stringify(i))},deserializeResponse(e){if(0===e.length)return{};var t=new TextDecoder;return JSON.parse(t.decode(e))}};class Af{constructor(e){this._e=void 0,this._e=e}retry(e,t,r){return new Promise(((i,n)=>{setTimeout((()=>{this._e.send(e,t).then(i,n)}),r)}))}send(e,r){var i=this;return t((function*(){for(var t=Date.now()+r,n=yield i._e.send(e,r),s=5,o=1e3;"retryable"===n.status&&s>0;){var a;s--;var l=Math.max(Math.min(o,5e3)+(.4*Math.random()-.2),0);o*=1.5;var u=null!==(a=n.retryInMillis)&&void 0!==a?a:l,h=t-Date.now();if(u>h)return n;n=yield i.retry(e,h,u)}return n}))()}shutdown(){return this._e.shutdown()}}function Ef(e){return new Af(e.transport)}function Rf(e){return[429,502,503,504].includes(e)}function Nf(e){if(null!=e){var t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;var r=new Date(e).getTime()-Date.now();return 0>r?0:r}}class Mf{constructor(e){this.Ve=void 0,this.Ve=e}send(e,r){var i=this;return t((function*(){var t=yield i.Ve.headers(),n=yield new Promise((n=>{var s=new XMLHttpRequest;s.timeout=r,s.open("POST",i.Ve.url),Object.entries(t).forEach((e=>{var[t,r]=e;s.setRequestHeader(t,r)})),s.ontimeout=e=>{n({status:"failure",error:new Error("XHR request timed out")})},s.onreadystatechange=()=>{200>s.status||s.status>299?s.status&&Rf(s.status)?n({status:"retryable",retryInMillis:Nf(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")}):(Iv.debug("XHR success"),n({status:"success"}))},s.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},s.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},s.send(e)}));return n}))()}shutdown(){}}class Ff{constructor(e){this.je=void 0,this.je=e}send(e){var r=this;return t((function*(){var t=(yield r.je.headers())["Content-Type"];return new Promise((i=>{navigator.sendBeacon(r.je.url,new Blob([e],{type:t}))?(Iv.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Of{constructor(e){this.Ve=void 0,this.Ve=e}send(e,r){var i=this;return t((function*(){var t=new AbortController,n=setTimeout((()=>t.abort()),r);try{var s,o=!!globalThis.location,a=new URL(i.Ve.url),l=yield fetch(a.href,{method:"POST",headers:yield i.Ve.headers(),body:e,signal:t.signal,keepalive:o,mode:o?(null==(s=globalThis.location)?void 0:s.origin)===a.origin?"same-origin":"cors":"no-cors"});return 200>l.status||l.status>299?Rf(l.status)?{status:"retryable",retryInMillis:Nf(l.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}:(Iv.debug("response success"),{status:"success"})}catch(e){return"AbortError"===(null==e?void 0:e.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:e})}:{status:"failure",error:new Error("Fetch request errored",{cause:e})}}finally{clearTimeout(n)}}))()}shutdown(){}}function Pf(e,t){return cf(e,t,Ef({transport:(r=e,new Mf(r))}));var r}function Lf(e,t){return cf(e,t,Ef({transport:(r=e,new Of(r))}));var r}function Df(e,t){return cf(e,t,Ef({transport:(r={url:e.url,headers:e.headers},new Ff(r))}));var r}function Bf(e){if(null!=e)try{var t,r=null==(t=globalThis.location)?void 0:t.href;return new URL(e,r).href}catch(t){throw new Error("Configuration: Could not parse user-provided export URL: '"+e+"'")}}function jf(e){return"function"==typeof e.headers?e.headers:function(e){if(null!=e)return t((function*(){return e}))}(e.headers)}function $f(e,i,n){return s={url:e.url,timeoutMillis:e.timeoutMillis,headers:jf(e),concurrencyLimit:e.concurrencyLimit},o={},a=function(e,i){return r({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(n=t((function*(){return e})),function(){return n.apply(this,arguments)}),url:"http://localhost:4318/"+i});var n}(n,i),r({},function(e,t,r){var i,n,s,o,a,l;return{timeoutMillis:Rd(null!==(i=null!==(n=e.timeoutMillis)&&void 0!==n?n:t.timeoutMillis)&&void 0!==i?i:r.timeoutMillis),concurrencyLimit:null!==(s=null!==(o=e.concurrencyLimit)&&void 0!==o?o:t.concurrencyLimit)&&void 0!==s?s:r.concurrencyLimit,compression:null!==(a=null!==(l=e.compression)&&void 0!==l?l:t.compression)&&void 0!==a?a:r.compression}}(s,o,a),{headers:(h=s.headers,c=o.headers,d=a.headers,t((function*(){var e=r({},yield d()),t={};return null!=c&&Object.assign(t,yield c()),null!=h&&Object.assign(t,function(e){var t={};return Object.entries(null!=e?e:{}).forEach((e=>{var[r,i]=e;void 0!==i?t[r]=String(i):Iv.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),t}(yield h())),Object.assign(t,e)}))),url:null!==(l=null!==(u=Bf(s.url))&&void 0!==u?u:o.url)&&void 0!==l?l:a.url});var s,o,a,l,u,h,c,d}function qf(e,t,r,i){return(e.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?Lf:Pf:Df)($f(e,r,i),t)}class Zf extends Ad{constructor(e){void 0===e&&(e={}),super(qf(e,Tf,"v1/logs",{"Content-Type":"application/json"}))}}class Hf{set severityText(e){this.He()||(this.Ye=e)}get severityText(){return this.Ye}set severityNumber(e){this.He()||(this.Ge=e)}get severityNumber(){return this.Ge}set body(e){this.He()||(this.We=e)}get body(){return this.We}get eventName(){return this.Ue}set eventName(e){this.He()||(this.Ue=e)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(e,t,r){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this.Ye=void 0,this.Ge=void 0,this.We=void 0,this.Ue=void 0,this.totalAttributesCount=0,this.ze=!1,this.Xe=void 0;var{timestamp:i,observedTimestamp:n,eventName:s,severityNumber:o,severityText:a,body:l,attributes:u={},context:h}=r,c=Date.now();if(this.hrTime=jv(null!=i?i:c),this.hrTimeObserved=jv(null!=n?n:c),h){var d=Sv.getSpanContext(h);d&&vv(d)&&(this.spanContext=d)}this.severityNumber=o,this.severityText=a,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this.Xe=e.logRecordLimits,this.Ue=s,this.setAttributes(u)}setAttribute(e,t){return this.He()||null===t?this:0===e.length?(Iv.warn("Invalid attribute key: "+e),this):kv(t)||"object"==typeof t&&!Array.isArray(t)&&Object.keys(t).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length<this.Xe.attributeCountLimit||{}.hasOwnProperty.call(this.attributes,e)?(this.attributes[e]=kv(t)?this.Ke(t):t,this):(1===this.droppedAttributesCount&&Iv.warn("Dropping extra attributes."),this)):(Iv.warn("Invalid attribute value set for key: "+e),this)}setAttributes(e){for(var[t,r]of Object.entries(e))this.setAttribute(t,r);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}Je(){this.ze=!0}Ke(e){var t=this.Xe.attributeValueLengthLimit;return t>0?"string"==typeof e?this.Qe(e,t):Array.isArray(e)?e.map((e=>"string"==typeof e?this.Qe(e,t):e)):e:(Iv.warn("Attribute value limit must be positive, got "+t),e)}Qe(e,t){return e.length>t?e.substring(0,t):e}He(){return this.ze&&Iv.warn("Can not execute the operation on emitted log record"),this.ze}}class Vf{constructor(e,t){this.instrumentationScope=void 0,this.$e=void 0,this.instrumentationScope=e,this.$e=t}emit(e){var t=e.context||_v.active(),i=new Hf(this.$e,this.instrumentationScope,r({context:t},e));this.$e.activeProcessor.onEmit(i,t),i.Je()}}class zf{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}}class Uf{constructor(e,t){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=e,this.forceFlushTimeoutMillis=t}forceFlush(){var e=this;return t((function*(){var t=e.forceFlushTimeoutMillis;yield Promise.all(e.processors.map((e=>of(e.forceFlush(),t))))}))()}onEmit(e,t){this.processors.forEach((r=>r.onEmit(e,t)))}shutdown(){var e=this;return t((function*(){yield Promise.all(e.processors.map((e=>e.shutdown())))}))()}}class Yf{constructor(e,t,r,i){this.resource=void 0,this.forceFlushTimeoutMillis=void 0,this.logRecordLimits=void 0,this.processors=void 0,this.loggers=new Map,this.activeProcessor=void 0,this.registeredLogRecordProcessors=[],this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=r,this.processors=i,i.length>0?(this.registeredLogRecordProcessors=i,this.activeProcessor=new Uf(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new zf}}class Gf{constructor(e){var t,r,i;void 0===e&&(e={}),this.et=void 0,this.$e=void 0;var n,s,o,a,l,u,h,c=function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];for(var i=t.shift(),n=new WeakMap;t.length>0;)i=Kv(i,t.shift(),0,n);return i}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},e),d=null!==(t=e.resource)&&void 0!==t?t:xf({"service.name":"unknown_service",[Nv]:Ov[Nv],[Mv]:Ov[Mv],[Fv]:Ov[Fv]});this.$e=new Yf(d,c.forceFlushTimeoutMillis,{attributeCountLimit:null!==(s=null!==(o=null!==(a=(n=c.logRecordLimits).attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==o?o:void 0)&&void 0!==s?s:128,attributeValueLengthLimit:null!==(l=null!==(u=null!==(h=n.attributeValueLengthLimit)&&void 0!==h?h:void 0)&&void 0!==u?u:void 0)&&void 0!==l?l:1/0},null!==(r=null==(i=e)?void 0:i.processors)&&void 0!==r?r:[]),this.et=new lf(this.tt,this)}getLogger(e,t,r){if(this.et.isCalled)return Iv.warn("A shutdown LoggerProvider cannot provide a Logger"),bd;e||Iv.warn("Logger requested without instrumentation scope name.");var i=e||"unknown",n=i+"@"+(t||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this.$e.loggers.has(n)||this.$e.loggers.set(n,new Vf({name:i,version:t,schemaUrl:null==r?void 0:r.schemaUrl},this.$e)),this.$e.loggers.get(n)}forceFlush(){return this.et.isCalled?(Iv.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.et.promise):this.$e.activeProcessor.forceFlush()}shutdown(){return this.et.isCalled?(Iv.warn("shutdown may only be called once per LoggerProvider"),this.et.promise):this.et.call()}tt(){return this.$e.activeProcessor.shutdown()}}class Wf{constructor(e,t){var r,i,n,s,o,a,l,u;this.rt=void 0,this.nt=void 0,this.it=void 0,this.ot=void 0,this.st=void 0,this.ut=!1,this.ct=[],this.dt=void 0,this.et=void 0,this.rt=e,this.nt=null!==(r=null!==(i=null==t?void 0:t.maxExportBatchSize)&&void 0!==i?i:void 0)&&void 0!==r?r:512,this.it=null!==(n=null!==(s=null==t?void 0:t.maxQueueSize)&&void 0!==s?s:void 0)&&void 0!==n?n:2048,this.ot=null!==(o=null!==(a=null==t?void 0:t.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==o?o:5e3,this.st=null!==(l=null!==(u=null==t?void 0:t.exportTimeoutMillis)&&void 0!==u?u:void 0)&&void 0!==l?l:3e4,this.et=new lf(this.tt,this),this.nt>this.it&&(Iv.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this.nt=this.it)}onEmit(e){this.et.isCalled||this.ht(e)}forceFlush(){return this.et.isCalled?this.et.promise:this.vt()}shutdown(){return this.et.call()}tt(){var e=this;return t((function*(){e.onShutdown(),yield e.vt(),yield e.rt.shutdown()}))()}ht(e){this.it>this.ct.length&&(this.ct.push(e),this.ft())}vt(){return new Promise(((e,t)=>{for(var r=[],i=Math.ceil(this.ct.length/this.nt),n=0;i>n;n++)r.push(this.yt());Promise.all(r).then((()=>{e()})).catch(t)}))}yt(){return this.bt(),0===this.ct.length?Promise.resolve():new Promise(((e,t)=>{of(this.Me(this.ct.splice(0,this.nt)),this.st).then((()=>e())).catch(t)}))}ft(){if(!this.ut){var e=()=>{this.ut=!0,this.yt().then((()=>{this.ut=!1,this.ct.length>0&&(this.bt(),this.ft())})).catch((e=>{this.ut=!1,Av(e)}))};if(this.ct.length>=this.nt)return e();void 0===this.dt&&(this.dt=setTimeout((()=>e()),this.ot),"number"!=typeof this.dt&&this.dt.unref())}}bt(){void 0!==this.dt&&(clearTimeout(this.dt),this.dt=void 0)}Me(e){var t=()=>uf.Me(this.rt,e).then((e=>{var t;e.code!==Ev.SUCCESS&&Av(null!==(t=e.error)&&void 0!==t?t:new Error("BatchLogRecordProcessor: log record export failed (status "+e+")"))})).catch(Av),r=e.map((e=>e.resource)).filter((e=>e.asyncAttributesPending));return 0===r.length?t():Promise.all(r.map((e=>null==e.waitForAsyncAttributes?void 0:e.waitForAsyncAttributes()))).then(t,Av)}}class Xf extends Wf{constructor(e,t){super(e,t),this.wt=void 0,this.Ct=void 0,this.It(t)}onShutdown(){"undefined"!=typeof document&&(this.wt&&document.removeEventListener("visibilitychange",this.wt),this.Ct&&document.removeEventListener("pagehide",this.Ct))}It(e){!0!==(null==e?void 0:e.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this.wt=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this.Ct=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this.wt),document.addEventListener("pagehide",this.Ct))}}var Jf=1e4,Kf=function(e,t,r,i,n,s){if(void 0===t&&(t=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=Jf),void 0===s&&(s=new WeakSet),s.has(e))return r[t||"circular"]="[Circular]",r;for(var o in s.add(e),e)if({}.hasOwnProperty.call(e,o)){var a=e[o],l=t?t+"."+o:o;if(Ur(a))Kf(a,l,r,i,n,s);else{if(i-=1,n-=String(a).length,n-=l.length,0>=i||0>=n)return void(r.attributes_truncated=!0);r[l]=a}}return r},Qf={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};ss.__PosthogExtensions__=ss.__PosthogExtensions__||{},ss.__PosthogExtensions__.logs={initializeLogs(e){(e=>{var t,i={"service.name":(null==(t=e.config.logs)?void 0:t.serviceName)||"posthog-browser-logs",host:ss.location.host};if(e.sessionManager){var{sessionId:n,windowId:s}=e.sessionManager.checkAndGetSessionAndWindowId(!0);i=r({},i,{"session.id":n,"window.id":s})}Td.setGlobalLoggerProvider(new Gf({resource:xf(i),processors:[new Xf(new Zf({url:e.config.api_host+"/i/v1/logs?token="+e.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(e);var t=Td.getLogger("console"),i={};if(e.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:s}=e.sessionManager.checkAndGetSessionAndWindowId(!0);i={sessionStartTimestamp:n.toString(),lastActivityTimestamp:s.toString()}}var o=function(n){var s;ss.console[n]=(s=ss.console[n],function(){for(var o=arguments.length,a=new Array(o),l=0;o>l;l++)a[l]=arguments[l];if(a.length>0){var u=a.map((e=>{return JSON.stringify(e,(t=new WeakSet,(e,i)=>{if(i instanceof Error)return r({},i,{name:i.name,message:i.message,stack:i.stack});if("object"==typeof i&&!Jr(i)){if(t.has(i))return"[Circular]";t.add(i)}return i}));var t})).join(" ");u.length>Jf&&(u=u.slice(0,Jf)+"...",i.body_truncated="true"),t.emit({severityText:Qf[n],body:u,attributes:r({"log.source":"console."+n,distinct_id:e.get_distinct_id(),"location.href":ss.location.href},i,Ur(a[0])?Kf(a[0]):{})}),s.apply(ss.console,a)}})};for(var a of["debug","log","warn","error","info"])o(a)}};var ep=cs("[Error tracking]");function tp(){return new yn([new Nn,new qn,new Fn,new Mn,new jn,new Bn,new Pn,new $n],function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;t>n;n++)i[n-1]=arguments[n];return function(t,n){void 0===n&&(n=0);for(var s=[],o=t.split("\n"),a=n;o.length>a;a++){var l=o[a];if(1024>=l.length){var u=En.test(l)?l.replace(En,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of i){var c=h(u,e);if(c){s.push(c);break}}if(s.length>=Rn)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,Rn).map((e=>{return r({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||bn});var i}))}(s)}}("web:javascript",xn,An))}var rp=cs("[ExceptionAutocapture]"),ip=tp(),np={wrapOnError(e){var t=Wn;t||rp.info("window not available, cannot wrap onerror");var r=t.onerror;return t.onerror=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var o=ip.buildFromUnknown(n[4]||n[0],{mechanism:{handled:!1}});return e(o),null!==(t=null==r?void 0:r(...n))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onerror)||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=r}},wrapUnhandledRejection(e){var t=Wn;t||rp.info("window not available, cannot wrap onUnhandledRejection");var r=t.onunhandledrejection;return t.onunhandledrejection=function(t){var i,n=ip.buildFromUnknown(t,{mechanism:{handled:!1}});return e(n),null!==(i=null==r?void 0:r(t))&&void 0!==i&&i},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.onunhandledrejection)||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=r}},wrapConsoleError(e){var t=console;t||rp.info("console not available, cannot wrap console.error");var r=t.error;return t.error=function(){for(var t,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];t=1==n.length?n[0]:n.join(" ");var o=n.find((e=>e instanceof Error)),a=ip.buildFromUnknown(o||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return e(a),null==r?void 0:r(...n)},t.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var e;null==(e=t.error)||delete e.__POSTHOG_INSTRUMENTED__,t.error=r}}};ss.__PosthogExtensions__=ss.__PosthogExtensions__||{},ss.__PosthogExtensions__.errorWrappingFunctions=np,ss.posthogErrorWrappingFunctions=np;var sp=(e,t,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(e){return}if(!Vr(e)||e.includes(n)){if(r){var{sessionId:s,windowId:o}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",s),i.headers.set("X-POSTHOG-WINDOW-ID",o)}t!==Io&&i.headers.set("X-POSTHOG-DISTINCT-ID",t)}};ss.__PosthogExtensions__=ss.__PosthogExtensions__||{};var op={_patchFetch:(e,r,i)=>As(Wn,"fetch",(n=>function(){var s=t((function*(t,s){var o=new Request(t,s);return sp(e,r,i,o),n(o)}));return function(e,t){return s.apply(this,arguments)}}())),_patchXHR:(e,t,r)=>As(Wn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=new Request(s);return sp(e,t,r,u),i.call(this,n,u.url,o,a,l)}))};ss.__PosthogExtensions__.tracingHeadersPatchFns=op,ss.postHogTracingHeadersPatchFns=op;var ap=-1,lp=e=>{addEventListener("pageshow",(t=>{t.persisted&&(ap=t.timeStamp,e(t))}),!0)},up=(e,t,r,i)=>{var n,s;return o=>{t.value>=0&&(o||i)&&((s=t.value-(null!=n?n:0))||void 0===n)&&(n=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t))}},hp=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},cp=()=>{var e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},dp=()=>{var e,t=cp();return null!==(e=null==t?void 0:t.activationStart)&&void 0!==e?e:0},vp=function(e,t){void 0===t&&(t=-1);var r=cp(),i="navigate";return 0>ap?r&&(document.prerendering||dp()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:e,value:t,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},fp=new WeakMap;function pp(e,t){return fp.get(e)||fp.set(e,new t),fp.get(e)}class gp{constructor(){this.t=void 0,this.i=0,this.o=[]}h(e){var t;if(!e.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>e.startTime-i.startTime&&5e3>e.startTime-r.startTime?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null==(t=this.t)||t.call(this,e)}}}var mp,yp=function(e,t,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return n.observe(r({type:e,buffered:!0},i)),n}}catch(e){}},bp=e=>{var t=!1;return()=>{t||(e(),t=!0)}},wp=-1,_p=new Set,Ip=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Cp=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(var t of _p)t();isFinite(wp)||(wp="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Cp,!0))}},Sp=()=>{if(0>wp){var e,t=dp(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").filter((e=>"hidden"===e.name&&e.startTime>t))[0])?void 0:e.startTime;wp=null!=r?r:Ip(),addEventListener("visibilitychange",Cp,!0),addEventListener("prerenderingchange",Cp,!0),lp((()=>{setTimeout((()=>{wp=Ip()}))}))}return{get firstHiddenTime(){return wp},onHidden(e){_p.add(e)}}},xp=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},kp=[1800,3e3],Tp=function(e,t){void 0===t&&(t={}),xp((()=>{var r,i=Sp(),n=vp("FCP"),s=yp("paint",(e=>{for(var t of e)"first-contentful-paint"===t.name&&(s.disconnect(),i.firstHiddenTime>t.startTime&&(n.value=Math.max(t.startTime-dp(),0),n.entries.push(t),r(!0)))}));s&&(r=up(e,n,kp,t.reportAllChanges),lp((i=>{n=vp("FCP"),r=up(e,n,kp,t.reportAllChanges),hp((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Ap=[.1,.25],Ep=0,Rp=1/0,Np=0,Mp=e=>{for(var t of e)t.interactionId&&(Rp=Math.min(Rp,t.interactionId),Np=Math.max(Np,t.interactionId),Ep=Np?(Np-Rp)/7+1:0)},Fp=()=>{var e;return mp?Ep:null!==(e=performance.interactionCount)&&void 0!==e?e:0},Op=0;class Pp{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){Op=Fp(),this.u.length=0,this.l.clear()}L(){var e=Math.min(this.u.length-1,Math.floor((Fp()-Op)/50));return this.u[e]}h(e){var t;if(null!=(t=this.m)&&t.call(this,e),e.interactionId||"first-input"===e.entryType){var r=this.u.at(-1),i=this.l.get(e.interactionId);if(i||10>this.u.length||e.duration>r.P){var n;if(i?e.duration>i.P?(i.entries=[e],i.P=e.duration):e.duration===i.P&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(this.l.set((i={id:e.interactionId,entries:[e],P:e.duration}).id,i),this.u.push(i)),this.u.sort(((e,t)=>t.P-e.P)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.l.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var Lp=e=>{var t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=bp(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},Dp=[200,500];class Bp{constructor(){this.m=void 0}h(e){var t;null==(t=this.m)||t.call(this,e)}}var jp=[2500,4e3],$p={onLCP(e,t){void 0===t&&(t={}),xp((()=>{var r,i=Sp(),n=vp("LCP"),s=pp(t,Bp),o=e=>{for(var o of(t.reportAllChanges||(e=e.slice(-1)),e))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-dp(),0),n.entries=[o],r())},a=yp("largest-contentful-paint",o);if(a){r=up(e,n,jp,t.reportAllChanges);var l=bp((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),u=e=>{e.isTrusted&&(Lp(l),removeEventListener(e.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});lp((i=>{n=vp("LCP"),r=up(e,n,jp,t.reportAllChanges),hp((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(e,t){void 0===t&&(t={});var r=Sp();Tp(bp((()=>{var i,n=vp("CLS",0),s=pp(t,gp),o=e=>{for(var t of e)s.h(t);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=yp("layout-shift",o);a&&(i=up(e,n,Ap,t.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),lp((()=>{s.i=0,n=vp("CLS",0),i=up(e,n,Ap,t.reportAllChanges),hp((()=>i()))})),setTimeout(i))})))},onFCP:Tp,onINP(e,t){if(void 0===t&&(t={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Sp();xp((()=>{var i;"interactionCount"in performance||mp||(mp=yp("event",Mp,{type:"event",buffered:!0,durationThreshold:0}));var n,s=vp("INP"),o=pp(t,Pp),a=e=>{Lp((()=>{for(var t of e)o.h(t);var r=o.L();r&&r.P!==s.value&&(s.value=r.P,s.entries=r.entries,n())}))},l=yp("event",a,{durationThreshold:null!==(i=t.durationThreshold)&&void 0!==i?i:40});n=up(e,s,Dp,t.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(l.takeRecords()),n(!0)})),lp((()=>{o.v(),s=vp("INP"),n=up(e,s,Dp,t.reportAllChanges)})))}))}}};ss.__PosthogExtensions__=ss.__PosthogExtensions__||{},ss.__PosthogExtensions__.postHogWebVitalsCallbacks=$p,ss.postHogWebVitalsCallbacks=$p,ss.__PosthogExtensions__.loadWebVitalsCallbacks=()=>$p;class qp{constructor(e){this.disabled=!1===e;var t=Ur(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(t-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var Zp="$copy_autocapture",Hp=cs("[AutoCapture]");function Vp(e,t){return t.length>e?t.slice(0,e)+"...":t}function zp(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Zo(t));return t}function Up(e,t){var i,n,{e:s,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u}=t;if(!Zo(e))return{props:{}};for(var h=[e],c=e;c.parentNode&&!Ho(c,"body");)if(zo(c.parentNode))h.push(c.parentNode.host),c=c.parentNode.host;else{if(!Zo(c.parentNode))break;h.push(c.parentNode),c=c.parentNode}var d,v,f=[],p={},g=!1,m=!1;if(vs(h,(e=>{var t=sa(e);if(Ho(e,"a")){var r=e.getAttribute("href");g=t&&!!r&&va(r)&&r}Br(Go(e),"ph-no-capture")&&(m=!0),f.push(function(e,t,r,i){var n=e.tagName.toLowerCase(),s={tag_name:n};Ko.indexOf(n)>-1&&!r&&(s.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?Vp(1024,fa(e)):Vp(1024,Xo(e)));var o=Go(e);o.length>0&&(s.classes=o.filter((function(e){return""!==e}))),vs(e.attributes,(function(r){var n;if((!oa(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!t&&va(r.value)&&(!Wr(n=r.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=r.value;"class"===r.name&&(o=Uo(o).join(" ")),s["attr__"+r.name]=Vp(1024,o)}}));for(var a=1,l=1,u=e;u=zp(u);)a++,u.tagName===e.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}(e,o,a,l));var i=function(e){if(!sa(e))return{};var t={};return vs(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),i=e.value;r&&i&&va(i)&&(t[r]=i)}})),t}(e);fs(p,i)})),m)return{props:{},explicitNoCapture:m};if(a||(f[0].$el_text=Ho(e,"a")||Ho(e,"button")?fa(e):Xo(e)),g){var y,b;f[0].attr__href=g;var w=null==(y=Cs(g))?void 0:y.host,_=null==Wn||null==(b=Wn.location)?void 0:b.host;w&&_&&w!==_&&(d=g)}return{props:fs({$event_type:s.type,$ce_version:1},u?{}:{$elements:f},{$elements_chain:(v=f,function(e){var t=e.map((e=>{var t,i,n="";if(e.tag_name&&(n+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))n+="."+s.replace(/"/g,"");var o=r({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return ps(o).sort(((e,t)=>{var[r]=e,[i]=t;return r.localeCompare(i)})).forEach((e=>{var[t,r]=e;return a[ga(t.toString())]=ga(r.toString())})),(n+=":")+ps(a).map((e=>{var[t,r]=e;return t+'="'+r+'"'})).join("")}));return t.join(";")}(function(e){return e.map((e=>{var t,r,i={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:ma(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return ps(e).filter((e=>{var[t]=e;return 0===t.indexOf("attr__")})).forEach((e=>{var[t,r]=e;return i.attributes[t]=r})),i}))}(v)))},null!=(i=f[0])&&i.$el_text?{$el_text:null==(n=f[0])?void 0:n.$el_text}:{},d&&"click"===s.type?{$external_click_url:d}:{},p)}}var Yp={};function Gp(e){return function(e,t){var r=Yp[e];if(r)return r;var i,n=t[e];if(zr(i=n)&&-1!==i.toString().indexOf("[native code]")&&!Wn.Zone)return Yp[e]=n.bind(t);var s=t.document;if(s&&zr(s.createElement))try{var o=s.createElement("iframe");o.hidden=!0,s.head.appendChild(o);var a=o.contentWindow;a&&a[e]&&(n=a[e]),s.head.removeChild(o)}catch(t){hs.warn("Could not create sandbox iframe for "+e+" check, bailing to assignableWindow."+e+": ",t)}return n&&zr(n)?Yp[e]=n.bind(t):n}("MutationObserver",e)}function Wp(e,t){return Qr(e)&&e>=t}class Xp{St(e){var t,r,i,n,s,o=this.kt((null==e?void 0:e.__onCapture)||this.xt.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!==(i=null==e?void 0:e.selection_change_threshold_ms)&&void 0!==i?i:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==e?void 0:e.mutation_threshold_ms)&&void 0!==n?n:o.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==e?void 0:e.capture_clicks_with_modifier_keys)&&void 0!==s?s:o.capture_clicks_with_modifier_keys,__onCapture:o.__onCapture}}constructor(e,t){this.At=[],this.kt=e=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:e}),this.Tt=e=>{var t=function(e){var t=Jo(e);return t?{node:t,originalEvent:e,timestamp:Date.now()}:null}(e);Jr(t)||this.Nt(t)||this.At.push(t),this.At.length&&Gr(this.Rt)&&(this.Rt=ss.setTimeout((()=>{this.Mt()}),1e3))},this._t=()=>{var e=Date.now();e%50==0&&this.At.forEach((t=>{Gr(t.scrollDelayMs)&&(t.scrollDelayMs=e-t.timestamp)}))},this.Et=()=>{this.Ot=Date.now()},this.Lt=()=>{"visible"===(null==Kn?void 0:Kn.visibilityState)&&(this.Ft=Date.now())},this.instance=e,this.Bt=this.St(t),this._onCapture=this.Bt.__onCapture}start(e){this.Zt(),this.Pt(),this.Dt(),this.qt(),this.Vt(e)}Vt(e){if(!this.jt){var t=Gp(ss);this.jt=new t((e=>{this.Ht(e)})),this.jt.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var e;null==(e=this.jt)||e.disconnect(),this.jt=void 0,ss.removeEventListener("click",this.Tt),ss.removeEventListener("scroll",this._t,{capture:!0}),ss.removeEventListener("selectionchange",this.Et),null==Kn||Kn.removeEventListener("visibilitychange",this.Lt)}Ht(e){this.Yt=Date.now()}Zt(){_s(ss,"click",this.Tt)}Pt(){_s(ss,"scroll",this._t,{capture:!0})}Dt(){_s(ss,"selectionchange",this.Et)}qt(){_s(Kn,"visibilitychange",this.Lt)}Nt(e){if(!e)return!0;if(!this.Bt.capture_clicks_with_modifier_keys&&((t=e.originalEvent).ctrlKey||t.metaKey||t.altKey||t.shiftKey))return!0;var t;if(qo(e.node))return!0;var r=this.At.some((t=>t.node===e.node&&1e3>Math.abs(t.timestamp-e.timestamp)));return!!r||!(!Ho(e.node,"html")&&Zo(e.node)&&!Ko.includes(e.node.tagName.toLowerCase()))}Mt(){if(this.At.length){clearTimeout(this.Rt),this.Rt=void 0;var e=this.At;for(var t of(this.At=[],e)){var r;t.mutationDelayMs=null!==(r=t.mutationDelayMs)&&void 0!==r?r:this.Yt&&this.Yt>=t.timestamp?this.Yt-t.timestamp:void 0,t.absoluteDelayMs=Date.now()-t.timestamp,t.selectionChangedDelayMs=this.Ot&&this.Ot>=t.timestamp?this.Ot-t.timestamp:void 0,t.visibilityChangedDelayMs=this.Ft?Math.abs(t.timestamp-this.Ft):void 0;var i=Wp(t.scrollDelayMs,this.Bt.scroll_threshold_ms),n=Wp(t.selectionChangedDelayMs,this.Bt.selection_change_threshold_ms),s=Wp(t.mutationDelayMs,this.Bt.mutation_threshold_ms),o=Wp(t.absoluteDelayMs,1.1*this.Bt.mutation_threshold_ms),a=Qr(t.scrollDelayMs)&&this.Bt.scroll_threshold_ms>t.scrollDelayMs,l=Qr(t.mutationDelayMs)&&this.Bt.mutation_threshold_ms>t.mutationDelayMs,u=Qr(t.selectionChangedDelayMs)&&this.Bt.selection_change_threshold_ms>t.selectionChangedDelayMs,h=Qr(t.visibilityChangedDelayMs)&&this.Bt.selection_change_threshold_ms>t.visibilityChangedDelayMs;if(!(a||l||u||h)){var c=Wp(t.visibilityChangedDelayMs,this.Bt.selection_change_threshold_ms);i||s||o||n||c?this._onCapture(t,{$dead_click_last_mutation_timestamp:this.Yt,$dead_click_event_timestamp:t.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:n,$dead_click_visibility_changed_timeout:c}):this.Bt.mutation_threshold_ms>t.absoluteDelayMs&&this.At.push(t)}}this.At.length&&Gr(this.Rt)&&(this.Rt=ss.setTimeout((()=>{this.Mt()}),1e3))}}xt(e,t){this.instance.capture("$dead_click",r({},t,Up(e.node,{e:e.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Bt.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,$dead_click_visibility_changed_delay_ms:e.visibilityChangedDelayMs}),{timestamp:new Date(e.timestamp)})}}ss.__PosthogExtensions__=ss.__PosthogExtensions__||{},ss.__PosthogExtensions__.initDeadClicksAutocapture=(e,t)=>new Xp(e,t);var Jp=cs("[ExternalScriptsLoader]"),Kp=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return Jp.warn(t+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==Kn?void 0:Kn.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===t){var e=i[o];return e.__posthog_loading_callback_fired?{v:r()}:(e.addEventListener("load",(t=>{e.__posthog_loading_callback_fired=!0,r(void 0,t)})),e.onerror=e=>r(e),{v:void 0})}},o=0;i.length>o;o++)if(n=s())return n.v;var a=()=>{if(!Kn)return r("document not found");var i=Kn.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=t,i.onload=e=>{i.__posthog_loading_callback_fired=!0,r(void 0,e)},i.onerror=e=>r(e),e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)Kn.head.appendChild(i);else{var n,s=Kn.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):Kn.body.appendChild(i)}};null!=Kn&&Kn.body?a():null==Kn||Kn.addEventListener("DOMContentLoaded",a)};ss.__PosthogExtensions__=ss.__PosthogExtensions__||{},ss.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{if("remote-config"!==t){var i;if(e.config.__preview_external_dependency_versioned_paths)i=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var n="/static/"+t+".js?v="+e.version;if("toolbar"===t){var s=3e5;n=n+"&t="+Math.floor(Date.now()/s)*s}i=e.requestRouter.endpointFor("assets",n)}Kp(e,i,r)}else{var o=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");Kp(e,o,r)}},ss.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var i=e.requestRouter.endpointFor("api",t);Kp(e,i,r)};class Qp{constructor(e){this._instance=e}get Bt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.Bt.cookieless_mode===Ao||this.isRejected()||-1===this.consent&&this.Bt.cookieless_mode===To}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Bt.opt_out_capturing_by_default}optInOut(e){this.nr.M(this.sr,e?1:0,this.Bt.cookie_expiration,this.Bt.cross_subdomain_cookie,this.Bt.secure_cookie)}reset(){this.nr.F(this.sr,this.Bt.cross_subdomain_cookie)}get sr(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:r}=this._instance.config;return r||(t?t+e:"__ph_opt_in_out_"+e)}get ir(){var e=this.nr.O(this.sr);return ai(e)?1:Br(li,e)?0:-1}get nr(){var e=this.Bt.opt_out_capturing_persistence_type,t="localStorage"===e?Mh:Rh;if(!this.ar||this.ar!==t){this.ar=t;var r="localStorage"===e?Rh:Mh;r.O(this.sr)&&(this.ar.O(this.sr)||this.optInOut(ai(r.O(this.sr))),r.F(this.sr,this.Bt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.Bt.respect_dnt&&[null==Jn?void 0:Jn.doNotTrack,null==Jn?void 0:Jn.msDoNotTrack,ss.doNotTrack].some((e=>ai(e)))}}var eg=cs("[Dead Clicks]"),tg=()=>!0,rg=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property($s)),i=e.instance.config.capture_dead_clicks;return ti(i)?i:!!Ur(i)||r};class ig{get lazyLoadedDeadClicksAutocapture(){return this.lr}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[$s]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.ur((()=>{this.hr()})):this.stop()}ur(e){var t,r;null!=(t=ss.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(r=ss.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(t=>{t?eg.error("failed to load script",t):e()}))}hr(){var e;if(Kn){if(!this.lr&&null!=(e=ss.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Ur(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.lr=ss.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.lr.start(Kn),eg.info("starting...")}}else eg.error("`document` not found. Cannot start.")}stop(){this.lr&&(this.lr.stop(),this.lr=void 0,eg.info("stopping..."))}}var ng=cs("[SegmentIntegration]");var sg="posthog-js";function og(e,t){var{organization:i,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{var l,u,h,c,d;if("*"!==o&&!o.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=v,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f,p=(null==(l=t.exception)?void 0:l.values)||[],g=p.map((e=>r({},e,{stacktrace:e.stacktrace?r({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map((e=>r({},e,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(u=p[0])?void 0:u.value)||t.message,$exception_type:null==(h=p[0])?void 0:h.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=p[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=p[0])?void 0:d.type,$sentry_tags:t.tags};return i&&n&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+t.event_id),a&&(null==(f=e.exceptions)||f.sendExceptionEvent(m)),t}}class ag{constructor(e,t,r,i,n,s){this.name=sg,this.setupOnce=function(o){o(og(e,{organization:t,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class lg{constructor(e){this.cr=(e,t,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(hs.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.vr()}vr(){var e;this.pr=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.cr)}destroy(){var e;null==(e=this.pr)||e.call(this),this.pr=void 0}doPageView(e,t){var r,i=this.gr(e,t);return this.dr={pathname:null!==(r=null==Wn?void 0:Wn.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var t;return this.gr(e,null==(t=this.dr)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.dr)?void 0:e.pageViewId}}gr(e,t){var r=this.dr;if(!r)return{$pageview_id:t};var i={$pageview_id:t,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:h}=n;if(!(Gr(s)||Gr(o)||Gr(a)||Gr(l)||Gr(u)||Gr(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var c=s>1?ui(o/s,0,1,hs):1,d=s>1?ui(a/s,0,1,hs):1,v=l>1?ui(u/l,0,1,hs):1,f=l>1?ui(h/l,0,1,hs):1;i=fs(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var ug={[Rs]:{exposure:"hidden"},[Ms]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Fs]:{exposure:"hidden"},[Os]:{exposure:"event"},[Ps]:{exposure:"hidden"},[Ls]:{exposure:"event"},[Ds]:{exposure:"hidden"},[Bs]:{exposure:"event"},[js]:{exposure:"event"},[$s]:{exposure:"event"},[qs]:{exposure:"hidden"},[Zs]:{exposure:"event"},[Hs]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Gs]:{exposure:"hidden"},[Ws]:{exposure:"event"},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},[Xs]:{exposure:"derived",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!Ur(e))return{};for(var t={},r=Object.keys(e),i=0;r.length>i;i++)t["$feature/"+r[i]]=e[r[i]];return t}},[Js]:{exposure:"event"},[Ks]:{exposure:"hidden"},[Qs]:{exposure:"hidden"},[eo]:{exposure:"event"},[to]:{exposure:"event"},[ro]:{exposure:"event"},[io]:{exposure:"hidden"},[no]:{exposure:"hidden"},[so]:{exposure:"hidden"},[oo]:{exposure:"hidden"},[ao]:{exposure:"event"},[lo]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[uo]:{exposure:"hidden"},[ho]:{exposure:"hidden"},[co]:{exposure:"hidden"},[vo]:{exposure:"hidden"},[fo]:{exposure:"hidden"},[po]:{exposure:"hidden"},[go]:{exposure:"hidden"},[mo]:{exposure:"hidden"},[yo]:{exposure:"hidden"},[bo]:{exposure:"hidden"},[wo]:{exposure:"hidden"},[Vs]:{exposure:"event"},[zs]:{exposure:"event"},[Us]:{exposure:"event"},[Ys]:{exposure:"event"},[Co]:{exposure:"event"},[So]:{exposure:"event"},[xo]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},hg=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],cg=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class dg{constructor(e,t){this.Bt=e,this.props={},this.mr=!1,this.yr=(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.nr=this.br(e),this.load(),e.debug&&hs.info("Persistence loaded",e.persistence,r({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.wr}br(e){-1===cg.indexOf(e.persistence.toLowerCase())&&(hs.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=function(e){void 0===e&&(e=[]);var t=[...Fh,...e];return r({},Mh,{Z(e){try{var t={};try{t=Rh.Z(e)||{}}catch(e){}var r=fs(t,JSON.parse(Mh.O(e)||"{}"));return Mh.M(e,r),r}catch(e){}return null},M(e,r,i,n,s,o){try{Mh.M(e,r,void 0,void 0,o);var a={};t.forEach((e=>{r[e]&&(a[e]=r[e])})),Object.keys(a).length&&Rh.M(e,a,i,n,s,o)}catch(e){Mh.B(e)}},F(e,t){try{null==Wn||Wn.localStorage.removeItem(e),Rh.F(e,t)}catch(e){Mh.B(e)}}})}(e.cookie_persisted_properties||[]),i=e.persistence.toLowerCase();return"localstorage"===i&&Mh.R()?Mh:"localstorage+cookie"===i&&t.R()?t:"sessionstorage"===i&&Dh.R()?Dh:"memory"===i?Ph:"cookie"===i?Rh:t.R()?t:Rh}_r(e){var t=null!=e?e:this.Bt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var r=this.props[vo];return!r||"number"!=typeof r||Date.now()-r>t}properties(){var e={};return vs(this.props,((t,r)=>{var i=(e=>{var t=ug[e];if(t)return t;for(var[r,i]of hg)if(0===e.indexOf(r))return i})(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(t,r===Xs?()=>this._r():()=>!1))return;i.transformToEventProperties&&fs(e,i.transformToEventProperties(t))}else i&&"event"!==i.exposure||(e[r]=t)})),e}load(){if(!this.wr){var e=this.nr.Z(this.yr);e&&(this.props=fs({},e))}}save(){this.wr||this.nr.M(this.yr,this.props,this.Ir,this.Cr,this.Sr,this.Bt.debug)}remove(){this.nr.F(this.yr,!1),this.nr.F(this.yr,!0)}clear(){this.remove(),this.props={}}register_once(e,t,r){if(Ur(e)){Gr(t)&&(t="None"),this.Ir=Gr(r)?this.kr:r;var i=!1;if(vs(e,((e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.Tr(r,e),i=!0)})),i)return this.save(),!0}return!1}register(e,t){if(Ur(e)){this.Ir=Gr(t)?this.kr:t;var r=!1;if(vs(e,((t,i)=>{e.hasOwnProperty(i)&&this.props[i]!==t&&(this.Tr(i,t),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Ar(e),this.save())}update_campaign_params(){if(!this.mr){var e=Yc(this.Bt.custom_campaign_params,this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties);Yr(ys(e))||this.register(e),this.mr=!0}}update_search_keyword(){var e;this.register((e=null==Kn?void 0:Kn.referrer)?Wc(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Kc(),$referring_domain:null!=Kn&&Kn.referrer&&(null==(e=Cs(Kn.referrer))?void 0:e.host)||Jc},void 0)}set_initial_person_info(){this.props[mo]||this.props[yo]||this.register_once({[bo]:Qc(this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};vs([yo,mo],(t=>{var r=this.props[t];r&&vs(r,(function(t,r){e["$initial_"+$r(r)]=t}))}));var t,r,i=this.props[bo];if(i){var n=(t=ed(i),r={},vs(t,(function(e,t){r["$initial_"+$r(t)]=e})),r);fs(e,n)}return e}safe_merge(e){return vs(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(e,t,r){if(this.kr=this.Ir=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var r=[...e].sort(),i=[...t].sort();return r.every(((e,t)=>e===i[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var i=this.br(e),n=this.props;this.clear(),this.nr=i,this.props=n,this.save()}}set_disabled(e){this.wr=e,this.wr?this.remove():this.save()}set_cross_subdomain(e){e!==this.Cr&&(this.Cr=e,this.remove(),this.save())}set_secure(e){e!==this.Sr&&(this.Sr=e,this.remove(),this.save())}set_event_timer(e,t){var r=this.props[Fs]||{};r[e]=t,this.Tr(Fs,r),this.save()}remove_event_timer(e){var t=this.props[Fs]||{},r=t[e];return Gr(r)||(delete t[e],this.Tr(Fs,t),this.save()),r}get_property(e){return this.props[e]}set_property(e,t){this.Tr(e,t),this.save()}Tr(e,t){this.props[e]=t}Ar(e){delete this.props[e]}}var vg=cs("[RateLimiter]");class fg{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{vg.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void vg.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,r,i;void 0===e&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(t=null==(r=this.instance.persistence)?void 0:r.get_property(go))&&void 0!==t?t:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var l=1>a.tokens;return l||e||(a.tokens=Math.max(0,a.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(i=this.instance.persistence)||i.set_property(go,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var pg=cs("[RemoteConfig]");class gg{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=ss._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Er(e){var t,r;null!=(t=ss.__PosthogExtensions__)&&t.loadExternalDependency?null==(r=ss.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}Rr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return pg.info("Using preloaded remote config",this.remoteConfig),this.Nr(this.remoteConfig),void this.Mr();if(this._instance.Fr())return void pg.warn("Remote config is disabled. Falling back to local config.");this.Er((e=>{if(!e)return pg.info("No config found after loading remote JS config. Falling back to JSON."),void this.Rr((e=>{this.Nr(e),this.Mr()}));this.Nr(e),this.Mr()}))}catch(e){pg.error("Error loading remote config",e)}}stop(){this.Or&&(clearInterval(this.Or),this.Or=void 0)}refresh(){this._instance.Fr()||"hidden"===(null==Kn?void 0:Kn.visibilityState)||this._instance.reloadFeatureFlags()}Mr(){var e;if(!this.Or){var t=null!==(e=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==e?e:3e5;0!==t&&(this.Or=setInterval((()=>{this.refresh()}),t))}}Nr(e){var t;e||pg.error("Failed to fetch remote config from PostHog."),this._instance.Nr(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}var mg=3e3;class yg{constructor(e,t){this.Pr=!0,this.Lr=[],this.Dr=ui((null==t?void 0:t.flush_interval_ms)||mg,250,5e3,hs.createLogger("flush interval"),mg),this.Br=e}enqueue(e){this.Lr.push(e),this.jr||this.$r()}unload(){this.qr();var e=this.Lr.length>0?this.Zr():{},t=Object.values(e),i=[...t.filter((e=>0===e.url.indexOf("/e"))),...t.filter((e=>0!==e.url.indexOf("/e")))];i.map((e=>{this.Br(r({},e,{transport:"sendBeacon"}))}))}enable(){this.Pr=!1,this.$r()}$r(){var e=this;this.Pr||(this.jr=setTimeout((()=>{if(this.qr(),this.Lr.length>0){var t=this.Zr(),r=function(){var r=t[i],n=(new Date).getTime();r.data&&Vr(r.data)&&vs(r.data,(e=>{e.offset=Math.abs(e.timestamp-n),delete e.timestamp})),e.Br(r)};for(var i in t)r()}}),this.Dr))}qr(){clearTimeout(this.jr),this.jr=void 0}Zr(){var e={};return vs(this.Lr,(t=>{var i,n=t,s=(n?n.batchKey:null)||n.url;Gr(e[s])&&(e[s]=r({},n,{data:[]})),null==(i=e[s].data)||i.push(n.data)})),this.Lr=[],e}}var bg=["retriesPerformedSoFar"];class wg{constructor(e){this.Hr=!1,this.Vr=3e3,this.Lr=[],this._instance=e,this.Lr=[],this.zr=!0,!Gr(Wn)&&"onLine"in Wn.navigator&&(this.zr=Wn.navigator.onLine,this.Ur=()=>{this.zr=!0,this.Yr()},this.Gr=()=>{this.zr=!1},_s(Wn,"online",this.Ur),_s(Wn,"offline",this.Gr))}get length(){return this.Lr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=i(e,bg);ei(t)&&(n.url=mh(n.url,{retry_count:t})),this._instance._send_request(r({},n,{callback:e=>{200===e.statusCode||e.statusCode>=400&&500>e.statusCode||(null!=t?t:0)>=10?null==n.callback||n.callback(e):this.Wr(r({retriesPerformedSoFar:t},n))}}))}Wr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(e){var t=3e3*Math.pow(2,e),r=t/2,i=Math.min(18e5,t),n=Math.random()-.5;return Math.ceil(i+n*(i-r))}(t),i=Date.now()+r;this.Lr.push({retryAt:i,requestOptions:e});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),hs.warn(n),this.Hr||(this.Hr=!0,this.Xr())}Xr(){if(this.Jr&&clearTimeout(this.Jr),0===this.Lr.length)return this.Hr=!1,void(this.Jr=void 0);this.Jr=setTimeout((()=>{this.zr&&this.Lr.length>0&&this.Yr(),this.Xr()}),this.Vr)}Yr(){var e=Date.now(),t=[],r=this.Lr.filter((r=>e>r.retryAt||(t.push(r),!1)));if(this.Lr=t,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.Jr&&(clearTimeout(this.Jr),this.Jr=void 0),this.Hr=!1,Gr(Wn)||(this.Ur&&(Wn.removeEventListener("online",this.Ur),this.Ur=void 0),this.Gr&&(Wn.removeEventListener("offline",this.Gr),this.Gr=void 0)),this.Lr))try{this._instance._send_request(r({},e,{transport:"sendBeacon"}))}catch(e){hs.error(e)}this.Lr=[]}}class _g{constructor(e){this.Kr=()=>{var e,t,r,i;this.Qr||(this.Qr={});var n=this.scrollElement(),s=this.scrollY(),o=n?Math.max(0,n.scrollHeight-n.clientHeight):0,a=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this.Qr.lastScrollY=Math.ceil(s),this.Qr.maxScrollY=Math.max(s,null!==(e=this.Qr.maxScrollY)&&void 0!==e?e:0),this.Qr.maxScrollHeight=Math.max(o,null!==(t=this.Qr.maxScrollHeight)&&void 0!==t?t:0),this.Qr.lastContentY=a,this.Qr.maxContentY=Math.max(a,null!==(r=this.Qr.maxContentY)&&void 0!==r?r:0),this.Qr.maxContentHeight=Math.max(l,null!==(i=this.Qr.maxContentHeight)&&void 0!==i?i:0)},this._instance=e}get ei(){return this._instance.config.scroll_root_selector}getContext(){return this.Qr}resetContext(){var e=this.Qr;return setTimeout(this.Kr,0),e}startMeasuringScrollPosition(){_s(Wn,"scroll",this.Kr,{capture:!0}),_s(Wn,"scrollend",this.Kr,{capture:!0}),_s(Wn,"resize",this.Kr)}scrollElement(){if(!this.ei)return null==Wn?void 0:Wn.document.documentElement;var e=Vr(this.ei)?this.ei:[this.ei];for(var t of e){var r=null==Wn?void 0:Wn.document.querySelector(t);if(r)return r}}scrollY(){if(this.ei){var e=this.scrollElement();return e&&e.scrollTop||0}return Wn&&(Wn.scrollY||Wn.pageYOffset||Wn.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var e=this.scrollElement();return e&&e.scrollLeft||0}return Wn&&(Wn.scrollX||Wn.pageXOffset||Wn.document.documentElement.scrollLeft)||0}}var Ig=e=>Qc(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class Cg{constructor(e,t,r,i){this.ti=e=>{var t=this.ri();if(!t||t.sessionId!==e){var r={sessionId:e,props:this.ii(this._instance)};this.ni.register({[po]:r})}},this._instance=e,this.si=t,this.ni=r,this.ii=i||Ig,this.si.onSessionId(this.ti)}ri(){return this.ni.props[po]}getSetOnceProps(){var e,t=null==(e=this.ri())?void 0:e.props;return t?"r"in t?ed(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 vs(ys(this.getSetOnceProps()),((t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+$r(r)]=t})),e}}class Sg{constructor(){this.oi={}}on(e,t){return this.oi[e]||(this.oi[e]=[]),this.oi[e].push(t),()=>{this.oi[e]=this.oi[e].filter((e=>e!==t))}}emit(e,t){for(var r of this.oi[e]||[])r(t);for(var i of this.oi["*"]||[])i(e,t)}}var xg=cs("[SessionId]");class kg{on(e,t){return this.ai.on(e,t)}constructor(e,t,r){var i;if(this.li=[],this.ui=void 0,this.ai=new Sg,this.hi=(e,t)=>!(!ei(e)||!ei(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Ao)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Bt=e.config,this.ni=e.persistence,this.ci=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=t||Mu,this.fi=r||Mu;var n=this.Bt.persistence_name||this.Bt.token;if(this._sessionTimeoutMs=1e3*ui(this.Bt.session_idle_timeout_seconds||1800,60,36e3,xg.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi="ph_"+n+"_window_id",this.mi="ph_"+n+"_primary_window_exists",this.yi()){var s=Dh.Z(this.gi),o=Dh.Z(this.mi);s&&!o?this.ci=s:Dh.F(this.gi),Dh.M(this.mi,!0)}if(null!=(i=this.Bt.bootstrap)&&i.sessionID)try{var a=(e=>{var t=this.Bt.bootstrap.sessionID.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.bi(this.Bt.bootstrap.sessionID,(new Date).getTime(),a)}catch(e){xg.error("Invalid sessionID in bootstrap",e)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Gr(this.li)&&(this.li=[]),this.li.push(e),this.di&&e(this.di,this.ci),()=>{this.li=this.li.filter((t=>t!==e))}}yi(){return"memory"!==this.Bt.persistence&&!this.ni.wr&&Dh.R()}Ii(e){e!==this.ci&&(this.ci=e,this.yi()&&Dh.M(this.gi,e))}Ci(){return this.ci?this.ci:this.yi()?Dh.Z(this.gi):null}bi(e,t,r){e===this.di&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this.di=e,this.ni.register({[Gs]:[t,e,r]}))}Si(){var e=this.ni.props[Gs];return Vr(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.bi(null,null,null)}destroy(){clearTimeout(this.xi),this.xi=void 0,this.ui&&Wn&&(Wn.removeEventListener(Fo,this.ui,{capture:!1}),this.ui=void 0),this.li=[]}wi(){this.ui=()=>{this.yi()&&Dh.F(this.mi)},_s(Wn,Fo,this.ui,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Bt.cookieless_mode===Ao)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),[i,n,s]=this.Si(),o=this.Ci(),a=ei(s)&&Math.abs(r-s)>864e5,l=!1,u=!n,h=!u&&!e&&this.hi(r,i);u||h||a?(n=this.vi(),o=this.fi(),xg.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}}),s=r,l=!0):o||(o=this.fi(),l=!0);var c=ei(i)&&e&&!a?i:r,d=ei(s)?s:(new Date).getTime();return this.Ii(o),this.bi(n,c,d),e||this.pi(),l&&this.li.forEach((e=>e(n,o,l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:d,changeReason:l?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}pi(){clearTimeout(this.xi),this.xi=setTimeout((()=>{var[e]=this.Si();if(this.hi((new Date).getTime(),e)){var t=this.di;this.resetSessionId(),this.ai.emit("forcedIdleReset",{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}}var Tg=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&Pr(r,t))return!0;try{var i=null==e?void 0:e.userAgentData;if(null!=i&&i.brands&&i.brands.some((e=>Pr(null==e?void 0:e.brand,t))))return!0}catch(e){}return!!e.webdriver},Ag="custom",Eg="i.posthog.com",Rg=/^\/static\//;class Ng{constructor(e){this.ki={},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 flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Eg,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.ki[this.apiHost]||(this.ki[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Ag),this.ki[this.apiHost]}Ti(e){var t=this.instance.config.__preview_external_dependency_versioned_paths;if("string"==typeof t&&Rg.test(e))return t.trim().replace(/\/$/,"")||void 0}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var r=this.Ti(t);if(r)return""+r+t}if(this.region===Ag)return this.apiHost+t;var i=Eg+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var Mg=cs("[PostHog ExternalIntegrations]"),Fg={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Og{constructor(e){this._instance=e}ur(e,t){var r;null==(r=ss.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,(e=>{if(e)return Mg.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var r,n,s;!i||null!=(r=ss.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[t]||e.ur(Fg[t],(()=>{var r;null==(r=ss.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[t])||r.start(e._instance)})),!i&&null!=(n=ss.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[t]&&(null==(s=ss.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[t])||s.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;t(r)}}}var Pg,Lg={},Dg=0,Bg=()=>{},jg='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',$g="Surveys module not available",qg="sanitize_properties is deprecated. Use before_send instead",Zg="Invalid value for property_denylist config: ",Hg="posthog",Vg=!fh&&-1===(null==ns?void 0:ns.indexOf("MSIE"))&&-1===(null==ns?void 0:ns.indexOf("Mozilla")),zg=e=>{var t;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:ws(null==Kn?void 0:Kn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Bg,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,debug:Qn&&Wr(null==Qn?void 0:Qn.search)&&-1!==Qn.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_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Wn||null==(t=Wn.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,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,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){hs.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:No,before_send:void 0,request_queue_config:{flush_interval_ms:mg},error_tracking:{},_onCapture:Bg,__preview_eager_load_replay:!1},(e=>({rageclick:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},Ug=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],Yg=e=>{var t={};for(var[r,i]of Ug)Gr(e[r])||(t[i]=e[r]);var n=fs({},t,e);return Vr(e.property_blacklist)&&(Gr(e.property_denylist)?n.property_denylist=e.property_blacklist:Vr(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:hs.error(Zg+e.property_denylist)),n};class Gg{constructor(){this.__forceAllowLocalhost=!1}get Ai(){return this.__forceAllowLocalhost}set Ai(e){hs.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Wg{Ei(e,t){if(e){var r=this.Ri.indexOf(e);-1!==r&&this.Ri.splice(r,1)}return this.Ri.push(t),null==t.initialize||t.initialize(),t}Ni(){return this.config.cookieless_mode===Ao||this.config.cookieless_mode===To&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){var e;this.webPerformance=new Gg,this.Mi=!1,this.version=ls.LIB_VERSION,this.Fi=new Sg,this.Ri=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=zg(),this.SentryIntegration=ag,this.sentryIntegration=e=>function(e,t){var r=og(e,t);return{name:sg,processEvent:e=>r(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Oi=!1,this.Pi=null,this.Li=null,this.Di=null,this.scrollManager=new _g(this),this.pageViewManager=new lg(this),this.rateLimiter=new fg(this),this.requestRouter=new Ng(this),this.consent=new Qp(this),this.externalIntegrations=new Og(this);var t=null!==(e=Wg.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,r)=>{var i=Wr(e)?{[e]:t}:e;this.setPersonProperties(i),null==r||r({})},set_once:(e,t,r)=>{var i=Wr(e)?{[e]:t}:e;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(e=>hs.info('send "'+(null==e?void 0:e.event)+'"',e)))}init(e,t,r){if(r&&r!==Hg){var i,n=null!==(i=Lg[r])&&void 0!==i?i:new Wg;return n._init(e,t,r),Lg[r]=n,Lg[Hg][r]=n,n}return this._init(e,t,r)}_init(e,t,i){var n,s;if(void 0===t&&(t={}),Gr(e)||Xr(e))return hs.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 console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Bi(t.debug),this.ji=t,this.$i=[],t.person_profiles?this.Li=t.person_profiles:t.process_person&&(this.Li=t.process_person),this.set_config(fs({},zg(t.defaults),Yg(t),{name:i,token:e})),this.config.on_xhr_error&&hs.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Ou;var o=this.qi();this.persistence=new dg(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new dg(r({},this.config,{persistence:"sessionStorage"}),o);var a=r({},this.persistence.props),l=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Zi=new yg((e=>this.Hi(e)),this.config.request_queue_config),this.Vi=new wg(this),this.__request_queue=[];var u=this.Ni();if(u||(this.sessionManager=new kg(this),this.sessionPropsManager=new Cg(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(hs.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.zi(u)}),0)):(hs.info("Initializing extensions synchronously"),this.zi(u)),ls.DEBUG=ls.DEBUG||this.config.debug,ls.DEBUG&&hs.info("Starting in debug mode",{this:this,config:t,thisC:r({},this.config),p:a,s:l}),!this.config.identity_distinct_id||null!=(n=t.bootstrap)&&n.distinctID||(t.bootstrap=r({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=t.bootstrap)?void 0:s.distinctID)){var h=t.bootstrap.distinctID,c=this.get_distinct_id(),d=this.persistence.get_property(fo);if(t.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===Eo)this.identify(h);else if(t.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===Ro)hs.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var v=this.config.get_device_id(Mu()),f=t.bootstrap.isIdentifiedID?v:h;this.persistence.set_property(fo,t.bootstrap.isIdentifiedID?Ro:Eo),this.register({distinct_id:h,$device_id:f})}}if(u)this.register_once({distinct_id:Io,$device_id:null},"");else if(!this.get_distinct_id()){var p=this.config.get_device_id(Mu());this.register_once({distinct_id:p,$device_id:p},""),this.persistence.set_property(fo,Eo)}return _s(Wn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var i=r=>{var i=()=>r.anonymousId()||Mu();e.config.get_device_id=i,r.id()&&(e.register({distinct_id:r.id(),$device_id:i()}),e.persistence.set_property(fo,Ro)),t()},n=r.user();"then"in n&&zr(n.then)?n.then(i):i(n)}(e,(()=>{r.register((e=>{Promise&&Promise.resolve||ng.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,r)=>{if(!r)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(ng.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(ng.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var i=e.calculateEventProperties(r,t.event.properties);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,Oo),identify:e=>t(e,Lo),screen:e=>t(e,"$screen")}})(e)).then((()=>{t()}))}))}(this,(()=>this.Ui())):this.Ui(),zr(this.config._onCapture)&&this.config._onCapture!==Bg&&(hs.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(e=>this.config._onCapture(e.event,e)))),this.config.ip&&hs.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}zi(e){var t,i,n,s,o,a,l,u=performance.now(),h=r({},Wg.__defaultExtensionClasses,this.config.__extensionClasses),c=[];h.featureFlags&&this.Ri.push(this.featureFlags=null!==(t=this.featureFlags)&&void 0!==t?t:new h.featureFlags(this)),h.exceptions&&this.Ri.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new h.exceptions(this)),h.historyAutocapture&&this.Ri.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.Ri.push(new h.tracingHeaders(this)),h.siteApps&&this.Ri.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!e&&this.Ri.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||c.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),h.autocapture&&this.Ri.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.Ri.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new h.surveys(this)),h.logs&&this.Ri.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new h.logs(this)),h.conversations&&this.Ri.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new h.conversations(this)),h.productTours&&this.Ri.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.Ri.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.Ri.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.Ri.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.Ri.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,rg)),h.toolbar&&this.Ri.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new h.toolbar(this)),h.experiments&&this.Ri.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new h.experiments(this)),this.Ri.forEach((e=>{e.initialize&&c.push((()=>{null==e.initialize||e.initialize()}))})),c.push((()=>{if(this.Yi){var e=this.Yi;this.Yi=void 0,this.Nr(e)}})),this.Gi(c,u)}Gi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Gi(e,t)}),0);var r=e.shift();if(r)try{r()}catch(e){hs.error("Error initializing extension:",e)}}var i=Math.round(performance.now()-t);this.register_for_session({[Co]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[So]:i}),this.config.__preview_deferred_init_extensions&&hs.info("PostHog extensions initialized ("+i+"ms)")}Nr(e){var t;if(!Kn||!Kn.body)return hs.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Nr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Yi=e),this.Wi=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Br(e.supportedCompression,Ou)?Ou:Br(e.supportedCompression,Pu)?Pu:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Li?this.Li:No}),this.Ri.forEach((t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e)))}Ui(){try{this.config.loaded(this)}catch(e){hs.critical("`loaded` function failed",e)}if(this.Xi(),this.config.internal_or_test_user_hostname&&null!=Qn&&Qn.hostname){var e=Qn.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ni())&&this.Ji()}),1),this.Ki=new gg(this),this.Ki.load()}Xi(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Zi)||e.enable())}_dom_loaded(){this.is_capturing()&&ds(this.__request_queue,(e=>this.Hi(e))),this.__request_queue=[],this.Xi()}_handle_unload(){var e,t,r,i;null==(e=this.surveys)||e.handlePageUnload(),this.config.request_batching?(this.Qi()&&this.capture(Po),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(r=this.Zi)||r.unload(),null==(i=this.Vi)||i.unload()):this.Qi()&&this.capture(Po,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Vg?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=mh(e.url,{ip:this.config.ip?1:0}),e.headers=r({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,n,s=r({},e);s.timeout=s.timeout||6e4,s.url=_h(s.url,s.compression);var o=null!==(t=s.transport)&&void 0!==t?t:"fetch",a=Ih.filter((e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport))),l=null!==(i=null==(n=function(e,t){for(var r=0;e.length>r;r++)if(t(e[r]))return e[r]}(a,(e=>e.transport===o)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!l)throw new Error("No available transport method");"sendBeacon"!==o&&s.data&&s.compression===Ou&&is&&!gh?wh(s).then((e=>{l(e)})).catch((t=>{if((e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""))(t))return gh=!0,void l(r({},s,{compression:void 0,url:_h(e.url,void 0)}));l(s)})):l(s)})(r({},e,{callback:t=>{var r,i;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,t),null==e.callback||e.callback(t)}}))))}Hi(e){this.Vi?this.Vi.retriableRequest(e):this._send_request(e)}_execute_array(e){Dg++;try{var t,r=[],i=[],n=[];ds(e,(e=>{e&&(Vr(t=e[0])?n.push(e):zr(e)?e.call(this):Vr(e)&&"alias"===t?r.push(e):Vr(e)&&-1!==t.indexOf("capture")&&zr(this[t])?n.push(e):i.push(e))}));var s=function(e,t){ds(e,(function(e){if(Vr(e[0])){var r=t;vs(e,(function(e){r=r[e[0]].apply(r,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}))};s(r,this),s(i,this),s(n,this)}finally{Dg--}}push(e){if(Dg>0&&Vr(e)&&Wr(e[0])){var t=Wg.prototype[e[0]];zr(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var n,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Zi){if(this.is_capturing())if(!Gr(e)&&Wr(e)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var h=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==h||!h.isRateLimited){null!=t&&t.$current_url&&!Wr(null==t?void 0:t.$current_url)&&(hs.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.en||hs.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),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 c=new Date,d=(null==i?void 0:i.timestamp)||c,v=Mu(),f={uuid:v,event:e,properties:this.calculateEventProperties(e,t||{},d,v)};e===Oo&&this.config.__preview_capture_bot_pageviews&&u&&(f.event="$bot_pageview",f.properties.$browser_type="bot"),h&&(f.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens),(null==i?void 0:i.$set)&&(f.$set=null==i?void 0:i.$set);var p=this.tn(null==i?void 0:i.$set_once,e!==Do,e===Lo);if(p&&(f.$set_once=p),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=f,a=e=>Wr(e)?e.slice(0,s):e,l=new Set,f=function e(t,r){return t!==Object(t)?a?a(t):t:l.has(t)?void 0:(l.add(t),Vr(t)?(i=[],ds(t,(t=>{i.push(e(t))}))):(i={},vs(t,((t,r)=>{l.has(t)||(i[r]=e(t,r))}))),i);var i}(o)),f.timestamp=d,Gr(null==i?void 0:i.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=c),e===ru.DISMISSED||e===ru.SENT){var g=null==t?void 0:t[iu.SURVEY_ID],m=null==t?void 0:t[iu.SURVEY_ITERATION];Su({id:g,current_iteration:m}),f.$set=r({},f.$set,{[lu({id:g,current_iteration:m},e===ru.SENT?"responded":"dismissed")]:!0})}else e===ru.SHOWN&&(f.$set=r({},f.$set,{[iu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===e){var y=null==t?void 0:t.$product_tour_type;y&&(f.$set=r({},f.$set,{["$product_tour_last_seen_date/"+y]:(new Date).toISOString()}))}var b=r({},f.properties.$set,f.$set);if(Yr(b)||this.setPersonPropertiesForFlags(b),!Kr(this.config.before_send)){var w=this.rn(f);if(!w)return;f=w}this.Fi.emit("eventCaptured",f);var _={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:f,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Hi(_):this.Zi.enqueue(_),f}hs.critical("This capture call is ignored due to client rate limiting.")}}else hs.error("No event name provided to posthog.capture")}else hs.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(t=>e(t.event,t)))}calculateEventProperties(e,t,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var o=s?void 0:this.persistence.remove_event_timer(e),a=r({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Ni()&&(a.$cookieless_mode=!0),"$snapshot"===e){var l=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!Wr(a.distinct_id)&&!Qr(a.distinct_id)||Xr(a.distinct_id))&&hs.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=function(e,t){var r,i,n,s;if(!ns)return{};var o,a=e?[...Hc,...t||[]]:[],[l,u]=function(e){for(var t=0;un.length>t;t++){var[r,i]=un[t],n=r.exec(e),s=n&&(zr(i)?i(n,e):i);if(s)return s}return["",""]}(ns);return fs(ys({$os:l,$os_version:u,$browser:on(ns,navigator.vendor),$device:hn(ns),$device_type:cn(ns,{userAgentDataPlatform:null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,maxTouchPoints:null==(i=navigator)?void 0:i.maxTouchPoints,screenWidth:null==Wn||null==(n=Wn.screen)?void 0:n.width,screenHeight:null==Wn||null==(s=Wn.screen)?void 0:s.height,devicePixelRatio:null==Wn?void 0:Wn.devicePixelRatio}),$timezone:td(),$timezone_offset:rd()}),{$current_url:ks(null==Qn?void 0:Qn.href,a,zc),$host:null==Qn?void 0:Qn.host,$pathname:null==Qn?void 0:Qn.pathname,$raw_user_agent:ns.length>1e3?ns.substring(0,997)+"...":ns,$browser_version:ln(ns,navigator.vendor),$browser_language:Xc(),$browser_language_prefix:(o=Xc(),"string"==typeof o?o.split("-")[0]:void 0),$screen_height:null==Wn?void 0:Wn.screen.height,$screen_width:null==Wn?void 0:Wn.screen.width,$viewport_height:null==Wn?void 0:Wn.innerHeight,$viewport_width:null==Wn?void 0:Wn.innerWidth,$lib:ls.LIB_NAME,$lib_version:ls.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&fs(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&fs(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.Vi)?void 0:v.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Ag&&(a.$lib_custom_api_host=this.config.api_host),u=e!==Oo||s?e!==Po||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=fs(a,u),e===Oo&&Kn&&(a.title=Kn.title),!Gr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}ns&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=fs({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Vr(this.config.property_denylist)?vs(this.config.property_denylist,(function(e){delete a[e]})):hs.error(Zg+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(hs.error(qg),a=p(a,e));var g=this.nn();return a.$process_person_profile=g,g&&!s&&this.sn("_calculate_event_properties"),a}tn(e,t,r){var i;if(void 0===t&&(t=!0),void 0===r&&(r=!1),!this.persistence||!this.nn())return e;if(this.Mi&&!r)return e;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=fs({},n,s||{},e||{}),a=this.config.sanitize_properties;return a&&(hs.error(qg),o=a(o,"$set_once")),t&&(this.Mi=!0),Yr(o)?void 0:o}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var i;null==(i=this.persistence)||i.register_once(e,t,r)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}an(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){var r;return null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,r){var i;null==(i=this.featureFlags)||i.updateFlags(e,t,r)}updateEarlyAccessFeatureEnrollment(e,t,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){var i;return void 0===t&&(t=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(e,t,r)}on(e,t){return this.Fi.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:$g}),()=>{})}onSessionId(e){var t,r;return null!==(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:$g})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:$g})}renderSurvey(e,t){var r;null==(r=this.surveys)||r.renderSurvey(e,t)}displaySurvey(e,t){var r;void 0===t&&(t=ku),null==(r=this.surveys)||r.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,r;return null!==(t=null==(r=this.surveys)?void 0:r.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:$g}}canRenderSurveyAsync(e,t){var r,i;return void 0===t&&(t=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(e,t))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:$g})}ln(e){return!e||Xr(e)?(hs.critical("Unique user id has not been set in posthog.identify"),!1):e===Io?(hs.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(hs.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,r){if(!this.__loaded||!this.persistence)return hs.uninitializedWarning("posthog.identify");if(Qr(e)&&(e=e.toString(),hs.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.ln(e)&&this.sn("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Ns)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),e!==i&&e!==this.get_property(Ms)&&(this.unregister(Ms),this.register({distinct_id:e}));var n,s=(this.persistence.get_property(fo)||Eo)===Eo;e!==i&&s?(this.persistence.set_property(fo,Ro),this.setPersonPropertiesForFlags({$set:t||{},$set_once:r||{}},!1),this.capture(Lo,{distinct_id:e,$anon_distinct_id:i},{$set:t||{},$set_once:r||{}}),this.Di=Sh(e,t,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(t||r)&&this.setPersonProperties(t,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(uo))}}setPersonProperties(e,t){if((e||t)&&this.sn("posthog.setPersonProperties")){var r=Sh(this.get_distinct_id(),e,t);this.Di!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Di=r):hs.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){var n=this.getGroups(),s=n[e]!==t;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r({},n,{[e]:t})}),s||i){var o={$group_type:e,$group_key:t};i&&(o.$group_set=i),this.capture(Do,o)}i&&this.setGroupPropertiesForFlags({[e]:i}),s&&!i&&this.reloadFeatureFlags()}else hs.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){var e;null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),this.sn("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t,r,i,n,s,o,a,l;if(hs.info("reset"),!this.__loaded)return hs.uninitializedWarning("posthog.reset");var u=this.get_property(Ns);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),null==(i=this.surveys)||i.reset(),null==(n=this.Ki)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.persistence)||a.set_property(fo,Eo),null==(l=this.sessionManager)||l.resetSessionId(),this.Di=null,this.config.cookieless_mode===Ao)this.register_once({distinct_id:Io,$device_id:null},"");else{var h=this.config.get_device_id(Mu());this.register_once({distinct_id:h,$device_id:e?h:u},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var r;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(r=this.conversations)||r.un()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.hn()}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.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),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&r){var n,s=null!==(n=e.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i}alias(e,t){return e===this.get_property(Rs)?(hs.critical("Attempting to create alias for existing People user - aborting."),-2):this.sn("posthog.alias")?(Gr(t)&&(t=this.get_distinct_id()),e!==t?(this.an(Ms,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(hs.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=r({},this.config);if(Ur(e)){var i,n,s,o,a,l,u,h,c,d;fs(this.config,Yg(e));var v=this.qi();null==(i=this.persistence)||i.update_config(this.config,t,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new dg(r({},this.config,{persistence:"sessionStorage"}),v);var f=this.Bi(this.config.debug);ti(f)&&(this.config.debug=f),ti(this.config.debug)&&(this.config.debug?(ls.DEBUG=!0,Mh.R()&&Mh.M("ph_debug",!0),hs.info("set_config",{config:e,oldConfig:t,newConfig:r({},this.config)})):(ls.DEBUG=!1,Mh.R()&&Mh.F("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(h=this.deadClicksAutocapture)||h.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.cn(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){ls.LIB_NAME=e,ls.LIB_VERSION=t}startSessionRecording(e){var t,r,i,n,s,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.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)||!e.started)}captureException(e,t){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,t))}}addExceptionStep(e,t){var r;null==(r=this.exceptions)||r.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!==(e=null==(t=this.logs)?void 0:t.logger)&&void 0!==e?e:Wg.dn}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,r;return null!==(t=null==(r=this.toolbar)?void 0:r.loadToolbar(e))&&void 0!==t&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:Hg;return t!==Hg&&(t=Hg+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(fo))===Ro||(null==(t=this.sessionPersistence)?void 0:t.get_property(fo))===Ro}nn(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===No&&!this._isIdentified()&&Yr(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[Ms])&&(null==(t=this.persistence)||null==(t=t.props)||!t[wo]))}Qi(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.nn()||this.sn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.sn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}sn(e){return"never"===this.config.person_profiles?(hs.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.an(wo,!0),!0)}qi(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==To)}cn(){var e,t,r,i,n=this.qi();return(null==(e=this.persistence)?void 0:e.wr)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(t=this.sessionPersistence)?void 0:t.wr)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==Ao){if(this.Ni()){var r,i,n,s,o;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new kg(this),this.pageViewManager=new lg(this),this.persistence&&(this.sessionPropsManager=new Cg(this,this.sessionManager,this.persistence));var a,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=Wg.__defaultExtensionClasses)?void 0:o.sessionRecording;l&&(this.sessionRecording=this.Ei(this.sessionRecording,new l(this)),this.Wi&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.Wi)))}var u,h;this.consent.optInOut(!0),this.cn(),this.Xi(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==To&&(null==(u=this.surveys)||u.loadIfEnabled()),(Gr(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(h=null==e?void 0:e.captureEventName)&&void 0!==h?h:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ji()}else hs.warn(jg)}opt_out_capturing(){var e,t,r;this.config.cookieless_mode!==Ao?(this.config.cookieless_mode===To&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===To&&(this.register({distinct_id:Io,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(r=this.sessionRecording)||r.stopRecording(),this.sessionRecording=void 0,this.Ji())):hs.warn(jg)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Ao||(this.config.cookieless_mode===To?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return Jn?Tg(Jn,this.config.custom_blocked_useragents):void 0}Ji(){Kn&&("visible"===Kn.visibilityState?this.Oi||(this.Oi=!0,this.capture(Oo,{title:Kn.title},{send_instantly:!0}),this.Pi&&(Kn.removeEventListener(Mo,this.Pi),this.Pi=null)):this.Pi||(this.Pi=this.Ji.bind(this),_s(Kn,Mo,this.Pi)))}debug(e){!1===e?(null==Wn||Wn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Wn||Wn.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)`."),this.set_config({debug:!0}))}Fr(){var e,t,r,i,n,s,o=this.ji||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(hs.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",!1,i=hs,n=(t="advanced_disable_flags")in(e=o)&&!Kr(e[t]),s=r in e&&!Kr(e[r]),n?e[t]:!!s&&(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[r]))}rn(e){if(Kr(this.config.before_send))return e;var t=Vr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of t){if(r=i(r),Kr(r)){var n="Event '"+e.event+"' was rejected in beforeSend function";return Br(Dr,e.event)?hs.warn(n+". This can cause unexpected behavior."):hs.info(n),null}r.properties&&!Yr(r.properties)||hs.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return null==(e=this.pageViewManager.dr)?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)})}Bi(e){var t=ti(e)&&!e,r=Mh.R()&&"true"===Mh.O("ph_debug");return!t&&(!!r||e)}}Wg.__defaultExtensionClasses={},Wg.dn={trace:Pg=()=>{},debug:Pg,info:Pg,warn:Pg,error:Pg,fatal:Pg},function(e,t){for(var r=0;t.length>r;r++)e.prototype[t[r]]=ms(e.prototype[t[r]])}(Wg,["identify"]);var Xg=cs("[ExceptionAutocapture]"),Jg=cs("[TracingHeaders]"),Kg=cs("[Web Vitals]"),Qg=9e5,em="disabled",tm="lazy_loading",rm="awaiting_config",im="missing_config";cs("[SessionRecording]"),cs("[SessionRecording]");var nm="[SessionRecording]",sm=cs(nm),om=cs("[Heatmaps]");function am(e){return Ur(e)&&"clientX"in e&&"clientY"in e&&Qr(e.clientX)&&Qr(e.clientY)}var lm=cs("[Product Tours]"),um=["$set_once","$set"],hm=cs("[SiteApps]"),cm="Error while initializing PostHog app with config id ";function dm(e,t,r){if(Kr(e))return!1;switch(r){case"exact":return e===t;case"contains":var i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class vm{constructor(e){this.vn=new Sg,this.fn=(e,t)=>this.pn(e,t)&&this.gn(e,t)&&this.mn(e,t)&&this.yn(e,t),this.pn=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.bn=new Set,this.wn=new Set}init(){var e,t;Gr(null==(e=this._instance)?void 0:e._addCaptureHook)||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.on(e,t)})))}register(e){var t,r;if(!Gr(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach((e=>{var t,r;null==(t=this.wn)||t.add(e),null==(r=e.steps)||r.forEach((e=>{var t;null==(t=this.bn)||t.add((null==e?void 0:e.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,n=new Set;e.forEach((e=>{var t;null==(t=e.steps)||t.forEach((e=>{null!=e&&e.selector&&n.add(null==e?void 0:e.selector)}))})),null==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(e,t){var r;null!=t&&0!=e.length&&(this.bn.has(e)||this.bn.has(null==t?void 0:t.event))&&this.wn&&(null==(r=this.wn)?void 0:r.size)>0&&this.wn.forEach((e=>{this._n(t,e)&&this.vn.emit("actionCaptured",e.name)}))}In(e){this.onAction("actionCaptured",(t=>e(t)))}_n(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this.fn(e,r))return!0;return!1}onAction(e,t){return this.vn.on(e,t)}gn(e,t){if(null!=t&&t.url){var r,i=null==e||null==(r=e.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!dm(i,t.url,t.url_matching||"contains"))return!1}return!0}mn(e,t){return!!this.Cn(e,t)&&!!this.Sn(e,t)&&!!this.xn(e,t)}Cn(e,t){var r;if(null==t||!t.href)return!0;var i=this.kn(e);if(i.length>0)return i.some((e=>dm(e.href,t.href,t.href_matching||"exact")));var n,s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!s&&dm((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}Sn(e,t){var r;if(null==t||!t.text)return!0;var i=this.kn(e);if(i.length>0)return i.some((e=>dm(e.text,t.text,t.text_matching||"exact")||dm(e.$el_text,t.text,t.text_matching||"exact")));var n,s,o,a=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(e){for(var t,r=[],i=/(?::|")text="(.*?)"/g;!Kr(t=i.exec(e));)r.includes(t[1])||r.push(t[1]);return r}(a),s=t.text,o=t.text_matching||"exact",n.some((e=>dm(e,s,o))))}xn(e,t){var r,i;if(null==t||!t.selector)return!0;var n=null==e||null==(r=e.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(t.selector))return!0;var s=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";if(t.selector_regex&&s)try{return new RegExp(t.selector_regex).test(s)}catch(e){return!1}return!1}kn(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}yn(e,t){return null==t||!t.properties||0===t.properties.length||Th(t.properties.reduce(((e,t)=>{var r=Vr(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:r,operator:t.operator||"exact"},e}),{}),null==e?void 0:e.properties)}}class fm{constructor(e){this._instance=e,this.Tn=new Map,this.An=new Map,this.En=new Map}Rn(e,t){return!!e&&Th(e.propertyFilters,null==t?void 0:t.properties)}Nn(e,t){var r=new Map;return e.forEach((e=>{var i;null==(i=e.conditions)||null==(i=i[t])||null==(i=i.values)||i.forEach((t=>{if(null!=t&&t.name){var i=r.get(t.name)||[];i.push(e.id),r.set(t.name,i)}}))})),r}Mn(e,t,r){var i=(r===Yl?this.Tn:this.An).get(e),n=[];return this.Fn((e=>{n=e.filter((e=>null==i?void 0:i.includes(e.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((t=>t.name===e));return this.Rn(s,t)}))}register(e){var t;Gr(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.On(e),this.Pn(e))}Pn(e){var t=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));0!==t.length&&(null==this.Ln&&(this.Ln=new vm(this._instance),this.Ln.init(),this.Ln.In((e=>{this.onAction(e)}))),t.forEach((e=>{var t,r,i,n,s;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(r=e.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Ln)||n.register(e.conditions.actions.values),null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((t=>{if(t&&t.name){var r=this.En.get(t.name);r&&r.push(e.id),this.En.set(t.name,r||[e.id])}})))})))}On(e){var t,r=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.events)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=e.filter((e=>{var t,r;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(r=e.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));0===r.length&&0===i.length||(null==(t=this._instance)||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this.Tn=this.Nn(e,Yl),this.An=this.Nn(e,Gl))}onEvent(e,t){var r,i=this.le(),n=this.Dn(),s=this.Bn(),o=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(s===e&&t&&o.length>0){var a,l;i.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:o});var u=(null==t||null==(a=t.properties)?void 0:a.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(u){var h=o.indexOf(u);0>h||(o.splice(h,1),this.jn(o))}}else{if(this.An.has(e)){var c=this.Mn(e,t,Gl);c.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:c.map((e=>e.id))}),c.forEach((e=>{var t=o.indexOf(e.id);0>t||o.splice(t,1),this.$n(e.id)})),this.jn(o))}if(this.Tn.has(e)){i.info("event name matched",{event:e,eventPayload:t,items:this.Tn.get(e)});var d=this.Mn(e,t,Yl);this.jn(o.concat(d.map((e=>e.id))||[]))}}}onAction(e){var t,r=this.Dn(),i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[r])||[];this.En.has(e)&&this.jn(i.concat(this.En.get(e)||[]))}jn(e){var t=this.le(),r=[...new Set(e)].filter((e=>!this.qn(e)));t.info("updating activated items",{activatedItems:r}),this.Zn(r)}getActivatedIds(){var e,t=this.Dn();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getEventToItemsMap(){return this.Tn}Hn(){return this.Ln}}class pm extends fm{constructor(e){super(e)}Dn(){return ao}Bn(){return ru.SHOWN}Fn(e){var t;null==(t=this._instance)||t.getSurveys(e)}$n(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}le(){return gu}Zn(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[ao]:e})}qn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var gm="SDK is not enabled or survey functionality is not yet loaded",mm="Disabled. Not loading surveys.",ym=null!=Wn&&Wn.location?Ts(Wn.location.hash,"__posthog")||Ts(location.hash,"state"):null,bm="_postHogToolbarParams",wm=cs("[Toolbar]"),_m=cs("[FeatureFlags]"),Im=cs("[FeatureFlags]",{debugEnabled:!0}),Cm="\" failed. Feature flags didn't load in time.",Sm=e=>{for(var t={},r=0;e.length>r;r++)t[e[r]]=!0;return t},xm=e=>{var t={};for(var[r,i]of ps(e||{}))i&&(t[r]=i);return t},km="Refusing to render web experiment since the viewer is a likely bot",Tm={icontains:(e,t)=>!!Wn&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!Wn&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!Wn&&Ch(t.href,e),not_regex:(e,t)=>!!Wn&&!Ch(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Am{get Bt(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments((e=>{Am.Vn("retrieved web experiments from the server"),t.zn=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;t.zn&&(Am.Vn("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=t.zn)||r.set(e.feature_flag_key,e));var i=t._instance.getFeatureFlag(e.feature_flag_key);Wr(i)&&e.variants[i]&&t.Un(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var n in e.variants){var s=e.variants[n];Am.Yn(s)&&t.Un(e.name,n,s.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Am.Vn(km);else if(!this.Bt.disable_web_experiments){if(Kr(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Am.Vn("applying feature flags",e),e.forEach((e=>{var t;if(this.zn&&null!=(t=this.zn)&&t.has(e)){var r,i=this._instance.getFeatureFlag(e),n=null==(r=this.zn)?void 0:r.get(e);i&&null!=n&&n.variants[i]&&this.Un(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var e=Am.getWindowLocation();if(null!=e&&e.search){var t=xs(null==e?void 0:e.search,"__experiment_id"),r=xs(null==e?void 0:e.search,"__experiment_variant");t&&r&&(Am.Vn("previewing web experiments "+t+" && "+r),this.getWebExperiments((e=>{this.Gn(parseInt(t),r,e)}),!1,!0))}}loadIfEnabled(){this.Bt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.Bt.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Bt.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Gn(e,t,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(Am.Vn("Previewing web experiment ["+i[0].name+"] with variant ["+t+"]"),this.Un(i[0].name,t,i[0].variants[t].transforms))}static Yn(e){return!Kr(e.conditions)&&Am.Wn(e)&&Am.Xn(e)}static Wn(e){var t;if(Kr(e.conditions)||Kr(null==(t=e.conditions)?void 0:t.url))return!0;var r,i,n,s=Am.getWindowLocation();return!!s&&(null==(r=e.conditions)||!r.url||Tm[null!==(i=null==(n=e.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](e.conditions.url,s))}static getWindowLocation(){return null==Wn?void 0:Wn.location}static Xn(e){var t;if(Kr(e.conditions)||Kr(null==(t=e.conditions)?void 0:t.utm))return!0;var r=Yc();if(r.utm_source){var i,n,s,o,a,l,u,h,c=null==(i=e.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=e.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.utm_campaign,d=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==r.utm_source,v=null==(a=e.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,f=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return c&&v&&f&&d}return!1}static Vn(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;t>i;i++)r[i-1]=arguments[i];hs.info("[WebExperiments] "+e,r)}Un(e,t,r){this._is_bot()?Am.Vn(km):"control"!==t?r.forEach((r=>{if(r.selector){var i;Am.Vn("applying transform of variant "+t+" for experiment "+e+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)}))}})):Am.Vn("Control variants leave the page unmodified.")}_is_bot(){return Jn&&this._instance?Tg(Jn,this.Bt.custom_blocked_useragents):void 0}}var Em,Rm,Nm=cs("[Conversations]"),Mm="Conversations not available yet.",Fm={featureFlags:class{constructor(e){this.Jn=!1,this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Bt(){return this._instance.config}get ni(){return this._instance.persistence}os(e){return this._instance.get_property(e)}ls(){var e,t;return null!==(e=null==(t=this.ni)?void 0:t._r(this.Bt.feature_flag_cache_ttl_ms))&&void 0!==e&&e}us(){return!!this.ls()&&(this.ss||this.Qn||(this.ss=!0,_m.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}hs(){var e,t=null!==(e=this.Bt.evaluation_contexts)&&void 0!==e?e:this.Bt.evaluation_environments;return!this.Bt.evaluation_environments||this.Bt.evaluation_contexts||this.ns||(_m.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ns=!0),null!=t&&t.length?t.filter((e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||_m.error("Invalid evaluation context found:",e,"Expected non-empty string"),t})):[]}cs(){return this.hs().length>0}initialize(){var e,t,{config:r}=this._instance,i=null!==(e=null==(t=r.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((e=>!!i[e])).reduce(((e,t)=>(e[t]=i[t]||!1,e)),{}),l=Object.keys(o).filter((e=>a[e])).reduce(((e,t)=>(o[t]&&(e[t]=o[t]),e)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,i){var n=null!=i&&i.merge?this.getFlagVariants():{},s=null!=i&&i.merge?this.getFlagPayloads():{},o=r({},n,e),a=r({},s,t),l={};for(var[u,h]of Object.entries(o)){var c="string"==typeof h;l[u]={key:u,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:Gr(null==a?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.receivedFeatureFlags({flags:l})}get hasLoadedFlags(){return this.Kn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.os(Qs),t=this.os(ro),i=this.os(io);if(!i&&!t)return e||{};var n=fs({},e||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var o of s){var a,l,u=n[o],h=null==t?void 0:t[o],c=Gr(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,d=Gr(h)?u.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[o],f=r({},u,{enabled:c,variant:c?null!=d?d:null==u?void 0:u.variant:void 0});c!==(null==u?void 0:u.enabled)&&(f.original_enabled=null==u?void 0:u.enabled),d!==(null==u?void 0:u.variant)&&(f.original_variant=null==u?void 0:u.variant),v&&(f.metadata=r({},null==u?void 0:u.metadata,{payload:v,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload})),n[o]=f}return this.Jn||(_m.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:n}),this.Jn=!0),n}getFlagVariants(){var e=this.os(Xs),t=this.os(ro);if(!t)return e||{};for(var r=fs({},e),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this.Jn||(_m.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this.Jn=!0),r}getFlagPayloads(){var e=this.os(eo),t=this.os(io);if(!t)return e||{};for(var r=fs({},e||{}),i=Object.keys(t),n=0;i.length>n;n++)r[i[n]]=t[i[n]];return this.Jn||(_m.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this.Jn=!0),r}reloadFeatureFlags(){this.es||this.Bt.advanced_disable_feature_flags||this.ds||(this._instance.Fi.emit("featureFlagsReloading",!0),this.ds=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.ds),this.ds=void 0}ensureFlagsLoaded(){this.Kn||this.Qn||this.ds||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.es=e}vs(e){var t;if(this.fs(),!this._instance.Fr())if(this.Qn)this.ts=!0;else{var i=this.Bt.token,n=this.os(Ns),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(t=this.ni)?void 0:t.get_initial_props())||{},this.os(no)||{}),group_properties:this.os(so),timezone:td()};Jr(n)||Gr(n)||(s.$device_id=n),(null!=e&&e.disableFlags||this.Bt.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.cs()&&(s.evaluation_contexts=this.hs());var o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Bt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Qn=!0,this._instance._send_request({method:"POST",url:o,data:s,compression:this.Bt.disable_compression?void 0:Pu,timeout:this.Bt.feature_flag_request_timeout_ms,callback:e=>{var t,r,i,n=!0;if(200===e.statusCode&&(this.ts||(this.$anon_distinct_id=void 0),n=!1),this.Qn=!1,!s.disable_flags||this.ts){this.rs=!n;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var a,l=!(null==(r=e.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(l&&o.push("quota_limited"),null==(i=this.ni)||i.register({[co]:o}),l)_m.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.");else s.disable_flags||this.receivedFeatureFlags(null!==(a=e.json)&&void 0!==a?a:{},n,{partialResponse:!!this.Bt.advanced_only_evaluate_survey_feature_flags}),this.ts&&(this.ts=!1,this.vs())}}})}}getFeatureFlag(e,t){var r;if(void 0===t&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var i=this.getFeatureFlagResult(e,t);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else _m.warn('getFeatureFlag for key "'+e+Cm)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var r=this.getFlagVariants(),i=e in r,n=r[e],s=this.getFlagPayloads()[e],o=String(n),a=this.os(to)||void 0,l=this.os(vo)||void 0,u=this.os(uo)||{};if(this.Bt.advanced_feature_flags_dedup_per_session){var h,c=this._instance.get_session_id(),d=this.os(ho);c&&c!==d&&(u={},null==(h=this.ni)||h.register({[uo]:u,[ho]:c}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){var v,f,p,g,m,y,b,w,_,I;Vr(u[e])?u[e].push(o):u[e]=[o],null==(v=this.ni)||v.register({[uo]:u});var C=this.getFeatureFlagDetails(e),S=[...null!==(f=this.os(co))&&void 0!==f?f:[]];Gr(n)&&S.push("flag_missing");var x={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this.Bt.bootstrap)||null==(p=p.featureFlags)?void 0:p[e])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Bt.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[e])||null,$used_bootstrap_value:!this.rs};Gr(null==C||null==(m=C.metadata)?void 0:m.version)||(x.$feature_flag_version=C.metadata.version);var k,T=null!==(y=null==C||null==(b=C.reason)?void 0:b.description)&&void 0!==y?y:null==C||null==(w=C.reason)?void 0:w.code;T&&(x.$feature_flag_reason=T),null!=C&&null!=(_=C.metadata)&&_.id&&(x.$feature_flag_id=C.metadata.id),Gr(null==C?void 0:C.original_variant)&&Gr(null==C?void 0:C.original_enabled)||(x.$feature_flag_original_response=Gr(C.original_variant)?C.original_enabled:C.original_variant),null!=C&&null!=(I=C.metadata)&&I.original_payload&&(x.$feature_flag_original_payload=null==C||null==(k=C.metadata)?void 0:k.original_payload),S.length&&(x.$feature_flag_error=S.join(",")),this._instance.capture("$feature_flag_called",x)}if(i){var A=s;if(!Gr(s))try{A=JSON.parse(s)}catch(e){}return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:A}}}}else _m.warn('getFeatureFlagResult for key "'+e+Cm)}getRemoteConfigPayload(e,t){var r=this.Bt.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.cs()&&(i.evaluation_contexts=this.hs()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.Bt.disable_compression?void 0:Pu,timeout:this.Bt.feature_flag_request_timeout_ms,callback(r){var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;t((null==n?void 0:n[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.rs){if(this.Kn||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,t);return Gr(r)?void 0:!!r}_m.warn('isFeatureEnabled for key "'+e+Cm)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,i){if(this.ni){this.Kn=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(e,t,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(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.payload})).map((e=>{var r;return[e,null==(r=t[e].metadata)?void 0:r.payload]})))):_m.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e),l=a.flags,u=a.featureFlags,h=a.featureFlagPayloads;if(u){var c=e.requestId,d=e.evaluatedAt;if(Vr(u)){_m.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(u)for(var f=0;u.length>f;f++)v[u[f]]=!0;t&&t.register({[Js]:u,[Xs]:v})}else{var p=u,g=h,m=l;if(null!=o&&o.partialResponse)p=r({},i,p),g=r({},n,g),m=r({},s,m);else if(e.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter((e=>{var t;return!(null!=(t=l[e])&&t.failed)})));p=r({},i,Object.fromEntries(Object.entries(p).filter((e=>{var[t]=e;return y.has(t)})))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((e=>{var[t]=e;return y.has(t)})))),m=r({},s,Object.fromEntries(Object.entries(m||{}).filter((e=>{var[t]=e;return y.has(t)}))))}else p=r({},i,p),g=r({},n,g),m=r({},s,m);t&&t.register(r({[Js]:Object.keys(xm(p)),[Xs]:p||{},[eo]:g||{},[Qs]:m||{}},c?{[to]:c}:{},d?{[vo]:d}:{}))}}}(e,this.ni,n,s,o,i),t||(this.ss=!1),this.ps(t)}}override(e,t){void 0===t&&(t=!1),_m.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.ni)return _m.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.ni.unregister(ro),this.ni.unregister(io),this.ps(),Im.info("All overrides cleared");if(Vr(e)){var t=Sm(e);return this.ni.register({[ro]:t}),this.ps(),Im.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var r,i=e;if(this.Jn=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.ni.unregister(ro),Im.info("Flag overrides cleared");else if(i.flags){if(Vr(i.flags)){var n=Sm(i.flags);this.ni.register({[ro]:n})}else this.ni.register({[ro]:i.flags});Im.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.ni.unregister(io),Im.info("Payload overrides cleared")):i.payloads&&(this.ni.register({[io]:i.payloads}),Im.info("Payload overrides set",{payloads:i.payloads}))),void this.ps()}if(e&&"object"==typeof e)return this.ni.register({[ro]:e}),this.ps(),Im.info("Flag overrides set",{flags:e});_m.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Kn){var{flags:t,flagVariants:r}=this.gs();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var n,s=(this.os(Ks)||[]).find((t=>t.flagKey===e)),o={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:o};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=r({},this.getFlagVariants(),{[e]:t});null==(n=this.ni)||n.register({[Js]:Object.keys(xm(l)),[Xs]:l}),this.ps()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var i=this.os(Ks),n=r?"&"+r.map((e=>"stage="+e)).join("&"):"";if(i&&!t)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Bt.token+n),method:"GET",callback:t=>{var r,i;if(t.json){var n=t.json.earlyAccessFeatures;return null==(r=this.ni)||r.unregister(Ks),null==(i=this.ni)||i.register({[Ks]:n}),e(n)}}})}gs(){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)),{})}}ps(e){var{flags:t,flagVariants:r}=this.gs();this.featureFlagEventHandlers.forEach((i=>i(t,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.os(no)||{},n=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._instance.register({[no]:r({},i,o,n)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(no)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.os(so)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((t=>{i[t]=r({},i[t],e[t]),delete e[t]})),this._instance.register({[so]:r({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.os(so)||{};this._instance.register({[so]:r({},t,{[e]:{}})})}else this._instance.unregister(so)}reset(){this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.fs(),this.Jn=!1}}},Om={sessionRecording:class{get Bt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var e;return!(null==(e=this.ys)||!e.isStarted)}get status(){var e,t;return this.bs===rm||this.bs===im?this.bs:null!==(e=null==(t=this.ys)?void 0:t.status)&&void 0!==e?e:this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=em,this.ws=void 0,this._instance=e,!this._instance.sessionManager)throw sm.error("started without valid sessionManager"),new Error(nm+" started without valid sessionManager. This is a bug.");if(this.Bt.cookieless_mode===Ao)throw new Error(nm+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get _s(){var e,t=!(null==(e=this._instance.get_property(Hs))||!e.enabled),r=!this.Bt.disable_session_recording,i=this.Bt.disable_session_recording||this._instance.consent.isOptedOut();return Wn&&t&&r&&!i}startIfEnabledOrStop(e){var t;if(!this._s||null==(t=this.ys)||!t.isStarted){var r=!Gr(Object.assign)&&!Gr(Array.from);this._s&&r?(this.Is(e),sm.info("starting")):(this.bs=em,this.stopRecording())}}Is(e){var t,r,i;this._s&&(this.bs!==rm&&this.bs!==im&&(this.bs=tm),null!=ss&&null!=(t=ss.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=ss.__PosthogExtensions__)&&r.initSessionRecording?this.Cs(e):null==(i=ss.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Ss,(t=>{if(t)return sm.error("could not load recorder",t);this.Cs(e)})))}stopRecording(){var e,t;null==(e=this.ws)||e.call(this),this.ws=void 0,null==(t=this.ys)||t.stop()}xs(){var e,t;null==(e=this.ws)||e.call(this),this.ws=void 0,null==(t=this.ys)||t.discard()}ks(){var e;null==(e=this.ni)||e.unregister(Ws)}Ts(e,t){if(Kr(e))return null;var r,i=Qr(e)?e:parseFloat(e);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(sm.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}As(e){if(this.ni){var t,i,n=this.ni,s=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this.Ts(null==(t=this.Bt.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),o=this.Ts(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;Kr(a)&&this.ks();var l=null==i?void 0:i.minimumDurationMilliseconds;n.register({[Hs]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Gr(l)?null:l,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(t=this.ws)||t.call(this),this.ws=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.As(e),void this.xs()):(this.As(e),void this.startIfEnabledOrStop()):(this.bs===rm&&(this.bs=im,sm.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this.ys)&&r.log?this.ys.log(e,t):sm.warn("log called before recorder was ready")}get Ss(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(Hs);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}Es(){var e,t=this._instance.get_property(Hs);if(!t)return!1;var r=null!==(e=("object"==typeof t?t:JSON.parse(t)).cache_timestamp)&&void 0!==e?e:Date.now();return 36e5>=Date.now()-r}Cs(e){var t,r;if(null==(t=ss.__PosthogExtensions__)||!t.initSessionRecording)return sm.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[xo]:!0});if(this.ys||(this.ys=null==(r=ss.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Es()){if(this.bs===im||this.bs===rm)return;return this.bs=rm,sm.info("persisted remote config is stale, requesting fresh config before starting"),void new gg(this._instance).load()}this.bs=tm,this.ys.start(e)}onRRwebEmit(e){var t;null==(t=this.ys)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.ys||null==(t=this.ni)||t.register({[zs]:!0}),null==(e=this.ys)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||null==(t=this.ni)||t.register({[Vs]:!0}),null==(e=this.ys)||e.overrideSampling()}overrideTrigger(e){var t,r;this.ys||null==(r=this.ni)||r.register({["url"===e?Us:Ys]:!0}),null==(t=this.ys)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.ys)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!(null==(r=this.ys)||!r.tryAddCustomEvent(e,t))}}},Pm={autocapture:class{constructor(e){this.Rs=!1,this.Ns=null,this.Ms=!1,this.instance=e,this.rageclicks=new qp(e.config.rageclick),this.Fs=null}initialize(){this.startIfEnabled()}get Bt(){var e,t,r=Ur(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(e=r.url_allowlist)?void 0:e.map((e=>new RegExp(e))),r.url_ignorelist=null==(t=r.url_ignorelist)?void 0:t.map((e=>new RegExp(e))),r}Os(){if(this.isBrowserSupported()){if(Wn&&Kn){var e=e=>{e=e||(null==Wn?void 0:Wn.event);try{this.Ps(e)}catch(e){Hp.error("Failed to capture event",e)}};if(_s(Kn,"submit",e,{capture:!0}),_s(Kn,"change",e,{capture:!0}),_s(Kn,"click",e,{capture:!0}),this.Bt.capture_copied_text){var t=e=>{e=e||(null==Wn?void 0:Wn.event);try{this.Ps(e,Zp)}catch(e){Hp.error("Failed to capture copy/cut event",e)}};_s(Kn,"copy",t,{capture:!0}),_s(Kn,"cut",t,{capture:!0})}}}else Hp.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Rs&&(this.Os(),this.Rs=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Ms=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Os]:!!e.autocapture_opt_out}),this.Ns=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Fs=e}getElementSelectors(e){var t,r=[];return null==(t=this.Fs)||t.forEach((t=>{var i=null==Kn?void 0:Kn.querySelectorAll(t);null==i||i.forEach((i=>{e===i&&r.push(t)}))})),r}get isEnabled(){var e,t,r=null==(e=this.instance.persistence)?void 0:e.props[Os];if(Jr(this.Ns)&&!ti(r)&&!this.instance.Fr())return!1;var i=null!==(t=this.Ns)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!i}Ps(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,i=Jo(e);Vo(i)&&(i=i.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&function(e,t){if(!Wn||ia(e))return!1;var r,i,n;if(ti(t)?(r=!!t&&ra,i=void 0):(r=null!==(n=null==t?void 0:t.css_selector_ignorelist)&&void 0!==n?n:ra,i=null==t?void 0:t.content_ignorelist),!1===r)return!1;var{targetElementList:s}=na(e,!1);return!function(e,t){if(!1===e||Gr(e))return!1;var r;if(!0===e)r=ta;else{if(!Vr(e))return!1;if(e.length>10)return hs.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:i}=e;return r.some((e=>t.includes(e)||i.includes(e)))}))}(i,s.map((e=>{var t;return{safeText:Xo(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}})))&&!Qo(s,r)}(i,this.instance.config.rageclick)&&this.Ps(e,"$rageclick");var n=t===Zp;if(i&&function(e,t,r,i,n){var s,o,a,l;if(void 0===r&&(r=void 0),!Wn||ia(e))return!1;if(null!=(s=r)&&s.url_allowlist&&!Yo(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&Yo(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var u=r.dom_event_allowlist;if(u&&!u.some((e=>t.type===e)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=na(e,i);if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(Gr(r))return!0;var i,n=function(e){if(r.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var s of e)if(i=n(s))return i.v;return!1}(c,r))return!1;if(!Qo(c,null==(l=r)?void 0:l.css_selector_allowlist))return!1;var d=Wn.getComputedStyle(e);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0;var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(Ko.indexOf(v)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e,this.Bt,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=Up(i,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Bt.element_attribute_ignorelist,elementsChainAsString:this.Ms});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),t===Zp){var l,u=Wo(null==Wn||null==(l=Wn.getSelection())?void 0:l.toString()),h=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=h}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return zr(null==Kn?void 0:Kn.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Ls=(null==Wn||null==(t=Wn.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(hs.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ds&&this.Ds(),this.Ds=void 0,hs.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(Wn&&Wn.history){var r=this;null!=(e=Wn.history.pushState)&&e.__posthog_wrapped__||As(Wn.history,"pushState",(e=>function(t,i,n){e.call(this,t,i,n),r.Bs("pushState")})),null!=(t=Wn.history.replaceState)&&t.__posthog_wrapped__||As(Wn.history,"replaceState",(e=>function(t,i,n){e.call(this,t,i,n),r.Bs("replaceState")})),this.js()}}Bs(e){try{var t,r=null==Wn||null==(t=Wn.location)?void 0:t.pathname;if(!r)return;r!==this.Ls&&this.isEnabled&&this._instance.capture(Oo,{navigation_type:e}),this.Ls=r}catch(t){hs.error("Error capturing "+e+" pageview",t)}}js(){if(!this.Ds){var e=()=>{this.Bs("popstate")};_s(Wn,"popstate",e),this.Ds=()=>{Wn&&Wn.removeEventListener("popstate",e)}}}},heatmaps:class{get Bt(){return this.instance.config}constructor(e){var t;this.$s=!1,this.Rs=!1,this.qs=null,this.instance=e,this.$s=!(null==(t=this.instance.persistence)||!t.props[Ps]),this.rageclicks=new qp(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return Ur(this.Bt.capture_heatmaps)&&this.Bt.capture_heatmaps.flush_interval_milliseconds&&(e=this.Bt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Kr(this.Bt.capture_heatmaps)?Kr(this.Bt.enable_heatmaps)?this.$s:this.Bt.enable_heatmaps:!1!==this.Bt.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Rs)return;om.info("starting..."),this.Zs(),this.Lt()}else{var e;clearInterval(null!==(e=this.qs)&&void 0!==e?e:void 0),this.Hs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ps]:t}),this.$s=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.T;return this.T=void 0,e}Vs(e){this.Tt(e.originalEvent,"deadclick")}Lt(){this.qs&&clearInterval(this.qs),this.qs=function(e){return"visible"===(null==e?void 0:e.visibilityState)}(Kn)?setInterval(this.Yr.bind(this),this.flushIntervalMilliseconds):null}Zs(){Wn&&Kn&&(this.zs=this.Yr.bind(this),_s(Wn,Fo,this.zs),this.Us=e=>this.Tt(e||(null==Wn?void 0:Wn.event)),_s(Kn,"click",this.Us,{capture:!0}),this.Ys=e=>this.Gs(e||(null==Wn?void 0:Wn.event)),_s(Kn,"mousemove",this.Ys,{capture:!0}),this.Ws=new ig(this.instance,tg,this.Vs.bind(this)),this.Ws.startIfEnabledOrStop(),this.Xs=this.Lt.bind(this),_s(Kn,Mo,this.Xs),this.Rs=!0)}Hs(){var e;Wn&&Kn&&(this.zs&&Wn.removeEventListener(Fo,this.zs),this.Us&&Kn.removeEventListener("click",this.Us,{capture:!0}),this.Ys&&Kn.removeEventListener("mousemove",this.Ys,{capture:!0}),this.Xs&&Kn.removeEventListener(Mo,this.Xs),clearTimeout(this.Js),null==(e=this.Ws)||e.stop(),this.Rs=!1)}Ks(e,t){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(e,t,r){for(var i=e;i&&Zo(i)&&!Ho(i,"body");){if(i===r)return!1;if(Br(t,null==Wn?void 0:Wn.getComputedStyle(i).position))return!0;i=ea(i)}return!1}(Jo(e),["fixed","sticky"],n);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:t}}Tt(e,t){var i;if(void 0===t&&(t="click"),!qo(e.target)&&am(e)){var n=this.Ks(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.Qs(r({},n,{type:"rageclick"})),this.Qs(n)}}Gs(e){!qo(e.target)&&am(e)&&(clearTimeout(this.Js),this.Js=setTimeout((()=>{this.Qs(this.Ks(e,"mousemove"))}),500))}Qs(e){if(Wn){var t=Wn.location.href,r=this.Bt.custom_personal_data_properties,i=this.Bt.mask_personal_data_properties?[...Hc,...r||[]]:[],n=ks(t,i,zc);this.T=this.T||{},this.T[n]||(this.T[n]=[]),this.T[n].push(e)}}Yr(){this.T&&!Yr(this.T)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:ig,webVitalsAutocapture:class{constructor(e){var t;this.$s=!1,this.Rs=!1,this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.eo=()=>{clearTimeout(this.ro),0!==this.T.metrics.length&&(this._instance.capture("$web_vitals",this.T.metrics.reduce(((e,t)=>r({},e,{["$web_vitals_"+t.name+"_event"]:r({},t),["$web_vitals_"+t.name+"_value"]:t.value})),{})),this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(Gr(i))Kg.error("Could not read session ID. Dropping metrics!");else{this.T=this.T||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.io();Gr(n)||(Kr(null==e?void 0:e.name)||Kr(null==e?void 0:e.value)?Kg.error("Invalid metric received",e):!this.no||this.no>e.value?(this.T.url!==n&&(this.eo(),this.ro=setTimeout(this.eo,this.flushToCaptureTimeoutMs)),Gr(this.T.url)&&(this.T.url=n),this.T.firstMetricTimestamp=Gr(this.T.firstMetricTimestamp)?Date.now():this.T.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.T.metrics.push(r({},e,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.T.metrics.length===this.allowedMetrics.length&&this.eo()):Kg.error("Ignoring metric with value >= "+this.no,e))}},this.so=()=>{if(!this.Rs){var e,t,r,i,n=ss.__PosthogExtensions__;Gr(n)||Gr(n.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),e&&t&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.ht.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.ht.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.ht.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.ht.bind(this)),this.Rs=!0):Kg.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.$s=!(null==(t=this._instance.persistence)||!t.props[js]),this.startIfEnabled()}get oo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,r=Ur(this.oo)?null==(e=this.oo)?void 0:e.web_vitals_allowed_metrics:void 0;return Kr(r)?(null==(t=this._instance.persistence)?void 0:t.props[Zs])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Ur(this.oo)?this.oo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Ur(this.oo)?this.oo.web_vitals_attribution:void 0;return null!=e&&e}get no(){var e=Ur(this.oo)&&Qr(this.oo.__web_vitals_max_value)?this.oo.__web_vitals_max_value:Qg;return e>0&&6e4>=e?Qg:e}get isEnabled(){var e=null==Qn?void 0:Qn.protocol;if("http:"!==e&&"https:"!==e)return Kg.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Ur(this.oo)?this.oo.web_vitals:ti(this.oo)?this.oo:void 0;return ti(t)?t:this.$s}startIfEnabled(){this.isEnabled&&!this.Rs&&(Kg.info("enabled, starting..."),this.ur(this.so))}onRemoteConfig(e){if("capturePerformance"in e){var t=Ur(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Ur(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[js]:t}),this._instance.persistence.register({[Zs]:r})),this.$s=t,this.startIfEnabled()}}ur(e){var t,r;null!=(t=ss.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(r=ss.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(t=>{t?Kg.error("failed to load script",t):e()}))}io(){var e=Wn?Wn.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...Hc,...t||[]]:[];return ks(e,r,zc)}Kg.error("Could not determine current URL")}}},Lm={exceptionObserver:class{constructor(e){var t,r,i;this.so=()=>{var e;if(Wn&&this.isEnabled&&null!=(e=ss.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=ss.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=ss.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=ss.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ao&&this.Bt.capture_unhandled_errors&&(this.ao=t(this.captureException.bind(this))),!this.lo&&this.Bt.capture_unhandled_rejections&&(this.lo=r(this.captureException.bind(this))),!this.uo&&this.Bt.capture_console_errors&&(this.uo=i(this.captureException.bind(this)))}catch(e){Xg.error("failed to start",e),this.ho()}}},this._instance=e,this.co=!(null==(t=this._instance.persistence)||!t.props[Ls]),this.do=new hi({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10,refillInterval:1e4,Gt:Xg}),this.Bt=this.vo(),this.startIfEnabledOrStop()}vo(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ur(e)?t=r({},t,e):(Gr(e)?this.co:e)&&(t=r({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Bt.capture_console_errors||this.Bt.capture_unhandled_errors||this.Bt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Xg.info("enabled"),this.ho(),this.ur(this.so)):this.ho()}ur(e){var t,r;null!=(t=ss.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(r=ss.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(t=>{if(t)return Xg.error("failed to load script",t);e()}))}ho(){var e,t,r;null==(e=this.ao)||e.call(this),this.ao=void 0,null==(t=this.lo)||t.call(this),this.lo=void 0,null==(r=this.uo)||r.call(this),this.uo=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.co=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Ls]:this.co}),this.Bt=this.vo(),this.startIfEnabledOrStop())}onConfigChange(){this.Bt=this.vo()}captureException(e){var t,r,i,n=null!==(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==t?t:"Exception";this.do.consumeRateLimit(n)?Xg.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,r;this.fo=[],this.po=tp(),this._instance=e,this.fo=null!==(t=null==(r=this._instance.persistence)?void 0:r.get_property(Ds))&&void 0!==t?t:[],this.mo=Un(this.yo()),this.bo=new Yn(this.mo)}onConfigChange(){this.mo=Un(this.yo()),this.bo.setConfig(this.mo)}onRemoteConfig(e){var t,r,i;if("errorTracking"in e){var n=null!==(t=null==(r=e.errorTracking)?void 0:r.suppressionRules)&&void 0!==t?t:[],s=null==(i=e.errorTracking)?void 0:i.captureExtensionExceptions;this.fo=n,this._instance.persistence&&this._instance.persistence.register({[Ds]:this.fo,[Bs]:s})}}get wo(){var e,t=!!this._instance.get_property(Bs),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=r?r:t)&&void 0!==e&&e}buildProperties(e,t){return this.po.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.mo.enabled)try{if(!Wr(e)||0===e.trim().length)return void ep.warn("Ignoring exception step because message must be a non-empty string");var i=this._o(t),{sanitizedProperties:n,droppedKeys:s}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((r,i)=>Vn.has(i)?(t.push(i),r):(r[i]=e[i],r)),{}),droppedKeys:t}}(i);s.length>0&&ep.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.bo.add(r({[Zn]:e,[Hn]:(new Date).toISOString()},n))}catch(e){ep.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Io(t)){if(this.Co(t))return this.So("Exception dropped: matched a suppression rule"),void ep.info("Skipping exception capture because a suppression rule matched");if(!this.wo&&this.xo(t))return this.So("Exception dropped: thrown by a browser extension"),void ep.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ko(t))return this.So("Exception dropped: thrown by the PostHog SDK"),void ep.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.mo.enabled&&Kr(e.$exception_steps)?this.To(e):e;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",en:!0});return i&&this.bo.clear(),i}catch(e){return ep.error("Failed to capture exception event. Dropping this exception.",e),void this.bo.clear()}}catch(e){return void ep.error("Failed to process exception event. Ignoring this exception.",e)}}To(e){try{var t=this.bo.getAttachable();return 0===t.length?e:r({},e,{$exception_steps:t})}catch(t){return ep.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}So(e){this.mo.enabled&&this.bo.add({[Zn]:e,[Hn]:(new Date).toISOString()})}_o(e){return Ur(e)?r({},e):{}}yo(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}Co(e){if(0===e.length)return!1;var t=e.reduce(((e,t)=>{var{type:r,value:i}=t;return Wr(r)&&r.length>0&&e.$exception_types.push(r),Wr(i)&&i.length>0&&e.$exception_values.push(i),e}),{$exception_types:[],$exception_values:[]});return this.fo.some((e=>{var r=e.values.map((e=>{var r,i=xh[e.operator],n=Vr(e.value)?e.value:[e.value],s=null!==(r=t[e.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===e.type?r.some(Boolean):r.every(Boolean)}))}xo(e){var t=e.flatMap((e=>{var t,r;return null!==(t=null==(r=e.stacktrace)?void 0:r.frames)&&void 0!==t?t:[]}));return t.some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}ko(e){if(e.length>0){var t,r,i,n,s=null!==(t=null==(r=e[0].stacktrace)?void 0:r.frames)&&void 0!==t?t:[],o=s[s.length-1];return null!==(i=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}Io(e){return!Kr(e)&&Vr(e)}}},Dm=r({productTours:class{get ni(){return this._instance.persistence}constructor(e){this.Ao=null,this.Eo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this.ni&&this.ni.register({[qs]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Ao||(e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property(qs)||this.ur((()=>this.Ro()))}ur(e){var t,r;null!=(t=ss.__PosthogExtensions__)&&t.generateProductTours?e():null==(r=ss.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(t=>{t?lm.error("Could not load product tours script",t):e()}))}Ro(){var e;!this.Ao&&null!=(e=ss.__PosthogExtensions__)&&e.generateProductTours&&(this.Ao=ss.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!Vr(this.Eo)||t){var r=this.ni;if(r){var i=r.props[lo];if(Vr(i)&&!t)return this.Eo=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:t=>{var i=t.statusCode;if(200!==i||!t.json){var n="Product Tours API could not be loaded, status: "+i;return lm.error(n),void e([],{isLoaded:!1,error:n})}var s=Vr(t.json.product_tours)?t.json.product_tours:[];this.Eo=s,r&&r.register({[lo]:s}),e(s,{isLoaded:!0})}})}else e(this.Eo,{isLoaded:!0})}getActiveProductTours(e){Kr(this.Ao)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ao.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Ao)||t.showTourById(e)}previewTour(e){this.Ao?this.Ao.previewTour(e):this.ur((()=>{var t;this.Ro(),null==(t=this.Ao)||t.previewTour(e)}))}dismissProductTour(){var e;null==(e=this.Ao)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Ao)||e.nextStep()}previousStep(){var e;null==(e=this.Ao)||e.previousStep()}clearCache(){var e;this.Eo=null,null==(e=this.ni)||e.unregister(lo)}resetTour(e){var t;null==(t=this.Ao)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Ao)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Ao)||t.cancelPendingTour(e)}}},Fm),Bm={siteApps:class{constructor(e){this._instance=e,this.No=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Mo(e,t){if(t){var r=this.globalsForEvent(t);this.No.push(r),this.No.length>1e3&&(this.No=this.No.slice(10))}}get siteAppLoaders(){var e;return null==(e=ss._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Mo.bind(this));this.Fo=()=>{e(),this.No=[],this.Fo=void 0}}}globalsForEvent(e){var t,n,s,o,a,l,u;if(!e)throw new Error("Event payload is required");var h={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[v,f]of Object.entries(d))h[v]={id:c[v],type:v,properties:f};var{$set_once:p,$set:g}=e;return{event:r({},i(e,um),{properties:r({},e.properties,g?{$set:r({},null!==(t=null==(n=e.properties)?void 0:n.$set)&&void 0!==t?t:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=e.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(l=e.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=e.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var r;!t.errored&&this.No.length&&(hm.info("Processing "+this.No.length+" events for site app with id "+e.id),this.No.forEach((e=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&(null==(r=this.Fo)||r.call(this))},i=!1,n=n=>{t.errored=!n,t.loaded=!0,hm.info("Site app with id "+e.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:s}=e.init({posthog:this._instance,callback(e){n(e)}});s&&(t.processEvent=s),i=!0}catch(t){hm.error(cm+e.id,t),n(!1)}if(i&&t.loaded)try{r()}catch(r){hm.error("Error while processing buffered events PostHog app with config id "+e.id,r),t.errored=!0}}Oo(){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)}Po(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(t)}catch(t){hm.error("Error while processing event "+e.event+" for site app "+r.id,t)}}}onRemoteConfig(e){var t,r,i,n=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Oo(),void this._instance.on("eventCaptured",(e=>this.Po(e)))):void hm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.Fo)||r.call(this),null!=(i=e.siteApps)&&i.length)if(this.isEnabled){var s=function(e){var t;ss["__$$ph_site_app_"+e]=n._instance,null==(t=ss.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,a,(t=>{if(t)return hm.error(cm+e,t)}))};for(var{id:o,url:a}of e.siteApps)s(o)}else hm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},jm={tracingHeaders:class{constructor(e){this.Lo=void 0,this.Do=void 0,this.so=()=>{var e,t,r=this.Bo()||[];Gr(this.Lo)&&(null==(e=ss.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(r,this._instance.get_distinct_id(),this._instance.sessionManager)),Gr(this.Do)&&(null==(t=ss.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(r,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}ur(e){var t,r;null!=(t=ss.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(r=ss.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(t=>{if(t)return Jg.error("failed to load script",t);e()}))}Bo(){var e;return null!==(e=this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var e,t;this.Bo()?this.ur(this.so):(null==(e=this.Lo)||e.call(this),null==(t=this.Do)||t.call(this),this.Lo=void 0,this.Do=void 0)}}},$m=r({surveys:class{get Bt(){return this._instance.config}constructor(e){this.jo=void 0,this._surveyManager=null,this.$o=!1,this.qo=[],this.Zo=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Bt.disable_surveys){var t=e.surveys;if(Kr(t))return gu.warn("Flags not loaded yet. Not loading surveys.");var r=Vr(t);this.jo=r?t.length>0:t,gu.info("flags response received, isSurveysEnabled: "+this.jo),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var r=localStorage.key(t);(null!=r&&r.startsWith(wu)||null!=r&&r.startsWith(_u))&&e.push(r)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this.$o)gu.info("Already initializing surveys, skipping...");else if(this.Bt.disable_surveys)gu.info(mm);else if(this.Bt.cookieless_mode&&this._instance.consent.isOptedOut())gu.info("Not loading surveys in cookieless mode without consent.");else{var e=null==ss?void 0:ss.__PosthogExtensions__;if(e){if(!Gr(this.jo)||this.Bt.advanced_enable_surveys){var t=this.jo||this.Bt.advanced_enable_surveys;this.$o=!0;try{var r=e.generateSurveys;if(r)return void this.Ho(r,t);var i=e.loadExternalDependency;if(!i)return void this.Vo(ko);i(this._instance,"surveys",(r=>{r||!e.generateSurveys?this.Vo("Could not load surveys script",r):this.Ho(e.generateSurveys,t)}))}catch(e){throw this.Vo("Error initializing surveys",e),e}finally{this.$o=!1}}}else gu.error("PostHog Extensions not found.")}}Ho(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new pm(this._instance),gu.info("Surveys loaded successfully"),this.zo({isLoaded:!0})}Vo(e,t){gu.error(e,t),this.zo({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.qo.push(e),this._surveyManager&&this.zo({isLoaded:!0}),()=>{this.qo=this.qo.filter((t=>t!==e))}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Bt.disable_surveys)return gu.info(mm),e([]);var r,i=this._instance.get_property(oo);if(i&&!t)return e(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.Zo?this.Zo.then((t=>{var{surveys:r,context:i}=t;return e(r,i)})):("undefined"!=typeof Promise&&(this.Zo=new Promise((e=>{r=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Bt.token),method:"GET",timeout:this.Bt.surveys_request_timeout_ms,callback:t=>{var i;this.Zo=null;var n=t.statusCode;if(200!==n||!t.json){var s="Surveys API could not be loaded, status: "+n;gu.error(s);var o={isLoaded:!1,error:s};return e([],o),void(null==r||r({surveys:[],context:o}))}var a,l=t.json.surveys||[],u=l.filter((e=>mu(e)&&(yu(e)||bu(e))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u)),null==(i=this._instance.persistence)||i.register({[oo]:l});var h={isLoaded:!0};e(l,h),null==r||r({surveys:l,context:h})}}))}zo(e){for(var t of this.qo)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){gu.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!Kr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);gu.warn("init was not called")}Uo(e){var t=null;return this.getSurveys((r=>{var i;t=null!==(i=r.find((t=>t.id===e)))&&void 0!==i?i:null})),t}Yo(e){if(Kr(this._surveyManager))return{eligible:!1,reason:gm};var t="string"==typeof e?this.Uo(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Kr(this._surveyManager))return gu.warn("init was not called"),{visible:!1,disabledReason:gm};var t=this.Yo(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Kr(this._surveyManager)?(gu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:gm})):new Promise((r=>{this.getSurveys((t=>{var i,n=null!==(i=t.find((t=>t.id===e)))&&void 0!==i?i:null;if(n){var s=this.Yo(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,r){var i;if(Kr(this._surveyManager))gu.warn("init was not called");else{var n="string"==typeof e?this.Uo(e):e;if(null!=n&&n.id)if(xu.includes(n.type)){var s=null==Kn?void 0:Kn.querySelector(t);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(gu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var e,t;gu.info("Rendering survey "+n.id+" with delay of "+(null==(e=n.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(n,s,r),gu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);gu.warn("Survey element not found")}else gu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else gu.warn("Survey not found")}}displaySurvey(e,t){var i;if(Kr(this._surveyManager))gu.warn("init was not called");else{var n=this.Uo(e);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==nu&&t.initialResponses&&gu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void gu.warn("Survey is not eligible to be displayed: ",o.disabledReason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else gu.warn("Survey not found")}}cancelPendingSurvey(e){Kr(this._surveyManager)?gu.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}},Fm),qm={toolbar:class{constructor(e){this.instance=e}Go(e){ss.ph_toolbar_state=e}Wo(){var e;return null!==(e=ss.ph_toolbar_state)&&void 0!==e?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),Is(this.instance.config))return!1;if(!Wn||!Kn)return!1;e=null!=e?e:Wn.location,r=null!=r?r:Wn.history;try{if(!t){try{Wn.localStorage.setItem("test","test"),Wn.localStorage.removeItem("test")}catch(e){return!1}t=null==Wn?void 0:Wn.localStorage}var i,n=ym||Ts(e.hash,"__posthog")||Ts(e.hash,"state"),s=n?gs((()=>JSON.parse(atob(decodeURIComponent(n)))))||gs((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(t.getItem(bm)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(e){return!1}}Xo(e){var t=ss.ph_load_toolbar||ss.ph_load_editor;!Kr(t)&&zr(t)?t(e,this.instance):wm.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==Kn||!Kn.getElementById(_o));if(!Wn||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(Wn.localStorage.setItem(bm,JSON.stringify(r({},n,{source:void 0}))),2===this.Wo())this.Xo(n);else if(0===this.Wo()){var s;this.Go(1),null==(s=ss.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(e=>{if(e)return wm.error("[Toolbar] Failed to load",e),void this.Go(0);this.Go(2),this.Xo(n)})),_s(Wn,"turbolinks:load",(()=>{this.Go(0),this.loadToolbar(n)}))}return!0}Jo(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,r){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(e,t,r)}}},Zm=r({experiments:Am},Fm),Hm={conversations:class{constructor(e){this.Ko=void 0,this._conversationsManager=null,this.Qo=!1,this.ea=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;Kr(t)||(ti(t)?this.Ko=t:(this.Ko=t.enabled,this.ea=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Ko=void 0,this.ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Qo||this._instance.config.disable_conversations||Is(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==ss?void 0:ss.__PosthogExtensions__;if(e&&!Gr(this.Ko)&&this.Ko)if(this.ea&&this.ea.token){this.Qo=!0;try{var t=e.initConversations;if(t)return this.ta(t),void(this.Qo=!1);var r=e.loadExternalDependency;if(!r)return void this.ra(ko);r(this._instance,"conversations",(t=>{t||!e.initConversations?this.ra("Could not load conversations script",t):this.ta(e.initConversations),this.Qo=!1}))}catch(e){this.ra("Error initializing conversations",e),this.Qo=!1}}else Nm.error("Conversations enabled but missing token in remote config.")}}ta(e){if(this.ea)try{this._conversationsManager=e(this.ea,this._instance),Nm.info("Conversations loaded successfully")}catch(e){this.ra("Error completing conversations initialization",e)}else Nm.error("Cannot complete initialization: remote config is null")}ra(e,t){Nm.error(e,t),this._conversationsManager=null,this.Qo=!1}show(){this._conversationsManager?this._conversationsManager.show():Nm.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ko&&!Jr(this._conversationsManager)}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}sendMessage(e,r,i){var n=this;return t((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,r,i):(Nm.warn(Mm),null)}))()}getMessages(e,r){var i=this;return t((function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,r):(Nm.warn(Mm),null)}))()}markAsRead(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(e):(Nm.warn(Mm),null)}))()}getTickets(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.getTickets(e):(Nm.warn(Mm),null)}))()}requestRestoreLink(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(e):(Nm.warn(Mm),null)}))()}restoreFromToken(e){var r=this;return t((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(e):(Nm.warn(Mm),null)}))()}restoreFromUrlToken(){var e=this;return t((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Nm.warn(Mm),null)}))()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}un(){var e;null==(e=this._conversationsManager)||e.setIdentity()}hn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},Vm={logs:class{constructor(e){var t;this.ia=!1,this.na=!1,this.Gt=cs("[logs]"),this.sa=[],this.oa=0,this.aa=0,this.la=!1,this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.ia=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,r=null==(t=e.logs)?void 0:t.captureConsoleLogs;!Kr(r)&&r&&(this.ia=!0,this.loadIfEnabled())}reset(){this.sa=[],this.jr&&(clearTimeout(this.jr),this.jr=void 0),this.oa=0,this.aa=0,this.la=!1}loadIfEnabled(){if(this.ia&&!this.na){var e=null==ss?void 0:ss.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",(t=>{var r;t||null==(r=e.logs)||!r.initializeLogs?this.Gt.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.na=!0)})):this.Gt.error(ko)}else this.Gt.error("PostHog Extensions not found.")}}captureLog(e){var t,i,n,s,o,a;if(this._instance.is_capturing())if(e&&e.body){var l=null!==(t=null==(i=this._instance.config.logs)?void 0:i.flushIntervalMs)&&void 0!==t?t:3e3,u=null!==(n=null==(s=this._instance.config.logs)?void 0:s.maxLogsPerInterval)&&void 0!==n?n:1e3,h=Date.now();if(l>h-this.aa||(this.aa=h,this.oa=0,this.la=!1),u>this.oa){this.oa++;var c=function(e,t){var i=e.level||"info",{text:n,number:s}=dn[i]||vn,o=String(Date.now())+"000000",a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var l=r({},a,e.attributes||{}),u={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:e.body},attributes:pn(l)};return e.trace_id&&(u.traceId=e.trace_id),e.span_id&&(u.spanId=e.span_id),Gr(e.trace_flags)||(u.flags=e.trace_flags),u}(e,this.ua());this.sa.push({record:c}),(null!==(o=null==(a=this._instance.config.logs)?void 0:a.maxBufferSize)&&void 0!==o?o:100)>this.sa.length?this.ha():this.flushLogs()}else this.la||(this.Gt.warn("captureLog dropping logs: exceeded "+u+" logs per "+l+"ms"),this.la=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.ca||(this.ca={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.ca}flushLogs(e){if(this.jr&&(clearTimeout(this.jr),this.jr=void 0),0!==this.sa.length){var t=this.sa;this.sa=[];var i=this._instance.config.logs,n=r({"service.name":(null==i?void 0:i.serviceName)||"unknown_service"},(null==i?void 0:i.environment)&&{"deployment.environment":i.environment},(null==i?void 0:i.serviceVersion)&&{"service.version":i.serviceVersion},null==i?void 0:i.resourceAttributes),s=function(e,t,r,i){return{resourceLogs:[{resource:{attributes:pn(t)},scopeLogs:[{scope:{name:r,version:i},logRecords:e}]}]}}(t.map((e=>e.record)),n,ls.LIB_NAME,ls.LIB_VERSION),o=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.Hi({method:"POST",url:o,data:s,compression:"best-available",batchKey:"logs",transport:e})}}ha(){var e,t;this.jr||(this.jr=setTimeout((()=>{this.jr=void 0,this.flushLogs()}),null!==(e=null==(t=this._instance.config.logs)?void 0:t.flushIntervalMs)&&void 0!==e?e:3e3))}ua(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:r}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=r}if(null!=ss&&null!=(e=ss.location)&&e.href&&(t.currentUrl=ss.location.href),this._instance.featureFlags){var i=this._instance.featureFlags.getFlags();i&&i.length>0&&(t.activeFeatureFlags=i)}return t}}},zm=r({},Fm,Om,Pm,Lm,Dm,Bm,$m,jm,qm,Zm,Hm,Vm);Wg.__defaultExtensionClasses=r({},zm),Em=Lg[Hg]=new Wg,(Rm=ss.posthog)&&vs(Rm._i,(function(e){if(e&&Vr(e)){var t=Em.init(e[0],e[1],e[2]),r=Rm[e[2]]||Rm;t&&(t._execute_array.call(t.people,r.people),t._execute_array(r))}})),ss.posthog=Em,function(){function e(){e.done||(e.done=!0,Vg=!1,vs(Lg,(function(e){e._dom_loaded()})))}null!=Kn&&Kn.addEventListener?"complete"===Kn.readyState?e():_s(Kn,"DOMContentLoaded",e,{capture:!1}):Wn&&hs.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
2
2
  //# sourceMappingURL=array.full.js.map