posthog-js 1.315.0 → 1.315.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.js +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/product-tours.js +1 -1
- package/dist/product-tours.js.map +1 -1
- package/dist/src/extensions/product-tours/constants.d.ts +1 -0
- package/dist/src/extensions/product-tours/product-tours.d.ts +7 -0
- package/lib/package.json +1 -1
- package/lib/src/extensions/product-tours/constants.d.ts +1 -0
- package/lib/src/extensions/product-tours/constants.js +2 -1
- package/lib/src/extensions/product-tours/constants.js.map +1 -1
- package/lib/src/extensions/product-tours/product-tours.d.ts +7 -0
- package/lib/src/extensions/product-tours/product-tours.js +79 -8
- package/lib/src/extensions/product-tours/product-tours.js.map +1 -1
- package/package.json +3 -3
package/dist/array.full.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";function t(t,e,i,r,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void i(t)}a.done?e(l):Promise.resolve(l).then(r,n)}function e(e){return function(){var i=this,r=arguments;return new Promise((function(n,s){var o=e.apply(i,r);function a(e){t(o,n,s,a,l,"next",e)}function l(e){t(o,n,s,a,l,"throw",e)}a(void 0)}))}}function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},i.apply(null,arguments)}function r(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}var n,s=["type"],o=Object.defineProperty,a=(t,e,i)=>((t,e,i)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),l=Object.defineProperty,u=(t,e,i)=>((t,e,i)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),h=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(h||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var v={};function f(t){if(v[t])return v[t];var e=function(t){var e,i=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],i=e.prototype,r=t in c?c[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in d?d[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return v[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?v[t]=u:e.prototype}catch(t){return e.prototype}}var p={};function g(t,e,i){var r,n=t+"."+String(i);if(p[n])return p[n].call(e);var s=f(t),o=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return o?(p[n]=o,o.call(e)):e[i]}var m={};function y(t,e,i){var r=t+"."+String(i);if(m[r])return m[r].bind(e);var n=f(t)[i];return"function"!=typeof n?e[i]:(m[r]=n,n.bind(e))}var b={childNodes:function(t){return g("Node",t,"childNodes")},parentNode:function(t){return g("Node",t,"parentNode")},parentElement:function(t){return g("Node",t,"parentElement")},textContent:function(t){return g("Node",t,"textContent")},contains:function(t,e){return y("Node",t,"contains")(e)},getRootNode:function(t){return y("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?g("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null},querySelector:function(t,e){return g("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return g("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return f("MutationObserver").constructor}};function _(t){return t.nodeType===t.ELEMENT_NODE}function w(t){var e=t&&"host"in t&&"mode"in t&&b.host(t)||null;return Boolean(e&&"shadowRoot"in e&&b.shadowRoot(e)===t)}function I(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function C(t){try{var e=t.rules||t.cssRules;if(!e)return null;var i=Array.from(e,(e=>S(e,t.href))).join("");return(r=i).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}catch(t){return null}var r}function S(t,e){if(function(t){return"styleSheet"in t}(t)){var i;try{i=C(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)return e;var i=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?i.push("layer"):t.layerName&&i.push("layer("+t.layerName+")"),t.supportsText&&i.push("supports("+t.supportsText+")"),t.media.length&&i.push(t.media.mediaText),i.join(" ")+";"}(t)}catch(e){i=t.cssText}return t.styleSheet.href?L(i,t.styleSheet.href):i}var r,n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(r=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(r,"$1\\$2")),e?L(n,e):n}function k(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let x=class{constructor(){u(this,"idNodeMap",new Map),u(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var i=null==(e=this.getMeta(t))?void 0:e.id;return null!=i?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var i=e.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(t){var{element:e,maskInputOptions:i,tagName:r,type:n,value:s,maskInputFn:o}=t,a=s||"",l=n&&T(n);return(i[r.toLowerCase()]||l&&i[l])&&(a=o?o(a,e):"*".repeat(a.length)),a}function T(t){return t.toLowerCase()}var E="__rrweb_original__";function M(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?T(e):null}function N(t,e){var i,r;try{r=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(i=null==n?void 0:n[1])&&void 0!==i?i:null}var R=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(t,e){return(t||"").replace(R,((t,i,r,n,s,o)=>{var a,l=r||s||o,u=i||n||"";if(!l)return t;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=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.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,Z=1,q=new RegExp("[^a-z0-9-_:]"),H=-2;function V(){return Z++}var j=/^[^ \t\n\r\u000c]+/,Y=/^[, \t\n\r\u000c]+/;var G=new WeakMap;function z(t,e){return e&&""!==e.trim()?U(t,e):e}function W(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function U(t,e){var i=G.get(t);if(i||(i=t.createElement("a"),G.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function X(t,e,i,r){return r?"src"===i||"href"===i&&("use"!==e||"#"!==r[0])||"xlink:href"===i&&"#"!==r[0]?z(t,r):"background"!==i||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===i?function(t,e){if(""===e.trim())return e;var i=0;function r(t){var r,n=t.exec(e.substring(i));return n?(r=n[0],i+=r.length,r):""}for(var n=[];r(Y),!(i>=e.length);){var s=r(j);if(","===s.slice(-1))s=z(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=z(t,s);for(var a=!1;;){var l=e.charAt(i);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){i+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?L(r,U(t)):"object"===e&&"data"===i?z(t,r):r:z(t,r):r}function J(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function K(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&K(b.parentNode(t),e,i);for(var r=t.classList.length;r--;){var n=t.classList[r];if(e.test(n))return!0}return!!i&&K(b.parentNode(t),e,i)}function Q(t,e,i,r){var n;if(_(t)){if(n=t,!b.childNodes(n).length)return!1}else{if(null===b.parentElement(t))return!1;n=b.parentElement(t)}try{if("string"==typeof e){if(r){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(K(n,e,r))return!0;if(i)if(r){if(n.closest(i))return!0}else if(n.matches(i))return!0}catch(t){}return!1}function tt(t,e){var{doc:i,mirror:r,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}=e,m=function(t,e){if(!e.hasNode(t))return;var i=e.getId(t);return 1===i?void 0:i}(i,r);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:h.Document,childNodes:[],compatMode:t.compatMode}:{type:h.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){for(var i,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=e,g=function(t,e,i){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var r=t.classList.length;r--;){var n=t.classList[r];if(e.test(n))return!0}if(i)return t.matches(i)}catch(t){}return!1}(t,n,s),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=T(t.tagName);return q.test(e)?"div":e}(t),y={},_=t.attributes.length,w=0;w<_;w++){var I=t.attributes[w];J(m,I.name,I.value)||(y[I.name]=X(r,m,T(I.name),I.value))}if("link"===m&&o){var S=function(t){return null==t?void 0:t.href}(t);if(S){var x=k(r,S);if(!x&&S.includes(".css"))x=k(r,window.location.origin+"/"+S.replace(window.location.href,""));var N=null;x&&(N=C(x)),N&&(delete y.rel,delete y.href,y._cssText=N)}}if("style"===m&&t.sheet&&!(t.innerText||b.textContent(t)||"").trim().length){var R=C(t.sheet);R&&(y._cssText=R)}if("input"===m||"textarea"===m||"select"===m){var F=t.value,O=t.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=A({element:t,type:M(t),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(y.checked=O)}"option"===m&&(t.selected&&!a.select?y.selected=!0:delete y.selected);if("dialog"===m&&t.open)try{y.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){y.rr_open_mode="modal",y.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var i=0;i<t.width;i+=50)for(var r=0;r<t.height;r+=50){var n=e.getImageData,s=E in n?n[E]:n;if(new Uint32Array(s.call(e,i,r,Math.min(50,t.width-i),Math.min(50,t.height-r)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(y.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){var P=t.toDataURL(u.type,u.quality),L=r.createElement("canvas");L.width=t.width,L.height=t.height,P!==L.toDataURL(u.type,u.quality)&&(y.rr_dataURL=P)}if("img"===m&&c){D||(D=r.createElement("canvas"),B=D.getContext("2d"));var Z=t,H=Z.currentSrc||Z.getAttribute("src")||"<unknown-src>",V=Z.crossOrigin,j=()=>{Z.removeEventListener("load",j);try{D.width=Z.naturalWidth,D.height=Z.naturalHeight,B.drawImage(Z,0,0),y.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(t){if("anonymous"!==Z.crossOrigin)return Z.crossOrigin="anonymous",void(Z.complete&&0!==Z.naturalWidth?j():Z.addEventListener("load",j));console.warn("Cannot inline img src="+H+"! Error: "+t)}"anonymous"===Z.crossOrigin&&(V?y.crossOrigin=V:Z.removeAttribute("crossorigin"))};Z.complete&&0!==Z.naturalWidth?j():Z.addEventListener("load",j)}if("audio"===m||"video"===m){var Y=y;Y.rr_mediaState=t.paused?"paused":"played",Y.rr_mediaCurrentTime=t.currentTime,Y.rr_mediaPlaybackRate=t.playbackRate,Y.rr_mediaMuted=t.muted,Y.rr_mediaLoop=t.loop,Y.rr_mediaVolume=t.volume}f||(t.scrollLeft&&(y.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(y.rr_scrollTop=t.scrollTop));if(g){var{width:G,height:z}=t.getBoundingClientRect();y={class:y.class,rr_width:G+"px",rr_height:z+"px"}}"iframe"!==m||v(y.src)||(t.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(i=!0)}catch(t){}return{type:h.Element,tagName:m,attributes:y,childNodes:[],isSVG:W(t)||void 0,needBlock:g,rootId:p,isCustom:i}}(t,{doc:i,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var i,{needsMask:r,maskTextFn:n,rootId:s}=e,o=b.parentNode(t),a=o&&o.tagName,l=b.textContent(t),u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(u&&l){try{t.nextSibling||t.previousSibling||(null==(i=o.sheet)?void 0:i.cssRules)&&(l=C(o.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=L(l,U(e.doc))}c&&(l="SCRIPT_PLACEHOLDER");!u&&!c&&l&&r&&(l=n?n(l,b.parentElement(t)):l.replace(/[\S]/g,"*"));return{type:h.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:i,needsMask:o,maskTextFn:u,rootId:m});case t.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:h.Comment,textContent:b.textContent(t)||"",rootId:m};default:return!1}}function et(t){return null==t?"":t.toLowerCase()}function it(t,e){var{doc:i,mirror:r,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:C,iframeLoadTimeout:S=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:T=!1}=e,{needsMask:E}=e,{preserveWhiteSpace:M=!0}=e;E||(E=Q(t,o,a,void 0===E));var R,F=tt(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:E,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:A,newlyAddedElement:T});if(!F)return console.warn(t,"not serialized"),null;R=r.hasNode(t)?r.getId(t):!function(t,e){if(e.comment&&t.type===h.Comment)return!0;if(t.type===h.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===N(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(et(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===et(t.attributes.name)||"icon"===et(t.attributes.rel)||"apple-touch-icon"===et(t.attributes.rel)||"shortcut icon"===et(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&et(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(et(t.attributes.property).match(/^(og|twitter|fb):/)||et(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===et(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===et(t.attributes.name)||"googlebot"===et(t.attributes.name)||"bingbot"===et(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===et(t.attributes.name)||"generator"===et(t.attributes.name)||"framework"===et(t.attributes.name)||"publisher"===et(t.attributes.name)||"progid"===et(t.attributes.name)||et(t.attributes.property).match(/^article:/)||et(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===et(t.attributes.name)||"yandex-verification"===et(t.attributes.name)||"csrf-token"===et(t.attributes.name)||"p:domain_verify"===et(t.attributes.name)||"verify-v1"===et(t.attributes.name)||"verification"===et(t.attributes.name)||"shopify-checkout-api-token"===et(t.attributes.name)))return!0}}return!1}(F,f)&&(M||F.type!==h.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?V():H;var O=Object.assign(F,{id:R});if(r.add(t,O),R===H)return null;y&&y(t);var P=!l;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=b.shadowRoot(t);L&&I(L)&&(O.isShadowHost=!0)}if((O.type===h.Document||O.type===h.Element)&&P){f.headWhitespace&&O.type===h.Element&&"head"===O.tagName&&(M=!1);var D={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:E,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:C,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A};if(O.type===h.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(b.childNodes(t))){var Z=it(B,D);Z&&O.childNodes.push(Z)}var q=null;if(_(t)&&(q=b.shadowRoot(t)))for(var j of Array.from(b.childNodes(q))){var Y=it(j,D);Y&&(I(q)&&(Y.isShadow=!0),O.childNodes.push(Y))}}var G=b.parentNode(t);return G&&w(G)&&I(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(t,e,i){var r=t.contentWindow;if(r){var n,s=!1;try{n=r.document.readyState}catch(t){return}if("complete"===n){var o="about:blank";if(r.location.href!==o||t.src===o||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{s||(e(),s=!0)}),i);t.addEventListener("load",(()=>{clearTimeout(a),s=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&C){var i=it(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:E,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:C,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});i&&C(t,i)}}),S),O.type===h.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===N(O.attributes.href))&&function(t,e,i){var r,n=!1;try{r=t.sheet}catch(t){return}if(!r){var s=setTimeout((()=>{n||(e(),n=!0)}),i);t.addEventListener("load",(()=>{clearTimeout(s),n=!0,e()}))}}(t,(()=>{if(k){var e=it(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:E,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:C,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});e&&k(t,e)}}),x),O}let rt=class t{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 t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var nt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},st={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var ot={};function at(t){if(ot[t])return ot[t];var e=function(t){var e,i=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],i=e.prototype,r=t in nt?nt[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in st?st[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return ot[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?ot[t]=u:i}catch(t){return i}}var lt={};function ut(t,e,i){var r,n=t+"."+String(i);if(lt[n])return lt[n].call(e);var s=at(t),o=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return o?(lt[n]=o,o.call(e)):e[i]}var ht={};function ct(t,e,i){var r=t+"."+String(i);if(ht[r])return ht[r].bind(e);var n=at(t)[i];return"function"!=typeof n?e[i]:(ht[r]=n,n.bind(e))}function dt(){return at("MutationObserver").constructor}var vt={childNodes:function(t){return ut("Node",t,"childNodes")},parentNode:function(t){return ut("Node",t,"parentNode")},parentElement:function(t){return ut("Node",t,"parentElement")},textContent:function(t){return ut("Node",t,"textContent")},contains:function(t,e){return ct("Node",t,"contains")(e)},getRootNode:function(t){return ct("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?ut("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?ut("Element",t,"shadowRoot"):null},querySelector:function(t,e){return ut("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return ut("Element",t,"querySelectorAll")(e)},mutationObserver:dt};function ft(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>i.removeEventListener(t,e,r)}var pt="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.",gt={map:{},getId:()=>(console.error(pt),-1),getNode:()=>(console.error(pt),null),removeNodeFromMap(){console.error(pt)},has:()=>(console.error(pt),!1),reset(){console.error(pt)}};function mt(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;u<=0||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,o)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,o)}),u))}}function yt(t,e,i,r,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,r?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>yt(t,e,s||{},!0)}function bt(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n=i(r);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=n,()=>{t[e]=r}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gt=new Proxy(gt,{get:(t,e,i)=>("map"===e&&console.error(pt),Reflect.get(t,e,i))}));var _t=Date.now;function wt(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=vt.parentElement(s.body))?void 0:e.scrollLeft)||(null==(i=null==s?void 0:s.body)?void 0:i.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(r=vt.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function It(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ct(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function St(t){return t?t.nodeType===t.ELEMENT_NODE?t:vt.parentElement(t):null}function kt(t,e,i,r){if(!t)return!1;var n=St(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if(K(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1}function xt(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||e.getId(t)===H}function At(t,e){if(w(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=vt.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||At(r,e))}function Tt(t){return Boolean(t.changedTouches)}function Et(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Mt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Nt(t){return!!t&&(t instanceof rt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vt.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(_t=()=>(new Date).getTime());let Rt=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ft(t){var e,i=null;return"getRootNode"in t&&(null==(e=vt.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vt.host(vt.getRootNode(t))&&(i=vt.host(vt.getRootNode(t))),i}function Ot(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Ft(i);)i=e;return i}(t);return vt.contains(e,i)}function Pt(t){var e=t.ownerDocument;return!!e&&(vt.contains(e,t)||Ot(t))}var Lt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Lt||{}),Dt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Dt||{}),Bt=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Bt||{}),Zt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Zt||{}),$t=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))($t||{}),qt=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(qt||{});function Ht(t){return"__ln"in t}class Vt{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,i=0;i<t;i++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Ht(t.previousSibling)){var i=t.previousSibling.__ln.next;e.next=i,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,i&&(i.previous=e)}else if(t.nextSibling&&Ht(t.nextSibling)&&t.nextSibling.__ln.previous){var r=t.nextSibling.__ln.previous;e.previous=r,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,r&&(r.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var jt,Yt=(t,e)=>t+"@"+e;class Gt{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",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,i=new Vt,r=t=>{for(var e=t,i=H;i===H;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=vt.parentNode(n);if(s&&Pt(n)&&"TEXTAREA"!==s.tagName){var o=w(s)?this.mirror.getId(Ft(n)):this.mirror.getId(s),a=r(n);if(-1===o||-1===a)return i.addNode(n);var l=it(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:t=>{Et(t,this.mirror)&&this.iframeManager.addIframe(t),Mt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Nt(n)&&this.shadowDomManager.addShadowRoot(vt.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Wt(this.removes,s,this.mirror)&&!this.movedSet.has(vt.parentNode(s))||n(s);for(var o of this.addedSet)Ut(this.droppedSet,o)||Wt(this.removes,o,this.mirror)?Ut(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;i.length;){var l=null;if(a){var u=this.mirror.getId(vt.parentNode(a.value)),h=r(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var c=i.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(vt.parentNode(d.value));if(-1===r(d.value))continue;if(-1!==v){l=d;break}var f=d.value,p=vt.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=vt.host(p);if(-1!==this.mirror.getId(g)){l=d;break}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}a=l.previous,i.removeNode(l.value),n(l.value)}var m={texts:this.texts.map((t=>{var e=t.node,i=vt.parentNode(e);return i&&"TEXTAREA"===i.tagName&&this.genTextAreaValueMutation(i),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var i=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);i.length<e.style.length&&(i+r).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(m))}})),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(vt.childNodes(t),(t=>vt.textContent(t)||"")).join("")})),a(this,"processMutation",(t=>{if(!xt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=vt.textContent(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Q(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,St(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var i=t.target,r=t.attributeName,n=t.target.getAttribute(r);if("value"===r){var s=M(i);n=A({element:i,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(kt(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===i.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(i.contentDocument)return;r="rr_src"}if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),"type"===r&&"INPUT"===i.tagName&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!J(i.tagName,r))if(o.attributes[r]=X(this.doc,T(i.tagName),T(r),n),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(i.style))){var u=i.style.getPropertyValue(l),h=i.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))""===i.style.getPropertyValue(c)&&(o.styleDiff[c]=!1)}else"open"===r&&"DIALOG"===i.tagName&&(i.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break;case"childList":if(kt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var i=this.mirror.getId(e),r=w(t.target)?this.mirror.getId(vt.host(t.target)):this.mirror.getId(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||xt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(zt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||At(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Yt(i,r)]?zt(this.movedSet,e):this.removes.push({parentId:r,id:i,isShadow:!(!w(t.target)||!I(t.target))||void 0})),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(xt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var i=null;e&&this.mirror.hasNode(e)&&(i=this.mirror.getId(e)),i&&-1!==i&&(this.movedMap[Yt(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);kt(t,this.blockClass,this.blockSelector,!1)||(vt.childNodes(t).forEach((t=>this.genAdds(t))),Nt(t)&&vt.childNodes(vt.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}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 zt(t,e){t.delete(e),vt.childNodes(e).forEach((e=>zt(t,e)))}function Wt(t,e,i){return 0!==t.length&&function(t,e,i){var r,n=vt.parentNode(e),s=function(){var e=i.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=vt.parentNode(n)};for(;n;)if(r=s())return r.v;return!1}(t,e,i)}function Ut(t,e){return 0!==t.size&&Xt(t,e)}function Xt(t,e){var i=vt.parentNode(e);return!!i&&(!!t.has(i)||Xt(t,i))}var Jt=t=>{if(!jt)return t;return function(){try{return t(...arguments)}catch(t){if(jt&&!0===jt(t))return;throw t}}},Kt=[];function Qt(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function te(t,e){var i=new Gt;Kt.push(i),i.init(t);var r=new(dt())(Jt(i.processMutations.bind(i)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function ee(t){var{mouseInteractionCb:e,doc:r,mirror:n,blockClass:s,blockSelector:o,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(Bt).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=T(t),l=(t=>r=>{var a=Qt(r);if(!kt(a,s,o,!0)){var l=null,u=t;if("pointerType"in r){switch(r.pointerType){case"mouse":l=Zt.Mouse;break;case"touch":l=Zt.Touch;break;case"pen":l=Zt.Pen}l===Zt.Touch?Bt[t]===Bt.MouseDown?u="TouchStart":Bt[t]===Bt.MouseUp&&(u="TouchEnd"):Zt.Pen}else Tt(r)&&(l=Zt.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Zt.Touch||u.startsWith("Mouse")&&l===Zt.Mouse)&&(l=null)):Bt[t]===Bt.Click&&(l=h,h=null);var c=Tt(r)?r.changedTouches[0]:r;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Jt(e)(i({type:Bt[u],id:d,x:v,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(Bt[t]){case Bt.MouseDown:case Bt.MouseUp:a=a.replace("mouse","pointer");break;case Bt.TouchStart:case Bt.TouchEnd:return}u.push(ft(a,l,r))})),Jt((()=>{u.forEach((t=>t()))}))}function ie(t){var{scrollCb:e,doc:i,mirror:r,blockClass:n,blockSelector:s,sampling:o}=t;return ft("scroll",Jt(mt(Jt((t=>{var o=Qt(t);if(o&&!kt(o,n,s,!0)){var a=r.getId(o);if(o===i&&i.defaultView){var l=wt(i.defaultView);e({id:a,x:l.left,y:l.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),i)}var re=["INPUT","TEXTAREA","SELECT"],ne=new WeakMap;function se(t){return function(t,e){if(ue("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||ue("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||ue("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||ue("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var i=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(i)}else if(t.parentStyleSheet){var r=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(r)}return e}(t,[])}function oe(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}function ae(t,e){var i,r,n,{mirror:s,stylesheetManager:o}=t,a=null;a="#document"===e.nodeName?s.getId(e):s.getId(vt.host(e));var l="#document"===e.nodeName?null==(i=e.defaultView)?void 0:i.Document:null==(n=null==(r=e.ownerDocument)?void 0:r.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!==a&&-1!==a&&l&&u?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var t;return null==(t=u.get)?void 0:t.call(this)},set(t){var e,i=null==(e=u.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{o.adoptStyleSheets(t,a)}catch(t){}return i}}),Jt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function le(t,e){void 0===e&&(e={});var r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:i,mousemoveCb:r,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:h,canvasMutationCb:c,fontCb:d,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),i(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),r(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(r=te(t,t.doc));var s=function(t){var{mousemoveCb:e,sampling:i,doc:r,mirror:n}=t;if(!1===i.mousemove)return()=>{};var s,o="number"==typeof i.mousemove?i.mousemove:50,a="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=mt(Jt((t=>{var i=Date.now()-s;e(l.map((t=>(t.timeOffset-=i,t))),t),l=[],s=null})),a),h=Jt(mt(Jt((t=>{var e=Qt(t),{clientX:i,clientY:r}=Tt(t)?t.changedTouches[0]:t;s||(s=_t()),l.push({x:i,y:r,id:n.getId(e),timeOffset:_t()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Dt.Drag:t instanceof MouseEvent?Dt.MouseMove:Dt.TouchMove)})),o,{trailing:!1})),c=[ft("mousemove",h,r),ft("touchmove",h,r),ft("drag",h,r)];return Jt((()=>{c.forEach((t=>t()))}))}(t),o=ee(t),a=ie(t),l=function(t,e){var{viewportResizeCb:i}=t,{win:r}=e,n=-1,s=-1;return ft("resize",Jt(mt(Jt((()=>{var t=It(),e=Ct();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),r)}(t,{win:n}),u=function(t){var{inputCb:e,doc:r,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=t;function v(t){var e=Qt(t),i=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=vt.parentElement(e)),e&&n&&!(re.indexOf(n)<0)&&!kt(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var c=e.value,v=!1,p=M(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(u[n.toLowerCase()]||u[p])&&(c=A({element:e,maskInputOptions:u,tagName:n,type:p,value:c,maskInputFn:h})),f(e,d?{text:c,isChecked:v,userTriggered:i}:{text:c,isChecked:v});var g=e.name;"radio"===p&&g&&v&&r.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var i=t.value;f(t,d?{text:i,isChecked:!v,userTriggered:!1}:{text:i,isChecked:!v})}}))}}function f(t,r){var s=ne.get(t);if(!s||s.text!==r.text||s.isChecked!==r.isChecked){ne.set(t,r);var o=n.getId(t);Jt(e)(i({},r,{id:o}))}}var p=("last"===c.input?["change"]:["input","change"]).map((t=>ft(t,Jt(v),r))),g=r.defaultView;if(!g)return()=>{p.forEach((t=>t()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...y.map((t=>yt(t[0],t[1],{set(){Jt(v)({target:this,isTrusted:!1})}},!1,g)))),Jt((()=>{p.forEach((t=>t()))}))}(t),h=function(t){var{mediaInteractionCb:e,blockClass:i,blockSelector:r,mirror:n,sampling:s,doc:o}=t,a=Jt((t=>mt(Jt((s=>{var o=Qt(s);if(o&&!kt(o,i,r,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:h,loop:c}=o;e({type:t,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:c})}})),s.media||500))),l=[ft("play",a(qt.Play),o),ft("pause",a(qt.Pause),o),ft("seeked",a(qt.Seeked),o),ft("volumechange",a(qt.VolumeChange),o),ft("ratechange",a(qt.RateChange),o)];return Jt((()=>{l.forEach((t=>t()))}))}(t),c=()=>{},d=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:i,mirror:r,stylesheetManager:n}=t,{win:s}=e;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Jt(((t,e,s)=>{var[o,a]=s,{id:l,styleId:u}=oe(e,r,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&i({id:l,styleId:u,adds:[{rule:o,index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,i){void 0===i&&(i=this.cssRules.length);var r=t+" { "+e+" }";return s.CSSStyleSheet.prototype.insertRule.apply(this,[r,i])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=oe(e,r,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&i({id:a,styleId:l,removes:[{index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=oe(e,r,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&i({id:a,styleId:l,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=oe(e,r,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&i({id:a,styleId:l,replaceSync:o}),t.apply(e,s)}))}));var h={};he("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(he("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),he("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),he("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var c={};return Object.entries(h).forEach((t=>{var[e,s]=t;c[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Jt(((t,e,s)=>{var[o,a]=s,{id:l,styleId:u}=oe(e.parentStyleSheet,r,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&i({id:l,styleId:u,adds:[{rule:o,index:[...se(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=oe(e.parentStyleSheet,r,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&i({id:a,styleId:l,removes:[{index:[...se(e),o]}]}),t.apply(e,s)}))})})),Jt((()=>{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((t=>{var[e,i]=t;i.prototype.insertRule=c[e].insertRule,i.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n}),d=ae(t,t.doc),v=function(t,e){var{styleDeclarationCb:i,mirror:r,ignoreCSSAttributes:n,stylesheetManager:s}=t,{win:o}=e,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Jt(((t,e,o)=>{var l,[u,h,c]=o;if(n.has(u))return a.apply(e,[u,h,c]);var{id:d,styleId:v}=oe(null==(l=e.parentRule)?void 0:l.parentStyleSheet,r,s.styleMirror);return(d&&-1!==d||v&&-1!==v)&&i({id:d,styleId:v,set:{property:u,value:h,priority:c},index:se(e.parentRule)}),t.apply(e,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Jt(((t,e,o)=>{var a,[u]=o;if(n.has(u))return l.apply(e,[u]);var{id:h,styleId:c}=oe(null==(a=e.parentRule)?void 0:a.parentStyleSheet,r,s.styleMirror);return(h&&-1!==h||c&&-1!==c)&&i({id:h,styleId:c,remove:{property:u},index:se(e.parentRule)}),t.apply(e,o)}))}),Jt((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:i}=t,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(t,e,i){var r=new o(t,e,i);return s.set(r,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};var a=bt(i.fonts,"add",(function(t){return function(i){return setTimeout(Jt((()=>{var t=s.get(i);t&&(e(t),s.delete(i))})),0),t.apply(this,[i])}}));return n.push((()=>{r.FontFace=o})),n.push(a),Jt((()=>{n.forEach((t=>t()))}))}(t)));var p=function(t){var{doc:e,mirror:i,blockClass:r,blockSelector:n,selectionCb:s}=t,o=!0,a=Jt((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;u<l;u++){var h=t.getRangeAt(u),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;kt(c,r,n,!0)||kt(v,r,n,!0)||a.push({start:i.getId(c),startOffset:d,end:i.getId(v),endOffset:f})}s({ranges:a})}}));return a(),ft("selectionchange",a)}(t),g=function(t){var{doc:e,customElementCb:i}=t,r=e.defaultView;return r&&r.customElements?bt(r.customElements,"define",(function(t){return function(e,r,n){try{i({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,r,n])}})):()=>{}}(t),m=[];for(var y of t.plugins)m.push(y.observer(y.callback,n,y.options));return Jt((()=>{Kt.forEach((t=>t.reset())),null==r||r.disconnect(),s(),o(),a(),l(),u(),h(),c(),d(),v(),f(),p(),g(),m.forEach((t=>t()))}))}function ue(t){return void 0!==window[t]}function he(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ce{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,r){var n=i||this.getIdToRemoteIdMap(t),s=r||this.getRemoteIdToIdMap(t),o=n.get(e);return o||(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var i=this.getIdToRemoteIdMap(t),r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,i,r)))}getRemoteId(t,e,i){var r=i||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var n=r.get(e);return n||-1}getRemoteIds(t,e){var i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,i)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class de{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ce(V)),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=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ce(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var i,r;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(i=t.contentWindow)||i.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var i=this.crossOriginIframeMap.get(t.source);if(i){var r=this.transformCrossOriginEvent(i,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var i;switch(e.type){case Lt.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),{timestamp:e.timestamp,type:Lt.IncrementalSnapshot,data:{source:Dt.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Lt.Meta:case Lt.Load:case Lt.DomContentLoaded:return!1;case Lt.Plugin:return e;case Lt.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Lt.IncrementalSnapshot:switch(e.data.source){case Dt.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(e.node,i)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.Drag:case Dt.TouchMove:case Dt.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.ViewportResize:return!1;case Dt.MediaInteraction:case Dt.MouseInteraction:case Dt.Scroll:case Dt.CanvasMutation:case Dt.Input:return this.replaceIds(e.data,t,["id"]),e;case Dt.StyleSheetRule:case Dt.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Dt.Font:return e;case Dt.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Dt.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(i=e.data.styles)||i.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,i,r){for(var n of r)(Array.isArray(e[n])||"number"==typeof e[n])&&(Array.isArray(e[n])?e[n]=t.getIds(i,e[n]):e[n]=t.getId(i,e[n]));return e}replaceIds(t,e,i){return this.replace(this.crossOriginIframeMirror,t,e,i)}replaceStyleIds(t,e,i){return this.replace(this.crossOriginIframeStyleMirror,t,e,i)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===h.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class ve{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(I(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var r=te(i({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(ie(i({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(vt.host(t))),this.restoreHandlers.push(ae({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var i=this;this.restoreHandlers.push(bt(t.prototype,"attachShadow",(function(t){return function(r){var n=t.call(this,r),s=vt.shadowRoot(this);return s&&Pt(this)&&i.addShadowRoot(s,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ge=0;ge<64;ge++)pe[fe.charCodeAt(ge)]=ge;var me=new Map;var ye=(t,e,i)=>{if(t&&(we(t,e)||"object"==typeof t)){var r=function(t,e){var i=me.get(t);return i||(i=new Map,me.set(t,i)),i.has(e)||i.set(e,[]),i.get(e)}(i,t.constructor.name),n=r.indexOf(t);return-1===n&&(n=r.length,r.push(t)),n}};function be(t,e,i){if(t instanceof Array)return t.map((t=>be(t,e,i)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;e<r;e+=3)n+=fe[i[e]>>2],n+=fe[(3&i[e])<<4|i[e+1]>>4],n+=fe[(15&i[e+1])<<2|i[e+2]>>6],n+=fe[63&i[e+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[be(t.buffer,e,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var r=t.constructor.name,{src:n}=t;return{rr_type:r,src:n}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[be(t.data,e,i),t.width,t.height]}:we(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ye(t,e,i)}:t}var _e=(t,e,i)=>t.map((t=>be(t,e,i))),we=(t,e)=>{var i=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(i.find((i=>t instanceof e[i])))};function Ie(t,e,i,r){var n=[];try{var s=bt(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];if(!kt(this,e,i,!0)){var l=function(t){return"experimental-webgl"===t?"webgl":t}(n);if("__context"in this||(this.__context=l),r&&["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 t.apply(this,[n,...o])}}));n.push(s)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Ce(t,e,i,r,n,s){var o=[],a=Object.getOwnPropertyNames(t),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var l=bt(t,a,(function(t){return function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];var h=t.apply(this,l);if(ye(h,s,this),"tagName"in this.canvas&&!kt(this.canvas,r,n,!0)){var c=_e(l,s,this),d={type:e,property:a,args:c};i(this.canvas,d)}return h}}));o.push(l)}catch(r){var u=yt(t,a,{set(t){i(this.canvas,{type:e,property:a,args:[t],setter:!0})}});o.push(u)}};for(var u of a)l(u);return o}var Se,ke,xe,Ae,Te="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ee="undefined"!=typeof window&&window.Blob&&new Blob([(Se=Te,Uint8Array.from(atob(Se),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Me(t){var e;try{if(!(e=Ee&&(window.URL||window.webkitURL).createObjectURL(Ee)))throw"";var i=new Worker(e,{name:null==t?void 0:t.name});return i.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),i}catch(e){return new Worker("data:text/javascript;base64,"+Te,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Ne{constructor(t){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",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var{sampling:e="all",win:i,blockClass:r,blockSelector:n,recordCanvas:s,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(i,r,n),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,i,r,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(t,i,r,n,s){var o=this,a=Ie(i,r,n,!0),l=new Map,u=new Me;u.onmessage=t=>{var{id:e}=t.data;if(l.set(e,!1),"base64"in t.data){var{base64:i,type:r,width:n,height:s}=t.data;this.mutationCb({id:e,type:$t["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i}],type:r}]},0,0]}]})}};var h,c=1e3/t,d=0,v=t=>{var a,f;d&&t-d<c?h=requestAnimationFrame(v):(d=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{kt(t,r,n,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(i.document),a).forEach(function(){var t=e((function*(t){var e,i=o.mirror.getId(t);if(!l.get(i)&&0!==t.width&&0!==t.height){if(l.set(i,!0),["webgl","webgl2"].includes(t.__context)){var r=t.getContext(t.__context);!1===(null==(e=null==r?void 0:r.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}var n=t.clientWidth||t.width,a=t.clientHeight||t.height,h=yield createImageBitmap(t,{resizeWidth:n,resizeHeight:a});u.postMessage({id:i,bitmap:h,width:n,height:a,dataURLOptions:s.dataURLOptions},[h])}}));return function(e){return t.apply(this,arguments)}}()),h=requestAnimationFrame(v))};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,e,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=Ie(t,e,i,!1),n=function(t,e,i,r){var n=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(s){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[s])return 1;var o=bt(e.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return kt(this.canvas,i,r,!0)||setTimeout((()=>{var i=_e(a,e,this);t(this.canvas,{type:$t["2D"],property:s,args:i})}),0),n.apply(this,a)}}));n.push(o)}catch(i){var a=yt(e.CanvasRenderingContext2D.prototype,s,{set(e){t(this.canvas,{type:$t["2D"],property:s,args:[e],setter:!0})}});n.push(a)}};for(var a of s)o(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i),s=function(t,e,i,r){var n=[];return n.push(...Ce(e.WebGLRenderingContext.prototype,$t.WebGL,t,i,r,e)),void 0!==e.WebGL2RenderingContext&&n.push(...Ce(e.WebGL2RenderingContext.prototype,$t.WebGL2,t,i,r,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i);this.resetObservers=()=>{r(),n(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var i=this.pendingCanvasMutations.get(t);if(i&&-1!==e){var n=i.map((t=>r(t,s))),{type:o}=i[0];this.mutationCb({id:e,type:o,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Re{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Rt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var i=this;if(0!==t.length){var r={id:e,styleIds:[]},n=[],s=function(t){var e;i.styleMirror.has(t)?e=i.styleMirror.getId(t):(e=i.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,i)=>({rule:S(e,t.href),index:i})))})),r.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Fe{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var i=this.nodeMap.get(t);return i&&Array.from(i).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Oe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Pe=document.createElement("iframe");document.body.appendChild(Pe),Array.from=(null==(n=Pe.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pe)}}catch(t){console.debug("Unable to override Array.from",t)}var Le,De,Be=new x;function Ze(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:r,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:_={},mousemoveWait:w,recordDOM:I=!0,recordCanvas:C=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:M,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:R=new Set([]),errorHandler:F}=t;jt=F;var O=!S||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(t){P=!0}if(O&&!e)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==w&&void 0===b.mousemove&&(b.mousemove=w),Be.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(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var Z=0,q=t=>{for(var e of M||[])e.eventProcessor&&(t=e.eventProcessor(t));return y&&!P&&(t=y(t)),t};ke=(t,i)=>{var s,o=t;if(o.timestamp=_t(),!(null==(s=Kt[0])?void 0:s.isFrozen())||o.type===Lt.FullSnapshot||o.type===Lt.IncrementalSnapshot&&o.data.source===Dt.Mutation||Kt.forEach((t=>t.unfreeze())),O)null==e||e(q(o),i);else if(P){var a={type:"rrweb",event:q(o),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(o.type===Lt.FullSnapshot)L=o,Z=0;else if(o.type===Lt.IncrementalSnapshot){if(o.data.source===Dt.Mutation&&o.data.isAttachIframe)return;Z++;var l=n&&Z>=n,u=r&&o.timestamp-L.timestamp>r;(l||u)&&xe(!0)}};var H=t=>{ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.Mutation},t)})},V=t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.Scroll},t)}),j=t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.CanvasMutation},t)}),Y=new Re({mutationCb:H,adoptedStyleSheetCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.AdoptedStyleSheet},t)})}),G=new de({mirror:Be,mutationCb:H,stylesheetManager:Y,recordCrossOriginIframes:S,wrappedEmit:ke});for(var z of M||[])z.getMirror&&z.getMirror({nodeMirror:Be,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var W=new Fe;Ae=new Ne({recordCanvas:C,mutationCb:j,win:window,blockClass:s,blockSelector:o,mirror:Be,sampling:b.canvas,dataURLOptions:_});var U=new ve({mutationCb:H,scrollCb:V,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:_,maskTextFn:g,maskInputFn:p,recordCanvas:C,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:Y,canvasManager:Ae,keepIframeSrcFn:N,processedNodeManager:W},mirror:Be});xe=function(t){if(void 0===t&&(t=!1),I){ke({type:Lt.Meta,data:{href:window.location.href,width:Ct(),height:It()}},t),Y.reset(),U.init(),Kt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:i=new x,blockClass:r="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:_,keepIframeSrcFn:w=(()=>!1)}=e||{};return it(t,{doc:t,mirror:i,blockClass:r,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:_,keepIframeSrcFn:w,newlyAddedElement:!1})}(document,{mirror:Be,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:_,recordCanvas:C,inlineImages:E,onSerialize:t=>{Et(t,Be)&&G.addIframe(t),Mt(t,Be)&&Y.trackLinkElement(t),Nt(t)&&U.addShadowRoot(vt.shadowRoot(t),document)},onIframeLoad:(t,e)=>{G.attachIframe(t,e),U.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{Y.attachLinkElement(t,e)},keepIframeSrcFn:N});if(!e)return console.warn("Failed to snapshot the document");ke({type:Lt.FullSnapshot,data:{node:e,initialOffset:wt(window)}},t),Kt.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,Be.getId(document))}};try{var X=[],J=t=>{var e;return Jt(le)({mutationCb:H,mousemoveCb:(t,e)=>ke({type:Lt.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.MouseInteraction},t)}),scrollCb:V,viewportResizeCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.ViewportResize},t)}),inputCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.Input},t)}),mediaInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.MediaInteraction},t)}),styleSheetRuleCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.StyleSheetRule},t)}),styleDeclarationCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.StyleDeclaration},t)}),canvasMutationCb:j,fontCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.Font},t)}),selectionCb:t=>{ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.Selection},t)})},customElementCb:t=>{ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.CustomElement},t)})},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:h,maskInputOptions:D,inlineStylesheet:c,sampling:b,recordDOM:I,recordCanvas:C,inlineImages:E,userTriggeredOnInput:A,collectFonts:T,doc:t,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:o,slimDOMOptions:B,dataURLOptions:_,mirror:Be,iframeManager:G,stylesheetManager:Y,shadowDomManager:U,processedNodeManager:W,canvasManager:Ae,ignoreCSSAttributes:R,plugins:(null==(e=null==M?void 0:M.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ke({type:Lt.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},m)};G.addLoadListener((t=>{try{X.push(J(t.contentDocument))}catch(t){console.warn(t)}}));var K=()=>{xe(),X.push(J(document)),Oe=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(ft("DOMContentLoaded",(()=>{ke({type:Lt.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(ft("load",(()=>{ke({type:Lt.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((t=>t())),W.destroy(),Oe=!1,jt=void 0}}catch(t){console.warn(t)}}Ze.addCustomEvent=(t,e)=>{if(!Oe)throw new Error("please add custom event after start recording");ke({type:Lt.Custom,data:{tag:t,payload:e}})},Ze.freezePage=()=>{Kt.forEach((t=>t.freeze()))},Ze.takeFullSnapshot=t=>{if(!Oe)throw new Error("please take full snapshot after start recording");xe(t)},Ze.mirror=Be,(De=Le||(Le={}))[De.NotStarted=0]="NotStarted",De[De.Running=1]="Running",De[De.Stopped=2]="Stopped";var $e,qe=Object.defineProperty,He=(t,e,i)=>((t,e,i)=>e in t?qe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Ve=Object.defineProperty,je=(t,e,i)=>((t,e,i)=>e in t?Ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Ye=Object.defineProperty,Ge=(t,e,i)=>((t,e,i)=>e in t?Ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),ze={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},We={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ue={};function Xe(t){if(Ue[t])return Ue[t];var e=globalThis[t],i=e.prototype,r=t in ze?ze[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in We?We[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return Ue[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?Ue[t]=u:i}catch(t){return i}}var Je={};function Ke(t,e,i){var r,n=t+"."+String(i);if(Je[n])return Je[n].call(e);var s=Xe(t),o=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return o?(Je[n]=o,o.call(e)):e[i]}var Qe={};function ti(t,e,i){var r=t+"."+String(i);if(Qe[r])return Qe[r].bind(e);var n=Xe(t)[i];return"function"!=typeof n?e[i]:(Qe[r]=n,n.bind(e))}var ei={childNodes:function(t){return Ke("Node",t,"childNodes")},parentNode:function(t){return Ke("Node",t,"parentNode")},parentElement:function(t){return Ke("Node",t,"parentElement")},textContent:function(t){return Ke("Node",t,"textContent")},contains:function(t,e){return ti("Node",t,"contains")(e)},getRootNode:function(t){return ti("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ke("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ke("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ke("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ke("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Xe("MutationObserver").constructor}};class ii{constructor(){Ge(this,"idNodeMap",new Map),Ge(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var i=null==(e=this.getMeta(t))?void 0:e.id;return null!=i?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var i=e.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ri(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&ri(ei.parentNode(t),e,i);for(var r=t.classList.length;r--;){var n=t.classList[r];if(e.test(n))return!0}return!!i&&ri(ei.parentNode(t),e,i)}class ni{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 t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof ni))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(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var si={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},oi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ai={};function li(t){if(ai[t])return ai[t];var e=globalThis[t],i=e.prototype,r=t in si?si[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in oi?oi[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return ai[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?ai[t]=u:i}catch(t){return i}}var ui={};function hi(t,e,i){var r,n=t+"."+String(i);if(ui[n])return ui[n].call(e);var s=li(t),o=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return o?(ui[n]=o,o.call(e)):e[i]}var ci={};function di(t,e,i){var r=t+"."+String(i);if(ci[r])return ci[r].bind(e);var n=li(t)[i];return"function"!=typeof n?e[i]:(ci[r]=n,n.bind(e))}var vi={childNodes:function(t){return hi("Node",t,"childNodes")},parentNode:function(t){return hi("Node",t,"parentNode")},parentElement:function(t){return hi("Node",t,"parentElement")},textContent:function(t){return hi("Node",t,"textContent")},contains:function(t,e){return di("Node",t,"contains")(e)},getRootNode:function(t){return di("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?hi("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?hi("Element",t,"shadowRoot"):null},querySelector:function(t,e){return hi("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return hi("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return li("MutationObserver").constructor}};var fi="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.",pi={map:{},getId:()=>(console.error(fi),-1),getNode:()=>(console.error(fi),null),removeNodeFromMap(){console.error(fi)},has:()=>(console.error(fi),!1),reset(){console.error(fi)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pi=new Proxy(pi,{get:(t,e,i)=>("map"===e&&console.error(fi),Reflect.get(t,e,i))}));var gi=Date.now;function mi(t){return t?t.nodeType===t.ELEMENT_NODE?t:vi.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(gi=()=>(new Date).getTime());function yi(t){var e,i=null;return"getRootNode"in t&&(null==(e=vi.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vi.host(vi.getRootNode(t))&&(i=vi.host(vi.getRootNode(t))),i}function bi(t){for(var e,i=t;e=yi(i);)i=e;return i}function _i(t){var e=t.ownerDocument;if(!e)return!1;var i=bi(t);return vi.contains(e,i)}for(var wi=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){je(this,"id",1),je(this,"styleIDMap",new WeakMap),je(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return pi},closestElementOfNode:mi,getBaseDimension:function t(e,i){var r,n,s=null==(n=null==(r=e.ownerDocument)?void 0:r.defaultView)?void 0:n.frameElement;if(!s||s===i)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=s.getBoundingClientRect(),a=t(s,i),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 t(e,i){var r=e[i[0]];return 1===i.length?r:t(r.cssRules[i[1]].cssRules,i.slice(2))},getPositionsAndIndex:function(t){var e=[...t],i=e.pop();return{positions:e,index:i}},getRootShadowHost:bi,getShadowHost:yi,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=vi.parentElement(s.body))?void 0:e.scrollLeft)||(null==(i=null==s?void 0:s.body)?void 0:i.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(r=vi.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof ni&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vi.shadowRoot(t)))},hookSetter:function t(e,i,r,n,s){void 0===s&&(s=window);var o=s.Object.getOwnPropertyDescriptor(e,i);return s.Object.defineProperty(e,i,n?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>t(e,i,o||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(vi.contains(e,t)||_i(t))},isAncestorRemoved:function t(e,i){if(n=(r=e)&&"host"in r&&"mode"in r&&ei.host(r)||null,Boolean(n&&"shadowRoot"in n&&ei.shadowRoot(n)===r))return!1;var r,n,s=i.getId(e);if(!i.has(s))return!0;var o=vi.parentNode(e);return(!o||o.nodeType!==e.DOCUMENT_NODE)&&(!o||t(o,i))},isBlocked:function(t,e,i,r){if(!t)return!1;var n=mi(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if(ri(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1},isIgnored:function(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))},iterateResolveTree:function t(e,i){i(e.value);for(var r=e.children.length-1;r>=0;r--)t(e.children[r],i)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return gi},on:function(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>i.removeEventListener(t,e,r)},patch:function(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n=i(r);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=n,()=>{t[e]=r}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},i=(t,i)=>{var r={value:t,parent:i,children:[]};return e[t.node.id]=r,r},r=[];for(var n of t){var{nextId:s,parentId:o}=n;if(s&&s in e){var a=e[s];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,i(n,a.parent))}else{var u=r.indexOf(a);r.splice(u,0,i(n,null))}}else if(o in e){var h=e[o];h.children.push(i(n,h))}else r.push(i(n,null))}return r},shadowHostInDom:_i,throttle:function(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;u<=0||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,o)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,o)}),u))}},uniqueTextMutations:function(t){for(var e=new Set,i=[],r=t.length;r--;){var n=t[r];e.has(n.id)||(i.push(n),e.add(n.id))}return i}},Symbol.toStringTag,{value:"Module"})),Ii="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ci="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Si=0;Si<64;Si++)Ci[Ii.charCodeAt(Si)]=Si;var ki;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var xi=document.createElement("iframe");document.body.appendChild(xi),Array.from=(null==($e=xi.contentWindow)?void 0:$e.Array.from)||Array.from,document.body.removeChild(xi)}}catch(t){console.debug("Unable to override Array.from",t)}new ii,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(ki||(ki={}));class Ai{constructor(t){He(this,"fileName"),He(this,"functionName"),He(this,"lineNumber"),He(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var Ti=/(^|@)\S+:\d+/,Ei=/^\s*at .*(\S+:\d+|\(native\))/m,Mi=/^(eval@)?(\[native code])?$/,Ni={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Ei)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ei)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),i=e.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(e=i?e.replace(i[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(i?i[1]:r.pop()),s=r.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Ai({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Mi)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ai({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ai({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,i=t.message.split("\n"),r=[],n=2,s=i.length;n<s;n+=2){var o=e.exec(i[n]);o&&r.push(new Ai({fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=t.stacktrace.split("\n"),r=[],n=0,s=i.length;n<s;n+=2){var o=e.exec(i[n]);o&&r.push(new Ai({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ti)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),i=this.extractLocation(e.pop()),r=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ai({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)}};function Ri(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var i=t.localName;if(!i)break;i=i.toLowerCase();var r=t.parentElement,n=[];if(r.children&&r.children.length>0)for(var s=0;s<r.children.length;s++){var o=r.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===i&&n.push(o)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function Fi(t){return"[object Object]"===Object.prototype.toString.call(t)}function Oi(t,e){if(0===e)return!0;var i=Object.keys(t);for(var r of i)if(Fi(t[r])&&Oi(t[r],e-1))return!0;return!1}function Pi(t,e){var i={numOfKeysLimit:50,depthOfLimit:4};Object.assign(i,e);var r=[],n=[];return JSON.stringify(t,(function(t,e){if(r.length>0){var s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?n.splice(s,1/0,t):n.push(t),~r.indexOf(e)&&(e=r[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(e)).join(".")+"]")}else r.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Fi(t)&&Object.keys(t).length>i.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Fi(t)&&Oi(t,i.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();i.stringLengthLimit&&e.length>i.stringLengthLimit&&(e=e.slice(0,i.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var a in e){var l=e[a];Array.isArray(l)?o[a]=Ri(l.length?l[0]:null):o[a]=l}return o}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Li={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 Di(t,e,i){var r,n=i?Object.assign({},Li,i):Li,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message,r=e.error,s=Ni.parse(r).map((t=>t.toString())),o=[Pi(i,n.stringifyOptions)];t({level:"error",trace:s,payload:o})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var i,r;e.reason instanceof Error?r=[Pi("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[Pi("Uncaught (in promise)",n.stringifyOptions),Pi(e.reason,n.stringifyOptions)]);var s=Ni.parse(i).map((t=>t.toString()));t({level:"error",trace:s,payload:r})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)l.push(d(r,c));return()=>{l.forEach((t=>t()))};function d(e,i){var r=this;return e[i]?wi.patch(e,i,(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];if(e.apply(r,l),!("assert"===i&&l[0]||a)){a=!0;try{var h=Ni.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===i?l.slice(1):l).map((t=>Pi(t,n.stringifyOptions)));++o<n.lengthThreshold?t({level:i,trace:h,payload:c}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Pi("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})):()=>{}}}var Bi=t=>({name:"rrweb/console@1",observer:Di,options:t}),Zi=["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"],$i=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return Zi.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))},qi=["$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 Hi(t,e){return-1!==t.indexOf(e)}var Vi=function(t){return t.trim()},ji=function(t){return t.replace(/^\$/,"")};var Yi=Array.isArray,Gi=Object.prototype,zi=Gi.hasOwnProperty,Wi=Gi.toString,Ui=Yi||function(t){return"[object Array]"===Wi.call(t)},Xi=t=>"function"==typeof t,Ji=t=>Xi(t)&&-1!==t.toString().indexOf("[native code]"),Ki=t=>t===Object(t)&&!Ui(t),Qi=t=>{if(Ki(t)){for(var e in t)if(zi.call(t,e))return!1;return!0}return!1},tr=t=>void 0===t,er=t=>"[object String]"==Wi.call(t),ir=t=>er(t)&&0===t.trim().length,rr=t=>null===t,nr=t=>tr(t)||rr(t),sr=t=>"[object Number]"==Wi.call(t),or=t=>"[object Boolean]"===Wi.call(t),ar=t=>t instanceof FormData,lr=t=>Hi(qi,t);function ur(t){return null===t||"object"!=typeof t}function hr(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function cr(t){return!tr(Event)&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var dr=[!0,"true",1,"1","yes"],vr=t=>Hi(dr,t),fr=[!1,"false",0,"0","no"];function pr(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),sr(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):t<e?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+n),pr(n||i,e,i,r))}class gr{constructor(t){this.o={},this.h=t.h,this.m=pr(t.bucketSize,0,100,t.I),this.C=pr(t.refillRate,0,this.m,t.I),this.S=pr(t.refillInterval,0,864e5,t.I)}k(t,e){var i=e-t.lastAccess,r=Math.floor(i/this.S);if(r>0){var n=r*this.C;t.tokens=Math.min(t.tokens+n,this.m),t.lastAccess=t.lastAccess+r*this.S}}consumeRateLimit(t){var e,i=Date.now(),r=String(t),n=this.o[r];return n?this.k(n,i):(n={tokens:this.m,lastAccess:i},this.o[r]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.h)||e.call(this,t)),0===n.tokens)}stop(){this.o={}}}var mr="Mobile",yr="iOS",br="Android",_r="Tablet",wr=br+" "+_r,Ir="iPad",Cr="Apple",Sr=Cr+" Watch",kr="Safari",xr="BlackBerry",Ar="Samsung",Tr=Ar+"Browser",Er=Ar+" Internet",Mr="Chrome",Nr=Mr+" OS",Rr=Mr+" "+yr,Fr="Internet Explorer",Or=Fr+" "+mr,Pr="Opera",Lr=Pr+" Mini",Dr="Edge",Br="Microsoft "+Dr,Zr="Firefox",$r=Zr+" "+yr,qr="Nintendo",Hr="PlayStation",Vr="Xbox",jr=br+" "+mr,Yr=mr+" "+kr,Gr="Windows",zr=Gr+" Phone",Wr="Nokia",Ur="Ouya",Xr="Generic",Jr=Xr+" "+mr.toLowerCase(),Kr=Xr+" "+_r.toLowerCase(),Qr="Konqueror",tn="(\\d+(\\.\\d+)?)",en=new RegExp("Version/"+tn),rn=new RegExp(Vr,"i"),nn=new RegExp(Hr+" \\w+","i"),sn=new RegExp(qr+" \\w+","i"),on=new RegExp(xr+"|PlayBook|BB10","i"),an={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var ln,un,hn,cn=(t,e)=>e&&Hi(e,Cr)||function(t){return Hi(t,kr)&&!Hi(t,Mr)&&!Hi(t,br)}(t),dn=function(t,e){return e=e||"",Hi(t," OPR/")&&Hi(t,"Mini")?Lr:Hi(t," OPR/")?Pr:on.test(t)?xr:Hi(t,"IE"+mr)||Hi(t,"WPDesktop")?Or:Hi(t,Tr)?Er:Hi(t,Dr)||Hi(t,"Edg/")?Br:Hi(t,"FBIOS")?"Facebook "+mr:Hi(t,"UCWEB")||Hi(t,"UCBrowser")?"UC Browser":Hi(t,"CriOS")?Rr:Hi(t,"CrMo")||Hi(t,Mr)?Mr:Hi(t,br)&&Hi(t,kr)?jr:Hi(t,"FxiOS")?$r:Hi(t.toLowerCase(),Qr.toLowerCase())?Qr:cn(t,e)?Hi(t,mr)?Yr:kr:Hi(t,Zr)?Zr:Hi(t,"MSIE")||Hi(t,"Trident/")?Fr:Hi(t,"Gecko")?Zr:""},vn={[Or]:[new RegExp("rv:"+tn)],[Br]:[new RegExp(Dr+"?\\/"+tn)],[Mr]:[new RegExp("("+Mr+"|CrMo)\\/"+tn)],[Rr]:[new RegExp("CriOS\\/"+tn)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+tn)],[kr]:[en],[Yr]:[en],[Pr]:[new RegExp("(Opera|OPR)\\/"+tn)],[Zr]:[new RegExp(Zr+"\\/"+tn)],[$r]:[new RegExp("FxiOS\\/"+tn)],[Qr]:[new RegExp("Konqueror[:/]?"+tn,"i")],[xr]:[new RegExp(xr+" "+tn),en],[jr]:[new RegExp("android\\s"+tn,"i")],[Er]:[new RegExp(Tr+"\\/"+tn)],[Fr]:[new RegExp("(rv:|MSIE )"+tn)],Mozilla:[new RegExp("rv:"+tn)]},fn=function(t,e){var i=dn(t,e),r=vn[i];if(tr(r))return null;for(var n=0;n<r.length;n++){var s=r[n],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},pn=[[new RegExp(Vr+"; "+Vr+" (.*?)[);]","i"),t=>[Vr,t&&t[1]||""]],[new RegExp(qr,"i"),[qr,""]],[new RegExp(Hr,"i"),[Hr,""]],[on,[xr,""]],[new RegExp(Gr,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[zr,""];if(new RegExp(mr).test(e)&&!/IEMobile\b/.test(e))return[Gr+" "+mr,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=i[1],n=an[r]||"";return/arm/i.test(e)&&(n="RT"),[Gr,n]}return[Gr,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[yr,e.join(".")]}return[yr,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=tr(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+br+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+br+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[br,e.join(".")]}return[br,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var i=[t[1],t[2],t[3]||"0"];e[1]=i.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Nr,""]],[/Linux|debian/i,["Linux",""]]],gn=function(t){return sn.test(t)?qr:nn.test(t)?Hr:rn.test(t)?Vr:new RegExp(Ur,"i").test(t)?Ur:new RegExp("("+zr+"|WPDesktop)","i").test(t)?zr:/iPad/.test(t)?Ir:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Sr:on.test(t)?xr:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Wr,"i").test(t)?Wr:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(mr).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?br:wr:new RegExp("(pda|"+mr+")","i").test(t)?Jr:new RegExp(_r,"i").test(t)&&!new RegExp(_r+" pc","i").test(t)?Kr:""},mn=function(t){var e=gn(t);return e===Ir||e===wr||"Kobo"===e||"Kindle Fire"===e||e===Kr?_r:e===qr||e===Vr||e===Hr||e===Ur?"Console":e===Sr?"Wearable":e?mr:"Desktop"},yn=t=>t instanceof Error;function bn(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return hn&&i.length===un||(un=i.length,hn=i.reduce(((i,r)=>{ln||(ln={});var n=ln[r];if(n)i[n[0]]=n[1];else for(var s=t(r),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=e[r];if(l&&u){i[l]=u,ln[r]=[l,u];break}}return i}),{})),hn}}class _n{constructor(t,e,i){void 0===i&&(i=[]),this.coercers=t,this.stackParser=e,this.modifiers=i}buildFromUnknown(t,e){void 0===e&&(e={});var i=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,e,0).apply(t),n=this.buildParsingContext(),s=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(s,i),$exception_level:"error"}}modifyFrames(t){var i=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Ui(e.stacktrace.frames)&&(e.stacktrace.frames=yield i.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var r,n;return null!=t.cause&&(r=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?1:0),e.chunkIdMap)),i({},t,{cause:r,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var i of this.coercers)if(i.match(t))return i.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var i=this;return e((function*(){var e=t;for(var r of i.modifiers)e=yield r(e);return e}))()}convertToExceptionList(t,e){var r,n,s,o={type:t.type,value:t.value,mechanism:{type:null!==(r=e.type)&&void 0!==r?r:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,i({},e,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:bn(this.stackParser)}}buildCoercingContext(t,e,r){void 0===r&&(r=0);var n=(i,r)=>{if(r<=4){var n=this.buildCoercingContext(t,e,r);return this.applyCoercers(i,n)}};return i({},e,{syntheticException:0==r?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,r),next:t=>n(t,r+1)})}}var wn="?";function In(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?wn:i,in_app:!0};return tr(r)||(s.lineno=r),tr(n)||(s.colno=n),s}var Cn=(t,e)=>{var i=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return i||r?[-1!==t.indexOf("@")?t.split("@")[0]:wn,i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Sn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,kn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,xn=/\((\S*)(?::(\d+))(?::(\d+))\)/,An=(t,e)=>{var i=Sn.exec(t);if(i){var[,r,n,s]=i;return In(e,r,wn,+n,+s)}var o=kn.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=xn.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=Cn(o[1]||wn,o[2]);return In(e,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Tn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,En=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Mn=(t,e)=>{var i=Tn.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=En.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var n=i[3],s=i[1]||wn;return[s,n]=Cn(s,n),In(e,n,s,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},Nn=/\(error: (.*)\)/,Rn=50;function Fn(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],o=e.split("\n"),a=n;a<o.length;a++){var l=o[a];if(!(l.length>1024)){var u=Nn.test(l)?l.replace(Nn,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of r){var c=h(u,t);if(c){s.push(c);break}}if(s.length>=Rn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Rn).map((t=>{return i({},t,{filename:t.filename||(r=e,r[r.length-1]||{}).filename,function:t.function||wn});var r}))}(s)}}class On{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=er(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:i?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return hr(t,"DOMException")}isDOMError(t){return hr(t,"DOMError")}}class Pn{match(t){return(t=>t instanceof Error)(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var i=t.message;return i.error&&"string"==typeof i.error.message?String(i.error.message):String(i)}getStack(t){return t.stacktrace||t.stack||void 0}}class Ln{constructor(){}match(t){return hr(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var i,r=e.apply(t.error);return r||{type:"ErrorEvent",value:t.message,stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}var Dn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Bn{match(t){return"string"==typeof t}coerce(t,e){var i,[r,n]=this.getInfos(t);return{type:null!=r?r:"Error",value:null!=n?n:t,stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(t){var e="Error",i=t,r=t.match(Dn);return r&&(e=r[1],i=r[2]),[e,i]}}var Zn=["fatal","error","warning","log","info","debug"];function $n(t,e){void 0===e&&(e=40);var i=Object.keys(t);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var n=i.slice(0,r).join(", ");if(!(n.length>e))return r===i.length||n.length<=e?n:n.slice(0,e)+"..."}return""}class qn{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var i,r=this.getErrorPropertyFromObject(t);return r?e.apply(r):{type:this.getType(t),value:this.getValue(t),stack:null==(i=e.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return cr(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var i=this.getObjectClassName(t);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+$n(t)}isSeverityLevel(t){return er(t)&&!ir(t)&&Zn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var i=t[e];if(yn(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Hn{match(t){return cr(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+$n(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Vn{match(t){return ur(t)}coerce(t,e){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class jn{match(t){return hr(t,"PromiseRejectionEvent")}coerce(t,e){var i,r=this.getUnhandledRejectionReason(t);return ur(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){if(ur(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Yn="undefined"!=typeof window?window:void 0,Gn="undefined"!=typeof globalThis?globalThis:Yn;"undefined"==typeof self&&(Gn.self=Gn),"undefined"==typeof File&&(Gn.File=function(){});var zn=Array.prototype,Wn=zn.forEach,Un=zn.indexOf,Xn=null==Gn?void 0:Gn.navigator,Jn=null==Gn?void 0:Gn.document,Kn=null==Gn?void 0:Gn.location,Qn=null==Gn?void 0:Gn.fetch,ts=null!=Gn&&Gn.XMLHttpRequest&&"withCredentials"in new Gn.XMLHttpRequest?Gn.XMLHttpRequest:void 0,es=null==Gn?void 0:Gn.AbortController,is=null==Xn?void 0:Xn.userAgent,rs=null!=Yn?Yn:{},ns=()=>!!Yn.Zone,ss=t=>t instanceof Document,os={DEBUG:!1,LIB_VERSION:"1.315.0"},as=function(t,e){var{debugEnabled:i}=void 0===e?{}:e,r={A:function(e){if(Yn&&(os.DEBUG||rs.POSTHOG_DEBUG||i)&&!tr(Yn.console)&&Yn.console){for(var r=("__rrweb_original__"in Yn.console[e]?Yn.console[e].__rrweb_original__:Yn.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];r(t,...s)}},info:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];r.A("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];r.A("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];r.A("error",...e)},critical:function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning:t=>{r.error("You must initialize PostHog before calling "+t)},createLogger:(e,i)=>as(t+" "+e,i)};return r},ls=as("[PostHog.js]"),us=ls.createLogger,hs={};function cs(t,e,i){if(Ui(t))if(Wn&&t.forEach===Wn)t.forEach(e,i);else if("length"in t&&t.length===+t.length)for(var r=0,n=t.length;r<n;r++)if(r in t&&e.call(i,t[r],r)===hs)return}function ds(t,e,i){if(!nr(t)){if(Ui(t))return cs(t,e,i);if(ar(t)){for(var r of t.entries())if(e.call(i,r[1],r[0])===hs)return}else for(var n in t)if(zi.call(t,n)&&e.call(i,t[n],n)===hs)return}}var vs=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];return cs(i,(function(e){for(var i in e)void 0!==e[i]&&(t[i]=e[i])})),t},fs=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];return cs(i,(function(e){cs(e,(function(e){t.push(e)}))})),t};function ps(t){for(var e=Object.keys(t),i=e.length,r=new Array(i);i--;)r[i]=[e[i],t[e[i]]];return r}var gs=function(t){try{return t()}catch(t){return}},ms=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){ls.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ls.critical(t)}}},ys=function(t){var e={};return ds(t,(function(t,i){(er(t)&&t.length>0||sr(t))&&(e[i]=t)})),e};function bs(t,e){return i=t,r=t=>er(t)&&!rr(e)?t.slice(0,e):t,n=new Set,function t(e,i){return e!==Object(e)?r?r(e,i):e:n.has(e)?void 0:(n.add(e),Ui(e)?(s=[],cs(e,(e=>{s.push(t(e))}))):(s={},ds(e,((e,i)=>{n.has(e)||(s[i]=t(e,i))}))),s);var s}(i);var i,r,n}var _s=["herokuapp.com","vercel.app","netlify.app"];function ws(t){var e=null==t?void 0:t.hostname;if(!er(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of _s)if(i===r)return!1;return!0}function Is(t,e){for(var i=0;i<t.length;i++)if(e(t[i]))return t[i]}function Cs(t,e,i,r){var{capture:n=!1,passive:s=!0}=null!=r?r:{};null==t||t.addEventListener(e,i,{capture:n,passive:s})}var Ss=t=>{var e=null==Jn?void 0:Jn.createElement("a");return tr(e)?null:(e.href=t,e)},ks=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return ds(t,(function(t,e){tr(t)||tr(e)||"undefined"===e||(i=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(e),n[n.length]=r+"="+i)})),n.join(e)},xs=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<r.length;n++){var s=r[n].split("=");if(s[0]===e){i=s;break}}if(!Ui(i)||i.length<2)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){ls.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},As=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[0]||"",s=r[1],o=n.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),h=[],c=0;c<u.length;c++){var d=u[c].split("=");Ui(d)&&(e.includes(d[0])?h.push(d[0]+"="+i):h.push(u[c]))}var v=l;return null!=a&&(v+="?"+h.join("&")),null!=s&&(v+="#"+s),v},Ts=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null};function Es(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n=i(r);return Xi(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=r}}catch(t){return()=>{}}}function Ms(t,e){var i,r=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:r,isHostDenied:!1};if(null==(i=e.payloadHostDenyList)||!i.length||null==r||!r.trim().length)return n;for(var s of e.payloadHostDenyList)if(r.endsWith(s))return{hostname:r,isHostDenied:!0};return n}var Ns="$people_distinct_id",Rs="__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",Zs="$web_vitals_enabled_server_side",$s="$dead_clicks_enabled_server_side",qs="$product_tours_enabled_server_side",Hs="$web_vitals_allowed_metrics",Vs="$session_recording_remote_config",js="$sesid",Ys="$session_is_sampled",Gs="$enabled_feature_flags",zs="$early_access_features",Ws="$feature_flag_details",Us="$stored_person_properties",Xs="$stored_group_properties",Js="$surveys",Ks="$flag_call_reported",Qs="$user_state",to="$client_session_props",eo="$capture_rate_limit",io="$initial_campaign_params",ro="$initial_referrer_info",no="$initial_person_info",so="$epp",oo="__POSTHOG_TOOLBAR__",ao="$posthog_cookieless",lo=[Ns,Rs,"__cmpns",Fs,"$session_recording_enabled_server_side",Ps,js,Gs,Ds,Qs,zs,Ws,Xs,Us,Js,Ks,to,eo,io,ro,so,no,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function uo(t){return t instanceof Element&&(t.id===oo||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function ho(t){return!!t&&1===t.nodeType}function co(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function vo(t){return!!t&&3===t.nodeType}function fo(t){return!!t&&11===t.nodeType}function po(t){return t?Vi(t).split(/\s+/):[]}function go(t){var e=null==Yn?void 0:Yn.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function mo(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return po(e)}function yo(t){return nr(t)?null:Vi(t).split(/(\s+)/).filter((t=>Zo(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function bo(t){var e="";return No(t)&&!Ro(t)&&t.childNodes&&t.childNodes.length&&ds(t.childNodes,(function(t){var i;vo(t)&&t.textContent&&(e+=null!==(i=yo(t.textContent))&&void 0!==i?i:"")})),Vi(e)}function _o(t){return tr(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var wo=["a","button","form","input","select","textarea","label"];function Io(t,e){if(tr(e))return!0;var i,r=function(t){if(e.some((e=>t.matches(e))))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function Co(t){var e=t.parentNode;return!(!e||!ho(e))&&e}var So=["next","previous","prev",">","<"],ko=10;var xo=[".ph-no-rageclick",".ph-no-capture"];function Ao(t,e){if(!Yn||To(t))return!1;var i,r,n;or(e)?(i=!!e&&xo,r=void 0):(i=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:xo,r=null==e?void 0:e.content_ignorelist);if(!1===i)return!1;var{targetElementList:s}=Eo(t,!1);return!function(t,e){if(!1===t||tr(t))return!1;var i;if(!0===t)i=So;else{if(!Ui(t))return!1;if(t.length>ko)return ls.error("[PostHog] content_ignorelist array cannot exceed "+ko+" items. Use css_selector_ignorelist for more complex matching."),!1;i=t.map((t=>t.toLowerCase()))}return e.some((t=>{var{safeText:e,ariaLabel:r}=t;return i.some((t=>e.includes(t)||r.includes(t)))}))}(r,s.map((t=>{var e;return{safeText:bo(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Io(s,i)}var To=t=>!t||co(t,"html")||!ho(t),Eo=(t,e)=>{if(!Yn||To(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[t],n=t;n.parentNode&&!co(n,"body");)if(fo(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var s=Co(n);if(!s)break;if(e||wo.indexOf(s.tagName.toLowerCase())>-1)i=!0;else{var o=Yn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}r.push(s),n=s}return{parentIsUsefulElement:i,targetElementList:r}};function Mo(t,e,i,r,n){var s,o,a,l;if(void 0===i&&(i=void 0),!Yn||To(t))return!1;if(null!=(s=i)&&s.url_allowlist&&!go(i.url_allowlist))return!1;if(null!=(o=i)&&o.url_ignorelist&&go(i.url_ignorelist))return!1;if(null!=(a=i)&&a.dom_event_allowlist){var u=i.dom_event_allowlist;if(u&&!u.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Eo(t,r);if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(tr(i))return!0;var r,n=function(t){if(i.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(c,i))return!1;if(!Io(c,null==(l=i)?void 0:l.css_selector_allowlist))return!1;var d=Yn.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0;var v=t.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return h?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(wo.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}function No(t){for(var e=t;e.parentNode&&!co(e,"body");e=e.parentNode){var i=mo(e);if(Hi(i,"ph-sensitive")||Hi(i,"ph-no-capture"))return!1}if(Hi(mo(t),"ph-include"))return!0;var r=t.type||"";if(er(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(er(n)){if(/^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,"")))return!1}return!0}function Ro(t){return!!(co(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||co(t,"select")||co(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Fo="(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})",Oo=new RegExp("^(?:"+Fo+")$"),Po=new RegExp(Fo),Lo="\\d{3}-?\\d{2}-?\\d{4}",Do=new RegExp("^("+Lo+")$"),Bo=new RegExp("("+Lo+")");function Zo(t,e){if(void 0===e&&(e=!0),nr(t))return!1;if(er(t)){if(t=Vi(t),(e?Oo:Po).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Do:Bo).test(t))return!1}return!0}function $o(t){var e=bo(t);return Zo(e=(e+" "+qo(t)).trim())?e:""}function qo(t){var e="";return t&&t.childNodes&&t.childNodes.length&&ds(t.childNodes,(function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=bo(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+qo(t)).trim())}catch(t){ls.error("[AutoCapture]",t)}})),e}function Ho(t){return function(t){var e=t.map((t=>{var e,r,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var o=i({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(r=t.nth_of_type)&&void 0!==r?r:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return ps(o).sort(((t,e)=>{var[i]=t,[r]=e;return i.localeCompare(r)})).forEach((t=>{var[e,i]=t;return a[Vo(e.toString())]=Vo(i.toString())})),n+=":",n+=ps(a).map((t=>{var[e,i]=t;return e+'="'+i+'"'})).join("")}));return e.join(";")}(function(t){return t.map((t=>{var e,i,r={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(i=t.attr__href)?void 0:i.slice(0,2048),attr_class:jo(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return ps(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,i]=t;return r.attributes[e]=i})),r}))}(t))}function Vo(t){return t.replace(/"|\\"/g,'\\"')}function jo(t){var e=t.attr__class;return e?Ui(e)?e:po(e):void 0}var Yo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Go=us("[Recorder]"),zo=t=>"navigation"===t.entryType,Wo=t=>"resource"===t.entryType;function Uo(t,e,i){if(i.recordInitialRequests){var r=e.performance.getEntries().filter((t=>zo(t)||Wo(t)&&i.initiatorTypes.includes(t.initiatorType)));t({requests:r.flatMap((t=>ia({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var r=e.getEntries().filter((t=>zo(t)||Wo(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:r.flatMap((t=>ia({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>i.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}function Xo(t,e){return!!e&&(or(e)||e[t])}function Jo(t){var{type:e,recordBody:i,headers:r,url:n}=t;function s(t){var e=Object.keys(r).find((t=>"content-type"===t.toLowerCase())),i=e&&r[e];return t.some((t=>null==i?void 0:i.includes(t)))}if(!i)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(or(i))return!0;if(Ui(i))return s(i);var o=i[e];return or(o)?o:s(o)}function Ko(t,e,i,r,n,s){return Qo.apply(this,arguments)}function Qo(){return Qo=e((function*(t,e,i,r,n,s){if(void 0===s&&(s=0),s>10)return Go.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null;var o=function(t,e){for(var i=t.length-1;i>=0;i-=1)if(e(t[i]))return t[i]}(t.performance.getEntriesByName(i),(t=>Wo(t)&&t.initiatorType===e&&(tr(r)||t.startTime>=r)&&(tr(n)||t.startTime<=n)));return o||(yield new Promise((t=>setTimeout(t,50*s))),Ko(t,e,i,r,n,s+1))})),Qo.apply(this,arguments)}function ta(t){var{body:e,options:i,url:r}=t;if(nr(e))return null;var{hostname:n,isHostDenied:s}=Ms(r,i);if(s)return n+" is in deny list";if(er(e))return e;if(ss(e))return e.textContent;if(ar(e))return ks(e);if(Ki(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var ea=t=>!rr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ia(t){var{entry:e,method:r,status:n,networkRequest:s,isInitial:o,start:a,end:l,url:u,initiatorType:h}=t;a=e?e.startTime:a,l=e?e.responseEnd:l;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[i({},e?e.toJSON():{name:u},{startTime:tr(a)?void 0:Math.round(a),endTime:tr(l)?void 0:Math.round(l),timeOrigin:c,timestamp:d,method:r,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(ea(e))for(var f of e.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var ra=["video/","audio/"];function na(t){return new Promise(((e,i)=>{var r=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>i(t))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e("[SessionReplay] Failed to read body")}}))}function sa(){return sa=e((function*(t){var{r:e,options:i,url:r}=t,{hostname:n,isHostDenied:s}=Ms(r,i);return s?Promise.resolve(n+" is in deny list"):na(e)})),sa.apply(this,arguments)}function oa(){return oa=e((function*(t){var{r:e,options:i,url:r}=t,n=function(t){var e,{r:i,options:r,url:n}=t;if("chunked"===i.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=i.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=ra.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:l}=Ms(n,r);return l?a+" is in deny list":null}({r:e,options:i,url:r});return rr(n)?na(e):Promise.resolve(n)})),oa.apply(this,arguments)}function aa(t,i,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var n=Xo("request",r.recordHeaders),s=Xo("response",r.recordHeaders),o=Es(i,"fetch",(o=>function(){var a=e((function*(e,a){var l,u,h,c=new Request(e,a),d={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),n&&(d.requestHeaders=v),Jo({type:"request",headers:v,url:e,recordBody:r.recordBody})&&(d.requestBody=yield function(t){return sa.apply(this,arguments)}({r:c,options:r,url:e})),u=i.performance.now(),l=yield o(c),h=i.performance.now();var f={};return l.headers.forEach(((t,e)=>{f[e]=t})),s&&(d.responseHeaders=f),Jo({type:"response",headers:f,url:e,recordBody:r.recordBody})&&(d.responseBody=yield function(t){return oa.apply(this,arguments)}({r:l,options:r,url:e})),l}finally{Ko(i,"fetch",c.url,u,h).then((e=>{var i,r=ia({entry:e,method:c.method,status:null==(i=l)?void 0:i.status,networkRequest:d,start:u,end:h,url:c.url,initiatorType:"fetch"});t({requests:r})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}var la=null;function ua(t,e,r){if(!("performance"in e))return()=>{};if(la)return Go.warn("Network observer already initialised, doing nothing"),()=>{};var n=r?Object.assign({},Yo,r):Yo,s=e=>{var r=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&r.push(e)})),r.length>0&&t(i({},e,{requests:r}))},o=Uo(s,e,n),a=()=>{},l=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=Xo("request",i.recordHeaders),n=Xo("response",i.recordHeaders),s=Es(e.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=(t,e)=>(g[t]=e,m(t,e)),r&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=t=>(Jo({type:"request",headers:g,url:a,recordBody:i.recordBody})&&(p.requestBody=ta({body:t,options:i,url:a})),c=e.performance.now(),y(t));var b=()=>{v.removeEventListener("readystatechange",_),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},_=()=>{if(v.readyState===v.DONE){b(),d=e.performance.now();var r={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),i=e.shift(),n=e.join(": ");i&&(r[i]=n)})),n&&(p.responseHeaders=r),Jo({type:"response",headers:r,url:a,recordBody:i.recordBody})&&(p.responseBody=ta({body:v.response,options:i,url:a})),Ko(e,"xmlhttprequest",f.url,c,d).then((e=>{var i=ia({entry:e,method:o,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:i})})).catch((()=>{}))}};v.addEventListener("readystatechange",_),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),s.call(v,o,a.toString(),l,u,h)}));return()=>{s()}}(s,e,n),l=aa(s,e,n)),la=()=>{o(),a(),l(),la=null}}var ha=t=>({name:"rrweb/network@1",observer:ua,options:t});rs.__PosthogExtensions__=rs.__PosthogExtensions__||{},rs.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Bi,getRecordNetworkPlugin:ha},rs.__PosthogExtensions__.rrweb={record:Ze,version:"v2"},rs.rrweb={record:Ze,version:"v2"},rs.rrwebConsoleRecord={getRecordConsolePlugin:Bi},rs.getRecordNetworkPlugin=ha;var ca,da,va,fa,pa,ga,ma,ya,ba={},_a=[],wa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ia=Array.isArray;function Ca(t,e){for(var i in e)t[i]=e[i];return t}function Sa(t){var e=t.parentNode;e&&e.removeChild(t)}function ka(t,e,i){var r,n,s,o={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?ca.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return xa(t,o,r,n,null)}function xa(t,e,i,r,n){var s={type:t,props:e,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==n?++va:n,__i:-1,__u:0};return null==n&&null!=da.vnode&&da.vnode(s),s}function Aa(t){return t.children}function Ta(t,e){this.props=t,this.context=e}function Ea(t,e){if(null==e)return t.__?Ea(t.__,t.__i+1):null;for(var i;e<t.__k.length;e++)if(null!=(i=t.__k[e])&&null!=i.__e)return i.__e;return"function"==typeof t.type?Ea(t):null}function Ma(t){var e,i;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(i=t.__k[e])&&null!=i.__e){t.__e=t.__c.base=i.__e;break}return Ma(t)}}function Na(t){(!t.__d&&(t.__d=!0)&&fa.push(t)&&!Ra.__r++||pa!==da.debounceRendering)&&((pa=da.debounceRendering)||ga)(Ra)}function Ra(){var t,e,i,r,n,s,o,a,l;for(fa.sort(ma);t=fa.shift();)t.__d&&(e=fa.length,r=void 0,s=(n=(i=t).__v).__e,a=[],l=[],(o=i.__P)&&((r=Ca({},n)).__v=n.__v+1,da.vnode&&da.vnode(r),$a(o,r,n,i.__n,void 0!==o.ownerSVGElement,32&n.__u?[s]:null,a,null==s?Ea(n):s,!!(32&n.__u),l),r.__.__k[r.__i]=r,qa(a,r,l),r.__e!=s&&Ma(r)),fa.length>e&&fa.sort(ma));Ra.__r=0}function Fa(t,e,i,r,n,s,o,a,l,u,h){var c,d,v,f,p,g=r&&r.__k||_a,m=e.length;for(i.__d=l,function(t,e,i){var r,n,s,o,a,l=e.length,u=i.length,h=u,c=0;for(t.__k=[],r=0;r<l;r++)null!=(n=t.__k[r]=null==(n=e[r])||"boolean"==typeof n||"function"==typeof n?null:"string"==typeof n||"number"==typeof n||"bigint"==typeof n||n.constructor==String?xa(null,n,null,null,n):Ia(n)?xa(Aa,{children:n},null,null,null):void 0===n.constructor&&n.__b>0?xa(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)?(n.__=t,n.__b=t.__b+1,a=Pa(n,i,o=r+c,h),n.__i=a,s=null,-1!==a&&(h--,(s=i[a])&&(s.__u|=131072)),null==s||null===s.__v?(-1==a&&c--,"function"!=typeof n.type&&(n.__u|=65536)):a!==o&&(a===o+1?c++:a>o?h>l-o?c+=a-o:c--:c=a<o&&a==o-1?a-o:0,a!==r+c&&(n.__u|=65536))):(s=i[r])&&null==s.key&&s.__e&&(s.__e==t.__d&&(t.__d=Ea(s)),Va(s,s,!1),i[r]=null,h--);if(h)for(r=0;r<u;r++)null!=(s=i[r])&&0==(131072&s.__u)&&(s.__e==t.__d&&(t.__d=Ea(s)),Va(s,s))}(i,e,g),l=i.__d,c=0;c<m;c++)null!=(v=i.__k[c])&&"boolean"!=typeof v&&"function"!=typeof v&&(d=-1===v.__i?ba:g[v.__i]||ba,v.__i=c,$a(t,v,d,n,s,o,a,l,u,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Ha(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),65536&v.__u||d.__k===v.__k?l=Oa(v,l,t):"function"==typeof v.type&&void 0!==v.__d?l=v.__d:f&&(l=f.nextSibling),v.__d=void 0,v.__u&=-196609);i.__d=l,i.__e=p}function Oa(t,e,i){var r,n;if("function"==typeof t.type){for(r=t.__k,n=0;r&&n<r.length;n++)r[n]&&(r[n].__=t,e=Oa(r[n],e,i));return e}return t.__e!=e&&(i.insertBefore(t.__e,e||null),e=t.__e),e&&e.nextSibling}function Pa(t,e,i,r){var n=t.key,s=t.type,o=i-1,a=i+1,l=e[i];if(null===l||l&&n==l.key&&s===l.type)return i;if(r>(null!=l&&0==(131072&l.__u)?1:0))for(;o>=0||a<e.length;){if(o>=0){if((l=e[o])&&0==(131072&l.__u)&&n==l.key&&s===l.type)return o;o--}if(a<e.length){if((l=e[a])&&0==(131072&l.__u)&&n==l.key&&s===l.type)return a;a++}}return-1}function La(t,e,i){"-"===e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||wa.test(e)?i:i+"px"}function Da(t,e,i,r,n){var s;t:if("style"===e)if("string"==typeof i)t.style.cssText=i;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)i&&e in i||La(t.style,e,"");if(i)for(e in i)r&&i[e]===r[e]||La(t.style,e,i[e])}else if("o"===e[0]&&"n"===e[1])s=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i.u=r.u:(i.u=Date.now(),t.addEventListener(e,s?Za:Ba,s)):t.removeEventListener(e,s?Za:Ba,s);else{if(n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==i?"":i;break t}catch(t){}"function"==typeof i||(null==i||!1===i&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,i))}}function Ba(t){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(da.event?da.event(t):t)}function Za(t){return this.l[t.type+!0](da.event?da.event(t):t)}function $a(t,e,i,r,n,s,o,a,l,u){var h,c,d,v,f,p,g,m,y,b,_,$,w,I,C,S=e.type;if(void 0!==e.constructor)return null;128&i.__u&&(l=!!(32&i.__u),s=[a=e.__e=i.__e]),(h=da.__b)&&h(e);t:if("function"==typeof S)try{if(m=e.props,y=(h=S.contextType)&&r[h.__c],b=h?y?y.props.value:h.__:r,i.__c?g=(c=e.__c=i.__c).__=c.__E:("prototype"in S&&S.prototype.render?e.__c=c=new S(m,b):(e.__c=c=new Ta(m,b),c.constructor=S,c.render=ja),y&&y.sub(c),c.props=m,c.state||(c.state={}),c.context=b,c.__n=r,d=c.__d=!0,c.__h=[],c._sb=[]),null==c.__s&&(c.__s=c.state),null!=S.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Ca({},c.__s)),Ca(c.__s,S.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=e,d)null==S.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==S.getDerivedStateFromProps&&m!==v&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(m,b),!c.__e&&(null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(m,c.__s,b)||e.__v===i.__v)){for(e.__v!==i.__v&&(c.props=m,c.state=c.__s,c.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.forEach((function(t){t&&(t.__=e)})),_=0;_<c._sb.length;_++)c.__h.push(c._sb[_]);c._sb=[],c.__h.length&&o.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(m,c.__s,b),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(v,f,p)}))}if(c.context=b,c.props=m,c.__P=t,c.__e=!1,$=da.__r,w=0,"prototype"in S&&S.prototype.render){for(c.state=c.__s,c.__d=!1,$&&$(e),h=c.render(c.props,c.state,c.context),I=0;I<c._sb.length;I++)c.__h.push(c._sb[I]);c._sb=[]}else do{c.__d=!1,$&&$(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++w<25);c.state=c.__s,null!=c.getChildContext&&(r=Ca(Ca({},r),c.getChildContext())),d||null==c.getSnapshotBeforeUpdate||(p=c.getSnapshotBeforeUpdate(v,f)),Fa(t,Ia(C=null!=h&&h.type===Aa&&null==h.key?h.props.children:h)?C:[C],e,i,r,n,s,o,a,l,u),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),g&&(c.__E=c.__=null)}catch(t){e.__v=null,l||null!=s?(e.__e=a,e.__u|=l?160:32,s[s.indexOf(a)]=null):(e.__e=i.__e,e.__k=i.__k),da.__e(t,e,i)}else null==s&&e.__v===i.__v?(e.__k=i.__k,e.__e=i.__e):e.__e=function(t,e,i,r,n,s,o,a,l){var u,h,c,d,v,f,p,g=i.props,m=e.props,y=e.type;if("svg"===y&&(n=!0),null!=s)for(u=0;u<s.length;u++)if((v=s[u])&&"setAttribute"in v==!!y&&(y?v.localName===y:3===v.nodeType)){t=v,s[u]=null;break}if(null==t){if(null===y)return document.createTextNode(m);t=n?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,m.is&&m),s=null,a=!1}if(null===y)g===m||a&&t.data===m||(t.data=m);else{if(s=s&&ca.call(t.childNodes),g=i.props||ba,!a&&null!=s)for(g={},u=0;u<t.attributes.length;u++)g[(v=t.attributes[u]).name]=v.value;for(u in g)v=g[u],"children"==u||("dangerouslySetInnerHTML"==u?c=v:"key"===u||u in m||Da(t,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:"key"===u||a&&"function"!=typeof v||g[u]===v||Da(t,u,v,g[u],n);if(h)a||c&&(h.__html===c.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),Fa(t,Ia(d)?d:[d],e,i,r,n&&"foreignObject"!==y,s,o,s?s[0]:i.__k&&Ea(i,0),a,l),null!=s)for(u=s.length;u--;)null!=s[u]&&Sa(s[u]);a||(u="value",void 0!==f&&(f!==t[u]||"progress"===y&&!f||"option"===y&&f!==g[u])&&Da(t,u,f,g[u],!1),u="checked",void 0!==p&&p!==t[u]&&Da(t,u,p,g[u],!1))}return t}(i.__e,e,i,r,n,s,o,l,u);(h=da.diffed)&&h(e)}function qa(t,e,i){e.__d=void 0;for(var r=0;r<i.length;r++)Ha(i[r],i[++r],i[++r]);da.__c&&da.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){da.__e(t,e.__v)}}))}function Ha(t,e,i){try{"function"==typeof t?t(e):t.current=e}catch(t){da.__e(t,i)}}function Va(t,e,i){var r,n;if(da.unmount&&da.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||Ha(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){da.__e(t,e)}r.base=r.__P=null,t.__c=void 0}if(r=t.__k)for(n=0;n<r.length;n++)r[n]&&Va(r[n],e,i||"function"!=typeof t.type);i||null==t.__e||Sa(t.__e),t.__=t.__e=t.__d=void 0}function ja(t,e,i){return this.constructor(t,i)}function Ya(t,e,i){var r,n,s;da.__&&da.__(t,e),r=!1?null:e.__k,n=[],s=[],$a(e,t=e.__k=ka(Aa,null,[t]),r||ba,ba,void 0!==e.ownerSVGElement,r?null:e.firstChild?ca.call(e.childNodes):null,n,r?r.__e:e.firstChild,false,s),qa(n,t,s)}function Ga(t,e,i){var r,n,s,o,a=Ca({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&void 0!==o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?ca.call(arguments,2):i),xa(t.type,a,r||t.key,n||t.ref,null)}ca=_a.slice,da={__e:function(t,e,i,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},va=0,Ta.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Ca({},this.state),"function"==typeof t&&(t=t(Ca({},i),this.props)),t&&Ca(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),Na(this))},Ta.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Na(this))},Ta.prototype.render=Aa,fa=[],ga="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ma=function(t,e){return t.__v.__b-e.__v.__b},Ra.__r=0,ya=0;var za,Wa,Ua,Xa,Ja=0,Ka=[],Qa=[],tl=da.__b,el=da.__r,il=da.diffed,rl=da.__c,nl=da.unmount;function sl(t,e){da.__h&&da.__h(Wa,t,Ja||e),Ja=0;var i=Wa.__H||(Wa.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:Qa}),i.__[t]}function ol(t){return Ja=1,function(t,e,i){var r=sl(za++,2);if(r.t=t,!r.__c&&(r.__=[ml(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],i=r.t(e,t);e!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=Wa,!Wa.u)){var n=function(t,e,i){if(!r.__c.__H)return!0;var n=r.__c.__H.__.filter((function(t){return t.__c}));if(n.every((function(t){return!t.__N})))return!s||s.call(this,t,e,i);var o=!1;return n.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),!(!o&&r.__c.props===t)&&(!s||s.call(this,t,e,i))};Wa.u=!0;var s=Wa.shouldComponentUpdate,o=Wa.componentWillUpdate;Wa.componentWillUpdate=function(t,e,i){if(this.__e){var r=s;s=void 0,n(t,e,i),s=r}o&&o.call(this,t,e,i)},Wa.shouldComponentUpdate=n}return r.__N||r.__}(ml,t)}function al(t,e){var i=sl(za++,3);!da.__s&&gl(i.__H,e)&&(i.__=t,i.i=e,Wa.__H.__h.push(i))}function ll(t){return Ja=5,ul((function(){return{current:t}}),[])}function ul(t,e){var i=sl(za++,7);return gl(i.__H,e)?(i.__V=t(),i.i=e,i.__h=t,i.__V):i.__}function hl(t){var e=Wa.context[t.__c],i=sl(za++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(Wa)),e.props.value):t.__}function cl(){for(var t;t=Ka.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(fl),t.__H.__h.forEach(pl),t.__H.__h=[]}catch(e){t.__H.__h=[],da.__e(e,t.__v)}}da.__b=function(t){Wa=null,tl&&tl(t)},da.__r=function(t){el&&el(t),za=0;var e=(Wa=t.__c).__H;e&&(Ua===Wa?(e.__h=[],Wa.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=Qa,t.__N=t.i=void 0}))):(e.__h.forEach(fl),e.__h.forEach(pl),e.__h=[],za=0)),Ua=Wa},da.diffed=function(t){il&&il(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Ka.push(e)&&Xa===da.requestAnimationFrame||((Xa=da.requestAnimationFrame)||vl)(cl)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==Qa&&(t.__=t.__V),t.i=void 0,t.__V=Qa}))),Ua=Wa=null},da.__c=function(t,e){e.some((function(t){try{t.__h.forEach(fl),t.__h=t.__h.filter((function(t){return!t.__||pl(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],da.__e(i,t.__v)}})),rl&&rl(t,e)},da.unmount=function(t){nl&&nl(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.forEach((function(t){try{fl(t)}catch(t){e=t}})),i.__H=void 0,e&&da.__e(e,i.__v))};var dl="function"==typeof requestAnimationFrame;function vl(t){var e,i=function(){clearTimeout(r),dl&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,100);dl&&(e=requestAnimationFrame(i))}function fl(t){var e=Wa,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),Wa=e}function pl(t){var e=Wa;t.__c=t.__(),Wa=e}function gl(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function ml(t,e){return"function"==typeof e?e(t):e}var yl=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({}),bl=function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t}({}),_l=function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t}({}),wl=function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t}({}),Il=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({}),Cl=function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t}({}),Sl=function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t}({}),kl=function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t}({}),xl=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t}({}),Al=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t}({}),Tl=function(t){return t.Popover="popover",t.Inline="inline",t}({}),El=us("[Surveys]");function Ml(t){return!(!t.start_date||t.end_date)}function Nl(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Rl(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Fl="seenSurvey_",Ol="inProgressSurvey_",Pl=(t,e)=>{var i="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(i="$survey_"+e+"/"+t.id+"/"+t.current_iteration),i},Ll=(t,e)=>{var i=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(i=""+t+e.id+"_"+e.current_iteration),i},Dl=t=>Ll(Fl,t),Bl=t=>{localStorage.getItem(Dl(t))||localStorage.setItem(Dl(t),"true")},Zl=[Il.Popover,Il.Widget,Il.API],$l={ignoreConditions:!1,ignoreDelay:!1,displayType:Tl.Popover};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return sr(t)&&isFinite(t)&&Math.floor(t)===t});var ql="0123456789abcdef";class Hl{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,i,r){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||t<0||e<0||i<0||r<0||t>0xffffffffffff||e>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/Math.pow(2,8),n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new Hl(n)}toString(){for(var t="",e=0;e<this.bytes.length;e++)t=t+ql.charAt(this.bytes[e]>>>4)+ql.charAt(15&this.bytes[e]),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Hl(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;e<16;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}}class Vl{constructor(){this.T=0,this.M=0,this.N=new Gl}generate(){var t=this.generateOrAbort();if(tr(t)){this.T=0;var e=this.generateOrAbort();if(tr(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.T)this.T=t,this.R();else{if(!(t+1e4>this.T))return;this.M++,this.M>4398046511103&&(this.T++,this.R())}return Hl.fromFieldsV7(this.T,Math.trunc(this.M/Math.pow(2,30)),this.M&Math.pow(2,30)-1,this.N.nextUint32())}R(){this.M=1024*this.N.nextUint32()+(1023&this.N.nextUint32())}}var jl,Yl=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Yn&&!tr(Yn.crypto)&&crypto.getRandomValues&&(Yl=t=>crypto.getRandomValues(t));class Gl{constructor(){this.F=new Uint32Array(8),this.O=1/0}nextUint32(){return this.O>=this.F.length&&(Yl(this.F),this.O=0),this.F[this.O++]}}var zl=()=>Wl().toString(),Wl=()=>(jl||(jl=new Vl)).generate(),Ul=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Xl=Uint8Array,Jl=Uint16Array,Kl=Uint32Array,Ql=new Xl([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]),tu=new Xl([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]),eu=new Xl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),iu=function(t,e){for(var i=new Jl(31),r=0;r<31;++r)i[r]=e+=1<<t[r-1];var n=new Kl(i[30]);for(r=1;r<30;++r)for(var s=i[r];s<i[r+1];++s)n[s]=s-i[r]<<5|r;return[i,n]},ru=iu(Ql,2),nu=ru[0],su=ru[1];nu[28]=258,su[258]=28;for(var ou=iu(tu,0)[1],au=new Jl(32768),lu=0;lu<32768;++lu){var uu=(43690&lu)>>>1|(21845&lu)<<1;uu=(61680&(uu=(52428&uu)>>>2|(13107&uu)<<2))>>>4|(3855&uu)<<4,au[lu]=((65280&uu)>>>8|(255&uu)<<8)>>>1}var hu=function(t,e,i){for(var r=t.length,n=0,s=new Jl(e);n<r;++n)++s[t[n]-1];var o,a=new Jl(e);for(n=0;n<e;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new Jl(1<<e);var l=15-e;for(n=0;n<r;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],c=a[t[n]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)o[au[c]>>>l]=u}else for(o=new Jl(r),n=0;n<r;++n)o[n]=au[a[t[n]-1]++]>>>15-t[n];return o},cu=new Xl(288);for(lu=0;lu<144;++lu)cu[lu]=8;for(lu=144;lu<256;++lu)cu[lu]=9;for(lu=256;lu<280;++lu)cu[lu]=7;for(lu=280;lu<288;++lu)cu[lu]=8;var du=new Xl(32);for(lu=0;lu<32;++lu)du[lu]=5;var vu=hu(cu,9,0),fu=hu(du,5,0),pu=function(t){return(t/8>>0)+(7&t&&1)},gu=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof Jl?Jl:t instanceof Kl?Kl:Xl)(i-e);return r.set(t.subarray(e,i)),r},mu=function(t,e,i){i<<=7&e;var r=e/8>>0;t[r]|=i,t[r+1]|=i>>>8},yu=function(t,e,i){i<<=7&e;var r=e/8>>0;t[r]|=i,t[r+1]|=i>>>8,t[r+2]|=i>>>16},bu=function(t,e){for(var i=[],r=0;r<t.length;++r)t[r]&&i.push({s:r,f:t[r]});var n=i.length,s=i.slice();if(!n)return[new Xl(0),0];if(1==n){var o=new Xl(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,c=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=i[i[u].f<i[c].f?u++:c++],l=i[u!=h&&i[u].f<i[c].f?u++:c++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=s[0].s;for(r=1;r<n;++r)s[r].s>d&&(d=s[r].s);var v=new Jl(d+1),f=_u(i[h-1],v,0);if(f>e){r=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));r<n;++r){var y=s[r].s;if(!(v[y]>e))break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=s[r].s;v[b]<e?p-=1<<e-v[b]++-1:++r}for(;r>=0&&p;--r){var _=s[r].s;v[_]==e&&(--v[_],++p)}f=e}return[new Xl(v),f]},_u=function(t,e,i){return-1==t.s?Math.max(_u(t.l,e,i+1),_u(t.r,e,i+1)):e[t.s]=i},wu=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new Jl(++e),r=0,n=t[0],s=1,o=function(t){i[r++]=t},a=1;a<=e;++a)if(t[a]==n&&a!=e)++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=t[a]}return[i.subarray(0,r),e]},Iu=function(t,e){for(var i=0,r=0;r<e.length;++r)i+=t[r]*e[r];return i},Cu=function(t,e,i){var r=i.length,n=pu(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;s<r;++s)t[n+s+4]=i[s];return 8*(n+4+r)},Su=function(t,e,i,r,n,s,o,a,l,u,h){mu(e,h++,i),++n[256];for(var c=bu(n,15),d=c[0],v=c[1],f=bu(s,15),p=f[0],g=f[1],m=wu(d),y=m[0],b=m[1],_=wu(p),w=_[0],I=_[1],C=new Jl(19),S=0;S<y.length;++S)C[31&y[S]]++;for(S=0;S<w.length;++S)C[31&w[S]]++;for(var k=bu(C,7),x=k[0],A=k[1],T=19;T>4&&!x[eu[T-1]];--T);var E,M,N,R,F=u+5<<3,O=Iu(n,cu)+Iu(s,du)+o,P=Iu(n,d)+Iu(s,p)+o+14+3*T+Iu(C,x)+(2*C[16]+3*C[17]+7*C[18]);if(F<=O&&F<=P)return Cu(e,h,t.subarray(l,l+u));if(mu(e,h,1+(P<O)),h+=2,P<O){E=hu(d,v,0),M=d,N=hu(p,g,0),R=p;var L=hu(x,A,0);mu(e,h,b-257),mu(e,h+5,I-1),mu(e,h+10,T-4),h+=14;for(S=0;S<T;++S)mu(e,h+3*S,x[eu[S]]);h+=3*T;for(var D=[y,w],B=0;B<2;++B){var Z=D[B];for(S=0;S<Z.length;++S){var q=31&Z[S];mu(e,h,L[q]),h+=x[q],q>15&&(mu(e,h,Z[S]>>>5&127),h+=Z[S]>>>12)}}}else E=vu,M=cu,N=fu,R=du;for(S=0;S<a;++S)if(r[S]>255){q=r[S]>>>18&31;yu(e,h,E[q+257]),h+=M[q+257],q>7&&(mu(e,h,r[S]>>>23&31),h+=Ql[q]);var H=31&r[S];yu(e,h,N[H]),h+=R[H],H>3&&(yu(e,h,r[S]>>>5&8191),h+=tu[H])}else yu(e,h,E[r[S]]),h+=M[r[S]];return yu(e,h,E[256]),h+M[256]},ku=new Kl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),xu=function(){for(var t=new Kl(256),e=0;e<256;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Au=function(t,e,i,r,n){return function(t,e,i,r,n,s){var o=t.length,a=new Xl(r+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(r,a.length-n),u=0;if(!e||o<8)for(var h=0;h<=o;h+=65535){var c=h+65535;c<o?u=Cu(l,u,t.subarray(h,c)):(l[h]=s,u=Cu(l,u,t.subarray(h,o)))}else{for(var d=ku[e-1],v=d>>>13,f=8191&d,p=(1<<i)-1,g=new Jl(32768),m=new Jl(p+1),y=Math.ceil(i/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new Kl(25e3),I=new Jl(288),C=new Jl(32),S=0,k=0,x=(h=0,0),A=0,T=0;h<o;++h){var E=_(h),M=32767&h,N=m[E];if(g[M]=N,m[E]=M,A<=h){var R=o-h;if((S>7e3||x>24576)&&R>423){u=Su(t,l,0,w,I,C,k,x,T,h-T,u),x=S=k=0,T=h;for(var F=0;F<286;++F)I[F]=0;for(F=0;F<30;++F)C[F]=0}var O=2,P=0,L=f,D=M-N&32767;if(R>2&&E==_(h-D))for(var B=Math.min(v,R)-1,Z=Math.min(32767,h),q=Math.min(258,R);D<=Z&&--L&&M!=N;){if(t[h+O]==t[h+O-D]){for(var H=0;H<q&&t[h+H]==t[h+H-D];++H);if(H>O){if(O=H,P=D,H>B)break;var V=Math.min(D,H-2),j=0;for(F=0;F<V;++F){var Y=h-D+F+32768&32767,G=Y-g[Y]+32768&32767;G>j&&(j=G,N=Y)}}}D+=(M=N)-(N=g[M])+32768&32767}if(P){w[x++]=268435456|su[O]<<18|ou[P];var z=31&su[O],W=31&ou[P];k+=Ql[z]+tu[W],++I[257+z],++C[W],A=h+O,++S}else w[x++]=t[h],++I[t[h]]}}u=Su(t,l,s,w,I,C,k,x,T,h-T,u)}return gu(a,0,r+pu(u)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,i,r,!0)},Tu=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function Eu(t,e){void 0===e&&(e={});var i=function(){var t=4294967295;return{p:function(e){for(var i=t,r=0;r<e.length;++r)i=xu[255&i^e[r]]^i>>>8;t=i},d:function(){return 4294967295^t}}}(),r=t.length;i.p(t);var n=Au(t,e,function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),8),s=n.length;return function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Tu(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;r<=i.length;++r)t[r+10]=i.charCodeAt(r)}}(n,e),Tu(n,s-8,i.d()),Tu(n,s-4,r),n}var Mu=function(t){var e,i,r,n,s="";for(e=i=0,r=(t=(t+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<r;n++){var o=t.charCodeAt(n),a=null;o<128?i++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),rr(a)||(i>e&&(s+=t.substring(e,i)),s+=a,e=i=n+1)}return i>e&&(s+=t.substring(e,t.length)),s},Nu=!!ts||!!Qn,Ru="text/plain",Fu=function(t,e,r){var n;void 0===r&&(r=!0);var[s,o]=t.split("?"),a=i({},e),l=null!==(n=null==o?void 0:o.split("&").map((t=>{var e,[i,n]=t.split("="),s=r&&null!==(e=a[i])&&void 0!==e?e:n;return delete a[i],i+"="+s})))&&void 0!==n?n:[],u=ks(a);return u&&l.push(u),s+"?"+l.join("&")},Ou=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Pu=t=>{var{data:e,compression:i}=t;if(e){if(i===Ul.GZipJS){var r=Eu(function(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Xl(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},o=0;o<i;++o){if(n+5>r.length){var a=new Xl(n+8+(i-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);l<128||e?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&t.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 gu(r,0,n)}(Ou(e)),{mtime:0}),n=new Blob([r],{type:Ru});return{contentType:Ru,body:n,estimatedSize:n.size}}if(i===Ul.Base64){var s=function(t){var e,i,r,n,s,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",h=[];if(!t)return t;t=Mu(t);do{e=(s=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,i=s>>12&63,r=s>>6&63,n=63&s,h[l++]=o.charAt(e)+o.charAt(i)+o.charAt(r)+o.charAt(n)}while(a<t.length);switch(u=h.join(""),t.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}(Ou(e)),o=(t=>"data="+encodeURIComponent("string"==typeof t?t:Ou(t)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=Ou(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Lu=[];Qn&&Lu.push({transport:"fetch",method:t=>{var e,r,{contentType:n,body:s,estimatedSize:o}=null!==(e=Pu(t))&&void 0!==e?e:{},a=new Headers;ds(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var l=t.url,u=null;if(es){var h=new es;u={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}Qn(l,i({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&(o||0)<52428.8,body:s,signal:null==(r=u)?void 0:r.signal},t.fetchOptions)).then((e=>e.text().then((i=>{var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){ls.error(t)}null==t.callback||t.callback(r)})))).catch((e=>{ls.error(e),null==t.callback||t.callback({statusCode:0,text:e})})).finally((()=>u?clearTimeout(u.timeout):null))}}),ts&&Lu.push({transport:"XHR",method:t=>{var e,i=new ts;i.open(t.method||"GET",t.url,!0);var{contentType:r,body:n}=null!==(e=Pu(t))&&void 0!==e?e:{};ds(t.headers,(function(t,e){i.setRequestHeader(e,t)})),r&&i.setRequestHeader("Content-Type",r),t.timeout&&(i.timeout=t.timeout),t.disableXHRCredentials||(i.withCredentials=!0),i.onreadystatechange=()=>{if(4===i.readyState){var e={statusCode:i.status,text:i.responseText};if(200===i.status)try{e.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(e)}},i.send(n)}}),null!=Xn&&Xn.sendBeacon&&Lu.push({transport:"sendBeacon",method:t=>{var e=Fu(t.url,{beacon:"1"});try{var i,{contentType:r,body:n}=null!==(i=Pu(t))&&void 0!==i?i:{},s="string"==typeof n?new Blob([n],{type:r}):n;Xn.sendBeacon(e,s)}catch(t){}}});var Du=function(t,e){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}};function Bu(t,e,i){return Ou({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var Zu={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>Du(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Du(e,t))))),icontains:(t,e)=>e.map($u).some((e=>t.map($u).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map($u).every((e=>t.map($u).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i<parseFloat(t)))}))},$u=t=>t.toLowerCase();function qu(t,e){return!t||Object.entries(t).every((t=>{var[i,r]=t,n=null==e?void 0:e[i];if(tr(n)||rr(n))return!1;var s=[String(n)],o=Zu[r.operator];return!!o&&o(r.values,s)}))}var Hu=us("[Stylesheet Loader]"),Vu=Yn,ju=Jn;function Yu(t){return"$survey_response_"+t}var Gu="#020617",zu={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:_l.Right,widgetType:bl.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:"2147483647",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:Gu,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function Wu(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Uu(t){var e;void 0===t&&(t=zu.backgroundColor),"#"===t[0]&&(e=Wu(t)),t.startsWith("rgb")&&(e=t);var i={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"}[t.toLowerCase()];if(i&&(e=Wu(i)),!e)return Gu;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),o=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?Gu:"white"}return Gu}function Xu(t){var e=((t,e,i)=>{var r,n=t.createElement("style");return n.innerText=e,null!=i&&null!=(r=i.config)&&r.prepare_external_dependency_stylesheet&&(n=i.config.prepare_external_dependency_stylesheet(n)),n||(Hu.error("prepare_external_dependency_stylesheet returned null"),null)})(ju,':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:2147483647;--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}.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:hover{cursor:pointer}.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)}.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)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}var Ju=(t,e,r)=>{var n=yh(t),s=ju.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=ju.createElement("div");((t,e,r)=>{var n=i({},zu,r),s=t.style,o=![_l.Center,_l.Left,_l.Right].includes(n.position)||e===Il.Widget&&(null==r?void 0:r.widgetType)===bl.Tab;s.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(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==r?void 0:r.submitButtonTextColor)||Uu(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",Uu(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==r?void 0:r.textColor)||Uu(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",Uu(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==r?void 0:r.inputBackground)||(null==r?void 0:r.inputBackgroundColor),l=a||n.inputBackground;a||"white"!==n.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==r?void 0:r.inputTextColor)||Uu(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,t.type,t.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=Xu(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return ju.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},Ku=(t,e)=>{if(!e)return null;var i=t[Yu(e)];return Ui(i)?[...i]:i},Qu=t=>{var{responses:e,survey:r,surveySubmissionId:n,posthog:s,isSurveyCompleted:o}=t;s?(Bl(r),s.capture(xl.SENT,i({[Al.SURVEY_NAME]:r.name,[Al.SURVEY_ID]:r.id,[Al.SURVEY_ITERATION]:r.current_iteration,[Al.SURVEY_ITERATION_START_DATE]:r.current_iteration_start_date,[Al.SURVEY_QUESTIONS]:r.questions.map((t=>({id:t.id,question:t.question,response:Ku(e,t.id)}))),[Al.SURVEY_SUBMISSION_ID]:n,[Al.SURVEY_COMPLETED]:o,sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},e,{$set:{[Pl(r,"responded")]:!0}})),o&&(Vu.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:r.id}})),mh(r))):El.error("[survey sent] event not captured, PostHog instance not found.")},th=t=>Object.values((null==t?void 0:t.responses)||{}).filter((t=>!nr(t))).length>0,eh=(t,e,r)=>i({[Al.SURVEY_NAME]:t.name,[Al.SURVEY_ID]:t.id,[Al.SURVEY_ITERATION]:t.current_iteration,[Al.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Al.SURVEY_PARTIALLY_COMPLETED]:th(e),sessionRecordingUrl:null==r.get_session_replay_url?void 0:r.get_session_replay_url()},null==e?void 0:e.responses,{[Al.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId,[Al.SURVEY_QUESTIONS]:t.questions.map((t=>({id:t.id,question:t.question,response:Ku((null==e?void 0:e.responses)||{},t.id)})))}),ih=(t,e,r)=>{if(e){if(!r){var n=ph(t);e.capture(xl.DISMISSED,i({},eh(t,n,e),{$set:{[Pl(t,"dismissed")]:!0}})),mh(t),Bl(t),Vu.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else El.error("[survey dismissed] event not captured, PostHog instance not found.")},rh=(t,e)=>{if(e){var i=(t=>Ll("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=ph(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(xl.ABANDONED,eh(t,r,e),{transport:"sendBeacon"})}}else El.error("[survey abandoned] event not captured, PostHog instance not found.")},nh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),sh=(t,e)=>t.length===e.length&&t.every(((t,i)=>t===e[i]))?e.reverse():e,oh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?sh(t.questions,nh(t.questions)):t.questions,ah=t=>{var e;return!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation||!(t=>{var e,i;return null!=(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)?void 0:e.length)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0})(t))||t.schedule===kl.Always||gh(t)},lh=function(t,e){var i={__c:e="__cC"+ya++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var i,r;return this.getChildContext||(i=[],(r={})[e]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&i.some((function(t){t.__e=!0,Na(t)}))},this.sub=function(t){i.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){i.splice(i.indexOf(t),1),e&&e.call(t)}}),t.children}};return i.Provider.__=i.Consumer.contextType=i}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:""}),uh=()=>hl(lh),hh=t=>{var{component:e,children:i,renderAsHtml:r,style:n}=t;return Ga(e,r?{dangerouslySetInnerHTML:{__html:i},style:n}:{children:i,style:n})};function ch(t){return null!=t?t:"icontains"}function dh(t){var e,i,r;if(null==(e=t.conditions)||!e.url)return!0;var n=null==Vu||null==(i=Vu.location)?void 0:i.href;if(!n)return!1;var s=[t.conditions.url],o=ch(null==(r=t.conditions)?void 0:r.urlMatchType);return Zu[o](s,[n])}var vh=t=>{var e=""+Ol+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Ol+t.id+"_"+t.current_iteration),e},fh=(t,e)=>{try{localStorage.setItem(vh(t),JSON.stringify(e))}catch(t){El.error("Error setting in-progress survey state in localStorage",t)}},ph=t=>{try{var e=localStorage.getItem(vh(t));if(e)return JSON.parse(e)}catch(t){El.error("Error getting in-progress survey state from localStorage",t)}return null},gh=t=>{var e=ph(t);return!nr(null==e?void 0:e.surveySubmissionId)},mh=t=>{try{localStorage.removeItem(vh(t))}catch(t){El.error("Error clearing in-progress survey state from localStorage",t)}};function yh(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}var bh=0;function _h(t,e,i,r,n,s){var o,a,l={};for(a in e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--bh,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return da.vnode&&da.vnode(u),u}var wh=_h("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_h("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"})}),Ih=_h("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_h("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"})}),Ch=_h("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_h("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"})}),Sh=_h("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_h("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"})}),kh=_h("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_h("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"})}),xh=_h("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title",children:[_h("title",{id:"close-survey-title",children:"Close survey"}),_h("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"black"})]}),Ah=_h("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[_h("g",{"clip-path":"url(#clip0_2415_6911)",children:[_h("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:_h("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),_h("g",{mask:"url(#mask0_2415_6911)",children:[_h("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"}),_h("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"}),_h("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"}),_h("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"}),_h("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"}),_h("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"})]})]}),_h("defs",{children:_h("clipPath",{id:"clip0_2415_6911",children:_h("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Th(){return _h("a",{href:"https://posthog.com/surveys",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Ah]})}function Eh(t){var{text:e,submitDisabled:i,appearance:r,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=t,{isPreviewMode:l}=hl(lh);return _h("div",{className:"bottom-section",children:[!a&&_h("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick:()=>{s&&(null==Yn||Yn.open(s)),l?null==o||o():n()},children:e}),!r.whiteLabel&&_h(Th,{})]})}function Mh(t){var{question:e,forceDisableHtml:i,htmlFor:r}=t;return _h("div",{class:"question-header",children:[_h(e.type===Cl.Open?"label":"h3",{className:"survey-question",htmlFor:r,children:e.question}),e.description&&hh({component:ka("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function Nh(t){var{onClick:e}=t,{isPreviewMode:i}=hl(lh);return _h("button",{className:"form-cancel",onClick:e,disabled:i,"aria-label":"Close survey",type:"button",children:xh})}_h("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:_h("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 Rh=Yn;function Fh(t){var{header:e,description:i,contentType:r,forceDisableHtml:n,appearance:s,onClose:o}=t,{isPopup:a}=hl(lh);return al((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Cs(Rh,"keydown",t),()=>{Rh.removeEventListener("keydown",t)}}),[o]),_h("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&_h(Nh,{onClick:()=>o()}),_h("h3",{className:"thank-you-message-header",children:e}),i&&hh({component:ka("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),a&&_h(Eh,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Oh=t=>Ui(t)&&t.every((t=>er(t)));function Ph(t){var{question:e,forceDisableHtml:i,appearance:r,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=t,{isPreviewMode:l}=uh(),u=ll(null),[h,c]=ol((()=>er(a)?a:""));al((()=>{setTimeout((()=>{var t;l||(null==(t=u.current)||t.focus())}),100)}),[l]);var d="surveyQuestion"+o;return _h(Aa,{children:[_h("div",{className:"question-container",children:[_h(Mh,{question:e,forceDisableHtml:i,htmlFor:d}),_h("textarea",{ref:u,id:d,rows:4,placeholder:null==r?void 0:r.placeholder,onInput:t=>{c(t.currentTarget.value),t.stopPropagation()},onKeyDown:t=>{t.stopPropagation()},value:h})]}),_h(Eh,{text:e.buttonText||"Submit",submitDisabled:!h&&!e.optional,appearance:r,onSubmit:()=>n(h),onPreviewSubmit:()=>s(h)})]})}function Lh(t){var{question:e,forceDisableHtml:i,appearance:r,onSubmit:n,onPreviewSubmit:s}=t;return _h(Aa,{children:[_h("div",{className:"question-container",children:_h(Mh,{question:e,forceDisableHtml:i})}),_h(Eh,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function Dh(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:r,appearance:n,onSubmit:s,onPreviewSubmit:o,initialValue:a}=t,l=e.scale,u=10===e.scale?0:1,[h,c]=ol((()=>sr(a)?a:Ui(a)&&a.length>0&&sr(parseInt(a[0]))?parseInt(a[0]):er(a)&&sr(parseInt(a))?parseInt(a):null)),{isPreviewMode:d}=uh(),v=t=>d?o(t):s(t);return _h(Aa,{children:[_h("div",{className:"question-container",children:[_h(Mh,{question:e,forceDisableHtml:i}),_h("div",{className:"rating-section",children:[_h("div",{className:"rating-options",children:["emoji"===e.display&&_h("div",{className:"rating-options-emoji",children:(3===e.scale?$h:qh).map(((t,i)=>_h("button",{"aria-label":"Rate "+(i+1),className:"ratings-emoji question-"+r+"-rating-"+i+" "+(i+1===h?"rating-active":""),value:i+1,type:"button",onClick:()=>{var t=i+1;c(t),e.skipSubmitButton&&v(t)},children:t},i)))}),"number"===e.display&&_h("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-u+1)+", minmax(0, 1fr))"},children:Yh(e.scale).map(((t,i)=>_h(Bh,{displayQuestionIndex:r,active:h===t,appearance:n,num:t,setActiveNumber:t=>{c(t),e.skipSubmitButton&&v(t)}},i)))})]}),_h("div",{className:"rating-text",children:[_h("div",{children:e.lowerBoundLabel}),_h("div",{children:e.upperBoundLabel})]})]})]}),_h(Eh,{text:e.buttonText||(null==n?void 0:n.submitButtonText)||"Submit",submitDisabled:rr(h)&&!e.optional,appearance:n,onSubmit:()=>s(h),onPreviewSubmit:()=>o(h),skipSubmitButton:e.skipSubmitButton})]})}function Bh(t){var{num:e,active:i,displayQuestionIndex:r,setActiveNumber:n}=t;return _h("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+r+"-rating-"+e+" "+(i?"rating-active":""),type:"button",onClick:()=>{n(e)},children:e})}function Zh(t){var{question:e,forceDisableHtml:r,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=t,u=ll(null),h=ul((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=sh(e,nh(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e)),[e]),[c,d]=ol((()=>((t,e)=>er(t)||Oh(t)?t:e===Cl.SingleChoice?null:[])(l,e.type))),[v,f]=ol((()=>((t,e)=>{if(er(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Oh(t)){var i=t.find((t=>!e.includes(t)));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(l,h))),{isPreviewMode:p}=uh(),g=e.type===Cl.SingleChoice,m=e.type===Cl.MultipleChoice,y=e.skipSubmitButton&&g&&!e.hasOpenChoice,b=(t,e)=>{if(e){var r=!v.isSelected;return f((t=>i({},t,{isSelected:r,inputValue:r?t.inputValue:""}))),g&&d(""),void(r&&setTimeout((()=>{var t;return null==(t=u.current)?void 0:t.focus()}),75))}if(g)return d(t),f((t=>i({},t,{isSelected:!1,inputValue:""}))),void(y&&(o(t),p&&a(t)));m&&Ui(c)&&(c.includes(t)?d(c.filter((e=>e!==t))):d([...c,t]))},_=t=>{t.stopPropagation();var e=t.currentTarget.value;f((t=>i({},t,{inputValue:e}))),g&&d(e)},w=t=>{t.stopPropagation(),"Enter"!==t.key||I()||(t.preventDefault(),C()),"Escape"===t.key&&(t.preventDefault(),f((t=>i({},t,{isSelected:!1,inputValue:""}))),g&&d(null))},I=()=>!e.optional&&(!!rr(c)||(!(!Ui(c)||v.isSelected||0!==c.length)||!(!v.isSelected||""!==v.inputValue.trim()))),C=()=>{v.isSelected&&m?Ui(c)&&(p?a([...c,v.inputValue]):o([...c,v.inputValue])):p?a(c):o(c)};return _h(Aa,{children:[_h("div",{className:"question-container",children:[_h(Mh,{question:e,forceDisableHtml:r}),_h("fieldset",{className:"multiple-choice-options limit-height",children:[_h("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((t,i)=>{var r=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+n+"Choice"+i,o=s+"Open",a=r?v.isSelected:g?c===t:Ui(c)&&c.includes(t);return _h("label",{className:r?"choice-option-open":"",children:[_h("div",{className:"response-choice",children:[_h("input",{type:g?"radio":"checkbox",name:s,checked:a,onChange:()=>b(t,r),id:s,"aria-controls":o}),_h("span",{children:r?t+":":t})]}),r&&_h("input",{type:"text",ref:u,id:o,name:"question"+n+"Open",value:v.inputValue,onKeyDown:w,onInput:_,onClick:e=>{v.isSelected||b(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},i)}))]})]}),_h(Eh,{text:e.buttonText||"Submit",submitDisabled:I(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:y})]})}var $h=[Ch,Ih,wh],qh=[Sh,Ch,Ih,wh,kh],Hh=[1,2,3,4,5],Vh=[1,2,3,4,5,6,7],jh=[0,1,2,3,4,5,6,7,8,9,10];function Yh(t){switch(t){case 5:default:return Hh;case 7:return Vh;case 10:return jh}}var Gh=Yn,zh=Jn,Wh="ph:show_survey_widget",Uh="PHWidgetSurveyClickListener";function Xh(t,e,i){var r,n=t.questions[e],s=e+1;if(null==(r=n.branching)||!r.type)return e===t.questions.length-1?Sl.End:s;if(n.branching.type===Sl.End)return Sl.End;if(n.branching.type===Sl.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Sl.ResponseBased){if(n.type===Cl.SingleChoice){var o,a=n.choices.indexOf(""+i);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===Sl.End?Sl.End:s}}else if(n.type===Cl.Rating){var u;if("number"!=typeof i||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(t,e){if(3===e){if(t<1||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(t<1||t>5)throw new Error("The response must be in range 1-5");return t<=2?"negative":3===t?"neutral":"positive"}if(7===e){if(t<1||t>7)throw new Error("The response must be in range 1-7");return t<=3?"negative":4===t?"neutral":"positive"}if(10===e){if(t<0||t>10)throw new Error("The response must be in range 0-10");return t<=6?"detractors":t<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(i,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===Sl.End?Sl.End:s}}return s}return El.warn("Falling back to next question index due to unexpected branching type"),s}var Jh=250,Kh=20,Qh=12;class tc{constructor(t){var e=this;this.P=new Map,this.L=new Map,this.D=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(Js);if(t)for(var e of t)gh(e)&&rh(e,this._posthog)},this.handlePopoverSurvey=t=>{var e;this.B(t.id),this.Z(t);var r=(null==(e=t.appearance)?void 0:e.surveyPopupDelaySeconds)||0,{shadow:n}=Ju(t,this._posthog);if(r<=0)return Ya(_h(sc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$}),n);var s=setTimeout((()=>{if(this.P.delete(t.id),!dh(t))return this.$(t);Ya(_h(sc,{posthog:this._posthog,survey:i({},t,{appearance:i({},t.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.$}),n)}),1e3*r);this.P.set(t.id,s)},this.q=t=>{var{shadow:e,isNewlyCreated:i}=Ju(t,this._posthog);i&&Ya(_h(ac,{posthog:this._posthog,survey:t},t.id),e)},this.H=t=>{this.V(t);var e=this.L.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Uh),this.L.delete(t.id),El.info("Removed click listener for survey "+t.id))},this.j=(t,e)=>{var i=zh.querySelector(e),r=this.L.get(t.id);if(i){if(this.q(t),r){if(i===r.element)return;El.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.H(t)}if(!i.hasAttribute(Uh)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===_l.NextToTrigger?function(t,e){try{var i=t.getBoundingClientRect(),r=Gh.innerHeight,n=Gh.innerWidth,s=Jh,o=i.left+i.width/2-e/2;o+e>n-Kh&&(o=n-e-Kh),o<Kh&&(o=Kh);var a=Qh,l=r-i.bottom,u=i.top,h=l<s&&u>l;return{position:"fixed",top:h?"auto":i.bottom+a+"px",left:o+"px",right:"auto",bottom:h?r-i.top+a+"px":"auto",zIndex:zu.zIndex}}catch(t){return El.warn("Failed to calculate trigger position:",t),null}}(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||zu.maxWidth)):{};Gh.dispatchEvent(new CustomEvent(Wh,{detail:{surveyId:t.id,position:n}}))};Cs(i,"click",n),i.setAttribute(Uh,"true"),this.L.set(t.id,{element:i,listener:n,survey:t}),El.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.H(t)},this.renderPopover=t=>{var{shadow:e}=Ju(t,this._posthog);Ya(_h(sc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$}),e)},this.renderSurvey=(t,e)=>{var i;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&this.Y(t),Ya(_h(sc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$,isPopup:!1}),e)},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||r.surveys.getSurveys((i=>{var r=i.filter((t=>e.checkSurveyEligibility(t).eligible&&e.G(t)&&e.W(t)&&e.U(t)));t(r)}),i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var i=t.filter((t=>t.type===Il.Popover||t.type===Il.Widget)),r=e.X(i),n=new Set;r.forEach((t=>{if(t.type===Il.Widget){var i,r,s,o;if((null==(i=t.appearance)?void 0:i.widgetType)===bl.Tab)return void e.q(t);if((null==(r=t.appearance)?void 0:r.widgetType)===bl.Selector&&null!=(s=t.appearance)&&s.widgetSelector)n.add(t.id),e.j(t,null==(o=t.appearance)?void 0:o.widgetSelector)}rr(e.J)&&t.type===Il.Popover&&e.handlePopoverSurvey(t)})),e.L.forEach((t=>{var{survey:i}=t;n.has(i.id)||e.H(i)}))}),t)},this.Z=t=>{rr(this.J)||El.error("Survey "+this.J+" already in focus. Cannot add survey "+t.id+"."),this.J=t.id},this.$=t=>{this.J!==t.id&&El.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.B(t.id),this.J=null,this.V(t)},this._posthog=t,this.J=null}B(t){var e=this.P.get(t);e&&(clearTimeout(e),this.P.delete(t))}cancelSurvey(t){this.P.has(t)&&(El.info("Cancelled pending survey "+t),this.B(t),this.J===t&&(this.J=null))}X(t){return t.sort(((t,e)=>{var i,r,n=gh(t),s=gh(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===kl.Always,a=e.schedule===kl.Always;return o&&!a?1:!o&&a?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)}))}Y(t){if(!this.D.has(t.id))try{var{params:e}=function(t){var e={},i=!1,r=t.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:i};var n=r.split("&");for(var s of n){var[o,a]=s.split("=");if(o&&!tr(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);e[c]||(e[c]=[]),e[c].push(u)}}else i=!0}}return{params:e,autoSubmit:i}}(Gh.location.search);if(0===Object.keys(e).length)return;El.info("[Survey Prefill] Detected URL prefill parameters");var i=function(t,e){var i={};return t.questions.forEach(((t,r)=>{if(e[r]&&t.id){var n=e[r],s=Yu(t.id);try{switch(t.type){case Cl.SingleChoice:if(!t.choices||0===t.choices.length)return void ls.warn("[Survey Prefill] Question "+r+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||o<0||o>=t.choices.length)return void ls.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[o];break;case Cl.MultipleChoice:if(!t.choices||0===t.choices.length)return void ls.warn("[Survey Prefill] Question "+r+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&e<t.choices.length));if(0===a.length)return void ls.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(a.map((e=>t.choices[e])))];l.length<a.length&&ls.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case Cl.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||u<0||u>h)return void ls.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:ls.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){ls.error("[Survey Prefill] Error converting q"+r+":",t)}}})),i}(t,e);if(0===Object.keys(i).length)return void El.warn("[Survey Prefill] No valid responses after conversion");var r=zl(),n=Object.keys(e).map((t=>parseInt(t,10))),{startQuestionIndex:s,skippedResponses:o}=function(t,e,i){for(var r=0,n={},s=0;s<t.length&&e.includes(s);s++){var o=t[s];if(!(o&&"skipSubmitButton"in o&&o.skipSubmitButton))break;if(r=s+1,o.id){var a=Yu(o.id);tr(i[a])||(n[a]=i[a])}}return{startQuestionIndex:r,skippedResponses:n}}(t.questions,n,i),a=s>=t.questions.length;fh(t,{surveySubmissionId:r,responses:i,lastQuestionIndex:a?t.questions.length-1:s}),El.info("[Survey Prefill] Stored prefilled responses in localStorage"),(Object.keys(o).length>0&&t.enable_partial_responses||a)&&Qu({responses:a?i:o,survey:t,surveySubmissionId:r,posthog:this._posthog,isSurveyCompleted:a}),this.D.add(t.id)}catch(t){El.error("[Survey Prefill] Error handling URL prefill:",t)}}K(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=!!this._posthog.featureFlags.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}),r=!0;e&&(r=this._posthog.featureFlags.getFeatureFlag(t,{send_event:!1})===e||"any"===e);return i&&r}G(t){return!t.conditions||dh(t)&&function(t){var e,i,r;if(null==(e=t.conditions)||!e.deviceTypes||0===(null==(i=t.conditions)?void 0:i.deviceTypes.length))return!0;if(!is)return!1;var n=mn(is);return Zu[ch(null==(r=t.conditions)?void 0:r.deviceTypesMatchType)](t.conditions.deviceTypes,[n])}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==ju||!ju.querySelector(t.conditions.selector))}(t)}tt(t){return ah(t)||this.K(t.internal_targeting_flag_key)||gh(t)}checkSurveyEligibility(t){var e,i,r={eligible:!0,reason:void 0};if(!Ml(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!Zl.includes(t.type))return r.eligible=!1,r.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",r;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;return this.K(t.linked_flag_key,n)?this.K(t.targeting_flag_key)?this.tt(t)?(t=>{var e=localStorage.getItem("lastSeenSurveyDate");if(!t||!e)return!0;var i=new Date,r=Math.abs(i.getTime()-new Date(e).getTime());return Math.ceil(r/864e5)>t})(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays)?(t=>!!localStorage.getItem(Dl(t))&&!ah(t))(t)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",r):(r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r):(r.eligible=!1,r.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",r)}W(t){var e;if(!Nl(t)&&!Rl(t))return!0;var i=null==(e=this._posthog.surveys._surveyEventReceiver)?void 0:e.getSurveys();return!(null==i||!i.includes(t.id))}U(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:i}=t;return!e||!i||this.K(i)}))}V(t){try{var e=zh.querySelector(yh(t,!0));null!=e&&e.shadowRoot&&Ya(null,e.shadowRoot),null==e||e.remove()}catch(e){El.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.J,surveyTimeouts:this.P,handleWidget:this.q,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.j,sortSurveysByAppearanceDelay:this.X,checkFlags:this.U.bind(this),isSurveyFeatureFlagEnabled:this.K.bind(this)}}}function ec(t,e){if(zh&&Gh){var i,r=new tc(t);if(t.config.disable_surveys_automatic_display)return El.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return El.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{tr(i)&&(i=setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Cs(zh,"visibilitychange",(()=>{zh.hidden?tr(i)||(clearInterval(i),i=void 0):(r.callSurveysAndEvaluateDisplayLogic(!1),n())})),r}}function ic(t){var{survey:e,removeSurveyFromFocus:i=(()=>{}),setSurveyVisible:r,isPreviewMode:n=!1}=t;al((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var s=()=>{var t,n=e.type===Il.Widget,s=dh(e),o=(null==(t=e.appearance)?void 0:t.widgetType)===bl.Tab&&n;if(!s)return El.info("Hiding survey "+e.id+" because URL does not match"),r(!1),i(e);o&&(El.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),r(!0))};Cs(Gh,"popstate",s),Cs(Gh,"hashchange",s);var o=Gh.history.pushState,a=Gh.history.replaceState;return Gh.history.pushState=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];o.apply(this,e),s()},Gh.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];a.apply(this,e),s()},()=>{Gh.removeEventListener("popstate",s),Gh.removeEventListener("hashchange",s),Gh.history.pushState=o,Gh.history.replaceState=a}}}),[n,e,i,r])}function rc(t,e,i){if(void 0===e&&(e=_l.Right),t===Il.ExternalSurvey)return{};switch(e){case _l.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case _l.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case _l.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case _l.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case _l.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case _l.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case _l.Left:return{left:"30px"};case _l.Center:return{left:"50%",transform:"translateX(-50%)"};default:case _l.Right:return{right:t===Il.Widget&&i===bl.Tab?"60px":"30px"}}}function nc(t){switch(void 0===t&&(t=wl.Right),t){case wl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case wl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case wl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case wl.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function sc(t){var e,r,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=(()=>{})}=t,y=ll(null),b=Number.isInteger(d),_=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:w,isSurveySent:I,hidePopupWithViewTransition:C}=function(t,e,i,r,n,s,o){var[a,l]=ol(r||0===i||t.type===Il.ExternalSurvey),[u,h]=ol(!1),c=()=>{var e=()=>{s&&n(t),l(!1)};zh.startViewTransition?zh.startViewTransition((()=>{var t;null==o||null==(t=o.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},d=e=>{e.detail.surveyId===t.id&&c()};return al((()=>{if(e){if(!r){var n=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return c();h(!0),null!=(r=t.appearance)&&r.autoDisappear&&setTimeout((()=>{c()}),5e3)}},s=()=>{dh(t)&&(l(!0),Gh.dispatchEvent(new Event("PHSurveyShown")),e.capture(xl.SHOWN,{[Al.SURVEY_NAME]:t.name,[Al.SURVEY_ID]:t.id,[Al.SURVEY_ITERATION]:t.current_iteration,[Al.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(Cs(Gh,"PHSurveyClosed",d),Cs(Gh,"PHSurveySent",n),i>0){var o=setTimeout(s,i);return()=>{clearTimeout(o),Gh.removeEventListener("PHSurveyClosed",d),Gh.removeEventListener("PHSurveySent",n)}}return s(),()=>{Gh.removeEventListener("PHSurveyClosed",d),Gh.removeEventListener("PHSurveySent",n)}}}else El.error("usePopupVisibility hook called without a PostHog instance.")}),[]),ic({survey:t,removeSurveyFromFocus:n,setSurveyVisible:l,isPreviewMode:r}),{isPopupVisible:a,isSurveySent:u,setIsPopupVisible:l,hidePopupWithViewTransition:c}}(l,h,_,b,v,f,y),S=I||d===l.questions.length,k=ul((()=>{var t=ph(l);return{isPreviewMode:b,previewPageIndex:d,onPopupSurveyDismissed:()=>{ih(l,h,b),g()},isPopup:f||!1,surveySubmissionId:(null==t?void 0:t.surveySubmissionId)||zl(),onPreviewSubmit:p,posthog:h}}),[b,d,f,h,l,g,p]);return w?_h(lh.Provider,{value:k,children:_h("div",{className:"ph-survey",style:i({},rc(l.type,null==(r=l.appearance)?void 0:r.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:y,children:S?_h(Fh,{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||zu,onClose:()=>{C(),m()}}):_h(oc,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function oc(t){var e,{survey:r,forceDisableHtml:n,posthog:s}=t,[o,a]=ol((()=>{var t=ph(r);return null!=t&&t.responses&&El.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),{previewPageIndex:l,onPopupSurveyDismissed:u,isPopup:h,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:v}=hl(lh),[f,p]=ol((()=>{var t=ph(r);return l||(null==t?void 0:t.lastQuestionIndex)||0})),g=ul((()=>oh(r)),[r]);al((()=>{v&&!tr(l)&&p(l)}),[l,v]);var m=g.at(f);return m?_h("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=r.appearance)?void 0:e.hideCancelButton)&&_h(Nh,{onClick:()=>{u()}}),_h("div",{className:"survey-box",children:lc({question:m,forceDisableHtml:n,displayQuestionIndex:f,appearance:r.appearance||zu,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:l}=t;if(s)if(l){var u=Yu(l),h=i({},o,{[u]:e});a(h);var c=Xh(r,n,e),v=c===Sl.End;v||(p(c),fh(r,{surveySubmissionId:d,responses:h,lastQuestionIndex:c})),(r.enable_partial_responses||v)&&Qu({responses:h,survey:r,surveySubmissionId:d,isSurveyCompleted:v,posthog:s})}else El.error("onNextButtonClick called without a questionId.");else El.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:f,questionId:m.id}),onPreviewSubmit:c,initialValue:m.id?o[Yu(m.id)]:void 0})})]}):null}function ac(t){var e,i,r,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:h,readOnly:c}=t,[d,v]=ol(!0),[f,p]=ol(!1),[g,m]=ol({}),y=()=>{p(!f)};if(al((()=>{var t;if(h){if(!c){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&m({top:"50%",bottom:"auto"});var e=t=>{var e,i=t;(null==(e=i.detail)?void 0:e.surveyId)===l.id&&(El.info("Received show event for feedback button survey "+l.id),m(i.detail.position||{}),y())};return Cs(Gh,Wh,e),()=>{Gh.removeEventListener(Wh,e)}}}else El.error("FeedbackWidget called without a PostHog instance.")}),[h,c,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(i=l.appearance)?void 0:i.widgetSelector,null==(r=l.appearance)?void 0:r.borderColor]),ic({survey:l,setSurveyVisible:v}),!d)return null;var b=()=>{l.schedule!==kl.Always&&v(!1),setTimeout((()=>{p(!1)}),200)};return _h(Aa,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&_h("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===wl.Top?"widget-tab-top":""),onClick:y,disabled:c,style:nc(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),f&&_h(sc,{posthog:h,survey:l,forceDisableHtml:u,style:g,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var lc=t=>{var{question:e,forceDisableHtml:r,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=t,u={forceDisableHtml:r,appearance:s,onPreviewSubmit:t=>{a(t)},onSubmit:t=>{o(t)},initialValue:l,displayQuestionIndex:n};switch(e.type){case Cl.Open:return ka(Ph,i({},u,{question:e,key:e.id}));case Cl.Link:return ka(Lh,i({},u,{question:e,key:e.id}));case Cl.Rating:return ka(Dh,i({},u,{question:e,key:e.id}));case Cl.SingleChoice:case Cl.MultipleChoice:return ka(Zh,i({},u,{question:e,key:e.id}));default:return El.error("Unsupported question type: "+e.type),null}};rs.__PosthogExtensions__=rs.__PosthogExtensions__||{},rs.__PosthogExtensions__.generateSurveys=ec,rs.extendPostHogWithSurveys=ec;var uc=us("[Error tracking]");function hc(){return new _n([new On,new jn,new Ln,new Pn,new Hn,new qn,new Bn,new Vn],Fn("web:javascript",An,Mn))}class cc{constructor(t){var e,i;this.et=[],this.it=hc(),this._instance=t,this.et=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property(Ds))&&void 0!==e?e:[]}onRemoteConfig(t){var e,i,r,n=null!==(e=null==(i=t.errorTracking)?void 0:i.suppressionRules)&&void 0!==e?e:[],s=null==(r=t.errorTracking)?void 0:r.captureExtensionExceptions;this.et=n,this._instance.persistence&&this._instance.persistence.register({[Ds]:this.et,[Bs]:s})}get rt(){var t,e=!!this._instance.get_property(Bs),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=i?i:e)&&void 0!==t&&t}buildProperties(t,e){return this.it.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}sendExceptionEvent(t){var e=t.$exception_list;if(this.nt(e)){if(this.st(e))return void uc.info("Skipping exception capture because a suppression rule matched");if(!this.rt&&this.ot(e))return void uc.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ut(e))return void uc.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}st(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:i,value:r}=e;return er(i)&&i.length>0&&t.$exception_types.push(i),er(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.et.some((t=>{var i=t.values.map((t=>{var i,r=Zu[t.operator],n=Ui(t.value)?t.value:[t.value],s=null!==(i=e[t.key])&&void 0!==i?i:[];return n.length>0&&r(n,s)}));return"OR"===t.type?i.some(Boolean):i.every(Boolean)}))}ot(t){var e=t.flatMap((t=>{var e,i;return null!==(e=null==(i=t.stacktrace)?void 0:i.frames)&&void 0!==e?e:[]}));return e.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ut(t){if(t.length>0){var e,i,r,n,s=null!==(e=null==(i=t[0].stacktrace)?void 0:i.frames)&&void 0!==e?e:[],o=s[s.length-1];return null!==(r=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}nt(t){return!nr(t)&&Ui(t)}}var dc=us("[ExceptionAutocapture]"),vc=hc(),fc={wrapOnError:t=>{var e=Yn;e||dc.info("window not available, cannot wrap onerror");var i=e.onerror;return e.onerror=function(){for(var e,r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];var o=n[4],a=n[0],l=vc.buildFromUnknown(o||a,{mechanism:{handled:!1}});return t(l),null!==(e=null==i?void 0:i(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=i}},wrapUnhandledRejection:t=>{var e=Yn;e||dc.info("window not available, cannot wrap onUnhandledRejection");var i=e.onunhandledrejection;return e.onunhandledrejection=function(r){var n,s=vc.buildFromUnknown(r,{mechanism:{handled:!1}});return t(s),null!==(n=null==i?void 0:i.apply(e,[r]))&&void 0!==n&&n},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=i}},wrapConsoleError:t=>{var e=console;e||dc.info("console not available, cannot wrap console.error");var i=e.error;return e.error=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var s=r.join(" "),o=r.find((t=>t instanceof Error)),a=vc.buildFromUnknown(o||s,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException")});return t(a),null==i?void 0:i(...r)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=i}}};rs.__PosthogExtensions__=rs.__PosthogExtensions__||{},rs.__PosthogExtensions__.errorWrappingFunctions=fc,rs.posthogErrorWrappingFunctions=fc;var pc=(t,e,i,r)=>{var n;try{n=new URL(r.url).hostname}catch(t){return}if(!Ui(t)||t.includes(n)){if(i){var{sessionId:s,windowId:o}=i.checkAndGetSessionAndWindowId(!0);r.headers.set("X-POSTHOG-SESSION-ID",s),r.headers.set("X-POSTHOG-WINDOW-ID",o)}e!==ao&&r.headers.set("X-POSTHOG-DISTINCT-ID",e)}};rs.__PosthogExtensions__=rs.__PosthogExtensions__||{};var gc={_patchFetch:(t,i,r)=>Es(Yn,"fetch",(n=>function(){var s=e((function*(e,s){var o=new Request(e,s);return pc(t,i,r,o),n(o)}));return function(t,e){return s.apply(this,arguments)}}())),_patchXHR:(t,e,i)=>Es(Yn.XMLHttpRequest.prototype,"open",(r=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=new Request(s);return pc(t,e,i,u),r.call(this,n,u.url,o,a,l)}))};rs.__PosthogExtensions__.tracingHeadersPatchFns=gc,rs.postHogTracingHeadersPatchFns=gc;var mc,yc,bc=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},_c=function(t){if("loading"===document.readyState)return"loading";var e=bc();if(e){if(t<e.domInteractive)return"loading";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return"dom-interactive";if(0===e.domComplete||t<e.domComplete)return"dom-content-loaded"}return"complete"},wc=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Ic=function(t,e){var i="";try{for(;t&&9!==t.nodeType;){var r=t,n=r.id?"#"+r.id:wc(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(i.length+n.length>(e||100)-1)return i||n;if(i=i?n+">"+i:n,r.id)break;t=r.parentNode}}catch(t){}return i},Cc=-1,Sc=function(){return Cc},kc=function(t){addEventListener("pageshow",(function(e){e.persisted&&(Cc=e.timeStamp,t(e))}),!0)},xc=function(){var t=bc();return t&&t.activationStart||0},Ac=function(t,e){var i=bc(),r="navigate";return Sc()>=0?r="back-forward-cache":i&&(document.prerendering||xc()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-"))),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Tc=function(t,e,i){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return r.observe(Object.assign({type:t,buffered:!0},i||{})),r}}catch(t){}},Ec=function(t,e,i,r){var n,s;return function(o){e.value>=0&&(o||r)&&((s=e.value-(n||0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,i),t(e))}},Mc=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},Nc=function(t){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t()}))},Rc=function(t){var e=!1;return function(){e||(t(),e=!0)}},Fc=-1,Oc=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Pc=function(t){"hidden"===document.visibilityState&&Fc>-1&&(Fc="visibilitychange"===t.type?t.timeStamp:0,Dc())},Lc=function(){addEventListener("visibilitychange",Pc,!0),addEventListener("prerenderingchange",Pc,!0)},Dc=function(){removeEventListener("visibilitychange",Pc,!0),removeEventListener("prerenderingchange",Pc,!0)},Bc=function(){return Fc<0&&(Fc=Oc(),Lc(),kc((function(){setTimeout((function(){Fc=Oc(),Lc()}),0)}))),{get firstHiddenTime(){return Fc}}},Zc=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},$c=[1800,3e3],qc=function(t,e){e=e||{},Zc((function(){var i,r=Bc(),n=Ac("FCP"),s=Tc("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(s.disconnect(),t.startTime<r.firstHiddenTime&&(n.value=Math.max(t.startTime-xc(),0),n.entries.push(t),i(!0)))}))}));s&&(i=Ec(t,n,$c,e.reportAllChanges),kc((function(r){n=Ac("FCP"),i=Ec(t,n,$c,e.reportAllChanges),Mc((function(){n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},Hc=[.1,.25],Vc=0,jc=1/0,Yc=0,Gc=function(t){t.forEach((function(t){t.interactionId&&(jc=Math.min(jc,t.interactionId),Yc=Math.max(Yc,t.interactionId),Vc=Yc?(Yc-jc)/7+1:0)}))},zc=function(){return mc?Vc:performance.interactionCount||0},Wc=function(){"interactionCount"in performance||mc||(mc=Tc("event",Gc,{type:"event",buffered:!0,durationThreshold:0}))},Uc=[],Xc=new Map,Jc=0,Kc=[],Qc=function(t){if(Kc.forEach((function(e){return e(t)})),t.interactionId||"first-input"===t.entryType){var e=Uc[Uc.length-1],i=Xc.get(t.interactionId);if(i||Uc.length<10||t.duration>e.latency){if(i)t.duration>i.latency?(i.entries=[t],i.latency=t.duration):t.duration===i.latency&&t.startTime===i.entries[0].startTime&&i.entries.push(t);else{var r={id:t.interactionId,latency:t.duration,entries:[t]};Xc.set(r.id,r),Uc.push(r)}Uc.sort((function(t,e){return e.latency-t.latency})),Uc.length>10&&Uc.splice(10).forEach((function(t){return Xc.delete(t.id)}))}}},td=function(t){var e=self.requestIdleCallback||self.setTimeout,i=-1;return t=Rc(t),"hidden"===document.visibilityState?t():(i=e(t),Nc(t)),i},ed=[200,500],id=function(t,e){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(e=e||{},Zc((function(){var i;Wc();var r,n=Ac("INP"),s=function(t){td((function(){t.forEach(Qc);var e=function(){var t=Math.min(Uc.length-1,Math.floor((zc()-Jc)/50));return Uc[t]}();e&&e.latency!==n.value&&(n.value=e.latency,n.entries=e.entries,r())}))},o=Tc("event",s,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});r=Ec(t,n,ed,e.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),Nc((function(){s(o.takeRecords()),r(!0)})),kc((function(){Jc=zc(),Uc.length=0,Xc.clear(),n=Ac("INP"),r=Ec(t,n,ed,e.reportAllChanges)})))})))},rd=[],nd=[],sd=0,od=new WeakMap,ad=new Map,ld=-1,ud=function(t){rd=rd.concat(t),hd()},hd=function(){ld<0&&(ld=td(cd))},cd=function(){ad.size>10&&ad.forEach((function(t,e){Xc.has(e)||ad.delete(e)}));var t=Uc.map((function(t){return od.get(t.entries[0])})),e=nd.length-50;nd=nd.filter((function(i,r){return r>=e||t.includes(i)}));for(var i=new Set,r=0;r<nd.length;r++){var n=nd[r];dd(n.startTime,n.processingEnd).forEach((function(t){i.add(t)}))}var s=rd.length-1-50;rd=rd.filter((function(t,e){return t.startTime>sd&&e>s||i.has(t)})),ld=-1};Kc.push((function(t){t.interactionId&&t.target&&!ad.has(t.interactionId)&&ad.set(t.interactionId,t.target)}),(function(t){var e,i=t.startTime+t.duration;sd=Math.max(sd,t.processingEnd);for(var r=nd.length-1;r>=0;r--){var n=nd[r];if(Math.abs(i-n.renderTime)<=8){(e=n).startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd),e.entries.push(t);break}}e||(e={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:i,entries:[t]},nd.push(e)),(t.interactionId||"first-input"===t.entryType)&&od.set(t,e),hd()}));var dd=function(t,e){for(var i,r=[],n=0;i=rd[n];n++)if(!(i.startTime+i.duration<t)){if(i.startTime>e)break;r.push(i)}return r},vd=[2500,4e3],fd={},pd={onLCP:function(t,e){!function(t,e){e=e||{},Zc((function(){var i,r=Bc(),n=Ac("LCP"),s=function(t){e.reportAllChanges||(t=t.slice(-1)),t.forEach((function(t){t.startTime<r.firstHiddenTime&&(n.value=Math.max(t.startTime-xc(),0),n.entries=[t],i())}))},o=Tc("largest-contentful-paint",s);if(o){i=Ec(t,n,vd,e.reportAllChanges);var a=Rc((function(){fd[n.id]||(s(o.takeRecords()),o.disconnect(),fd[n.id]=!0,i(!0))}));["keydown","click"].forEach((function(t){addEventListener(t,(function(){return td(a)}),{once:!0,capture:!0})})),Nc(a),kc((function(r){n=Ac("LCP"),i=Ec(t,n,vd,e.reportAllChanges),Mc((function(){n.value=performance.now()-r.timeStamp,fd[n.id]=!0,i(!0)}))}))}}))}((function(e){var i=function(t){var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var i=bc();if(i){var r=i.activationStart||0,n=t.entries[t.entries.length-1],s=n.url&&performance.getEntriesByType("resource").filter((function(t){return t.name===n.url}))[0],o=Math.max(0,i.responseStart-r),a=Math.max(o,s?(s.requestStart||s.startTime)-r:0),l=Math.max(a,s?s.responseEnd-r:0),u=Math.max(l,n.startTime-r);e={element:Ic(n.element),timeToFirstByte:o,resourceLoadDelay:a-o,resourceLoadDuration:l-a,elementRenderDelay:u-l,navigationEntry:i,lcpEntry:n},n.url&&(e.url=n.url),s&&(e.lcpResourceEntry=s)}}return Object.assign(t,{attribution:e})}(e);t(i)}),e)},onCLS:function(t,e){!function(t,e){e=e||{},qc(Rc((function(){var i,r=Ac("CLS",0),n=0,s=[],o=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=s[0],i=s[s.length-1];n&&t.startTime-i.startTime<1e3&&t.startTime-e.startTime<5e3?(n+=t.value,s.push(t)):(n=t.value,s=[t])}})),n>r.value&&(r.value=n,r.entries=s,i())},a=Tc("layout-shift",o);a&&(i=Ec(t,r,Hc,e.reportAllChanges),Nc((function(){o(a.takeRecords()),i(!0)})),kc((function(){n=0,r=Ac("CLS",0),i=Ec(t,r,Hc,e.reportAllChanges),Mc((function(){return i()}))})),setTimeout(i,0))})))}((function(e){var i=function(t){var e,i={};if(t.entries.length){var r=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(r&&r.sources&&r.sources.length){var n=(e=r.sources).find((function(t){return t.node&&1===t.node.nodeType}))||e[0];n&&(i={largestShiftTarget:Ic(n.node),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:n,largestShiftEntry:r,loadState:_c(r.startTime)})}}return Object.assign(t,{attribution:i})}(e);t(i)}),e)},onFCP:function(t,e){qc((function(e){var i=function(t){var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:_c(Sc())};if(t.entries.length){var i=bc(),r=t.entries[t.entries.length-1];if(i){var n=i.activationStart||0,s=Math.max(0,i.responseStart-n);e={timeToFirstByte:s,firstByteToFCP:t.value-s,loadState:_c(t.entries[0].startTime),navigationEntry:i,fcpEntry:r}}}return Object.assign(t,{attribution:e})}(e);t(i)}),e)},onINP:function(t,e){yc||(yc=Tc("long-animation-frame",ud)),id((function(e){var i=function(t){var e=t.entries[0],i=od.get(e),r=e.processingStart,n=i.processingEnd,s=i.entries.sort((function(t,e){return t.processingStart-e.processingStart})),o=dd(e.startTime,n),a=t.entries.find((function(t){return t.target})),l=a&&a.target||ad.get(e.interactionId),u=[e.startTime+e.duration,n].concat(o.map((function(t){return t.startTime+t.duration}))),h=Math.max.apply(Math,u),c={interactionTarget:Ic(l),interactionTargetElement:l,interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:h,processedEventEntries:s,longAnimationFrameEntries:o,inputDelay:r-e.startTime,processingDuration:n-r,presentationDelay:Math.max(h-n,0),loadState:_c(e.startTime)};return Object.assign(t,{attribution:c})}(e);t(i)}),e)}};rs.__PosthogExtensions__=rs.__PosthogExtensions__||{},rs.__PosthogExtensions__.postHogWebVitalsCallbacks=pd,rs.postHogWebVitalsCallbacks=pd;class gd{constructor(t){this.disabled=!1===t;var e=Ki(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&i-r.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:e,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:i}];return!1}}var md="$copy_autocapture",yd=us("[AutoCapture]");function bd(t,e){return e.length>t?e.slice(0,t)+"...":e}function _d(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!ho(e));return e}function wd(t,e,i,r){var n=t.tagName.toLowerCase(),s={tag_name:n};wo.indexOf(n)>-1&&!i&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?s.$el_text=bd(1024,$o(t)):s.$el_text=bd(1024,bo(t)));var o=mo(t);o.length>0&&(s.classes=o.filter((function(t){return""!==t}))),ds(t.attributes,(function(i){var n;if((!Ro(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&((null==r||!r.includes(i.name))&&!e&&Zo(i.value)&&(n=i.name,!er(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var o=i.value;"class"===i.name&&(o=po(o).join(" ")),s["attr__"+i.name]=bd(1024,o)}}));for(var a=1,l=1,u=t;u=_d(u);)a++,u.tagName===t.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}function Id(t,e){for(var i,r,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=e,u=[t],h=t;h.parentNode&&!co(h,"body");)fo(h.parentNode)?(u.push(h.parentNode.host),h=h.parentNode.host):(u.push(h.parentNode),h=h.parentNode);var c,d=[],v={},f=!1,p=!1;if(ds(u,(t=>{var e=No(t);"a"===t.tagName.toLowerCase()&&(f=t.getAttribute("href"),f=e&&f&&Zo(f)&&f),Hi(mo(t),"ph-no-capture")&&(p=!0),d.push(wd(t,s,o,a));var i=function(t){if(!No(t))return{};var e={};return ds(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var i=t.name.replace("data-ph-capture-attribute-",""),r=t.value;i&&r&&Zo(r)&&(e[i]=r)}})),e}(t);vs(v,i)})),p)return{props:{},explicitNoCapture:p};if(o||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?d[0].$el_text=$o(t):d[0].$el_text=bo(t)),f){var g,m;d[0].attr__href=f;var y=null==(g=Ss(f))?void 0:g.host,b=null==Yn||null==(m=Yn.location)?void 0:m.host;y&&b&&y!==b&&(c=f)}return{props:vs({$event_type:n.type,$ce_version:1},l?{}:{$elements:d},{$elements_chain:Ho(d)},null!=(i=d[0])&&i.$el_text?{$el_text:null==(r=d[0])?void 0:r.$el_text}:{},c&&"click"===n.type?{$external_click_url:c}:{},v)}}class Cd{constructor(t){this.ht=!1,this.ct=null,this.dt=!1,this.instance=t,this.rageclicks=new gd(t.config.rageclick),this.vt=null}get ft(){var t,e,i=Ki(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(t=i.url_allowlist)?void 0:t.map((t=>new RegExp(t))),i.url_ignorelist=null==(e=i.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),i}yt(){if(this.isBrowserSupported()){if(Yn&&Jn){var t=t=>{t=t||(null==Yn?void 0:Yn.event);try{this.bt(t)}catch(t){yd.error("Failed to capture event",t)}};if(Cs(Jn,"submit",t,{capture:!0}),Cs(Jn,"change",t,{capture:!0}),Cs(Jn,"click",t,{capture:!0}),this.ft.capture_copied_text){var e=t=>{t=t||(null==Yn?void 0:Yn.event),this.bt(t,md)};Cs(Jn,"copy",e,{capture:!0}),Cs(Jn,"cut",e,{capture:!0})}}}else yd.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.ht&&(this.yt(),this.ht=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.dt=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Os]:!!t.autocapture_opt_out}),this.ct=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.vt=t}getElementSelectors(t){var e,i=[];return null==(e=this.vt)||e.forEach((e=>{var r=null==Jn?void 0:Jn.querySelectorAll(e);null==r||r.forEach((r=>{t===r&&i.push(e)}))})),i}get isEnabled(){var t,e,i=null==(t=this.instance.persistence)?void 0:t.props[Os],r=this.ct;if(rr(r)&&!or(i)&&!this.instance._t())return!1;var n=null!==(e=this.ct)&&void 0!==e?e:!!i;return!!this.instance.config.autocapture&&!n}bt(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var i,r=_o(t);if(vo(r)&&(r=r.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent)this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&Ao(r,this.instance.config.rageclick)&&this.bt(t,"$rageclick");var n=e===md;if(r&&Mo(r,t,this.ft,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=Id(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.ft.element_attribute_ignorelist,elementsChainAsString:this.dt});if(o)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(s.$element_selectors=a),e===md){var l,u=yo(null==Yn||null==(l=Yn.getSelection())?void 0:l.toString()),h=t.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=h}return this.instance.capture(e,s),!0}}}isBrowserSupported(){return Xi(null==Jn?void 0:Jn.querySelectorAll)}}var Sd={};function kd(t){return function(t,e){var i=Sd[t];if(i)return i;var r=e[t];if(Ji(r)&&!ns())return Sd[t]=r.bind(e);var n=e.document;if(n&&Xi(n.createElement))try{var s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);var o=s.contentWindow;o&&o[t]&&(r=o[t]),n.head.removeChild(s)}catch(e){ls.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return r&&Xi(r)?Sd[t]=r.bind(e):r}("MutationObserver",t)}function xd(t,e){return sr(t)&&t>=e}class Ad{wt(t){var e,i,r,n,s,o=this.It((null==t?void 0:t.__onCapture)||this.Ct.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(i=null==t?void 0:t.scroll_threshold_ms)&&void 0!==i?i:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==r?r:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:o.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:o.capture_clicks_with_modifier_keys,__onCapture:o.__onCapture}}constructor(t,e){this.St=[],this.It=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:t}),this.kt=t=>{var e=function(t){var e=_o(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);rr(e)||this.xt(e)||this.St.push(e),this.St.length&&tr(this.At)&&(this.At=rs.setTimeout((()=>{this.Tt()}),1e3))},this.Et=()=>{var t=Date.now();t%50==0&&this.St.forEach((e=>{tr(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Mt=()=>{this.Nt=Date.now()},this.instance=t,this.ft=this.wt(e),this._onCapture=this.ft.__onCapture}start(t){this.Rt(),this.Ft(),this.Ot(),this.Pt(t)}Pt(t){if(!this.Lt){var e=kd(rs);this.Lt=new e((t=>{this.Dt(t)})),this.Lt.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Lt)||t.disconnect(),this.Lt=void 0,rs.removeEventListener("click",this.kt),rs.removeEventListener("scroll",this.Et,{capture:!0}),rs.removeEventListener("selectionchange",this.Mt)}Dt(t){this.Bt=Date.now()}Rt(){Cs(rs,"click",this.kt)}Ft(){Cs(rs,"scroll",this.Et,{capture:!0})}Ot(){Cs(rs,"selectionchange",this.Mt)}xt(t){if(!t)return!0;if(!this.ft.capture_clicks_with_modifier_keys&&((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))return!0;var e;if(uo(t.node))return!0;var i=this.St.some((e=>e.node===t.node&&Math.abs(e.timestamp-t.timestamp)<1e3));return!!i||!(!co(t.node,"html")&&ho(t.node)&&!wo.includes(t.node.tagName.toLowerCase()))}Tt(){if(this.St.length){clearTimeout(this.At),this.At=void 0;var t=this.St;for(var e of(this.St=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.Bt&&e.timestamp<=this.Bt?this.Bt-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Nt&&e.timestamp<=this.Nt?this.Nt-e.timestamp:void 0;var r=xd(e.scrollDelayMs,this.ft.scroll_threshold_ms),n=xd(e.selectionChangedDelayMs,this.ft.selection_change_threshold_ms),s=xd(e.mutationDelayMs,this.ft.mutation_threshold_ms),o=xd(e.absoluteDelayMs,1.1*this.ft.mutation_threshold_ms),a=sr(e.scrollDelayMs)&&e.scrollDelayMs<this.ft.scroll_threshold_ms,l=sr(e.mutationDelayMs)&&e.mutationDelayMs<this.ft.mutation_threshold_ms,u=sr(e.selectionChangedDelayMs)&&e.selectionChangedDelayMs<this.ft.selection_change_threshold_ms;a||l||u||(r||s||o||n?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.Bt,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:r,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:n}):e.absoluteDelayMs<this.ft.mutation_threshold_ms&&this.St.push(e))}this.St.length&&tr(this.At)&&(this.At=rs.setTimeout((()=>{this.Tt()}),1e3))}}Ct(t,e){this.instance.capture("$dead_click",i({},e,Id(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.ft.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:t.scrollDelayMs,$dead_click_mutation_delay_ms:t.mutationDelayMs,$dead_click_absolute_delay_ms:t.absoluteDelayMs,$dead_click_selection_changed_delay_ms:t.selectionChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}rs.__PosthogExtensions__=rs.__PosthogExtensions__||{},rs.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Ad(t,e);var Td=us("[ExternalScriptsLoader]"),Ed=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return Td.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=null==Jn?void 0:Jn.querySelectorAll("script");if(r)for(var n,s=function(){if(r[o].src===e){var t=r[o];return t.__posthog_loading_callback_fired?{v:i()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,i(void 0,e)})),t.onerror=t=>i(t),{v:void 0})}},o=0;o<r.length;o++)if(n=s())return n.v;var a=()=>{if(!Jn)return i("document not found");var r=Jn.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=e,r.onload=t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)},r.onerror=t=>i(t),t.config.prepare_external_dependency_script&&(r=t.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");var n,s=Jn.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(r,s[0]):Jn.body.appendChild(r)};null!=Jn&&Jn.body?a():null==Jn||Jn.addEventListener("DOMContentLoaded",a)};rs.__PosthogExtensions__=rs.__PosthogExtensions__||{},rs.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{var r="/static/"+e+".js?v="+t.version;if("remote-config"===e&&(r="/array/"+t.config.token+"/config.js"),"toolbar"===e){var n=3e5;r=r+"&t="+Math.floor(Date.now()/n)*n}var s=t.requestRouter.endpointFor("assets",r);Ed(t,s,i)},rs.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);Ed(t,r,i)};var Md="";var Nd=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Rd(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=Jn),Md)return Md;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),r=Math.min(i.length,8),n="dmn_chk_"+zl();!Md&&r--;){var s=i.slice(r).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",Md=s)}return Md}(t);if(!i){var r=(t=>{var e=t.match(Nd);return e?e[0]:""})(t);r!==i&&ls.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}var Fd={Zt:()=>!!Jn,$t:function(t){ls.error("cookieStore error: "+t)},qt:function(t){if(Jn){try{for(var e=t+"=",i=Jn.cookie.split(";").filter((t=>t.length)),r=0;r<i.length;r++){for(var n=i[r];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},Ht:function(t){var e;try{e=JSON.parse(Fd.qt(t))||{}}catch(t){}return e},Vt:function(t,e,i,r,n){if(Jn)try{var s="",o="",a=Rd(Jn.location.hostname,r);if(i){var l=new Date;l.setTime(l.getTime()+24*i*60*60*1e3),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ls.warn("cookieStore warning: large cookie, len="+u.length),Jn.cookie=u,u}catch(t){return}},jt:function(t,e){if(null!=Jn&&Jn.cookie)try{Fd.Vt(t,"",-1,e)}catch(t){return}}},Od=null,Pd={Zt:function(){if(!rr(Od))return Od;var t=!0;if(tr(Yn))t=!1;else try{var e="__mplssupport__";Pd.Vt(e,"xyz"),'"xyz"'!==Pd.qt(e)&&(t=!1),Pd.jt(e)}catch(e){t=!1}return t||ls.error("localStorage unsupported; falling back to cookie store"),Od=t,t},$t:function(t){ls.error("localStorage error: "+t)},qt:function(t){try{return null==Yn?void 0:Yn.localStorage.getItem(t)}catch(t){Pd.$t(t)}return null},Ht:function(t){try{return JSON.parse(Pd.qt(t))||{}}catch(t){}return null},Vt:function(t,e){try{null==Yn||Yn.localStorage.setItem(t,JSON.stringify(e))}catch(t){Pd.$t(t)}},jt:function(t){try{null==Yn||Yn.localStorage.removeItem(t)}catch(t){Pd.$t(t)}}},Ld=["$device_id","distinct_id",js,Ys,so,no],Dd={},Bd={Zt:function(){return!0},$t:function(t){ls.error("memoryStorage error: "+t)},qt:function(t){return Dd[t]||null},Ht:function(t){return Dd[t]||null},Vt:function(t,e){Dd[t]=e},jt:function(t){delete Dd[t]}},Zd=null,$d={Zt:function(){if(!rr(Zd))return Zd;if(Zd=!0,tr(Yn))Zd=!1;else try{var t="__support__";$d.Vt(t,"xyz"),'"xyz"'!==$d.qt(t)&&(Zd=!1),$d.jt(t)}catch(t){Zd=!1}return Zd},$t:function(t){ls.error("sessionStorage error: ",t)},qt:function(t){try{return null==Yn?void 0:Yn.sessionStorage.getItem(t)}catch(t){$d.$t(t)}return null},Ht:function(t){try{return JSON.parse($d.qt(t))||null}catch(t){}return null},Vt:function(t,e){try{null==Yn||Yn.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){$d.$t(t)}},jt:function(t){try{null==Yn||Yn.sessionStorage.removeItem(t)}catch(t){$d.$t(t)}}},qd=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class Hd{constructor(t){this._instance=t}get ft(){return this._instance.config}get consent(){return this.Yt()?qd.DENIED:this.Gt}isOptedOut(){return"always"===this.ft.cookieless_mode||(this.consent===qd.DENIED||this.consent===qd.PENDING&&(this.ft.opt_out_capturing_by_default||"on_reject"===this.ft.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===qd.DENIED}optInOut(t){this.zt.Vt(this.Wt,t?1:0,this.ft.cookie_expiration,this.ft.cross_subdomain_cookie,this.ft.secure_cookie)}reset(){this.zt.jt(this.Wt,this.ft.cross_subdomain_cookie)}get Wt(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:i}=this._instance.config;return i||(e?e+t:"__ph_opt_in_out_"+t)}get Gt(){var t=this.zt.qt(this.Wt);return vr(t)?qd.GRANTED:Hi(fr,t)?qd.DENIED:qd.PENDING}get zt(){if(!this.Ut){var t=this.ft.opt_out_capturing_persistence_type;this.Ut="localStorage"===t?Pd:Fd;var e="localStorage"===t?Fd:Pd;e.qt(this.Wt)&&(this.Ut.qt(this.Wt)||this.optInOut(vr(e.qt(this.Wt))),e.jt(this.Wt,this.ft.cross_subdomain_cookie))}return this.Ut}Yt(){return!!this.ft.respect_dnt&&!!Is([null==Xn?void 0:Xn.doNotTrack,null==Xn?void 0:Xn.msDoNotTrack,rs.doNotTrack],(t=>vr(t)))}}var Vd=us("[Dead Clicks]"),jd=()=>!0,Yd=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property($s)),r=t.instance.config.capture_dead_clicks;return or(r)?r:!!Ki(r)||i};class Gd{get lazyLoadedDeadClicksAutocapture(){return this.Xt}constructor(t,e,i){this.instance=t,this.isEnabled=e,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[$s]:null==t?void 0:t.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.Jt((()=>{this.Kt()}))}Jt(t){var e,i;null!=(e=rs.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(i=rs.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Vd.error("failed to load script",e):t()}))}Kt(){var t;if(Jn){if(!this.Xt&&null!=(t=rs.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Ki(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.Xt=rs.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Xt.start(Jn),Vd.info("starting...")}}else Vd.error("`document` not found. Cannot start.")}stop(){this.Xt&&(this.Xt.stop(),this.Xt=void 0,Vd.info("stopping..."))}}var zd=us("[ExceptionAutocapture]");class Wd{constructor(t){var e,i,r;this.Qt=()=>{var t;if(Yn&&this.isEnabled&&null!=(t=rs.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=rs.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=rs.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=rs.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.te&&this.ft.capture_unhandled_errors&&(this.te=e(this.captureException.bind(this))),!this.ee&&this.ft.capture_unhandled_rejections&&(this.ee=i(this.captureException.bind(this))),!this.ie&&this.ft.capture_console_errors&&(this.ie=r(this.captureException.bind(this)))}catch(t){zd.error("failed to start",t),this.re()}}},this._instance=t,this.ne=!(null==(e=this._instance.persistence)||!e.props[Ls]),this.se=new gr({refillRate:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==i?i:1,bucketSize:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10,refillInterval:1e4,I:zd}),this.ft=this.oe(),this.startIfEnabledOrStop()}oe(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ki(t)?e=i({},e,t):(tr(t)?this.ne:t)&&(e=i({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.ft.capture_console_errors||this.ft.capture_unhandled_errors||this.ft.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(zd.info("enabled"),this.re(),this.Jt(this.Qt)):this.re()}Jt(t){var e,i;null!=(e=rs.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(i=rs.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return zd.error("failed to load script",e);t()}))}re(){var t,e,i;null==(t=this.te)||t.call(this),this.te=void 0,null==(e=this.ee)||e.call(this),this.ee=void 0,null==(i=this.ie)||i.call(this),this.ie=void 0}onRemoteConfig(t){var e=t.autocaptureExceptions;this.ne=!!e||!1,this._instance.persistence&&this._instance.persistence.register({[Ls]:this.ne}),this.ft=this.oe(),this.startIfEnabledOrStop()}onConfigChange(){this.ft=this.oe()}captureException(t){var e,i,r=null!==(e=null==t||null==(i=t.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==e?e:"Exception";this.se.consumeRateLimit(r)?zd.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(t)}}class Ud{constructor(t){var e;this._instance=t,this.ae=(null==Yn||null==(e=Yn.location)?void 0:e.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(ls.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.le&&this.le(),this.le=void 0,ls.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(Yn&&Yn.history){var i=this;null!=(t=Yn.history.pushState)&&t.__posthog_wrapped__||Es(Yn.history,"pushState",(t=>function(e,r,n){t.call(this,e,r,n),i.ue("pushState")})),null!=(e=Yn.history.replaceState)&&e.__posthog_wrapped__||Es(Yn.history,"replaceState",(t=>function(e,r,n){t.call(this,e,r,n),i.ue("replaceState")})),this.he()}}ue(t){try{var e,i=null==Yn||null==(e=Yn.location)?void 0:e.pathname;if(!i)return;i!==this.ae&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.ae=i}catch(e){ls.error("Error capturing "+t+" pageview",e)}}he(){if(!this.le){var t=()=>{this.ue("popstate")};Cs(Yn,"popstate",t),this.le=()=>{Yn&&Yn.removeEventListener("popstate",t)}}}}var Xd=us("[SegmentIntegration]");function Jd(t,e){var i=t.config.segment;if(!i)return e();!function(t,e){var i=t.config.segment;if(!i)return e();var r=i=>{var r=()=>i.anonymousId()||zl();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(Qs,"identified")),e()},n=i.user();"then"in n&&Xi(n.then)?n.then(r):r(n)}(t,(()=>{i.register((t=>{Promise&&Promise.resolve||Xd.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,i)=>{if(!i)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(Xd.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Xd.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var r=t.calculateEventProperties(i,e.event.properties);return e.event.properties=Object.assign({},r,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,"$pageview"),identify:t=>e(t,"$identify"),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}var Kd="posthog-js";function Qd(t,e){var{organization:r,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var l,u,h,c,d;if(!("*"===o||o.includes(e.level))||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=(null==(l=e.exception)?void 0:l.values)||[],p=f.map((t=>i({},t,{stacktrace:t.stacktrace?i({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>i({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(u=f[0])?void 0:u.value)||e.message,$exception_type:null==(h=f[0])?void 0:h.type,$exception_level:e.level,$exception_list:p,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return r&&n&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+e.event_id),a&&t.exceptions.sendExceptionEvent(g),e}}class tv{constructor(t,e,i,r,n,s){this.name=Kd,this.setupOnce=function(o){o(Qd(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}var ev=null!=Yn&&Yn.location?Ts(Yn.location.hash,"__posthog")||Ts(location.hash,"state"):null,iv="_postHogToolbarParams",rv=us("[Toolbar]"),nv=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(nv||{});class sv{constructor(t){this.instance=t}ce(t){rs.ph_toolbar_state=t}de(){var t;return null!==(t=rs.ph_toolbar_state)&&void 0!==t?t:nv.UNINITIALIZED}maybeLoadToolbar(t,e,i){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),!Yn||!Jn)return!1;t=null!=t?t:Yn.location,i=null!=i?i:Yn.history;try{if(!e){try{Yn.localStorage.setItem("test","test"),Yn.localStorage.removeItem("test")}catch(t){return!1}e=null==Yn?void 0:Yn.localStorage}var r,n=ev||Ts(t.hash,"__posthog")||Ts(t.hash,"state"),s=n?gs((()=>JSON.parse(atob(decodeURIComponent(n)))))||gs((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?t.hash=s.desiredHash:i?i.replaceState(i.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(iv)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch(t){return!1}}ve(t){var e=rs.ph_load_toolbar||rs.ph_load_editor;!nr(e)&&Xi(e)?e(t,this.instance):rv.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==Jn||!Jn.getElementById(oo));if(!Yn||e)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=i({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(Yn.localStorage.setItem(iv,JSON.stringify(i({},n,{source:void 0}))),this.de()===nv.LOADED)this.ve(n);else if(this.de()===nv.UNINITIALIZED){var s;this.ce(nv.LOADING),null==(s=rs.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return rv.error("[Toolbar] Failed to load",t),void this.ce(nv.UNINITIALIZED);this.ce(nv.LOADED),this.ve(n)})),Cs(Yn,"turbolinks:load",(()=>{this.ce(nv.UNINITIALIZED),this.loadToolbar(n)}))}return!0}fe(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,i){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(t,e,i)}}var ov=us("[TracingHeaders]");class av{constructor(t){this.pe=void 0,this.ge=void 0,this.Qt=()=>{var t,e;tr(this.pe)&&(null==(t=rs.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));tr(this.ge)&&(null==(e=rs.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}Jt(t){var e,i;null!=(e=rs.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(i=rs.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return ov.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.Jt(this.Qt):(null==(t=this.pe)||t.call(this),null==(e=this.ge)||e.call(this),this.pe=void 0,this.ge=void 0)}}var lv="https?://(.*)",uv=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],hv=fs(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],uv),cv="<masked>",dv=["li_fat_id"];function vv(t,e,i){if(!Jn)return{};var r,n=e?fs([],uv,i||[]):[],s=fv(As(Jn.URL,n,cv),t),o=(r={},ds(dv,(function(t){var e=Fd.qt(t);r[t]=e||null})),r);return vs(o,s)}function fv(t,e){var i=hv.concat(e||[]),r={};return ds(i,(function(e){var i=xs(t,e);r[e]=i||null})),r}function pv(t){var e=function(t){return t?0===t.search(lv+"google.([^/?]*)")?"google":0===t.search(lv+"bing.com")?"bing":0===t.search(lv+"yahoo.com")?"yahoo":0===t.search(lv+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",r={};if(!rr(e)){r.$search_engine=e;var n=Jn?xs(Jn.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function gv(){return navigator.language||navigator.userLanguage}function mv(){return(null==Jn?void 0:Jn.referrer)||"$direct"}function yv(t,e){var i=t?fs([],uv,e||[]):[],r=null==Kn?void 0:Kn.href.substring(0,1e3);return{r:mv().substring(0,1e3),u:r?As(r,i,cv):void 0}}function bv(t){var e,{r:i,u:r}=t,n={$referrer:i,$referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(e=Ss(i))?void 0:e.host};if(r){n.$current_url=r;var s=Ss(r);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=fv(r);vs(n,o)}if(i){var a=pv(i);vs(n,a)}return n}function _v(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function wv(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function Iv(t,e){if(!is)return{};var i,r=t?fs([],uv,e||[]):[],[n,s]=function(t){for(var e=0;e<pn.length;e++){var[i,r]=pn[e],n=i.exec(t),s=n&&(Xi(r)?r(n,t):r);if(s)return s}return["",""]}(is);return vs(ys({$os:n,$os_version:s,$browser:dn(is,navigator.vendor),$device:gn(is),$device_type:mn(is),$timezone:_v(),$timezone_offset:wv()}),{$current_url:As(null==Kn?void 0:Kn.href,r,cv),$host:null==Kn?void 0:Kn.host,$pathname:null==Kn?void 0:Kn.pathname,$raw_user_agent:is.length>1e3?is.substring(0,997)+"...":is,$browser_version:fn(is,navigator.vendor),$browser_language:gv(),$browser_language_prefix:(i=gv(),"string"==typeof i?i.split("-")[0]:void 0),$screen_height:null==Yn?void 0:Yn.screen.height,$screen_width:null==Yn?void 0:Yn.screen.width,$viewport_height:null==Yn?void 0:Yn.innerHeight,$viewport_width:null==Yn?void 0:Yn.innerWidth,$lib:"web",$lib_version:os.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Cv=us("[Web Vitals]"),Sv=9e5;class kv{constructor(t){var e;this.me=!1,this.ht=!1,this.F={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.ye=()=>{clearTimeout(this.be),0!==this.F.metrics.length&&(this._instance.capture("$web_vitals",this.F.metrics.reduce(((t,e)=>i({},t,{["$web_vitals_"+e.name+"_event"]:i({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.F={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._e=t=>{var e,r=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(tr(r))Cv.error("Could not read session ID. Dropping metrics!");else{this.F=this.F||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.we();if(!tr(n))if(nr(null==t?void 0:t.name)||nr(null==t?void 0:t.value))Cv.error("Invalid metric received",t);else if(this.Ie&&t.value>=this.Ie)Cv.error("Ignoring metric with value >= "+this.Ie,t);else this.F.url!==n&&(this.ye(),this.be=setTimeout(this.ye,this.flushToCaptureTimeoutMs)),tr(this.F.url)&&(this.F.url=n),this.F.firstMetricTimestamp=tr(this.F.firstMetricTimestamp)?Date.now():this.F.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.F.metrics.push(i({},t,{$current_url:n,$session_id:r.sessionId,$window_id:r.windowId,timestamp:Date.now()})),this.F.metrics.length===this.allowedMetrics.length&&this.ye()}},this.Qt=()=>{var t,e,i,r,n=rs.__PosthogExtensions__;tr(n)||tr(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:i,onINP:r}=n.postHogWebVitalsCallbacks),t&&e&&i&&r?(this.allowedMetrics.indexOf("LCP")>-1&&t(this._e.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this._e.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this._e.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this._e.bind(this)),this.ht=!0):Cv.error("web vitals callbacks not loaded - not starting")},this._instance=t,this.me=!(null==(e=this._instance.persistence)||!e.props[Zs]),this.startIfEnabled()}get allowedMetrics(){var t,e,i=Ki(this._instance.config.capture_performance)?null==(t=this._instance.config.capture_performance)?void 0:t.web_vitals_allowed_metrics:void 0;return tr(i)?(null==(e=this._instance.persistence)?void 0:e.props[Hs])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(Ki(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Ie(){var t=Ki(this._instance.config.capture_performance)&&sr(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Sv;return 0<t&&t<=6e4?Sv:t}get isEnabled(){var t=null==Kn?void 0:Kn.protocol;if("http:"!==t&&"https:"!==t)return Cv.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Ki(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:or(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return or(e)?e:this.me}startIfEnabled(){this.isEnabled&&!this.ht&&(Cv.info("enabled, starting..."),this.Jt(this.Qt))}onRemoteConfig(t){var e=Ki(t.capturePerformance)&&!!t.capturePerformance.web_vitals,i=Ki(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Zs]:e}),this._instance.persistence.register({[Hs]:i})),this.me=e,this.startIfEnabled()}Jt(t){var e,i;null!=(e=rs.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks&&t(),null==(i=rs.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"web-vitals",(e=>{e?Cv.error("failed to load script",e):t()}))}we(){var t=Yn?Yn.location.href:void 0;if(t){var e=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties,r=e?fs([],uv,i||[]):[];return As(t,r,cv)}Cv.error("Could not determine current URL")}}var xv=us("[Heatmaps]");function Av(t){return Ki(t)&&"clientX"in t&&"clientY"in t&&sr(t.clientX)&&sr(t.clientY)}class Tv{constructor(t){var e;this.me=!1,this.ht=!1,this.Ce=null,this.instance=t,this.me=!(null==(e=this.instance.persistence)||!e.props[Ps]),this.rageclicks=new gd(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return Ki(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return tr(this.instance.config.capture_heatmaps)?tr(this.instance.config.enable_heatmaps)?this.me:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.ht)return;xv.info("starting..."),this.Se(),this.ke()}else{var t;clearInterval(null!==(t=this.Ce)&&void 0!==t?t:void 0),this.xe(),this.getAndClearBuffer()}}onRemoteConfig(t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ps]:e}),this.me=e,this.startIfEnabled()}getAndClearBuffer(){var t=this.F;return this.F=void 0,t}Ae(t){this.kt(t.originalEvent,"deadclick")}ke(){this.Ce&&clearInterval(this.Ce),this.Ce=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(Jn)?setInterval(this.Te.bind(this),this.flushIntervalMilliseconds):null}Se(){Yn&&Jn&&(this.Ee=this.Te.bind(this),Cs(Yn,"beforeunload",this.Ee),this.Me=t=>this.kt(t||(null==Yn?void 0:Yn.event)),Cs(Jn,"click",this.Me,{capture:!0}),this.Ne=t=>this.Re(t||(null==Yn?void 0:Yn.event)),Cs(Jn,"mousemove",this.Ne,{capture:!0}),this.Fe=new Gd(this.instance,jd,this.Ae.bind(this)),this.Fe.startIfEnabled(),this.Oe=this.ke.bind(this),Cs(Jn,"visibilitychange",this.Oe),this.ht=!0)}xe(){var t;Yn&&Jn&&(this.Ee&&Yn.removeEventListener("beforeunload",this.Ee),this.Me&&Jn.removeEventListener("click",this.Me,{capture:!0}),this.Ne&&Jn.removeEventListener("mousemove",this.Ne,{capture:!0}),this.Oe&&Jn.removeEventListener("visibilitychange",this.Oe),clearTimeout(this.Pe),null==(t=this.Fe)||t.stop(),this.ht=!1)}Le(t,e){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,i){for(var r=t;r&&ho(r)&&!co(r,"body");){if(r===i)return!1;if(Hi(e,null==Yn?void 0:Yn.getComputedStyle(r).position))return!0;r=Co(r)}return!1}(_o(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:r),y:t.clientY+(s?0:i),target_fixed:s,type:e}}kt(t,e){var r;if(void 0===e&&(e="click"),!uo(t.target)&&Av(t)){var n=this.Le(t,e);null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.De(i({},n,{type:"rageclick"})),this.De(n)}}Re(t){!uo(t.target)&&Av(t)&&(clearTimeout(this.Pe),this.Pe=setTimeout((()=>{this.De(this.Le(t,"mousemove"))}),500))}De(t){if(Yn){var e=Yn.location.href,i=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,n=i?fs([],uv,r||[]):[],s=As(e,n,cv);this.F=this.F||{},this.F[s]||(this.F[s]=[]),this.F[s].push(t)}}Te(){this.F&&!Qi(this.F)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Ev{constructor(t){this.Be=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength)&&(ls.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Ze=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.$e()}$e(){var t;this.qe=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Be)}destroy(){var t;null==(t=this.qe)||t.call(this),this.qe=void 0}doPageView(t,e){var i,r=this.He(t,e);return this.Ze={pathname:null!==(i=null==Yn?void 0:Yn.location.pathname)&&void 0!==i?i:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.He(t,null==(e=this.Ze)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Ze)?void 0:t.pageViewId}}He(t,e){var i=this.Ze;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.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(!(tr(s)||tr(o)||tr(a)||tr(l)||tr(u)||tr(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?1:pr(o/s,0,1,ls),d=s<=1?1:pr(a/s,0,1,ls),v=l<=1?1:pr(u/l,0,1,ls),f=l<=1?1:pr(h/l,0,1,ls);r=vs(r,{$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 i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}}var Mv=us("[FeatureFlags]"),Nv=us("[FeatureFlags]",{debugEnabled:!0}),Rv="$active_feature_flags",Fv="$override_feature_flags",Ov="$feature_flag_payloads",Pv="$override_feature_flag_payloads",Lv="$feature_flag_request_id",Dv="$feature_flag_evaluated_at",Bv=t=>{var e={};for(var[i,r]of ps(t||{}))r&&(e[i]=r);return e},Zv=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var i;return[t,null!==(i=e[t].variant)&&void 0!==i?i:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var i;return null==(i=e[t].metadata)?void 0:i.payload})).map((t=>{var i;return[t,null==(i=e[t].metadata)?void 0:i.payload]})))):Mv.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},$v=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class qv{constructor(t){this.Ve=!1,this.je=!1,this.Ye=!1,this.Ge=!1,this.ze=!1,this.We=!1,this.Ue=!1,this._instance=t,this.featureFlagEventHandlers=[]}Xe(){var t=this._instance.config.evaluation_environments;return null!=t&&t.length?t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Mv.error("Invalid evaluation environment found:",t,"Expected non-empty string"),e})):[]}Je(){return this.Xe().length>0}flags(){if(this._instance.config.__preview_remote_config)this.We=!0;else{var t=!this.Ke&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.Qe({disableFlags:t})}}get hasLoadedFlags(){return this.je}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(Ws),e=this._instance.get_property(Fv),r=this._instance.get_property(Pv);if(!r&&!e)return t||{};var n=vs({},t||{}),s=[...new Set([...Object.keys(r||{}),...Object.keys(e||{})])];for(var o of s){var a,l,u=n[o],h=null==e?void 0:e[o],c=tr(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,d=tr(h)?u.variant:"string"==typeof h?h:void 0,v=null==r?void 0:r[o],f=i({},u,{enabled:c,variant:c?null!=d?d:null==u?void 0:u.variant:void 0});if(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=i({},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.Ve||(Mv.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:n}),this.Ve=!0),n}getFlagVariants(){var t=this._instance.get_property(Gs),e=this._instance.get_property(Fv);if(!e)return t||{};for(var i=vs({},t),r=Object.keys(e),n=0;n<r.length;n++)i[r[n]]=e[r[n]];return this.Ve||(Mv.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.Ve=!0),i}getFlagPayloads(){var t=this._instance.get_property(Ov),e=this._instance.get_property(Pv);if(!e)return t||{};for(var i=vs({},t||{}),r=Object.keys(e),n=0;n<r.length;n++)i[r[n]]=e[r[n]];return this.Ve||(Mv.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.Ve=!0),i}reloadFeatureFlags(){this.Ge||this._instance.config.advanced_disable_feature_flags||this.Ke||(this.Ke=setTimeout((()=>{this.Qe()}),5))}ti(){clearTimeout(this.Ke),this.Ke=void 0}ensureFlagsLoaded(){this.je||this.Ye||this.Ke||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Ge=t}Qe(t){var e;if(this.ti(),!this._instance._t())if(this.Ye)this.ze=!0;else{var r=this._instance.config.token,n=this._instance.get_property("$device_id"),s={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i({},(null==(e=this._instance.persistence)?void 0:e.get_initial_props())||{},this._instance.get_property(Us)||{}),group_properties:this._instance.get_property(Xs)};rr(n)||tr(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Je()&&(s.evaluation_environments=this.Xe());var o=this._instance.config.__preview_remote_config,a=o?"/flags/?v=2":"/flags/?v=2&config=true",l=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",u=this._instance.requestRouter.endpointFor("flags",a+l);o&&(s.timezone=_v()),this.Ye=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this._instance.config.disable_compression?void 0:Ul.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:t=>{var e,i,r=!0;(200===t.statusCode&&(this.ze||(this.$anon_distinct_id=void 0),r=!1),this.Ye=!1,this.We)||(this.We=!0,this._instance.ei(null!==(i=t.json)&&void 0!==i?i:{}));if(!s.disable_flags||this.ze)if(this.Ue=!r,t.json&&null!=(e=t.json.quotaLimited)&&e.includes($v.FeatureFlags))Mv.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{var n;if(!s.disable_flags)this.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},r);this.ze&&(this.ze=!1,this.Qe())}}})}}getFeatureFlag(t,e){if(void 0===e&&(e={}),this.je||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[t],r=""+i,n=this._instance.get_property(Lv)||void 0,s=this._instance.get_property(Dv)||void 0,o=this._instance.get_property(Ks)||{};if((e.send_event||!("send_event"in e))&&(!(t in o)||!o[t].includes(r))){var a,l,u,h,c,d,v,f,p;Ui(o[t])?o[t].push(r):o[t]=[r],null==(a=this._instance.persistence)||a.register({[Ks]:o});var g=this.getFeatureFlagDetails(t),m={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(t)||null,$feature_flag_request_id:n,$feature_flag_evaluated_at:s,$feature_flag_bootstrapped_response:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlags)?void 0:l[t])||null,$feature_flag_bootstrapped_payload:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlagPayloads)?void 0:u[t])||null,$used_bootstrap_value:!this.Ue};tr(null==g||null==(h=g.metadata)?void 0:h.version)||(m.$feature_flag_version=g.metadata.version);var y,b=null!==(c=null==g||null==(d=g.reason)?void 0:d.description)&&void 0!==c?c:null==g||null==(v=g.reason)?void 0:v.code;if(b&&(m.$feature_flag_reason=b),null!=g&&null!=(f=g.metadata)&&f.id&&(m.$feature_flag_id=g.metadata.id),tr(null==g?void 0:g.original_variant)&&tr(null==g?void 0:g.original_enabled)||(m.$feature_flag_original_response=tr(g.original_variant)?g.original_enabled:g.original_variant),null!=g&&null!=(p=g.metadata)&&p.original_payload)m.$feature_flag_original_payload=null==g||null==(y=g.metadata)?void 0:y.original_payload;this._instance.capture("$feature_flag_called",m)}return i}Mv.warn('getFeatureFlag for key "'+t+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,e){var i=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.Je()&&(r.evaluation_environments=this.Xe()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:r,compression:this._instance.config.disable_compression?void 0:Ul.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var r,n=null==(r=i.json)?void 0:r.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),this.je||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(t,e);return tr(i)?void 0:!!i}Mv.warn('isFeatureEnabled for key "'+t+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e){if(this._instance.persistence){this.je=!0;var r=this.getFlagVariants(),n=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(t,e,r,n,s){void 0===r&&(r={}),void 0===n&&(n={}),void 0===s&&(s={});var o=Zv(t),a=o.flags,l=o.featureFlags,u=o.featureFlagPayloads;if(l){var h=t.requestId,c=t.evaluatedAt;if(Ui(l)){Mv.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(l)for(var v=0;v<l.length;v++)d[l[v]]=!0;e&&e.register({[Rv]:l,[Gs]:d})}else{var f=l,p=u,g=a;t.errorsWhileComputingFlags&&(f=i({},r,f),p=i({},n,p),g=i({},s,g)),e&&e.register(i({[Rv]:Object.keys(Bv(f)),[Gs]:f||{},[Ov]:p||{},[Ws]:g||{}},h?{[Lv]:h}:{},c?{[Dv]:c}:{}))}}}(t,this._instance.persistence,r,n,s),this.ii(e)}}override(t,e){void 0===e&&(e=!1),Mv.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return Mv.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this._instance.persistence.unregister(Fv),this._instance.persistence.unregister(Pv),this.ii(),Nv.info("All overrides cleared");if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;if(this.Ve=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e),"flags"in i)if(!1===i.flags)this._instance.persistence.unregister(Fv),Nv.info("Flag overrides cleared");else if(i.flags){if(Ui(i.flags)){for(var r={},n=0;n<i.flags.length;n++)r[i.flags[n]]=!0;this._instance.persistence.register({[Fv]:r})}else this._instance.persistence.register({[Fv]:i.flags});Nv.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this._instance.persistence.unregister(Pv),Nv.info("Payload overrides cleared")):i.payloads&&(this._instance.persistence.register({[Pv]:i.payloads}),Nv.info("Payload overrides set",{payloads:i.payloads}))),void this.ii()}this.ii()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.je){var{flags:e,flagVariants:i}=this.ri();t(e,i)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,r){var n,s=(this._instance.get_property(zs)||[]).find((e=>e.flagKey===t)),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};s&&(a.$early_access_feature_name=s.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=i({},this.getFlagVariants(),{[t]:e});null==(n=this._instance.persistence)||n.register({[Rv]:Object.keys(Bv(l)),[Gs]:l}),this.ii()}getEarlyAccessFeatures(t,e,i){void 0===e&&(e=!1);var r=this._instance.get_property(zs),n=i?"&"+i.map((t=>"stage="+t)).join("&"):"";if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:e=>{var i,r;if(e.json){var n=e.json.earlyAccessFeatures;return null==(i=this._instance.persistence)||i.unregister(zs),null==(r=this._instance.persistence)||r.register({[zs]:n}),t(n)}}})}ri(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,i)=>(t[i]=e[i],t)),{})}}ii(t){var{flags:e,flagVariants:i}=this.ri();this.featureFlagEventHandlers.forEach((r=>r(e,i,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var r=this._instance.get_property(Us)||{};this._instance.register({[Us]:i({},r,t)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Us)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var r=this._instance.get_property(Xs)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((e=>{r[e]=i({},r[e],t[e]),delete t[e]})),this._instance.register({[Xs]:i({},r,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this._instance.get_property(Xs)||{};this._instance.register({[Xs]:i({},e,{[t]:{}})})}else this._instance.unregister(Xs)}reset(){this.je=!1,this.Ye=!1,this.Ge=!1,this.ze=!1,this.We=!1,this.Ue=!1,this.$anon_distinct_id=void 0,this.ti(),this.Ve=!1}}var Hv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Vv{constructor(t,e){this.ft=t,this.props={},this.ni=!1,this.si=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.zt=this.oi(t),this.load(),t.debug&&ls.info("Persistence loaded",t.persistence,i({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this.ai}oi(t){-1===Hv.indexOf(t.persistence.toLowerCase())&&(ls.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e=function(t){void 0===t&&(t=[]);var e=[...Ld,...t];return i({},Pd,{Ht:function(t){try{var e={};try{e=Fd.Ht(t)||{}}catch(t){}var i=vs(e,JSON.parse(Pd.qt(t)||"{}"));return Pd.Vt(t,i),i}catch(t){}return null},Vt:function(t,i,r,n,s,o){try{Pd.Vt(t,i,void 0,void 0,o);var a={};e.forEach((t=>{i[t]&&(a[t]=i[t])})),Object.keys(a).length&&Fd.Vt(t,a,r,n,s,o)}catch(t){Pd.$t(t)}},jt:function(t,e){try{null==Yn||Yn.localStorage.removeItem(t),Fd.jt(t,e)}catch(t){Pd.$t(t)}}})}(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return"localstorage"===r&&Pd.Zt()?Pd:"localstorage+cookie"===r&&e.Zt()?e:"sessionstorage"===r&&$d.Zt()?$d:"memory"===r?Bd:"cookie"===r?Fd:e.Zt()?e:Fd}properties(){var t={};return ds(this.props,(function(e,i){if(i===Gs&&Ki(e))for(var r=Object.keys(e),n=0;n<r.length;n++)t["$feature/"+r[n]]=e[r[n]];else o=i,a=!1,(rr(s=lo)?a:Un&&s.indexOf===Un?-1!=s.indexOf(o):(ds(s,(function(t){if(a||(a=t===o))return hs})),a))||(t[i]=e);var s,o,a})),t}load(){if(!this.ai){var t=this.zt.Ht(this.si);t&&(this.props=vs({},t))}}save(){this.ai||this.zt.Vt(this.si,this.props,this.li,this.ui,this.hi,this.ft.debug)}remove(){this.zt.jt(this.si,!1),this.zt.jt(this.si,!0)}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Ki(t)){tr(e)&&(e="None"),this.li=tr(i)?this.ci:i;var r=!1;if(ds(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(Ki(t)){this.li=tr(e)?this.ci:e;var i=!1;if(ds(t,((e,r)=>{t.hasOwnProperty(r)&&this.props[r]!==e&&(this.props[r]=e,i=!0)})),i)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.ni){var t=vv(this.ft.custom_campaign_params,this.ft.mask_personal_data_properties,this.ft.custom_personal_data_properties);Qi(ys(t))||this.register(t),this.ni=!0}}update_search_keyword(){var t;this.register((t=null==Jn?void 0:Jn.referrer)?pv(t):{})}update_referrer_info(){var t;this.register_once({$referrer:mv(),$referring_domain:null!=Jn&&Jn.referrer&&(null==(t=Ss(Jn.referrer))?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[io]||this.props[ro]||this.register_once({[no]:yv(this.ft.mask_personal_data_properties,this.ft.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};ds([ro,io],(e=>{var i=this.props[e];i&&ds(i,(function(e,i){t["$initial_"+ji(i)]=e}))}));var e,i,r=this.props[no];if(r){var n=(e=bv(r),i={},ds(e,(function(t,e){i["$initial_"+ji(e)]=t})),i);vs(t,n)}return t}safe_merge(t){return ds(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){if(this.ci=this.li=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!i),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every(((t,e)=>t===r[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[])){var r=this.oi(t),n=this.props;this.clear(),this.zt=r,this.props=n,this.save()}}set_disabled(t){this.ai=t,this.ai?this.remove():this.save()}set_cross_subdomain(t){t!==this.ui&&(this.ui=t,this.remove(),this.save())}set_secure(t){t!==this.hi&&(this.hi=t,this.remove(),this.save())}set_event_timer(t,e){var i=this.props[Fs]||{};i[t]=e,this.props[Fs]=i,this.save()}remove_event_timer(t){var e=(this.props[Fs]||{})[t];return tr(e)||(delete this.props[Fs][t],this.save()),e}get_property(t){return this.props[t]}set_property(t,e){this.props[t]=e,this.save()}}var jv=us("[Product Tours]"),Yv="ph_product_tours";class Gv{constructor(t){this.di=null,this.vi=null,this._instance=t}onRemoteConfig(t){this._instance.persistence&&this._instance.persistence.register({[qs]:!(null==t||!t.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var t,e;this.di||((t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(qs))||this.Jt((()=>this.fi()))}Jt(t){var e,i;null!=(e=rs.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=rs.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",(e=>{e?jv.error("Could not load product tours script",e):t()}))}fi(){var t;!this.di&&null!=(t=rs.__PosthogExtensions__)&&t.generateProductTours&&(this.di=rs.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Ui(this.vi)||e){var i=this._instance.persistence;if(i){var r=i.props[Yv];if(Ui(r)&&!e)return this.vi=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:e=>{var r=e.statusCode;if(200!==r||!e.json){var n="Product Tours API could not be loaded, status: "+r;return jv.error(n),void t([],{isLoaded:!1,error:n})}var s=Ui(e.json.product_tours)?e.json.product_tours:[];this.vi=s,i&&i.register({[Yv]:s}),t(s,{isLoaded:!0})}})}else t(this.vi,{isLoaded:!0})}getActiveProductTours(t){nr(this.di)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.di.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.di)||e.showTourById(t)}previewTour(t){this.di?this.di.previewTour(t):this.Jt((()=>{var e;this.fi(),null==(e=this.di)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.di)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.di)||t.nextStep()}previousStep(){var t;null==(t=this.di)||t.previousStep()}clearCache(){var t;this.vi=null,null==(t=this._instance.persistence)||t.unregister(Yv)}resetTour(t){var e;null==(e=this.di)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.di)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.di)||e.cancelPendingTour(t)}}class zv{constructor(){this.pi={},this.pi={}}on(t,e){return this.pi[t]||(this.pi[t]=[]),this.pi[t].push(e),()=>{this.pi[t]=this.pi[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.pi[t]||[])i(e);for(var r of this.pi["*"]||[])r(t,e)}}function Wv(t,e,i){if(nr(t))return!1;switch(i){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class Uv{constructor(t){this.gi=new zv,this.mi=(t,e)=>this.yi(t,e)&&this.bi(t,e)&&this.wi(t,e)&&this.Ii(t,e),this.yi=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.Ci=new Set,this.Si=new Set}init(){var t;if(!tr(null==(t=this._instance)?void 0:t.ki)){var e;null==(e=this._instance)||e.ki(((t,e)=>{this.on(t,e)}))}}register(t){var e,i;if(!tr(null==(e=this._instance)?void 0:e.ki)&&(t.forEach((t=>{var e,i;null==(e=this.Si)||e.add(t),null==(i=t.steps)||i.forEach((t=>{var e;null==(e=this.Ci)||e.add((null==t?void 0:t.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var r,n=new Set;t.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&n.add(null==t?void 0:t.selector)}))})),null==(r=this._instance)||r.autocapture.setElementSelectors(n)}}on(t,e){var i;null!=e&&0!=t.length&&(this.Ci.has(t)||this.Ci.has(null==e?void 0:e.event))&&this.Si&&(null==(i=this.Si)?void 0:i.size)>0&&this.Si.forEach((t=>{this.xi(e,t)&&this.gi.emit("actionCaptured",t.name)}))}Ai(t){this.onAction("actionCaptured",(e=>t(e)))}xi(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.mi(t,i))return!0;return!1}onAction(t,e){return this.gi.on(t,e)}bi(t,e){if(null!=e&&e.url){var i,r=null==t||null==(i=t.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r)return!1;if(!Wv(r,e.url,e.url_matching||"contains"))return!1}return!0}wi(t,e){return!!this.Ti(t,e)&&(!!this.Ei(t,e)&&!!this.Mi(t,e))}Ti(t,e){var i;if(null==e||!e.href)return!0;var r=this.Ni(t);if(r.length>0)return r.some((t=>Wv(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&Wv((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Ei(t,e){var i;if(null==e||!e.text)return!0;var r=this.Ni(t);if(r.length>0)return r.some((t=>Wv(t.text,e.text,e.text_matching||"exact")||Wv(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!a&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!nr(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>Wv(t,s,o))))}Mi(t,e){var i,r;if(null==e||!e.selector)return!0;var n=null==t||null==(i=t.properties)?void 0:i.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}Ni(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Ii(t,e){return null==e||!e.properties||0===e.properties.length||qu(e.properties.reduce(((t,e)=>{var i=Ui(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:i,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Xv{constructor(t){this._instance=t,this.Ri=new Map,this.Fi=new Map,this.Oi=new Map}Pi(t,e){return!!t&&qu(t.propertyFilters,null==e?void 0:e.properties)}Li(t,e){var i=new Map;return t.forEach((t=>{var r;null==(r=t.conditions)||null==(r=r[e])||null==(r=r.values)||r.forEach((e=>{if(null!=e&&e.name){var r=i.get(e.name)||[];r.push(t.id),i.set(e.name,r)}}))})),i}Di(t,e,i){var r=(i===yl.Activation?this.Ri:this.Fi).get(t),n=[];return this.Bi((t=>{n=t.filter((t=>null==r?void 0:r.includes(t.id)))})),n.filter((r=>{var n,s=null==(n=r.conditions)||null==(n=n[i])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.Pi(s,e)}))}register(t){var e;tr(null==(e=this._instance)?void 0:e.ki)||(this.Zi(t),this.$i(t))}$i(t){var e=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0}));if(0!==e.length){if(null==this.qi){this.qi=new Uv(this._instance),this.qi.init();this.qi.Ai((t=>{this.onAction(t)}))}e.forEach((t=>{var e,i,r,n,s;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(i=t.conditions)&&null!=(i=i.actions)&&i.values&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(n=this.qi)||n.register(t.conditions.actions.values),null==(s=t.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((e=>{if(e&&e.name){var i=this.Oi.get(e.name);i&&i.push(t.id),this.Oi.set(e.name,i||[t.id])}})))}))}}Zi(t){var e,i=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.events)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0})),r=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(i=t.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0}));if(0!==i.length||0!==r.length){null==(e=this._instance)||e.ki(((t,e)=>{this.onEvent(t,e)})),this.Ri=this.Li(t,yl.Activation),this.Fi=this.Li(t,yl.Cancellation)}}onEvent(t,e){var i,r=this.Hi(),n=this.Vi(),s=this.ji(),o=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[n])||[];if(s===t&&e&&o.length>0){var a,l;r.info("event matched, removing item from activated items",{event:t,eventPayload:e,existingActivatedItems:o});var u=(null==e||null==(a=e.properties)?void 0:a.$survey_id)||(null==e||null==(l=e.properties)?void 0:l.$product_tour_id);if(u){var h=o.indexOf(u);h>=0&&(o.splice(h,1),this.Yi(o))}}else{if(this.Fi.has(t)){var c=this.Di(t,e,yl.Cancellation);c.length>0&&(r.info("cancel event matched, cancelling items",{event:t,itemsToCancel:c.map((t=>t.id))}),c.forEach((t=>{var e=o.indexOf(t.id);e>=0&&o.splice(e,1),this.Gi(t.id)})),this.Yi(o))}if(this.Ri.has(t)){r.info("event name matched",{event:t,eventPayload:e,items:this.Ri.get(t)});var d=this.Di(t,e,yl.Activation);this.Yi(o.concat(d.map((t=>t.id))||[]))}}}onAction(t){var e,i=this.Vi(),r=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[i])||[];this.Oi.has(t)&&this.Yi(r.concat(this.Oi.get(t)||[]))}Yi(t){var e,i=this.Hi(),r=this.Vi(),n=[...new Set(t)].filter((t=>!this.zi(t)));i.info("updating activated items",{activatedItems:n}),null==(e=this._instance)||null==(e=e.persistence)||e.register({[r]:n})}getActivatedIds(){var t,e=this.Vi(),i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i||[]}getEventToItemsMap(){return this.Ri}Wi(){return this.qi}}class Jv extends Xv{constructor(t){super(t)}Vi(){return"$surveys_activated"}ji(){return xl.SHOWN}Bi(t){var e;null==(e=this._instance)||e.getSurveys(t)}Gi(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Hi(){return El}zi(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Kv{constructor(t){this.Ui=void 0,this._surveyManager=null,this.Xi=!1,this.Ji=[],this.Ki=null,this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var e=t.surveys;if(nr(e))return El.warn("Flags not loaded yet. Not loading surveys.");var i=Ui(e);this.Ui=i?e.length>0:e,El.info("flags response received, isSurveysEnabled: "+this.Ui),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var i=localStorage.key(e);(null!=i&&i.startsWith(Fl)||null!=i&&i.startsWith(Ol))&&t.push(i)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.Xi)El.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)El.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())El.info("Not loading surveys in cookieless mode without consent.");else{var t=null==rs?void 0:rs.__PosthogExtensions__;if(t){if(!tr(this.Ui)||this._instance.config.advanced_enable_surveys){var e=this.Ui||this._instance.config.advanced_enable_surveys;this.Xi=!0;try{var i=t.generateSurveys;if(i)return void this.Qi(i,e);var r=t.loadExternalDependency;if(!r)return void this.tr("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(i=>{i||!t.generateSurveys?this.tr("Could not load surveys script",i):this.Qi(t.generateSurveys,e)}))}catch(t){throw this.tr("Error initializing surveys",t),t}finally{this.Xi=!1}}}else El.error("PostHog Extensions not found.")}}Qi(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Jv(this._instance),El.info("Surveys loaded successfully"),this.er({isLoaded:!0})}tr(t,e){El.error(t,e),this.er({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ji.push(t),this._surveyManager&&this.er({isLoaded:!0}),()=>{this.Ji=this.Ji.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this._instance.config.disable_surveys)return El.info("Disabled. Not loading surveys."),t([]);var i,r=this._instance.get_property(Js);if(r&&!e)return t(r,{isLoaded:!0});"undefined"!=typeof Promise&&this.Ki?this.Ki.then((e=>{var{surveys:i,context:r}=e;return t(i,r)})):("undefined"!=typeof Promise&&(this.Ki=new Promise((t=>{i=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:e=>{var r;this.Ki=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;El.error(s);var o={isLoaded:!1,error:s};return t([],o),void(null==i||i({surveys:[],context:o}))}var a,l=e.json.surveys||[],u=l.filter((t=>Ml(t)&&(Nl(t)||Rl(t))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u));null==(r=this._instance.persistence)||r.register({[Js]:l});var h={isLoaded:!0};t(l,h),null==i||i({surveys:l,context:h})}}))}er(t){for(var e of this.Ji)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){El.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!nr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);El.warn("init was not called")}ir(t){var e=null;return this.getSurveys((i=>{var r;e=null!==(r=i.find((e=>e.id===t)))&&void 0!==r?r:null})),e}rr(t){if(nr(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var e="string"==typeof t?this.ir(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(nr(this._surveyManager))return El.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var e=this.rr(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return nr(this._surveyManager)?(El.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((i=>{this.getSurveys((e=>{var r,n=null!==(r=e.find((e=>e.id===t)))&&void 0!==r?r:null;if(n){var s=this.rr(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e){var i;if(nr(this._surveyManager))El.warn("init was not called");else{var r="string"==typeof t?this.ir(t):t;if(null!=r&&r.id)if(Zl.includes(r.type)){var n=null==Jn?void 0:Jn.querySelector(e);if(n)return null!=(i=r.appearance)&&i.surveyPopupDelaySeconds?(El.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;El.info("Rendering survey "+r.id+" with delay of "+(null==(t=r.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(r,n),El.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,n);El.warn("Survey element not found")}else El.warn("Surveys of type "+r.type+" cannot be rendered in the app");else El.warn("Survey not found")}}displaySurvey(t,e){var r;if(nr(this._surveyManager))El.warn("init was not called");else{var n=this.ir(t);if(n){var s=n;if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=i({},n,{appearance:i({},n.appearance,{surveyPopupDelaySeconds:0})})),!1===e.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void El.warn("Survey is not eligible to be displayed: ",o.disabledReason)}e.displayType!==Tl.Inline?this._surveyManager.handlePopoverSurvey(s):this.renderSurvey(s,e.selector)}else El.warn("Survey not found")}}cancelPendingSurvey(t){nr(this._surveyManager)?El.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}var Qv=us("[Conversations]");class tf{constructor(t){this.nr=void 0,this._conversationsManager=null,this.sr=!1,this.ar=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;nr(e)||(or(e)?this.nr=e:(this.nr=e.enabled,this.ar=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.nr=void 0,this.ar=null}loadIfEnabled(){if(!this._conversationsManager&&!this.sr&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==rs?void 0:rs.__PosthogExtensions__;if(t&&!tr(this.nr)&&this.nr)if(this.ar&&this.ar.token){this.sr=!0;try{var e=t.initConversations;if(e)return this.lr(e),void(this.sr=!1);var i=t.loadExternalDependency;if(!i)return void this.ur("PostHog loadExternalDependency extension not found.");i(this._instance,"conversations",(e=>{e||!t.initConversations?this.ur("Could not load conversations script",e):this.lr(t.initConversations),this.sr=!1}))}catch(t){this.ur("Error initializing conversations",t),this.sr=!1}}else Qv.error("Conversations enabled but missing token in remote config.")}}lr(t){if(this.ar)try{this._conversationsManager=t(this.ar,this._instance),Qv.info("Conversations loaded successfully")}catch(t){this.ur("Error completing conversations initialization",t)}else Qv.error("Cannot complete initialization: remote config is null")}ur(t,e){Qv.error(t,e),this._conversationsManager=null,this.sr=!1}enable(){this._conversationsManager?this._conversationsManager.enable():Qv.warn("Conversations not loaded yet.")}disable(){this._conversationsManager&&this._conversationsManager.disable()}isLoaded(){return!rr(this._conversationsManager)}isEnabled(){return!0===this.nr}isWidgetEnabled(){var t;return!0===(null==(t=this.ar)?void 0:t.widgetEnabled)}isWidgetVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isWidgetVisible())&&void 0!==t&&t}}var ef=us("[RateLimiter]");class rf{constructor(t){var e,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{ef.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void ef.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.captureEventsPerSecond=(null==(e=t.config.rate_limiting)?void 0:e.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(i=t.config.rate_limiting)?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(t){var e,i,r;void 0===t&&(t=!1);var n=(new Date).getTime(),s=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(eo))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:n};s.tokens+=(n-s.last)/1e3*this.captureEventsPerSecond,s.last=n,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);var o=s.tokens<1;return o||t||(s.tokens=Math.max(0,s.tokens-1)),!o||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null==(r=this.instance.persistence)||r.set_property(eo,s),{isRateLimited:o,remainingTokens:s.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var nf=us("[RemoteConfig]");class sf{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=rs._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}hr(t){var e,i;null!=(e=rs.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=rs.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(nf.error("PostHog Extensions not found. Cannot load remote config."),t())}cr(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e=>{t(e.json)}})}load(){try{if(this.remoteConfig)return nf.info("Using preloaded remote config",this.remoteConfig),void this.ei(this.remoteConfig);if(this._instance._t())return void nf.warn("Remote config is disabled. Falling back to local config.");this.hr((t=>{if(!t)return nf.info("No config found after loading remote JS config. Falling back to JSON."),void this.cr((t=>{this.ei(t)}));this.ei(t)}))}catch(t){nf.error("Error loading remote config",t)}}ei(t){t?this._instance.config.__preview_remote_config?(this._instance.ei(t),!1!==t.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):nf.info("__preview_remote_config is disabled. Logging config instead",t):nf.error("Failed to fetch remote config from PostHog.")}}var of=3e3;class af{constructor(t,e){this.dr=!0,this.vr=[],this.pr=pr((null==e?void 0:e.flush_interval_ms)||of,250,5e3,ls.createLogger("flush interval"),of),this.gr=t}enqueue(t){this.vr.push(t),this.mr||this.yr()}unload(){this.br();var t=this.vr.length>0?this._r():{},e=Object.values(t),r=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];r.map((t=>{this.gr(i({},t,{transport:"sendBeacon"}))}))}enable(){this.dr=!1,this.yr()}yr(){var t=this;this.dr||(this.mr=setTimeout((()=>{if(this.br(),this.vr.length>0){var e=this._r(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&Ui(i.data)&&ds(i.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.gr(i)};for(var r in e)i()}}),this.pr))}br(){clearTimeout(this.mr),this.mr=void 0}_r(){var t={};return ds(this.vr,(e=>{var r,n=e,s=(n?n.batchKey:null)||n.url;tr(t[s])&&(t[s]=i({},n,{data:[]})),null==(r=t[s].data)||r.push(n.data)})),this.vr=[],t}}var lf=["retriesPerformedSoFar"];class uf{constructor(t){this.wr=!1,this.Ir=3e3,this.vr=[],this._instance=t,this.vr=[],this.Cr=!0,!tr(Yn)&&"onLine"in Yn.navigator&&(this.Cr=Yn.navigator.onLine,this.Sr=()=>{this.Cr=!0,this.Te()},this.kr=()=>{this.Cr=!1},Cs(Yn,"online",this.Sr),Cs(Yn,"offline",this.kr))}get length(){return this.vr.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=r(t,lf);sr(e)&&e>0&&(n.url=Fu(n.url,{retry_count:e})),this._instance._send_request(i({},n,{callback:t=>{200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&(null!=e?e:0)<10?this.Ar(i({retriesPerformedSoFar:e},n)):null==n.callback||n.callback(t)}}))}Ar(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var i=function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),n=(Math.random()-.5)*(r-i);return Math.ceil(r+n)}(e),r=Date.now()+i;this.vr.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),ls.warn(n),this.wr||(this.wr=!0,this.Tr())}Tr(){if(this.Er&&clearTimeout(this.Er),0===this.vr.length)return this.wr=!1,void(this.Er=void 0);this.Er=setTimeout((()=>{this.Cr&&this.vr.length>0&&this.Te(),this.Tr()}),this.Ir)}Te(){var t=Date.now(),e=[],i=this.vr.filter((i=>i.retryAt<t||(e.push(i),!1)));if(this.vr=e,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:t}of(this.Er&&(clearTimeout(this.Er),this.Er=void 0),this.wr=!1,tr(Yn)||(this.Sr&&(Yn.removeEventListener("online",this.Sr),this.Sr=void 0),this.kr&&(Yn.removeEventListener("offline",this.kr),this.kr=void 0)),this.vr))try{this._instance._send_request(i({},t,{transport:"sendBeacon"}))}catch(t){ls.error(t)}this.vr=[]}}class hf{constructor(t){this.Mr=()=>{var t,e,i,r;this.Nr||(this.Nr={});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.Nr.lastScrollY=Math.ceil(s),this.Nr.maxScrollY=Math.max(s,null!==(t=this.Nr.maxScrollY)&&void 0!==t?t:0),this.Nr.maxScrollHeight=Math.max(o,null!==(e=this.Nr.maxScrollHeight)&&void 0!==e?e:0),this.Nr.lastContentY=a,this.Nr.maxContentY=Math.max(a,null!==(i=this.Nr.maxContentY)&&void 0!==i?i:0),this.Nr.maxContentHeight=Math.max(l,null!==(r=this.Nr.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}getContext(){return this.Nr}resetContext(){var t=this.Nr;return setTimeout(this.Mr,0),t}startMeasuringScrollPosition(){Cs(Yn,"scroll",this.Mr,{capture:!0}),Cs(Yn,"scrollend",this.Mr,{capture:!0}),Cs(Yn,"resize",this.Mr)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==Yn?void 0:Yn.document.documentElement;var t=Ui(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var e of t){var i=null==Yn?void 0:Yn.document.querySelector(e);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Yn&&(Yn.scrollY||Yn.pageYOffset||Yn.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Yn&&(Yn.scrollX||Yn.pageXOffset||Yn.document.documentElement.scrollLeft)||0}}var cf=t=>yv(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class df{constructor(t,e,i,r){this.Rr=t=>{var e=this.Fr();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Or(this._instance)};this.Pr.register({[to]:i})}},this._instance=t,this.Lr=e,this.Pr=i,this.Or=r||cf,this.Lr.onSessionId(this.Rr)}Fr(){return this.Pr.props[to]}getSetOnceProps(){var t,e=null==(t=this.Fr())?void 0:t.props;return e?"r"in e?bv(e):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return ds(ys(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+ji(i)]=e})),t}}var vf=us("[SessionId]");class ff{on(t,e){return this.Dr.on(t,e)}constructor(t,e,i){var r;if(this.Br=[],this.Zr=void 0,this.Dr=new zv,this.$r=(t,e)=>Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.ft=t.config,this.Pr=t.persistence,this.qr=void 0,this.Hr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Vr=e||zl,this.jr=i||zl;var n=this.ft.persistence_name||this.ft.token,s=this.ft.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*pr(s,60,36e3,vf.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Yr(),this.Gr="ph_"+n+"_window_id",this.zr="ph_"+n+"_primary_window_exists",this.Wr()){var o=$d.Ht(this.Gr),a=$d.Ht(this.zr);o&&!a?this.qr=o:$d.jt(this.Gr),$d.Vt(this.zr,!0)}if(null!=(r=this.ft.bootstrap)&&r.sessionID)try{var l=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(this.ft.bootstrap.sessionID);this.Ur(this.ft.bootstrap.sessionID,(new Date).getTime(),l)}catch(t){vf.error("Invalid sessionID in bootstrap",t)}this.Xr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return tr(this.Br)&&(this.Br=[]),this.Br.push(t),this.Hr&&t(this.Hr,this.qr),()=>{this.Br=this.Br.filter((e=>e!==t))}}Wr(){return"memory"!==this.ft.persistence&&!this.Pr.ai&&$d.Zt()}Jr(t){t!==this.qr&&(this.qr=t,this.Wr()&&$d.Vt(this.Gr,t))}Kr(){return this.qr?this.qr:this.Wr()?$d.Ht(this.Gr):null}Ur(t,e,i){t===this.Hr&&e===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Hr=t,this.Pr.register({[js]:[e,t,i]}))}Qr(){var t=this.Pr.props[js];return Ui(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Ur(null,null,null)}destroy(){clearTimeout(this.tn),this.tn=void 0,this.Zr&&Yn&&(Yn.removeEventListener("beforeunload",this.Zr,{capture:!1}),this.Zr=void 0),this.Br=[]}Xr(){this.Zr=()=>{this.Wr()&&$d.jt(this.zr)},Cs(Yn,"beforeunload",this.Zr,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),"always"===this.ft.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=e||(new Date).getTime(),[r,n,s]=this.Qr(),o=this.Kr(),a=sr(s)&&s>0&&Math.abs(i-s)>864e5,l=!1,u=!n,h=!u&&!t&&this.$r(i,r);u||h||a?(n=this.Vr(),o=this.jr(),vf.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}}),s=i,l=!0):o||(o=this.jr(),l=!0);var c=0===r||!t||a?i:r,d=0===s?(new Date).getTime():s;return this.Jr(o),this.Ur(n,c,d),t||this.Yr(),l&&this.Br.forEach((t=>t(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:r}}Yr(){clearTimeout(this.tn),this.tn=setTimeout((()=>{var[t]=this.Qr();if(this.$r((new Date).getTime(),t)){var e=this.Hr;this.resetSessionId(),this.Dr.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var pf=["$set_once","$set"],gf=us("[SiteApps]");class mf{constructor(t){this._instance=t,this.en=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}rn(t,e){if(e){var i=this.globalsForEvent(e);this.en.push(i),this.en.length>1e3&&(this.en=this.en.slice(10))}}get siteAppLoaders(){var t;return null==(t=rs._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance.ki(this.rn.bind(this));this.nn=()=>{t(),this.en=[],this.nn=void 0}}}globalsForEvent(t){var e,n,s,o,a,l,u;if(!t)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}=t;return{event:i({},r(t,pf),{properties:i({},t.properties,g?{$set:i({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:i({},null!==(s=null==(o=t.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(l=t.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=t.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}setupSiteApp(t){var e=this.apps[t.id],i=()=>{var i;(!e.errored&&this.en.length&&(gf.info("Processing "+this.en.length+" events for site app with id "+t.id),this.en.forEach((t=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored)))&&(null==(i=this.nn)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,gf.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var{processEvent:s}=t.init({posthog:this._instance,callback:t=>{n(t)}});s&&(e.processEvent=s),r=!0}catch(e){gf.error("Error while initializing PostHog app with config id "+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){gf.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}sn(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of t)this.setupSiteApp(i)}an(t){if(0!==Object.keys(this.apps).length){var e=this.globalsForEvent(t);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(e)}catch(e){gf.error("Error while processing event "+t.event+" for site app "+i.id,e)}}}onRemoteConfig(t){var e,i,r,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.sn(),void this._instance.on("eventCaptured",(t=>this.an(t)))):void gf.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.nn)||i.call(this),null!=(r=t.siteApps)&&r.length)if(this.isEnabled){var s=function(t){var e;rs["__$$ph_site_app_"+t]=n._instance,null==(e=rs.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return gf.error("Error while initializing PostHog app with config id "+t,e)}))};for(var{id:o,url:a}of t.siteApps)s(o)}else gf.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var yf=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&$i(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>$i(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},bf=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),_f="i.posthog.com";class wf{constructor(t){this.ln={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+_f,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.ln[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.ln[this.apiHost]=bf.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.ln[this.apiHost]=bf.EU:this.ln[this.apiHost]=bf.CUSTOM),this.ln[this.apiHost]}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if(this.region===bf.CUSTOM)return this.apiHost+e;var i=_f+e;switch(t){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var If={icontains:(t,e)=>!!Yn&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!Yn&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!Yn&&Du(e.href,t),not_regex:(t,e)=>!!Yn&&!Du(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class Cf{constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Cf.un("retrieved web experiments from the server"),e.hn=new Map,t.forEach((t=>{if(t.feature_flag_key){var i;if(e.hn)Cf.un("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e.hn)||i.set(t.feature_flag_key,t);var r=e._instance.getFeatureFlag(t.feature_flag_key);er(r)&&t.variants[r]&&e.cn(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];Cf.dn(s)&&e.cn(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}onFeatureFlags(t){if(this._is_bot())Cf.un("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(nr(this.hn))return this.hn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Cf.un("applying feature flags",t),t.forEach((t=>{var e;if(this.hn&&null!=(e=this.hn)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.hn)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.cn(n.name,r,n.variants[r].transforms)}}))}}previewWebExperiment(){var t=Cf.getWindowLocation();if(null!=t&&t.search){var e=xs(null==t?void 0:t.search,"__experiment_id"),i=xs(null==t?void 0:t.search,"__experiment_variant");e&&i&&(Cf.un("previewing web experiments "+e+" && "+i),this.getWebExperiments((t=>{this.vn(parseInt(e),i,t)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this._instance.config.disable_web_experiments&&!i)return t([]);var r=this._instance.get_property("$web_experiments");if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:e=>{if(200!==e.statusCode||!e.json)return t([]);var i=e.json.experiments||[];return t(i)}})}vn(t,e,i){var r=i.filter((e=>e.id===t));r&&r.length>0&&(Cf.un("Previewing web experiment ["+r[0].name+"] with variant ["+e+"]"),this.cn(r[0].name,e,r[0].variants[e].transforms))}static dn(t){return!nr(t.conditions)&&(Cf.fn(t)&&Cf.pn(t))}static fn(t){var e;if(nr(t.conditions)||nr(null==(e=t.conditions)?void 0:e.url))return!0;var i,r,n,s=Cf.getWindowLocation();return!!s&&(null==(i=t.conditions)||!i.url||If[null!==(r=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==r?r:"icontains"](t.conditions.url,s))}static getWindowLocation(){return null==Yn?void 0:Yn.location}static pn(t){var e;if(nr(t.conditions)||nr(null==(e=t.conditions)?void 0:e.utm))return!0;var i=vv();if(i.utm_source){var r,n,s,o,a,l,u,h,c=null==(r=t.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==i.utm_campaign,d=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==i.utm_term;return c&&v&&f&&d}return!1}static un(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];ls.info("[WebExperiments] "+t,i)}cn(t,e,i){this._is_bot()?Cf.un("Refusing to render web experiment since the viewer is a likely bot"):"control"!==e?i.forEach((i=>{if(i.selector){var r;Cf.un("applying transform of variant "+e+" for experiment "+t+" ",i);var n=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==n||n.forEach((t=>{var e=t;i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)}))}})):Cf.un("Control variants leave the page unmodified.")}_is_bot(){return Xn&&this._instance?yf(Xn,this._instance.config.custom_blocked_useragents):void 0}}var Sf=us("[PostHog ExternalIntegrations]"),kf={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class xf{constructor(t){this._instance=t}Jt(t,e){var i;null==(i=rs.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return Sf.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var i,n,s;(!r||null!=(i=rs.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.Jt(kf[e],(()=>{var i;null==(i=rs.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)})),!r&&null!=(n=rs.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e])&&(null==(s=rs.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[e])||s.stop())};for(var[i,r]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(i)}}}var Af="[SessionRecording]",Tf=us(Af);class Ef{get started(){var t;return!(null==(t=this.gn)||!t.isStarted)}get status(){return this.gn?this.gn.status:this.mn&&!this.yn?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.mn=!1,this.bn=void 0,this._instance=t,!this._instance.sessionManager)throw Tf.error("started without valid sessionManager"),new Error(Af+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Af+' cannot be used with cookieless_mode="always"')}get yn(){var t,e=!(null==(t=this._instance.get_property(Vs))||!t.enabled),i=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Yn&&e&&i&&!r}startIfEnabledOrStop(t){var e;if(!this.yn||null==(e=this.gn)||!e.isStarted){var i=!tr(Object.assign)&&!tr(Array.from);this.yn&&i?(this._n(t),Tf.info("starting")):this.stopRecording()}}_n(t){var e,i,r;this.yn&&(null!=rs&&null!=(e=rs.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=rs.__PosthogExtensions__)&&i.initSessionRecording?this.wn(t):null==(r=rs.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.In,(e=>{if(e)return Tf.error("could not load recorder",e);this.wn(t)})))}stopRecording(){var t,e;null==(t=this.bn)||t.call(this),this.bn=void 0,null==(e=this.gn)||e.stop()}Cn(){var t;null==(t=this._instance.persistence)||t.unregister(Ys)}Sn(t){if(this._instance.persistence){var e,r,n=this._instance.persistence,s=()=>{var e=!1===t.sessionRecording?void 0:t.sessionRecording,r=null==e?void 0:e.sampleRate,s=nr(r)?null:parseFloat(r);nr(s)&&this.Cn();var o=null==e?void 0:e.minimumDurationMilliseconds;n.register({[Vs]:i({enabled:!!e},e,{networkPayloadCapture:i({capturePerformance:t.capturePerformance},null==e?void 0:e.networkPayloadCapture),canvasRecording:{enabled:null==e?void 0:e.recordCanvas,fps:null==e?void 0:e.canvasFps,quality:null==e?void 0:e.canvasQuality},sampleRate:s,minimumDurationMilliseconds:tr(o)?null:o,endpoint:null==e?void 0:e.endpoint,triggerMatchType:null==e?void 0:e.triggerMatchType,masking:null==e?void 0:e.masking,urlTriggers:null==e?void 0:e.urlTriggers})})};s(),null==(e=this.bn)||e.call(this),this.bn=null==(r=this._instance.sessionManager)?void 0:r.onSessionId(s)}}onRemoteConfig(t){"sessionRecording"in t?!1!==t.sessionRecording?(this.Sn(t),this.mn=!0,this.startIfEnabledOrStop()):this.mn=!0:Tf.info("skipping remote config with no sessionRecording",t)}log(t,e){var i;void 0===e&&(e="log"),null!=(i=this.gn)&&i.log?this.gn.log(t,e):Tf.warn("log called before recorder was ready")}get In(){var t,e,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Vs);return(null==i||null==(e=i.scriptConfig)?void 0:e.script)||"lazy-recorder"}wn(t){var e,i;if(null==(e=rs.__PosthogExtensions__)||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.gn||(this.gn=null==(i=rs.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.gn._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.gn.start(t)}onRRwebEmit(t){var e;null==(e=this.gn)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.gn||(null==(e=this._instance.persistence)||e.register({$replay_override_linked_flag:!0}));null==(t=this.gn)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.gn||(null==(e=this._instance.persistence)||e.register({$replay_override_sampling:!0}));null==(t=this.gn)||t.overrideSampling()}overrideTrigger(t){var e,i;this.gn||(null==(i=this._instance.persistence)||i.register({["url"===t?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(e=this.gn)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.gn)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.gn)||!i.tryAddCustomEvent(t,e))}}var Mf={},Nf=()=>{},Rf="posthog",Ff=!Nu&&-1===(null==is?void 0:is.indexOf("MSIE"))&&-1===(null==is?void 0:is.indexOf("Mozilla")),Of=t=>{var e;return i({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:ws(null==Jn?void 0:Jn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Nf,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,debug:Kn&&er(null==Kn?void 0:Kn.search)&&-1!==Kn.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:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Yn||null==(e=Yn.location)?void 0:e.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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var e="Bad HTTP status: "+t.statusCode+" "+t.text;ls.error(e)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:of},error_tracking:{},_onCapture:Nf,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},Pf=t=>{var e={};tr(t.process_person)||(e.person_profiles=t.process_person),tr(t.xhr_headers)||(e.request_headers=t.xhr_headers),tr(t.cookie_name)||(e.persistence_name=t.cookie_name),tr(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),tr(t.store_google)||(e.save_campaign_params=t.store_google),tr(t.verbose)||(e.debug=t.verbose);var i=vs({},e,t);return Ui(t.property_blacklist)&&(tr(t.property_denylist)?i.property_denylist=t.property_blacklist:Ui(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:ls.error("Invalid value for property_denylist config: "+t.property_denylist)),i};class Lf{constructor(){this.__forceAllowLocalhost=!1}get kn(){return this.__forceAllowLocalhost}set kn(t){ls.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Df{get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){this.webPerformance=new Lf,this.xn=!1,this.version=os.LIB_VERSION,this.An=new zv,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Of(),this.SentryIntegration=tv,this.sentryIntegration=t=>function(t,e){var i=Qd(t,e);return{name:Kd,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Tn=!1,this.En=null,this.Mn=null,this.Nn=null,this.featureFlags=new qv(this),this.toolbar=new sv(this),this.scrollManager=new hf(this),this.pageViewManager=new Ev(this),this.surveys=new Kv(this),this.conversations=new tf(this),this.experiments=new Cf(this),this.exceptions=new cc(this),this.rateLimiter=new rf(this),this.requestRouter=new wf(this),this.consent=new Hd(this),this.externalIntegrations=new xf(this),this.people={set:(t,e,i)=>{var r=er(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=er(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>ls.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==Rf){var r,n=null!==(r=Mf[i])&&void 0!==r?r:new Df;return n._init(t,e,i),Mf[i]=n,Mf[Rf][i]=n,n}return this._init(t,e,i)}_init(t,e,r){var n;if(void 0===e&&(e={}),tr(t)||ir(t))return ls.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={},e.debug=this.Rn(e.debug),this.Fn=e,this.On=[],e.person_profiles&&(this.Mn=e.person_profiles),this.set_config(vs({},Of(e.defaults),Pf(e),{name:r,token:t})),this.config.on_xhr_error&&ls.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Ul.GZipJS;var s=this.Pn();this.persistence=new Vv(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Vv(i({},this.config,{persistence:"sessionStorage"}),s);var o=i({},this.persistence.props),a=i({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Ln=new af((t=>this.Dn(t)),this.config.request_queue_config),this.Bn=new uf(this),this.__request_queue=[];var l="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new ff(this),this.sessionPropsManager=new df(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ls.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Zn(l)}),0)):(ls.info("Initializing extensions synchronously"),this.Zn(l)),os.DEBUG=os.DEBUG||this.config.debug,os.DEBUG&&ls.info("Starting in debug mode",{this:this,config:e,thisC:i({},this.config),p:o,s:a}),void 0!==(null==(n=e.bootstrap)?void 0:n.distinctID)){var u,h,c=this.config.get_device_id(zl()),d=null!=(u=e.bootstrap)&&u.isIdentifiedID?c:e.bootstrap.distinctID;this.persistence.set_property(Qs,null!=(h=e.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:e.bootstrap.distinctID,$device_id:d})}if(this.$n()){var v,f,p=Object.keys((null==(v=e.bootstrap)?void 0:v.featureFlags)||{}).filter((t=>{var i;return!(null==(i=e.bootstrap)||null==(i=i.featureFlags)||!i[t])})).reduce(((t,i)=>{var r;return t[i]=(null==(r=e.bootstrap)||null==(r=r.featureFlags)?void 0:r[i])||!1,t}),{}),g=Object.keys((null==(f=e.bootstrap)?void 0:f.featureFlagPayloads)||{}).filter((t=>p[t])).reduce(((t,i)=>{var r,n;null!=(r=e.bootstrap)&&null!=(r=r.featureFlagPayloads)&&r[i]&&(t[i]=null==(n=e.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[i]);return t}),{});this.featureFlags.receivedFeatureFlags({featureFlags:p,featureFlagPayloads:g})}if(l)this.register_once({distinct_id:ao,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(zl());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(Qs,"anonymous")}return Cs(Yn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),e.segment?Jd(this,(()=>this.qn())):this.qn(),Xi(this.config._onCapture)&&this.config._onCapture!==Nf&&(ls.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&ls.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}Zn(t){var e=performance.now();this.historyAutocapture=new Ud(this),this.historyAutocapture.startIfEnabled();var i=[];i.push((()=>{new av(this).startIfEnabledOrStop()})),i.push((()=>{var t;this.siteApps=new mf(this),null==(t=this.siteApps)||t.init()})),t||i.push((()=>{this.sessionRecording=new Ef(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),i.push((()=>{this.autocapture=new Cd(this),this.autocapture.startIfEnabled()})),i.push((()=>{this.surveys.loadIfEnabled()})),i.push((()=>{this.conversations.loadIfEnabled()})),i.push((()=>{this.productTours=new Gv(this),this.productTours.loadIfEnabled()})),i.push((()=>{this.heatmaps=new Tv(this),this.heatmaps.startIfEnabled()})),i.push((()=>{this.webVitalsAutocapture=new kv(this)})),i.push((()=>{this.exceptionObserver=new Wd(this),this.exceptionObserver.startIfEnabledOrStop()})),i.push((()=>{this.deadClicksAutocapture=new Gd(this,Yd),this.deadClicksAutocapture.startIfEnabled()})),i.push((()=>{if(this.Hn){var t=this.Hn;this.Hn=void 0,this.ei(t)}})),this.Vn(i,e)}Vn(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Vn(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){ls.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&ls.info("PostHog extensions initialized ("+r+"ms)")}ei(t){var e,i,r,n,s,o,a,l,u;if(!Jn||!Jn.body)return ls.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.ei(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Hn=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Hi(t.supportedCompression,Ul.GZipJS)?Ul.GZipJS:Hi(t.supportedCompression,Ul.Base64)?Ul.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Mn?this.Mn:"identified_only"}),null==(i=this.siteApps)||i.onRemoteConfig(t),null==(r=this.sessionRecording)||r.onRemoteConfig(t),null==(n=this.autocapture)||n.onRemoteConfig(t),null==(s=this.heatmaps)||s.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.conversations.onRemoteConfig(t),null==(o=this.productTours)||o.onRemoteConfig(t),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(t),null==(l=this.exceptionObserver)||l.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(t)}qn(){try{this.config.loaded(this)}catch(t){ls.critical("`loaded` function failed",t)}this.jn(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.Yn()}),1),new sf(this).load(),this.featureFlags.flags()}jn(){var t;this.is_capturing()&&(this.config.request_batching&&(null==(t=this.Ln)||t.enable()))}_dom_loaded(){this.is_capturing()&&cs(this.__request_queue,(t=>this.Dn(t))),this.__request_queue=[],this.jn()}_handle_unload(){var t,e;this.surveys.handlePageUnload(),this.config.request_batching?(this.Gn()&&this.capture("$pageleave"),null==(t=this.Ln)||t.unload(),null==(e=this.Bn)||e.unload()):this.Gn()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(Ff?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Fu(t.url,{ip:this.config.ip?1:0}),t.headers=i({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,r,n,s=i({},t);s.timeout=s.timeout||6e4,s.url=Fu(s.url,{_:(new Date).getTime().toString(),ver:os.LIB_VERSION,compression:s.compression});var o=null!==(e=s.transport)&&void 0!==e?e:"fetch",a=Lu.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),l=null!==(r=null==(n=Is(a,(t=>t.transport===o)))?void 0:n.method)&&void 0!==r?r:a[0].method;if(!l)throw new Error("No available transport method");l(s)})(i({},t,{callback:e=>{var i,r;(this.rateLimiter.checkForLimiting(e),e.statusCode>=400)&&(null==(i=(r=this.config).on_request_error)||i.call(r,e));null==t.callback||t.callback(e)}}))))}Dn(t){this.Bn?this.Bn.retriableRequest(t):this._send_request(t)}_execute_array(t){var e,i=[],r=[],n=[];cs(t,(t=>{t&&(e=t[0],Ui(e)?n.push(t):Xi(t)?t.call(this):Ui(t)&&"alias"===e?i.push(t):Ui(t)&&-1!==e.indexOf("capture")&&Xi(this[e])?n.push(t):r.push(t))}));var s=function(t,e){cs(t,(function(t){if(Ui(t[0])){var i=e;ds(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else this[t[0]].apply(this,t.slice(1))}),e)};s(i,this),s(r,this),s(n,this)}$n(){var t,e;return(null==(t=this.config.bootstrap)?void 0:t.featureFlags)&&Object.keys(null==(e=this.config.bootstrap)?void 0:e.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,e,r){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ln){if(this.is_capturing())if(!tr(t)&&er(t)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var o=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){null!=e&&e.$current_url&&!er(null==e?void 0:e.$current_url)&&(ls.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,l=(null==r?void 0:r.timestamp)||a,u=zl(),h={uuid:u,event:t,properties:this.calculateEventProperties(t,e||{},l,u)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&s&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),o&&(h.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==r?void 0:r.$set)&&(h.$set=null==r?void 0:r.$set);var c="$groupidentify"!==t,d=this.zn(null==r?void 0:r.$set_once,c);if(d&&(h.$set_once=d),(h=bs(h,null!=r&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,tr(null==r?void 0:r.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=a),t===xl.DISMISSED||t===xl.SENT){var v=null==e?void 0:e[Al.SURVEY_ID],f=null==e?void 0:e[Al.SURVEY_ITERATION];Bl({id:v,current_iteration:f}),h.$set=i({},h.$set,{[Pl({id:v,current_iteration:f},t===xl.SENT?"responded":"dismissed")]:!0})}else t===xl.SHOWN&&(h.$set=i({},h.$set,{[Al.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var p=i({},h.properties.$set,h.$set);if(Qi(p)||this.setPersonPropertiesForFlags(p),!nr(this.config.before_send)){var g=this.Wn(h);if(!g)return;h=g}this.An.emit("eventCaptured",h);var m={method:"POST",url:null!==(n=null==r?void 0:r._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:null==r?void 0:r._batchKey};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this.Dn(m):this.Ln.enqueue(m),h}ls.critical("This capture call is ignored due to client rate limiting.")}}else ls.error("No event name provided to posthog.capture")}else ls.uninitializedWarning("posthog.capture")}ki(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,r,n,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return e;var o=s?void 0:this.persistence.remove_event_timer(t),a=i({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===t){var l=i({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!er(a.distinct_id)&&!sr(a.distinct_id)||ir(a.distinct_id))&&ls.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=Iv(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&vs(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&vs(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.Bn)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===bf.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u="$pageview"!==t||s?"$pageleave"!==t||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,n),a=vs(a,u),"$pageview"===t&&Jn&&(a.title=Jn.title),!tr(o)){var f=r.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}is&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=vs({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Ui(this.config.property_denylist)?ds(this.config.property_denylist,(function(t){delete a[t]})):ls.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(ls.error("sanitize_properties is deprecated. Use before_send instead"),a=p(a,t));var g=this.Un();return a.$process_person_profile=g,g&&!s&&this.Xn("_calculate_event_properties"),a}zn(t,e){var i;if(void 0===e&&(e=!0),!this.persistence||!this.Un())return t;if(this.xn)return t;var r=this.persistence.get_initial_props(),n=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),s=vs({},r,n||{},t||{}),o=this.config.sanitize_properties;return o&&(ls.error("sanitize_properties is deprecated. Use before_send instead"),s=o(s,"$set_once")),e&&(this.xn=!0),Qi(s)?void 0:s}register(t,e){var i;null==(i=this.persistence)||i.register(t,e)}register_once(t,e,i){var r;null==(r=this.persistence)||r.register_once(t,e,i)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}Jn(t,e){this.register({[t]:e})}getFeatureFlag(t,e){return this.featureFlags.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(e)}catch(t){return e}}isFeatureEnabled(t,e){return this.featureFlags.isFeatureEnabled(t,e)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(t,e,r){var n=null!=r&&r.merge?this.featureFlags.getFlagVariants():{},s=null!=r&&r.merge?this.featureFlags.getFlagPayloads():{},o=i({},n,t),a=i({},s,e),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:tr(null==a?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.featureFlags.receivedFeatureFlags({flags:l})}updateEarlyAccessFeatureEnrollment(t,e,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){return void 0===e&&(e=!1),this.featureFlags.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.An.on(t,e)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys.getSurveys(t,e)}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys.getActiveMatchingSurveys(t,e)}renderSurvey(t,e){this.surveys.renderSurvey(t,e)}displaySurvey(t,e){void 0===e&&(e=$l),this.surveys.displaySurvey(t,e)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,e){return void 0===e&&(e=!1),this.surveys.canRenderSurveyAsync(t,e)}identify(t,e,r){if(!this.__loaded||!this.persistence)return ls.uninitializedWarning("posthog.identify");if(sr(t)&&(t=t.toString(),ls.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))ls.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==ao){if(this.Xn("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}t!==n&&t!==this.get_property(Rs)&&(this.unregister(Rs),this.register({distinct_id:t}));var o="anonymous"===(this.persistence.get_property(Qs)||"anonymous");t!==n&&o?(this.persistence.set_property(Qs,"identified"),this.setPersonPropertiesForFlags(i({},r||{},e||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:n},{$set:e||{},$set_once:r||{}}),this.Nn=Bu(t,e,r),this.featureFlags.setAnonymousDistinctId(n)):(e||r)&&this.setPersonProperties(e,r),t!==n&&(this.reloadFeatureFlags(),this.unregister(Ks))}}else ls.critical('The string "'+ao+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else ls.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,e){if((t||e)&&this.Xn("posthog.setPersonProperties")){var r=Bu(this.get_distinct_id(),t,e);this.Nn!==r?(this.setPersonPropertiesForFlags(i({},e||{},t||{})),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Nn=r):ls.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,e,r){if(t&&e){var n=this.getGroups();n[t]!==e&&this.resetGroupPropertiesForFlags(t),this.register({$groups:i({},n,{[t]:e})}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:e,$group_set:r}),this.setGroupPropertiesForFlags({[t]:r})),n[t]===e||r||this.reloadFeatureFlags()}else ls.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.featureFlags.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0),this.Xn("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,e)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var e,i,r,n;if(ls.info("reset"),!this.__loaded)return ls.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(i=this.sessionPersistence)||i.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(r=this.persistence)||r.set_property(Qs,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.Nn=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ao,$device_id:null},"");else{var o=this.config.get_device_id(zl());this.register_once({distinct_id:o,$device_id:t?o:s},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:e,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&i){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0)}return r}alias(t,e){return t===this.get_property(Ns)?(ls.critical("Attempting to create alias for existing People user - aborting."),-2):this.Xn("posthog.alias")?(tr(e)&&(e=this.get_distinct_id()),t!==e?(this.Jn(Rs,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(ls.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=i({},this.config);if(Ki(t)){var r,n,s,o,a,l,u;vs(this.config,Pf(t));var h=this.Pn();null==(r=this.persistence)||r.update_config(this.config,e,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Vv(i({},this.config,{persistence:"sessionStorage"}),h);var c=this.Rn(this.config.debug);or(c)&&(this.config.debug=c),or(this.config.debug)&&(this.config.debug?(os.DEBUG=!0,Pd.Zt()&&Pd.Vt("ph_debug","true"),ls.info("set_config",{config:t,oldConfig:e,newConfig:i({},this.config)})):(os.DEBUG=!1,Pd.Zt()&&Pd.jt("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.Kn(),null==(u=this.externalIntegrations)||u.startIfEnabledOrStop()}}startSessionRecording(t){var e=!0===t,i={sampling:e||!(null==t||!t.sampling),linked_flag:e||!(null==t||!t.linked_flag),url_trigger:e||!(null==t||!t.url_trigger),event_trigger:e||!(null==t||!t.event_trigger)};if(Object.values(i).some(Boolean)){var r,n,s,o,a;if(null==(r=this.sessionManager)||r.checkAndGetSessionAndWindowId(),i.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(i.linked_flag)null==(s=this.sessionRecording)||s.overrideLinkedFlag();if(i.url_trigger)null==(o=this.sessionRecording)||o.overrideTrigger("url");if(i.event_trigger)null==(a=this.sessionRecording)||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){var r=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(i({},n,e))}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:Rf;return e!==Rf&&(e=Rf+"."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property(Qs))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property(Qs))}Un(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Qi(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Rs])&&(null==(e=this.persistence)||null==(e=e.props)||!e[so]))}Gn(){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.Un()||this.Xn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Xn(t){return"never"===this.config.person_profiles?(ls.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jn(so,!0),!0)}Pn(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut(),e=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||t&&!!e}Kn(){var t,e,i,r,n=this.Pn();(null==(t=this.persistence)?void 0:t.ai)!==n&&(null==(i=this.persistence)||i.set_disabled(n));(null==(e=this.sessionPersistence)?void 0:e.ai)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n));return n}opt_in_capturing(t){var e;if("always"!==this.config.cookieless_mode){var i,r,n;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new ff(this),this.pageViewManager=new Ev(this),this.persistence&&(this.sessionPropsManager=new df(this,this.sessionManager,this.persistence)),this.sessionRecording=new Ef(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this.Kn(),this.jn(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),tr(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)this.capture(null!==(n=null==t?void 0:t.captureEventName)&&void 0!==n?n:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.Yn()}else ls.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,e,i;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kn(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ao,$device_id:null}),null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(i=this.sessionRecording)||i.stopRecording(),this.sessionRecording=void 0,this.Yn())):ls.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===qd.GRANTED?"granted":t===qd.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Kn()}_is_bot(){return Xn?yf(Xn,this.config.custom_blocked_useragents):void 0}Yn(){Jn&&("visible"===Jn.visibilityState?this.Tn||(this.Tn=!0,this.capture("$pageview",{title:Jn.title},{send_instantly:!0}),this.En&&(Jn.removeEventListener("visibilitychange",this.En),this.En=null)):this.En||(this.En=this.Yn.bind(this),Cs(Jn,"visibilitychange",this.En)))}debug(t){!1===t?(null==Yn||Yn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Yn||Yn.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}))}_t(){var t,e,i,r,n,s,o,a=this.Fn||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ls.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):(i="advanced_disable_decide",r=!1,n=ls,s=(e="advanced_disable_flags")in(t=a)&&!tr(t[e]),o=i in t&&!tr(t[i]),s?t[e]:o?(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i]):r)}Wn(t){if(nr(this.config.before_send))return t;var e=Ui(this.config.before_send)?this.config.before_send:[this.config.before_send],i=t;for(var r of e){if(i=r(i),nr(i)){var n="Event '"+t.event+"' was rejected in beforeSend function";return lr(t.event)?ls.warn(n+". This can cause unexpected behavior."):ls.info(n),null}i.properties&&!Qi(i.properties)||ls.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var t;return null==(t=this.pageViewManager.Ze)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(i)})}Rn(t){var e=or(t)&&!t,i=Pd.Zt()&&"true"===Pd.qt("ph_debug");return!e&&(!!i||t)}}!function(t,e){for(var i=0;i<e.length;i++)t.prototype[e[i]]=ms(t.prototype[e[i]])}(Df,["identify"]);var Bf,Zf;Bf=Mf[Rf]=new Df,(Zf=rs.posthog)&&ds(Zf._i,(function(t){if(t&&Ui(t)){var e=Bf.init(t[0],t[1],t[2]),i=Zf[t[2]]||Zf;e&&(e._execute_array.call(e.people,i.people),e._execute_array(i))}})),rs.posthog=Bf,function(){function t(){t.done||(t.done=!0,Ff=!1,ds(Mf,(function(t){t._dom_loaded()})))}null!=Jn&&Jn.addEventListener?"complete"===Jn.readyState?t():Cs(Jn,"DOMContentLoaded",t,{capture:!1}):Yn&&ls.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
|
|
1
|
+
!function(){"use strict";function t(t,e,i,r,n,s,o){try{var a=t[s](o),l=a.value}catch(t){return void i(t)}a.done?e(l):Promise.resolve(l).then(r,n)}function e(e){return function(){var i=this,r=arguments;return new Promise((function(n,s){var o=e.apply(i,r);function a(e){t(o,n,s,a,l,"next",e)}function l(e){t(o,n,s,a,l,"throw",e)}a(void 0)}))}}function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},i.apply(null,arguments)}function r(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}var n,s=["type"],o=Object.defineProperty,a=(t,e,i)=>((t,e,i)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),l=Object.defineProperty,u=(t,e,i)=>((t,e,i)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),h=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(h||{}),c={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},d={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var v={};function f(t){if(v[t])return v[t];var e=function(t){var e,i=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],i=e.prototype,r=t in c?c[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in d?d[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return v[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?v[t]=u:e.prototype}catch(t){return e.prototype}}var p={};function g(t,e,i){var r,n=t+"."+String(i);if(p[n])return p[n].call(e);var s=f(t),o=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return o?(p[n]=o,o.call(e)):e[i]}var m={};function y(t,e,i){var r=t+"."+String(i);if(m[r])return m[r].bind(e);var n=f(t)[i];return"function"!=typeof n?e[i]:(m[r]=n,n.bind(e))}var b={childNodes:function(t){return g("Node",t,"childNodes")},parentNode:function(t){return g("Node",t,"parentNode")},parentElement:function(t){return g("Node",t,"parentElement")},textContent:function(t){return g("Node",t,"textContent")},contains:function(t,e){return y("Node",t,"contains")(e)},getRootNode:function(t){return y("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?g("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?g("Element",t,"shadowRoot"):null},querySelector:function(t,e){return g("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return g("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return f("MutationObserver").constructor}};function _(t){return t.nodeType===t.ELEMENT_NODE}function w(t){var e=t&&"host"in t&&"mode"in t&&b.host(t)||null;return Boolean(e&&"shadowRoot"in e&&b.shadowRoot(e)===t)}function I(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function C(t){try{var e=t.rules||t.cssRules;if(!e)return null;var i=Array.from(e,(e=>S(e,t.href))).join("");return(r=i).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}catch(t){return null}var r}function S(t,e){if(function(t){return"styleSheet"in t}(t)){var i;try{i=C(t.styleSheet)||function(t){var{cssText:e}=t;if(e.split('"').length<3)return e;var i=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?i.push("layer"):t.layerName&&i.push("layer("+t.layerName+")"),t.supportsText&&i.push("supports("+t.supportsText+")"),t.media.length&&i.push(t.media.mediaText),i.join(" ")+";"}(t)}catch(e){i=t.cssText}return t.styleSheet.href?L(i,t.styleSheet.href):i}var r,n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(r=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n=n.replace(r,"$1\\$2")),e?L(n,e):n}function k(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}let x=class{constructor(){u(this,"idNodeMap",new Map),u(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var i=null==(e=this.getMeta(t))?void 0:e.id;return null!=i?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var i=e.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function A(t){var{element:e,maskInputOptions:i,tagName:r,type:n,value:s,maskInputFn:o}=t,a=s||"",l=n&&T(n);return(i[r.toLowerCase()]||l&&i[l])&&(a=o?o(a,e):"*".repeat(a.length)),a}function T(t){return t.toLowerCase()}var E="__rrweb_original__";function M(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?T(e):null}function N(t,e){var i,r;try{r=new URL(t,null!=e?e:window.location.href)}catch(t){return null}var n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(i=null==n?void 0:n[1])&&void 0!==i?i:null}var R=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,F=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,P=/^(data:)([^,]*),(.*)/i;function L(t,e){return(t||"").replace(R,((t,i,r,n,s,o)=>{var a,l=r||s||o,u=i||n||"";if(!l)return t;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=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+l)+u+")";var h=e.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,Z=1,q=new RegExp("[^a-z0-9-_:]"),H=-2;function V(){return Z++}var j=/^[^ \t\n\r\u000c]+/,Y=/^[, \t\n\r\u000c]+/;var G=new WeakMap;function z(t,e){return e&&""!==e.trim()?U(t,e):e}function W(t){return Boolean("svg"===t.tagName||t.ownerSVGElement)}function U(t,e){var i=G.get(t);if(i||(i=t.createElement("a"),G.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function X(t,e,i,r){return r?"src"===i||"href"===i&&("use"!==e||"#"!==r[0])||"xlink:href"===i&&"#"!==r[0]?z(t,r):"background"!==i||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===i?function(t,e){if(""===e.trim())return e;var i=0;function r(t){var r,n=t.exec(e.substring(i));return n?(r=n[0],i+=r.length,r):""}for(var n=[];r(Y),!(i>=e.length);){var s=r(j);if(","===s.slice(-1))s=z(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=z(t,s);for(var a=!1;;){var l=e.charAt(i);if(""===l){n.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){i+=1,n.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?L(r,U(t)):"object"===e&&"data"===i?z(t,r):r:z(t,r):r}function J(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function K(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&K(b.parentNode(t),e,i);for(var r=t.classList.length;r--;){var n=t.classList[r];if(e.test(n))return!0}return!!i&&K(b.parentNode(t),e,i)}function Q(t,e,i,r){var n;if(_(t)){if(n=t,!b.childNodes(n).length)return!1}else{if(null===b.parentElement(t))return!1;n=b.parentElement(t)}try{if("string"==typeof e){if(r){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(K(n,e,r))return!0;if(i)if(r){if(n.closest(i))return!0}else if(n.matches(i))return!0}catch(t){}return!1}function tt(t,e){var{doc:i,mirror:r,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}=e,m=function(t,e){if(!e.hasNode(t))return;var i=e.getId(t);return 1===i?void 0:i}(i,r);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:h.Document,childNodes:[],compatMode:t.compatMode}:{type:h.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:h.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){for(var i,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskInputFn:l,dataURLOptions:u={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:v,newlyAddedElement:f=!1,rootId:p}=e,g=function(t,e,i){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var r=t.classList.length;r--;){var n=t.classList[r];if(e.test(n))return!0}if(i)return t.matches(i)}catch(t){}return!1}(t,n,s),m=function(t){if(t instanceof HTMLFormElement)return"form";var e=T(t.tagName);return q.test(e)?"div":e}(t),y={},_=t.attributes.length,w=0;w<_;w++){var I=t.attributes[w];J(m,I.name,I.value)||(y[I.name]=X(r,m,T(I.name),I.value))}if("link"===m&&o){var S=function(t){return null==t?void 0:t.href}(t);if(S){var x=k(r,S);if(!x&&S.includes(".css"))x=k(r,window.location.origin+"/"+S.replace(window.location.href,""));var N=null;x&&(N=C(x)),N&&(delete y.rel,delete y.href,y._cssText=N)}}if("style"===m&&t.sheet&&!(t.innerText||b.textContent(t)||"").trim().length){var R=C(t.sheet);R&&(y._cssText=R)}if("input"===m||"textarea"===m||"select"===m){var F=t.value,O=t.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&F?y.value=A({element:t,type:M(t),tagName:m,value:F,maskInputOptions:a,maskInputFn:l}):O&&(y.checked=O)}"option"===m&&(t.selected&&!a.select?y.selected=!0:delete y.selected);if("dialog"===m&&t.open)try{y.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){y.rr_open_mode="modal",y.ph_rr_could_not_detect_modal=!0}if("canvas"===m&&d)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var i=0;i<t.width;i+=50)for(var r=0;r<t.height;r+=50){var n=e.getImageData,s=E in n?n[E]:n;if(new Uint32Array(s.call(e,i,r,Math.min(50,t.width-i),Math.min(50,t.height-r)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(y.rr_dataURL=t.toDataURL(u.type,u.quality));else if(!("__context"in t)){var P=t.toDataURL(u.type,u.quality),L=r.createElement("canvas");L.width=t.width,L.height=t.height,P!==L.toDataURL(u.type,u.quality)&&(y.rr_dataURL=P)}if("img"===m&&c){D||(D=r.createElement("canvas"),B=D.getContext("2d"));var Z=t,H=Z.currentSrc||Z.getAttribute("src")||"<unknown-src>",V=Z.crossOrigin,j=()=>{Z.removeEventListener("load",j);try{D.width=Z.naturalWidth,D.height=Z.naturalHeight,B.drawImage(Z,0,0),y.rr_dataURL=D.toDataURL(u.type,u.quality)}catch(t){if("anonymous"!==Z.crossOrigin)return Z.crossOrigin="anonymous",void(Z.complete&&0!==Z.naturalWidth?j():Z.addEventListener("load",j));console.warn("Cannot inline img src="+H+"! Error: "+t)}"anonymous"===Z.crossOrigin&&(V?y.crossOrigin=V:Z.removeAttribute("crossorigin"))};Z.complete&&0!==Z.naturalWidth?j():Z.addEventListener("load",j)}if("audio"===m||"video"===m){var Y=y;Y.rr_mediaState=t.paused?"paused":"played",Y.rr_mediaCurrentTime=t.currentTime,Y.rr_mediaPlaybackRate=t.playbackRate,Y.rr_mediaMuted=t.muted,Y.rr_mediaLoop=t.loop,Y.rr_mediaVolume=t.volume}f||(t.scrollLeft&&(y.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(y.rr_scrollTop=t.scrollTop));if(g){var{width:G,height:z}=t.getBoundingClientRect();y={class:y.class,rr_width:G+"px",rr_height:z+"px"}}"iframe"!==m||v(y.src)||(t.contentDocument||(y.rr_src=y.src),delete y.src);try{customElements.get(m)&&(i=!0)}catch(t){}return{type:h.Element,tagName:m,attributes:y,childNodes:[],isSVG:W(t)||void 0,needBlock:g,rootId:p,isCustom:i}}(t,{doc:i,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:v,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var i,{needsMask:r,maskTextFn:n,rootId:s}=e,o=b.parentNode(t),a=o&&o.tagName,l=b.textContent(t),u="STYLE"===a||void 0,c="SCRIPT"===a||void 0;if(u&&l){try{t.nextSibling||t.previousSibling||(null==(i=o.sheet)?void 0:i.cssRules)&&(l=C(o.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=L(l,U(e.doc))}c&&(l="SCRIPT_PLACEHOLDER");!u&&!c&&l&&r&&(l=n?n(l,b.parentElement(t)):l.replace(/[\S]/g,"*"));return{type:h.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:i,needsMask:o,maskTextFn:u,rootId:m});case t.CDATA_SECTION_NODE:return{type:h.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:h.Comment,textContent:b.textContent(t)||"",rootId:m};default:return!1}}function et(t){return null==t?"":t.toLowerCase()}function it(t,e){var{doc:i,mirror:r,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:C,iframeLoadTimeout:S=5e3,onStylesheetLoad:k,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:A=(()=>!1),newlyAddedElement:T=!1}=e,{needsMask:E}=e,{preserveWhiteSpace:M=!0}=e;E||(E=Q(t,o,a,void 0===E));var R,F=tt(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:E,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:A,newlyAddedElement:T});if(!F)return console.warn(t,"not serialized"),null;R=r.hasNode(t)?r.getId(t):!function(t,e){if(e.comment&&t.type===h.Comment)return!0;if(t.type===h.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===N(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(et(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===et(t.attributes.name)||"icon"===et(t.attributes.rel)||"apple-touch-icon"===et(t.attributes.rel)||"shortcut icon"===et(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&et(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(et(t.attributes.property).match(/^(og|twitter|fb):/)||et(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===et(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===et(t.attributes.name)||"googlebot"===et(t.attributes.name)||"bingbot"===et(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===et(t.attributes.name)||"generator"===et(t.attributes.name)||"framework"===et(t.attributes.name)||"publisher"===et(t.attributes.name)||"progid"===et(t.attributes.name)||et(t.attributes.property).match(/^article:/)||et(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===et(t.attributes.name)||"yandex-verification"===et(t.attributes.name)||"csrf-token"===et(t.attributes.name)||"p:domain_verify"===et(t.attributes.name)||"verify-v1"===et(t.attributes.name)||"verification"===et(t.attributes.name)||"shopify-checkout-api-token"===et(t.attributes.name)))return!0}}return!1}(F,f)&&(M||F.type!==h.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?V():H;var O=Object.assign(F,{id:R});if(r.add(t,O),R===H)return null;y&&y(t);var P=!l;if(O.type===h.Element){P=P&&!O.needBlock,delete O.needBlock;var L=b.shadowRoot(t);L&&I(L)&&(O.isShadowHost=!0)}if((O.type===h.Document||O.type===h.Element)&&P){f.headWhitespace&&O.type===h.Element&&"head"===O.tagName&&(M=!1);var D={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:E,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:C,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A};if(O.type===h.Element&&"textarea"===O.tagName&&void 0!==O.attributes.value);else for(var B of Array.from(b.childNodes(t))){var Z=it(B,D);Z&&O.childNodes.push(Z)}var q=null;if(_(t)&&(q=b.shadowRoot(t)))for(var j of Array.from(b.childNodes(q))){var Y=it(j,D);Y&&(I(q)&&(Y.isShadow=!0),O.childNodes.push(Y))}}var G=b.parentNode(t);return G&&w(G)&&I(G)&&(O.isShadow=!0),O.type===h.Element&&"iframe"===O.tagName&&function(t,e,i){var r=t.contentWindow;if(r){var n,s=!1;try{n=r.document.readyState}catch(t){return}if("complete"===n){var o="about:blank";if(r.location.href!==o||t.src===o||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}else{var a=setTimeout((()=>{s||(e(),s=!0)}),i);t.addEventListener("load",(()=>{clearTimeout(a),s=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&C){var i=it(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:E,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:C,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});i&&C(t,i)}}),S),O.type===h.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===N(O.attributes.href))&&function(t,e,i){var r,n=!1;try{r=t.sheet}catch(t){return}if(!r){var s=setTimeout((()=>{n||(e(),n=!0)}),i);t.addEventListener("load",(()=>{clearTimeout(s),n=!0,e()}))}}(t,(()=>{if(k){var e=it(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:E,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:d,maskInputFn:v,slimDOMOptions:f,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:C,iframeLoadTimeout:S,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:A});e&&k(t,e)}}),x),O}let rt=class t{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 t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var nt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},st={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]};var ot={};function at(t){if(ot[t])return ot[t];var e=function(t){var e,i=null==globalThis||null==(e=globalThis.Zone)||null==e.__symbol__?void 0:e.__symbol__(t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],i=e.prototype,r=t in nt?nt[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in st?st[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return ot[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?ot[t]=u:i}catch(t){return i}}var lt={};function ut(t,e,i){var r,n=t+"."+String(i);if(lt[n])return lt[n].call(e);var s=at(t),o=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return o?(lt[n]=o,o.call(e)):e[i]}var ht={};function ct(t,e,i){var r=t+"."+String(i);if(ht[r])return ht[r].bind(e);var n=at(t)[i];return"function"!=typeof n?e[i]:(ht[r]=n,n.bind(e))}function dt(){return at("MutationObserver").constructor}var vt={childNodes:function(t){return ut("Node",t,"childNodes")},parentNode:function(t){return ut("Node",t,"parentNode")},parentElement:function(t){return ut("Node",t,"parentElement")},textContent:function(t){return ut("Node",t,"textContent")},contains:function(t,e){return ct("Node",t,"contains")(e)},getRootNode:function(t){return ct("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?ut("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?ut("Element",t,"shadowRoot"):null},querySelector:function(t,e){return ut("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return ut("Element",t,"querySelectorAll")(e)},mutationObserver:dt};function ft(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>i.removeEventListener(t,e,r)}var pt="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.",gt={map:{},getId:()=>(console.error(pt),-1),getNode:()=>(console.error(pt),null),removeNodeFromMap(){console.error(pt)},has:()=>(console.error(pt),!1),reset(){console.error(pt)}};function mt(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;u<=0||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,o)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,o)}),u))}}function yt(t,e,i,r,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,r?i:{set(t){setTimeout((()=>{i.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>yt(t,e,s||{},!0)}function bt(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n=i(r);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=n,()=>{t[e]=r}}catch(t){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gt=new Proxy(gt,{get:(t,e,i)=>("map"===e&&console.error(pt),Reflect.get(t,e,i))}));var _t=Date.now;function wt(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=vt.parentElement(s.body))?void 0:e.scrollLeft)||(null==(i=null==s?void 0:s.body)?void 0:i.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(r=vt.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function It(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ct(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function St(t){return t?t.nodeType===t.ELEMENT_NODE?t:vt.parentElement(t):null}function kt(t,e,i,r){if(!t)return!1;var n=St(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if(K(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1}function xt(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||e.getId(t)===H}function At(t,e){if(w(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=vt.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||At(r,e))}function Tt(t){return Boolean(t.changedTouches)}function Et(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Mt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Nt(t){return!!t&&(t instanceof rt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vt.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(_t=()=>(new Date).getTime());let Rt=class{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ft(t){var e,i=null;return"getRootNode"in t&&(null==(e=vt.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vt.host(vt.getRootNode(t))&&(i=vt.host(vt.getRootNode(t))),i}function Ot(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=Ft(i);)i=e;return i}(t);return vt.contains(e,i)}function Pt(t){var e=t.ownerDocument;return!!e&&(vt.contains(e,t)||Ot(t))}var Lt=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(Lt||{}),Dt=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(Dt||{}),Bt=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(Bt||{}),Zt=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(Zt||{}),$t=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))($t||{}),qt=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(qt||{});function Ht(t){return"__ln"in t}class Vt{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,i=0;i<t;i++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Ht(t.previousSibling)){var i=t.previousSibling.__ln.next;e.next=i,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,i&&(i.previous=e)}else if(t.nextSibling&&Ht(t.nextSibling)&&t.nextSibling.__ln.previous){var r=t.nextSibling.__ln.previous;e.previous=r,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,r&&(r.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var jt,Yt=(t,e)=>t+"@"+e;class Gt{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",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,i=new Vt,r=t=>{for(var e=t,i=H;i===H;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=vt.parentNode(n);if(s&&Pt(n)&&"TEXTAREA"!==s.tagName){var o=w(s)?this.mirror.getId(Ft(n)):this.mirror.getId(s),a=r(n);if(-1===o||-1===a)return i.addNode(n);var l=it(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:t=>{Et(t,this.mirror)&&this.iframeManager.addIframe(t),Mt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Nt(n)&&this.shadowDomManager.addShadowRoot(vt.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});l&&(t.push({parentId:o,nextId:a,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Wt(this.removes,s,this.mirror)&&!this.movedSet.has(vt.parentNode(s))||n(s);for(var o of this.addedSet)Ut(this.droppedSet,o)||Wt(this.removes,o,this.mirror)?Ut(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;i.length;){var l=null;if(a){var u=this.mirror.getId(vt.parentNode(a.value)),h=r(a.value);-1!==u&&-1!==h&&(l=a)}if(!l)for(var c=i.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(vt.parentNode(d.value));if(-1===r(d.value))continue;if(-1!==v){l=d;break}var f=d.value,p=vt.parentNode(f);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var g=vt.host(p);if(-1!==this.mirror.getId(g)){l=d;break}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}a=l.previous,i.removeNode(l.value),n(l.value)}var m={texts:this.texts.map((t=>{var e=t.node,i=vt.parentNode(e);return i&&"TEXTAREA"===i.tagName&&this.genTextAreaValueMutation(i),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var i=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);i.length<e.style.length&&(i+r).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(m.texts.length||m.attributes.length||m.removes.length||m.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(m))}})),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(vt.childNodes(t),(t=>vt.textContent(t)||"")).join("")})),a(this,"processMutation",(t=>{if(!xt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=vt.textContent(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:Q(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,St(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var i=t.target,r=t.attributeName,n=t.target.getAttribute(r);if("value"===r){var s=M(i);n=A({element:i,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(kt(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===i.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(i.contentDocument)return;r="rr_src"}if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),"type"===r&&"INPUT"===i.tagName&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!J(i.tagName,r))if(o.attributes[r]=X(this.doc,T(i.tagName),T(r),n),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(i.style))){var u=i.style.getPropertyValue(l),h=i.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))""===i.style.getPropertyValue(c)&&(o.styleDiff[c]=!1)}else"open"===r&&"DIALOG"===i.tagName&&(i.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break;case"childList":if(kt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var i=this.mirror.getId(e),r=w(t.target)?this.mirror.getId(vt.host(t.target)):this.mirror.getId(t.target);kt(t.target,this.blockClass,this.blockSelector,!1)||xt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(zt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||At(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Yt(i,r)]?zt(this.movedSet,e):this.removes.push({parentId:r,id:i,isShadow:!(!w(t.target)||!I(t.target))||void 0})),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(xt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var i=null;e&&this.mirror.hasNode(e)&&(i=this.mirror.getId(e)),i&&-1!==i&&(this.movedMap[Yt(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);kt(t,this.blockClass,this.blockSelector,!1)||(vt.childNodes(t).forEach((t=>this.genAdds(t))),Nt(t)&&vt.childNodes(vt.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]}))}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 zt(t,e){t.delete(e),vt.childNodes(e).forEach((e=>zt(t,e)))}function Wt(t,e,i){return 0!==t.length&&function(t,e,i){var r,n=vt.parentNode(e),s=function(){var e=i.getId(n);if(t.some((t=>t.id===e)))return{v:!0};n=vt.parentNode(n)};for(;n;)if(r=s())return r.v;return!1}(t,e,i)}function Ut(t,e){return 0!==t.size&&Xt(t,e)}function Xt(t,e){var i=vt.parentNode(e);return!!i&&(!!t.has(i)||Xt(t,i))}var Jt=t=>{if(!jt)return t;return function(){try{return t(...arguments)}catch(t){if(jt&&!0===jt(t))return;throw t}}},Kt=[];function Qt(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function te(t,e){var i=new Gt;Kt.push(i),i.init(t);var r=new(dt())(Jt(i.processMutations.bind(i)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function ee(t){var{mouseInteractionCb:e,doc:r,mirror:n,blockClass:s,blockSelector:o,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var l=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[],h=null;return Object.keys(Bt).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var a=T(t),l=(t=>r=>{var a=Qt(r);if(!kt(a,s,o,!0)){var l=null,u=t;if("pointerType"in r){switch(r.pointerType){case"mouse":l=Zt.Mouse;break;case"touch":l=Zt.Touch;break;case"pen":l=Zt.Pen}l===Zt.Touch?Bt[t]===Bt.MouseDown?u="TouchStart":Bt[t]===Bt.MouseUp&&(u="TouchEnd"):Zt.Pen}else Tt(r)&&(l=Zt.Touch);null!==l?(h=l,(u.startsWith("Touch")&&l===Zt.Touch||u.startsWith("Mouse")&&l===Zt.Mouse)&&(l=null)):Bt[t]===Bt.Click&&(l=h,h=null);var c=Tt(r)?r.changedTouches[0]:r;if(c){var d=n.getId(a),{clientX:v,clientY:f}=c;Jt(e)(i({type:Bt[u],id:d,x:v,y:f},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(Bt[t]){case Bt.MouseDown:case Bt.MouseUp:a=a.replace("mouse","pointer");break;case Bt.TouchStart:case Bt.TouchEnd:return}u.push(ft(a,l,r))})),Jt((()=>{u.forEach((t=>t()))}))}function ie(t){var{scrollCb:e,doc:i,mirror:r,blockClass:n,blockSelector:s,sampling:o}=t;return ft("scroll",Jt(mt(Jt((t=>{var o=Qt(t);if(o&&!kt(o,n,s,!0)){var a=r.getId(o);if(o===i&&i.defaultView){var l=wt(i.defaultView);e({id:a,x:l.left,y:l.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),i)}var re=["INPUT","TEXTAREA","SELECT"],ne=new WeakMap;function se(t){return function(t,e){if(ue("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||ue("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||ue("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||ue("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){var i=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(i)}else if(t.parentStyleSheet){var r=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(r)}return e}(t,[])}function oe(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}function ae(t,e){var i,r,n,{mirror:s,stylesheetManager:o}=t,a=null;a="#document"===e.nodeName?s.getId(e):s.getId(vt.host(e));var l="#document"===e.nodeName?null==(i=e.defaultView)?void 0:i.Document:null==(n=null==(r=e.ownerDocument)?void 0:r.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!==a&&-1!==a&&l&&u?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get(){var t;return null==(t=u.get)?void 0:t.call(this)},set(t){var e,i=null==(e=u.set)?void 0:e.call(this,t);if(null!==a&&-1!==a)try{o.adoptStyleSheets(t,a)}catch(t){}return i}}),Jt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):()=>{}}function le(t,e){void 0===e&&(e={});var r,n=t.doc.defaultView;if(!n)return()=>{};!function(t,e){var{mutationCb:i,mousemoveCb:r,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:h,canvasMutationCb:c,fontCb:d,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),i(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),r(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),o(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),a(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM&&(r=te(t,t.doc));var s=function(t){var{mousemoveCb:e,sampling:i,doc:r,mirror:n}=t;if(!1===i.mousemove)return()=>{};var s,o="number"==typeof i.mousemove?i.mousemove:50,a="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],u=mt(Jt((t=>{var i=Date.now()-s;e(l.map((t=>(t.timeOffset-=i,t))),t),l=[],s=null})),a),h=Jt(mt(Jt((t=>{var e=Qt(t),{clientX:i,clientY:r}=Tt(t)?t.changedTouches[0]:t;s||(s=_t()),l.push({x:i,y:r,id:n.getId(e),timeOffset:_t()-s}),u("undefined"!=typeof DragEvent&&t instanceof DragEvent?Dt.Drag:t instanceof MouseEvent?Dt.MouseMove:Dt.TouchMove)})),o,{trailing:!1})),c=[ft("mousemove",h,r),ft("touchmove",h,r),ft("drag",h,r)];return Jt((()=>{c.forEach((t=>t()))}))}(t),o=ee(t),a=ie(t),l=function(t,e){var{viewportResizeCb:i}=t,{win:r}=e,n=-1,s=-1;return ft("resize",Jt(mt(Jt((()=>{var t=It(),e=Ct();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),r)}(t,{win:n}),u=function(t){var{inputCb:e,doc:r,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=t;function v(t){var e=Qt(t),i=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=vt.parentElement(e)),e&&n&&!(re.indexOf(n)<0)&&!kt(e,s,o,!0)&&!(e.classList.contains(a)||l&&e.matches(l))){var c=e.value,v=!1,p=M(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(u[n.toLowerCase()]||u[p])&&(c=A({element:e,maskInputOptions:u,tagName:n,type:p,value:c,maskInputFn:h})),f(e,d?{text:c,isChecked:v,userTriggered:i}:{text:c,isChecked:v});var g=e.name;"radio"===p&&g&&v&&r.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var i=t.value;f(t,d?{text:i,isChecked:!v,userTriggered:!1}:{text:i,isChecked:!v})}}))}}function f(t,r){var s=ne.get(t);if(!s||s.text!==r.text||s.isChecked!==r.isChecked){ne.set(t,r);var o=n.getId(t);Jt(e)(i({},r,{id:o}))}}var p=("last"===c.input?["change"]:["input","change"]).map((t=>ft(t,Jt(v),r))),g=r.defaultView;if(!g)return()=>{p.forEach((t=>t()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),y=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...y.map((t=>yt(t[0],t[1],{set(){Jt(v)({target:this,isTrusted:!1})}},!1,g)))),Jt((()=>{p.forEach((t=>t()))}))}(t),h=function(t){var{mediaInteractionCb:e,blockClass:i,blockSelector:r,mirror:n,sampling:s,doc:o}=t,a=Jt((t=>mt(Jt((s=>{var o=Qt(s);if(o&&!kt(o,i,r,!0)){var{currentTime:a,volume:l,muted:u,playbackRate:h,loop:c}=o;e({type:t,id:n.getId(o),currentTime:a,volume:l,muted:u,playbackRate:h,loop:c})}})),s.media||500))),l=[ft("play",a(qt.Play),o),ft("pause",a(qt.Pause),o),ft("seeked",a(qt.Seeked),o),ft("volumechange",a(qt.VolumeChange),o),ft("ratechange",a(qt.RateChange),o)];return Jt((()=>{l.forEach((t=>t()))}))}(t),c=()=>{},d=()=>{},v=()=>{},f=()=>{};t.recordDOM&&(c=function(t,e){var{styleSheetRuleCb:i,mirror:r,stylesheetManager:n}=t,{win:s}=e;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Jt(((t,e,s)=>{var[o,a]=s,{id:l,styleId:u}=oe(e,r,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&i({id:l,styleId:u,adds:[{rule:o,index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,i){void 0===i&&(i=this.cssRules.length);var r=t+" { "+e+" }";return s.CSSStyleSheet.prototype.insertRule.apply(this,[r,i])};var a,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=oe(e,r,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&i({id:a,styleId:l,removes:[{index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(a=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=oe(e,r,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&i({id:a,styleId:l,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=oe(e,r,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&i({id:a,styleId:l,replaceSync:o}),t.apply(e,s)}))}));var h={};he("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(he("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),he("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),he("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var c={};return Object.entries(h).forEach((t=>{var[e,s]=t;c[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(c[e].insertRule,{apply:Jt(((t,e,s)=>{var[o,a]=s,{id:l,styleId:u}=oe(e.parentStyleSheet,r,n.styleMirror);return(l&&-1!==l||u&&-1!==u)&&i({id:l,styleId:u,adds:[{rule:o,index:[...se(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:Jt(((t,e,s)=>{var[o]=s,{id:a,styleId:l}=oe(e.parentStyleSheet,r,n.styleMirror);return(a&&-1!==a||l&&-1!==l)&&i({id:a,styleId:l,removes:[{index:[...se(e),o]}]}),t.apply(e,s)}))})})),Jt((()=>{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((t=>{var[e,i]=t;i.prototype.insertRule=c[e].insertRule,i.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:n}),d=ae(t,t.doc),v=function(t,e){var{styleDeclarationCb:i,mirror:r,ignoreCSSAttributes:n,stylesheetManager:s}=t,{win:o}=e,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Jt(((t,e,o)=>{var l,[u,h,c]=o;if(n.has(u))return a.apply(e,[u,h,c]);var{id:d,styleId:v}=oe(null==(l=e.parentRule)?void 0:l.parentStyleSheet,r,s.styleMirror);return(d&&-1!==d||v&&-1!==v)&&i({id:d,styleId:v,set:{property:u,value:h,priority:c},index:se(e.parentRule)}),t.apply(e,o)}))});var l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Jt(((t,e,o)=>{var a,[u]=o;if(n.has(u))return l.apply(e,[u]);var{id:h,styleId:c}=oe(null==(a=e.parentRule)?void 0:a.parentStyleSheet,r,s.styleMirror);return(h&&-1!==h||c&&-1!==c)&&i({id:h,styleId:c,remove:{property:u},index:se(e.parentRule)}),t.apply(e,o)}))}),Jt((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:n}),t.collectFonts&&(f=function(t){var{fontCb:e,doc:i}=t,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(t,e,i){var r=new o(t,e,i);return s.set(r,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};var a=bt(i.fonts,"add",(function(t){return function(i){return setTimeout(Jt((()=>{var t=s.get(i);t&&(e(t),s.delete(i))})),0),t.apply(this,[i])}}));return n.push((()=>{r.FontFace=o})),n.push(a),Jt((()=>{n.forEach((t=>t()))}))}(t)));var p=function(t){var{doc:e,mirror:i,blockClass:r,blockSelector:n,selectionCb:s}=t,o=!0,a=Jt((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],l=t.rangeCount||0,u=0;u<l;u++){var h=t.getRangeAt(u),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;kt(c,r,n,!0)||kt(v,r,n,!0)||a.push({start:i.getId(c),startOffset:d,end:i.getId(v),endOffset:f})}s({ranges:a})}}));return a(),ft("selectionchange",a)}(t),g=function(t){var{doc:e,customElementCb:i}=t,r=e.defaultView;return r&&r.customElements?bt(r.customElements,"define",(function(t){return function(e,r,n){try{i({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,r,n])}})):()=>{}}(t),m=[];for(var y of t.plugins)m.push(y.observer(y.callback,n,y.options));return Jt((()=>{Kt.forEach((t=>t.reset())),null==r||r.disconnect(),s(),o(),a(),l(),u(),h(),c(),d(),v(),f(),p(),g(),m.forEach((t=>t()))}))}function ue(t){return void 0!==window[t]}function he(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ce{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,r){var n=i||this.getIdToRemoteIdMap(t),s=r||this.getRemoteIdToIdMap(t),o=n.get(e);return o||(o=this.generateIdFn(),n.set(e,o),s.set(o,e)),o}getIds(t,e){var i=this.getIdToRemoteIdMap(t),r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,i,r)))}getRemoteId(t,e,i){var r=i||this.getRemoteIdToIdMap(t);if("number"!=typeof e)return e;var n=r.get(e);return n||-1}getRemoteIds(t,e){var i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,i)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class de{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ce(V)),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=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ce(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var i,r;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(i=t.contentWindow)||i.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var i=this.crossOriginIframeMap.get(t.source);if(i){var r=this.transformCrossOriginEvent(i,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var i;switch(e.type){case Lt.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),{timestamp:e.timestamp,type:Lt.IncrementalSnapshot,data:{source:Dt.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Lt.Meta:case Lt.Load:case Lt.DomContentLoaded:return!1;case Lt.Plugin:return e;case Lt.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case Lt.IncrementalSnapshot:switch(e.data.source){case Dt.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(e.node,i)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.Drag:case Dt.TouchMove:case Dt.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case Dt.ViewportResize:return!1;case Dt.MediaInteraction:case Dt.MouseInteraction:case Dt.Scroll:case Dt.CanvasMutation:case Dt.Input:return this.replaceIds(e.data,t,["id"]),e;case Dt.StyleSheetRule:case Dt.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case Dt.Font:return e;case Dt.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case Dt.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(i=e.data.styles)||i.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,i,r){for(var n of r)(Array.isArray(e[n])||"number"==typeof e[n])&&(Array.isArray(e[n])?e[n]=t.getIds(i,e[n]):e[n]=t.getId(i,e[n]));return e}replaceIds(t,e,i){return this.replace(this.crossOriginIframeMirror,t,e,i)}replaceStyleIds(t,e,i){return this.replace(this.crossOriginIframeStyleMirror,t,e,i)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===h.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}}class ve{constructor(t){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(I(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var r=te(i({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>r.disconnect())),this.restoreHandlers.push(ie(i({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(vt.host(t))),this.restoreHandlers.push(ae({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var i=this;this.restoreHandlers.push(bt(t.prototype,"attachShadow",(function(t){return function(r){var n=t.call(this,r),s=vt.shadowRoot(this);return s&&Pt(this)&&i.addShadowRoot(s,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ge=0;ge<64;ge++)pe[fe.charCodeAt(ge)]=ge;var me=new Map;var ye=(t,e,i)=>{if(t&&(we(t,e)||"object"==typeof t)){var r=function(t,e){var i=me.get(t);return i||(i=new Map,me.set(t,i)),i.has(e)||i.set(e,[]),i.get(e)}(i,t.constructor.name),n=r.indexOf(t);return-1===n&&(n=r.length,r.push(t)),n}};function be(t,e,i){if(t instanceof Array)return t.map((t=>be(t,e,i)));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,i=new Uint8Array(t),r=i.length,n="";for(e=0;e<r;e+=3)n+=fe[i[e]>>2],n+=fe[(3&i[e])<<4|i[e+1]>>4],n+=fe[(15&i[e+1])<<2|i[e+2]>>6],n+=fe[63&i[e+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[be(t.buffer,e,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var r=t.constructor.name,{src:n}=t;return{rr_type:r,src:n}}if(t instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:t.toDataURL()}}return t instanceof ImageData?{rr_type:t.constructor.name,args:[be(t.data,e,i),t.width,t.height]}:we(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ye(t,e,i)}:t}var _e=(t,e,i)=>t.map((t=>be(t,e,i))),we=(t,e)=>{var i=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(i.find((i=>t instanceof e[i])))};function Ie(t,e,i,r){var n=[];try{var s=bt(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];if(!kt(this,e,i,!0)){var l=function(t){return"experimental-webgl"===t?"webgl":t}(n);if("__context"in this||(this.__context=l),r&&["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 t.apply(this,[n,...o])}}));n.push(s)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach((t=>t()))}}function Ce(t,e,i,r,n,s){var o=[],a=Object.getOwnPropertyNames(t),l=function(a){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return 0;try{if("function"!=typeof t[a])return 0;var l=bt(t,a,(function(t){return function(){for(var o=arguments.length,l=new Array(o),u=0;u<o;u++)l[u]=arguments[u];var h=t.apply(this,l);if(ye(h,s,this),"tagName"in this.canvas&&!kt(this.canvas,r,n,!0)){var c=_e(l,s,this),d={type:e,property:a,args:c};i(this.canvas,d)}return h}}));o.push(l)}catch(r){var u=yt(t,a,{set(t){i(this.canvas,{type:e,property:a,args:[t],setter:!0})}});o.push(u)}};for(var u of a)l(u);return o}var Se,ke,xe,Ae,Te="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ee="undefined"!=typeof window&&window.Blob&&new Blob([(Se=Te,Uint8Array.from(atob(Se),(t=>t.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});function Me(t){var e;try{if(!(e=Ee&&(window.URL||window.webkitURL).createObjectURL(Ee)))throw"";var i=new Worker(e,{name:null==t?void 0:t.name});return i.addEventListener("error",(()=>{(window.URL||window.webkitURL).revokeObjectURL(e)})),i}catch(e){return new Worker("data:text/javascript;base64,"+Te,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Ne{constructor(t){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",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var{sampling:e="all",win:i,blockClass:r,blockSelector:n,recordCanvas:s,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(i,r,n),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,i,r,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(t,i,r,n,s){var o=this,a=Ie(i,r,n,!0),l=new Map,u=new Me;u.onmessage=t=>{var{id:e}=t.data;if(l.set(e,!1),"base64"in t.data){var{base64:i,type:r,width:n,height:s}=t.data;this.mutationCb({id:e,type:$t["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i}],type:r}]},0,0]}]})}};var h,c=1e3/t,d=0,v=t=>{var a,f;d&&t-d<c?h=requestAnimationFrame(v):(d=t,(a=[],f=t=>{t.querySelectorAll("canvas").forEach((t=>{kt(t,r,n,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&f(t.shadowRoot)}))},f(i.document),a).forEach(function(){var t=e((function*(t){var e,i=o.mirror.getId(t);if(!l.get(i)&&0!==t.width&&0!==t.height){if(l.set(i,!0),["webgl","webgl2"].includes(t.__context)){var r=t.getContext(t.__context);!1===(null==(e=null==r?void 0:r.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}var n=t.clientWidth||t.width,a=t.clientHeight||t.height,h=yield createImageBitmap(t,{resizeWidth:n,resizeHeight:a});u.postMessage({id:i,bitmap:h,width:n,height:a,dataURLOptions:s.dataURLOptions},[h])}}));return function(e){return t.apply(this,arguments)}}()),h=requestAnimationFrame(v))};h=requestAnimationFrame(v),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}initCanvasMutationObserver(t,e,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=Ie(t,e,i,!1),n=function(t,e,i,r){var n=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(s){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[s])return 1;var o=bt(e.CanvasRenderingContext2D.prototype,s,(function(n){return function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return kt(this.canvas,i,r,!0)||setTimeout((()=>{var i=_e(a,e,this);t(this.canvas,{type:$t["2D"],property:s,args:i})}),0),n.apply(this,a)}}));n.push(o)}catch(i){var a=yt(e.CanvasRenderingContext2D.prototype,s,{set(e){t(this.canvas,{type:$t["2D"],property:s,args:[e],setter:!0})}});n.push(a)}};for(var a of s)o(a);return()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i),s=function(t,e,i,r){var n=[];return n.push(...Ce(e.WebGLRenderingContext.prototype,$t.WebGL,t,i,r,e)),void 0!==e.WebGL2RenderingContext&&n.push(...Ce(e.WebGL2RenderingContext.prototype,$t.WebGL2,t,i,r,e)),()=>{n.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i);this.resetObservers=()=>{r(),n(),s()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var i=this.pendingCanvasMutations.get(t);if(i&&-1!==e){var n=i.map((t=>r(t,s))),{type:o}=i[0];this.mutationCb({id:e,type:o,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Re{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Rt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var i=this;if(0!==t.length){var r={id:e,styleIds:[]},n=[],s=function(t){var e;i.styleMirror.has(t)?e=i.styleMirror.getId(t):(e=i.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,i)=>({rule:S(e,t.href),index:i})))})),r.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Fe{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var i=this.nodeMap.get(t);return i&&Array.from(i).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Oe=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Pe=document.createElement("iframe");document.body.appendChild(Pe),Array.from=(null==(n=Pe.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Pe)}}catch(t){console.debug("Unable to override Array.from",t)}var Le,De,Be=new x;function Ze(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:r,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:_={},mousemoveWait:w,recordDOM:I=!0,recordCanvas:C=!1,recordCrossOriginIframes:S=!1,recordAfter:k=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:M,keepIframeSrcFn:N=(()=>!1),ignoreCSSAttributes:R=new Set([]),errorHandler:F}=t;jt=F;var O=!S||window.parent===window,P=!1;if(!O)try{window.parent.document&&(P=!1)}catch(t){P=!0}if(O&&!e)throw new Error("emit function is required");if(!O&&!P)return()=>{};void 0!==w&&void 0===b.mousemove&&(b.mousemove=w),Be.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(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();var Z=0,q=t=>{for(var e of M||[])e.eventProcessor&&(t=e.eventProcessor(t));return y&&!P&&(t=y(t)),t};ke=(t,i)=>{var s,o=t;if(o.timestamp=_t(),!(null==(s=Kt[0])?void 0:s.isFrozen())||o.type===Lt.FullSnapshot||o.type===Lt.IncrementalSnapshot&&o.data.source===Dt.Mutation||Kt.forEach((t=>t.unfreeze())),O)null==e||e(q(o),i);else if(P){var a={type:"rrweb",event:q(o),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(o.type===Lt.FullSnapshot)L=o,Z=0;else if(o.type===Lt.IncrementalSnapshot){if(o.data.source===Dt.Mutation&&o.data.isAttachIframe)return;Z++;var l=n&&Z>=n,u=r&&o.timestamp-L.timestamp>r;(l||u)&&xe(!0)}};var H=t=>{ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.Mutation},t)})},V=t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.Scroll},t)}),j=t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.CanvasMutation},t)}),Y=new Re({mutationCb:H,adoptedStyleSheetCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.AdoptedStyleSheet},t)})}),G=new de({mirror:Be,mutationCb:H,stylesheetManager:Y,recordCrossOriginIframes:S,wrappedEmit:ke});for(var z of M||[])z.getMirror&&z.getMirror({nodeMirror:Be,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});var W=new Fe;Ae=new Ne({recordCanvas:C,mutationCb:j,win:window,blockClass:s,blockSelector:o,mirror:Be,sampling:b.canvas,dataURLOptions:_});var U=new ve({mutationCb:H,scrollCb:V,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskInputOptions:D,dataURLOptions:_,maskTextFn:g,maskInputFn:p,recordCanvas:C,inlineImages:E,sampling:b,slimDOMOptions:B,iframeManager:G,stylesheetManager:Y,canvasManager:Ae,keepIframeSrcFn:N,processedNodeManager:W},mirror:Be});xe=function(t){if(void 0===t&&(t=!1),I){ke({type:Lt.Meta,data:{href:window.location.href,width:Ct(),height:It()}},t),Y.reset(),U.init(),Kt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:i=new x,blockClass:r="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:_,keepIframeSrcFn:w=(()=>!1)}=e||{};return it(t,{doc:t,mirror:i,blockClass:r,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:_,keepIframeSrcFn:w,newlyAddedElement:!1})}(document,{mirror:Be,blockClass:s,blockSelector:o,maskTextClass:u,maskTextSelector:h,inlineStylesheet:c,maskAllInputs:D,maskTextFn:g,maskInputFn:p,slimDOM:B,dataURLOptions:_,recordCanvas:C,inlineImages:E,onSerialize:t=>{Et(t,Be)&&G.addIframe(t),Mt(t,Be)&&Y.trackLinkElement(t),Nt(t)&&U.addShadowRoot(vt.shadowRoot(t),document)},onIframeLoad:(t,e)=>{G.attachIframe(t,e),U.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{Y.attachLinkElement(t,e)},keepIframeSrcFn:N});if(!e)return console.warn("Failed to snapshot the document");ke({type:Lt.FullSnapshot,data:{node:e,initialOffset:wt(window)}},t),Kt.forEach((t=>t.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,Be.getId(document))}};try{var X=[],J=t=>{var e;return Jt(le)({mutationCb:H,mousemoveCb:(t,e)=>ke({type:Lt.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.MouseInteraction},t)}),scrollCb:V,viewportResizeCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.ViewportResize},t)}),inputCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.Input},t)}),mediaInteractionCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.MediaInteraction},t)}),styleSheetRuleCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.StyleSheetRule},t)}),styleDeclarationCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.StyleDeclaration},t)}),canvasMutationCb:j,fontCb:t=>ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.Font},t)}),selectionCb:t=>{ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.Selection},t)})},customElementCb:t=>{ke({type:Lt.IncrementalSnapshot,data:i({source:Dt.CustomElement},t)})},blockClass:s,ignoreClass:a,ignoreSelector:l,maskTextClass:u,maskTextSelector:h,maskInputOptions:D,inlineStylesheet:c,sampling:b,recordDOM:I,recordCanvas:C,inlineImages:E,userTriggeredOnInput:A,collectFonts:T,doc:t,maskInputFn:p,maskTextFn:g,keepIframeSrcFn:N,blockSelector:o,slimDOMOptions:B,dataURLOptions:_,mirror:Be,iframeManager:G,stylesheetManager:Y,shadowDomManager:U,processedNodeManager:W,canvasManager:Ae,ignoreCSSAttributes:R,plugins:(null==(e=null==M?void 0:M.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ke({type:Lt.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},m)};G.addLoadListener((t=>{try{X.push(J(t.contentDocument))}catch(t){console.warn(t)}}));var K=()=>{xe(),X.push(J(document)),Oe=!0};return"interactive"===document.readyState||"complete"===document.readyState?K():(X.push(ft("DOMContentLoaded",(()=>{ke({type:Lt.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&K()}))),X.push(ft("load",(()=>{ke({type:Lt.Load,data:{}}),"load"===k&&K()}),window))),()=>{X.forEach((t=>t())),W.destroy(),Oe=!1,jt=void 0}}catch(t){console.warn(t)}}Ze.addCustomEvent=(t,e)=>{if(!Oe)throw new Error("please add custom event after start recording");ke({type:Lt.Custom,data:{tag:t,payload:e}})},Ze.freezePage=()=>{Kt.forEach((t=>t.freeze()))},Ze.takeFullSnapshot=t=>{if(!Oe)throw new Error("please take full snapshot after start recording");xe(t)},Ze.mirror=Be,(De=Le||(Le={}))[De.NotStarted=0]="NotStarted",De[De.Running=1]="Running",De[De.Stopped=2]="Stopped";var $e,qe=Object.defineProperty,He=(t,e,i)=>((t,e,i)=>e in t?qe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Ve=Object.defineProperty,je=(t,e,i)=>((t,e,i)=>e in t?Ve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),Ye=Object.defineProperty,Ge=(t,e,i)=>((t,e,i)=>e in t?Ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),ze={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},We={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ue={};function Xe(t){if(Ue[t])return Ue[t];var e=globalThis[t],i=e.prototype,r=t in ze?ze[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in We?We[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return Ue[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?Ue[t]=u:i}catch(t){return i}}var Je={};function Ke(t,e,i){var r,n=t+"."+String(i);if(Je[n])return Je[n].call(e);var s=Xe(t),o=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return o?(Je[n]=o,o.call(e)):e[i]}var Qe={};function ti(t,e,i){var r=t+"."+String(i);if(Qe[r])return Qe[r].bind(e);var n=Xe(t)[i];return"function"!=typeof n?e[i]:(Qe[r]=n,n.bind(e))}var ei={childNodes:function(t){return Ke("Node",t,"childNodes")},parentNode:function(t){return Ke("Node",t,"parentNode")},parentElement:function(t){return Ke("Node",t,"parentElement")},textContent:function(t){return Ke("Node",t,"textContent")},contains:function(t,e){return ti("Node",t,"contains")(e)},getRootNode:function(t){return ti("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?Ke("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?Ke("Element",t,"shadowRoot"):null},querySelector:function(t,e){return Ke("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return Ke("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return Xe("MutationObserver").constructor}};class ii{constructor(){Ge(this,"idNodeMap",new Map),Ge(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var i=null==(e=this.getMeta(t))?void 0:e.id;return null!=i?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t)))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){var i=e.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,e)}replace(t,e){var i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ri(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&ri(ei.parentNode(t),e,i);for(var r=t.classList.length;r--;){var n=t.classList[r];if(e.test(n))return!0}return!!i&&ri(ei.parentNode(t),e,i)}class ni{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 t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof ni))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(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var si={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},oi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ai={};function li(t){if(ai[t])return ai[t];var e=globalThis[t],i=e.prototype,r=t in si?si[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in oi?oi[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return ai[t]=e.prototype,e.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var l=a.contentWindow;if(!l)return e.prototype;var u=l[t].prototype;return document.body.removeChild(a),u?ai[t]=u:i}catch(t){return i}}var ui={};function hi(t,e,i){var r,n=t+"."+String(i);if(ui[n])return ui[n].call(e);var s=li(t),o=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return o?(ui[n]=o,o.call(e)):e[i]}var ci={};function di(t,e,i){var r=t+"."+String(i);if(ci[r])return ci[r].bind(e);var n=li(t)[i];return"function"!=typeof n?e[i]:(ci[r]=n,n.bind(e))}var vi={childNodes:function(t){return hi("Node",t,"childNodes")},parentNode:function(t){return hi("Node",t,"parentNode")},parentElement:function(t){return hi("Node",t,"parentElement")},textContent:function(t){return hi("Node",t,"textContent")},contains:function(t,e){return di("Node",t,"contains")(e)},getRootNode:function(t){return di("Node",t,"getRootNode")()},host:function(t){return t&&"host"in t?hi("ShadowRoot",t,"host"):null},styleSheets:function(t){return t.styleSheets},shadowRoot:function(t){return t&&"shadowRoot"in t?hi("Element",t,"shadowRoot"):null},querySelector:function(t,e){return hi("Element",t,"querySelector")(e)},querySelectorAll:function(t,e){return hi("Element",t,"querySelectorAll")(e)},mutationObserver:function(){return li("MutationObserver").constructor}};var fi="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.",pi={map:{},getId:()=>(console.error(fi),-1),getNode:()=>(console.error(fi),null),removeNodeFromMap(){console.error(fi)},has:()=>(console.error(fi),!1),reset(){console.error(fi)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pi=new Proxy(pi,{get:(t,e,i)=>("map"===e&&console.error(fi),Reflect.get(t,e,i))}));var gi=Date.now;function mi(t){return t?t.nodeType===t.ELEMENT_NODE?t:vi.parentElement(t):null}/[1-9][0-9]{12}/.test(Date.now().toString())||(gi=()=>(new Date).getTime());function yi(t){var e,i=null;return"getRootNode"in t&&(null==(e=vi.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&vi.host(vi.getRootNode(t))&&(i=vi.host(vi.getRootNode(t))),i}function bi(t){for(var e,i=t;e=yi(i);)i=e;return i}function _i(t){var e=t.ownerDocument;if(!e)return!1;var i=bi(t);return vi.contains(e,i)}for(var wi=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){je(this,"id",1),je(this,"styleIDMap",new WeakMap),je(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},get _mirror(){return pi},closestElementOfNode:mi,getBaseDimension:function t(e,i){var r,n,s=null==(n=null==(r=e.ownerDocument)?void 0:r.defaultView)?void 0:n.frameElement;if(!s||s===i)return{x:0,y:0,relativeScale:1,absoluteScale:1};var o=s.getBoundingClientRect(),a=t(s,i),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 t(e,i){var r=e[i[0]];return 1===i.length?r:t(r.cssRules[i[1]].cssRules,i.slice(2))},getPositionsAndIndex:function(t){var e=[...t],i=e.pop();return{positions:e,index:i}},getRootShadowHost:bi,getShadowHost:yi,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=vi.parentElement(s.body))?void 0:e.scrollLeft)||(null==(i=null==s?void 0:s.body)?void 0:i.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(r=vi.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(t){return!!t&&(t instanceof ni&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(vi.shadowRoot(t)))},hookSetter:function t(e,i,r,n,s){void 0===s&&(s=window);var o=s.Object.getOwnPropertyDescriptor(e,i);return s.Object.defineProperty(e,i,n?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),o&&o.set&&o.set.call(this,t)}}),()=>t(e,i,o||{},!0)},inDom:function(t){var e=t.ownerDocument;return!!e&&(vi.contains(e,t)||_i(t))},isAncestorRemoved:function t(e,i){if(n=(r=e)&&"host"in r&&"mode"in r&&ei.host(r)||null,Boolean(n&&"shadowRoot"in n&&ei.shadowRoot(n)===r))return!1;var r,n,s=i.getId(e);if(!i.has(s))return!0;var o=vi.parentNode(e);return(!o||o.nodeType!==e.DOCUMENT_NODE)&&(!o||t(o,i))},isBlocked:function(t,e,i,r){if(!t)return!1;var n=mi(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if(ri(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1},isIgnored:function(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||-2===e.getId(t)},isSerialized:function(t,e){return-1!==e.getId(t)},isSerializedIframe:function(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))},isSerializedStylesheet:function(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))},iterateResolveTree:function t(e,i){i(e.value);for(var r=e.children.length-1;r>=0;r--)t(e.children[r],i)},legacy_isTouchEvent:function(t){return Boolean(t.changedTouches)},get nowTimestamp(){return gi},on:function(t,e,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>i.removeEventListener(t,e,r)},patch:function(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n=i(r);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:r}})),t[e]=n,()=>{t[e]=r}}catch(t){return()=>{}}},polyfill:function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)},queueToResolveTrees:function(t){var e={},i=(t,i)=>{var r={value:t,parent:i,children:[]};return e[t.node.id]=r,r},r=[];for(var n of t){var{nextId:s,parentId:o}=n;if(s&&s in e){var a=e[s];if(a.parent){var l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,i(n,a.parent))}else{var u=r.indexOf(a);r.splice(u,0,i(n,null))}}else if(o in e){var h=e[o];h.children.push(i(n,h))}else r.push(i(n,null))}return r},shadowHostInDom:_i,throttle:function(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;u<=0||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,o)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,o)}),u))}},uniqueTextMutations:function(t){for(var e=new Set,i=[],r=t.length;r--;){var n=t[r];e.has(n.id)||(i.push(n),e.add(n.id))}return i}},Symbol.toStringTag,{value:"Module"})),Ii="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ci="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Si=0;Si<64;Si++)Ci[Ii.charCodeAt(Si)]=Si;var ki;"undefined"!=typeof window&&window.Blob&&new Blob([(t=>Uint8Array.from(atob(t),(t=>t.charCodeAt(0))))("KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=")],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],(t=>2*t))[0]){var xi=document.createElement("iframe");document.body.appendChild(xi),Array.from=(null==($e=xi.contentWindow)?void 0:$e.Array.from)||Array.from,document.body.removeChild(xi)}}catch(t){console.debug("Unable to override Array.from",t)}new ii,function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"}(ki||(ki={}));class Ai{constructor(t){He(this,"fileName"),He(this,"functionName"),He(this,"lineNumber"),He(this,"columnNumber"),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}}var Ti=/(^|@)\S+:\d+/,Ei=/^\s*at .*(\S+:\d+|\(native\))/m,Mi=/^(eval@)?(\[native code])?$/,Ni={parse:function(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Ei)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):(console.warn("[console-record-plugin]: Failed to parse error object:",t),[]):[]},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ei)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),i=e.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(e=i?e.replace(i[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(i?i[1]:r.pop()),s=r.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Ai({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter((function(t){return!t.match(Mi)}),this).map((function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ai({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ai({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,i=t.message.split("\n"),r=[],n=2,s=i.length;n<s;n+=2){var o=e.exec(i[n]);o&&r.push(new Ai({fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera10:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=t.stacktrace.split("\n"),r=[],n=0,s=i.length;n<s;n+=2){var o=e.exec(i[n]);o&&r.push(new Ai({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11:function(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ti)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),i=this.extractLocation(e.pop()),r=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ai({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)}};function Ri(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var i=t.localName;if(!i)break;i=i.toLowerCase();var r=t.parentElement,n=[];if(r.children&&r.children.length>0)for(var s=0;s<r.children.length;s++){var o=r.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===i&&n.push(o)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function Fi(t){return"[object Object]"===Object.prototype.toString.call(t)}function Oi(t,e){if(0===e)return!0;var i=Object.keys(t);for(var r of i)if(Fi(t[r])&&Oi(t[r],e-1))return!0;return!1}function Pi(t,e){var i={numOfKeysLimit:50,depthOfLimit:4};Object.assign(i,e);var r=[],n=[];return JSON.stringify(t,(function(t,e){if(r.length>0){var s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?n.splice(s,1/0,t):n.push(t),~r.indexOf(e)&&(e=r[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(e)).join(".")+"]")}else r.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(function(t){if(Fi(t)&&Object.keys(t).length>i.numOfKeysLimit)return!0;if("function"==typeof t)return!0;if(Fi(t)&&Oi(t,i.depthOfLimit))return!0;return!1}(e))return function(t){var e=t.toString();i.stringLengthLimit&&e.length>i.stringLengthLimit&&(e=e.slice(0,i.stringLengthLimit)+"...");return e}(e);if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var a in e){var l=e[a];Array.isArray(l)?o[a]=Ri(l.length?l[0]:null):o[a]=l}return o}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var Li={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 Di(t,e,i){var r,n=i?Object.assign({},Li,i):Li,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var o=0,a=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message,r=e.error,s=Ni.parse(r).map((t=>t.toString())),o=[Pi(i,n.stringifyOptions)];t({level:"error",trace:s,payload:o})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var i,r;e.reason instanceof Error?r=[Pi("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[Pi("Uncaught (in promise)",n.stringifyOptions),Pi(e.reason,n.stringifyOptions)]);var s=Ni.parse(i).map((t=>t.toString()));t({level:"error",trace:s,payload:r})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)l.push(d(r,c));return()=>{l.forEach((t=>t()))};function d(e,i){var r=this;return e[i]?wi.patch(e,i,(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];if(e.apply(r,l),!("assert"===i&&l[0]||a)){a=!0;try{var h=Ni.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===i?l.slice(1):l).map((t=>Pi(t,n.stringifyOptions)));++o<n.lengthThreshold?t({level:i,trace:h,payload:c}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Pi("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{a=!1}}})):()=>{}}}var Bi=t=>({name:"rrweb/console@1",observer:Di,options:t}),Zi=["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"],$i=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return Zi.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))},qi=["$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 Hi(t,e){return-1!==t.indexOf(e)}var Vi=function(t){return t.trim()},ji=function(t){return t.replace(/^\$/,"")};var Yi=Array.isArray,Gi=Object.prototype,zi=Gi.hasOwnProperty,Wi=Gi.toString,Ui=Yi||function(t){return"[object Array]"===Wi.call(t)},Xi=t=>"function"==typeof t,Ji=t=>Xi(t)&&-1!==t.toString().indexOf("[native code]"),Ki=t=>t===Object(t)&&!Ui(t),Qi=t=>{if(Ki(t)){for(var e in t)if(zi.call(t,e))return!1;return!0}return!1},tr=t=>void 0===t,er=t=>"[object String]"==Wi.call(t),ir=t=>er(t)&&0===t.trim().length,rr=t=>null===t,nr=t=>tr(t)||rr(t),sr=t=>"[object Number]"==Wi.call(t),or=t=>"[object Boolean]"===Wi.call(t),ar=t=>t instanceof FormData,lr=t=>Hi(qi,t);function ur(t){return null===t||"object"!=typeof t}function hr(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function cr(t){return!tr(Event)&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var dr=[!0,"true",1,"1","yes"],vr=t=>Hi(dr,t),fr=[!1,"false",0,"0","no"];function pr(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),sr(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):t<e?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+n),pr(n||i,e,i,r))}class gr{constructor(t){this.o={},this.h=t.h,this.m=pr(t.bucketSize,0,100,t.I),this.C=pr(t.refillRate,0,this.m,t.I),this.S=pr(t.refillInterval,0,864e5,t.I)}k(t,e){var i=e-t.lastAccess,r=Math.floor(i/this.S);if(r>0){var n=r*this.C;t.tokens=Math.min(t.tokens+n,this.m),t.lastAccess=t.lastAccess+r*this.S}}consumeRateLimit(t){var e,i=Date.now(),r=String(t),n=this.o[r];return n?this.k(n,i):(n={tokens:this.m,lastAccess:i},this.o[r]=n),0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.h)||e.call(this,t)),0===n.tokens)}stop(){this.o={}}}var mr="Mobile",yr="iOS",br="Android",_r="Tablet",wr=br+" "+_r,Ir="iPad",Cr="Apple",Sr=Cr+" Watch",kr="Safari",xr="BlackBerry",Ar="Samsung",Tr=Ar+"Browser",Er=Ar+" Internet",Mr="Chrome",Nr=Mr+" OS",Rr=Mr+" "+yr,Fr="Internet Explorer",Or=Fr+" "+mr,Pr="Opera",Lr=Pr+" Mini",Dr="Edge",Br="Microsoft "+Dr,Zr="Firefox",$r=Zr+" "+yr,qr="Nintendo",Hr="PlayStation",Vr="Xbox",jr=br+" "+mr,Yr=mr+" "+kr,Gr="Windows",zr=Gr+" Phone",Wr="Nokia",Ur="Ouya",Xr="Generic",Jr=Xr+" "+mr.toLowerCase(),Kr=Xr+" "+_r.toLowerCase(),Qr="Konqueror",tn="(\\d+(\\.\\d+)?)",en=new RegExp("Version/"+tn),rn=new RegExp(Vr,"i"),nn=new RegExp(Hr+" \\w+","i"),sn=new RegExp(qr+" \\w+","i"),on=new RegExp(xr+"|PlayBook|BB10","i"),an={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"};var ln,un,hn,cn=(t,e)=>e&&Hi(e,Cr)||function(t){return Hi(t,kr)&&!Hi(t,Mr)&&!Hi(t,br)}(t),dn=function(t,e){return e=e||"",Hi(t," OPR/")&&Hi(t,"Mini")?Lr:Hi(t," OPR/")?Pr:on.test(t)?xr:Hi(t,"IE"+mr)||Hi(t,"WPDesktop")?Or:Hi(t,Tr)?Er:Hi(t,Dr)||Hi(t,"Edg/")?Br:Hi(t,"FBIOS")?"Facebook "+mr:Hi(t,"UCWEB")||Hi(t,"UCBrowser")?"UC Browser":Hi(t,"CriOS")?Rr:Hi(t,"CrMo")||Hi(t,Mr)?Mr:Hi(t,br)&&Hi(t,kr)?jr:Hi(t,"FxiOS")?$r:Hi(t.toLowerCase(),Qr.toLowerCase())?Qr:cn(t,e)?Hi(t,mr)?Yr:kr:Hi(t,Zr)?Zr:Hi(t,"MSIE")||Hi(t,"Trident/")?Fr:Hi(t,"Gecko")?Zr:""},vn={[Or]:[new RegExp("rv:"+tn)],[Br]:[new RegExp(Dr+"?\\/"+tn)],[Mr]:[new RegExp("("+Mr+"|CrMo)\\/"+tn)],[Rr]:[new RegExp("CriOS\\/"+tn)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+tn)],[kr]:[en],[Yr]:[en],[Pr]:[new RegExp("(Opera|OPR)\\/"+tn)],[Zr]:[new RegExp(Zr+"\\/"+tn)],[$r]:[new RegExp("FxiOS\\/"+tn)],[Qr]:[new RegExp("Konqueror[:/]?"+tn,"i")],[xr]:[new RegExp(xr+" "+tn),en],[jr]:[new RegExp("android\\s"+tn,"i")],[Er]:[new RegExp(Tr+"\\/"+tn)],[Fr]:[new RegExp("(rv:|MSIE )"+tn)],Mozilla:[new RegExp("rv:"+tn)]},fn=function(t,e){var i=dn(t,e),r=vn[i];if(tr(r))return null;for(var n=0;n<r.length;n++){var s=r[n],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},pn=[[new RegExp(Vr+"; "+Vr+" (.*?)[);]","i"),t=>[Vr,t&&t[1]||""]],[new RegExp(qr,"i"),[qr,""]],[new RegExp(Hr,"i"),[Hr,""]],[on,[xr,""]],[new RegExp(Gr,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[zr,""];if(new RegExp(mr).test(e)&&!/IEMobile\b/.test(e))return[Gr+" "+mr,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=i[1],n=an[r]||"";return/arm/i.test(e)&&(n="RT"),[Gr,n]}return[Gr,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[yr,e.join(".")]}return[yr,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=tr(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+br+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+br+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[br,e.join(".")]}return[br,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var i=[t[1],t[2],t[3]||"0"];e[1]=i.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Nr,""]],[/Linux|debian/i,["Linux",""]]],gn=function(t){return sn.test(t)?qr:nn.test(t)?Hr:rn.test(t)?Vr:new RegExp(Ur,"i").test(t)?Ur:new RegExp("("+zr+"|WPDesktop)","i").test(t)?zr:/iPad/.test(t)?Ir:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Sr:on.test(t)?xr:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Wr,"i").test(t)?Wr:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(mr).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?br:wr:new RegExp("(pda|"+mr+")","i").test(t)?Jr:new RegExp(_r,"i").test(t)&&!new RegExp(_r+" pc","i").test(t)?Kr:""},mn=function(t){var e=gn(t);return e===Ir||e===wr||"Kobo"===e||"Kindle Fire"===e||e===Kr?_r:e===qr||e===Vr||e===Hr||e===Ur?"Console":e===Sr?"Wearable":e?mr:"Desktop"},yn=t=>t instanceof Error;function bn(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return hn&&i.length===un||(un=i.length,hn=i.reduce(((i,r)=>{ln||(ln={});var n=ln[r];if(n)i[n[0]]=n[1];else for(var s=t(r),o=s.length-1;o>=0;o--){var a=s[o],l=null==a?void 0:a.filename,u=e[r];if(l&&u){i[l]=u,ln[r]=[l,u];break}}return i}),{})),hn}}class _n{constructor(t,e,i){void 0===i&&(i=[]),this.coercers=t,this.stackParser=e,this.modifiers=i}buildFromUnknown(t,e){void 0===e&&(e={});var i=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,e,0).apply(t),n=this.buildParsingContext(),s=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(s,i),$exception_level:"error"}}modifyFrames(t){var i=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Ui(e.stacktrace.frames)&&(e.stacktrace.frames=yield i.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var r,n;return null!=t.cause&&(r=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?1:0),e.chunkIdMap)),i({},t,{cause:r,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var i of this.coercers)if(i.match(t))return i.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var i=this;return e((function*(){var e=t;for(var r of i.modifiers)e=yield r(e);return e}))()}convertToExceptionList(t,e){var r,n,s,o={type:t.type,value:t.value,mechanism:{type:null!==(r=e.type)&&void 0!==r?r:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return null!=t.cause&&a.push(...this.convertToExceptionList(t.cause,i({},e,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:bn(this.stackParser)}}buildCoercingContext(t,e,r){void 0===r&&(r=0);var n=(i,r)=>{if(r<=4){var n=this.buildCoercingContext(t,e,r);return this.applyCoercers(i,n)}};return i({},e,{syntheticException:0==r?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,r),next:t=>n(t,r+1)})}}var wn="?";function In(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?wn:i,in_app:!0};return tr(r)||(s.lineno=r),tr(n)||(s.colno=n),s}var Cn=(t,e)=>{var i=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return i||r?[-1!==t.indexOf("@")?t.split("@")[0]:wn,i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Sn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,kn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,xn=/\((\S*)(?::(\d+))(?::(\d+))\)/,An=(t,e)=>{var i=Sn.exec(t);if(i){var[,r,n,s]=i;return In(e,r,wn,+n,+s)}var o=kn.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=xn.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=Cn(o[1]||wn,o[2]);return In(e,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Tn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,En=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Mn=(t,e)=>{var i=Tn.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=En.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var n=i[3],s=i[1]||wn;return[s,n]=Cn(s,n),In(e,n,s,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},Nn=/\(error: (.*)\)/,Rn=50;function Fn(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],o=e.split("\n"),a=n;a<o.length;a++){var l=o[a];if(!(l.length>1024)){var u=Nn.test(l)?l.replace(Nn,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of r){var c=h(u,t);if(c){s.push(c);break}}if(s.length>=Rn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Rn).map((t=>{return i({},t,{filename:t.filename||(r=e,r[r.length-1]||{}).filename,function:t.function||wn});var r}))}(s)}}class On{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=er(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:i?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return hr(t,"DOMException")}isDOMError(t){return hr(t,"DOMError")}}class Pn{match(t){return(t=>t instanceof Error)(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var i=t.message;return i.error&&"string"==typeof i.error.message?String(i.error.message):String(i)}getStack(t){return t.stacktrace||t.stack||void 0}}class Ln{constructor(){}match(t){return hr(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var i,r=e.apply(t.error);return r||{type:"ErrorEvent",value:t.message,stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}var Dn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Bn{match(t){return"string"==typeof t}coerce(t,e){var i,[r,n]=this.getInfos(t);return{type:null!=r?r:"Error",value:null!=n?n:t,stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(t){var e="Error",i=t,r=t.match(Dn);return r&&(e=r[1],i=r[2]),[e,i]}}var Zn=["fatal","error","warning","log","info","debug"];function $n(t,e){void 0===e&&(e=40);var i=Object.keys(t);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var n=i.slice(0,r).join(", ");if(!(n.length>e))return r===i.length||n.length<=e?n:n.slice(0,e)+"..."}return""}class qn{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var i,r=this.getErrorPropertyFromObject(t);return r?e.apply(r):{type:this.getType(t),value:this.getValue(t),stack:null==(i=e.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return cr(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var i=this.getObjectClassName(t);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+$n(t)}isSeverityLevel(t){return er(t)&&!ir(t)&&Zn.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var i=t[e];if(yn(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class Hn{match(t){return cr(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+$n(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class Vn{match(t){return ur(t)}coerce(t,e){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class jn{match(t){return hr(t,"PromiseRejectionEvent")}coerce(t,e){var i,r=this.getUnhandledRejectionReason(t);return ur(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){if(ur(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var Yn="undefined"!=typeof window?window:void 0,Gn="undefined"!=typeof globalThis?globalThis:Yn;"undefined"==typeof self&&(Gn.self=Gn),"undefined"==typeof File&&(Gn.File=function(){});var zn=Array.prototype,Wn=zn.forEach,Un=zn.indexOf,Xn=null==Gn?void 0:Gn.navigator,Jn=null==Gn?void 0:Gn.document,Kn=null==Gn?void 0:Gn.location,Qn=null==Gn?void 0:Gn.fetch,ts=null!=Gn&&Gn.XMLHttpRequest&&"withCredentials"in new Gn.XMLHttpRequest?Gn.XMLHttpRequest:void 0,es=null==Gn?void 0:Gn.AbortController,is=null==Xn?void 0:Xn.userAgent,rs=null!=Yn?Yn:{},ns=()=>!!Yn.Zone,ss=t=>t instanceof Document,os={DEBUG:!1,LIB_VERSION:"1.315.1"},as=function(t,e){var{debugEnabled:i}=void 0===e?{}:e,r={A:function(e){if(Yn&&(os.DEBUG||rs.POSTHOG_DEBUG||i)&&!tr(Yn.console)&&Yn.console){for(var r=("__rrweb_original__"in Yn.console[e]?Yn.console[e].__rrweb_original__:Yn.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];r(t,...s)}},info:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];r.A("log",...e)},warn:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];r.A("warn",...e)},error:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];r.A("error",...e)},critical:function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning:t=>{r.error("You must initialize PostHog before calling "+t)},createLogger:(e,i)=>as(t+" "+e,i)};return r},ls=as("[PostHog.js]"),us=ls.createLogger,hs={};function cs(t,e,i){if(Ui(t))if(Wn&&t.forEach===Wn)t.forEach(e,i);else if("length"in t&&t.length===+t.length)for(var r=0,n=t.length;r<n;r++)if(r in t&&e.call(i,t[r],r)===hs)return}function ds(t,e,i){if(!nr(t)){if(Ui(t))return cs(t,e,i);if(ar(t)){for(var r of t.entries())if(e.call(i,r[1],r[0])===hs)return}else for(var n in t)if(zi.call(t,n)&&e.call(i,t[n],n)===hs)return}}var vs=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];return cs(i,(function(e){for(var i in e)void 0!==e[i]&&(t[i]=e[i])})),t},fs=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];return cs(i,(function(e){cs(e,(function(e){t.push(e)}))})),t};function ps(t){for(var e=Object.keys(t),i=e.length,r=new Array(i);i--;)r[i]=[e[i],t[e[i]]];return r}var gs=function(t){try{return t()}catch(t){return}},ms=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){ls.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ls.critical(t)}}},ys=function(t){var e={};return ds(t,(function(t,i){(er(t)&&t.length>0||sr(t))&&(e[i]=t)})),e};function bs(t,e){return i=t,r=t=>er(t)&&!rr(e)?t.slice(0,e):t,n=new Set,function t(e,i){return e!==Object(e)?r?r(e,i):e:n.has(e)?void 0:(n.add(e),Ui(e)?(s=[],cs(e,(e=>{s.push(t(e))}))):(s={},ds(e,((e,i)=>{n.has(e)||(s[i]=t(e,i))}))),s);var s}(i);var i,r,n}var _s=["herokuapp.com","vercel.app","netlify.app"];function ws(t){var e=null==t?void 0:t.hostname;if(!er(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of _s)if(i===r)return!1;return!0}function Is(t,e){for(var i=0;i<t.length;i++)if(e(t[i]))return t[i]}function Cs(t,e,i,r){var{capture:n=!1,passive:s=!0}=null!=r?r:{};null==t||t.addEventListener(e,i,{capture:n,passive:s})}var Ss=t=>{var e=null==Jn?void 0:Jn.createElement("a");return tr(e)?null:(e.href=t,e)},ks=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return ds(t,(function(t,e){tr(t)||tr(e)||"undefined"===e||(i=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(e),n[n.length]=r+"="+i)})),n.join(e)},xs=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;n<r.length;n++){var s=r[n].split("=");if(s[0]===e){i=s;break}}if(!Ui(i)||i.length<2)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){ls.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},As=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[0]||"",s=r[1],o=n.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),h=[],c=0;c<u.length;c++){var d=u[c].split("=");Ui(d)&&(e.includes(d[0])?h.push(d[0]+"="+i):h.push(u[c]))}var v=l;return null!=a&&(v+="?"+h.join("&")),null!=s&&(v+="#"+s),v},Ts=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null};function Es(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n=i(r);return Xi(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=r}}catch(t){return()=>{}}}function Ms(t,e){var i,r=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:r,isHostDenied:!1};if(null==(i=e.payloadHostDenyList)||!i.length||null==r||!r.trim().length)return n;for(var s of e.payloadHostDenyList)if(r.endsWith(s))return{hostname:r,isHostDenied:!0};return n}var Ns="$people_distinct_id",Rs="__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",Zs="$web_vitals_enabled_server_side",$s="$dead_clicks_enabled_server_side",qs="$product_tours_enabled_server_side",Hs="$web_vitals_allowed_metrics",Vs="$session_recording_remote_config",js="$sesid",Ys="$session_is_sampled",Gs="$enabled_feature_flags",zs="$early_access_features",Ws="$feature_flag_details",Us="$stored_person_properties",Xs="$stored_group_properties",Js="$surveys",Ks="$flag_call_reported",Qs="$user_state",to="$client_session_props",eo="$capture_rate_limit",io="$initial_campaign_params",ro="$initial_referrer_info",no="$initial_person_info",so="$epp",oo="__POSTHOG_TOOLBAR__",ao="$posthog_cookieless",lo=[Ns,Rs,"__cmpns",Fs,"$session_recording_enabled_server_side",Ps,js,Gs,Ds,Qs,zs,Ws,Xs,Us,Js,Ks,to,eo,io,ro,so,no,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function uo(t){return t instanceof Element&&(t.id===oo||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function ho(t){return!!t&&1===t.nodeType}function co(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function vo(t){return!!t&&3===t.nodeType}function fo(t){return!!t&&11===t.nodeType}function po(t){return t?Vi(t).split(/\s+/):[]}function go(t){var e=null==Yn?void 0:Yn.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function mo(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return po(e)}function yo(t){return nr(t)?null:Vi(t).split(/(\s+)/).filter((t=>Zo(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function bo(t){var e="";return No(t)&&!Ro(t)&&t.childNodes&&t.childNodes.length&&ds(t.childNodes,(function(t){var i;vo(t)&&t.textContent&&(e+=null!==(i=yo(t.textContent))&&void 0!==i?i:"")})),Vi(e)}function _o(t){return tr(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var wo=["a","button","form","input","select","textarea","label"];function Io(t,e){if(tr(e))return!0;var i,r=function(t){if(e.some((e=>t.matches(e))))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function Co(t){var e=t.parentNode;return!(!e||!ho(e))&&e}var So=["next","previous","prev",">","<"],ko=10;var xo=[".ph-no-rageclick",".ph-no-capture"];function Ao(t,e){if(!Yn||To(t))return!1;var i,r,n;or(e)?(i=!!e&&xo,r=void 0):(i=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:xo,r=null==e?void 0:e.content_ignorelist);if(!1===i)return!1;var{targetElementList:s}=Eo(t,!1);return!function(t,e){if(!1===t||tr(t))return!1;var i;if(!0===t)i=So;else{if(!Ui(t))return!1;if(t.length>ko)return ls.error("[PostHog] content_ignorelist array cannot exceed "+ko+" items. Use css_selector_ignorelist for more complex matching."),!1;i=t.map((t=>t.toLowerCase()))}return e.some((t=>{var{safeText:e,ariaLabel:r}=t;return i.some((t=>e.includes(t)||r.includes(t)))}))}(r,s.map((t=>{var e;return{safeText:bo(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Io(s,i)}var To=t=>!t||co(t,"html")||!ho(t),Eo=(t,e)=>{if(!Yn||To(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[t],n=t;n.parentNode&&!co(n,"body");)if(fo(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var s=Co(n);if(!s)break;if(e||wo.indexOf(s.tagName.toLowerCase())>-1)i=!0;else{var o=Yn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}r.push(s),n=s}return{parentIsUsefulElement:i,targetElementList:r}};function Mo(t,e,i,r,n){var s,o,a,l;if(void 0===i&&(i=void 0),!Yn||To(t))return!1;if(null!=(s=i)&&s.url_allowlist&&!go(i.url_allowlist))return!1;if(null!=(o=i)&&o.url_ignorelist&&go(i.url_ignorelist))return!1;if(null!=(a=i)&&a.dom_event_allowlist){var u=i.dom_event_allowlist;if(u&&!u.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Eo(t,r);if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(tr(i))return!0;var r,n=function(t){if(i.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(c,i))return!1;if(!Io(c,null==(l=i)?void 0:l.css_selector_allowlist))return!1;var d=Yn.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0;var v=t.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(n||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(e.type)>=0;default:return h?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(wo.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}function No(t){for(var e=t;e.parentNode&&!co(e,"body");e=e.parentNode){var i=mo(e);if(Hi(i,"ph-sensitive")||Hi(i,"ph-no-capture"))return!1}if(Hi(mo(t),"ph-include"))return!0;var r=t.type||"";if(er(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";if(er(n)){if(/^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,"")))return!1}return!0}function Ro(t){return!!(co(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||co(t,"select")||co(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Fo="(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})",Oo=new RegExp("^(?:"+Fo+")$"),Po=new RegExp(Fo),Lo="\\d{3}-?\\d{2}-?\\d{4}",Do=new RegExp("^("+Lo+")$"),Bo=new RegExp("("+Lo+")");function Zo(t,e){if(void 0===e&&(e=!0),nr(t))return!1;if(er(t)){if(t=Vi(t),(e?Oo:Po).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Do:Bo).test(t))return!1}return!0}function $o(t){var e=bo(t);return Zo(e=(e+" "+qo(t)).trim())?e:""}function qo(t){var e="";return t&&t.childNodes&&t.childNodes.length&&ds(t.childNodes,(function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=bo(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+qo(t)).trim())}catch(t){ls.error("[AutoCapture]",t)}})),e}function Ho(t){return function(t){var e=t.map((t=>{var e,r,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var o=i({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(r=t.nth_of_type)&&void 0!==r?r:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return ps(o).sort(((t,e)=>{var[i]=t,[r]=e;return i.localeCompare(r)})).forEach((t=>{var[e,i]=t;return a[Vo(e.toString())]=Vo(i.toString())})),n+=":",n+=ps(a).map((t=>{var[e,i]=t;return e+'="'+i+'"'})).join("")}));return e.join(";")}(function(t){return t.map((t=>{var e,i,r={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(i=t.attr__href)?void 0:i.slice(0,2048),attr_class:jo(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return ps(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,i]=t;return r.attributes[e]=i})),r}))}(t))}function Vo(t){return t.replace(/"|\\"/g,'\\"')}function jo(t){var e=t.attr__class;return e?Ui(e)?e:po(e):void 0}var Yo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Go=us("[Recorder]"),zo=t=>"navigation"===t.entryType,Wo=t=>"resource"===t.entryType;function Uo(t,e,i){if(i.recordInitialRequests){var r=e.performance.getEntries().filter((t=>zo(t)||Wo(t)&&i.initiatorTypes.includes(t.initiatorType)));t({requests:r.flatMap((t=>ia({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var r=e.getEntries().filter((t=>zo(t)||Wo(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:r.flatMap((t=>ia({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>i.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}function Xo(t,e){return!!e&&(or(e)||e[t])}function Jo(t){var{type:e,recordBody:i,headers:r,url:n}=t;function s(t){var e=Object.keys(r).find((t=>"content-type"===t.toLowerCase())),i=e&&r[e];return t.some((t=>null==i?void 0:i.includes(t)))}if(!i)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:e instanceof Request&&t(e.url)}catch(t){return!1}}(n))return!1;if(or(i))return!0;if(Ui(i))return s(i);var o=i[e];return or(o)?o:s(o)}function Ko(t,e,i,r,n,s){return Qo.apply(this,arguments)}function Qo(){return Qo=e((function*(t,e,i,r,n,s){if(void 0===s&&(s=0),s>10)return Go.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null;var o=function(t,e){for(var i=t.length-1;i>=0;i-=1)if(e(t[i]))return t[i]}(t.performance.getEntriesByName(i),(t=>Wo(t)&&t.initiatorType===e&&(tr(r)||t.startTime>=r)&&(tr(n)||t.startTime<=n)));return o||(yield new Promise((t=>setTimeout(t,50*s))),Ko(t,e,i,r,n,s+1))})),Qo.apply(this,arguments)}function ta(t){var{body:e,options:i,url:r}=t;if(nr(e))return null;var{hostname:n,isHostDenied:s}=Ms(r,i);if(s)return n+" is in deny list";if(er(e))return e;if(ss(e))return e.textContent;if(ar(e))return ks(e);if(Ki(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var ea=t=>!rr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ia(t){var{entry:e,method:r,status:n,networkRequest:s,isInitial:o,start:a,end:l,url:u,initiatorType:h}=t;a=e?e.startTime:a,l=e?e.responseEnd:l;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[i({},e?e.toJSON():{name:u},{startTime:tr(a)?void 0:Math.round(a),endTime:tr(l)?void 0:Math.round(l),timeOrigin:c,timestamp:d,method:r,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(ea(e))for(var f of e.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var ra=["video/","audio/"];function na(t){return new Promise(((e,i)=>{var r=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>i(t))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e("[SessionReplay] Failed to read body")}}))}function sa(){return sa=e((function*(t){var{r:e,options:i,url:r}=t,{hostname:n,isHostDenied:s}=Ms(r,i);return s?Promise.resolve(n+" is in deny list"):na(e)})),sa.apply(this,arguments)}function oa(){return oa=e((function*(t){var{r:e,options:i,url:r}=t,n=function(t){var e,{r:i,options:r,url:n}=t;if("chunked"===i.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=i.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=ra.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:l}=Ms(n,r);return l?a+" is in deny list":null}({r:e,options:i,url:r});return rr(n)?na(e):Promise.resolve(n)})),oa.apply(this,arguments)}function aa(t,i,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var n=Xo("request",r.recordHeaders),s=Xo("response",r.recordHeaders),o=Es(i,"fetch",(o=>function(){var a=e((function*(e,a){var l,u,h,c=new Request(e,a),d={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),n&&(d.requestHeaders=v),Jo({type:"request",headers:v,url:e,recordBody:r.recordBody})&&(d.requestBody=yield function(t){return sa.apply(this,arguments)}({r:c,options:r,url:e})),u=i.performance.now(),l=yield o(c),h=i.performance.now();var f={};return l.headers.forEach(((t,e)=>{f[e]=t})),s&&(d.responseHeaders=f),Jo({type:"response",headers:f,url:e,recordBody:r.recordBody})&&(d.responseBody=yield function(t){return oa.apply(this,arguments)}({r:l,options:r,url:e})),l}finally{Ko(i,"fetch",c.url,u,h).then((e=>{var i,r=ia({entry:e,method:c.method,status:null==(i=l)?void 0:i.status,networkRequest:d,start:u,end:h,url:c.url,initiatorType:"fetch"});t({requests:r})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}var la=null;function ua(t,e,r){if(!("performance"in e))return()=>{};if(la)return Go.warn("Network observer already initialised, doing nothing"),()=>{};var n=r?Object.assign({},Yo,r):Yo,s=e=>{var r=[];e.requests.forEach((t=>{var e=n.maskRequestFn(t);e&&r.push(e)})),r.length>0&&t(i({},e,{requests:r}))},o=Uo(s,e,n),a=()=>{},l=()=>{};return(n.recordHeaders||n.recordBody)&&(a=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=Xo("request",i.recordHeaders),n=Xo("response",i.recordHeaders),s=Es(e.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=(t,e)=>(g[t]=e,m(t,e)),r&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=t=>(Jo({type:"request",headers:g,url:a,recordBody:i.recordBody})&&(p.requestBody=ta({body:t,options:i,url:a})),c=e.performance.now(),y(t));var b=()=>{v.removeEventListener("readystatechange",_),v.removeEventListener("error",b),v.removeEventListener("abort",b),v.removeEventListener("timeout",b)},_=()=>{if(v.readyState===v.DONE){b(),d=e.performance.now();var r={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),i=e.shift(),n=e.join(": ");i&&(r[i]=n)})),n&&(p.responseHeaders=r),Jo({type:"response",headers:r,url:a,recordBody:i.recordBody})&&(p.responseBody=ta({body:v.response,options:i,url:a})),Ko(e,"xmlhttprequest",f.url,c,d).then((e=>{var i=ia({entry:e,method:o,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:i})})).catch((()=>{}))}};v.addEventListener("readystatechange",_),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),s.call(v,o,a.toString(),l,u,h)}));return()=>{s()}}(s,e,n),l=aa(s,e,n)),la=()=>{o(),a(),l(),la=null}}var ha=t=>({name:"rrweb/network@1",observer:ua,options:t});rs.__PosthogExtensions__=rs.__PosthogExtensions__||{},rs.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Bi,getRecordNetworkPlugin:ha},rs.__PosthogExtensions__.rrweb={record:Ze,version:"v2"},rs.rrweb={record:Ze,version:"v2"},rs.rrwebConsoleRecord={getRecordConsolePlugin:Bi},rs.getRecordNetworkPlugin=ha;var ca,da,va,fa,pa,ga,ma,ya,ba={},_a=[],wa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ia=Array.isArray;function Ca(t,e){for(var i in e)t[i]=e[i];return t}function Sa(t){var e=t.parentNode;e&&e.removeChild(t)}function ka(t,e,i){var r,n,s,o={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?ca.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return xa(t,o,r,n,null)}function xa(t,e,i,r,n){var s={type:t,props:e,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==n?++va:n,__i:-1,__u:0};return null==n&&null!=da.vnode&&da.vnode(s),s}function Aa(t){return t.children}function Ta(t,e){this.props=t,this.context=e}function Ea(t,e){if(null==e)return t.__?Ea(t.__,t.__i+1):null;for(var i;e<t.__k.length;e++)if(null!=(i=t.__k[e])&&null!=i.__e)return i.__e;return"function"==typeof t.type?Ea(t):null}function Ma(t){var e,i;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(i=t.__k[e])&&null!=i.__e){t.__e=t.__c.base=i.__e;break}return Ma(t)}}function Na(t){(!t.__d&&(t.__d=!0)&&fa.push(t)&&!Ra.__r++||pa!==da.debounceRendering)&&((pa=da.debounceRendering)||ga)(Ra)}function Ra(){var t,e,i,r,n,s,o,a,l;for(fa.sort(ma);t=fa.shift();)t.__d&&(e=fa.length,r=void 0,s=(n=(i=t).__v).__e,a=[],l=[],(o=i.__P)&&((r=Ca({},n)).__v=n.__v+1,da.vnode&&da.vnode(r),$a(o,r,n,i.__n,void 0!==o.ownerSVGElement,32&n.__u?[s]:null,a,null==s?Ea(n):s,!!(32&n.__u),l),r.__.__k[r.__i]=r,qa(a,r,l),r.__e!=s&&Ma(r)),fa.length>e&&fa.sort(ma));Ra.__r=0}function Fa(t,e,i,r,n,s,o,a,l,u,h){var c,d,v,f,p,g=r&&r.__k||_a,m=e.length;for(i.__d=l,function(t,e,i){var r,n,s,o,a,l=e.length,u=i.length,h=u,c=0;for(t.__k=[],r=0;r<l;r++)null!=(n=t.__k[r]=null==(n=e[r])||"boolean"==typeof n||"function"==typeof n?null:"string"==typeof n||"number"==typeof n||"bigint"==typeof n||n.constructor==String?xa(null,n,null,null,n):Ia(n)?xa(Aa,{children:n},null,null,null):void 0===n.constructor&&n.__b>0?xa(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)?(n.__=t,n.__b=t.__b+1,a=Pa(n,i,o=r+c,h),n.__i=a,s=null,-1!==a&&(h--,(s=i[a])&&(s.__u|=131072)),null==s||null===s.__v?(-1==a&&c--,"function"!=typeof n.type&&(n.__u|=65536)):a!==o&&(a===o+1?c++:a>o?h>l-o?c+=a-o:c--:c=a<o&&a==o-1?a-o:0,a!==r+c&&(n.__u|=65536))):(s=i[r])&&null==s.key&&s.__e&&(s.__e==t.__d&&(t.__d=Ea(s)),Va(s,s,!1),i[r]=null,h--);if(h)for(r=0;r<u;r++)null!=(s=i[r])&&0==(131072&s.__u)&&(s.__e==t.__d&&(t.__d=Ea(s)),Va(s,s))}(i,e,g),l=i.__d,c=0;c<m;c++)null!=(v=i.__k[c])&&"boolean"!=typeof v&&"function"!=typeof v&&(d=-1===v.__i?ba:g[v.__i]||ba,v.__i=c,$a(t,v,d,n,s,o,a,l,u,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Ha(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),65536&v.__u||d.__k===v.__k?l=Oa(v,l,t):"function"==typeof v.type&&void 0!==v.__d?l=v.__d:f&&(l=f.nextSibling),v.__d=void 0,v.__u&=-196609);i.__d=l,i.__e=p}function Oa(t,e,i){var r,n;if("function"==typeof t.type){for(r=t.__k,n=0;r&&n<r.length;n++)r[n]&&(r[n].__=t,e=Oa(r[n],e,i));return e}return t.__e!=e&&(i.insertBefore(t.__e,e||null),e=t.__e),e&&e.nextSibling}function Pa(t,e,i,r){var n=t.key,s=t.type,o=i-1,a=i+1,l=e[i];if(null===l||l&&n==l.key&&s===l.type)return i;if(r>(null!=l&&0==(131072&l.__u)?1:0))for(;o>=0||a<e.length;){if(o>=0){if((l=e[o])&&0==(131072&l.__u)&&n==l.key&&s===l.type)return o;o--}if(a<e.length){if((l=e[a])&&0==(131072&l.__u)&&n==l.key&&s===l.type)return a;a++}}return-1}function La(t,e,i){"-"===e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||wa.test(e)?i:i+"px"}function Da(t,e,i,r,n){var s;t:if("style"===e)if("string"==typeof i)t.style.cssText=i;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)i&&e in i||La(t.style,e,"");if(i)for(e in i)r&&i[e]===r[e]||La(t.style,e,i[e])}else if("o"===e[0]&&"n"===e[1])s=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i.u=r.u:(i.u=Date.now(),t.addEventListener(e,s?Za:Ba,s)):t.removeEventListener(e,s?Za:Ba,s);else{if(n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&"role"!==e&&e in t)try{t[e]=null==i?"":i;break t}catch(t){}"function"==typeof i||(null==i||!1===i&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,i))}}function Ba(t){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(da.event?da.event(t):t)}function Za(t){return this.l[t.type+!0](da.event?da.event(t):t)}function $a(t,e,i,r,n,s,o,a,l,u){var h,c,d,v,f,p,g,m,y,b,_,$,w,I,C,S=e.type;if(void 0!==e.constructor)return null;128&i.__u&&(l=!!(32&i.__u),s=[a=e.__e=i.__e]),(h=da.__b)&&h(e);t:if("function"==typeof S)try{if(m=e.props,y=(h=S.contextType)&&r[h.__c],b=h?y?y.props.value:h.__:r,i.__c?g=(c=e.__c=i.__c).__=c.__E:("prototype"in S&&S.prototype.render?e.__c=c=new S(m,b):(e.__c=c=new Ta(m,b),c.constructor=S,c.render=ja),y&&y.sub(c),c.props=m,c.state||(c.state={}),c.context=b,c.__n=r,d=c.__d=!0,c.__h=[],c._sb=[]),null==c.__s&&(c.__s=c.state),null!=S.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Ca({},c.__s)),Ca(c.__s,S.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=e,d)null==S.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==S.getDerivedStateFromProps&&m!==v&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(m,b),!c.__e&&(null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(m,c.__s,b)||e.__v===i.__v)){for(e.__v!==i.__v&&(c.props=m,c.state=c.__s,c.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.forEach((function(t){t&&(t.__=e)})),_=0;_<c._sb.length;_++)c.__h.push(c._sb[_]);c._sb=[],c.__h.length&&o.push(c);break t}null!=c.componentWillUpdate&&c.componentWillUpdate(m,c.__s,b),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(v,f,p)}))}if(c.context=b,c.props=m,c.__P=t,c.__e=!1,$=da.__r,w=0,"prototype"in S&&S.prototype.render){for(c.state=c.__s,c.__d=!1,$&&$(e),h=c.render(c.props,c.state,c.context),I=0;I<c._sb.length;I++)c.__h.push(c._sb[I]);c._sb=[]}else do{c.__d=!1,$&&$(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++w<25);c.state=c.__s,null!=c.getChildContext&&(r=Ca(Ca({},r),c.getChildContext())),d||null==c.getSnapshotBeforeUpdate||(p=c.getSnapshotBeforeUpdate(v,f)),Fa(t,Ia(C=null!=h&&h.type===Aa&&null==h.key?h.props.children:h)?C:[C],e,i,r,n,s,o,a,l,u),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),g&&(c.__E=c.__=null)}catch(t){e.__v=null,l||null!=s?(e.__e=a,e.__u|=l?160:32,s[s.indexOf(a)]=null):(e.__e=i.__e,e.__k=i.__k),da.__e(t,e,i)}else null==s&&e.__v===i.__v?(e.__k=i.__k,e.__e=i.__e):e.__e=function(t,e,i,r,n,s,o,a,l){var u,h,c,d,v,f,p,g=i.props,m=e.props,y=e.type;if("svg"===y&&(n=!0),null!=s)for(u=0;u<s.length;u++)if((v=s[u])&&"setAttribute"in v==!!y&&(y?v.localName===y:3===v.nodeType)){t=v,s[u]=null;break}if(null==t){if(null===y)return document.createTextNode(m);t=n?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,m.is&&m),s=null,a=!1}if(null===y)g===m||a&&t.data===m||(t.data=m);else{if(s=s&&ca.call(t.childNodes),g=i.props||ba,!a&&null!=s)for(g={},u=0;u<t.attributes.length;u++)g[(v=t.attributes[u]).name]=v.value;for(u in g)v=g[u],"children"==u||("dangerouslySetInnerHTML"==u?c=v:"key"===u||u in m||Da(t,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:"key"===u||a&&"function"!=typeof v||g[u]===v||Da(t,u,v,g[u],n);if(h)a||c&&(h.__html===c.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),Fa(t,Ia(d)?d:[d],e,i,r,n&&"foreignObject"!==y,s,o,s?s[0]:i.__k&&Ea(i,0),a,l),null!=s)for(u=s.length;u--;)null!=s[u]&&Sa(s[u]);a||(u="value",void 0!==f&&(f!==t[u]||"progress"===y&&!f||"option"===y&&f!==g[u])&&Da(t,u,f,g[u],!1),u="checked",void 0!==p&&p!==t[u]&&Da(t,u,p,g[u],!1))}return t}(i.__e,e,i,r,n,s,o,l,u);(h=da.diffed)&&h(e)}function qa(t,e,i){e.__d=void 0;for(var r=0;r<i.length;r++)Ha(i[r],i[++r],i[++r]);da.__c&&da.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){da.__e(t,e.__v)}}))}function Ha(t,e,i){try{"function"==typeof t?t(e):t.current=e}catch(t){da.__e(t,i)}}function Va(t,e,i){var r,n;if(da.unmount&&da.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||Ha(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){da.__e(t,e)}r.base=r.__P=null,t.__c=void 0}if(r=t.__k)for(n=0;n<r.length;n++)r[n]&&Va(r[n],e,i||"function"!=typeof t.type);i||null==t.__e||Sa(t.__e),t.__=t.__e=t.__d=void 0}function ja(t,e,i){return this.constructor(t,i)}function Ya(t,e,i){var r,n,s;da.__&&da.__(t,e),r=!1?null:e.__k,n=[],s=[],$a(e,t=e.__k=ka(Aa,null,[t]),r||ba,ba,void 0!==e.ownerSVGElement,r?null:e.firstChild?ca.call(e.childNodes):null,n,r?r.__e:e.firstChild,false,s),qa(n,t,s)}function Ga(t,e,i){var r,n,s,o,a=Ca({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&void 0!==o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?ca.call(arguments,2):i),xa(t.type,a,r||t.key,n||t.ref,null)}ca=_a.slice,da={__e:function(t,e,i,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},va=0,Ta.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Ca({},this.state),"function"==typeof t&&(t=t(Ca({},i),this.props)),t&&Ca(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),Na(this))},Ta.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Na(this))},Ta.prototype.render=Aa,fa=[],ga="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ma=function(t,e){return t.__v.__b-e.__v.__b},Ra.__r=0,ya=0;var za,Wa,Ua,Xa,Ja=0,Ka=[],Qa=[],tl=da.__b,el=da.__r,il=da.diffed,rl=da.__c,nl=da.unmount;function sl(t,e){da.__h&&da.__h(Wa,t,Ja||e),Ja=0;var i=Wa.__H||(Wa.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:Qa}),i.__[t]}function ol(t){return Ja=1,function(t,e,i){var r=sl(za++,2);if(r.t=t,!r.__c&&(r.__=[ml(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],i=r.t(e,t);e!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=Wa,!Wa.u)){var n=function(t,e,i){if(!r.__c.__H)return!0;var n=r.__c.__H.__.filter((function(t){return t.__c}));if(n.every((function(t){return!t.__N})))return!s||s.call(this,t,e,i);var o=!1;return n.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),!(!o&&r.__c.props===t)&&(!s||s.call(this,t,e,i))};Wa.u=!0;var s=Wa.shouldComponentUpdate,o=Wa.componentWillUpdate;Wa.componentWillUpdate=function(t,e,i){if(this.__e){var r=s;s=void 0,n(t,e,i),s=r}o&&o.call(this,t,e,i)},Wa.shouldComponentUpdate=n}return r.__N||r.__}(ml,t)}function al(t,e){var i=sl(za++,3);!da.__s&&gl(i.__H,e)&&(i.__=t,i.i=e,Wa.__H.__h.push(i))}function ll(t){return Ja=5,ul((function(){return{current:t}}),[])}function ul(t,e){var i=sl(za++,7);return gl(i.__H,e)?(i.__V=t(),i.i=e,i.__h=t,i.__V):i.__}function hl(t){var e=Wa.context[t.__c],i=sl(za++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(Wa)),e.props.value):t.__}function cl(){for(var t;t=Ka.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(fl),t.__H.__h.forEach(pl),t.__H.__h=[]}catch(e){t.__H.__h=[],da.__e(e,t.__v)}}da.__b=function(t){Wa=null,tl&&tl(t)},da.__r=function(t){el&&el(t),za=0;var e=(Wa=t.__c).__H;e&&(Ua===Wa?(e.__h=[],Wa.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=Qa,t.__N=t.i=void 0}))):(e.__h.forEach(fl),e.__h.forEach(pl),e.__h=[],za=0)),Ua=Wa},da.diffed=function(t){il&&il(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Ka.push(e)&&Xa===da.requestAnimationFrame||((Xa=da.requestAnimationFrame)||vl)(cl)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==Qa&&(t.__=t.__V),t.i=void 0,t.__V=Qa}))),Ua=Wa=null},da.__c=function(t,e){e.some((function(t){try{t.__h.forEach(fl),t.__h=t.__h.filter((function(t){return!t.__||pl(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],da.__e(i,t.__v)}})),rl&&rl(t,e)},da.unmount=function(t){nl&&nl(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.forEach((function(t){try{fl(t)}catch(t){e=t}})),i.__H=void 0,e&&da.__e(e,i.__v))};var dl="function"==typeof requestAnimationFrame;function vl(t){var e,i=function(){clearTimeout(r),dl&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,100);dl&&(e=requestAnimationFrame(i))}function fl(t){var e=Wa,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),Wa=e}function pl(t){var e=Wa;t.__c=t.__(),Wa=e}function gl(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function ml(t,e){return"function"==typeof e?e(t):e}var yl=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({}),bl=function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t}({}),_l=function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t}({}),wl=function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t}({}),Il=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({}),Cl=function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t}({}),Sl=function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t}({}),kl=function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t}({}),xl=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t}({}),Al=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t}({}),Tl=function(t){return t.Popover="popover",t.Inline="inline",t}({}),El=us("[Surveys]");function Ml(t){return!(!t.start_date||t.end_date)}function Nl(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Rl(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Fl="seenSurvey_",Ol="inProgressSurvey_",Pl=(t,e)=>{var i="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(i="$survey_"+e+"/"+t.id+"/"+t.current_iteration),i},Ll=(t,e)=>{var i=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(i=""+t+e.id+"_"+e.current_iteration),i},Dl=t=>Ll(Fl,t),Bl=t=>{localStorage.getItem(Dl(t))||localStorage.setItem(Dl(t),"true")},Zl=[Il.Popover,Il.Widget,Il.API],$l={ignoreConditions:!1,ignoreDelay:!1,displayType:Tl.Popover};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return sr(t)&&isFinite(t)&&Math.floor(t)===t});var ql="0123456789abcdef";class Hl{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,i,r){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||t<0||e<0||i<0||r<0||t>0xffffffffffff||e>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/Math.pow(2,8),n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new Hl(n)}toString(){for(var t="",e=0;e<this.bytes.length;e++)t=t+ql.charAt(this.bytes[e]>>>4)+ql.charAt(15&this.bytes[e]),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Hl(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;e<16;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}}class Vl{constructor(){this.T=0,this.M=0,this.N=new Gl}generate(){var t=this.generateOrAbort();if(tr(t)){this.T=0;var e=this.generateOrAbort();if(tr(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.T)this.T=t,this.R();else{if(!(t+1e4>this.T))return;this.M++,this.M>4398046511103&&(this.T++,this.R())}return Hl.fromFieldsV7(this.T,Math.trunc(this.M/Math.pow(2,30)),this.M&Math.pow(2,30)-1,this.N.nextUint32())}R(){this.M=1024*this.N.nextUint32()+(1023&this.N.nextUint32())}}var jl,Yl=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};Yn&&!tr(Yn.crypto)&&crypto.getRandomValues&&(Yl=t=>crypto.getRandomValues(t));class Gl{constructor(){this.F=new Uint32Array(8),this.O=1/0}nextUint32(){return this.O>=this.F.length&&(Yl(this.F),this.O=0),this.F[this.O++]}}var zl=()=>Wl().toString(),Wl=()=>(jl||(jl=new Vl)).generate(),Ul=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Xl=Uint8Array,Jl=Uint16Array,Kl=Uint32Array,Ql=new Xl([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]),tu=new Xl([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]),eu=new Xl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),iu=function(t,e){for(var i=new Jl(31),r=0;r<31;++r)i[r]=e+=1<<t[r-1];var n=new Kl(i[30]);for(r=1;r<30;++r)for(var s=i[r];s<i[r+1];++s)n[s]=s-i[r]<<5|r;return[i,n]},ru=iu(Ql,2),nu=ru[0],su=ru[1];nu[28]=258,su[258]=28;for(var ou=iu(tu,0)[1],au=new Jl(32768),lu=0;lu<32768;++lu){var uu=(43690&lu)>>>1|(21845&lu)<<1;uu=(61680&(uu=(52428&uu)>>>2|(13107&uu)<<2))>>>4|(3855&uu)<<4,au[lu]=((65280&uu)>>>8|(255&uu)<<8)>>>1}var hu=function(t,e,i){for(var r=t.length,n=0,s=new Jl(e);n<r;++n)++s[t[n]-1];var o,a=new Jl(e);for(n=0;n<e;++n)a[n]=a[n-1]+s[n-1]<<1;if(i){o=new Jl(1<<e);var l=15-e;for(n=0;n<r;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],c=a[t[n]-1]++<<h,d=c|(1<<h)-1;c<=d;++c)o[au[c]>>>l]=u}else for(o=new Jl(r),n=0;n<r;++n)o[n]=au[a[t[n]-1]++]>>>15-t[n];return o},cu=new Xl(288);for(lu=0;lu<144;++lu)cu[lu]=8;for(lu=144;lu<256;++lu)cu[lu]=9;for(lu=256;lu<280;++lu)cu[lu]=7;for(lu=280;lu<288;++lu)cu[lu]=8;var du=new Xl(32);for(lu=0;lu<32;++lu)du[lu]=5;var vu=hu(cu,9,0),fu=hu(du,5,0),pu=function(t){return(t/8>>0)+(7&t&&1)},gu=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof Jl?Jl:t instanceof Kl?Kl:Xl)(i-e);return r.set(t.subarray(e,i)),r},mu=function(t,e,i){i<<=7&e;var r=e/8>>0;t[r]|=i,t[r+1]|=i>>>8},yu=function(t,e,i){i<<=7&e;var r=e/8>>0;t[r]|=i,t[r+1]|=i>>>8,t[r+2]|=i>>>16},bu=function(t,e){for(var i=[],r=0;r<t.length;++r)t[r]&&i.push({s:r,f:t[r]});var n=i.length,s=i.slice();if(!n)return[new Xl(0),0];if(1==n){var o=new Xl(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,c=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=n-1;)a=i[i[u].f<i[c].f?u++:c++],l=i[u!=h&&i[u].f<i[c].f?u++:c++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=s[0].s;for(r=1;r<n;++r)s[r].s>d&&(d=s[r].s);var v=new Jl(d+1),f=_u(i[h-1],v,0);if(f>e){r=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return v[e.s]-v[t.s]||t.f-e.f}));r<n;++r){var y=s[r].s;if(!(v[y]>e))break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=s[r].s;v[b]<e?p-=1<<e-v[b]++-1:++r}for(;r>=0&&p;--r){var _=s[r].s;v[_]==e&&(--v[_],++p)}f=e}return[new Xl(v),f]},_u=function(t,e,i){return-1==t.s?Math.max(_u(t.l,e,i+1),_u(t.r,e,i+1)):e[t.s]=i},wu=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new Jl(++e),r=0,n=t[0],s=1,o=function(t){i[r++]=t},a=1;a<=e;++a)if(t[a]==n&&a!=e)++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=t[a]}return[i.subarray(0,r),e]},Iu=function(t,e){for(var i=0,r=0;r<e.length;++r)i+=t[r]*e[r];return i},Cu=function(t,e,i){var r=i.length,n=pu(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;s<r;++s)t[n+s+4]=i[s];return 8*(n+4+r)},Su=function(t,e,i,r,n,s,o,a,l,u,h){mu(e,h++,i),++n[256];for(var c=bu(n,15),d=c[0],v=c[1],f=bu(s,15),p=f[0],g=f[1],m=wu(d),y=m[0],b=m[1],_=wu(p),w=_[0],I=_[1],C=new Jl(19),S=0;S<y.length;++S)C[31&y[S]]++;for(S=0;S<w.length;++S)C[31&w[S]]++;for(var k=bu(C,7),x=k[0],A=k[1],T=19;T>4&&!x[eu[T-1]];--T);var E,M,N,R,F=u+5<<3,O=Iu(n,cu)+Iu(s,du)+o,P=Iu(n,d)+Iu(s,p)+o+14+3*T+Iu(C,x)+(2*C[16]+3*C[17]+7*C[18]);if(F<=O&&F<=P)return Cu(e,h,t.subarray(l,l+u));if(mu(e,h,1+(P<O)),h+=2,P<O){E=hu(d,v,0),M=d,N=hu(p,g,0),R=p;var L=hu(x,A,0);mu(e,h,b-257),mu(e,h+5,I-1),mu(e,h+10,T-4),h+=14;for(S=0;S<T;++S)mu(e,h+3*S,x[eu[S]]);h+=3*T;for(var D=[y,w],B=0;B<2;++B){var Z=D[B];for(S=0;S<Z.length;++S){var q=31&Z[S];mu(e,h,L[q]),h+=x[q],q>15&&(mu(e,h,Z[S]>>>5&127),h+=Z[S]>>>12)}}}else E=vu,M=cu,N=fu,R=du;for(S=0;S<a;++S)if(r[S]>255){q=r[S]>>>18&31;yu(e,h,E[q+257]),h+=M[q+257],q>7&&(mu(e,h,r[S]>>>23&31),h+=Ql[q]);var H=31&r[S];yu(e,h,N[H]),h+=R[H],H>3&&(yu(e,h,r[S]>>>5&8191),h+=tu[H])}else yu(e,h,E[r[S]]),h+=M[r[S]];return yu(e,h,E[256]),h+M[256]},ku=new Kl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),xu=function(){for(var t=new Kl(256),e=0;e<256;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Au=function(t,e,i,r,n){return function(t,e,i,r,n,s){var o=t.length,a=new Xl(r+o+5*(1+Math.floor(o/7e3))+n),l=a.subarray(r,a.length-n),u=0;if(!e||o<8)for(var h=0;h<=o;h+=65535){var c=h+65535;c<o?u=Cu(l,u,t.subarray(h,c)):(l[h]=s,u=Cu(l,u,t.subarray(h,o)))}else{for(var d=ku[e-1],v=d>>>13,f=8191&d,p=(1<<i)-1,g=new Jl(32768),m=new Jl(p+1),y=Math.ceil(i/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new Kl(25e3),I=new Jl(288),C=new Jl(32),S=0,k=0,x=(h=0,0),A=0,T=0;h<o;++h){var E=_(h),M=32767&h,N=m[E];if(g[M]=N,m[E]=M,A<=h){var R=o-h;if((S>7e3||x>24576)&&R>423){u=Su(t,l,0,w,I,C,k,x,T,h-T,u),x=S=k=0,T=h;for(var F=0;F<286;++F)I[F]=0;for(F=0;F<30;++F)C[F]=0}var O=2,P=0,L=f,D=M-N&32767;if(R>2&&E==_(h-D))for(var B=Math.min(v,R)-1,Z=Math.min(32767,h),q=Math.min(258,R);D<=Z&&--L&&M!=N;){if(t[h+O]==t[h+O-D]){for(var H=0;H<q&&t[h+H]==t[h+H-D];++H);if(H>O){if(O=H,P=D,H>B)break;var V=Math.min(D,H-2),j=0;for(F=0;F<V;++F){var Y=h-D+F+32768&32767,G=Y-g[Y]+32768&32767;G>j&&(j=G,N=Y)}}}D+=(M=N)-(N=g[M])+32768&32767}if(P){w[x++]=268435456|su[O]<<18|ou[P];var z=31&su[O],W=31&ou[P];k+=Ql[z]+tu[W],++I[257+z],++C[W],A=h+O,++S}else w[x++]=t[h],++I[t[h]]}}u=Su(t,l,s,w,I,C,k,x,T,h-T,u)}return gu(a,0,r+pu(u)+n)}(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,i,r,!0)},Tu=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function Eu(t,e){void 0===e&&(e={});var i=function(){var t=4294967295;return{p:function(e){for(var i=t,r=0;r<e.length;++r)i=xu[255&i^e[r]]^i>>>8;t=i},d:function(){return 4294967295^t}}}(),r=t.length;i.p(t);var n=Au(t,e,function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),8),s=n.length;return function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Tu(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;r<=i.length;++r)t[r+10]=i.charCodeAt(r)}}(n,e),Tu(n,s-8,i.d()),Tu(n,s-4,r),n}var Mu=function(t){var e,i,r,n,s="";for(e=i=0,r=(t=(t+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<r;n++){var o=t.charCodeAt(n),a=null;o<128?i++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),rr(a)||(i>e&&(s+=t.substring(e,i)),s+=a,e=i=n+1)}return i>e&&(s+=t.substring(e,t.length)),s},Nu=!!ts||!!Qn,Ru="text/plain",Fu=function(t,e,r){var n;void 0===r&&(r=!0);var[s,o]=t.split("?"),a=i({},e),l=null!==(n=null==o?void 0:o.split("&").map((t=>{var e,[i,n]=t.split("="),s=r&&null!==(e=a[i])&&void 0!==e?e:n;return delete a[i],i+"="+s})))&&void 0!==n?n:[],u=ks(a);return u&&l.push(u),s+"?"+l.join("&")},Ou=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Pu=t=>{var{data:e,compression:i}=t;if(e){if(i===Ul.GZipJS){var r=Eu(function(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Xl(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},o=0;o<i;++o){if(n+5>r.length){var a=new Xl(n+8+(i-o<<1));a.set(r),r=a}var l=t.charCodeAt(o);l<128||e?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&t.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 gu(r,0,n)}(Ou(e)),{mtime:0}),n=new Blob([r],{type:Ru});return{contentType:Ru,body:n,estimatedSize:n.size}}if(i===Ul.Base64){var s=function(t){var e,i,r,n,s,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",h=[];if(!t)return t;t=Mu(t);do{e=(s=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,i=s>>12&63,r=s>>6&63,n=63&s,h[l++]=o.charAt(e)+o.charAt(i)+o.charAt(r)+o.charAt(n)}while(a<t.length);switch(u=h.join(""),t.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}(Ou(e)),o=(t=>"data="+encodeURIComponent("string"==typeof t?t:Ou(t)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=Ou(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Lu=[];Qn&&Lu.push({transport:"fetch",method:t=>{var e,r,{contentType:n,body:s,estimatedSize:o}=null!==(e=Pu(t))&&void 0!==e?e:{},a=new Headers;ds(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var l=t.url,u=null;if(es){var h=new es;u={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}Qn(l,i({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&(o||0)<52428.8,body:s,signal:null==(r=u)?void 0:r.signal},t.fetchOptions)).then((e=>e.text().then((i=>{var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){ls.error(t)}null==t.callback||t.callback(r)})))).catch((e=>{ls.error(e),null==t.callback||t.callback({statusCode:0,text:e})})).finally((()=>u?clearTimeout(u.timeout):null))}}),ts&&Lu.push({transport:"XHR",method:t=>{var e,i=new ts;i.open(t.method||"GET",t.url,!0);var{contentType:r,body:n}=null!==(e=Pu(t))&&void 0!==e?e:{};ds(t.headers,(function(t,e){i.setRequestHeader(e,t)})),r&&i.setRequestHeader("Content-Type",r),t.timeout&&(i.timeout=t.timeout),t.disableXHRCredentials||(i.withCredentials=!0),i.onreadystatechange=()=>{if(4===i.readyState){var e={statusCode:i.status,text:i.responseText};if(200===i.status)try{e.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(e)}},i.send(n)}}),null!=Xn&&Xn.sendBeacon&&Lu.push({transport:"sendBeacon",method:t=>{var e=Fu(t.url,{beacon:"1"});try{var i,{contentType:r,body:n}=null!==(i=Pu(t))&&void 0!==i?i:{},s="string"==typeof n?new Blob([n],{type:r}):n;Xn.sendBeacon(e,s)}catch(t){}}});var Du=function(t,e){if(!function(t){try{new RegExp(t)}catch(t){return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}};function Bu(t,e,i){return Ou({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var Zu={exact:(t,e)=>e.some((e=>t.some((t=>e===t)))),is_not:(t,e)=>e.every((e=>t.every((t=>e!==t)))),regex:(t,e)=>e.some((e=>t.some((t=>Du(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Du(e,t))))),icontains:(t,e)=>e.map($u).some((e=>t.map($u).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map($u).every((e=>t.map($u).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i<parseFloat(t)))}))},$u=t=>t.toLowerCase();function qu(t,e){return!t||Object.entries(t).every((t=>{var[i,r]=t,n=null==e?void 0:e[i];if(tr(n)||rr(n))return!1;var s=[String(n)],o=Zu[r.operator];return!!o&&o(r.values,s)}))}var Hu=us("[Stylesheet Loader]"),Vu=Yn,ju=Jn;function Yu(t){return"$survey_response_"+t}var Gu="#020617",zu={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:_l.Right,widgetType:bl.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:"2147483647",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:Gu,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"};function Wu(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Uu(t){var e;void 0===t&&(t=zu.backgroundColor),"#"===t[0]&&(e=Wu(t)),t.startsWith("rgb")&&(e=t);var i={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"}[t.toLowerCase()];if(i&&(e=Wu(i)),!e)return Gu;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),o=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?Gu:"white"}return Gu}function Xu(t){var e=((t,e,i)=>{var r,n=t.createElement("style");return n.innerText=e,null!=i&&null!=(r=i.config)&&r.prepare_external_dependency_stylesheet&&(n=i.config.prepare_external_dependency_stylesheet(n)),n||(Hu.error("prepare_external_dependency_stylesheet returned null"),null)})(ju,':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:2147483647;--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}.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:hover{cursor:pointer}.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)}.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)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}var Ju=(t,e,r)=>{var n=yh(t),s=ju.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=ju.createElement("div");((t,e,r)=>{var n=i({},zu,r),s=t.style,o=![_l.Center,_l.Left,_l.Right].includes(n.position)||e===Il.Widget&&(null==r?void 0:r.widgetType)===bl.Tab;s.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(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==r?void 0:r.submitButtonTextColor)||Uu(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",Uu(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==r?void 0:r.textColor)||Uu(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",Uu(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==r?void 0:r.inputBackground)||(null==r?void 0:r.inputBackgroundColor),l=a||n.inputBackground;a||"white"!==n.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==r?void 0:r.inputTextColor)||Uu(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,t.type,t.appearance),o.className=n;var a=o.attachShadow({mode:"open"}),l=Xu(e);if(l){var u=a.querySelector("style");u&&a.removeChild(u),a.appendChild(l)}return ju.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},Ku=(t,e)=>{if(!e)return null;var i=t[Yu(e)];return Ui(i)?[...i]:i},Qu=t=>{var{responses:e,survey:r,surveySubmissionId:n,posthog:s,isSurveyCompleted:o}=t;s?(Bl(r),s.capture(xl.SENT,i({[Al.SURVEY_NAME]:r.name,[Al.SURVEY_ID]:r.id,[Al.SURVEY_ITERATION]:r.current_iteration,[Al.SURVEY_ITERATION_START_DATE]:r.current_iteration_start_date,[Al.SURVEY_QUESTIONS]:r.questions.map((t=>({id:t.id,question:t.question,response:Ku(e,t.id)}))),[Al.SURVEY_SUBMISSION_ID]:n,[Al.SURVEY_COMPLETED]:o,sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},e,{$set:{[Pl(r,"responded")]:!0}})),o&&(Vu.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:r.id}})),mh(r))):El.error("[survey sent] event not captured, PostHog instance not found.")},th=t=>Object.values((null==t?void 0:t.responses)||{}).filter((t=>!nr(t))).length>0,eh=(t,e,r)=>i({[Al.SURVEY_NAME]:t.name,[Al.SURVEY_ID]:t.id,[Al.SURVEY_ITERATION]:t.current_iteration,[Al.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Al.SURVEY_PARTIALLY_COMPLETED]:th(e),sessionRecordingUrl:null==r.get_session_replay_url?void 0:r.get_session_replay_url()},null==e?void 0:e.responses,{[Al.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId,[Al.SURVEY_QUESTIONS]:t.questions.map((t=>({id:t.id,question:t.question,response:Ku((null==e?void 0:e.responses)||{},t.id)})))}),ih=(t,e,r)=>{if(e){if(!r){var n=ph(t);e.capture(xl.DISMISSED,i({},eh(t,n,e),{$set:{[Pl(t,"dismissed")]:!0}})),mh(t),Bl(t),Vu.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else El.error("[survey dismissed] event not captured, PostHog instance not found.")},rh=(t,e)=>{if(e){var i=(t=>Ll("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=ph(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(xl.ABANDONED,eh(t,r,e),{transport:"sendBeacon"})}}else El.error("[survey abandoned] event not captured, PostHog instance not found.")},nh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),sh=(t,e)=>t.length===e.length&&t.every(((t,i)=>t===e[i]))?e.reverse():e,oh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?sh(t.questions,nh(t.questions)):t.questions,ah=t=>{var e;return!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation||!(t=>{var e,i;return null!=(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)?void 0:e.length)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0})(t))||t.schedule===kl.Always||gh(t)},lh=function(t,e){var i={__c:e="__cC"+ya++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var i,r;return this.getChildContext||(i=[],(r={})[e]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&i.some((function(t){t.__e=!0,Na(t)}))},this.sub=function(t){i.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){i.splice(i.indexOf(t),1),e&&e.call(t)}}),t.children}};return i.Provider.__=i.Consumer.contextType=i}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{},surveySubmissionId:""}),uh=()=>hl(lh),hh=t=>{var{component:e,children:i,renderAsHtml:r,style:n}=t;return Ga(e,r?{dangerouslySetInnerHTML:{__html:i},style:n}:{children:i,style:n})};function ch(t){return null!=t?t:"icontains"}function dh(t){var e,i,r;if(null==(e=t.conditions)||!e.url)return!0;var n=null==Vu||null==(i=Vu.location)?void 0:i.href;if(!n)return!1;var s=[t.conditions.url],o=ch(null==(r=t.conditions)?void 0:r.urlMatchType);return Zu[o](s,[n])}var vh=t=>{var e=""+Ol+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Ol+t.id+"_"+t.current_iteration),e},fh=(t,e)=>{try{localStorage.setItem(vh(t),JSON.stringify(e))}catch(t){El.error("Error setting in-progress survey state in localStorage",t)}},ph=t=>{try{var e=localStorage.getItem(vh(t));if(e)return JSON.parse(e)}catch(t){El.error("Error getting in-progress survey state from localStorage",t)}return null},gh=t=>{var e=ph(t);return!nr(null==e?void 0:e.surveySubmissionId)},mh=t=>{try{localStorage.removeItem(vh(t))}catch(t){El.error("Error clearing in-progress survey state from localStorage",t)}};function yh(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}var bh=0;function _h(t,e,i,r,n,s){var o,a,l={};for(a in e)"ref"==a?o=e[a]:l[a]=e[a];var u={type:t,props:l,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--bh,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===l[a]&&(l[a]=o[a]);return da.vnode&&da.vnode(u),u}var wh=_h("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_h("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"})}),Ih=_h("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_h("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"})}),Ch=_h("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_h("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"})}),Sh=_h("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_h("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"})}),kh=_h("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_h("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"})}),xh=_h("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title",children:[_h("title",{id:"close-survey-title",children:"Close survey"}),_h("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"black"})]}),Ah=_h("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[_h("g",{"clip-path":"url(#clip0_2415_6911)",children:[_h("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:_h("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),_h("g",{mask:"url(#mask0_2415_6911)",children:[_h("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"}),_h("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"}),_h("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"}),_h("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"}),_h("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"}),_h("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"})]})]}),_h("defs",{children:_h("clipPath",{id:"clip0_2415_6911",children:_h("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Th(){return _h("a",{href:"https://posthog.com/surveys",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Ah]})}function Eh(t){var{text:e,submitDisabled:i,appearance:r,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=t,{isPreviewMode:l}=hl(lh);return _h("div",{className:"bottom-section",children:[!a&&_h("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick:()=>{s&&(null==Yn||Yn.open(s)),l?null==o||o():n()},children:e}),!r.whiteLabel&&_h(Th,{})]})}function Mh(t){var{question:e,forceDisableHtml:i,htmlFor:r}=t;return _h("div",{class:"question-header",children:[_h(e.type===Cl.Open?"label":"h3",{className:"survey-question",htmlFor:r,children:e.question}),e.description&&hh({component:ka("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function Nh(t){var{onClick:e}=t,{isPreviewMode:i}=hl(lh);return _h("button",{className:"form-cancel",onClick:e,disabled:i,"aria-label":"Close survey",type:"button",children:xh})}_h("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:_h("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 Rh=Yn;function Fh(t){var{header:e,description:i,contentType:r,forceDisableHtml:n,appearance:s,onClose:o}=t,{isPopup:a}=hl(lh);return al((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Cs(Rh,"keydown",t),()=>{Rh.removeEventListener("keydown",t)}}),[o]),_h("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&_h(Nh,{onClick:()=>o()}),_h("h3",{className:"thank-you-message-header",children:e}),i&&hh({component:ka("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),a&&_h(Eh,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Oh=t=>Ui(t)&&t.every((t=>er(t)));function Ph(t){var{question:e,forceDisableHtml:i,appearance:r,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=t,{isPreviewMode:l}=uh(),u=ll(null),[h,c]=ol((()=>er(a)?a:""));al((()=>{setTimeout((()=>{var t;l||(null==(t=u.current)||t.focus())}),100)}),[l]);var d="surveyQuestion"+o;return _h(Aa,{children:[_h("div",{className:"question-container",children:[_h(Mh,{question:e,forceDisableHtml:i,htmlFor:d}),_h("textarea",{ref:u,id:d,rows:4,placeholder:null==r?void 0:r.placeholder,onInput:t=>{c(t.currentTarget.value),t.stopPropagation()},onKeyDown:t=>{t.stopPropagation()},value:h})]}),_h(Eh,{text:e.buttonText||"Submit",submitDisabled:!h&&!e.optional,appearance:r,onSubmit:()=>n(h),onPreviewSubmit:()=>s(h)})]})}function Lh(t){var{question:e,forceDisableHtml:i,appearance:r,onSubmit:n,onPreviewSubmit:s}=t;return _h(Aa,{children:[_h("div",{className:"question-container",children:_h(Mh,{question:e,forceDisableHtml:i})}),_h(Eh,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function Dh(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:r,appearance:n,onSubmit:s,onPreviewSubmit:o,initialValue:a}=t,l=e.scale,u=10===e.scale?0:1,[h,c]=ol((()=>sr(a)?a:Ui(a)&&a.length>0&&sr(parseInt(a[0]))?parseInt(a[0]):er(a)&&sr(parseInt(a))?parseInt(a):null)),{isPreviewMode:d}=uh(),v=t=>d?o(t):s(t);return _h(Aa,{children:[_h("div",{className:"question-container",children:[_h(Mh,{question:e,forceDisableHtml:i}),_h("div",{className:"rating-section",children:[_h("div",{className:"rating-options",children:["emoji"===e.display&&_h("div",{className:"rating-options-emoji",children:(3===e.scale?$h:qh).map(((t,i)=>_h("button",{"aria-label":"Rate "+(i+1),className:"ratings-emoji question-"+r+"-rating-"+i+" "+(i+1===h?"rating-active":""),value:i+1,type:"button",onClick:()=>{var t=i+1;c(t),e.skipSubmitButton&&v(t)},children:t},i)))}),"number"===e.display&&_h("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-u+1)+", minmax(0, 1fr))"},children:Yh(e.scale).map(((t,i)=>_h(Bh,{displayQuestionIndex:r,active:h===t,appearance:n,num:t,setActiveNumber:t=>{c(t),e.skipSubmitButton&&v(t)}},i)))})]}),_h("div",{className:"rating-text",children:[_h("div",{children:e.lowerBoundLabel}),_h("div",{children:e.upperBoundLabel})]})]})]}),_h(Eh,{text:e.buttonText||(null==n?void 0:n.submitButtonText)||"Submit",submitDisabled:rr(h)&&!e.optional,appearance:n,onSubmit:()=>s(h),onPreviewSubmit:()=>o(h),skipSubmitButton:e.skipSubmitButton})]})}function Bh(t){var{num:e,active:i,displayQuestionIndex:r,setActiveNumber:n}=t;return _h("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+r+"-rating-"+e+" "+(i?"rating-active":""),type:"button",onClick:()=>{n(e)},children:e})}function Zh(t){var{question:e,forceDisableHtml:r,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=t,u=ll(null),h=ul((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=sh(e,nh(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e)),[e]),[c,d]=ol((()=>((t,e)=>er(t)||Oh(t)?t:e===Cl.SingleChoice?null:[])(l,e.type))),[v,f]=ol((()=>((t,e)=>{if(er(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Oh(t)){var i=t.find((t=>!e.includes(t)));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(l,h))),{isPreviewMode:p}=uh(),g=e.type===Cl.SingleChoice,m=e.type===Cl.MultipleChoice,y=e.skipSubmitButton&&g&&!e.hasOpenChoice,b=(t,e)=>{if(e){var r=!v.isSelected;return f((t=>i({},t,{isSelected:r,inputValue:r?t.inputValue:""}))),g&&d(""),void(r&&setTimeout((()=>{var t;return null==(t=u.current)?void 0:t.focus()}),75))}if(g)return d(t),f((t=>i({},t,{isSelected:!1,inputValue:""}))),void(y&&(o(t),p&&a(t)));m&&Ui(c)&&(c.includes(t)?d(c.filter((e=>e!==t))):d([...c,t]))},_=t=>{t.stopPropagation();var e=t.currentTarget.value;f((t=>i({},t,{inputValue:e}))),g&&d(e)},w=t=>{t.stopPropagation(),"Enter"!==t.key||I()||(t.preventDefault(),C()),"Escape"===t.key&&(t.preventDefault(),f((t=>i({},t,{isSelected:!1,inputValue:""}))),g&&d(null))},I=()=>!e.optional&&(!!rr(c)||(!(!Ui(c)||v.isSelected||0!==c.length)||!(!v.isSelected||""!==v.inputValue.trim()))),C=()=>{v.isSelected&&m?Ui(c)&&(p?a([...c,v.inputValue]):o([...c,v.inputValue])):p?a(c):o(c)};return _h(Aa,{children:[_h("div",{className:"question-container",children:[_h(Mh,{question:e,forceDisableHtml:r}),_h("fieldset",{className:"multiple-choice-options limit-height",children:[_h("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((t,i)=>{var r=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+n+"Choice"+i,o=s+"Open",a=r?v.isSelected:g?c===t:Ui(c)&&c.includes(t);return _h("label",{className:r?"choice-option-open":"",children:[_h("div",{className:"response-choice",children:[_h("input",{type:g?"radio":"checkbox",name:s,checked:a,onChange:()=>b(t,r),id:s,"aria-controls":o}),_h("span",{children:r?t+":":t})]}),r&&_h("input",{type:"text",ref:u,id:o,name:"question"+n+"Open",value:v.inputValue,onKeyDown:w,onInput:_,onClick:e=>{v.isSelected||b(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},i)}))]})]}),_h(Eh,{text:e.buttonText||"Submit",submitDisabled:I(),appearance:s,onSubmit:C,onPreviewSubmit:C,skipSubmitButton:y})]})}var $h=[Ch,Ih,wh],qh=[Sh,Ch,Ih,wh,kh],Hh=[1,2,3,4,5],Vh=[1,2,3,4,5,6,7],jh=[0,1,2,3,4,5,6,7,8,9,10];function Yh(t){switch(t){case 5:default:return Hh;case 7:return Vh;case 10:return jh}}var Gh=Yn,zh=Jn,Wh="ph:show_survey_widget",Uh="PHWidgetSurveyClickListener";function Xh(t,e,i){var r,n=t.questions[e],s=e+1;if(null==(r=n.branching)||!r.type)return e===t.questions.length-1?Sl.End:s;if(n.branching.type===Sl.End)return Sl.End;if(n.branching.type===Sl.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Sl.ResponseBased){if(n.type===Cl.SingleChoice){var o,a=n.choices.indexOf(""+i);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===Sl.End?Sl.End:s}}else if(n.type===Cl.Rating){var u;if("number"!=typeof i||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(t,e){if(3===e){if(t<1||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(t<1||t>5)throw new Error("The response must be in range 1-5");return t<=2?"negative":3===t?"neutral":"positive"}if(7===e){if(t<1||t>7)throw new Error("The response must be in range 1-7");return t<=3?"negative":4===t?"neutral":"positive"}if(10===e){if(t<0||t>10)throw new Error("The response must be in range 0-10");return t<=6?"detractors":t<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 7, 10")}(i,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===Sl.End?Sl.End:s}}return s}return El.warn("Falling back to next question index due to unexpected branching type"),s}var Jh=250,Kh=20,Qh=12;class tc{constructor(t){var e=this;this.P=new Map,this.L=new Map,this.D=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(Js);if(t)for(var e of t)gh(e)&&rh(e,this._posthog)},this.handlePopoverSurvey=t=>{var e;this.B(t.id),this.Z(t);var r=(null==(e=t.appearance)?void 0:e.surveyPopupDelaySeconds)||0,{shadow:n}=Ju(t,this._posthog);if(r<=0)return Ya(_h(sc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$}),n);var s=setTimeout((()=>{if(this.P.delete(t.id),!dh(t))return this.$(t);Ya(_h(sc,{posthog:this._posthog,survey:i({},t,{appearance:i({},t.appearance,{surveyPopupDelaySeconds:0})}),removeSurveyFromFocus:this.$}),n)}),1e3*r);this.P.set(t.id,s)},this.q=t=>{var{shadow:e,isNewlyCreated:i}=Ju(t,this._posthog);i&&Ya(_h(ac,{posthog:this._posthog,survey:t},t.id),e)},this.H=t=>{this.V(t);var e=this.L.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Uh),this.L.delete(t.id),El.info("Removed click listener for survey "+t.id))},this.j=(t,e)=>{var i=zh.querySelector(e),r=this.L.get(t.id);if(i){if(this.q(t),r){if(i===r.element)return;El.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.H(t)}if(!i.hasAttribute(Uh)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===_l.NextToTrigger?function(t,e){try{var i=t.getBoundingClientRect(),r=Gh.innerHeight,n=Gh.innerWidth,s=Jh,o=i.left+i.width/2-e/2;o+e>n-Kh&&(o=n-e-Kh),o<Kh&&(o=Kh);var a=Qh,l=r-i.bottom,u=i.top,h=l<s&&u>l;return{position:"fixed",top:h?"auto":i.bottom+a+"px",left:o+"px",right:"auto",bottom:h?r-i.top+a+"px":"auto",zIndex:zu.zIndex}}catch(t){return El.warn("Failed to calculate trigger position:",t),null}}(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||zu.maxWidth)):{};Gh.dispatchEvent(new CustomEvent(Wh,{detail:{surveyId:t.id,position:n}}))};Cs(i,"click",n),i.setAttribute(Uh,"true"),this.L.set(t.id,{element:i,listener:n,survey:t}),El.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.H(t)},this.renderPopover=t=>{var{shadow:e}=Ju(t,this._posthog);Ya(_h(sc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$}),e)},this.renderSurvey=(t,e)=>{var i;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&this.Y(t),Ya(_h(sc,{posthog:this._posthog,survey:t,removeSurveyFromFocus:this.$,isPopup:!1}),e)},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||r.surveys.getSurveys((i=>{var r=i.filter((t=>e.checkSurveyEligibility(t).eligible&&e.G(t)&&e.W(t)&&e.U(t)));t(r)}),i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var i=t.filter((t=>t.type===Il.Popover||t.type===Il.Widget)),r=e.X(i),n=new Set;r.forEach((t=>{if(t.type===Il.Widget){var i,r,s,o;if((null==(i=t.appearance)?void 0:i.widgetType)===bl.Tab)return void e.q(t);if((null==(r=t.appearance)?void 0:r.widgetType)===bl.Selector&&null!=(s=t.appearance)&&s.widgetSelector)n.add(t.id),e.j(t,null==(o=t.appearance)?void 0:o.widgetSelector)}rr(e.J)&&t.type===Il.Popover&&e.handlePopoverSurvey(t)})),e.L.forEach((t=>{var{survey:i}=t;n.has(i.id)||e.H(i)}))}),t)},this.Z=t=>{rr(this.J)||El.error("Survey "+this.J+" already in focus. Cannot add survey "+t.id+"."),this.J=t.id},this.$=t=>{this.J!==t.id&&El.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.B(t.id),this.J=null,this.V(t)},this._posthog=t,this.J=null}B(t){var e=this.P.get(t);e&&(clearTimeout(e),this.P.delete(t))}cancelSurvey(t){this.P.has(t)&&(El.info("Cancelled pending survey "+t),this.B(t),this.J===t&&(this.J=null))}X(t){return t.sort(((t,e)=>{var i,r,n=gh(t),s=gh(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===kl.Always,a=e.schedule===kl.Always;return o&&!a?1:!o&&a?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)}))}Y(t){if(!this.D.has(t.id))try{var{params:e}=function(t){var e={},i=!1,r=t.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:i};var n=r.split("&");for(var s of n){var[o,a]=s.split("=");if(o&&!tr(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);e[c]||(e[c]=[]),e[c].push(u)}}else i=!0}}return{params:e,autoSubmit:i}}(Gh.location.search);if(0===Object.keys(e).length)return;El.info("[Survey Prefill] Detected URL prefill parameters");var i=function(t,e){var i={};return t.questions.forEach(((t,r)=>{if(e[r]&&t.id){var n=e[r],s=Yu(t.id);try{switch(t.type){case Cl.SingleChoice:if(!t.choices||0===t.choices.length)return void ls.warn("[Survey Prefill] Question "+r+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||o<0||o>=t.choices.length)return void ls.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[o];break;case Cl.MultipleChoice:if(!t.choices||0===t.choices.length)return void ls.warn("[Survey Prefill] Question "+r+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&e<t.choices.length));if(0===a.length)return void ls.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(a.map((e=>t.choices[e])))];l.length<a.length&&ls.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case Cl.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||u<0||u>h)return void ls.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:ls.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){ls.error("[Survey Prefill] Error converting q"+r+":",t)}}})),i}(t,e);if(0===Object.keys(i).length)return void El.warn("[Survey Prefill] No valid responses after conversion");var r=zl(),n=Object.keys(e).map((t=>parseInt(t,10))),{startQuestionIndex:s,skippedResponses:o}=function(t,e,i){for(var r=0,n={},s=0;s<t.length&&e.includes(s);s++){var o=t[s];if(!(o&&"skipSubmitButton"in o&&o.skipSubmitButton))break;if(r=s+1,o.id){var a=Yu(o.id);tr(i[a])||(n[a]=i[a])}}return{startQuestionIndex:r,skippedResponses:n}}(t.questions,n,i),a=s>=t.questions.length;fh(t,{surveySubmissionId:r,responses:i,lastQuestionIndex:a?t.questions.length-1:s}),El.info("[Survey Prefill] Stored prefilled responses in localStorage"),(Object.keys(o).length>0&&t.enable_partial_responses||a)&&Qu({responses:a?i:o,survey:t,surveySubmissionId:r,posthog:this._posthog,isSurveyCompleted:a}),this.D.add(t.id)}catch(t){El.error("[Survey Prefill] Error handling URL prefill:",t)}}K(t,e){if(void 0===e&&(e=void 0),!t)return!0;var i=!!this._posthog.featureFlags.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")}),r=!0;e&&(r=this._posthog.featureFlags.getFeatureFlag(t,{send_event:!1})===e||"any"===e);return i&&r}G(t){return!t.conditions||dh(t)&&function(t){var e,i,r;if(null==(e=t.conditions)||!e.deviceTypes||0===(null==(i=t.conditions)?void 0:i.deviceTypes.length))return!0;if(!is)return!1;var n=mn(is);return Zu[ch(null==(r=t.conditions)?void 0:r.deviceTypesMatchType)](t.conditions.deviceTypes,[n])}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==ju||!ju.querySelector(t.conditions.selector))}(t)}tt(t){return ah(t)||this.K(t.internal_targeting_flag_key)||gh(t)}checkSurveyEligibility(t){var e,i,r={eligible:!0,reason:void 0};if(!Ml(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!Zl.includes(t.type))return r.eligible=!1,r.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",r;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;return this.K(t.linked_flag_key,n)?this.K(t.targeting_flag_key)?this.tt(t)?(t=>{var e=localStorage.getItem("lastSeenSurveyDate");if(!t||!e)return!0;var i=new Date,r=Math.abs(i.getTime()-new Date(e).getTime());return Math.ceil(r/864e5)>t})(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays)?(t=>!!localStorage.getItem(Dl(t))&&!ah(t))(t)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",r):(r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r):(r.eligible=!1,r.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",r)}W(t){var e;if(!Nl(t)&&!Rl(t))return!0;var i=null==(e=this._posthog.surveys._surveyEventReceiver)?void 0:e.getSurveys();return!(null==i||!i.includes(t.id))}U(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:i}=t;return!e||!i||this.K(i)}))}V(t){try{var e=zh.querySelector(yh(t,!0));null!=e&&e.shadowRoot&&Ya(null,e.shadowRoot),null==e||e.remove()}catch(e){El.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.J,surveyTimeouts:this.P,handleWidget:this.q,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.j,sortSurveysByAppearanceDelay:this.X,checkFlags:this.U.bind(this),isSurveyFeatureFlagEnabled:this.K.bind(this)}}}function ec(t,e){if(zh&&Gh){var i,r=new tc(t);if(t.config.disable_surveys_automatic_display)return El.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return El.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{tr(i)&&(i=setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Cs(zh,"visibilitychange",(()=>{zh.hidden?tr(i)||(clearInterval(i),i=void 0):(r.callSurveysAndEvaluateDisplayLogic(!1),n())})),r}}function ic(t){var{survey:e,removeSurveyFromFocus:i=(()=>{}),setSurveyVisible:r,isPreviewMode:n=!1}=t;al((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var s=()=>{var t,n=e.type===Il.Widget,s=dh(e),o=(null==(t=e.appearance)?void 0:t.widgetType)===bl.Tab&&n;if(!s)return El.info("Hiding survey "+e.id+" because URL does not match"),r(!1),i(e);o&&(El.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),r(!0))};Cs(Gh,"popstate",s),Cs(Gh,"hashchange",s);var o=Gh.history.pushState,a=Gh.history.replaceState;return Gh.history.pushState=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];o.apply(this,e),s()},Gh.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];a.apply(this,e),s()},()=>{Gh.removeEventListener("popstate",s),Gh.removeEventListener("hashchange",s),Gh.history.pushState=o,Gh.history.replaceState=a}}}),[n,e,i,r])}function rc(t,e,i){if(void 0===e&&(e=_l.Right),t===Il.ExternalSurvey)return{};switch(e){case _l.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case _l.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case _l.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case _l.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case _l.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case _l.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case _l.Left:return{left:"30px"};case _l.Center:return{left:"50%",transform:"translateX(-50%)"};default:case _l.Right:return{right:t===Il.Widget&&i===bl.Tab?"60px":"30px"}}}function nc(t){switch(void 0===t&&(t=wl.Right),t){case wl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case wl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case wl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:case wl.Right:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function sc(t){var e,r,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=(()=>{})}=t,y=ll(null),b=Number.isInteger(d),_=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:w,isSurveySent:I,hidePopupWithViewTransition:C}=function(t,e,i,r,n,s,o){var[a,l]=ol(r||0===i||t.type===Il.ExternalSurvey),[u,h]=ol(!1),c=()=>{var e=()=>{s&&n(t),l(!1)};zh.startViewTransition?zh.startViewTransition((()=>{var t;null==o||null==(t=o.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},d=e=>{e.detail.surveyId===t.id&&c()};return al((()=>{if(e){if(!r){var n=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return c();h(!0),null!=(r=t.appearance)&&r.autoDisappear&&setTimeout((()=>{c()}),5e3)}},s=()=>{dh(t)&&(l(!0),Gh.dispatchEvent(new Event("PHSurveyShown")),e.capture(xl.SHOWN,{[Al.SURVEY_NAME]:t.name,[Al.SURVEY_ID]:t.id,[Al.SURVEY_ITERATION]:t.current_iteration,[Al.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(Cs(Gh,"PHSurveyClosed",d),Cs(Gh,"PHSurveySent",n),i>0){var o=setTimeout(s,i);return()=>{clearTimeout(o),Gh.removeEventListener("PHSurveyClosed",d),Gh.removeEventListener("PHSurveySent",n)}}return s(),()=>{Gh.removeEventListener("PHSurveyClosed",d),Gh.removeEventListener("PHSurveySent",n)}}}else El.error("usePopupVisibility hook called without a PostHog instance.")}),[]),ic({survey:t,removeSurveyFromFocus:n,setSurveyVisible:l,isPreviewMode:r}),{isPopupVisible:a,isSurveySent:u,setIsPopupVisible:l,hidePopupWithViewTransition:c}}(l,h,_,b,v,f,y),S=I||d===l.questions.length,k=ul((()=>{var t=ph(l);return{isPreviewMode:b,previewPageIndex:d,onPopupSurveyDismissed:()=>{ih(l,h,b),g()},isPopup:f||!1,surveySubmissionId:(null==t?void 0:t.surveySubmissionId)||zl(),onPreviewSubmit:p,posthog:h}}),[b,d,f,h,l,g,p]);return w?_h(lh.Provider,{value:k,children:_h("div",{className:"ph-survey",style:i({},rc(l.type,null==(r=l.appearance)?void 0:r.position,null==(n=l.appearance)?void 0:n.widgetType),c),ref:y,children:S?_h(Fh,{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||zu,onClose:()=>{C(),m()}}):_h(oc,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function oc(t){var e,{survey:r,forceDisableHtml:n,posthog:s}=t,[o,a]=ol((()=>{var t=ph(r);return null!=t&&t.responses&&El.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),{previewPageIndex:l,onPopupSurveyDismissed:u,isPopup:h,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:v}=hl(lh),[f,p]=ol((()=>{var t=ph(r);return l||(null==t?void 0:t.lastQuestionIndex)||0})),g=ul((()=>oh(r)),[r]);al((()=>{v&&!tr(l)&&p(l)}),[l,v]);var m=g.at(f);return m?_h("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=r.appearance)?void 0:e.hideCancelButton)&&_h(Nh,{onClick:()=>{u()}}),_h("div",{className:"survey-box",children:lc({question:m,forceDisableHtml:n,displayQuestionIndex:f,appearance:r.appearance||zu,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:l}=t;if(s)if(l){var u=Yu(l),h=i({},o,{[u]:e});a(h);var c=Xh(r,n,e),v=c===Sl.End;v||(p(c),fh(r,{surveySubmissionId:d,responses:h,lastQuestionIndex:c})),(r.enable_partial_responses||v)&&Qu({responses:h,survey:r,surveySubmissionId:d,isSurveyCompleted:v,posthog:s})}else El.error("onNextButtonClick called without a questionId.");else El.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:f,questionId:m.id}),onPreviewSubmit:c,initialValue:m.id?o[Yu(m.id)]:void 0})})]}):null}function ac(t){var e,i,r,n,s,o,a,{survey:l,forceDisableHtml:u,posthog:h,readOnly:c}=t,[d,v]=ol(!0),[f,p]=ol(!1),[g,m]=ol({}),y=()=>{p(!f)};if(al((()=>{var t;if(h){if(!c){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&m({top:"50%",bottom:"auto"});var e=t=>{var e,i=t;(null==(e=i.detail)?void 0:e.surveyId)===l.id&&(El.info("Received show event for feedback button survey "+l.id),m(i.detail.position||{}),y())};return Cs(Gh,Wh,e),()=>{Gh.removeEventListener(Wh,e)}}}else El.error("FeedbackWidget called without a PostHog instance.")}),[h,c,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(i=l.appearance)?void 0:i.widgetSelector,null==(r=l.appearance)?void 0:r.borderColor]),ic({survey:l,setSurveyVisible:v}),!d)return null;var b=()=>{l.schedule!==kl.Always&&v(!1),setTimeout((()=>{p(!1)}),200)};return _h(Aa,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&_h("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===wl.Top?"widget-tab-top":""),onClick:y,disabled:c,style:nc(null==(o=l.appearance)?void 0:o.tabPosition),children:(null==(a=l.appearance)?void 0:a.widgetLabel)||""}),f&&_h(sc,{posthog:h,survey:l,forceDisableHtml:u,style:g,onPopupSurveyDismissed:b,onCloseConfirmationMessage:b})]})}var lc=t=>{var{question:e,forceDisableHtml:r,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:l}=t,u={forceDisableHtml:r,appearance:s,onPreviewSubmit:t=>{a(t)},onSubmit:t=>{o(t)},initialValue:l,displayQuestionIndex:n};switch(e.type){case Cl.Open:return ka(Ph,i({},u,{question:e,key:e.id}));case Cl.Link:return ka(Lh,i({},u,{question:e,key:e.id}));case Cl.Rating:return ka(Dh,i({},u,{question:e,key:e.id}));case Cl.SingleChoice:case Cl.MultipleChoice:return ka(Zh,i({},u,{question:e,key:e.id}));default:return El.error("Unsupported question type: "+e.type),null}};rs.__PosthogExtensions__=rs.__PosthogExtensions__||{},rs.__PosthogExtensions__.generateSurveys=ec,rs.extendPostHogWithSurveys=ec;var uc=us("[Error tracking]");function hc(){return new _n([new On,new jn,new Ln,new Pn,new Hn,new qn,new Bn,new Vn],Fn("web:javascript",An,Mn))}class cc{constructor(t){var e,i;this.et=[],this.it=hc(),this._instance=t,this.et=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property(Ds))&&void 0!==e?e:[]}onRemoteConfig(t){var e,i,r,n=null!==(e=null==(i=t.errorTracking)?void 0:i.suppressionRules)&&void 0!==e?e:[],s=null==(r=t.errorTracking)?void 0:r.captureExtensionExceptions;this.et=n,this._instance.persistence&&this._instance.persistence.register({[Ds]:this.et,[Bs]:s})}get rt(){var t,e=!!this._instance.get_property(Bs),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=i?i:e)&&void 0!==t&&t}buildProperties(t,e){return this.it.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}sendExceptionEvent(t){var e=t.$exception_list;if(this.nt(e)){if(this.st(e))return void uc.info("Skipping exception capture because a suppression rule matched");if(!this.rt&&this.ot(e))return void uc.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ut(e))return void uc.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}st(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:i,value:r}=e;return er(i)&&i.length>0&&t.$exception_types.push(i),er(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.et.some((t=>{var i=t.values.map((t=>{var i,r=Zu[t.operator],n=Ui(t.value)?t.value:[t.value],s=null!==(i=e[t.key])&&void 0!==i?i:[];return n.length>0&&r(n,s)}));return"OR"===t.type?i.some(Boolean):i.every(Boolean)}))}ot(t){var e=t.flatMap((t=>{var e,i;return null!==(e=null==(i=t.stacktrace)?void 0:i.frames)&&void 0!==e?e:[]}));return e.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ut(t){if(t.length>0){var e,i,r,n,s=null!==(e=null==(i=t[0].stacktrace)?void 0:i.frames)&&void 0!==e?e:[],o=s[s.length-1];return null!==(r=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}nt(t){return!nr(t)&&Ui(t)}}var dc=us("[ExceptionAutocapture]"),vc=hc(),fc={wrapOnError:t=>{var e=Yn;e||dc.info("window not available, cannot wrap onerror");var i=e.onerror;return e.onerror=function(){for(var e,r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];var o=n[4],a=n[0],l=vc.buildFromUnknown(o||a,{mechanism:{handled:!1}});return t(l),null!==(e=null==i?void 0:i(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=i}},wrapUnhandledRejection:t=>{var e=Yn;e||dc.info("window not available, cannot wrap onUnhandledRejection");var i=e.onunhandledrejection;return e.onunhandledrejection=function(r){var n,s=vc.buildFromUnknown(r,{mechanism:{handled:!1}});return t(s),null!==(n=null==i?void 0:i.apply(e,[r]))&&void 0!==n&&n},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=i}},wrapConsoleError:t=>{var e=console;e||dc.info("console not available, cannot wrap console.error");var i=e.error;return e.error=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var s=r.join(" "),o=r.find((t=>t instanceof Error)),a=vc.buildFromUnknown(o||s,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException")});return t(a),null==i?void 0:i(...r)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=i}}};rs.__PosthogExtensions__=rs.__PosthogExtensions__||{},rs.__PosthogExtensions__.errorWrappingFunctions=fc,rs.posthogErrorWrappingFunctions=fc;var pc=(t,e,i,r)=>{var n;try{n=new URL(r.url).hostname}catch(t){return}if(!Ui(t)||t.includes(n)){if(i){var{sessionId:s,windowId:o}=i.checkAndGetSessionAndWindowId(!0);r.headers.set("X-POSTHOG-SESSION-ID",s),r.headers.set("X-POSTHOG-WINDOW-ID",o)}e!==ao&&r.headers.set("X-POSTHOG-DISTINCT-ID",e)}};rs.__PosthogExtensions__=rs.__PosthogExtensions__||{};var gc={_patchFetch:(t,i,r)=>Es(Yn,"fetch",(n=>function(){var s=e((function*(e,s){var o=new Request(e,s);return pc(t,i,r,o),n(o)}));return function(t,e){return s.apply(this,arguments)}}())),_patchXHR:(t,e,i)=>Es(Yn.XMLHttpRequest.prototype,"open",(r=>function(n,s,o,a,l){void 0===o&&(o=!0);var u=new Request(s);return pc(t,e,i,u),r.call(this,n,u.url,o,a,l)}))};rs.__PosthogExtensions__.tracingHeadersPatchFns=gc,rs.postHogTracingHeadersPatchFns=gc;var mc,yc,bc=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},_c=function(t){if("loading"===document.readyState)return"loading";var e=bc();if(e){if(t<e.domInteractive)return"loading";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return"dom-interactive";if(0===e.domComplete||t<e.domComplete)return"dom-content-loaded"}return"complete"},wc=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Ic=function(t,e){var i="";try{for(;t&&9!==t.nodeType;){var r=t,n=r.id?"#"+r.id:wc(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(i.length+n.length>(e||100)-1)return i||n;if(i=i?n+">"+i:n,r.id)break;t=r.parentNode}}catch(t){}return i},Cc=-1,Sc=function(){return Cc},kc=function(t){addEventListener("pageshow",(function(e){e.persisted&&(Cc=e.timeStamp,t(e))}),!0)},xc=function(){var t=bc();return t&&t.activationStart||0},Ac=function(t,e){var i=bc(),r="navigate";return Sc()>=0?r="back-forward-cache":i&&(document.prerendering||xc()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-"))),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Tc=function(t,e,i){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return r.observe(Object.assign({type:t,buffered:!0},i||{})),r}}catch(t){}},Ec=function(t,e,i,r){var n,s;return function(o){e.value>=0&&(o||r)&&((s=e.value-(n||0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,i),t(e))}},Mc=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},Nc=function(t){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t()}))},Rc=function(t){var e=!1;return function(){e||(t(),e=!0)}},Fc=-1,Oc=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Pc=function(t){"hidden"===document.visibilityState&&Fc>-1&&(Fc="visibilitychange"===t.type?t.timeStamp:0,Dc())},Lc=function(){addEventListener("visibilitychange",Pc,!0),addEventListener("prerenderingchange",Pc,!0)},Dc=function(){removeEventListener("visibilitychange",Pc,!0),removeEventListener("prerenderingchange",Pc,!0)},Bc=function(){return Fc<0&&(Fc=Oc(),Lc(),kc((function(){setTimeout((function(){Fc=Oc(),Lc()}),0)}))),{get firstHiddenTime(){return Fc}}},Zc=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},$c=[1800,3e3],qc=function(t,e){e=e||{},Zc((function(){var i,r=Bc(),n=Ac("FCP"),s=Tc("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(s.disconnect(),t.startTime<r.firstHiddenTime&&(n.value=Math.max(t.startTime-xc(),0),n.entries.push(t),i(!0)))}))}));s&&(i=Ec(t,n,$c,e.reportAllChanges),kc((function(r){n=Ac("FCP"),i=Ec(t,n,$c,e.reportAllChanges),Mc((function(){n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},Hc=[.1,.25],Vc=0,jc=1/0,Yc=0,Gc=function(t){t.forEach((function(t){t.interactionId&&(jc=Math.min(jc,t.interactionId),Yc=Math.max(Yc,t.interactionId),Vc=Yc?(Yc-jc)/7+1:0)}))},zc=function(){return mc?Vc:performance.interactionCount||0},Wc=function(){"interactionCount"in performance||mc||(mc=Tc("event",Gc,{type:"event",buffered:!0,durationThreshold:0}))},Uc=[],Xc=new Map,Jc=0,Kc=[],Qc=function(t){if(Kc.forEach((function(e){return e(t)})),t.interactionId||"first-input"===t.entryType){var e=Uc[Uc.length-1],i=Xc.get(t.interactionId);if(i||Uc.length<10||t.duration>e.latency){if(i)t.duration>i.latency?(i.entries=[t],i.latency=t.duration):t.duration===i.latency&&t.startTime===i.entries[0].startTime&&i.entries.push(t);else{var r={id:t.interactionId,latency:t.duration,entries:[t]};Xc.set(r.id,r),Uc.push(r)}Uc.sort((function(t,e){return e.latency-t.latency})),Uc.length>10&&Uc.splice(10).forEach((function(t){return Xc.delete(t.id)}))}}},td=function(t){var e=self.requestIdleCallback||self.setTimeout,i=-1;return t=Rc(t),"hidden"===document.visibilityState?t():(i=e(t),Nc(t)),i},ed=[200,500],id=function(t,e){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(e=e||{},Zc((function(){var i;Wc();var r,n=Ac("INP"),s=function(t){td((function(){t.forEach(Qc);var e=function(){var t=Math.min(Uc.length-1,Math.floor((zc()-Jc)/50));return Uc[t]}();e&&e.latency!==n.value&&(n.value=e.latency,n.entries=e.entries,r())}))},o=Tc("event",s,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});r=Ec(t,n,ed,e.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),Nc((function(){s(o.takeRecords()),r(!0)})),kc((function(){Jc=zc(),Uc.length=0,Xc.clear(),n=Ac("INP"),r=Ec(t,n,ed,e.reportAllChanges)})))})))},rd=[],nd=[],sd=0,od=new WeakMap,ad=new Map,ld=-1,ud=function(t){rd=rd.concat(t),hd()},hd=function(){ld<0&&(ld=td(cd))},cd=function(){ad.size>10&&ad.forEach((function(t,e){Xc.has(e)||ad.delete(e)}));var t=Uc.map((function(t){return od.get(t.entries[0])})),e=nd.length-50;nd=nd.filter((function(i,r){return r>=e||t.includes(i)}));for(var i=new Set,r=0;r<nd.length;r++){var n=nd[r];dd(n.startTime,n.processingEnd).forEach((function(t){i.add(t)}))}var s=rd.length-1-50;rd=rd.filter((function(t,e){return t.startTime>sd&&e>s||i.has(t)})),ld=-1};Kc.push((function(t){t.interactionId&&t.target&&!ad.has(t.interactionId)&&ad.set(t.interactionId,t.target)}),(function(t){var e,i=t.startTime+t.duration;sd=Math.max(sd,t.processingEnd);for(var r=nd.length-1;r>=0;r--){var n=nd[r];if(Math.abs(i-n.renderTime)<=8){(e=n).startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd),e.entries.push(t);break}}e||(e={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:i,entries:[t]},nd.push(e)),(t.interactionId||"first-input"===t.entryType)&&od.set(t,e),hd()}));var dd=function(t,e){for(var i,r=[],n=0;i=rd[n];n++)if(!(i.startTime+i.duration<t)){if(i.startTime>e)break;r.push(i)}return r},vd=[2500,4e3],fd={},pd={onLCP:function(t,e){!function(t,e){e=e||{},Zc((function(){var i,r=Bc(),n=Ac("LCP"),s=function(t){e.reportAllChanges||(t=t.slice(-1)),t.forEach((function(t){t.startTime<r.firstHiddenTime&&(n.value=Math.max(t.startTime-xc(),0),n.entries=[t],i())}))},o=Tc("largest-contentful-paint",s);if(o){i=Ec(t,n,vd,e.reportAllChanges);var a=Rc((function(){fd[n.id]||(s(o.takeRecords()),o.disconnect(),fd[n.id]=!0,i(!0))}));["keydown","click"].forEach((function(t){addEventListener(t,(function(){return td(a)}),{once:!0,capture:!0})})),Nc(a),kc((function(r){n=Ac("LCP"),i=Ec(t,n,vd,e.reportAllChanges),Mc((function(){n.value=performance.now()-r.timeStamp,fd[n.id]=!0,i(!0)}))}))}}))}((function(e){var i=function(t){var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var i=bc();if(i){var r=i.activationStart||0,n=t.entries[t.entries.length-1],s=n.url&&performance.getEntriesByType("resource").filter((function(t){return t.name===n.url}))[0],o=Math.max(0,i.responseStart-r),a=Math.max(o,s?(s.requestStart||s.startTime)-r:0),l=Math.max(a,s?s.responseEnd-r:0),u=Math.max(l,n.startTime-r);e={element:Ic(n.element),timeToFirstByte:o,resourceLoadDelay:a-o,resourceLoadDuration:l-a,elementRenderDelay:u-l,navigationEntry:i,lcpEntry:n},n.url&&(e.url=n.url),s&&(e.lcpResourceEntry=s)}}return Object.assign(t,{attribution:e})}(e);t(i)}),e)},onCLS:function(t,e){!function(t,e){e=e||{},qc(Rc((function(){var i,r=Ac("CLS",0),n=0,s=[],o=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=s[0],i=s[s.length-1];n&&t.startTime-i.startTime<1e3&&t.startTime-e.startTime<5e3?(n+=t.value,s.push(t)):(n=t.value,s=[t])}})),n>r.value&&(r.value=n,r.entries=s,i())},a=Tc("layout-shift",o);a&&(i=Ec(t,r,Hc,e.reportAllChanges),Nc((function(){o(a.takeRecords()),i(!0)})),kc((function(){n=0,r=Ac("CLS",0),i=Ec(t,r,Hc,e.reportAllChanges),Mc((function(){return i()}))})),setTimeout(i,0))})))}((function(e){var i=function(t){var e,i={};if(t.entries.length){var r=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(r&&r.sources&&r.sources.length){var n=(e=r.sources).find((function(t){return t.node&&1===t.node.nodeType}))||e[0];n&&(i={largestShiftTarget:Ic(n.node),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:n,largestShiftEntry:r,loadState:_c(r.startTime)})}}return Object.assign(t,{attribution:i})}(e);t(i)}),e)},onFCP:function(t,e){qc((function(e){var i=function(t){var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:_c(Sc())};if(t.entries.length){var i=bc(),r=t.entries[t.entries.length-1];if(i){var n=i.activationStart||0,s=Math.max(0,i.responseStart-n);e={timeToFirstByte:s,firstByteToFCP:t.value-s,loadState:_c(t.entries[0].startTime),navigationEntry:i,fcpEntry:r}}}return Object.assign(t,{attribution:e})}(e);t(i)}),e)},onINP:function(t,e){yc||(yc=Tc("long-animation-frame",ud)),id((function(e){var i=function(t){var e=t.entries[0],i=od.get(e),r=e.processingStart,n=i.processingEnd,s=i.entries.sort((function(t,e){return t.processingStart-e.processingStart})),o=dd(e.startTime,n),a=t.entries.find((function(t){return t.target})),l=a&&a.target||ad.get(e.interactionId),u=[e.startTime+e.duration,n].concat(o.map((function(t){return t.startTime+t.duration}))),h=Math.max.apply(Math,u),c={interactionTarget:Ic(l),interactionTargetElement:l,interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:h,processedEventEntries:s,longAnimationFrameEntries:o,inputDelay:r-e.startTime,processingDuration:n-r,presentationDelay:Math.max(h-n,0),loadState:_c(e.startTime)};return Object.assign(t,{attribution:c})}(e);t(i)}),e)}};rs.__PosthogExtensions__=rs.__PosthogExtensions__||{},rs.__PosthogExtensions__.postHogWebVitalsCallbacks=pd,rs.postHogWebVitalsCallbacks=pd;class gd{constructor(t){this.disabled=!1===t;var e=Ki(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&i-r.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:e,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:i}];return!1}}var md="$copy_autocapture",yd=us("[AutoCapture]");function bd(t,e){return e.length>t?e.slice(0,t)+"...":e}function _d(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!ho(e));return e}function wd(t,e,i,r){var n=t.tagName.toLowerCase(),s={tag_name:n};wo.indexOf(n)>-1&&!i&&("a"===n.toLowerCase()||"button"===n.toLowerCase()?s.$el_text=bd(1024,$o(t)):s.$el_text=bd(1024,bo(t)));var o=mo(t);o.length>0&&(s.classes=o.filter((function(t){return""!==t}))),ds(t.attributes,(function(i){var n;if((!Ro(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&((null==r||!r.includes(i.name))&&!e&&Zo(i.value)&&(n=i.name,!er(n)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7)))){var o=i.value;"class"===i.name&&(o=po(o).join(" ")),s["attr__"+i.name]=bd(1024,o)}}));for(var a=1,l=1,u=t;u=_d(u);)a++,u.tagName===t.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}function Id(t,e){for(var i,r,{e:n,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=e,u=[t],h=t;h.parentNode&&!co(h,"body");)fo(h.parentNode)?(u.push(h.parentNode.host),h=h.parentNode.host):(u.push(h.parentNode),h=h.parentNode);var c,d=[],v={},f=!1,p=!1;if(ds(u,(t=>{var e=No(t);"a"===t.tagName.toLowerCase()&&(f=t.getAttribute("href"),f=e&&f&&Zo(f)&&f),Hi(mo(t),"ph-no-capture")&&(p=!0),d.push(wd(t,s,o,a));var i=function(t){if(!No(t))return{};var e={};return ds(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var i=t.name.replace("data-ph-capture-attribute-",""),r=t.value;i&&r&&Zo(r)&&(e[i]=r)}})),e}(t);vs(v,i)})),p)return{props:{},explicitNoCapture:p};if(o||("a"===t.tagName.toLowerCase()||"button"===t.tagName.toLowerCase()?d[0].$el_text=$o(t):d[0].$el_text=bo(t)),f){var g,m;d[0].attr__href=f;var y=null==(g=Ss(f))?void 0:g.host,b=null==Yn||null==(m=Yn.location)?void 0:m.host;y&&b&&y!==b&&(c=f)}return{props:vs({$event_type:n.type,$ce_version:1},l?{}:{$elements:d},{$elements_chain:Ho(d)},null!=(i=d[0])&&i.$el_text?{$el_text:null==(r=d[0])?void 0:r.$el_text}:{},c&&"click"===n.type?{$external_click_url:c}:{},v)}}class Cd{constructor(t){this.ht=!1,this.ct=null,this.dt=!1,this.instance=t,this.rageclicks=new gd(t.config.rageclick),this.vt=null}get ft(){var t,e,i=Ki(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(t=i.url_allowlist)?void 0:t.map((t=>new RegExp(t))),i.url_ignorelist=null==(e=i.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),i}yt(){if(this.isBrowserSupported()){if(Yn&&Jn){var t=t=>{t=t||(null==Yn?void 0:Yn.event);try{this.bt(t)}catch(t){yd.error("Failed to capture event",t)}};if(Cs(Jn,"submit",t,{capture:!0}),Cs(Jn,"change",t,{capture:!0}),Cs(Jn,"click",t,{capture:!0}),this.ft.capture_copied_text){var e=t=>{t=t||(null==Yn?void 0:Yn.event),this.bt(t,md)};Cs(Jn,"copy",e,{capture:!0}),Cs(Jn,"cut",e,{capture:!0})}}}else yd.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.ht&&(this.yt(),this.ht=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.dt=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Os]:!!t.autocapture_opt_out}),this.ct=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.vt=t}getElementSelectors(t){var e,i=[];return null==(e=this.vt)||e.forEach((e=>{var r=null==Jn?void 0:Jn.querySelectorAll(e);null==r||r.forEach((r=>{t===r&&i.push(e)}))})),i}get isEnabled(){var t,e,i=null==(t=this.instance.persistence)?void 0:t.props[Os],r=this.ct;if(rr(r)&&!or(i)&&!this.instance._t())return!1;var n=null!==(e=this.ct)&&void 0!==e?e:!!i;return!!this.instance.config.autocapture&&!n}bt(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var i,r=_o(t);if(vo(r)&&(r=r.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent)this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&Ao(r,this.instance.config.rageclick)&&this.bt(t,"$rageclick");var n=e===md;if(r&&Mo(r,t,this.ft,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=Id(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.ft.element_attribute_ignorelist,elementsChainAsString:this.dt});if(o)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(s.$element_selectors=a),e===md){var l,u=yo(null==Yn||null==(l=Yn.getSelection())?void 0:l.toString()),h=t.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=h}return this.instance.capture(e,s),!0}}}isBrowserSupported(){return Xi(null==Jn?void 0:Jn.querySelectorAll)}}var Sd={};function kd(t){return function(t,e){var i=Sd[t];if(i)return i;var r=e[t];if(Ji(r)&&!ns())return Sd[t]=r.bind(e);var n=e.document;if(n&&Xi(n.createElement))try{var s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);var o=s.contentWindow;o&&o[t]&&(r=o[t]),n.head.removeChild(s)}catch(e){ls.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return r&&Xi(r)?Sd[t]=r.bind(e):r}("MutationObserver",t)}function xd(t,e){return sr(t)&&t>=e}class Ad{wt(t){var e,i,r,n,s,o=this.It((null==t?void 0:t.__onCapture)||this.Ct.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:o.element_attribute_ignorelist,scroll_threshold_ms:null!==(i=null==t?void 0:t.scroll_threshold_ms)&&void 0!==i?i:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==r?r:o.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:o.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:o.capture_clicks_with_modifier_keys,__onCapture:o.__onCapture}}constructor(t,e){this.St=[],this.It=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:t}),this.kt=t=>{var e=function(t){var e=_o(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);rr(e)||this.xt(e)||this.St.push(e),this.St.length&&tr(this.At)&&(this.At=rs.setTimeout((()=>{this.Tt()}),1e3))},this.Et=()=>{var t=Date.now();t%50==0&&this.St.forEach((e=>{tr(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Mt=()=>{this.Nt=Date.now()},this.instance=t,this.ft=this.wt(e),this._onCapture=this.ft.__onCapture}start(t){this.Rt(),this.Ft(),this.Ot(),this.Pt(t)}Pt(t){if(!this.Lt){var e=kd(rs);this.Lt=new e((t=>{this.Dt(t)})),this.Lt.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Lt)||t.disconnect(),this.Lt=void 0,rs.removeEventListener("click",this.kt),rs.removeEventListener("scroll",this.Et,{capture:!0}),rs.removeEventListener("selectionchange",this.Mt)}Dt(t){this.Bt=Date.now()}Rt(){Cs(rs,"click",this.kt)}Ft(){Cs(rs,"scroll",this.Et,{capture:!0})}Ot(){Cs(rs,"selectionchange",this.Mt)}xt(t){if(!t)return!0;if(!this.ft.capture_clicks_with_modifier_keys&&((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))return!0;var e;if(uo(t.node))return!0;var i=this.St.some((e=>e.node===t.node&&Math.abs(e.timestamp-t.timestamp)<1e3));return!!i||!(!co(t.node,"html")&&ho(t.node)&&!wo.includes(t.node.tagName.toLowerCase()))}Tt(){if(this.St.length){clearTimeout(this.At),this.At=void 0;var t=this.St;for(var e of(this.St=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.Bt&&e.timestamp<=this.Bt?this.Bt-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Nt&&e.timestamp<=this.Nt?this.Nt-e.timestamp:void 0;var r=xd(e.scrollDelayMs,this.ft.scroll_threshold_ms),n=xd(e.selectionChangedDelayMs,this.ft.selection_change_threshold_ms),s=xd(e.mutationDelayMs,this.ft.mutation_threshold_ms),o=xd(e.absoluteDelayMs,1.1*this.ft.mutation_threshold_ms),a=sr(e.scrollDelayMs)&&e.scrollDelayMs<this.ft.scroll_threshold_ms,l=sr(e.mutationDelayMs)&&e.mutationDelayMs<this.ft.mutation_threshold_ms,u=sr(e.selectionChangedDelayMs)&&e.selectionChangedDelayMs<this.ft.selection_change_threshold_ms;a||l||u||(r||s||o||n?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.Bt,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:r,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:n}):e.absoluteDelayMs<this.ft.mutation_threshold_ms&&this.St.push(e))}this.St.length&&tr(this.At)&&(this.At=rs.setTimeout((()=>{this.Tt()}),1e3))}}Ct(t,e){this.instance.capture("$dead_click",i({},e,Id(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.ft.element_attribute_ignorelist,elementsChainAsString:!1}).props,{$dead_click_scroll_delay_ms:t.scrollDelayMs,$dead_click_mutation_delay_ms:t.mutationDelayMs,$dead_click_absolute_delay_ms:t.absoluteDelayMs,$dead_click_selection_changed_delay_ms:t.selectionChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}rs.__PosthogExtensions__=rs.__PosthogExtensions__||{},rs.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Ad(t,e);var Td=us("[ExternalScriptsLoader]"),Ed=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return Td.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=null==Jn?void 0:Jn.querySelectorAll("script");if(r)for(var n,s=function(){if(r[o].src===e){var t=r[o];return t.__posthog_loading_callback_fired?{v:i()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,i(void 0,e)})),t.onerror=t=>i(t),{v:void 0})}},o=0;o<r.length;o++)if(n=s())return n.v;var a=()=>{if(!Jn)return i("document not found");var r=Jn.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=e,r.onload=t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)},r.onerror=t=>i(t),t.config.prepare_external_dependency_script&&(r=t.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");var n,s=Jn.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(r,s[0]):Jn.body.appendChild(r)};null!=Jn&&Jn.body?a():null==Jn||Jn.addEventListener("DOMContentLoaded",a)};rs.__PosthogExtensions__=rs.__PosthogExtensions__||{},rs.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{var r="/static/"+e+".js?v="+t.version;if("remote-config"===e&&(r="/array/"+t.config.token+"/config.js"),"toolbar"===e){var n=3e5;r=r+"&t="+Math.floor(Date.now()/n)*n}var s=t.requestRouter.endpointFor("assets",r);Ed(t,s,i)},rs.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);Ed(t,r,i)};var Md="";var Nd=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Rd(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=Jn),Md)return Md;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),r=Math.min(i.length,8),n="dmn_chk_"+zl();!Md&&r--;){var s=i.slice(r).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",Md=s)}return Md}(t);if(!i){var r=(t=>{var e=t.match(Nd);return e?e[0]:""})(t);r!==i&&ls.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}var Fd={Zt:()=>!!Jn,$t:function(t){ls.error("cookieStore error: "+t)},qt:function(t){if(Jn){try{for(var e=t+"=",i=Jn.cookie.split(";").filter((t=>t.length)),r=0;r<i.length;r++){for(var n=i[r];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},Ht:function(t){var e;try{e=JSON.parse(Fd.qt(t))||{}}catch(t){}return e},Vt:function(t,e,i,r,n){if(Jn)try{var s="",o="",a=Rd(Jn.location.hostname,r);if(i){var l=new Date;l.setTime(l.getTime()+24*i*60*60*1e3),s="; expires="+l.toUTCString()}n&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ls.warn("cookieStore warning: large cookie, len="+u.length),Jn.cookie=u,u}catch(t){return}},jt:function(t,e){if(null!=Jn&&Jn.cookie)try{Fd.Vt(t,"",-1,e)}catch(t){return}}},Od=null,Pd={Zt:function(){if(!rr(Od))return Od;var t=!0;if(tr(Yn))t=!1;else try{var e="__mplssupport__";Pd.Vt(e,"xyz"),'"xyz"'!==Pd.qt(e)&&(t=!1),Pd.jt(e)}catch(e){t=!1}return t||ls.error("localStorage unsupported; falling back to cookie store"),Od=t,t},$t:function(t){ls.error("localStorage error: "+t)},qt:function(t){try{return null==Yn?void 0:Yn.localStorage.getItem(t)}catch(t){Pd.$t(t)}return null},Ht:function(t){try{return JSON.parse(Pd.qt(t))||{}}catch(t){}return null},Vt:function(t,e){try{null==Yn||Yn.localStorage.setItem(t,JSON.stringify(e))}catch(t){Pd.$t(t)}},jt:function(t){try{null==Yn||Yn.localStorage.removeItem(t)}catch(t){Pd.$t(t)}}},Ld=["$device_id","distinct_id",js,Ys,so,no],Dd={},Bd={Zt:function(){return!0},$t:function(t){ls.error("memoryStorage error: "+t)},qt:function(t){return Dd[t]||null},Ht:function(t){return Dd[t]||null},Vt:function(t,e){Dd[t]=e},jt:function(t){delete Dd[t]}},Zd=null,$d={Zt:function(){if(!rr(Zd))return Zd;if(Zd=!0,tr(Yn))Zd=!1;else try{var t="__support__";$d.Vt(t,"xyz"),'"xyz"'!==$d.qt(t)&&(Zd=!1),$d.jt(t)}catch(t){Zd=!1}return Zd},$t:function(t){ls.error("sessionStorage error: ",t)},qt:function(t){try{return null==Yn?void 0:Yn.sessionStorage.getItem(t)}catch(t){$d.$t(t)}return null},Ht:function(t){try{return JSON.parse($d.qt(t))||null}catch(t){}return null},Vt:function(t,e){try{null==Yn||Yn.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){$d.$t(t)}},jt:function(t){try{null==Yn||Yn.sessionStorage.removeItem(t)}catch(t){$d.$t(t)}}},qd=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class Hd{constructor(t){this._instance=t}get ft(){return this._instance.config}get consent(){return this.Yt()?qd.DENIED:this.Gt}isOptedOut(){return"always"===this.ft.cookieless_mode||(this.consent===qd.DENIED||this.consent===qd.PENDING&&(this.ft.opt_out_capturing_by_default||"on_reject"===this.ft.cookieless_mode))}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===qd.DENIED}optInOut(t){this.zt.Vt(this.Wt,t?1:0,this.ft.cookie_expiration,this.ft.cross_subdomain_cookie,this.ft.secure_cookie)}reset(){this.zt.jt(this.Wt,this.ft.cross_subdomain_cookie)}get Wt(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:i}=this._instance.config;return i||(e?e+t:"__ph_opt_in_out_"+t)}get Gt(){var t=this.zt.qt(this.Wt);return vr(t)?qd.GRANTED:Hi(fr,t)?qd.DENIED:qd.PENDING}get zt(){if(!this.Ut){var t=this.ft.opt_out_capturing_persistence_type;this.Ut="localStorage"===t?Pd:Fd;var e="localStorage"===t?Fd:Pd;e.qt(this.Wt)&&(this.Ut.qt(this.Wt)||this.optInOut(vr(e.qt(this.Wt))),e.jt(this.Wt,this.ft.cross_subdomain_cookie))}return this.Ut}Yt(){return!!this.ft.respect_dnt&&!!Is([null==Xn?void 0:Xn.doNotTrack,null==Xn?void 0:Xn.msDoNotTrack,rs.doNotTrack],(t=>vr(t)))}}var Vd=us("[Dead Clicks]"),jd=()=>!0,Yd=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property($s)),r=t.instance.config.capture_dead_clicks;return or(r)?r:!!Ki(r)||i};class Gd{get lazyLoadedDeadClicksAutocapture(){return this.Xt}constructor(t,e,i){this.instance=t,this.isEnabled=e,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[$s]:null==t?void 0:t.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.Jt((()=>{this.Kt()}))}Jt(t){var e,i;null!=(e=rs.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(i=rs.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Vd.error("failed to load script",e):t()}))}Kt(){var t;if(Jn){if(!this.Xt&&null!=(t=rs.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Ki(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.Xt=rs.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.Xt.start(Jn),Vd.info("starting...")}}else Vd.error("`document` not found. Cannot start.")}stop(){this.Xt&&(this.Xt.stop(),this.Xt=void 0,Vd.info("stopping..."))}}var zd=us("[ExceptionAutocapture]");class Wd{constructor(t){var e,i,r;this.Qt=()=>{var t;if(Yn&&this.isEnabled&&null!=(t=rs.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=rs.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=rs.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=rs.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.te&&this.ft.capture_unhandled_errors&&(this.te=e(this.captureException.bind(this))),!this.ee&&this.ft.capture_unhandled_rejections&&(this.ee=i(this.captureException.bind(this))),!this.ie&&this.ft.capture_console_errors&&(this.ie=r(this.captureException.bind(this)))}catch(t){zd.error("failed to start",t),this.re()}}},this._instance=t,this.ne=!(null==(e=this._instance.persistence)||!e.props[Ls]),this.se=new gr({refillRate:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==i?i:1,bucketSize:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10,refillInterval:1e4,I:zd}),this.ft=this.oe(),this.startIfEnabledOrStop()}oe(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ki(t)?e=i({},e,t):(tr(t)?this.ne:t)&&(e=i({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.ft.capture_console_errors||this.ft.capture_unhandled_errors||this.ft.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(zd.info("enabled"),this.re(),this.Jt(this.Qt)):this.re()}Jt(t){var e,i;null!=(e=rs.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(i=rs.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return zd.error("failed to load script",e);t()}))}re(){var t,e,i;null==(t=this.te)||t.call(this),this.te=void 0,null==(e=this.ee)||e.call(this),this.ee=void 0,null==(i=this.ie)||i.call(this),this.ie=void 0}onRemoteConfig(t){var e=t.autocaptureExceptions;this.ne=!!e||!1,this._instance.persistence&&this._instance.persistence.register({[Ls]:this.ne}),this.ft=this.oe(),this.startIfEnabledOrStop()}onConfigChange(){this.ft=this.oe()}captureException(t){var e,i,r=null!==(e=null==t||null==(i=t.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==e?e:"Exception";this.se.consumeRateLimit(r)?zd.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(t)}}class Ud{constructor(t){var e;this._instance=t,this.ae=(null==Yn||null==(e=Yn.location)?void 0:e.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(ls.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.le&&this.le(),this.le=void 0,ls.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(Yn&&Yn.history){var i=this;null!=(t=Yn.history.pushState)&&t.__posthog_wrapped__||Es(Yn.history,"pushState",(t=>function(e,r,n){t.call(this,e,r,n),i.ue("pushState")})),null!=(e=Yn.history.replaceState)&&e.__posthog_wrapped__||Es(Yn.history,"replaceState",(t=>function(e,r,n){t.call(this,e,r,n),i.ue("replaceState")})),this.he()}}ue(t){try{var e,i=null==Yn||null==(e=Yn.location)?void 0:e.pathname;if(!i)return;i!==this.ae&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.ae=i}catch(e){ls.error("Error capturing "+t+" pageview",e)}}he(){if(!this.le){var t=()=>{this.ue("popstate")};Cs(Yn,"popstate",t),this.le=()=>{Yn&&Yn.removeEventListener("popstate",t)}}}}var Xd=us("[SegmentIntegration]");function Jd(t,e){var i=t.config.segment;if(!i)return e();!function(t,e){var i=t.config.segment;if(!i)return e();var r=i=>{var r=()=>i.anonymousId()||zl();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(Qs,"identified")),e()},n=i.user();"then"in n&&Xi(n.then)?n.then(r):r(n)}(t,(()=>{i.register((t=>{Promise&&Promise.resolve||Xd.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,i)=>{if(!i)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(Xd.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Xd.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var r=t.calculateEventProperties(i,e.event.properties);return e.event.properties=Object.assign({},r,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,"$pageview"),identify:t=>e(t,"$identify"),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}var Kd="posthog-js";function Qd(t,e){var{organization:r,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var l,u,h,c,d;if(!("*"===o||o.includes(e.level))||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f=(null==(l=e.exception)?void 0:l.values)||[],p=f.map((t=>i({},t,{stacktrace:t.stacktrace?i({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>i({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(u=f[0])?void 0:u.value)||e.message,$exception_type:null==(h=f[0])?void 0:h.type,$exception_level:e.level,$exception_list:p,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||e.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:e.tags};return r&&n&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+e.event_id),a&&t.exceptions.sendExceptionEvent(g),e}}class tv{constructor(t,e,i,r,n,s){this.name=Kd,this.setupOnce=function(o){o(Qd(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}var ev=null!=Yn&&Yn.location?Ts(Yn.location.hash,"__posthog")||Ts(location.hash,"state"):null,iv="_postHogToolbarParams",rv=us("[Toolbar]"),nv=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(nv||{});class sv{constructor(t){this.instance=t}ce(t){rs.ph_toolbar_state=t}de(){var t;return null!==(t=rs.ph_toolbar_state)&&void 0!==t?t:nv.UNINITIALIZED}maybeLoadToolbar(t,e,i){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),!Yn||!Jn)return!1;t=null!=t?t:Yn.location,i=null!=i?i:Yn.history;try{if(!e){try{Yn.localStorage.setItem("test","test"),Yn.localStorage.removeItem("test")}catch(t){return!1}e=null==Yn?void 0:Yn.localStorage}var r,n=ev||Ts(t.hash,"__posthog")||Ts(t.hash,"state"),s=n?gs((()=>JSON.parse(atob(decodeURIComponent(n)))))||gs((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?t.hash=s.desiredHash:i?i.replaceState(i.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(iv)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch(t){return!1}}ve(t){var e=rs.ph_load_toolbar||rs.ph_load_editor;!nr(e)&&Xi(e)?e(t,this.instance):rv.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==Jn||!Jn.getElementById(oo));if(!Yn||e)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=i({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(Yn.localStorage.setItem(iv,JSON.stringify(i({},n,{source:void 0}))),this.de()===nv.LOADED)this.ve(n);else if(this.de()===nv.UNINITIALIZED){var s;this.ce(nv.LOADING),null==(s=rs.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return rv.error("[Toolbar] Failed to load",t),void this.ce(nv.UNINITIALIZED);this.ce(nv.LOADED),this.ve(n)})),Cs(Yn,"turbolinks:load",(()=>{this.ce(nv.UNINITIALIZED),this.loadToolbar(n)}))}return!0}fe(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,i){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(t,e,i)}}var ov=us("[TracingHeaders]");class av{constructor(t){this.pe=void 0,this.ge=void 0,this.Qt=()=>{var t,e;tr(this.pe)&&(null==(t=rs.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager));tr(this.ge)&&(null==(e=rs.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}Jt(t){var e,i;null!=(e=rs.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(i=rs.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return ov.error("failed to load script",e);t()}))}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.Jt(this.Qt):(null==(t=this.pe)||t.call(this),null==(e=this.ge)||e.call(this),this.pe=void 0,this.ge=void 0)}}var lv="https?://(.*)",uv=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],hv=fs(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],uv),cv="<masked>",dv=["li_fat_id"];function vv(t,e,i){if(!Jn)return{};var r,n=e?fs([],uv,i||[]):[],s=fv(As(Jn.URL,n,cv),t),o=(r={},ds(dv,(function(t){var e=Fd.qt(t);r[t]=e||null})),r);return vs(o,s)}function fv(t,e){var i=hv.concat(e||[]),r={};return ds(i,(function(e){var i=xs(t,e);r[e]=i||null})),r}function pv(t){var e=function(t){return t?0===t.search(lv+"google.([^/?]*)")?"google":0===t.search(lv+"bing.com")?"bing":0===t.search(lv+"yahoo.com")?"yahoo":0===t.search(lv+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",r={};if(!rr(e)){r.$search_engine=e;var n=Jn?xs(Jn.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function gv(){return navigator.language||navigator.userLanguage}function mv(){return(null==Jn?void 0:Jn.referrer)||"$direct"}function yv(t,e){var i=t?fs([],uv,e||[]):[],r=null==Kn?void 0:Kn.href.substring(0,1e3);return{r:mv().substring(0,1e3),u:r?As(r,i,cv):void 0}}function bv(t){var e,{r:i,u:r}=t,n={$referrer:i,$referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(e=Ss(i))?void 0:e.host};if(r){n.$current_url=r;var s=Ss(r);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=fv(r);vs(n,o)}if(i){var a=pv(i);vs(n,a)}return n}function _v(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function wv(){try{return(new Date).getTimezoneOffset()}catch(t){return}}function Iv(t,e){if(!is)return{};var i,r=t?fs([],uv,e||[]):[],[n,s]=function(t){for(var e=0;e<pn.length;e++){var[i,r]=pn[e],n=i.exec(t),s=n&&(Xi(r)?r(n,t):r);if(s)return s}return["",""]}(is);return vs(ys({$os:n,$os_version:s,$browser:dn(is,navigator.vendor),$device:gn(is),$device_type:mn(is),$timezone:_v(),$timezone_offset:wv()}),{$current_url:As(null==Kn?void 0:Kn.href,r,cv),$host:null==Kn?void 0:Kn.host,$pathname:null==Kn?void 0:Kn.pathname,$raw_user_agent:is.length>1e3?is.substring(0,997)+"...":is,$browser_version:fn(is,navigator.vendor),$browser_language:gv(),$browser_language_prefix:(i=gv(),"string"==typeof i?i.split("-")[0]:void 0),$screen_height:null==Yn?void 0:Yn.screen.height,$screen_width:null==Yn?void 0:Yn.screen.width,$viewport_height:null==Yn?void 0:Yn.innerHeight,$viewport_width:null==Yn?void 0:Yn.innerWidth,$lib:"web",$lib_version:os.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Cv=us("[Web Vitals]"),Sv=9e5;class kv{constructor(t){var e;this.me=!1,this.ht=!1,this.F={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.ye=()=>{clearTimeout(this.be),0!==this.F.metrics.length&&(this._instance.capture("$web_vitals",this.F.metrics.reduce(((t,e)=>i({},t,{["$web_vitals_"+e.name+"_event"]:i({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.F={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this._e=t=>{var e,r=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(tr(r))Cv.error("Could not read session ID. Dropping metrics!");else{this.F=this.F||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.we();if(!tr(n))if(nr(null==t?void 0:t.name)||nr(null==t?void 0:t.value))Cv.error("Invalid metric received",t);else if(this.Ie&&t.value>=this.Ie)Cv.error("Ignoring metric with value >= "+this.Ie,t);else this.F.url!==n&&(this.ye(),this.be=setTimeout(this.ye,this.flushToCaptureTimeoutMs)),tr(this.F.url)&&(this.F.url=n),this.F.firstMetricTimestamp=tr(this.F.firstMetricTimestamp)?Date.now():this.F.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.F.metrics.push(i({},t,{$current_url:n,$session_id:r.sessionId,$window_id:r.windowId,timestamp:Date.now()})),this.F.metrics.length===this.allowedMetrics.length&&this.ye()}},this.Qt=()=>{var t,e,i,r,n=rs.__PosthogExtensions__;tr(n)||tr(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:i,onINP:r}=n.postHogWebVitalsCallbacks),t&&e&&i&&r?(this.allowedMetrics.indexOf("LCP")>-1&&t(this._e.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this._e.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this._e.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this._e.bind(this)),this.ht=!0):Cv.error("web vitals callbacks not loaded - not starting")},this._instance=t,this.me=!(null==(e=this._instance.persistence)||!e.props[Zs]),this.startIfEnabled()}get allowedMetrics(){var t,e,i=Ki(this._instance.config.capture_performance)?null==(t=this._instance.config.capture_performance)?void 0:t.web_vitals_allowed_metrics:void 0;return tr(i)?(null==(e=this._instance.persistence)?void 0:e.props[Hs])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(Ki(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Ie(){var t=Ki(this._instance.config.capture_performance)&&sr(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Sv;return 0<t&&t<=6e4?Sv:t}get isEnabled(){var t=null==Kn?void 0:Kn.protocol;if("http:"!==t&&"https:"!==t)return Cv.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Ki(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:or(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return or(e)?e:this.me}startIfEnabled(){this.isEnabled&&!this.ht&&(Cv.info("enabled, starting..."),this.Jt(this.Qt))}onRemoteConfig(t){var e=Ki(t.capturePerformance)&&!!t.capturePerformance.web_vitals,i=Ki(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Zs]:e}),this._instance.persistence.register({[Hs]:i})),this.me=e,this.startIfEnabled()}Jt(t){var e,i;null!=(e=rs.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks&&t(),null==(i=rs.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"web-vitals",(e=>{e?Cv.error("failed to load script",e):t()}))}we(){var t=Yn?Yn.location.href:void 0;if(t){var e=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties,r=e?fs([],uv,i||[]):[];return As(t,r,cv)}Cv.error("Could not determine current URL")}}var xv=us("[Heatmaps]");function Av(t){return Ki(t)&&"clientX"in t&&"clientY"in t&&sr(t.clientX)&&sr(t.clientY)}class Tv{constructor(t){var e;this.me=!1,this.ht=!1,this.Ce=null,this.instance=t,this.me=!(null==(e=this.instance.persistence)||!e.props[Ps]),this.rageclicks=new gd(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return Ki(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return tr(this.instance.config.capture_heatmaps)?tr(this.instance.config.enable_heatmaps)?this.me:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.ht)return;xv.info("starting..."),this.Se(),this.ke()}else{var t;clearInterval(null!==(t=this.Ce)&&void 0!==t?t:void 0),this.xe(),this.getAndClearBuffer()}}onRemoteConfig(t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ps]:e}),this.me=e,this.startIfEnabled()}getAndClearBuffer(){var t=this.F;return this.F=void 0,t}Ae(t){this.kt(t.originalEvent,"deadclick")}ke(){this.Ce&&clearInterval(this.Ce),this.Ce=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(Jn)?setInterval(this.Te.bind(this),this.flushIntervalMilliseconds):null}Se(){Yn&&Jn&&(this.Ee=this.Te.bind(this),Cs(Yn,"beforeunload",this.Ee),this.Me=t=>this.kt(t||(null==Yn?void 0:Yn.event)),Cs(Jn,"click",this.Me,{capture:!0}),this.Ne=t=>this.Re(t||(null==Yn?void 0:Yn.event)),Cs(Jn,"mousemove",this.Ne,{capture:!0}),this.Fe=new Gd(this.instance,jd,this.Ae.bind(this)),this.Fe.startIfEnabled(),this.Oe=this.ke.bind(this),Cs(Jn,"visibilitychange",this.Oe),this.ht=!0)}xe(){var t;Yn&&Jn&&(this.Ee&&Yn.removeEventListener("beforeunload",this.Ee),this.Me&&Jn.removeEventListener("click",this.Me,{capture:!0}),this.Ne&&Jn.removeEventListener("mousemove",this.Ne,{capture:!0}),this.Oe&&Jn.removeEventListener("visibilitychange",this.Oe),clearTimeout(this.Pe),null==(t=this.Fe)||t.stop(),this.ht=!1)}Le(t,e){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,i){for(var r=t;r&&ho(r)&&!co(r,"body");){if(r===i)return!1;if(Hi(e,null==Yn?void 0:Yn.getComputedStyle(r).position))return!0;r=Co(r)}return!1}(_o(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:r),y:t.clientY+(s?0:i),target_fixed:s,type:e}}kt(t,e){var r;if(void 0===e&&(e="click"),!uo(t.target)&&Av(t)){var n=this.Le(t,e);null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.De(i({},n,{type:"rageclick"})),this.De(n)}}Re(t){!uo(t.target)&&Av(t)&&(clearTimeout(this.Pe),this.Pe=setTimeout((()=>{this.De(this.Le(t,"mousemove"))}),500))}De(t){if(Yn){var e=Yn.location.href,i=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,n=i?fs([],uv,r||[]):[],s=As(e,n,cv);this.F=this.F||{},this.F[s]||(this.F[s]=[]),this.F[s].push(t)}}Te(){this.F&&!Qi(this.F)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Ev{constructor(t){this.Be=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength)&&(ls.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Ze=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.$e()}$e(){var t;this.qe=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Be)}destroy(){var t;null==(t=this.qe)||t.call(this),this.qe=void 0}doPageView(t,e){var i,r=this.He(t,e);return this.Ze={pathname:null!==(i=null==Yn?void 0:Yn.location.pathname)&&void 0!==i?i:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.He(t,null==(e=this.Ze)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Ze)?void 0:t.pageViewId}}He(t,e){var i=this.Ze;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.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(!(tr(s)||tr(o)||tr(a)||tr(l)||tr(u)||tr(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?1:pr(o/s,0,1,ls),d=s<=1?1:pr(a/s,0,1,ls),v=l<=1?1:pr(u/l,0,1,ls),f=l<=1?1:pr(h/l,0,1,ls);r=vs(r,{$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 i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}}var Mv=us("[FeatureFlags]"),Nv=us("[FeatureFlags]",{debugEnabled:!0}),Rv="$active_feature_flags",Fv="$override_feature_flags",Ov="$feature_flag_payloads",Pv="$override_feature_flag_payloads",Lv="$feature_flag_request_id",Dv="$feature_flag_evaluated_at",Bv=t=>{var e={};for(var[i,r]of ps(t||{}))r&&(e[i]=r);return e},Zv=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var i;return[t,null!==(i=e[t].variant)&&void 0!==i?i:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var i;return null==(i=e[t].metadata)?void 0:i.payload})).map((t=>{var i;return[t,null==(i=e[t].metadata)?void 0:i.payload]})))):Mv.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},$v=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class qv{constructor(t){this.Ve=!1,this.je=!1,this.Ye=!1,this.Ge=!1,this.ze=!1,this.We=!1,this.Ue=!1,this._instance=t,this.featureFlagEventHandlers=[]}Xe(){var t=this._instance.config.evaluation_environments;return null!=t&&t.length?t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Mv.error("Invalid evaluation environment found:",t,"Expected non-empty string"),e})):[]}Je(){return this.Xe().length>0}flags(){if(this._instance.config.__preview_remote_config)this.We=!0;else{var t=!this.Ke&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.Qe({disableFlags:t})}}get hasLoadedFlags(){return this.je}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(Ws),e=this._instance.get_property(Fv),r=this._instance.get_property(Pv);if(!r&&!e)return t||{};var n=vs({},t||{}),s=[...new Set([...Object.keys(r||{}),...Object.keys(e||{})])];for(var o of s){var a,l,u=n[o],h=null==e?void 0:e[o],c=tr(h)?null!==(a=null==u?void 0:u.enabled)&&void 0!==a&&a:!!h,d=tr(h)?u.variant:"string"==typeof h?h:void 0,v=null==r?void 0:r[o],f=i({},u,{enabled:c,variant:c?null!=d?d:null==u?void 0:u.variant:void 0});if(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=i({},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.Ve||(Mv.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:n}),this.Ve=!0),n}getFlagVariants(){var t=this._instance.get_property(Gs),e=this._instance.get_property(Fv);if(!e)return t||{};for(var i=vs({},t),r=Object.keys(e),n=0;n<r.length;n++)i[r[n]]=e[r[n]];return this.Ve||(Mv.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.Ve=!0),i}getFlagPayloads(){var t=this._instance.get_property(Ov),e=this._instance.get_property(Pv);if(!e)return t||{};for(var i=vs({},t||{}),r=Object.keys(e),n=0;n<r.length;n++)i[r[n]]=e[r[n]];return this.Ve||(Mv.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.Ve=!0),i}reloadFeatureFlags(){this.Ge||this._instance.config.advanced_disable_feature_flags||this.Ke||(this.Ke=setTimeout((()=>{this.Qe()}),5))}ti(){clearTimeout(this.Ke),this.Ke=void 0}ensureFlagsLoaded(){this.je||this.Ye||this.Ke||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Ge=t}Qe(t){var e;if(this.ti(),!this._instance._t())if(this.Ye)this.ze=!0;else{var r=this._instance.config.token,n=this._instance.get_property("$device_id"),s={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i({},(null==(e=this._instance.persistence)?void 0:e.get_initial_props())||{},this._instance.get_property(Us)||{}),group_properties:this._instance.get_property(Xs)};rr(n)||tr(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Je()&&(s.evaluation_environments=this.Xe());var o=this._instance.config.__preview_remote_config,a=o?"/flags/?v=2":"/flags/?v=2&config=true",l=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",u=this._instance.requestRouter.endpointFor("flags",a+l);o&&(s.timezone=_v()),this.Ye=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this._instance.config.disable_compression?void 0:Ul.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:t=>{var e,i,r=!0;(200===t.statusCode&&(this.ze||(this.$anon_distinct_id=void 0),r=!1),this.Ye=!1,this.We)||(this.We=!0,this._instance.ei(null!==(i=t.json)&&void 0!==i?i:{}));if(!s.disable_flags||this.ze)if(this.Ue=!r,t.json&&null!=(e=t.json.quotaLimited)&&e.includes($v.FeatureFlags))Mv.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{var n;if(!s.disable_flags)this.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},r);this.ze&&(this.ze=!1,this.Qe())}}})}}getFeatureFlag(t,e){if(void 0===e&&(e={}),this.je||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[t],r=""+i,n=this._instance.get_property(Lv)||void 0,s=this._instance.get_property(Dv)||void 0,o=this._instance.get_property(Ks)||{};if((e.send_event||!("send_event"in e))&&(!(t in o)||!o[t].includes(r))){var a,l,u,h,c,d,v,f,p;Ui(o[t])?o[t].push(r):o[t]=[r],null==(a=this._instance.persistence)||a.register({[Ks]:o});var g=this.getFeatureFlagDetails(t),m={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(t)||null,$feature_flag_request_id:n,$feature_flag_evaluated_at:s,$feature_flag_bootstrapped_response:(null==(l=this._instance.config.bootstrap)||null==(l=l.featureFlags)?void 0:l[t])||null,$feature_flag_bootstrapped_payload:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlagPayloads)?void 0:u[t])||null,$used_bootstrap_value:!this.Ue};tr(null==g||null==(h=g.metadata)?void 0:h.version)||(m.$feature_flag_version=g.metadata.version);var y,b=null!==(c=null==g||null==(d=g.reason)?void 0:d.description)&&void 0!==c?c:null==g||null==(v=g.reason)?void 0:v.code;if(b&&(m.$feature_flag_reason=b),null!=g&&null!=(f=g.metadata)&&f.id&&(m.$feature_flag_id=g.metadata.id),tr(null==g?void 0:g.original_variant)&&tr(null==g?void 0:g.original_enabled)||(m.$feature_flag_original_response=tr(g.original_variant)?g.original_enabled:g.original_variant),null!=g&&null!=(p=g.metadata)&&p.original_payload)m.$feature_flag_original_payload=null==g||null==(y=g.metadata)?void 0:y.original_payload;this._instance.capture("$feature_flag_called",m)}return i}Mv.warn('getFeatureFlag for key "'+t+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,e){var i=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.Je()&&(r.evaluation_environments=this.Xe()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:r,compression:this._instance.config.disable_compression?void 0:Ul.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var r,n=null==(r=i.json)?void 0:r.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),this.je||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(t,e);return tr(i)?void 0:!!i}Mv.warn('isFeatureEnabled for key "'+t+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e){if(this._instance.persistence){this.je=!0;var r=this.getFlagVariants(),n=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(t,e,r,n,s){void 0===r&&(r={}),void 0===n&&(n={}),void 0===s&&(s={});var o=Zv(t),a=o.flags,l=o.featureFlags,u=o.featureFlagPayloads;if(l){var h=t.requestId,c=t.evaluatedAt;if(Ui(l)){Mv.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(l)for(var v=0;v<l.length;v++)d[l[v]]=!0;e&&e.register({[Rv]:l,[Gs]:d})}else{var f=l,p=u,g=a;t.errorsWhileComputingFlags&&(f=i({},r,f),p=i({},n,p),g=i({},s,g)),e&&e.register(i({[Rv]:Object.keys(Bv(f)),[Gs]:f||{},[Ov]:p||{},[Ws]:g||{}},h?{[Lv]:h}:{},c?{[Dv]:c}:{}))}}}(t,this._instance.persistence,r,n,s),this.ii(e)}}override(t,e){void 0===e&&(e=!1),Mv.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return Mv.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this._instance.persistence.unregister(Fv),this._instance.persistence.unregister(Pv),this.ii(),Nv.info("All overrides cleared");if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var e,i=t;if(this.Ve=Boolean(null!==(e=i.suppressWarning)&&void 0!==e&&e),"flags"in i)if(!1===i.flags)this._instance.persistence.unregister(Fv),Nv.info("Flag overrides cleared");else if(i.flags){if(Ui(i.flags)){for(var r={},n=0;n<i.flags.length;n++)r[i.flags[n]]=!0;this._instance.persistence.register({[Fv]:r})}else this._instance.persistence.register({[Fv]:i.flags});Nv.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this._instance.persistence.unregister(Pv),Nv.info("Payload overrides cleared")):i.payloads&&(this._instance.persistence.register({[Pv]:i.payloads}),Nv.info("Payload overrides set",{payloads:i.payloads}))),void this.ii()}this.ii()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.je){var{flags:e,flagVariants:i}=this.ri();t(e,i)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,r){var n,s=(this._instance.get_property(zs)||[]).find((e=>e.flagKey===t)),o={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:o};s&&(a.$early_access_feature_name=s.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=i({},this.getFlagVariants(),{[t]:e});null==(n=this._instance.persistence)||n.register({[Rv]:Object.keys(Bv(l)),[Gs]:l}),this.ii()}getEarlyAccessFeatures(t,e,i){void 0===e&&(e=!1);var r=this._instance.get_property(zs),n=i?"&"+i.map((t=>"stage="+t)).join("&"):"";if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:e=>{var i,r;if(e.json){var n=e.json.earlyAccessFeatures;return null==(i=this._instance.persistence)||i.unregister(zs),null==(r=this._instance.persistence)||r.register({[zs]:n}),t(n)}}})}ri(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,i)=>(t[i]=e[i],t)),{})}}ii(t){var{flags:e,flagVariants:i}=this.ri();this.featureFlagEventHandlers.forEach((r=>r(e,i,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var r=this._instance.get_property(Us)||{};this._instance.register({[Us]:i({},r,t)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Us)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var r=this._instance.get_property(Xs)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((e=>{r[e]=i({},r[e],t[e]),delete t[e]})),this._instance.register({[Xs]:i({},r,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this._instance.get_property(Xs)||{};this._instance.register({[Xs]:i({},e,{[t]:{}})})}else this._instance.unregister(Xs)}reset(){this.je=!1,this.Ye=!1,this.Ge=!1,this.ze=!1,this.We=!1,this.Ue=!1,this.$anon_distinct_id=void 0,this.ti(),this.Ve=!1}}var Hv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Vv{constructor(t,e){this.ft=t,this.props={},this.ni=!1,this.si=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.zt=this.oi(t),this.load(),t.debug&&ls.info("Persistence loaded",t.persistence,i({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this.ai}oi(t){-1===Hv.indexOf(t.persistence.toLowerCase())&&(ls.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e=function(t){void 0===t&&(t=[]);var e=[...Ld,...t];return i({},Pd,{Ht:function(t){try{var e={};try{e=Fd.Ht(t)||{}}catch(t){}var i=vs(e,JSON.parse(Pd.qt(t)||"{}"));return Pd.Vt(t,i),i}catch(t){}return null},Vt:function(t,i,r,n,s,o){try{Pd.Vt(t,i,void 0,void 0,o);var a={};e.forEach((t=>{i[t]&&(a[t]=i[t])})),Object.keys(a).length&&Fd.Vt(t,a,r,n,s,o)}catch(t){Pd.$t(t)}},jt:function(t,e){try{null==Yn||Yn.localStorage.removeItem(t),Fd.jt(t,e)}catch(t){Pd.$t(t)}}})}(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return"localstorage"===r&&Pd.Zt()?Pd:"localstorage+cookie"===r&&e.Zt()?e:"sessionstorage"===r&&$d.Zt()?$d:"memory"===r?Bd:"cookie"===r?Fd:e.Zt()?e:Fd}properties(){var t={};return ds(this.props,(function(e,i){if(i===Gs&&Ki(e))for(var r=Object.keys(e),n=0;n<r.length;n++)t["$feature/"+r[n]]=e[r[n]];else o=i,a=!1,(rr(s=lo)?a:Un&&s.indexOf===Un?-1!=s.indexOf(o):(ds(s,(function(t){if(a||(a=t===o))return hs})),a))||(t[i]=e);var s,o,a})),t}load(){if(!this.ai){var t=this.zt.Ht(this.si);t&&(this.props=vs({},t))}}save(){this.ai||this.zt.Vt(this.si,this.props,this.li,this.ui,this.hi,this.ft.debug)}remove(){this.zt.jt(this.si,!1),this.zt.jt(this.si,!0)}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Ki(t)){tr(e)&&(e="None"),this.li=tr(i)?this.ci:i;var r=!1;if(ds(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(Ki(t)){this.li=tr(e)?this.ci:e;var i=!1;if(ds(t,((e,r)=>{t.hasOwnProperty(r)&&this.props[r]!==e&&(this.props[r]=e,i=!0)})),i)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.ni){var t=vv(this.ft.custom_campaign_params,this.ft.mask_personal_data_properties,this.ft.custom_personal_data_properties);Qi(ys(t))||this.register(t),this.ni=!0}}update_search_keyword(){var t;this.register((t=null==Jn?void 0:Jn.referrer)?pv(t):{})}update_referrer_info(){var t;this.register_once({$referrer:mv(),$referring_domain:null!=Jn&&Jn.referrer&&(null==(t=Ss(Jn.referrer))?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[io]||this.props[ro]||this.register_once({[no]:yv(this.ft.mask_personal_data_properties,this.ft.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};ds([ro,io],(e=>{var i=this.props[e];i&&ds(i,(function(e,i){t["$initial_"+ji(i)]=e}))}));var e,i,r=this.props[no];if(r){var n=(e=bv(r),i={},ds(e,(function(t,e){i["$initial_"+ji(e)]=t})),i);vs(t,n)}return t}safe_merge(t){return ds(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){if(this.ci=this.li=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!i),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every(((t,e)=>t===r[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[])){var r=this.oi(t),n=this.props;this.clear(),this.zt=r,this.props=n,this.save()}}set_disabled(t){this.ai=t,this.ai?this.remove():this.save()}set_cross_subdomain(t){t!==this.ui&&(this.ui=t,this.remove(),this.save())}set_secure(t){t!==this.hi&&(this.hi=t,this.remove(),this.save())}set_event_timer(t,e){var i=this.props[Fs]||{};i[t]=e,this.props[Fs]=i,this.save()}remove_event_timer(t){var e=(this.props[Fs]||{})[t];return tr(e)||(delete this.props[Fs][t],this.save()),e}get_property(t){return this.props[t]}set_property(t,e){this.props[t]=e,this.save()}}var jv=us("[Product Tours]"),Yv="ph_product_tours";class Gv{constructor(t){this.di=null,this.vi=null,this._instance=t}onRemoteConfig(t){this._instance.persistence&&this._instance.persistence.register({[qs]:!(null==t||!t.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var t,e;this.di||((t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(qs))||this.Jt((()=>this.fi()))}Jt(t){var e,i;null!=(e=rs.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=rs.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",(e=>{e?jv.error("Could not load product tours script",e):t()}))}fi(){var t;!this.di&&null!=(t=rs.__PosthogExtensions__)&&t.generateProductTours&&(this.di=rs.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Ui(this.vi)||e){var i=this._instance.persistence;if(i){var r=i.props[Yv];if(Ui(r)&&!e)return this.vi=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:e=>{var r=e.statusCode;if(200!==r||!e.json){var n="Product Tours API could not be loaded, status: "+r;return jv.error(n),void t([],{isLoaded:!1,error:n})}var s=Ui(e.json.product_tours)?e.json.product_tours:[];this.vi=s,i&&i.register({[Yv]:s}),t(s,{isLoaded:!0})}})}else t(this.vi,{isLoaded:!0})}getActiveProductTours(t){nr(this.di)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.di.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.di)||e.showTourById(t)}previewTour(t){this.di?this.di.previewTour(t):this.Jt((()=>{var e;this.fi(),null==(e=this.di)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.di)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.di)||t.nextStep()}previousStep(){var t;null==(t=this.di)||t.previousStep()}clearCache(){var t;this.vi=null,null==(t=this._instance.persistence)||t.unregister(Yv)}resetTour(t){var e;null==(e=this.di)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.di)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.di)||e.cancelPendingTour(t)}}class zv{constructor(){this.pi={},this.pi={}}on(t,e){return this.pi[t]||(this.pi[t]=[]),this.pi[t].push(e),()=>{this.pi[t]=this.pi[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.pi[t]||[])i(e);for(var r of this.pi["*"]||[])r(t,e)}}function Wv(t,e,i){if(nr(t))return!1;switch(i){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class Uv{constructor(t){this.gi=new zv,this.mi=(t,e)=>this.yi(t,e)&&this.bi(t,e)&&this.wi(t,e)&&this.Ii(t,e),this.yi=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.Ci=new Set,this.Si=new Set}init(){var t;if(!tr(null==(t=this._instance)?void 0:t.ki)){var e;null==(e=this._instance)||e.ki(((t,e)=>{this.on(t,e)}))}}register(t){var e,i;if(!tr(null==(e=this._instance)?void 0:e.ki)&&(t.forEach((t=>{var e,i;null==(e=this.Si)||e.add(t),null==(i=t.steps)||i.forEach((t=>{var e;null==(e=this.Ci)||e.add((null==t?void 0:t.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var r,n=new Set;t.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&n.add(null==t?void 0:t.selector)}))})),null==(r=this._instance)||r.autocapture.setElementSelectors(n)}}on(t,e){var i;null!=e&&0!=t.length&&(this.Ci.has(t)||this.Ci.has(null==e?void 0:e.event))&&this.Si&&(null==(i=this.Si)?void 0:i.size)>0&&this.Si.forEach((t=>{this.xi(e,t)&&this.gi.emit("actionCaptured",t.name)}))}Ai(t){this.onAction("actionCaptured",(e=>t(e)))}xi(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.mi(t,i))return!0;return!1}onAction(t,e){return this.gi.on(t,e)}bi(t,e){if(null!=e&&e.url){var i,r=null==t||null==(i=t.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r)return!1;if(!Wv(r,e.url,e.url_matching||"contains"))return!1}return!0}wi(t,e){return!!this.Ti(t,e)&&(!!this.Ei(t,e)&&!!this.Mi(t,e))}Ti(t,e){var i;if(null==e||!e.href)return!0;var r=this.Ni(t);if(r.length>0)return r.some((t=>Wv(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&Wv((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Ei(t,e){var i;if(null==e||!e.text)return!0;var r=this.Ni(t);if(r.length>0)return r.some((t=>Wv(t.text,e.text,e.text_matching||"exact")||Wv(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!a&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!nr(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>Wv(t,s,o))))}Mi(t,e){var i,r;if(null==e||!e.selector)return!0;var n=null==t||null==(i=t.properties)?void 0:i.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}Ni(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Ii(t,e){return null==e||!e.properties||0===e.properties.length||qu(e.properties.reduce(((t,e)=>{var i=Ui(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:i,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Xv{constructor(t){this._instance=t,this.Ri=new Map,this.Fi=new Map,this.Oi=new Map}Pi(t,e){return!!t&&qu(t.propertyFilters,null==e?void 0:e.properties)}Li(t,e){var i=new Map;return t.forEach((t=>{var r;null==(r=t.conditions)||null==(r=r[e])||null==(r=r.values)||r.forEach((e=>{if(null!=e&&e.name){var r=i.get(e.name)||[];r.push(t.id),i.set(e.name,r)}}))})),i}Di(t,e,i){var r=(i===yl.Activation?this.Ri:this.Fi).get(t),n=[];return this.Bi((t=>{n=t.filter((t=>null==r?void 0:r.includes(t.id)))})),n.filter((r=>{var n,s=null==(n=r.conditions)||null==(n=n[i])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.Pi(s,e)}))}register(t){var e;tr(null==(e=this._instance)?void 0:e.ki)||(this.Zi(t),this.$i(t))}$i(t){var e=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0}));if(0!==e.length){if(null==this.qi){this.qi=new Uv(this._instance),this.qi.init();this.qi.Ai((t=>{this.onAction(t)}))}e.forEach((t=>{var e,i,r,n,s;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(i=t.conditions)&&null!=(i=i.actions)&&i.values&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(n=this.qi)||n.register(t.conditions.actions.values),null==(s=t.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((e=>{if(e&&e.name){var i=this.Oi.get(e.name);i&&i.push(t.id),this.Oi.set(e.name,i||[t.id])}})))}))}}Zi(t){var e,i=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.events)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0})),r=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(i=t.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0}));if(0!==i.length||0!==r.length){null==(e=this._instance)||e.ki(((t,e)=>{this.onEvent(t,e)})),this.Ri=this.Li(t,yl.Activation),this.Fi=this.Li(t,yl.Cancellation)}}onEvent(t,e){var i,r=this.Hi(),n=this.Vi(),s=this.ji(),o=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[n])||[];if(s===t&&e&&o.length>0){var a,l;r.info("event matched, removing item from activated items",{event:t,eventPayload:e,existingActivatedItems:o});var u=(null==e||null==(a=e.properties)?void 0:a.$survey_id)||(null==e||null==(l=e.properties)?void 0:l.$product_tour_id);if(u){var h=o.indexOf(u);h>=0&&(o.splice(h,1),this.Yi(o))}}else{if(this.Fi.has(t)){var c=this.Di(t,e,yl.Cancellation);c.length>0&&(r.info("cancel event matched, cancelling items",{event:t,itemsToCancel:c.map((t=>t.id))}),c.forEach((t=>{var e=o.indexOf(t.id);e>=0&&o.splice(e,1),this.Gi(t.id)})),this.Yi(o))}if(this.Ri.has(t)){r.info("event name matched",{event:t,eventPayload:e,items:this.Ri.get(t)});var d=this.Di(t,e,yl.Activation);this.Yi(o.concat(d.map((t=>t.id))||[]))}}}onAction(t){var e,i=this.Vi(),r=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[i])||[];this.Oi.has(t)&&this.Yi(r.concat(this.Oi.get(t)||[]))}Yi(t){var e,i=this.Hi(),r=this.Vi(),n=[...new Set(t)].filter((t=>!this.zi(t)));i.info("updating activated items",{activatedItems:n}),null==(e=this._instance)||null==(e=e.persistence)||e.register({[r]:n})}getActivatedIds(){var t,e=this.Vi(),i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i||[]}getEventToItemsMap(){return this.Ri}Wi(){return this.qi}}class Jv extends Xv{constructor(t){super(t)}Vi(){return"$surveys_activated"}ji(){return xl.SHOWN}Bi(t){var e;null==(e=this._instance)||e.getSurveys(t)}Gi(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Hi(){return El}zi(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class Kv{constructor(t){this.Ui=void 0,this._surveyManager=null,this.Xi=!1,this.Ji=[],this.Ki=null,this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var e=t.surveys;if(nr(e))return El.warn("Flags not loaded yet. Not loading surveys.");var i=Ui(e);this.Ui=i?e.length>0:e,El.info("flags response received, isSurveysEnabled: "+this.Ui),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var i=localStorage.key(e);(null!=i&&i.startsWith(Fl)||null!=i&&i.startsWith(Ol))&&t.push(i)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.Xi)El.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)El.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())El.info("Not loading surveys in cookieless mode without consent.");else{var t=null==rs?void 0:rs.__PosthogExtensions__;if(t){if(!tr(this.Ui)||this._instance.config.advanced_enable_surveys){var e=this.Ui||this._instance.config.advanced_enable_surveys;this.Xi=!0;try{var i=t.generateSurveys;if(i)return void this.Qi(i,e);var r=t.loadExternalDependency;if(!r)return void this.tr("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",(i=>{i||!t.generateSurveys?this.tr("Could not load surveys script",i):this.Qi(t.generateSurveys,e)}))}catch(t){throw this.tr("Error initializing surveys",t),t}finally{this.Xi=!1}}}else El.error("PostHog Extensions not found.")}}Qi(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Jv(this._instance),El.info("Surveys loaded successfully"),this.er({isLoaded:!0})}tr(t,e){El.error(t,e),this.er({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ji.push(t),this._surveyManager&&this.er({isLoaded:!0}),()=>{this.Ji=this.Ji.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this._instance.config.disable_surveys)return El.info("Disabled. Not loading surveys."),t([]);var i,r=this._instance.get_property(Js);if(r&&!e)return t(r,{isLoaded:!0});"undefined"!=typeof Promise&&this.Ki?this.Ki.then((e=>{var{surveys:i,context:r}=e;return t(i,r)})):("undefined"!=typeof Promise&&(this.Ki=new Promise((t=>{i=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:e=>{var r;this.Ki=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;El.error(s);var o={isLoaded:!1,error:s};return t([],o),void(null==i||i({surveys:[],context:o}))}var a,l=e.json.surveys||[],u=l.filter((t=>Ml(t)&&(Nl(t)||Rl(t))));u.length>0&&(null==(a=this._surveyEventReceiver)||a.register(u));null==(r=this._instance.persistence)||r.register({[Js]:l});var h={isLoaded:!0};t(l,h),null==i||i({surveys:l,context:h})}}))}er(t){for(var e of this.Ji)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){El.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!nr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);El.warn("init was not called")}ir(t){var e=null;return this.getSurveys((i=>{var r;e=null!==(r=i.find((e=>e.id===t)))&&void 0!==r?r:null})),e}rr(t){if(nr(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var e="string"==typeof t?this.ir(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(nr(this._surveyManager))return El.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var e=this.rr(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return nr(this._surveyManager)?(El.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((i=>{this.getSurveys((e=>{var r,n=null!==(r=e.find((e=>e.id===t)))&&void 0!==r?r:null;if(n){var s=this.rr(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e){var i;if(nr(this._surveyManager))El.warn("init was not called");else{var r="string"==typeof t?this.ir(t):t;if(null!=r&&r.id)if(Zl.includes(r.type)){var n=null==Jn?void 0:Jn.querySelector(e);if(n)return null!=(i=r.appearance)&&i.surveyPopupDelaySeconds?(El.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;El.info("Rendering survey "+r.id+" with delay of "+(null==(t=r.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(r,n),El.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,n);El.warn("Survey element not found")}else El.warn("Surveys of type "+r.type+" cannot be rendered in the app");else El.warn("Survey not found")}}displaySurvey(t,e){var r;if(nr(this._surveyManager))El.warn("init was not called");else{var n=this.ir(t);if(n){var s=n;if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=i({},n,{appearance:i({},n.appearance,{surveyPopupDelaySeconds:0})})),!1===e.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void El.warn("Survey is not eligible to be displayed: ",o.disabledReason)}e.displayType!==Tl.Inline?this._surveyManager.handlePopoverSurvey(s):this.renderSurvey(s,e.selector)}else El.warn("Survey not found")}}cancelPendingSurvey(t){nr(this._surveyManager)?El.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}var Qv=us("[Conversations]");class tf{constructor(t){this.nr=void 0,this._conversationsManager=null,this.sr=!1,this.ar=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;nr(e)||(or(e)?this.nr=e:(this.nr=e.enabled,this.ar=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.nr=void 0,this.ar=null}loadIfEnabled(){if(!this._conversationsManager&&!this.sr&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==rs?void 0:rs.__PosthogExtensions__;if(t&&!tr(this.nr)&&this.nr)if(this.ar&&this.ar.token){this.sr=!0;try{var e=t.initConversations;if(e)return this.lr(e),void(this.sr=!1);var i=t.loadExternalDependency;if(!i)return void this.ur("PostHog loadExternalDependency extension not found.");i(this._instance,"conversations",(e=>{e||!t.initConversations?this.ur("Could not load conversations script",e):this.lr(t.initConversations),this.sr=!1}))}catch(t){this.ur("Error initializing conversations",t),this.sr=!1}}else Qv.error("Conversations enabled but missing token in remote config.")}}lr(t){if(this.ar)try{this._conversationsManager=t(this.ar,this._instance),Qv.info("Conversations loaded successfully")}catch(t){this.ur("Error completing conversations initialization",t)}else Qv.error("Cannot complete initialization: remote config is null")}ur(t,e){Qv.error(t,e),this._conversationsManager=null,this.sr=!1}enable(){this._conversationsManager?this._conversationsManager.enable():Qv.warn("Conversations not loaded yet.")}disable(){this._conversationsManager&&this._conversationsManager.disable()}isLoaded(){return!rr(this._conversationsManager)}isEnabled(){return!0===this.nr}isWidgetEnabled(){var t;return!0===(null==(t=this.ar)?void 0:t.widgetEnabled)}isWidgetVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isWidgetVisible())&&void 0!==t&&t}}var ef=us("[RateLimiter]");class rf{constructor(t){var e,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{ef.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void ef.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.captureEventsPerSecond=(null==(e=t.config.rate_limiting)?void 0:e.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(i=t.config.rate_limiting)?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(t){var e,i,r;void 0===t&&(t=!1);var n=(new Date).getTime(),s=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(eo))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:n};s.tokens+=(n-s.last)/1e3*this.captureEventsPerSecond,s.last=n,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);var o=s.tokens<1;return o||t||(s.tokens=Math.max(0,s.tokens-1)),!o||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,null==(r=this.instance.persistence)||r.set_property(eo,s),{isRateLimited:o,remainingTokens:s.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var nf=us("[RemoteConfig]");class sf{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=rs._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}hr(t){var e,i;null!=(e=rs.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=rs.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):(nf.error("PostHog Extensions not found. Cannot load remote config."),t())}cr(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e=>{t(e.json)}})}load(){try{if(this.remoteConfig)return nf.info("Using preloaded remote config",this.remoteConfig),void this.ei(this.remoteConfig);if(this._instance._t())return void nf.warn("Remote config is disabled. Falling back to local config.");this.hr((t=>{if(!t)return nf.info("No config found after loading remote JS config. Falling back to JSON."),void this.cr((t=>{this.ei(t)}));this.ei(t)}))}catch(t){nf.error("Error loading remote config",t)}}ei(t){t?this._instance.config.__preview_remote_config?(this._instance.ei(t),!1!==t.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):nf.info("__preview_remote_config is disabled. Logging config instead",t):nf.error("Failed to fetch remote config from PostHog.")}}var of=3e3;class af{constructor(t,e){this.dr=!0,this.vr=[],this.pr=pr((null==e?void 0:e.flush_interval_ms)||of,250,5e3,ls.createLogger("flush interval"),of),this.gr=t}enqueue(t){this.vr.push(t),this.mr||this.yr()}unload(){this.br();var t=this.vr.length>0?this._r():{},e=Object.values(t),r=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];r.map((t=>{this.gr(i({},t,{transport:"sendBeacon"}))}))}enable(){this.dr=!1,this.yr()}yr(){var t=this;this.dr||(this.mr=setTimeout((()=>{if(this.br(),this.vr.length>0){var e=this._r(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&Ui(i.data)&&ds(i.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.gr(i)};for(var r in e)i()}}),this.pr))}br(){clearTimeout(this.mr),this.mr=void 0}_r(){var t={};return ds(this.vr,(e=>{var r,n=e,s=(n?n.batchKey:null)||n.url;tr(t[s])&&(t[s]=i({},n,{data:[]})),null==(r=t[s].data)||r.push(n.data)})),this.vr=[],t}}var lf=["retriesPerformedSoFar"];class uf{constructor(t){this.wr=!1,this.Ir=3e3,this.vr=[],this._instance=t,this.vr=[],this.Cr=!0,!tr(Yn)&&"onLine"in Yn.navigator&&(this.Cr=Yn.navigator.onLine,this.Sr=()=>{this.Cr=!0,this.Te()},this.kr=()=>{this.Cr=!1},Cs(Yn,"online",this.Sr),Cs(Yn,"offline",this.kr))}get length(){return this.vr.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=r(t,lf);sr(e)&&e>0&&(n.url=Fu(n.url,{retry_count:e})),this._instance._send_request(i({},n,{callback:t=>{200!==t.statusCode&&(t.statusCode<400||t.statusCode>=500)&&(null!=e?e:0)<10?this.Ar(i({retriesPerformedSoFar:e},n)):null==n.callback||n.callback(t)}}))}Ar(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var i=function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),n=(Math.random()-.5)*(r-i);return Math.ceil(r+n)}(e),r=Date.now()+i;this.vr.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),ls.warn(n),this.wr||(this.wr=!0,this.Tr())}Tr(){if(this.Er&&clearTimeout(this.Er),0===this.vr.length)return this.wr=!1,void(this.Er=void 0);this.Er=setTimeout((()=>{this.Cr&&this.vr.length>0&&this.Te(),this.Tr()}),this.Ir)}Te(){var t=Date.now(),e=[],i=this.vr.filter((i=>i.retryAt<t||(e.push(i),!1)));if(this.vr=e,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:t}of(this.Er&&(clearTimeout(this.Er),this.Er=void 0),this.wr=!1,tr(Yn)||(this.Sr&&(Yn.removeEventListener("online",this.Sr),this.Sr=void 0),this.kr&&(Yn.removeEventListener("offline",this.kr),this.kr=void 0)),this.vr))try{this._instance._send_request(i({},t,{transport:"sendBeacon"}))}catch(t){ls.error(t)}this.vr=[]}}class hf{constructor(t){this.Mr=()=>{var t,e,i,r;this.Nr||(this.Nr={});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.Nr.lastScrollY=Math.ceil(s),this.Nr.maxScrollY=Math.max(s,null!==(t=this.Nr.maxScrollY)&&void 0!==t?t:0),this.Nr.maxScrollHeight=Math.max(o,null!==(e=this.Nr.maxScrollHeight)&&void 0!==e?e:0),this.Nr.lastContentY=a,this.Nr.maxContentY=Math.max(a,null!==(i=this.Nr.maxContentY)&&void 0!==i?i:0),this.Nr.maxContentHeight=Math.max(l,null!==(r=this.Nr.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}getContext(){return this.Nr}resetContext(){var t=this.Nr;return setTimeout(this.Mr,0),t}startMeasuringScrollPosition(){Cs(Yn,"scroll",this.Mr,{capture:!0}),Cs(Yn,"scrollend",this.Mr,{capture:!0}),Cs(Yn,"resize",this.Mr)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==Yn?void 0:Yn.document.documentElement;var t=Ui(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var e of t){var i=null==Yn?void 0:Yn.document.querySelector(e);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return Yn&&(Yn.scrollY||Yn.pageYOffset||Yn.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return Yn&&(Yn.scrollX||Yn.pageXOffset||Yn.document.documentElement.scrollLeft)||0}}var cf=t=>yv(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class df{constructor(t,e,i,r){this.Rr=t=>{var e=this.Fr();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Or(this._instance)};this.Pr.register({[to]:i})}},this._instance=t,this.Lr=e,this.Pr=i,this.Or=r||cf,this.Lr.onSessionId(this.Rr)}Fr(){return this.Pr.props[to]}getSetOnceProps(){var t,e=null==(t=this.Fr())?void 0:t.props;return e?"r"in e?bv(e):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return ds(ys(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+ji(i)]=e})),t}}var vf=us("[SessionId]");class ff{on(t,e){return this.Dr.on(t,e)}constructor(t,e,i){var r;if(this.Br=[],this.Zr=void 0,this.Dr=new zv,this.$r=(t,e)=>Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.ft=t.config,this.Pr=t.persistence,this.qr=void 0,this.Hr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Vr=e||zl,this.jr=i||zl;var n=this.ft.persistence_name||this.ft.token,s=this.ft.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*pr(s,60,36e3,vf.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Yr(),this.Gr="ph_"+n+"_window_id",this.zr="ph_"+n+"_primary_window_exists",this.Wr()){var o=$d.Ht(this.Gr),a=$d.Ht(this.zr);o&&!a?this.qr=o:$d.jt(this.Gr),$d.Vt(this.zr,!0)}if(null!=(r=this.ft.bootstrap)&&r.sessionID)try{var l=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(this.ft.bootstrap.sessionID);this.Ur(this.ft.bootstrap.sessionID,(new Date).getTime(),l)}catch(t){vf.error("Invalid sessionID in bootstrap",t)}this.Xr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return tr(this.Br)&&(this.Br=[]),this.Br.push(t),this.Hr&&t(this.Hr,this.qr),()=>{this.Br=this.Br.filter((e=>e!==t))}}Wr(){return"memory"!==this.ft.persistence&&!this.Pr.ai&&$d.Zt()}Jr(t){t!==this.qr&&(this.qr=t,this.Wr()&&$d.Vt(this.Gr,t))}Kr(){return this.qr?this.qr:this.Wr()?$d.Ht(this.Gr):null}Ur(t,e,i){t===this.Hr&&e===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Hr=t,this.Pr.register({[js]:[e,t,i]}))}Qr(){var t=this.Pr.props[js];return Ui(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Ur(null,null,null)}destroy(){clearTimeout(this.tn),this.tn=void 0,this.Zr&&Yn&&(Yn.removeEventListener("beforeunload",this.Zr,{capture:!1}),this.Zr=void 0),this.Br=[]}Xr(){this.Zr=()=>{this.Wr()&&$d.jt(this.zr)},Cs(Yn,"beforeunload",this.Zr,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),"always"===this.ft.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=e||(new Date).getTime(),[r,n,s]=this.Qr(),o=this.Kr(),a=sr(s)&&s>0&&Math.abs(i-s)>864e5,l=!1,u=!n,h=!u&&!t&&this.$r(i,r);u||h||a?(n=this.Vr(),o=this.jr(),vf.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:a}}),s=i,l=!0):o||(o=this.jr(),l=!0);var c=0===r||!t||a?i:r,d=0===s?(new Date).getTime():s;return this.Jr(o),this.Ur(n,c,d),t||this.Yr(),l&&this.Br.forEach((t=>t(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:r}}Yr(){clearTimeout(this.tn),this.tn=setTimeout((()=>{var[t]=this.Qr();if(this.$r((new Date).getTime(),t)){var e=this.Hr;this.resetSessionId(),this.Dr.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var pf=["$set_once","$set"],gf=us("[SiteApps]");class mf{constructor(t){this._instance=t,this.en=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}rn(t,e){if(e){var i=this.globalsForEvent(e);this.en.push(i),this.en.length>1e3&&(this.en=this.en.slice(10))}}get siteAppLoaders(){var t;return null==(t=rs._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance.ki(this.rn.bind(this));this.nn=()=>{t(),this.en=[],this.nn=void 0}}}globalsForEvent(t){var e,n,s,o,a,l,u;if(!t)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}=t;return{event:i({},r(t,pf),{properties:i({},t.properties,g?{$set:i({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:i({},null!==(s=null==(o=t.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(l=t.properties)?void 0:l.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(u=t.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}setupSiteApp(t){var e=this.apps[t.id],i=()=>{var i;(!e.errored&&this.en.length&&(gf.info("Processing "+this.en.length+" events for site app with id "+t.id),this.en.forEach((t=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored)))&&(null==(i=this.nn)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,gf.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var{processEvent:s}=t.init({posthog:this._instance,callback:t=>{n(t)}});s&&(e.processEvent=s),r=!0}catch(e){gf.error("Error while initializing PostHog app with config id "+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){gf.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}sn(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of t)this.setupSiteApp(i)}an(t){if(0!==Object.keys(this.apps).length){var e=this.globalsForEvent(t);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(e)}catch(e){gf.error("Error while processing event "+t.event+" for site app "+i.id,e)}}}onRemoteConfig(t){var e,i,r,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.sn(),void this._instance.on("eventCaptured",(t=>this.an(t)))):void gf.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.nn)||i.call(this),null!=(r=t.siteApps)&&r.length)if(this.isEnabled){var s=function(t){var e;rs["__$$ph_site_app_"+t]=n._instance,null==(e=rs.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return gf.error("Error while initializing PostHog app with config id "+t,e)}))};for(var{id:o,url:a}of t.siteApps)s(o)}else gf.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var yf=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&$i(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>$i(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},bf=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),_f="i.posthog.com";class wf{constructor(t){this.ln={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+_f,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.ln[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.ln[this.apiHost]=bf.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.ln[this.apiHost]=bf.EU:this.ln[this.apiHost]=bf.CUSTOM),this.ln[this.apiHost]}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if(this.region===bf.CUSTOM)return this.apiHost+e;var i=_f+e;switch(t){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var If={icontains:(t,e)=>!!Yn&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!Yn&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!Yn&&Du(e.href,t),not_regex:(t,e)=>!!Yn&&!Du(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class Cf{constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Cf.un("retrieved web experiments from the server"),e.hn=new Map,t.forEach((t=>{if(t.feature_flag_key){var i;if(e.hn)Cf.un("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e.hn)||i.set(t.feature_flag_key,t);var r=e._instance.getFeatureFlag(t.feature_flag_key);er(r)&&t.variants[r]&&e.cn(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];Cf.dn(s)&&e.cn(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}onFeatureFlags(t){if(this._is_bot())Cf.un("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(nr(this.hn))return this.hn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Cf.un("applying feature flags",t),t.forEach((t=>{var e;if(this.hn&&null!=(e=this.hn)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.hn)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.cn(n.name,r,n.variants[r].transforms)}}))}}previewWebExperiment(){var t=Cf.getWindowLocation();if(null!=t&&t.search){var e=xs(null==t?void 0:t.search,"__experiment_id"),i=xs(null==t?void 0:t.search,"__experiment_variant");e&&i&&(Cf.un("previewing web experiments "+e+" && "+i),this.getWebExperiments((t=>{this.vn(parseInt(e),i,t)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this._instance.config.disable_web_experiments&&!i)return t([]);var r=this._instance.get_property("$web_experiments");if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:e=>{if(200!==e.statusCode||!e.json)return t([]);var i=e.json.experiments||[];return t(i)}})}vn(t,e,i){var r=i.filter((e=>e.id===t));r&&r.length>0&&(Cf.un("Previewing web experiment ["+r[0].name+"] with variant ["+e+"]"),this.cn(r[0].name,e,r[0].variants[e].transforms))}static dn(t){return!nr(t.conditions)&&(Cf.fn(t)&&Cf.pn(t))}static fn(t){var e;if(nr(t.conditions)||nr(null==(e=t.conditions)?void 0:e.url))return!0;var i,r,n,s=Cf.getWindowLocation();return!!s&&(null==(i=t.conditions)||!i.url||If[null!==(r=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==r?r:"icontains"](t.conditions.url,s))}static getWindowLocation(){return null==Yn?void 0:Yn.location}static pn(t){var e;if(nr(t.conditions)||nr(null==(e=t.conditions)?void 0:e.utm))return!0;var i=vv();if(i.utm_source){var r,n,s,o,a,l,u,h,c=null==(r=t.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==i.utm_campaign,d=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(o=t.conditions)||null==(o=o.utm)?void 0:o.utm_source)==i.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==i.utm_term;return c&&v&&f&&d}return!1}static un(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];ls.info("[WebExperiments] "+t,i)}cn(t,e,i){this._is_bot()?Cf.un("Refusing to render web experiment since the viewer is a likely bot"):"control"!==e?i.forEach((i=>{if(i.selector){var r;Cf.un("applying transform of variant "+e+" for experiment "+t+" ",i);var n=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==n||n.forEach((t=>{var e=t;i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)}))}})):Cf.un("Control variants leave the page unmodified.")}_is_bot(){return Xn&&this._instance?yf(Xn,this._instance.config.custom_blocked_useragents):void 0}}var Sf=us("[PostHog ExternalIntegrations]"),kf={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class xf{constructor(t){this._instance=t}Jt(t,e){var i;null==(i=rs.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return Sf.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var i,n,s;(!r||null!=(i=rs.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.Jt(kf[e],(()=>{var i;null==(i=rs.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)})),!r&&null!=(n=rs.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e])&&(null==(s=rs.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[e])||s.stop())};for(var[i,r]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(i)}}}var Af="[SessionRecording]",Tf=us(Af);class Ef{get started(){var t;return!(null==(t=this.gn)||!t.isStarted)}get status(){return this.gn?this.gn.status:this.mn&&!this.yn?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.mn=!1,this.bn=void 0,this._instance=t,!this._instance.sessionManager)throw Tf.error("started without valid sessionManager"),new Error(Af+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw new Error(Af+' cannot be used with cookieless_mode="always"')}get yn(){var t,e=!(null==(t=this._instance.get_property(Vs))||!t.enabled),i=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return Yn&&e&&i&&!r}startIfEnabledOrStop(t){var e;if(!this.yn||null==(e=this.gn)||!e.isStarted){var i=!tr(Object.assign)&&!tr(Array.from);this.yn&&i?(this._n(t),Tf.info("starting")):this.stopRecording()}}_n(t){var e,i,r;this.yn&&(null!=rs&&null!=(e=rs.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=rs.__PosthogExtensions__)&&i.initSessionRecording?this.wn(t):null==(r=rs.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.In,(e=>{if(e)return Tf.error("could not load recorder",e);this.wn(t)})))}stopRecording(){var t,e;null==(t=this.bn)||t.call(this),this.bn=void 0,null==(e=this.gn)||e.stop()}Cn(){var t;null==(t=this._instance.persistence)||t.unregister(Ys)}Sn(t){if(this._instance.persistence){var e,r,n=this._instance.persistence,s=()=>{var e=!1===t.sessionRecording?void 0:t.sessionRecording,r=null==e?void 0:e.sampleRate,s=nr(r)?null:parseFloat(r);nr(s)&&this.Cn();var o=null==e?void 0:e.minimumDurationMilliseconds;n.register({[Vs]:i({enabled:!!e},e,{networkPayloadCapture:i({capturePerformance:t.capturePerformance},null==e?void 0:e.networkPayloadCapture),canvasRecording:{enabled:null==e?void 0:e.recordCanvas,fps:null==e?void 0:e.canvasFps,quality:null==e?void 0:e.canvasQuality},sampleRate:s,minimumDurationMilliseconds:tr(o)?null:o,endpoint:null==e?void 0:e.endpoint,triggerMatchType:null==e?void 0:e.triggerMatchType,masking:null==e?void 0:e.masking,urlTriggers:null==e?void 0:e.urlTriggers})})};s(),null==(e=this.bn)||e.call(this),this.bn=null==(r=this._instance.sessionManager)?void 0:r.onSessionId(s)}}onRemoteConfig(t){"sessionRecording"in t?!1!==t.sessionRecording?(this.Sn(t),this.mn=!0,this.startIfEnabledOrStop()):this.mn=!0:Tf.info("skipping remote config with no sessionRecording",t)}log(t,e){var i;void 0===e&&(e="log"),null!=(i=this.gn)&&i.log?this.gn.log(t,e):Tf.warn("log called before recorder was ready")}get In(){var t,e,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Vs);return(null==i||null==(e=i.scriptConfig)?void 0:e.script)||"lazy-recorder"}wn(t){var e,i;if(null==(e=rs.__PosthogExtensions__)||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.gn||(this.gn=null==(i=rs.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.gn._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture);this.gn.start(t)}onRRwebEmit(t){var e;null==(e=this.gn)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.gn||(null==(e=this._instance.persistence)||e.register({$replay_override_linked_flag:!0}));null==(t=this.gn)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.gn||(null==(e=this._instance.persistence)||e.register({$replay_override_sampling:!0}));null==(t=this.gn)||t.overrideSampling()}overrideTrigger(t){var e,i;this.gn||(null==(i=this._instance.persistence)||i.register({["url"===t?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}));null==(e=this.gn)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.gn)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.gn)||!i.tryAddCustomEvent(t,e))}}var Mf={},Nf=()=>{},Rf="posthog",Ff=!Nu&&-1===(null==is?void 0:is.indexOf("MSIE"))&&-1===(null==is?void 0:is.indexOf("Mozilla")),Of=t=>{var e;return i({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:ws(null==Jn?void 0:Jn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Nf,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,debug:Kn&&er(null==Kn?void 0:Kn.search)&&-1!==Kn.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:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Yn||null==(e=Yn.location)?void 0:e.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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var e="Bad HTTP status: "+t.statusCode+" "+t.text;ls.error(e)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:of},error_tracking:{},_onCapture:Nf,__preview_eager_load_replay:!1},(t=>({rageclick:!(t&&t>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(t&&t>="2025-05-24")||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},Pf=t=>{var e={};tr(t.process_person)||(e.person_profiles=t.process_person),tr(t.xhr_headers)||(e.request_headers=t.xhr_headers),tr(t.cookie_name)||(e.persistence_name=t.cookie_name),tr(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),tr(t.store_google)||(e.save_campaign_params=t.store_google),tr(t.verbose)||(e.debug=t.verbose);var i=vs({},e,t);return Ui(t.property_blacklist)&&(tr(t.property_denylist)?i.property_denylist=t.property_blacklist:Ui(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:ls.error("Invalid value for property_denylist config: "+t.property_denylist)),i};class Lf{constructor(){this.__forceAllowLocalhost=!1}get kn(){return this.__forceAllowLocalhost}set kn(t){ls.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Df{get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){this.webPerformance=new Lf,this.xn=!1,this.version=os.LIB_VERSION,this.An=new zv,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Of(),this.SentryIntegration=tv,this.sentryIntegration=t=>function(t,e){var i=Qd(t,e);return{name:Kd,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Tn=!1,this.En=null,this.Mn=null,this.Nn=null,this.featureFlags=new qv(this),this.toolbar=new sv(this),this.scrollManager=new hf(this),this.pageViewManager=new Ev(this),this.surveys=new Kv(this),this.conversations=new tf(this),this.experiments=new Cf(this),this.exceptions=new cc(this),this.rateLimiter=new rf(this),this.requestRouter=new wf(this),this.consent=new Hd(this),this.externalIntegrations=new xf(this),this.people={set:(t,e,i)=>{var r=er(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=er(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>ls.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==Rf){var r,n=null!==(r=Mf[i])&&void 0!==r?r:new Df;return n._init(t,e,i),Mf[i]=n,Mf[Rf][i]=n,n}return this._init(t,e,i)}_init(t,e,r){var n;if(void 0===e&&(e={}),tr(t)||ir(t))return ls.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={},e.debug=this.Rn(e.debug),this.Fn=e,this.On=[],e.person_profiles&&(this.Mn=e.person_profiles),this.set_config(vs({},Of(e.defaults),Pf(e),{name:r,token:t})),this.config.on_xhr_error&&ls.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Ul.GZipJS;var s=this.Pn();this.persistence=new Vv(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Vv(i({},this.config,{persistence:"sessionStorage"}),s);var o=i({},this.persistence.props),a=i({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Ln=new af((t=>this.Dn(t)),this.config.request_queue_config),this.Bn=new uf(this),this.__request_queue=[];var l="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new ff(this),this.sessionPropsManager=new df(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ls.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Zn(l)}),0)):(ls.info("Initializing extensions synchronously"),this.Zn(l)),os.DEBUG=os.DEBUG||this.config.debug,os.DEBUG&&ls.info("Starting in debug mode",{this:this,config:e,thisC:i({},this.config),p:o,s:a}),void 0!==(null==(n=e.bootstrap)?void 0:n.distinctID)){var u,h,c=this.config.get_device_id(zl()),d=null!=(u=e.bootstrap)&&u.isIdentifiedID?c:e.bootstrap.distinctID;this.persistence.set_property(Qs,null!=(h=e.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:e.bootstrap.distinctID,$device_id:d})}if(this.$n()){var v,f,p=Object.keys((null==(v=e.bootstrap)?void 0:v.featureFlags)||{}).filter((t=>{var i;return!(null==(i=e.bootstrap)||null==(i=i.featureFlags)||!i[t])})).reduce(((t,i)=>{var r;return t[i]=(null==(r=e.bootstrap)||null==(r=r.featureFlags)?void 0:r[i])||!1,t}),{}),g=Object.keys((null==(f=e.bootstrap)?void 0:f.featureFlagPayloads)||{}).filter((t=>p[t])).reduce(((t,i)=>{var r,n;null!=(r=e.bootstrap)&&null!=(r=r.featureFlagPayloads)&&r[i]&&(t[i]=null==(n=e.bootstrap)||null==(n=n.featureFlagPayloads)?void 0:n[i]);return t}),{});this.featureFlags.receivedFeatureFlags({featureFlags:p,featureFlagPayloads:g})}if(l)this.register_once({distinct_id:ao,$device_id:null},"");else if(!this.get_distinct_id()){var m=this.config.get_device_id(zl());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(Qs,"anonymous")}return Cs(Yn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),e.segment?Jd(this,(()=>this.qn())):this.qn(),Xi(this.config._onCapture)&&this.config._onCapture!==Nf&&(ls.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&ls.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}Zn(t){var e=performance.now();this.historyAutocapture=new Ud(this),this.historyAutocapture.startIfEnabled();var i=[];i.push((()=>{new av(this).startIfEnabledOrStop()})),i.push((()=>{var t;this.siteApps=new mf(this),null==(t=this.siteApps)||t.init()})),t||i.push((()=>{this.sessionRecording=new Ef(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),i.push((()=>{this.autocapture=new Cd(this),this.autocapture.startIfEnabled()})),i.push((()=>{this.surveys.loadIfEnabled()})),i.push((()=>{this.conversations.loadIfEnabled()})),i.push((()=>{this.productTours=new Gv(this),this.productTours.loadIfEnabled()})),i.push((()=>{this.heatmaps=new Tv(this),this.heatmaps.startIfEnabled()})),i.push((()=>{this.webVitalsAutocapture=new kv(this)})),i.push((()=>{this.exceptionObserver=new Wd(this),this.exceptionObserver.startIfEnabledOrStop()})),i.push((()=>{this.deadClicksAutocapture=new Gd(this,Yd),this.deadClicksAutocapture.startIfEnabled()})),i.push((()=>{if(this.Hn){var t=this.Hn;this.Hn=void 0,this.ei(t)}})),this.Vn(i,e)}Vn(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions)if(performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Vn(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){ls.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&ls.info("PostHog extensions initialized ("+r+"ms)")}ei(t){var e,i,r,n,s,o,a,l,u;if(!Jn||!Jn.body)return ls.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.ei(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Hn=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Hi(t.supportedCompression,Ul.GZipJS)?Ul.GZipJS:Hi(t.supportedCompression,Ul.Base64)?Ul.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Mn?this.Mn:"identified_only"}),null==(i=this.siteApps)||i.onRemoteConfig(t),null==(r=this.sessionRecording)||r.onRemoteConfig(t),null==(n=this.autocapture)||n.onRemoteConfig(t),null==(s=this.heatmaps)||s.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.conversations.onRemoteConfig(t),null==(o=this.productTours)||o.onRemoteConfig(t),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(t),null==(l=this.exceptionObserver)||l.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(t)}qn(){try{this.config.loaded(this)}catch(t){ls.critical("`loaded` function failed",t)}this.jn(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.Yn()}),1),new sf(this).load(),this.featureFlags.flags()}jn(){var t;this.is_capturing()&&(this.config.request_batching&&(null==(t=this.Ln)||t.enable()))}_dom_loaded(){this.is_capturing()&&cs(this.__request_queue,(t=>this.Dn(t))),this.__request_queue=[],this.jn()}_handle_unload(){var t,e;this.surveys.handlePageUnload(),this.config.request_batching?(this.Gn()&&this.capture("$pageleave"),null==(t=this.Ln)||t.unload(),null==(e=this.Bn)||e.unload()):this.Gn()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(Ff?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Fu(t.url,{ip:this.config.ip?1:0}),t.headers=i({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,r,n,s=i({},t);s.timeout=s.timeout||6e4,s.url=Fu(s.url,{_:(new Date).getTime().toString(),ver:os.LIB_VERSION,compression:s.compression});var o=null!==(e=s.transport)&&void 0!==e?e:"fetch",a=Lu.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),l=null!==(r=null==(n=Is(a,(t=>t.transport===o)))?void 0:n.method)&&void 0!==r?r:a[0].method;if(!l)throw new Error("No available transport method");l(s)})(i({},t,{callback:e=>{var i,r;(this.rateLimiter.checkForLimiting(e),e.statusCode>=400)&&(null==(i=(r=this.config).on_request_error)||i.call(r,e));null==t.callback||t.callback(e)}}))))}Dn(t){this.Bn?this.Bn.retriableRequest(t):this._send_request(t)}_execute_array(t){var e,i=[],r=[],n=[];cs(t,(t=>{t&&(e=t[0],Ui(e)?n.push(t):Xi(t)?t.call(this):Ui(t)&&"alias"===e?i.push(t):Ui(t)&&-1!==e.indexOf("capture")&&Xi(this[e])?n.push(t):r.push(t))}));var s=function(t,e){cs(t,(function(t){if(Ui(t[0])){var i=e;ds(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else this[t[0]].apply(this,t.slice(1))}),e)};s(i,this),s(r,this),s(n,this)}$n(){var t,e;return(null==(t=this.config.bootstrap)?void 0:t.featureFlags)&&Object.keys(null==(e=this.config.bootstrap)?void 0:e.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,e,r){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ln){if(this.is_capturing())if(!tr(t)&&er(t)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var o=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){null!=e&&e.$current_url&&!er(null==e?void 0:e.$current_url)&&(ls.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,l=(null==r?void 0:r.timestamp)||a,u=zl(),h={uuid:u,event:t,properties:this.calculateEventProperties(t,e||{},l,u)};"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&s&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),o&&(h.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==r?void 0:r.$set)&&(h.$set=null==r?void 0:r.$set);var c="$groupidentify"!==t,d=this.zn(null==r?void 0:r.$set_once,c);if(d&&(h.$set_once=d),(h=bs(h,null!=r&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,tr(null==r?void 0:r.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=a),t===xl.DISMISSED||t===xl.SENT){var v=null==e?void 0:e[Al.SURVEY_ID],f=null==e?void 0:e[Al.SURVEY_ITERATION];Bl({id:v,current_iteration:f}),h.$set=i({},h.$set,{[Pl({id:v,current_iteration:f},t===xl.SENT?"responded":"dismissed")]:!0})}else t===xl.SHOWN&&(h.$set=i({},h.$set,{[Al.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var p=i({},h.properties.$set,h.$set);if(Qi(p)||this.setPersonPropertiesForFlags(p),!nr(this.config.before_send)){var g=this.Wn(h);if(!g)return;h=g}this.An.emit("eventCaptured",h);var m={method:"POST",url:null!==(n=null==r?void 0:r._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:null==r?void 0:r._batchKey};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this.Dn(m):this.Ln.enqueue(m),h}ls.critical("This capture call is ignored due to client rate limiting.")}}else ls.error("No event name provided to posthog.capture")}else ls.uninitializedWarning("posthog.capture")}ki(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,r,n,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return e;var o=s?void 0:this.persistence.remove_event_timer(t),a=i({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),"$snapshot"===t){var l=i({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!er(a.distinct_id)&&!sr(a.distinct_id)||ir(a.distinct_id))&&ls.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,h=Iv(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&vs(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&vs(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.Bn)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===bf.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u="$pageview"!==t||s?"$pageleave"!==t||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,n),a=vs(a,u),"$pageview"===t&&Jn&&(a.title=Jn.title),!tr(o)){var f=r.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}is&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=vs({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Ui(this.config.property_denylist)?ds(this.config.property_denylist,(function(t){delete a[t]})):ls.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(ls.error("sanitize_properties is deprecated. Use before_send instead"),a=p(a,t));var g=this.Un();return a.$process_person_profile=g,g&&!s&&this.Xn("_calculate_event_properties"),a}zn(t,e){var i;if(void 0===e&&(e=!0),!this.persistence||!this.Un())return t;if(this.xn)return t;var r=this.persistence.get_initial_props(),n=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),s=vs({},r,n||{},t||{}),o=this.config.sanitize_properties;return o&&(ls.error("sanitize_properties is deprecated. Use before_send instead"),s=o(s,"$set_once")),e&&(this.xn=!0),Qi(s)?void 0:s}register(t,e){var i;null==(i=this.persistence)||i.register(t,e)}register_once(t,e,i){var r;null==(r=this.persistence)||r.register_once(t,e,i)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}Jn(t,e){this.register({[t]:e})}getFeatureFlag(t,e){return this.featureFlags.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(e)}catch(t){return e}}isFeatureEnabled(t,e){return this.featureFlags.isFeatureEnabled(t,e)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(t,e,r){var n=null!=r&&r.merge?this.featureFlags.getFlagVariants():{},s=null!=r&&r.merge?this.featureFlags.getFlagPayloads():{},o=i({},n,t),a=i({},s,e),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:tr(null==a?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.featureFlags.receivedFeatureFlags({flags:l})}updateEarlyAccessFeatureEnrollment(t,e,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){return void 0===e&&(e=!1),this.featureFlags.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.An.on(t,e)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys.getSurveys(t,e)}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys.getActiveMatchingSurveys(t,e)}renderSurvey(t,e){this.surveys.renderSurvey(t,e)}displaySurvey(t,e){void 0===e&&(e=$l),this.surveys.displaySurvey(t,e)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,e){return void 0===e&&(e=!1),this.surveys.canRenderSurveyAsync(t,e)}identify(t,e,r){if(!this.__loaded||!this.persistence)return ls.uninitializedWarning("posthog.identify");if(sr(t)&&(t=t.toString(),ls.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))ls.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==ao){if(this.Xn("posthog.identify")){var n=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var s=n;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}t!==n&&t!==this.get_property(Rs)&&(this.unregister(Rs),this.register({distinct_id:t}));var o="anonymous"===(this.persistence.get_property(Qs)||"anonymous");t!==n&&o?(this.persistence.set_property(Qs,"identified"),this.setPersonPropertiesForFlags(i({},r||{},e||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:n},{$set:e||{},$set_once:r||{}}),this.Nn=Bu(t,e,r),this.featureFlags.setAnonymousDistinctId(n)):(e||r)&&this.setPersonProperties(e,r),t!==n&&(this.reloadFeatureFlags(),this.unregister(Ks))}}else ls.critical('The string "'+ao+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else ls.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,e){if((t||e)&&this.Xn("posthog.setPersonProperties")){var r=Bu(this.get_distinct_id(),t,e);this.Nn!==r?(this.setPersonPropertiesForFlags(i({},e||{},t||{})),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Nn=r):ls.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,e,r){if(t&&e){var n=this.getGroups();n[t]!==e&&this.resetGroupPropertiesForFlags(t),this.register({$groups:i({},n,{[t]:e})}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:e,$group_set:r}),this.setGroupPropertiesForFlags({[t]:r})),n[t]===e||r||this.reloadFeatureFlags()}else ls.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0),this.featureFlags.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0),this.Xn("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,e)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var e,i,r,n;if(ls.info("reset"),!this.__loaded)return ls.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(i=this.sessionPersistence)||i.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(r=this.persistence)||r.set_property(Qs,"anonymous"),null==(n=this.sessionManager)||n.resetSessionId(),this.Nn=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ao,$device_id:null},"");else{var o=this.config.get_device_id(zl());this.register_once({distinct_id:o,$device_id:t?o:s},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:e,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&i){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0)}return r}alias(t,e){return t===this.get_property(Ns)?(ls.critical("Attempting to create alias for existing People user - aborting."),-2):this.Xn("posthog.alias")?(tr(e)&&(e=this.get_distinct_id()),t!==e?(this.Jn(Rs,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(ls.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=i({},this.config);if(Ki(t)){var r,n,s,o,a,l,u;vs(this.config,Pf(t));var h=this.Pn();null==(r=this.persistence)||r.update_config(this.config,e,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Vv(i({},this.config,{persistence:"sessionStorage"}),h);var c=this.Rn(this.config.debug);or(c)&&(this.config.debug=c),or(this.config.debug)&&(this.config.debug?(os.DEBUG=!0,Pd.Zt()&&Pd.Vt("ph_debug","true"),ls.info("set_config",{config:t,oldConfig:e,newConfig:i({},this.config)})):(os.DEBUG=!1,Pd.Zt()&&Pd.jt("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.sessionRecording)||s.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.Kn(),null==(u=this.externalIntegrations)||u.startIfEnabledOrStop()}}startSessionRecording(t){var e=!0===t,i={sampling:e||!(null==t||!t.sampling),linked_flag:e||!(null==t||!t.linked_flag),url_trigger:e||!(null==t||!t.url_trigger),event_trigger:e||!(null==t||!t.event_trigger)};if(Object.values(i).some(Boolean)){var r,n,s,o,a;if(null==(r=this.sessionManager)||r.checkAndGetSessionAndWindowId(),i.sampling)null==(n=this.sessionRecording)||n.overrideSampling();if(i.linked_flag)null==(s=this.sessionRecording)||s.overrideLinkedFlag();if(i.url_trigger)null==(o=this.sessionRecording)||o.overrideTrigger("url");if(i.event_trigger)null==(a=this.sessionRecording)||a.overrideTrigger("event")}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){var r=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(i({},n,e))}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:Rf;return e!==Rf&&(e=Rf+"."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property(Qs))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property(Qs))}Un(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Qi(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Rs])&&(null==(e=this.persistence)||null==(e=e.props)||!e[so]))}Gn(){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.Un()||this.Xn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Xn(t){return"never"===this.config.person_profiles?(ls.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jn(so,!0),!0)}Pn(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut(),e=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||t&&!!e}Kn(){var t,e,i,r,n=this.Pn();(null==(t=this.persistence)?void 0:t.ai)!==n&&(null==(i=this.persistence)||i.set_disabled(n));(null==(e=this.sessionPersistence)?void 0:e.ai)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n));return n}opt_in_capturing(t){var e;if("always"!==this.config.cookieless_mode){var i,r,n;if("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new ff(this),this.pageViewManager=new Ev(this),this.persistence&&(this.sessionPropsManager=new df(this,this.sessionManager,this.persistence)),this.sessionRecording=new Ef(this),this.sessionRecording.startIfEnabledOrStop();if(this.consent.optInOut(!0),this.Kn(),this.jn(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),tr(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)this.capture(null!==(n=null==t?void 0:t.captureEventName)&&void 0!==n?n:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0});this.config.capture_pageview&&this.Yn()}else ls.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,e,i;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kn(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ao,$device_id:null}),null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(i=this.sessionRecording)||i.stopRecording(),this.sessionRecording=void 0,this.Yn())):ls.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===qd.GRANTED?"granted":t===qd.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Kn()}_is_bot(){return Xn?yf(Xn,this.config.custom_blocked_useragents):void 0}Yn(){Jn&&("visible"===Jn.visibilityState?this.Tn||(this.Tn=!0,this.capture("$pageview",{title:Jn.title},{send_instantly:!0}),this.En&&(Jn.removeEventListener("visibilitychange",this.En),this.En=null)):this.En||(this.En=this.Yn.bind(this),Cs(Jn,"visibilitychange",this.En)))}debug(t){!1===t?(null==Yn||Yn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Yn||Yn.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}))}_t(){var t,e,i,r,n,s,o,a=this.Fn||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ls.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):(i="advanced_disable_decide",r=!1,n=ls,s=(e="advanced_disable_flags")in(t=a)&&!tr(t[e]),o=i in t&&!tr(t[i]),s?t[e]:o?(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i]):r)}Wn(t){if(nr(this.config.before_send))return t;var e=Ui(this.config.before_send)?this.config.before_send:[this.config.before_send],i=t;for(var r of e){if(i=r(i),nr(i)){var n="Event '"+t.event+"' was rejected in beforeSend function";return lr(t.event)?ls.warn(n+". This can cause unexpected behavior."):ls.info(n),null}i.properties&&!Qi(i.properties)||ls.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var t;return null==(t=this.pageViewManager.Ze)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(i)})}Rn(t){var e=or(t)&&!t,i=Pd.Zt()&&"true"===Pd.qt("ph_debug");return!e&&(!!i||t)}}!function(t,e){for(var i=0;i<e.length;i++)t.prototype[e[i]]=ms(t.prototype[e[i]])}(Df,["identify"]);var Bf,Zf;Bf=Mf[Rf]=new Df,(Zf=rs.posthog)&&ds(Zf._i,(function(t){if(t&&Ui(t)){var e=Bf.init(t[0],t[1],t[2]),i=Zf[t[2]]||Zf;e&&(e._execute_array.call(e.people,i.people),e._execute_array(i))}})),rs.posthog=Bf,function(){function t(){t.done||(t.done=!0,Ff=!1,ds(Mf,(function(t){t._dom_loaded()})))}null!=Jn&&Jn.addEventListener?"complete"===Jn.readyState?t():Cs(Jn,"DOMContentLoaded",t,{capture:!1}):Yn&&ls.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}();
|
|
2
2
|
//# sourceMappingURL=array.full.js.map
|