posthog-js 1.376.2 → 1.376.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- function t(t,e,r,i,n,s,o){try{var a=t[s](o),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=e.apply(r,i);function a(e){t(o,n,s,a,u,"next",e)}function u(e){t(o,n,s,a,u,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),u=(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))(u||{}),l=(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))(l||{}),h=(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))(h||{}),c=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(c||{}),d=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(d||{}),v=(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))(v||{}),f=(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))(f||{}),p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},g={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},m={};function y(t){if(m[t])return m[t];var e=function(t){var e,r,i=null==(r=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in p?p[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in g?g[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return m[t]=e.prototype,e.prototype;var a=document.createElement("iframe");try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return l?m[t]=l:r}catch(t){return r}finally{a.parentNode&&document.body.removeChild(a)}}var b={};function _(t,e,r){var i,n=t+"."+String(r);if(b[n])return b[n].call(e);var s=y(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(b[n]=o,o.call(e)):e[r]}var w={};function x(t,e,r){var i=t+"."+String(r);if(w[i])return w[i].bind(e);var n=y(t)[r];return"function"!=typeof n?e[r]:(w[i]=n,n.bind(e))}function S(){return y("MutationObserver").constructor}function k(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}var C={childNodes:t=>_("Node",t,"childNodes"),parentNode:t=>_("Node",t,"parentNode"),parentElement:t=>_("Node",t,"parentElement"),textContent:t=>_("Node",t,"textContent"),contains:(t,e)=>x("Node",t,"contains")(e),getRootNode:t=>x("Node",t,"getRootNode")(),host:t=>t&&"host"in t?_("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?_("Element",t,"shadowRoot"):null,querySelector:(t,e)=>x("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>x("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:k};function T(t){return t.nodeType===t.ELEMENT_NODE}function I(t){var e=t&&"host"in t&&"mode"in t&&C.host(t)||null;return Boolean(e&&"shadowRoot"in e&&C.shadowRoot(e)===t)}function E(t){return"[object ShadowRoot]"==={}.toString.call(t)}function R(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=t.href;return!r&&t.ownerNode&&(r=t.ownerNode.baseURI),(i=Array.from(e,(t=>M(t,r))).join("")).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function M(t,e){var r;if(function(t){return"styleSheet"in t}(t)){var i;try{i=R(t.styleSheet)||function(t){var{cssText:e}=t;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){i=t.cssText}try{if(i&&(null==(r=t.styleSheet)?void 0:r.href))return U(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?U(n,e):n}class O{constructor(){a(this,"idNodeMap",new Map),a(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-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);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),T(t)){var r=C.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function P(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=t,a=s||"",u=n&&L(n);return(r[i.toLowerCase()]||u&&r[u])&&(a=o?o(a,e):"*".repeat(a.length)),a}function L(t){return t.toLowerCase()}var A="__rrweb_original__";function F(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?L(e):null}var N=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,D=/^(?:[a-z+]+:)?\/\//i,q=/^www\..*/i,j=/^(data:)([^,]*),(.*)/i;function U(t,e){return(t||"").replace(N,((t,r,i,n,s,o)=>{var a,u=i||s||o,l=r||n||"";if(!u)return t;if(D.test(u)||q.test(u))return"url("+l+u+l+")";if(j.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var H,B,z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",V=4096,W=1,Z=new RegExp("[^a-z0-9-_:]"),G=-2;function Q(){return W++}var J=/^[^ \t\n\r\u000c]+/,K=/^[, \t\n\r\u000c]+/,Y=new WeakMap;function X(t,e){return e&&""!==e.trim()?tt(t,e):e}function tt(t,e){var r=Y.get(t);if(r||(r=t.createElement("a"),Y.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function et(t,e,r,i,n,s){var o,a,u;if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var l=null==(o=n.sheet)?void 0:o.href;if(l)return l}var h=X(t,i);if("img"===e&&h.startsWith("data:")&&n){var c=h;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(c=function(t,e,r,i){if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>V||t.naturalHeight>V)return e;try{var n=document.createElement("canvas");n.width=t.naturalWidth,n.height=t.naturalHeight;var s=n.getContext("2d");return s?(s.drawImage(t,0,0),n.toDataURL(r||"image/webp",null!=i?i:.4)):e}catch(t){return e}}(n,h,s.type,s.quality)),(null==s?void 0:s.maxBase64ImageLength)&&(a=c,c=(u=s.maxBase64ImageLength)&&a.length>u?z:a),c}return h}return"xlink:href"===r&&"#"!==i[0]?X(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(K),e.length>r;){var s=i(J);if(","===s.slice(-1))s=X(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=X(t,s);for(var a=!1;;){var u=e.charAt(r);if(""===u){n.push((s+o).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,n.push((s+o).trim());break}"("===u&&(a=!0)}o+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?U(i,tt(t)):"object"===e&&"data"===r?X(t,i):i:X(t,i)}function rt(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function it(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&it(C.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&it(C.parentNode(t),e,r)}function nt(t,e,r,i){var n;if(T(t)){if(!C.childNodes(n=t).length)return!1}else{if(null===C.parentElement(t))return!1;n=C.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(it(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}var st=new Map;function ot(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function at(t){return null==t?"":t.toLowerCase()}var ut=50,lt=!1,ht=!1;function ct(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:h={},maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:S=(()=>!1),newlyAddedElement:k=!1,depth:M=0,maxDepth:O=ut}=e,{needsMask:N}=e,{preserveWhiteSpace:D=!0}=e;if(M>=O)return ht=!0,lt||(lt=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+O+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;N||(N=nt(t,o,a,void 0===N));var q,j=function(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:u={},maskTextFn:l,maskInputFn:h,dataURLOptions:c={},inlineImages:d,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:g=!1}=e,m=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:f.Document,childNodes:[],compatMode:t.compatMode}:{type:f.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){for(var r,i,n,{doc:s,blockClass:o,blockSelector:a,inlineStylesheet:u,maskInputOptions:l={},maskInputFn:h,dataURLOptions:c={},inlineImages:d,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:g=!1,rootId:m}=e,y=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,o,a),b=function(t){if(t instanceof HTMLFormElement)return"form";var e=L(t.tagName);return Z.test(e)?"div":e}(t),_={},w=t.attributes.length,x=0;w>x;x++){var S=t.attributes[x];rt(b,S.name)||(_[S.name]=et(s,b,L(S.name),S.value,t,c))}if("link"===b&&u){var k=t.sheet;if(!k){var T=function(t){return t.href}(t);T&&!(k=ot(s,T))&&T.includes(".css")&&(k=ot(s,window.location.origin+"/"+T.replace(window.location.href,"")))}var I=null;k&&(I=R(k)),I&&(delete _.rel,delete _.href,_._cssText=I)}if("style"===b&&t.sheet&&!(t.innerText||C.textContent(t)||"").trim().length){var E=R(t.sheet);E&&(_._cssText=E)}if("input"===b||"textarea"===b||"select"===b){var M=t.value,O=t.checked;"radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&M?_.value=P({element:t,type:F(t),tagName:b,value:M,maskInputOptions:l,maskInputFn:h}):O&&(_.checked=O)}if("option"===b&&(t.selected&&!l.select?_.selected=!0:delete _.selected),"dialog"===b&&t.open)try{_.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){_.rr_open_mode="modal",_.ph_rr_could_not_detect_modal=!0}if("canvas"===b&&v)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((A in n?n[A]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(_.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var N=t.toDataURL(c.type,c.quality),D=s.createElement("canvas");D.width=t.width,D.height=t.height,N!==D.toDataURL(c.type,c.quality)&&(_.rr_dataURL=N)}if("img"===b&&d){H||(H=s.createElement("canvas"),B=H.getContext("2d"));var q=t,j=q.currentSrc||q.getAttribute("src")||"<unknown-src>",U=q.crossOrigin,z=()=>{q.removeEventListener("load",z);try{H.width=q.naturalWidth,H.height=q.naturalHeight,B.drawImage(q,0,0),_.rr_dataURL=H.toDataURL(c.type,c.quality)}catch(t){if("anonymous"!==q.crossOrigin)return q.crossOrigin="anonymous",void(q.complete&&0!==q.naturalWidth?z():q.addEventListener("load",z));console.warn("Cannot inline img src="+j+"! Error: "+t)}"anonymous"===q.crossOrigin&&(U?_.crossOrigin=U:q.removeAttribute("crossorigin"))};q.complete&&0!==q.naturalWidth?z():q.addEventListener("load",z)}if("audio"===b||"video"===b){var V=_;V.rr_mediaState=t.paused?"paused":"played",V.rr_mediaCurrentTime=t.currentTime,V.rr_mediaPlaybackRate=t.playbackRate,V.rr_mediaMuted=t.muted,V.rr_mediaLoop=t.loop,V.rr_mediaVolume=t.volume}if(g||(t.scrollLeft&&(_.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(_.rr_scrollTop=t.scrollTop)),y){var{width:W,height:G,left:Q,top:J}=t.getBoundingClientRect();_={class:_.class,rr_width:W+"px",rr_height:G+"px",rr_left:Math.floor(Q+((null==(r=s.defaultView)?void 0:r.scrollX)||0))+"px",rr_top:Math.floor(J+((null==(i=s.defaultView)?void 0:i.scrollY)||0))+"px"}}"iframe"!==b||p(_.src)||(t.contentDocument||(_.rr_src=_.src),delete _.src);try{customElements.get(b)&&(n=!0)}catch(t){}return{type:f.Element,tagName:b,attributes:_,childNodes:[],isSVG:(K=t,Boolean("svg"===K.tagName||K.ownerSVGElement)||void 0),needBlock:y,rootId:m,isCustom:n};var K}(t,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,dataURLOptions:c,inlineImages:d,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:s}=e,o=C.parentNode(t),a=o&&o.tagName,u=C.textContent(t),l="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(l&&u){try{if(t.nextSibling||t.previousSibling);else if(null==(r=o.sheet)?void 0:r.cssRules){var c=R(o.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(u=c)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=U(u,tt(e.doc))}return h&&(u="SCRIPT_PLACEHOLDER"),!l&&!h&&u&&i&&(u=n?n(u,C.parentElement(t)):u.replace(/[\S]/g,"*")),{type:f.Text,textContent:u||"",isStyle:l,rootId:s}}(t,{doc:r,needsMask:o,maskTextFn:l,rootId:m});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:f.Comment,textContent:C.textContent(t)||"",rootId:m};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:N,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:S,newlyAddedElement:k});if(!j)return console.warn(t,"not serialized"),null;q=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===f.Comment)return!0;if(t.type===f.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(at(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===at(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(at(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&at(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(at(t.attributes.property).match(/^(og|twitter|fb):/)||at(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===at(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(at(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(at(t.attributes.name))||at(t.attributes.property).match(/^article:/)||at(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(at(t.attributes.name)))return!0}}return!1}(j,v)||!D&&j.type===f.Text&&!j.isStyle&&!j.textContent.replace(/^\s+|\s+$/gm,"").length?G:Q();var z=Object.assign(j,{id:q});if(i.add(t,z),q===G)return null;y&&y(t);var V=!u;if(z.type===f.Element){V=V&&!z.needBlock,delete z.needBlock;var W=C.shadowRoot(t);W&&E(W)&&(z.isShadowHost=!0)}if((z.type===f.Document||z.type===f.Element)&&V){v.headWhitespace&&z.type===f.Element&&"head"===z.tagName&&(D=!1);var J={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:N,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:D,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:S,depth:M+1,maxDepth:O};if(z.type===f.Element&&"textarea"===z.tagName&&void 0!==z.attributes.value);else for(var K of Array.from(C.childNodes(t))){var Y=ct(K,J);Y&&z.childNodes.push(Y)}var X=null;if(T(t)&&(X=C.shadowRoot(t)))for(var it of Array.from(C.childNodes(X))){var dt=ct(it,J);dt&&(E(X)&&(dt.isShadow=!0),z.childNodes.push(dt))}}var vt=C.parentNode(t);return vt&&I(vt)&&E(vt)&&(z.isShadow=!0),z.type===f.Element&&"iframe"===z.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var o="about:blank";if(i.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)}),r);t.addEventListener("load",(()=>{clearTimeout(a),s=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&b){var r=ct(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:N,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:D,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:S,depth:M+1,maxDepth:O});r&&b(t,r)}}),_),z.type===f.Element&&"link"===z.tagName&&"stylesheet"===z.attributes.rel&&function(e,u,f){if(!st.has(e)){var k;try{k=e.sheet}catch(t){return}if(!k){var C=new AbortController,T=!1,I=()=>{if(!T){T=!0;try{(()=>{if(w){var e=ct(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:N,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:D,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:S,depth:M,maxDepth:O});e&&w(t,e)}})()}finally{st.delete(e),C.abort()}}},E=setTimeout(I,f);C.signal.addEventListener("abort",(()=>clearTimeout(E)),{once:!0}),e.addEventListener("load",I,{signal:C.signal,once:!0}),st.set(e,C)}}}(t,0,x),z}function dt(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class vt{constructor(){a(this,"parentElement",null),a(this,"parentNode",null),a(this,"ownerDocument"),a(this,"firstChild",null),a(this,"lastChild",null),a(this,"previousSibling",null),a(this,"nextSibling",null),a(this,"ELEMENT_NODE",1),a(this,"TEXT_NODE",3),a(this,"nodeType"),a(this,"nodeName"),a(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof vt))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"}}function ft(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}function pt(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var gt="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.",mt={map:{},getId(){return console.error(gt),-1},getNode(){return console.error(gt),null},removeNodeFromMap(){console.error(gt)},has(){return console.error(gt),!1},reset(){console.error(gt)}};function yt(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;0>=l||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),l))}}function bt(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>bt(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(mt=new Proxy(mt,{get(t,e,r){return"map"===e&&console.error(gt),Reflect.get(t,e,r)}}));var _t=Date.now;function wt(t){var e,r,i,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=C.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.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==(i=C.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function xt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function St(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function kt(t){return t?t.nodeType===t.ELEMENT_NODE?t:C.parentElement(t):null}function Ct(t,e,r,i){if(!t)return!1;var n=kt(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(it(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Tt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===G}function It(t,e){if(I(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=C.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||It(i,e))}function Et(t){return Boolean(t.changedTouches)}function Rt(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 Ot(t){return!!t&&(t instanceof vt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(C.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(_t=()=>(new Date).getTime());class Pt{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):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}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 Lt(t){var e,r=null;return"getRootNode"in t&&(null==(e=C.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(t))&&(r=C.host(C.getRootNode(t))),r}function At(t){var e=t.ownerDocument;return!!e&&(C.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Lt(r);)r=e;return r}(t);return C.contains(e,r)}(t))}function Ft(t){return"__ln"in t}class Nt{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,r=0;t>r;r++)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&&Ft(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Ft(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.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 $t,Dt=(t,e)=>t+"@"+e;class qt{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,"removesSubTreeCache",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,r=new Nt,i=t=>{for(var e=t,r=G;r===G;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=C.parentNode(n);if(s&&At(n)&&"TEXTAREA"!==s.tagName){var o=I(s)?this.mirror.getId(Lt(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var u=ct(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=>{Rt(t,this.mirror)&&this.iframeManager.addIframe(t),Mt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Ot(n)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:o,nextId:a,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Ut(this.removesSubTreeCache,s)&&!this.movedSet.has(C.parentNode(s))||n(s);for(var o of this.addedSet)Ht(this.droppedSet,o)||Ut(this.removesSubTreeCache,o)?Ht(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(C.parentNode(a.value)),h=i(a.value);-1!==l&&-1!==h&&(u=a)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(C.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=C.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=C.host(f);if(-1!==this.mirror.getId(p)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),n(u.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=C.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{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 r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).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};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))}})),a(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(C.childNodes(t),(t=>C.textContent(t)||"")).join("");e.attributes.value=P({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:F(t),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(t=>{if(!Tt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=C.textContent(t.target);Ct(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:nt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,kt(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=F(r);n=P({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Ct(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!rt(r.tagName,i))if(o.attributes[i]=et(this.doc,L(r.tagName),L(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),h=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||h!==a.style.getPropertyPriority(u)?o.styleDiff[u]=""===h?l:[l,h]:o._unchangedStyles[u]=[l,h]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(o.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ct(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 r=this.mirror.getId(e),i=I(t.target)?this.mirror.getId(C.host(t.target)):this.mirror.getId(t.target);Ct(t.target,this.blockClass,this.blockSelector,!1)||Tt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(jt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||It(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Dt(r,i)]?jt(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!I(t.target)||!E(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),C.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),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(Tt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[Dt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ct(t,this.blockClass,this.blockSelector,!1)||(C.childNodes(t).forEach((t=>this.genAdds(t))),Ot(t)&&C.childNodes(C.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()}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function jt(t,e){t.delete(e),C.childNodes(e).forEach((e=>jt(t,e)))}function Ut(t,e,r){return 0!==t.size&&function(t,e,r){var i=C.parentNode(e);return!!i&&t.has(i)}(t,e)}function Ht(t,e){return 0!==t.size&&Bt(t,e)}function Bt(t,e){var r=C.parentNode(e);return!!r&&(!!t.has(r)||Bt(t,r))}var zt=t=>$t?function(){try{return t(...arguments)}catch(t){if($t&&!0===$t(t))return;throw t}}:t,Vt=[];function Wt(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 Zt(t,e){var r=new qt;Vt.push(r),r.init(t);var i=new(S())(zt(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{observer:i,buffer:r}}function Gt(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=t;return ft("scroll",zt(yt(zt((t=>{var o=Wt(t);if(o&&!Ct(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var u=wt(r.defaultView);e({id:a,x:u.left,y:u.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),r)}var Qt=["INPUT","TEXTAREA","SELECT"],Jt=new WeakMap;function Kt(t){return function t(e,r){if(ee("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ee("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ee("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ee("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function Yt(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function Xt(t,e){var r,i,n,s,{mirror:o,stylesheetManager:a}=t;s=o.getId("#document"===e.nodeName?e:C.host(e));var u="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&u&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r=null==(e=l.set)?void 0:e.call(this,t);if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return r}}),zt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function te(t,e){void 0===e&&(e={});var i,n,s=t.doc.defaultView;if(!s)return()=>{};if(function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:h,canvasMutationCb:c,fontCb:d,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...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),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...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){var o=Zt(t,t.doc);i=o.observer,n=o.buffer}var a=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],h=yt(zt((t=>{var r=Date.now()-s;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],s=null})),a),c=zt(yt(zt((t=>{var e=Wt(t),{clientX:r,clientY:i}=Et(t)?t.changedTouches[0]:t;s||(s=_t()),u.push({x:r,y:i,id:n.getId(e),timeOffset:_t()-s}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?l.Drag:t instanceof MouseEvent?l.MouseMove:l.TouchMove)})),o,{trailing:!1})),d=[ft("mousemove",c,i),ft("touchmove",c,i),ft("drag",c,i)];return zt((()=>{d.forEach((t=>t()))}))}(t),u=function(t){var{mouseInteractionCb:e,doc:i,mirror:n,blockClass:s,blockSelector:o,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var u=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],d=null;return Object.keys(h).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==u[t])).forEach((t=>{var a=L(t),u=(t=>i=>{var a=Wt(i);if(!Ct(a,s,o,!0)){var u=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":u=c.Mouse;break;case"touch":u=c.Touch;break;case"pen":u=c.Pen}u===c.Touch&&(h[t]===h.MouseDown?l="TouchStart":h[t]===h.MouseUp&&(l="TouchEnd"))}else Et(i)&&(u=c.Touch);null!==u?(d=u,(l.startsWith("Touch")&&u===c.Touch||l.startsWith("Mouse")&&u===c.Mouse)&&(u=null)):h[t]===h.Click&&(u=d,d=null);var v=Et(i)?i.changedTouches[0]:i;if(v){var f=n.getId(a),{clientX:p,clientY:g}=v;zt(e)(r({type:h[l],id:f,x:p,y:g},null!==u&&{pointerType:u}))}}})(t);if(window.PointerEvent)switch(h[t]){case h.MouseDown:case h.MouseUp:a=a.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}l.push(ft(a,u,i))})),zt((()=>{l.forEach((t=>t()))}))}(t),d=Gt(t),f=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,s=-1;return ft("resize",zt(yt(zt((()=>{var t=xt(),e=St();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:s}),p=function(t){var{inputCb:e,doc:i,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:u,maskInputOptions:l,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=t;function v(t){var e=Wt(t),r=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=C.parentElement(e)),e&&n&&Qt.indexOf(n)>=0&&!Ct(e,s,o,!0)&&!(e.classList.contains(a)||u&&e.matches(u))){var c=e.value,v=!1,p=F(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(l[n.toLowerCase()]||l[p])&&(c=P({element:e,maskInputOptions:l,tagName:n,type:p,value:c,maskInputFn:h})),f(e,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=e.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,i){var s=Jt.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){Jt.set(t,i);var o=n.getId(t);zt(e)(r({},i,{id:o}))}}var p=("last"===c.input?["change"]:["input","change"]).map((t=>ft(t,zt(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((t=>t()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value");return m&&m.set&&p.push(...[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]].map((t=>bt(t[0],t[1],{set(){zt(v)({target:this,isTrusted:!1})}},!1,g)))),zt((()=>{p.forEach((t=>t()))}))}(t),g=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=t,a=zt((t=>yt(zt((s=>{var o=Wt(s);if(o&&!Ct(o,r,i,!0)){var{currentTime:a,volume:u,muted:l,playbackRate:h,loop:c}=o;e({type:t,id:n.getId(o),currentTime:a,volume:u,muted:l,playbackRate:h,loop:c})}})),s.media||500))),u=[ft("play",a(v.Play),o),ft("pause",a(v.Pause),o),ft("seeked",a(v.Seeked),o),ft("volumechange",a(v.VolumeChange),o),ft("ratechange",a(v.RateChange),o)];return zt((()=>{u.forEach((t=>t()))}))}(t),m=()=>{},y=()=>{},b=()=>{},_=()=>{};t.recordDOM&&(m=function(t,e){var{styleSheetRuleCb:r,mirror:i,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:zt(((t,e,s)=>{var[o,a]=s,{id:u,styleId:l}=Yt(e,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var a,u,l=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:zt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=Yt(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,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:zt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=Yt(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:zt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=Yt(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:o}),t.apply(e,s)}))}));var h={};re("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(re("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),re("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),re("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:zt(((t,e,s)=>{var[o,a]=s,{id:u,styleId:l}=Yt(e.parentStyleSheet,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:[...Kt(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:zt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=Yt(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...Kt(e),o]}]}),t.apply(e,s)}))})})),zt((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=l,a&&(s.CSSStyleSheet.prototype.replace=a),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(h).forEach((t=>{var[e,r]=t;r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:s}),y=Xt(t,t.doc),b=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=t,{win:o}=e,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:zt(((t,e,o)=>{var u,[l,h,c]=o;if(n.has(l))return a.apply(e,[l,h,c]);var{id:d,styleId:v}=Yt(null==(u=e.parentRule)?void 0:u.parentStyleSheet,i,s.styleMirror);return(d&&-1!==d||v&&-1!==v)&&r({id:d,styleId:v,set:{property:l,value:h,priority:c},index:Kt(e.parentRule)}),t.apply(e,o)}))});var u=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:zt(((t,e,o)=>{var a,[l]=o;if(n.has(l))return u.apply(e,[l]);var{id:h,styleId:c}=Yt(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||c&&-1!==c)&&r({id:h,styleId:c,remove:{property:l},index:Kt(e.parentRule)}),t.apply(e,o)}))}),zt((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:s}),t.collectFonts&&(_=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(t,e,r){var i=new o(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=k(r.fonts,"add",(function(t){return function(r){return setTimeout(zt((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),zt((()=>{n.forEach((t=>t()))}))}(t)));var w=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=t,o=!0,a=zt((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],u=t.rangeCount||0,l=0;u>l;l++){var h=t.getRangeAt(l),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;Ct(c,i,n,!0)||Ct(v,i,n,!0)||a.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),ft("selectionchange",a)}(t),x=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?k(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),S=[];for(var T of t.plugins)S.push(T.observer(T.callback,s,T.options));return zt((()=>{if(n){n.destroy(),n.reset();var t=Vt.indexOf(n);-1!==t&&Vt.splice(t,1)}null==i||i.disconnect(),a(),u(),d(),f(),p(),g(),m(),y(),b(),_(),w(),x(),S.forEach((t=>t()))}))}function ee(t){return void 0!==window[t]}function re(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ie{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),s=i||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 r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:i.get(e)||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}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||this.iframeIdToRemoteIdMap.set(t,e=new Map),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||this.iframeRemoteIdToIdMap.set(t,e=new Map),e}}class ne{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ie(Q)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"pageHideListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),a(this,"messageHandler"),a(this,"nestedIframeListeners",new Map),a(this,"attachedIframes",new Map),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ie(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var n=t.contentWindow;if(this.recordCrossOriginIframes&&n&&!this.nestedIframeListeners.has(n)){var s=this.handleMessage.bind(this);pt((()=>{n.addEventListener("message",s),this.nestedIframeListeners.set(n,s)}))}pt((()=>{var e;return null==(e=t.contentWindow)?void 0:e.addEventListener("pagehide",(()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)}))})),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 r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case u.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:u.IncrementalSnapshot,data:{source:l.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case u.Meta:case u.Load:case u.DomContentLoaded:return!1;case u.Plugin:return e;case u.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case u.IncrementalSnapshot:switch(e.data.source){case l.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),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 l.Drag:case l.TouchMove:case l.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case l.ViewportResize:return!1;case l.MediaInteraction:case l.MouseInteraction:case l.Scroll:case l.CanvasMutation:case l.Input:return this.replaceIds(e.data,t,["id"]),e;case l.StyleSheetRule:case l.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case l.Font:return e;case l.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case l.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}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===f.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.mirror.getNode(t);if(r){var i=r.contentWindow;if(i&&this.nestedIframeListeners.has(i)){var n=this.nestedIframeListeners.get(i);pt((()=>i.removeEventListener("message",n))),this.nestedIframeListeners.delete(i)}i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r)}e&&this.attachedIframes.delete(t)}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var{content:r}=t;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&window.removeEventListener("message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{pt((()=>e.removeEventListener("message",t)))})),this.nestedIframeListeners.clear(),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap}}class se{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(E(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var{observer:i,buffer:n}=Zt(r({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>{i.disconnect(),n.destroy();var t=Vt.indexOf(n);-1!==t&&Vt.splice(t,1)})),this.restoreHandlers.push(Gt(r({},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(C.host(t))),this.restoreHandlers.push(Xt({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 r=this;this.restoreHandlers.push(k(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=C.shadowRoot(this);return s&&At(this)&&r.addShadowRoot(s,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ae="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ue=0;64>ue;ue++)ae[oe.charCodeAt(ue)]=ue;var le=new Map,he=(t,e,r)=>{if(t&&(ve(t,e)||"object"==typeof t)){var i=function(t,e){var r=le.get(t);return r||le.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function ce(t,e,r,i){if(t instanceof Array)return t.map((t=>ce(t,e,r,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){var n=t.constructor.name,s=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=oe[r[e]>>2],n+=oe[(3&r[e])<<4|r[e+1]>>4],n+=oe[(15&r[e+1])<<2|r[e+2]>>6],n+=oe[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}if(t instanceof DataView)return{rr_type:t.constructor.name,args:[ce(t.buffer,e,r,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var o=t.constructor.name,{src:a}=t;return{rr_type:o,src:a}}return t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[ce(t.data,e,r,i),t.width,t.height]}:ve(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:he(t,e,r)}:t}var de=(t,e,r,i)=>t.map((t=>ce(t,e,r,i))),ve=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))},fe=["webgl","webgl2"];function pe(t){return"nodeType"in t}function ge(t,e,i,n){var s=[];try{if(n){var o=function(t,e,i){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return k(n.prototype,"configure",(function(n){return function(s){var o=function(t){var{canvas:e}=t;return e&&"object"==typeof e?e:null}(this);if(!o||pe(o)&&Ct(o,e,i,!0))return n.call(this,s);pe(o)&&!("__context"in o)&&(o.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==a&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}}))}(t,e,i);o&&s.push(o)}var a=k(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(r){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(r),o=arguments.length,a=new Array(o>1?o-1:0),u=1;o>u;u++)a[u-1]=arguments[u];if(!Ct(this,e,i,!0)&&("__context"in this||(this.__context=s),n&&fe.includes(s)))if(a[0]&&"object"==typeof a[0]){var l=a[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...a])}}));s.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((t=>t()))}}function me(t,e,r,i,n,s,o){var a=[],u=Object.getOwnPropertyNames(t),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof t[u])return 0;var l=k(t,u,(function(t){return function(){for(var a=arguments.length,l=new Array(a),h=0;a>h;h++)l[h]=arguments[h];var c=t.apply(this,l);if(he(c,s,this),"tagName"in this.canvas&&!Ct(this.canvas,i,n,!0)){var d=de(l,s,this,o);r(this.canvas,{type:e,property:u,args:d})}return c}}));a.push(l)}catch(i){var h=bt(t,u,{set(t){r(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(h)}};for(var h of u)l(h);return a}var ye,be,_e,we='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n function fnv1aHash(buffer) {\n const view = new Uint8Array(buffer);\n let hash = 2166136261;\n for (let i2 = 0; i2 < view.length; i2++) {\n hash ^= view[i2];\n hash = hash * 16777619 | 0;\n }\n return (hash >>> 0).toString(16);\n }\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n try {\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d");\n }\n reusableCtx.clearRect(0, 0, width, height);\n reusableCtx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const fingerprint = fnv1aHash(arrayBuffer);\n if (!lastFingerprintMap.has(id)) {\n const base642 = encode(arrayBuffer);\n if (await transparentBase64 === base642) {\n lastFingerprintMap.set(id, fingerprint);\n return worker.postMessage({ id });\n }\n lastFingerprintMap.set(id, fingerprint);\n worker.postMessage({ id, type, base64: base642, width, height });\n return;\n }\n if (lastFingerprintMap.get(id) === fingerprint)\n return worker.postMessage({ id });\n const base64 = encode(arrayBuffer);\n worker.postMessage({ id, type, base64, width, height });\n lastFingerprintMap.set(id, fingerprint);\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-Ca9A-vl6.js.map\n',xe="undefined"!=typeof self&&self.Blob&&new Blob([we],{type:"text/javascript;charset=utf-8"});function Se(t){var e;try{if(!(e=xe&&(self.URL||self.webkitURL).createObjectURL(xe)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(we),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class ke{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,"rafIdTimestamp",null),a(this,"rafIdFlush",null),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:r,blockClass:i,blockSelector:n,recordCanvas:s,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(r,i,n,o),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null)}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,i,n,s){var o=this;if("OffscreenCanvas"in r){var a=ge(r,i,n,!0),u=new Map,l=new Se;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:s}=t.data;this.mutationCb({id:e,type:d["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}],displayWidth:n,displayHeight:s})}};var h,c=1e3/t,v=0,f=t=>{var a,d;v&&c>t-v||(v=t,(a=[],d=t=>{try{t.querySelectorAll("canvas").forEach((t=>{Ct(t,i,n,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&d(t.shadowRoot)}))}catch(t){}},d(r.document),a).forEach(function(){var t=e((function*(t){var e,r,i=o.mirror.getId(t);if(!u.get(i)&&0!==t.width&&0!==t.height){u.set(i,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n=t.getContext(t.__context);if(null==(e=null==n?void 0:n.isContextLost)?void 0:e.call(n))return void u.set(i,!1);!1===(null==(r=null==n?void 0:n.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var a=t.clientWidth||t.width,h=t.clientHeight||t.height,c=yield createImageBitmap(t,{resizeWidth:a,resizeHeight:h});l.postMessage({id:i,bitmap:c,width:a,height:h,dataURLOptions:s.dataURLOptions},[c])}catch(t){u.set(i,!1)}}}));return function(e){return t.apply(this,arguments)}}())),h=requestAnimationFrame(f)};h=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=ge(t,e,r,!1),s=function(t,e,r,i,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=k(e.CanvasRenderingContext2D.prototype,o,(function(s){return function(){for(var a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];return Ct(this.canvas,r,i,!0)||setTimeout((()=>{var r=de(u,e,this,n);t(this.canvas,{type:d["2D"],property:o,args:r})}),0),s.apply(this,u)}}));s.push(a)}catch(r){var u=bt(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:d["2D"],property:o,args:[e],setter:!0})}});s.push(u)}};for(var u of o)a(u);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),o=function(t,e,r,i,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...me(e.WebGLRenderingContext.prototype,d.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...me(e.WebGL2RenderingContext.prototype,d.WebGL2,t,r,i,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,s))),{type:o}=r[0];this.mutationCb({id:e,type:o,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Ce{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Pt),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 r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:M(e,t.href),index:r})))})),i.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,st.forEach((t=>t.abort())),st.clear()}trackStylesheetInLinkElement(t){}}class Te{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).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 Ie=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Ee=document.createElement("iframe");document.body.appendChild(Ee),Array.from=(null==(n=Ee.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Ee)}}catch(t){console.debug("Unable to override Array.from",t)}var Re=new O;function Me(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:h=null,maskTextClass:c="rr-mask",maskTextSelector:d=null,inlineStylesheet:v=!0,maskAllInputs:f,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:y,hooks:b,packFn:_,sampling:w={},dataURLOptions:x={},mousemoveWait:S,recordDOM:k=!0,recordCanvas:T=!1,recordCrossOriginIframes:I=!1,recordAfter:E=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:R=!1,collectFonts:M=!1,inlineImages:P=!1,plugins:L,keepIframeSrcFn:A=(()=>!1),ignoreCSSAttributes:F=new Set([]),errorHandler:N}=t;$t=N;var D=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},x),q=!I||window.parent===window,j=!1;if(!q)try{window.parent.document&&(j=!1)}catch(t){j=!0}if(q&&!e)throw new Error("emit function is required");if(!q&&!j)return()=>{};void 0!==S&&void 0===w.mousemove&&(w.mousemove=S),Re.reset();var U,H=!0===f?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},B=dt(void 0!==g&&g);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var z=0,V=new Map,W=t=>{for(var e of L||[])e.eventProcessor&&(t=e.eventProcessor(t));return _&&!j&&(t=_(t)),t};ye=(t,r)=>{var s,o=t;if(o.timestamp=_t(),!(null==(s=Vt[0])?void 0:s.isFrozen())||o.type===u.FullSnapshot||o.type===u.IncrementalSnapshot&&o.data.source===l.Mutation||Vt.forEach((t=>t.unfreeze())),q)null==e||e(W(o),r);else if(j){var a={type:"rrweb",event:W(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===u.FullSnapshot)U=o,z=0;else if(o.type===u.IncrementalSnapshot){if(o.data.source===l.Mutation&&o.data.isAttachIframe)return;z++,(n&&z>=n||i&&o.timestamp-U.timestamp>i)&&be(!0)}};var Z=t=>{if(I&&t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null;t.removes.forEach((t=>{var{id:r}=t;if(!e||!e.has(r)){var i=V.get(r);i&&(i(),V.delete(r)),K.removeIframeById(r)}})),function(){for(var[t,e]of V){var r=Re.getNode(t);if(r)try{r.contentDocument&&r.contentDocument.defaultView||(e(),V.delete(t))}catch(r){e(),V.delete(t)}else e(),V.delete(t)}}()}ye({type:u.IncrementalSnapshot,data:r({source:l.Mutation},t)})},G=t=>ye({type:u.IncrementalSnapshot,data:r({source:l.Scroll},t)}),Q=t=>ye({type:u.IncrementalSnapshot,data:r({source:l.CanvasMutation},t)}),J=new Ce({mutationCb:Z,adoptedStyleSheetCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.AdoptedStyleSheet},t)})}),K=new ne({mirror:Re,mutationCb:Z,stylesheetManager:J,recordCrossOriginIframes:I,wrappedEmit:ye});for(var Y of L||[])Y.getMirror&&Y.getMirror({nodeMirror:Re,crossOriginIframeMirror:K.crossOriginIframeMirror,crossOriginIframeStyleMirror:K.crossOriginIframeStyleMirror});var X=new Te;_e=new ke({recordCanvas:T,mutationCb:Q,win:window,blockClass:s,blockSelector:o,mirror:Re,sampling:w.canvas,dataURLOptions:D});var tt=new se({mutationCb:Z,scrollCb:G,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:d,inlineStylesheet:v,maskInputOptions:H,dataURLOptions:D,maskTextFn:y,maskInputFn:m,recordCanvas:T,inlineImages:P,sampling:w,slimDOMOptions:B,iframeManager:K,stylesheetManager:J,canvasManager:_e,keepIframeSrcFn:A,processedNodeManager:X},mirror:Re});be=function(t){if(void 0===t&&(t=!1),k){ye({type:u.Meta,data:{href:window.location.href,width:St(),height:xt()}},t),J.reset(),tt.init(),Vt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new O,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:u=!1,recordCanvas:l=!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),maxDepth:x}=e||{};return ct(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:dt(v),dataURLOptions:f,inlineImages:u,recordCanvas:l,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:_,keepIframeSrcFn:w,newlyAddedElement:!1,maxDepth:x})}(document,{mirror:Re,blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:d,inlineStylesheet:v,maskAllInputs:H,maskTextFn:y,maskInputFn:m,slimDOM:B,dataURLOptions:D,recordCanvas:T,inlineImages:P,onSerialize(t){Rt(t,Re)&&K.addIframe(t),Mt(t,Re)&&J.trackLinkElement(t),Ot(t)&&tt.addShadowRoot(C.shadowRoot(t),document)},onIframeLoad(t,e){K.attachIframe(t,e),tt.observeAttachShadow(t)},onStylesheetLoad(t,e){J.attachLinkElement(t,e)},keepIframeSrcFn:A});if(!e)return console.warn("Failed to snapshot the document");ye({type:u.FullSnapshot,data:{node:e,initialOffset:wt(window)}},t),Vt.forEach((t=>t.unlock())),I&&K.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&J.adoptStyleSheets(document.adoptedStyleSheets,Re.getId(document))}};try{var et=[],rt=t=>{var e;return zt(te)({mutationCb:Z,mousemoveCb:(t,e)=>ye({type:u.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.MouseInteraction},t)}),scrollCb:G,viewportResizeCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.ViewportResize},t)}),inputCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.Input},t)}),mediaInteractionCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.MediaInteraction},t)}),styleSheetRuleCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.StyleSheetRule},t)}),styleDeclarationCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.StyleDeclaration},t)}),canvasMutationCb:Q,fontCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.Font},t)}),selectionCb(t){ye({type:u.IncrementalSnapshot,data:r({source:l.Selection},t)})},customElementCb(t){ye({type:u.IncrementalSnapshot,data:r({source:l.CustomElement},t)})},blockClass:s,ignoreClass:a,ignoreSelector:h,maskTextClass:c,maskTextSelector:d,maskInputOptions:H,inlineStylesheet:v,sampling:w,recordDOM:k,recordCanvas:T,inlineImages:P,userTriggeredOnInput:R,collectFonts:M,doc:t,maskInputFn:m,maskTextFn:y,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:B,dataURLOptions:D,mirror:Re,iframeManager:K,stylesheetManager:J,shadowDomManager:tt,processedNodeManager:X,canvasManager:_e,ignoreCSSAttributes:F,plugins:(null==(e=null==L?void 0:L.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ye({type:u.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},b)};K.addLoadListener((t=>{try{var e=Re.getId(t),r=rt(t.contentDocument);et.push(r),-1!==e&&V.set(e,r)}catch(t){console.warn(t)}})),K.addPageHideListener((t=>{var e=Re.getId(t),r=V.get(e);r&&(r(),V.delete(e)),function(t){for(var e=Vt.length-1;e>=0;e--){var r=Vt[e];(null==r?void 0:r.bufferBelongsToIframe(t))&&(r.reset(),Vt.splice(e,1))}}(t)}));var it=()=>{be(),et.push(rt(document)),Ie=!0};return["interactive","complete"].includes(document.readyState)?it():(et.push(ft("DOMContentLoaded",(()=>{ye({type:u.DomContentLoaded,data:{}}),"DOMContentLoaded"===E&&it()}))),et.push(ft("load",(()=>{ye({type:u.Load,data:{}}),"load"===E&&it()}),window))),()=>{et.forEach((t=>pt(t))),X.destroy(),K.removeLoadListener(),K.destroy(),V.clear(),Re.reset(),Ie=!1,$t=void 0}}catch(t){console.warn(t)}}Me.addCustomEvent=(t,e)=>{if(!Ie)throw new Error("please add custom event after start recording");ye({type:u.Custom,data:{tag:t,payload:e}})},Me.freezePage=()=>{Vt.forEach((t=>t.freeze()))},Me.takeFullSnapshot=t=>{if(!Ie)throw new Error("please take full snapshot after start recording");be(t)},Me.mirror=Re;var Oe=Object.defineProperty,Pe=(t,e,r)=>((t,e,r)=>e in t?Oe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class Le{constructor(t){Pe(this,"fileName"),Pe(this,"functionName"),Pe(this,"lineNumber"),Pe(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 Ae=/(^|@)\S+:\d+/,Fe=/^\s*at .*(\S+:\d+|\(native\))/m,Ne=/^(eval@)?(\[native code])?$/,$e={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Fe)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(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(t){return t.stack.split("\n").filter((function(t){return!!t.match(Fe)}),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,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Le({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Ne)}),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 Le({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Le({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(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(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new Le({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new Le({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ae)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Le({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function De(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function qe(t){return Array.isArray(t)}function je(t){return"object"==typeof t&&null!==t&&!qe(t)}function Ue(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(je(t[i])&&Ue(t[i],e-1))return!0;return!1}function He(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(je(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||je(o)&&Ue(o,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var u in e){var l=e[u];a[u]=qe(l)?De(l.length?l[0]:null):l}return a}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 Be={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 ze(t,e,r){var i,n=r?Object.assign({},Be,r):Be,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var o=0,a=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message,i=$e.parse(e.error).map((t=>t.toString())),s=[He(r,n.stringifyOptions)];t({level:"error",trace:i,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[He("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[He("Uncaught (in promise)",n.stringifyOptions),He(e.reason,n.stringifyOptions)]);var s=$e.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach((t=>t()))};function d(e,r){var i=this;return e[r]?function(e,s,u){try{if(!(s in e))return()=>{};var l=e[s],h=(e=>function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||a)){a=!0;try{var h=$e.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>He(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:r,trace:h,payload:c}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[He("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{a=!1}}})(l);return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:l}})),e[s]=h,()=>{e[s]=l}}catch(t){return()=>{}}}(e,r):()=>{}}}var Ve,We=t=>({name:"rrweb/console@1",observer:ze,options:t}),Ze=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Ge=function(t){return t.MinLength="min_length",t.MaxLength="max_length",t}({}),Qe=["$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"],Je="NativeGzipValidationError",Ke=t=>t.length>=2&&31===t[0]&&139===t[1],Ye=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Xe=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Je,e},tr=function(){var t=e((function*(t,e){18>t.size&&Xe("too-short");var r=new Uint8Array(yield t.slice(0,10).arrayBuffer());Ke(r)&&8===r[2]||Xe("invalid-header");var i=new DataView(yield t.slice(t.size-8).arrayBuffer());i.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Ve)return Ve;Ve=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;Ve[t]=e>>>0}return Ve})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&Xe("invalid-crc");var n=e.length>>>0;i.getUint32(4,!0)!==n&&Xe("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function er(){return er=e((function*(t,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(t),s=new CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(n).then((()=>o.close())).catch(function(){var t=e((function*(t){try{yield o.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),u=new Response(s.readable).blob(),[l]=yield Promise.all([u,a]);return yield tr(l,n),l}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),null}})),er.apply(this,arguments)}var rr=["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"],ir=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return rr.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))};function nr(t,e){return-1!==t.indexOf(e)}var sr=function(t){return t.trim()},or=function(t){return t.replace(/^\$/,"")},ar=Object.prototype,ur=ar.hasOwnProperty,lr=ar.toString,hr=Array.isArray||function(t){return"[object Array]"===lr.call(t)},cr=t=>"function"==typeof t,dr=t=>t===Object(t)&&!hr(t),vr=t=>{if(dr(t)){for(var e in t)if(ur.call(t,e))return!1;return!0}return!1},fr=t=>void 0===t,pr=t=>"[object String]"==lr.call(t),gr=t=>pr(t)&&0===t.trim().length,mr=t=>null===t,yr=t=>fr(t)||mr(t),br=t=>"[object Number]"==lr.call(t)&&t==t,_r=t=>br(t)&&t>0,wr=t=>"[object Boolean]"===lr.call(t),xr=t=>t instanceof FormData;function Sr(t){return null===t||"object"!=typeof t}function kr(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Cr(t){return"undefined"!=typeof Event&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var Tr=[!0,"true",1,"1","yes"],Ir=t=>nr(Tr,t),Er=[!1,"false",0,"0","no"];function Rr(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),br(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),Rr(n||r,e,r,i))}class Mr{constructor(t){this.$t={},this.zt=t.zt,this.Zt=Rr(t.bucketSize,0,100,t.Gt),this.Qt=Rr(t.refillRate,0,this.Zt,t.Gt),this.Jt=Rr(t.refillInterval,0,864e5,t.Gt)}Kt(t,e){var r=Math.floor((e-t.lastAccess)/this.Jt);r>0&&(t.tokens=Math.min(t.tokens+r*this.Qt,this.Zt),t.lastAccess=t.lastAccess+r*this.Jt)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.$t[i];return n?this.Kt(n,r):this.$t[i]=n={tokens:this.Zt,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.zt)||e.call(this,t)),0===n.tokens)}stop(){this.$t={}}}var Or,Pr,Lr,Ar="Mobile",Fr="iOS",Nr="Android",$r="Tablet",Dr=Nr+" "+$r,qr="iPad",jr="Apple",Ur=jr+" Watch",Hr="Safari",Br="BlackBerry",zr="Samsung",Vr=zr+"Browser",Wr=zr+" Internet",Zr="Chrome",Gr=Zr+" OS",Qr=Zr+" "+Fr,Jr="Internet Explorer",Kr=Jr+" "+Ar,Yr="Opera",Xr=Yr+" Mini",ti="Edge",ei="Microsoft "+ti,ri="Firefox",ii=ri+" "+Fr,ni="Nintendo",si="PlayStation",oi="Xbox",ai=Nr+" "+Ar,ui=Ar+" "+Hr,li="Windows",hi=li+" Phone",ci="Nokia",di="Ouya",vi="Generic",fi=vi+" "+Ar.toLowerCase(),pi=vi+" "+$r.toLowerCase(),gi="Konqueror",mi="Oculus Browser",yi="(\\d+(\\.\\d+)?)",bi=new RegExp("Version/"+yi),_i=new RegExp(oi,"i"),wi=new RegExp(si+" \\w+","i"),xi=new RegExp(ni+" \\w+","i"),Si=new RegExp(Br+"|PlayBook|BB10","i"),ki={"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"},Ci=function(t,e){return e=e||"",nr(t," OPR/")&&nr(t,"Mini")?Xr:nr(t," OPR/")?Yr:Si.test(t)?Br:nr(t,"IE"+Ar)||nr(t,"WPDesktop")?Kr:nr(t,"OculusBrowser")?mi:nr(t,Vr)?Wr:nr(t,ti)||nr(t,"Edg/")?ei:nr(t,"FBIOS")?"Facebook "+Ar:nr(t,"UCWEB")||nr(t,"UCBrowser")?"UC Browser":nr(t,"CriOS")?Qr:nr(t,"CrMo")||nr(t,Zr)?Zr:nr(t,Nr)&&nr(t,Hr)?ai:nr(t,"FxiOS")?ii:nr(t.toLowerCase(),gi.toLowerCase())?gi:((t,e)=>e&&nr(e,jr)||function(t){return nr(t,Hr)&&!nr(t,Zr)&&!nr(t,Nr)}(t))(t,e)?nr(t,Ar)?ui:Hr:nr(t,ri)?ri:nr(t,"MSIE")||nr(t,"Trident/")?Jr:nr(t,"Gecko")?ri:""},Ti={[Kr]:[new RegExp("rv:"+yi)],[ei]:[new RegExp(ti+"?\\/"+yi)],[Zr]:[new RegExp("("+Zr+"|CrMo)\\/"+yi)],[Qr]:[new RegExp("CriOS\\/"+yi)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+yi)],[Hr]:[bi],[ui]:[bi],[Yr]:[new RegExp("(Opera|OPR)\\/"+yi)],[ri]:[new RegExp(ri+"\\/"+yi)],[ii]:[new RegExp("FxiOS\\/"+yi)],[gi]:[new RegExp("Konqueror[:/]?"+yi,"i")],[Br]:[new RegExp(Br+" "+yi),bi],[ai]:[new RegExp("android\\s"+yi,"i")],[Wr]:[new RegExp(Vr+"\\/"+yi)],[mi]:[new RegExp("OculusBrowser\\/"+yi)],[Jr]:[new RegExp("(rv:|MSIE )"+yi)],Mozilla:[new RegExp("rv:"+yi)]},Ii=function(t,e){var r=Ci(t,e),i=Ti[r];if(fr(i))return null;for(var n=0;i.length>n;n++){var s=t.match(i[n]);if(s)return parseFloat(s[s.length-2])}return null},Ei=[[new RegExp(oi+"; "+oi+" (.*?)[);]","i"),t=>[oi,t&&t[1]||""]],[new RegExp(ni,"i"),[ni,""]],[new RegExp(si,"i"),[si,""]],[Si,[Br,""]],[new RegExp(li,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[hi,""];if(new RegExp(Ar).test(e)&&!/IEMobile\b/.test(e))return[li+" "+Ar,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=ki[r[1]]||"";return/arm/i.test(e)&&(i="RT"),[li,i]}return[li,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[Fr,[t[3],t[4],t[5]||"0"].join(".")]:[Fr,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=fr(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Nr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Nr+")","i"),t=>t&&t[2]?[Nr,[t[2],t[3],t[4]||"0"].join(".")]:[Nr,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Gr,""]],[/Linux|debian/i,["Linux",""]]],Ri=function(t){return xi.test(t)?ni:wi.test(t)?si:_i.test(t)?oi:new RegExp(di,"i").test(t)?di:new RegExp("("+hi+"|WPDesktop)","i").test(t)?hi:/iPad/.test(t)?qr:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ur:Si.test(t)?Br:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(ci,"i").test(t)?ci:/(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(Ar).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)?Nr:Dr:new RegExp("(pda|"+Ar+")","i").test(t)?fi:new RegExp($r,"i").test(t)&&!new RegExp($r+" pc","i").test(t)?pi:""},Mi=function(t,e){var r,i,n,s,o=Ri(t);return o===qr||o===Dr||"Kobo"===o||"Kindle Fire"===o||o===pi?$r:o===ni||o===oi||o===si||o===di?"Console":o===Ur?"Wearable":o?Ar:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(r=null==e?void 0:e.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==e?void 0:e.screenWidth)&&void 0!==i?i:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?Ar:$r:"Desktop"},Oi={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},Pi=Oi.info;function Li(t){if(wr(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(hr(t))return{arrayValue:{values:t.map((t=>Li(t)))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}function Ai(t){var e=[];for(var r in t){var i=t[r];mr(i)||fr(i)||e.push({key:r,value:Li(i)})}return e}function Fi(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}function Ni(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return Lr&&r.length===Pr||(Pr=r.length,Lr=r.reduce(((r,i)=>{Or||(Or={});var n=Or[i];if(n)r[n[0]]=n[1];else for(var s=t(i),o=s.length-1;o>=0;o--){var a=s[o],u=null==a?void 0:a.filename,l=e[i];if(u&&l){r[u]=l,Or[i]=[u,l];break}}return r}),{})),Lr}}class $i{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&hr(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.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 i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,s,o={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"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,r({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:Ni(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var Di="?";function qi(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?Di:r,in_app:!0};return fr(i)||(s.lineno=i),fr(n)||(s.colno=n),s}var ji=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:Di,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Ui=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Hi=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Bi=/\((\S*)(?::(\d+))(?::(\d+))\)/,zi=(t,e)=>{var r=Ui.exec(t);if(r){var[,i,n,s]=r;return qi(e,i,Di,+n,+s)}var o=Hi.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=Bi.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[u,l]=ji(o[1]||Di,o[2]);return qi(e,l,u,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Vi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Wi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Zi=(t,e)=>{var r=Vi.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Wi.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],s=r[1]||Di;return[s,n]=ji(s,n),qi(e,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Gi=/\(error: (.*)\)/,Qi=50;class Ji{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=pr(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?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 kr(t,"DOMException")}isDOMError(t){return kr(t,"DOMError")}}class Ki{match(t){return t instanceof Error}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 r=t.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Yi{constructor(){}match(t){return kr(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r;return e.apply(t.error)||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var Xi=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tn{match(t){return"string"==typeof t}coerce(t,e){var r,[i,n]=this.getInfos(t);return{type:null!=i?i:"Error",value:null!=n?n:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match(Xi);return i&&(e=i[1],r=i[2]),[e,r]}}var en=["fatal","error","warning","log","info","debug"];function rn(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(e>=n.length)return i===r.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class nn{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i=this.getErrorPropertyFromObject(t);return i?e.apply(i):{type:this.getType(t),value:this.getValue(t),stack:null==(r=e.syntheticException)?void 0:r.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 r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+rn(t)}isSeverityLevel(t){return pr(t)&&!gr(t)&&en.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var r=t[e];if(r instanceof Error)return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class sn{match(t){return Cr(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+rn(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class on{match(t){return Sr(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class an{match(t){return kr(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Cr(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return Sr(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var un="$message",ln="$timestamp",hn=new Set([un,ln]),cn={enabled:!0,max_bytes:32768};function dn(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:cn.enabled,max_bytes:fn(t.max_bytes,cn.max_bytes)}:r({},cn)}class vn{constructor(t){this.Yt=[],this.Xt=0,this.qt=dn(t)}setConfig(t){this.qt=dn(t),this.er()}add(t){var e=function(t){var e=function(t){var e=new WeakSet;try{return JSON.stringify(t,((t,r)=>{if("bigint"==typeof r)return r.toString();if("function"!=typeof r&&"symbol"!=typeof r){if(r instanceof Date)return r.toISOString();if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&"object"==typeof r){if(e.has(r))return"[Circular]";e.add(r)}return r}}))}catch(t){return}}(t);if(e)try{var r=JSON.parse(e);if(!dr(r))return;var i=r,n=i[un],s=i[ln];if(!pr(n)||0===n.trim().length)return;if(!pr(s)&&!br(s))return;return{step:i,json:e}}catch(t){return}}(t);if(e){var r=function(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),r=0,i=0;e.length>i;i++)"%"===e[i]?(r+=1,i+=2):r+=1;return r}(e.json);r>this.qt.max_bytes||(this.Yt.push({step:e.step,bytes:r}),this.Xt+=r,this.er())}}getAttachable(){return this.Yt.map((t=>t.step))}clear(){this.Yt=[],this.Xt=0}size(){return this.Yt.length}er(){for(;this.Xt>this.qt.max_bytes&&this.Yt.length>0;){var t=this.Yt.shift();t&&(this.Xt-=t.bytes)}}}function fn(t,e){if(!br(t)||t===1/0||t===-1/0)return e;var r=Math.floor(t);return 0>r?e:r}var pn="undefined"!=typeof window?window:void 0,gn="undefined"!=typeof globalThis?globalThis:pn;"undefined"==typeof self&&(gn.self=gn),"undefined"==typeof File&&(gn.File=function(){});var mn=null==gn?void 0:gn.navigator,yn=null==gn?void 0:gn.document,bn=null==gn?void 0:gn.location,_n=null==gn?void 0:gn.fetch,wn=null!=gn&&gn.XMLHttpRequest&&"withCredentials"in new gn.XMLHttpRequest?gn.XMLHttpRequest:void 0,xn=null==gn?void 0:gn.AbortController,Sn=null==gn?void 0:gn.CompressionStream,kn=null==mn?void 0:mn.userAgent,Cn=null!=pn?pn:{},Tn=t=>t instanceof Document,In="1.376.2",En={DEBUG:!1,LIB_VERSION:In,LIB_NAME:"web",JS_SDK_VERSION:In},Rn=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={k(e){if(pn&&(En.DEBUG||Cn.POSTHOG_DEBUG||r)&&!fr(pn.console)&&pn.console){for(var i=("__rrweb_original__"in pn.console[e]?pn.console[e].__rrweb_original__:pn.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(t,...s)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(t){i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>Rn(t+" "+e,r)};return i},Mn=Rn("[PostHog.js]"),On=Mn.createLogger;function Pn(t,e){hr(t)&&t.forEach(e)}function Ln(t,e){if(!yr(t))if(hr(t))t.forEach(e);else if(xr(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)ur.call(t,r)&&e(t[r],r)}var An=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function Fn(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}var Nn=function(t){try{return t()}catch(t){return}},$n=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){Mn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Mn.critical(t)}}},Dn=function(t){var e={};return Ln(t,(function(t,r){(pr(t)&&t.length>0||br(t))&&(e[r]=t)})),e};var qn=["herokuapp.com","vercel.app","netlify.app"];function jn(t){var e=null==t?void 0:t.hostname;if(!pr(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of qn)if(r===i)return!1;return!0}function Un(t,e,r,i){var{capture:n=!1,passive:s=!0}=null!=i?i:{};null==t||t.addEventListener(e,r,{capture:n,passive:s})}function Hn(t){return"ph_toolbar_internal"===t.name}var Bn=t=>{var e=null==yn?void 0:yn.createElement("a");return fr(e)?null:(e.href=t,e)},zn=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return Ln(t,(function(t,e){fr(t)||fr(e)||"undefined"===e||(r=encodeURIComponent(t instanceof File?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},Vn=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!hr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){Mn.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Wn=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],u=(o||"").split("&"),l=[],h=0;u.length>h;h++){var c=u[h].split("=");hr(c)&&(e.includes(c[0])?l.push(c[0]+"="+r):l.push(u[h]))}var d=a;return null!=o&&(d+="?"+l.join("&")),null!=n&&(d+="#"+n),d},Zn=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null};function Gn(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return cr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function Qn(t,e){var r,i=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:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}var Jn="$people_distinct_id",Kn="$device_id",Yn="__alias",Xn="__timers",ts="$autocapture_disabled_server_side",es="$heatmaps_enabled_server_side",rs="$exception_capture_enabled_server_side",is="$error_tracking_suppression_rules",ns="$error_tracking_capture_extension_exceptions",ss="$web_vitals_enabled_server_side",os="$dead_clicks_enabled_server_side",as="$product_tours_enabled_server_side",us="$web_vitals_allowed_metrics",ls="$session_recording_remote_config",hs="$replay_override_sampling",cs="$replay_override_linked_flag",ds="$replay_override_url_trigger",vs="$replay_override_event_trigger",fs="$sesid",ps="$session_is_sampled",gs="$enabled_feature_flags",ms="$active_feature_flags",ys="$early_access_features",bs="$feature_flag_details",_s="$feature_flag_payloads",ws="$feature_flag_request_id",xs="$override_feature_flags",Ss="$override_feature_flag_payloads",ks="$stored_person_properties",Cs="$stored_group_properties",Ts="$surveys",Is="$surveys_activated",Es="ph_product_tours",Rs="$flag_call_reported",Ms="$flag_call_reported_session_id",Os="$feature_flag_errors",Ps="$feature_flag_evaluated_at",Ls="$user_state",As="$client_session_props",Fs="$capture_rate_limit",Ns="$initial_campaign_params",$s="$initial_referrer_info",Ds="$initial_person_info",qs="$epp",js="__POSTHOG_TOOLBAR__",Us="$posthog_cookieless",Hs="$sdk_debug_extensions_init_method",Bs="$sdk_debug_extensions_init_time_ms",zs="$sdk_debug_recording_script_not_loaded",Vs="PostHog loadExternalDependency extension not found.",Ws="on_reject",Zs="always",Gs="anonymous",Qs="identified",Js="identified_only",Ks="visibilitychange",Ys="beforeunload",Xs="$pageview",to="$pageleave",eo="$identify",ro="$groupidentify",io=1,no=3,so=11;function oo(t){return t instanceof Element&&(t.id===js||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function ao(t){return!!t&&t.nodeType===io}function uo(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function lo(t){return!!t&&t.nodeType===no}function ho(t){return!!t&&t.nodeType===so&&ao(t.host)}function co(t){return t?sr(t).split(/\s+/):[]}function vo(t){var e=null==pn?void 0:pn.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function fo(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 co(e)}function po(t){return yr(t)?null:sr(t).split(/(\s+)/).filter((t=>Ao(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function go(t){var e="";return To(t)&&!Io(t)&&t.childNodes&&t.childNodes.length&&Ln(t.childNodes,(function(t){var r;lo(t)&&t.textContent&&(e+=null!==(r=po(t.textContent))&&void 0!==r?r:"")})),sr(e)}function mo(t){return fr(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var yo=["a","button","form","input","select","textarea","label"];function bo(t,e){if(fr(e))return!0;var r,i=function(t){if(e.some((e=>t.matches(e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function _o(t){var e=t.parentNode;return!(!e||!ao(e))&&e}var wo=["next","previous","prev",">","<"],xo=[".ph-no-deadclick",".ph-no-capture"],So=[".ph-no-rageclick",".ph-no-capture"];var ko=t=>!t||uo(t,"html")||!ao(t),Co=(t,e)=>{if(!pn||ko(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!uo(n,"body");)if(ho(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=_o(n);if(!s)break;if(e||yo.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=pn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function To(t){for(var e=t;e.parentNode&&!uo(e,"body");e=e.parentNode){var r=fo(e);if(nr(r,"ph-sensitive")||nr(r,"ph-no-capture"))return!1}if(nr(fo(t),"ph-include"))return!0;var i=t.type||"";if(pr(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!pr(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function Io(t){return!!(uo(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||uo(t,"select")||uo(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Eo="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Ro=new RegExp("^(?:"+Eo+")$"),Mo=new RegExp(Eo),Oo="\\d{3}-?\\d{2}-?\\d{4}",Po=new RegExp("^("+Oo+")$"),Lo=new RegExp("("+Oo+")");function Ao(t,e){if(void 0===e&&(e=!0),yr(t))return!1;if(pr(t)){if(t=sr(t),(e?Ro:Mo).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Po:Lo).test(t))return!1}return!0}function Fo(t){var e=go(t);return Ao(e=(e+" "+No(t)).trim())?e:""}function No(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Ln(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=go(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+No(t)).trim())}catch(t){Mn.error("[AutoCapture]",t)}})),e}function $o(t){return t.replace(/"|\\"/g,'\\"')}function Do(t){var e=t.attr__class;return e?hr(e)?e:co(e):void 0}var qo={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"]},jo=On("[Recorder]"),Uo=t=>"navigation"===t.entryType,Ho=t=>"resource"===t.entryType;function Bo(t,e){return!!e&&(wr(e)||e[t])}function zo(t){var{type:e,recordBody:r,headers:i,url:n}=t;function s(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)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(wr(r))return!0;if(hr(r))return s(r);var o=r[e];return wr(o)?o:s(o)}function Vo(t,e,r,i,n,s){return Wo.apply(this,arguments)}function Wo(){return Wo=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return jo.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(Ho(o=t[s])&&o.initiatorType===e&&(fr(i)||o.startTime>=i)&&(fr(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*s))),Vo(t,e,r,i,n,s+1))})),Wo.apply(this,arguments)}function Zo(t){var{body:e,options:r,url:i}=t;if(yr(e))return null;var{hostname:n,isHostDenied:s}=Qn(i,r);if(s)return n+" is in deny list";if(pr(e))return e;if(Tn(e))return e.textContent;if(xr(e))return zn(e);if(dr(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 Go=t=>!mr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Qo(t){var{entry:e,method:i,status:n,networkRequest:s,isInitial:o,start:a,end:u,url:l,initiatorType:h}=t;a=e?e.startTime:a,u=e?e.responseEnd:u;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[r({},e?e.toJSON():{name:l},{startTime:fr(a)?void 0:Math.round(a),endTime:fr(u)?void 0:Math.round(u),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(Go(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 Jo=["video/","audio/"];function Ko(t){return new Promise((e=>{var r=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>e("[SessionReplay] Failed to read body: "+t))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e("[SessionReplay] Failed to read body")}}))}function Yo(){return Yo=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:s}=Qn(i,r);return s?Promise.resolve(n+" is in deny list"):Ko(e)})),Yo.apply(this,arguments)}function Xo(){return Xo=e((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=Jo.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:u}=Qn(n,i);return u?a+" is in deny list":null}({r:e,options:r,url:i});return mr(n)?Ko(e):Promise.resolve(n)})),Xo.apply(this,arguments)}var ta=null;function ea(t,i,n){if(!("performance"in i))return()=>{};if(ta)return jo.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},qo,n):qo,o=e=>{var i=[];e.requests.forEach((t=>{var e=s.maskRequestFn(t);e&&i.push(e)})),i.length>0&&t(r({},e,{requests:i}))},a=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Uo(t)||Ho(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>Qo({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>Uo(t)||Ho(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>Qo({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),u=()=>{},l=()=>{};return(s.recordHeaders||s.recordBody)&&(u=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Bo("request",r.recordHeaders),n=Bo("response",r.recordHeaders),s=Gn(e.XMLHttpRequest.prototype,"open",(s=>function(o,a,u,l,h){void 0===u&&(u=!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)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=t=>(zo({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=Zo({body:t,options:r,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 i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),zo({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=Zo({body:v.response,options:r,url:a})),Vo(e,"xmlhttprequest",f.url,c,d).then((e=>{var r=Qo({entry:e,method:o,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",_),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),s.call(v,o,a.toString(),u,l,h)}));return()=>{s()}}(o,i,s),l=function(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Bo("request",i.recordHeaders),s=Bo("response",i.recordHeaders),o=Gn(r,"fetch",(o=>function(){var a=e((function*(e,a){var u,l,h,c=new Request(e,a),d={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),n&&(d.requestHeaders=v),zo({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(d.requestBody=yield function(t){return Yo.apply(this,arguments)}({r:c,options:i,url:e})),l=r.performance.now(),u=yield o(c),h=r.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),s&&(d.responseHeaders=f),zo({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(d.responseBody=yield function(t){return Xo.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{Vo(r,"fetch",c.url,l,h).then((e=>{var r,i=Qo({entry:e,method:c.method,status:null==(r=u)?void 0:r.status,networkRequest:d,start:l,end:h,url:c.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),ta=()=>{a(),u(),l(),ta=null}}var ra=t=>({name:"rrweb/network@1",observer:ea,options:t});Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:We,getRecordNetworkPlugin:ra},Cn.__PosthogExtensions__.rrweb={record:Me,version:"v2",wasMaxDepthReached:()=>ht,resetMaxDepthState(){ht=!1,lt=!1}},Cn.rrweb={record:Me,version:"v2"},Cn.rrwebConsoleRecord={getRecordConsolePlugin:We},Cn.getRecordNetworkPlugin=ra;var ia,na,sa,oa,aa,ua,la,ha,ca,da,va,fa,pa={},ga=[],ma=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ya=Array.isArray;function ba(t,e){for(var r in e)t[r]=e[r];return t}function _a(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function wa(t,e,r){var i,n,s,o={};for(s in e)"key"==s?i=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?ia.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return xa(t,o,i,n,null)}function xa(t,e,r,i,n){var s={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++sa:n,__i:-1,__u:0};return null==n&&null!=na.vnode&&na.vnode(s),s}function Sa(t){return t.children}function ka(t,e){this.props=t,this.context=e}function Ca(t,e){if(null==e)return t.__?Ca(t.__,t.__i+1):null;for(var r;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Ca(t):null}function Ta(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return Ta(t)}}function Ia(t){(!t.__d&&(t.__d=!0)&&oa.push(t)&&!$.__r++||aa!=na.debounceRendering)&&((aa=na.debounceRendering)||ua)($)}function $(){for(var t,e,r,i,n,s,o,a=1;oa.length;)oa.length>a&&oa.sort(la),t=oa.shift(),a=oa.length,t.__d&&(r=void 0,i=void 0,n=(i=(e=t).__v).__e,s=[],o=[],e.__P&&((r=ba({},i)).__v=i.__v+1,na.vnode&&na.vnode(r),Aa(e.__P,r,i,e.__n,e.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?Ca(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,Na(s,r,o),i.__e=i.__=null,r.__e!=n&&Ta(r)));$.__r=0}function Ea(t,e,r,i,n,s,o,a,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||ga,b=e.length;for(u=function(t,e,r,i,n){var s,o,a,u,l,h=r.length,c=h,d=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=xa(null,o,null,null,null):ya(o)?o=t.__k[s]=xa(Sa,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=xa(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,u=s+d,o.__=t,o.__b=t.__b+1,a=null,-1!=(l=o.__i=Ma(o,r,u,c))&&(c--,(a=r[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(n>h?d--:h>n&&d++),"function"!=typeof o.type&&(o.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,o.__u|=4))):t.__k[s]=null;if(c)for(s=0;h>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=Ca(a)),qa(a,a));return i}(r,e,y,u,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1==v.__i?pa:y[v.__i]||pa,v.__i=c,g=Aa(t,v,d,n,s,o,a,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Da(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||d.__k===v.__k?u=Ra(v,u,t,m):"function"==typeof v.type&&void 0!==g?u=g:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function Ra(t,e,r,i){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=Ra(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Ca(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Ma(t,e,r,i){var n,s,o,a=t.key,u=t.type,l=e[r],h=null!=l&&0==(2&l.__u);if(null===l&&null==a||h&&a==l.key&&u==l.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||e.length>s;)if(null!=(l=e[o=0>n?s++:n--])&&0==(2&l.__u)&&a==l.key&&u==l.type)return o;return-1}function Oa(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||ma.test(e)?r:r+"px"}function Pa(t,e,r,i,n){var s,o;t:if("style"==e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||Oa(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||Oa(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(ha,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?i?r.u=i.u:(r.u=ca,t.addEventListener(e,s?va:da,s)):t.removeEventListener(e,s?va:da,s);else{if("http://www.w3.org/2000/svg"==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&&"popover"!=e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==r?"":r))}}function La(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e.t)e.t=ca++;else if(r.u>e.t)return;return r(na.event?na.event(e):e)}}}function Aa(t,e,r,i,n,s,o,a,u,l){var h,c,d,v,f,p,g,m,y,b,_,$,w,x,S,k,C,T=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(u=!!(32&r.__u),s=[a=e.__e=r.__e]),(h=na.__b)&&h(e);t:if("function"==typeof T)try{if(m=e.props,y="prototype"in T&&T.prototype.render,b=(h=T.contextType)&&i[h.__c],_=h?b?b.props.value:h.__:i,r.__c?g=(c=e.__c=r.__c).__=c.__E:(y?e.__c=c=new T(m,_):(e.__c=c=new ka(m,_),c.constructor=T,c.render=ja),b&&b.sub(c),c.state||(c.state={}),c.__n=i,d=c.__d=!0,c.__h=[],c._sb=[]),y&&null==c.__s&&(c.__s=c.state),y&&null!=T.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=ba({},c.__s)),ba(c.__s,T.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=e,d)y&&null==T.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),y&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(y&&null==T.getDerivedStateFromProps&&m!==v&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(m,_),e.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(m,c.__s,_)){for(e.__v!=r.__v&&(c.props=m,c.state=c.__s,c.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some((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,_),y&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(v,f,p)}))}if(c.context=_,c.props=m,c.__P=t,c.__e=!1,w=na.__r,x=0,y){for(c.state=c.__s,c.__d=!1,w&&w(e),h=c.render(c.props,c.state,c.context),S=0;c._sb.length>S;S++)c.__h.push(c._sb[S]);c._sb=[]}else do{c.__d=!1,w&&w(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&25>++x);c.state=c.__s,null!=c.getChildContext&&(i=ba(ba({},i),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),k=h,null!=h&&h.type===Sa&&null==h.key&&(k=$a(h.props.children)),a=Ea(t,ya(k)?k:[k],e,r,i,n,s,o,a,u,l),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),g&&(c.__E=c.__=null)}catch(t){if(e.__v=null,u||null!=s)if(t.then){for(e.__u|=u?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else{for(C=s.length;C--;)_a(s[C]);Fa(e)}else e.__e=r.__e,e.__k=r.__k,t.then||Fa(e);na.__e(t,e,r)}else null==s&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=function(t,e,r,i,n,s,o,a,u){var l,h,c,d,v,f,p,g=r.props||pa,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(l=0;s.length>l;l++)if((v=s[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,s[l]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(na.__m&&na.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s=s&&ia.call(t.childNodes),!a&&null!=s)for(g={},l=0;t.attributes.length>l;l++)g[(v=t.attributes[l]).name]=v.value;for(l in g)if(v=g[l],"children"==l);else if("dangerouslySetInnerHTML"==l)c=v;else if(!(l in m)){if("value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m)continue;Pa(t,l,null,v,n)}for(l in m)v=m[l],"children"==l?d=v:"dangerouslySetInnerHTML"==l?h=v:"value"==l?f=v:"checked"==l?p=v:a&&"function"!=typeof v||g[l]===v||Pa(t,l,v,g[l],n);if(h)a||c&&(h.__html==c.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),Ea("template"==e.type?t.content:t,ya(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&Ca(r,0),a,u),null!=s)for(l=s.length;l--;)_a(s[l]);a||(l="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[l]||"progress"==y&&!f||"option"==y&&f!=g[l])&&Pa(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&Pa(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,s,o,u,l);return(h=na.diffed)&&h(e),128&e.__u?void 0:a}function Fa(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Fa)}function Na(t,e,r){for(var i=0;r.length>i;i++)Da(r[i],r[++i],r[++i]);na.__c&&na.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){na.__e(t,e.__v)}}))}function $a(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:ya(t)?t.map($a):ba({},t)}function Da(t,e,r){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){na.__e(t,r)}}function qa(t,e,r){var i,n;if(na.unmount&&na.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Da(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){na.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(n=0;i.length>n;n++)i[n]&&qa(i[n],e,r||"function"!=typeof t.type);r||_a(t.__e),t.__c=t.__=t.__e=void 0}function ja(t,e,r){return this.constructor(t,r)}function Ua(t,e,r){var i,n,s;e==document&&(e=document.documentElement),na.__&&na.__(t,e),i=e.__k,n=[],s=[],Aa(e,t=e.__k=wa(Sa,null,[t]),i||pa,pa,e.namespaceURI,i?null:e.firstChild?ia.call(e.childNodes):null,n,i?i.__e:e.firstChild,!1,s),Na(n,t,s)}ia=ga.slice,na={__e(t,e,r,i){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,i||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},sa=0,ka.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=ba({},this.state),"function"==typeof t&&(t=t(ba({},r),this.props)),t&&ba(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),Ia(this))},ka.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ia(this))},ka.prototype.render=Sa,oa=[],ua="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,la=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,ha=/(PointerCapture)$|Capture$/i,ca=0,da=La(!1),va=La(!0),fa=0;var Ha,Ba,za,Va,Wa=0,Za=[],Ga=na,Qa=Ga.__b,Ja=Ga.__r,Ka=Ga.diffed,Ya=Ga.__c,Xa=Ga.unmount,tu=Ga.__;function eu(t,e){Ga.__h&&Ga.__h(Ba,t,Wa||e),Wa=0;var r=Ba.__H||(Ba.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function ru(t){return Wa=1,function(t,e,r){var i=eu(Ha++,2);if(i.t=t,!i.__c&&(i.__=[vu(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Ba,!Ba.__f)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(t){return!!t.__c}));if(n.every((function(t){return!t.__N})))return!s||s.call(this,t,e,r);var o=i.__c.props!==t;return n.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),s&&s.call(this,t,e,r)||o};Ba.__f=!0;var s=Ba.shouldComponentUpdate,o=Ba.componentWillUpdate;Ba.componentWillUpdate=function(t,e,r){if(this.__e){var i=s;s=void 0,n(t,e,r),s=i}o&&o.call(this,t,e,r)},Ba.shouldComponentUpdate=n}return i.__N||i.__}(vu,t)}function iu(t,e){var r=eu(Ha++,3);!Ga.__s&&du(r.__H,e)&&(r.__=t,r.u=e,Ba.__H.__h.push(r))}function nu(t){return Wa=5,su((function(){return{current:t}}),[])}function su(t,e){var r=eu(Ha++,7);return du(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function ou(t){var e=Ba.context[t.__c],r=eu(Ha++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(Ba)),e.props.value):t.__}function au(){for(var t;t=Za.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(hu),t.__H.__h.forEach(cu),t.__H.__h=[]}catch(e){t.__H.__h=[],Ga.__e(e,t.__v)}}Ga.__b=function(t){Ba=null,Qa&&Qa(t)},Ga.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),tu&&tu(t,e)},Ga.__r=function(t){Ja&&Ja(t),Ha=0;var e=(Ba=t.__c).__H;e&&(za===Ba?(e.__h=[],Ba.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach(hu),e.__h.forEach(cu),e.__h=[],Ha=0)),za=Ba},Ga.diffed=function(t){Ka&&Ka(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Za.push(e)&&Va===Ga.requestAnimationFrame||((Va=Ga.requestAnimationFrame)||lu)(au)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),za=Ba=null},Ga.__c=function(t,e){e.some((function(t){try{t.__h.forEach(hu),t.__h=t.__h.filter((function(t){return!t.__||cu(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],Ga.__e(r,t.__v)}})),Ya&&Ya(t,e)},Ga.unmount=function(t){Xa&&Xa(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{hu(t)}catch(t){e=t}})),r.__H=void 0,e&&Ga.__e(e,r.__v))};var uu="function"==typeof requestAnimationFrame;function lu(t){var e,r=function(){clearTimeout(i),uu&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);uu&&(e=requestAnimationFrame(r))}function hu(t){var e=Ba,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Ba=e}function cu(t){var e=Ba;t.__c=t.__(),Ba=e}function du(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function vu(t,e){return"function"==typeof e?e(t):e}var fu={Activation:"events",Cancellation:"cancelEvents"},pu={Button:"button",Tab:"tab",Selector:"selector"},gu={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},mu={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},yu={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},bu={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},_u={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},wu={Once:"once",Recurring:"recurring",Always:"always"},xu={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Su={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},ku={Popover:"popover",Inline:"inline"};function Cu(t){return"$survey_response_"+t}function Tu(t,e){if(!e)return null;var r=t[Cu(e)];return hr(r)?[...r]:r}function Iu(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!fr(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=Tu(t,e.id);fr(s)||(i[n]=s)}})),r({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:Tu(t,e.id)})))},t,i)}function Eu(t,e){var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r}function Ru(t){return"string"==typeof t&&t.trim()?t.trim():null}function Mu(t){return t.toLowerCase()}function Ou(t,e,r){if(!t||!e)return null;var i=Mu(e),n=Object.keys(t).find((t=>Mu(t)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var s=i.split("-")[0],o=Object.keys(t).find((t=>Mu(t)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}function Pu(t,e,i){var n,s=Ou(t.translations,e,i),o=r({},t),a=!1;if(s){var u,l=null==(u=t.translations)?void 0:u[s];l&&(null==i||i.info("Applying survey-level translation for language: "+s),fr(l.name)||(o.name=l.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),fr(l.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=l.thankYouMessageHeader,a=!0),fr(l.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=l.thankYouMessageDescription,a=!0),fr(l.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=l.thankYouMessageCloseButtonText,a=!0)):function(t){return!fr(t.thankYouMessageHeader)||!fr(t.thankYouMessageDescription)||!fr(t.thankYouMessageCloseButtonText)}(l)&&(a=!0))}var h=t.questions.map((t=>function(t,e,i){var n,s=Ou(t.translations,e,i);if(!s)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(n=t.translations)?void 0:n[s];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=r({},t),u=!1;return fr(o.question)||(a.question=o.question,u=!0),fr(o.description)||(a.description=o.description,u=!0),fr(o.buttonText)||(a.buttonText=o.buttonText,u=!0),"link"in a&&!fr(o.link)&&(a.link=o.link,u=!0),"lowerBoundLabel"in a&&!fr(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,u=!0),"upperBoundLabel"in a&&!fr(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,u=!0),"choices"in a&&function(t){return hr(t.choices)}(o)&&(a.choices=o.choices,u=!0),{question:u?a:t,matchedKey:u?s:null,hasChanges:u}}(t,e,i))),c=h.map((t=>t.question)),d=h.some((t=>t.hasChanges)),v=null;return s||(v=(null==(n=h.find((t=>t.matchedKey)))?void 0:n.matchedKey)||null),d&&(o.questions=c,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:o,matchedKey:a?s||v:null}}var Lu=On("[Surveys]");function Au(t){return!(!t.start_date||t.end_date)}function Fu(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Nu(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var $u="seenSurvey_",Du="inProgressSurvey_",qu=(t,e)=>{var r=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(r=""+t+e.id+"_"+e.current_iteration),r},ju=t=>qu($u,t),Uu=t=>{try{var e=ju(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Lu.error("Failed to persist survey seen state",t)}},Hu=[yu.Popover,yu.Widget,yu.API],Bu={ignoreConditions:!1,ignoreDelay:!1,displayType:ku.Popover};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return br(t)&&isFinite(t)&&Math.floor(t)===t});class zu{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>e||0>r||0>i||t>0xffffffffffff||e>4095||r>1073741823||i>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|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new zu(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),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 zu(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class Vu{constructor(){this.S=0,this.C=0,this.I=new Gu}generate(){var t=this.generateOrAbort();if(fr(t)){this.S=0;var e=this.generateOrAbort();if(fr(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.S)this.S=t,this.T();else{if(this.S>=t+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.T())}return zu.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}T(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var Wu,Zu=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};pn&&!fr(pn.crypto)&&crypto.getRandomValues&&(Zu=t=>crypto.getRandomValues(t));class Gu{constructor(){this.M=new Uint32Array(8),this.O=1/0}nextUint32(){return this.M.length>this.O||(Zu(this.M),this.O=0),this.M[this.O++]}}var Qu=()=>Ju().toString(),Ju=()=>(Wu||(Wu=new Vu)).generate(),Ku=["fatal","error","warning","log","info","debug"],Yu={GZipJS:"gzip-js",Base64:"base64"},Xu=Uint8Array,tl=Uint16Array,el=Uint32Array,rl=new Xu([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]),il=new Xu([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]),nl=new Xu([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),sl=function(t,e){for(var r=new tl(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new el(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},ol=sl(rl,2),al=ol[1];ol[0][28]=258,al[258]=28;for(var ul=sl(il,0)[1],ll=new tl(32768),hl=0;32768>hl;++hl){var cl=(43690&hl)>>>1|(21845&hl)<<1;ll[hl]=((65280&(cl=(61680&(cl=(52428&cl)>>>2|(13107&cl)<<2))>>>4|(3855&cl)<<4))>>>8|(255&cl)<<8)>>>1}var dl=function(t,e,r){for(var i=t.length,n=0,s=new tl(e);i>n;++n)++s[t[n]-1];var o,a=new tl(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new tl(1<<e);var u=15-e;for(n=0;i>n;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],c=a[t[n]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)o[ll[c]>>>u]=l}else for(o=new tl(i),n=0;i>n;++n)o[n]=ll[a[t[n]-1]++]>>>15-t[n];return o},vl=new Xu(288);for(hl=0;144>hl;++hl)vl[hl]=8;for(hl=144;256>hl;++hl)vl[hl]=9;for(hl=256;280>hl;++hl)vl[hl]=7;for(hl=280;288>hl;++hl)vl[hl]=8;var fl=new Xu(32);for(hl=0;32>hl;++hl)fl[hl]=5;var pl=dl(vl,9,0),gl=dl(fl,5,0),ml=function(t){return(t/8>>0)+(7&t&&1)},yl=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof tl?tl:t instanceof el?el:Xu)(r-e);return i.set(t.subarray(e,r)),i},bl=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},_l=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},wl=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new Xu(0),0];if(1==n){var o=new Xu(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],u=r[1],l=0,h=1,c=2;for(r[0]={s:-1,f:a.f+u.f,l:a,r:u};h!=n-1;)a=r[r[c].f>r[l].f?l++:c++],u=r[l!=h&&r[c].f>r[l].f?l++:c++],r[h++]={s:-1,f:a.f+u.f,l:a,r:u};var d=s[0].s;for(i=1;n>i;++i)s[i].s>d&&(d=s[i].s);var v=new tl(d+1),f=xl(r[h-1],v,0);if(f>e){i=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}));n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=s[i].s;e>v[b]?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var _=s[i].s;v[_]==e&&(--v[_],++p)}f=e}return[new Xu(v),f]},xl=function(t,e,r){return-1==t.s?Math.max(xl(t.l,e,r+1),xl(t.r,e,r+1)):e[t.s]=r},Sl=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new tl(++e),i=0,n=t[0],s=1,o=function(t){r[i++]=t},a=1;e>=a;++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[r.subarray(0,i),e]},kl=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Cl=function(t,e,r){var i=r.length,n=ml(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},Tl=function(t,e,r,i,n,s,o,a,u,l,h){bl(e,h++,r),++n[256];for(var c=wl(n,15),d=c[0],v=c[1],f=wl(s,15),p=f[0],g=f[1],m=Sl(d),y=m[0],b=m[1],_=Sl(p),w=_[0],x=_[1],S=new tl(19),k=0;y.length>k;++k)S[31&y[k]]++;for(k=0;w.length>k;++k)S[31&w[k]]++;for(var C=wl(S,7),T=C[0],I=C[1],E=19;E>4&&!T[nl[E-1]];--E);var R,M,O,P,L=l+5<<3,A=kl(n,vl)+kl(s,fl)+o,F=kl(n,d)+kl(s,p)+o+14+3*E+kl(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(A>=L&&F>=L)return Cl(e,h,t.subarray(u,u+l));if(bl(e,h,1+(A>F)),h+=2,A>F){R=dl(d,v,0),M=d,O=dl(p,g,0),P=p;var N=dl(T,I,0);for(bl(e,h,b-257),bl(e,h+5,x-1),bl(e,h+10,E-4),h+=14,k=0;E>k;++k)bl(e,h+3*k,T[nl[k]]);h+=3*E;for(var D=[y,w],q=0;2>q;++q){var j=D[q];for(k=0;j.length>k;++k)bl(e,h,N[U=31&j[k]]),h+=T[U],U>15&&(bl(e,h,j[k]>>>5&127),h+=j[k]>>>12)}}else R=pl,M=vl,O=gl,P=fl;for(k=0;a>k;++k)if(i[k]>255){var U;_l(e,h,R[257+(U=i[k]>>>18&31)]),h+=M[U+257],U>7&&(bl(e,h,i[k]>>>23&31),h+=rl[U]);var H=31&i[k];_l(e,h,O[H]),h+=P[H],H>3&&(_l(e,h,i[k]>>>5&8191),h+=il[H])}else _l(e,h,R[i[k]]),h+=M[i[k]];return _l(e,h,R[256]),h+M[256]},Il=new el([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),El=function(){for(var t=new el(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Rl=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Ml(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=El[255&r^e[i]]^r>>>8;t=r},d(){return 4294967295^t}}}(),i=t.length;r.p(t);var n,s,o,a,u=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,r,i,n,s){var o=t.length,a=new Xu(i+o+5*(1+Math.floor(o/7e3))+n),u=a.subarray(i,a.length-n),l=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var c=h+65535;o>c?l=Cl(u,l,t.subarray(h,c)):(u[h]=!0,l=Cl(u,l,t.subarray(h,o)))}else{for(var d=Il[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new tl(32768),m=new tl(p+1),y=Math.ceil(r/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new el(25e3),x=new tl(288),S=new tl(32),k=0,C=0,T=(h=0,0),I=0,E=0;o>h;++h){var R=_(h),M=32767&h,O=m[R];if(g[M]=O,m[R]=M,h>=I){var P=o-h;if((k>7e3||T>24576)&&P>423){l=Tl(t,u,0,w,x,S,C,T,E,h-E,l),T=k=C=0,E=h;for(var L=0;286>L;++L)x[L]=0;for(L=0;30>L;++L)S[L]=0}var A=2,F=0,N=f,D=M-O&32767;if(P>2&&R==_(h-D))for(var q=Math.min(v,P)-1,j=Math.min(32767,h),U=Math.min(258,P);j>=D&&--N&&M!=O;){if(t[h+A]==t[h+A-D]){for(var H=0;U>H&&t[h+H]==t[h+H-D];++H);if(H>A){if(A=H,F=D,H>q)break;var B=Math.min(D,H-2),z=0;for(L=0;B>L;++L){var V=h-D+L+32768&32767,W=V-g[V]+32768&32767;W>z&&(z=W,O=V)}}}D+=(M=O)-(O=g[M])+32768&32767}if(F){w[T++]=268435456|al[A]<<18|ul[F];var Z=31&al[A],G=31&ul[F];C+=rl[Z]+il[G],++x[257+Z],++S[G],I=h+A,++k}else w[T++]=t[h],++x[t[h]]}}l=Tl(t,u,!0,w,x,S,C,T,E,h-E,l)}return yl(a,0,i+ml(l)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a)),l=u.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Rl(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}}(u,e),Rl(u,l-8,r.d()),Rl(u,l-4,i),u}var Ol=!!wn||!!_n,Pl="text/plain",Ll=!1,Al=(t,e)=>{var[r,i]=t.split("#"),[n,s]=r.split("?");if(!s)return t;var o=s.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return n+(o?"?"+o:"")+(i?"#"+i:"")},Fl=function(t,e,i){var n;void 0===i&&(i=!0);var[s,o]=t.split("?"),a=r({},e),u=null!==(n=null==o?void 0:o.split("&").map((t=>{var e,[r,n]=t.split("="),s=i&&null!==(e=a[r])&&void 0!==e?e:n;return delete a[r],r+"="+s})))&&void 0!==n?n:[],l=zn(a);return l&&u.push(l),s+"?"+u.join("&")},Nl=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),$l=t=>{if(t.tr)return t.tr;var{data:e,compression:r}=t;if(e){if(r===Yu.GZipJS){var i=Ml(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new Xu(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},o=0;r>o;++o){if(n+5>i.length){var a=new Xu(n+8+(r-o<<1));a.set(i),i=a}var u=t.charCodeAt(o);128>u?s(u):2048>u?(s(192|u>>>6),s(128|63&u)):u>55295&&57344>u?(s(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++o))>>>18),s(128|u>>>12&63),s(128|u>>>6&63),s(128|63&u)):(s(224|u>>>12),s(128|u>>>6&63),s(128|63&u))}return yl(i,0,n)}(Nl(e)),{mtime:0});return{contentType:Pl,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===Yu.Base64){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Nl(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Nl(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Nl(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Dl=t=>{var e,i,n,s=$l(t);return!s||(i=t.compression,n=Vn(t.url,"compression"),i!==Ze.GZipJS&&n!==Ze.GZipJS&&"gzip"!==n)||((e=s.body)instanceof ArrayBuffer?Ke(new Uint8Array(e)):ArrayBuffer.isView(e)&&Ke(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))?{url:t.url,encodedBody:s}:(Ll=!0,{url:Al(t.url,"compression"),encodedBody:$l(r({},t,{compression:void 0,tr:void 0}))})},ql=function(){var t=e((function*(t){var e=Nl(t.data),i=yield function(t,e,r){return er.apply(this,arguments)}(e,En.DEBUG,{rethrow:!0});if(!i)return t;var n=yield i.arrayBuffer();return r({},t,{tr:{contentType:Pl,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),jl=(t,e)=>Fl(t,{_:(new Date).getTime().toString(),ver:En.JS_SDK_VERSION,compression:e}),Ul=[];_n&&Ul.push({transport:"fetch",method(t){var e,{url:i,encodedBody:n}=Dl(t),{contentType:s,body:o,estimatedSize:a}=null!=n?n:{},u=new Headers;Ln(t.headers,(function(t,e){u.append(e,t)})),s&&u.append("Content-Type",s);var l=null;if(xn){var h=new xn;l={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}_n(i,r({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&52428.8>(a||0),body:o,signal:null==(e=l)?void 0:e.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){Mn.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{Mn.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>l?clearTimeout(l.timeout):null))}}),wn&&Ul.push({transport:"XHR",method(t){var e=new wn,{url:r,encodedBody:i}=Dl(t);e.open(t.method||"GET",r,!0);var{contentType:n,body:s}=null!=i?i:{};Ln(t.headers,(function(t,r){e.setRequestHeader(r,t)})),n&&e.setRequestHeader("Content-Type",n),t.timeout&&(e.timeout=t.timeout),t.disableXHRCredentials||(e.withCredentials=!0),e.onreadystatechange=()=>{if(4===e.readyState){var r={statusCode:e.status,text:e.responseText};if(200===e.status)try{r.json=JSON.parse(e.responseText)}catch(t){}null==t.callback||t.callback(r)}},e.send(s)}}),null!=mn&&mn.sendBeacon&&Ul.push({transport:"sendBeacon",method(t){try{var{url:e,encodedBody:r}=Dl(t),i=Fl(e,{beacon:"1"}),{contentType:n,body:s}=null!=r?r:{};if(!s)return;var o=s instanceof Blob?s:new Blob([s],{type:n});mn.sendBeacon(i,o)}catch(t){}}});var Hl=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 Bl(t,e,r){return Nl({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var zl={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=>Hl(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Hl(e,t))))),icontains:(t,e)=>e.map(Vl).some((e=>t.map(Vl).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Vl).every((e=>t.map(Vl).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},Vl=t=>t.toLowerCase();function Wl(t,e){return!t||Object.entries(t).every((t=>{var[r,i]=t,n=null==e?void 0:e[r];if(fr(n)||mr(n))return!1;var s=[String(n)],o=zl[i.operator];return!!o&&o(i.values,s)}))}var Zl="",Gl=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Ql={R:()=>!!yn,D(t){Mn.error("cookieStore error: "+t)},A(t){if(yn){try{for(var e=t+"=",r=yn.cookie.split(";").filter((t=>t.length)),i=0;r.length>i;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},F(t){var e;try{e=JSON.parse(Ql.A(t))||{}}catch(t){}return e},N(t,e,r,i,n){if(yn)try{var s="",o="",a=function(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=yn),Zl)return Zl;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var r=t.split("."),i=Math.min(r.length,8),n="dmn_chk_"+Qu();!Zl&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",Zl=s)}return Zl}(t);if(!r){var i=(t=>{var e=t.match(Gl);return e?e[0]:""})(t);i!==r&&Mn.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(yn.location.hostname,i);if(r){var u=new Date;u.setTime(u.getTime()+864e5*r),s="; expires="+u.toUTCString()}n&&(o="; secure");var l=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&Mn.warn("cookieStore warning: large cookie, len="+l.length),yn.cookie=l,l}catch(t){return}},q(t,e){if(null!=yn&&yn.cookie)try{Ql.N(t,"",-1,e)}catch(t){return}}},Jl=null,Kl={R(){if(!mr(Jl))return Jl;var t=!0;if(fr(pn))t=!1;else try{var e="__mplssupport__";Kl.N(e,"xyz"),'"xyz"'!==Kl.A(e)&&(t=!1),Kl.q(e)}catch(e){t=!1}return t||Mn.error("localStorage unsupported; falling back to cookie store"),Jl=t,t},D(t){Mn.error("localStorage error: "+t)},A(t){try{return null==pn?void 0:pn.localStorage.getItem(t)}catch(t){Kl.D(t)}return null},F(t){try{return JSON.parse(Kl.A(t))||{}}catch(t){}return null},N(t,e){try{null==pn||pn.localStorage.setItem(t,JSON.stringify(e))}catch(t){Kl.D(t)}},q(t){try{null==pn||pn.localStorage.removeItem(t)}catch(t){Kl.D(t)}}},Yl=[Kn,"distinct_id",fs,ps,qs,Ds,Ls],Xl={},th={R:()=>!0,D(t){Mn.error("memoryStorage error: "+t)},A:t=>Xl[t]||null,F:t=>Xl[t]||null,N(t,e){Xl[t]=e},q(t){delete Xl[t]}},eh=null,rh={R(){if(!mr(eh))return eh;if(eh=!0,fr(pn))eh=!1;else try{var t="__support__";rh.N(t,"xyz"),'"xyz"'!==rh.A(t)&&(eh=!1),rh.q(t)}catch(t){eh=!1}return eh},D(t){Mn.error("sessionStorage error: ",t)},A(t){try{return null==pn?void 0:pn.sessionStorage.getItem(t)}catch(t){rh.D(t)}return null},F(t){try{return JSON.parse(rh.A(t))||null}catch(t){}return null},N(t,e){try{null==pn||pn.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){rh.D(t)}},q(t){try{null==pn||pn.sessionStorage.removeItem(t)}catch(t){rh.D(t)}}},ih=On("[Stylesheet Loader]"),nh=pn,sh=yn,oh="#020617",ah={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:gu.Right,widgetType:pu.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:oh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},uh=[gu.Center,gu.Left,gu.Right];function lh(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 hh(t){var e;void 0===t&&(t=ah.backgroundColor),"#"===t[0]&&(e=lh(t)),t.startsWith("rgb")&&(e=t);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(r&&(e=lh(r)),!e)return oh;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?oh:"white"}return oh}var ch=(t,e,i)=>{var n=Rh(t),s=sh.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=sh.createElement("div");((t,e,i)=>{var n=r({},ah,i),s=t.style,o=!uh.includes(n.position)||e===yu.Widget&&(null==i?void 0:i.widgetType)===pu.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==i?void 0:i.submitButtonTextColor)||hh(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",hh(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||hh(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",hh(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),u=a||n.inputBackground;a||"white"!==n.backgroundColor||(u="#f8f8f8"),s.setProperty("--ph-survey-input-background",u);var l=(null==i?void 0:i.inputTextColor)||hh(u);s.setProperty("--ph-survey-input-text-color",l),s.setProperty("--ph-survey-rating-text-color",l),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"}),u=function(t){var e=((t,e,r)=>{var i,n=sh.createElement("style");return n.innerText=':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(ih.error("prepare_external_dependency_stylesheet returned null"),null)})(0,0,t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(u){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(u)}return sh.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},dh=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a,surveyLanguage:u}=t;s?(Uu(i),s.capture(xu.SENT,r({[Su.SURVEY_NAME]:i.name,[Su.SURVEY_ID]:i.id,[Su.SURVEY_ITERATION]:i.current_iteration,[Su.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Su.SURVEY_SUBMISSION_ID]:n,[Su.SURVEY_COMPLETED]:o},u&&{[Su.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},Iu(e,i),a,{$set:{[Eu(i,"responded")]:!0}})),o&&(nh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Eh(i))):Lu.error("[survey sent] event not captured, PostHog instance not found.")},vh=(t,e,i)=>{return r({[Su.SURVEY_NAME]:t.name,[Su.SURVEY_ID]:t.id,[Su.SURVEY_ITERATION]:t.current_iteration,[Su.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Su.SURVEY_PARTIALLY_COMPLETED]:(n=null==e?void 0:e.responses,void 0===n&&(n={}),Object.values(n).some((t=>!yr(t))))},(null==e?void 0:e.surveyLanguage)&&{[Su.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Su.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},Iu(null==e?void 0:e.responses,t));var n},fh=(t,e,i,n)=>{if(e){if(!i){var s=Th(t);e.capture(xu.DISMISSED,r({},vh(t,s,e),n&&{[Su.SURVEY_LANGUAGE]:n},{$set:{[Eu(t,"dismissed")]:!0}})),Eh(t),Uu(t),nh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Lu.error("[survey dismissed] event not captured, PostHog instance not found.")},ph=(t,e)=>{if(e){var r=(t=>qu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=Th(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(xu.ABANDONED,vh(t,i,e),{transport:"sendBeacon"})}}else Lu.error("[survey abandoned] event not captured, PostHog instance not found.")},gh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),mh=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,yh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?mh(t.questions,gh(t.questions)):t.questions,bh=t=>{var e;return!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation||!(t=>{var e,r;return null!=(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)?void 0:e.length)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(t))||t.schedule===wu.Always||Ih(t)},_h=function(t){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&r.forEach((function(t){t.__e=!0,Ia(t)}))},this.sub=function(t){r.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r&&r.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+fa++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),wh=()=>ou(_h),xh=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return function(t,e,r){var i,n,s,o,a=ba({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?i=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?ia.call(arguments,2):r),xa(t.type,a,i||t.key,n||t.ref,null)}(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function Sh(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==nh||null==(r=nh.location)?void 0:r.href;if(!n)return!1;var s=[t.conditions.url],o=function(t){return null!=t?t:"icontains"}(null==(i=t.conditions)?void 0:i.urlMatchType);return zl[o](s,[n])}var kh=t=>{var e=""+Du+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Du+t.id+"_"+t.current_iteration),e},Ch=(t,e)=>{try{localStorage.setItem(kh(t),JSON.stringify(e))}catch(t){Lu.error("Error setting in-progress survey state in localStorage",t)}},Th=t=>{try{var e=localStorage.getItem(kh(t));if(e)return JSON.parse(e)}catch(t){Lu.error("Error getting in-progress survey state from localStorage",t)}return null},Ih=t=>{var e=Th(t);return!yr(null==e?void 0:e.surveySubmissionId)},Eh=t=>{try{localStorage.removeItem(kh(t))}catch(t){Lu.error("Error clearing in-progress survey state from localStorage",t)}};function Rh(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function Mh(t,e,r){if(void 0===e&&(e=gu.Right),t===yu.ExternalSurvey)return{};switch(e){case gu.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case gu.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case gu.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case gu.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case gu.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case gu.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case gu.Left:return{left:"30px"};case gu.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===yu.Widget&&r===pu.Tab?"60px":"30px"}}}var Oh=0;function Ph(t,e,r,i,n,s){e||(e={});var o,a,u=e;if("ref"in u)for(a in u={},e)"ref"==a?o=e[a]:u[a]=e[a];var l={type:t,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Oh,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===u[a]&&(u[a]=o[a]);return na.vnode&&na.vnode(l),l}var Lh=Ph("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ph("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"})}),Ah=Ph("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ph("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"})}),Fh=Ph("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ph("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"})}),Nh=Ph("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ph("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"})}),$h=Ph("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ph("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"})}),Dh=Ph("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ph("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),qh=Ph("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ph("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),jh=function(t){var{fill:e="currentColor"}=void 0===t?{}:t;return Ph("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:e,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Ph("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Ph("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:e})]})},Uh=Ph("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ph("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ph("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ph("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ph("g",{mask:"url(#mask0_2415_6911)",children:[Ph("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"}),Ph("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"}),Ph("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"}),Ph("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"}),Ph("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"}),Ph("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"})]})]}),Ph("defs",{children:Ph("clipPath",{id:"clip0_2415_6911",children:Ph("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Hh(t){var{urlParams:e}=t,r=e?Object.entries(e).map((t=>{var[e,r]=t;return encodeURIComponent(e)+"="+encodeURIComponent(r)})).join("&"):"";return Ph("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Uh]})}function Bh(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=t,{isPreviewMode:u}=ou(_h);return Ph("div",{className:"bottom-section",children:[!a&&Ph("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==pn||pn.open(s)),u?null==o||o():n()},children:e}),!i.whiteLabel&&Ph(Hh,{urlParams:{utm_source:"survey-footer"}})]})}function zh(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return Ph("div",{class:"question-header",children:[Ph(e.type===bu.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&xh({component:wa("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function Vh(t){var{onClick:e}=t,{isPreviewMode:r}=ou(_h);return Ph("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:jh({fill:"black"})})}Ph("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ph("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 Wh=pn;function Zh(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=t,{isPopup:a}=ou(_h);return iu((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Un(Wh,"keydown",t),()=>{Wh.removeEventListener("keydown",t)}}),[o]),Ph("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Ph(Vh,{onClick:()=>o()}),Ph("h3",{className:"thank-you-message-header",children:e}),r&&xh({component:wa("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Ph(Bh,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Gh=t=>hr(t)&&t.every((t=>pr(t)));function Qh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=t,{isPreviewMode:u}=wh(),l=nu(null),[h,c]=ru((()=>pr(a)?a:""));iu((()=>{setTimeout((()=>{var t;u||null==(t=l.current)||t.focus()}),100)}),[u]);var d="surveyQuestion"+o,v=su((()=>function(t,e,r){var i,n,s=t.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case Ge.MinLength:if(void 0!==o.value&&o.value>s.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case Ge.MaxLength:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(h,e.validation,e.optional)),[h,e.validation,e.optional]),f=Fi(e.validation,Ge.MinLength),p=Fi(e.validation,Ge.MaxLength),g=su((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(f,p)),[f,p]),m=()=>{v||n(h.trim())},y=()=>{v||s(h.trim())};return Ph(Sa,{children:[Ph("div",{className:"question-container",children:[Ph(zh,{question:e,forceDisableHtml:r,htmlFor:d}),Ph("textarea",{ref:l,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:f,maxLength:p,onInput(t){c(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||v||(t.preventDefault(),u?y():m())},value:h}),g&&Ph("div",{className:"validation-hint",children:g})]}),Ph(Bh,{text:e.buttonText||"Submit",submitDisabled:!!v,appearance:i,onSubmit:m,onPreviewSubmit:y})]})}function Jh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=t;return Ph(Sa,{children:[Ph("div",{className:"question-container",children:Ph(zh,{question:e,forceDisableHtml:r})}),Ph(Bh,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function Kh(t){var e,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l=r.scale,h=10===r.scale?0:1,[c,d]=ru((()=>br(u)?u:hr(u)&&u.length>0&&br(parseInt(u[0]))?parseInt(u[0]):pr(u)&&br(parseInt(u))?parseInt(u):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=wh(),p=t=>f?a(t):o(t);return Ph(Sa,{children:[Ph("div",{className:"question-container",children:[Ph(zh,{question:r,forceDisableHtml:i}),Ph("div",{className:"rating-section",children:[Ph("div",{className:"rating-options",children:["emoji"===r.display&&Ph("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(e=ic[r.scale])?void 0:e.map(((t,e)=>Ph("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===c?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;d(t),r.skipSubmitButton&&p(t)},children:t},e)))}),"number"===r.display&&Ph("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-h+1)+", minmax(0, 1fr))"},children:nc(r.scale).map(((t,e)=>Ph(Yh,{displayQuestionIndex:n,active:c===t,appearance:s,num:t,setActiveNumber(t){d(t),r.skipSubmitButton&&p(t)}},e)))})]}),!v&&Ph("div",{className:"rating-text",children:[Ph("div",{children:r.lowerBoundLabel}),Ph("div",{children:r.upperBoundLabel})]})]})]}),Ph(Bh,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:mr(c)&&!r.optional,appearance:s,onSubmit:()=>o(c),onPreviewSubmit:()=>a(c),skipSubmitButton:r.skipSubmitButton})]})}function Yh(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return Ph("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick(){n(e)},children:e})}function Xh(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l=nu(null),h=su((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=mh(e,gh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[c,d]=ru((()=>((t,e)=>pr(t)||Gh(t)?t:e===bu.SingleChoice?null:[])(u,e.type))),[v,f]=ru((()=>((t,e)=>{if(pr(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Gh(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,h))),{isPreviewMode:p}=wh(),g=e.type===bu.SingleChoice,m=e.type===bu.MultipleChoice,y=e.skipSubmitButton&&g&&!e.hasOpenChoice,b=(t,e)=>{if(e){var i=!v.isSelected;return f((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),g&&d(""),void(i&&setTimeout((()=>{var t;return null==(t=l.current)?void 0:t.focus()}),75))}if(g)return d(t),f((t=>r({},t,{isSelected:!1,inputValue:""}))),void(y&&(o(t),p&&a(t)));m&&hr(c)&&(c.includes(t)?d(c.filter((e=>e!==t))):d([...c,t]))},_=t=>{t.stopPropagation();var e=t.currentTarget.value;f((t=>r({},t,{inputValue:e}))),g&&d(e)},w=t=>{t.stopPropagation(),"Enter"!==t.key||x()||(t.preventDefault(),S()),"Escape"===t.key&&(t.preventDefault(),f((t=>r({},t,{isSelected:!1,inputValue:""}))),g&&d(null))},x=()=>!(e.optional||!mr(c)&&(!hr(c)||v.isSelected||0!==c.length)&&(!v.isSelected||""!==v.inputValue.trim())),S=()=>{v.isSelected&&m?hr(c)&&(p?a([...c,v.inputValue]):o([...c,v.inputValue])):p?a(c):o(c)};return Ph(Sa,{children:[Ph("div",{className:"question-container",children:[Ph(zh,{question:e,forceDisableHtml:i}),Ph("fieldset",{className:"multiple-choice-options limit-height",children:[Ph("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?v.isSelected:g?c===t:hr(c)&&c.includes(t);return Ph("label",{className:i?"choice-option-open":"",children:[Ph("div",{className:"response-choice",children:[Ph("input",{type:g?"radio":"checkbox",name:s,checked:a,onChange:()=>b(t,i),id:s,"aria-controls":o}),Ph("span",{children:i?t+":":t})]}),i&&Ph("input",{type:"text",ref:l,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"})]},r)}))]})]}),Ph(Bh,{text:e.buttonText||"Submit",submitDisabled:x(),appearance:s,onSubmit:S,onPreviewSubmit:S,skipSubmitButton:y})]})}var tc=[1,2,3,4,5],ec=[1,2,3,4,5,6,7],rc=[0,1,2,3,4,5,6,7,8,9,10],ic={2:[Dh,qh],3:[Fh,Ah,Lh],5:[Nh,Fh,Ah,Lh,$h]};function nc(t){switch(t){case 5:default:return tc;case 7:return ec;case 10:return rc}}var sc=On("[Surveys]");function oc(t,e,r){var i,n=t.questions[e],s=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?_u.End:s;if(n.branching.type===_u.End)return _u.End;if(n.branching.type===_u.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===_u.ResponseBased){if(n.type===bu.SingleChoice){var o,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var u=n.branching.responseValues[a];return Number.isInteger(u)?u:u===_u.End?_u.End:s}}else if(n.type===bu.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||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(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(l=n.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===_u.End?_u.End:s}}return s}return sc.warn("Falling back to next question index due to unexpected branching type"),s}var ac="https?://(.*)",uc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],lc=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...uc],hc="<masked>",cc=["li_fat_id"];function dc(t,e,r){if(!yn)return{};var i,n=e?[...uc,...r||[]]:[],s=vc(Wn(yn.URL,n,hc),t),o=(i={},Ln(cc,(function(t){var e=Ql.A(t);i[t]=e||null})),i);return An(o,s)}function vc(t,e){var r=lc.concat(e||[]),i={};return Ln(r,(function(e){var r=Vn(t,e);i[e]=r||null})),i}function fc(t){var e=function(t){return t?0===t.search(ac+"google.([^/?]*)")?"google":0===t.search(ac+"bing.com")?"bing":0===t.search(ac+"yahoo.com")?"yahoo":0===t.search(ac+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!mr(e)){i.$search_engine=e;var n=yn?Vn(yn.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function pc(){return navigator.language||navigator.userLanguage}var gc="$direct";function mc(){return(null==yn?void 0:yn.referrer)||gc}function yc(t,e){var r=t?[...uc,...e||[]]:[],i=null==bn?void 0:bn.href.substring(0,1e3);return{r:mc().substring(0,1e3),u:i?Wn(i,r,hc):void 0}}function bc(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:r==gc?gc:null==(e=Bn(r))?void 0:e.host};if(i){n.$current_url=i;var s=Bn(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=vc(i);An(n,o)}if(r){var a=fc(r);An(n,a)}return n}function _c(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function wc(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var xc=On("[SurveyTranslations]");function Sc(t,e){var r=function(t){return function(t,e){var{overrideLanguage:r,storedPersonProperties:i,locale:n}=t,s=Ru(r);if(s)return null==e||e.info("Using override display language: "+s),s;var o=function(t){return t&&"object"==typeof t&&"language"in t?Ru(t.language):null}(i);if(o)return null==e||e.info("Using person property language: "+o),o;var a=Ru(n);return a?(null==e||e.info("Using detected locale: "+a),a):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:cr(t.get_property)?t.get_property(ks):void 0,locale:pc()},xc)}(e);if(!r)return xc.info("No user language detected"),{survey:t,language:null};var i=Pu(t,r,xc);return{survey:i.survey,language:i.matchedKey}}var kc=pn,Cc=yn,Tc="ph:show_survey_widget",Ic="PHWidgetSurveyClickListener";function Ec(t,e){try{var r=t.getBoundingClientRect(),i=kc.innerHeight,n=kc.innerWidth,s=r.left+r.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:ah.zIndex}}catch(t){return Lu.warn("Failed to calculate trigger position:",t),null}}class Rc{constructor(t){var e=this;this.j=new Map,this.H=new Map,this.U=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(Ts);if(t)for(var e of t)Ih(e)&&ph(e,this._posthog)},this.handlePopoverSurvey=(t,e)=>{var i,n,s,o,{survey:a,language:u}=this.B(t),l=null!=e&&e.position||null!=e&&e.selector?r({},a,{appearance:r({},a.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):a;this.V(l.id);var{properties:h,initialResponses:c}=null!=e?e:{},d=!(!c||0>=Object.keys(c).length)&&this.W(l,c,h,u);if(!d||null!=(i=l.appearance)&&i.displayThankYouMessage){this.Z(l);var v={};if((null==(n=l.appearance)?void 0:n.position)===gu.NextToTrigger&&null!=(s=l.appearance)&&s.widgetSelector){var f,p=Cc.querySelector(l.appearance.widgetSelector);p&&(v=Ec(p,parseInt((null==(f=l.appearance)?void 0:f.maxWidth)||ah.maxWidth))||{})}var g=(null==(o=l.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:m}=ch(l,this._posthog),y={posthog:this._posthog,survey:l,removeSurveyFromFocus:this.$,properties:h,style:v,isSurveyCompleted:d,skipShownEvent:null==e?void 0:e.skipShownEvent,surveyLanguage:u};if(0>=g)return Ua(Ph(Lc,r({},y)),m);var b=setTimeout((()=>{if(this.j.delete(l.id),!Sh(l))return this.$(l);Ua(Ph(Lc,r({},y,{survey:r({},l,{appearance:r({},l.appearance,{surveyPopupDelaySeconds:0})})})),m)}),1e3*g);this.j.set(l.id,b)}},this.G=t=>{var{survey:e,language:r}=this.B(t),{shadow:i,isNewlyCreated:n}=ch(e,this._posthog);n&&Ua(Ph(Fc,{posthog:this._posthog,survey:e,surveyLanguage:r},t.id),i)},this.X=t=>{this.Y(t);var e=this.H.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Ic),this.H.delete(t.id),Lu.info("Removed click listener for survey "+t.id))},this.J=(t,e)=>{var r=Cc.querySelector(e),i=this.H.get(t.id);if(r){if(this.G(t),i){if(r===i.element)return;Lu.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.X(t)}if(!r.hasAttribute(Ic)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===gu.NextToTrigger?Ec(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||ah.maxWidth)):{};kc.dispatchEvent(new CustomEvent(Tc,{detail:{surveyId:t.id,position:n}}))};Un(r,"click",n),r.setAttribute(Ic,"true"),this.H.set(t.id,{element:r,listener:n,survey:t}),Lu.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.X(t)},this.renderPopover=t=>{var{survey:e,language:r}=this.B(t),{shadow:i}=ch(e,this._posthog);Ua(Ph(Lc,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.$,surveyLanguage:r}),i)},this.renderSurvey=(t,e,r)=>{var i,{survey:n,language:s}=this.B(t),o=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(o=this.K(n,s)),Ua(Ph(Lc,{posthog:this._posthog,survey:n,removeSurveyFromFocus:this.$,isPopup:!1,properties:r,isSurveyCompleted:o,surveyLanguage:s}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((t=>e.checkSurveyEligibility(t).eligible&&e.ee(t)&&e.te(t)&&e.re(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===yu.Popover||t.type===yu.Widget)),i=e.ne(r),n=new Set;i.forEach((t=>{if(t.type===yu.Widget){var r,i,s,o;if((null==(r=t.appearance)?void 0:r.widgetType)===pu.Tab)return void e.G(t);(null==(i=t.appearance)?void 0:i.widgetType)===pu.Selector&&null!=(s=t.appearance)&&s.widgetSelector&&(n.add(t.id),e.J(t,null==(o=t.appearance)?void 0:o.widgetSelector))}mr(e.ie)&&t.type===yu.Popover&&e.handlePopoverSurvey(t)})),e.H.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.X(r)}))}),t)},this.Z=t=>{mr(this.ie)||Lu.error("Survey "+this.ie+" already in focus. Cannot add survey "+t.id+"."),this.ie=t.id},this.$=t=>{this.ie!==t.id&&Lu.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.V(t.id),this.ie=null,this.Y(t)},this._posthog=t,this.ie=null}V(t){var e=this.j.get(t);e&&(clearTimeout(e),this.j.delete(t))}cancelSurvey(t){this.j.has(t)&&(Lu.info("Cancelled pending survey "+t),this.V(t),this.ie===t&&(this.ie=null))}ne(t){return t.sort(((t,e)=>{var r,i,n=Ih(t),s=Ih(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===wu.Always,a=e.schedule===wu.Always;return o&&!a?1:!o&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}B(t){return Sc(t,this._posthog)}K(t,e){if(this.U.has(t.id))return!1;var{params:r}=function(t){var e={},r=!1,i=kc.location.search.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var s of n){var[o,a]=s.split("=");if(o&&!fr(a)){var u=decodeURIComponent(o),l=decodeURIComponent(a);if("auto_submit"!==u||"true"!==l){var h=u.match(/^q(\d+)$/);if(h){var c=parseInt(h[1],10);e[c]||(e[c]=[]),e[c].push(l)}}else r=!0}}return{params:e,autoSubmit:r}}();if(0===Object.keys(r).length)return!1;Lu.info("[Survey Prefill] Detected URL prefill parameters");var i=this.oe(t,r,e);if(!i)return!1;var{responses:n,submissionId:s,isSurveyCompleted:o,skippedResponses:a}=i;return(Object.keys(a).length>0&&t.enable_partial_responses||o)&&dh({responses:o?n:a,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,surveyLanguage:e}),this.U.add(t.id),o}W(t,e,r,i){var n={};for(var[s,o]of Object.entries(e))n[parseInt(s)]=hr(o)?o.map(String):[String(o)];Lu.info("[Survey] Processing initial responses");var a=this.oe(t,n,i);if(!a)return!1;var{responses:u,submissionId:l,isSurveyCompleted:h}=a;return dh({responses:u,survey:t,surveySubmissionId:l,posthog:this._posthog,isSurveyCompleted:h,properties:r,surveyLanguage:i}),h}oe(t,e,r){try{var i=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],s=Cu(t.id);try{switch(t.type){case bu.SingleChoice:if(!t.choices||0===t.choices.length)return void Mn.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void Mn.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case bu.MultipleChoice:if(!t.choices||0===t.choices.length)return void Mn.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===a.length)return void Mn.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(a.map((e=>t.choices[e])))];a.length>u.length&&Mn.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=u;break;case bu.Rating:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||0>l||l>h)return void Mn.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=l;break;default:Mn.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Mn.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(i).length)return Lu.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Qu(),s=Object.keys(e).map((t=>parseInt(t,10))),{startQuestionIndex:o,skippedResponses:a}=function(t,e,r){for(var i=0,n={},s=t.questions.length+1;t.questions.length>i&&s>0&&e.includes(i);){var o=t.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=Cu(o.id);fr(r[a])||(n[a]=r[a])}var u=oc(t,i,o.id?r[Cu(o.id)]:null);if(u===_u.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=u}return{startQuestionIndex:i,skippedResponses:n}}(t,s,i),u=o>=t.questions.length;return Ch(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:o,surveyLanguage:r}),Lu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return Lu.error("[Survey Prefill] Error handling prefill:",t),null}}ae(t,e){var r;if(void 0===e&&(e=void 0),!t)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),s=!0;return e&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),n&&s}ee(t){return!t.conditions||Sh(t)&&function(t){var e,r;return function(t,e){var r,i,n;if(!t||0===t.length)return!0;if(!kn)return!1;var s=Mi(kn,{userAgentDataPlatform:null==mn||null==(r=mn.userAgentData)?void 0:r.platform,maxTouchPoints:null==mn?void 0:mn.maxTouchPoints,screenWidth:null==pn||null==(i=pn.screen)?void 0:i.width,screenHeight:null==pn||null==(n=pn.screen)?void 0:n.height,devicePixelRatio:null==pn?void 0:pn.devicePixelRatio});return zl[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(r=t.conditions)?void 0:r.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==sh||!sh.querySelector(t.conditions.selector))}(t)}se(t){return bh(t)||this.ae(t.internal_targeting_flag_key)||Ih(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!Au(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!Hu.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;return this.ae(t.linked_flag_key,n)?this.ae(t.targeting_flag_key)?this.se(t)?function(t,e){if(!t||!e)return!0;var r="string"==typeof e?new Date(e):e,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>t}(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Kl.A("lastSeenSurveyDate"))?(t=>!!Kl.A(ju(t))&&!bh(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i):(i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i):(i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i)}te(t){var e;if(!Fu(t)&&!Nu(t))return!0;var r=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}re(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:r}=t;return!e||!r||this.ae(r)}))}Y(t){try{var e=Cc.querySelector(Rh(t,!0));null!=e&&e.shadowRoot&&Ua(null,e.shadowRoot),null==e||e.remove()}catch(e){Lu.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.ie,surveyTimeouts:this.j,handleWidget:this.G,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.J,sortSurveysByAppearanceDelay:this.ne,checkFlags:this.re.bind(this),isSurveyFeatureFlagEnabled:this.ae.bind(this)}}}function Mc(t,e){if(Cc&&kc){var r,i=new Rc(t);if(t.config.disable_surveys_automatic_display)return Lu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Lu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{fr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Un(Cc,"visibilitychange",(()=>{Cc.hidden?fr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function Oc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;iu((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var s=()=>{var t,n=e.type===yu.Widget,s=Sh(e),o=(null==(t=e.appearance)?void 0:t.widgetType)===pu.Tab&&n;if(!s)return Lu.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);o&&(Lu.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};Un(kc,"popstate",s),Un(kc,"hashchange",s);var o=kc.history.pushState,a=kc.history.replaceState;return kc.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];o.apply(this,e),s()},kc.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];a.apply(this,e),s()},()=>{kc.removeEventListener("popstate",s),kc.removeEventListener("hashchange",s),kc.history.pushState=o,kc.history.replaceState=a}}}),[n,e,r,i])}function Pc(t){switch(void 0===t&&(t=mu.Right),t){case mu.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case mu.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case mu.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Lc(t){var e,i,n,s,o,a,{survey:u,forceDisableHtml:l,posthog:h,style:c={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{}),properties:y,isSurveyCompleted:b,skipShownEvent:_,surveyLanguage:w}=t,x=nu(null),S=Number.isInteger(d),k=null!=(e=u.appearance)&&e.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:C,isSurveySent:T,hidePopupWithViewTransition:I}=function(t,e,i,n,s,o,a,u,l){var[h,c]=ru(n||0===i||t.type===yu.ExternalSurvey),[d,v]=ru(!1),f=()=>{var e=()=>{o&&s(t),c(!1)};Cc.startViewTransition?Cc.startViewTransition((()=>{var t;null==a||null==(t=a.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},p=e=>{e.detail.surveyId===t.id&&f()};return iu((()=>{if(e){if(!n){var s=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return f();v(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{f()}),5e3)}},o=()=>{Sh(t)&&(c(!0),kc.dispatchEvent(new Event("PHSurveyShown")),u||e.capture(xu.SHOWN,r({[Su.SURVEY_NAME]:t.name,[Su.SURVEY_ID]:t.id,[Su.SURVEY_ITERATION]:t.current_iteration,[Su.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[Su.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()})),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(Un(kc,"PHSurveyClosed",p),Un(kc,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),kc.removeEventListener("PHSurveyClosed",p),kc.removeEventListener("PHSurveySent",s)}}return o(),()=>{kc.removeEventListener("PHSurveyClosed",p),kc.removeEventListener("PHSurveySent",s)}}}else Lu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Oc({survey:t,removeSurveyFromFocus:s,setSurveyVisible:c,isPreviewMode:n}),{isPopupVisible:h,isSurveySent:d,setIsPopupVisible:c,hidePopupWithViewTransition:f}}(u,h,k,S,v,f,x,_,w),E=T||d===u.questions.length||!0===b,R=su((()=>{var t=Th(u),e=(null==t?void 0:t.surveySubmissionId)||Qu();return{isPreviewMode:S,previewPageIndex:d,onPopupSurveyDismissed(){w?fh(u,h,S,w):fh(u,h,S),g()},isPopup:f||!1,surveySubmissionId:e,onPreviewSubmit:p,posthog:h,properties:y,surveyLanguage:w}}),[S,d,f,h,u,g,p,y,w]);return C?Ph(_h.Provider,{value:R,children:Ph("div",{className:"ph-survey",style:r({},Mh(u.type,null==(i=u.appearance)?void 0:i.position,null==(n=u.appearance)?void 0:n.widgetType),c),ref:x,children:E?Ph(Zh,{header:(null==(s=u.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=u.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null==(a=u.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:u.appearance||ah,onClose(){I(),m()}}):Ph(Ac,{survey:u,forceDisableHtml:!!l,posthog:h})})}):null}function Ac(t){var e,{survey:i,forceDisableHtml:n,posthog:s}=t,[o,a]=ru((()=>{var t=Th(i);return null!=t&&t.responses&&Lu.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),{previewPageIndex:u,onPopupSurveyDismissed:l,isPopup:h,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:v,properties:f,surveyLanguage:p}=ou(_h),[g,m]=ru((()=>{var t=Th(i);return u||(null==t?void 0:t.lastQuestionIndex)||0})),y=su((()=>yh(i)),[i]);iu((()=>{v&&!fr(u)&&m(u)}),[u,v]);var b=y.at(g);return b?Ph("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=i.appearance)?void 0:e.hideCancelButton)&&Ph(Vh,{onClick(){l()}}),Ph("div",{className:"survey-box","data-question-index":g,children:Nc({question:b,forceDisableHtml:n,displayQuestionIndex:g,appearance:i.appearance||ah,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:u}=t;if(s)if(u){var l=Cu(u),h=r({},o,{[l]:e});a(h);var c=oc(i,n,e),v=c===_u.End;v||(m(c),Ch(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c,surveyLanguage:p})),(i.enable_partial_responses||v)&&dh({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:s,properties:f,surveyLanguage:p})}else Lu.error("onNextButtonClick called without a questionId.");else Lu.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:g,questionId:b.id}),onPreviewSubmit:c,initialValue:b.id?o[Cu(b.id)]:void 0})})]}):null}function Fc(t){var e,r,i,n,s,o,a,{survey:u,forceDisableHtml:l,posthog:h,readOnly:c,surveyLanguage:d}=t,[v,f]=ru(!0),[p,g]=ru(!1),[m,y]=ru({}),b=()=>{g(!p)};if(iu((()=>{var t;if(h){if(!c){"tab"===(null==(t=u.appearance)?void 0:t.widgetType)&&y({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===u.id&&(Lu.info("Received show event for feedback button survey "+u.id),y(r.detail.position||{}),b())};return Un(kc,Tc,e),()=>{kc.removeEventListener(Tc,e)}}}else Lu.error("FeedbackWidget called without a PostHog instance.")}),[h,c,u.id,null==(e=u.appearance)?void 0:e.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),Oc({survey:u,setSurveyVisible:f}),!v)return null;var _=()=>{u.schedule!==wu.Always&&f(!1),setTimeout((()=>{g(!1)}),200)};return Ph(Sa,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Ph("button",{className:"ph-survey-widget-tab "+((null==(s=u.appearance)?void 0:s.tabPosition)===mu.Top?"widget-tab-top":""),onClick:b,disabled:c,style:Pc(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),p&&Ph(Lc,{posthog:h,survey:u,forceDisableHtml:l,style:m,onPopupSurveyDismissed:_,onCloseConfirmationMessage:_,surveyLanguage:d})]})}var Nc=t=>{var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l={forceDisableHtml:i,appearance:s,onPreviewSubmit(t){a(t)},onSubmit(t){o(t)},initialValue:u,displayQuestionIndex:n};switch(e.type){case bu.Open:return wa(Qh,r({},l,{question:e,key:e.id}));case bu.Link:return wa(Jh,r({},l,{question:e,key:e.id}));case bu.Rating:return wa(Kh,r({},l,{question:e,key:e.id}));case bu.SingleChoice:case bu.MultipleChoice:return wa(Xh,r({},l,{question:e,key:e.id}));default:return Lu.error("Unsupported question type: "+e.type),null}};Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.generateSurveys=Mc,Cn.extendPostHogWithSurveys=Mc;class $c{emit(t){}}var Dc=new $c,qc=new class{getLogger(t,e,r){return new $c}};class jc{constructor(t,e,r,i){this.ue=t,this.name=e,this.version=r,this.options=i}emit(t){this.le().emit(t)}le(){if(this.ce)return this.ce;var t=this.ue.de(this.name,this.version,this.options);return t?(this.ce=t,this.ce):Dc}}class Uc{getLogger(t,e,r){var i;return null!==(i=this.de(t,e,r))&&void 0!==i?i:new jc(this,t,e,r)}he(){var t;return null!==(t=this.ce)&&void 0!==t?t:qc}ve(t){this.ce=t}de(t,e,r){var i;return null===(i=this.ce)||void 0===i?void 0:i.getLogger(t,e,r)}}var Hc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Bc=Symbol.for("io.opentelemetry.js.api.logs"),zc=Hc;class Vc{constructor(){this.fe=new Uc}static getInstance(){return this._instance||(this._instance=new Vc),this._instance}setGlobalLoggerProvider(t){return zc[Bc]?this.getLoggerProvider():(zc[Bc]=(1,e=t,r=qc,t=>1===t?e:r),this.fe.ve(t),t);var e,r}getLoggerProvider(){var t,e;return null!==(e=null===(t=zc[Bc])||void 0===t?void 0:t.call(zc,1))&&void 0!==e?e:this.fe}getLogger(t,e,r){return this.getLoggerProvider().getLogger(t,e,r)}disable(){delete zc[Bc],this.fe=new Uc}}var Wc=Vc.getInstance();class Zc{constructor(t){this.ce=void 0,this.ce=t}export(t,e){this.ce.export(t,e)}forceFlush(){return this.ce.forceFlush()}shutdown(){return this.ce.shutdown()}}class Gc extends Error{constructor(t,e,r){super(t),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=r,this.code=e}}function Qc(t){if(Number.isFinite(t)&&t>0)return t;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+t+"')")}class Jc{constructor(t){this.pe=void 0,this.me=[],this.pe=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this.me.push(t);var e=()=>{var e=this.me.indexOf(t);this.me.splice(e,1)};t.then(e,e)}hasReachedLimit(){return this.me.length>=this.pe}awaitAll(){var t=this;return e((function*(){yield Promise.all(t.me)}))()}}function Kc(t){return new Jc(t.concurrencyLimit)}var Yc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Xc="1.9.0",td=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,ed=function(t){var e=new Set([t]),r=new Set,i=t.match(td);if(!i)return function(){return!1};var n=+i[1],s=+i[2],o=+i[3];if(null!=i[4])return function(e){return e===t};function a(t){return r.add(t),!1}function u(t){return e.add(t),!0}return function(t){if(e.has(t))return!0;if(r.has(t))return!1;var i=t.match(td);if(!i)return a(t);var l=+i[2],h=+i[3];return null!=i[4]||n!==+i[1]?a(t):0===n?s!==l||o>h?a(t):u(t):s>l?a(t):u(t)}}(Xc),rd=Xc.split(".")[0],id=Symbol.for("opentelemetry.js.api."+rd),nd=Yc;function sd(t,e,r,i){var n;void 0===i&&(i=!1);var s=nd[id]=null!==(n=nd[id])&&void 0!==n?n:{version:Xc};if(!i&&s[t]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(o.stack||o.message),!1}return s.version!==Xc?(o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+Xc),r.error(o.stack||o.message),!1):(s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+Xc+"."),!0)}function od(t){var e,r,i=null===(e=nd[id])||void 0===e?void 0:e.version;if(i&&ed(i))return null===(r=nd[id])||void 0===r?void 0:r[t]}function ad(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Xc+".");var r=nd[id];r&&delete r[t]}var ud,ld=function(){function t(t){this.ye=t.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return hd("debug",this.ye,t)},t.prototype.error=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return hd("error",this.ye,t)},t.prototype.info=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return hd("info",this.ye,t)},t.prototype.warn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return hd("warn",this.ye,t)},t.prototype.verbose=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return hd("verbose",this.ye,t)},t}();function hd(t,e,r){var i=od("diag");if(i)return r.unshift(e),i[t].apply(i,function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;s>n;n++)!i&&n in e||(i||(i=[].slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||[].slice.call(e))}([],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(r),!1))}!function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"}(ud||(ud={}));var cd=function(){function t(){function t(t){return function(){for(var e=[],r=0;arguments.length>r;r++)e[r]=arguments[r];var i=od("diag");if(i)return i[t].apply(i,function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;s>n;n++)!i&&n in e||(i||(i=[].slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||[].slice.call(e))}([],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(e),!1))}}var e=this;e.setLogger=function(t,r){var i,n,s;if(void 0===r&&(r={logLevel:ud.INFO}),t===e){var o=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return e.error(null!==(i=o.stack)&&void 0!==i?i:o.message),!1}"number"==typeof r&&(r={logLevel:r});var a=od("diag"),u=function(t,e){function r(r,i){var n=e[r];return"function"!=typeof n||i>t?function(){}:n.bind(e)}return ud.NONE>t?t=ud.NONE:t>ud.ALL&&(t=ud.ALL),e=e||{},{error:r("error",ud.ERROR),warn:r("warn",ud.WARN),info:r("info",ud.INFO),debug:r("debug",ud.DEBUG),verbose:r("verbose",ud.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:ud.INFO,t);if(a&&!r.suppressOverrideMessage){var l=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+l),u.warn("Current logger will overwrite one already registered from "+l)}return sd("diag",u,e,!0)},e.disable=function(){ad("diag",e)},e.createComponentLogger=function(t){return new ld(t)},e.verbose=t("verbose"),e.debug=t("debug"),e.info=t("info"),e.warn=t("warn"),e.error=t("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t}();function dd(t){return Symbol.for(t)}var vd,fd=new function t(e){var r=this;r.ge=e?new Map(e):new Map,r.getValue=function(t){return r.ge.get(t)},r.setValue=function(e,i){var n=new t(r.ge);return n.ge.set(e,i),n},r.deleteValue=function(e){var i=new t(r.ge);return i.ge.delete(e),i}},pd=function(){function t(){}return t.prototype.active=function(){return fd},t.prototype.with=function(t,e,r){for(var i=[],n=3;arguments.length>n;n++)i[n-3]=arguments[n];return e.call.apply(e,function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;s>n;n++)!i&&n in e||(i||(i=[].slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||[].slice.call(e))}([r],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(i),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),gd="context",md=new pd,yd=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return sd(gd,t,cd.instance())},t.prototype.active=function(){return this.be().active()},t.prototype.with=function(t,e,r){for(var i,n=[],s=3;arguments.length>s;s++)n[s-3]=arguments[s];return(i=this.be()).with.apply(i,function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;s>n;n++)!i&&n in e||(i||(i=[].slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||[].slice.call(e))}([t,e,r],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(n),!1))},t.prototype.bind=function(t,e){return this.be().bind(t,e)},t.prototype.be=function(){return od(gd)||md},t.prototype.disable=function(){this.be().disable(),ad(gd,cd.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(vd||(vd={}));var bd="0000000000000000",_d="00000000000000000000000000000000",wd={traceId:_d,spanId:bd,traceFlags:vd.NONE},xd=function(){function t(t){void 0===t&&(t=wd),this.we=t}return t.prototype.spanContext=function(){return this.we},t.prototype.setAttribute=function(t,e){return this},t.prototype.setAttributes=function(t){return this},t.prototype.addEvent=function(t,e){return this},t.prototype.addLink=function(t){return this},t.prototype.addLinks=function(t){return this},t.prototype.setStatus=function(t){return this},t.prototype.updateName=function(t){return this},t.prototype.end=function(t){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(t,e){},t}(),Sd=dd("OpenTelemetry Context Key SPAN");function kd(t){return t.getValue(Sd)||void 0}function Cd(){return kd(yd.getInstance().active())}function Td(t,e){return t.setValue(Sd,e)}function Id(t){return t.deleteValue(Sd)}function Ed(t,e){return Td(t,new xd(e))}function Rd(t){var e;return null===(e=kd(t))||void 0===e?void 0:e.spanContext()}var Md=/^([0-9a-f]{32})$/i,Od=/^[0-9a-f]{16}$/i;function Pd(t){return Md.test(r=t.traceId)&&r!==_d&&Od.test(e=t.spanId)&&e!==bd;var e,r}function Ld(t){return new xd(t)}var Ad=yd.getInstance(),Fd=function(){function t(){}return t.prototype.startSpan=function(t,e,r){if(void 0===r&&(r=Ad.active()),Boolean(null==e?void 0:e.root))return new xd;var i,n=r&&Rd(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&Pd(n)?new xd(n):new xd},t.prototype.startActiveSpan=function(t,e,r,i){var n,s,o;if(arguments.length>=2){2===arguments.length?o=e:3===arguments.length?(n=e,o=r):(n=e,s=r,o=i);var a=null!=s?s:Ad.active(),u=this.startSpan(t,n,a),l=Td(a,u);return Ad.with(l,o,void 0,u)}},t}(),Nd=new Fd,$d=function(){function t(t,e,r,i){this.ue=t,this.name=e,this.version=r,this.options=i}return t.prototype.startSpan=function(t,e,r){return this.ke().startSpan(t,e,r)},t.prototype.startActiveSpan=function(t,e,r,i){var n=this.ke();return Reflect.apply(n.startActiveSpan,n,arguments)},t.prototype.ke=function(){if(this.ce)return this.ce;var t=this.ue.getDelegateTracer(this.name,this.version,this.options);return t?(this.ce=t,this.ce):Nd},t}(),Dd=new(function(){function t(){}return t.prototype.getTracer=function(t,e,r){return new Fd},t}()),qd=function(){function t(){}return t.prototype.getTracer=function(t,e,r){var i;return null!==(i=this.getDelegateTracer(t,e,r))&&void 0!==i?i:new $d(this,t,e,r)},t.prototype.getDelegate=function(){var t;return null!==(t=this.ce)&&void 0!==t?t:Dd},t.prototype.setDelegate=function(t){this.ce=t},t.prototype.getDelegateTracer=function(t,e,r){var i;return null===(i=this.ce)||void 0===i?void 0:i.getTracer(t,e,r)},t}(),jd=yd.getInstance(),Ud=cd.instance(),Hd="trace",Bd=function(){function t(){this.xe=new qd,this.wrapSpanContext=Ld,this.isSpanContextValid=Pd,this.deleteSpan=Id,this.getSpan=kd,this.getActiveSpan=Cd,this.getSpanContext=Rd,this.setSpan=Td,this.setSpanContext=Ed}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=sd(Hd,this.xe,cd.instance());return e&&this.xe.setDelegate(t),e},t.prototype.getTracerProvider=function(){return od(Hd)||this.xe},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){ad(Hd,cd.instance()),this.xe=new qd},t}().getInstance(),zd=dd("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Vd(t){return null==t||(Array.isArray(t)?function(t){var e;for(var r of t)if(null!=r){var i=typeof r;if(i!==e){if(!e){if(Wd(i)){e=i;continue}return!1}return!1}}return!0}(t):Wd(typeof t))}function Wd(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}function Zd(t){try{(t=>{Ud.error(function(t){return"string"==typeof t?t:JSON.stringify(function(t){for(var e={},r=t;null!==r;)Object.getOwnPropertyNames(r).forEach((t=>{if(!e[t]){var i=r[t];i&&(e[t]=String(i))}})),r=Object.getPrototypeOf(r);return e}(t))}(t))})(t)}catch(t){}}var Gd,Qd=performance,Jd="telemetry.sdk.language",Kd="telemetry.sdk.name",Yd="telemetry.sdk.version",Xd={[Kd]:"opentelemetry","process.runtime.name":"browser",[Jd]:"webjs",[Yd]:"2.2.0"},tv=Math.pow(10,6),ev=Math.pow(10,9);function rv(t){return[Math.trunc(t/1e3),Math.round(t%1e3*tv)]}function iv(){var t=Qd.timeOrigin;return"number"!=typeof t&&(t=Qd.timing&&Qd.timing.fetchStart),t}function nv(t){if(s=t,Array.isArray(s)&&2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1])return t;if("number"==typeof t)return t<iv()?(e=t,r=rv(iv()),i=rv("number"==typeof e?e:Qd.now()),ev>(n=[r[0]+i[0],r[1]+i[1]])[1]||(n[1]-=ev,n[0]+=1),n):rv(t);var e,r,i,n,s;if(t instanceof Date)return rv(t.getTime());throw TypeError("Invalid input type")}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(Gd||(Gd={}));var sv="[object Object]",ov="[object Null]",av="[object Undefined]",uv=function(){}.toString,lv=uv.call(Object),hv=Object.getPrototypeOf,cv=Object.prototype,dv=cv.hasOwnProperty,vv=Symbol?Symbol.toStringTag:void 0,fv=cv.toString;function pv(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){return null==t?void 0===t?av:ov:vv&&vv in Object(t)?function(t){var e=dv.call(t,vv),r=t[vv],i=!1;try{t[vv]=void 0,i=!0}catch(t){}var n=fv.call(t);return i&&(e?t[vv]=r:delete t[vv]),n}(t):function(t){return fv.call(t)}(t)}(t)!==sv)return!1;var e=hv(t);if(null===e)return!0;var r=dv.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&uv.call(r)===lv}function gv(t){return bv(t)?t.slice():t}function mv(t,e,r,i){var n;if(void 0===r&&(r=0),20>=r){if(r++,xv(t)||xv(e)||_v(e))n=gv(e);else if(bv(t)){if(n=t.slice(),bv(e))for(var s=0,o=e.length;o>s;s++)n.push(gv(e[s]));else if(wv(e))for(var a=Object.keys(e),u=0,l=a.length;l>u;u++){var h=a[u];n[h]=gv(e[h])}}else if(wv(t))if(wv(e)){if(!function(t,e){return!(!pv(t)||!pv(e))}(t,e))return e;n=Object.assign({},t);for(var c=Object.keys(e),d=0,v=c.length;v>d;d++){var f=c[d],p=e[f];if(xv(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(yv(t,f,i)||yv(e,f,i))delete n[f];else{if(wv(g)&&wv(m)){var y=i.get(g)||[],b=i.get(m)||[];y.push({obj:t,key:f}),b.push({obj:e,key:f}),i.set(g,y),i.set(m,b)}n[f]=mv(n[f],p,r,i)}}}}else n=e;return n}}function yv(t,e,r){for(var i=r.get(t[e])||[],n=0,s=i.length;s>n;n++){var o=i[n];if(o.key===e&&o.obj===t)return!0}return!1}function bv(t){return Array.isArray(t)}function _v(t){return"function"==typeof t}function wv(t){return!xv(t)&&!bv(t)&&!_v(t)&&"object"==typeof t}function xv(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class Sv extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Sv.prototype)}}function kv(t,e){var r,i=new Promise((function(t,i){r=setTimeout((function(){i(new Sv("Operation timed out."))}),e)}));return Promise.race([t,i]).then((t=>(clearTimeout(r),t)),(t=>{throw clearTimeout(r),t}))}class Cv{constructor(){this.Se=void 0,this.Ce=void 0,this.Ie=void 0,this.Se=new Promise(((t,e)=>{this.Ce=t,this.Ie=e}))}get promise(){return this.Se}resolve(t){this.Ce(t)}reject(t){this.Ie(t)}}class Tv{constructor(t,e){this.Te=void 0,this.Me=void 0,this._e=!1,this.Le=new Cv,this.Te=t,this.Me=e}get isCalled(){return this._e}get promise(){return this.Le.promise}call(){if(!this._e){this._e=!0;try{for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];Promise.resolve(this.Te.call(this.Me,...e)).then((t=>this.Le.resolve(t)),(t=>this.Le.reject(t)))}catch(t){this.Le.reject(t)}}return this.Le.promise}}var Iv={Ee:(t,e)=>new Promise((r=>{jd.with(function(t){return t.setValue(zd,!0)}(jd.active()),(()=>{t.export(e,(t=>{r(t)}))}))}))};class Ev{constructor(t,e,r,i,n){this.Oe=void 0,this.Re=void 0,this.Ne=void 0,this.Ae=void 0,this.Pe=void 0,this.qe=void 0,this.Oe=t,this.Re=e,this.Ne=r,this.Ae=i,this.Pe=n,this.qe=Ud.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,e){if(this.qe.debug("items to be sent",t),this.Ae.hasReachedLimit())e({code:Gd.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this.Re.serializeRequest(t);null!=r?this.Ae.pushPromise(this.Oe.send(r,this.Pe).then((t=>{if("success"!==t.status)e("failure"===t.status&&t.error?{code:Gd.FAILED,error:t.error}:"retryable"===t.status?{code:Gd.FAILED,error:new Gc("Export failed with retryable status")}:{code:Gd.FAILED,error:new Gc("Export failed with unknown error")});else{if(null!=t.data)try{this.Ne.handleResponse(this.Re.deserializeResponse(t.data))}catch(e){this.qe.warn("Export succeeded but could not deserialize response - is the response specification compliant?",e,t.data)}e({code:Gd.SUCCESS})}}),(t=>e({code:Gd.FAILED,error:t})))):e({code:Gd.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.Ae.awaitAll()}shutdown(){var t=this;return e((function*(){t.qe.debug("shutdown started"),yield t.forceFlush(),t.Oe.shutdown()}))()}}function Rv(t,e,r){return i={transport:r,serializer:e,promiseHandler:Kc(t)},new Ev(i.transport,i.serializer,{handleResponse(t){null!=t&&function(t){return{}.hasOwnProperty.call(t,"partialSuccess")}(t)&&null!=t.partialSuccess&&0!==Object.keys(t.partialSuccess).length&&Ud.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}},i.promiseHandler,{timeout:t.timeoutMillis}.timeout);var i}function Mv(t){return 48>t||t>57?97>t||t>102?t-55:t-87:t-48}function Ov(t){for(var e=new Uint8Array(t.length/2),r=0,i=0;t.length>i;i+=2){var n=Mv(t.charCodeAt(i)),s=Mv(t.charCodeAt(i+1));e[r++]=n<<4|s}return e}function Pv(t){var e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Lv(t){var e;return e=Pv(t),{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var Av="undefined"!=typeof BigInt?function(t){return Pv(t).toString()}:function(t){return t[0]*ev+t[1]};function Fv(t){return t}function Nv(t){if(void 0!==t)return Ov(t)}var $v={encodeHrTime:Lv,encodeSpanContext:Ov,encodeOptionalSpanContext:Nv};function Dv(t,e){return{key:t,value:qv(e)}}function qv(t){var e=typeof t;return"string"===e?{stringValue:t}:"number"===e?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:"boolean"===e?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(qv)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((t=>{var[e,r]=t;return Dv(e,r)}))}}:{}}function jv(t,e){var r=function(t){var e=new Map;for(var r of t){var{resource:i,instrumentationScope:{name:n,version:s="",schemaUrl:o=""}}=r,a=e.get(i);a||(a=new Map,e.set(i,a));var u=n+"@"+s+":"+o,l=a.get(u);l||a.set(u,l=[]),l.push(r)}return e}(t);return Array.from(r,(t=>{var[r,i]=t,n=function(t){var e,r={attributes:(e=t.attributes,Object.keys(e).map((t=>Dv(t,e[t])))),droppedAttributesCount:0},i=t.schemaUrl;return i&&""!==i&&(r.schemaUrl=i),r}(r);return{resource:n,scopeLogs:Array.from(i,(t=>{var r,[,i]=t;return{scope:(r=i[0].instrumentationScope,{name:r.name,version:r.version}),logRecords:i.map((t=>function(t,e){var r,i,n,s;return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:qv(t.body),eventName:t.eventName,attributes:(s=t.attributes,Object.keys(s).map((t=>Dv(t,s[t])))),droppedAttributesCount:t.droppedAttributesCount,flags:null==(r=t.spanContext)?void 0:r.traceFlags,traceId:e.encodeOptionalSpanContext(null==(i=t.spanContext)?void 0:i.traceId),spanId:e.encodeOptionalSpanContext(null==(n=t.spanContext)?void 0:n.spanId)}}(t,e))),schemaUrl:i[0].instrumentationScope.schemaUrl}})),schemaUrl:n.schemaUrl}}))}var Uv=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class Hv{static FromAttributeList(t,e){var r=new Hv({},e);return r.De=zv(t),r.Fe=t.filter((t=>{var[e,r]=t;return Uv(r)})).length>0,r}constructor(t,e){var r;this.De=void 0,this.Fe=!1,this.je=void 0,this.He=void 0;var i=null!==(r=t.attributes)&&void 0!==r?r:{};this.De=Object.entries(i).map((t=>{var[e,r]=t;return Uv(r)&&(this.Fe=!0),[e,r]})),this.De=zv(this.De),this.je=function(t){if("string"==typeof t||void 0===t)return t;Ud.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}(null==e?void 0:e.schemaUrl)}get asyncAttributesPending(){return this.Fe}waitForAsyncAttributes(){var t=this;return e((function*(){if(t.asyncAttributesPending){for(var e=0;t.De.length>e;e++){var[r,i]=t.De[e];t.De[e]=[r,Uv(i)?yield i:i]}t.Fe=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Ud.error("Accessing resource attributes before async attributes settled"),this.He)return this.He;var t={};for(var[e,r]of this.De){var i;Uv(r)?Ud.debug("Unsettled resource attribute "+e+" skipped"):null!=r&&(null!==(i=t[e])&&void 0!==i||(t[e]=r))}return this.Fe||(this.He=t),t}getRawAttributes(){return this.De}get schemaUrl(){return this.je}merge(t){if(null==t)return this;var e,r,i,n,s=(n=null==(r=t)?void 0:r.schemaUrl,void 0===(i=null==(e=this)?void 0:e.schemaUrl)||""===i?n:void 0===n||""===n||i===n?i:void Ud.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',i,n)),o=s?{schemaUrl:s}:void 0;return Hv.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],o)}}function Bv(t,e){return Hv.FromAttributeList(Object.entries(t),e)}function zv(t){return t.map((t=>{var[e,r]=t;return Uv(r)?[e,r.catch((t=>{Ud.debug("promise rejection for resource attribute: %s - %s",e,t)}))]:[e,r]}))}var Vv={serializeRequest(t){var e,r,i=(e=t,r=function(t){var e,r;if(void 0===t)return $v;var i=null===(e=t.useLongBits)||void 0===e||e,n=null!==(r=t.useHex)&&void 0!==r&&r;return{encodeHrTime:i?Lv:Av,encodeSpanContext:n?Fv:Ov,encodeOptionalSpanContext:n?Fv:Nv}}({useHex:!0,useLongBits:!1}),{resourceLogs:jv(e,r)});return(new TextEncoder).encode(JSON.stringify(i))},deserializeResponse(t){if(0===t.length)return{};var e=new TextDecoder;return JSON.parse(e.decode(t))}};class Wv{constructor(t){this.Oe=void 0,this.Oe=t}retry(t,e,r){return new Promise(((i,n)=>{setTimeout((()=>{this.Oe.send(t,e).then(i,n)}),r)}))}send(t,r){var i=this;return e((function*(){for(var e=Date.now()+r,n=yield i.Oe.send(t,r),s=5,o=1e3;"retryable"===n.status&&s>0;){var a;s--;var u=Math.max(Math.min(o,5e3)+(.4*Math.random()-.2),0);o*=1.5;var l=null!==(a=n.retryInMillis)&&void 0!==a?a:u,h=e-Date.now();if(l>h)return n;n=yield i.retry(t,h,l)}return n}))()}shutdown(){return this.Oe.shutdown()}}function Zv(t){return new Wv(t.transport)}function Gv(t){return[429,502,503,504].includes(t)}function Qv(t){if(null!=t){var e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?1e3*e:-1;var r=new Date(t).getTime()-Date.now();return 0>r?0:r}}class Jv{constructor(t){this.Ue=void 0,this.Ue=t}send(t,r){var i=this;return e((function*(){var e=yield i.Ue.headers(),n=yield new Promise((n=>{var s=new XMLHttpRequest;s.timeout=r,s.open("POST",i.Ue.url),Object.entries(e).forEach((t=>{var[e,r]=t;s.setRequestHeader(e,r)})),s.ontimeout=t=>{n({status:"failure",error:new Error("XHR request timed out")})},s.onreadystatechange=()=>{200>s.status||s.status>299?s.status&&Gv(s.status)?n({status:"retryable",retryInMillis:Qv(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")}):(Ud.debug("XHR success"),n({status:"success"}))},s.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},s.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},s.send(t)}));return n}))()}shutdown(){}}class Kv{constructor(t){this.Be=void 0,this.Be=t}send(t){var r=this;return e((function*(){var e=(yield r.Be.headers())["Content-Type"];return new Promise((i=>{navigator.sendBeacon(r.Be.url,new Blob([t],{type:e}))?(Ud.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Yv{constructor(t){this.Ue=void 0,this.Ue=t}send(t,r){var i=this;return e((function*(){var e=new AbortController,n=setTimeout((()=>e.abort()),r);try{var s,o=!!globalThis.location,a=new URL(i.Ue.url),u=yield fetch(a.href,{method:"POST",headers:yield i.Ue.headers(),body:t,signal:e.signal,keepalive:o,mode:o?(null==(s=globalThis.location)?void 0:s.origin)===a.origin?"same-origin":"cors":"no-cors"});return 200>u.status||u.status>299?Gv(u.status)?{status:"retryable",retryInMillis:Qv(u.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}:(Ud.debug("response success"),{status:"success"})}catch(t){return"AbortError"===(null==t?void 0:t.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:t})}:{status:"failure",error:new Error("Fetch request errored",{cause:t})}}finally{clearTimeout(n)}}))()}shutdown(){}}function Xv(t,e){return Rv(t,e,Zv({transport:(r=t,new Jv(r))}));var r}function tf(t,e){return Rv(t,e,Zv({transport:(r=t,new Yv(r))}));var r}function ef(t,e){return Rv(t,e,Zv({transport:(r={url:t.url,headers:t.headers},new Kv(r))}));var r}function rf(t){if(null!=t)try{var e,r=null==(e=globalThis.location)?void 0:e.href;return new URL(t,r).href}catch(e){throw new Error("Configuration: Could not parse user-provided export URL: '"+t+"'")}}function nf(t){return"function"==typeof t.headers?t.headers:function(t){if(null!=t)return e((function*(){return t}))}(t.headers)}function sf(t,i,n){return s={url:t.url,timeoutMillis:t.timeoutMillis,headers:nf(t),concurrencyLimit:t.concurrencyLimit},o={},a=function(t,i){return r({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(n=e((function*(){return t})),function(){return n.apply(this,arguments)}),url:"http://localhost:4318/"+i});var n}(n,i),r({},function(t,e,r){var i,n,s,o,a,u;return{timeoutMillis:Qc(null!==(i=null!==(n=t.timeoutMillis)&&void 0!==n?n:e.timeoutMillis)&&void 0!==i?i:r.timeoutMillis),concurrencyLimit:null!==(s=null!==(o=t.concurrencyLimit)&&void 0!==o?o:e.concurrencyLimit)&&void 0!==s?s:r.concurrencyLimit,compression:null!==(a=null!==(u=t.compression)&&void 0!==u?u:e.compression)&&void 0!==a?a:r.compression}}(s,o,a),{headers:(h=s.headers,c=o.headers,d=a.headers,e((function*(){var t=r({},yield d()),e={};return null!=c&&Object.assign(e,yield c()),null!=h&&Object.assign(e,function(t){var e={};return Object.entries(null!=t?t:{}).forEach((t=>{var[r,i]=t;void 0!==i?e[r]=String(i):Ud.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),e}(yield h())),Object.assign(e,t)}))),url:null!==(u=null!==(l=rf(s.url))&&void 0!==l?l:o.url)&&void 0!==u?u:a.url});var s,o,a,u,l,h,c,d}function of(t,e,r,i){return(t.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?tf:Xv:ef)(sf(t,r,i),e)}class af extends Zc{constructor(t){void 0===t&&(t={}),super(of(t,Vv,"v1/logs",{"Content-Type":"application/json"}))}}class uf{set severityText(t){this.Ve()||(this.We=t)}get severityText(){return this.We}set severityNumber(t){this.Ve()||(this.ze=t)}get severityNumber(){return this.ze}set body(t){this.Ve()||(this.Ze=t)}get body(){return this.Ze}get eventName(){return this.$e}set eventName(t){this.Ve()||(this.$e=t)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(t,e,r){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this.We=void 0,this.ze=void 0,this.Ze=void 0,this.$e=void 0,this.totalAttributesCount=0,this.Qe=!1,this.Ge=void 0;var{timestamp:i,observedTimestamp:n,eventName:s,severityNumber:o,severityText:a,body:u,attributes:l={},context:h}=r,c=Date.now();if(this.hrTime=nv(null!=i?i:c),this.hrTimeObserved=nv(null!=n?n:c),h){var d=Bd.getSpanContext(h);d&&Pd(d)&&(this.spanContext=d)}this.severityNumber=o,this.severityText=a,this.body=u,this.resource=t.resource,this.instrumentationScope=e,this.Ge=t.logRecordLimits,this.$e=s,this.setAttributes(l)}setAttribute(t,e){return this.Ve()||null===e?this:0===t.length?(Ud.warn("Invalid attribute key: "+t),this):Vd(e)||"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length<this.Ge.attributeCountLimit||{}.hasOwnProperty.call(this.attributes,t)?(this.attributes[t]=Vd(e)?this.Xe(e):e,this):(1===this.droppedAttributesCount&&Ud.warn("Dropping extra attributes."),this)):(Ud.warn("Invalid attribute value set for key: "+t),this)}setAttributes(t){for(var[e,r]of Object.entries(t))this.setAttribute(e,r);return this}setBody(t){return this.body=t,this}setEventName(t){return this.eventName=t,this}setSeverityNumber(t){return this.severityNumber=t,this}setSeverityText(t){return this.severityText=t,this}Ye(){this.Qe=!0}Xe(t){var e=this.Ge.attributeValueLengthLimit;return e>0?"string"==typeof t?this.Je(t,e):Array.isArray(t)?t.map((t=>"string"==typeof t?this.Je(t,e):t)):t:(Ud.warn("Attribute value limit must be positive, got "+e),t)}Je(t,e){return t.length>e?t.substring(0,e):t}Ve(){return this.Qe&&Ud.warn("Can not execute the operation on emitted log record"),this.Qe}}class lf{constructor(t,e){this.instrumentationScope=void 0,this.Ke=void 0,this.instrumentationScope=t,this.Ke=e}emit(t){var e=t.context||jd.active(),i=new uf(this.Ke,this.instrumentationScope,r({context:e},t));this.Ke.activeProcessor.onEmit(i,e),i.Ye()}}class hf{forceFlush(){return Promise.resolve()}onEmit(t,e){}shutdown(){return Promise.resolve()}}class cf{constructor(t,e){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=t,this.forceFlushTimeoutMillis=e}forceFlush(){var t=this;return e((function*(){var e=t.forceFlushTimeoutMillis;yield Promise.all(t.processors.map((t=>kv(t.forceFlush(),e))))}))()}onEmit(t,e){this.processors.forEach((r=>r.onEmit(t,e)))}shutdown(){var t=this;return e((function*(){yield Promise.all(t.processors.map((t=>t.shutdown())))}))()}}class df{constructor(t,e,r,i){this.resource=void 0,this.forceFlushTimeoutMillis=void 0,this.logRecordLimits=void 0,this.processors=void 0,this.loggers=new Map,this.activeProcessor=void 0,this.registeredLogRecordProcessors=[],this.resource=t,this.forceFlushTimeoutMillis=e,this.logRecordLimits=r,this.processors=i,i.length>0?(this.registeredLogRecordProcessors=i,this.activeProcessor=new cf(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new hf}}class vf{constructor(t){var e,r,i;void 0===t&&(t={}),this.et=void 0,this.Ke=void 0;var n,s,o,a,u,l,h,c=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];for(var i=e.shift(),n=new WeakMap;e.length>0;)i=mv(i,e.shift(),0,n);return i}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},t),d=null!==(e=t.resource)&&void 0!==e?e:Bv({"service.name":"unknown_service",[Jd]:Xd[Jd],[Kd]:Xd[Kd],[Yd]:Xd[Yd]});this.Ke=new df(d,c.forceFlushTimeoutMillis,{attributeCountLimit:null!==(s=null!==(o=null!==(a=(n=c.logRecordLimits).attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==o?o:void 0)&&void 0!==s?s:128,attributeValueLengthLimit:null!==(u=null!==(l=null!==(h=n.attributeValueLengthLimit)&&void 0!==h?h:void 0)&&void 0!==l?l:void 0)&&void 0!==u?u:1/0},null!==(r=null==(i=t)?void 0:i.processors)&&void 0!==r?r:[]),this.et=new Tv(this.tt,this)}getLogger(t,e,r){if(this.et.isCalled)return Ud.warn("A shutdown LoggerProvider cannot provide a Logger"),Dc;t||Ud.warn("Logger requested without instrumentation scope name.");var i=t||"unknown",n=i+"@"+(e||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this.Ke.loggers.has(n)||this.Ke.loggers.set(n,new lf({name:i,version:e,schemaUrl:null==r?void 0:r.schemaUrl},this.Ke)),this.Ke.loggers.get(n)}forceFlush(){return this.et.isCalled?(Ud.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.et.promise):this.Ke.activeProcessor.forceFlush()}shutdown(){return this.et.isCalled?(Ud.warn("shutdown may only be called once per LoggerProvider"),this.et.promise):this.et.call()}tt(){return this.Ke.activeProcessor.shutdown()}}class ff{constructor(t,e){var r,i,n,s,o,a,u,l;this.rt=void 0,this.nt=void 0,this.it=void 0,this.ot=void 0,this.st=void 0,this.ut=!1,this.ct=[],this.dt=void 0,this.et=void 0,this.rt=t,this.nt=null!==(r=null!==(i=null==e?void 0:e.maxExportBatchSize)&&void 0!==i?i:void 0)&&void 0!==r?r:512,this.it=null!==(n=null!==(s=null==e?void 0:e.maxQueueSize)&&void 0!==s?s:void 0)&&void 0!==n?n:2048,this.ot=null!==(o=null!==(a=null==e?void 0:e.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==o?o:5e3,this.st=null!==(u=null!==(l=null==e?void 0:e.exportTimeoutMillis)&&void 0!==l?l:void 0)&&void 0!==u?u:3e4,this.et=new Tv(this.tt,this),this.nt>this.it&&(Ud.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this.nt=this.it)}onEmit(t){this.et.isCalled||this.ht(t)}forceFlush(){return this.et.isCalled?this.et.promise:this.vt()}shutdown(){return this.et.call()}tt(){var t=this;return e((function*(){t.onShutdown(),yield t.vt(),yield t.rt.shutdown()}))()}ht(t){this.it>this.ct.length&&(this.ct.push(t),this.ft())}vt(){return new Promise(((t,e)=>{for(var r=[],i=Math.ceil(this.ct.length/this.nt),n=0;i>n;n++)r.push(this.yt());Promise.all(r).then((()=>{t()})).catch(e)}))}yt(){return this.bt(),0===this.ct.length?Promise.resolve():new Promise(((t,e)=>{kv(this.Ee(this.ct.splice(0,this.nt)),this.st).then((()=>t())).catch(e)}))}ft(){if(!this.ut){var t=()=>{this.ut=!0,this.yt().then((()=>{this.ut=!1,this.ct.length>0&&(this.bt(),this.ft())})).catch((t=>{this.ut=!1,Zd(t)}))};if(this.ct.length>=this.nt)return t();void 0===this.dt&&(this.dt=setTimeout((()=>t()),this.ot),"number"!=typeof this.dt&&this.dt.unref())}}bt(){void 0!==this.dt&&(clearTimeout(this.dt),this.dt=void 0)}Ee(t){var e=()=>Iv.Ee(this.rt,t).then((t=>{var e;t.code!==Gd.SUCCESS&&Zd(null!==(e=t.error)&&void 0!==e?e:new Error("BatchLogRecordProcessor: log record export failed (status "+t+")"))})).catch(Zd),r=t.map((t=>t.resource)).filter((t=>t.asyncAttributesPending));return 0===r.length?e():Promise.all(r.map((t=>null==t.waitForAsyncAttributes?void 0:t.waitForAsyncAttributes()))).then(e,Zd)}}class pf extends ff{constructor(t,e){super(t,e),this.wt=void 0,this.kt=void 0,this.xt(e)}onShutdown(){"undefined"!=typeof document&&(this.wt&&document.removeEventListener("visibilitychange",this.wt),this.kt&&document.removeEventListener("pagehide",this.kt))}xt(t){!0!==(null==t?void 0:t.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this.wt=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this.kt=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this.wt),document.addEventListener("pagehide",this.kt))}}var gf=1e4,mf=function(t,e){if(void 0===e&&(e=new WeakSet),!dr(t)&&!hr(t))return t;if(e.has(t))return"[Circular]";e.add(t);var r,i=hr(t)?[]:{};try{r=Object.keys(t)}catch(t){return}for(var n of r)try{i[n]=mf(t[n],e)}catch(t){}if(t instanceof Error){try{i.name=t.name}catch(t){}try{i.message=t.message}catch(t){}try{i.stack=t.stack}catch(t){}}return i},yf=function(t,e,r,i,n,s){if(void 0===e&&(e=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=gf),void 0===s&&(s=new WeakSet),s.has(t))return r[e||"circular"]="[Circular]",r;s.add(t);try{for(var o in t)try{if(!{}.hasOwnProperty.call(t,o))continue;var a=t[o],u=e?e+"."+o:o;if(dr(a))yf(a,u,r,i,n,s);else{if(i-=1,n-=String(a).length,n-=u.length,0>=i||0>=n)return void(r.attributes_truncated=!0);r[u]=a}}catch(t){continue}}catch(t){}return r},bf={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.logs={initializeLogs(t){(t=>{var e,i={"service.name":(null==(e=t.config.logs)?void 0:e.serviceName)||"posthog-browser-logs",host:Cn.location.host};if(t.sessionManager){var{sessionId:n,windowId:s}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i=r({},i,{"session.id":n,"window.id":s})}Wc.setGlobalLoggerProvider(new vf({resource:Bv(i),processors:[new pf(new af({url:t.config.api_host+"/i/v1/logs?token="+t.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(t);var e=Wc.getLogger("console"),i={};if(t.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:s}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i={sessionStartTimestamp:n.toString(),lastActivityTimestamp:s.toString()}}var o=function(n){var s;Cn.console[n]=(s=Cn.console[n],function(){for(var o=arguments.length,a=new Array(o),u=0;o>u;u++)a[u]=arguments[u];if(a.length>0){var l=a.map((t=>{return((t,e)=>{try{return JSON.stringify(t,e)}catch(e){try{return JSON.stringify(mf(t))}catch(t){return}}})(t,(e=new WeakSet,(t,i)=>{if(i instanceof Error)return r({},i,{name:i.name,message:i.message,stack:i.stack});if("object"==typeof i&&!mr(i)){if(e.has(i))return"[Circular]";e.add(i)}return i}));var e})).join(" ");l.length>gf&&(l=l.slice(0,gf)+"...",i.body_truncated="true"),e.emit({severityText:bf[n],body:l,attributes:r({"log.source":"console."+n,distinct_id:t.get_distinct_id(),"location.href":Cn.location.href},i,dr(a[0])?yf(a[0]):{})}),s.apply(Cn.console,a)}})};for(var a of["debug","log","warn","error","info"])o(a)}};var _f=On("[Error tracking]");function wf(){return new $i([new Ji,new an,new Yi,new Ki,new sn,new nn,new tn,new on],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;e>n;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],o=e.split("\n"),a=n;o.length>a;a++){var u=o[a];if(1024>=u.length){var l=Gi.test(u)?u.replace(Gi,"$1"):u;if(!l.match(/\S*Error: /)){for(var h of i){var c=h(l,t);if(c){s.push(c);break}}if(s.length>=Qi)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Qi).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||Di});var i}))}(s)}}("web:javascript",zi,Zi))}var xf=On("[ExceptionAutocapture]"),Sf=wf(),kf={wrapOnError(t){var e=pn;e||xf.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){for(var e,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var o=Sf.buildFromUnknown(n[4]||n[0],{mechanism:{handled:!1}});return t(o),null!==(e=null==r?void 0:r(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=r}},wrapUnhandledRejection(t){var e=pn;e||xf.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(e){var i,n=Sf.buildFromUnknown(e,{mechanism:{handled:!1}});return t(n),null!==(i=null==r?void 0:r(e))&&void 0!==i&&i},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError(t){var e=console;e||xf.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),a=Sf.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return t(a),null==r?void 0:r(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.errorWrappingFunctions=kf,Cn.posthogErrorWrappingFunctions=kf;var Cf="X-POSTHOG-SESSION-ID",Tf="X-POSTHOG-WINDOW-ID",If="X-POSTHOG-DISTINCT-ID",Ef=[Cf,Tf,If],Rf=(t,e,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(t){return}if(!hr(t)||t.includes(n)){if(r){var{sessionId:s,windowId:o}=r.checkAndGetSessionAndWindowId(!0);i.headers.set(Cf,s),i.headers.set(Tf,o)}e!==Us&&i.headers.set(If,e)}};Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{};var Mf={_patchFetch:(t,r,i)=>Gn(pn,"fetch",(n=>function(){var s=e((function*(e,s){var o=new Request(e,s);return Rf(t,r,i,o),n(o)}));return function(t,e){return s.apply(this,arguments)}}())),_patchXHR:(t,e,r)=>Gn(pn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,u){void 0===o&&(o=!0);var l=this,h=new Request(s);Rf(t,e,r,h);var c=i.call(l,n,h.url,o,a,u);return Ef.forEach((t=>{var e=h.headers.get(t);e&&l.setRequestHeader(t,e)})),c}))};Cn.__PosthogExtensions__.tracingHeadersPatchFns=Mf,Cn.postHogTracingHeadersPatchFns=Mf;var Of=-1,Pf=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Of=e.timeStamp,t(e))}),!0)},Lf=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},Af=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Ff=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Nf=()=>{var t,e=Ff();return null!==(t=null==e?void 0:e.activationStart)&&void 0!==t?t:0},$f=function(t,e){void 0===e&&(e=-1);var r=Ff(),i="navigate";return 0>Of?r&&(document.prerendering||Nf()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Df=new WeakMap;function qf(t,e){return Df.get(t)||Df.set(t,new e),Df.get(t)}class jf{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var Uf,Hf=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{Promise.resolve().then((()=>{e(t.getEntries())}))}));return n.observe(r({type:t,buffered:!0},i)),n}}catch(t){}},Bf=t=>{var e=!1;return()=>{e||(t(),e=!0)}},zf=-1,Vf=new Set,Wf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Zf=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Vf)e();isFinite(zf)||(zf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Zf,!0))}},Gf=()=>{if(0>zf){var t,e=Nf(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0])?void 0:t.startTime;zf=null!=r?r:Wf(),addEventListener("visibilitychange",Zf,!0),addEventListener("prerenderingchange",Zf,!0),Pf((()=>{setTimeout((()=>{zf=Wf()}))}))}return{get firstHiddenTime(){return zf},onHidden(t){Vf.add(t)}}},Qf=t=>{document.prerendering?addEventListener("prerenderingchange",(()=>t()),!0):t()},Jf=[1800,3e3],Kf=function(t,e){void 0===e&&(e={}),Qf((()=>{var r,i=Gf(),n=$f("FCP"),s=Hf("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),i.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-Nf(),0),n.entries.push(e),r(!0)))}));s&&(r=Lf(t,n,Jf,e.reportAllChanges),Pf((i=>{n=$f("FCP"),r=Lf(t,n,Jf,e.reportAllChanges),Af((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Yf=[.1,.25],Xf=0,tp=1/0,ep=0,rp=t=>{for(var e of t)e.interactionId&&(tp=Math.min(tp,e.interactionId),ep=Math.max(ep,e.interactionId),Xf=ep?(ep-tp)/7+1:0)},ip=()=>{var t;return Uf?Xf:null!==(t=performance.interactionCount)&&void 0!==t?t:0},np=0;class sp{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){np=ip(),this.u.length=0,this.l.clear()}L(){var t=Math.min(this.u.length-1,Math.floor((ip()-np)/50));return this.u[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.u.at(-1),i=this.l.get(t.interactionId);if(i||10>this.u.length||t.duration>r.P){var n;if(i?t.duration>i.P?(i.entries=[t],i.P=t.duration):t.duration===i.P&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.l.set((i={id:t.interactionId,entries:[t],P:t.duration}).id,i),this.u.push(i)),this.u.sort(((t,e)=>e.P-t.P)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.l.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var op=t=>{var e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=Bf(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e((()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})})))},ap=[200,500];class up{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var lp=[2500,4e3],hp={onLCP(t,e){void 0===e&&(e={}),Qf((()=>{var r,i=Gf(),n=$f("LCP"),s=qf(e,up),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-Nf(),0),n.entries=[o],r())},a=Hf("largest-contentful-paint",o);if(a){r=Lf(t,n,lp,e.reportAllChanges);var u=Bf((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),l=t=>{t.isTrusted&&(op(u),removeEventListener(t.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});Pf((i=>{n=$f("LCP"),r=Lf(t,n,lp,e.reportAllChanges),Af((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var r=Gf();Kf(Bf((()=>{var i,n=$f("CLS",0),s=qf(e,jf),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=Hf("layout-shift",o);a&&(i=Lf(t,n,Yf,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),Pf((()=>{s.i=0,n=$f("CLS",0),i=Lf(t,n,Yf,e.reportAllChanges),Af((()=>i()))})),setTimeout(i))})))},onFCP:Kf,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Gf();Qf((()=>{var i;"interactionCount"in performance||Uf||(Uf=Hf("event",rp,{type:"event",buffered:!0,durationThreshold:0}));var n,s=$f("INP"),o=qf(e,sp),a=t=>{op((()=>{for(var e of t)o.h(e);var r=o.L();r&&r.P!==s.value&&(s.value=r.P,s.entries=r.entries,n())}))},u=Hf("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=Lf(t,s,ap,e.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(u.takeRecords()),n(!0)})),Pf((()=>{o.v(),s=$f("INP"),n=Lf(t,s,ap,e.reportAllChanges)})))}))}}};Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.postHogWebVitalsCallbacks=hp,Cn.postHogWebVitalsCallbacks=hp,Cn.__PosthogExtensions__.loadWebVitalsCallbacks=()=>hp;class cp{constructor(t){this.disabled=!1===t;var e=dr(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,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var dp="$copy_autocapture",vp=On("[AutoCapture]");function fp(t,e){return e.length>t?e.slice(0,t)+"...":e}function pp(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!ao(e));return e}function gp(t,e){var i,n,{e:s,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:u,elementsChainAsString:l}=e;if(!ao(t))return{props:{}};for(var h=[t],c=t;c.parentNode&&!uo(c,"body");)if(ho(c.parentNode))h.push(c.parentNode.host),c=c.parentNode.host;else{if(!ao(c.parentNode))break;h.push(c.parentNode),c=c.parentNode}var d,v,f=[],p={},g=!1,m=!1;if(Ln(h,(t=>{var e=To(t);if(uo(t,"a")){var r=t.getAttribute("href");g=e&&!!r&&Ao(r)&&r}nr(fo(t),"ph-no-capture")&&(m=!0),f.push(function(t,e,r,i){var n=t.tagName.toLowerCase(),s={tag_name:n};yo.indexOf(n)>-1&&!r&&(s.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?fp(1024,Fo(t)):fp(1024,go(t)));var o=fo(t);o.length>0&&(s.classes=o.filter((function(t){return""!==t}))),Ln(t.attributes,(function(r){var n;if((!Io(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&Ao(r.value)&&(!pr(n=r.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=r.value;"class"===r.name&&(o=co(o).join(" ")),s["attr__"+r.name]=fp(1024,o)}}));for(var a=1,u=1,l=t;l=pp(l);)a++,l.tagName===t.tagName&&u++;return s.nth_child=a,s.nth_of_type=u,s}(t,o,a,u));var i=function(t){if(!To(t))return{};var e={};return Ln(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&Ao(i)&&(e[r]=i)}})),e}(t);An(p,i)})),m)return{props:{},explicitNoCapture:m};if(a||(f[0].$el_text=uo(t,"a")||uo(t,"button")?Fo(t):go(t)),g){var y,b;f[0].attr__href=g;var _=null==(y=Bn(g))?void 0:y.host,w=null==pn||null==(b=pn.location)?void 0:b.host;_&&w&&_!==w&&(d=g)}return{props:An({$event_type:s.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:(v=f,function(t){var e=t.map((t=>{var e,i,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=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return Fn(o).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[$o(e.toString())]=$o(r.toString())})),(n+=":")+Fn(a).map((t=>{var[e,r]=t;return e+'="'+r+'"'})).join("")}));return e.join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:Do(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Fn(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,r]=t;return i.attributes[e]=r})),i}))}(v)))},null!=(i=f[0])&&i.$el_text?{$el_text:null==(n=f[0])?void 0:n.$el_text}:{},d&&"click"===s.type?{$external_click_url:d}:{},p)}}var mp={};function yp(t){return function(t,e){var r=mp[t];if(r)return r;var i,n=e[t];if(cr(i=n)&&-1!==i.toString().indexOf("[native code]")&&!pn.Zone)return mp[t]=n.bind(e);var s=e.document;if(s&&cr(s.createElement))try{var o=s.createElement("iframe");o.hidden=!0,s.head.appendChild(o);var a=o.contentWindow;a&&a[t]&&(n=a[t]),s.head.removeChild(o)}catch(e){Mn.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return n&&cr(n)?mp[t]=n.bind(e):n}("MutationObserver",t)}function bp(t,e){return br(t)&&t>=e}class _p{St(t){var e,r,i,n,s,o=this.Ct((null==t?void 0:t.__onCapture)||this.It.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!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i: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,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:o.__onCapture}}constructor(t,e){this.Tt=[],this.Ct=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.Mt=t=>{var e=function(t){var e=mo(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);mr(e)||this._t(e)||this.Tt.push(e),this.Tt.length&&fr(this.Lt)&&(this.Lt=Cn.setTimeout((()=>{this.Et()}),1e3))},this.Ot=()=>{var t=Date.now();t%50==0&&this.Tt.forEach((e=>{fr(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Rt=()=>{this.Nt=Date.now()},this.At=()=>{"visible"===(null==yn?void 0:yn.visibilityState)&&(this.Pt=Date.now())},this.instance=t,this.qt=this.St(e),this._onCapture=this.qt.__onCapture}start(t){this.Dt(),this.Ft(),this.jt(),this.Ht(),this.Ut(t)}Ut(t){if(!this.Bt){var e=yp(Cn);this.Bt=new e((t=>{this.Vt(t)})),this.Bt.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Bt)||t.disconnect(),this.Bt=void 0,Cn.removeEventListener("click",this.Mt),Cn.removeEventListener("scroll",this.Ot,{capture:!0}),Cn.removeEventListener("selectionchange",this.Rt),null==yn||yn.removeEventListener("visibilitychange",this.At)}Vt(t){this.Wt=Date.now()}Dt(){Un(Cn,"click",this.Mt)}Ft(){Un(Cn,"scroll",this.Ot,{capture:!0})}jt(){Un(Cn,"selectionchange",this.Rt)}Ht(){Un(yn,"visibilitychange",this.At)}_t(t){if(!t)return!0;if(!this.qt.capture_clicks_with_modifier_keys&&((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))return!0;var e;if(oo(t.node))return!0;var r=this.Tt.some((e=>e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!r&&!uo(t.node,"html")&&ao(t.node)&&!function(t){if(!pn||ko(t))return!1;var{targetElementList:e}=Co(t,!1);return e.some((t=>uo(t,"a")))}(t.node)&&function(t,e){var r;if(!pn||ko(t))return!1;var i=wr(e)?xo:null!==(r=null==e?void 0:e.css_selector_ignorelist)&&void 0!==r?r:xo,{targetElementList:n}=Co(t,!1);return!bo(n,i)}(t.node,{css_selector_ignorelist:this.qt.css_selector_ignorelist}))}Et(){if(this.Tt.length){clearTimeout(this.Lt),this.Lt=void 0;var t=this.Tt;for(var e of(this.Tt=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Wt&&this.Wt>=e.timestamp?this.Wt-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Nt&&this.Nt>=e.timestamp?this.Nt-e.timestamp:void 0,e.visibilityChangedDelayMs=this.Pt?Math.abs(e.timestamp-this.Pt):void 0;var i=bp(e.scrollDelayMs,this.qt.scroll_threshold_ms),n=bp(e.selectionChangedDelayMs,this.qt.selection_change_threshold_ms),s=bp(e.mutationDelayMs,this.qt.mutation_threshold_ms),o=bp(e.absoluteDelayMs,1.1*this.qt.mutation_threshold_ms),a=br(e.scrollDelayMs)&&this.qt.scroll_threshold_ms>e.scrollDelayMs,u=br(e.mutationDelayMs)&&this.qt.mutation_threshold_ms>e.mutationDelayMs,l=br(e.selectionChangedDelayMs)&&this.qt.selection_change_threshold_ms>e.selectionChangedDelayMs,h=br(e.visibilityChangedDelayMs)&&this.qt.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(a||u||l||h)){var c=bp(e.visibilityChangedDelayMs,this.qt.selection_change_threshold_ms);i||s||o||n||c?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.Wt,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:n,$dead_click_visibility_changed_timeout:c}):this.qt.mutation_threshold_ms>e.absoluteDelayMs&&this.Tt.push(e)}}this.Tt.length&&fr(this.Lt)&&(this.Lt=Cn.setTimeout((()=>{this.Et()}),1e3))}}It(t,e){this.instance.capture("$dead_click",r({},e,gp(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qt.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,$dead_click_visibility_changed_delay_ms:t.visibilityChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new _p(t,e);var wp=On("[ExternalScriptsLoader]"),xp=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return wp.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==yn?void 0:yn.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===e){var t=i[o];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},o=0;i.length>o;o++)if(n=s())return n.v;var a=()=>{if(!yn)return r("document not found");var i=yn.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)yn.head.appendChild(i);else{var n,s=yn.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):yn.body.appendChild(i)}};null!=yn&&yn.body?a():null==yn||yn.addEventListener("DOMContentLoaded",a)};Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{if("remote-config"!==e){var i;if(t.config.__preview_external_dependency_versioned_paths)i=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var n="/static/"+e+".js?v="+t.version;if("toolbar"===e){var s=3e5;n=n+"&t="+Math.floor(Date.now()/s)*s}i=t.requestRouter.endpointFor("assets",n)}xp(t,i,r)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");xp(t,o,r)}},Cn.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);xp(t,i,r)};class Sp{constructor(t){this._instance=t}get qt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.qt.cookieless_mode===Zs||this.isRejected()||-1===this.consent&&this.qt.cookieless_mode===Ws}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.qt.opt_out_capturing_by_default}optInOut(t){this.nr.N(this.sr,t?1:0,this.qt.cookie_expiration,this.qt.cross_subdomain_cookie,this.qt.secure_cookie)}reset(){this.nr.q(this.sr,this.qt.cross_subdomain_cookie)}get sr(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:r}=this._instance.config;return r||(e?e+t:"__ph_opt_in_out_"+t)}get ir(){var t=this.nr.A(this.sr);return Ir(t)?1:nr(Er,t)?0:-1}get nr(){var t=this.qt.opt_out_capturing_persistence_type,e="localStorage"===t?Kl:Ql;if(!this.ar||this.ar!==e){this.ar=e;var r="localStorage"===t?Ql:Kl;r.A(this.sr)&&(this.ar.A(this.sr)||this.optInOut(Ir(r.A(this.sr))),r.q(this.sr,this.qt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.qt.respect_dnt&&[null==mn?void 0:mn.doNotTrack,null==mn?void 0:mn.msDoNotTrack,Cn.doNotTrack].some((t=>Ir(t)))}}var kp=On("[Dead Clicks]"),Cp=()=>!0,Tp=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(os)),i=t.instance.config.capture_dead_clicks;return wr(i)?i:!!dr(i)||r};class Ip{get lazyLoadedDeadClicksAutocapture(){return this.ur}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[os]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.lr((()=>{this.hr()})):this.stop()}lr(t){var e,r;null!=(e=Cn.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=Cn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?kp.error("failed to load script",e):t()}))}hr(){var t;if(yn){if(!this.ur&&null!=(t=Cn.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=dr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.ur=Cn.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.ur.start(yn),kp.info("starting...")}}else kp.error("`document` not found. Cannot start.")}stop(){this.ur&&(this.ur.stop(),this.ur=void 0,kp.info("stopping..."))}}var Ep=On("[SegmentIntegration]");var Rp="posthog-js";function Mp(t,e){var{organization:i,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var u,l,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,p=(null==(u=e.exception)?void 0:u.values)||[],g=p.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(l=p[0])?void 0:l.value)||e.message,$exception_type:null==(h=p[0])?void 0:h.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(c=p[0])?void 0:c.value)||e.message,$sentry_exception_type:null==(d=p[0])?void 0:d.type,$sentry_tags:e.tags};return i&&n&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+e.event_id),a&&(null==(f=t.exceptions)||f.sendExceptionEvent(m)),e}}class Op{constructor(t,e,r,i,n,s){this.name=Rp,this.setupOnce=function(o){o(Mp(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class Pp{constructor(t){this.cr=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(Mn.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.vr()}vr(){var t;this.pr=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.cr)}destroy(){var t;null==(t=this.pr)||t.call(this),this.pr=void 0}doPageView(t,e){var r,i=this.gr(t,e);return this.dr={pathname:null!==(r=null==pn?void 0:pn.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.gr(t,null==(e=this.dr)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.dr)?void 0:t.pageViewId}}gr(t,e){var r=this.dr;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:u,lastContentY:l,maxContentY:h}=n;if(!(fr(s)||fr(o)||fr(a)||fr(u)||fr(l)||fr(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),h=Math.ceil(h);var c=s>1?Rr(o/s,0,1,Mn):1,d=s>1?Rr(a/s,0,1,Mn):1,v=u>1?Rr(l/u,0,1,Mn):1,f=u>1?Rr(h/u,0,1,Mn):1;i=An(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Lp={[Jn]:{exposure:"hidden"},[Yn]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Xn]:{exposure:"hidden"},[ts]:{exposure:"event"},[es]:{exposure:"hidden"},[rs]:{exposure:"event"},[is]:{exposure:"hidden"},[ns]:{exposure:"event"},[ss]:{exposure:"event"},[os]:{exposure:"event"},[as]:{exposure:"hidden"},[us]:{exposure:"event"},[ls]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[fs]:{exposure:"hidden"},[ps]:{exposure:"event"},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},[gs]:{exposure:"derived",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!dr(t))return{};for(var e={},r=Object.keys(t),i=0;r.length>i;i++)e["$feature/"+r[i]]=t[r[i]];return e}},[ms]:{exposure:"event"},[ys]:{exposure:"hidden"},[bs]:{exposure:"hidden"},[_s]:{exposure:"event"},[ws]:{exposure:"event"},[xs]:{exposure:"event"},[Ss]:{exposure:"hidden"},[ks]:{exposure:"hidden"},[Cs]:{exposure:"hidden"},[Ts]:{exposure:"hidden"},[Is]:{exposure:"event"},[Es]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Rs]:{exposure:"hidden"},[Ms]:{exposure:"hidden"},[Os]:{exposure:"hidden"},[Ps]:{exposure:"hidden"},[Ls]:{exposure:"hidden"},[As]:{exposure:"hidden"},[Fs]:{exposure:"hidden"},[Ns]:{exposure:"hidden"},[$s]:{exposure:"hidden"},[Ds]:{exposure:"hidden"},[qs]:{exposure:"hidden"},[hs]:{exposure:"event"},[cs]:{exposure:"event"},[ds]:{exposure:"event"},[vs]:{exposure:"event"},[Hs]:{exposure:"event"},[Bs]:{exposure:"event"},[zs]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Ap=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Fp=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Np{constructor(t,e){this.qt=t,this.props={},this.mr=!1,this.yr=(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.nr=this.br(t),this.load(),t.debug&&Mn.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this._r}br(t){-1===Fp.indexOf(t.persistence.toLowerCase())&&(Mn.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=[...Yl,...t];return r({},Kl,{F(t){try{var e={};try{e=Ql.F(t)||{}}catch(t){}var r=An(e,JSON.parse(Kl.A(t)||"{}"));return Kl.N(t,r),r}catch(t){}return null},N(t,r,i,n,s,o){try{Kl.N(t,r,void 0,void 0,o);var a={};e.forEach((t=>{r[t]&&(a[t]=r[t])})),Object.keys(a).length&&Ql.N(t,a,i,n,s,o)}catch(t){Kl.D(t)}},q(t,e){try{null==pn||pn.localStorage.removeItem(t),Ql.q(t,e)}catch(t){Kl.D(t)}}})}(t.cookie_persisted_properties||[]),i=t.persistence.toLowerCase();return"localstorage"===i&&Kl.R()?Kl:"localstorage+cookie"===i&&e.R()?e:"sessionstorage"===i&&rh.R()?rh:"memory"===i?th:"cookie"===i?Ql:e.R()?e:Ql}wr(t){var e=null!=t?t:this.qt.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var r=this.props[Ps];return!r||"number"!=typeof r||Date.now()-r>e}properties(){var t={};return Ln(this.props,((e,r)=>{var i=(t=>{var e=Lp[t];if(e)return e;for(var[r,i]of Ap)if(0===t.indexOf(r))return i})(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,r===gs?()=>this.wr():()=>!1))return;i.transformToEventProperties&&An(t,i.transformToEventProperties(e))}else i&&"event"!==i.exposure||(t[r]=e)})),t}load(){if(!this._r){var t=this.nr.F(this.yr);t&&(this.props=An({},t))}}save(){this._r||this.nr.N(this.yr,this.props,this.Sr,this.kr,this.Cr,this.qt.debug)}remove(){this.nr.q(this.yr,!1),this.nr.q(this.yr,!0)}clear(){this.remove(),this.props={}}register_once(t,e,r){if(dr(t)){fr(e)&&(e="None"),this.Sr=fr(r)?this.Ir:r;var i=!1;if(Ln(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.Tr(r,t),i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(dr(t)){this.Sr=fr(e)?this.Ir:e;var r=!1;if(Ln(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.Tr(i,e),r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Er(t),this.save())}update_campaign_params(){if(!this.mr){var t=dc(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);vr(Dn(t))||this.register(t),this.mr=!0}}update_search_keyword(){var t;this.register((t=null==yn?void 0:yn.referrer)?fc(t):{})}update_referrer_info(){var t;this.register_once({$referrer:mc(),$referring_domain:null!=yn&&yn.referrer&&(null==(t=Bn(yn.referrer))?void 0:t.host)||gc},void 0)}set_initial_person_info(){this.props[Ns]||this.props[$s]||this.register_once({[Ds]:yc(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Ln([$s,Ns],(e=>{var r=this.props[e];r&&Ln(r,(function(e,r){t["$initial_"+or(r)]=e}))}));var e,r,i=this.props[Ds];if(i){var n=(e=bc(i),r={},Ln(e,(function(t,e){r["$initial_"+or(e)]=t})),r);An(t,n)}return t}safe_merge(t){return Ln(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){if(this.Ir=this.Sr=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),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 r=[...t].sort(),i=[...e].sort();return r.every(((t,e)=>t===i[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[])){var i=this.br(t),n=this.props;this.clear(),this.nr=i,this.props=n,this.save()}}set_disabled(t){this._r=t,this._r?this.remove():this.save()}set_cross_subdomain(t){t!==this.kr&&(this.kr=t,this.remove(),this.save())}set_secure(t){t!==this.Cr&&(this.Cr=t,this.remove(),this.save())}set_event_timer(t,e){var r=this.props[Xn]||{};r[t]=e,this.Tr(Xn,r),this.save()}remove_event_timer(t){var e=this.props[Xn]||{},r=e[t];return fr(r)||(delete e[t],this.Tr(Xn,e),this.save()),r}get_property(t){return this.props[t]}set_property(t,e){this.Tr(t,e),this.save()}Tr(t,e){this.props[t]=e}Er(t){delete this.props[t]}}var $p={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},Dp={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},qp={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},jp=On("[RateLimiter]");class Up{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{jp.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void jp.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,r,i;void 0===t&&(t=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(Fs))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var u=1>a.tokens;return u||t||(a.tokens=Math.max(0,a.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,null==(i=this.instance.persistence)||i.set_property(Fs,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Hp=On("[RemoteConfig]");class Bp{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=Cn._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Mr(t){var e,r;null!=(e=Cn.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=Cn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Pr(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 Hp.info("Using preloaded remote config",this.remoteConfig),this.Rr(this.remoteConfig),void this.Or();if(this._instance.Lr())return void Hp.warn("Remote config is disabled. Falling back to local config.");this.Mr((t=>{if(!t)return Hp.info("No config found after loading remote JS config. Falling back to JSON."),void this.Pr((t=>{this.Rr(t),this.Or()}));this.Rr(t),this.Or()}))}catch(t){Hp.error("Error loading remote config",t)}}stop(){this.Fr&&(clearInterval(this.Fr),this.Fr=void 0)}refresh(){!this._instance.Lr()&&yn&&"hidden"!==yn.visibilityState&&this._instance.reloadFeatureFlags()}Or(){var t;if(!this.Fr){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.Fr=setInterval((()=>{this.refresh()}),e))}}Rr(t){var e;t||Hp.error("Failed to fetch remote config from PostHog."),this._instance.Rr(null!=t?t:{}),!1!==(null==t?void 0:t.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(e=this._instance.featureFlags)||e.ensureFlagsLoaded())}}var zp=3e3;class Vp{constructor(t,e){this.Ar=!0,this.Nr=[],this.$r=Rr((null==e?void 0:e.flush_interval_ms)||zp,250,5e3,Mn.createLogger("flush interval"),zp),this.Dr=t}enqueue(t){this.Nr.push(t),this.qr||this.jr()}unload(){this.Hr();var t=this.Nr.length>0?this.Ur():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.Dr(r({},t,{transport:"sendBeacon"}))}))}enable(){this.Ar=!1,this.jr()}jr(){var t=this;this.Ar||(this.qr=setTimeout((()=>{if(this.Hr(),this.Nr.length>0){var e=this.Ur(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&hr(r.data)&&Ln(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.Dr(r)};for(var i in e)r()}}),this.$r))}Hr(){clearTimeout(this.qr),this.qr=void 0}Ur(){var t={};return Ln(this.Nr,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;fr(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.Nr=[],t}}var Wp=["retriesPerformedSoFar"];class Zp{constructor(t){this.Br=!1,this.zr=3e3,this.Nr=[],this._instance=t,this.Nr=[],this.Vr=!0,!fr(pn)&&"onLine"in pn.navigator&&(this.Vr=pn.navigator.onLine,this.Wr=()=>{this.Vr=!0,this.Zr()},this.Gr=()=>{this.Vr=!1},Un(pn,"online",this.Wr),Un(pn,"offline",this.Gr))}get length(){return this.Nr.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,Wp);_r(e)&&(n.url=Fl(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{200===t.statusCode||t.statusCode>=400&&500>t.statusCode||(null!=e?e:0)>=10?null==n.callback||n.callback(t):this.Qr(r({retriesPerformedSoFar:e},n))}}))}Qr(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=Math.random()-.5;return Math.ceil(i+n*(i-r))}(e),i=Date.now()+r;this.Nr.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),Mn.warn(n),this.Br||(this.Br=!0,this.Jr())}Jr(){if(this.Kr&&clearTimeout(this.Kr),0===this.Nr.length)return this.Br=!1,void(this.Kr=void 0);this.Kr=setTimeout((()=>{this.Vr&&this.Nr.length>0&&this.Zr(),this.Jr()}),this.zr)}Zr(){var t=Date.now(),e=[],r=this.Nr.filter((r=>t>r.retryAt||(e.push(r),!1)));if(this.Nr=e,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.Kr&&(clearTimeout(this.Kr),this.Kr=void 0),this.Br=!1,fr(pn)||(this.Wr&&(pn.removeEventListener("online",this.Wr),this.Wr=void 0),this.Gr&&(pn.removeEventListener("offline",this.Gr),this.Gr=void 0)),this.Nr))try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(t){Mn.error(t)}this.Nr=[]}}class Gp{constructor(t){this.Yr=()=>{var t,e,r,i;this.Xr||(this.Xr={});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),u=(null==n?void 0:n.scrollHeight)||0;this.Xr.lastScrollY=Math.ceil(s),this.Xr.maxScrollY=Math.max(s,null!==(t=this.Xr.maxScrollY)&&void 0!==t?t:0),this.Xr.maxScrollHeight=Math.max(o,null!==(e=this.Xr.maxScrollHeight)&&void 0!==e?e:0),this.Xr.lastContentY=a,this.Xr.maxContentY=Math.max(a,null!==(r=this.Xr.maxContentY)&&void 0!==r?r:0),this.Xr.maxContentHeight=Math.max(u,null!==(i=this.Xr.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}get ei(){return this._instance.config.scroll_root_selector}getContext(){return this.Xr}resetContext(){var t=this.Xr;return setTimeout(this.Yr,0),t}startMeasuringScrollPosition(){Un(pn,"scroll",this.Yr,{capture:!0}),Un(pn,"scrollend",this.Yr,{capture:!0}),Un(pn,"resize",this.Yr)}scrollElement(){if(!this.ei)return null==pn?void 0:pn.document.documentElement;var t=hr(this.ei)?this.ei:[this.ei];for(var e of t){var r=null==pn?void 0:pn.document.querySelector(e);if(r)return r}}scrollY(){if(this.ei){var t=this.scrollElement();return t&&t.scrollTop||0}return pn&&(pn.scrollY||pn.pageYOffset||pn.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var t=this.scrollElement();return t&&t.scrollLeft||0}return pn&&(pn.scrollX||pn.pageXOffset||pn.document.documentElement.scrollLeft)||0}}var Qp=t=>yc(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class Jp{constructor(t,e,r,i){this.ti=t=>{var e=this.ri();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.ii(this._instance)};this.ni.register({[As]:r})}},this._instance=t,this.si=e,this.ni=r,this.ii=i||Qp,this.si.onSessionId(this.ti)}ri(){return this.ni.props[As]}getSetOnceProps(){var t,e=null==(t=this.ri())?void 0:t.props;return e?"r"in e?bc(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 Ln(Dn(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+or(r)]=e})),t}}class Kp{constructor(){this.oi={}}on(t,e){return this.oi[t]||(this.oi[t]=[]),this.oi[t].push(e),()=>{this.oi[t]=this.oi[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.oi[t]||[])r(e);for(var i of this.oi["*"]||[])i(t,e)}}var Yp=On("[SessionId]");class Xp{on(t,e){return this.ai.on(t,e)}constructor(t,e,r){var i;if(this.ui=[],this.li=void 0,this.ai=new Kp,this.hi=(t,e)=>!(!_r(t)||!_r(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Zs)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qt=t.config,this.ni=t.persistence,this.ci=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=e||Qu,this.fi=r||Qu;var n=this.qt.persistence_name||this.qt.token;if(this._sessionTimeoutMs=1e3*Rr(this.qt.session_idle_timeout_seconds||1800,60,36e3,Yp.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi="ph_"+n+"_window_id",this.mi="ph_"+n+"_primary_window_exists",this.yi()){var s=rh.F(this.gi),o=rh.F(this.mi);s&&!o?this.ci=s:rh.q(this.gi),rh.N(this.mi,!0)}if(null!=(i=this.qt.bootstrap)&&i.sessionID)try{var a=(t=>{var e=this.qt.bootstrap.sessionID.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.bi(this.qt.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){Yp.error("Invalid sessionID in bootstrap",t)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return fr(this.ui)&&(this.ui=[]),this.ui.push(t),this.di&&t(this.di,this.ci),()=>{this.ui=this.ui.filter((e=>e!==t))}}yi(){return"memory"!==this.qt.persistence&&!this.ni._r&&rh.R()}xi(t){t!==this.ci&&(this.ci=t,this.yi()&&rh.N(this.gi,t))}Si(){return this.ci?this.ci:this.yi()?rh.F(this.gi):null}bi(t,e,r){t===this.di&&e===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.di=t,this.ni.register({[fs]:[e,t,r]}))}ki(){var t=this.ni.props[fs];return hr(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.bi(null,null,null)}destroy(){clearTimeout(this.Ci),this.Ci=void 0,this.li&&pn&&(pn.removeEventListener(Ys,this.li,{capture:!1}),this.li=void 0),this.ui=[]}wi(){this.li=()=>{this.yi()&&rh.q(this.mi)},Un(pn,Ys,this.li,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.qt.cookieless_mode===Zs)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),[i,n,s]=this.ki(),o=this.Si(),a=_r(s)&&Math.abs(r-s)>864e5,u=!1,l=!n,h=!l&&!t&&this.hi(r,i);l||h||a?(n=this.vi(),o=this.fi(),Yp.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}}),s=r,u=!0):o||(o=this.fi(),u=!0);var c=_r(i)&&t&&!a?i:r,d=_r(s)?s:(new Date).getTime();return this.xi(o),this.bi(n,c,d),t||this.pi(),u&&this.ui.forEach((t=>t(n,o,u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:d,changeReason:u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}pi(){clearTimeout(this.Ci),this.Ci=setTimeout((()=>{var[t]=this.ki();if(this.hi((new Date).getTime(),t)){var e=this.di;this.resetSessionId(),this.ai.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var tg=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&ir(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>ir(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},eg="custom",rg="i.posthog.com",ig=/^\/static\//;class ng{constructor(t){this.Ii={},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("."+rg,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Ii[this.apiHost]||(this.Ii[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":eg),this.Ii[this.apiHost]}Ti(t){var e=this.instance.config.__preview_external_dependency_versioned_paths;if("string"==typeof e&&ig.test(t))return e.trim().replace(/\/$/,"")||void 0}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("assets"===t){var r=this.Ti(e);if(r)return""+r+e}if(this.region===eg)return this.apiHost+e;var i=rg+e;switch(t){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var sg=On("[PostHog ExternalIntegrations]"),og={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class ag{constructor(t){this._instance=t}lr(t,e){var r;null==(r=Cn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return sg.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,s;!i||null!=(r=Cn.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.lr(og[e],(()=>{var r;null==(r=Cn.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=Cn.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e]&&(null==(s=Cn.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[e])||s.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(r)}}}var ug,lg={},hg=0,cg=()=>{},dg='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',vg="Surveys module not available",fg="sanitize_properties is deprecated. Use before_send instead",pg="Invalid value for property_denylist config: ",gg="posthog",mg=!Ol&&-1===(null==kn?void 0:kn.indexOf("MSIE"))&&-1===(null==kn?void 0:kn.indexOf("Mozilla")),yg=t=>{var e;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:jn(null==yn?void 0:yn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:cg,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,__preview_external_dependency_versioned_paths:!1,debug:bn&&pr(null==bn?void 0:bn.search)&&-1!==bn.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==pn||null==(e=pn.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_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(t){Mn.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Js,before_send:void 0,request_queue_config:{flush_interval_ms:zp},error_tracking:{},_onCapture:cg,__preview_eager_load_replay:!1},(t=>({rageclick:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},bg=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],_g=t=>{var e={};for(var[r,i]of bg)fr(t[r])||(e[i]=t[r]);var n=An({},e,t);return hr(t.property_blacklist)&&(fr(t.property_denylist)?n.property_denylist=t.property_blacklist:hr(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:Mn.error(pg+t.property_denylist)),n};class wg{constructor(){this.__forceAllowLocalhost=!1}get Ei(){return this.__forceAllowLocalhost}set Ei(t){Mn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class xg{Mi(t,e){if(t){var r=this.Pi.indexOf(t);-1!==r&&this.Pi.splice(r,1)}return this.Pi.push(e),null==e.initialize||e.initialize(),e}Ri(){return this.config.cookieless_mode===Zs||this.config.cookieless_mode===Ws&&this.consent.isRejected()}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(){var t;this.webPerformance=new wg,this.Oi=!1,this.version=En.LIB_VERSION,this.Li=new Kp,this.Pi=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=yg(),this.SentryIntegration=Op,this.sentryIntegration=t=>function(t,e){var r=Mp(t,e);return{name:Rp,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Fi=!1,this.Ai=null,this.Ni=null,this.$i=null,this.scrollManager=new Gp(this),this.pageViewManager=new Pp(this),this.rateLimiter=new Up(this),this.requestRouter=new ng(this),this.consent=new Sp(this),this.externalIntegrations=new ag(this);var e=null!==(t=xg.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,r)=>{var i=pr(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=pr(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>Mn.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==gg){var i,n=null!==(i=lg[r])&&void 0!==i?i:new xg;return n._init(t,e,r),lg[r]=n,lg[gg][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n,s;if(void 0===e&&(e={}),fr(t)||gr(t))return Mn.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.Di(e.debug),this.qi=e,this.ji=[],e.person_profiles?this.Ni=e.person_profiles:e.process_person&&(this.Ni=e.process_person),this.set_config(An({},yg(e.defaults),_g(e),{name:i,token:t})),this.config.on_xhr_error&&Mn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Yu.GZipJS;var o=this.Hi();this.persistence=new Np(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Np(r({},this.config,{persistence:"sessionStorage"}),o);var a=r({},this.persistence.props),u=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Ui=new Vp((t=>this.Bi(t)),this.config.request_queue_config),this.zi=new Zp(this),this.__request_queue=[];var l=this.Ri();if(l||(this.sessionManager=new Xp(this),this.sessionPropsManager=new Jp(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Mn.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Vi(l)}),0)):(Mn.info("Initializing extensions synchronously"),this.Vi(l)),En.DEBUG=En.DEBUG||this.config.debug,En.DEBUG&&Mn.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:a,s:u}),!this.config.identity_distinct_id||null!=(n=e.bootstrap)&&n.distinctID||(e.bootstrap=r({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=e.bootstrap)?void 0:s.distinctID)){var h=e.bootstrap.distinctID,c=this.get_distinct_id(),d=this.persistence.get_property(Ls);if(e.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===Gs)this.identify(h);else if(e.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===Qs)Mn.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var v=this.config.get_device_id(Qu()),f=e.bootstrap.isIdentifiedID?v:h;this.persistence.set_property(Ls,e.bootstrap.isIdentifiedID?Qs:Gs),this.register({distinct_id:h,$device_id:f})}}if(l)this.register_once({distinct_id:Us,$device_id:null},"");else if(!this.get_distinct_id()){var p=this.config.get_device_id(Qu());this.register_once({distinct_id:p,$device_id:p},""),this.persistence.set_property(Ls,Gs)}return Un(pn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?function(t,e){var r=t.config.segment;if(!r)return e();!function(t,e){var r=t.config.segment;if(!r)return e();var i=r=>{var i=()=>r.anonymousId()||Qu();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(Ls,Qs)),e()},n=r.user();"then"in n&&cr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||Ep.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,r)=>{if(!r)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(Ep.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Ep.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,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,Xs),identify:t=>e(t,eo),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Wi())):this.Wi(),cr(this.config._onCapture)&&this.config._onCapture!==cg&&(Mn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&Mn.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}Vi(t){var e,i,n,s,o,a,u,l=performance.now(),h=r({},xg.__defaultExtensionClasses,this.config.__extensionClasses),c=[];h.featureFlags&&this.Pi.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new h.featureFlags(this)),h.exceptions&&this.Pi.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new h.exceptions(this)),h.historyAutocapture&&this.Pi.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.Pi.push(new h.tracingHeaders(this)),h.siteApps&&this.Pi.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!t&&this.Pi.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||c.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),h.autocapture&&this.Pi.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.Pi.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new h.surveys(this)),h.logs&&this.Pi.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new h.logs(this)),h.conversations&&this.Pi.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new h.conversations(this)),h.productTours&&this.Pi.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.Pi.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.Pi.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.Pi.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.Pi.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,Tp)),h.toolbar&&this.Pi.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new h.toolbar(this)),h.experiments&&this.Pi.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new h.experiments(this)),this.Pi.forEach((t=>{t.initialize&&c.push((()=>{null==t.initialize||t.initialize()}))})),c.push((()=>{if(this.Zi){var t=this.Zi;this.Zi=void 0,this.Rr(t)}})),this.Gi(c,l)}Gi(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Gi(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){Mn.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({[Hs]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Bs]:i}),this.config.__preview_deferred_init_extensions&&Mn.info("PostHog extensions initialized ("+i+"ms)")}Rr(t){var e;if(!yn||!yn.body)return Mn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Rr(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Zi=t),this.Qi=t,this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=nr(t.supportedCompression,Yu.GZipJS)?Yu.GZipJS:nr(t.supportedCompression,Yu.Base64)?Yu.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ni?this.Ni:Js}),this.Pi.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Wi(){try{this.config.loaded(this)}catch(t){Mn.critical("`loaded` function failed",t)}if(this.Ji(),this.config.internal_or_test_user_hostname&&null!=bn&&bn.hostname){var t=bn.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ri())&&this.Ki()}),1),this.Yi=new Bp(this),this.Yi.load()}Ji(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.Ui)||t.enable())}_dom_loaded(){this.is_capturing()&&Pn(this.__request_queue,(t=>this.Bi(t))),this.__request_queue=[],this.Ji()}_handle_unload(){var t,e,r,i;null==(t=this.surveys)||t.handlePageUnload(),this.config.request_batching?(this.Xi()&&this.capture(to),null==(e=this.logs)||e.flushLogs("sendBeacon"),null==(r=this.Ui)||r.unload(),null==(i=this.zi)||i.unload()):this.Xi()&&this.capture(to,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(mg?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Fl(t.url,{ip:this.config.ip?1:0}),t.headers=r({},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,i,n,s=r({},t);s.timeout=s.timeout||6e4,s.url=jl(s.url,s.compression);var o=null!==(e=s.transport)&&void 0!==e?e:"fetch",a=Ul.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),u=null!==(i=null==(n=function(t,e){for(var r=0;t.length>r;r++)if(e(t[r]))return t[r]}(a,(t=>t.transport===o)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!u)throw new Error("No available transport method");"sendBeacon"!==o&&s.data&&s.compression===Yu.GZipJS&&Sn&&!Ll?ql(s).then((t=>{u(t)})).catch((e=>{if(Ye(e))return Ll=!0,void u(r({},s,{compression:void 0,url:jl(t.url,void 0)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Ye(t)||e===Je})(e)&&(Ll=!0),u(s)})):u(s)})(r({},t,{callback:e=>{var r,i;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,e),null==t.callback||t.callback(e)}}))))}Bi(t){this.zi?this.zi.retriableRequest(t):this._send_request(t)}_execute_array(t){hg++;try{var e,r=[],i=[],n=[];Pn(t,(t=>{if(t)if(hr(e=t[0]))n.push(t);else if(cr(t))try{t.call(this)}catch(e){Mn.error("Error executing queued PostHog call",t,e)}else hr(t)&&"alias"===e?r.push(t):hr(t)&&-1!==e.indexOf("capture")&&cr(this[e])?n.push(t):i.push(t)}));var s=function(t,e){Pn(t,(function(t){try{if(hr(t[0])){var r=e;Ln(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){Mn.error("Error executing queued PostHog call",t,e)}}))};s(r,this),s(i,this),s(n,this)}finally{hg--}}push(t){if(hg>0&&hr(t)&&pr(t[0])){var e=xg.prototype[t[0]];cr(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var n,s,o,a,u;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ui){if(this.is_capturing())if(!fr(t)&&pr(t)){var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var h=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==h||!h.isRateLimited){null!=e&&e.$current_url&&!pr(null==e?void 0:e.$current_url)&&(Mn.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||null!=i&&i.en||Mn.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var c=new Date,d=(null==i?void 0:i.timestamp)||c,v=(null==i?void 0:i.uuid)||Qu(),f={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===Xs&&this.config.__preview_capture_bot_pageviews&&l&&(f.event="$bot_pageview",f.properties.$browser_type="bot"),h&&(f.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens),(null==i?void 0:i.$set)&&(f.$set=null==i?void 0:i.$set);var p=this.tn(null==i?void 0:i.$set_once,t!==ro,t===eo);if(p&&(f.$set_once=p),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=f,a=t=>pr(t)?t.slice(0,s):t,u=new Set,f=function t(e,r){return e!==Object(e)?a?a(e):e:u.has(e)?void 0:(u.add(e),hr(e)?(i=[],Pn(e,(e=>{i.push(t(e))}))):(i={},Ln(e,((e,r)=>{u.has(e)||(i[r]=t(e,r))}))),i);var i}(o)),f.timestamp=d,fr(null==i?void 0:i.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=c),t===xu.DISMISSED||t===xu.SENT){var g=null==e?void 0:e[Su.SURVEY_ID],m=null==e?void 0:e[Su.SURVEY_ITERATION];Uu({id:g,current_iteration:m}),f.$set=r({},f.$set,{[Eu({id:g,current_iteration:m},t===xu.SENT?"responded":"dismissed")]:!0})}else t===xu.SHOWN&&(f.$set=r({},f.$set,{[Su.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===Dp.SHOWN){var y=null==e?void 0:e[qp.TOUR_TYPE];y&&(f.$set=r({},f.$set,{[qp.TOUR_LAST_SEEN_DATE+"/"+y]:(new Date).toISOString()}))}var b=r({},f.properties.$set,f.$set);if(vr(b)||this.setPersonPropertiesForFlags(b),!yr(this.config.before_send)){var _=this.rn(f);if(!_)return;f=_}this.Li.emit("eventCaptured",f);var w={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:f,compression:"best-available",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Bi(w):this.Ui.enqueue(w),f}Mn.critical("This capture call is ignored due to client rate limiting.")}}else Mn.error("No event name provided to posthog.capture")}else Mn.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var o=s?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Ri()&&(a.$cookieless_mode=!0),"$snapshot"===t){var u=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!pr(a.distinct_id)&&!br(a.distinct_id)||gr(a.distinct_id))&&Mn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,h=function(t,e){var r,i,n,s;if(!kn)return{};var o,a=t?[...uc,...e||[]]:[],[u,l]=function(t){for(var e=0;Ei.length>e;e++){var[r,i]=Ei[e],n=r.exec(t),s=n&&(cr(i)?i(n,t):i);if(s)return s}return["",""]}(kn);return An(Dn({$os:u,$os_version:l,$browser:Ci(kn,navigator.vendor),$device:Ri(kn),$device_type:Mi(kn,{userAgentDataPlatform:null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,maxTouchPoints:null==(i=navigator)?void 0:i.maxTouchPoints,screenWidth:null==pn||null==(n=pn.screen)?void 0:n.width,screenHeight:null==pn||null==(s=pn.screen)?void 0:s.height,devicePixelRatio:null==pn?void 0:pn.devicePixelRatio}),$timezone:_c(),$timezone_offset:wc()}),{$current_url:Wn(null==bn?void 0:bn.href,a,hc),$host:null==bn?void 0:bn.host,$pathname:null==bn?void 0:bn.pathname,$raw_user_agent:kn.length>1e3?kn.substring(0,997)+"...":kn,$browser_version:Ii(kn,navigator.vendor),$browser_language:pc(),$browser_language_prefix:(o=pc(),"string"==typeof o?o.split("-")[0]:void 0),$screen_height:null==pn?void 0:pn.screen.height,$screen_width:null==pn?void 0:pn.screen.width,$viewport_height:null==pn?void 0:pn.innerHeight,$viewport_width:null==pn?void 0:pn.innerWidth,$lib:En.LIB_NAME,$lib_version:En.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&An(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&An(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.zi)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===eg&&(a.$lib_custom_api_host=this.config.api_host),l=t!==Xs||s?t!==to||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=An(a,l),t===Xs&&yn&&(a.title=yn.title),!fr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}kn&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=An({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),hr(this.config.property_denylist)?Ln(this.config.property_denylist,(function(t){delete a[t]})):Mn.error(pg+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(Mn.error(fg),a=p(a,t));var g=this.nn();return a.$process_person_profile=g,g&&!s&&this.sn("_calculate_event_properties"),a}tn(t,e,r){var i;if(void 0===e&&(e=!0),void 0===r&&(r=!1),!this.persistence||!this.nn())return t;if(this.Oi&&!r)return t;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=An({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&(Mn.error(fg),o=a(o,"$set_once")),e&&(this.Oi=!0),vr(o)?void 0:o}register(t,e){var r;null==(r=this.persistence)||r.register(t,e)}register_once(t,e,r){var i;null==(i=this.persistence)||i.register_once(t,e,r)}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)}an(t,e){this.register({[t]:e})}getFeatureFlag(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(t,e)}isFeatureEnabled(t,e){var r;return null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(t,e)}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,r){var i;null==(i=this.featureFlags)||i.updateFlags(t,e,r)}updateEarlyAccessFeatureEnrollment(t,e,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){var i;return void 0===e&&(e=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.Li.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:vg}),()=>{})}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:vg})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:vg})}renderSurvey(t,e){var r;null==(r=this.surveys)||r.renderSurvey(t,e)}displaySurvey(t,e){var r;void 0===e&&(e=Bu),null==(r=this.surveys)||r.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,r;return null!==(e=null==(r=this.surveys)?void 0:r.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:vg}}canRenderSurveyAsync(t,e){var r,i;return void 0===e&&(e=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(t,e))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:vg})}un(t){return!t||gr(t)?(Mn.critical("Unique user id has not been set in posthog.identify"),!1):t===Us?(Mn.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(Mn.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.'),!1)}identify(t,e,r){if(!this.__loaded||!this.persistence)return Mn.uninitializedWarning("posthog.identify");if(br(t)&&(t=t.toString(),Mn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.un(t)&&this.sn("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:t}),this.get_property(Kn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(Yn)&&(this.unregister(Yn),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(Ls)||Gs)===Gs;t!==i&&s?(this.persistence.set_property(Ls,Qs),this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!1),this.capture(eo,{distinct_id:t,$anon_distinct_id:i},{$set:e||{},$set_once:r||{}}),this.$i=Bl(t,e,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(e||r)&&this.setPersonProperties(e,r),t!==i&&(this.reloadFeatureFlags(),this.unregister(Rs))}}setPersonProperties(t,e){if((t||e)&&this.sn("posthog.setPersonProperties")){var r=Bl(this.get_distinct_id(),t,e);this.$i!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.$i=r):Mn.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,e,i){if(t&&e){var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),s||i){var o={$group_type:t,$group_key:e};i&&(o.$group_set=i),this.capture(ro,o)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else Mn.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){var t;null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),this.sn("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e,r,i,n,s,o,a,u;if(Mn.info("reset"),!this.__loaded)return Mn.uninitializedWarning("posthog.reset");var l,h=this.get_property(Kn),c=this.get_property(ls);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),fr(c)||null==(l=this.persistence)||l.register({[ls]:c}),null==(i=this.surveys)||i.reset(),null==(n=this.Yi)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.persistence)||a.set_property(Ls,Gs),null==(u=this.sessionManager)||u.resetSessionId(),this.$i=null,this.config.cookieless_mode===Zs)this.register_once({distinct_id:Us,$device_id:null},"");else{var d=this.config.get_device_id(Qu());this.register_once({distinct_id:d,$device_id:t?d:h},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(t,e){var r;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(r=this.conversations)||r.ln()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.hn()}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:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&r){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i}alias(t,e){return t===this.get_property(Jn)?(Mn.critical("Attempting to create alias for existing People user - aborting."),-2):this.sn("posthog.alias")?(fr(e)&&(e=this.get_distinct_id()),t!==e?(this.an(Yn,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(Mn.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(dr(t)){var i,n,s,o,a,u,l,h,c,d;An(this.config,_g(t));var v=this.Hi();null==(i=this.persistence)||i.update_config(this.config,e,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Np(r({},this.config,{persistence:"sessionStorage"}),v);var f=this.Di(this.config.debug);wr(f)&&(this.config.debug=f),wr(this.config.debug)&&(this.config.debug?(En.DEBUG=!0,Kl.R()&&Kl.N("ph_debug",!0),Mn.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(En.DEBUG=!1,Kl.R()&&Kl.q("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),null==(h=this.deadClicksAutocapture)||h.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.cn(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){En.LIB_NAME=t,En.LIB_VERSION=e}startSessionRecording(t){var e,r,i,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}}addExceptionStep(t,e){var r;null==(r=this.exceptions)||r.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:xg.dn}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,r;return null!==(e=null==(r=this.toolbar)?void 0:r.loadToolbar(t))&&void 0!==e&&e}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:gg;return e!==gg&&(e=gg+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Ls))===Qs||(null==(e=this.sessionPersistence)?void 0:e.get_property(Ls))===Qs}nn(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Js&&!this._isIdentified()&&vr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Yn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[qs]))}Xi(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.nn()||this.sn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.sn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}sn(t){return"never"===this.config.person_profiles?(Mn.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.an(qs,!0),!0)}Hi(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Ws)}cn(){var t,e,r,i,n=this.Hi();return(null==(t=this.persistence)?void 0:t._r)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e._r)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Zs){if(this.Ri()){var r,i,n,s,o;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new Xp(this),this.pageViewManager=new Pp(this),this.persistence&&(this.sessionPropsManager=new Jp(this,this.sessionManager,this.persistence));var a,u=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=xg.__defaultExtensionClasses)?void 0:o.sessionRecording;u&&(this.sessionRecording=this.Mi(this.sessionRecording,new u(this)),this.Qi&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.Qi)))}var l,h;this.consent.optInOut(!0),this.cn(),this.Ji(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Ws&&(null==(l=this.surveys)||l.loadIfEnabled()),(fr(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ki()}else Mn.warn(dg)}opt_out_capturing(){var t,e,r;this.config.cookieless_mode!==Zs?(this.config.cookieless_mode===Ws&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===Ws&&(this.register({distinct_id:Us,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.Ki())):Mn.warn(dg)}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 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Zs||(this.config.cookieless_mode===Ws?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return mn?tg(mn,this.config.custom_blocked_useragents):void 0}Ki(){yn&&("visible"===yn.visibilityState?this.Fi||(this.Fi=!0,this.capture(Xs,{title:yn.title},{send_instantly:!0}),this.Ai&&(yn.removeEventListener(Ks,this.Ai),this.Ai=null)):this.Ai||(this.Ai=this.Ki.bind(this),Un(yn,Ks,this.Ai)))}debug(t){!1===t?(null==pn||pn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==pn||pn.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}))}Lr(){var t,e,r,i,n,s,o=this.qi||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Mn.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",!1,i=Mn,n=(e="advanced_disable_flags")in(t=o)&&!yr(t[e]),s=r in t&&!yr(t[r]),n?t[e]:!!s&&(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r]))}rn(t){if(yr(this.config.before_send))return t;var e=hr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),yr(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return nr(Qe,t.event)?Mn.warn(n+". This can cause unexpected behavior."):Mn.info(n),null}r.properties&&!vr(r.properties)||Mn.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return null==(t=this.pageViewManager.dr)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(r)})}Di(t){var e=wr(t)&&!t,r=Kl.R()&&"true"===Kl.A("ph_debug");return!e&&(!!r||t)}}xg.__defaultExtensionClasses={},xg.dn={trace:ug=()=>{},debug:ug,info:ug,warn:ug,error:ug,fatal:ug},function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=$n(t.prototype[e[r]])}(xg,["identify"]);var Sg=On("[ExceptionAutocapture]"),kg=On("[TracingHeaders]"),Cg=On("[Web Vitals]"),Tg=9e5,Ig="disabled",Eg="lazy_loading",Rg="awaiting_config",Mg="missing_config";On("[SessionRecording]"),On("[SessionRecording]");var Og="[SessionRecording]",Pg=On(Og),Lg=On("[Heatmaps]");function Ag(t){return dr(t)&&"clientX"in t&&"clientY"in t&&br(t.clientX)&&br(t.clientY)}var Fg=On("[Product Tours]"),Ng=["$set_once","$set"],$g=On("[SiteApps]"),Dg="Error while initializing PostHog app with config id ";function qg(t,e,r){if(yr(t))return!1;switch(r){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class jg{constructor(t){this.vn=new Kp,this.fn=(t,e)=>this.pn(t,e)&&this.gn(t,e)&&this.mn(t,e)&&this.yn(t,e),this.pn=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.bn=new Set,this._n=new Set}init(){var t,e;fr(null==(t=this._instance)?void 0:t._addCaptureHook)||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)})))}register(t){var e,r;if(!fr(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,r;null==(e=this._n)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.bn)||e.add((null==t?void 0:t.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,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==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(t,e){var r;null!=e&&0!=t.length&&(this.bn.has(t)||this.bn.has(null==e?void 0:e.event))&&this._n&&(null==(r=this._n)?void 0:r.size)>0&&this._n.forEach((t=>{this.wn(e,t)&&this.vn.emit("actionCaptured",t.name)}))}xn(t){this.onAction("actionCaptured",(e=>t(e)))}wn(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.fn(t,r))return!0;return!1}onAction(t,e){return this.vn.on(t,e)}gn(t,e){if(null!=e&&e.url){var r,i=null==t||null==(r=t.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!qg(i,e.url,e.url_matching||"contains"))return!1}return!0}mn(t,e){return!!this.Sn(t,e)&&!!this.kn(t,e)&&!!this.Cn(t,e)}Sn(t,e){var r;if(null==e||!e.href)return!0;var i=this.In(t);if(i.length>0)return i.some((t=>qg(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&qg((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}kn(t,e){var r;if(null==e||!e.text)return!0;var i=this.In(t);if(i.length>0)return i.some((t=>qg(t.text,e.text,e.text_matching||"exact")||qg(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!yr(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>qg(t,s,o))))}Cn(t,e){var r,i;if(null==e||!e.selector)return!0;var n=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}In(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}yn(t,e){return null==e||!e.properties||0===e.properties.length||Wl(e.properties.reduce(((t,e)=>{var r=hr(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:r,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Ug{constructor(t){this._instance=t,this.Tn=new Map,this.En=new Map,this.Mn=new Map}Pn(t,e){return!!t&&Wl(t.propertyFilters,null==e?void 0:e.properties)}Rn(t,e){var r=new Map;return t.forEach((t=>{var i;null==(i=t.conditions)||null==(i=i[e])||null==(i=i.values)||i.forEach((e=>{if(null!=e&&e.name){var i=r.get(e.name)||[];i.push(t.id),r.set(e.name,i)}}))})),r}On(t,e,r){var i=(r===fu.Activation?this.Tn:this.En).get(t),n=[];return this.Ln((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.Pn(s,e)}))}register(t){var e;fr(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.Fn(t),this.An(t))}An(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));0!==e.length&&(null==this.Nn&&(this.Nn=new jg(this._instance),this.Nn.init(),this.Nn.xn((t=>{this.onAction(t)}))),e.forEach((t=>{var e,r,i,n,s;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Nn)||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 r=this.Mn.get(e.name);r&&r.push(t.id),this.Mn.set(e.name,r||[t.id])}})))})))}Fn(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));0===r.length&&0===i.length||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.Tn=this.Rn(t,fu.Activation),this.En=this.Rn(t,fu.Cancellation))}onEvent(t,e){var r,i=this.le(),n=this.$n(),s=this.Dn(),o=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(s===t&&e&&o.length>0){var a,u;i.info("event matched, removing item from activated items",{event:t,eventPayload:e,existingActivatedItems:o});var l=(null==e||null==(a=e.properties)?void 0:a.$survey_id)||(null==e||null==(u=e.properties)?void 0:u.$product_tour_id);if(l){var h=o.indexOf(l);0>h||(o.splice(h,1),this.qn(o))}}else{if(this.En.has(t)){var c=this.On(t,e,fu.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:t,itemsToCancel:c.map((t=>t.id))}),c.forEach((t=>{var e=o.indexOf(t.id);0>e||o.splice(e,1),this.jn(t.id)})),this.qn(o))}if(this.Tn.has(t)){i.info("event name matched",{event:t,eventPayload:e,items:this.Tn.get(t)});var d=this.On(t,e,fu.Activation);this.qn(o.concat(d.map((t=>t.id))||[]))}}}onAction(t){var e,r=this.$n(),i=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[r])||[];this.Mn.has(t)&&this.qn(i.concat(this.Mn.get(t)||[]))}qn(t){var e=this.le(),r=[...new Set(t)].filter((t=>!this.Hn(t)));e.info("updating activated items",{activatedItems:r}),this.Un(r)}getActivatedIds(){var t,e=this.$n();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}getEventToItemsMap(){return this.Tn}Bn(){return this.Nn}}class Hg extends Ug{constructor(t){super(t)}$n(){return Is}Dn(){return xu.SHOWN}Ln(t){var e;null==(e=this._instance)||e.getSurveys(t)}jn(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}le(){return Lu}Un(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[Is]:t})}Hn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Bg="SDK is not enabled or survey functionality is not yet loaded",zg="Disabled. Not loading surveys.",Vg=null!=pn&&pn.location?Zn(pn.location.hash,"__posthog")||Zn(location.hash,"state"):null,Wg="_postHogToolbarParams",Zg=On("[Toolbar]"),Gg=On("[FeatureFlags]"),Qg=On("[FeatureFlags]",{debugEnabled:!0}),Jg="\" failed. Feature flags didn't load in time.",Kg=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},Yg=t=>{var e={};for(var[r,i]of Fn(t||{}))i&&(e[r]=i);return e},Xg="Refusing to render web experiment since the viewer is a likely bot",tm={icontains:(t,e)=>!!pn&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!pn&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!pn&&Hl(e.href,t),not_regex:(t,e)=>!!pn&&!Hl(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class em{get qt(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{em.zn("retrieved web experiments from the server"),e.Vn=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;e.Vn&&(em.zn("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.Vn)||r.set(t.feature_flag_key,t));var i=e._instance.getFeatureFlag(t.feature_flag_key);pr(i)&&t.variants[i]&&e.Wn(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];em.Zn(s)&&e.Wn(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())em.zn(Xg);else if(!this.qt.disable_web_experiments){if(yr(this.Vn))return this.Vn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();em.zn("applying feature flags",t),t.forEach((t=>{var e;if(this.Vn&&null!=(e=this.Vn)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.Vn)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.Wn(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=em.getWindowLocation();if(null!=t&&t.search){var e=Vn(null==t?void 0:t.search,"__experiment_id"),r=Vn(null==t?void 0:t.search,"__experiment_variant");e&&r&&(em.zn("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.Gn(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this.qt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this.qt.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.qt.token),method:"GET",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}Gn(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(em.zn("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.Wn(i[0].name,e,i[0].variants[e].transforms))}static Zn(t){return!yr(t.conditions)&&em.Qn(t)&&em.Jn(t)}static Qn(t){var e;if(yr(t.conditions)||yr(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,s=em.getWindowLocation();return!!s&&(null==(r=t.conditions)||!r.url||tm[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,s))}static getWindowLocation(){return null==pn?void 0:pn.location}static Jn(t){var e;if(yr(t.conditions)||yr(null==(e=t.conditions)?void 0:e.utm))return!0;var r=dc();if(r.utm_source){var i,n,s,o,a,u,l,h,c=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.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)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(u=t.conditions)||null==(u=u.utm)?void 0:u.utm_medium)==r.utm_medium,f=null==(l=t.conditions)||null==(l=l.utm)||!l.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return c&&v&&f&&d}return!1}static zn(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];Mn.info("[WebExperiments] "+t,r)}Wn(t,e,r){this._is_bot()?em.zn(Xg):"control"!==e?r.forEach((r=>{if(r.selector){var i;em.zn("applying transform of variant "+e+" for experiment "+t+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}})):em.zn("Control variants leave the page unmodified.")}_is_bot(){return mn&&this._instance?tg(mn,this.qt.custom_blocked_useragents):void 0}}var rm=On("[Conversations]"),im="Conversations not available yet.",nm={featureFlags:class{constructor(t){this.Kn=!1,this.Yn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=!1,this._instance=t,this.featureFlagEventHandlers=[]}get qt(){return this._instance.config}get ni(){return this._instance.persistence}os(t){return this._instance.get_property(t)}us(){var t,e;return null!==(t=null==(e=this.ni)?void 0:e.wr(this.qt.feature_flag_cache_ttl_ms))&&void 0!==t&&t}ls(){return!!this.us()&&(this.ss||this.Xn||(this.ss=!0,Gg.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}hs(){var t,e=null!==(t=this.qt.evaluation_contexts)&&void 0!==t?t:this.qt.evaluation_environments;return!this.qt.evaluation_environments||this.qt.evaluation_contexts||this.ns||(Gg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ns=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Gg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}cs(){return this.hs().length>0}ds(){var t=this.qt.flag_keys;if(!fr(t)){if(hr(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Gg.error("Invalid flag key found:",t,"Expected non-empty string"),e}));Gg.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,{config:r}=this._instance,i=null!==(t=null==(e=r.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((t=>!!i[t])).reduce(((t,e)=>(t[e]=i[e]||!1,t)),{}),u=Object.keys(o).filter((t=>a[t])).reduce(((t,e)=>(o[e]&&(t[e]=o[e]),t)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:u})}}updateFlags(t,e,i){var n=null!=i&&i.merge?this.getFlagVariants():{},s=null!=i&&i.merge?this.getFlagPayloads():{},o=r({},n,t),a=r({},s,e),u={};for(var[l,h]of Object.entries(o)){var c="string"==typeof h;u[l]={key:l,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:fr(null==a?void 0:a[l])?void 0:{id:0,version:void 0,description:void 0,payload:a[l]}}}this.receivedFeatureFlags({flags:u})}get hasLoadedFlags(){return this.Yn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.os(bs),e=this.os(xs),i=this.os(Ss);if(!i&&!e)return t||{};var n=An({},t||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var o of s){var a,u,l=n[o],h=null==e?void 0:e[o],c=fr(h)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!h,d=fr(h)?l.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[o],f=r({},l,{enabled:c,variant:c?null!=d?d:null==l?void 0:l.variant:void 0});c!==(null==l?void 0:l.enabled)&&(f.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(f.original_variant=null==l?void 0:l.variant),v&&(f.metadata=r({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(u=l.metadata)?void 0:u.payload})),n[o]=f}return this.Kn||(Gg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.Kn=!0),n}getFlagVariants(){var t=this.os(gs),e=this.os(xs);if(!e)return t||{};for(var r=An({},t),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Kn||(Gg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Kn=!0),r}getFlagPayloads(){var t=this.os(_s),e=this.os(Ss);if(!e)return t||{};for(var r=An({},t||{}),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Kn||(Gg.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.Kn=!0),r}reloadFeatureFlags(){this.es||this.qt.advanced_disable_feature_flags||this.vs||(this._instance.Li.emit("featureFlagsReloading",!0),this.vs=setTimeout((()=>{this.fs()}),5))}ps(){clearTimeout(this.vs),this.vs=void 0}ensureFlagsLoaded(){this.Yn||this.Xn||this.vs||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.es=t}fs(t){var e;if(this.ps(),!this._instance.Lr())if(this.Xn)this.ts=!0;else{var i=this.qt.token,n=this.os(Kn),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(e=this.ni)?void 0:e.get_initial_props())||{},this.os(ks)||{}),group_properties:this.os(Cs),timezone:_c()};mr(n)||fr(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this.qt.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.cs()&&(s.evaluation_contexts=this.hs());var o=this.ds();fr(o)||(s.flag_keys=o);var a=!!this.qt.advanced_only_evaluate_survey_feature_flags,u=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.qt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Xn=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this.qt.disable_compression?void 0:Yu.Base64,timeout:this.qt.feature_flag_request_timeout_ms,callback:t=>{var e,r,i,n=!0;if(200===t.statusCode&&(this.ts||(this.$anon_distinct_id=void 0),n=!1),this.Xn=!1,!s.disable_flags||this.ts){this.rs=!n;var o=[];t.error?t.error instanceof Error?o.push("AbortError"===t.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==t.statusCode&&o.push("api_error_"+t.statusCode),null!=(e=t.json)&&e.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var u,l=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(l&&o.push("quota_limited"),null==(i=this.ni)||i.register({[Os]:o}),l)Gg.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(u=t.json)&&void 0!==u?u:{},n,{partialResponse:a}),this.ts&&(this.ts=!1,this.fs())}}})}}getFeatureFlag(t,e){var r;if(void 0===e&&(e={}),!e.fresh||this.rs)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var i=this.getFeatureFlagResult(t,e);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else Gg.warn('getFeatureFlag for key "'+t+Jg)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.rs)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var r=this.getFlagVariants(),i=t in r,n=r[t],s=this.getFlagPayloads()[t],o=String(n),a=this.os(ws)||void 0,u=this.os(Ps)||void 0,l=this.os(Rs)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var h,c=this._instance.get_session_id(),d=this.os(Ms);c&&c!==d&&(l={},null==(h=this.ni)||h.register({[Rs]:l,[Ms]:c}))}if((e.send_event||!("send_event"in e))&&(!(t in l)||!l[t].includes(o))){var v,f,p,g,m,y,b,_,w,x;hr(l[t])?l[t].push(o):l[t]=[o],null==(v=this.ni)||v.register({[Rs]:l});var S=this.getFeatureFlagDetails(t),k=[...null!==(f=this.os(Os))&&void 0!==f?f:[]];fr(n)&&k.push("flag_missing");var C={$feature_flag:t,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(null==(p=this.qt.bootstrap)||null==(p=p.featureFlags)?void 0:p[t])||null,$feature_flag_bootstrapped_payload:(null==(g=this.qt.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[t])||null,$used_bootstrap_value:!this.rs};fr(null==S||null==(m=S.metadata)?void 0:m.version)||(C.$feature_flag_version=S.metadata.version);var T,I=null!==(y=null==S||null==(b=S.reason)?void 0:b.description)&&void 0!==y?y:null==S||null==(_=S.reason)?void 0:_.code;I&&(C.$feature_flag_reason=I),null!=S&&null!=(w=S.metadata)&&w.id&&(C.$feature_flag_id=S.metadata.id),fr(null==S?void 0:S.original_variant)&&fr(null==S?void 0:S.original_enabled)||(C.$feature_flag_original_response=fr(S.original_variant)?S.original_enabled:S.original_variant),null!=S&&null!=(x=S.metadata)&&x.original_payload&&(C.$feature_flag_original_payload=null==S||null==(T=S.metadata)?void 0:T.original_payload),k.length&&(C.$feature_flag_error=k.join(",")),this._instance.capture("$feature_flag_called",C)}if(i){var E=s;if(!fr(s))try{E=JSON.parse(s)}catch(t){}return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:E}}}}else Gg.warn('getFeatureFlagResult for key "'+t+Jg)}getRemoteConfigPayload(t,e){var r=this.qt.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.cs()&&(i.evaluation_contexts=this.hs());var n=this.ds();fr(n)||(i.flag_keys=n),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.qt.disable_compression?void 0:Yu.Base64,timeout:this.qt.feature_flag_request_timeout_ms,callback(r){var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),!e.fresh||this.rs){if(this.Yn||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return fr(r)?void 0:!!r}Gg.warn('isFeatureEnabled for key "'+t+Jg)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,i){if(this.ni){this.Yn=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(t,e,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var r;return[t,null!==(r=e[t].variant)&&void 0!==r?r:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var r;return null==(r=e[t].metadata)?void 0:r.payload})).map((t=>{var r;return[t,null==(r=e[t].metadata)?void 0:r.payload]})))):Gg.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t})(t),u=a.flags,l=a.featureFlags,h=a.featureFlagPayloads;if(l){var c=t.requestId,d=t.evaluatedAt;if(hr(l)){Gg.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(l)for(var f=0;l.length>f;f++)v[l[f]]=!0;e&&e.register({[ms]:l,[gs]:v})}else{var p=l,g=h,m=u;if(null!=o&&o.partialResponse)p=r({},i,p),g=r({},n,g),m=r({},s,m);else if(t.errorsWhileComputingFlags)if(u){var y=new Set(Object.keys(u).filter((t=>{var e;return!(null!=(e=u[t])&&e.failed)})));p=r({},i,Object.fromEntries(Object.entries(p).filter((t=>{var[e]=t;return y.has(e)})))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((t=>{var[e]=t;return y.has(e)})))),m=r({},s,Object.fromEntries(Object.entries(m||{}).filter((t=>{var[e]=t;return y.has(e)}))))}else p=r({},i,p),g=r({},n,g),m=r({},s,m);e&&e.register(r({[ms]:Object.keys(Yg(p)),[gs]:p||{},[_s]:g||{},[bs]:m||{}},c?{[ws]:c}:{},d?{[Ps]:d}:{}))}}}(t,this.ni,n,s,o,i),e||(this.ss=!1),this.gs(e)}}override(t,e){void 0===e&&(e=!1),Gg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.ni)return Gg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.ni.unregister(xs),this.ni.unregister(Ss),this.gs(),Qg.info("All overrides cleared");if(hr(t)){var e=Kg(t);return this.ni.register({[xs]:e}),this.gs(),Qg.info("Flag overrides set",{flags:t})}if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var r,i=t;if(this.Kn=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.ni.unregister(xs),Qg.info("Flag overrides cleared");else if(i.flags){if(hr(i.flags)){var n=Kg(i.flags);this.ni.register({[xs]:n})}else this.ni.register({[xs]:i.flags});Qg.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.ni.unregister(Ss),Qg.info("Payload overrides cleared")):i.payloads&&(this.ni.register({[Ss]:i.payloads}),Qg.info("Payload overrides set",{payloads:i.payloads}))),void this.gs()}if(t&&"object"==typeof t)return this.ni.register({[xs]:t}),this.gs(),Qg.info("Flag overrides set",{flags:t});Gg.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Yn){var{flags:e,flagVariants:r}=this.ys();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this.os(ys)||[]).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),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var u=r({},this.getFlagVariants(),{[t]:e});null==(n=this.ni)||n.register({[ms]:Object.keys(Yg(u)),[gs]:u}),this.gs()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this.os(ys),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.qt.token+n),method:"GET",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this.ni)||r.unregister(ys),null==(i=this.ni)||i.register({[ys]:n}),t(n)}}})}ys(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,r)=>(t[r]=e[r],t)),{})}}gs(t){var{flags:e,flagVariants:r}=this.ys();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.os(ks)||{},n=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._instance.register({[ks]:r({},i,o,n)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ks)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.os(Cs)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Cs]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.os(Cs)||{};this._instance.register({[Cs]:r({},e,{[t]:{}})})}else this._instance.unregister(Cs)}reset(){this.Yn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.ps(),this.Kn=!1}}},sm={sessionRecording:class{get qt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var t;return!(null==(t=this.bs)||!t.isStarted)}get status(){var t,e;return this._s===Rg||this._s===Mg?this._s:null!==(t=null==(e=this.bs)?void 0:e.status)&&void 0!==t?t:this._s}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this._s=Ig,this.ws=void 0,this._instance=t,!this._instance.sessionManager)throw Pg.error("started without valid sessionManager"),new Error(Og+" started without valid sessionManager. This is a bug.");if(this.qt.cookieless_mode===Zs)throw new Error(Og+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get xs(){var t,e=!(null==(t=this._instance.get_property(ls))||!t.enabled),r=!this.qt.disable_session_recording,i=this.qt.disable_session_recording||this._instance.consent.isOptedOut();return pn&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.xs||null==(e=this.bs)||!e.isStarted){var r=!fr(Object.assign)&&!fr(Array.from);this.xs&&r?(this.Ss(t),Pg.info("starting")):(this._s=Ig,this.stopRecording())}}Ss(t){var e,r,i;this.xs&&(this._s!==Rg&&this._s!==Mg&&(this._s=Eg),null!=Cn&&null!=(e=Cn.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=Cn.__PosthogExtensions__)&&r.initSessionRecording?this.ks(t):null==(i=Cn.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Cs,(e=>{if(e)return Pg.error("could not load recorder",e);this.ks(t)})))}stopRecording(){var t,e;null==(t=this.ws)||t.call(this),this.ws=void 0,null==(e=this.bs)||e.stop()}Is(){var t,e;null==(t=this.ws)||t.call(this),this.ws=void 0,null==(e=this.bs)||e.discard()}Ts(){var t;null==(t=this.ni)||t.unregister(ps)}Es(t,e){if(yr(t))return null;var r,i=br(t)?t:parseFloat(t);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(Pg.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):i}Ms(t){if(this.ni){var e,i,n=this.ni,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.Es(null==(e=this.qt.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.Es(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;yr(a)&&this.Ts();var u=null==i?void 0:i.minimumDurationMilliseconds;n.register({[ls]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:fr(u)?null:u,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(e=this.ws)||e.call(this),this.ws=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){return"sessionRecording"in t?!1===t.sessionRecording?(this.Ms(t),void this.Is()):(this.Ms(t),void this.startIfEnabledOrStop()):(this._s===Rg&&(this._s=Mg,Pg.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.bs)&&r.log?this.bs.log(t,e):Pg.warn("log called before recorder was ready")}get Cs(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(ls);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}Ps(){var t,e,r=this._instance.get_property(ls);if(!r)return!1;try{e="object"==typeof r?r:JSON.parse(r)}catch(t){return Pg.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}var i=null!==(t=e.cache_timestamp)&&void 0!==t?t:Date.now();return 36e5>=Date.now()-i}ks(t){var e,r;if(null==(e=Cn.__PosthogExtensions__)||!e.initSessionRecording)return Pg.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[zs]:!0});if(this.bs||(this.bs=null==(r=Cn.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.bs._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ps()){if(this._s===Mg||this._s===Rg)return;return this._s=Rg,Pg.info("persisted remote config is stale, requesting fresh config before starting"),void new Bp(this._instance).load()}this._s=Eg,this.bs.start(t)}onRRwebEmit(t){var e;null==(e=this.bs)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.bs||null==(e=this.ni)||e.register({[cs]:!0}),null==(t=this.bs)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.bs||null==(e=this.ni)||e.register({[hs]:!0}),null==(t=this.bs)||t.overrideSampling()}overrideTrigger(t){var e,r;this.bs||null==(r=this.ni)||r.register({["url"===t?ds:vs]:!0}),null==(e=this.bs)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.bs)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.bs)||!r.tryAddCustomEvent(t,e))}}},om={autocapture:class{constructor(t){this.Rs=!1,this.Os=null,this.Ls=!1,this.instance=t,this.rageclicks=new cp(t.config.rageclick),this.Fs=null}initialize(){this.startIfEnabled()}get qt(){var t,e,r=dr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(t=r.url_allowlist)?void 0:t.map((t=>new RegExp(t))),r.url_ignorelist=null==(e=r.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),r}As(){if(this.isBrowserSupported()){if(pn&&yn){var t=t=>{t=t||(null==pn?void 0:pn.event);try{this.Ns(t)}catch(t){vp.error("Failed to capture event",t)}};if(Un(yn,"submit",t,{capture:!0}),Un(yn,"change",t,{capture:!0}),Un(yn,"click",t,{capture:!0}),this.qt.capture_copied_text){var e=t=>{t=t||(null==pn?void 0:pn.event);try{this.Ns(t,dp)}catch(t){vp.error("Failed to capture copy/cut event",t)}};Un(yn,"copy",e,{capture:!0}),Un(yn,"cut",e,{capture:!0})}}}else vp.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Rs&&(this.As(),this.Rs=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Ls=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ts]:!!t.autocapture_opt_out}),this.Os=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Fs=t}getElementSelectors(t){var e,r=[];return null==(e=this.Fs)||e.forEach((e=>{var i=null==yn?void 0:yn.querySelectorAll(e);null==i||i.forEach((i=>{t===i&&r.push(e)}))})),r}get isEnabled(){var t,e,r=null==(t=this.instance.persistence)?void 0:t.props[ts];if(mr(this.Os)&&!wr(r)&&!this.instance.Lr())return!1;var i=null!==(e=this.Os)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!i}Ns(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=mo(t);lo(i)&&(i=i.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&function(t,e){if(!pn||ko(t))return!1;var r,i,n;if(wr(e)?(r=!!e&&So,i=void 0):(r=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:So,i=null==e?void 0:e.content_ignorelist),!1===r)return!1;var{targetElementList:s}=Co(t,!1);return!function(t,e){if(!1===t||fr(t))return!1;var r;if(!0===t)r=wo;else{if(!hr(t))return!1;if(t.length>10)return Mn.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var{safeText:e,ariaLabel:i}=t;return r.some((t=>e.includes(t)||i.includes(t)))}))}(i,s.map((t=>{var e;return{safeText:go(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!bo(s,r)}(i,this.instance.config.rageclick)&&this.Ns(t,"$rageclick");var n=e===dp;if(i&&function(t,e,r,i,n){var s,o,a,u;if(void 0===r&&(r=void 0),!pn||ko(t))return!1;if(null!=(s=r)&&s.url_allowlist&&!vo(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&vo(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Co(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(fr(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(i=n(s))return i.v;return!1}(c,r))return!1;if(!bo(c,null==(u=r)?void 0:u.css_selector_allowlist))return!1;var d=pn.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&&(yo.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}(i,t,this.qt,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=gp(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qt.element_attribute_ignorelist,elementsChainAsString:this.Ls});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),e===dp){var u,l=po(null==pn||null==(u=pn.getSelection())?void 0:u.toString()),h=t.type||"clipboard";if(!l)return!1;s.$selected_content=l,s.$copy_type=h}return this.instance.capture(e,s),!0}}}isBrowserSupported(){return cr(null==yn?void 0:yn.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.$s=(null==pn||null==(e=pn.location)?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(Mn.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ds&&this.Ds(),this.Ds=void 0,Mn.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(pn&&pn.history){var r=this;null!=(t=pn.history.pushState)&&t.__posthog_wrapped__||Gn(pn.history,"pushState",(t=>function(e,i,n){t.call(this,e,i,n),r.qs("pushState")})),null!=(e=pn.history.replaceState)&&e.__posthog_wrapped__||Gn(pn.history,"replaceState",(t=>function(e,i,n){t.call(this,e,i,n),r.qs("replaceState")})),this.js()}}qs(t){try{var e,r=null==pn||null==(e=pn.location)?void 0:e.pathname;if(!r)return;r!==this.$s&&this.isEnabled&&this._instance.capture(Xs,{navigation_type:t}),this.$s=r}catch(e){Mn.error("Error capturing "+t+" pageview",e)}}js(){if(!this.Ds){var t=()=>{this.qs("popstate")};Un(pn,"popstate",t),this.Ds=()=>{pn&&pn.removeEventListener("popstate",t)}}}},heatmaps:class{get qt(){return this.instance.config}constructor(t){var e;this.Hs=!1,this.Rs=!1,this.Us=null,this.instance=t,this.Hs=!(null==(e=this.instance.persistence)||!e.props[es]),this.rageclicks=new cp(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return dr(this.qt.capture_heatmaps)&&this.qt.capture_heatmaps.flush_interval_milliseconds&&(t=this.qt.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return yr(this.qt.capture_heatmaps)?yr(this.qt.enable_heatmaps)?this.Hs:this.qt.enable_heatmaps:!1!==this.qt.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Rs)return;Lg.info("starting..."),this.Bs(),this.At()}else{var t;clearInterval(null!==(t=this.Us)&&void 0!==t?t:void 0),this.zs(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[es]:e}),this.Hs=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.M;return this.M=void 0,t}Vs(t){this.Mt(t.originalEvent,"deadclick")}At(){this.Us&&clearInterval(this.Us),this.Us="visible"===(null==yn?void 0:yn.visibilityState)?setInterval(this.Zr.bind(this),this.flushIntervalMilliseconds):null}Bs(){pn&&yn&&(this.Ws=this.Zr.bind(this),Un(pn,Ys,this.Ws),this.Zs=t=>this.Mt(t||(null==pn?void 0:pn.event)),Un(yn,"click",this.Zs,{capture:!0}),this.Gs=t=>this.Qs(t||(null==pn?void 0:pn.event)),Un(yn,"mousemove",this.Gs,{capture:!0}),this.Js=new Ip(this.instance,Cp,this.Vs.bind(this)),this.Js.startIfEnabledOrStop(),this.Ks=this.At.bind(this),Un(yn,Ks,this.Ks),this.Rs=!0)}zs(){var t;pn&&yn&&(this.Ws&&pn.removeEventListener(Ys,this.Ws),this.Zs&&yn.removeEventListener("click",this.Zs,{capture:!0}),this.Gs&&yn.removeEventListener("mousemove",this.Gs,{capture:!0}),this.Ks&&yn.removeEventListener(Ks,this.Ks),clearTimeout(this.Ys),null==(t=this.Js)||t.stop(),this.Rs=!1)}Xs(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,r){for(var i=t;i&&ao(i)&&!uo(i,"body");){if(i===r)return!1;if(nr(e,null==pn?void 0:pn.getComputedStyle(i).position))return!0;i=_o(i)}return!1}(mo(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:i),y:t.clientY+(s?0:r),target_fixed:s,type:e}}Mt(t,e){var i;if(void 0===e&&(e="click"),!oo(t.target)&&Ag(t)){var n=this.Xs(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.eo(r({},n,{type:"rageclick"})),this.eo(n)}}Qs(t){!oo(t.target)&&Ag(t)&&(clearTimeout(this.Ys),this.Ys=setTimeout((()=>{this.eo(this.Xs(t,"mousemove"))}),500))}eo(t){if(pn){var e=pn.location.href,r=this.qt.custom_personal_data_properties,i=this.qt.mask_personal_data_properties?[...uc,...r||[]]:[],n=Wn(e,i,hc);this.M=this.M||{},this.M[n]||(this.M[n]=[]),this.M[n].push(t)}}Zr(){this.M&&!vr(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Ip,webVitalsAutocapture:class{constructor(t){var e;this.Hs=!1,this.Rs=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.ro=()=>{clearTimeout(this.io),0!==this.M.metrics.length&&(this._instance.capture("$web_vitals",this.M.metrics.reduce(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=t=>{var e;this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.no();if(!fr(i))if(yr(null==t?void 0:t.name)||yr(null==t?void 0:t.value))Cg.error("Invalid metric received",t);else if(!this.so||this.so>t.value){this.M.url!==i&&(this.ro(),this.io=setTimeout(this.ro,this.flushToCaptureTimeoutMs)),fr(this.M.url)&&(this.M.url=i),this.M.firstMetricTimestamp=fr(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0);var n=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),s=r({},t,{$current_url:i,timestamp:Date.now()});fr(n)||(s.$session_id=n.sessionId,s.$window_id=n.windowId),this.M.metrics.push(s),this.M.metrics.length===this.allowedMetrics.length&&this.ro()}else Cg.error("Ignoring metric with value >= "+this.so,t)},this.oo=()=>{if(!this.Rs){var t,e,r,i,n=Cn.__PosthogExtensions__;fr(n)||fr(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.ht.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.ht.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.ht.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.ht.bind(this)),this.Rs=!0):Cg.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Hs=!(null==(e=this._instance.persistence)||!e.props[ss]),this.startIfEnabled()}get ao(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=dr(this.ao)?null==(t=this.ao)?void 0:t.web_vitals_allowed_metrics:void 0;return yr(r)?(null==(e=this._instance.persistence)?void 0:e.props[us])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(dr(this.ao)?this.ao.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=dr(this.ao)?this.ao.web_vitals_attribution:void 0;return null!=t&&t}get so(){var t=dr(this.ao)&&br(this.ao.__web_vitals_max_value)?this.ao.__web_vitals_max_value:Tg;return t>0&&6e4>=t?Tg:t}get isEnabled(){var t=null==bn?void 0:bn.protocol;if("http:"!==t&&"https:"!==t)return Cg.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=dr(this.ao)?this.ao.web_vitals:wr(this.ao)?this.ao:void 0;return wr(e)?e:this.Hs}startIfEnabled(){this.isEnabled&&!this.Rs&&(Cg.info("enabled, starting..."),this.lr(this.oo))}onRemoteConfig(t){if("capturePerformance"in t){var e=dr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=dr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[ss]:e}),this._instance.persistence.register({[us]:r})),this.Hs=e,this.startIfEnabled()}}lr(t){var e,r;null!=(e=Cn.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks?t():null==(r=Cn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(e=>{e?Cg.error("failed to load script",e):t()}))}no(){var t=pn?pn.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...uc,...e||[]]:[];return Wn(t,r,hc)}Cg.error("Could not determine current URL")}}},am={exceptionObserver:class{constructor(t){var e,r,i;this.oo=()=>{var t;if(pn&&this.isEnabled&&null!=(t=Cn.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=Cn.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=Cn.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=Cn.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.uo&&this.qt.capture_unhandled_errors&&(this.uo=e(this.captureException.bind(this))),!this.lo&&this.qt.capture_unhandled_rejections&&(this.lo=r(this.captureException.bind(this))),!this.ho&&this.qt.capture_console_errors&&(this.ho=i(this.captureException.bind(this)))}catch(t){Sg.error("failed to start",t),this.co()}}},this._instance=t,this.do=!(null==(e=this._instance.persistence)||!e.props[rs]),this.vo=new Mr({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10,refillInterval:1e4,Gt:Sg}),this.qt=this.fo(),this.startIfEnabledOrStop()}fo(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return dr(t)?e=r({},e,t):(fr(t)?this.do:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.qt.capture_console_errors||this.qt.capture_unhandled_errors||this.qt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Sg.info("enabled"),this.co(),this.lr(this.oo)):this.co()}lr(t){var e,r;null!=(e=Cn.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=Cn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Sg.error("failed to load script",e);t()}))}co(){var t,e,r;null==(t=this.uo)||t.call(this),this.uo=void 0,null==(e=this.lo)||e.call(this),this.lo=void 0,null==(r=this.ho)||r.call(this),this.ho=void 0}onRemoteConfig(t){"autocaptureExceptions"in t&&(this.do=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[rs]:this.do}),this.qt=this.fo(),this.startIfEnabledOrStop())}onConfigChange(){this.qt=this.fo()}captureException(t){var e,r,i,n=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.vo.consumeRateLimit(n)?Sg.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,r;this.po=[],this.mo=wf(),this._instance=t,this.po=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(is))&&void 0!==e?e:[],this.yo=dn(this.bo()),this._o=new vn(this.yo)}onConfigChange(){this.yo=dn(this.bo()),this._o.setConfig(this.yo)}onRemoteConfig(t){var e,r,i;if("errorTracking"in t){var n=null!==(e=null==(r=t.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],s=null==(i=t.errorTracking)?void 0:i.captureExtensionExceptions;this.po=n,this._instance.persistence&&this._instance.persistence.register({[is]:this.po,[ns]:s})}}get wo(){var t,e=!!this._instance.get_property(ns),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.mo.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.yo.enabled)try{if(!pr(t)||0===t.trim().length)return void _f.warn("Ignoring exception step because message must be a non-empty string");var i=this.xo(e),{sanitizedProperties:n,droppedKeys:s}=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((r,i)=>hn.has(i)?(e.push(i),r):(r[i]=t[i],r)),{}),droppedKeys:e}}(i);s.length>0&&_f.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this._o.add(r({[un]:t,[ln]:(new Date).toISOString()},n))}catch(t){_f.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.So(e)){if(this.ko(e))return this.Co("Exception dropped: matched a suppression rule"),void _f.info("Skipping exception capture because a suppression rule matched");if(!this.wo&&this.Io(e))return this.Co("Exception dropped: thrown by a browser extension"),void _f.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.To(e))return this.Co("Exception dropped: thrown by the PostHog SDK"),void _f.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.yo.enabled&&yr(t.$exception_steps)?this.Eo(t):t;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",en:!0});return i&&this._o.clear(),i}catch(t){return _f.error("Failed to capture exception event. Dropping this exception.",t),void this._o.clear()}}catch(t){return void _f.error("Failed to process exception event. Ignoring this exception.",t)}}Eo(t){try{var e=this._o.getAttachable();return 0===e.length?t:r({},t,{$exception_steps:e})}catch(e){return _f.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Co(t){this.yo.enabled&&this._o.add({[un]:t,[ln]:(new Date).toISOString()})}xo(t){return dr(t)?r({},t):{}}bo(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}ko(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:r,value:i}=e;return pr(r)&&r.length>0&&t.$exception_types.push(r),pr(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.po.some((t=>{var r=t.values.map((t=>{var r,i=zl[t.operator],n=hr(t.value)?t.value:[t.value],s=null!==(r=e[t.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}Io(t){var e=t.flatMap((t=>{var e,r;return null!==(e=null==(r=t.stacktrace)?void 0:r.frames)&&void 0!==e?e:[]}));return e.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}To(t){if(t.length>0){var e,r,i,n,s=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],o=s[s.length-1];return null!==(i=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}So(t){return!yr(t)&&hr(t)}}},um=r({productTours:class{get ni(){return this._instance.persistence}constructor(t){this.Mo=null,this.Po=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){"productTours"in t&&(this.ni&&this.ni.register({[as]:!!t.productTours}),this.loadIfEnabled())}loadIfEnabled(){var t,e;this.Mo||(t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(as)||this.lr((()=>this.Ro()))}lr(t){var e,r;null!=(e=Cn.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=Cn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?Fg.error("Could not load product tours script",e):t()}))}Ro(){var t;!this.Mo&&null!=(t=Cn.__PosthogExtensions__)&&t.generateProductTours&&(this.Mo=Cn.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!hr(this.Po)||e){var r=this.ni;if(r){var i=r.props[Es];if(hr(i)&&!e)return this.Po=i,void t(i,{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 i=e.statusCode;if(200!==i||!e.json){var n="Product Tours API could not be loaded, status: "+i;return Fg.error(n),void t([],{isLoaded:!1,error:n})}var s=hr(e.json.product_tours)?e.json.product_tours:[];this.Po=s,r&&r.register({[Es]:s}),t(s,{isLoaded:!0})}})}else t(this.Po,{isLoaded:!0})}getActiveProductTours(t){yr(this.Mo)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Mo.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Mo)||e.showTourById(t)}previewTour(t){this.Mo?this.Mo.previewTour(t):this.lr((()=>{var e;this.Ro(),null==(e=this.Mo)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Mo)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Mo)||t.nextStep()}previousStep(){var t;null==(t=this.Mo)||t.previousStep()}clearCache(){var t;this.Po=null,null==(t=this.ni)||t.unregister(Es)}resetTour(t){var e;null==(e=this.Mo)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Mo)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Mo)||e.cancelPendingTour(t)}}},nm),lm={siteApps:class{constructor(t){this._instance=t,this.Oo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Lo(t,e){if(e){var r=this.globalsForEvent(e);this.Oo.push(r),this.Oo.length>1e3&&(this.Oo=this.Oo.slice(10))}}get siteAppLoaders(){var t;return null==(t=Cn._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Lo.bind(this));this.Fo=()=>{t(),this.Oo=[],this.Fo=void 0}}}globalsForEvent(t){var e,n,s,o,a,u,l;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:r({},i(t,Ng),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=t.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(u=t.properties)?void 0:u.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(l=t.properties)?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;!e.errored&&this.Oo.length&&($g.info("Processing "+this.Oo.length+" events for site app with id "+t.id),this.Oo.forEach((t=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(r=this.Fo)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,$g.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:s}=t.init({posthog:this._instance,callback(t){n(t)}});s&&(e.processEvent=s),i=!0}catch(e){$g.error(Dg+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){$g.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}Ao(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}No(t){if(0!==Object.keys(this.apps).length){var e=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(e)}catch(e){$g.error("Error while processing event "+t.event+" for site app "+r.id,e)}}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.Ao(),void this._instance.on("eventCaptured",(t=>this.No(t)))):void $g.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.Fo)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var s=function(t){var e;Cn["__$$ph_site_app_"+t]=n._instance,null==(e=Cn.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return $g.error(Dg+t,e)}))};for(var{id:o,url:a}of t.siteApps)s(o)}else $g.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},hm={tracingHeaders:class{constructor(t){this.$o=void 0,this.Do=void 0,this.oo=()=>{var t,e,r=this.qo()||[];fr(this.$o)&&(null==(t=Cn.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(r,this._instance.get_distinct_id(),this._instance.sessionManager)),fr(this.Do)&&(null==(e=Cn.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(r,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}initialize(){this.startIfEnabledOrStop()}lr(t){var e,r;null!=(e=Cn.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(r=Cn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return kg.error("failed to load script",e);t()}))}qo(){var t;return null!==(t=this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var t,e;this.qo()?this.lr(this.oo):(null==(t=this.$o)||t.call(this),null==(e=this.Do)||e.call(this),this.$o=void 0,this.Do=void 0)}}},cm=r({surveys:class{get qt(){return this._instance.config}constructor(t){this.jo=void 0,this._surveyManager=null,this.Ho=!1,this.Uo=[],this.Bo=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.qt.disable_surveys){var e=t.surveys;if(yr(e))return Lu.warn("Flags not loaded yet. Not loading surveys.");var r=hr(e);this.jo=r?e.length>0:e,Lu.info("flags response received, isSurveysEnabled: "+this.jo),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith($u)||null!=r&&r.startsWith(Du))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.Ho)Lu.info("Already initializing surveys, skipping...");else if(this.qt.disable_surveys)Lu.info(zg);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())Lu.info("Not loading surveys in cookieless mode without consent.");else{var t=null==Cn?void 0:Cn.__PosthogExtensions__;if(t){if(!fr(this.jo)||this.qt.advanced_enable_surveys){var e=this.jo||this.qt.advanced_enable_surveys;this.Ho=!0;try{var r=t.generateSurveys;if(r)return void this.zo(r,e);var i=t.loadExternalDependency;if(!i)return void this.Vo(Vs);i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.Vo("Could not load surveys script",r):this.zo(t.generateSurveys,e)}))}catch(t){throw this.Vo("Error initializing surveys",t),t}finally{this.Ho=!1}}}else Lu.error("PostHog Extensions not found.")}}zo(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Hg(this._instance),Lu.info("Surveys loaded successfully"),this.Wo({isLoaded:!0})}Vo(t,e){Lu.error(t,e),this.Wo({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Uo.push(t),this._surveyManager&&this.Wo({isLoaded:!0}),()=>{this.Uo=this.Uo.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.qt.disable_surveys)return Lu.info(zg),t([]);var r,i=this._instance.get_property(Ts);if(i&&!e)return t(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.Bo?this.Bo.then((e=>{var{surveys:r,context:i}=e;return t(r,i)})):("undefined"!=typeof Promise&&(this.Bo=new Promise((t=>{r=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.qt.token),method:"GET",timeout:this.qt.surveys_request_timeout_ms,callback:e=>{var i;this.Bo=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;Lu.error(s);var o={isLoaded:!1,error:s};return t([],o),void(null==r||r({surveys:[],context:o}))}var a,u=e.json.surveys||[],l=u.filter((t=>Au(t)&&(Fu(t)||Nu(t))));l.length>0&&(null==(a=this._surveyEventReceiver)||a.register(l)),null==(i=this._instance.persistence)||i.register({[Ts]:u});var h={isLoaded:!0};t(u,h),null==r||r({surveys:u,context:h})}}))}Wo(t){for(var e of this.Uo)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Lu.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!yr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Lu.warn("init was not called")}Zo(t){var e=null;return this.getSurveys((r=>{var i;e=null!==(i=r.find((e=>e.id===t)))&&void 0!==i?i:null})),e}Go(t){if(yr(this._surveyManager))return{eligible:!1,reason:Bg};var e="string"==typeof t?this.Zo(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(yr(this._surveyManager))return Lu.warn("init was not called"),{visible:!1,disabledReason:Bg};var e=this.Go(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return yr(this._surveyManager)?(Lu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Bg})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var s=this.Go(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if(yr(this._surveyManager))Lu.warn("init was not called");else{var n="string"==typeof t?this.Zo(t):t;if(null!=n&&n.id)if(Hu.includes(n.type)){var s=null==yn?void 0:yn.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Lu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Lu.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,r),Lu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Lu.warn("Survey element not found")}else Lu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Lu.warn("Survey not found")}}displaySurvey(t,e){var i;if(yr(this._surveyManager))Lu.warn("init was not called");else{var n=this.Zo(t);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==ku.Popover&&e.initialResponses&&Lu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void Lu.warn("Survey is not eligible to be displayed: ",o.disabledReason)}e.displayType!==ku.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Lu.warn("Survey not found")}}cancelPendingSurvey(t){yr(this._surveyManager)?Lu.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}},nm),dm={toolbar:class{constructor(t){this.instance=t}Qo(t){Cn.ph_toolbar_state=t}Jo(){var t;return null!==(t=Cn.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),Hn(this.instance.config))return!1;if(!pn||!yn)return!1;t=null!=t?t:pn.location,r=null!=r?r:pn.history;try{if(!e){try{pn.localStorage.setItem("test","test"),pn.localStorage.removeItem("test")}catch(t){return!1}e=null==pn?void 0:pn.localStorage}var i,n=Vg||Zn(t.hash,"__posthog")||Zn(t.hash,"state"),s=n?Nn((()=>JSON.parse(atob(decodeURIComponent(n)))))||Nn((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?t.hash=s.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(Wg)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(t){return!1}}Ko(t){var e=Cn.ph_load_toolbar||Cn.ph_load_editor;!yr(e)&&cr(e)?e(t,this.instance):Zg.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==yn||!yn.getElementById(js));if(!pn||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(pn.localStorage.setItem(Wg,JSON.stringify(r({},n,{source:void 0}))),2===this.Jo())this.Ko(n);else if(0===this.Jo()){var s;this.Qo(1),null==(s=Cn.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Zg.error("[Toolbar] Failed to load",t),void this.Qo(0);this.Qo(2),this.Ko(n)})),Un(pn,"turbolinks:load",(()=>{this.Qo(0),this.loadToolbar(n)}))}return!0}Yo(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}},vm=r({experiments:em},nm),fm={conversations:class{constructor(t){this.Xo=void 0,this._conversationsManager=null,this.ea=!1,this.ta=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;yr(e)||(wr(e)?this.Xo=e:(this.Xo=e.enabled,this.ta=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Xo=void 0,this.ta=null}loadIfEnabled(){if(!(this._conversationsManager||this.ea||this._instance.config.disable_conversations||Hn(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==Cn?void 0:Cn.__PosthogExtensions__;if(t&&!fr(this.Xo)&&this.Xo)if(this.ta&&this.ta.token){this.ea=!0;try{var e=t.initConversations;if(e)return this.ra(e),void(this.ea=!1);var r=t.loadExternalDependency;if(!r)return void this.ia(Vs);r(this._instance,"conversations",(e=>{e||!t.initConversations?this.ia("Could not load conversations script",e):this.ra(t.initConversations),this.ea=!1}))}catch(t){this.ia("Error initializing conversations",t),this.ea=!1}}else rm.error("Conversations enabled but missing token in remote config.")}}ra(t){if(this.ta)try{this._conversationsManager=t(this.ta,this._instance),rm.info("Conversations loaded successfully")}catch(t){this.ia("Error completing conversations initialization",t)}else rm.error("Cannot complete initialization: remote config is null")}ia(t,e){rm.error(t,e),this._conversationsManager=null,this.ea=!1}show(){this._conversationsManager?this._conversationsManager.show():rm.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Xo&&!mr(this._conversationsManager)}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,r,i){var n=this;return e((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,r,i):(rm.warn(im),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(rm.warn(im),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(rm.warn(im),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(rm.warn(im),null)}))()}requestRestoreLink(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(t):(rm.warn(im),null)}))()}restoreFromToken(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(t):(rm.warn(im),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(rm.warn(im),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}ln(){var t;null==(t=this._conversationsManager)||t.setIdentity()}hn(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},pm={logs:class{constructor(t){var e;this.na=!1,this.sa=!1,this.Gt=On("[logs]"),this.oa=[],this.aa=0,this.ua=0,this.la=!1,this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.na=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e,r=null==(e=t.logs)?void 0:e.captureConsoleLogs;!yr(r)&&r&&(this.na=!0,this.loadIfEnabled())}reset(){this.oa=[],this.qr&&(clearTimeout(this.qr),this.qr=void 0),this.aa=0,this.ua=0,this.la=!1}loadIfEnabled(){if(this.na&&!this.sa){var t=null==Cn?void 0:Cn.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(e=>{var r;e||null==(r=t.logs)||!r.initializeLogs?this.Gt.error("Could not load logs script",e):(t.logs.initializeLogs(this._instance),this.sa=!0)})):this.Gt.error(Vs)}else this.Gt.error("PostHog Extensions not found.")}}captureLog(t){var e,i,n,s,o,a;if(this._instance.is_capturing())if(t&&t.body){var u=null!==(e=null==(i=this._instance.config.logs)?void 0:i.flushIntervalMs)&&void 0!==e?e:3e3,l=null!==(n=null==(s=this._instance.config.logs)?void 0:s.maxLogsPerInterval)&&void 0!==n?n:1e3,h=Date.now();if(u>h-this.ua||(this.ua=h,this.aa=0,this.la=!1),l>this.aa){this.aa++;var c=function(t,e){var i=t.level||"info",{text:n,number:s}=Oi[i]||Pi,o=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var u=r({},a,t.attributes||{}),l={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:t.body},attributes:Ai(u)};return t.trace_id&&(l.traceId=t.trace_id),t.span_id&&(l.spanId=t.span_id),fr(t.trace_flags)||(l.flags=t.trace_flags),l}(t,this.ha());this.oa.push({record:c}),(null!==(o=null==(a=this._instance.config.logs)?void 0:a.maxBufferSize)&&void 0!==o?o:100)>this.oa.length?this.ca():this.flushLogs()}else this.la||(this.Gt.warn("captureLog dropping logs: exceeded "+l+" logs per "+u+"ms"),this.la=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.da||(this.da={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.da}flushLogs(t){if(this.qr&&(clearTimeout(this.qr),this.qr=void 0),0!==this.oa.length){var e=this.oa;this.oa=[];var i=this._instance.config.logs,n=r({"service.name":(null==i?void 0:i.serviceName)||"unknown_service"},(null==i?void 0:i.environment)&&{"deployment.environment":i.environment},(null==i?void 0:i.serviceVersion)&&{"service.version":i.serviceVersion},null==i?void 0:i.resourceAttributes),s=function(t,e,r,i){return{resourceLogs:[{resource:{attributes:Ai(e)},scopeLogs:[{scope:{name:r,version:i},logRecords:t}]}]}}(e.map((t=>t.record)),n,En.LIB_NAME,En.LIB_VERSION),o=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.Bi({method:"POST",url:o,data:s,compression:"best-available",batchKey:"logs",transport:t})}}ca(){var t,e;this.qr||(this.qr=setTimeout((()=>{this.qr=void 0,this.flushLogs()}),null!==(t=null==(e=this._instance.config.logs)?void 0:e.flushIntervalMs)&&void 0!==t?t:3e3))}ha(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:r}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);e.sessionId=r}if(null!=Cn&&null!=(t=Cn.location)&&t.href&&(e.currentUrl=Cn.location.href),this._instance.featureFlags){var i=this._instance.featureFlags.getFlags();i&&i.length>0&&(e.activeFeatureFlags=i)}return e}}},gm=r({},nm,sm,om,am,um,lm,cm,hm,dm,vm,fm,pm);xg.__defaultExtensionClasses=r({},gm);var mm,ym=(mm=lg[gg]=new xg,function(){function t(){t.done||(t.done=!0,mg=!1,Ln(lg,(function(t){t._dom_loaded()})))}null!=yn&&yn.addEventListener?"complete"===yn.readyState?t():Un(yn,"DOMContentLoaded",t,{capture:!1}):pn&&Mn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),mm);export{Yu as Compression,$p as DEFAULT_PRODUCT_TOUR_APPEARANCE,ku as DisplaySurveyType,xg as PostHog,Dp as ProductTourEventName,qp as ProductTourEventProperties,xu as SurveyEventName,Su as SurveyEventProperties,fu as SurveyEventType,gu as SurveyPosition,_u as SurveyQuestionBranchingType,bu as SurveyQuestionType,wu as SurveySchedule,mu as SurveyTabPosition,yu as SurveyType,pu as SurveyWidgetType,ym as default,ym as posthog,Ku as severityLevels};
1
+ function t(t,e,r,i,n,s,o){try{var a=t[s](o),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=e.apply(r,i);function a(e){t(o,n,s,a,u,"next",e)}function u(e){t(o,n,s,a,u,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),u=(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))(u||{}),l=(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))(l||{}),h=(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))(h||{}),c=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(c||{}),d=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(d||{}),v=(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))(v||{}),f=(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))(f||{}),p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},g={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},m={};function y(t){if(m[t])return m[t];var e=function(t){var e,r,i=null==(r=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in p?p[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in g?g[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return m[t]=e.prototype,e.prototype;var a=document.createElement("iframe");try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return l?m[t]=l:r}catch(t){return r}finally{a.parentNode&&document.body.removeChild(a)}}var b={};function _(t,e,r){var i,n=t+"."+String(r);if(b[n])return b[n].call(e);var s=y(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(b[n]=o,o.call(e)):e[r]}var w={};function x(t,e,r){var i=t+"."+String(r);if(w[i])return w[i].bind(e);var n=y(t)[r];return"function"!=typeof n?e[r]:(w[i]=n,n.bind(e))}function S(){return y("MutationObserver").constructor}function k(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}var C={childNodes:t=>_("Node",t,"childNodes"),parentNode:t=>_("Node",t,"parentNode"),parentElement:t=>_("Node",t,"parentElement"),textContent:t=>_("Node",t,"textContent"),contains:(t,e)=>x("Node",t,"contains")(e),getRootNode:t=>x("Node",t,"getRootNode")(),host:t=>t&&"host"in t?_("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?_("Element",t,"shadowRoot"):null,querySelector:(t,e)=>x("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>x("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:k};function T(t){return t.nodeType===t.ELEMENT_NODE}function I(t){var e=t&&"host"in t&&"mode"in t&&C.host(t)||null;return Boolean(e&&"shadowRoot"in e&&C.shadowRoot(e)===t)}function E(t){return"[object ShadowRoot]"==={}.toString.call(t)}function R(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=t.href;return!r&&t.ownerNode&&(r=t.ownerNode.baseURI),(i=Array.from(e,(t=>M(t,r))).join("")).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function M(t,e){var r;if(function(t){return"styleSheet"in t}(t)){var i;try{i=R(t.styleSheet)||function(t){var{cssText:e}=t;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){i=t.cssText}try{if(i&&(null==(r=t.styleSheet)?void 0:r.href))return U(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?U(n,e):n}class O{constructor(){a(this,"idNodeMap",new Map),a(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-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);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),T(t)){var r=C.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function P(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=t,a=s||"",u=n&&L(n);return(r[i.toLowerCase()]||u&&r[u])&&(a=o?o(a,e):"*".repeat(a.length)),a}function L(t){return t.toLowerCase()}var A="__rrweb_original__";function N(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?L(e):null}var F=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,D=/^(?:[a-z+]+:)?\/\//i,q=/^www\..*/i,j=/^(data:)([^,]*),(.*)/i;function U(t,e){return(t||"").replace(F,((t,r,i,n,s,o)=>{var a,u=i||s||o,l=r||n||"";if(!u)return t;if(D.test(u)||q.test(u))return"url("+l+u+l+")";if(j.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var H,B,z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",V=4096,W=1,Z=new RegExp("[^a-z0-9-_:]"),G=-2;function Q(){return W++}var J=/^[^ \t\n\r\u000c]+/,K=/^[, \t\n\r\u000c]+/,Y=new WeakMap;function X(t,e){return e&&""!==e.trim()?tt(t,e):e}function tt(t,e){var r=Y.get(t);if(r||(r=t.createElement("a"),Y.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function et(t,e,r,i,n,s){var o,a,u;if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var l=null==(o=n.sheet)?void 0:o.href;if(l)return l}var h=X(t,i);if("img"===e&&h.startsWith("data:")&&n){var c=h;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(c=function(t,e,r,i){if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>V||t.naturalHeight>V)return e;try{var n=document.createElement("canvas");n.width=t.naturalWidth,n.height=t.naturalHeight;var s=n.getContext("2d");return s?(s.drawImage(t,0,0),n.toDataURL(r||"image/webp",null!=i?i:.4)):e}catch(t){return e}}(n,h,s.type,s.quality)),(null==s?void 0:s.maxBase64ImageLength)&&(a=c,c=(u=s.maxBase64ImageLength)&&a.length>u?z:a),c}return h}return"xlink:href"===r&&"#"!==i[0]?X(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(K),e.length>r;){var s=i(J);if(","===s.slice(-1))s=X(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=X(t,s);for(var a=!1;;){var u=e.charAt(r);if(""===u){n.push((s+o).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,n.push((s+o).trim());break}"("===u&&(a=!0)}o+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?U(i,tt(t)):"object"===e&&"data"===r?X(t,i):i:X(t,i)}function rt(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function it(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&it(C.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&it(C.parentNode(t),e,r)}function nt(t,e,r,i){var n;if(T(t)){if(!C.childNodes(n=t).length)return!1}else{if(null===C.parentElement(t))return!1;n=C.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(it(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}var st=new Map;function ot(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function at(t){return null==t?"":t.toLowerCase()}var ut=50,lt=!1,ht=!1;function ct(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:h={},maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:S=(()=>!1),newlyAddedElement:k=!1,depth:M=0,maxDepth:O=ut}=e,{needsMask:F}=e,{preserveWhiteSpace:D=!0}=e;if(M>=O)return ht=!0,lt||(lt=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+O+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;F||(F=nt(t,o,a,void 0===F));var q,j=function(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:o,inlineStylesheet:a,maskInputOptions:u={},maskTextFn:l,maskInputFn:h,dataURLOptions:c={},inlineImages:d,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:g=!1}=e,m=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,i);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:f.Document,childNodes:[],compatMode:t.compatMode}:{type:f.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:f.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:m};case t.ELEMENT_NODE:return function(t,e){for(var r,i,n,{doc:s,blockClass:o,blockSelector:a,inlineStylesheet:u,maskInputOptions:l={},maskInputFn:h,dataURLOptions:c={},inlineImages:d,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:g=!1,rootId:m}=e,y=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,o,a),b=function(t){if(t instanceof HTMLFormElement)return"form";var e=L(t.tagName);return Z.test(e)?"div":e}(t),_={},w=t.attributes.length,x=0;w>x;x++){var S=t.attributes[x];rt(b,S.name)||(_[S.name]=et(s,b,L(S.name),S.value,t,c))}if("link"===b&&u){var k=t.sheet;if(!k){var T=function(t){return t.href}(t);T&&!(k=ot(s,T))&&T.includes(".css")&&(k=ot(s,window.location.origin+"/"+T.replace(window.location.href,"")))}var I=null;k&&(I=R(k)),I&&(delete _.rel,delete _.href,_._cssText=I)}if("style"===b&&t.sheet&&!(t.innerText||C.textContent(t)||"").trim().length){var E=R(t.sheet);E&&(_._cssText=E)}if("input"===b||"textarea"===b||"select"===b){var M=t.value,O=t.checked;"radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&M?_.value=P({element:t,type:N(t),tagName:b,value:M,maskInputOptions:l,maskInputFn:h}):O&&(_.checked=O)}if("option"===b&&(t.selected&&!l.select?_.selected=!0:delete _.selected),"dialog"===b&&t.open)try{_.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){_.rr_open_mode="modal",_.ph_rr_could_not_detect_modal=!0}if("canvas"===b&&v)if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((A in n?n[A]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(_.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var F=t.toDataURL(c.type,c.quality),D=s.createElement("canvas");D.width=t.width,D.height=t.height,F!==D.toDataURL(c.type,c.quality)&&(_.rr_dataURL=F)}if("img"===b&&d){H||(H=s.createElement("canvas"),B=H.getContext("2d"));var q=t,j=q.currentSrc||q.getAttribute("src")||"<unknown-src>",U=q.crossOrigin,z=()=>{q.removeEventListener("load",z);try{H.width=q.naturalWidth,H.height=q.naturalHeight,B.drawImage(q,0,0),_.rr_dataURL=H.toDataURL(c.type,c.quality)}catch(t){if("anonymous"!==q.crossOrigin)return q.crossOrigin="anonymous",void(q.complete&&0!==q.naturalWidth?z():q.addEventListener("load",z));console.warn("Cannot inline img src="+j+"! Error: "+t)}"anonymous"===q.crossOrigin&&(U?_.crossOrigin=U:q.removeAttribute("crossorigin"))};q.complete&&0!==q.naturalWidth?z():q.addEventListener("load",z)}if("audio"===b||"video"===b){var V=_;V.rr_mediaState=t.paused?"paused":"played",V.rr_mediaCurrentTime=t.currentTime,V.rr_mediaPlaybackRate=t.playbackRate,V.rr_mediaMuted=t.muted,V.rr_mediaLoop=t.loop,V.rr_mediaVolume=t.volume}if(g||(t.scrollLeft&&(_.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(_.rr_scrollTop=t.scrollTop)),y){var{width:W,height:G,left:Q,top:J}=t.getBoundingClientRect();_={class:_.class,rr_width:W+"px",rr_height:G+"px",rr_left:Math.floor(Q+((null==(r=s.defaultView)?void 0:r.scrollX)||0))+"px",rr_top:Math.floor(J+((null==(i=s.defaultView)?void 0:i.scrollY)||0))+"px"}}"iframe"!==b||p(_.src)||(t.contentDocument||(_.rr_src=_.src),delete _.src);try{customElements.get(b)&&(n=!0)}catch(t){}return{type:f.Element,tagName:b,attributes:_,childNodes:[],isSVG:(K=t,Boolean("svg"===K.tagName||K.ownerSVGElement)||void 0),needBlock:y,rootId:m,isCustom:n};var K}(t,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,dataURLOptions:c,inlineImages:d,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:s}=e,o=C.parentNode(t),a=o&&o.tagName,u=C.textContent(t),l="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(l&&u){try{if(t.nextSibling||t.previousSibling);else if(null==(r=o.sheet)?void 0:r.cssRules){var c=R(o.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(u=c)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=U(u,tt(e.doc))}return h&&(u="SCRIPT_PLACEHOLDER"),!l&&!h&&u&&i&&(u=n?n(u,C.parentElement(t)):u.replace(/[\S]/g,"*")),{type:f.Text,textContent:u||"",isStyle:l,rootId:s}}(t,{doc:r,needsMask:o,maskTextFn:l,rootId:m});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:f.Comment,textContent:C.textContent(t)||"",rootId:m};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:F,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:S,newlyAddedElement:k});if(!j)return console.warn(t,"not serialized"),null;q=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===f.Comment)return!0;if(t.type===f.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(at(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===at(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(at(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&at(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(at(t.attributes.property).match(/^(og|twitter|fb):/)||at(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===at(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(at(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(at(t.attributes.name))||at(t.attributes.property).match(/^article:/)||at(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(at(t.attributes.name)))return!0}}return!1}(j,v)||!D&&j.type===f.Text&&!j.isStyle&&!j.textContent.replace(/^\s+|\s+$/gm,"").length?G:Q();var z=Object.assign(j,{id:q});if(i.add(t,z),q===G)return null;y&&y(t);var V=!u;if(z.type===f.Element){V=V&&!z.needBlock,delete z.needBlock;var W=C.shadowRoot(t);W&&E(W)&&(z.isShadowHost=!0)}if((z.type===f.Document||z.type===f.Element)&&V){v.headWhitespace&&z.type===f.Element&&"head"===z.tagName&&(D=!1);var J={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:F,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:D,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:S,depth:M+1,maxDepth:O};if(z.type===f.Element&&"textarea"===z.tagName&&void 0!==z.attributes.value);else for(var K of Array.from(C.childNodes(t))){var Y=ct(K,J);Y&&z.childNodes.push(Y)}var X=null;if(T(t)&&(X=C.shadowRoot(t)))for(var it of Array.from(C.childNodes(X))){var dt=ct(it,J);dt&&(E(X)&&(dt.isShadow=!0),z.childNodes.push(dt))}}var vt=C.parentNode(t);return vt&&I(vt)&&E(vt)&&(z.isShadow=!0),z.type===f.Element&&"iframe"===z.tagName&&function(t,e,r){var i=t.contentWindow;if(i){var n,s=!1;try{n=i.document.readyState}catch(t){return}if("complete"===n){var o="about:blank";if(i.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)}),r);t.addEventListener("load",(()=>{clearTimeout(a),s=!0,e()}))}}}(t,(()=>{var e=t.contentDocument;if(e&&b){var r=ct(e,{doc:e,mirror:i,blockClass:n,blockSelector:s,needsMask:F,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:D,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:S,depth:M+1,maxDepth:O});r&&b(t,r)}}),_),z.type===f.Element&&"link"===z.tagName&&"stylesheet"===z.attributes.rel&&function(e,u,f){if(!st.has(e)){var k;try{k=e.sheet}catch(t){return}if(!k){var C=new AbortController,T=!1,I=()=>{if(!T){T=!0;try{(()=>{if(w){var e=ct(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:F,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:D,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:S,depth:M,maxDepth:O});e&&w(t,e)}})()}finally{st.delete(e),C.abort()}}},E=setTimeout(I,f);C.signal.addEventListener("abort",(()=>clearTimeout(E)),{once:!0}),e.addEventListener("load",I,{signal:C.signal,once:!0}),st.set(e,C)}}}(t,0,x),z}function dt(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}class vt{constructor(){a(this,"parentElement",null),a(this,"parentNode",null),a(this,"ownerDocument"),a(this,"firstChild",null),a(this,"lastChild",null),a(this,"previousSibling",null),a(this,"nextSibling",null),a(this,"ELEMENT_NODE",1),a(this,"TEXT_NODE",3),a(this,"nodeType"),a(this,"nodeName"),a(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof vt))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"}}function ft(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}function pt(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var gt="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.",mt={map:{},getId(){return console.error(gt),-1},getNode(){return console.error(gt),null},removeNodeFromMap(){console.error(gt)},has(){return console.error(gt),!1},reset(){console.error(gt)}};function yt(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;s>a;a++)o[a]=arguments[a];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;0>=l||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,o)):i||!1===r.trailing||(i=setTimeout((()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,o)}),l))}}function bt(t,e,r,i,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){setTimeout((()=>{r.set.call(this,t)}),0),s&&s.set&&s.set.call(this,t)}}),()=>bt(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(mt=new Proxy(mt,{get(t,e,r){return"map"===e&&console.error(gt),Reflect.get(t,e,r)}}));var _t=Date.now;function wt(t){var e,r,i,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=C.parentElement(s.body))?void 0:e.scrollLeft)||(null==(r=null==s?void 0:s.body)?void 0:r.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==(i=C.parentElement(s.body))?void 0:i.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function xt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function St(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function kt(t){return t?t.nodeType===t.ELEMENT_NODE?t:C.parentElement(t):null}function Ct(t,e,r,i){if(!t)return!1;var n=kt(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(it(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Tt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===G}function It(t,e){if(I(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=C.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||It(i,e))}function Et(t){return Boolean(t.changedTouches)}function Rt(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 Ot(t){return!!t&&(t instanceof vt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(C.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(_t=()=>(new Date).getTime());class Pt{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):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}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 Lt(t){var e,r=null;return"getRootNode"in t&&(null==(e=C.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(t))&&(r=C.host(C.getRootNode(t))),r}function At(t){var e=t.ownerDocument;return!!e&&(C.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Lt(r);)r=e;return r}(t);return C.contains(e,r)}(t))}function Nt(t){return"__ln"in t}class Ft{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,r=0;t>r;r++)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&&Nt(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Nt(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.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 $t,Dt=(t,e)=>t+"@"+e;class qt{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,"removesSubTreeCache",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,r=new Ft,i=t=>{for(var e=t,r=G;r===G;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=C.parentNode(n);if(s&&At(n)&&"TEXTAREA"!==s.tagName){var o=I(s)?this.mirror.getId(Lt(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var u=ct(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=>{Rt(t,this.mirror)&&this.iframeManager.addIframe(t),Mt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Ot(n)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:o,nextId:a,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Ut(this.removesSubTreeCache,s)&&!this.movedSet.has(C.parentNode(s))||n(s);for(var o of this.addedSet)Ht(this.droppedSet,o)||Ut(this.removesSubTreeCache,o)?Ht(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(C.parentNode(a.value)),h=i(a.value);-1!==l&&-1!==h&&(u=a)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(C.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=C.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=C.host(f);if(-1!==this.mirror.getId(p)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),n(u.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=C.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{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 r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).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};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))}})),a(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(C.childNodes(t),(t=>C.textContent(t)||"")).join("");e.attributes.value=P({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:N(t),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(t=>{if(!Tt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=C.textContent(t.target);Ct(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:nt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,kt(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=N(r);n=P({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Ct(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!rt(r.tagName,i))if(o.attributes[i]=et(this.doc,L(r.tagName),L(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),h=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||h!==a.style.getPropertyPriority(u)?o.styleDiff[u]=""===h?l:[l,h]:o._unchangedStyles[u]=[l,h]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(o.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ct(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 r=this.mirror.getId(e),i=I(t.target)?this.mirror.getId(C.host(t.target)):this.mirror.getId(t.target);Ct(t.target,this.blockClass,this.blockSelector,!1)||Tt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(jt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||It(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Dt(r,i)]?jt(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!I(t.target)||!E(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),C.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),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(Tt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[Dt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ct(t,this.blockClass,this.blockSelector,!1)||(C.childNodes(t).forEach((t=>this.genAdds(t))),Ot(t)&&C.childNodes(C.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()}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}}function jt(t,e){t.delete(e),C.childNodes(e).forEach((e=>jt(t,e)))}function Ut(t,e,r){return 0!==t.size&&function(t,e,r){var i=C.parentNode(e);return!!i&&t.has(i)}(t,e)}function Ht(t,e){return 0!==t.size&&Bt(t,e)}function Bt(t,e){var r=C.parentNode(e);return!!r&&(!!t.has(r)||Bt(t,r))}var zt=t=>$t?function(){try{return t(...arguments)}catch(t){if($t&&!0===$t(t))return;throw t}}:t,Vt=[];function Wt(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 Zt(t,e){var r=new qt;Vt.push(r),r.init(t);var i=new(S())(zt(r.processMutations.bind(r)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{observer:i,buffer:r}}function Gt(t){var{scrollCb:e,doc:r,mirror:i,blockClass:n,blockSelector:s,sampling:o}=t;return ft("scroll",zt(yt(zt((t=>{var o=Wt(t);if(o&&!Ct(o,n,s,!0)){var a=i.getId(o);if(o===r&&r.defaultView){var u=wt(r.defaultView);e({id:a,x:u.left,y:u.top})}else e({id:a,x:o.scrollLeft,y:o.scrollTop})}})),o.scroll||100)),r)}var Qt=["INPUT","TEXTAREA","SELECT"],Jt=new WeakMap;function Kt(t){return function t(e,r){if(ee("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ee("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ee("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ee("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function Yt(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function Xt(t,e){var r,i,n,s,{mirror:o,stylesheetManager:a}=t;s=o.getId("#document"===e.nodeName?e:C.host(e));var u="#document"===e.nodeName?null==(r=e.defaultView)?void 0:r.Document:null==(n=null==(i=e.ownerDocument)?void 0:i.defaultView)?void 0:n.ShadowRoot,l=(null==u?void 0:u.prototype)?Object.getOwnPropertyDescriptor(null==u?void 0:u.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&u&&l?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var e,r=null==(e=l.set)?void 0:e.call(this,t);if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return r}}),zt((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function te(t,e){void 0===e&&(e={});var i,n,s=t.doc.defaultView;if(!s)return()=>{};if(function(t,e){var{mutationCb:r,mousemoveCb:i,mouseInteractionCb:n,scrollCb:s,viewportResizeCb:o,inputCb:a,mediaInteractionCb:u,styleSheetRuleCb:l,styleDeclarationCb:h,canvasMutationCb:c,fontCb:d,selectionCb:v,customElementCb:f}=t;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...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),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...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){var o=Zt(t,t.doc);i=o.observer,n=o.buffer}var a=function(t){var{mousemoveCb:e,sampling:r,doc:i,mirror:n}=t;if(!1===r.mousemove)return()=>{};var s,o="number"==typeof r.mousemove?r.mousemove:50,a="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],h=yt(zt((t=>{var r=Date.now()-s;e(u.map((t=>(t.timeOffset-=r,t))),t),u=[],s=null})),a),c=zt(yt(zt((t=>{var e=Wt(t),{clientX:r,clientY:i}=Et(t)?t.changedTouches[0]:t;s||(s=_t()),u.push({x:r,y:i,id:n.getId(e),timeOffset:_t()-s}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?l.Drag:t instanceof MouseEvent?l.MouseMove:l.TouchMove)})),o,{trailing:!1})),d=[ft("mousemove",c,i),ft("touchmove",c,i),ft("drag",c,i)];return zt((()=>{d.forEach((t=>t()))}))}(t),u=function(t){var{mouseInteractionCb:e,doc:i,mirror:n,blockClass:s,blockSelector:o,sampling:a}=t;if(!1===a.mouseInteraction)return()=>{};var u=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],d=null;return Object.keys(h).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==u[t])).forEach((t=>{var a=L(t),u=(t=>i=>{var a=Wt(i);if(!Ct(a,s,o,!0)){var u=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":u=c.Mouse;break;case"touch":u=c.Touch;break;case"pen":u=c.Pen}u===c.Touch&&(h[t]===h.MouseDown?l="TouchStart":h[t]===h.MouseUp&&(l="TouchEnd"))}else Et(i)&&(u=c.Touch);null!==u?(d=u,(l.startsWith("Touch")&&u===c.Touch||l.startsWith("Mouse")&&u===c.Mouse)&&(u=null)):h[t]===h.Click&&(u=d,d=null);var v=Et(i)?i.changedTouches[0]:i;if(v){var f=n.getId(a),{clientX:p,clientY:g}=v;zt(e)(r({type:h[l],id:f,x:p,y:g},null!==u&&{pointerType:u}))}}})(t);if(window.PointerEvent)switch(h[t]){case h.MouseDown:case h.MouseUp:a=a.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}l.push(ft(a,u,i))})),zt((()=>{l.forEach((t=>t()))}))}(t),d=Gt(t),f=function(t,e){var{viewportResizeCb:r}=t,{win:i}=e,n=-1,s=-1;return ft("resize",zt(yt(zt((()=>{var t=xt(),e=St();n===t&&s===e||(r({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),i)}(t,{win:s}),p=function(t){var{inputCb:e,doc:i,mirror:n,blockClass:s,blockSelector:o,ignoreClass:a,ignoreSelector:u,maskInputOptions:l,maskInputFn:h,sampling:c,userTriggeredOnInput:d}=t;function v(t){var e=Wt(t),r=t.isTrusted,n=e&&e.tagName;if(e&&"OPTION"===n&&(e=C.parentElement(e)),e&&n&&Qt.indexOf(n)>=0&&!Ct(e,s,o,!0)&&!(e.classList.contains(a)||u&&e.matches(u))){var c=e.value,v=!1,p=N(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(l[n.toLowerCase()]||l[p])&&(c=P({element:e,maskInputOptions:l,tagName:n,type:p,value:c,maskInputFn:h})),f(e,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=e.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,i){var s=Jt.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){Jt.set(t,i);var o=n.getId(t);zt(e)(r({},i,{id:o}))}}var p=("last"===c.input?["change"]:["input","change"]).map((t=>ft(t,zt(v),i))),g=i.defaultView;if(!g)return()=>{p.forEach((t=>t()))};var m=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value");return m&&m.set&&p.push(...[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]].map((t=>bt(t[0],t[1],{set(){zt(v)({target:this,isTrusted:!1})}},!1,g)))),zt((()=>{p.forEach((t=>t()))}))}(t),g=function(t){var{mediaInteractionCb:e,blockClass:r,blockSelector:i,mirror:n,sampling:s,doc:o}=t,a=zt((t=>yt(zt((s=>{var o=Wt(s);if(o&&!Ct(o,r,i,!0)){var{currentTime:a,volume:u,muted:l,playbackRate:h,loop:c}=o;e({type:t,id:n.getId(o),currentTime:a,volume:u,muted:l,playbackRate:h,loop:c})}})),s.media||500))),u=[ft("play",a(v.Play),o),ft("pause",a(v.Pause),o),ft("seeked",a(v.Seeked),o),ft("volumechange",a(v.VolumeChange),o),ft("ratechange",a(v.RateChange),o)];return zt((()=>{u.forEach((t=>t()))}))}(t),m=()=>{},y=()=>{},b=()=>{},_=()=>{};t.recordDOM&&(m=function(t,e){var{styleSheetRuleCb:r,mirror:i,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:zt(((t,e,s)=>{var[o,a]=s,{id:u,styleId:l}=Yt(e,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var a,u,l=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:zt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=Yt(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,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:zt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=Yt(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replace:o}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:zt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=Yt(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:o}),t.apply(e,s)}))}));var h={};re("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(re("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),re("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),re("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:zt(((t,e,s)=>{var[o,a]=s,{id:u,styleId:l}=Yt(e.parentStyleSheet,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:[...Kt(e),a||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(c[e].deleteRule,{apply:zt(((t,e,s)=>{var[o]=s,{id:a,styleId:u}=Yt(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...Kt(e),o]}]}),t.apply(e,s)}))})})),zt((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=l,a&&(s.CSSStyleSheet.prototype.replace=a),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(h).forEach((t=>{var[e,r]=t;r.prototype.insertRule=c[e].insertRule,r.prototype.deleteRule=c[e].deleteRule}))}))}(t,{win:s}),y=Xt(t,t.doc),b=function(t,e){var{styleDeclarationCb:r,mirror:i,ignoreCSSAttributes:n,stylesheetManager:s}=t,{win:o}=e,a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:zt(((t,e,o)=>{var u,[l,h,c]=o;if(n.has(l))return a.apply(e,[l,h,c]);var{id:d,styleId:v}=Yt(null==(u=e.parentRule)?void 0:u.parentStyleSheet,i,s.styleMirror);return(d&&-1!==d||v&&-1!==v)&&r({id:d,styleId:v,set:{property:l,value:h,priority:c},index:Kt(e.parentRule)}),t.apply(e,o)}))});var u=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:zt(((t,e,o)=>{var a,[l]=o;if(n.has(l))return u.apply(e,[l]);var{id:h,styleId:c}=Yt(null==(a=e.parentRule)?void 0:a.parentStyleSheet,i,s.styleMirror);return(h&&-1!==h||c&&-1!==c)&&r({id:h,styleId:c,remove:{property:l},index:Kt(e.parentRule)}),t.apply(e,o)}))}),zt((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=u}))}(t,{win:s}),t.collectFonts&&(_=function(t){var{fontCb:e,doc:r}=t,i=r.defaultView;if(!i)return()=>{};var n=[],s=new WeakMap,o=i.FontFace;i.FontFace=function(t,e,r){var i=new o(t,e,r);return s.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var a=k(r.fonts,"add",(function(t){return function(r){return setTimeout(zt((()=>{var t=s.get(r);t&&(e(t),s.delete(r))})),0),t.apply(this,[r])}}));return n.push((()=>{i.FontFace=o})),n.push(a),zt((()=>{n.forEach((t=>t()))}))}(t)));var w=function(t){var{doc:e,mirror:r,blockClass:i,blockSelector:n,selectionCb:s}=t,o=!0,a=zt((()=>{var t=e.getSelection();if(!(!t||o&&(null==t?void 0:t.isCollapsed))){o=t.isCollapsed||!1;for(var a=[],u=t.rangeCount||0,l=0;u>l;l++){var h=t.getRangeAt(l),{startContainer:c,startOffset:d,endContainer:v,endOffset:f}=h;Ct(c,i,n,!0)||Ct(v,i,n,!0)||a.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}s({ranges:a})}}));return a(),ft("selectionchange",a)}(t),x=function(t){var{doc:e,customElementCb:r}=t,i=e.defaultView;return i&&i.customElements?k(i.customElements,"define",(function(t){return function(e,i,n){try{r({define:{name:e}})}catch(t){console.warn("Custom element callback failed for "+e)}return t.apply(this,[e,i,n])}})):()=>{}}(t),S=[];for(var T of t.plugins)S.push(T.observer(T.callback,s,T.options));return zt((()=>{if(n){n.destroy(),n.reset();var t=Vt.indexOf(n);-1!==t&&Vt.splice(t,1)}null==i||i.disconnect(),a(),u(),d(),f(),p(),g(),m(),y(),b(),_(),w(),x(),S.forEach((t=>t()))}))}function ee(t){return void 0!==window[t]}function re(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ie{constructor(t){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){var n=r||this.getIdToRemoteIdMap(t),s=i||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 r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,r,i)))}getRemoteId(t,e,r){var i=r||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:i.get(e)||-1}getRemoteIds(t,e){var r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,r)))}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||this.iframeIdToRemoteIdMap.set(t,e=new Map),e}getRemoteIdToIdMap(t){var e=this.iframeRemoteIdToIdMap.get(t);return e||this.iframeRemoteIdToIdMap.set(t,e=new Map),e}}class ne{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ie(Q)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"pageHideListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),a(this,"messageHandler"),a(this,"nestedIframeListeners",new Map),a(this,"attachedIframes",new Map),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ie(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var n=t.contentWindow;if(this.recordCrossOriginIframes&&n&&!this.nestedIframeListeners.has(n)){var s=this.handleMessage.bind(this);pt((()=>{n.addEventListener("message",s),this.nestedIframeListeners.set(n,s)}))}pt((()=>{var e;return null==(e=t.contentWindow)?void 0:e.addEventListener("pagehide",(()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)}))})),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 r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var r;switch(e.type){case u.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:u.IncrementalSnapshot,data:{source:l.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case u.Meta:case u.Load:case u.DomContentLoaded:return!1;case u.Plugin:return e;case u.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case u.IncrementalSnapshot:switch(e.data.source){case l.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)})),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 l.Drag:case l.TouchMove:case l.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case l.ViewportResize:return!1;case l.MediaInteraction:case l.MouseInteraction:case l.Scroll:case l.CanvasMutation:case l.Input:return this.replaceIds(e.data,t,["id"]),e;case l.StyleSheetRule:case l.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case l.Font:return e;case l.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case l.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(r=e.data.styles)||r.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}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===f.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach((t=>{this.patchRootIdOnNode(t,e)}))}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.mirror.getNode(t);if(r){var i=r.contentWindow;if(i&&this.nestedIframeListeners.has(i)){var n=this.nestedIframeListeners.get(i);pt((()=>i.removeEventListener("message",n))),this.nestedIframeListeners.delete(i)}i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r)}e&&this.attachedIframes.delete(t)}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var{content:r}=t;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&window.removeEventListener("message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{pt((()=>e.removeEventListener("message",t)))})),this.nestedIframeListeners.clear(),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap}}class se{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(E(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var{observer:i,buffer:n}=Zt(r({},this.bypassOptions,{doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push((()=>{i.disconnect(),n.destroy();var t=Vt.indexOf(n);-1!==t&&Vt.splice(t,1)})),this.restoreHandlers.push(Gt(r({},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(C.host(t))),this.restoreHandlers.push(Xt({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 r=this;this.restoreHandlers.push(k(t.prototype,"attachShadow",(function(t){return function(i){var n=t.call(this,i),s=C.shadowRoot(this);return s&&At(this)&&r.addShadowRoot(s,e),n}})))}reset(){this.restoreHandlers.forEach((t=>{try{t()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ae="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ue=0;64>ue;ue++)ae[oe.charCodeAt(ue)]=ue;var le=new Map,he=(t,e,r)=>{if(t&&(ve(t,e)||"object"==typeof t)){var i=function(t,e){var r=le.get(t);return r||le.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function ce(t,e,r,i){if(t instanceof Array)return t.map((t=>ce(t,e,r,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){var n=t.constructor.name,s=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=oe[r[e]>>2],n+=oe[(3&r[e])<<4|r[e+1]>>4],n+=oe[(15&r[e+1])<<2|r[e+2]>>6],n+=oe[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}if(t instanceof DataView)return{rr_type:t.constructor.name,args:[ce(t.buffer,e,r,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){var o=t.constructor.name,{src:a}=t;return{rr_type:o,src:a}}return t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[ce(t.data,e,r,i),t.width,t.height]}:ve(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:he(t,e,r)}:t}var de=(t,e,r,i)=>t.map((t=>ce(t,e,r,i))),ve=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(r.find((r=>t instanceof e[r])))},fe=["webgl","webgl2"];function pe(t){return"nodeType"in t}function ge(t,e,i,n){var s=[];try{if(n){var o=function(t,e,i){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return k(n.prototype,"configure",(function(n){return function(s){var o=function(t){var{canvas:e}=t;return e&&"object"==typeof e?e:null}(this);if(!o||pe(o)&&Ct(o,e,i,!0))return n.call(this,s);pe(o)&&!("__context"in o)&&(o.__context="webgpu");var a=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==a&&s?r({},s,{usage:"number"==typeof s.usage?s.usage|a:a}):s)}}))}(t,e,i);o&&s.push(o)}var a=k(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(r){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(r),o=arguments.length,a=new Array(o>1?o-1:0),u=1;o>u;u++)a[u-1]=arguments[u];if(!Ct(this,e,i,!0)&&("__context"in this||(this.__context=s),n&&fe.includes(s)))if(a[0]&&"object"==typeof a[0]){var l=a[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[r,...a])}}));s.push(a)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((t=>t()))}}function me(t,e,r,i,n,s,o){var a=[],u=Object.getOwnPropertyNames(t),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof t[u])return 0;var l=k(t,u,(function(t){return function(){for(var a=arguments.length,l=new Array(a),h=0;a>h;h++)l[h]=arguments[h];var c=t.apply(this,l);if(he(c,s,this),"tagName"in this.canvas&&!Ct(this.canvas,i,n,!0)){var d=de(l,s,this,o);r(this.canvas,{type:e,property:u,args:d})}return c}}));a.push(l)}catch(i){var h=bt(t,u,{set(t){r(this.canvas,{type:e,property:u,args:[t],setter:!0})}});a.push(h)}};for(var h of u)l(h);return a}var ye,be,_e,we='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n function fnv1aHash(buffer) {\n const view = new Uint8Array(buffer);\n let hash = 2166136261;\n for (let i2 = 0; i2 < view.length; i2++) {\n hash ^= view[i2];\n hash = hash * 16777619 | 0;\n }\n return (hash >>> 0).toString(16);\n }\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n try {\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d");\n }\n reusableCtx.clearRect(0, 0, width, height);\n reusableCtx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const fingerprint = fnv1aHash(arrayBuffer);\n if (!lastFingerprintMap.has(id)) {\n const base642 = encode(arrayBuffer);\n if (await transparentBase64 === base642) {\n lastFingerprintMap.set(id, fingerprint);\n return worker.postMessage({ id });\n }\n lastFingerprintMap.set(id, fingerprint);\n worker.postMessage({ id, type, base64: base642, width, height });\n return;\n }\n if (lastFingerprintMap.get(id) === fingerprint)\n return worker.postMessage({ id });\n const base64 = encode(arrayBuffer);\n worker.postMessage({ id, type, base64, width, height });\n lastFingerprintMap.set(id, fingerprint);\n } catch {\n worker.postMessage({ id });\n }\n } else {\n e.data.bitmap.close();\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-Ca9A-vl6.js.map\n',xe="undefined"!=typeof self&&self.Blob&&new Blob([we],{type:"text/javascript;charset=utf-8"});function Se(t){var e;try{if(!(e=xe&&(self.URL||self.webkitURL).createObjectURL(xe)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(we),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class ke{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,"rafIdTimestamp",null),a(this,"rafIdFlush",null),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:r,blockClass:i,blockSelector:n,recordCanvas:s,dataURLOptions:o}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,s&&"all"===e&&this.initCanvasMutationObserver(r,i,n,o),s&&"number"==typeof e&&this.initCanvasFPSObserver(e,r,i,n,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null)}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,i,n,s){var o=this;if("OffscreenCanvas"in r){var a=ge(r,i,n,!0),u=new Map,l=new Se;l.onmessage=t=>{var{id:e}=t.data;if(u.set(e,!1),"base64"in t.data){var{base64:r,type:i,width:n,height:s}=t.data;this.mutationCb({id:e,type:d["2D"],commands:[{property:"clearRect",args:[0,0,n,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}],displayWidth:n,displayHeight:s})}};var h,c=1e3/t,v=0,f=t=>{var a,d;v&&c>t-v||(v=t,(a=[],d=t=>{try{t.querySelectorAll("canvas").forEach((t=>{Ct(t,i,n,!0)||a.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&d(t.shadowRoot)}))}catch(t){}},d(r.document),a).forEach(function(){var t=e((function*(t){var e,r,i=o.mirror.getId(t);if(!u.get(i)&&0!==t.width&&0!==t.height){u.set(i,!0);try{if(["webgl","webgl2"].includes(t.__context)){var n=t.getContext(t.__context);if(null==(e=null==n?void 0:n.isContextLost)?void 0:e.call(n))return void u.set(i,!1);!1===(null==(r=null==n?void 0:n.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var a=t.clientWidth||t.width,h=t.clientHeight||t.height,c=yield createImageBitmap(t,{resizeWidth:a,resizeHeight:h});l.postMessage({id:i,bitmap:c,width:a,height:h,dataURLOptions:s.dataURLOptions},[c])}catch(t){u.set(i,!1)}}}));return function(e){return t.apply(this,arguments)}}())),h=requestAnimationFrame(f)};h=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(h)}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=ge(t,e,r,!1),s=function(t,e,r,i,n){var s=[],o=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),a=function(o){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])return 1;var a=k(e.CanvasRenderingContext2D.prototype,o,(function(s){return function(){for(var a=arguments.length,u=new Array(a),l=0;a>l;l++)u[l]=arguments[l];return Ct(this.canvas,r,i,!0)||setTimeout((()=>{var r=de(u,e,this,n);t(this.canvas,{type:d["2D"],property:o,args:r})}),0),s.apply(this,u)}}));s.push(a)}catch(r){var u=bt(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:d["2D"],property:o,args:[e],setter:!0})}});s.push(u)}};for(var u of o)a(u);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i),o=function(t,e,r,i,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...me(e.WebGLRenderingContext.prototype,d.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...me(e.WebGL2RenderingContext.prototype,d.WebGL2,t,r,i,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),s(),o()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var r=this.pendingCanvasMutations.get(t);if(r&&-1!==e){var n=r.map((t=>i(t,s))),{type:o}=r[0];this.mutationCb({id:e,type:o,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Ce{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Pt),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 r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:M(e,t.href),index:r})))})),i.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,st.forEach((t=>t.abort())),st.clear()}trackStylesheetInLinkElement(t){}}class Te{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).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 Ie=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Ee=document.createElement("iframe");document.body.appendChild(Ee),Array.from=(null==(n=Ee.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Ee)}}catch(t){console.debug("Unable to override Array.from",t)}var Re=new O;function Me(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:h=null,maskTextClass:c="rr-mask",maskTextSelector:d=null,inlineStylesheet:v=!0,maskAllInputs:f,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:y,hooks:b,packFn:_,sampling:w={},dataURLOptions:x={},mousemoveWait:S,recordDOM:k=!0,recordCanvas:T=!1,recordCrossOriginIframes:I=!1,recordAfter:E=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:R=!1,collectFonts:M=!1,inlineImages:P=!1,plugins:L,keepIframeSrcFn:A=(()=>!1),ignoreCSSAttributes:N=new Set([]),errorHandler:F}=t;$t=F;var D=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},x),q=!I||window.parent===window,j=!1;if(!q)try{window.parent.document&&(j=!1)}catch(t){j=!0}if(q&&!e)throw new Error("emit function is required");if(!q&&!j)return()=>{};void 0!==S&&void 0===w.mousemove&&(w.mousemove=S),Re.reset();var U,H=!0===f?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},B=dt(void 0!==g&&g);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var z=0,V=new Map,W=t=>{for(var e of L||[])e.eventProcessor&&(t=e.eventProcessor(t));return _&&!j&&(t=_(t)),t};ye=(t,r)=>{var s,o=t;if(o.timestamp=_t(),!(null==(s=Vt[0])?void 0:s.isFrozen())||o.type===u.FullSnapshot||o.type===u.IncrementalSnapshot&&o.data.source===l.Mutation||Vt.forEach((t=>t.unfreeze())),q)null==e||e(W(o),r);else if(j){var a={type:"rrweb",event:W(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===u.FullSnapshot)U=o,z=0;else if(o.type===u.IncrementalSnapshot){if(o.data.source===l.Mutation&&o.data.isAttachIframe)return;z++,(n&&z>=n||i&&o.timestamp-U.timestamp>i)&&be(!0)}};var Z=t=>{if(I&&t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null;t.removes.forEach((t=>{var{id:r}=t;if(!e||!e.has(r)){var i=V.get(r);i&&(i(),V.delete(r)),K.removeIframeById(r)}})),function(){for(var[t,e]of V){var r=Re.getNode(t);if(r)try{r.contentDocument&&r.contentDocument.defaultView||(e(),V.delete(t))}catch(r){e(),V.delete(t)}else e(),V.delete(t)}}()}ye({type:u.IncrementalSnapshot,data:r({source:l.Mutation},t)})},G=t=>ye({type:u.IncrementalSnapshot,data:r({source:l.Scroll},t)}),Q=t=>ye({type:u.IncrementalSnapshot,data:r({source:l.CanvasMutation},t)}),J=new Ce({mutationCb:Z,adoptedStyleSheetCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.AdoptedStyleSheet},t)})}),K=new ne({mirror:Re,mutationCb:Z,stylesheetManager:J,recordCrossOriginIframes:I,wrappedEmit:ye});for(var Y of L||[])Y.getMirror&&Y.getMirror({nodeMirror:Re,crossOriginIframeMirror:K.crossOriginIframeMirror,crossOriginIframeStyleMirror:K.crossOriginIframeStyleMirror});var X=new Te;_e=new ke({recordCanvas:T,mutationCb:Q,win:window,blockClass:s,blockSelector:o,mirror:Re,sampling:w.canvas,dataURLOptions:D});var tt=new se({mutationCb:Z,scrollCb:G,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:d,inlineStylesheet:v,maskInputOptions:H,dataURLOptions:D,maskTextFn:y,maskInputFn:m,recordCanvas:T,inlineImages:P,sampling:w,slimDOMOptions:B,iframeManager:K,stylesheetManager:J,canvasManager:_e,keepIframeSrcFn:A,processedNodeManager:X},mirror:Re});be=function(t){if(void 0===t&&(t=!1),k){ye({type:u.Meta,data:{href:window.location.href,width:St(),height:xt()}},t),J.reset(),tt.init(),Vt.forEach((t=>t.lock()));var e=function(t,e){var{mirror:r=new O,blockClass:i="rr-block",blockSelector:n=null,maskTextClass:s="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:u=!1,recordCanvas:l=!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),maxDepth:x}=e||{};return ct(t,{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:s,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:dt(v),dataURLOptions:f,inlineImages:u,recordCanvas:l,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:_,keepIframeSrcFn:w,newlyAddedElement:!1,maxDepth:x})}(document,{mirror:Re,blockClass:s,blockSelector:o,maskTextClass:c,maskTextSelector:d,inlineStylesheet:v,maskAllInputs:H,maskTextFn:y,maskInputFn:m,slimDOM:B,dataURLOptions:D,recordCanvas:T,inlineImages:P,onSerialize(t){Rt(t,Re)&&K.addIframe(t),Mt(t,Re)&&J.trackLinkElement(t),Ot(t)&&tt.addShadowRoot(C.shadowRoot(t),document)},onIframeLoad(t,e){K.attachIframe(t,e),tt.observeAttachShadow(t)},onStylesheetLoad(t,e){J.attachLinkElement(t,e)},keepIframeSrcFn:A});if(!e)return console.warn("Failed to snapshot the document");ye({type:u.FullSnapshot,data:{node:e,initialOffset:wt(window)}},t),Vt.forEach((t=>t.unlock())),I&&K.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&J.adoptStyleSheets(document.adoptedStyleSheets,Re.getId(document))}};try{var et=[],rt=t=>{var e;return zt(te)({mutationCb:Z,mousemoveCb:(t,e)=>ye({type:u.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.MouseInteraction},t)}),scrollCb:G,viewportResizeCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.ViewportResize},t)}),inputCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.Input},t)}),mediaInteractionCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.MediaInteraction},t)}),styleSheetRuleCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.StyleSheetRule},t)}),styleDeclarationCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.StyleDeclaration},t)}),canvasMutationCb:Q,fontCb:t=>ye({type:u.IncrementalSnapshot,data:r({source:l.Font},t)}),selectionCb(t){ye({type:u.IncrementalSnapshot,data:r({source:l.Selection},t)})},customElementCb(t){ye({type:u.IncrementalSnapshot,data:r({source:l.CustomElement},t)})},blockClass:s,ignoreClass:a,ignoreSelector:h,maskTextClass:c,maskTextSelector:d,maskInputOptions:H,inlineStylesheet:v,sampling:w,recordDOM:k,recordCanvas:T,inlineImages:P,userTriggeredOnInput:R,collectFonts:M,doc:t,maskInputFn:m,maskTextFn:y,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:B,dataURLOptions:D,mirror:Re,iframeManager:K,stylesheetManager:J,shadowDomManager:tt,processedNodeManager:X,canvasManager:_e,ignoreCSSAttributes:N,plugins:(null==(e=null==L?void 0:L.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>ye({type:u.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},b)};K.addLoadListener((t=>{try{var e=Re.getId(t),r=rt(t.contentDocument);et.push(r),-1!==e&&V.set(e,r)}catch(t){console.warn(t)}})),K.addPageHideListener((t=>{var e=Re.getId(t),r=V.get(e);r&&(r(),V.delete(e)),function(t){for(var e=Vt.length-1;e>=0;e--){var r=Vt[e];(null==r?void 0:r.bufferBelongsToIframe(t))&&(r.reset(),Vt.splice(e,1))}}(t)}));var it=()=>{be(),et.push(rt(document)),Ie=!0};return["interactive","complete"].includes(document.readyState)?it():(et.push(ft("DOMContentLoaded",(()=>{ye({type:u.DomContentLoaded,data:{}}),"DOMContentLoaded"===E&&it()}))),et.push(ft("load",(()=>{ye({type:u.Load,data:{}}),"load"===E&&it()}),window))),()=>{et.forEach((t=>pt(t))),X.destroy(),K.removeLoadListener(),K.destroy(),V.clear(),Re.reset(),Ie=!1,$t=void 0}}catch(t){console.warn(t)}}Me.addCustomEvent=(t,e)=>{if(!Ie)throw new Error("please add custom event after start recording");ye({type:u.Custom,data:{tag:t,payload:e}})},Me.freezePage=()=>{Vt.forEach((t=>t.freeze()))},Me.takeFullSnapshot=t=>{if(!Ie)throw new Error("please take full snapshot after start recording");be(t)},Me.mirror=Re;var Oe=Object.defineProperty,Pe=(t,e,r)=>((t,e,r)=>e in t?Oe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class Le{constructor(t){Pe(this,"fileName"),Pe(this,"functionName"),Pe(this,"lineNumber"),Pe(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 Ae=/(^|@)\S+:\d+/,Ne=/^\s*at .*(\S+:\d+|\(native\))/m,Fe=/^(eval@)?(\[native code])?$/,$e={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(Ne)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(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(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ne)}),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,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop()),s=i.join(" ")||void 0,o=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Le({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(Fe)}),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 Le({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Le({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)},parseOpera(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(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new Le({fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,s=r.length;s>n;n+=2){var o=e.exec(r[n]);o&&i.push(new Le({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(Ae)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),r=this.extractLocation(e.pop()),i=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Le({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function De(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var s=0;i.children.length>s;s++){var o=i.children[s];o.localName&&o.localName.toLowerCase&&o.localName.toLowerCase()===r&&n.push(o)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function qe(t){return Array.isArray(t)}function je(t){return"object"==typeof t&&null!==t&&!qe(t)}function Ue(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(je(t[i])&&Ue(t[i],e-1))return!0;return!1}function He(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,(function(t,e){if(i.length>0){var s=i.indexOf(this);~s?i.splice(s+1):i.push(this),~s?n.splice(s,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(je(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||je(o)&&Ue(o,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var o;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var a={};for(var u in e){var l=e[u];a[u]=qe(l)?De(l.length?l[0]:null):l}return a}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 Be={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 ze(t,e,r){var i,n=r?Object.assign({},Be,r):Be,s=n.logger;if(!s)return()=>{};i="string"==typeof s?e[s]:s;var o=0,a=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message,i=$e.parse(e.error).map((t=>t.toString())),s=[He(r,n.stringifyOptions)];t({level:"error",trace:i,payload:s})};e.addEventListener("error",l),u.push((()=>{e.removeEventListener("error",l)}));var h=e=>{var r,i;e.reason instanceof Error?i=[He("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[He("Uncaught (in promise)",n.stringifyOptions),He(e.reason,n.stringifyOptions)]);var s=$e.parse(r).map((t=>t.toString()));t({level:"error",trace:s,payload:i})};e.addEventListener("unhandledrejection",h),u.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach((t=>t()))};function d(e,r){var i=this;return e[r]?function(e,s,u){try{if(!(s in e))return()=>{};var l=e[s],h=(e=>function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||a)){a=!0;try{var h=$e.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>He(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:r,trace:h,payload:c}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[He("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{a=!1}}})(l);return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:l}})),e[s]=h,()=>{e[s]=l}}catch(t){return()=>{}}}(e,r):()=>{}}}var Ve,We=t=>({name:"rrweb/console@1",observer:ze,options:t}),Ze=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Ge=function(t){return t.MinLength="min_length",t.MaxLength="max_length",t}({}),Qe=["$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"],Je="NativeGzipValidationError",Ke=t=>t.length>=2&&31===t[0]&&139===t[1],Ye=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Xe=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Je,e},tr=function(){var t=e((function*(t,e){18>t.size&&Xe("too-short");var r=new Uint8Array(yield t.slice(0,10).arrayBuffer());Ke(r)&&8===r[2]||Xe("invalid-header");var i=new DataView(yield t.slice(t.size-8).arrayBuffer());i.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(Ve)return Ve;Ve=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;Ve[t]=e>>>0}return Ve})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&Xe("invalid-crc");var n=e.length>>>0;i.getUint32(4,!0)!==n&&Xe("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function er(){return er=e((function*(t,r,i){void 0===r&&(r=!0);try{var n=(new TextEncoder).encode(t),s=new CompressionStream("gzip"),o=s.writable.getWriter(),a=o.write(n).then((()=>o.close())).catch(function(){var t=e((function*(t){try{yield o.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),u=new Response(s.readable).blob(),[l]=yield Promise.all([u,a]);return yield tr(l,n),l}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),null}})),er.apply(this,arguments)}var rr=["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"],ir=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return rr.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))};function nr(t,e){return-1!==t.indexOf(e)}var sr=function(t){return t.trim()},or=function(t){return t.replace(/^\$/,"")},ar=Object.prototype,ur=ar.hasOwnProperty,lr=ar.toString,hr=Array.isArray||function(t){return"[object Array]"===lr.call(t)},cr=t=>"function"==typeof t,dr=t=>t===Object(t)&&!hr(t),vr=t=>{if(dr(t)){for(var e in t)if(ur.call(t,e))return!1;return!0}return!1},fr=t=>void 0===t,pr=t=>"[object String]"==lr.call(t),gr=t=>pr(t)&&0===t.trim().length,mr=t=>null===t,yr=t=>fr(t)||mr(t),br=t=>"[object Number]"==lr.call(t)&&t==t,_r=t=>br(t)&&t>0,wr=t=>"[object Boolean]"===lr.call(t),xr=t=>t instanceof FormData;function Sr(t){return null===t||"object"!=typeof t}function kr(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Cr(t){return"undefined"!=typeof Event&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var Tr=[!0,"true",1,"1","yes"],Ir=t=>nr(Tr,t),Er=[!1,"false",0,"0","no"];function Rr(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),br(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),Rr(n||r,e,r,i))}class Mr{constructor(t){this.$t={},this.zt=t.zt,this.Zt=Rr(t.bucketSize,0,100,t.Gt),this.Qt=Rr(t.refillRate,0,this.Zt,t.Gt),this.Jt=Rr(t.refillInterval,0,864e5,t.Gt)}Kt(t,e){var r=Math.floor((e-t.lastAccess)/this.Jt);r>0&&(t.tokens=Math.min(t.tokens+r*this.Qt,this.Zt),t.lastAccess=t.lastAccess+r*this.Jt)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.$t[i];return n?this.Kt(n,r):this.$t[i]=n={tokens:this.Zt,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.zt)||e.call(this,t)),0===n.tokens)}stop(){this.$t={}}}var Or,Pr,Lr,Ar="Mobile",Nr="iOS",Fr="Android",$r="Tablet",Dr=Fr+" "+$r,qr="iPad",jr="Apple",Ur=jr+" Watch",Hr="Safari",Br="BlackBerry",zr="Samsung",Vr=zr+"Browser",Wr=zr+" Internet",Zr="Chrome",Gr=Zr+" OS",Qr=Zr+" "+Nr,Jr="Internet Explorer",Kr=Jr+" "+Ar,Yr="Opera",Xr=Yr+" Mini",ti="Edge",ei="Microsoft "+ti,ri="Firefox",ii=ri+" "+Nr,ni="Nintendo",si="PlayStation",oi="Xbox",ai=Fr+" "+Ar,ui=Ar+" "+Hr,li="Windows",hi=li+" Phone",ci="Nokia",di="Ouya",vi="Generic",fi=vi+" "+Ar.toLowerCase(),pi=vi+" "+$r.toLowerCase(),gi="Konqueror",mi="Oculus Browser",yi="(\\d+(\\.\\d+)?)",bi=new RegExp("Version/"+yi),_i=new RegExp(oi,"i"),wi=new RegExp(si+" \\w+","i"),xi=new RegExp(ni+" \\w+","i"),Si=new RegExp(Br+"|PlayBook|BB10","i"),ki={"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"},Ci=function(t,e){return e=e||"",nr(t," OPR/")&&nr(t,"Mini")?Xr:nr(t," OPR/")?Yr:Si.test(t)?Br:nr(t,"IE"+Ar)||nr(t,"WPDesktop")?Kr:nr(t,"OculusBrowser")?mi:nr(t,Vr)?Wr:nr(t,ti)||nr(t,"Edg/")?ei:nr(t,"FBIOS")?"Facebook "+Ar:nr(t,"UCWEB")||nr(t,"UCBrowser")?"UC Browser":nr(t,"CriOS")?Qr:nr(t,"CrMo")||nr(t,Zr)?Zr:nr(t,Fr)&&nr(t,Hr)?ai:nr(t,"FxiOS")?ii:nr(t.toLowerCase(),gi.toLowerCase())?gi:((t,e)=>e&&nr(e,jr)||function(t){return nr(t,Hr)&&!nr(t,Zr)&&!nr(t,Fr)}(t))(t,e)?nr(t,Ar)?ui:Hr:nr(t,ri)?ri:nr(t,"MSIE")||nr(t,"Trident/")?Jr:nr(t,"Gecko")?ri:""},Ti={[Kr]:[new RegExp("rv:"+yi)],[ei]:[new RegExp(ti+"?\\/"+yi)],[Zr]:[new RegExp("("+Zr+"|CrMo)\\/"+yi)],[Qr]:[new RegExp("CriOS\\/"+yi)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+yi)],[Hr]:[bi],[ui]:[bi],[Yr]:[new RegExp("(Opera|OPR)\\/"+yi)],[ri]:[new RegExp(ri+"\\/"+yi)],[ii]:[new RegExp("FxiOS\\/"+yi)],[gi]:[new RegExp("Konqueror[:/]?"+yi,"i")],[Br]:[new RegExp(Br+" "+yi),bi],[ai]:[new RegExp("android\\s"+yi,"i")],[Wr]:[new RegExp(Vr+"\\/"+yi)],[mi]:[new RegExp("OculusBrowser\\/"+yi)],[Jr]:[new RegExp("(rv:|MSIE )"+yi)],Mozilla:[new RegExp("rv:"+yi)]},Ii=function(t,e){var r=Ci(t,e),i=Ti[r];if(fr(i))return null;for(var n=0;i.length>n;n++){var s=t.match(i[n]);if(s)return parseFloat(s[s.length-2])}return null},Ei=[[new RegExp(oi+"; "+oi+" (.*?)[);]","i"),t=>[oi,t&&t[1]||""]],[new RegExp(ni,"i"),[ni,""]],[new RegExp(si,"i"),[si,""]],[Si,[Br,""]],[new RegExp(li,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[hi,""];if(new RegExp(Ar).test(e)&&!/IEMobile\b/.test(e))return[li+" "+Ar,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=ki[r[1]]||"";return/arm/i.test(e)&&(i="RT"),[li,i]}return[li,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[Nr,[t[3],t[4],t[5]||"0"].join(".")]:[Nr,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=fr(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Fr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Fr+")","i"),t=>t&&t[2]?[Fr,[t[2],t[3],t[4]||"0"].join(".")]:[Fr,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Gr,""]],[/Linux|debian/i,["Linux",""]]],Ri=function(t){return xi.test(t)?ni:wi.test(t)?si:_i.test(t)?oi:new RegExp(di,"i").test(t)?di:new RegExp("("+hi+"|WPDesktop)","i").test(t)?hi:/iPad/.test(t)?qr:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ur:Si.test(t)?Br:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(ci,"i").test(t)?ci:/(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(Ar).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)?Fr:Dr:new RegExp("(pda|"+Ar+")","i").test(t)?fi:new RegExp($r,"i").test(t)&&!new RegExp($r+" pc","i").test(t)?pi:""},Mi=function(t,e){var r,i,n,s,o=Ri(t);return o===qr||o===Dr||"Kobo"===o||"Kindle Fire"===o||o===pi?$r:o===ni||o===oi||o===si||o===di?"Console":o===Ur?"Wearable":o?Ar:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(r=null==e?void 0:e.maxTouchPoints)&&void 0!==r?r:0)>0?600>Math.min(null!==(i=null==e?void 0:e.screenWidth)&&void 0!==i?i:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?Ar:$r:"Desktop"},Oi={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},Pi=Oi.info;function Li(t){if(wr(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(hr(t))return{arrayValue:{values:t.map((t=>Li(t)))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}function Ai(t){var e=[];for(var r in t){var i=t[r];mr(i)||fr(i)||e.push({key:r,value:Li(i)})}return e}function Ni(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}function Fi(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return Lr&&r.length===Pr||(Pr=r.length,Lr=r.reduce(((r,i)=>{Or||(Or={});var n=Or[i];if(n)r[n[0]]=n[1];else for(var s=t(i),o=s.length-1;o>=0;o--){var a=s[o],u=null==a?void 0:a.filename,l=e[i];if(u&&l){r[u]=l,Or[i]=[u,l];break}}return r}),{})),Lr}}class $i{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(t){var r=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&hr(e.stacktrace.frames)&&(e.stacktrace.frames=yield r.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 i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),r({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var r=this;return e((function*(){var e=t;for(var i of r.modifiers)e=yield i(e);return e}))()}convertToExceptionList(t,e){var i,n,s,o={type:t.type,value:t.value,mechanism:{type:null!==(i=e.type)&&void 0!==i?i:"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,r({},e,{handled:!0}))),a}buildParsingContext(t){var e;return{chunkIdMap:Fi(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,i){void 0===i&&(i=0);var n=(r,i)=>{if(4>=i){var n=this.buildCoercingContext(t,e,i);return this.applyCoercers(r,n)}};return r({},e,{syntheticException:0==i?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}var Di="?";function qi(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?Di:r,in_app:!0};return fr(i)||(s.lineno=i),fr(n)||(s.colno=n),s}var ji=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:Di,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Ui=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Hi=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Bi=/\((\S*)(?::(\d+))(?::(\d+))\)/,zi=(t,e)=>{var r=Ui.exec(t);if(r){var[,i,n,s]=r;return qi(e,i,Di,+n,+s)}var o=Hi.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=Bi.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[u,l]=ji(o[1]||Di,o[2]);return qi(e,l,u,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Vi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Wi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Zi=(t,e)=>{var r=Vi.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Wi.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],s=r[1]||Di;return[s,n]=ji(s,n),qi(e,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Gi=/\(error: (.*)\)/,Qi=50;class Ji{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=pr(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?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 kr(t,"DOMException")}isDOMError(t){return kr(t,"DOMError")}}class Ki{match(t){return t instanceof Error}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 r=t.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Yi{constructor(){}match(t){return kr(t,"ErrorEvent")&&null!=t.error}coerce(t,e){var r;return e.apply(t.error)||{type:"ErrorEvent",value:t.message,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}var Xi=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tn{match(t){return"string"==typeof t}coerce(t,e){var r,[i,n]=this.getInfos(t);return{type:null!=i?i:"Error",value:null!=n?n:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match(Xi);return i&&(e=i[1],r=i[2]),[e,r]}}var en=["fatal","error","warning","log","info","debug"];function rn(t,e){void 0===e&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var i=r.length;i>0;i--){var n=r.slice(0,i).join(", ");if(e>=n.length)return i===r.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class nn{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i=this.getErrorPropertyFromObject(t);return i?e.apply(i):{type:this.getType(t),value:this.getValue(t),stack:null==(r=e.syntheticException)?void 0:r.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 r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+rn(t)}isSeverityLevel(t){return pr(t)&&!gr(t)&&en.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var r=t[e];if(r instanceof Error)return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class sn{match(t){return Cr(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+rn(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class on{match(t){return Sr(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class an{match(t){return kr(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Cr(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return Sr(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}}var un="$message",ln="$timestamp",hn=new Set([un,ln]),cn={enabled:!0,max_bytes:32768};function dn(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:cn.enabled,max_bytes:fn(t.max_bytes,cn.max_bytes)}:r({},cn)}class vn{constructor(t){this.Yt=[],this.Xt=0,this.qt=dn(t)}setConfig(t){this.qt=dn(t),this.er()}add(t){var e=function(t){var e=function(t){var e=new WeakSet;try{return JSON.stringify(t,((t,r)=>{if("bigint"==typeof r)return r.toString();if("function"!=typeof r&&"symbol"!=typeof r){if(r instanceof Date)return r.toISOString();if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&"object"==typeof r){if(e.has(r))return"[Circular]";e.add(r)}return r}}))}catch(t){return}}(t);if(e)try{var r=JSON.parse(e);if(!dr(r))return;var i=r,n=i[un],s=i[ln];if(!pr(n)||0===n.trim().length)return;if(!pr(s)&&!br(s))return;return{step:i,json:e}}catch(t){return}}(t);if(e){var r=function(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),r=0,i=0;e.length>i;i++)"%"===e[i]?(r+=1,i+=2):r+=1;return r}(e.json);r>this.qt.max_bytes||(this.Yt.push({step:e.step,bytes:r}),this.Xt+=r,this.er())}}getAttachable(){return this.Yt.map((t=>t.step))}clear(){this.Yt=[],this.Xt=0}size(){return this.Yt.length}er(){for(;this.Xt>this.qt.max_bytes&&this.Yt.length>0;){var t=this.Yt.shift();t&&(this.Xt-=t.bytes)}}}function fn(t,e){if(!br(t)||t===1/0||t===-1/0)return e;var r=Math.floor(t);return 0>r?e:r}var pn="undefined"!=typeof window?window:void 0,gn="undefined"!=typeof globalThis?globalThis:pn;"undefined"==typeof self&&(gn.self=gn),"undefined"==typeof File&&(gn.File=function(){});var mn=null==gn?void 0:gn.navigator,yn=null==gn?void 0:gn.document,bn=null==gn?void 0:gn.location,_n=null==gn?void 0:gn.fetch,wn=null!=gn&&gn.XMLHttpRequest&&"withCredentials"in new gn.XMLHttpRequest?gn.XMLHttpRequest:void 0,xn=null==gn?void 0:gn.AbortController,Sn=null==gn?void 0:gn.CompressionStream,kn=null==mn?void 0:mn.userAgent,Cn=null!=pn?pn:{},Tn=t=>t instanceof Document,In="1.376.3",En={DEBUG:!1,LIB_VERSION:In,LIB_NAME:"web",JS_SDK_VERSION:In},Rn=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={k(e){if(pn&&(En.DEBUG||Cn.POSTHOG_DEBUG||r)&&!fr(pn.console)&&pn.console){for(var i=("__rrweb_original__"in pn.console[e]?pn.console[e].__rrweb_original__:pn.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),o=1;n>o;o++)s[o-1]=arguments[o];i(t,...s)}},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];i.k("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(t){i.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>Rn(t+" "+e,r)};return i},Mn=Rn("[PostHog.js]"),On=Mn.createLogger;function Pn(t,e){hr(t)&&t.forEach(e)}function Ln(t,e){if(!yr(t))if(hr(t))t.forEach(e);else if(xr(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)ur.call(t,r)&&e(t[r],r)}var An=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];for(var n of r)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function Nn(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}var Fn=function(t){try{return t()}catch(t){return}},$n=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];return t.apply(this,r)}catch(t){Mn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Mn.critical(t)}}},Dn=function(t){var e={};return Ln(t,(function(t,r){(pr(t)&&t.length>0||br(t))&&(e[r]=t)})),e};var qn=["herokuapp.com","vercel.app","netlify.app"];function jn(t){var e=null==t?void 0:t.hostname;if(!pr(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of qn)if(r===i)return!1;return!0}function Un(t,e,r,i){var{capture:n=!1,passive:s=!0}=null!=i?i:{};null==t||t.addEventListener(e,r,{capture:n,passive:s})}function Hn(t){return"ph_toolbar_internal"===t.name}var Bn=t=>{var e=null==yn?void 0:yn.createElement("a");return fr(e)?null:(e.href=t,e)},zn=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return Ln(t,(function(t,e){fr(t)||fr(e)||"undefined"===e||(r=encodeURIComponent(t instanceof File?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},Vn=function(t,e){for(var r,i=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;i.length>n;n++){var s=i[n].split("=");if(s[0]===e){r=s;break}}if(!hr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){Mn.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Wn=function(t,e,r){if(!t||!e||!e.length)return t;for(var i=t.split("#"),n=i[1],s=(i[0]||"").split("?"),o=s[1],a=s[0],u=(o||"").split("&"),l=[],h=0;u.length>h;h++){var c=u[h].split("=");hr(c)&&(e.includes(c[0])?l.push(c[0]+"="+r):l.push(u[h]))}var d=a;return null!=o&&(d+="?"+l.join("&")),null!=n&&(d+="#"+n),d},Zn=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null};function Gn(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return cr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function Qn(t,e){var r,i=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:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var s of e.payloadHostDenyList)if(i.endsWith(s))return{hostname:i,isHostDenied:!0};return n}var Jn="$people_distinct_id",Kn="$device_id",Yn="__alias",Xn="__timers",ts="$autocapture_disabled_server_side",es="$heatmaps_enabled_server_side",rs="$exception_capture_enabled_server_side",is="$error_tracking_suppression_rules",ns="$error_tracking_capture_extension_exceptions",ss="$web_vitals_enabled_server_side",os="$dead_clicks_enabled_server_side",as="$product_tours_enabled_server_side",us="$web_vitals_allowed_metrics",ls="$session_recording_remote_config",hs="$replay_override_sampling",cs="$replay_override_linked_flag",ds="$replay_override_url_trigger",vs="$replay_override_event_trigger",fs="$sesid",ps="$session_is_sampled",gs="$enabled_feature_flags",ms="$active_feature_flags",ys="$early_access_features",bs="$feature_flag_details",_s="$feature_flag_payloads",ws="$feature_flag_request_id",xs="$override_feature_flags",Ss="$override_feature_flag_payloads",ks="$stored_person_properties",Cs="$stored_group_properties",Ts="$surveys",Is="$surveys_activated",Es="ph_product_tours",Rs="$flag_call_reported",Ms="$flag_call_reported_session_id",Os="$feature_flag_errors",Ps="$feature_flag_evaluated_at",Ls="$user_state",As="$client_session_props",Ns="$capture_rate_limit",Fs="$initial_campaign_params",$s="$initial_referrer_info",Ds="$initial_person_info",qs="$epp",js="__POSTHOG_TOOLBAR__",Us="$posthog_cookieless",Hs="$sdk_debug_extensions_init_method",Bs="$sdk_debug_extensions_init_time_ms",zs="$sdk_debug_recording_script_not_loaded",Vs="PostHog loadExternalDependency extension not found.",Ws="on_reject",Zs="always",Gs="anonymous",Qs="identified",Js="identified_only",Ks="visibilitychange",Ys="beforeunload",Xs="$pageview",to="$pageleave",eo="$identify",ro="$groupidentify",io=1,no=3,so=11;function oo(t){return t instanceof Element&&(t.id===js||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function ao(t){return!!t&&t.nodeType===io}function uo(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function lo(t){return!!t&&t.nodeType===no}function ho(t){return!!t&&t.nodeType===so&&ao(t.host)}function co(t){return t?sr(t).split(/\s+/):[]}function vo(t){var e=null==pn?void 0:pn.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function fo(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 co(e)}function po(t){return yr(t)?null:sr(t).split(/(\s+)/).filter((t=>Ao(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function go(t){var e="";return To(t)&&!Io(t)&&t.childNodes&&t.childNodes.length&&Ln(t.childNodes,(function(t){var r;lo(t)&&t.textContent&&(e+=null!==(r=po(t.textContent))&&void 0!==r?r:"")})),sr(e)}function mo(t){return fr(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var yo=["a","button","form","input","select","textarea","label"];function bo(t,e){if(fr(e))return!0;var r,i=function(t){if(e.some((e=>t.matches(e))))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}function _o(t){var e=t.parentNode;return!(!e||!ao(e))&&e}var wo=["next","previous","prev",">","<"],xo=[".ph-no-deadclick",".ph-no-capture"],So=[".ph-no-rageclick",".ph-no-capture"];var ko=t=>!t||uo(t,"html")||!ao(t),Co=(t,e)=>{if(!pn||ko(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!uo(n,"body");)if(ho(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=_o(n);if(!s)break;if(e||yo.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=pn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function To(t){for(var e=t;e.parentNode&&!uo(e,"body");e=e.parentNode){var r=fo(e);if(nr(r,"ph-sensitive")||nr(r,"ph-no-capture"))return!1}if(nr(fo(t),"ph-include"))return!0;var i=t.type||"";if(pr(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!pr(n)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(n.replace(/[^a-zA-Z0-9]/g,""))}function Io(t){return!!(uo(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||uo(t,"select")||uo(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Eo="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Ro=new RegExp("^(?:"+Eo+")$"),Mo=new RegExp(Eo),Oo="\\d{3}-?\\d{2}-?\\d{4}",Po=new RegExp("^("+Oo+")$"),Lo=new RegExp("("+Oo+")");function Ao(t,e){if(void 0===e&&(e=!0),yr(t))return!1;if(pr(t)){if(t=sr(t),(e?Ro:Mo).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Po:Lo).test(t))return!1}return!0}function No(t){var e=go(t);return Ao(e=(e+" "+Fo(t)).trim())?e:""}function Fo(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Ln(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=go(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Fo(t)).trim())}catch(t){Mn.error("[AutoCapture]",t)}})),e}function $o(t){return t.replace(/"|\\"/g,'\\"')}function Do(t){var e=t.attr__class;return e?hr(e)?e:co(e):void 0}var qo={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"]},jo=On("[Recorder]"),Uo=t=>"navigation"===t.entryType,Ho=t=>"resource"===t.entryType;function Bo(t,e){return!!e&&(wr(e)||e[t])}function zo(t){var{type:e,recordBody:r,headers:i,url:n}=t;function s(t){var e=Object.keys(i).find((t=>"content-type"===t.toLowerCase())),r=e&&i[e];return t.some((t=>null==r?void 0:r.includes(t)))}if(!r)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(wr(r))return!0;if(hr(r))return s(r);var o=r[e];return wr(o)?o:s(o)}function Vo(t,e,r,i,n,s){return Wo.apply(this,arguments)}function Wo(){return Wo=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return jo.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null;var o=function(t,r){for(var s=t.length-1;s>=0;s-=1)if(Ho(o=t[s])&&o.initiatorType===e&&(fr(i)||o.startTime>=i)&&(fr(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*s))),Vo(t,e,r,i,n,s+1))})),Wo.apply(this,arguments)}function Zo(t){var{body:e,options:r,url:i}=t;if(yr(e))return null;var{hostname:n,isHostDenied:s}=Qn(i,r);if(s)return n+" is in deny list";if(pr(e))return e;if(Tn(e))return e.textContent;if(xr(e))return zn(e);if(dr(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 Go=t=>!mr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Qo(t){var{entry:e,method:i,status:n,networkRequest:s,isInitial:o,start:a,end:u,url:l,initiatorType:h}=t;a=e?e.startTime:a,u=e?e.responseEnd:u;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(a||0)),v=[r({},e?e.toJSON():{name:l},{startTime:fr(a)?void 0:Math.round(a),endTime:fr(u)?void 0:Math.round(u),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:o})];if(Go(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 Jo=["video/","audio/"];function Ko(t){return new Promise((e=>{var r=setTimeout((()=>e("[SessionReplay] Timeout while trying to read body")),500);try{t.clone().text().then((t=>e(t)),(t=>e("[SessionReplay] Failed to read body: "+t))).finally((()=>clearTimeout(r)))}catch(t){clearTimeout(r),e("[SessionReplay] Failed to read body")}}))}function Yo(){return Yo=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:s}=Qn(i,r);return s?Promise.resolve(n+" is in deny list"):Ko(e)})),Yo.apply(this,arguments)}function Xo(){return Xo=e((function*(t){var{r:e,options:r,url:i}=t,n=function(t){var e,{r:r,options:i,url:n}=t;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),o=Jo.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:u}=Qn(n,i);return u?a+" is in deny list":null}({r:e,options:r,url:i});return mr(n)?Ko(e):Promise.resolve(n)})),Xo.apply(this,arguments)}var ta=null;function ea(t,i,n){if(!("performance"in i))return()=>{};if(ta)return jo.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},qo,n):qo,o=e=>{var i=[];e.requests.forEach((t=>{var e=s.maskRequestFn(t);e&&i.push(e)})),i.length>0&&t(r({},e,{requests:i}))},a=function(t,e,r){if(r.recordInitialRequests){var i=e.performance.getEntries().filter((t=>Uo(t)||Ho(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>Qo({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var i=e.getEntries().filter((t=>Uo(t)||Ho(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>Qo({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>r.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(o,i,s),u=()=>{},l=()=>{};return(s.recordHeaders||s.recordBody)&&(u=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=Bo("request",r.recordHeaders),n=Bo("response",r.recordHeaders),s=Gn(e.XMLHttpRequest.prototype,"open",(s=>function(o,a,u,l,h){void 0===u&&(u=!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)),i&&(p.requestHeaders=g);var y=v.send.bind(v);v.send=t=>(zo({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=Zo({body:t,options:r,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 i={};v.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)})),n&&(p.responseHeaders=i),zo({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=Zo({body:v.response,options:r,url:a})),Vo(e,"xmlhttprequest",f.url,c,d).then((e=>{var r=Qo({entry:e,method:o,status:null==v?void 0:v.status,networkRequest:p,start:c,end:d,url:a.toString(),initiatorType:"xmlhttprequest"});t({requests:r})})).catch((()=>{}))}};v.addEventListener("readystatechange",_),v.addEventListener("error",b),v.addEventListener("abort",b),v.addEventListener("timeout",b),s.call(v,o,a.toString(),u,l,h)}));return()=>{s()}}(o,i,s),l=function(t,r,i){if(!i.initiatorTypes.includes("fetch"))return()=>{};var n=Bo("request",i.recordHeaders),s=Bo("response",i.recordHeaders),o=Gn(r,"fetch",(o=>function(){var a=e((function*(e,a){var u,l,h,c=new Request(e,a),d={};try{var v={};c.headers.forEach(((t,e)=>{v[e]=t})),n&&(d.requestHeaders=v),zo({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(d.requestBody=yield function(t){return Yo.apply(this,arguments)}({r:c,options:i,url:e})),l=r.performance.now(),u=yield o(c),h=r.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),s&&(d.responseHeaders=f),zo({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(d.responseBody=yield function(t){return Xo.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{Vo(r,"fetch",c.url,l,h).then((e=>{var r,i=Qo({entry:e,method:c.method,status:null==(r=u)?void 0:r.status,networkRequest:d,start:l,end:h,url:c.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),ta=()=>{a(),u(),l(),ta=null}}var ra=t=>({name:"rrweb/network@1",observer:ea,options:t});Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:We,getRecordNetworkPlugin:ra},Cn.__PosthogExtensions__.rrweb={record:Me,version:"v2",wasMaxDepthReached:()=>ht,resetMaxDepthState(){ht=!1,lt=!1}},Cn.rrweb={record:Me,version:"v2"},Cn.rrwebConsoleRecord={getRecordConsolePlugin:We},Cn.getRecordNetworkPlugin=ra;var ia,na,sa,oa,aa,ua,la,ha,ca,da,va,fa,pa={},ga=[],ma=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ya=Array.isArray;function ba(t,e){for(var r in e)t[r]=e[r];return t}function _a(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function wa(t,e,r){var i,n,s,o={};for(s in e)"key"==s?i=e[s]:"ref"==s?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?ia.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===o[s]&&(o[s]=t.defaultProps[s]);return xa(t,o,i,n,null)}function xa(t,e,r,i,n){var s={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++sa:n,__i:-1,__u:0};return null==n&&null!=na.vnode&&na.vnode(s),s}function Sa(t){return t.children}function ka(t,e){this.props=t,this.context=e}function Ca(t,e){if(null==e)return t.__?Ca(t.__,t.__i+1):null;for(var r;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Ca(t):null}function Ta(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return Ta(t)}}function Ia(t){(!t.__d&&(t.__d=!0)&&oa.push(t)&&!$.__r++||aa!=na.debounceRendering)&&((aa=na.debounceRendering)||ua)($)}function $(){for(var t,e,r,i,n,s,o,a=1;oa.length;)oa.length>a&&oa.sort(la),t=oa.shift(),a=oa.length,t.__d&&(r=void 0,i=void 0,n=(i=(e=t).__v).__e,s=[],o=[],e.__P&&((r=ba({},i)).__v=i.__v+1,na.vnode&&na.vnode(r),Aa(e.__P,r,i,e.__n,e.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?Ca(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,Fa(s,r,o),i.__e=i.__=null,r.__e!=n&&Ta(r)));$.__r=0}function Ea(t,e,r,i,n,s,o,a,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||ga,b=e.length;for(u=function(t,e,r,i,n){var s,o,a,u,l,h=r.length,c=h,d=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(o=e[s])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=t.__k[s]=xa(null,o,null,null,null):ya(o)?o=t.__k[s]=xa(Sa,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=xa(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,u=s+d,o.__=t,o.__b=t.__b+1,a=null,-1!=(l=o.__i=Ma(o,r,u,c))&&(c--,(a=r[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(n>h?d--:h>n&&d++),"function"!=typeof o.type&&(o.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,o.__u|=4))):t.__k[s]=null;if(c)for(s=0;h>s;s++)null!=(a=r[s])&&0==(2&a.__u)&&(a.__e==i&&(i=Ca(a)),qa(a,a));return i}(r,e,y,u,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1==v.__i?pa:y[v.__i]||pa,v.__i=c,g=Aa(t,v,d,n,s,o,a,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Da(d.ref,null,v),h.push(v.ref,v.__c||f,v)),null==p&&null!=f&&(p=f),(m=!!(4&v.__u))||d.__k===v.__k?u=Ra(v,u,t,m):"function"==typeof v.type&&void 0!==g?u=g:f&&(u=f.nextSibling),v.__u&=-7);return r.__e=p,u}function Ra(t,e,r,i){var n,s;if("function"==typeof t.type){for(n=t.__k,s=0;n&&n.length>s;s++)n[s]&&(n[s].__=t,e=Ra(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Ca(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Ma(t,e,r,i){var n,s,o,a=t.key,u=t.type,l=e[r],h=null!=l&&0==(2&l.__u);if(null===l&&null==a||h&&a==l.key&&u==l.type)return r;if(i>(h?1:0))for(n=r-1,s=r+1;n>=0||e.length>s;)if(null!=(l=e[o=0>n?s++:n--])&&0==(2&l.__u)&&a==l.key&&u==l.type)return o;return-1}function Oa(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||ma.test(e)?r:r+"px"}function Pa(t,e,r,i,n){var s,o;t:if("style"==e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||Oa(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||Oa(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(ha,"$1")),o=e.toLowerCase(),e=o in t||"onFocusOut"==e||"onFocusIn"==e?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?i?r.u=i.u:(r.u=ca,t.addEventListener(e,s?va:da,s)):t.removeEventListener(e,s?va:da,s);else{if("http://www.w3.org/2000/svg"==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&&"popover"!=e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==r?"":r))}}function La(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e.t)e.t=ca++;else if(r.u>e.t)return;return r(na.event?na.event(e):e)}}}function Aa(t,e,r,i,n,s,o,a,u,l){var h,c,d,v,f,p,g,m,y,b,_,$,w,x,S,k,C,T=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(u=!!(32&r.__u),s=[a=e.__e=r.__e]),(h=na.__b)&&h(e);t:if("function"==typeof T)try{if(m=e.props,y="prototype"in T&&T.prototype.render,b=(h=T.contextType)&&i[h.__c],_=h?b?b.props.value:h.__:i,r.__c?g=(c=e.__c=r.__c).__=c.__E:(y?e.__c=c=new T(m,_):(e.__c=c=new ka(m,_),c.constructor=T,c.render=ja),b&&b.sub(c),c.state||(c.state={}),c.__n=i,d=c.__d=!0,c.__h=[],c._sb=[]),y&&null==c.__s&&(c.__s=c.state),y&&null!=T.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=ba({},c.__s)),ba(c.__s,T.getDerivedStateFromProps(m,c.__s))),v=c.props,f=c.state,c.__v=e,d)y&&null==T.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),y&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(y&&null==T.getDerivedStateFromProps&&m!==v&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(m,_),e.__v==r.__v||!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(m,c.__s,_)){for(e.__v!=r.__v&&(c.props=m,c.state=c.__s,c.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some((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,_),y&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(v,f,p)}))}if(c.context=_,c.props=m,c.__P=t,c.__e=!1,w=na.__r,x=0,y){for(c.state=c.__s,c.__d=!1,w&&w(e),h=c.render(c.props,c.state,c.context),S=0;c._sb.length>S;S++)c.__h.push(c._sb[S]);c._sb=[]}else do{c.__d=!1,w&&w(e),h=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&25>++x);c.state=c.__s,null!=c.getChildContext&&(i=ba(ba({},i),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),k=h,null!=h&&h.type===Sa&&null==h.key&&(k=$a(h.props.children)),a=Ea(t,ya(k)?k:[k],e,r,i,n,s,o,a,u,l),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),g&&(c.__E=c.__=null)}catch(t){if(e.__v=null,u||null!=s)if(t.then){for(e.__u|=u?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else{for(C=s.length;C--;)_a(s[C]);Na(e)}else e.__e=r.__e,e.__k=r.__k,t.then||Na(e);na.__e(t,e,r)}else null==s&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=function(t,e,r,i,n,s,o,a,u){var l,h,c,d,v,f,p,g=r.props||pa,m=e.props,y=e.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=s)for(l=0;s.length>l;l++)if((v=s[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,s[l]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),a&&(na.__m&&na.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s=s&&ia.call(t.childNodes),!a&&null!=s)for(g={},l=0;t.attributes.length>l;l++)g[(v=t.attributes[l]).name]=v.value;for(l in g)if(v=g[l],"children"==l);else if("dangerouslySetInnerHTML"==l)c=v;else if(!(l in m)){if("value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m)continue;Pa(t,l,null,v,n)}for(l in m)v=m[l],"children"==l?d=v:"dangerouslySetInnerHTML"==l?h=v:"value"==l?f=v:"checked"==l?p=v:a&&"function"!=typeof v||g[l]===v||Pa(t,l,v,g[l],n);if(h)a||c&&(h.__html==c.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),Ea("template"==e.type?t.content:t,ya(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&Ca(r,0),a,u),null!=s)for(l=s.length;l--;)_a(s[l]);a||(l="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[l]||"progress"==y&&!f||"option"==y&&f!=g[l])&&Pa(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&Pa(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,s,o,u,l);return(h=na.diffed)&&h(e),128&e.__u?void 0:a}function Na(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Na)}function Fa(t,e,r){for(var i=0;r.length>i;i++)Da(r[i],r[++i],r[++i]);na.__c&&na.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){na.__e(t,e.__v)}}))}function $a(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:ya(t)?t.map($a):ba({},t)}function Da(t,e,r){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){na.__e(t,r)}}function qa(t,e,r){var i,n;if(na.unmount&&na.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Da(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){na.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(n=0;i.length>n;n++)i[n]&&qa(i[n],e,r||"function"!=typeof t.type);r||_a(t.__e),t.__c=t.__=t.__e=void 0}function ja(t,e,r){return this.constructor(t,r)}function Ua(t,e,r){var i,n,s;e==document&&(e=document.documentElement),na.__&&na.__(t,e),i=e.__k,n=[],s=[],Aa(e,t=e.__k=wa(Sa,null,[t]),i||pa,pa,e.namespaceURI,i?null:e.firstChild?ia.call(e.childNodes):null,n,i?i.__e:e.firstChild,!1,s),Fa(n,t,s)}ia=ga.slice,na={__e(t,e,r,i){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,i||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},sa=0,ka.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=ba({},this.state),"function"==typeof t&&(t=t(ba({},r),this.props)),t&&ba(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),Ia(this))},ka.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ia(this))},ka.prototype.render=Sa,oa=[],ua="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,la=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,ha=/(PointerCapture)$|Capture$/i,ca=0,da=La(!1),va=La(!0),fa=0;var Ha,Ba,za,Va,Wa=0,Za=[],Ga=na,Qa=Ga.__b,Ja=Ga.__r,Ka=Ga.diffed,Ya=Ga.__c,Xa=Ga.unmount,tu=Ga.__;function eu(t,e){Ga.__h&&Ga.__h(Ba,t,Wa||e),Wa=0;var r=Ba.__H||(Ba.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function ru(t){return Wa=1,function(t,e,r){var i=eu(Ha++,2);if(i.t=t,!i.__c&&(i.__=[vu(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],r=i.t(e,t);e!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=Ba,!Ba.__f)){var n=function(t,e,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(t){return!!t.__c}));if(n.every((function(t){return!t.__N})))return!s||s.call(this,t,e,r);var o=i.__c.props!==t;return n.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(o=!0)}})),s&&s.call(this,t,e,r)||o};Ba.__f=!0;var s=Ba.shouldComponentUpdate,o=Ba.componentWillUpdate;Ba.componentWillUpdate=function(t,e,r){if(this.__e){var i=s;s=void 0,n(t,e,r),s=i}o&&o.call(this,t,e,r)},Ba.shouldComponentUpdate=n}return i.__N||i.__}(vu,t)}function iu(t,e){var r=eu(Ha++,3);!Ga.__s&&du(r.__H,e)&&(r.__=t,r.u=e,Ba.__H.__h.push(r))}function nu(t){return Wa=5,su((function(){return{current:t}}),[])}function su(t,e){var r=eu(Ha++,7);return du(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function ou(t){var e=Ba.context[t.__c],r=eu(Ha++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(Ba)),e.props.value):t.__}function au(){for(var t;t=Za.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(hu),t.__H.__h.forEach(cu),t.__H.__h=[]}catch(e){t.__H.__h=[],Ga.__e(e,t.__v)}}Ga.__b=function(t){Ba=null,Qa&&Qa(t)},Ga.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),tu&&tu(t,e)},Ga.__r=function(t){Ja&&Ja(t),Ha=0;var e=(Ba=t.__c).__H;e&&(za===Ba?(e.__h=[],Ba.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach(hu),e.__h.forEach(cu),e.__h=[],Ha=0)),za=Ba},Ga.diffed=function(t){Ka&&Ka(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Za.push(e)&&Va===Ga.requestAnimationFrame||((Va=Ga.requestAnimationFrame)||lu)(au)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),za=Ba=null},Ga.__c=function(t,e){e.some((function(t){try{t.__h.forEach(hu),t.__h=t.__h.filter((function(t){return!t.__||cu(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],Ga.__e(r,t.__v)}})),Ya&&Ya(t,e)},Ga.unmount=function(t){Xa&&Xa(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{hu(t)}catch(t){e=t}})),r.__H=void 0,e&&Ga.__e(e,r.__v))};var uu="function"==typeof requestAnimationFrame;function lu(t){var e,r=function(){clearTimeout(i),uu&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);uu&&(e=requestAnimationFrame(r))}function hu(t){var e=Ba,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Ba=e}function cu(t){var e=Ba;t.__c=t.__(),Ba=e}function du(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function vu(t,e){return"function"==typeof e?e(t):e}var fu={Activation:"events",Cancellation:"cancelEvents"},pu={Button:"button",Tab:"tab",Selector:"selector"},gu={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},mu={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},yu={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},bu={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},_u={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},wu={Once:"once",Recurring:"recurring",Always:"always"},xu={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Su={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},ku={Popover:"popover",Inline:"inline"};function Cu(t){return"$survey_response_"+t}function Tu(t,e){if(!e)return null;var r=t[Cu(e)];return hr(r)?[...r]:r}function Iu(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!fr(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=Tu(t,e.id);fr(s)||(i[n]=s)}})),r({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:Tu(t,e.id)})))},t,i)}function Eu(t,e){var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r}function Ru(t){return"string"==typeof t&&t.trim()?t.trim():null}function Mu(t){return t.toLowerCase()}function Ou(t,e,r){if(!t||!e)return null;var i=Mu(e),n=Object.keys(t).find((t=>Mu(t)===i));if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var s=i.split("-")[0],o=Object.keys(t).find((t=>Mu(t)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}function Pu(t,e,i){var n,s=Ou(t.translations,e,i),o=r({},t),a=!1;if(s){var u,l=null==(u=t.translations)?void 0:u[s];l&&(null==i||i.info("Applying survey-level translation for language: "+s),fr(l.name)||(o.name=l.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),fr(l.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=l.thankYouMessageHeader,a=!0),fr(l.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=l.thankYouMessageDescription,a=!0),fr(l.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=l.thankYouMessageCloseButtonText,a=!0)):function(t){return!fr(t.thankYouMessageHeader)||!fr(t.thankYouMessageDescription)||!fr(t.thankYouMessageCloseButtonText)}(l)&&(a=!0))}var h=t.questions.map((t=>function(t,e,i){var n,s=Ou(t.translations,e,i);if(!s)return{question:t,matchedKey:null,hasChanges:!1};var o=null==(n=t.translations)?void 0:n[s];if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=r({},t),u=!1;return fr(o.question)||(a.question=o.question,u=!0),fr(o.description)||(a.description=o.description,u=!0),fr(o.buttonText)||(a.buttonText=o.buttonText,u=!0),"link"in a&&!fr(o.link)&&(a.link=o.link,u=!0),"lowerBoundLabel"in a&&!fr(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,u=!0),"upperBoundLabel"in a&&!fr(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,u=!0),"choices"in a&&function(t){return hr(t.choices)}(o)&&(a.choices=o.choices,u=!0),{question:u?a:t,matchedKey:u?s:null,hasChanges:u}}(t,e,i))),c=h.map((t=>t.question)),d=h.some((t=>t.hasChanges)),v=null;return s||(v=(null==(n=h.find((t=>t.matchedKey)))?void 0:n.matchedKey)||null),d&&(o.questions=c,a=!0,null==i||i.info("Applied question-level translations for language: "+e)),{survey:o,matchedKey:a?s||v:null}}var Lu=On("[Surveys]");function Au(t){return!(!t.start_date||t.end_date)}function Nu(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Fu(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var $u="seenSurvey_",Du="inProgressSurvey_",qu=(t,e)=>{var r=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(r=""+t+e.id+"_"+e.current_iteration),r},ju=t=>qu($u,t),Uu=t=>{try{var e=ju(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Lu.error("Failed to persist survey seen state",t)}},Hu=[yu.Popover,yu.Widget,yu.API],Bu={ignoreConditions:!1,ignoreDelay:!1,displayType:ku.Popover};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return br(t)&&isFinite(t)&&Math.floor(t)===t});class zu{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,r,i){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>e||0>r||0>i||t>0xffffffffffff||e>4095||r>1073741823||i>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|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new zu(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),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 zu(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}}class Vu{constructor(){this.S=0,this.C=0,this.I=new Gu}generate(){var t=this.generateOrAbort();if(fr(t)){this.S=0;var e=this.generateOrAbort();if(fr(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.S)this.S=t,this.T();else{if(this.S>=t+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.T())}return zu.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}T(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var Wu,Zu=t=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};pn&&!fr(pn.crypto)&&crypto.getRandomValues&&(Zu=t=>crypto.getRandomValues(t));class Gu{constructor(){this.M=new Uint32Array(8),this.O=1/0}nextUint32(){return this.M.length>this.O||(Zu(this.M),this.O=0),this.M[this.O++]}}var Qu=()=>Ju().toString(),Ju=()=>(Wu||(Wu=new Vu)).generate(),Ku=["fatal","error","warning","log","info","debug"],Yu={GZipJS:"gzip-js",Base64:"base64"},Xu=Uint8Array,tl=Uint16Array,el=Uint32Array,rl=new Xu([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]),il=new Xu([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]),nl=new Xu([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),sl=function(t,e){for(var r=new tl(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new el(r[30]);for(i=1;30>i;++i)for(var s=r[i];r[i+1]>s;++s)n[s]=s-r[i]<<5|i;return[r,n]},ol=sl(rl,2),al=ol[1];ol[0][28]=258,al[258]=28;for(var ul=sl(il,0)[1],ll=new tl(32768),hl=0;32768>hl;++hl){var cl=(43690&hl)>>>1|(21845&hl)<<1;ll[hl]=((65280&(cl=(61680&(cl=(52428&cl)>>>2|(13107&cl)<<2))>>>4|(3855&cl)<<4))>>>8|(255&cl)<<8)>>>1}var dl=function(t,e,r){for(var i=t.length,n=0,s=new tl(e);i>n;++n)++s[t[n]-1];var o,a=new tl(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new tl(1<<e);var u=15-e;for(n=0;i>n;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],c=a[t[n]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)o[ll[c]>>>u]=l}else for(o=new tl(i),n=0;i>n;++n)o[n]=ll[a[t[n]-1]++]>>>15-t[n];return o},vl=new Xu(288);for(hl=0;144>hl;++hl)vl[hl]=8;for(hl=144;256>hl;++hl)vl[hl]=9;for(hl=256;280>hl;++hl)vl[hl]=7;for(hl=280;288>hl;++hl)vl[hl]=8;var fl=new Xu(32);for(hl=0;32>hl;++hl)fl[hl]=5;var pl=dl(vl,9,0),gl=dl(fl,5,0),ml=function(t){return(t/8>>0)+(7&t&&1)},yl=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof tl?tl:t instanceof el?el:Xu)(r-e);return i.set(t.subarray(e,r)),i},bl=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},_l=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},wl=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,s=r.slice();if(!n)return[new Xu(0),0];if(1==n){var o=new Xu(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(t,e){return t.f-e.f})),r.push({s:-1,f:25001});var a=r[0],u=r[1],l=0,h=1,c=2;for(r[0]={s:-1,f:a.f+u.f,l:a,r:u};h!=n-1;)a=r[r[c].f>r[l].f?l++:c++],u=r[l!=h&&r[c].f>r[l].f?l++:c++],r[h++]={s:-1,f:a.f+u.f,l:a,r:u};var d=s[0].s;for(i=1;n>i;++i)s[i].s>d&&(d=s[i].s);var v=new tl(d+1),f=xl(r[h-1],v,0);if(f>e){i=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}));n>i;++i){var y=s[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=s[i].s;e>v[b]?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var _=s[i].s;v[_]==e&&(--v[_],++p)}f=e}return[new Xu(v),f]},xl=function(t,e,r){return-1==t.s?Math.max(xl(t.l,e,r+1),xl(t.r,e,r+1)):e[t.s]=r},Sl=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new tl(++e),i=0,n=t[0],s=1,o=function(t){r[i++]=t},a=1;e>=a;++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[r.subarray(0,i),e]},kl=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Cl=function(t,e,r){var i=r.length,n=ml(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;i>s;++s)t[n+s+4]=r[s];return 8*(n+4+i)},Tl=function(t,e,r,i,n,s,o,a,u,l,h){bl(e,h++,r),++n[256];for(var c=wl(n,15),d=c[0],v=c[1],f=wl(s,15),p=f[0],g=f[1],m=Sl(d),y=m[0],b=m[1],_=Sl(p),w=_[0],x=_[1],S=new tl(19),k=0;y.length>k;++k)S[31&y[k]]++;for(k=0;w.length>k;++k)S[31&w[k]]++;for(var C=wl(S,7),T=C[0],I=C[1],E=19;E>4&&!T[nl[E-1]];--E);var R,M,O,P,L=l+5<<3,A=kl(n,vl)+kl(s,fl)+o,N=kl(n,d)+kl(s,p)+o+14+3*E+kl(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(A>=L&&N>=L)return Cl(e,h,t.subarray(u,u+l));if(bl(e,h,1+(A>N)),h+=2,A>N){R=dl(d,v,0),M=d,O=dl(p,g,0),P=p;var F=dl(T,I,0);for(bl(e,h,b-257),bl(e,h+5,x-1),bl(e,h+10,E-4),h+=14,k=0;E>k;++k)bl(e,h+3*k,T[nl[k]]);h+=3*E;for(var D=[y,w],q=0;2>q;++q){var j=D[q];for(k=0;j.length>k;++k)bl(e,h,F[U=31&j[k]]),h+=T[U],U>15&&(bl(e,h,j[k]>>>5&127),h+=j[k]>>>12)}}else R=pl,M=vl,O=gl,P=fl;for(k=0;a>k;++k)if(i[k]>255){var U;_l(e,h,R[257+(U=i[k]>>>18&31)]),h+=M[U+257],U>7&&(bl(e,h,i[k]>>>23&31),h+=rl[U]);var H=31&i[k];_l(e,h,O[H]),h+=P[H],H>3&&(_l(e,h,i[k]>>>5&8191),h+=il[H])}else _l(e,h,R[i[k]]),h+=M[i[k]];return _l(e,h,R[256]),h+M[256]},Il=new el([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),El=function(){for(var t=new el(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Rl=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Ml(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=El[255&r^e[i]]^r>>>8;t=r},d(){return 4294967295^t}}}(),i=t.length;r.p(t);var n,s,o,a,u=(n=t,s=e,o=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),a=8,function(t,e,r,i,n,s){var o=t.length,a=new Xu(i+o+5*(1+Math.floor(o/7e3))+n),u=a.subarray(i,a.length-n),l=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var c=h+65535;o>c?l=Cl(u,l,t.subarray(h,c)):(u[h]=!0,l=Cl(u,l,t.subarray(h,o)))}else{for(var d=Il[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new tl(32768),m=new tl(p+1),y=Math.ceil(r/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new el(25e3),x=new tl(288),S=new tl(32),k=0,C=0,T=(h=0,0),I=0,E=0;o>h;++h){var R=_(h),M=32767&h,O=m[R];if(g[M]=O,m[R]=M,h>=I){var P=o-h;if((k>7e3||T>24576)&&P>423){l=Tl(t,u,0,w,x,S,C,T,E,h-E,l),T=k=C=0,E=h;for(var L=0;286>L;++L)x[L]=0;for(L=0;30>L;++L)S[L]=0}var A=2,N=0,F=f,D=M-O&32767;if(P>2&&R==_(h-D))for(var q=Math.min(v,P)-1,j=Math.min(32767,h),U=Math.min(258,P);j>=D&&--F&&M!=O;){if(t[h+A]==t[h+A-D]){for(var H=0;U>H&&t[h+H]==t[h+H-D];++H);if(H>A){if(A=H,N=D,H>q)break;var B=Math.min(D,H-2),z=0;for(L=0;B>L;++L){var V=h-D+L+32768&32767,W=V-g[V]+32768&32767;W>z&&(z=W,O=V)}}}D+=(M=O)-(O=g[M])+32768&32767}if(N){w[T++]=268435456|al[A]<<18|ul[N];var Z=31&al[A],G=31&ul[N];C+=rl[Z]+il[G],++x[257+Z],++S[G],I=h+A,++k}else w[T++]=t[h],++x[t[h]]}}l=Tl(t,u,!0,w,x,S,C,T,E,h-E,l)}return yl(a,0,i+ml(l)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,o,a)),l=u.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Rl(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}}(u,e),Rl(u,l-8,r.d()),Rl(u,l-4,i),u}var Ol=!!wn||!!_n,Pl="text/plain",Ll=!1,Al=(t,e)=>{var[r,i]=t.split("#"),[n,s]=r.split("?");if(!s)return t;var o=s.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return n+(o?"?"+o:"")+(i?"#"+i:"")},Nl=function(t,e,i){var n;void 0===i&&(i=!0);var[s,o]=t.split("?"),a=r({},e),u=null!==(n=null==o?void 0:o.split("&").map((t=>{var e,[r,n]=t.split("="),s=i&&null!==(e=a[r])&&void 0!==e?e:n;return delete a[r],r+"="+s})))&&void 0!==n?n:[],l=zn(a);return l&&u.push(l),s+"?"+u.join("&")},Fl=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),$l=t=>{if(t.tr)return t.tr;var{data:e,compression:r}=t;if(e){if(r===Yu.GZipJS){var i=Ml(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new Xu(t.length+(t.length>>>1)),n=0,s=function(t){i[n++]=t},o=0;r>o;++o){if(n+5>i.length){var a=new Xu(n+8+(r-o<<1));a.set(i),i=a}var u=t.charCodeAt(o);128>u?s(u):2048>u?(s(192|u>>>6),s(128|63&u)):u>55295&&57344>u?(s(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++o))>>>18),s(128|u>>>12&63),s(128|u>>>6&63),s(128|63&u)):(s(224|u>>>12),s(128|u>>>6&63),s(128|63&u))}return yl(i,0,n)}(Fl(e)),{mtime:0});return{contentType:Pl,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===Yu.Base64){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Fl(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Fl(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Fl(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Dl=t=>{var e,i,n,s=$l(t);return!s||(i=t.compression,n=Vn(t.url,"compression"),i!==Ze.GZipJS&&n!==Ze.GZipJS&&"gzip"!==n)||((e=s.body)instanceof ArrayBuffer?Ke(new Uint8Array(e)):ArrayBuffer.isView(e)&&Ke(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))?{url:t.url,encodedBody:s}:(Ll=!0,{url:Al(t.url,"compression"),encodedBody:$l(r({},t,{compression:void 0,tr:void 0}))})},ql=function(){var t=e((function*(t){var e=Fl(t.data),i=yield function(t,e,r){return er.apply(this,arguments)}(e,En.DEBUG,{rethrow:!0});if(!i)return t;var n=yield i.arrayBuffer();return r({},t,{tr:{contentType:Pl,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),jl=(t,e)=>Nl(t,{_:(new Date).getTime().toString(),ver:En.JS_SDK_VERSION,compression:e}),Ul=[];_n&&Ul.push({transport:"fetch",method(t){var e,{url:i,encodedBody:n}=Dl(t),{contentType:s,body:o,estimatedSize:a}=null!=n?n:{},u=new Headers;Ln(t.headers,(function(t,e){u.append(e,t)})),s&&u.append("Content-Type",s);var l=null;if(xn){var h=new xn;l={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}_n(i,r({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&52428.8>(a||0),body:o,signal:null==(e=l)?void 0:e.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){Mn.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{Mn.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>l?clearTimeout(l.timeout):null))}}),wn&&Ul.push({transport:"XHR",method(t){var e=new wn,{url:r,encodedBody:i}=Dl(t);e.open(t.method||"GET",r,!0);var{contentType:n,body:s}=null!=i?i:{};Ln(t.headers,(function(t,r){e.setRequestHeader(r,t)})),n&&e.setRequestHeader("Content-Type",n),t.timeout&&(e.timeout=t.timeout),t.disableXHRCredentials||(e.withCredentials=!0),e.onreadystatechange=()=>{if(4===e.readyState){var r={statusCode:e.status,text:e.responseText};if(200===e.status)try{r.json=JSON.parse(e.responseText)}catch(t){}null==t.callback||t.callback(r)}},e.send(s)}}),null!=mn&&mn.sendBeacon&&Ul.push({transport:"sendBeacon",method(t){try{var{url:e,encodedBody:r}=Dl(t),i=Nl(e,{beacon:"1"}),{contentType:n,body:s}=null!=r?r:{};if(!s)return;var o=s instanceof Blob?s:new Blob([s],{type:n});mn.sendBeacon(i,o)}catch(t){}}});var Hl=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 Bl(t,e,r){return Fl({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var zl={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=>Hl(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Hl(e,t))))),icontains:(t,e)=>e.map(Vl).some((e=>t.map(Vl).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Vl).every((e=>t.map(Vl).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var r=parseFloat(e);return!isNaN(r)&&t.some((t=>r<parseFloat(t)))}))},Vl=t=>t.toLowerCase();function Wl(t,e){return!t||Object.entries(t).every((t=>{var[r,i]=t,n=null==e?void 0:e[r];if(fr(n)||mr(n))return!1;var s=[String(n)],o=zl[i.operator];return!!o&&o(i.values,s)}))}var Zl="",Gl=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Ql={R:()=>!!yn,D(t){Mn.error("cookieStore error: "+t)},A(t){if(yn){try{for(var e=t+"=",r=yn.cookie.split(";").filter((t=>t.length)),i=0;r.length>i;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},F(t){var e;try{e=JSON.parse(Ql.A(t))||{}}catch(t){}return e},N(t,e,r,i,n){if(yn)try{var s="",o="",a=function(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=yn),Zl)return Zl;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var r=t.split("."),i=Math.min(r.length,8),n="dmn_chk_"+Qu();!Zl&&i--;){var s=r.slice(i).join("."),o=n+"=1;domain=."+s+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(n)&&(e.cookie=o+";max-age=0",Zl=s)}return Zl}(t);if(!r){var i=(t=>{var e=t.match(Gl);return e?e[0]:""})(t);i!==r&&Mn.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(yn.location.hostname,i);if(r){var u=new Date;u.setTime(u.getTime()+864e5*r),s="; expires="+u.toUTCString()}n&&(o="; secure");var l=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&Mn.warn("cookieStore warning: large cookie, len="+l.length),yn.cookie=l,l}catch(t){return}},q(t,e){if(null!=yn&&yn.cookie)try{Ql.N(t,"",-1,e)}catch(t){return}}},Jl=null,Kl={R(){if(!mr(Jl))return Jl;var t=!0;if(fr(pn))t=!1;else try{var e="__mplssupport__";Kl.N(e,"xyz"),'"xyz"'!==Kl.A(e)&&(t=!1),Kl.q(e)}catch(e){t=!1}return t||Mn.error("localStorage unsupported; falling back to cookie store"),Jl=t,t},D(t){Mn.error("localStorage error: "+t)},A(t){try{return null==pn?void 0:pn.localStorage.getItem(t)}catch(t){Kl.D(t)}return null},F(t){try{return JSON.parse(Kl.A(t))||{}}catch(t){}return null},N(t,e){try{null==pn||pn.localStorage.setItem(t,JSON.stringify(e))}catch(t){Kl.D(t)}},q(t){try{null==pn||pn.localStorage.removeItem(t)}catch(t){Kl.D(t)}}},Yl=[Kn,"distinct_id",fs,ps,qs,Ds,Ls],Xl={},th={R:()=>!0,D(t){Mn.error("memoryStorage error: "+t)},A:t=>Xl[t]||null,F:t=>Xl[t]||null,N(t,e){Xl[t]=e},q(t){delete Xl[t]}},eh=null,rh={R(){if(!mr(eh))return eh;if(eh=!0,fr(pn))eh=!1;else try{var t="__support__";rh.N(t,"xyz"),'"xyz"'!==rh.A(t)&&(eh=!1),rh.q(t)}catch(t){eh=!1}return eh},D(t){Mn.error("sessionStorage error: ",t)},A(t){try{return null==pn?void 0:pn.sessionStorage.getItem(t)}catch(t){rh.D(t)}return null},F(t){try{return JSON.parse(rh.A(t))||null}catch(t){}return null},N(t,e){try{null==pn||pn.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){rh.D(t)}},q(t){try{null==pn||pn.sessionStorage.removeItem(t)}catch(t){rh.D(t)}}},ih=On("[Stylesheet Loader]"),nh=pn,sh=yn,oh="#020617",ah={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:gu.Right,widgetType:pu.Tab,widgetLabel:"Feedback",widgetColor:"black",zIndex:String(2147483645),disabledButtonOpacity:"0.6",maxWidth:"300px",textSubtleColor:"#939393",boxPadding:"20px 24px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"10px",shuffleQuestions:!1,surveyPopupDelaySeconds:void 0,outlineColor:"rgba(59, 130, 246, 0.8)",inputBackground:"white",inputTextColor:oh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},uh=[gu.Center,gu.Left,gu.Right];function lh(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 hh(t){var e;void 0===t&&(t=ah.backgroundColor),"#"===t[0]&&(e=lh(t)),t.startsWith("rgb")&&(e=t);var r={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(r&&(e=lh(r)),!e)return oh;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),s=parseInt(i[2]),o=parseInt(i[3]);return Math.sqrt(n*n*.299+s*s*.587+o*o*.114)>127.5?oh:"white"}return oh}var ch=(t,e,i)=>{var n=Rh(t),s=sh.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=sh.createElement("div");((t,e,i)=>{var n=r({},ah,i),s=t.style,o=!uh.includes(n.position)||e===yu.Widget&&(null==i?void 0:i.widgetType)===pu.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==i?void 0:i.submitButtonTextColor)||hh(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",hh(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||hh(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",hh(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var a=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),u=a||n.inputBackground;a||"white"!==n.backgroundColor||(u="#f8f8f8"),s.setProperty("--ph-survey-input-background",u);var l=(null==i?void 0:i.inputTextColor)||hh(u);s.setProperty("--ph-survey-input-text-color",l),s.setProperty("--ph-survey-rating-text-color",l),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"}),u=function(t){var e=((t,e,r)=>{var i,n=sh.createElement("style");return n.innerText=':host{--ph-survey-font-family:-apple-system,BlinkMacSystemFont,"Inter","Segoe UI","Roboto",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:2147483645;--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px rgba(0,0,0,.15);--ph-survey-submit-button-color:#000;--ph-survey-submit-button-text-color:#fff;--ph-survey-rating-bg-color:#fff;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:#000;--ph-survey-rating-active-text-color:#fff;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:#fff;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:rgba(59,130,246,.8);--ph-survey-input-background:#fff;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:0.6}.ph-survey{bottom:0;height:fit-content;margin:0;max-width:85%;min-width:300px;position:fixed;width:var(--ph-survey-max-width);z-index:var(--ph-survey-z-index)}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;color:var(--ph-survey-text-primary-color);font-family:var(--ph-survey-font-family)}.ph-survey .multiple-choice-options label,.ph-survey input[type=text],.ph-survey textarea{background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;color:var(--ph-survey-input-text-color);padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input[type=text],.ph-survey textarea{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus,.ph-survey input[type=radio]:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey textarea:focus,.ph-survey textarea:focus-visible{border-color:var(--ph-survey-rating-active-bg-color);outline:1.5px solid var(--ph-survey-outline-color);outline-offset:2px}.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey textarea:focus:not(:focus-visible){outline:none}.ph-survey input[type=text]:hover:not(:focus),.ph-survey textarea:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey input[type=text],.ph-survey textarea{font-size:1rem}}.ph-survey .form-cancel,.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit,.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey label{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);border:none;border-radius:3px 3px 0 0;color:var(--ph-widget-text-color);cursor:pointer;padding:10px 12px;position:fixed;text-align:center;transition:padding .2s ease-out;z-index:var(--ph-survey-z-index)}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{gap:16px}.bottom-section,.survey-box{display:flex;flex-direction:column}.bottom-section{gap:8px}.thank-you-message-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message{display:flex;flex-direction:column;gap:8px}.survey-question{font-size:14px;font-weight:500}.survey-question-description{font-size:13px;opacity:.8;padding-top:4px}.survey-question-description,.thank-you-message-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body) embed,:is(.survey-question-description,.thank-you-message-body) iframe,:is(.survey-question-description,.thank-you-message-body) img,:is(.survey-question-description,.thank-you-message-body) object,:is(.survey-question-description,.thank-you-message-body) video{height:auto;max-width:100%}:is(.survey-question-description,.thank-you-message-body) svg{height:auto;max-width:100%}.question-textarea-wrapper{display:flex;flex-direction:column}.survey-form{animation:ph-survey-fade-in .3s ease-out forwards}.survey-form,.thank-you-message{background:var(--ph-survey-background-color);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);margin:0;padding:var(--ph-survey-box-padding);position:relative;text-align:left;width:100%;z-index:var(--ph-survey-z-index)}.survey-form input[type=text],.survey-form textarea{min-width:100%}:is(.survey-form textarea):focus,:is(.survey-form textarea):focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.08)}:is(.survey-form textarea):focus:not(:focus-visible){box-shadow:none}.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options,.survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea{margin-top:0}.multiple-choice-options{border:none;display:flex;flex-direction:column;font-size:14px;gap:8px;margin:0;padding:1px 0}.multiple-choice-options .response-choice,.multiple-choice-options label{align-items:center;color:inherit;display:flex;gap:8px}.multiple-choice-options label{cursor:pointer;font-size:13px}:is(.multiple-choice-options label):hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px rgba(0,0,0,.08)}:is(.multiple-choice-options label):has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px rgba(0,0,0,.05)}.choice-option-open:is(.multiple-choice-options label){flex-wrap:wrap}:is(.multiple-choice-options label) span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:var(--ph-survey-input-background);border-radius:3px;cursor:pointer;flex-shrink:0;height:1rem;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;width:1rem;z-index:1}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{animation:ph-survey-checkmark-reveal .2s ease-out .1s forwards;border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;height:8px;left:4px;transform:rotate(45deg) scale(0);width:4px}.multiple-choice-options input[type=radio]:checked:after{animation:ph-survey-radio-reveal .15s ease-out .05s forwards;background:var(--ph-survey-rating-active-text-color);border-radius:50%;height:6px;left:5px;top:5px;transform:scale(0);width:6px}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{box-sizing:content-box;content:"";position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}:is(:is(.multiple-choice-options .choice-option-open) input[type=text])::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{display:flex;justify-content:space-between}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{background-color:transparent;border:none;font-size:16px;opacity:.5;padding:0}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;overflow:hidden}.rating-options-number .ratings-number{border:none;border-right:1px solid var(--ph-survey-border-color);color:var(--ph-survey-rating-text-color);cursor:pointer;font-weight:700;text-align:center}:is(.rating-options-number .ratings-number):last-of-type{border-right:0}.rating-active:is(.rating-options-number .ratings-number){background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb,var(--ph-survey-rating-active-bg-color) 14%,var(--ph-survey-rating-bg-color))}}.rating-text{display:flex;flex-direction:row;font-size:11px;justify-content:space-between;opacity:.7}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.validation-hint{font-size:12px;margin-top:4px;opacity:.7}.form-cancel{background:#fff;border-radius:100%;cursor:pointer;line-height:0;padding:12px;position:absolute;right:0;top:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%) scale(1.1)}.footer-branding{align-items:center;display:flex;font-size:11px;font-weight:500;gap:4px;justify-content:center;opacity:.6;text-decoration:none}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{font-size:14px;opacity:.8}.limit-height{max-height:256px;overflow-x:hidden;overflow-y:auto;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);scrollbar-width:thin}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}:is(.limit-height::-webkit-scrollbar-thumb):hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}@media (prefers-reduced-motion:reduce){.ph-survey *{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg) scale(0)}50%{opacity:1;transform:rotate(45deg) scale(1.2)}to{opacity:1;transform:rotate(45deg) scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',null!=r&&null!=(i=r.config)&&i.prepare_external_dependency_stylesheet&&(n=r.config.prepare_external_dependency_stylesheet(n)),n||(ih.error("prepare_external_dependency_stylesheet returned null"),null)})(0,0,t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(u){var l=a.querySelector("style");l&&a.removeChild(l),a.appendChild(u)}return sh.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},dh=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a,surveyLanguage:u}=t;s?(Uu(i),s.capture(xu.SENT,r({[Su.SURVEY_NAME]:i.name,[Su.SURVEY_ID]:i.id,[Su.SURVEY_ITERATION]:i.current_iteration,[Su.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Su.SURVEY_SUBMISSION_ID]:n,[Su.SURVEY_COMPLETED]:o},u&&{[Su.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},Iu(e,i),a,{$set:{[Eu(i,"responded")]:!0}})),o&&(nh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Eh(i))):Lu.error("[survey sent] event not captured, PostHog instance not found.")},vh=(t,e,i)=>{return r({[Su.SURVEY_NAME]:t.name,[Su.SURVEY_ID]:t.id,[Su.SURVEY_ITERATION]:t.current_iteration,[Su.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Su.SURVEY_PARTIALLY_COMPLETED]:(n=null==e?void 0:e.responses,void 0===n&&(n={}),Object.values(n).some((t=>!yr(t))))},(null==e?void 0:e.surveyLanguage)&&{[Su.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Su.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},Iu(null==e?void 0:e.responses,t));var n},fh=(t,e,i,n)=>{if(e){if(!i){var s=Th(t);e.capture(xu.DISMISSED,r({},vh(t,s,e),n&&{[Su.SURVEY_LANGUAGE]:n},{$set:{[Eu(t,"dismissed")]:!0}})),Eh(t),Uu(t),nh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Lu.error("[survey dismissed] event not captured, PostHog instance not found.")},ph=(t,e)=>{if(e){var r=(t=>qu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=Th(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(xu.ABANDONED,vh(t,i,e),{transport:"sendBeacon"})}}else Lu.error("[survey abandoned] event not captured, PostHog instance not found.")},gh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),mh=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,yh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?mh(t.questions,gh(t.questions)):t.questions,bh=t=>{var e;return!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation||!(t=>{var e,r;return null!=(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)?void 0:e.length)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})(t))||t.schedule===wu.Always||Ih(t)},_h=function(t){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&r.forEach((function(t){t.__e=!0,Ia(t)}))},this.sub=function(t){r.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r&&r.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+fa++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),wh=()=>ou(_h),xh=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return function(t,e,r){var i,n,s,o,a=ba({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)"key"==s?i=e[s]:"ref"==s?n=e[s]:a[s]=void 0===e[s]&&null!=o?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?ia.call(arguments,2):r),xa(t.type,a,i||t.key,n||t.ref,null)}(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function Sh(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==nh||null==(r=nh.location)?void 0:r.href;if(!n)return!1;var s=[t.conditions.url],o=function(t){return null!=t?t:"icontains"}(null==(i=t.conditions)?void 0:i.urlMatchType);return zl[o](s,[n])}var kh=t=>{var e=""+Du+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Du+t.id+"_"+t.current_iteration),e},Ch=(t,e)=>{try{localStorage.setItem(kh(t),JSON.stringify(e))}catch(t){Lu.error("Error setting in-progress survey state in localStorage",t)}},Th=t=>{try{var e=localStorage.getItem(kh(t));if(e)return JSON.parse(e)}catch(t){Lu.error("Error getting in-progress survey state from localStorage",t)}return null},Ih=t=>{var e=Th(t);return!yr(null==e?void 0:e.surveySubmissionId)},Eh=t=>{try{localStorage.removeItem(kh(t))}catch(t){Lu.error("Error clearing in-progress survey state from localStorage",t)}};function Rh(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function Mh(t,e,r){if(void 0===e&&(e=gu.Right),t===yu.ExternalSurvey)return{};switch(e){case gu.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case gu.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case gu.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case gu.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case gu.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case gu.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case gu.Left:return{left:"30px"};case gu.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===yu.Widget&&r===pu.Tab?"60px":"30px"}}}var Oh=0;function Ph(t,e,r,i,n,s){e||(e={});var o,a,u=e;if("ref"in u)for(a in u={},e)"ref"==a?o=e[a]:u[a]=e[a];var l={type:t,props:u,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Oh,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(o=t.defaultProps))for(a in o)void 0===u[a]&&(u[a]=o[a]);return na.vnode&&na.vnode(l),l}var Lh=Ph("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ph("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"})}),Ah=Ph("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ph("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"})}),Nh=Ph("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ph("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"})}),Fh=Ph("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ph("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"})}),$h=Ph("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ph("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"})}),Dh=Ph("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ph("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2v11zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97l2.66-6.15z"})}),qh=Ph("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ph("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2V4zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4H6.55c-.7 0-1.36.37-1.72.97l-2.66 6.15z"})}),jh=function(t){var{fill:e="currentColor"}=void 0===t?{}:t;return Ph("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:e,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Ph("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Ph("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:e})]})},Uh=Ph("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ph("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ph("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ph("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ph("g",{mask:"url(#mask0_2415_6911)",children:[Ph("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"}),Ph("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"}),Ph("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"}),Ph("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"}),Ph("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"}),Ph("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"})]})]}),Ph("defs",{children:Ph("clipPath",{id:"clip0_2415_6911",children:Ph("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Hh(t){var{urlParams:e}=t,r=e?Object.entries(e).map((t=>{var[e,r]=t;return encodeURIComponent(e)+"="+encodeURIComponent(r)})).join("&"):"";return Ph("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Uh]})}function Bh(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=t,{isPreviewMode:u}=ou(_h);return Ph("div",{className:"bottom-section",children:[!a&&Ph("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==pn||pn.open(s)),u?null==o||o():n()},children:e}),!i.whiteLabel&&Ph(Hh,{urlParams:{utm_source:"survey-footer"}})]})}function zh(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return Ph("div",{class:"question-header",children:[Ph(e.type===bu.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&xh({component:wa("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function Vh(t){var{onClick:e}=t,{isPreviewMode:r}=ou(_h);return Ph("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:jh({fill:"black"})})}Ph("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ph("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 Wh=pn;function Zh(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=t,{isPopup:a}=ou(_h);return iu((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Un(Wh,"keydown",t),()=>{Wh.removeEventListener("keydown",t)}}),[o]),Ph("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Ph(Vh,{onClick:()=>o()}),Ph("h3",{className:"thank-you-message-header",children:e}),r&&xh({component:wa("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Ph(Bh,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Gh=t=>hr(t)&&t.every((t=>pr(t)));function Qh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=t,{isPreviewMode:u}=wh(),l=nu(null),[h,c]=ru((()=>pr(a)?a:""));iu((()=>{setTimeout((()=>{var t;u||null==(t=l.current)||t.focus()}),100)}),[u]);var d="surveyQuestion"+o,v=su((()=>function(t,e,r){var i,n,s=t.trim();if(!r&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var o of e)switch(o.type){case Ge.MinLength:if(void 0!==o.value&&o.value>s.length)return null!==(i=o.errorMessage)&&void 0!==i?i:"Please enter at least "+o.value+" characters";break;case Ge.MaxLength:if(void 0!==o.value&&s.length>o.value)return null!==(n=o.errorMessage)&&void 0!==n?n:"Please enter no more than "+o.value+" characters"}return!1}(h,e.validation,e.optional)),[h,e.validation,e.optional]),f=Ni(e.validation,Ge.MinLength),p=Ni(e.validation,Ge.MaxLength),g=su((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(f,p)),[f,p]),m=()=>{v||n(h.trim())},y=()=>{v||s(h.trim())};return Ph(Sa,{children:[Ph("div",{className:"question-container",children:[Ph(zh,{question:e,forceDisableHtml:r,htmlFor:d}),Ph("textarea",{ref:l,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:f,maxLength:p,onInput(t){c(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||v||(t.preventDefault(),u?y():m())},value:h}),g&&Ph("div",{className:"validation-hint",children:g})]}),Ph(Bh,{text:e.buttonText||"Submit",submitDisabled:!!v,appearance:i,onSubmit:m,onPreviewSubmit:y})]})}function Jh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=t;return Ph(Sa,{children:[Ph("div",{className:"question-container",children:Ph(zh,{question:e,forceDisableHtml:r})}),Ph(Bh,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function Kh(t){var e,{question:r,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l=r.scale,h=10===r.scale?0:1,[c,d]=ru((()=>br(u)?u:hr(u)&&u.length>0&&br(parseInt(u[0]))?parseInt(u[0]):pr(u)&&br(parseInt(u))?parseInt(u):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=wh(),p=t=>f?a(t):o(t);return Ph(Sa,{children:[Ph("div",{className:"question-container",children:[Ph(zh,{question:r,forceDisableHtml:i}),Ph("div",{className:"rating-section",children:[Ph("div",{className:"rating-options",children:["emoji"===r.display&&Ph("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(e=ic[r.scale])?void 0:e.map(((t,e)=>Ph("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===c?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;d(t),r.skipSubmitButton&&p(t)},children:t},e)))}),"number"===r.display&&Ph("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-h+1)+", minmax(0, 1fr))"},children:nc(r.scale).map(((t,e)=>Ph(Yh,{displayQuestionIndex:n,active:c===t,appearance:s,num:t,setActiveNumber(t){d(t),r.skipSubmitButton&&p(t)}},e)))})]}),!v&&Ph("div",{className:"rating-text",children:[Ph("div",{children:r.lowerBoundLabel}),Ph("div",{children:r.upperBoundLabel})]})]})]}),Ph(Bh,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:mr(c)&&!r.optional,appearance:s,onSubmit:()=>o(c),onPreviewSubmit:()=>a(c),skipSubmitButton:r.skipSubmitButton})]})}function Yh(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return Ph("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick(){n(e)},children:e})}function Xh(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l=nu(null),h=su((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=mh(e,gh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[c,d]=ru((()=>((t,e)=>pr(t)||Gh(t)?t:e===bu.SingleChoice?null:[])(u,e.type))),[v,f]=ru((()=>((t,e)=>{if(pr(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Gh(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,h))),{isPreviewMode:p}=wh(),g=e.type===bu.SingleChoice,m=e.type===bu.MultipleChoice,y=e.skipSubmitButton&&g&&!e.hasOpenChoice,b=(t,e)=>{if(e){var i=!v.isSelected;return f((t=>r({},t,{isSelected:i,inputValue:i?t.inputValue:""}))),g&&d(""),void(i&&setTimeout((()=>{var t;return null==(t=l.current)?void 0:t.focus()}),75))}if(g)return d(t),f((t=>r({},t,{isSelected:!1,inputValue:""}))),void(y&&(o(t),p&&a(t)));m&&hr(c)&&(c.includes(t)?d(c.filter((e=>e!==t))):d([...c,t]))},_=t=>{t.stopPropagation();var e=t.currentTarget.value;f((t=>r({},t,{inputValue:e}))),g&&d(e)},w=t=>{t.stopPropagation(),"Enter"!==t.key||x()||(t.preventDefault(),S()),"Escape"===t.key&&(t.preventDefault(),f((t=>r({},t,{isSelected:!1,inputValue:""}))),g&&d(null))},x=()=>!(e.optional||!mr(c)&&(!hr(c)||v.isSelected||0!==c.length)&&(!v.isSelected||""!==v.inputValue.trim())),S=()=>{v.isSelected&&m?hr(c)&&(p?a([...c,v.inputValue]):o([...c,v.inputValue])):p?a(c):o(c)};return Ph(Sa,{children:[Ph("div",{className:"question-container",children:[Ph(zh,{question:e,forceDisableHtml:i}),Ph("fieldset",{className:"multiple-choice-options limit-height",children:[Ph("legend",{className:"sr-only",children:m?" Select all that apply":" Select one"}),h.map(((t,r)=>{var i=!!e.hasOpenChoice&&r===e.choices.length-1,s="surveyQuestion"+n+"Choice"+r,o=s+"Open",a=i?v.isSelected:g?c===t:hr(c)&&c.includes(t);return Ph("label",{className:i?"choice-option-open":"",children:[Ph("div",{className:"response-choice",children:[Ph("input",{type:g?"radio":"checkbox",name:s,checked:a,onChange:()=>b(t,i),id:s,"aria-controls":o}),Ph("span",{children:i?t+":":t})]}),i&&Ph("input",{type:"text",ref:l,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"})]},r)}))]})]}),Ph(Bh,{text:e.buttonText||"Submit",submitDisabled:x(),appearance:s,onSubmit:S,onPreviewSubmit:S,skipSubmitButton:y})]})}var tc=[1,2,3,4,5],ec=[1,2,3,4,5,6,7],rc=[0,1,2,3,4,5,6,7,8,9,10],ic={2:[Dh,qh],3:[Nh,Ah,Lh],5:[Fh,Nh,Ah,Lh,$h]};function nc(t){switch(t){case 5:default:return tc;case 7:return ec;case 10:return rc}}var sc=On("[Surveys]");function oc(t,e,r){var i,n=t.questions[e],s=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?_u.End:s;if(n.branching.type===_u.End)return _u.End;if(n.branching.type===_u.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===_u.ResponseBased){if(n.type===bu.SingleChoice){var o,a=n.choices.indexOf(""+r);if(-1===a&&n.hasOpenChoice&&(a=n.choices.length-1),null!=(o=n.branching)&&null!=(o=o.responseValues)&&o.hasOwnProperty(a)){var u=n.branching.responseValues[a];return Number.isInteger(u)?u:u===_u.End?_u.End:s}}else if(n.type===bu.Rating){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||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(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(r,n.scale);if(null!=(l=n.branching)&&null!=(l=l.responseValues)&&l.hasOwnProperty(h)){var c=n.branching.responseValues[h];return Number.isInteger(c)?c:c===_u.End?_u.End:s}}return s}return sc.warn("Falling back to next question index due to unexpected branching type"),s}var ac="https?://(.*)",uc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],lc=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...uc],hc="<masked>",cc=["li_fat_id"];function dc(t,e,r){if(!yn)return{};var i,n=e?[...uc,...r||[]]:[],s=vc(Wn(yn.URL,n,hc),t),o=(i={},Ln(cc,(function(t){var e=Ql.A(t);i[t]=e||null})),i);return An(o,s)}function vc(t,e){var r=lc.concat(e||[]),i={};return Ln(r,(function(e){var r=Vn(t,e);i[e]=r||null})),i}function fc(t){var e=function(t){return t?0===t.search(ac+"google.([^/?]*)")?"google":0===t.search(ac+"bing.com")?"bing":0===t.search(ac+"yahoo.com")?"yahoo":0===t.search(ac+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!mr(e)){i.$search_engine=e;var n=yn?Vn(yn.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function pc(){return navigator.language||navigator.userLanguage}var gc="$direct";function mc(){return(null==yn?void 0:yn.referrer)||gc}function yc(t,e){var r=t?[...uc,...e||[]]:[],i=null==bn?void 0:bn.href.substring(0,1e3);return{r:mc().substring(0,1e3),u:i?Wn(i,r,hc):void 0}}function bc(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:r==gc?gc:null==(e=Bn(r))?void 0:e.host};if(i){n.$current_url=i;var s=Bn(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=vc(i);An(n,o)}if(r){var a=fc(r);An(n,a)}return n}function _c(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function wc(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var xc=On("[SurveyTranslations]");function Sc(t,e){var r=function(t){return function(t,e){var{overrideLanguage:r,storedPersonProperties:i,locale:n}=t,s=Ru(r);if(s)return null==e||e.info("Using override display language: "+s),s;var o=function(t){return t&&"object"==typeof t&&"language"in t?Ru(t.language):null}(i);if(o)return null==e||e.info("Using person property language: "+o),o;var a=Ru(n);return a?(null==e||e.info("Using detected locale: "+a),a):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:cr(t.get_property)?t.get_property(ks):void 0,locale:pc()},xc)}(e);if(!r)return xc.info("No user language detected"),{survey:t,language:null};var i=Pu(t,r,xc);return{survey:i.survey,language:i.matchedKey}}var kc=pn,Cc=yn,Tc="ph:show_survey_widget",Ic="PHWidgetSurveyClickListener";function Ec(t,e){try{var r=t.getBoundingClientRect(),i=kc.innerHeight,n=kc.innerWidth,s=r.left+r.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var o=i-r.bottom,a=250>o&&r.top>o;return{position:"fixed",top:a?"auto":r.bottom+12+"px",left:s+"px",right:"auto",bottom:a?i-r.top+12+"px":"auto",zIndex:ah.zIndex}}catch(t){return Lu.warn("Failed to calculate trigger position:",t),null}}class Rc{constructor(t){var e=this;this.j=new Map,this.H=new Map,this.U=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(Ts);if(t)for(var e of t)Ih(e)&&ph(e,this._posthog)},this.handlePopoverSurvey=(t,e)=>{var i,n,s,o,{survey:a,language:u}=this.B(t),l=null!=e&&e.position||null!=e&&e.selector?r({},a,{appearance:r({},a.appearance,e.position&&{position:e.position},e.selector&&{widgetSelector:e.selector})}):a;this.V(l.id);var{properties:h,initialResponses:c}=null!=e?e:{},d=!(!c||0>=Object.keys(c).length)&&this.W(l,c,h,u);if(!d||null!=(i=l.appearance)&&i.displayThankYouMessage){this.Z(l);var v={};if((null==(n=l.appearance)?void 0:n.position)===gu.NextToTrigger&&null!=(s=l.appearance)&&s.widgetSelector){var f,p=Cc.querySelector(l.appearance.widgetSelector);p&&(v=Ec(p,parseInt((null==(f=l.appearance)?void 0:f.maxWidth)||ah.maxWidth))||{})}var g=(null==(o=l.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:m}=ch(l,this._posthog),y={posthog:this._posthog,survey:l,removeSurveyFromFocus:this.$,properties:h,style:v,isSurveyCompleted:d,skipShownEvent:null==e?void 0:e.skipShownEvent,surveyLanguage:u};if(0>=g)return Ua(Ph(Lc,r({},y)),m);var b=setTimeout((()=>{if(this.j.delete(l.id),!Sh(l))return this.$(l);Ua(Ph(Lc,r({},y,{survey:r({},l,{appearance:r({},l.appearance,{surveyPopupDelaySeconds:0})})})),m)}),1e3*g);this.j.set(l.id,b)}},this.G=t=>{var{survey:e,language:r}=this.B(t),{shadow:i,isNewlyCreated:n}=ch(e,this._posthog);n&&Ua(Ph(Nc,{posthog:this._posthog,survey:e,surveyLanguage:r},t.id),i)},this.J=t=>{this.X(t);var e=this.H.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Ic),this.H.delete(t.id),Lu.info("Removed click listener for survey "+t.id))},this.Y=(t,e)=>{var r=Cc.querySelector(e),i=this.H.get(t.id);if(r){if(this.G(t),i){if(r===i.element)return;Lu.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.J(t)}if(!r.hasAttribute(Ic)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===gu.NextToTrigger?Ec(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||ah.maxWidth)):{};kc.dispatchEvent(new CustomEvent(Tc,{detail:{surveyId:t.id,position:n}}))};Un(r,"click",n),r.setAttribute(Ic,"true"),this.H.set(t.id,{element:r,listener:n,survey:t}),Lu.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.J(t)},this.renderPopover=t=>{var{survey:e,language:r}=this.B(t),{shadow:i}=ch(e,this._posthog);Ua(Ph(Lc,{posthog:this._posthog,survey:e,removeSurveyFromFocus:this.$,surveyLanguage:r}),i)},this.renderSurvey=(t,e,r)=>{var i,{survey:n,language:s}=this.B(t),o=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(o=this.K(n,s)),Ua(Ph(Lc,{posthog:this._posthog,survey:n,removeSurveyFromFocus:this.$,isPopup:!1,properties:r,isSurveyCompleted:o,surveyLanguage:s}),e)},this.getActiveMatchingSurveys=function(t,r){var i;void 0===r&&(r=!1),null==(i=e._posthog)||null==(i=i.surveys)||i.getSurveys((r=>{var i=r.filter((t=>e.checkSurveyEligibility(t).eligible&&e.ee(t)&&e.te(t)&&e.re(t)));t(i)}),r)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var r=t.filter((t=>t.type===yu.Popover||t.type===yu.Widget)),i=e.ne(r),n=new Set;i.forEach((t=>{if(t.type===yu.Widget){var r,i,s,o;if((null==(r=t.appearance)?void 0:r.widgetType)===pu.Tab)return void e.G(t);(null==(i=t.appearance)?void 0:i.widgetType)===pu.Selector&&null!=(s=t.appearance)&&s.widgetSelector&&(n.add(t.id),e.Y(t,null==(o=t.appearance)?void 0:o.widgetSelector))}mr(e.ie)&&t.type===yu.Popover&&e.handlePopoverSurvey(t)})),e.H.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.J(r)}))}),t)},this.Z=t=>{mr(this.ie)||Lu.error("Survey "+this.ie+" already in focus. Cannot add survey "+t.id+"."),this.ie=t.id},this.$=t=>{this.ie!==t.id&&Lu.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.V(t.id),this.ie=null,this.X(t)},this._posthog=t,this.ie=null}V(t){var e=this.j.get(t);e&&(clearTimeout(e),this.j.delete(t))}cancelSurvey(t){this.j.has(t)&&(Lu.info("Cancelled pending survey "+t),this.V(t),this.ie===t&&(this.ie=null))}ne(t){return t.sort(((t,e)=>{var r,i,n=Ih(t),s=Ih(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===wu.Always,a=e.schedule===wu.Always;return o&&!a?1:!o&&a?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)}))}B(t){return Sc(t,this._posthog)}K(t,e){if(this.U.has(t.id))return!1;var{params:r}=function(t){var e={},r=!1,i=kc.location.search.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};var n=i.split("&");for(var s of n){var[o,a]=s.split("=");if(o&&!fr(a)){var u=decodeURIComponent(o),l=decodeURIComponent(a);if("auto_submit"!==u||"true"!==l){var h=u.match(/^q(\d+)$/);if(h){var c=parseInt(h[1],10);e[c]||(e[c]=[]),e[c].push(l)}}else r=!0}}return{params:e,autoSubmit:r}}();if(0===Object.keys(r).length)return!1;Lu.info("[Survey Prefill] Detected URL prefill parameters");var i=this.oe(t,r,e);if(!i)return!1;var{responses:n,submissionId:s,isSurveyCompleted:o,skippedResponses:a}=i;return(Object.keys(a).length>0&&t.enable_partial_responses||o)&&dh({responses:o?n:a,survey:t,surveySubmissionId:s,posthog:this._posthog,isSurveyCompleted:o,surveyLanguage:e}),this.U.add(t.id),o}W(t,e,r,i){var n={};for(var[s,o]of Object.entries(e))n[parseInt(s)]=hr(o)?o.map(String):[String(o)];Lu.info("[Survey] Processing initial responses");var a=this.oe(t,n,i);if(!a)return!1;var{responses:u,submissionId:l,isSurveyCompleted:h}=a;return dh({responses:u,survey:t,surveySubmissionId:l,posthog:this._posthog,isSurveyCompleted:h,properties:r,surveyLanguage:i}),h}oe(t,e,r){try{var i=function(t,e){var r={};return t.questions.forEach(((t,i)=>{if(e[i]&&t.id){var n=e[i],s=Cu(t.id);try{switch(t.type){case bu.SingleChoice:if(!t.choices||0===t.choices.length)return void Mn.warn("[Survey Prefill] Question "+i+" has no choices");var o=parseInt(n[0],10);if(isNaN(o)||0>o||o>=t.choices.length)return void Mn.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case bu.MultipleChoice:if(!t.choices||0===t.choices.length)return void Mn.warn("[Survey Prefill] Question "+i+" has no choices");var a=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===a.length)return void Mn.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(a.map((e=>t.choices[e])))];a.length>u.length&&Mn.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=u;break;case bu.Rating:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||0>l||l>h)return void Mn.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=l;break;default:Mn.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Mn.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(i).length)return Lu.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Qu(),s=Object.keys(e).map((t=>parseInt(t,10))),{startQuestionIndex:o,skippedResponses:a}=function(t,e,r){for(var i=0,n={},s=t.questions.length+1;t.questions.length>i&&s>0&&e.includes(i);){var o=t.questions[i];if(!o||!("skipSubmitButton"in o)||!o.skipSubmitButton)break;if(o.id){var a=Cu(o.id);fr(r[a])||(n[a]=r[a])}var u=oc(t,i,o.id?r[Cu(o.id)]:null);if(u===_u.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=u}return{startQuestionIndex:i,skippedResponses:n}}(t,s,i),u=o>=t.questions.length;return Ch(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:o,surveyLanguage:r}),Lu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return Lu.error("[Survey Prefill] Error handling prefill:",t),null}}ae(t,e){var r;if(void 0===e&&(e=void 0),!t)return!0;var i,n=!(null==(r=this._posthog.featureFlags)||!r.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),s=!0;return e&&(s=(null==(i=this._posthog.featureFlags)?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),n&&s}ee(t){return!t.conditions||Sh(t)&&function(t){var e,r;return function(t,e){var r,i,n;if(!t||0===t.length)return!0;if(!kn)return!1;var s=Mi(kn,{userAgentDataPlatform:null==mn||null==(r=mn.userAgentData)?void 0:r.platform,maxTouchPoints:null==mn?void 0:mn.maxTouchPoints,screenWidth:null==pn||null==(i=pn.screen)?void 0:i.width,screenHeight:null==pn||null==(n=pn.screen)?void 0:n.height,devicePixelRatio:null==pn?void 0:pn.devicePixelRatio});return zl[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(r=t.conditions)?void 0:r.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==sh||!sh.querySelector(t.conditions.selector))}(t)}se(t){return bh(t)||this.ae(t.internal_targeting_flag_key)||Ih(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!Au(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!Hu.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;return this.ae(t.linked_flag_key,n)?this.ae(t.targeting_flag_key)?this.se(t)?function(t,e){if(!t||!e)return!0;var r="string"==typeof e?new Date(e):e,i=new Date,n=Math.abs(i.getTime()-r.getTime());return Math.ceil(n/864e5)>t}(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays,Kl.A("lastSeenSurveyDate"))?(t=>!!Kl.A(ju(t))&&!bh(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason="Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i):(i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i):(i.eligible=!1,i.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",i)}te(t){var e;if(!Nu(t)&&!Fu(t))return!0;var r=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}re(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:r}=t;return!e||!r||this.ae(r)}))}X(t){try{var e=Cc.querySelector(Rh(t,!0));null!=e&&e.shadowRoot&&Ua(null,e.shadowRoot),null==e||e.remove()}catch(e){Lu.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.ie,surveyTimeouts:this.j,handleWidget:this.G,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Y,sortSurveysByAppearanceDelay:this.ne,checkFlags:this.re.bind(this),isSurveyFeatureFlagEnabled:this.ae.bind(this)}}}function Mc(t,e){if(Cc&&kc){var r,i=new Rc(t);if(t.config.disable_surveys_automatic_display)return Lu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Lu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{fr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Un(Cc,"visibilitychange",(()=>{Cc.hidden?fr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function Oc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;iu((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var s=()=>{var t,n=e.type===yu.Widget,s=Sh(e),o=(null==(t=e.appearance)?void 0:t.widgetType)===pu.Tab&&n;if(!s)return Lu.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);o&&(Lu.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};Un(kc,"popstate",s),Un(kc,"hashchange",s);var o=kc.history.pushState,a=kc.history.replaceState;return kc.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];o.apply(this,e),s()},kc.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];a.apply(this,e),s()},()=>{kc.removeEventListener("popstate",s),kc.removeEventListener("hashchange",s),kc.history.pushState=o,kc.history.replaceState=a}}}),[n,e,r,i])}function Pc(t){switch(void 0===t&&(t=mu.Right),t){case mu.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case mu.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case mu.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Lc(t){var e,i,n,s,o,a,{survey:u,forceDisableHtml:l,posthog:h,style:c={},previewPageIndex:d,removeSurveyFromFocus:v=(()=>{}),isPopup:f=!0,onPreviewSubmit:p=(()=>{}),onPopupSurveyDismissed:g=(()=>{}),onCloseConfirmationMessage:m=(()=>{}),properties:y,isSurveyCompleted:b,skipShownEvent:_,surveyLanguage:w}=t,x=nu(null),S=Number.isInteger(d),k=null!=(e=u.appearance)&&e.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,{isPopupVisible:C,isSurveySent:T,hidePopupWithViewTransition:I}=function(t,e,i,n,s,o,a,u,l){var[h,c]=ru(n||0===i||t.type===yu.ExternalSurvey),[d,v]=ru(!1),f=()=>{var e=()=>{o&&s(t),c(!1)};Cc.startViewTransition?Cc.startViewTransition((()=>{var t;null==a||null==(t=a.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},p=e=>{e.detail.surveyId===t.id&&f()};return iu((()=>{if(e){if(!n){var s=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return f();v(!0),null!=(i=t.appearance)&&i.autoDisappear&&setTimeout((()=>{f()}),5e3)}},o=()=>{Sh(t)&&(c(!0),kc.dispatchEvent(new Event("PHSurveyShown")),u||e.capture(xu.SHOWN,r({[Su.SURVEY_NAME]:t.name,[Su.SURVEY_ID]:t.id,[Su.SURVEY_ITERATION]:t.current_iteration,[Su.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[Su.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()})),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(Un(kc,"PHSurveyClosed",p),Un(kc,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),kc.removeEventListener("PHSurveyClosed",p),kc.removeEventListener("PHSurveySent",s)}}return o(),()=>{kc.removeEventListener("PHSurveyClosed",p),kc.removeEventListener("PHSurveySent",s)}}}else Lu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Oc({survey:t,removeSurveyFromFocus:s,setSurveyVisible:c,isPreviewMode:n}),{isPopupVisible:h,isSurveySent:d,setIsPopupVisible:c,hidePopupWithViewTransition:f}}(u,h,k,S,v,f,x,_,w),E=T||d===u.questions.length||!0===b,R=su((()=>{var t=Th(u),e=(null==t?void 0:t.surveySubmissionId)||Qu();return{isPreviewMode:S,previewPageIndex:d,onPopupSurveyDismissed(){w?fh(u,h,S,w):fh(u,h,S),g()},isPopup:f||!1,surveySubmissionId:e,onPreviewSubmit:p,posthog:h,properties:y,surveyLanguage:w}}),[S,d,f,h,u,g,p,y,w]);return C?Ph(_h.Provider,{value:R,children:Ph("div",{className:"ph-survey",style:r({},Mh(u.type,null==(i=u.appearance)?void 0:i.position,null==(n=u.appearance)?void 0:n.widgetType),c),ref:x,children:E?Ph(Zh,{header:(null==(s=u.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(o=u.appearance)?void 0:o.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null==(a=u.appearance)?void 0:a.thankYouMessageDescriptionContentType,appearance:u.appearance||ah,onClose(){I(),m()}}):Ph(Ac,{survey:u,forceDisableHtml:!!l,posthog:h})})}):null}function Ac(t){var e,{survey:i,forceDisableHtml:n,posthog:s}=t,[o,a]=ru((()=>{var t=Th(i);return null!=t&&t.responses&&Lu.info("Survey is already in progress, filling in initial responses"),(null==t?void 0:t.responses)||{}})),{previewPageIndex:u,onPopupSurveyDismissed:l,isPopup:h,onPreviewSubmit:c,surveySubmissionId:d,isPreviewMode:v,properties:f,surveyLanguage:p}=ou(_h),[g,m]=ru((()=>{var t=Th(i);return u||(null==t?void 0:t.lastQuestionIndex)||0})),y=su((()=>yh(i)),[i]);iu((()=>{v&&!fr(u)&&m(u)}),[u,v]);var b=y.at(g);return b?Ph("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=i.appearance)?void 0:e.hideCancelButton)&&Ph(Vh,{onClick(){l()}}),Ph("div",{className:"survey-box","data-question-index":g,children:Fc({question:b,forceDisableHtml:n,displayQuestionIndex:g,appearance:i.appearance||ah,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:u}=t;if(s)if(u){var l=Cu(u),h=r({},o,{[l]:e});a(h);var c=oc(i,n,e),v=c===_u.End;v||(m(c),Ch(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c,surveyLanguage:p})),(i.enable_partial_responses||v)&&dh({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:s,properties:f,surveyLanguage:p})}else Lu.error("onNextButtonClick called without a questionId.");else Lu.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:g,questionId:b.id}),onPreviewSubmit:c,initialValue:b.id?o[Cu(b.id)]:void 0})})]}):null}function Nc(t){var e,r,i,n,s,o,a,{survey:u,forceDisableHtml:l,posthog:h,readOnly:c,surveyLanguage:d}=t,[v,f]=ru(!0),[p,g]=ru(!1),[m,y]=ru({}),b=()=>{g(!p)};if(iu((()=>{var t;if(h){if(!c){"tab"===(null==(t=u.appearance)?void 0:t.widgetType)&&y({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===u.id&&(Lu.info("Received show event for feedback button survey "+u.id),y(r.detail.position||{}),b())};return Un(kc,Tc,e),()=>{kc.removeEventListener(Tc,e)}}}else Lu.error("FeedbackWidget called without a PostHog instance.")}),[h,c,u.id,null==(e=u.appearance)?void 0:e.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),Oc({survey:u,setSurveyVisible:f}),!v)return null;var _=()=>{u.schedule!==wu.Always&&f(!1),setTimeout((()=>{g(!1)}),200)};return Ph(Sa,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Ph("button",{className:"ph-survey-widget-tab "+((null==(s=u.appearance)?void 0:s.tabPosition)===mu.Top?"widget-tab-top":""),onClick:b,disabled:c,style:Pc(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),p&&Ph(Lc,{posthog:h,survey:u,forceDisableHtml:l,style:m,onPopupSurveyDismissed:_,onCloseConfirmationMessage:_,surveyLanguage:d})]})}var Fc=t=>{var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l={forceDisableHtml:i,appearance:s,onPreviewSubmit(t){a(t)},onSubmit(t){o(t)},initialValue:u,displayQuestionIndex:n};switch(e.type){case bu.Open:return wa(Qh,r({},l,{question:e,key:e.id}));case bu.Link:return wa(Jh,r({},l,{question:e,key:e.id}));case bu.Rating:return wa(Kh,r({},l,{question:e,key:e.id}));case bu.SingleChoice:case bu.MultipleChoice:return wa(Xh,r({},l,{question:e,key:e.id}));default:return Lu.error("Unsupported question type: "+e.type),null}};Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.generateSurveys=Mc,Cn.extendPostHogWithSurveys=Mc;class $c{emit(t){}}var Dc=new $c,qc=new class{getLogger(t,e,r){return new $c}};class jc{constructor(t,e,r,i){this.ue=t,this.name=e,this.version=r,this.options=i}emit(t){this.le().emit(t)}le(){if(this.ce)return this.ce;var t=this.ue.de(this.name,this.version,this.options);return t?(this.ce=t,this.ce):Dc}}class Uc{getLogger(t,e,r){var i;return null!==(i=this.de(t,e,r))&&void 0!==i?i:new jc(this,t,e,r)}he(){var t;return null!==(t=this.ce)&&void 0!==t?t:qc}ve(t){this.ce=t}de(t,e,r){var i;return null===(i=this.ce)||void 0===i?void 0:i.getLogger(t,e,r)}}var Hc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Bc=Symbol.for("io.opentelemetry.js.api.logs"),zc=Hc;class Vc{constructor(){this.fe=new Uc}static getInstance(){return this._instance||(this._instance=new Vc),this._instance}setGlobalLoggerProvider(t){return zc[Bc]?this.getLoggerProvider():(zc[Bc]=(1,e=t,r=qc,t=>1===t?e:r),this.fe.ve(t),t);var e,r}getLoggerProvider(){var t,e;return null!==(e=null===(t=zc[Bc])||void 0===t?void 0:t.call(zc,1))&&void 0!==e?e:this.fe}getLogger(t,e,r){return this.getLoggerProvider().getLogger(t,e,r)}disable(){delete zc[Bc],this.fe=new Uc}}var Wc=Vc.getInstance();class Zc{constructor(t){this.ce=void 0,this.ce=t}export(t,e){this.ce.export(t,e)}forceFlush(){return this.ce.forceFlush()}shutdown(){return this.ce.shutdown()}}class Gc extends Error{constructor(t,e,r){super(t),this.code=void 0,this.name="OTLPExporterError",this.data=void 0,this.data=r,this.code=e}}function Qc(t){if(Number.isFinite(t)&&t>0)return t;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+t+"')")}class Jc{constructor(t){this.pe=void 0,this.me=[],this.pe=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this.me.push(t);var e=()=>{var e=this.me.indexOf(t);this.me.splice(e,1)};t.then(e,e)}hasReachedLimit(){return this.me.length>=this.pe}awaitAll(){var t=this;return e((function*(){yield Promise.all(t.me)}))()}}function Kc(t){return new Jc(t.concurrencyLimit)}var Yc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Xc="1.9.0",td=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,ed=function(t){var e=new Set([t]),r=new Set,i=t.match(td);if(!i)return function(){return!1};var n=+i[1],s=+i[2],o=+i[3];if(null!=i[4])return function(e){return e===t};function a(t){return r.add(t),!1}function u(t){return e.add(t),!0}return function(t){if(e.has(t))return!0;if(r.has(t))return!1;var i=t.match(td);if(!i)return a(t);var l=+i[2],h=+i[3];return null!=i[4]||n!==+i[1]?a(t):0===n?s!==l||o>h?a(t):u(t):s>l?a(t):u(t)}}(Xc),rd=Xc.split(".")[0],id=Symbol.for("opentelemetry.js.api."+rd),nd=Yc;function sd(t,e,r,i){var n;void 0===i&&(i=!1);var s=nd[id]=null!==(n=nd[id])&&void 0!==n?n:{version:Xc};if(!i&&s[t]){var o=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(o.stack||o.message),!1}return s.version!==Xc?(o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+Xc),r.error(o.stack||o.message),!1):(s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+Xc+"."),!0)}function od(t){var e,r,i=null===(e=nd[id])||void 0===e?void 0:e.version;if(i&&ed(i))return null===(r=nd[id])||void 0===r?void 0:r[t]}function ad(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Xc+".");var r=nd[id];r&&delete r[t]}var ud,ld=function(){function t(t){this.ye=t.namespace||"DiagComponentLogger"}return t.prototype.debug=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return hd("debug",this.ye,t)},t.prototype.error=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return hd("error",this.ye,t)},t.prototype.info=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return hd("info",this.ye,t)},t.prototype.warn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return hd("warn",this.ye,t)},t.prototype.verbose=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return hd("verbose",this.ye,t)},t}();function hd(t,e,r){var i=od("diag");if(i)return r.unshift(e),i[t].apply(i,function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;s>n;n++)!i&&n in e||(i||(i=[].slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||[].slice.call(e))}([],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(r),!1))}!function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"}(ud||(ud={}));var cd=function(){function t(){function t(t){return function(){for(var e=[],r=0;arguments.length>r;r++)e[r]=arguments[r];var i=od("diag");if(i)return i[t].apply(i,function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;s>n;n++)!i&&n in e||(i||(i=[].slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||[].slice.call(e))}([],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(e),!1))}}var e=this;e.setLogger=function(t,r){var i,n,s;if(void 0===r&&(r={logLevel:ud.INFO}),t===e){var o=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return e.error(null!==(i=o.stack)&&void 0!==i?i:o.message),!1}"number"==typeof r&&(r={logLevel:r});var a=od("diag"),u=function(t,e){function r(r,i){var n=e[r];return"function"!=typeof n||i>t?function(){}:n.bind(e)}return ud.NONE>t?t=ud.NONE:t>ud.ALL&&(t=ud.ALL),e=e||{},{error:r("error",ud.ERROR),warn:r("warn",ud.WARN),info:r("info",ud.INFO),debug:r("debug",ud.DEBUG),verbose:r("verbose",ud.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:ud.INFO,t);if(a&&!r.suppressOverrideMessage){var l=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+l),u.warn("Current logger will overwrite one already registered from "+l)}return sd("diag",u,e,!0)},e.disable=function(){ad("diag",e)},e.createComponentLogger=function(t){return new ld(t)},e.verbose=t("verbose"),e.debug=t("debug"),e.info=t("info"),e.warn=t("warn"),e.error=t("error")}return t.instance=function(){return this._instance||(this._instance=new t),this._instance},t}();function dd(t){return Symbol.for(t)}var vd,fd=new function t(e){var r=this;r.ge=e?new Map(e):new Map,r.getValue=function(t){return r.ge.get(t)},r.setValue=function(e,i){var n=new t(r.ge);return n.ge.set(e,i),n},r.deleteValue=function(e){var i=new t(r.ge);return i.ge.delete(e),i}},pd=function(){function t(){}return t.prototype.active=function(){return fd},t.prototype.with=function(t,e,r){for(var i=[],n=3;arguments.length>n;n++)i[n-3]=arguments[n];return e.call.apply(e,function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;s>n;n++)!i&&n in e||(i||(i=[].slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||[].slice.call(e))}([r],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(i),!1))},t.prototype.bind=function(t,e){return e},t.prototype.enable=function(){return this},t.prototype.disable=function(){return this},t}(),gd="context",md=new pd,yd=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return sd(gd,t,cd.instance())},t.prototype.active=function(){return this.be().active()},t.prototype.with=function(t,e,r){for(var i,n=[],s=3;arguments.length>s;s++)n[s-3]=arguments[s];return(i=this.be()).with.apply(i,function(t,e,r){if(r||2===arguments.length)for(var i,n=0,s=e.length;s>n;n++)!i&&n in e||(i||(i=[].slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||[].slice.call(e))}([t,e,r],function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,s=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}(n),!1))},t.prototype.bind=function(t,e){return this.be().bind(t,e)},t.prototype.be=function(){return od(gd)||md},t.prototype.disable=function(){this.be().disable(),ad(gd,cd.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(vd||(vd={}));var bd="0000000000000000",_d="00000000000000000000000000000000",wd={traceId:_d,spanId:bd,traceFlags:vd.NONE},xd=function(){function t(t){void 0===t&&(t=wd),this.we=t}return t.prototype.spanContext=function(){return this.we},t.prototype.setAttribute=function(t,e){return this},t.prototype.setAttributes=function(t){return this},t.prototype.addEvent=function(t,e){return this},t.prototype.addLink=function(t){return this},t.prototype.addLinks=function(t){return this},t.prototype.setStatus=function(t){return this},t.prototype.updateName=function(t){return this},t.prototype.end=function(t){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(t,e){},t}(),Sd=dd("OpenTelemetry Context Key SPAN");function kd(t){return t.getValue(Sd)||void 0}function Cd(){return kd(yd.getInstance().active())}function Td(t,e){return t.setValue(Sd,e)}function Id(t){return t.deleteValue(Sd)}function Ed(t,e){return Td(t,new xd(e))}function Rd(t){var e;return null===(e=kd(t))||void 0===e?void 0:e.spanContext()}var Md=/^([0-9a-f]{32})$/i,Od=/^[0-9a-f]{16}$/i;function Pd(t){return Md.test(r=t.traceId)&&r!==_d&&Od.test(e=t.spanId)&&e!==bd;var e,r}function Ld(t){return new xd(t)}var Ad=yd.getInstance(),Nd=function(){function t(){}return t.prototype.startSpan=function(t,e,r){if(void 0===r&&(r=Ad.active()),Boolean(null==e?void 0:e.root))return new xd;var i,n=r&&Rd(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&Pd(n)?new xd(n):new xd},t.prototype.startActiveSpan=function(t,e,r,i){var n,s,o;if(arguments.length>=2){2===arguments.length?o=e:3===arguments.length?(n=e,o=r):(n=e,s=r,o=i);var a=null!=s?s:Ad.active(),u=this.startSpan(t,n,a),l=Td(a,u);return Ad.with(l,o,void 0,u)}},t}(),Fd=new Nd,$d=function(){function t(t,e,r,i){this.ue=t,this.name=e,this.version=r,this.options=i}return t.prototype.startSpan=function(t,e,r){return this.ke().startSpan(t,e,r)},t.prototype.startActiveSpan=function(t,e,r,i){var n=this.ke();return Reflect.apply(n.startActiveSpan,n,arguments)},t.prototype.ke=function(){if(this.ce)return this.ce;var t=this.ue.getDelegateTracer(this.name,this.version,this.options);return t?(this.ce=t,this.ce):Fd},t}(),Dd=new(function(){function t(){}return t.prototype.getTracer=function(t,e,r){return new Nd},t}()),qd=function(){function t(){}return t.prototype.getTracer=function(t,e,r){var i;return null!==(i=this.getDelegateTracer(t,e,r))&&void 0!==i?i:new $d(this,t,e,r)},t.prototype.getDelegate=function(){var t;return null!==(t=this.ce)&&void 0!==t?t:Dd},t.prototype.setDelegate=function(t){this.ce=t},t.prototype.getDelegateTracer=function(t,e,r){var i;return null===(i=this.ce)||void 0===i?void 0:i.getTracer(t,e,r)},t}(),jd=yd.getInstance(),Ud=cd.instance(),Hd="trace",Bd=function(){function t(){this.xe=new qd,this.wrapSpanContext=Ld,this.isSpanContextValid=Pd,this.deleteSpan=Id,this.getSpan=kd,this.getActiveSpan=Cd,this.getSpanContext=Rd,this.setSpan=Td,this.setSpanContext=Ed}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=sd(Hd,this.xe,cd.instance());return e&&this.xe.setDelegate(t),e},t.prototype.getTracerProvider=function(){return od(Hd)||this.xe},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){ad(Hd,cd.instance()),this.xe=new qd},t}().getInstance(),zd=dd("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Vd(t){return null==t||(Array.isArray(t)?function(t){var e;for(var r of t)if(null!=r){var i=typeof r;if(i!==e){if(!e){if(Wd(i)){e=i;continue}return!1}return!1}}return!0}(t):Wd(typeof t))}function Wd(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}function Zd(t){try{(t=>{Ud.error(function(t){return"string"==typeof t?t:JSON.stringify(function(t){for(var e={},r=t;null!==r;)Object.getOwnPropertyNames(r).forEach((t=>{if(!e[t]){var i=r[t];i&&(e[t]=String(i))}})),r=Object.getPrototypeOf(r);return e}(t))}(t))})(t)}catch(t){}}var Gd,Qd=performance,Jd="telemetry.sdk.language",Kd="telemetry.sdk.name",Yd="telemetry.sdk.version",Xd={[Kd]:"opentelemetry","process.runtime.name":"browser",[Jd]:"webjs",[Yd]:"2.2.0"},tv=Math.pow(10,6),ev=Math.pow(10,9);function rv(t){return[Math.trunc(t/1e3),Math.round(t%1e3*tv)]}function iv(){var t=Qd.timeOrigin;return"number"!=typeof t&&(t=Qd.timing&&Qd.timing.fetchStart),t}function nv(t){if(s=t,Array.isArray(s)&&2===s.length&&"number"==typeof s[0]&&"number"==typeof s[1])return t;if("number"==typeof t)return t<iv()?(e=t,r=rv(iv()),i=rv("number"==typeof e?e:Qd.now()),ev>(n=[r[0]+i[0],r[1]+i[1]])[1]||(n[1]-=ev,n[0]+=1),n):rv(t);var e,r,i,n,s;if(t instanceof Date)return rv(t.getTime());throw TypeError("Invalid input type")}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(Gd||(Gd={}));var sv="[object Object]",ov="[object Null]",av="[object Undefined]",uv=function(){}.toString,lv=uv.call(Object),hv=Object.getPrototypeOf,cv=Object.prototype,dv=cv.hasOwnProperty,vv=Symbol?Symbol.toStringTag:void 0,fv=cv.toString;function pv(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){return null==t?void 0===t?av:ov:vv&&vv in Object(t)?function(t){var e=dv.call(t,vv),r=t[vv],i=!1;try{t[vv]=void 0,i=!0}catch(t){}var n=fv.call(t);return i&&(e?t[vv]=r:delete t[vv]),n}(t):function(t){return fv.call(t)}(t)}(t)!==sv)return!1;var e=hv(t);if(null===e)return!0;var r=dv.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&uv.call(r)===lv}function gv(t){return bv(t)?t.slice():t}function mv(t,e,r,i){var n;if(void 0===r&&(r=0),20>=r){if(r++,xv(t)||xv(e)||_v(e))n=gv(e);else if(bv(t)){if(n=t.slice(),bv(e))for(var s=0,o=e.length;o>s;s++)n.push(gv(e[s]));else if(wv(e))for(var a=Object.keys(e),u=0,l=a.length;l>u;u++){var h=a[u];n[h]=gv(e[h])}}else if(wv(t))if(wv(e)){if(!function(t,e){return!(!pv(t)||!pv(e))}(t,e))return e;n=Object.assign({},t);for(var c=Object.keys(e),d=0,v=c.length;v>d;d++){var f=c[d],p=e[f];if(xv(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(yv(t,f,i)||yv(e,f,i))delete n[f];else{if(wv(g)&&wv(m)){var y=i.get(g)||[],b=i.get(m)||[];y.push({obj:t,key:f}),b.push({obj:e,key:f}),i.set(g,y),i.set(m,b)}n[f]=mv(n[f],p,r,i)}}}}else n=e;return n}}function yv(t,e,r){for(var i=r.get(t[e])||[],n=0,s=i.length;s>n;n++){var o=i[n];if(o.key===e&&o.obj===t)return!0}return!1}function bv(t){return Array.isArray(t)}function _v(t){return"function"==typeof t}function wv(t){return!xv(t)&&!bv(t)&&!_v(t)&&"object"==typeof t}function xv(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class Sv extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Sv.prototype)}}function kv(t,e){var r,i=new Promise((function(t,i){r=setTimeout((function(){i(new Sv("Operation timed out."))}),e)}));return Promise.race([t,i]).then((t=>(clearTimeout(r),t)),(t=>{throw clearTimeout(r),t}))}class Cv{constructor(){this.Se=void 0,this.Ce=void 0,this.Ie=void 0,this.Se=new Promise(((t,e)=>{this.Ce=t,this.Ie=e}))}get promise(){return this.Se}resolve(t){this.Ce(t)}reject(t){this.Ie(t)}}class Tv{constructor(t,e){this.Te=void 0,this.Me=void 0,this._e=!1,this.Le=new Cv,this.Te=t,this.Me=e}get isCalled(){return this._e}get promise(){return this.Le.promise}call(){if(!this._e){this._e=!0;try{for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];Promise.resolve(this.Te.call(this.Me,...e)).then((t=>this.Le.resolve(t)),(t=>this.Le.reject(t)))}catch(t){this.Le.reject(t)}}return this.Le.promise}}var Iv={Oe:(t,e)=>new Promise((r=>{jd.with(function(t){return t.setValue(zd,!0)}(jd.active()),(()=>{t.export(e,(t=>{r(t)}))}))}))};class Ev{constructor(t,e,r,i,n){this.Ee=void 0,this.Re=void 0,this.Ne=void 0,this.Ae=void 0,this.Pe=void 0,this.qe=void 0,this.Ee=t,this.Re=e,this.Ne=r,this.Ae=i,this.Pe=n,this.qe=Ud.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,e){if(this.qe.debug("items to be sent",t),this.Ae.hasReachedLimit())e({code:Gd.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this.Re.serializeRequest(t);null!=r?this.Ae.pushPromise(this.Ee.send(r,this.Pe).then((t=>{if("success"!==t.status)e("failure"===t.status&&t.error?{code:Gd.FAILED,error:t.error}:"retryable"===t.status?{code:Gd.FAILED,error:new Gc("Export failed with retryable status")}:{code:Gd.FAILED,error:new Gc("Export failed with unknown error")});else{if(null!=t.data)try{this.Ne.handleResponse(this.Re.deserializeResponse(t.data))}catch(e){this.qe.warn("Export succeeded but could not deserialize response - is the response specification compliant?",e,t.data)}e({code:Gd.SUCCESS})}}),(t=>e({code:Gd.FAILED,error:t})))):e({code:Gd.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.Ae.awaitAll()}shutdown(){var t=this;return e((function*(){t.qe.debug("shutdown started"),yield t.forceFlush(),t.Ee.shutdown()}))()}}function Rv(t,e,r){return i={transport:r,serializer:e,promiseHandler:Kc(t)},new Ev(i.transport,i.serializer,{handleResponse(t){null!=t&&function(t){return{}.hasOwnProperty.call(t,"partialSuccess")}(t)&&null!=t.partialSuccess&&0!==Object.keys(t.partialSuccess).length&&Ud.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}},i.promiseHandler,{timeout:t.timeoutMillis}.timeout);var i}function Mv(t){return 48>t||t>57?97>t||t>102?t-55:t-87:t-48}function Ov(t){for(var e=new Uint8Array(t.length/2),r=0,i=0;t.length>i;i+=2){var n=Mv(t.charCodeAt(i)),s=Mv(t.charCodeAt(i+1));e[r++]=n<<4|s}return e}function Pv(t){var e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Lv(t){var e;return e=Pv(t),{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var Av="undefined"!=typeof BigInt?function(t){return Pv(t).toString()}:function(t){return t[0]*ev+t[1]};function Nv(t){return t}function Fv(t){if(void 0!==t)return Ov(t)}var $v={encodeHrTime:Lv,encodeSpanContext:Ov,encodeOptionalSpanContext:Fv};function Dv(t,e){return{key:t,value:qv(e)}}function qv(t){var e=typeof t;return"string"===e?{stringValue:t}:"number"===e?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:"boolean"===e?{boolValue:t}:t instanceof Uint8Array?{bytesValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(qv)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((t=>{var[e,r]=t;return Dv(e,r)}))}}:{}}function jv(t,e){var r=function(t){var e=new Map;for(var r of t){var{resource:i,instrumentationScope:{name:n,version:s="",schemaUrl:o=""}}=r,a=e.get(i);a||(a=new Map,e.set(i,a));var u=n+"@"+s+":"+o,l=a.get(u);l||a.set(u,l=[]),l.push(r)}return e}(t);return Array.from(r,(t=>{var[r,i]=t,n=function(t){var e,r={attributes:(e=t.attributes,Object.keys(e).map((t=>Dv(t,e[t])))),droppedAttributesCount:0},i=t.schemaUrl;return i&&""!==i&&(r.schemaUrl=i),r}(r);return{resource:n,scopeLogs:Array.from(i,(t=>{var r,[,i]=t;return{scope:(r=i[0].instrumentationScope,{name:r.name,version:r.version}),logRecords:i.map((t=>function(t,e){var r,i,n,s;return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:qv(t.body),eventName:t.eventName,attributes:(s=t.attributes,Object.keys(s).map((t=>Dv(t,s[t])))),droppedAttributesCount:t.droppedAttributesCount,flags:null==(r=t.spanContext)?void 0:r.traceFlags,traceId:e.encodeOptionalSpanContext(null==(i=t.spanContext)?void 0:i.traceId),spanId:e.encodeOptionalSpanContext(null==(n=t.spanContext)?void 0:n.spanId)}}(t,e))),schemaUrl:i[0].instrumentationScope.schemaUrl}})),schemaUrl:n.schemaUrl}}))}var Uv=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class Hv{static FromAttributeList(t,e){var r=new Hv({},e);return r.De=zv(t),r.Fe=t.filter((t=>{var[e,r]=t;return Uv(r)})).length>0,r}constructor(t,e){var r;this.De=void 0,this.Fe=!1,this.je=void 0,this.He=void 0;var i=null!==(r=t.attributes)&&void 0!==r?r:{};this.De=Object.entries(i).map((t=>{var[e,r]=t;return Uv(r)&&(this.Fe=!0),[e,r]})),this.De=zv(this.De),this.je=function(t){if("string"==typeof t||void 0===t)return t;Ud.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",t)}(null==e?void 0:e.schemaUrl)}get asyncAttributesPending(){return this.Fe}waitForAsyncAttributes(){var t=this;return e((function*(){if(t.asyncAttributesPending){for(var e=0;t.De.length>e;e++){var[r,i]=t.De[e];t.De[e]=[r,Uv(i)?yield i:i]}t.Fe=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Ud.error("Accessing resource attributes before async attributes settled"),this.He)return this.He;var t={};for(var[e,r]of this.De){var i;Uv(r)?Ud.debug("Unsettled resource attribute "+e+" skipped"):null!=r&&(null!==(i=t[e])&&void 0!==i||(t[e]=r))}return this.Fe||(this.He=t),t}getRawAttributes(){return this.De}get schemaUrl(){return this.je}merge(t){if(null==t)return this;var e,r,i,n,s=(n=null==(r=t)?void 0:r.schemaUrl,void 0===(i=null==(e=this)?void 0:e.schemaUrl)||""===i?n:void 0===n||""===n||i===n?i:void Ud.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',i,n)),o=s?{schemaUrl:s}:void 0;return Hv.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],o)}}function Bv(t,e){return Hv.FromAttributeList(Object.entries(t),e)}function zv(t){return t.map((t=>{var[e,r]=t;return Uv(r)?[e,r.catch((t=>{Ud.debug("promise rejection for resource attribute: %s - %s",e,t)}))]:[e,r]}))}var Vv={serializeRequest(t){var e,r,i=(e=t,r=function(t){var e,r;if(void 0===t)return $v;var i=null===(e=t.useLongBits)||void 0===e||e,n=null!==(r=t.useHex)&&void 0!==r&&r;return{encodeHrTime:i?Lv:Av,encodeSpanContext:n?Nv:Ov,encodeOptionalSpanContext:n?Nv:Fv}}({useHex:!0,useLongBits:!1}),{resourceLogs:jv(e,r)});return(new TextEncoder).encode(JSON.stringify(i))},deserializeResponse(t){if(0===t.length)return{};var e=new TextDecoder;return JSON.parse(e.decode(t))}};class Wv{constructor(t){this.Ee=void 0,this.Ee=t}retry(t,e,r){return new Promise(((i,n)=>{setTimeout((()=>{this.Ee.send(t,e).then(i,n)}),r)}))}send(t,r){var i=this;return e((function*(){for(var e=Date.now()+r,n=yield i.Ee.send(t,r),s=5,o=1e3;"retryable"===n.status&&s>0;){var a;s--;var u=Math.max(Math.min(o,5e3)+(.4*Math.random()-.2),0);o*=1.5;var l=null!==(a=n.retryInMillis)&&void 0!==a?a:u,h=e-Date.now();if(l>h)return n;n=yield i.retry(t,h,l)}return n}))()}shutdown(){return this.Ee.shutdown()}}function Zv(t){return new Wv(t.transport)}function Gv(t){return[429,502,503,504].includes(t)}function Qv(t){if(null!=t){var e=Number.parseInt(t,10);if(Number.isInteger(e))return e>0?1e3*e:-1;var r=new Date(t).getTime()-Date.now();return 0>r?0:r}}class Jv{constructor(t){this.Ue=void 0,this.Ue=t}send(t,r){var i=this;return e((function*(){var e=yield i.Ue.headers(),n=yield new Promise((n=>{var s=new XMLHttpRequest;s.timeout=r,s.open("POST",i.Ue.url),Object.entries(e).forEach((t=>{var[e,r]=t;s.setRequestHeader(e,r)})),s.ontimeout=t=>{n({status:"failure",error:new Error("XHR request timed out")})},s.onreadystatechange=()=>{200>s.status||s.status>299?s.status&&Gv(s.status)?n({status:"retryable",retryInMillis:Qv(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")}):(Ud.debug("XHR success"),n({status:"success"}))},s.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},s.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},s.send(t)}));return n}))()}shutdown(){}}class Kv{constructor(t){this.Be=void 0,this.Be=t}send(t){var r=this;return e((function*(){var e=(yield r.Be.headers())["Content-Type"];return new Promise((i=>{navigator.sendBeacon(r.Be.url,new Blob([t],{type:e}))?(Ud.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Yv{constructor(t){this.Ue=void 0,this.Ue=t}send(t,r){var i=this;return e((function*(){var e=new AbortController,n=setTimeout((()=>e.abort()),r);try{var s,o=!!globalThis.location,a=new URL(i.Ue.url),u=yield fetch(a.href,{method:"POST",headers:yield i.Ue.headers(),body:t,signal:e.signal,keepalive:o,mode:o?(null==(s=globalThis.location)?void 0:s.origin)===a.origin?"same-origin":"cors":"no-cors"});return 200>u.status||u.status>299?Gv(u.status)?{status:"retryable",retryInMillis:Qv(u.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}:(Ud.debug("response success"),{status:"success"})}catch(t){return"AbortError"===(null==t?void 0:t.name)?{status:"failure",error:new Error("Fetch request timed out",{cause:t})}:{status:"failure",error:new Error("Fetch request errored",{cause:t})}}finally{clearTimeout(n)}}))()}shutdown(){}}function Xv(t,e){return Rv(t,e,Zv({transport:(r=t,new Jv(r))}));var r}function tf(t,e){return Rv(t,e,Zv({transport:(r=t,new Yv(r))}));var r}function ef(t,e){return Rv(t,e,Zv({transport:(r={url:t.url,headers:t.headers},new Kv(r))}));var r}function rf(t){if(null!=t)try{var e,r=null==(e=globalThis.location)?void 0:e.href;return new URL(t,r).href}catch(e){throw new Error("Configuration: Could not parse user-provided export URL: '"+t+"'")}}function nf(t){return"function"==typeof t.headers?t.headers:function(t){if(null!=t)return e((function*(){return t}))}(t.headers)}function sf(t,i,n){return s={url:t.url,timeoutMillis:t.timeoutMillis,headers:nf(t),concurrencyLimit:t.concurrencyLimit},o={},a=function(t,i){return r({},{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"},{headers:(n=e((function*(){return t})),function(){return n.apply(this,arguments)}),url:"http://localhost:4318/"+i});var n}(n,i),r({},function(t,e,r){var i,n,s,o,a,u;return{timeoutMillis:Qc(null!==(i=null!==(n=t.timeoutMillis)&&void 0!==n?n:e.timeoutMillis)&&void 0!==i?i:r.timeoutMillis),concurrencyLimit:null!==(s=null!==(o=t.concurrencyLimit)&&void 0!==o?o:e.concurrencyLimit)&&void 0!==s?s:r.concurrencyLimit,compression:null!==(a=null!==(u=t.compression)&&void 0!==u?u:e.compression)&&void 0!==a?a:r.compression}}(s,o,a),{headers:(h=s.headers,c=o.headers,d=a.headers,e((function*(){var t=r({},yield d()),e={};return null!=c&&Object.assign(e,yield c()),null!=h&&Object.assign(e,function(t){var e={};return Object.entries(null!=t?t:{}).forEach((t=>{var[r,i]=t;void 0!==i?e[r]=String(i):Ud.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),e}(yield h())),Object.assign(e,t)}))),url:null!==(u=null!==(l=rf(s.url))&&void 0!==l?l:o.url)&&void 0!==u?u:a.url});var s,o,a,u,l,h,c,d}function of(t,e,r,i){return(t.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?tf:Xv:ef)(sf(t,r,i),e)}class af extends Zc{constructor(t){void 0===t&&(t={}),super(of(t,Vv,"v1/logs",{"Content-Type":"application/json"}))}}class uf{set severityText(t){this.Ve()||(this.We=t)}get severityText(){return this.We}set severityNumber(t){this.Ve()||(this.ze=t)}get severityNumber(){return this.ze}set body(t){this.Ve()||(this.Ze=t)}get body(){return this.Ze}get eventName(){return this.$e}set eventName(t){this.Ve()||(this.$e=t)}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}constructor(t,e,r){this.hrTime=void 0,this.hrTimeObserved=void 0,this.spanContext=void 0,this.resource=void 0,this.instrumentationScope=void 0,this.attributes={},this.We=void 0,this.ze=void 0,this.Ze=void 0,this.$e=void 0,this.totalAttributesCount=0,this.Qe=!1,this.Ge=void 0;var{timestamp:i,observedTimestamp:n,eventName:s,severityNumber:o,severityText:a,body:u,attributes:l={},context:h}=r,c=Date.now();if(this.hrTime=nv(null!=i?i:c),this.hrTimeObserved=nv(null!=n?n:c),h){var d=Bd.getSpanContext(h);d&&Pd(d)&&(this.spanContext=d)}this.severityNumber=o,this.severityText=a,this.body=u,this.resource=t.resource,this.instrumentationScope=e,this.Ge=t.logRecordLimits,this.$e=s,this.setAttributes(l)}setAttribute(t,e){return this.Ve()||null===e?this:0===t.length?(Ud.warn("Invalid attribute key: "+t),this):Vd(e)||"object"==typeof e&&!Array.isArray(e)&&Object.keys(e).length>0?(this.totalAttributesCount+=1,Object.keys(this.attributes).length<this.Ge.attributeCountLimit||{}.hasOwnProperty.call(this.attributes,t)?(this.attributes[t]=Vd(e)?this.Je(e):e,this):(1===this.droppedAttributesCount&&Ud.warn("Dropping extra attributes."),this)):(Ud.warn("Invalid attribute value set for key: "+t),this)}setAttributes(t){for(var[e,r]of Object.entries(t))this.setAttribute(e,r);return this}setBody(t){return this.body=t,this}setEventName(t){return this.eventName=t,this}setSeverityNumber(t){return this.severityNumber=t,this}setSeverityText(t){return this.severityText=t,this}Xe(){this.Qe=!0}Je(t){var e=this.Ge.attributeValueLengthLimit;return e>0?"string"==typeof t?this.Ye(t,e):Array.isArray(t)?t.map((t=>"string"==typeof t?this.Ye(t,e):t)):t:(Ud.warn("Attribute value limit must be positive, got "+e),t)}Ye(t,e){return t.length>e?t.substring(0,e):t}Ve(){return this.Qe&&Ud.warn("Can not execute the operation on emitted log record"),this.Qe}}class lf{constructor(t,e){this.instrumentationScope=void 0,this.Ke=void 0,this.instrumentationScope=t,this.Ke=e}emit(t){var e=t.context||jd.active(),i=new uf(this.Ke,this.instrumentationScope,r({context:e},t));this.Ke.activeProcessor.onEmit(i,e),i.Xe()}}class hf{forceFlush(){return Promise.resolve()}onEmit(t,e){}shutdown(){return Promise.resolve()}}class cf{constructor(t,e){this.processors=void 0,this.forceFlushTimeoutMillis=void 0,this.processors=t,this.forceFlushTimeoutMillis=e}forceFlush(){var t=this;return e((function*(){var e=t.forceFlushTimeoutMillis;yield Promise.all(t.processors.map((t=>kv(t.forceFlush(),e))))}))()}onEmit(t,e){this.processors.forEach((r=>r.onEmit(t,e)))}shutdown(){var t=this;return e((function*(){yield Promise.all(t.processors.map((t=>t.shutdown())))}))()}}class df{constructor(t,e,r,i){this.resource=void 0,this.forceFlushTimeoutMillis=void 0,this.logRecordLimits=void 0,this.processors=void 0,this.loggers=new Map,this.activeProcessor=void 0,this.registeredLogRecordProcessors=[],this.resource=t,this.forceFlushTimeoutMillis=e,this.logRecordLimits=r,this.processors=i,i.length>0?(this.registeredLogRecordProcessors=i,this.activeProcessor=new cf(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new hf}}class vf{constructor(t){var e,r,i;void 0===t&&(t={}),this.et=void 0,this.Ke=void 0;var n,s,o,a,u,l,h,c=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];for(var i=e.shift(),n=new WeakMap;e.length>0;)i=mv(i,e.shift(),0,n);return i}({},{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},includeTraceContext:!0},t),d=null!==(e=t.resource)&&void 0!==e?e:Bv({"service.name":"unknown_service",[Jd]:Xd[Jd],[Kd]:Xd[Kd],[Yd]:Xd[Yd]});this.Ke=new df(d,c.forceFlushTimeoutMillis,{attributeCountLimit:null!==(s=null!==(o=null!==(a=(n=c.logRecordLimits).attributeCountLimit)&&void 0!==a?a:void 0)&&void 0!==o?o:void 0)&&void 0!==s?s:128,attributeValueLengthLimit:null!==(u=null!==(l=null!==(h=n.attributeValueLengthLimit)&&void 0!==h?h:void 0)&&void 0!==l?l:void 0)&&void 0!==u?u:1/0},null!==(r=null==(i=t)?void 0:i.processors)&&void 0!==r?r:[]),this.et=new Tv(this.tt,this)}getLogger(t,e,r){if(this.et.isCalled)return Ud.warn("A shutdown LoggerProvider cannot provide a Logger"),Dc;t||Ud.warn("Logger requested without instrumentation scope name.");var i=t||"unknown",n=i+"@"+(e||"")+":"+((null==r?void 0:r.schemaUrl)||"");return this.Ke.loggers.has(n)||this.Ke.loggers.set(n,new lf({name:i,version:e,schemaUrl:null==r?void 0:r.schemaUrl},this.Ke)),this.Ke.loggers.get(n)}forceFlush(){return this.et.isCalled?(Ud.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.et.promise):this.Ke.activeProcessor.forceFlush()}shutdown(){return this.et.isCalled?(Ud.warn("shutdown may only be called once per LoggerProvider"),this.et.promise):this.et.call()}tt(){return this.Ke.activeProcessor.shutdown()}}class ff{constructor(t,e){var r,i,n,s,o,a,u,l;this.rt=void 0,this.nt=void 0,this.it=void 0,this.ot=void 0,this.st=void 0,this.ut=!1,this.ct=[],this.dt=void 0,this.et=void 0,this.rt=t,this.nt=null!==(r=null!==(i=null==e?void 0:e.maxExportBatchSize)&&void 0!==i?i:void 0)&&void 0!==r?r:512,this.it=null!==(n=null!==(s=null==e?void 0:e.maxQueueSize)&&void 0!==s?s:void 0)&&void 0!==n?n:2048,this.ot=null!==(o=null!==(a=null==e?void 0:e.scheduledDelayMillis)&&void 0!==a?a:void 0)&&void 0!==o?o:5e3,this.st=null!==(u=null!==(l=null==e?void 0:e.exportTimeoutMillis)&&void 0!==l?l:void 0)&&void 0!==u?u:3e4,this.et=new Tv(this.tt,this),this.nt>this.it&&(Ud.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this.nt=this.it)}onEmit(t){this.et.isCalled||this.ht(t)}forceFlush(){return this.et.isCalled?this.et.promise:this.vt()}shutdown(){return this.et.call()}tt(){var t=this;return e((function*(){t.onShutdown(),yield t.vt(),yield t.rt.shutdown()}))()}ht(t){this.it>this.ct.length&&(this.ct.push(t),this.ft())}vt(){return new Promise(((t,e)=>{for(var r=[],i=Math.ceil(this.ct.length/this.nt),n=0;i>n;n++)r.push(this.yt());Promise.all(r).then((()=>{t()})).catch(e)}))}yt(){return this.bt(),0===this.ct.length?Promise.resolve():new Promise(((t,e)=>{kv(this.Oe(this.ct.splice(0,this.nt)),this.st).then((()=>t())).catch(e)}))}ft(){if(!this.ut){var t=()=>{this.ut=!0,this.yt().then((()=>{this.ut=!1,this.ct.length>0&&(this.bt(),this.ft())})).catch((t=>{this.ut=!1,Zd(t)}))};if(this.ct.length>=this.nt)return t();void 0===this.dt&&(this.dt=setTimeout((()=>t()),this.ot),"number"!=typeof this.dt&&this.dt.unref())}}bt(){void 0!==this.dt&&(clearTimeout(this.dt),this.dt=void 0)}Oe(t){var e=()=>Iv.Oe(this.rt,t).then((t=>{var e;t.code!==Gd.SUCCESS&&Zd(null!==(e=t.error)&&void 0!==e?e:new Error("BatchLogRecordProcessor: log record export failed (status "+t+")"))})).catch(Zd),r=t.map((t=>t.resource)).filter((t=>t.asyncAttributesPending));return 0===r.length?e():Promise.all(r.map((t=>null==t.waitForAsyncAttributes?void 0:t.waitForAsyncAttributes()))).then(e,Zd)}}class pf extends ff{constructor(t,e){super(t,e),this.wt=void 0,this.kt=void 0,this.xt(e)}onShutdown(){"undefined"!=typeof document&&(this.wt&&document.removeEventListener("visibilitychange",this.wt),this.kt&&document.removeEventListener("pagehide",this.kt))}xt(t){!0!==(null==t?void 0:t.disableAutoFlushOnDocumentHide)&&"undefined"!=typeof document&&(this.wt=()=>{"hidden"===document.visibilityState&&this.forceFlush()},this.kt=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this.wt),document.addEventListener("pagehide",this.kt))}}var gf=(t,e,r)=>r.remaining>0?e.length>r.remaining?(t.push(e.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(t.push(e),r.remaining-=e.length,!0):(r.truncated=!0,!1),mf=(t,e,r)=>{var i=JSON.stringify(t);if(r.remaining>=i.length)return gf(e,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,s=Math.min(t.length,r.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>r.remaining?s=o-1:n=o}return gf(e,JSON.stringify(t.slice(0,n)),r)},yf=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,bf=function(t,e,r,i,n){if(void 0===n&&(n=!1),!yf(t))return!n||gf(e,"null",r);if(mr(t)||(t=>{try{return br(t)||wr(t)}catch(t){return!1}})(t))return gf(e,JSON.stringify(t),r);if("string"==typeof t)return mf(t,e,r);if(!dr(t)&&!hr(t))return gf(e,JSON.stringify(t),r);if(i.has(t))return mf("[Circular]",e,r);i.add(t);try{var s=t.toJSON;if(cr(s))return bf(s.call(t),e,r,i,n)}catch(t){}try{var o={}.toString.call(t);if("[object String]"===o)return mf(String(t.valueOf()),e,r);if("[object Number]"===o||"[object Boolean]"===o)return gf(e,JSON.stringify(t.valueOf()),r)}catch(t){}if(t instanceof Error){var a={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(a[u]=t[u])}catch(t){}try{a.name=t.name}catch(t){}try{a.message=t.message}catch(t){}try{a.stack=t.stack}catch(t){}return bf(a,e,r,i,n)}if(hr(t)){if(!gf(e,"[",r))return!1;for(var l=0;t.length>l;l++){if(l>0&&!gf(e,",",r))return!1;var h=void 0;try{h=t[l]}catch(t){h=void 0}if(!bf(h,e,r,i,!0))return!1}return gf(e,"]",r)}if(!gf(e,"{",r))return!1;var c=!0;try{for(var d in t)if({}.hasOwnProperty.call(t,d)){if(0>=r.remaining)return r.truncated=!0,!1;var v=void 0;try{v=t[d]}catch(t){continue}if(yf(v)){var f=(c?"":",")+JSON.stringify(d)+":";if(f.length>=r.remaining)return r.truncated=!0,!1;var p=e.length,g=r.remaining,m=r.truncated;if(!gf(e,f,r))return!1;var y=e.length,b=bf(v,e,r,i,!1),_=r.truncated;if(e.length!==y){if(c=!1,!b)return!1}else if(e.length=p,r.remaining=g,r.truncated=b?m:_,!b)return!1}}}catch(t){}return gf(e,"}",r)},_f=function(t,e,r,i,n,s){if(void 0===e&&(e=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=1e4),void 0===s&&(s=new WeakSet),s.has(t))return r[e||"circular"]="[Circular]",r;s.add(t);try{for(var o in t)try{if(!{}.hasOwnProperty.call(t,o))continue;var a=t[o],u=e?e+"."+o:o;if(dr(a))_f(a,u,r,i,n,s);else{if(i-=1,n-=String(a).length,n-=u.length,0>=i||0>=n)return void(r.attributes_truncated=!0);r[u]=a}}catch(t){continue}}catch(t){}return r},wf={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.logs={initializeLogs(t){(t=>{var e,i={"service.name":(null==(e=t.config.logs)?void 0:e.serviceName)||"posthog-browser-logs",host:Cn.location.host};if(t.sessionManager){var{sessionId:n,windowId:s}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i=r({},i,{"session.id":n,"window.id":s})}Wc.setGlobalLoggerProvider(new vf({resource:Bv(i),processors:[new pf(new af({url:t.config.api_host+"/i/v1/logs?token="+t.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(t);var e=Wc.getLogger("console"),i={};if(t.sessionManager){var{sessionStartTimestamp:n,lastActivityTimestamp:s}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i={sessionStartTimestamp:n.toString(),lastActivityTimestamp:s.toString()}}var o=function(n){var s;Cn.console[n]=(s=Cn.console[n],function(){for(var o=arguments.length,a=new Array(o),u=0;o>u;u++)a[u]=arguments[u];if(a.length>0){var{body:l,truncated:h}=((t,e)=>{for(var r=[],i={remaining:1e4,truncated:!1},n=0;t.length>n&&(0>=n||gf(r," ",i))&&bf(t[n],r,i,new WeakSet);n++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated}})(a),c=r({},i,h?{body_truncated:"true"}:{});e.emit({severityText:wf[n],body:l,attributes:r({"log.source":"console."+n,distinct_id:t.get_distinct_id(),"location.href":Cn.location.href},c,dr(a[0])?_f(a[0]):{})}),s.apply(Cn.console,a)}})};for(var a of["debug","log","warn","error","info"])o(a)}};var xf=On("[Error tracking]");function Sf(){return new $i([new Ji,new an,new Yi,new Ki,new sn,new nn,new tn,new on],function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;e>n;n++)i[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],o=e.split("\n"),a=n;o.length>a;a++){var u=o[a];if(1024>=u.length){var l=Gi.test(u)?u.replace(Gi,"$1"):u;if(!l.match(/\S*Error: /)){for(var h of i){var c=h(l,t);if(c){s.push(c);break}}if(s.length>=Qi)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Qi).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||Di});var i}))}(s)}}("web:javascript",zi,Zi))}var kf=On("[ExceptionAutocapture]"),Cf=Sf(),Tf={wrapOnError(t){var e=pn;e||kf.info("window not available, cannot wrap onerror");var r=e.onerror;return e.onerror=function(){for(var e,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];var o=Cf.buildFromUnknown(n[4]||n[0],{mechanism:{handled:!1}});return t(o),null!==(e=null==r?void 0:r(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=r}},wrapUnhandledRejection(t){var e=pn;e||kf.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(e){var i,n=Cf.buildFromUnknown(e,{mechanism:{handled:!1}});return t(n),null!==(i=null==r?void 0:r(e))&&void 0!==i&&i},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=r}},wrapConsoleError(t){var e=console;e||kf.info("console not available, cannot wrap console.error");var r=e.error;return e.error=function(){for(var e,i=arguments.length,n=new Array(i),s=0;i>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var o=n.find((t=>t instanceof Error)),a=Cf.buildFromUnknown(o||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});return t(a),null==r?void 0:r(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=r}}};Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.errorWrappingFunctions=Tf,Cn.posthogErrorWrappingFunctions=Tf;var If="X-POSTHOG-SESSION-ID",Ef="X-POSTHOG-WINDOW-ID",Rf="X-POSTHOG-DISTINCT-ID",Mf=[If,Ef,Rf],Of=(t,e,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(t){return}if(!hr(t)||t.includes(n)){if(r){var{sessionId:s,windowId:o}=r.checkAndGetSessionAndWindowId(!0);i.headers.set(If,s),i.headers.set(Ef,o)}e!==Us&&i.headers.set(Rf,e)}};Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{};var Pf={_patchFetch:(t,r,i)=>Gn(pn,"fetch",(n=>function(){var s=e((function*(e,s){var o=new Request(e,s);return Of(t,r,i,o),n(o)}));return function(t,e){return s.apply(this,arguments)}}())),_patchXHR:(t,e,r)=>Gn(pn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,u){void 0===o&&(o=!0);var l=this,h=new Request(s);Of(t,e,r,h);var c=i.call(l,n,h.url,o,a,u);return Mf.forEach((t=>{var e=h.headers.get(t);e&&l.setRequestHeader(t,e)})),c}))};Cn.__PosthogExtensions__.tracingHeadersPatchFns=Pf,Cn.postHogTracingHeadersPatchFns=Pf;var Lf=-1,Af=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Lf=e.timeStamp,t(e))}),!0)},Nf=(t,e,r,i)=>{var n,s;return o=>{e.value>=0&&(o||i)&&((s=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=s,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},Ff=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},$f=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Df=()=>{var t,e=$f();return null!==(t=null==e?void 0:e.activationStart)&&void 0!==t?t:0},qf=function(t,e){void 0===e&&(e=-1);var r=$f(),i="navigate";return 0>Lf?r&&(document.prerendering||Df()>0?i="prerender":document.wasDiscarded?i="restore":r.type&&(i=r.type.replace(/_/g,"-"))):i="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},jf=new WeakMap;function Uf(t,e){return jf.get(t)||jf.set(t,new e),jf.get(t)}class Hf{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}}var Bf,zf=function(t,e,i){void 0===i&&(i={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{Promise.resolve().then((()=>{e(t.getEntries())}))}));return n.observe(r({type:t,buffered:!0},i)),n}}catch(t){}},Vf=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Wf=-1,Zf=new Set,Gf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Qf=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Zf)e();isFinite(Wf)||(Wf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Qf,!0))}},Jf=()=>{if(0>Wf){var t,e=Df(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0])?void 0:t.startTime;Wf=null!=r?r:Gf(),addEventListener("visibilitychange",Qf,!0),addEventListener("prerenderingchange",Qf,!0),Af((()=>{setTimeout((()=>{Wf=Gf()}))}))}return{get firstHiddenTime(){return Wf},onHidden(t){Zf.add(t)}}},Kf=t=>{document.prerendering?addEventListener("prerenderingchange",(()=>t()),!0):t()},Yf=[1800,3e3],Xf=function(t,e){void 0===e&&(e={}),Kf((()=>{var r,i=Jf(),n=qf("FCP"),s=zf("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),i.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-Df(),0),n.entries.push(e),r(!0)))}));s&&(r=Nf(t,n,Yf,e.reportAllChanges),Af((i=>{n=qf("FCP"),r=Nf(t,n,Yf,e.reportAllChanges),Ff((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},tp=[.1,.25],ep=0,rp=1/0,ip=0,np=t=>{for(var e of t)e.interactionId&&(rp=Math.min(rp,e.interactionId),ip=Math.max(ip,e.interactionId),ep=ip?(ip-rp)/7+1:0)},sp=()=>{var t;return Bf?ep:null!==(t=performance.interactionCount)&&void 0!==t?t:0},op=0;class ap{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){op=sp(),this.u.length=0,this.l.clear()}L(){var t=Math.min(this.u.length-1,Math.floor((sp()-op)/50));return this.u[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var r=this.u.at(-1),i=this.l.get(t.interactionId);if(i||10>this.u.length||t.duration>r.P){var n;if(i?t.duration>i.P?(i.entries=[t],i.P=t.duration):t.duration===i.P&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.l.set((i={id:t.interactionId,entries:[t],P:t.duration}).id,i),this.u.push(i)),this.u.sort(((t,e)=>e.P-t.P)),this.u.length>10){var s=this.u.splice(10);for(var o of s)this.l.delete(o.id)}null==(n=this.p)||n.call(this,i)}}}}var up=t=>{var e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=Vf(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e((()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})})))},lp=[200,500];class hp{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var cp=[2500,4e3],dp={onLCP(t,e){void 0===e&&(e={}),Kf((()=>{var r,i=Jf(),n=qf("LCP"),s=Uf(e,hp),o=t=>{for(var o of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(o),i.firstHiddenTime>o.startTime&&(n.value=Math.max(o.startTime-Df(),0),n.entries=[o],r())},a=zf("largest-contentful-paint",o);if(a){r=Nf(t,n,cp,e.reportAllChanges);var u=Vf((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),l=t=>{t.isTrusted&&(up(u),removeEventListener(t.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});Af((i=>{n=qf("LCP"),r=Nf(t,n,cp,e.reportAllChanges),Ff((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var r=Jf();Xf(Vf((()=>{var i,n=qf("CLS",0),s=Uf(e,Hf),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=zf("layout-shift",o);a&&(i=Nf(t,n,tp,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),Af((()=>{s.i=0,n=qf("CLS",0),i=Nf(t,n,tp,e.reportAllChanges),Ff((()=>i()))})),setTimeout(i))})))},onFCP:Xf,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Jf();Kf((()=>{var i;"interactionCount"in performance||Bf||(Bf=zf("event",np,{type:"event",buffered:!0,durationThreshold:0}));var n,s=qf("INP"),o=Uf(e,ap),a=t=>{up((()=>{for(var e of t)o.h(e);var r=o.L();r&&r.P!==s.value&&(s.value=r.P,s.entries=r.entries,n())}))},u=zf("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=Nf(t,s,lp,e.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(u.takeRecords()),n(!0)})),Af((()=>{o.v(),s=qf("INP"),n=Nf(t,s,lp,e.reportAllChanges)})))}))}}};Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.postHogWebVitalsCallbacks=dp,Cn.postHogWebVitalsCallbacks=dp,Cn.__PosthogExtensions__.loadWebVitalsCallbacks=()=>dp;class vp{constructor(t){this.disabled=!1===t;var e=dr(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,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(e-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:t,y:e,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:r}];return!1}}var fp="$copy_autocapture",pp=On("[AutoCapture]");function gp(t,e){return e.length>t?e.slice(0,t)+"...":e}function mp(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!ao(e));return e}function yp(t,e){var i,n,{e:s,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:u,elementsChainAsString:l}=e;if(!ao(t))return{props:{}};for(var h=[t],c=t;c.parentNode&&!uo(c,"body");)if(ho(c.parentNode))h.push(c.parentNode.host),c=c.parentNode.host;else{if(!ao(c.parentNode))break;h.push(c.parentNode),c=c.parentNode}var d,v,f=[],p={},g=!1,m=!1;if(Ln(h,(t=>{var e=To(t);if(uo(t,"a")){var r=t.getAttribute("href");g=e&&!!r&&Ao(r)&&r}nr(fo(t),"ph-no-capture")&&(m=!0),f.push(function(t,e,r,i){var n=t.tagName.toLowerCase(),s={tag_name:n};yo.indexOf(n)>-1&&!r&&(s.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?gp(1024,No(t)):gp(1024,go(t)));var o=fo(t);o.length>0&&(s.classes=o.filter((function(t){return""!==t}))),Ln(t.attributes,(function(r){var n;if((!Io(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&Ao(r.value)&&(!pr(n=r.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=r.value;"class"===r.name&&(o=co(o).join(" ")),s["attr__"+r.name]=gp(1024,o)}}));for(var a=1,u=1,l=t;l=mp(l);)a++,l.tagName===t.tagName&&u++;return s.nth_child=a,s.nth_of_type=u,s}(t,o,a,u));var i=function(t){if(!To(t))return{};var e={};return Ln(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&Ao(i)&&(e[r]=i)}})),e}(t);An(p,i)})),m)return{props:{},explicitNoCapture:m};if(a||(f[0].$el_text=uo(t,"a")||uo(t,"button")?No(t):go(t)),g){var y,b;f[0].attr__href=g;var _=null==(y=Bn(g))?void 0:y.host,w=null==pn||null==(b=pn.location)?void 0:b.host;_&&w&&_!==w&&(d=g)}return{props:An({$event_type:s.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:(v=f,function(t){var e=t.map((t=>{var e,i,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=r({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),a={};return Nn(o).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[$o(e.toString())]=$o(r.toString())})),(n+=":")+Nn(a).map((t=>{var[e,r]=t;return e+'="'+r+'"'})).join("")}));return e.join(";")}(function(t){return t.map((t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:Do(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Nn(t).filter((t=>{var[e]=t;return 0===e.indexOf("attr__")})).forEach((t=>{var[e,r]=t;return i.attributes[e]=r})),i}))}(v)))},null!=(i=f[0])&&i.$el_text?{$el_text:null==(n=f[0])?void 0:n.$el_text}:{},d&&"click"===s.type?{$external_click_url:d}:{},p)}}var bp={};function _p(t){return function(t,e){var r=bp[t];if(r)return r;var i,n=e[t];if(cr(i=n)&&-1!==i.toString().indexOf("[native code]")&&!pn.Zone)return bp[t]=n.bind(e);var s=e.document;if(s&&cr(s.createElement))try{var o=s.createElement("iframe");o.hidden=!0,s.head.appendChild(o);var a=o.contentWindow;a&&a[t]&&(n=a[t]),s.head.removeChild(o)}catch(e){Mn.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return n&&cr(n)?bp[t]=n.bind(e):n}("MutationObserver",t)}function wp(t,e){return br(t)&&t>=e}class xp{St(t){var e,r,i,n,s,o=this.Ct((null==t?void 0:t.__onCapture)||this.It.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!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:o.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i: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,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:o.__onCapture}}constructor(t,e){this.Tt=[],this.Ct=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.Mt=t=>{var e=function(t){var e=mo(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);mr(e)||this._t(e)||this.Tt.push(e),this.Tt.length&&fr(this.Lt)&&(this.Lt=Cn.setTimeout((()=>{this.Ot()}),1e3))},this.Et=()=>{var t=Date.now();t%50==0&&this.Tt.forEach((e=>{fr(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Rt=()=>{this.Nt=Date.now()},this.At=()=>{"visible"===(null==yn?void 0:yn.visibilityState)&&(this.Pt=Date.now())},this.instance=t,this.qt=this.St(e),this._onCapture=this.qt.__onCapture}start(t){this.Dt(),this.Ft(),this.jt(),this.Ht(),this.Ut(t)}Ut(t){if(!this.Bt){var e=_p(Cn);this.Bt=new e((t=>{this.Vt(t)})),this.Bt.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Bt)||t.disconnect(),this.Bt=void 0,Cn.removeEventListener("click",this.Mt),Cn.removeEventListener("scroll",this.Et,{capture:!0}),Cn.removeEventListener("selectionchange",this.Rt),null==yn||yn.removeEventListener("visibilitychange",this.At)}Vt(t){this.Wt=Date.now()}Dt(){Un(Cn,"click",this.Mt)}Ft(){Un(Cn,"scroll",this.Et,{capture:!0})}jt(){Un(Cn,"selectionchange",this.Rt)}Ht(){Un(yn,"visibilitychange",this.At)}_t(t){if(!t)return!0;if(!this.qt.capture_clicks_with_modifier_keys&&((e=t.originalEvent).ctrlKey||e.metaKey||e.altKey||e.shiftKey))return!0;var e;if(oo(t.node))return!0;var r=this.Tt.some((e=>e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!r&&!uo(t.node,"html")&&ao(t.node)&&!function(t){if(!pn||ko(t))return!1;var{targetElementList:e}=Co(t,!1);return e.some((t=>uo(t,"a")))}(t.node)&&function(t,e){var r;if(!pn||ko(t))return!1;var i=wr(e)?xo:null!==(r=null==e?void 0:e.css_selector_ignorelist)&&void 0!==r?r:xo,{targetElementList:n}=Co(t,!1);return!bo(n,i)}(t.node,{css_selector_ignorelist:this.qt.css_selector_ignorelist}))}Ot(){if(this.Tt.length){clearTimeout(this.Lt),this.Lt=void 0;var t=this.Tt;for(var e of(this.Tt=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Wt&&this.Wt>=e.timestamp?this.Wt-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.Nt&&this.Nt>=e.timestamp?this.Nt-e.timestamp:void 0,e.visibilityChangedDelayMs=this.Pt?Math.abs(e.timestamp-this.Pt):void 0;var i=wp(e.scrollDelayMs,this.qt.scroll_threshold_ms),n=wp(e.selectionChangedDelayMs,this.qt.selection_change_threshold_ms),s=wp(e.mutationDelayMs,this.qt.mutation_threshold_ms),o=wp(e.absoluteDelayMs,1.1*this.qt.mutation_threshold_ms),a=br(e.scrollDelayMs)&&this.qt.scroll_threshold_ms>e.scrollDelayMs,u=br(e.mutationDelayMs)&&this.qt.mutation_threshold_ms>e.mutationDelayMs,l=br(e.selectionChangedDelayMs)&&this.qt.selection_change_threshold_ms>e.selectionChangedDelayMs,h=br(e.visibilityChangedDelayMs)&&this.qt.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(a||u||l||h)){var c=wp(e.visibilityChangedDelayMs,this.qt.selection_change_threshold_ms);i||s||o||n||c?this._onCapture(e,{$dead_click_last_mutation_timestamp:this.Wt,$dead_click_event_timestamp:e.timestamp,$dead_click_scroll_timeout:i,$dead_click_mutation_timeout:s,$dead_click_absolute_timeout:o,$dead_click_selection_changed_timeout:n,$dead_click_visibility_changed_timeout:c}):this.qt.mutation_threshold_ms>e.absoluteDelayMs&&this.Tt.push(e)}}this.Tt.length&&fr(this.Lt)&&(this.Lt=Cn.setTimeout((()=>{this.Ot()}),1e3))}}It(t,e){this.instance.capture("$dead_click",r({},e,yp(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qt.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,$dead_click_visibility_changed_delay_ms:t.visibilityChangedDelayMs}),{timestamp:new Date(t.timestamp)})}}Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new xp(t,e);var Sp=On("[ExternalScriptsLoader]"),kp=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return Sp.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==yn?void 0:yn.querySelectorAll("script");if(i)for(var n,s=function(){if(i[o].src===e){var t=i[o];return t.__posthog_loading_callback_fired?{v:r()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,r(void 0,e)})),t.onerror=t=>r(t),{v:void 0})}},o=0;i.length>o;o++)if(n=s())return n.v;var a=()=>{if(!yn)return r("document not found");var i=yn.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=e,i.onload=t=>{i.__posthog_loading_callback_fired=!0,r(void 0,t)},i.onerror=t=>r(t),t.config.prepare_external_dependency_script&&(i=t.config.prepare_external_dependency_script(i)),!i)return r("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)yn.head.appendChild(i);else{var n,s=yn.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):yn.body.appendChild(i)}};null!=yn&&yn.body?a():null==yn||yn.addEventListener("DOMContentLoaded",a)};Cn.__PosthogExtensions__=Cn.__PosthogExtensions__||{},Cn.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{if("remote-config"!==e){var i;if(t.config.__preview_external_dependency_versioned_paths)i=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var n="/static/"+e+".js?v="+t.version;if("toolbar"===e){var s=3e5;n=n+"&t="+Math.floor(Date.now()/s)*s}i=t.requestRouter.endpointFor("assets",n)}kp(t,i,r)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");kp(t,o,r)}},Cn.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);kp(t,i,r)};class Cp{constructor(t){this._instance=t}get qt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.qt.cookieless_mode===Zs||this.isRejected()||-1===this.consent&&this.qt.cookieless_mode===Ws}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.qt.opt_out_capturing_by_default}optInOut(t){this.nr.N(this.sr,t?1:0,this.qt.cookie_expiration,this.qt.cross_subdomain_cookie,this.qt.secure_cookie)}reset(){this.nr.q(this.sr,this.qt.cross_subdomain_cookie)}get sr(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:r}=this._instance.config;return r||(e?e+t:"__ph_opt_in_out_"+t)}get ir(){var t=this.nr.A(this.sr);return Ir(t)?1:nr(Er,t)?0:-1}get nr(){var t=this.qt.opt_out_capturing_persistence_type,e="localStorage"===t?Kl:Ql;if(!this.ar||this.ar!==e){this.ar=e;var r="localStorage"===t?Ql:Kl;r.A(this.sr)&&(this.ar.A(this.sr)||this.optInOut(Ir(r.A(this.sr))),r.q(this.sr,this.qt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.qt.respect_dnt&&[null==mn?void 0:mn.doNotTrack,null==mn?void 0:mn.msDoNotTrack,Cn.doNotTrack].some((t=>Ir(t)))}}var Tp=On("[Dead Clicks]"),Ip=()=>!0,Ep=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(os)),i=t.instance.config.capture_dead_clicks;return wr(i)?i:!!dr(i)||r};class Rp{get lazyLoadedDeadClicksAutocapture(){return this.ur}constructor(t,e,r){this.instance=t,this.isEnabled=e,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[os]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.lr((()=>{this.hr()})):this.stop()}lr(t){var e,r;null!=(e=Cn.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=Cn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Tp.error("failed to load script",e):t()}))}hr(){var t;if(yn){if(!this.ur&&null!=(t=Cn.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=dr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.ur=Cn.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.ur.start(yn),Tp.info("starting...")}}else Tp.error("`document` not found. Cannot start.")}stop(){this.ur&&(this.ur.stop(),this.ur=void 0,Tp.info("stopping..."))}}var Mp=On("[SegmentIntegration]");var Op="posthog-js";function Pp(t,e){var{organization:i,projectId:n,prefix:s,severityAllowList:o=["error"],sendExceptionsToPostHog:a=!0}=void 0===e?{}:e;return e=>{var u,l,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,p=(null==(u=e.exception)?void 0:u.values)||[],g=p.map((t=>r({},t,{stacktrace:t.stacktrace?r({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>r({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(l=p[0])?void 0:l.value)||e.message,$exception_type:null==(h=p[0])?void 0:h.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(c=p[0])?void 0:c.value)||e.message,$sentry_exception_type:null==(d=p[0])?void 0:d.type,$sentry_tags:e.tags};return i&&n&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+e.event_id),a&&(null==(f=t.exceptions)||f.sendExceptionEvent(m)),e}}class Lp{constructor(t,e,r,i,n,s){this.name=Op,this.setupOnce=function(o){o(Pp(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class Ap{constructor(t){this.cr=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(Mn.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.vr()}vr(){var t;this.pr=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.cr)}destroy(){var t;null==(t=this.pr)||t.call(this),this.pr=void 0}doPageView(t,e){var r,i=this.gr(t,e);return this.dr={pathname:null!==(r=null==pn?void 0:pn.location.pathname)&&void 0!==r?r:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var e;return this.gr(t,null==(e=this.dr)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.dr)?void 0:t.pageViewId}}gr(t,e){var r=this.dr;if(!r)return{$pageview_id:e};var i={$pageview_id:e,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:u,lastContentY:l,maxContentY:h}=n;if(!(fr(s)||fr(o)||fr(a)||fr(u)||fr(l)||fr(h))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),h=Math.ceil(h);var c=s>1?Rr(o/s,0,1,Mn):1,d=s>1?Rr(a/s,0,1,Mn):1,v=u>1?Rr(l/u,0,1,Mn):1,f=u>1?Rr(h/u,0,1,Mn):1;i=An(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Np={[Jn]:{exposure:"hidden"},[Yn]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Xn]:{exposure:"hidden"},[ts]:{exposure:"event"},[es]:{exposure:"hidden"},[rs]:{exposure:"event"},[is]:{exposure:"hidden"},[ns]:{exposure:"event"},[ss]:{exposure:"event"},[os]:{exposure:"event"},[as]:{exposure:"hidden"},[us]:{exposure:"event"},[ls]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[fs]:{exposure:"hidden"},[ps]:{exposure:"event"},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},[gs]:{exposure:"derived",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!dr(t))return{};for(var e={},r=Object.keys(t),i=0;r.length>i;i++)e["$feature/"+r[i]]=t[r[i]];return e}},[ms]:{exposure:"event"},[ys]:{exposure:"hidden"},[bs]:{exposure:"hidden"},[_s]:{exposure:"event"},[ws]:{exposure:"event"},[xs]:{exposure:"event"},[Ss]:{exposure:"hidden"},[ks]:{exposure:"hidden"},[Cs]:{exposure:"hidden"},[Ts]:{exposure:"hidden"},[Is]:{exposure:"event"},[Es]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Rs]:{exposure:"hidden"},[Ms]:{exposure:"hidden"},[Os]:{exposure:"hidden"},[Ps]:{exposure:"hidden"},[Ls]:{exposure:"hidden"},[As]:{exposure:"hidden"},[Ns]:{exposure:"hidden"},[Fs]:{exposure:"hidden"},[$s]:{exposure:"hidden"},[Ds]:{exposure:"hidden"},[qs]:{exposure:"hidden"},[hs]:{exposure:"event"},[cs]:{exposure:"event"},[ds]:{exposure:"event"},[vs]:{exposure:"event"},[Hs]:{exposure:"event"},[Bs]:{exposure:"event"},[zs]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Fp=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],$p=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Dp{constructor(t,e){this.qt=t,this.props={},this.mr=!1,this.yr=(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.nr=this.br(t),this.load(),t.debug&&Mn.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this._r}br(t){-1===$p.indexOf(t.persistence.toLowerCase())&&(Mn.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=[...Yl,...t];return r({},Kl,{F(t){try{var e={};try{e=Ql.F(t)||{}}catch(t){}var r=An(e,JSON.parse(Kl.A(t)||"{}"));return Kl.N(t,r),r}catch(t){}return null},N(t,r,i,n,s,o){try{Kl.N(t,r,void 0,void 0,o);var a={};e.forEach((t=>{r[t]&&(a[t]=r[t])})),Object.keys(a).length&&Ql.N(t,a,i,n,s,o)}catch(t){Kl.D(t)}},q(t,e){try{null==pn||pn.localStorage.removeItem(t),Ql.q(t,e)}catch(t){Kl.D(t)}}})}(t.cookie_persisted_properties||[]),i=t.persistence.toLowerCase();return"localstorage"===i&&Kl.R()?Kl:"localstorage+cookie"===i&&e.R()?e:"sessionstorage"===i&&rh.R()?rh:"memory"===i?th:"cookie"===i?Ql:e.R()?e:Ql}wr(t){var e=null!=t?t:this.qt.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var r=this.props[Ps];return!r||"number"!=typeof r||Date.now()-r>e}properties(){var t={};return Ln(this.props,((e,r)=>{var i=(t=>{var e=Np[t];if(e)return e;for(var[r,i]of Fp)if(0===t.indexOf(r))return i})(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,r===gs?()=>this.wr():()=>!1))return;i.transformToEventProperties&&An(t,i.transformToEventProperties(e))}else i&&"event"!==i.exposure||(t[r]=e)})),t}load(){if(!this._r){var t=this.nr.F(this.yr);t&&(this.props=An({},t))}}save(){this._r||this.nr.N(this.yr,this.props,this.Sr,this.kr,this.Cr,this.qt.debug)}remove(){this.nr.q(this.yr,!1),this.nr.q(this.yr,!0)}clear(){this.remove(),this.props={}}register_once(t,e,r){if(dr(t)){fr(e)&&(e="None"),this.Sr=fr(r)?this.Ir:r;var i=!1;if(Ln(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.Tr(r,t),i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(dr(t)){this.Sr=fr(e)?this.Ir:e;var r=!1;if(Ln(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.Tr(i,e),r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Er(t),this.save())}update_campaign_params(){if(!this.mr){var t=dc(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);vr(Dn(t))||this.register(t),this.mr=!0}}update_search_keyword(){var t;this.register((t=null==yn?void 0:yn.referrer)?fc(t):{})}update_referrer_info(){var t;this.register_once({$referrer:mc(),$referring_domain:null!=yn&&yn.referrer&&(null==(t=Bn(yn.referrer))?void 0:t.host)||gc},void 0)}set_initial_person_info(){this.props[Fs]||this.props[$s]||this.register_once({[Ds]:yc(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Ln([$s,Fs],(e=>{var r=this.props[e];r&&Ln(r,(function(e,r){t["$initial_"+or(r)]=e}))}));var e,r,i=this.props[Ds];if(i){var n=(e=bc(i),r={},Ln(e,(function(t,e){r["$initial_"+or(e)]=t})),r);An(t,n)}return t}safe_merge(t){return Ln(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){if(this.Ir=this.Sr=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),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 r=[...t].sort(),i=[...e].sort();return r.every(((t,e)=>t===i[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[])){var i=this.br(t),n=this.props;this.clear(),this.nr=i,this.props=n,this.save()}}set_disabled(t){this._r=t,this._r?this.remove():this.save()}set_cross_subdomain(t){t!==this.kr&&(this.kr=t,this.remove(),this.save())}set_secure(t){t!==this.Cr&&(this.Cr=t,this.remove(),this.save())}set_event_timer(t,e){var r=this.props[Xn]||{};r[t]=e,this.Tr(Xn,r),this.save()}remove_event_timer(t){var e=this.props[Xn]||{},r=e[t];return fr(r)||(delete e[t],this.Tr(Xn,e),this.save()),r}get_property(t){return this.props[t]}set_property(t,e){this.Tr(t,e),this.save()}Tr(t,e){this.props[t]=e}Er(t){delete this.props[t]}}var qp={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},jp={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},Up={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},Hp=On("[RateLimiter]");class Bp{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach((t=>{Hp.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void Hp.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var e,r,i;void 0===t&&(t=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:s}=this,o=(new Date).getTime(),a=null!==(e=null==(r=this.instance.persistence)?void 0:r.get_property(Ns))&&void 0!==e?e:{tokens:n,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>n&&(a.tokens=n);var u=1>a.tokens;return u||t||(a.tokens=Math.max(0,a.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,null==(i=this.instance.persistence)||i.set_property(Ns,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var zp=On("[RemoteConfig]");class Vp{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=Cn._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Mr(t){var e,r;null!=(e=Cn.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=Cn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Pr(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 zp.info("Using preloaded remote config",this.remoteConfig),this.Rr(this.remoteConfig),void this.Or();if(this._instance.Lr())return void zp.warn("Remote config is disabled. Falling back to local config.");this.Mr((t=>{if(!t)return zp.info("No config found after loading remote JS config. Falling back to JSON."),void this.Pr((t=>{this.Rr(t),this.Or()}));this.Rr(t),this.Or()}))}catch(t){zp.error("Error loading remote config",t)}}stop(){this.Fr&&(clearInterval(this.Fr),this.Fr=void 0)}refresh(){!this._instance.Lr()&&yn&&"hidden"!==yn.visibilityState&&this._instance.reloadFeatureFlags()}Or(){var t;if(!this.Fr){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.Fr=setInterval((()=>{this.refresh()}),e))}}Rr(t){var e;t||zp.error("Failed to fetch remote config from PostHog."),this._instance.Rr(null!=t?t:{}),!1!==(null==t?void 0:t.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(e=this._instance.featureFlags)||e.ensureFlagsLoaded())}}var Wp=3e3;class Zp{constructor(t,e){this.Ar=!0,this.Nr=[],this.$r=Rr((null==e?void 0:e.flush_interval_ms)||Wp,250,5e3,Mn.createLogger("flush interval"),Wp),this.Dr=t}enqueue(t){this.Nr.push(t),this.qr||this.jr()}unload(){this.Hr();var t=this.Nr.length>0?this.Ur():{},e=Object.values(t),i=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];i.map((t=>{this.Dr(r({},t,{transport:"sendBeacon"}))}))}enable(){this.Ar=!1,this.jr()}jr(){var t=this;this.Ar||(this.qr=setTimeout((()=>{if(this.Hr(),this.Nr.length>0){var e=this.Ur(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&hr(r.data)&&Ln(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.Dr(r)};for(var i in e)r()}}),this.$r))}Hr(){clearTimeout(this.qr),this.qr=void 0}Ur(){var t={};return Ln(this.Nr,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;fr(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.Nr=[],t}}var Gp=["retriesPerformedSoFar"];class Qp{constructor(t){this.Br=!1,this.zr=3e3,this.Nr=[],this._instance=t,this.Nr=[],this.Vr=!0,!fr(pn)&&"onLine"in pn.navigator&&(this.Vr=pn.navigator.onLine,this.Wr=()=>{this.Vr=!0,this.Zr()},this.Gr=()=>{this.Vr=!1},Un(pn,"online",this.Wr),Un(pn,"offline",this.Gr))}get length(){return this.Nr.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,Gp);_r(e)&&(n.url=Nl(n.url,{retry_count:e})),this._instance._send_request(r({},n,{callback:t=>{200===t.statusCode||t.statusCode>=400&&500>t.statusCode||(null!=e?e:0)>=10?null==n.callback||n.callback(t):this.Qr(r({retriesPerformedSoFar:e},n))}}))}Qr(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var r=function(t){var e=3e3*Math.pow(2,t),r=e/2,i=Math.min(18e5,e),n=Math.random()-.5;return Math.ceil(i+n*(i-r))}(e),i=Date.now()+r;this.Nr.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),Mn.warn(n),this.Br||(this.Br=!0,this.Jr())}Jr(){if(this.Kr&&clearTimeout(this.Kr),0===this.Nr.length)return this.Br=!1,void(this.Kr=void 0);this.Kr=setTimeout((()=>{this.Vr&&this.Nr.length>0&&this.Zr(),this.Jr()}),this.zr)}Zr(){var t=Date.now(),e=[],r=this.Nr.filter((r=>t>r.retryAt||(e.push(r),!1)));if(this.Nr=e,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.Kr&&(clearTimeout(this.Kr),this.Kr=void 0),this.Br=!1,fr(pn)||(this.Wr&&(pn.removeEventListener("online",this.Wr),this.Wr=void 0),this.Gr&&(pn.removeEventListener("offline",this.Gr),this.Gr=void 0)),this.Nr))try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(t){Mn.error(t)}this.Nr=[]}}class Jp{constructor(t){this.Yr=()=>{var t,e,r,i;this.Xr||(this.Xr={});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),u=(null==n?void 0:n.scrollHeight)||0;this.Xr.lastScrollY=Math.ceil(s),this.Xr.maxScrollY=Math.max(s,null!==(t=this.Xr.maxScrollY)&&void 0!==t?t:0),this.Xr.maxScrollHeight=Math.max(o,null!==(e=this.Xr.maxScrollHeight)&&void 0!==e?e:0),this.Xr.lastContentY=a,this.Xr.maxContentY=Math.max(a,null!==(r=this.Xr.maxContentY)&&void 0!==r?r:0),this.Xr.maxContentHeight=Math.max(u,null!==(i=this.Xr.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}get ei(){return this._instance.config.scroll_root_selector}getContext(){return this.Xr}resetContext(){var t=this.Xr;return setTimeout(this.Yr,0),t}startMeasuringScrollPosition(){Un(pn,"scroll",this.Yr,{capture:!0}),Un(pn,"scrollend",this.Yr,{capture:!0}),Un(pn,"resize",this.Yr)}scrollElement(){if(!this.ei)return null==pn?void 0:pn.document.documentElement;var t=hr(this.ei)?this.ei:[this.ei];for(var e of t){var r=null==pn?void 0:pn.document.querySelector(e);if(r)return r}}scrollY(){if(this.ei){var t=this.scrollElement();return t&&t.scrollTop||0}return pn&&(pn.scrollY||pn.pageYOffset||pn.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var t=this.scrollElement();return t&&t.scrollLeft||0}return pn&&(pn.scrollX||pn.pageXOffset||pn.document.documentElement.scrollLeft)||0}}var Kp=t=>yc(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class Yp{constructor(t,e,r,i){this.ti=t=>{var e=this.ri();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.ii(this._instance)};this.ni.register({[As]:r})}},this._instance=t,this.si=e,this.ni=r,this.ii=i||Kp,this.si.onSessionId(this.ti)}ri(){return this.ni.props[As]}getSetOnceProps(){var t,e=null==(t=this.ri())?void 0:t.props;return e?"r"in e?bc(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 Ln(Dn(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+or(r)]=e})),t}}class Xp{constructor(){this.oi={}}on(t,e){return this.oi[t]||(this.oi[t]=[]),this.oi[t].push(e),()=>{this.oi[t]=this.oi[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.oi[t]||[])r(e);for(var i of this.oi["*"]||[])i(t,e)}}var tg=On("[SessionId]");class eg{on(t,e){return this.ai.on(t,e)}constructor(t,e,r){var i;if(this.ui=[],this.li=void 0,this.ai=new Xp,this.hi=(t,e)=>!(!_r(t)||!_r(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Zs)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qt=t.config,this.ni=t.persistence,this.ci=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=e||Qu,this.fi=r||Qu;var n=this.qt.persistence_name||this.qt.token;if(this._sessionTimeoutMs=1e3*Rr(this.qt.session_idle_timeout_seconds||1800,60,36e3,tg.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi="ph_"+n+"_window_id",this.mi="ph_"+n+"_primary_window_exists",this.yi()){var s=rh.F(this.gi),o=rh.F(this.mi);s&&!o?this.ci=s:rh.q(this.gi),rh.N(this.mi,!0)}if(null!=(i=this.qt.bootstrap)&&i.sessionID)try{var a=(t=>{var e=this.qt.bootstrap.sessionID.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.bi(this.qt.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){tg.error("Invalid sessionID in bootstrap",t)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return fr(this.ui)&&(this.ui=[]),this.ui.push(t),this.di&&t(this.di,this.ci),()=>{this.ui=this.ui.filter((e=>e!==t))}}yi(){return"memory"!==this.qt.persistence&&!this.ni._r&&rh.R()}xi(t){t!==this.ci&&(this.ci=t,this.yi()&&rh.N(this.gi,t))}Si(){return this.ci?this.ci:this.yi()?rh.F(this.gi):null}bi(t,e,r){t===this.di&&e===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.di=t,this.ni.register({[fs]:[e,t,r]}))}ki(){var t=this.ni.props[fs];return hr(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.bi(null,null,null)}destroy(){clearTimeout(this.Ci),this.Ci=void 0,this.li&&pn&&(pn.removeEventListener(Ys,this.li,{capture:!1}),this.li=void 0),this.ui=[]}wi(){this.li=()=>{this.yi()&&rh.q(this.mi)},Un(pn,Ys,this.li,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.qt.cookieless_mode===Zs)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),[i,n,s]=this.ki(),o=this.Si(),a=_r(s)&&Math.abs(r-s)>864e5,u=!1,l=!n,h=!l&&!t&&this.hi(r,i);l||h||a?(n=this.vi(),o=this.fi(),tg.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}}),s=r,u=!0):o||(o=this.fi(),u=!0);var c=_r(i)&&t&&!a?i:r,d=_r(s)?s:(new Date).getTime();return this.xi(o),this.bi(n,c,d),t||this.pi(),u&&this.ui.forEach((t=>t(n,o,u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:d,changeReason:u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:i}}pi(){clearTimeout(this.Ci),this.Ci=setTimeout((()=>{var[t]=this.ki();if(this.hi((new Date).getTime(),t)){var e=this.di;this.resetSessionId(),this.ai.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var rg=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&ir(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>ir(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},ig="custom",ng="i.posthog.com",sg=/^\/static\//;class og{constructor(t){this.Ii={},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("."+ng,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Ii[this.apiHost]||(this.Ii[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":ig),this.Ii[this.apiHost]}Ti(t){var e=this.instance.config.__preview_external_dependency_versioned_paths;if("string"==typeof e&&sg.test(t))return e.trim().replace(/\/$/,"")||void 0}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("assets"===t){var r=this.Ti(e);if(r)return""+r+e}if(this.region===ig)return this.apiHost+e;var i=ng+e;switch(t){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var ag=On("[PostHog ExternalIntegrations]"),ug={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class lg{constructor(t){this._instance=t}lr(t,e){var r;null==(r=Cn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return ag.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,s;!i||null!=(r=Cn.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.lr(ug[e],(()=>{var r;null==(r=Cn.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=Cn.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e]&&(null==(s=Cn.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[e])||s.stop())};for(var[r,i]of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;e(r)}}}var hg,cg={},dg=0,vg=()=>{},fg='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',pg="Surveys module not available",gg="sanitize_properties is deprecated. Use before_send instead",mg="Invalid value for property_denylist config: ",yg="posthog",bg=!Ol&&-1===(null==kn?void 0:kn.indexOf("MSIE"))&&-1===(null==kn?void 0:kn.indexOf("Mozilla")),_g=t=>{var e;return r({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:jn(null==yn?void 0:yn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:vg,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,__preview_external_dependency_versioned_paths:!1,debug:bn&&pr(null==bn?void 0:bn.search)&&-1!==bn.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==pn||null==(e=pn.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_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(t){Mn.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Js,before_send:void 0,request_queue_config:{flush_interval_ms:Wp},error_tracking:{},_onCapture:vg,__preview_eager_load_replay:!1},(t=>({rageclick:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},wg=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],xg=t=>{var e={};for(var[r,i]of wg)fr(t[r])||(e[i]=t[r]);var n=An({},e,t);return hr(t.property_blacklist)&&(fr(t.property_denylist)?n.property_denylist=t.property_blacklist:hr(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:Mn.error(mg+t.property_denylist)),n};class Sg{constructor(){this.__forceAllowLocalhost=!1}get Ei(){return this.__forceAllowLocalhost}set Ei(t){Mn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class kg{Mi(t,e){if(t){var r=this.Pi.indexOf(t);-1!==r&&this.Pi.splice(r,1)}return this.Pi.push(e),null==e.initialize||e.initialize(),e}Ri(){return this.config.cookieless_mode===Zs||this.config.cookieless_mode===Ws&&this.consent.isRejected()}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(){var t;this.webPerformance=new Sg,this.Oi=!1,this.version=En.LIB_VERSION,this.Li=new Xp,this.Pi=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=_g(),this.SentryIntegration=Lp,this.sentryIntegration=t=>function(t,e){var r=Pp(t,e);return{name:Op,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Fi=!1,this.Ai=null,this.Ni=null,this.$i=null,this.scrollManager=new Jp(this),this.pageViewManager=new Ap(this),this.rateLimiter=new Bp(this),this.requestRouter=new og(this),this.consent=new Cp(this),this.externalIntegrations=new lg(this);var e=null!==(t=kg.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,r)=>{var i=pr(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=pr(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>Mn.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==yg){var i,n=null!==(i=cg[r])&&void 0!==i?i:new kg;return n._init(t,e,r),cg[r]=n,cg[yg][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n,s;if(void 0===e&&(e={}),fr(t)||gr(t))return Mn.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.Di(e.debug),this.qi=e,this.ji=[],e.person_profiles?this.Ni=e.person_profiles:e.process_person&&(this.Ni=e.process_person),this.set_config(An({},_g(e.defaults),xg(e),{name:i,token:t})),this.config.on_xhr_error&&Mn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Yu.GZipJS;var o=this.Hi();this.persistence=new Dp(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Dp(r({},this.config,{persistence:"sessionStorage"}),o);var a=r({},this.persistence.props),u=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Ui=new Zp((t=>this.Bi(t)),this.config.request_queue_config),this.zi=new Qp(this),this.__request_queue=[];var l=this.Ri();if(l||(this.sessionManager=new eg(this),this.sessionPropsManager=new Yp(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Mn.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Vi(l)}),0)):(Mn.info("Initializing extensions synchronously"),this.Vi(l)),En.DEBUG=En.DEBUG||this.config.debug,En.DEBUG&&Mn.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:a,s:u}),!this.config.identity_distinct_id||null!=(n=e.bootstrap)&&n.distinctID||(e.bootstrap=r({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=e.bootstrap)?void 0:s.distinctID)){var h=e.bootstrap.distinctID,c=this.get_distinct_id(),d=this.persistence.get_property(Ls);if(e.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===Gs)this.identify(h);else if(e.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===Qs)Mn.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var v=this.config.get_device_id(Qu()),f=e.bootstrap.isIdentifiedID?v:h;this.persistence.set_property(Ls,e.bootstrap.isIdentifiedID?Qs:Gs),this.register({distinct_id:h,$device_id:f})}}if(l)this.register_once({distinct_id:Us,$device_id:null},"");else if(!this.get_distinct_id()){var p=this.config.get_device_id(Qu());this.register_once({distinct_id:p,$device_id:p},""),this.persistence.set_property(Ls,Gs)}return Un(pn,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?function(t,e){var r=t.config.segment;if(!r)return e();!function(t,e){var r=t.config.segment;if(!r)return e();var i=r=>{var i=()=>r.anonymousId()||Qu();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(Ls,Qs)),e()},n=r.user();"then"in n&&cr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||Mp.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,r)=>{if(!r)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(Mp.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Mp.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var i=t.calculateEventProperties(r,e.event.properties);return e.event.properties=Object.assign({},i,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,Xs),identify:t=>e(t,eo),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Wi())):this.Wi(),cr(this.config._onCapture)&&this.config._onCapture!==vg&&(Mn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&Mn.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}Vi(t){var e,i,n,s,o,a,u,l=performance.now(),h=r({},kg.__defaultExtensionClasses,this.config.__extensionClasses),c=[];h.featureFlags&&this.Pi.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new h.featureFlags(this)),h.exceptions&&this.Pi.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new h.exceptions(this)),h.historyAutocapture&&this.Pi.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.Pi.push(new h.tracingHeaders(this)),h.siteApps&&this.Pi.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!t&&this.Pi.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||c.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),h.autocapture&&this.Pi.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.Pi.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new h.surveys(this)),h.logs&&this.Pi.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new h.logs(this)),h.conversations&&this.Pi.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new h.conversations(this)),h.productTours&&this.Pi.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.Pi.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.Pi.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.Pi.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.Pi.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,Ep)),h.toolbar&&this.Pi.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new h.toolbar(this)),h.experiments&&this.Pi.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new h.experiments(this)),this.Pi.forEach((t=>{t.initialize&&c.push((()=>{null==t.initialize||t.initialize()}))})),c.push((()=>{if(this.Zi){var t=this.Zi;this.Zi=void 0,this.Rr(t)}})),this.Gi(c,l)}Gi(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Gi(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){Mn.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({[Hs]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Bs]:i}),this.config.__preview_deferred_init_extensions&&Mn.info("PostHog extensions initialized ("+i+"ms)")}Rr(t){var e;if(!yn||!yn.body)return Mn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Rr(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Zi=t),this.Qi=t,this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=nr(t.supportedCompression,Yu.GZipJS)?Yu.GZipJS:nr(t.supportedCompression,Yu.Base64)?Yu.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ni?this.Ni:Js}),this.Pi.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Wi(){try{this.config.loaded(this)}catch(t){Mn.critical("`loaded` function failed",t)}if(this.Ji(),this.config.internal_or_test_user_hostname&&null!=bn&&bn.hostname){var t=bn.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ri())&&this.Ki()}),1),this.Yi=new Vp(this),this.Yi.load()}Ji(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.Ui)||t.enable())}_dom_loaded(){this.is_capturing()&&Pn(this.__request_queue,(t=>this.Bi(t))),this.__request_queue=[],this.Ji()}_handle_unload(){var t,e,r,i;null==(t=this.surveys)||t.handlePageUnload(),this.config.request_batching?(this.Xi()&&this.capture(to),null==(e=this.logs)||e.flushLogs("sendBeacon"),null==(r=this.Ui)||r.unload(),null==(i=this.zi)||i.unload()):this.Xi()&&this.capture(to,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(bg?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Nl(t.url,{ip:this.config.ip?1:0}),t.headers=r({},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,i,n,s=r({},t);s.timeout=s.timeout||6e4,s.url=jl(s.url,s.compression);var o=null!==(e=s.transport)&&void 0!==e?e:"fetch",a=Ul.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),u=null!==(i=null==(n=function(t,e){for(var r=0;t.length>r;r++)if(e(t[r]))return t[r]}(a,(t=>t.transport===o)))?void 0:n.method)&&void 0!==i?i:a[0].method;if(!u)throw new Error("No available transport method");"sendBeacon"!==o&&s.data&&s.compression===Yu.GZipJS&&Sn&&!Ll?ql(s).then((t=>{u(t)})).catch((e=>{if(Ye(e))return Ll=!0,void u(r({},s,{compression:void 0,url:jl(t.url,void 0)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Ye(t)||e===Je})(e)&&(Ll=!0),u(s)})):u(s)})(r({},t,{callback:e=>{var r,i;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(r=(i=this.config).on_request_error)||r.call(i,e),null==t.callback||t.callback(e)}}))))}Bi(t){this.zi?this.zi.retriableRequest(t):this._send_request(t)}_execute_array(t){dg++;try{var e,r=[],i=[],n=[];Pn(t,(t=>{if(t)if(hr(e=t[0]))n.push(t);else if(cr(t))try{t.call(this)}catch(e){Mn.error("Error executing queued PostHog call",t,e)}else hr(t)&&"alias"===e?r.push(t):hr(t)&&-1!==e.indexOf("capture")&&cr(this[e])?n.push(t):i.push(t)}));var s=function(t,e){Pn(t,(function(t){try{if(hr(t[0])){var r=e;Ln(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){Mn.error("Error executing queued PostHog call",t,e)}}))};s(r,this),s(i,this),s(n,this)}finally{dg--}}push(t){if(dg>0&&hr(t)&&pr(t[0])){var e=kg.prototype[t[0]];cr(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var n,s,o,a,u;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ui){if(this.is_capturing())if(!fr(t)&&pr(t)){var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var h=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==h||!h.isRateLimited){null!=e&&e.$current_url&&!pr(null==e?void 0:e.$current_url)&&(Mn.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||null!=i&&i.en||Mn.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var c=new Date,d=(null==i?void 0:i.timestamp)||c,v=(null==i?void 0:i.uuid)||Qu(),f={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===Xs&&this.config.__preview_capture_bot_pageviews&&l&&(f.event="$bot_pageview",f.properties.$browser_type="bot"),h&&(f.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens),(null==i?void 0:i.$set)&&(f.$set=null==i?void 0:i.$set);var p=this.tn(null==i?void 0:i.$set_once,t!==ro,t===eo);if(p&&(f.$set_once=p),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=f,a=t=>pr(t)?t.slice(0,s):t,u=new Set,f=function t(e,r){return e!==Object(e)?a?a(e):e:u.has(e)?void 0:(u.add(e),hr(e)?(i=[],Pn(e,(e=>{i.push(t(e))}))):(i={},Ln(e,((e,r)=>{u.has(e)||(i[r]=t(e,r))}))),i);var i}(o)),f.timestamp=d,fr(null==i?void 0:i.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=c),t===xu.DISMISSED||t===xu.SENT){var g=null==e?void 0:e[Su.SURVEY_ID],m=null==e?void 0:e[Su.SURVEY_ITERATION];Uu({id:g,current_iteration:m}),f.$set=r({},f.$set,{[Eu({id:g,current_iteration:m},t===xu.SENT?"responded":"dismissed")]:!0})}else t===xu.SHOWN&&(f.$set=r({},f.$set,{[Su.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===jp.SHOWN){var y=null==e?void 0:e[Up.TOUR_TYPE];y&&(f.$set=r({},f.$set,{[Up.TOUR_LAST_SEEN_DATE+"/"+y]:(new Date).toISOString()}))}var b=r({},f.properties.$set,f.$set);if(vr(b)||this.setPersonPropertiesForFlags(b),!yr(this.config.before_send)){var _=this.rn(f);if(!_)return;f=_}this.Li.emit("eventCaptured",f);var w={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:f,compression:"best-available",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Bi(w):this.Ui.enqueue(w),f}Mn.critical("This capture call is ignored due to client rate limiting.")}}else Mn.error("No event name provided to posthog.capture")}else Mn.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(t,e,i,n,s){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return e;var o=s?void 0:this.persistence.remove_event_timer(t),a=r({},e);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Ri()&&(a.$cookieless_mode=!0),"$snapshot"===t){var u=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!pr(a.distinct_id)&&!br(a.distinct_id)||gr(a.distinct_id))&&Mn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,h=function(t,e){var r,i,n,s;if(!kn)return{};var o,a=t?[...uc,...e||[]]:[],[u,l]=function(t){for(var e=0;Ei.length>e;e++){var[r,i]=Ei[e],n=r.exec(t),s=n&&(cr(i)?i(n,t):i);if(s)return s}return["",""]}(kn);return An(Dn({$os:u,$os_version:l,$browser:Ci(kn,navigator.vendor),$device:Ri(kn),$device_type:Mi(kn,{userAgentDataPlatform:null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,maxTouchPoints:null==(i=navigator)?void 0:i.maxTouchPoints,screenWidth:null==pn||null==(n=pn.screen)?void 0:n.width,screenHeight:null==pn||null==(s=pn.screen)?void 0:s.height,devicePixelRatio:null==pn?void 0:pn.devicePixelRatio}),$timezone:_c(),$timezone_offset:wc()}),{$current_url:Wn(null==bn?void 0:bn.href,a,hc),$host:null==bn?void 0:bn.host,$pathname:null==bn?void 0:bn.pathname,$raw_user_agent:kn.length>1e3?kn.substring(0,997)+"...":kn,$browser_version:Ii(kn,navigator.vendor),$browser_language:pc(),$browser_language_prefix:(o=pc(),"string"==typeof o?o.split("-")[0]:void 0),$screen_height:null==pn?void 0:pn.screen.height,$screen_width:null==pn?void 0:pn.screen.width,$viewport_height:null==pn?void 0:pn.innerHeight,$viewport_width:null==pn?void 0:pn.innerWidth,$lib:En.LIB_NAME,$lib_version:En.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&An(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&An(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.zi)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===ig&&(a.$lib_custom_api_host=this.config.api_host),l=t!==Xs||s?t!==to||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=An(a,l),t===Xs&&yn&&(a.title=yn.title),!fr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}kn&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=An({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),hr(this.config.property_denylist)?Ln(this.config.property_denylist,(function(t){delete a[t]})):Mn.error(mg+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(Mn.error(gg),a=p(a,t));var g=this.nn();return a.$process_person_profile=g,g&&!s&&this.sn("_calculate_event_properties"),a}tn(t,e,r){var i;if(void 0===e&&(e=!0),void 0===r&&(r=!1),!this.persistence||!this.nn())return t;if(this.Oi&&!r)return t;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=An({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&(Mn.error(gg),o=a(o,"$set_once")),e&&(this.Oi=!0),vr(o)?void 0:o}register(t,e){var r;null==(r=this.persistence)||r.register(t,e)}register_once(t,e,r){var i;null==(i=this.persistence)||i.register_once(t,e,r)}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)}an(t,e){this.register({[t]:e})}getFeatureFlag(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(t,e)}isFeatureEnabled(t,e){var r;return null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(t,e)}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,r){var i;null==(i=this.featureFlags)||i.updateFlags(t,e,r)}updateEarlyAccessFeatureEnrollment(t,e,r){var i;null==(i=this.featureFlags)||i.updateEarlyAccessFeatureEnrollment(t,e,r)}getEarlyAccessFeatures(t,e,r){var i;return void 0===e&&(e=!1),null==(i=this.featureFlags)?void 0:i.getEarlyAccessFeatures(t,e,r)}on(t,e){return this.Li.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:pg}),()=>{})}onSessionId(t){var e,r;return null!==(e=null==(r=this.sessionManager)?void 0:r.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:pg})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:pg})}renderSurvey(t,e){var r;null==(r=this.surveys)||r.renderSurvey(t,e)}displaySurvey(t,e){var r;void 0===e&&(e=Bu),null==(r=this.surveys)||r.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,r;return null!==(e=null==(r=this.surveys)?void 0:r.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:pg}}canRenderSurveyAsync(t,e){var r,i;return void 0===e&&(e=!1),null!==(r=null==(i=this.surveys)?void 0:i.canRenderSurveyAsync(t,e))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:pg})}un(t){return!t||gr(t)?(Mn.critical("Unique user id has not been set in posthog.identify"),!1):t===Us?(Mn.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(Mn.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.'),!1)}identify(t,e,r){if(!this.__loaded||!this.persistence)return Mn.uninitializedWarning("posthog.identify");if(br(t)&&(t=t.toString(),Mn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.un(t)&&this.sn("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:t}),this.get_property(Kn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(Yn)&&(this.unregister(Yn),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(Ls)||Gs)===Gs;t!==i&&s?(this.persistence.set_property(Ls,Qs),this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!1),this.capture(eo,{distinct_id:t,$anon_distinct_id:i},{$set:e||{},$set_once:r||{}}),this.$i=Bl(t,e,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(e||r)&&this.setPersonProperties(e,r),t!==i&&(this.reloadFeatureFlags(),this.unregister(Rs))}}setPersonProperties(t,e){if((t||e)&&this.sn("posthog.setPersonProperties")){var r=Bl(this.get_distinct_id(),t,e);this.$i!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.$i=r):Mn.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,e,i){if(t&&e){var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:r({},n,{[t]:e})}),s||i){var o={$group_type:t,$group_key:e};i&&(o.$group_set=i),this.capture(ro,o)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else Mn.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(){var t;null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,e){var r;void 0===e&&(e=!0),this.sn("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e,r,i,n,s,o,a,u;if(Mn.info("reset"),!this.__loaded)return Mn.uninitializedWarning("posthog.reset");var l,h=this.get_property(Kn),c=this.get_property(ls);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),fr(c)||null==(l=this.persistence)||l.register({[ls]:c}),null==(i=this.surveys)||i.reset(),null==(n=this.Yi)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.persistence)||a.set_property(Ls,Gs),null==(u=this.sessionManager)||u.resetSessionId(),this.$i=null,this.config.cookieless_mode===Zs)this.register_once({distinct_id:Us,$device_id:null},"");else{var d=this.config.get_device_id(Qu());this.register_once({distinct_id:d,$device_id:t?d:h},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(t,e){var r;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(r=this.conversations)||r.ln()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.hn()}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:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);if(null!=t&&t.withTimestamp&&r){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!r)return i;i+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0)}return i}alias(t,e){return t===this.get_property(Jn)?(Mn.critical("Attempting to create alias for existing People user - aborting."),-2):this.sn("posthog.alias")?(fr(e)&&(e=this.get_distinct_id()),t!==e?(this.an(Yn,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(Mn.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(dr(t)){var i,n,s,o,a,u,l,h,c,d;An(this.config,xg(t));var v=this.Hi();null==(i=this.persistence)||i.update_config(this.config,e,v),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Dp(r({},this.config,{persistence:"sessionStorage"}),v);var f=this.Di(this.config.debug);wr(f)&&(this.config.debug=f),wr(this.config.debug)&&(this.config.debug?(En.DEBUG=!0,Kl.R()&&Kl.N("ph_debug",!0),Mn.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(En.DEBUG=!1,Kl.R()&&Kl.q("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),null==(h=this.deadClicksAutocapture)||h.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.cn(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){En.LIB_NAME=t,En.LIB_VERSION=e}startSessionRecording(t){var e,r,i,n,s,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),a.linked_flag&&(null==(i=this.sessionRecording)||i.overrideLinkedFlag()),a.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),a.event_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("event")));this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){if(this.exceptions){var i=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(r({},n,e))}}addExceptionStep(t,e){var r;null==(r=this.exceptions)||r.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:kg.dn}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,r;return null!==(e=null==(r=this.toolbar)?void 0:r.loadToolbar(t))&&void 0!==e&&e}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:yg;return e!==yg&&(e=yg+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Ls))===Qs||(null==(e=this.sessionPersistence)?void 0:e.get_property(Ls))===Qs}nn(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Js&&!this._isIdentified()&&vr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Yn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[qs]))}Xi(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.nn()||this.sn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.sn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}sn(t){return"never"===this.config.person_profiles?(Mn.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.an(qs,!0),!0)}Hi(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Ws)}cn(){var t,e,r,i,n=this.Hi();return(null==(t=this.persistence)?void 0:t._r)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e._r)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Zs){if(this.Ri()){var r,i,n,s,o;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new eg(this),this.pageViewManager=new Ap(this),this.persistence&&(this.sessionPropsManager=new Yp(this,this.sessionManager,this.persistence));var a,u=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(o=kg.__defaultExtensionClasses)?void 0:o.sessionRecording;u&&(this.sessionRecording=this.Mi(this.sessionRecording,new u(this)),this.Qi&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.Qi)))}var l,h;this.consent.optInOut(!0),this.cn(),this.Ji(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Ws&&(null==(l=this.surveys)||l.loadIfEnabled()),(fr(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ki()}else Mn.warn(fg)}opt_out_capturing(){var t,e,r;this.config.cookieless_mode!==Zs?(this.config.cookieless_mode===Ws&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===Ws&&(this.register({distinct_id:Us,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.Ki())):Mn.warn(fg)}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 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Zs||(this.config.cookieless_mode===Ws?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return mn?rg(mn,this.config.custom_blocked_useragents):void 0}Ki(){yn&&("visible"===yn.visibilityState?this.Fi||(this.Fi=!0,this.capture(Xs,{title:yn.title},{send_instantly:!0}),this.Ai&&(yn.removeEventListener(Ks,this.Ai),this.Ai=null)):this.Ai||(this.Ai=this.Ki.bind(this),Un(yn,Ks,this.Ai)))}debug(t){!1===t?(null==pn||pn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==pn||pn.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}))}Lr(){var t,e,r,i,n,s,o=this.qi||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Mn.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",!1,i=Mn,n=(e="advanced_disable_flags")in(t=o)&&!yr(t[e]),s=r in t&&!yr(t[r]),n?t[e]:!!s&&(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[r]))}rn(t){if(yr(this.config.before_send))return t;var e=hr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),yr(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return nr(Qe,t.event)?Mn.warn(n+". This can cause unexpected behavior."):Mn.info(n),null}r.properties&&!vr(r.properties)||Mn.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return null==(t=this.pageViewManager.dr)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(r)})}Di(t){var e=wr(t)&&!t,r=Kl.R()&&"true"===Kl.A("ph_debug");return!e&&(!!r||t)}}kg.__defaultExtensionClasses={},kg.dn={trace:hg=()=>{},debug:hg,info:hg,warn:hg,error:hg,fatal:hg},function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=$n(t.prototype[e[r]])}(kg,["identify"]);var Cg=On("[ExceptionAutocapture]"),Tg=On("[TracingHeaders]"),Ig=On("[Web Vitals]"),Eg=9e5,Rg="disabled",Mg="lazy_loading",Og="awaiting_config",Pg="missing_config";On("[SessionRecording]"),On("[SessionRecording]");var Lg="[SessionRecording]",Ag=On(Lg),Ng=On("[Heatmaps]");function Fg(t){return dr(t)&&"clientX"in t&&"clientY"in t&&br(t.clientX)&&br(t.clientY)}var $g=On("[Product Tours]"),Dg=["$set_once","$set"],qg=On("[SiteApps]"),jg="Error while initializing PostHog app with config id ";function Ug(t,e,r){if(yr(t))return!1;switch(r){case"exact":return t===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class Hg{constructor(t){this.vn=new Xp,this.fn=(t,e)=>this.pn(t,e)&&this.gn(t,e)&&this.mn(t,e)&&this.yn(t,e),this.pn=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.bn=new Set,this._n=new Set}init(){var t,e;fr(null==(t=this._instance)?void 0:t._addCaptureHook)||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)})))}register(t){var e,r;if(!fr(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,r;null==(e=this._n)||e.add(t),null==(r=t.steps)||r.forEach((t=>{var e;null==(e=this.bn)||e.add((null==t?void 0:t.event)||"")}))})),null!=(r=this._instance)&&r.autocapture)){var i,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==(i=this._instance)||i.autocapture.setElementSelectors(n)}}on(t,e){var r;null!=e&&0!=t.length&&(this.bn.has(t)||this.bn.has(null==e?void 0:e.event))&&this._n&&(null==(r=this._n)?void 0:r.size)>0&&this._n.forEach((t=>{this.wn(e,t)&&this.vn.emit("actionCaptured",t.name)}))}xn(t){this.onAction("actionCaptured",(e=>t(e)))}wn(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.fn(t,r))return!0;return!1}onAction(t,e){return this.vn.on(t,e)}gn(t,e){if(null!=e&&e.url){var r,i=null==t||null==(r=t.properties)?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!Ug(i,e.url,e.url_matching||"contains"))return!1}return!0}mn(t,e){return!!this.Sn(t,e)&&!!this.kn(t,e)&&!!this.Cn(t,e)}Sn(t,e){var r;if(null==e||!e.href)return!0;var i=this.In(t);if(i.length>0)return i.some((t=>Ug(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&Ug((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}kn(t,e){var r;if(null==e||!e.text)return!0;var i=this.In(t);if(i.length>0)return i.some((t=>Ug(t.text,e.text,e.text_matching||"exact")||Ug(t.$el_text,e.text,e.text_matching||"exact")));var n,s,o,a=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!a&&(n=function(t){for(var e,r=[],i=/(?::|")text="(.*?)"/g;!yr(e=i.exec(t));)r.includes(e[1])||r.push(e[1]);return r}(a),s=e.text,o=e.text_matching||"exact",n.some((t=>Ug(t,s,o))))}Cn(t,e){var r,i;if(null==e||!e.selector)return!0;var n=null==t||null==(r=t.properties)?void 0:r.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}In(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}yn(t,e){return null==e||!e.properties||0===e.properties.length||Wl(e.properties.reduce(((t,e)=>{var r=hr(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:r,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Bg{constructor(t){this._instance=t,this.Tn=new Map,this.En=new Map,this.Mn=new Map}Pn(t,e){return!!t&&Wl(t.propertyFilters,null==e?void 0:e.properties)}Rn(t,e){var r=new Map;return t.forEach((t=>{var i;null==(i=t.conditions)||null==(i=i[e])||null==(i=i.values)||i.forEach((e=>{if(null!=e&&e.name){var i=r.get(e.name)||[];i.push(t.id),r.set(e.name,i)}}))})),r}On(t,e,r){var i=(r===fu.Activation?this.Tn:this.En).get(t),n=[];return this.Ln((t=>{n=t.filter((t=>null==i?void 0:i.includes(t.id)))})),n.filter((i=>{var n,s=null==(n=i.conditions)||null==(n=n[r])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.Pn(s,e)}))}register(t){var e;fr(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.Fn(t),this.An(t))}An(t){var e=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0}));0!==e.length&&(null==this.Nn&&(this.Nn=new Hg(this._instance),this.Nn.init(),this.Nn.xn((t=>{this.onAction(t)}))),e.forEach((t=>{var e,r,i,n,s;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(r=t.conditions)&&null!=(r=r.actions)&&r.values&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0&&(null==(n=this.Nn)||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 r=this.Mn.get(e.name);r&&r.push(t.id),this.Mn.set(e.name,r||[t.id])}})))})))}Fn(t){var e,r=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.events)&&(null==(r=t.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0})),i=t.filter((t=>{var e,r;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(r=t.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0}));0===r.length&&0===i.length||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.Tn=this.Rn(t,fu.Activation),this.En=this.Rn(t,fu.Cancellation))}onEvent(t,e){var r,i=this.le(),n=this.$n(),s=this.Dn(),o=(null==(r=this._instance)||null==(r=r.persistence)?void 0:r.props[n])||[];if(s===t&&e&&o.length>0){var a,u;i.info("event matched, removing item from activated items",{event:t,eventPayload:e,existingActivatedItems:o});var l=(null==e||null==(a=e.properties)?void 0:a.$survey_id)||(null==e||null==(u=e.properties)?void 0:u.$product_tour_id);if(l){var h=o.indexOf(l);0>h||(o.splice(h,1),this.qn(o))}}else{if(this.En.has(t)){var c=this.On(t,e,fu.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:t,itemsToCancel:c.map((t=>t.id))}),c.forEach((t=>{var e=o.indexOf(t.id);0>e||o.splice(e,1),this.jn(t.id)})),this.qn(o))}if(this.Tn.has(t)){i.info("event name matched",{event:t,eventPayload:e,items:this.Tn.get(t)});var d=this.On(t,e,fu.Activation);this.qn(o.concat(d.map((t=>t.id))||[]))}}}onAction(t){var e,r=this.$n(),i=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[r])||[];this.Mn.has(t)&&this.qn(i.concat(this.Mn.get(t)||[]))}qn(t){var e=this.le(),r=[...new Set(t)].filter((t=>!this.Hn(t)));e.info("updating activated items",{activatedItems:r}),this.Un(r)}getActivatedIds(){var t,e=this.$n();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}getEventToItemsMap(){return this.Tn}Bn(){return this.Nn}}class zg extends Bg{constructor(t){super(t)}$n(){return Is}Dn(){return xu.SHOWN}Ln(t){var e;null==(e=this._instance)||e.getSurveys(t)}jn(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}le(){return Lu}Un(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[Is]:t})}Hn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Vg="SDK is not enabled or survey functionality is not yet loaded",Wg="Disabled. Not loading surveys.",Zg=null!=pn&&pn.location?Zn(pn.location.hash,"__posthog")||Zn(location.hash,"state"):null,Gg="_postHogToolbarParams",Qg=On("[Toolbar]"),Jg=On("[FeatureFlags]"),Kg=On("[FeatureFlags]",{debugEnabled:!0}),Yg="\" failed. Feature flags didn't load in time.",Xg=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},tm=t=>{var e={};for(var[r,i]of Nn(t||{}))i&&(e[r]=i);return e},em="Refusing to render web experiment since the viewer is a likely bot",rm={icontains:(t,e)=>!!pn&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!pn&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!pn&&Hl(e.href,t),not_regex:(t,e)=>!!pn&&!Hl(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class im{get qt(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{im.zn("retrieved web experiments from the server"),e.Vn=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;e.Vn&&(im.zn("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.Vn)||r.set(t.feature_flag_key,t));var i=e._instance.getFeatureFlag(t.feature_flag_key);pr(i)&&t.variants[i]&&e.Wn(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];im.Zn(s)&&e.Wn(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())im.zn(em);else if(!this.qt.disable_web_experiments){if(yr(this.Vn))return this.Vn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();im.zn("applying feature flags",t),t.forEach((t=>{var e;if(this.Vn&&null!=(e=this.Vn)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.Vn)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.Wn(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=im.getWindowLocation();if(null!=t&&t.search){var e=Vn(null==t?void 0:t.search,"__experiment_id"),r=Vn(null==t?void 0:t.search,"__experiment_variant");e&&r&&(im.zn("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.Gn(parseInt(e),r,t)}),!1,!0))}}loadIfEnabled(){this.qt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,r){if(this.qt.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.qt.token),method:"GET",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}Gn(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(im.zn("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.Wn(i[0].name,e,i[0].variants[e].transforms))}static Zn(t){return!yr(t.conditions)&&im.Qn(t)&&im.Jn(t)}static Qn(t){var e;if(yr(t.conditions)||yr(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,s=im.getWindowLocation();return!!s&&(null==(r=t.conditions)||!r.url||rm[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,s))}static getWindowLocation(){return null==pn?void 0:pn.location}static Jn(t){var e;if(yr(t.conditions)||yr(null==(e=t.conditions)?void 0:e.utm))return!0;var r=dc();if(r.utm_source){var i,n,s,o,a,u,l,h,c=null==(i=t.conditions)||null==(i=i.utm)||!i.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==r.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)==r.utm_source,v=null==(a=t.conditions)||null==(a=a.utm)||!a.utm_medium||(null==(u=t.conditions)||null==(u=u.utm)?void 0:u.utm_medium)==r.utm_medium,f=null==(l=t.conditions)||null==(l=l.utm)||!l.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==r.utm_term;return c&&v&&f&&d}return!1}static zn(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];Mn.info("[WebExperiments] "+t,r)}Wn(t,e,r){this._is_bot()?im.zn(em):"control"!==e?r.forEach((r=>{if(r.selector){var i;im.zn("applying transform of variant "+e+" for experiment "+t+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}})):im.zn("Control variants leave the page unmodified.")}_is_bot(){return mn&&this._instance?rg(mn,this.qt.custom_blocked_useragents):void 0}}var nm=On("[Conversations]"),sm="Conversations not available yet.",om={featureFlags:class{constructor(t){this.Kn=!1,this.Yn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=!1,this._instance=t,this.featureFlagEventHandlers=[]}get qt(){return this._instance.config}get ni(){return this._instance.persistence}os(t){return this._instance.get_property(t)}us(){var t,e;return null!==(t=null==(e=this.ni)?void 0:e.wr(this.qt.feature_flag_cache_ttl_ms))&&void 0!==t&&t}ls(){return!!this.us()&&(this.ss||this.Xn||(this.ss=!0,Jg.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}hs(){var t,e=null!==(t=this.qt.evaluation_contexts)&&void 0!==t?t:this.qt.evaluation_environments;return!this.qt.evaluation_environments||this.qt.evaluation_contexts||this.ns||(Jg.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ns=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Jg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}cs(){return this.hs().length>0}ds(){var t=this.qt.flag_keys;if(!fr(t)){if(hr(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||Jg.error("Invalid flag key found:",t,"Expected non-empty string"),e}));Jg.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,{config:r}=this._instance,i=null!==(t=null==(e=r.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((t=>!!i[t])).reduce(((t,e)=>(t[e]=i[e]||!1,t)),{}),u=Object.keys(o).filter((t=>a[t])).reduce(((t,e)=>(o[e]&&(t[e]=o[e]),t)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:u})}}updateFlags(t,e,i){var n=null!=i&&i.merge?this.getFlagVariants():{},s=null!=i&&i.merge?this.getFlagPayloads():{},o=r({},n,t),a=r({},s,e),u={};for(var[l,h]of Object.entries(o)){var c="string"==typeof h;u[l]={key:l,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:fr(null==a?void 0:a[l])?void 0:{id:0,version:void 0,description:void 0,payload:a[l]}}}this.receivedFeatureFlags({flags:u})}get hasLoadedFlags(){return this.Yn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.os(bs),e=this.os(xs),i=this.os(Ss);if(!i&&!e)return t||{};var n=An({},t||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(e||{})])];for(var o of s){var a,u,l=n[o],h=null==e?void 0:e[o],c=fr(h)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!h,d=fr(h)?l.variant:"string"==typeof h?h:void 0,v=null==i?void 0:i[o],f=r({},l,{enabled:c,variant:c?null!=d?d:null==l?void 0:l.variant:void 0});c!==(null==l?void 0:l.enabled)&&(f.original_enabled=null==l?void 0:l.enabled),d!==(null==l?void 0:l.variant)&&(f.original_variant=null==l?void 0:l.variant),v&&(f.metadata=r({},null==l?void 0:l.metadata,{payload:v,original_payload:null==l||null==(u=l.metadata)?void 0:u.payload})),n[o]=f}return this.Kn||(Jg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.Kn=!0),n}getFlagVariants(){var t=this.os(gs),e=this.os(xs);if(!e)return t||{};for(var r=An({},t),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Kn||(Jg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Kn=!0),r}getFlagPayloads(){var t=this.os(_s),e=this.os(Ss);if(!e)return t||{};for(var r=An({},t||{}),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Kn||(Jg.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.Kn=!0),r}reloadFeatureFlags(){this.es||this.qt.advanced_disable_feature_flags||this.vs||(this._instance.Li.emit("featureFlagsReloading",!0),this.vs=setTimeout((()=>{this.fs()}),5))}ps(){clearTimeout(this.vs),this.vs=void 0}ensureFlagsLoaded(){this.Yn||this.Xn||this.vs||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.es=t}fs(t){var e;if(this.ps(),!this._instance.Lr())if(this.Xn)this.ts=!0;else{var i=this.qt.token,n=this.os(Kn),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:r({},(null==(e=this.ni)?void 0:e.get_initial_props())||{},this.os(ks)||{}),group_properties:this.os(Cs),timezone:_c()};mr(n)||fr(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this.qt.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.cs()&&(s.evaluation_contexts=this.hs());var o=this.ds();fr(o)||(s.flag_keys=o);var a=!!this.qt.advanced_only_evaluate_survey_feature_flags,u=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.qt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Xn=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this.qt.disable_compression?void 0:Yu.Base64,timeout:this.qt.feature_flag_request_timeout_ms,callback:t=>{var e,r,i,n=!0;if(200===t.statusCode&&(this.ts||(this.$anon_distinct_id=void 0),n=!1),this.Xn=!1,!s.disable_flags||this.ts){this.rs=!n;var o=[];t.error?t.error instanceof Error?o.push("AbortError"===t.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==t.statusCode&&o.push("api_error_"+t.statusCode),null!=(e=t.json)&&e.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var u,l=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(l&&o.push("quota_limited"),null==(i=this.ni)||i.register({[Os]:o}),l)Jg.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(u=t.json)&&void 0!==u?u:{},n,{partialResponse:a}),this.ts&&(this.ts=!1,this.fs())}}})}}getFeatureFlag(t,e){var r;if(void 0===e&&(e={}),!e.fresh||this.rs)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var i=this.getFeatureFlagResult(t,e);return null!==(r=null==i?void 0:i.variant)&&void 0!==r?r:null==i?void 0:i.enabled}}else Jg.warn('getFeatureFlag for key "'+t+Yg)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return null==e?void 0:e.payload}getFeatureFlagResult(t,e){if(void 0===e&&(e={}),!e.fresh||this.rs)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var r=this.getFlagVariants(),i=t in r,n=r[t],s=this.getFlagPayloads()[t],o=String(n),a=this.os(ws)||void 0,u=this.os(Ps)||void 0,l=this.os(Rs)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var h,c=this._instance.get_session_id(),d=this.os(Ms);c&&c!==d&&(l={},null==(h=this.ni)||h.register({[Rs]:l,[Ms]:c}))}if((e.send_event||!("send_event"in e))&&(!(t in l)||!l[t].includes(o))){var v,f,p,g,m,y,b,_,w,x;hr(l[t])?l[t].push(o):l[t]=[o],null==(v=this.ni)||v.register({[Rs]:l});var S=this.getFeatureFlagDetails(t),k=[...null!==(f=this.os(Os))&&void 0!==f?f:[]];fr(n)&&k.push("flag_missing");var C={$feature_flag:t,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:(null==(p=this.qt.bootstrap)||null==(p=p.featureFlags)?void 0:p[t])||null,$feature_flag_bootstrapped_payload:(null==(g=this.qt.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[t])||null,$used_bootstrap_value:!this.rs};fr(null==S||null==(m=S.metadata)?void 0:m.version)||(C.$feature_flag_version=S.metadata.version);var T,I=null!==(y=null==S||null==(b=S.reason)?void 0:b.description)&&void 0!==y?y:null==S||null==(_=S.reason)?void 0:_.code;I&&(C.$feature_flag_reason=I),null!=S&&null!=(w=S.metadata)&&w.id&&(C.$feature_flag_id=S.metadata.id),fr(null==S?void 0:S.original_variant)&&fr(null==S?void 0:S.original_enabled)||(C.$feature_flag_original_response=fr(S.original_variant)?S.original_enabled:S.original_variant),null!=S&&null!=(x=S.metadata)&&x.original_payload&&(C.$feature_flag_original_payload=null==S||null==(T=S.metadata)?void 0:T.original_payload),k.length&&(C.$feature_flag_error=k.join(",")),this._instance.capture("$feature_flag_called",C)}if(i){var E=s;if(!fr(s))try{E=JSON.parse(s)}catch(t){}return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:E}}}}else Jg.warn('getFeatureFlagResult for key "'+t+Yg)}getRemoteConfigPayload(t,e){var r=this.qt.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.cs()&&(i.evaluation_contexts=this.hs());var n=this.ds();fr(n)||(i.flag_keys=n),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.qt.disable_compression?void 0:Yu.Base64,timeout:this.qt.feature_flag_request_timeout_ms,callback(r){var i,n=null==(i=r.json)?void 0:i.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),!e.fresh||this.rs){if(this.Yn||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return fr(r)?void 0:!!r}Jg.warn('isFeatureEnabled for key "'+t+Yg)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,i){if(this.ni){this.Yn=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();!function(t,e,i,n,s,o){void 0===i&&(i={}),void 0===n&&(n={}),void 0===s&&(s={});var a=(t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var r;return[t,null!==(r=e[t].variant)&&void 0!==r?r:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var r;return null==(r=e[t].metadata)?void 0:r.payload})).map((t=>{var r;return[t,null==(r=e[t].metadata)?void 0:r.payload]})))):Jg.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t})(t),u=a.flags,l=a.featureFlags,h=a.featureFlagPayloads;if(l){var c=t.requestId,d=t.evaluatedAt;if(hr(l)){Jg.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(l)for(var f=0;l.length>f;f++)v[l[f]]=!0;e&&e.register({[ms]:l,[gs]:v})}else{var p=l,g=h,m=u;if(null!=o&&o.partialResponse)p=r({},i,p),g=r({},n,g),m=r({},s,m);else if(t.errorsWhileComputingFlags)if(u){var y=new Set(Object.keys(u).filter((t=>{var e;return!(null!=(e=u[t])&&e.failed)})));p=r({},i,Object.fromEntries(Object.entries(p).filter((t=>{var[e]=t;return y.has(e)})))),g=r({},n,Object.fromEntries(Object.entries(g||{}).filter((t=>{var[e]=t;return y.has(e)})))),m=r({},s,Object.fromEntries(Object.entries(m||{}).filter((t=>{var[e]=t;return y.has(e)}))))}else p=r({},i,p),g=r({},n,g),m=r({},s,m);e&&e.register(r({[ms]:Object.keys(tm(p)),[gs]:p||{},[_s]:g||{},[bs]:m||{}},c?{[ws]:c}:{},d?{[Ps]:d}:{}))}}}(t,this.ni,n,s,o,i),e||(this.ss=!1),this.gs(e)}}override(t,e){void 0===e&&(e=!1),Jg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.ni)return Jg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.ni.unregister(xs),this.ni.unregister(Ss),this.gs(),Kg.info("All overrides cleared");if(hr(t)){var e=Xg(t);return this.ni.register({[xs]:e}),this.gs(),Kg.info("Flag overrides set",{flags:t})}if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var r,i=t;if(this.Kn=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.ni.unregister(xs),Kg.info("Flag overrides cleared");else if(i.flags){if(hr(i.flags)){var n=Xg(i.flags);this.ni.register({[xs]:n})}else this.ni.register({[xs]:i.flags});Kg.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.ni.unregister(Ss),Kg.info("Payload overrides cleared")):i.payloads&&(this.ni.register({[Ss]:i.payloads}),Kg.info("Payload overrides set",{payloads:i.payloads}))),void this.gs()}if(t&&"object"==typeof t)return this.ni.register({[xs]:t}),this.gs(),Kg.info("Flag overrides set",{flags:t});Jg.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Yn){var{flags:e,flagVariants:r}=this.ys();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this.os(ys)||[]).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),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var u=r({},this.getFlagVariants(),{[t]:e});null==(n=this.ni)||n.register({[ms]:Object.keys(tm(u)),[gs]:u}),this.gs()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this.os(ys),n=r?"&"+r.map((t=>"stage="+t)).join("&"):"";if(i&&!e)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.qt.token+n),method:"GET",callback:e=>{var r,i;if(e.json){var n=e.json.earlyAccessFeatures;return null==(r=this.ni)||r.unregister(ys),null==(i=this.ni)||i.register({[ys]:n}),t(n)}}})}ys(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,r)=>(t[r]=e[r],t)),{})}}gs(t){var{flags:e,flagVariants:r}=this.ys();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.os(ks)||{},n=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$set_once,o={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(o[a]=s[a]));this._instance.register({[ks]:r({},i,o,n)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ks)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.os(Cs)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[Cs]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.os(Cs)||{};this._instance.register({[Cs]:r({},e,{[t]:{}})})}else this._instance.unregister(Cs)}reset(){this.Yn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.ps(),this.Kn=!1}}},am={sessionRecording:class{get qt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var t;return!(null==(t=this.bs)||!t.isStarted)}get status(){var t,e;return this._s===Og||this._s===Pg?this._s:null!==(t=null==(e=this.bs)?void 0:e.status)&&void 0!==t?t:this._s}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this._s=Rg,this.ws=void 0,this._instance=t,!this._instance.sessionManager)throw Ag.error("started without valid sessionManager"),new Error(Lg+" started without valid sessionManager. This is a bug.");if(this.qt.cookieless_mode===Zs)throw new Error(Lg+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get xs(){var t,e=!(null==(t=this._instance.get_property(ls))||!t.enabled),r=!this.qt.disable_session_recording,i=this.qt.disable_session_recording||this._instance.consent.isOptedOut();return pn&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.xs||null==(e=this.bs)||!e.isStarted){var r=!fr(Object.assign)&&!fr(Array.from);this.xs&&r?(this.Ss(t),Ag.info("starting")):(this._s=Rg,this.stopRecording())}}Ss(t){var e,r,i;this.xs&&(this._s!==Og&&this._s!==Pg&&(this._s=Mg),null!=Cn&&null!=(e=Cn.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=Cn.__PosthogExtensions__)&&r.initSessionRecording?this.ks(t):null==(i=Cn.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Cs,(e=>{if(e)return Ag.error("could not load recorder",e);this.ks(t)})))}stopRecording(){var t,e;null==(t=this.ws)||t.call(this),this.ws=void 0,null==(e=this.bs)||e.stop()}Is(){var t,e;null==(t=this.ws)||t.call(this),this.ws=void 0,null==(e=this.bs)||e.discard()}Ts(){var t;null==(t=this.ni)||t.unregister(ps)}Es(t,e){if(yr(t))return null;var r,i=br(t)?t:parseFloat(t);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(Ag.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):i}Ms(t){if(this.ni){var e,i,n=this.ni,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.Es(null==(e=this.qt.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.Es(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;yr(a)&&this.Ts();var u=null==i?void 0:i.minimumDurationMilliseconds;n.register({[ls]:r({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:r({capturePerformance:t.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:fr(u)?null:u,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(e=this.ws)||e.call(this),this.ws=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){return"sessionRecording"in t?!1===t.sessionRecording?(this.Ms(t),void this.Is()):(this.Ms(t),void this.startIfEnabledOrStop()):(this._s===Og&&(this._s=Pg,Ag.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.bs)&&r.log?this.bs.log(t,e):Ag.warn("log called before recorder was ready")}get Cs(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(ls);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}Ps(){var t,e,r=this._instance.get_property(ls);if(!r)return!1;try{e="object"==typeof r?r:JSON.parse(r)}catch(t){return Ag.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}var i=null!==(t=e.cache_timestamp)&&void 0!==t?t:Date.now();return 36e5>=Date.now()-i}ks(t){var e,r;if(null==(e=Cn.__PosthogExtensions__)||!e.initSessionRecording)return Ag.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[zs]:!0});if(this.bs||(this.bs=null==(r=Cn.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.bs._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ps()){if(this._s===Pg||this._s===Og)return;return this._s=Og,Ag.info("persisted remote config is stale, requesting fresh config before starting"),void new Vp(this._instance).load()}this._s=Mg,this.bs.start(t)}onRRwebEmit(t){var e;null==(e=this.bs)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.bs||null==(e=this.ni)||e.register({[cs]:!0}),null==(t=this.bs)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.bs||null==(e=this.ni)||e.register({[hs]:!0}),null==(t=this.bs)||t.overrideSampling()}overrideTrigger(t){var e,r;this.bs||null==(r=this.ni)||r.register({["url"===t?ds:vs]:!0}),null==(e=this.bs)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.bs)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.bs)||!r.tryAddCustomEvent(t,e))}}},um={autocapture:class{constructor(t){this.Rs=!1,this.Os=null,this.Ls=!1,this.instance=t,this.rageclicks=new vp(t.config.rageclick),this.Fs=null}initialize(){this.startIfEnabled()}get qt(){var t,e,r=dr(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(t=r.url_allowlist)?void 0:t.map((t=>new RegExp(t))),r.url_ignorelist=null==(e=r.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),r}As(){if(this.isBrowserSupported()){if(pn&&yn){var t=t=>{t=t||(null==pn?void 0:pn.event);try{this.Ns(t)}catch(t){pp.error("Failed to capture event",t)}};if(Un(yn,"submit",t,{capture:!0}),Un(yn,"change",t,{capture:!0}),Un(yn,"click",t,{capture:!0}),this.qt.capture_copied_text){var e=t=>{t=t||(null==pn?void 0:pn.event);try{this.Ns(t,fp)}catch(t){pp.error("Failed to capture copy/cut event",t)}};Un(yn,"copy",e,{capture:!0}),Un(yn,"cut",e,{capture:!0})}}}else pp.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Rs&&(this.As(),this.Rs=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Ls=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ts]:!!t.autocapture_opt_out}),this.Os=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Fs=t}getElementSelectors(t){var e,r=[];return null==(e=this.Fs)||e.forEach((e=>{var i=null==yn?void 0:yn.querySelectorAll(e);null==i||i.forEach((i=>{t===i&&r.push(e)}))})),r}get isEnabled(){var t,e,r=null==(t=this.instance.persistence)?void 0:t.props[ts];if(mr(this.Os)&&!wr(r)&&!this.instance.Lr())return!1;var i=null!==(e=this.Os)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!i}Ns(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=mo(t);lo(i)&&(i=i.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&function(t,e){if(!pn||ko(t))return!1;var r,i,n;if(wr(e)?(r=!!e&&So,i=void 0):(r=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:So,i=null==e?void 0:e.content_ignorelist),!1===r)return!1;var{targetElementList:s}=Co(t,!1);return!function(t,e){if(!1===t||fr(t))return!1;var r;if(!0===t)r=wo;else{if(!hr(t))return!1;if(t.length>10)return Mn.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=t.map((t=>t.toLowerCase()))}return e.some((t=>{var{safeText:e,ariaLabel:i}=t;return r.some((t=>e.includes(t)||i.includes(t)))}))}(i,s.map((t=>{var e;return{safeText:go(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!bo(s,r)}(i,this.instance.config.rageclick)&&this.Ns(t,"$rageclick");var n=e===fp;if(i&&function(t,e,r,i,n){var s,o,a,u;if(void 0===r&&(r=void 0),!pn||ko(t))return!1;if(null!=(s=r)&&s.url_allowlist&&!vo(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&vo(r.url_ignorelist))return!1;if(null!=(a=r)&&a.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((t=>e.type===t)))return!1}var{parentIsUsefulElement:h,targetElementList:c}=Co(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(fr(r))return!0;var i,n=function(t){if(r.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(i=n(s))return i.v;return!1}(c,r))return!1;if(!bo(c,null==(u=r)?void 0:u.css_selector_allowlist))return!1;var d=pn.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&&(yo.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}(i,t,this.qt,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=yp(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qt.element_attribute_ignorelist,elementsChainAsString:this.Ls});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),e===fp){var u,l=po(null==pn||null==(u=pn.getSelection())?void 0:u.toString()),h=t.type||"clipboard";if(!l)return!1;s.$selected_content=l,s.$copy_type=h}return this.instance.capture(e,s),!0}}}isBrowserSupported(){return cr(null==yn?void 0:yn.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.$s=(null==pn||null==(e=pn.location)?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(Mn.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ds&&this.Ds(),this.Ds=void 0,Mn.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(pn&&pn.history){var r=this;null!=(t=pn.history.pushState)&&t.__posthog_wrapped__||Gn(pn.history,"pushState",(t=>function(e,i,n){t.call(this,e,i,n),r.qs("pushState")})),null!=(e=pn.history.replaceState)&&e.__posthog_wrapped__||Gn(pn.history,"replaceState",(t=>function(e,i,n){t.call(this,e,i,n),r.qs("replaceState")})),this.js()}}qs(t){try{var e,r=null==pn||null==(e=pn.location)?void 0:e.pathname;if(!r)return;r!==this.$s&&this.isEnabled&&this._instance.capture(Xs,{navigation_type:t}),this.$s=r}catch(e){Mn.error("Error capturing "+t+" pageview",e)}}js(){if(!this.Ds){var t=()=>{this.qs("popstate")};Un(pn,"popstate",t),this.Ds=()=>{pn&&pn.removeEventListener("popstate",t)}}}},heatmaps:class{get qt(){return this.instance.config}constructor(t){var e;this.Hs=!1,this.Rs=!1,this.Us=null,this.instance=t,this.Hs=!(null==(e=this.instance.persistence)||!e.props[es]),this.rageclicks=new vp(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return dr(this.qt.capture_heatmaps)&&this.qt.capture_heatmaps.flush_interval_milliseconds&&(t=this.qt.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return yr(this.qt.capture_heatmaps)?yr(this.qt.enable_heatmaps)?this.Hs:this.qt.enable_heatmaps:!1!==this.qt.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Rs)return;Ng.info("starting..."),this.Bs(),this.At()}else{var t;clearInterval(null!==(t=this.Us)&&void 0!==t?t:void 0),this.zs(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[es]:e}),this.Hs=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.M;return this.M=void 0,t}Vs(t){this.Mt(t.originalEvent,"deadclick")}At(){this.Us&&clearInterval(this.Us),this.Us="visible"===(null==yn?void 0:yn.visibilityState)?setInterval(this.Zr.bind(this),this.flushIntervalMilliseconds):null}Bs(){pn&&yn&&(this.Ws=this.Zr.bind(this),Un(pn,Ys,this.Ws),this.Zs=t=>this.Mt(t||(null==pn?void 0:pn.event)),Un(yn,"click",this.Zs,{capture:!0}),this.Gs=t=>this.Qs(t||(null==pn?void 0:pn.event)),Un(yn,"mousemove",this.Gs,{capture:!0}),this.Js=new Rp(this.instance,Ip,this.Vs.bind(this)),this.Js.startIfEnabledOrStop(),this.Ks=this.At.bind(this),Un(yn,Ks,this.Ks),this.Rs=!0)}zs(){var t;pn&&yn&&(this.Ws&&pn.removeEventListener(Ys,this.Ws),this.Zs&&yn.removeEventListener("click",this.Zs,{capture:!0}),this.Gs&&yn.removeEventListener("mousemove",this.Gs,{capture:!0}),this.Ks&&yn.removeEventListener(Ks,this.Ks),clearTimeout(this.Ys),null==(t=this.Js)||t.stop(),this.Rs=!1)}Xs(t,e){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,r){for(var i=t;i&&ao(i)&&!uo(i,"body");){if(i===r)return!1;if(nr(e,null==pn?void 0:pn.getComputedStyle(i).position))return!0;i=_o(i)}return!1}(mo(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:i),y:t.clientY+(s?0:r),target_fixed:s,type:e}}Mt(t,e){var i;if(void 0===e&&(e="click"),!oo(t.target)&&Fg(t)){var n=this.Xs(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.eo(r({},n,{type:"rageclick"})),this.eo(n)}}Qs(t){!oo(t.target)&&Fg(t)&&(clearTimeout(this.Ys),this.Ys=setTimeout((()=>{this.eo(this.Xs(t,"mousemove"))}),500))}eo(t){if(pn){var e=pn.location.href,r=this.qt.custom_personal_data_properties,i=this.qt.mask_personal_data_properties?[...uc,...r||[]]:[],n=Wn(e,i,hc);this.M=this.M||{},this.M[n]||(this.M[n]=[]),this.M[n].push(t)}}Zr(){this.M&&!vr(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Rp,webVitalsAutocapture:class{constructor(t){var e;this.Hs=!1,this.Rs=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.ro=()=>{clearTimeout(this.io),0!==this.M.metrics.length&&(this._instance.capture("$web_vitals",this.M.metrics.reduce(((t,e)=>r({},t,{["$web_vitals_"+e.name+"_event"]:r({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{})),this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=t=>{var e;this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.no();if(!fr(i))if(yr(null==t?void 0:t.name)||yr(null==t?void 0:t.value))Ig.error("Invalid metric received",t);else if(!this.so||this.so>t.value){this.M.url!==i&&(this.ro(),this.io=setTimeout(this.ro,this.flushToCaptureTimeoutMs)),fr(this.M.url)&&(this.M.url=i),this.M.firstMetricTimestamp=fr(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0);var n=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),s=r({},t,{$current_url:i,timestamp:Date.now()});fr(n)||(s.$session_id=n.sessionId,s.$window_id=n.windowId),this.M.metrics.push(s),this.M.metrics.length===this.allowedMetrics.length&&this.ro()}else Ig.error("Ignoring metric with value >= "+this.so,t)},this.oo=()=>{if(!this.Rs){var t,e,r,i,n=Cn.__PosthogExtensions__;fr(n)||fr(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.ht.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.ht.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.ht.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.ht.bind(this)),this.Rs=!0):Ig.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Hs=!(null==(e=this._instance.persistence)||!e.props[ss]),this.startIfEnabled()}get ao(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=dr(this.ao)?null==(t=this.ao)?void 0:t.web_vitals_allowed_metrics:void 0;return yr(r)?(null==(e=this._instance.persistence)?void 0:e.props[us])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(dr(this.ao)?this.ao.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=dr(this.ao)?this.ao.web_vitals_attribution:void 0;return null!=t&&t}get so(){var t=dr(this.ao)&&br(this.ao.__web_vitals_max_value)?this.ao.__web_vitals_max_value:Eg;return t>0&&6e4>=t?Eg:t}get isEnabled(){var t=null==bn?void 0:bn.protocol;if("http:"!==t&&"https:"!==t)return Ig.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=dr(this.ao)?this.ao.web_vitals:wr(this.ao)?this.ao:void 0;return wr(e)?e:this.Hs}startIfEnabled(){this.isEnabled&&!this.Rs&&(Ig.info("enabled, starting..."),this.lr(this.oo))}onRemoteConfig(t){if("capturePerformance"in t){var e=dr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=dr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[ss]:e}),this._instance.persistence.register({[us]:r})),this.Hs=e,this.startIfEnabled()}}lr(t){var e,r;null!=(e=Cn.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks?t():null==(r=Cn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(e=>{e?Ig.error("failed to load script",e):t()}))}no(){var t=pn?pn.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...uc,...e||[]]:[];return Wn(t,r,hc)}Ig.error("Could not determine current URL")}}},lm={exceptionObserver:class{constructor(t){var e,r,i;this.oo=()=>{var t;if(pn&&this.isEnabled&&null!=(t=Cn.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=Cn.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=Cn.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=Cn.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.uo&&this.qt.capture_unhandled_errors&&(this.uo=e(this.captureException.bind(this))),!this.lo&&this.qt.capture_unhandled_rejections&&(this.lo=r(this.captureException.bind(this))),!this.ho&&this.qt.capture_console_errors&&(this.ho=i(this.captureException.bind(this)))}catch(t){Cg.error("failed to start",t),this.co()}}},this._instance=t,this.do=!(null==(e=this._instance.persistence)||!e.props[rs]),this.vo=new Mr({refillRate:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==r?r:1,bucketSize:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==i?i:10,refillInterval:1e4,Gt:Cg}),this.qt=this.fo(),this.startIfEnabledOrStop()}fo(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return dr(t)?e=r({},e,t):(fr(t)?this.do:t)&&(e=r({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.qt.capture_console_errors||this.qt.capture_unhandled_errors||this.qt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Cg.info("enabled"),this.co(),this.lr(this.oo)):this.co()}lr(t){var e,r;null!=(e=Cn.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=Cn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Cg.error("failed to load script",e);t()}))}co(){var t,e,r;null==(t=this.uo)||t.call(this),this.uo=void 0,null==(e=this.lo)||e.call(this),this.lo=void 0,null==(r=this.ho)||r.call(this),this.ho=void 0}onRemoteConfig(t){"autocaptureExceptions"in t&&(this.do=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[rs]:this.do}),this.qt=this.fo(),this.startIfEnabledOrStop())}onConfigChange(){this.qt=this.fo()}captureException(t){var e,r,i,n=null!==(e=null==t||null==(r=t.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==e?e:"Exception";this.vo.consumeRateLimit(n)?Cg.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(i=this._instance.exceptions)||i.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,r;this.po=[],this.mo=Sf(),this._instance=t,this.po=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(is))&&void 0!==e?e:[],this.yo=dn(this.bo()),this._o=new vn(this.yo)}onConfigChange(){this.yo=dn(this.bo()),this._o.setConfig(this.yo)}onRemoteConfig(t){var e,r,i;if("errorTracking"in t){var n=null!==(e=null==(r=t.errorTracking)?void 0:r.suppressionRules)&&void 0!==e?e:[],s=null==(i=t.errorTracking)?void 0:i.captureExtensionExceptions;this.po=n,this._instance.persistence&&this._instance.persistence.register({[is]:this.po,[ns]:s})}}get wo(){var t,e=!!this._instance.get_property(ns),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.mo.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.yo.enabled)try{if(!pr(t)||0===t.trim().length)return void xf.warn("Ignoring exception step because message must be a non-empty string");var i=this.xo(e),{sanitizedProperties:n,droppedKeys:s}=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((r,i)=>hn.has(i)?(e.push(i),r):(r[i]=t[i],r)),{}),droppedKeys:e}}(i);s.length>0&&xf.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this._o.add(r({[un]:t,[ln]:(new Date).toISOString()},n))}catch(t){xf.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.So(e)){if(this.ko(e))return this.Co("Exception dropped: matched a suppression rule"),void xf.info("Skipping exception capture because a suppression rule matched");if(!this.wo&&this.Io(e))return this.Co("Exception dropped: thrown by a browser extension"),void xf.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.To(e))return this.Co("Exception dropped: thrown by the PostHog SDK"),void xf.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.yo.enabled&&yr(t.$exception_steps)?this.Eo(t):t;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",en:!0});return i&&this._o.clear(),i}catch(t){return xf.error("Failed to capture exception event. Dropping this exception.",t),void this._o.clear()}}catch(t){return void xf.error("Failed to process exception event. Ignoring this exception.",t)}}Eo(t){try{var e=this._o.getAttachable();return 0===e.length?t:r({},t,{$exception_steps:e})}catch(e){return xf.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Co(t){this.yo.enabled&&this._o.add({[un]:t,[ln]:(new Date).toISOString()})}xo(t){return dr(t)?r({},t):{}}bo(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}ko(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:r,value:i}=e;return pr(r)&&r.length>0&&t.$exception_types.push(r),pr(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.po.some((t=>{var r=t.values.map((t=>{var r,i=zl[t.operator],n=hr(t.value)?t.value:[t.value],s=null!==(r=e[t.key])&&void 0!==r?r:[];return n.length>0&&i(n,s)}));return"OR"===t.type?r.some(Boolean):r.every(Boolean)}))}Io(t){var e=t.flatMap((t=>{var e,r;return null!==(e=null==(r=t.stacktrace)?void 0:r.frames)&&void 0!==e?e:[]}));return e.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}To(t){if(t.length>0){var e,r,i,n,s=null!==(e=null==(r=t[0].stacktrace)?void 0:r.frames)&&void 0!==e?e:[],o=s[s.length-1];return null!==(i=null==o||null==(n=o.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==i&&i}return!1}So(t){return!yr(t)&&hr(t)}}},hm=r({productTours:class{get ni(){return this._instance.persistence}constructor(t){this.Mo=null,this.Po=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){"productTours"in t&&(this.ni&&this.ni.register({[as]:!!t.productTours}),this.loadIfEnabled())}loadIfEnabled(){var t,e;this.Mo||(t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(as)||this.lr((()=>this.Ro()))}lr(t){var e,r;null!=(e=Cn.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=Cn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?$g.error("Could not load product tours script",e):t()}))}Ro(){var t;!this.Mo&&null!=(t=Cn.__PosthogExtensions__)&&t.generateProductTours&&(this.Mo=Cn.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!hr(this.Po)||e){var r=this.ni;if(r){var i=r.props[Es];if(hr(i)&&!e)return this.Po=i,void t(i,{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 i=e.statusCode;if(200!==i||!e.json){var n="Product Tours API could not be loaded, status: "+i;return $g.error(n),void t([],{isLoaded:!1,error:n})}var s=hr(e.json.product_tours)?e.json.product_tours:[];this.Po=s,r&&r.register({[Es]:s}),t(s,{isLoaded:!0})}})}else t(this.Po,{isLoaded:!0})}getActiveProductTours(t){yr(this.Mo)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Mo.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Mo)||e.showTourById(t)}previewTour(t){this.Mo?this.Mo.previewTour(t):this.lr((()=>{var e;this.Ro(),null==(e=this.Mo)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Mo)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Mo)||t.nextStep()}previousStep(){var t;null==(t=this.Mo)||t.previousStep()}clearCache(){var t;this.Po=null,null==(t=this.ni)||t.unregister(Es)}resetTour(t){var e;null==(e=this.Mo)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Mo)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Mo)||e.cancelPendingTour(t)}}},om),cm={siteApps:class{constructor(t){this._instance=t,this.Oo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Lo(t,e){if(e){var r=this.globalsForEvent(e);this.Oo.push(r),this.Oo.length>1e3&&(this.Oo=this.Oo.slice(10))}}get siteAppLoaders(){var t;return null==(t=Cn._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Lo.bind(this));this.Fo=()=>{t(),this.Oo=[],this.Fo=void 0}}}globalsForEvent(t){var e,n,s,o,a,u,l;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:r({},i(t,Dg),{properties:r({},t.properties,g?{$set:r({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:r({},null!==(s=null==(o=t.properties)?void 0:o.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(a=null==(u=t.properties)?void 0:u.$elements_chain)&&void 0!==a?a:"",distinct_id:null==(l=t.properties)?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var r;!e.errored&&this.Oo.length&&(qg.info("Processing "+this.Oo.length+" events for site app with id "+t.id),this.Oo.forEach((t=>null==e.processEvent?void 0:e.processEvent(t))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(r=this.Fo)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,qg.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),i&&r()};try{var{processEvent:s}=t.init({posthog:this._instance,callback(t){n(t)}});s&&(e.processEvent=s),i=!0}catch(e){qg.error(jg+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){qg.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}Ao(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}No(t){if(0!==Object.keys(this.apps).length){var e=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{null==r.processEvent||r.processEvent(e)}catch(e){qg.error("Error while processing event "+t.event+" for site app "+r.id,e)}}}onRemoteConfig(t){var e,r,i,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.Ao(),void this._instance.on("eventCaptured",(t=>this.No(t)))):void qg.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.Fo)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var s=function(t){var e;Cn["__$$ph_site_app_"+t]=n._instance,null==(e=Cn.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return qg.error(jg+t,e)}))};for(var{id:o,url:a}of t.siteApps)s(o)}else qg.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},dm={tracingHeaders:class{constructor(t){this.$o=void 0,this.Do=void 0,this.oo=()=>{var t,e,r=this.qo()||[];fr(this.$o)&&(null==(t=Cn.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(r,this._instance.get_distinct_id(),this._instance.sessionManager)),fr(this.Do)&&(null==(e=Cn.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchFetch(r,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}initialize(){this.startIfEnabledOrStop()}lr(t){var e,r;null!=(e=Cn.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(r=Cn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return Tg.error("failed to load script",e);t()}))}qo(){var t;return null!==(t=this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var t,e;this.qo()?this.lr(this.oo):(null==(t=this.$o)||t.call(this),null==(e=this.Do)||e.call(this),this.$o=void 0,this.Do=void 0)}}},vm=r({surveys:class{get qt(){return this._instance.config}constructor(t){this.jo=void 0,this._surveyManager=null,this.Ho=!1,this.Uo=[],this.Bo=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.qt.disable_surveys){var e=t.surveys;if(yr(e))return Lu.warn("Flags not loaded yet. Not loading surveys.");var r=hr(e);this.jo=r?e.length>0:e,Lu.info("flags response received, isSurveysEnabled: "+this.jo),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith($u)||null!=r&&r.startsWith(Du))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.Ho)Lu.info("Already initializing surveys, skipping...");else if(this.qt.disable_surveys)Lu.info(Wg);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())Lu.info("Not loading surveys in cookieless mode without consent.");else{var t=null==Cn?void 0:Cn.__PosthogExtensions__;if(t){if(!fr(this.jo)||this.qt.advanced_enable_surveys){var e=this.jo||this.qt.advanced_enable_surveys;this.Ho=!0;try{var r=t.generateSurveys;if(r)return void this.zo(r,e);var i=t.loadExternalDependency;if(!i)return void this.Vo(Vs);i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.Vo("Could not load surveys script",r):this.zo(t.generateSurveys,e)}))}catch(t){throw this.Vo("Error initializing surveys",t),t}finally{this.Ho=!1}}}else Lu.error("PostHog Extensions not found.")}}zo(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new zg(this._instance),Lu.info("Surveys loaded successfully"),this.Wo({isLoaded:!0})}Vo(t,e){Lu.error(t,e),this.Wo({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Uo.push(t),this._surveyManager&&this.Wo({isLoaded:!0}),()=>{this.Uo=this.Uo.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.qt.disable_surveys)return Lu.info(Wg),t([]);var r,i=this._instance.get_property(Ts);if(i&&!e)return t(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.Bo?this.Bo.then((e=>{var{surveys:r,context:i}=e;return t(r,i)})):("undefined"!=typeof Promise&&(this.Bo=new Promise((t=>{r=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.qt.token),method:"GET",timeout:this.qt.surveys_request_timeout_ms,callback:e=>{var i;this.Bo=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;Lu.error(s);var o={isLoaded:!1,error:s};return t([],o),void(null==r||r({surveys:[],context:o}))}var a,u=e.json.surveys||[],l=u.filter((t=>Au(t)&&(Nu(t)||Fu(t))));l.length>0&&(null==(a=this._surveyEventReceiver)||a.register(l)),null==(i=this._instance.persistence)||i.register({[Ts]:u});var h={isLoaded:!0};t(u,h),null==r||r({surveys:u,context:h})}}))}Wo(t){for(var e of this.Uo)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Lu.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!yr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Lu.warn("init was not called")}Zo(t){var e=null;return this.getSurveys((r=>{var i;e=null!==(i=r.find((e=>e.id===t)))&&void 0!==i?i:null})),e}Go(t){if(yr(this._surveyManager))return{eligible:!1,reason:Vg};var e="string"==typeof t?this.Zo(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(yr(this._surveyManager))return Lu.warn("init was not called"),{visible:!1,disabledReason:Vg};var e=this.Go(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return yr(this._surveyManager)?(Lu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Vg})):new Promise((r=>{this.getSurveys((e=>{var i,n=null!==(i=e.find((e=>e.id===t)))&&void 0!==i?i:null;if(n){var s=this.Go(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if(yr(this._surveyManager))Lu.warn("init was not called");else{var n="string"==typeof t?this.Zo(t):t;if(null!=n&&n.id)if(Hu.includes(n.type)){var s=null==yn?void 0:yn.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Lu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Lu.info("Rendering survey "+n.id+" with delay of "+(null==(t=n.appearance)?void 0:t.surveyPopupDelaySeconds)+" seconds"),null==(e=this._surveyManager)||e.renderSurvey(n,s,r),Lu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Lu.warn("Survey element not found")}else Lu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Lu.warn("Survey not found")}}displaySurvey(t,e){var i;if(yr(this._surveyManager))Lu.warn("init was not called");else{var n=this.Zo(t);if(n){var s=n;if(null!=(i=n.appearance)&&i.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=r({},n,{appearance:r({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==ku.Popover&&e.initialResponses&&Lu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var o=this.canRenderSurvey(n);if(!o.visible)return void Lu.warn("Survey is not eligible to be displayed: ",o.disabledReason)}e.displayType!==ku.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Lu.warn("Survey not found")}}cancelPendingSurvey(t){yr(this._surveyManager)?Lu.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}},om),fm={toolbar:class{constructor(t){this.instance=t}Qo(t){Cn.ph_toolbar_state=t}Jo(){var t;return null!==(t=Cn.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,r){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),Hn(this.instance.config))return!1;if(!pn||!yn)return!1;t=null!=t?t:pn.location,r=null!=r?r:pn.history;try{if(!e){try{pn.localStorage.setItem("test","test"),pn.localStorage.removeItem("test")}catch(t){return!1}e=null==pn?void 0:pn.localStorage}var i,n=Zg||Zn(t.hash,"__posthog")||Zn(t.hash,"state"),s=n?Fn((()=>JSON.parse(atob(decodeURIComponent(n)))))||Fn((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?t.hash=s.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((i=JSON.parse(e.getItem(Gg)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(t){return!1}}Ko(t){var e=Cn.ph_load_toolbar||Cn.ph_load_editor;!yr(e)&&cr(e)?e(t,this.instance):Qg.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==yn||!yn.getElementById(js));if(!pn||e)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=r({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(pn.localStorage.setItem(Gg,JSON.stringify(r({},n,{source:void 0}))),2===this.Jo())this.Ko(n);else if(0===this.Jo()){var s;this.Qo(1),null==(s=Cn.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return Qg.error("[Toolbar] Failed to load",t),void this.Qo(0);this.Qo(2),this.Ko(n)})),Un(pn,"turbolinks:load",(()=>{this.Qo(0),this.loadToolbar(n)}))}return!0}Yo(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}},pm=r({experiments:im},om),gm={conversations:class{constructor(t){this.Xo=void 0,this._conversationsManager=null,this.ea=!1,this.ta=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;yr(e)||(wr(e)?this.Xo=e:(this.Xo=e.enabled,this.ta=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Xo=void 0,this.ta=null}loadIfEnabled(){if(!(this._conversationsManager||this.ea||this._instance.config.disable_conversations||Hn(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==Cn?void 0:Cn.__PosthogExtensions__;if(t&&!fr(this.Xo)&&this.Xo)if(this.ta&&this.ta.token){this.ea=!0;try{var e=t.initConversations;if(e)return this.ra(e),void(this.ea=!1);var r=t.loadExternalDependency;if(!r)return void this.ia(Vs);r(this._instance,"conversations",(e=>{e||!t.initConversations?this.ia("Could not load conversations script",e):this.ra(t.initConversations),this.ea=!1}))}catch(t){this.ia("Error initializing conversations",t),this.ea=!1}}else nm.error("Conversations enabled but missing token in remote config.")}}ra(t){if(this.ta)try{this._conversationsManager=t(this.ta,this._instance),nm.info("Conversations loaded successfully")}catch(t){this.ia("Error completing conversations initialization",t)}else nm.error("Cannot complete initialization: remote config is null")}ia(t,e){nm.error(t,e),this._conversationsManager=null,this.ea=!1}show(){this._conversationsManager?this._conversationsManager.show():nm.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Xo&&!mr(this._conversationsManager)}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,r,i){var n=this;return e((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,r,i):(nm.warn(sm),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(nm.warn(sm),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(nm.warn(sm),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(nm.warn(sm),null)}))()}requestRestoreLink(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(t):(nm.warn(sm),null)}))()}restoreFromToken(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(t):(nm.warn(sm),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(nm.warn(sm),null)}))()}getCurrentTicketId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getCurrentTicketId())&&void 0!==t?t:null}getWidgetSessionId(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.getWidgetSessionId())&&void 0!==t?t:null}ln(){var t;null==(t=this._conversationsManager)||t.setIdentity()}hn(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},mm={logs:class{constructor(t){var e;this.na=!1,this.sa=!1,this.Gt=On("[logs]"),this.oa=[],this.aa=0,this.ua=0,this.la=!1,this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.na=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e,r=null==(e=t.logs)?void 0:e.captureConsoleLogs;!yr(r)&&r&&(this.na=!0,this.loadIfEnabled())}reset(){this.oa=[],this.qr&&(clearTimeout(this.qr),this.qr=void 0),this.aa=0,this.ua=0,this.la=!1}loadIfEnabled(){if(this.na&&!this.sa){var t=null==Cn?void 0:Cn.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(e=>{var r;e||null==(r=t.logs)||!r.initializeLogs?this.Gt.error("Could not load logs script",e):(t.logs.initializeLogs(this._instance),this.sa=!0)})):this.Gt.error(Vs)}else this.Gt.error("PostHog Extensions not found.")}}captureLog(t){var e,i,n,s,o,a;if(this._instance.is_capturing())if(t&&t.body){var u=null!==(e=null==(i=this._instance.config.logs)?void 0:i.flushIntervalMs)&&void 0!==e?e:3e3,l=null!==(n=null==(s=this._instance.config.logs)?void 0:s.maxLogsPerInterval)&&void 0!==n?n:1e3,h=Date.now();if(u>h-this.ua||(this.ua=h,this.aa=0,this.la=!1),l>this.aa){this.aa++;var c=function(t,e){var i=t.level||"info",{text:n,number:s}=Oi[i]||Pi,o=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var u=r({},a,t.attributes||{}),l={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:s,severityText:n,body:{stringValue:t.body},attributes:Ai(u)};return t.trace_id&&(l.traceId=t.trace_id),t.span_id&&(l.spanId=t.span_id),fr(t.trace_flags)||(l.flags=t.trace_flags),l}(t,this.ha());this.oa.push({record:c}),(null!==(o=null==(a=this._instance.config.logs)?void 0:a.maxBufferSize)&&void 0!==o?o:100)>this.oa.length?this.ca():this.flushLogs()}else this.la||(this.Gt.warn("captureLog dropping logs: exceeded "+l+" logs per "+u+"ms"),this.la=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.da||(this.da={trace:(t,e)=>this.captureLog({body:t,level:"trace",attributes:e}),debug:(t,e)=>this.captureLog({body:t,level:"debug",attributes:e}),info:(t,e)=>this.captureLog({body:t,level:"info",attributes:e}),warn:(t,e)=>this.captureLog({body:t,level:"warn",attributes:e}),error:(t,e)=>this.captureLog({body:t,level:"error",attributes:e}),fatal:(t,e)=>this.captureLog({body:t,level:"fatal",attributes:e})}),this.da}flushLogs(t){if(this.qr&&(clearTimeout(this.qr),this.qr=void 0),0!==this.oa.length){var e=this.oa;this.oa=[];var i=this._instance.config.logs,n=r({"service.name":(null==i?void 0:i.serviceName)||"unknown_service"},(null==i?void 0:i.environment)&&{"deployment.environment":i.environment},(null==i?void 0:i.serviceVersion)&&{"service.version":i.serviceVersion},null==i?void 0:i.resourceAttributes),s=function(t,e,r,i){return{resourceLogs:[{resource:{attributes:Ai(e)},scopeLogs:[{scope:{name:r,version:i},logRecords:t}]}]}}(e.map((t=>t.record)),n,En.LIB_NAME,En.LIB_VERSION),o=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.Bi({method:"POST",url:o,data:s,compression:"best-available",batchKey:"logs",transport:t})}}ca(){var t,e;this.qr||(this.qr=setTimeout((()=>{this.qr=void 0,this.flushLogs()}),null!==(t=null==(e=this._instance.config.logs)?void 0:e.flushIntervalMs)&&void 0!==t?t:3e3))}ha(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:r}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);e.sessionId=r}if(null!=Cn&&null!=(t=Cn.location)&&t.href&&(e.currentUrl=Cn.location.href),this._instance.featureFlags){var i=this._instance.featureFlags.getFlags();i&&i.length>0&&(e.activeFeatureFlags=i)}return e}}},ym=r({},om,am,um,lm,hm,cm,vm,dm,fm,pm,gm,mm);kg.__defaultExtensionClasses=r({},ym);var bm,_m=(bm=cg[yg]=new kg,function(){function t(){t.done||(t.done=!0,bg=!1,Ln(cg,(function(t){t._dom_loaded()})))}null!=yn&&yn.addEventListener?"complete"===yn.readyState?t():Un(yn,"DOMContentLoaded",t,{capture:!1}):pn&&Mn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),bm);export{Yu as Compression,qp as DEFAULT_PRODUCT_TOUR_APPEARANCE,ku as DisplaySurveyType,kg as PostHog,jp as ProductTourEventName,Up as ProductTourEventProperties,xu as SurveyEventName,Su as SurveyEventProperties,fu as SurveyEventType,gu as SurveyPosition,_u as SurveyQuestionBranchingType,bu as SurveyQuestionType,wu as SurveySchedule,mu as SurveyTabPosition,yu as SurveyType,pu as SurveyWidgetType,_m as default,_m as posthog,Ku as severityLevels};
2
2
  //# sourceMappingURL=module.full.js.map