posthog-js 1.373.2 → 1.373.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 H(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?H(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}function N(t,e){var r,i;try{i=new URL(t,null!=e?e: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}var D=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,q=/^(?:[a-z+]+:)?\/\//i,j=/^www\..*/i,U=/^(data:)([^,]*),(.*)/i;function H(t,e){return(t||"").replace(D,((t,r,i,n,s,o)=>{var a,u=i||s||o,l=r||n||"";if(!u)return t;if(q.test(u)||j.test(u))return"url("+l+u+l+")";if(U.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 B,z,V="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",W=4096,Z=1,G=new RegExp("[^a-z0-9-_:]"),Q=-2;function J(){return Z++}var Y=/^[^ \t\n\r\u000c]+/,K=/^[, \t\n\r\u000c]+/,X=new WeakMap;function tt(t,e){return e&&""!==e.trim()?et(t,e):e}function et(t,e){var r=X.get(t);if(r||(r=t.createElement("a"),X.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function rt(t,e,r,i,n,s){if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){var o=tt(t,i);if("img"===e&&o.startsWith("data:")&&n){var a=o;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(a=function(t,e,r,i){if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>W||t.naturalHeight>W)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,o,s.type,s.quality)),(null==s?void 0:s.maxBase64ImageLength)&&(u=a,a=(l=s.maxBase64ImageLength)&&u.length>l?V:u),a}return o}return"xlink:href"===r&&"#"!==i[0]?tt(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(Y);if(","===s.slice(-1))s=tt(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=tt(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?H(i,et(t)):"object"===e&&"data"===r?tt(t,i):i:tt(t,i);var u,l}function it(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function nt(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&nt(C.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&nt(C.parentNode(t),e,r)}function st(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(nt(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}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:D}=e,{preserveWhiteSpace:q=!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;D||(D=st(t,o,a,void 0===D));var j,U=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 G.test(e)?"div":e}(t),_={},w=t.attributes.length,x=0;w>x;x++){var S=t.attributes[x];it(b,S.name)||(_[S.name]=rt(s,b,L(S.name),S.value,t,c))}if("link"===b&&u){var k=function(t){return t.href}(t);if(k){var T=ot(s,k);!T&&k.includes(".css")&&(T=ot(s,window.location.origin+"/"+k.replace(window.location.href,"")));var I=null;T&&(I=R(T)),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){B||(B=s.createElement("canvas"),z=B.getContext("2d"));var q=t,j=q.currentSrc||q.getAttribute("src")||"<unknown-src>",U=q.crossOrigin,H=()=>{q.removeEventListener("load",H);try{B.width=q.naturalWidth,B.height=q.naturalHeight,z.drawImage(q,0,0),_.rr_dataURL=B.toDataURL(c.type,c.quality)}catch(t){if("anonymous"!==q.crossOrigin)return q.crossOrigin="anonymous",void(q.complete&&0!==q.naturalWidth?H():q.addEventListener("load",H));console.warn("Cannot inline img src="+j+"! Error: "+t)}"anonymous"===q.crossOrigin&&(U?_.crossOrigin=U:q.removeAttribute("crossorigin"))};q.complete&&0!==q.naturalWidth?H():q.addEventListener("load",H)}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:Z,left:Q,top:J}=t.getBoundingClientRect();_={class:_.class,rr_width:W+"px",rr_height:Z+"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:(Y=t,Boolean("svg"===Y.tagName||Y.ownerSVGElement)||void 0),needBlock:y,rootId:m,isCustom:n};var Y}(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=H(u,et(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:D,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:S,newlyAddedElement:k});if(!U)return console.warn(t,"not serialized"),null;j=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"===N(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}(U,v)&&(q||U.type!==f.Text||U.isStyle||U.textContent.replace(/^\s+|\s+$/gm,"").length)?J():Q;var V=Object.assign(U,{id:j});if(i.add(t,V),j===Q)return null;y&&y(t);var W=!u;if(V.type===f.Element){W=W&&!V.needBlock,delete V.needBlock;var Z=C.shadowRoot(t);Z&&E(Z)&&(V.isShadowHost=!0)}if((V.type===f.Document||V.type===f.Element)&&W){v.headWhitespace&&V.type===f.Element&&"head"===V.tagName&&(q=!1);var Y={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:D,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:q,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:S,depth:M+1,maxDepth:O};if(V.type===f.Element&&"textarea"===V.tagName&&void 0!==V.attributes.value);else for(var K of Array.from(C.childNodes(t))){var X=ct(K,Y);X&&V.childNodes.push(X)}var tt=null;if(T(t)&&(tt=C.shadowRoot(t)))for(var nt of Array.from(C.childNodes(tt))){var dt=ct(nt,Y);dt&&(E(tt)&&(dt.isShadow=!0),V.childNodes.push(dt))}}var vt=C.parentNode(t);return vt&&I(vt)&&E(vt)&&(V.isShadow=!0),V.type===f.Element&&"iframe"===V.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:D,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:q,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:S,depth:M+1,maxDepth:O});r&&b(t,r)}}),_),V.type===f.Element&&"link"===V.tagName&&"string"==typeof V.attributes.rel&&("stylesheet"===V.attributes.rel||"preload"===V.attributes.rel&&"string"==typeof V.attributes.href&&"css"===N(V.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var s=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(s),n=!0,e()}))}}(t,(()=>{if(w){var e=ct(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:D,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:q,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:S,depth:M,maxDepth:O});e&&w(t,e)}}),x),V}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(nt(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)===Q}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=Q;r===Q;)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:st(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"),!it(r.tagName,i))if(o.attributes[i]=rt(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 Yt(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 Kt(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}=Kt(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}=Kt(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}=Kt(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}=Kt(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}=Kt(e.parentStyleSheet,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:[...Yt(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}=Kt(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...Yt(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}=Kt(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:Yt(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}=Kt(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:Yt(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(J)),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}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)),Y.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)})}),Y=new ne({mirror:Re,mutationCb:Z,stylesheetManager:J,recordCrossOriginIframes:I,wrappedEmit:ye});for(var K of L||[])K.getMirror&&K.getMirror({nodeMirror:Re,crossOriginIframeMirror:Y.crossOriginIframeMirror,crossOriginIframeStyleMirror:Y.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:Y,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)&&Y.addIframe(t),Mt(t,Re)&&J.trackLinkElement(t),Ot(t)&&tt.addShadowRoot(C.shadowRoot(t),document)},onIframeLoad(t,e){Y.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&&Y.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:Y,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)};Y.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)}})),Y.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(),Y.removeLoadListener(),Y.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="NativeGzipValidationError",Ge=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Qe=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Ze,e},Je=function(){var t=e((function*(t,e){18>t.size&&Qe("too-short");var r=new Uint8Array(yield t.slice(0,10).arrayBuffer());31===r[0]&&139===r[1]&&8===r[2]||Qe("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)&&Qe("invalid-crc");var n=e.length>>>0;i.getUint32(4,!0)!==n&&Qe("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function Ye(){return Ye=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 Je(l,n),l}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),null}})),Ye.apply(this,arguments)}var Ke=["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"],Xe=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return Ke.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))},tr=function(t){return t.MinLength="min_length",t.MaxLength="max_length",t}({}),er=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function rr(t,e){return-1!==t.indexOf(e)}var ir=function(t){return t.trim()},nr=function(t){return t.replace(/^\$/,"")},sr=Object.prototype,or=sr.hasOwnProperty,ar=sr.toString,ur=Array.isArray||function(t){return"[object Array]"===ar.call(t)},lr=t=>"function"==typeof t,hr=t=>t===Object(t)&&!ur(t),cr=t=>{if(hr(t)){for(var e in t)if(or.call(t,e))return!1;return!0}return!1},dr=t=>void 0===t,vr=t=>"[object String]"==ar.call(t),fr=t=>vr(t)&&0===t.trim().length,pr=t=>null===t,gr=t=>dr(t)||pr(t),mr=t=>"[object Number]"==ar.call(t)&&t==t,yr=t=>mr(t)&&t>0,br=t=>"[object Boolean]"===ar.call(t),_r=t=>t instanceof FormData;function wr(t){return null===t||"object"!=typeof t}function xr(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Sr(t){return"undefined"!=typeof Event&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var kr=[!0,"true",1,"1","yes"],Cr=t=>rr(kr,t),Tr=[!1,"false",0,"0","no"];function Ir(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),mr(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),Ir(n||r,e,r,i))}class Er{constructor(t){this.$t={},this.zt=t.zt,this.Zt=Ir(t.bucketSize,0,100,t.Gt),this.Qt=Ir(t.refillRate,0,this.Zt,t.Gt),this.Jt=Ir(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 Rr,Mr,Or,Pr="Mobile",Lr="iOS",Ar="Android",Fr="Tablet",Nr=Ar+" "+Fr,$r="iPad",Dr="Apple",qr=Dr+" Watch",jr="Safari",Ur="BlackBerry",Hr="Samsung",Br=Hr+"Browser",zr=Hr+" Internet",Vr="Chrome",Wr=Vr+" OS",Zr=Vr+" "+Lr,Gr="Internet Explorer",Qr=Gr+" "+Pr,Jr="Opera",Yr=Jr+" Mini",Kr="Edge",Xr="Microsoft "+Kr,ti="Firefox",ei=ti+" "+Lr,ri="Nintendo",ii="PlayStation",ni="Xbox",si=Ar+" "+Pr,oi=Pr+" "+jr,ai="Windows",ui=ai+" Phone",li="Nokia",hi="Ouya",ci="Generic",di=ci+" "+Pr.toLowerCase(),vi=ci+" "+Fr.toLowerCase(),fi="Konqueror",pi="(\\d+(\\.\\d+)?)",gi=new RegExp("Version/"+pi),mi=new RegExp(ni,"i"),yi=new RegExp(ii+" \\w+","i"),bi=new RegExp(ri+" \\w+","i"),_i=new RegExp(Ur+"|PlayBook|BB10","i"),wi={"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"},xi=function(t,e){return e=e||"",rr(t," OPR/")&&rr(t,"Mini")?Yr:rr(t," OPR/")?Jr:_i.test(t)?Ur:rr(t,"IE"+Pr)||rr(t,"WPDesktop")?Qr:rr(t,Br)?zr:rr(t,Kr)||rr(t,"Edg/")?Xr:rr(t,"FBIOS")?"Facebook "+Pr:rr(t,"UCWEB")||rr(t,"UCBrowser")?"UC Browser":rr(t,"CriOS")?Zr:rr(t,"CrMo")||rr(t,Vr)?Vr:rr(t,Ar)&&rr(t,jr)?si:rr(t,"FxiOS")?ei:rr(t.toLowerCase(),fi.toLowerCase())?fi:((t,e)=>e&&rr(e,Dr)||function(t){return rr(t,jr)&&!rr(t,Vr)&&!rr(t,Ar)}(t))(t,e)?rr(t,Pr)?oi:jr:rr(t,ti)?ti:rr(t,"MSIE")||rr(t,"Trident/")?Gr:rr(t,"Gecko")?ti:""},Si={[Qr]:[new RegExp("rv:"+pi)],[Xr]:[new RegExp(Kr+"?\\/"+pi)],[Vr]:[new RegExp("("+Vr+"|CrMo)\\/"+pi)],[Zr]:[new RegExp("CriOS\\/"+pi)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+pi)],[jr]:[gi],[oi]:[gi],[Jr]:[new RegExp("(Opera|OPR)\\/"+pi)],[ti]:[new RegExp(ti+"\\/"+pi)],[ei]:[new RegExp("FxiOS\\/"+pi)],[fi]:[new RegExp("Konqueror[:/]?"+pi,"i")],[Ur]:[new RegExp(Ur+" "+pi),gi],[si]:[new RegExp("android\\s"+pi,"i")],[zr]:[new RegExp(Br+"\\/"+pi)],[Gr]:[new RegExp("(rv:|MSIE )"+pi)],Mozilla:[new RegExp("rv:"+pi)]},ki=function(t,e){var r=xi(t,e),i=Si[r];if(dr(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},Ci=[[new RegExp(ni+"; "+ni+" (.*?)[);]","i"),t=>[ni,t&&t[1]||""]],[new RegExp(ri,"i"),[ri,""]],[new RegExp(ii,"i"),[ii,""]],[_i,[Ur,""]],[new RegExp(ai,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[ui,""];if(new RegExp(Pr).test(e)&&!/IEMobile\b/.test(e))return[ai+" "+Pr,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=wi[r[1]]||"";return/arm/i.test(e)&&(i="RT"),[ai,i]}return[ai,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[Lr,[t[3],t[4],t[5]||"0"].join(".")]:[Lr,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=dr(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Ar+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ar+")","i"),t=>t&&t[2]?[Ar,[t[2],t[3],t[4]||"0"].join(".")]:[Ar,""]],[/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/,[Wr,""]],[/Linux|debian/i,["Linux",""]]],Ti=function(t){return bi.test(t)?ri:yi.test(t)?ii:mi.test(t)?ni:new RegExp(hi,"i").test(t)?hi:new RegExp("("+ui+"|WPDesktop)","i").test(t)?ui:/iPad/.test(t)?$r:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?qr:_i.test(t)?Ur:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(li,"i").test(t)?li:/(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(Pr).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)?Ar:Nr:new RegExp("(pda|"+Pr+")","i").test(t)?di:new RegExp(Fr,"i").test(t)&&!new RegExp(Fr+" pc","i").test(t)?vi:""},Ii=function(t,e){var r,i,n,s,o=Ti(t);return o===$r||o===Nr||"Kobo"===o||"Kindle Fire"===o||o===vi?Fr:o===ri||o===ni||o===ii||o===hi?"Console":o===qr?"Wearable":o?Pr:"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)?Pr:Fr:"Desktop"},Ei={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}},Ri=Ei.info;function Mi(t){if(br(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(ur(t))return{arrayValue:{values:t.map((t=>Mi(t)))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}function Oi(t){var e=[];for(var r in t){var i=t[r];pr(i)||dr(i)||e.push({key:r,value:Mi(i)})}return e}function Pi(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}function Li(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return Or&&r.length===Mr||(Mr=r.length,Or=r.reduce(((r,i)=>{Rr||(Rr={});var n=Rr[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,Rr[i]=[u,l];break}}return r}),{})),Or}}class Ai{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&&ur(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:Li(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 Fi="?";function Ni(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?Fi:r,in_app:!0};return dr(i)||(s.lineno=i),dr(n)||(s.colno=n),s}var $i=(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]:Fi,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Di=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,qi=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ji=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ui=(t,e)=>{var r=Di.exec(t);if(r){var[,i,n,s]=r;return Ni(e,i,Fi,+n,+s)}var o=qi.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=ji.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[u,l]=$i(o[1]||Fi,o[2]);return Ni(e,l,u,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Hi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Bi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,zi=(t,e)=>{var r=Hi.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Bi.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]||Fi;return[s,n]=$i(s,n),Ni(e,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Vi=/\(error: (.*)\)/,Wi=50;class Zi{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=vr(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 xr(t,"DOMException")}isDOMError(t){return xr(t,"DOMError")}}class Gi{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 Qi{constructor(){}match(t){return xr(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 Ji=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Yi{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(Ji);return i&&(e=i[1],r=i[2]),[e,r]}}var Ki=["fatal","error","warning","log","info","debug"];function Xi(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 tn{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 Sr(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: "+Xi(t)}isSeverityLevel(t){return vr(t)&&!fr(t)&&Ki.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 en{match(t){return Sr(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Xi(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class rn{match(t){return wr(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 nn{match(t){return xr(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Sr(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 wr(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 sn="$message",on="$timestamp",an=new Set([sn,on]),un={enabled:!0,max_bytes:32768};function ln(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:un.enabled,max_bytes:cn(t.max_bytes,un.max_bytes)}:r({},un)}class hn{constructor(t){this.Yt=[],this.Xt=0,this.qt=ln(t)}setConfig(t){this.qt=ln(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(!hr(r))return;var i=r,n=i[sn],s=i[on];if(!vr(n)||0===n.trim().length)return;if(!vr(s)&&!mr(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 cn(t,e){if(!mr(t)||t===1/0||t===-1/0)return e;var r=Math.floor(t);return 0>r?e:r}var dn="undefined"!=typeof window?window:void 0,vn="undefined"!=typeof globalThis?globalThis:dn;"undefined"==typeof self&&(vn.self=vn),"undefined"==typeof File&&(vn.File=function(){});var fn=null==vn?void 0:vn.navigator,pn=null==vn?void 0:vn.document,gn=null==vn?void 0:vn.location,mn=null==vn?void 0:vn.fetch,yn=null!=vn&&vn.XMLHttpRequest&&"withCredentials"in new vn.XMLHttpRequest?vn.XMLHttpRequest:void 0,bn=null==vn?void 0:vn.AbortController,_n=null==vn?void 0:vn.CompressionStream,wn=null==fn?void 0:fn.userAgent,xn=null!=dn?dn:{},Sn=t=>t instanceof Document,kn="1.373.2",Cn={DEBUG:!1,LIB_VERSION:kn,LIB_NAME:"web",JS_SDK_VERSION:kn},Tn=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={k(e){if(dn&&(Cn.DEBUG||xn.POSTHOG_DEBUG||r)&&!dr(dn.console)&&dn.console){for(var i=("__rrweb_original__"in dn.console[e]?dn.console[e].__rrweb_original__:dn.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)=>Tn(t+" "+e,r)};return i},In=Tn("[PostHog.js]"),En=In.createLogger;function Rn(t,e){ur(t)&&t.forEach(e)}function Mn(t,e){if(!gr(t))if(ur(t))t.forEach(e);else if(_r(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)or.call(t,r)&&e(t[r],r)}var On=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 Pn(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 Ln=function(t){try{return t()}catch(t){return}},An=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){In.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),In.critical(t)}}},Fn=function(t){var e={};return Mn(t,(function(t,r){(vr(t)&&t.length>0||mr(t))&&(e[r]=t)})),e};var Nn=["herokuapp.com","vercel.app","netlify.app"];function $n(t){var e=null==t?void 0:t.hostname;if(!vr(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of Nn)if(r===i)return!1;return!0}function Dn(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 qn(t){return"ph_toolbar_internal"===t.name}var jn=t=>{var e=null==pn?void 0:pn.createElement("a");return dr(e)?null:(e.href=t,e)},Un=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return Mn(t,(function(t,e){dr(t)||dr(e)||"undefined"===e||(r=encodeURIComponent(t instanceof File?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},Hn=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(!ur(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){In.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Bn=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("=");ur(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 Vn(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return lr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function Wn(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 Zn="$people_distinct_id",Gn="$device_id",Qn="__alias",Jn="__timers",Yn="$autocapture_disabled_server_side",Kn="$heatmaps_enabled_server_side",Xn="$exception_capture_enabled_server_side",ts="$error_tracking_suppression_rules",es="$error_tracking_capture_extension_exceptions",rs="$web_vitals_enabled_server_side",is="$dead_clicks_enabled_server_side",ns="$product_tours_enabled_server_side",ss="$web_vitals_allowed_metrics",os="$session_recording_remote_config",as="$replay_override_sampling",us="$replay_override_linked_flag",ls="$replay_override_url_trigger",hs="$replay_override_event_trigger",cs="$sesid",ds="$session_is_sampled",vs="$enabled_feature_flags",fs="$active_feature_flags",ps="$early_access_features",gs="$feature_flag_details",ms="$feature_flag_payloads",ys="$feature_flag_request_id",bs="$override_feature_flags",_s="$override_feature_flag_payloads",ws="$stored_person_properties",xs="$stored_group_properties",Ss="$surveys",ks="$surveys_activated",Cs="ph_product_tours",Ts="$flag_call_reported",Is="$flag_call_reported_session_id",Es="$feature_flag_errors",Rs="$feature_flag_evaluated_at",Ms="$user_state",Os="$client_session_props",Ps="$capture_rate_limit",Ls="$initial_campaign_params",As="$initial_referrer_info",Fs="$initial_person_info",Ns="$epp",$s="__POSTHOG_TOOLBAR__",Ds="$posthog_cookieless",qs="$sdk_debug_extensions_init_method",js="$sdk_debug_extensions_init_time_ms",Us="$sdk_debug_recording_script_not_loaded",Hs="PostHog loadExternalDependency extension not found.",Bs="on_reject",zs="always",Vs="anonymous",Ws="identified",Zs="identified_only",Gs="visibilitychange",Qs="beforeunload",Js="$pageview",Ys="$pageleave",Ks="$identify",Xs="$groupidentify",to=1,eo=3,ro=11;function io(t){return t instanceof Element&&(t.id===$s||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function no(t){return!!t&&t.nodeType===to}function so(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function oo(t){return!!t&&t.nodeType===eo}function ao(t){return!!t&&t.nodeType===ro&&no(t.host)}function uo(t){return t?ir(t).split(/\s+/):[]}function lo(t){var e=null==dn?void 0:dn.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function ho(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 uo(e)}function co(t){return gr(t)?null:ir(t).split(/(\s+)/).filter((t=>Mo(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function vo(t){var e="";return xo(t)&&!So(t)&&t.childNodes&&t.childNodes.length&&Mn(t.childNodes,(function(t){var r;oo(t)&&t.textContent&&(e+=null!==(r=co(t.textContent))&&void 0!==r?r:"")})),ir(e)}function fo(t){return dr(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var po=["a","button","form","input","select","textarea","label"];function go(t,e){if(dr(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 mo(t){var e=t.parentNode;return!(!e||!no(e))&&e}var yo=["next","previous","prev",">","<"],bo=[".ph-no-rageclick",".ph-no-capture"];var _o=t=>!t||so(t,"html")||!no(t),wo=(t,e)=>{if(!dn||_o(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!so(n,"body");)if(ao(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=mo(n);if(!s)break;if(e||po.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=dn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function xo(t){for(var e=t;e.parentNode&&!so(e,"body");e=e.parentNode){var r=ho(e);if(rr(r,"ph-sensitive")||rr(r,"ph-no-capture"))return!1}if(rr(ho(t),"ph-include"))return!0;var i=t.type||"";if(vr(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!vr(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 So(t){return!!(so(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||so(t,"select")||so(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var ko="(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})",Co=new RegExp("^(?:"+ko+")$"),To=new RegExp(ko),Io="\\d{3}-?\\d{2}-?\\d{4}",Eo=new RegExp("^("+Io+")$"),Ro=new RegExp("("+Io+")");function Mo(t,e){if(void 0===e&&(e=!0),gr(t))return!1;if(vr(t)){if(t=ir(t),(e?Co:To).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Eo:Ro).test(t))return!1}return!0}function Oo(t){var e=vo(t);return Mo(e=(e+" "+Po(t)).trim())?e:""}function Po(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Mn(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=vo(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Po(t)).trim())}catch(t){In.error("[AutoCapture]",t)}})),e}function Lo(t){return t.replace(/"|\\"/g,'\\"')}function Ao(t){var e=t.attr__class;return e?ur(e)?e:uo(e):void 0}var Fo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn: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"]},No=En("[Recorder]"),$o=t=>"navigation"===t.entryType,Do=t=>"resource"===t.entryType;function qo(t,e){return!!e&&(br(e)||e[t])}function jo(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(br(r))return!0;if(ur(r))return s(r);var o=r[e];return br(o)?o:s(o)}function Uo(t,e,r,i,n,s){return Ho.apply(this,arguments)}function Ho(){return Ho=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return No.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(Do(o=t[s])&&o.initiatorType===e&&(dr(i)||o.startTime>=i)&&(dr(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*s))),Uo(t,e,r,i,n,s+1))})),Ho.apply(this,arguments)}function Bo(t){var{body:e,options:r,url:i}=t;if(gr(e))return null;var{hostname:n,isHostDenied:s}=Wn(i,r);if(s)return n+" is in deny list";if(vr(e))return e;if(Sn(e))return e.textContent;if(_r(e))return Un(e);if(hr(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 zo=t=>!pr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Vo(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:dr(a)?void 0:Math.round(a),endTime:dr(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(zo(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 Wo=["video/","audio/"];function Zo(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 Go(){return Go=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:s}=Wn(i,r);return s?Promise.resolve(n+" is in deny list"):Zo(e)})),Go.apply(this,arguments)}function Qo(){return Qo=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=Wo.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:u}=Wn(n,i);return u?a+" is in deny list":null}({r:e,options:r,url:i});return pr(n)?Zo(e):Promise.resolve(n)})),Qo.apply(this,arguments)}var Jo=null;function Yo(t,i,n){if(!("performance"in i))return()=>{};if(Jo)return No.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Fo,n):Fo,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=>$o(t)||Do(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>Vo({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=>$o(t)||Do(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>Vo({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=qo("request",r.recordHeaders),n=qo("response",r.recordHeaders),s=Vn(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=>(jo({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=Bo({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),jo({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=Bo({body:v.response,options:r,url:a})),Uo(e,"xmlhttprequest",f.url,c,d).then((e=>{var r=Vo({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=qo("request",i.recordHeaders),s=qo("response",i.recordHeaders),o=Vn(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),jo({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(d.requestBody=yield function(t){return Go.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),jo({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(d.responseBody=yield function(t){return Qo.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{Uo(r,"fetch",c.url,l,h).then((e=>{var r,i=Vo({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)),Jo=()=>{a(),u(),l(),Jo=null}}var Ko=t=>({name:"rrweb/network@1",observer:Yo,options:t});xn.__PosthogExtensions__=xn.__PosthogExtensions__||{},xn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:We,getRecordNetworkPlugin:Ko},xn.__PosthogExtensions__.rrweb={record:Me,version:"v2",wasMaxDepthReached:()=>ht,resetMaxDepthState(){ht=!1,lt=!1}},xn.rrweb={record:Me,version:"v2"},xn.rrwebConsoleRecord={getRecordConsolePlugin:We},xn.getRecordNetworkPlugin=Ko;var Xo,ta,ea,ra,ia,na,sa,oa,aa,ua,la,ha,ca={},da=[],va=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,fa=Array.isArray;function pa(t,e){for(var r in e)t[r]=e[r];return t}function ga(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function ma(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?Xo.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 ya(t,o,i,n,null)}function ya(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?++ea:n,__i:-1,__u:0};return null==n&&null!=ta.vnode&&ta.vnode(s),s}function ba(t){return t.children}function _a(t,e){this.props=t,this.context=e}function wa(t,e){if(null==e)return t.__?wa(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?wa(t):null}function xa(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 xa(t)}}function Sa(t){(!t.__d&&(t.__d=!0)&&ra.push(t)&&!$.__r++||ia!=ta.debounceRendering)&&((ia=ta.debounceRendering)||na)($)}function $(){for(var t,e,r,i,n,s,o,a=1;ra.length;)ra.length>a&&ra.sort(sa),t=ra.shift(),a=ra.length,t.__d&&(r=void 0,i=void 0,n=(i=(e=t).__v).__e,s=[],o=[],e.__P&&((r=pa({},i)).__v=i.__v+1,ta.vnode&&ta.vnode(r),Ma(e.__P,r,i,e.__n,e.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?wa(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,Pa(s,r,o),i.__e=i.__=null,r.__e!=n&&xa(r)));$.__r=0}function ka(t,e,r,i,n,s,o,a,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||da,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]=ya(null,o,null,null,null):fa(o)?o=t.__k[s]=ya(ba,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=ya(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=Ta(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=wa(a)),Fa(a,a));return i}(r,e,y,u,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1==v.__i?ca:y[v.__i]||ca,v.__i=c,g=Ma(t,v,d,n,s,o,a,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Aa(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=Ca(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 Ca(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=Ca(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=wa(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Ta(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 Ia(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||va.test(e)?r:r+"px"}function Ea(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||Ia(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||Ia(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(oa,"$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=aa,t.addEventListener(e,s?la:ua,s)):t.removeEventListener(e,s?la:ua,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 Ra(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e.t)e.t=aa++;else if(r.u>e.t)return;return r(ta.event?ta.event(e):e)}}}function Ma(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=ta.__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 _a(m,_),c.constructor=T,c.render=Na),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=pa({},c.__s)),pa(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=ta.__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=pa(pa({},i),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),k=h,null!=h&&h.type===ba&&null==h.key&&(k=La(h.props.children)),a=ka(t,fa(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--;)ga(s[C]);Oa(e)}else e.__e=r.__e,e.__k=r.__k,t.then||Oa(e);ta.__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||ca,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&&(ta.__m&&ta.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s=s&&Xo.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;Ea(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||Ea(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=""),ka("template"==e.type?t.content:t,fa(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&wa(r,0),a,u),null!=s)for(l=s.length;l--;)ga(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])&&Ea(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&Ea(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,s,o,u,l);return(h=ta.diffed)&&h(e),128&e.__u?void 0:a}function Oa(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Oa)}function Pa(t,e,r){for(var i=0;r.length>i;i++)Aa(r[i],r[++i],r[++i]);ta.__c&&ta.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ta.__e(t,e.__v)}}))}function La(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:fa(t)?t.map(La):pa({},t)}function Aa(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){ta.__e(t,r)}}function Fa(t,e,r){var i,n;if(ta.unmount&&ta.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Aa(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ta.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(n=0;i.length>n;n++)i[n]&&Fa(i[n],e,r||"function"!=typeof t.type);r||ga(t.__e),t.__c=t.__=t.__e=void 0}function Na(t,e,r){return this.constructor(t,r)}function $a(t,e,r){var i,n,s;e==document&&(e=document.documentElement),ta.__&&ta.__(t,e),i=e.__k,n=[],s=[],Ma(e,t=e.__k=ma(ba,null,[t]),i||ca,ca,e.namespaceURI,i?null:e.firstChild?Xo.call(e.childNodes):null,n,i?i.__e:e.firstChild,!1,s),Pa(n,t,s)}Xo=da.slice,ta={__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}},ea=0,_a.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=pa({},this.state),"function"==typeof t&&(t=t(pa({},r),this.props)),t&&pa(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),Sa(this))},_a.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Sa(this))},_a.prototype.render=ba,ra=[],na="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,sa=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,oa=/(PointerCapture)$|Capture$/i,aa=0,ua=Ra(!1),la=Ra(!0),ha=0;var Da,qa,ja,Ua,Ha=0,Ba=[],za=ta,Va=za.__b,Wa=za.__r,Za=za.diffed,Ga=za.__c,Qa=za.unmount,Ja=za.__;function Ya(t,e){za.__h&&za.__h(qa,t,Ha||e),Ha=0;var r=qa.__H||(qa.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function Ka(t){return Ha=1,function(t,e,r){var i=Ya(Da++,2);if(i.t=t,!i.__c&&(i.__=[lu(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=qa,!qa.__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};qa.__f=!0;var s=qa.shouldComponentUpdate,o=qa.componentWillUpdate;qa.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)},qa.shouldComponentUpdate=n}return i.__N||i.__}(lu,t)}function Xa(t,e){var r=Ya(Da++,3);!za.__s&&uu(r.__H,e)&&(r.__=t,r.u=e,qa.__H.__h.push(r))}function tu(t){return Ha=5,eu((function(){return{current:t}}),[])}function eu(t,e){var r=Ya(Da++,7);return uu(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function ru(t){var e=qa.context[t.__c],r=Ya(Da++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(qa)),e.props.value):t.__}function iu(){for(var t;t=Ba.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ou),t.__H.__h.forEach(au),t.__H.__h=[]}catch(e){t.__H.__h=[],za.__e(e,t.__v)}}za.__b=function(t){qa=null,Va&&Va(t)},za.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Ja&&Ja(t,e)},za.__r=function(t){Wa&&Wa(t),Da=0;var e=(qa=t.__c).__H;e&&(ja===qa?(e.__h=[],qa.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach(ou),e.__h.forEach(au),e.__h=[],Da=0)),ja=qa},za.diffed=function(t){Za&&Za(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Ba.push(e)&&Ua===za.requestAnimationFrame||((Ua=za.requestAnimationFrame)||su)(iu)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),ja=qa=null},za.__c=function(t,e){e.some((function(t){try{t.__h.forEach(ou),t.__h=t.__h.filter((function(t){return!t.__||au(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],za.__e(r,t.__v)}})),Ga&&Ga(t,e)},za.unmount=function(t){Qa&&Qa(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{ou(t)}catch(t){e=t}})),r.__H=void 0,e&&za.__e(e,r.__v))};var nu="function"==typeof requestAnimationFrame;function su(t){var e,r=function(){clearTimeout(i),nu&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);nu&&(e=requestAnimationFrame(r))}function ou(t){var e=qa,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),qa=e}function au(t){var e=qa;t.__c=t.__(),qa=e}function uu(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function lu(t,e){return"function"==typeof e?e(t):e}var hu={Activation:"events",Cancellation:"cancelEvents"},cu={Button:"button",Tab:"tab",Selector:"selector"},du={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"},vu={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},fu={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},pu={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},gu={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},mu={Once:"once",Recurring:"recurring",Always:"always"},yu={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},bu={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"},_u={Popover:"popover",Inline:"inline"};function wu(t){return"$survey_response_"+t}function xu(t,e){if(!e)return null;var r=t[wu(e)];return ur(r)?[...r]:r}function Su(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!dr(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=xu(t,e.id);dr(s)||(i[n]=s)}})),r({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:xu(t,e.id)})))},t,i)}function ku(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 Cu(t){return"string"==typeof t&&t.trim()?t.trim():null}function Tu(t){return t.toLowerCase()}function Iu(t,e,r){if(!t||!e)return null;var i=Tu(e),n=Object.keys(t).find((t=>Tu(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=>Tu(t)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}function Eu(t,e,i){var n,s=Iu(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),dr(l.name)||(o.name=l.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),dr(l.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=l.thankYouMessageHeader,a=!0),dr(l.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=l.thankYouMessageDescription,a=!0),dr(l.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=l.thankYouMessageCloseButtonText,a=!0)):function(t){return!dr(t.thankYouMessageHeader)||!dr(t.thankYouMessageDescription)||!dr(t.thankYouMessageCloseButtonText)}(l)&&(a=!0))}var h=t.questions.map((t=>function(t,e,i){var n,s=Iu(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 dr(o.question)||(a.question=o.question,u=!0),dr(o.description)||(a.description=o.description,u=!0),dr(o.buttonText)||(a.buttonText=o.buttonText,u=!0),"link"in a&&!dr(o.link)&&(a.link=o.link,u=!0),"lowerBoundLabel"in a&&!dr(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,u=!0),"upperBoundLabel"in a&&!dr(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,u=!0),"choices"in a&&function(t){return ur(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 Ru=En("[Surveys]");function Mu(t){return!(!t.start_date||t.end_date)}function Ou(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Pu(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Lu="seenSurvey_",Au="inProgressSurvey_",Fu=(t,e)=>{var r=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(r=""+t+e.id+"_"+e.current_iteration),r},Nu=t=>Fu(Lu,t),$u=t=>{try{var e=Nu(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Ru.error("Failed to persist survey seen state",t)}},Du=[fu.Popover,fu.Widget,fu.API],qu={ignoreConditions:!1,ignoreDelay:!1,displayType:_u.Popover};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return mr(t)&&isFinite(t)&&Math.floor(t)===t});class ju{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 ju(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 ju(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 Uu{constructor(){this.S=0,this.C=0,this.I=new zu}generate(){var t=this.generateOrAbort();if(dr(t)){this.S=0;var e=this.generateOrAbort();if(dr(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 ju.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 Hu,Bu=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};dn&&!dr(dn.crypto)&&crypto.getRandomValues&&(Bu=t=>crypto.getRandomValues(t));class zu{constructor(){this.M=new Uint32Array(8),this.O=1/0}nextUint32(){return this.M.length>this.O||(Bu(this.M),this.O=0),this.M[this.O++]}}var Vu=()=>Wu().toString(),Wu=()=>(Hu||(Hu=new Uu)).generate(),Zu=["fatal","error","warning","log","info","debug"],Gu={GZipJS:"gzip-js",Base64:"base64"},Qu=Uint8Array,Ju=Uint16Array,Yu=Uint32Array,Ku=new Qu([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]),Xu=new Qu([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]),tl=new Qu([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),el=function(t,e){for(var r=new Ju(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new Yu(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]},rl=el(Ku,2),il=rl[1];rl[0][28]=258,il[258]=28;for(var nl=el(Xu,0)[1],sl=new Ju(32768),ol=0;32768>ol;++ol){var al=(43690&ol)>>>1|(21845&ol)<<1;sl[ol]=((65280&(al=(61680&(al=(52428&al)>>>2|(13107&al)<<2))>>>4|(3855&al)<<4))>>>8|(255&al)<<8)>>>1}var ul=function(t,e,r){for(var i=t.length,n=0,s=new Ju(e);i>n;++n)++s[t[n]-1];var o,a=new Ju(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Ju(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[sl[c]>>>u]=l}else for(o=new Ju(i),n=0;i>n;++n)o[n]=sl[a[t[n]-1]++]>>>15-t[n];return o},ll=new Qu(288);for(ol=0;144>ol;++ol)ll[ol]=8;for(ol=144;256>ol;++ol)ll[ol]=9;for(ol=256;280>ol;++ol)ll[ol]=7;for(ol=280;288>ol;++ol)ll[ol]=8;var hl=new Qu(32);for(ol=0;32>ol;++ol)hl[ol]=5;var cl=ul(ll,9,0),dl=ul(hl,5,0),vl=function(t){return(t/8>>0)+(7&t&&1)},fl=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof Ju?Ju:t instanceof Yu?Yu:Qu)(r-e);return i.set(t.subarray(e,r)),i},pl=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},gl=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},ml=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 Qu(0),0];if(1==n){var o=new Qu(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 Ju(d+1),f=yl(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 Qu(v),f]},yl=function(t,e,r){return-1==t.s?Math.max(yl(t.l,e,r+1),yl(t.r,e,r+1)):e[t.s]=r},bl=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Ju(++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]},_l=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},wl=function(t,e,r){var i=r.length,n=vl(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)},xl=function(t,e,r,i,n,s,o,a,u,l,h){pl(e,h++,r),++n[256];for(var c=ml(n,15),d=c[0],v=c[1],f=ml(s,15),p=f[0],g=f[1],m=bl(d),y=m[0],b=m[1],_=bl(p),w=_[0],x=_[1],S=new Ju(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=ml(S,7),T=C[0],I=C[1],E=19;E>4&&!T[tl[E-1]];--E);var R,M,O,P,L=l+5<<3,A=_l(n,ll)+_l(s,hl)+o,F=_l(n,d)+_l(s,p)+o+14+3*E+_l(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(A>=L&&F>=L)return wl(e,h,t.subarray(u,u+l));if(pl(e,h,1+(A>F)),h+=2,A>F){R=ul(d,v,0),M=d,O=ul(p,g,0),P=p;var N=ul(T,I,0);for(pl(e,h,b-257),pl(e,h+5,x-1),pl(e,h+10,E-4),h+=14,k=0;E>k;++k)pl(e,h+3*k,T[tl[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)pl(e,h,N[U=31&j[k]]),h+=T[U],U>15&&(pl(e,h,j[k]>>>5&127),h+=j[k]>>>12)}}else R=cl,M=ll,O=dl,P=hl;for(k=0;a>k;++k)if(i[k]>255){var U;gl(e,h,R[257+(U=i[k]>>>18&31)]),h+=M[U+257],U>7&&(pl(e,h,i[k]>>>23&31),h+=Ku[U]);var H=31&i[k];gl(e,h,O[H]),h+=P[H],H>3&&(gl(e,h,i[k]>>>5&8191),h+=Xu[H])}else gl(e,h,R[i[k]]),h+=M[i[k]];return gl(e,h,R[256]),h+M[256]},Sl=new Yu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),kl=function(){for(var t=new Yu(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Cl=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Tl(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=kl[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 Qu(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=wl(u,l,t.subarray(h,c)):(u[h]=!0,l=wl(u,l,t.subarray(h,o)))}else{for(var d=Sl[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new Ju(32768),m=new Ju(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 Yu(25e3),x=new Ju(288),S=new Ju(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=xl(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|il[A]<<18|nl[F];var Z=31&il[A],G=31&nl[F];C+=Ku[Z]+Xu[G],++x[257+Z],++S[G],I=h+A,++k}else w[T++]=t[h],++x[t[h]]}}l=xl(t,u,!0,w,x,S,C,T,E,h-E,l)}return fl(a,0,i+vl(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&&Cl(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),Cl(u,l-8,r.d()),Cl(u,l-4,i),u}var Il=!!yn||!!mn,El="text/plain",Rl=!1,Ml=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=Un(a);return l&&u.push(l),s+"?"+u.join("&")},Ol=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Pl=t=>{if(t.tr)return t.tr;var{data:e,compression:r}=t;if(e){if(r===Gu.GZipJS){var i=Tl(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new Qu(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 Qu(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 fl(i,0,n)}(Ol(e)),{mtime:0});return{contentType:El,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===Gu.Base64){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Ol(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Ol(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Ol(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Ll=function(){var t=e((function*(t){var e=Ol(t.data),i=yield function(t,e,r){return Ye.apply(this,arguments)}(e,Cn.DEBUG,{rethrow:!0});if(!i)return t;var n=yield i.arrayBuffer();return r({},t,{tr:{contentType:El,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),Al=(t,e)=>Ml(t,{_:(new Date).getTime().toString(),ver:Cn.JS_SDK_VERSION,compression:e}),Fl=[];mn&&Fl.push({transport:"fetch",method(t){var e,i,{contentType:n,body:s,estimatedSize:o}=null!==(e=Pl(t))&&void 0!==e?e:{},a=new Headers;Mn(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var u=t.url,l=null;if(bn){var h=new bn;l={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}mn(u,r({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&52428.8>(o||0),body:s,signal:null==(i=l)?void 0:i.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){In.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{In.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>l?clearTimeout(l.timeout):null))}}),yn&&Fl.push({transport:"XHR",method(t){var e,r=new yn;r.open(t.method||"GET",t.url,!0);var{contentType:i,body:n}=null!==(e=Pl(t))&&void 0!==e?e:{};Mn(t.headers,(function(t,e){r.setRequestHeader(e,t)})),i&&r.setRequestHeader("Content-Type",i),t.timeout&&(r.timeout=t.timeout),t.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var e={statusCode:r.status,text:r.responseText};if(200===r.status)try{e.json=JSON.parse(r.responseText)}catch(t){}null==t.callback||t.callback(e)}},r.send(n)}}),null!=fn&&fn.sendBeacon&&Fl.push({transport:"sendBeacon",method(t){var e=Ml(t.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Pl(t))&&void 0!==r?r:{};if(!n)return;var s=n instanceof Blob?n:new Blob([n],{type:i});fn.sendBeacon(e,s)}catch(t){}}});var Nl=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 $l(t,e,r){return Ol({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var Dl={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=>Nl(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Nl(e,t))))),icontains:(t,e)=>e.map(ql).some((e=>t.map(ql).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(ql).every((e=>t.map(ql).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)))}))},ql=t=>t.toLowerCase();function jl(t,e){return!t||Object.entries(t).every((t=>{var[r,i]=t,n=null==e?void 0:e[r];if(dr(n)||pr(n))return!1;var s=[String(n)],o=Dl[i.operator];return!!o&&o(i.values,s)}))}var Ul="",Hl=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Bl={R:()=>!!pn,D(t){In.error("cookieStore error: "+t)},A(t){if(pn){try{for(var e=t+"=",r=pn.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(Bl.A(t))||{}}catch(t){}return e},N(t,e,r,i,n){if(pn)try{var s="",o="",a=function(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=pn),Ul)return Ul;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_"+Vu();!Ul&&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",Ul=s)}return Ul}(t);if(!r){var i=(t=>{var e=t.match(Hl);return e?e[0]:""})(t);i!==r&&In.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(pn.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&&In.warn("cookieStore warning: large cookie, len="+l.length),pn.cookie=l,l}catch(t){return}},q(t,e){if(null!=pn&&pn.cookie)try{Bl.N(t,"",-1,e)}catch(t){return}}},zl=null,Vl={R(){if(!pr(zl))return zl;var t=!0;if(dr(dn))t=!1;else try{var e="__mplssupport__";Vl.N(e,"xyz"),'"xyz"'!==Vl.A(e)&&(t=!1),Vl.q(e)}catch(e){t=!1}return t||In.error("localStorage unsupported; falling back to cookie store"),zl=t,t},D(t){In.error("localStorage error: "+t)},A(t){try{return null==dn?void 0:dn.localStorage.getItem(t)}catch(t){Vl.D(t)}return null},F(t){try{return JSON.parse(Vl.A(t))||{}}catch(t){}return null},N(t,e){try{null==dn||dn.localStorage.setItem(t,JSON.stringify(e))}catch(t){Vl.D(t)}},q(t){try{null==dn||dn.localStorage.removeItem(t)}catch(t){Vl.D(t)}}},Wl=[Gn,"distinct_id",cs,ds,Ns,Fs,Ms],Zl={},Gl={R:()=>!0,D(t){In.error("memoryStorage error: "+t)},A:t=>Zl[t]||null,F:t=>Zl[t]||null,N(t,e){Zl[t]=e},q(t){delete Zl[t]}},Ql=null,Jl={R(){if(!pr(Ql))return Ql;if(Ql=!0,dr(dn))Ql=!1;else try{var t="__support__";Jl.N(t,"xyz"),'"xyz"'!==Jl.A(t)&&(Ql=!1),Jl.q(t)}catch(t){Ql=!1}return Ql},D(t){In.error("sessionStorage error: ",t)},A(t){try{return null==dn?void 0:dn.sessionStorage.getItem(t)}catch(t){Jl.D(t)}return null},F(t){try{return JSON.parse(Jl.A(t))||null}catch(t){}return null},N(t,e){try{null==dn||dn.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){Jl.D(t)}},q(t){try{null==dn||dn.sessionStorage.removeItem(t)}catch(t){Jl.D(t)}}},Yl=En("[Stylesheet Loader]"),Kl=dn,Xl=pn,th="#020617",eh={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:du.Right,widgetType:cu.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:th,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},rh=[du.Center,du.Left,du.Right];function ih(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 nh(t){var e;void 0===t&&(t=eh.backgroundColor),"#"===t[0]&&(e=ih(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=ih(r)),!e)return th;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?th:"white"}return th}var sh=(t,e,i)=>{var n=Sh(t),s=Xl.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=Xl.createElement("div");((t,e,i)=>{var n=r({},eh,i),s=t.style,o=!rh.includes(n.position)||e===fu.Widget&&(null==i?void 0:i.widgetType)===cu.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)||nh(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",nh(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||nh(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",nh(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)||nh(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=Xl.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||(Yl.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 Xl.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},oh=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a,surveyLanguage:u}=t;s?($u(i),s.capture(yu.SENT,r({[bu.SURVEY_NAME]:i.name,[bu.SURVEY_ID]:i.id,[bu.SURVEY_ITERATION]:i.current_iteration,[bu.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[bu.SURVEY_SUBMISSION_ID]:n,[bu.SURVEY_COMPLETED]:o},u&&{[bu.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},Su(e,i),a,{$set:{[ku(i,"responded")]:!0}})),o&&(Kl.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),xh(i))):Ru.error("[survey sent] event not captured, PostHog instance not found.")},ah=(t,e,i)=>{return r({[bu.SURVEY_NAME]:t.name,[bu.SURVEY_ID]:t.id,[bu.SURVEY_ITERATION]:t.current_iteration,[bu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[bu.SURVEY_PARTIALLY_COMPLETED]:(n=null==e?void 0:e.responses,void 0===n&&(n={}),Object.values(n).some((t=>!gr(t))))},(null==e?void 0:e.surveyLanguage)&&{[bu.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[bu.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},Su(null==e?void 0:e.responses,t));var n},uh=(t,e,i,n)=>{if(e){if(!i){var s=_h(t);e.capture(yu.DISMISSED,r({},ah(t,s,e),n&&{[bu.SURVEY_LANGUAGE]:n},{$set:{[ku(t,"dismissed")]:!0}})),xh(t),$u(t),Kl.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Ru.error("[survey dismissed] event not captured, PostHog instance not found.")},lh=(t,e)=>{if(e){var r=(t=>Fu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=_h(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(yu.ABANDONED,ah(t,i,e),{transport:"sendBeacon"})}}else Ru.error("[survey abandoned] event not captured, PostHog instance not found.")},hh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),ch=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,dh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?ch(t.questions,hh(t.questions)):t.questions,vh=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===mu.Always||wh(t)},fh=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,Sa(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"+ha++,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}),ph=()=>ru(fh),gh=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return function(t,e,r){var i,n,s,o,a=pa({},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?Xo.call(arguments,2):r),ya(t.type,a,i||t.key,n||t.ref,null)}(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function mh(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==Kl||null==(r=Kl.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 Dl[o](s,[n])}var yh=t=>{var e=""+Au+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Au+t.id+"_"+t.current_iteration),e},bh=(t,e)=>{try{localStorage.setItem(yh(t),JSON.stringify(e))}catch(t){Ru.error("Error setting in-progress survey state in localStorage",t)}},_h=t=>{try{var e=localStorage.getItem(yh(t));if(e)return JSON.parse(e)}catch(t){Ru.error("Error getting in-progress survey state from localStorage",t)}return null},wh=t=>{var e=_h(t);return!gr(null==e?void 0:e.surveySubmissionId)},xh=t=>{try{localStorage.removeItem(yh(t))}catch(t){Ru.error("Error clearing in-progress survey state from localStorage",t)}};function Sh(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function kh(t,e,r){if(void 0===e&&(e=du.Right),t===fu.ExternalSurvey)return{};switch(e){case du.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case du.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case du.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case du.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case du.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case du.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case du.Left:return{left:"30px"};case du.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===fu.Widget&&r===cu.Tab?"60px":"30px"}}}var Ch=0;function Th(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:--Ch,__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 ta.vnode&&ta.vnode(l),l}var Ih=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Eh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Rh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Mh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Oh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Ph=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Th("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"})}),Lh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Th("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"})}),Ah=function(t){var{fill:e="currentColor"}=void 0===t?{}:t;return Th("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:[Th("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Th("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})]})},Fh=Th("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Th("g",{"clip-path":"url(#clip0_2415_6911)",children:[Th("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Th("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Th("g",{mask:"url(#mask0_2415_6911)",children:[Th("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"}),Th("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"}),Th("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"}),Th("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"}),Th("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"}),Th("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"})]})]}),Th("defs",{children:Th("clipPath",{id:"clip0_2415_6911",children:Th("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Nh(t){var{urlParams:e}=t,r=e?Object.entries(e).map((t=>{var[e,r]=t;return encodeURIComponent(e)+"="+encodeURIComponent(r)})).join("&"):"";return Th("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Fh]})}function $h(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=t,{isPreviewMode:u}=ru(fh);return Th("div",{className:"bottom-section",children:[!a&&Th("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==dn||dn.open(s)),u?null==o||o():n()},children:e}),!i.whiteLabel&&Th(Nh,{urlParams:{utm_source:"survey-footer"}})]})}function Dh(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return Th("div",{class:"question-header",children:[Th(e.type===pu.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&gh({component:ma("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function qh(t){var{onClick:e}=t,{isPreviewMode:r}=ru(fh);return Th("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:Ah({fill:"black"})})}Th("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Th("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 jh=dn;function Uh(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=t,{isPopup:a}=ru(fh);return Xa((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Dn(jh,"keydown",t),()=>{jh.removeEventListener("keydown",t)}}),[o]),Th("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Th(qh,{onClick:()=>o()}),Th("h3",{className:"thank-you-message-header",children:e}),r&&gh({component:ma("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Th($h,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Hh=t=>ur(t)&&t.every((t=>vr(t)));function Bh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=t,{isPreviewMode:u}=ph(),l=tu(null),[h,c]=Ka((()=>vr(a)?a:""));Xa((()=>{setTimeout((()=>{var t;u||null==(t=l.current)||t.focus()}),100)}),[u]);var d="surveyQuestion"+o,v=eu((()=>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 tr.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 tr.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=Pi(e.validation,tr.MinLength),p=Pi(e.validation,tr.MaxLength),g=eu((()=>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]);return Th(ba,{children:[Th("div",{className:"question-container",children:[Th(Dh,{question:e,forceDisableHtml:r,htmlFor:d}),Th("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()},value:h}),g&&Th("div",{className:"validation-hint",children:g})]}),Th($h,{text:e.buttonText||"Submit",submitDisabled:!!v,appearance:i,onSubmit(){v||n(h.trim())},onPreviewSubmit(){v||s(h.trim())}})]})}function zh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=t;return Th(ba,{children:[Th("div",{className:"question-container",children:Th(Dh,{question:e,forceDisableHtml:r})}),Th($h,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function Vh(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]=Ka((()=>mr(u)?u:ur(u)&&u.length>0&&mr(parseInt(u[0]))?parseInt(u[0]):vr(u)&&mr(parseInt(u))?parseInt(u):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=ph(),p=t=>f?a(t):o(t);return Th(ba,{children:[Th("div",{className:"question-container",children:[Th(Dh,{question:r,forceDisableHtml:i}),Th("div",{className:"rating-section",children:[Th("div",{className:"rating-options",children:["emoji"===r.display&&Th("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(e=Yh[r.scale])?void 0:e.map(((t,e)=>Th("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&&Th("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-h+1)+", minmax(0, 1fr))"},children:Kh(r.scale).map(((t,e)=>Th(Wh,{displayQuestionIndex:n,active:c===t,appearance:s,num:t,setActiveNumber(t){d(t),r.skipSubmitButton&&p(t)}},e)))})]}),!v&&Th("div",{className:"rating-text",children:[Th("div",{children:r.lowerBoundLabel}),Th("div",{children:r.upperBoundLabel})]})]})]}),Th($h,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:pr(c)&&!r.optional,appearance:s,onSubmit:()=>o(c),onPreviewSubmit:()=>a(c),skipSubmitButton:r.skipSubmitButton})]})}function Wh(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return Th("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick(){n(e)},children:e})}function Zh(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l=tu(null),h=eu((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=ch(e,hh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[c,d]=Ka((()=>((t,e)=>vr(t)||Hh(t)?t:e===pu.SingleChoice?null:[])(u,e.type))),[v,f]=Ka((()=>((t,e)=>{if(vr(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Hh(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,h))),{isPreviewMode:p}=ph(),g=e.type===pu.SingleChoice,m=e.type===pu.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&&ur(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||!pr(c)&&(!ur(c)||v.isSelected||0!==c.length)&&(!v.isSelected||""!==v.inputValue.trim())),S=()=>{v.isSelected&&m?ur(c)&&(p?a([...c,v.inputValue]):o([...c,v.inputValue])):p?a(c):o(c)};return Th(ba,{children:[Th("div",{className:"question-container",children:[Th(Dh,{question:e,forceDisableHtml:i}),Th("fieldset",{className:"multiple-choice-options limit-height",children:[Th("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:ur(c)&&c.includes(t);return Th("label",{className:i?"choice-option-open":"",children:[Th("div",{className:"response-choice",children:[Th("input",{type:g?"radio":"checkbox",name:s,checked:a,onChange:()=>b(t,i),id:s,"aria-controls":o}),Th("span",{children:i?t+":":t})]}),i&&Th("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)}))]})]}),Th($h,{text:e.buttonText||"Submit",submitDisabled:x(),appearance:s,onSubmit:S,onPreviewSubmit:S,skipSubmitButton:y})]})}var Gh=[1,2,3,4,5],Qh=[1,2,3,4,5,6,7],Jh=[0,1,2,3,4,5,6,7,8,9,10],Yh={2:[Ph,Lh],3:[Rh,Eh,Ih],5:[Mh,Rh,Eh,Ih,Oh]};function Kh(t){switch(t){case 5:default:return Gh;case 7:return Qh;case 10:return Jh}}var Xh=En("[Surveys]");function tc(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?gu.End:s;if(n.branching.type===gu.End)return gu.End;if(n.branching.type===gu.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===gu.ResponseBased){if(n.type===pu.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===gu.End?gu.End:s}}else if(n.type===pu.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===gu.End?gu.End:s}}return s}return Xh.warn("Falling back to next question index due to unexpected branching type"),s}var ec="https?://(.*)",rc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ic=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...rc],nc="<masked>",sc=["li_fat_id"];function oc(t,e,r){if(!pn)return{};var i,n=e?[...rc,...r||[]]:[],s=ac(Bn(pn.URL,n,nc),t),o=(i={},Mn(sc,(function(t){var e=Bl.A(t);i[t]=e||null})),i);return On(o,s)}function ac(t,e){var r=ic.concat(e||[]),i={};return Mn(r,(function(e){var r=Hn(t,e);i[e]=r||null})),i}function uc(t){var e=function(t){return t?0===t.search(ec+"google.([^/?]*)")?"google":0===t.search(ec+"bing.com")?"bing":0===t.search(ec+"yahoo.com")?"yahoo":0===t.search(ec+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!pr(e)){i.$search_engine=e;var n=pn?Hn(pn.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function lc(){return navigator.language||navigator.userLanguage}var hc="$direct";function cc(){return(null==pn?void 0:pn.referrer)||hc}function dc(t,e){var r=t?[...rc,...e||[]]:[],i=null==gn?void 0:gn.href.substring(0,1e3);return{r:cc().substring(0,1e3),u:i?Bn(i,r,nc):void 0}}function vc(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:r==hc?hc:null==(e=jn(r))?void 0:e.host};if(i){n.$current_url=i;var s=jn(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=ac(i);On(n,o)}if(r){var a=uc(r);On(n,a)}return n}function fc(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function pc(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var gc=En("[SurveyTranslations]");function mc(t,e){var r=function(t){return function(t,e){var{overrideLanguage:r,storedPersonProperties:i,locale:n}=t,s=Cu(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?Cu(t.language):null}(i);if(o)return null==e||e.info("Using person property language: "+o),o;var a=Cu(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:lr(t.get_property)?t.get_property(ws):void 0,locale:lc()},gc)}(e);if(!r)return gc.info("No user language detected"),{survey:t,language:null};var i=Eu(t,r,gc);return{survey:i.survey,language:i.matchedKey}}var yc=dn,bc=pn,_c="ph:show_survey_widget",wc="PHWidgetSurveyClickListener";function xc(t,e){try{var r=t.getBoundingClientRect(),i=yc.innerHeight,n=yc.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:eh.zIndex}}catch(t){return Ru.warn("Failed to calculate trigger position:",t),null}}class Sc{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(Ss);if(t)for(var e of t)wh(e)&&lh(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)===du.NextToTrigger&&null!=(s=l.appearance)&&s.widgetSelector){var f,p=bc.querySelector(l.appearance.widgetSelector);p&&(v=xc(p,parseInt((null==(f=l.appearance)?void 0:f.maxWidth)||eh.maxWidth))||{})}var g=(null==(o=l.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:m}=sh(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 $a(Th(Ic,r({},y)),m);var b=setTimeout((()=>{if(this.j.delete(l.id),!mh(l))return this.$(l);$a(Th(Ic,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}=sh(e,this._posthog);n&&$a(Th(Rc,{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(wc),this.H.delete(t.id),Ru.info("Removed click listener for survey "+t.id))},this.J=(t,e)=>{var r=bc.querySelector(e),i=this.H.get(t.id);if(r){if(this.G(t),i){if(r===i.element)return;Ru.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.X(t)}if(!r.hasAttribute(wc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===du.NextToTrigger?xc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||eh.maxWidth)):{};yc.dispatchEvent(new CustomEvent(_c,{detail:{surveyId:t.id,position:n}}))};Dn(r,"click",n),r.setAttribute(wc,"true"),this.H.set(t.id,{element:r,listener:n,survey:t}),Ru.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}=sh(e,this._posthog);$a(Th(Ic,{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)),$a(Th(Ic,{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===fu.Popover||t.type===fu.Widget)),i=e.ne(r),n=new Set;i.forEach((t=>{if(t.type===fu.Widget){var r,i,s,o;if((null==(r=t.appearance)?void 0:r.widgetType)===cu.Tab)return void e.G(t);(null==(i=t.appearance)?void 0:i.widgetType)===cu.Selector&&null!=(s=t.appearance)&&s.widgetSelector&&(n.add(t.id),e.J(t,null==(o=t.appearance)?void 0:o.widgetSelector))}pr(e.ie)&&t.type===fu.Popover&&e.handlePopoverSurvey(t)})),e.H.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.X(r)}))}),t)},this.Z=t=>{pr(this.ie)||Ru.error("Survey "+this.ie+" already in focus. Cannot add survey "+t.id+"."),this.ie=t.id},this.$=t=>{this.ie!==t.id&&Ru.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)&&(Ru.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=wh(t),s=wh(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===mu.Always,a=e.schedule===mu.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 mc(t,this._posthog)}K(t,e){if(this.U.has(t.id))return!1;var{params:r}=function(t){var e={},r=!1,i=yc.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&&!dr(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;Ru.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)&&oh({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)]=ur(o)?o.map(String):[String(o)];Ru.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 oh({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=wu(t.id);try{switch(t.type){case pu.SingleChoice:if(!t.choices||0===t.choices.length)return void In.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 In.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case pu.MultipleChoice:if(!t.choices||0===t.choices.length)return void In.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 In.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(a.map((e=>t.choices[e])))];a.length>u.length&&In.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=u;break;case pu.Rating:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||0>l||l>h)return void In.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=l;break;default:In.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){In.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(i).length)return Ru.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Vu(),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=wu(o.id);dr(r[a])||(n[a]=r[a])}var u=tc(t,i,o.id?r[wu(o.id)]:null);if(u===gu.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=u}return{startQuestionIndex:i,skippedResponses:n}}(t,s,i),u=o>=t.questions.length;return bh(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:o,surveyLanguage:r}),Ru.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return Ru.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||mh(t)&&function(t){var e,r;return function(t,e){var r,i,n;if(!t||0===t.length)return!0;if(!wn)return!1;var s=Ii(wn,{userAgentDataPlatform:null==fn||null==(r=fn.userAgentData)?void 0:r.platform,maxTouchPoints:null==fn?void 0:fn.maxTouchPoints,screenWidth:null==dn||null==(i=dn.screen)?void 0:i.width,screenHeight:null==dn||null==(n=dn.screen)?void 0:n.height,devicePixelRatio:null==dn?void 0:dn.devicePixelRatio});return Dl[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==Xl||!Xl.querySelector(t.conditions.selector))}(t)}se(t){return vh(t)||this.ae(t.internal_targeting_flag_key)||wh(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!Mu(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!Du.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,Vl.A("lastSeenSurveyDate"))?(t=>!!Vl.A(Nu(t))&&!vh(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(!Ou(t)&&!Pu(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=bc.querySelector(Sh(t,!0));null!=e&&e.shadowRoot&&$a(null,e.shadowRoot),null==e||e.remove()}catch(e){Ru.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 kc(t,e){if(bc&&yc){var r,i=new Sc(t);if(t.config.disable_surveys_automatic_display)return Ru.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Ru.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{dr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Dn(bc,"visibilitychange",(()=>{bc.hidden?dr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function Cc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;Xa((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var s=()=>{var t,n=e.type===fu.Widget,s=mh(e),o=(null==(t=e.appearance)?void 0:t.widgetType)===cu.Tab&&n;if(!s)return Ru.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);o&&(Ru.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};Dn(yc,"popstate",s),Dn(yc,"hashchange",s);var o=yc.history.pushState,a=yc.history.replaceState;return yc.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()},yc.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()},()=>{yc.removeEventListener("popstate",s),yc.removeEventListener("hashchange",s),yc.history.pushState=o,yc.history.replaceState=a}}}),[n,e,r,i])}function Tc(t){switch(void 0===t&&(t=vu.Right),t){case vu.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case vu.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case vu.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Ic(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=tu(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]=Ka(n||0===i||t.type===fu.ExternalSurvey),[d,v]=Ka(!1),f=()=>{var e=()=>{o&&s(t),c(!1)};bc.startViewTransition?bc.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 Xa((()=>{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=()=>{mh(t)&&(c(!0),yc.dispatchEvent(new Event("PHSurveyShown")),u||e.capture(yu.SHOWN,r({[bu.SURVEY_NAME]:t.name,[bu.SURVEY_ID]:t.id,[bu.SURVEY_ITERATION]:t.current_iteration,[bu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[bu.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()})),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(Dn(yc,"PHSurveyClosed",p),Dn(yc,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),yc.removeEventListener("PHSurveyClosed",p),yc.removeEventListener("PHSurveySent",s)}}return o(),()=>{yc.removeEventListener("PHSurveyClosed",p),yc.removeEventListener("PHSurveySent",s)}}}else Ru.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Cc({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=eu((()=>{var t=_h(u),e=(null==t?void 0:t.surveySubmissionId)||Vu();return{isPreviewMode:S,previewPageIndex:d,onPopupSurveyDismissed(){w?uh(u,h,S,w):uh(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?Th(fh.Provider,{value:R,children:Th("div",{className:"ph-survey",style:r({},kh(u.type,null==(i=u.appearance)?void 0:i.position,null==(n=u.appearance)?void 0:n.widgetType),c),ref:x,children:E?Th(Uh,{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||eh,onClose(){I(),m()}}):Th(Ec,{survey:u,forceDisableHtml:!!l,posthog:h})})}):null}function Ec(t){var e,{survey:i,forceDisableHtml:n,posthog:s}=t,[o,a]=Ka((()=>{var t=_h(i);return null!=t&&t.responses&&Ru.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}=ru(fh),[g,m]=Ka((()=>{var t=_h(i);return u||(null==t?void 0:t.lastQuestionIndex)||0})),y=eu((()=>dh(i)),[i]);Xa((()=>{v&&!dr(u)&&m(u)}),[u,v]);var b=y.at(g);return b?Th("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=i.appearance)?void 0:e.hideCancelButton)&&Th(qh,{onClick(){l()}}),Th("div",{className:"survey-box","data-question-index":g,children:Mc({question:b,forceDisableHtml:n,displayQuestionIndex:g,appearance:i.appearance||eh,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:u}=t;if(s)if(u){var l=wu(u),h=r({},o,{[l]:e});a(h);var c=tc(i,n,e),v=c===gu.End;v||(m(c),bh(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c,surveyLanguage:p})),(i.enable_partial_responses||v)&&oh({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:s,properties:f,surveyLanguage:p})}else Ru.error("onNextButtonClick called without a questionId.");else Ru.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:g,questionId:b.id}),onPreviewSubmit:c,initialValue:b.id?o[wu(b.id)]:void 0})})]}):null}function Rc(t){var e,r,i,n,s,o,a,{survey:u,forceDisableHtml:l,posthog:h,readOnly:c,surveyLanguage:d}=t,[v,f]=Ka(!0),[p,g]=Ka(!1),[m,y]=Ka({}),b=()=>{g(!p)};if(Xa((()=>{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&&(Ru.info("Received show event for feedback button survey "+u.id),y(r.detail.position||{}),b())};return Dn(yc,_c,e),()=>{yc.removeEventListener(_c,e)}}}else Ru.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]),Cc({survey:u,setSurveyVisible:f}),!v)return null;var _=()=>{u.schedule!==mu.Always&&f(!1),setTimeout((()=>{g(!1)}),200)};return Th(ba,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Th("button",{className:"ph-survey-widget-tab "+((null==(s=u.appearance)?void 0:s.tabPosition)===vu.Top?"widget-tab-top":""),onClick:b,disabled:c,style:Tc(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),p&&Th(Ic,{posthog:h,survey:u,forceDisableHtml:l,style:m,onPopupSurveyDismissed:_,onCloseConfirmationMessage:_,surveyLanguage:d})]})}var Mc=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 pu.Open:return ma(Bh,r({},l,{question:e,key:e.id}));case pu.Link:return ma(zh,r({},l,{question:e,key:e.id}));case pu.Rating:return ma(Vh,r({},l,{question:e,key:e.id}));case pu.SingleChoice:case pu.MultipleChoice:return ma(Zh,r({},l,{question:e,key:e.id}));default:return Ru.error("Unsupported question type: "+e.type),null}};xn.__PosthogExtensions__=xn.__PosthogExtensions__||{},xn.__PosthogExtensions__.generateSurveys=kc,xn.extendPostHogWithSurveys=kc;class Oc{emit(t){}}var Pc=new Oc,Lc=new class{getLogger(t,e,r){return new Oc}};class Ac{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):Pc}}class Fc{getLogger(t,e,r){var i;return null!==(i=this.de(t,e,r))&&void 0!==i?i:new Ac(this,t,e,r)}he(){var t;return null!==(t=this.ce)&&void 0!==t?t:Lc}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 Nc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},$c=Symbol.for("io.opentelemetry.js.api.logs"),Dc=Nc;class qc{constructor(){this.fe=new Fc}static getInstance(){return this._instance||(this._instance=new qc),this._instance}setGlobalLoggerProvider(t){return Dc[$c]?this.getLoggerProvider():(Dc[$c]=(1,e=t,r=Lc,t=>1===t?e:r),this.fe.ve(t),t);var e,r}getLoggerProvider(){var t,e;return null!==(e=null===(t=Dc[$c])||void 0===t?void 0:t.call(Dc,1))&&void 0!==e?e:this.fe}getLogger(t,e,r){return this.getLoggerProvider().getLogger(t,e,r)}disable(){delete Dc[$c],this.fe=new Fc}}var jc=qc.getInstance();class Uc{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 Hc 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 Bc(t){if(Number.isFinite(t)&&t>0)return t;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+t+"')")}class zc{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 Vc(t){return new zc(t.concurrencyLimit)}var Wc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Zc="1.9.0",Gc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,Qc=function(t){var e=new Set([t]),r=new Set,i=t.match(Gc);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(Gc);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)}}(Zc),Jc=Zc.split(".")[0],Yc=Symbol.for("opentelemetry.js.api."+Jc),Kc=Wc;function Xc(t,e,r,i){var n;void 0===i&&(i=!1);var s=Kc[Yc]=null!==(n=Kc[Yc])&&void 0!==n?n:{version:Zc};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!==Zc?(o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+Zc),r.error(o.stack||o.message),!1):(s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+Zc+"."),!0)}function td(t){var e,r,i=null===(e=Kc[Yc])||void 0===e?void 0:e.version;if(i&&Qc(i))return null===(r=Kc[Yc])||void 0===r?void 0:r[t]}function ed(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Zc+".");var r=Kc[Yc];r&&delete r[t]}var rd,id=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 nd("debug",this.ye,t)},t.prototype.error=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return nd("error",this.ye,t)},t.prototype.info=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return nd("info",this.ye,t)},t.prototype.warn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return nd("warn",this.ye,t)},t.prototype.verbose=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return nd("verbose",this.ye,t)},t}();function nd(t,e,r){var i=td("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"}(rd||(rd={}));var sd=function(){function t(){function t(t){return function(){for(var e=[],r=0;arguments.length>r;r++)e[r]=arguments[r];var i=td("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:rd.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=td("diag"),u=function(t,e){function r(r,i){var n=e[r];return"function"!=typeof n||i>t?function(){}:n.bind(e)}return rd.NONE>t?t=rd.NONE:t>rd.ALL&&(t=rd.ALL),e=e||{},{error:r("error",rd.ERROR),warn:r("warn",rd.WARN),info:r("info",rd.INFO),debug:r("debug",rd.DEBUG),verbose:r("verbose",rd.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:rd.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 Xc("diag",u,e,!0)},e.disable=function(){ed("diag",e)},e.createComponentLogger=function(t){return new id(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 od(t){return Symbol.for(t)}var ad,ud=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}},ld=function(){function t(){}return t.prototype.active=function(){return ud},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}(),hd="context",cd=new ld,dd=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return Xc(hd,t,sd.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 td(hd)||cd},t.prototype.disable=function(){this.be().disable(),ed(hd,sd.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(ad||(ad={}));var vd="0000000000000000",fd="00000000000000000000000000000000",pd={traceId:fd,spanId:vd,traceFlags:ad.NONE},gd=function(){function t(t){void 0===t&&(t=pd),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}(),md=od("OpenTelemetry Context Key SPAN");function yd(t){return t.getValue(md)||void 0}function bd(){return yd(dd.getInstance().active())}function _d(t,e){return t.setValue(md,e)}function wd(t){return t.deleteValue(md)}function xd(t,e){return _d(t,new gd(e))}function Sd(t){var e;return null===(e=yd(t))||void 0===e?void 0:e.spanContext()}var kd=/^([0-9a-f]{32})$/i,Cd=/^[0-9a-f]{16}$/i;function Td(t){return kd.test(r=t.traceId)&&r!==fd&&Cd.test(e=t.spanId)&&e!==vd;var e,r}function Id(t){return new gd(t)}var Ed=dd.getInstance(),Rd=function(){function t(){}return t.prototype.startSpan=function(t,e,r){if(void 0===r&&(r=Ed.active()),Boolean(null==e?void 0:e.root))return new gd;var i,n=r&&Sd(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&Td(n)?new gd(n):new gd},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:Ed.active(),u=this.startSpan(t,n,a),l=_d(a,u);return Ed.with(l,o,void 0,u)}},t}(),Md=new Rd,Od=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):Md},t}(),Pd=new(function(){function t(){}return t.prototype.getTracer=function(t,e,r){return new Rd},t}()),Ld=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 Od(this,t,e,r)},t.prototype.getDelegate=function(){var t;return null!==(t=this.ce)&&void 0!==t?t:Pd},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}(),Ad=dd.getInstance(),Fd=sd.instance(),Nd="trace",$d=function(){function t(){this.xe=new Ld,this.wrapSpanContext=Id,this.isSpanContextValid=Td,this.deleteSpan=wd,this.getSpan=yd,this.getActiveSpan=bd,this.getSpanContext=Sd,this.setSpan=_d,this.setSpanContext=xd}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=Xc(Nd,this.xe,sd.instance());return e&&this.xe.setDelegate(t),e},t.prototype.getTracerProvider=function(){return td(Nd)||this.xe},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){ed(Nd,sd.instance()),this.xe=new Ld},t}().getInstance(),Dd=od("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function qd(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(jd(i)){e=i;continue}return!1}return!1}}return!0}(t):jd(typeof t))}function jd(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}function Ud(t){try{(t=>{Fd.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 Hd,Bd=performance,zd="telemetry.sdk.language",Vd="telemetry.sdk.name",Wd="telemetry.sdk.version",Zd={[Vd]:"opentelemetry","process.runtime.name":"browser",[zd]:"webjs",[Wd]:"2.2.0"},Gd=Math.pow(10,6),Qd=Math.pow(10,9);function Jd(t){return[Math.trunc(t/1e3),Math.round(t%1e3*Gd)]}function Yd(){var t=Bd.timeOrigin;return"number"!=typeof t&&(t=Bd.timing&&Bd.timing.fetchStart),t}function Kd(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<Yd()?(e=t,r=Jd(Yd()),i=Jd("number"==typeof e?e:Bd.now()),Qd>(n=[r[0]+i[0],r[1]+i[1]])[1]||(n[1]-=Qd,n[0]+=1),n):Jd(t);var e,r,i,n,s;if(t instanceof Date)return Jd(t.getTime());throw TypeError("Invalid input type")}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(Hd||(Hd={}));var Xd="[object Object]",tv="[object Null]",ev="[object Undefined]",rv=function(){}.toString,iv=rv.call(Object),nv=Object.getPrototypeOf,sv=Object.prototype,ov=sv.hasOwnProperty,av=Symbol?Symbol.toStringTag:void 0,uv=sv.toString;function lv(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){return null==t?void 0===t?ev:tv:av&&av in Object(t)?function(t){var e=ov.call(t,av),r=t[av],i=!1;try{t[av]=void 0,i=!0}catch(t){}var n=uv.call(t);return i&&(e?t[av]=r:delete t[av]),n}(t):function(t){return uv.call(t)}(t)}(t)!==Xd)return!1;var e=nv(t);if(null===e)return!0;var r=ov.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&rv.call(r)===iv}function hv(t){return vv(t)?t.slice():t}function cv(t,e,r,i){var n;if(void 0===r&&(r=0),20>=r){if(r++,gv(t)||gv(e)||fv(e))n=hv(e);else if(vv(t)){if(n=t.slice(),vv(e))for(var s=0,o=e.length;o>s;s++)n.push(hv(e[s]));else if(pv(e))for(var a=Object.keys(e),u=0,l=a.length;l>u;u++){var h=a[u];n[h]=hv(e[h])}}else if(pv(t))if(pv(e)){if(!function(t,e){return!(!lv(t)||!lv(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(gv(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(dv(t,f,i)||dv(e,f,i))delete n[f];else{if(pv(g)&&pv(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]=cv(n[f],p,r,i)}}}}else n=e;return n}}function dv(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 vv(t){return Array.isArray(t)}function fv(t){return"function"==typeof t}function pv(t){return!gv(t)&&!vv(t)&&!fv(t)&&"object"==typeof t}function gv(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class mv extends Error{constructor(t){super(t),Object.setPrototypeOf(this,mv.prototype)}}function yv(t,e){var r,i=new Promise((function(t,i){r=setTimeout((function(){i(new mv("Operation timed out."))}),e)}));return Promise.race([t,i]).then((t=>(clearTimeout(r),t)),(t=>{throw clearTimeout(r),t}))}class bv{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 _v{constructor(t,e){this.Te=void 0,this.Me=void 0,this._e=!1,this.Le=new bv,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 wv={Oe:(t,e)=>new Promise((r=>{Ad.with(function(t){return t.setValue(Dd,!0)}(Ad.active()),(()=>{t.export(e,(t=>{r(t)}))}))}))};class xv{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=Fd.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,e){if(this.qe.debug("items to be sent",t),this.Ae.hasReachedLimit())e({code:Hd.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:Hd.FAILED,error:t.error}:"retryable"===t.status?{code:Hd.FAILED,error:new Hc("Export failed with retryable status")}:{code:Hd.FAILED,error:new Hc("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:Hd.SUCCESS})}}),(t=>e({code:Hd.FAILED,error:t})))):e({code:Hd.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 Sv(t,e,r){return i={transport:r,serializer:e,promiseHandler:Vc(t)},new xv(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&&Fd.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}},i.promiseHandler,{timeout:t.timeoutMillis}.timeout);var i}function kv(t){return 48>t||t>57?97>t||t>102?t-55:t-87:t-48}function Cv(t){for(var e=new Uint8Array(t.length/2),r=0,i=0;t.length>i;i+=2){var n=kv(t.charCodeAt(i)),s=kv(t.charCodeAt(i+1));e[r++]=n<<4|s}return e}function Tv(t){var e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Iv(t){var e;return e=Tv(t),{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var Ev="undefined"!=typeof BigInt?function(t){return Tv(t).toString()}:function(t){return t[0]*Qd+t[1]};function Rv(t){return t}function Mv(t){if(void 0!==t)return Cv(t)}var Ov={encodeHrTime:Iv,encodeSpanContext:Cv,encodeOptionalSpanContext:Mv};function Pv(t,e){return{key:t,value:Lv(e)}}function Lv(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(Lv)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((t=>{var[e,r]=t;return Pv(e,r)}))}}:{}}function Av(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=>Pv(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:Lv(t.body),eventName:t.eventName,attributes:(s=t.attributes,Object.keys(s).map((t=>Pv(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 Fv=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class Nv{static FromAttributeList(t,e){var r=new Nv({},e);return r.De=Dv(t),r.Fe=t.filter((t=>{var[e,r]=t;return Fv(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 Fv(r)&&(this.Fe=!0),[e,r]})),this.De=Dv(this.De),this.je=function(t){if("string"==typeof t||void 0===t)return t;Fd.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,Fv(i)?yield i:i]}t.Fe=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Fd.error("Accessing resource attributes before async attributes settled"),this.He)return this.He;var t={};for(var[e,r]of this.De){var i;Fv(r)?Fd.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 Fd.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 Nv.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],o)}}function $v(t,e){return Nv.FromAttributeList(Object.entries(t),e)}function Dv(t){return t.map((t=>{var[e,r]=t;return Fv(r)?[e,r.catch((t=>{Fd.debug("promise rejection for resource attribute: %s - %s",e,t)}))]:[e,r]}))}var qv={serializeRequest(t){var e,r,i=(e=t,r=function(t){var e,r;if(void 0===t)return Ov;var i=null===(e=t.useLongBits)||void 0===e||e,n=null!==(r=t.useHex)&&void 0!==r&&r;return{encodeHrTime:i?Iv:Ev,encodeSpanContext:n?Rv:Cv,encodeOptionalSpanContext:n?Rv:Mv}}({useHex:!0,useLongBits:!1}),{resourceLogs:Av(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 jv{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 Uv(t){return new jv(t.transport)}function Hv(t){return[429,502,503,504].includes(t)}function Bv(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 zv{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&&Hv(s.status)?n({status:"retryable",retryInMillis:Bv(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")}):(Fd.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 Vv{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}))?(Fd.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Wv{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?Hv(u.status)?{status:"retryable",retryInMillis:Bv(u.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}:(Fd.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 Zv(t,e){return Sv(t,e,Uv({transport:(r=t,new zv(r))}));var r}function Gv(t,e){return Sv(t,e,Uv({transport:(r=t,new Wv(r))}));var r}function Qv(t,e){return Sv(t,e,Uv({transport:(r={url:t.url,headers:t.headers},new Vv(r))}));var r}function Jv(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 Yv(t){return"function"==typeof t.headers?t.headers:function(t){if(null!=t)return e((function*(){return t}))}(t.headers)}function Kv(t,i,n){return s={url:t.url,timeoutMillis:t.timeoutMillis,headers:Yv(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:Bc(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):Fd.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),e}(yield h())),Object.assign(e,t)}))),url:null!==(u=null!==(l=Jv(s.url))&&void 0!==l?l:o.url)&&void 0!==u?u:a.url});var s,o,a,u,l,h,c,d}function Xv(t,e,r,i){return(t.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?Gv:Zv:Qv)(Kv(t,r,i),e)}class tf extends Uc{constructor(t){void 0===t&&(t={}),super(Xv(t,qv,"v1/logs",{"Content-Type":"application/json"}))}}class ef{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=Kd(null!=i?i:c),this.hrTimeObserved=Kd(null!=n?n:c),h){var d=$d.getSpanContext(h);d&&Td(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?(Fd.warn("Invalid attribute key: "+t),this):qd(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]=qd(e)?this.Xe(e):e,this):(1===this.droppedAttributesCount&&Fd.warn("Dropping extra attributes."),this)):(Fd.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:(Fd.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&&Fd.warn("Can not execute the operation on emitted log record"),this.Qe}}class rf{constructor(t,e){this.instrumentationScope=void 0,this.Ke=void 0,this.instrumentationScope=t,this.Ke=e}emit(t){var e=t.context||Ad.active(),i=new ef(this.Ke,this.instrumentationScope,r({context:e},t));this.Ke.activeProcessor.onEmit(i,e),i.Ye()}}class nf{forceFlush(){return Promise.resolve()}onEmit(t,e){}shutdown(){return Promise.resolve()}}class sf{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=>yv(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 of{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 sf(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new nf}}class af{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=cv(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:$v({"service.name":"unknown_service",[zd]:Zd[zd],[Vd]:Zd[Vd],[Wd]:Zd[Wd]});this.Ke=new of(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 _v(this.tt,this)}getLogger(t,e,r){if(this.et.isCalled)return Fd.warn("A shutdown LoggerProvider cannot provide a Logger"),Pc;t||Fd.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 rf({name:i,version:e,schemaUrl:null==r?void 0:r.schemaUrl},this.Ke)),this.Ke.loggers.get(n)}forceFlush(){return this.et.isCalled?(Fd.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.et.promise):this.Ke.activeProcessor.forceFlush()}shutdown(){return this.et.isCalled?(Fd.warn("shutdown may only be called once per LoggerProvider"),this.et.promise):this.et.call()}tt(){return this.Ke.activeProcessor.shutdown()}}class uf{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 _v(this.tt,this),this.nt>this.it&&(Fd.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)=>{yv(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,Ud(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=()=>wv.Oe(this.rt,t).then((t=>{var e;t.code!==Hd.SUCCESS&&Ud(null!==(e=t.error)&&void 0!==e?e:new Error("BatchLogRecordProcessor: log record export failed (status "+t+")"))})).catch(Ud),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,Ud)}}class lf extends uf{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 hf=1e4,cf=function(t,e){if(void 0===e&&(e=new WeakSet),!hr(t)&&!ur(t))return t;if(e.has(t))return"[Circular]";e.add(t);var r,i=ur(t)?[]:{};try{r=Object.keys(t)}catch(t){return}for(var n of r)try{i[n]=cf(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},df=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=hf),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(hr(a))df(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},vf={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};xn.__PosthogExtensions__=xn.__PosthogExtensions__||{},xn.__PosthogExtensions__.logs={initializeLogs(t){(t=>{var e,i={"service.name":(null==(e=t.config.logs)?void 0:e.serviceName)||"posthog-browser-logs",host:xn.location.host};if(t.sessionManager){var{sessionId:n,windowId:s}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i=r({},i,{"session.id":n,"window.id":s})}jc.setGlobalLoggerProvider(new af({resource:$v(i),processors:[new lf(new tf({url:t.config.api_host+"/i/v1/logs?token="+t.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(t);var e=jc.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;xn.console[n]=(s=xn.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(cf(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&&!pr(i)){if(e.has(i))return"[Circular]";e.add(i)}return i}));var e})).join(" ");l.length>hf&&(l=l.slice(0,hf)+"...",i.body_truncated="true"),e.emit({severityText:vf[n],body:l,attributes:r({"log.source":"console."+n,distinct_id:t.get_distinct_id(),"location.href":xn.location.href},i,hr(a[0])?df(a[0]):{})}),s.apply(xn.console,a)}})};for(var a of["debug","log","warn","error","info"])o(a)}};var ff=En("[Error tracking]");function pf(){return new Ai([new Zi,new nn,new Qi,new Gi,new en,new tn,new Yi,new rn],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=Vi.test(u)?u.replace(Vi,"$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>=Wi)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Wi).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||Fi});var i}))}(s)}}("web:javascript",Ui,zi))}var gf=En("[ExceptionAutocapture]"),mf=pf(),yf={wrapOnError(t){var e=dn;e||gf.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=mf.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=dn;e||gf.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(e){var i,n=mf.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||gf.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=mf.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}}};xn.__PosthogExtensions__=xn.__PosthogExtensions__||{},xn.__PosthogExtensions__.errorWrappingFunctions=yf,xn.posthogErrorWrappingFunctions=yf;var bf=(t,e,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(t){return}if(!ur(t)||t.includes(n)){if(r){var{sessionId:s,windowId:o}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",s),i.headers.set("X-POSTHOG-WINDOW-ID",o)}e!==Ds&&i.headers.set("X-POSTHOG-DISTINCT-ID",e)}};xn.__PosthogExtensions__=xn.__PosthogExtensions__||{};var _f={_patchFetch:(t,r,i)=>Vn(dn,"fetch",(n=>function(){var s=e((function*(e,s){var o=new Request(e,s);return bf(t,r,i,o),n(o)}));return function(t,e){return s.apply(this,arguments)}}())),_patchXHR:(t,e,r)=>Vn(dn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,u){void 0===o&&(o=!0);var l=new Request(s);return bf(t,e,r,l),i.call(this,n,l.url,o,a,u)}))};xn.__PosthogExtensions__.tracingHeadersPatchFns=_f,xn.postHogTracingHeadersPatchFns=_f;var wf=-1,xf=t=>{addEventListener("pageshow",(e=>{e.persisted&&(wf=e.timeStamp,t(e))}),!0)},Sf=(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))}},kf=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Cf=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Tf=()=>{var t,e=Cf();return null!==(t=null==e?void 0:e.activationStart)&&void 0!==t?t:0},If=function(t,e){void 0===e&&(e=-1);var r=Cf(),i="navigate";return 0>wf?r&&(document.prerendering||Tf()>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}},Ef=new WeakMap;function Rf(t,e){return Ef.get(t)||Ef.set(t,new e),Ef.get(t)}class Mf{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 Of,Pf=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){}},Lf=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Af=-1,Ff=new Set,Nf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,$f=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Ff)e();isFinite(Af)||(Af="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",$f,!0))}},Df=()=>{if(0>Af){var t,e=Tf(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0])?void 0:t.startTime;Af=null!=r?r:Nf(),addEventListener("visibilitychange",$f,!0),addEventListener("prerenderingchange",$f,!0),xf((()=>{setTimeout((()=>{Af=Nf()}))}))}return{get firstHiddenTime(){return Af},onHidden(t){Ff.add(t)}}},qf=t=>{document.prerendering?addEventListener("prerenderingchange",(()=>t()),!0):t()},jf=[1800,3e3],Uf=function(t,e){void 0===e&&(e={}),qf((()=>{var r,i=Df(),n=If("FCP"),s=Pf("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),i.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-Tf(),0),n.entries.push(e),r(!0)))}));s&&(r=Sf(t,n,jf,e.reportAllChanges),xf((i=>{n=If("FCP"),r=Sf(t,n,jf,e.reportAllChanges),kf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Hf=[.1,.25],Bf=0,zf=1/0,Vf=0,Wf=t=>{for(var e of t)e.interactionId&&(zf=Math.min(zf,e.interactionId),Vf=Math.max(Vf,e.interactionId),Bf=Vf?(Vf-zf)/7+1:0)},Zf=()=>{var t;return Of?Bf:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Gf=0;class Qf{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){Gf=Zf(),this.u.length=0,this.l.clear()}L(){var t=Math.min(this.u.length-1,Math.floor((Zf()-Gf)/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 Jf=t=>{var e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=Lf(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e((()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})})))},Yf=[200,500];class Kf{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var Xf=[2500,4e3],tp={onLCP(t,e){void 0===e&&(e={}),qf((()=>{var r,i=Df(),n=If("LCP"),s=Rf(e,Kf),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-Tf(),0),n.entries=[o],r())},a=Pf("largest-contentful-paint",o);if(a){r=Sf(t,n,Xf,e.reportAllChanges);var u=Lf((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),l=t=>{t.isTrusted&&(Jf(u),removeEventListener(t.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});xf((i=>{n=If("LCP"),r=Sf(t,n,Xf,e.reportAllChanges),kf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var r=Df();Uf(Lf((()=>{var i,n=If("CLS",0),s=Rf(e,Mf),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=Pf("layout-shift",o);a&&(i=Sf(t,n,Hf,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),xf((()=>{s.i=0,n=If("CLS",0),i=Sf(t,n,Hf,e.reportAllChanges),kf((()=>i()))})),setTimeout(i))})))},onFCP:Uf,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Df();qf((()=>{var i;"interactionCount"in performance||Of||(Of=Pf("event",Wf,{type:"event",buffered:!0,durationThreshold:0}));var n,s=If("INP"),o=Rf(e,Qf),a=t=>{Jf((()=>{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=Pf("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=Sf(t,s,Yf,e.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(u.takeRecords()),n(!0)})),xf((()=>{o.v(),s=If("INP"),n=Sf(t,s,Yf,e.reportAllChanges)})))}))}}};xn.__PosthogExtensions__=xn.__PosthogExtensions__||{},xn.__PosthogExtensions__.postHogWebVitalsCallbacks=tp,xn.postHogWebVitalsCallbacks=tp,xn.__PosthogExtensions__.loadWebVitalsCallbacks=()=>tp;class ep{constructor(t){this.disabled=!1===t;var e=hr(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 rp="$copy_autocapture",ip=En("[AutoCapture]");function np(t,e){return e.length>t?e.slice(0,t)+"...":e}function sp(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!no(e));return e}function op(t,e){var i,n,{e:s,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:u,elementsChainAsString:l}=e;if(!no(t))return{props:{}};for(var h=[t],c=t;c.parentNode&&!so(c,"body");)if(ao(c.parentNode))h.push(c.parentNode.host),c=c.parentNode.host;else{if(!no(c.parentNode))break;h.push(c.parentNode),c=c.parentNode}var d,v,f=[],p={},g=!1,m=!1;if(Mn(h,(t=>{var e=xo(t);if(so(t,"a")){var r=t.getAttribute("href");g=e&&!!r&&Mo(r)&&r}rr(ho(t),"ph-no-capture")&&(m=!0),f.push(function(t,e,r,i){var n=t.tagName.toLowerCase(),s={tag_name:n};po.indexOf(n)>-1&&!r&&(s.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?np(1024,Oo(t)):np(1024,vo(t)));var o=ho(t);o.length>0&&(s.classes=o.filter((function(t){return""!==t}))),Mn(t.attributes,(function(r){var n;if((!So(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&Mo(r.value)&&(!vr(n=r.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=r.value;"class"===r.name&&(o=uo(o).join(" ")),s["attr__"+r.name]=np(1024,o)}}));for(var a=1,u=1,l=t;l=sp(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(!xo(t))return{};var e={};return Mn(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&&Mo(i)&&(e[r]=i)}})),e}(t);On(p,i)})),m)return{props:{},explicitNoCapture:m};if(a||(f[0].$el_text=so(t,"a")||so(t,"button")?Oo(t):vo(t)),g){var y,b;f[0].attr__href=g;var _=null==(y=jn(g))?void 0:y.host,w=null==dn||null==(b=dn.location)?void 0:b.host;_&&w&&_!==w&&(d=g)}return{props:On({$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 Pn(o).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[Lo(e.toString())]=Lo(r.toString())})),(n+=":")+Pn(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:Ao(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Pn(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 ap={};function up(t){return function(t,e){var r=ap[t];if(r)return r;var i,n=e[t];if(lr(i=n)&&-1!==i.toString().indexOf("[native code]")&&!dn.Zone)return ap[t]=n.bind(e);var s=e.document;if(s&&lr(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){In.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return n&&lr(n)?ap[t]=n.bind(e):n}("MutationObserver",t)}function lp(t,e){return mr(t)&&t>=e}class hp{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,__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=fo(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);pr(e)||this._t(e)||this.Tt.push(e),this.Tt.length&&dr(this.Lt)&&(this.Lt=xn.setTimeout((()=>{this.Ot()}),1e3))},this.Et=()=>{var t=Date.now();t%50==0&&this.Tt.forEach((e=>{dr(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Rt=()=>{this.Nt=Date.now()},this.At=()=>{"visible"===(null==pn?void 0:pn.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=up(xn);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,xn.removeEventListener("click",this.Mt),xn.removeEventListener("scroll",this.Et,{capture:!0}),xn.removeEventListener("selectionchange",this.Rt),null==pn||pn.removeEventListener("visibilitychange",this.At)}Vt(t){this.Wt=Date.now()}Dt(){Dn(xn,"click",this.Mt)}Ft(){Dn(xn,"scroll",this.Et,{capture:!0})}jt(){Dn(xn,"selectionchange",this.Rt)}Ht(){Dn(pn,"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(io(t.node))return!0;var r=this.Tt.some((e=>e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!!r||!(!so(t.node,"html")&&no(t.node)&&!po.includes(t.node.tagName.toLowerCase()))}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=lp(e.scrollDelayMs,this.qt.scroll_threshold_ms),n=lp(e.selectionChangedDelayMs,this.qt.selection_change_threshold_ms),s=lp(e.mutationDelayMs,this.qt.mutation_threshold_ms),o=lp(e.absoluteDelayMs,1.1*this.qt.mutation_threshold_ms),a=mr(e.scrollDelayMs)&&this.qt.scroll_threshold_ms>e.scrollDelayMs,u=mr(e.mutationDelayMs)&&this.qt.mutation_threshold_ms>e.mutationDelayMs,l=mr(e.selectionChangedDelayMs)&&this.qt.selection_change_threshold_ms>e.selectionChangedDelayMs,h=mr(e.visibilityChangedDelayMs)&&this.qt.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(a||u||l||h)){var c=lp(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&&dr(this.Lt)&&(this.Lt=xn.setTimeout((()=>{this.Ot()}),1e3))}}It(t,e){this.instance.capture("$dead_click",r({},e,op(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)})}}xn.__PosthogExtensions__=xn.__PosthogExtensions__||{},xn.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new hp(t,e);var cp=En("[ExternalScriptsLoader]"),dp=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return cp.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==pn?void 0:pn.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(!pn)return r("document not found");var i=pn.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)pn.head.appendChild(i);else{var n,s=pn.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):pn.body.appendChild(i)}};null!=pn&&pn.body?a():null==pn||pn.addEventListener("DOMContentLoaded",a)};xn.__PosthogExtensions__=xn.__PosthogExtensions__||{},xn.__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)}dp(t,i,r)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");dp(t,o,r)}},xn.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);dp(t,i,r)};class vp{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===Bs}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 Cr(t)?1:rr(Tr,t)?0:-1}get nr(){var t=this.qt.opt_out_capturing_persistence_type,e="localStorage"===t?Vl:Bl;if(!this.ar||this.ar!==e){this.ar=e;var r="localStorage"===t?Bl:Vl;r.A(this.sr)&&(this.ar.A(this.sr)||this.optInOut(Cr(r.A(this.sr))),r.q(this.sr,this.qt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.qt.respect_dnt&&[null==fn?void 0:fn.doNotTrack,null==fn?void 0:fn.msDoNotTrack,xn.doNotTrack].some((t=>Cr(t)))}}var fp=En("[Dead Clicks]"),pp=()=>!0,gp=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(is)),i=t.instance.config.capture_dead_clicks;return br(i)?i:!!hr(i)||r};class mp{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({[is]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.lr((()=>{this.hr()})):this.stop()}lr(t){var e,r;null!=(e=xn.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=xn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?fp.error("failed to load script",e):t()}))}hr(){var t;if(pn){if(!this.ur&&null!=(t=xn.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=hr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.ur=xn.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.ur.start(pn),fp.info("starting...")}}else fp.error("`document` not found. Cannot start.")}stop(){this.ur&&(this.ur.stop(),this.ur=void 0,fp.info("stopping..."))}}var yp=En("[SegmentIntegration]");var bp="posthog-js";function _p(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 wp{constructor(t,e,r,i,n,s){this.name=bp,this.setupOnce=function(o){o(_p(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class xp{constructor(t){this.cr=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(In.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==dn?void 0:dn.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(!(dr(s)||dr(o)||dr(a)||dr(u)||dr(l)||dr(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?Ir(o/s,0,1,In):1,d=s>1?Ir(a/s,0,1,In):1,v=u>1?Ir(l/u,0,1,In):1,f=u>1?Ir(h/u,0,1,In):1;i=On(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 Sp={[Zn]:{exposure:"hidden"},[Qn]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Jn]:{exposure:"hidden"},[Yn]:{exposure:"event"},[Kn]:{exposure:"hidden"},[Xn]:{exposure:"event"},[ts]:{exposure:"hidden"},[es]:{exposure:"event"},[rs]:{exposure:"event"},[is]:{exposure:"event"},[ns]:{exposure:"hidden"},[ss]:{exposure:"event"},[os]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[cs]:{exposure:"hidden"},[ds]:{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"},[vs]:{exposure:"derived",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!hr(t))return{};for(var e={},r=Object.keys(t),i=0;r.length>i;i++)e["$feature/"+r[i]]=t[r[i]];return e}},[fs]:{exposure:"event"},[ps]:{exposure:"hidden"},[gs]:{exposure:"hidden"},[ms]:{exposure:"event"},[ys]:{exposure:"event"},[bs]:{exposure:"event"},[_s]:{exposure:"hidden"},[ws]:{exposure:"hidden"},[xs]:{exposure:"hidden"},[Ss]:{exposure:"hidden"},[ks]:{exposure:"event"},[Cs]:{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"},[Ts]:{exposure:"hidden"},[Is]:{exposure:"hidden"},[Es]:{exposure:"hidden"},[Rs]:{exposure:"hidden"},[Ms]:{exposure:"hidden"},[Os]:{exposure:"hidden"},[Ps]:{exposure:"hidden"},[Ls]:{exposure:"hidden"},[As]:{exposure:"hidden"},[Fs]:{exposure:"hidden"},[Ns]:{exposure:"hidden"},[as]:{exposure:"event"},[us]:{exposure:"event"},[ls]:{exposure:"event"},[hs]:{exposure:"event"},[qs]:{exposure:"event"},[js]:{exposure:"event"},[Us]:{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"}},kp=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Cp=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Tp{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&&In.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this._r}br(t){-1===Cp.indexOf(t.persistence.toLowerCase())&&(In.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=[...Wl,...t];return r({},Vl,{F(t){try{var e={};try{e=Bl.F(t)||{}}catch(t){}var r=On(e,JSON.parse(Vl.A(t)||"{}"));return Vl.N(t,r),r}catch(t){}return null},N(t,r,i,n,s,o){try{Vl.N(t,r,void 0,void 0,o);var a={};e.forEach((t=>{r[t]&&(a[t]=r[t])})),Object.keys(a).length&&Bl.N(t,a,i,n,s,o)}catch(t){Vl.D(t)}},q(t,e){try{null==dn||dn.localStorage.removeItem(t),Bl.q(t,e)}catch(t){Vl.D(t)}}})}(t.cookie_persisted_properties||[]),i=t.persistence.toLowerCase();return"localstorage"===i&&Vl.R()?Vl:"localstorage+cookie"===i&&e.R()?e:"sessionstorage"===i&&Jl.R()?Jl:"memory"===i?Gl:"cookie"===i?Bl:e.R()?e:Bl}wr(t){var e=null!=t?t:this.qt.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var r=this.props[Rs];return!r||"number"!=typeof r||Date.now()-r>e}properties(){var t={};return Mn(this.props,((e,r)=>{var i=(t=>{var e=Sp[t];if(e)return e;for(var[r,i]of kp)if(0===t.indexOf(r))return i})(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,r===vs?()=>this.wr():()=>!1))return;i.transformToEventProperties&&On(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=On({},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(hr(t)){dr(e)&&(e="None"),this.Sr=dr(r)?this.Ir:r;var i=!1;if(Mn(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(hr(t)){this.Sr=dr(e)?this.Ir:e;var r=!1;if(Mn(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=oc(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);cr(Fn(t))||this.register(t),this.mr=!0}}update_search_keyword(){var t;this.register((t=null==pn?void 0:pn.referrer)?uc(t):{})}update_referrer_info(){var t;this.register_once({$referrer:cc(),$referring_domain:null!=pn&&pn.referrer&&(null==(t=jn(pn.referrer))?void 0:t.host)||hc},void 0)}set_initial_person_info(){this.props[Ls]||this.props[As]||this.register_once({[Fs]:dc(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Mn([As,Ls],(e=>{var r=this.props[e];r&&Mn(r,(function(e,r){t["$initial_"+nr(r)]=e}))}));var e,r,i=this.props[Fs];if(i){var n=(e=vc(i),r={},Mn(e,(function(t,e){r["$initial_"+nr(e)]=t})),r);On(t,n)}return t}safe_merge(t){return Mn(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[Jn]||{};r[t]=e,this.Tr(Jn,r),this.save()}remove_event_timer(t){var e=this.props[Jn]||{},r=e[t];return dr(r)||(delete e[t],this.Tr(Jn,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 Ip={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},Ep={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"},Rp={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"},Mp=En("[RateLimiter]");class Op{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=>{Mp.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void Mp.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(Ps))&&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(Ps,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Pp=En("[RemoteConfig]");class Lp{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=xn._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Mr(t){var e,r;null!=(e=xn.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=xn.__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 Pp.info("Using preloaded remote config",this.remoteConfig),this.Rr(this.remoteConfig),void this.Or();if(this._instance.Lr())return void Pp.warn("Remote config is disabled. Falling back to local config.");this.Mr((t=>{if(!t)return Pp.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){Pp.error("Error loading remote config",t)}}stop(){this.Fr&&(clearInterval(this.Fr),this.Fr=void 0)}refresh(){!this._instance.Lr()&&pn&&"hidden"!==pn.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||Pp.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 Ap=3e3;class Fp{constructor(t,e){this.Ar=!0,this.Nr=[],this.$r=Ir((null==e?void 0:e.flush_interval_ms)||Ap,250,5e3,In.createLogger("flush interval"),Ap),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&&ur(r.data)&&Mn(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 Mn(this.Nr,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;dr(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.Nr=[],t}}var Np=["retriesPerformedSoFar"];class $p{constructor(t){this.Br=!1,this.zr=3e3,this.Nr=[],this._instance=t,this.Nr=[],this.Vr=!0,!dr(dn)&&"onLine"in dn.navigator&&(this.Vr=dn.navigator.onLine,this.Wr=()=>{this.Vr=!0,this.Zr()},this.Gr=()=>{this.Vr=!1},Dn(dn,"online",this.Wr),Dn(dn,"offline",this.Gr))}get length(){return this.Nr.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,Np);yr(e)&&(n.url=Ml(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)"),In.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,dr(dn)||(this.Wr&&(dn.removeEventListener("online",this.Wr),this.Wr=void 0),this.Gr&&(dn.removeEventListener("offline",this.Gr),this.Gr=void 0)),this.Nr))try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(t){In.error(t)}this.Nr=[]}}class Dp{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(){Dn(dn,"scroll",this.Yr,{capture:!0}),Dn(dn,"scrollend",this.Yr,{capture:!0}),Dn(dn,"resize",this.Yr)}scrollElement(){if(!this.ei)return null==dn?void 0:dn.document.documentElement;var t=ur(this.ei)?this.ei:[this.ei];for(var e of t){var r=null==dn?void 0:dn.document.querySelector(e);if(r)return r}}scrollY(){if(this.ei){var t=this.scrollElement();return t&&t.scrollTop||0}return dn&&(dn.scrollY||dn.pageYOffset||dn.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var t=this.scrollElement();return t&&t.scrollLeft||0}return dn&&(dn.scrollX||dn.pageXOffset||dn.document.documentElement.scrollLeft)||0}}var qp=t=>dc(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({[Os]:r})}},this._instance=t,this.si=e,this.ni=r,this.ii=i||qp,this.si.onSessionId(this.ti)}ri(){return this.ni.props[Os]}getSetOnceProps(){var t,e=null==(t=this.ri())?void 0:t.props;return e?"r"in e?vc(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 Mn(Fn(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+nr(r)]=e})),t}}class Up{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 Hp=En("[SessionId]");class Bp{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 Up,this.hi=(t,e)=>!(!yr(t)||!yr(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||Vu,this.fi=r||Vu;var n=this.qt.persistence_name||this.qt.token;if(this._sessionTimeoutMs=1e3*Ir(this.qt.session_idle_timeout_seconds||1800,60,36e3,Hp.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=Jl.F(this.gi),o=Jl.F(this.mi);s&&!o?this.ci=s:Jl.q(this.gi),Jl.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){Hp.error("Invalid sessionID in bootstrap",t)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return dr(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&&Jl.R()}xi(t){t!==this.ci&&(this.ci=t,this.yi()&&Jl.N(this.gi,t))}Si(){return this.ci?this.ci:this.yi()?Jl.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({[cs]:[e,t,r]}))}ki(){var t=this.ni.props[cs];return ur(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&&dn&&(dn.removeEventListener(Qs,this.li,{capture:!1}),this.li=void 0),this.ui=[]}wi(){this.li=()=>{this.yi()&&Jl.q(this.mi)},Dn(dn,Qs,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=yr(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(),Hp.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=yr(i)&&t&&!a?i:r,d=yr(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 zp=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&Xe(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>Xe(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},Vp="custom",Wp="i.posthog.com",Zp=/^\/static\//;class Gp{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("."+Wp,".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":Vp),this.Ii[this.apiHost]}Ti(t){var e=this.instance.config.__preview_external_dependency_versioned_paths;if("string"==typeof e&&Zp.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===Vp)return this.apiHost+e;var i=Wp+e;switch(t){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var Qp=En("[PostHog ExternalIntegrations]"),Jp={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Yp{constructor(t){this._instance=t}lr(t,e){var r;null==(r=xn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return Qp.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,s;!i||null!=(r=xn.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.lr(Jp[e],(()=>{var r;null==(r=xn.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=xn.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e]&&(null==(s=xn.__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 Kp,Xp={},tg=0,eg=()=>{},rg='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ig="Surveys module not available",ng="sanitize_properties is deprecated. Use before_send instead",sg="Invalid value for property_denylist config: ",og="posthog",ag=!Il&&-1===(null==wn?void 0:wn.indexOf("MSIE"))&&-1===(null==wn?void 0:wn.indexOf("Mozilla")),ug=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:$n(null==pn?void 0:pn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:eg,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:gn&&vr(null==gn?void 0:gn.search)&&-1!==gn.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==dn||null==(e=dn.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){In.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:Zs,before_send:void 0,request_queue_config:{flush_interval_ms:Ap},error_tracking:{},_onCapture:eg,__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))},lg=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],hg=t=>{var e={};for(var[r,i]of lg)dr(t[r])||(e[i]=t[r]);var n=On({},e,t);return ur(t.property_blacklist)&&(dr(t.property_denylist)?n.property_denylist=t.property_blacklist:ur(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:In.error(sg+t.property_denylist)),n};class cg{constructor(){this.__forceAllowLocalhost=!1}get Ei(){return this.__forceAllowLocalhost}set Ei(t){In.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class dg{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===Bs&&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 cg,this.Oi=!1,this.version=Cn.LIB_VERSION,this.Li=new Up,this.Pi=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ug(),this.SentryIntegration=wp,this.sentryIntegration=t=>function(t,e){var r=_p(t,e);return{name:bp,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 Dp(this),this.pageViewManager=new xp(this),this.rateLimiter=new Op(this),this.requestRouter=new Gp(this),this.consent=new vp(this),this.externalIntegrations=new Yp(this);var e=null!==(t=dg.__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=vr(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=vr(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>In.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==og){var i,n=null!==(i=Xp[r])&&void 0!==i?i:new dg;return n._init(t,e,r),Xp[r]=n,Xp[og][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n,s;if(void 0===e&&(e={}),dr(t)||fr(t))return In.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(On({},ug(e.defaults),hg(e),{name:i,token:t})),this.config.on_xhr_error&&In.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Gu.GZipJS;var o=this.Hi();this.persistence=new Tp(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Tp(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 Fp((t=>this.Bi(t)),this.config.request_queue_config),this.zi=new $p(this),this.__request_queue=[];var l=this.Ri();if(l||(this.sessionManager=new Bp(this),this.sessionPropsManager=new jp(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(In.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Vi(l)}),0)):(In.info("Initializing extensions synchronously"),this.Vi(l)),Cn.DEBUG=Cn.DEBUG||this.config.debug,Cn.DEBUG&&In.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(Ms);if(e.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===Vs)this.identify(h);else if(e.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===Ws)In.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(Vu()),f=e.bootstrap.isIdentifiedID?v:h;this.persistence.set_property(Ms,e.bootstrap.isIdentifiedID?Ws:Vs),this.register({distinct_id:h,$device_id:f})}}if(l)this.register_once({distinct_id:Ds,$device_id:null},"");else if(!this.get_distinct_id()){var p=this.config.get_device_id(Vu());this.register_once({distinct_id:p,$device_id:p},""),this.persistence.set_property(Ms,Vs)}return Dn(dn,"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()||Vu();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(Ms,Ws)),e()},n=r.user();"then"in n&&lr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||yp.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()||(yp.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(yp.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,Js),identify:t=>e(t,Ks),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Wi())):this.Wi(),lr(this.config._onCapture)&&this.config._onCapture!==eg&&(In.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&In.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({},dg.__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,gp)),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){In.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({[qs]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[js]:i}),this.config.__preview_deferred_init_extensions&&In.info("PostHog extensions initialized ("+i+"ms)")}Rr(t){var e;if(!pn||!pn.body)return In.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=rr(t.supportedCompression,Gu.GZipJS)?Gu.GZipJS:rr(t.supportedCompression,Gu.Base64)?Gu.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ni?this.Ni:Zs}),this.Pi.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Wi(){try{this.config.loaded(this)}catch(t){In.critical("`loaded` function failed",t)}if(this.Ji(),this.config.internal_or_test_user_hostname&&null!=gn&&gn.hostname){var t=gn.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 Lp(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()&&Rn(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(Ys),null==(e=this.logs)||e.flushLogs("sendBeacon"),null==(r=this.Ui)||r.unload(),null==(i=this.zi)||i.unload()):this.Xi()&&this.capture(Ys,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(ag?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Ml(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=Al(s.url,s.compression);var o=null!==(e=s.transport)&&void 0!==e?e:"fetch",a=Fl.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===Gu.GZipJS&&_n&&!Rl?Ll(s).then((t=>{u(t)})).catch((e=>{if(Ge(e))return Rl=!0,void u(r({},s,{compression:void 0,url:Al(t.url,void 0)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Ge(t)||e===Ze})(e)&&(Rl=!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){tg++;try{var e,r=[],i=[],n=[];Rn(t,(t=>{if(t)if(ur(e=t[0]))n.push(t);else if(lr(t))try{t.call(this)}catch(e){In.error("Error executing queued PostHog call",t,e)}else ur(t)&&"alias"===e?r.push(t):ur(t)&&-1!==e.indexOf("capture")&&lr(this[e])?n.push(t):i.push(t)}));var s=function(t,e){Rn(t,(function(t){try{if(ur(t[0])){var r=e;Mn(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){In.error("Error executing queued PostHog call",t,e)}}))};s(r,this),s(i,this),s(n,this)}finally{tg--}}push(t){if(tg>0&&ur(t)&&vr(t[0])){var e=dg.prototype[t[0]];lr(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(!dr(t)&&vr(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&&!vr(null==e?void 0:e.$current_url)&&(In.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||In.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)||Vu(),f={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===Js&&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!==Xs,t===Ks);if(p&&(f.$set_once=p),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=f,a=t=>vr(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),ur(e)?(i=[],Rn(e,(e=>{i.push(t(e))}))):(i={},Mn(e,((e,r)=>{u.has(e)||(i[r]=t(e,r))}))),i);var i}(o)),f.timestamp=d,dr(null==i?void 0:i.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=c),t===yu.DISMISSED||t===yu.SENT){var g=null==e?void 0:e[bu.SURVEY_ID],m=null==e?void 0:e[bu.SURVEY_ITERATION];$u({id:g,current_iteration:m}),f.$set=r({},f.$set,{[ku({id:g,current_iteration:m},t===yu.SENT?"responded":"dismissed")]:!0})}else t===yu.SHOWN&&(f.$set=r({},f.$set,{[bu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===Ep.SHOWN){var y=null==e?void 0:e[Rp.TOUR_TYPE];y&&(f.$set=r({},f.$set,{[Rp.TOUR_LAST_SEEN_DATE+"/"+y]:(new Date).toISOString()}))}var b=r({},f.properties.$set,f.$set);if(cr(b)||this.setPersonPropertiesForFlags(b),!gr(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};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Bi(w):this.Ui.enqueue(w),f}In.critical("This capture call is ignored due to client rate limiting.")}}else In.error("No event name provided to posthog.capture")}else In.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,(!vr(a.distinct_id)&&!mr(a.distinct_id)||fr(a.distinct_id))&&In.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(!wn)return{};var o,a=t?[...rc,...e||[]]:[],[u,l]=function(t){for(var e=0;Ci.length>e;e++){var[r,i]=Ci[e],n=r.exec(t),s=n&&(lr(i)?i(n,t):i);if(s)return s}return["",""]}(wn);return On(Fn({$os:u,$os_version:l,$browser:xi(wn,navigator.vendor),$device:Ti(wn),$device_type:Ii(wn,{userAgentDataPlatform:null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,maxTouchPoints:null==(i=navigator)?void 0:i.maxTouchPoints,screenWidth:null==dn||null==(n=dn.screen)?void 0:n.width,screenHeight:null==dn||null==(s=dn.screen)?void 0:s.height,devicePixelRatio:null==dn?void 0:dn.devicePixelRatio}),$timezone:fc(),$timezone_offset:pc()}),{$current_url:Bn(null==gn?void 0:gn.href,a,nc),$host:null==gn?void 0:gn.host,$pathname:null==gn?void 0:gn.pathname,$raw_user_agent:wn.length>1e3?wn.substring(0,997)+"...":wn,$browser_version:ki(wn,navigator.vendor),$browser_language:lc(),$browser_language_prefix:(o=lc(),"string"==typeof o?o.split("-")[0]:void 0),$screen_height:null==dn?void 0:dn.screen.height,$screen_width:null==dn?void 0:dn.screen.width,$viewport_height:null==dn?void 0:dn.innerHeight,$viewport_width:null==dn?void 0:dn.innerWidth,$lib:Cn.LIB_NAME,$lib_version:Cn.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&&On(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&On(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===Vp&&(a.$lib_custom_api_host=this.config.api_host),l=t!==Js||s?t!==Ys||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=On(a,l),t===Js&&pn&&(a.title=pn.title),!dr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}wn&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=On({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),ur(this.config.property_denylist)?Mn(this.config.property_denylist,(function(t){delete a[t]})):In.error(sg+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(In.error(ng),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=On({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&(In.error(ng),o=a(o,"$set_once")),e&&(this.Oi=!0),cr(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:ig}),()=>{})}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:ig})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:ig})}renderSurvey(t,e){var r;null==(r=this.surveys)||r.renderSurvey(t,e)}displaySurvey(t,e){var r;void 0===e&&(e=qu),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:ig}}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:ig})}un(t){return!t||fr(t)?(In.critical("Unique user id has not been set in posthog.identify"),!1):t===Ds?(In.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())||(In.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 In.uninitializedWarning("posthog.identify");if(mr(t)&&(t=t.toString(),In.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(Gn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(Qn)&&(this.unregister(Qn),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(Ms)||Vs)===Vs;t!==i&&s?(this.persistence.set_property(Ms,Ws),this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!1),this.capture(Ks,{distinct_id:t,$anon_distinct_id:i},{$set:e||{},$set_once:r||{}}),this.$i=$l(t,e,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(e||r)&&this.setPersonProperties(e,r),t!==i&&(this.reloadFeatureFlags(),this.unregister(Ts))}}setPersonProperties(t,e){if((t||e)&&this.sn("posthog.setPersonProperties")){var r=$l(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):In.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(Xs,o)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else In.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(In.info("reset"),!this.__loaded)return In.uninitializedWarning("posthog.reset");var l=this.get_property(Gn);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),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(Ms,Vs),null==(u=this.sessionManager)||u.resetSessionId(),this.$i=null,this.config.cookieless_mode===zs)this.register_once({distinct_id:Ds,$device_id:null},"");else{var h=this.config.get_device_id(Vu());this.register_once({distinct_id:h,$device_id:t?h:l},"")}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(Zn)?(In.critical("Attempting to create alias for existing People user - aborting."),-2):this.sn("posthog.alias")?(dr(e)&&(e=this.get_distinct_id()),t!==e?(this.an(Qn,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(In.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(hr(t)){var i,n,s,o,a,u,l,h,c,d;On(this.config,hg(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 Tp(r({},this.config,{persistence:"sessionStorage"}),v);var f=this.Di(this.config.debug);br(f)&&(this.config.debug=f),br(this.config.debug)&&(this.config.debug?(Cn.DEBUG=!0,Vl.R()&&Vl.N("ph_debug",!0),In.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(Cn.DEBUG=!1,Vl.R()&&Vl.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){Cn.LIB_NAME=t,Cn.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:dg.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:og;return e!==og&&(e=og+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Ms))===Ws||(null==(e=this.sessionPersistence)?void 0:e.get_property(Ms))===Ws}nn(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Zs&&!this._isIdentified()&&cr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Qn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Ns]))}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?(In.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.an(Ns,!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!==Bs)}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 Bp(this),this.pageViewManager=new xp(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=dg.__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==Bs&&(null==(l=this.surveys)||l.loadIfEnabled()),(dr(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 In.warn(rg)}opt_out_capturing(){var t,e,r;this.config.cookieless_mode!==zs?(this.config.cookieless_mode===Bs&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===Bs&&(this.register({distinct_id:Ds,$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())):In.warn(rg)}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===Bs?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return fn?zp(fn,this.config.custom_blocked_useragents):void 0}Ki(){pn&&("visible"===pn.visibilityState?this.Fi||(this.Fi=!0,this.capture(Js,{title:pn.title},{send_instantly:!0}),this.Ai&&(pn.removeEventListener(Gs,this.Ai),this.Ai=null)):this.Ai||(this.Ai=this.Ki.bind(this),Dn(pn,Gs,this.Ai)))}debug(t){!1===t?(null==dn||dn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==dn||dn.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?(In.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=In,n=(e="advanced_disable_flags")in(t=o)&&!gr(t[e]),s=r in t&&!gr(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(gr(this.config.before_send))return t;var e=ur(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),gr(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return rr(er,t.event)?In.warn(n+". This can cause unexpected behavior."):In.info(n),null}r.properties&&!cr(r.properties)||In.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=br(t)&&!t,r=Vl.R()&&"true"===Vl.A("ph_debug");return!e&&(!!r||t)}}dg.__defaultExtensionClasses={},dg.dn={trace:Kp=()=>{},debug:Kp,info:Kp,warn:Kp,error:Kp,fatal:Kp},function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=An(t.prototype[e[r]])}(dg,["identify"]);var vg=En("[ExceptionAutocapture]"),fg=En("[TracingHeaders]"),pg=En("[Web Vitals]"),gg=9e5,mg="disabled",yg="lazy_loading",bg="awaiting_config",_g="missing_config";En("[SessionRecording]"),En("[SessionRecording]");var wg="[SessionRecording]",xg=En(wg),Sg=En("[Heatmaps]");function kg(t){return hr(t)&&"clientX"in t&&"clientY"in t&&mr(t.clientX)&&mr(t.clientY)}var Cg=En("[Product Tours]"),Tg=["$set_once","$set"],Ig=En("[SiteApps]"),Eg="Error while initializing PostHog app with config id ";function Rg(t,e,r){if(gr(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 Mg{constructor(t){this.vn=new Up,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;dr(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(!dr(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(!Rg(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=>Rg(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&Rg((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=>Rg(t.text,e.text,e.text_matching||"exact")||Rg(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;!gr(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=>Rg(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||jl(e.properties.reduce(((t,e)=>{var r=ur(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 Og{constructor(t){this._instance=t,this.Tn=new Map,this.En=new Map,this.Mn=new Map}Pn(t,e){return!!t&&jl(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===hu.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;dr(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 Mg(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,hu.Activation),this.En=this.Rn(t,hu.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,hu.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,hu.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 Pg extends Og{constructor(t){super(t)}$n(){return ks}Dn(){return yu.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 Ru}Un(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ks]:t})}Hn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Lg="SDK is not enabled or survey functionality is not yet loaded",Ag="Disabled. Not loading surveys.",Fg=null!=dn&&dn.location?zn(dn.location.hash,"__posthog")||zn(location.hash,"state"):null,Ng="_postHogToolbarParams",$g=En("[Toolbar]"),Dg=En("[FeatureFlags]"),qg=En("[FeatureFlags]",{debugEnabled:!0}),jg="\" failed. Feature flags didn't load in time.",Ug=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},Hg=t=>{var e={};for(var[r,i]of Pn(t||{}))i&&(e[r]=i);return e},Bg="Refusing to render web experiment since the viewer is a likely bot",zg={icontains:(t,e)=>!!dn&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!dn&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!dn&&Nl(e.href,t),not_regex:(t,e)=>!!dn&&!Nl(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class Vg{get qt(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Vg.zn("retrieved web experiments from the server"),e.Vn=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;e.Vn&&(Vg.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);vr(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];Vg.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())Vg.zn(Bg);else if(!this.qt.disable_web_experiments){if(gr(this.Vn))return this.Vn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Vg.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=Vg.getWindowLocation();if(null!=t&&t.search){var e=Hn(null==t?void 0:t.search,"__experiment_id"),r=Hn(null==t?void 0:t.search,"__experiment_variant");e&&r&&(Vg.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&&(Vg.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!gr(t.conditions)&&Vg.Qn(t)&&Vg.Jn(t)}static Qn(t){var e;if(gr(t.conditions)||gr(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,s=Vg.getWindowLocation();return!!s&&(null==(r=t.conditions)||!r.url||zg[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,s))}static getWindowLocation(){return null==dn?void 0:dn.location}static Jn(t){var e;if(gr(t.conditions)||gr(null==(e=t.conditions)?void 0:e.utm))return!0;var r=oc();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];In.info("[WebExperiments] "+t,r)}Wn(t,e,r){this._is_bot()?Vg.zn(Bg):"control"!==e?r.forEach((r=>{if(r.selector){var i;Vg.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)}))}})):Vg.zn("Control variants leave the page unmodified.")}_is_bot(){return fn&&this._instance?zp(fn,this.qt.custom_blocked_useragents):void 0}}var Wg=En("[Conversations]"),Zg="Conversations not available yet.",Gg={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,Dg.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||(Dg.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||Dg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}cs(){return this.hs().length>0}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:dr(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(gs),e=this.os(bs),i=this.os(_s);if(!i&&!e)return t||{};var n=On({},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=dr(h)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!h,d=dr(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||(Dg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.Kn=!0),n}getFlagVariants(){var t=this.os(vs),e=this.os(bs);if(!e)return t||{};for(var r=On({},t),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Kn||(Dg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Kn=!0),r}getFlagPayloads(){var t=this.os(ms),e=this.os(_s);if(!e)return t||{};for(var r=On({},t||{}),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Kn||(Dg.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.ds||(this._instance.Li.emit("featureFlagsReloading",!0),this.ds=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.ds),this.ds=void 0}ensureFlagsLoaded(){this.Yn||this.Xn||this.ds||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.es=t}vs(t){var e;if(this.fs(),!this._instance.Lr())if(this.Xn)this.ts=!0;else{var i=this.qt.token,n=this.os(Gn),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(ws)||{}),group_properties:this.os(xs),timezone:fc()};pr(n)||dr(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._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:o,data:s,compression:this.qt.disable_compression?void 0:Gu.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 a,u=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(u&&o.push("quota_limited"),null==(i=this.ni)||i.register({[Es]:o}),u)Dg.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(a=t.json)&&void 0!==a?a:{},n,{partialResponse:!!this.qt.advanced_only_evaluate_survey_feature_flags}),this.ts&&(this.ts=!1,this.vs())}}})}}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 Dg.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(ys)||void 0,u=this.os(Rs)||void 0,l=this.os(Ts)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var h,c=this._instance.get_session_id(),d=this.os(Is);c&&c!==d&&(l={},null==(h=this.ni)||h.register({[Ts]:l,[Is]: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;ur(l[t])?l[t].push(o):l[t]=[o],null==(v=this.ni)||v.register({[Ts]:l});var S=this.getFeatureFlagDetails(t),k=[...null!==(f=this.os(Es))&&void 0!==f?f:[]];dr(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};dr(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),dr(null==S?void 0:S.original_variant)&&dr(null==S?void 0:S.original_enabled)||(C.$feature_flag_original_response=dr(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(!dr(s))try{E=JSON.parse(s)}catch(t){}return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:E}}}}else Dg.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()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.qt.disable_compression?void 0:Gu.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 dr(r)?void 0:!!r}Dg.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]})))):Dg.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(ur(l)){Dg.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({[fs]:l,[vs]: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({[fs]:Object.keys(Hg(p)),[vs]:p||{},[ms]:g||{},[gs]:m||{}},c?{[ys]:c}:{},d?{[Rs]:d}:{}))}}}(t,this.ni,n,s,o,i),e||(this.ss=!1),this.ps(e)}}override(t,e){void 0===e&&(e=!1),Dg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.ni)return Dg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.ni.unregister(bs),this.ni.unregister(_s),this.ps(),qg.info("All overrides cleared");if(ur(t)){var e=Ug(t);return this.ni.register({[bs]:e}),this.ps(),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(bs),qg.info("Flag overrides cleared");else if(i.flags){if(ur(i.flags)){var n=Ug(i.flags);this.ni.register({[bs]:n})}else this.ni.register({[bs]:i.flags});qg.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.ni.unregister(_s),qg.info("Payload overrides cleared")):i.payloads&&(this.ni.register({[_s]:i.payloads}),qg.info("Payload overrides set",{payloads:i.payloads}))),void this.ps()}if(t&&"object"==typeof t)return this.ni.register({[bs]:t}),this.ps(),qg.info("Flag overrides set",{flags:t});Dg.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Yn){var{flags:e,flagVariants:r}=this.gs();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this.os(ps)||[]).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({[fs]:Object.keys(Hg(u)),[vs]:u}),this.ps()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this.os(ps),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(ps),null==(i=this.ni)||i.register({[ps]:n}),t(n)}}})}gs(){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)),{})}}ps(t){var{flags:e,flagVariants:r}=this.gs();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.os(ws)||{},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({[ws]:r({},i,o,n)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ws)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.os(xs)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[xs]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.os(xs)||{};this._instance.register({[xs]:r({},e,{[t]:{}})})}else this._instance.unregister(xs)}reset(){this.Yn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.fs(),this.Kn=!1}}},Qg={sessionRecording:class{get qt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var t;return!(null==(t=this.ys)||!t.isStarted)}get status(){var t,e;return this.bs===bg||this.bs===_g?this.bs:null!==(t=null==(e=this.ys)?void 0:e.status)&&void 0!==t?t:this.bs}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=mg,this._s=void 0,this._instance=t,!this._instance.sessionManager)throw xg.error("started without valid sessionManager"),new Error(wg+" started without valid sessionManager. This is a bug.");if(this.qt.cookieless_mode===zs)throw new Error(wg+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get ws(){var t,e=!(null==(t=this._instance.get_property(os))||!t.enabled),r=!this.qt.disable_session_recording,i=this.qt.disable_session_recording||this._instance.consent.isOptedOut();return dn&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.ws||null==(e=this.ys)||!e.isStarted){var r=!dr(Object.assign)&&!dr(Array.from);this.ws&&r?(this.xs(t),xg.info("starting")):(this.bs=mg,this.stopRecording())}}xs(t){var e,r,i;this.ws&&(this.bs!==bg&&this.bs!==_g&&(this.bs=yg),null!=xn&&null!=(e=xn.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=xn.__PosthogExtensions__)&&r.initSessionRecording?this.Ss(t):null==(i=xn.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.ks,(e=>{if(e)return xg.error("could not load recorder",e);this.Ss(t)})))}stopRecording(){var t,e;null==(t=this._s)||t.call(this),this._s=void 0,null==(e=this.ys)||e.stop()}Cs(){var t,e;null==(t=this._s)||t.call(this),this._s=void 0,null==(e=this.ys)||e.discard()}Is(){var t;null==(t=this.ni)||t.unregister(ds)}Ts(t,e){if(gr(t))return null;var r,i=mr(t)?t:parseFloat(t);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(xg.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):i}Es(t){if(this.ni){var e,i,n=this.ni,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.Ts(null==(e=this.qt.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.Ts(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;gr(a)&&this.Is();var u=null==i?void 0:i.minimumDurationMilliseconds;n.register({[os]: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:dr(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._s)||e.call(this),this._s=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){return"sessionRecording"in t?!1===t.sessionRecording?(this.Es(t),void this.Cs()):(this.Es(t),void this.startIfEnabledOrStop()):(this.bs===bg&&(this.bs=_g,xg.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.ys)&&r.log?this.ys.log(t,e):xg.warn("log called before recorder was ready")}get ks(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(os);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}Ms(){var t,e,r=this._instance.get_property(os);if(!r)return!1;try{e="object"==typeof r?r:JSON.parse(r)}catch(t){return xg.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}Ss(t){var e,r;if(null==(e=xn.__PosthogExtensions__)||!e.initSessionRecording)return xg.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Us]:!0});if(this.ys||(this.ys=null==(r=xn.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ms()){if(this.bs===_g||this.bs===bg)return;return this.bs=bg,xg.info("persisted remote config is stale, requesting fresh config before starting"),void new Lp(this._instance).load()}this.bs=yg,this.ys.start(t)}onRRwebEmit(t){var e;null==(e=this.ys)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.ys||null==(e=this.ni)||e.register({[us]:!0}),null==(t=this.ys)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.ys||null==(e=this.ni)||e.register({[as]:!0}),null==(t=this.ys)||t.overrideSampling()}overrideTrigger(t){var e,r;this.ys||null==(r=this.ni)||r.register({["url"===t?ls:hs]:!0}),null==(e=this.ys)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.ys)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.ys)||!r.tryAddCustomEvent(t,e))}}},Jg={autocapture:class{constructor(t){this.Ps=!1,this.Rs=null,this.Os=!1,this.instance=t,this.rageclicks=new ep(t.config.rageclick),this.Ls=null}initialize(){this.startIfEnabled()}get qt(){var t,e,r=hr(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}Fs(){if(this.isBrowserSupported()){if(dn&&pn){var t=t=>{t=t||(null==dn?void 0:dn.event);try{this.As(t)}catch(t){ip.error("Failed to capture event",t)}};if(Dn(pn,"submit",t,{capture:!0}),Dn(pn,"change",t,{capture:!0}),Dn(pn,"click",t,{capture:!0}),this.qt.capture_copied_text){var e=t=>{t=t||(null==dn?void 0:dn.event);try{this.As(t,rp)}catch(t){ip.error("Failed to capture copy/cut event",t)}};Dn(pn,"copy",e,{capture:!0}),Dn(pn,"cut",e,{capture:!0})}}}else ip.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ps&&(this.Fs(),this.Ps=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Os=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Yn]:!!t.autocapture_opt_out}),this.Rs=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Ls=t}getElementSelectors(t){var e,r=[];return null==(e=this.Ls)||e.forEach((e=>{var i=null==pn?void 0:pn.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[Yn];if(pr(this.Rs)&&!br(r)&&!this.instance.Lr())return!1;var i=null!==(e=this.Rs)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!i}As(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=fo(t);oo(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(!dn||_o(t))return!1;var r,i,n;if(br(e)?(r=!!e&&bo,i=void 0):(r=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:bo,i=null==e?void 0:e.content_ignorelist),!1===r)return!1;var{targetElementList:s}=wo(t,!1);return!function(t,e){if(!1===t||dr(t))return!1;var r;if(!0===t)r=yo;else{if(!ur(t))return!1;if(t.length>10)return In.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:vo(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!go(s,r)}(i,this.instance.config.rageclick)&&this.As(t,"$rageclick");var n=e===rp;if(i&&function(t,e,r,i,n){var s,o,a,u;if(void 0===r&&(r=void 0),!dn||_o(t))return!1;if(null!=(s=r)&&s.url_allowlist&&!lo(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&lo(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}=wo(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(dr(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(!go(c,null==(u=r)?void 0:u.css_selector_allowlist))return!1;var d=dn.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&&(po.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}(i,t,this.qt,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=op(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.Os});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),e===rp){var u,l=co(null==dn||null==(u=dn.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 lr(null==pn?void 0:pn.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Ns=(null==dn||null==(e=dn.location)?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(In.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.$s&&this.$s(),this.$s=void 0,In.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(dn&&dn.history){var r=this;null!=(t=dn.history.pushState)&&t.__posthog_wrapped__||Vn(dn.history,"pushState",(t=>function(e,i,n){t.call(this,e,i,n),r.Ds("pushState")})),null!=(e=dn.history.replaceState)&&e.__posthog_wrapped__||Vn(dn.history,"replaceState",(t=>function(e,i,n){t.call(this,e,i,n),r.Ds("replaceState")})),this.qs()}}Ds(t){try{var e,r=null==dn||null==(e=dn.location)?void 0:e.pathname;if(!r)return;r!==this.Ns&&this.isEnabled&&this._instance.capture(Js,{navigation_type:t}),this.Ns=r}catch(e){In.error("Error capturing "+t+" pageview",e)}}qs(){if(!this.$s){var t=()=>{this.Ds("popstate")};Dn(dn,"popstate",t),this.$s=()=>{dn&&dn.removeEventListener("popstate",t)}}}},heatmaps:class{get qt(){return this.instance.config}constructor(t){var e;this.js=!1,this.Ps=!1,this.Hs=null,this.instance=t,this.js=!(null==(e=this.instance.persistence)||!e.props[Kn]),this.rageclicks=new ep(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return hr(this.qt.capture_heatmaps)&&this.qt.capture_heatmaps.flush_interval_milliseconds&&(t=this.qt.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return gr(this.qt.capture_heatmaps)?gr(this.qt.enable_heatmaps)?this.js:this.qt.enable_heatmaps:!1!==this.qt.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ps)return;Sg.info("starting..."),this.Us(),this.At()}else{var t;clearInterval(null!==(t=this.Hs)&&void 0!==t?t:void 0),this.Bs(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Kn]:e}),this.js=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.M;return this.M=void 0,t}zs(t){this.Mt(t.originalEvent,"deadclick")}At(){this.Hs&&clearInterval(this.Hs),this.Hs="visible"===(null==pn?void 0:pn.visibilityState)?setInterval(this.Zr.bind(this),this.flushIntervalMilliseconds):null}Us(){dn&&pn&&(this.Vs=this.Zr.bind(this),Dn(dn,Qs,this.Vs),this.Ws=t=>this.Mt(t||(null==dn?void 0:dn.event)),Dn(pn,"click",this.Ws,{capture:!0}),this.Zs=t=>this.Gs(t||(null==dn?void 0:dn.event)),Dn(pn,"mousemove",this.Zs,{capture:!0}),this.Qs=new mp(this.instance,pp,this.zs.bind(this)),this.Qs.startIfEnabledOrStop(),this.Js=this.At.bind(this),Dn(pn,Gs,this.Js),this.Ps=!0)}Bs(){var t;dn&&pn&&(this.Vs&&dn.removeEventListener(Qs,this.Vs),this.Ws&&pn.removeEventListener("click",this.Ws,{capture:!0}),this.Zs&&pn.removeEventListener("mousemove",this.Zs,{capture:!0}),this.Js&&pn.removeEventListener(Gs,this.Js),clearTimeout(this.Ks),null==(t=this.Qs)||t.stop(),this.Ps=!1)}Ys(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&&no(i)&&!so(i,"body");){if(i===r)return!1;if(rr(e,null==dn?void 0:dn.getComputedStyle(i).position))return!0;i=mo(i)}return!1}(fo(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"),!io(t.target)&&kg(t)){var n=this.Ys(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.Xs(r({},n,{type:"rageclick"})),this.Xs(n)}}Gs(t){!io(t.target)&&kg(t)&&(clearTimeout(this.Ks),this.Ks=setTimeout((()=>{this.Xs(this.Ys(t,"mousemove"))}),500))}Xs(t){if(dn){var e=dn.location.href,r=this.qt.custom_personal_data_properties,i=this.qt.mask_personal_data_properties?[...rc,...r||[]]:[],n=Bn(e,i,nc);this.M=this.M||{},this.M[n]||(this.M[n]=[]),this.M[n].push(t)}}Zr(){this.M&&!cr(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:mp,webVitalsAutocapture:class{constructor(t){var e;this.js=!1,this.Ps=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.eo=()=>{clearTimeout(this.ro),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,i=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(dr(i))pg.error("Could not read session ID. Dropping metrics!");else{this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.io();dr(n)||(gr(null==t?void 0:t.name)||gr(null==t?void 0:t.value)?pg.error("Invalid metric received",t):!this.no||this.no>t.value?(this.M.url!==n&&(this.eo(),this.ro=setTimeout(this.eo,this.flushToCaptureTimeoutMs)),dr(this.M.url)&&(this.M.url=n),this.M.firstMetricTimestamp=dr(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.M.metrics.push(r({},t,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.M.metrics.length===this.allowedMetrics.length&&this.eo()):pg.error("Ignoring metric with value >= "+this.no,t))}},this.so=()=>{if(!this.Ps){var t,e,r,i,n=xn.__PosthogExtensions__;dr(n)||dr(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.Ps=!0):pg.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.js=!(null==(e=this._instance.persistence)||!e.props[rs]),this.startIfEnabled()}get oo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=hr(this.oo)?null==(t=this.oo)?void 0:t.web_vitals_allowed_metrics:void 0;return gr(r)?(null==(e=this._instance.persistence)?void 0:e.props[ss])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(hr(this.oo)?this.oo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=hr(this.oo)?this.oo.web_vitals_attribution:void 0;return null!=t&&t}get no(){var t=hr(this.oo)&&mr(this.oo.__web_vitals_max_value)?this.oo.__web_vitals_max_value:gg;return t>0&&6e4>=t?gg:t}get isEnabled(){var t=null==gn?void 0:gn.protocol;if("http:"!==t&&"https:"!==t)return pg.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=hr(this.oo)?this.oo.web_vitals:br(this.oo)?this.oo:void 0;return br(e)?e:this.js}startIfEnabled(){this.isEnabled&&!this.Ps&&(pg.info("enabled, starting..."),this.lr(this.so))}onRemoteConfig(t){if("capturePerformance"in t){var e=hr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=hr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[rs]:e}),this._instance.persistence.register({[ss]:r})),this.js=e,this.startIfEnabled()}}lr(t){var e,r;null!=(e=xn.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks?t():null==(r=xn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(e=>{e?pg.error("failed to load script",e):t()}))}io(){var t=dn?dn.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...rc,...e||[]]:[];return Bn(t,r,nc)}pg.error("Could not determine current URL")}}},Yg={exceptionObserver:class{constructor(t){var e,r,i;this.so=()=>{var t;if(dn&&this.isEnabled&&null!=(t=xn.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=xn.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=xn.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=xn.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ao&&this.qt.capture_unhandled_errors&&(this.ao=e(this.captureException.bind(this))),!this.uo&&this.qt.capture_unhandled_rejections&&(this.uo=r(this.captureException.bind(this))),!this.lo&&this.qt.capture_console_errors&&(this.lo=i(this.captureException.bind(this)))}catch(t){vg.error("failed to start",t),this.ho()}}},this._instance=t,this.co=!(null==(e=this._instance.persistence)||!e.props[Xn]),this.do=new Er({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:vg}),this.qt=this.vo(),this.startIfEnabledOrStop()}vo(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return hr(t)?e=r({},e,t):(dr(t)?this.co: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?(vg.info("enabled"),this.ho(),this.lr(this.so)):this.ho()}lr(t){var e,r;null!=(e=xn.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=xn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return vg.error("failed to load script",e);t()}))}ho(){var t,e,r;null==(t=this.ao)||t.call(this),this.ao=void 0,null==(e=this.uo)||e.call(this),this.uo=void 0,null==(r=this.lo)||r.call(this),this.lo=void 0}onRemoteConfig(t){"autocaptureExceptions"in t&&(this.co=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Xn]:this.co}),this.qt=this.vo(),this.startIfEnabledOrStop())}onConfigChange(){this.qt=this.vo()}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.do.consumeRateLimit(n)?vg.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.fo=[],this.po=pf(),this._instance=t,this.fo=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(ts))&&void 0!==e?e:[],this.mo=ln(this.yo()),this.bo=new hn(this.mo)}onConfigChange(){this.mo=ln(this.yo()),this.bo.setConfig(this.mo)}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.fo=n,this._instance.persistence&&this._instance.persistence.register({[ts]:this.fo,[es]:s})}}get _o(){var t,e=!!this._instance.get_property(es),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.po.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.mo.enabled)try{if(!vr(t)||0===t.trim().length)return void ff.warn("Ignoring exception step because message must be a non-empty string");var i=this.wo(e),{sanitizedProperties:n,droppedKeys:s}=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((r,i)=>an.has(i)?(e.push(i),r):(r[i]=t[i],r)),{}),droppedKeys:e}}(i);s.length>0&&ff.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.bo.add(r({[sn]:t,[on]:(new Date).toISOString()},n))}catch(t){ff.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.xo(e)){if(this.So(e))return this.ko("Exception dropped: matched a suppression rule"),void ff.info("Skipping exception capture because a suppression rule matched");if(!this._o&&this.Co(e))return this.ko("Exception dropped: thrown by a browser extension"),void ff.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Io(e))return this.ko("Exception dropped: thrown by the PostHog SDK"),void ff.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.mo.enabled&&gr(t.$exception_steps)?this.To(t):t;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",en:!0});return i&&this.bo.clear(),i}catch(t){return ff.error("Failed to capture exception event. Dropping this exception.",t),void this.bo.clear()}}catch(t){return void ff.error("Failed to process exception event. Ignoring this exception.",t)}}To(t){try{var e=this.bo.getAttachable();return 0===e.length?t:r({},t,{$exception_steps:e})}catch(e){return ff.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}ko(t){this.mo.enabled&&this.bo.add({[sn]:t,[on]:(new Date).toISOString()})}wo(t){return hr(t)?r({},t):{}}yo(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}So(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:r,value:i}=e;return vr(r)&&r.length>0&&t.$exception_types.push(r),vr(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.fo.some((t=>{var r=t.values.map((t=>{var r,i=Dl[t.operator],n=ur(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)}))}Co(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://")))}Io(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}xo(t){return!gr(t)&&ur(t)}}},Kg=r({productTours:class{get ni(){return this._instance.persistence}constructor(t){this.Eo=null,this.Mo=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){"productTours"in t&&(this.ni&&this.ni.register({[ns]:!!t.productTours}),this.loadIfEnabled())}loadIfEnabled(){var t,e;this.Eo||(t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(ns)||this.lr((()=>this.Po()))}lr(t){var e,r;null!=(e=xn.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=xn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?Cg.error("Could not load product tours script",e):t()}))}Po(){var t;!this.Eo&&null!=(t=xn.__PosthogExtensions__)&&t.generateProductTours&&(this.Eo=xn.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!ur(this.Mo)||e){var r=this.ni;if(r){var i=r.props[Cs];if(ur(i)&&!e)return this.Mo=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 Cg.error(n),void t([],{isLoaded:!1,error:n})}var s=ur(e.json.product_tours)?e.json.product_tours:[];this.Mo=s,r&&r.register({[Cs]:s}),t(s,{isLoaded:!0})}})}else t(this.Mo,{isLoaded:!0})}getActiveProductTours(t){gr(this.Eo)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Eo.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Eo)||e.showTourById(t)}previewTour(t){this.Eo?this.Eo.previewTour(t):this.lr((()=>{var e;this.Po(),null==(e=this.Eo)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Eo)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Eo)||t.nextStep()}previousStep(){var t;null==(t=this.Eo)||t.previousStep()}clearCache(){var t;this.Mo=null,null==(t=this.ni)||t.unregister(Cs)}resetTour(t){var e;null==(e=this.Eo)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Eo)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Eo)||e.cancelPendingTour(t)}}},Gg),Xg={siteApps:class{constructor(t){this._instance=t,this.Ro=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Oo(t,e){if(e){var r=this.globalsForEvent(e);this.Ro.push(r),this.Ro.length>1e3&&(this.Ro=this.Ro.slice(10))}}get siteAppLoaders(){var t;return null==(t=xn._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Oo.bind(this));this.Lo=()=>{t(),this.Ro=[],this.Lo=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,Tg),{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.Ro.length&&(Ig.info("Processing "+this.Ro.length+" events for site app with id "+t.id),this.Ro.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.Lo)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,Ig.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){Ig.error(Eg+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){Ig.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}Fo(){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)}Ao(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){Ig.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.Fo(),void this._instance.on("eventCaptured",(t=>this.Ao(t)))):void Ig.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.Lo)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var s=function(t){var e;xn["__$$ph_site_app_"+t]=n._instance,null==(e=xn.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return Ig.error(Eg+t,e)}))};for(var{id:o,url:a}of t.siteApps)s(o)}else Ig.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},tm={tracingHeaders:class{constructor(t){this.No=void 0,this.$o=void 0,this.so=()=>{var t,e,r=this.Do()||[];dr(this.No)&&(null==(t=xn.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(r,this._instance.get_distinct_id(),this._instance.sessionManager)),dr(this.$o)&&(null==(e=xn.__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=xn.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(r=xn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return fg.error("failed to load script",e);t()}))}Do(){var t;return null!==(t=this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var t,e;this.Do()?this.lr(this.so):(null==(t=this.No)||t.call(this),null==(e=this.$o)||e.call(this),this.No=void 0,this.$o=void 0)}}},em=r({surveys:class{get qt(){return this._instance.config}constructor(t){this.qo=void 0,this._surveyManager=null,this.jo=!1,this.Ho=[],this.Uo=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.qt.disable_surveys){var e=t.surveys;if(gr(e))return Ru.warn("Flags not loaded yet. Not loading surveys.");var r=ur(e);this.qo=r?e.length>0:e,Ru.info("flags response received, isSurveysEnabled: "+this.qo),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith(Lu)||null!=r&&r.startsWith(Au))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.jo)Ru.info("Already initializing surveys, skipping...");else if(this.qt.disable_surveys)Ru.info(Ag);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())Ru.info("Not loading surveys in cookieless mode without consent.");else{var t=null==xn?void 0:xn.__PosthogExtensions__;if(t){if(!dr(this.qo)||this.qt.advanced_enable_surveys){var e=this.qo||this.qt.advanced_enable_surveys;this.jo=!0;try{var r=t.generateSurveys;if(r)return void this.Bo(r,e);var i=t.loadExternalDependency;if(!i)return void this.zo(Hs);i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.zo("Could not load surveys script",r):this.Bo(t.generateSurveys,e)}))}catch(t){throw this.zo("Error initializing surveys",t),t}finally{this.jo=!1}}}else Ru.error("PostHog Extensions not found.")}}Bo(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Pg(this._instance),Ru.info("Surveys loaded successfully"),this.Vo({isLoaded:!0})}zo(t,e){Ru.error(t,e),this.Vo({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ho.push(t),this._surveyManager&&this.Vo({isLoaded:!0}),()=>{this.Ho=this.Ho.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.qt.disable_surveys)return Ru.info(Ag),t([]);var r,i=this._instance.get_property(Ss);if(i&&!e)return t(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.Uo?this.Uo.then((e=>{var{surveys:r,context:i}=e;return t(r,i)})):("undefined"!=typeof Promise&&(this.Uo=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.Uo=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;Ru.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=>Mu(t)&&(Ou(t)||Pu(t))));l.length>0&&(null==(a=this._surveyEventReceiver)||a.register(l)),null==(i=this._instance.persistence)||i.register({[Ss]:u});var h={isLoaded:!0};t(u,h),null==r||r({surveys:u,context:h})}}))}Vo(t){for(var e of this.Ho)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Ru.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!gr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Ru.warn("init was not called")}Wo(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}Zo(t){if(gr(this._surveyManager))return{eligible:!1,reason:Lg};var e="string"==typeof t?this.Wo(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(gr(this._surveyManager))return Ru.warn("init was not called"),{visible:!1,disabledReason:Lg};var e=this.Zo(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return gr(this._surveyManager)?(Ru.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Lg})):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.Zo(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if(gr(this._surveyManager))Ru.warn("init was not called");else{var n="string"==typeof t?this.Wo(t):t;if(null!=n&&n.id)if(Du.includes(n.type)){var s=null==pn?void 0:pn.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Ru.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Ru.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),Ru.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Ru.warn("Survey element not found")}else Ru.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Ru.warn("Survey not found")}}displaySurvey(t,e){var i;if(gr(this._surveyManager))Ru.warn("init was not called");else{var n=this.Wo(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!==_u.Popover&&e.initialResponses&&Ru.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 Ru.warn("Survey is not eligible to be displayed: ",o.disabledReason)}e.displayType!==_u.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Ru.warn("Survey not found")}}cancelPendingSurvey(t){gr(this._surveyManager)?Ru.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}},Gg),rm={toolbar:class{constructor(t){this.instance=t}Go(t){xn.ph_toolbar_state=t}Qo(){var t;return null!==(t=xn.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),qn(this.instance.config))return!1;if(!dn||!pn)return!1;t=null!=t?t:dn.location,r=null!=r?r:dn.history;try{if(!e){try{dn.localStorage.setItem("test","test"),dn.localStorage.removeItem("test")}catch(t){return!1}e=null==dn?void 0:dn.localStorage}var i,n=Fg||zn(t.hash,"__posthog")||zn(t.hash,"state"),s=n?Ln((()=>JSON.parse(atob(decodeURIComponent(n)))))||Ln((()=>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(Ng)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(t){return!1}}Jo(t){var e=xn.ph_load_toolbar||xn.ph_load_editor;!gr(e)&&lr(e)?e(t,this.instance):$g.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==pn||!pn.getElementById($s));if(!dn||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(dn.localStorage.setItem(Ng,JSON.stringify(r({},n,{source:void 0}))),2===this.Qo())this.Jo(n);else if(0===this.Qo()){var s;this.Go(1),null==(s=xn.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return $g.error("[Toolbar] Failed to load",t),void this.Go(0);this.Go(2),this.Jo(n)})),Dn(dn,"turbolinks:load",(()=>{this.Go(0),this.loadToolbar(n)}))}return!0}Ko(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)}}},im=r({experiments:Vg},Gg),nm={conversations:class{constructor(t){this.Yo=void 0,this._conversationsManager=null,this.Xo=!1,this.ea=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;gr(e)||(br(e)?this.Yo=e:(this.Yo=e.enabled,this.ea=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Yo=void 0,this.ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Xo||this._instance.config.disable_conversations||qn(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==xn?void 0:xn.__PosthogExtensions__;if(t&&!dr(this.Yo)&&this.Yo)if(this.ea&&this.ea.token){this.Xo=!0;try{var e=t.initConversations;if(e)return this.ta(e),void(this.Xo=!1);var r=t.loadExternalDependency;if(!r)return void this.ra(Hs);r(this._instance,"conversations",(e=>{e||!t.initConversations?this.ra("Could not load conversations script",e):this.ta(t.initConversations),this.Xo=!1}))}catch(t){this.ra("Error initializing conversations",t),this.Xo=!1}}else Wg.error("Conversations enabled but missing token in remote config.")}}ta(t){if(this.ea)try{this._conversationsManager=t(this.ea,this._instance),Wg.info("Conversations loaded successfully")}catch(t){this.ra("Error completing conversations initialization",t)}else Wg.error("Cannot complete initialization: remote config is null")}ra(t,e){Wg.error(t,e),this._conversationsManager=null,this.Xo=!1}show(){this._conversationsManager?this._conversationsManager.show():Wg.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Yo&&!pr(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):(Wg.warn(Zg),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(Wg.warn(Zg),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(Wg.warn(Zg),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(Wg.warn(Zg),null)}))()}requestRestoreLink(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(t):(Wg.warn(Zg),null)}))()}restoreFromToken(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(t):(Wg.warn(Zg),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Wg.warn(Zg),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()}}},sm={logs:class{constructor(t){var e;this.ia=!1,this.na=!1,this.Gt=En("[logs]"),this.sa=[],this.oa=0,this.aa=0,this.ua=!1,this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.ia=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e,r=null==(e=t.logs)?void 0:e.captureConsoleLogs;!gr(r)&&r&&(this.ia=!0,this.loadIfEnabled())}reset(){this.sa=[],this.qr&&(clearTimeout(this.qr),this.qr=void 0),this.oa=0,this.aa=0,this.ua=!1}loadIfEnabled(){if(this.ia&&!this.na){var t=null==xn?void 0:xn.__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.na=!0)})):this.Gt.error(Hs)}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.aa||(this.aa=h,this.oa=0,this.ua=!1),l>this.oa){this.oa++;var c=function(t,e){var i=t.level||"info",{text:n,number:s}=Ei[i]||Ri,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:Oi(u)};return t.trace_id&&(l.traceId=t.trace_id),t.span_id&&(l.spanId=t.span_id),dr(t.trace_flags)||(l.flags=t.trace_flags),l}(t,this.la());this.sa.push({record:c}),(null!==(o=null==(a=this._instance.config.logs)?void 0:a.maxBufferSize)&&void 0!==o?o:100)>this.sa.length?this.ha():this.flushLogs()}else this.ua||(this.Gt.warn("captureLog dropping logs: exceeded "+l+" logs per "+u+"ms"),this.ua=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.ca||(this.ca={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.ca}flushLogs(t){if(this.qr&&(clearTimeout(this.qr),this.qr=void 0),0!==this.sa.length){var e=this.sa;this.sa=[];var i=this._instance.config.logs,n=r({"service.name":(null==i?void 0:i.serviceName)||"unknown_service"},(null==i?void 0:i.environment)&&{"deployment.environment":i.environment},(null==i?void 0:i.serviceVersion)&&{"service.version":i.serviceVersion},null==i?void 0:i.resourceAttributes),s=function(t,e,r,i){return{resourceLogs:[{resource:{attributes:Oi(e)},scopeLogs:[{scope:{name:r,version:i},logRecords:t}]}]}}(e.map((t=>t.record)),n,Cn.LIB_NAME,Cn.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})}}ha(){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))}la(){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!=xn&&null!=(t=xn.location)&&t.href&&(e.currentUrl=xn.location.href),this._instance.featureFlags){var i=this._instance.featureFlags.getFlags();i&&i.length>0&&(e.activeFeatureFlags=i)}return e}}},om=r({},Gg,Qg,Jg,Yg,Kg,Xg,em,tm,rm,im,nm,sm);dg.__defaultExtensionClasses=r({},om);var am,um=(am=Xp[og]=new dg,function(){function t(){t.done||(t.done=!0,ag=!1,Mn(Xp,(function(t){t._dom_loaded()})))}null!=pn&&pn.addEventListener?"complete"===pn.readyState?t():Dn(pn,"DOMContentLoaded",t,{capture:!1}):dn&&In.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),am);export{Gu as Compression,Ip as DEFAULT_PRODUCT_TOUR_APPEARANCE,_u as DisplaySurveyType,dg as PostHog,Ep as ProductTourEventName,Rp as ProductTourEventProperties,yu as SurveyEventName,bu as SurveyEventProperties,hu as SurveyEventType,du as SurveyPosition,gu as SurveyQuestionBranchingType,pu as SurveyQuestionType,mu as SurveySchedule,vu as SurveyTabPosition,fu as SurveyType,cu as SurveyWidgetType,um as default,um as posthog,Zu 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 H(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?H(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}function N(t,e){var r,i;try{i=new URL(t,null!=e?e: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}var D=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,q=/^(?:[a-z+]+:)?\/\//i,j=/^www\..*/i,U=/^(data:)([^,]*),(.*)/i;function H(t,e){return(t||"").replace(D,((t,r,i,n,s,o)=>{var a,u=i||s||o,l=r||n||"";if(!u)return t;if(q.test(u)||j.test(u))return"url("+l+u+l+")";if(U.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 B,z,V="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",W=4096,Z=1,G=new RegExp("[^a-z0-9-_:]"),Q=-2;function J(){return Z++}var Y=/^[^ \t\n\r\u000c]+/,K=/^[, \t\n\r\u000c]+/,X=new WeakMap;function tt(t,e){return e&&""!==e.trim()?et(t,e):e}function et(t,e){var r=X.get(t);if(r||(r=t.createElement("a"),X.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function rt(t,e,r,i,n,s){if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){var o=tt(t,i);if("img"===e&&o.startsWith("data:")&&n){var a=o;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(a=function(t,e,r,i){if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>W||t.naturalHeight>W)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,o,s.type,s.quality)),(null==s?void 0:s.maxBase64ImageLength)&&(u=a,a=(l=s.maxBase64ImageLength)&&u.length>l?V:u),a}return o}return"xlink:href"===r&&"#"!==i[0]?tt(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(Y);if(","===s.slice(-1))s=tt(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=tt(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?H(i,et(t)):"object"===e&&"data"===r?tt(t,i):i:tt(t,i);var u,l}function it(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function nt(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&nt(C.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&nt(C.parentNode(t),e,r)}function st(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(nt(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}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:D}=e,{preserveWhiteSpace:q=!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;D||(D=st(t,o,a,void 0===D));var j,U=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 G.test(e)?"div":e}(t),_={},w=t.attributes.length,x=0;w>x;x++){var S=t.attributes[x];it(b,S.name)||(_[S.name]=rt(s,b,L(S.name),S.value,t,c))}if("link"===b&&u){var k=function(t){return t.href}(t);if(k){var T=ot(s,k);!T&&k.includes(".css")&&(T=ot(s,window.location.origin+"/"+k.replace(window.location.href,"")));var I=null;T&&(I=R(T)),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){B||(B=s.createElement("canvas"),z=B.getContext("2d"));var q=t,j=q.currentSrc||q.getAttribute("src")||"<unknown-src>",U=q.crossOrigin,H=()=>{q.removeEventListener("load",H);try{B.width=q.naturalWidth,B.height=q.naturalHeight,z.drawImage(q,0,0),_.rr_dataURL=B.toDataURL(c.type,c.quality)}catch(t){if("anonymous"!==q.crossOrigin)return q.crossOrigin="anonymous",void(q.complete&&0!==q.naturalWidth?H():q.addEventListener("load",H));console.warn("Cannot inline img src="+j+"! Error: "+t)}"anonymous"===q.crossOrigin&&(U?_.crossOrigin=U:q.removeAttribute("crossorigin"))};q.complete&&0!==q.naturalWidth?H():q.addEventListener("load",H)}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:Z,left:Q,top:J}=t.getBoundingClientRect();_={class:_.class,rr_width:W+"px",rr_height:Z+"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:(Y=t,Boolean("svg"===Y.tagName||Y.ownerSVGElement)||void 0),needBlock:y,rootId:m,isCustom:n};var Y}(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=H(u,et(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:D,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:S,newlyAddedElement:k});if(!U)return console.warn(t,"not serialized"),null;j=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"===N(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}(U,v)&&(q||U.type!==f.Text||U.isStyle||U.textContent.replace(/^\s+|\s+$/gm,"").length)?J():Q;var V=Object.assign(U,{id:j});if(i.add(t,V),j===Q)return null;y&&y(t);var W=!u;if(V.type===f.Element){W=W&&!V.needBlock,delete V.needBlock;var Z=C.shadowRoot(t);Z&&E(Z)&&(V.isShadowHost=!0)}if((V.type===f.Document||V.type===f.Element)&&W){v.headWhitespace&&V.type===f.Element&&"head"===V.tagName&&(q=!1);var Y={doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:D,maskTextClass:o,maskTextSelector:a,skipChild:u,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:q,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:S,depth:M+1,maxDepth:O};if(V.type===f.Element&&"textarea"===V.tagName&&void 0!==V.attributes.value);else for(var K of Array.from(C.childNodes(t))){var X=ct(K,Y);X&&V.childNodes.push(X)}var tt=null;if(T(t)&&(tt=C.shadowRoot(t)))for(var nt of Array.from(C.childNodes(tt))){var dt=ct(nt,Y);dt&&(E(tt)&&(dt.isShadow=!0),V.childNodes.push(dt))}}var vt=C.parentNode(t);return vt&&I(vt)&&E(vt)&&(V.isShadow=!0),V.type===f.Element&&"iframe"===V.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:D,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:q,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:S,depth:M+1,maxDepth:O});r&&b(t,r)}}),_),V.type===f.Element&&"link"===V.tagName&&"string"==typeof V.attributes.rel&&("stylesheet"===V.attributes.rel||"preload"===V.attributes.rel&&"string"==typeof V.attributes.href&&"css"===N(V.attributes.href))&&function(t,e,r){var i,n=!1;try{i=t.sheet}catch(t){return}if(!i){var s=setTimeout((()=>{n||(e(),n=!0)}),r);t.addEventListener("load",(()=>{clearTimeout(s),n=!0,e()}))}}(t,(()=>{if(w){var e=ct(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:D,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,preserveWhiteSpace:q,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:S,depth:M,maxDepth:O});e&&w(t,e)}}),x),V}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(nt(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)===Q}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=Q;r===Q;)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:st(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"),!it(r.tagName,i))if(o.attributes[i]=rt(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 Yt(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 Kt(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}=Kt(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}=Kt(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}=Kt(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}=Kt(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}=Kt(e.parentStyleSheet,i,n.styleMirror);return(u&&-1!==u||l&&-1!==l)&&r({id:u,styleId:l,adds:[{rule:o,index:[...Yt(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}=Kt(e.parentStyleSheet,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,removes:[{index:[...Yt(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}=Kt(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:Yt(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}=Kt(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:Yt(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(J)),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}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)),Y.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)})}),Y=new ne({mirror:Re,mutationCb:Z,stylesheetManager:J,recordCrossOriginIframes:I,wrappedEmit:ye});for(var K of L||[])K.getMirror&&K.getMirror({nodeMirror:Re,crossOriginIframeMirror:Y.crossOriginIframeMirror,crossOriginIframeStyleMirror:Y.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:Y,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)&&Y.addIframe(t),Mt(t,Re)&&J.trackLinkElement(t),Ot(t)&&tt.addShadowRoot(C.shadowRoot(t),document)},onIframeLoad(t,e){Y.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&&Y.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:Y,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)};Y.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)}})),Y.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(),Y.removeLoadListener(),Y.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="NativeGzipValidationError",Ge=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Qe=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Ze,e},Je=function(){var t=e((function*(t,e){18>t.size&&Qe("too-short");var r=new Uint8Array(yield t.slice(0,10).arrayBuffer());31===r[0]&&139===r[1]&&8===r[2]||Qe("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)&&Qe("invalid-crc");var n=e.length>>>0;i.getUint32(4,!0)!==n&&Qe("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function Ye(){return Ye=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 Je(l,n),l}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),null}})),Ye.apply(this,arguments)}var Ke=["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"],Xe=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return Ke.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))},tr=function(t){return t.MinLength="min_length",t.MaxLength="max_length",t}({}),er=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function rr(t,e){return-1!==t.indexOf(e)}var ir=function(t){return t.trim()},nr=function(t){return t.replace(/^\$/,"")},sr=Object.prototype,or=sr.hasOwnProperty,ar=sr.toString,ur=Array.isArray||function(t){return"[object Array]"===ar.call(t)},lr=t=>"function"==typeof t,hr=t=>t===Object(t)&&!ur(t),cr=t=>{if(hr(t)){for(var e in t)if(or.call(t,e))return!1;return!0}return!1},dr=t=>void 0===t,vr=t=>"[object String]"==ar.call(t),fr=t=>vr(t)&&0===t.trim().length,pr=t=>null===t,gr=t=>dr(t)||pr(t),mr=t=>"[object Number]"==ar.call(t)&&t==t,yr=t=>mr(t)&&t>0,br=t=>"[object Boolean]"===ar.call(t),_r=t=>t instanceof FormData;function wr(t){return null===t||"object"!=typeof t}function xr(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Sr(t){return"undefined"!=typeof Event&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var kr=[!0,"true",1,"1","yes"],Cr=t=>rr(kr,t),Tr=[!1,"false",0,"0","no"];function Ir(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),mr(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),Ir(n||r,e,r,i))}class Er{constructor(t){this.$t={},this.zt=t.zt,this.Zt=Ir(t.bucketSize,0,100,t.Gt),this.Qt=Ir(t.refillRate,0,this.Zt,t.Gt),this.Jt=Ir(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 Rr,Mr,Or,Pr="Mobile",Lr="iOS",Ar="Android",Fr="Tablet",Nr=Ar+" "+Fr,$r="iPad",Dr="Apple",qr=Dr+" Watch",jr="Safari",Ur="BlackBerry",Hr="Samsung",Br=Hr+"Browser",zr=Hr+" Internet",Vr="Chrome",Wr=Vr+" OS",Zr=Vr+" "+Lr,Gr="Internet Explorer",Qr=Gr+" "+Pr,Jr="Opera",Yr=Jr+" Mini",Kr="Edge",Xr="Microsoft "+Kr,ti="Firefox",ei=ti+" "+Lr,ri="Nintendo",ii="PlayStation",ni="Xbox",si=Ar+" "+Pr,oi=Pr+" "+jr,ai="Windows",ui=ai+" Phone",li="Nokia",hi="Ouya",ci="Generic",di=ci+" "+Pr.toLowerCase(),vi=ci+" "+Fr.toLowerCase(),fi="Konqueror",pi="(\\d+(\\.\\d+)?)",gi=new RegExp("Version/"+pi),mi=new RegExp(ni,"i"),yi=new RegExp(ii+" \\w+","i"),bi=new RegExp(ri+" \\w+","i"),_i=new RegExp(Ur+"|PlayBook|BB10","i"),wi={"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"},xi=function(t,e){return e=e||"",rr(t," OPR/")&&rr(t,"Mini")?Yr:rr(t," OPR/")?Jr:_i.test(t)?Ur:rr(t,"IE"+Pr)||rr(t,"WPDesktop")?Qr:rr(t,Br)?zr:rr(t,Kr)||rr(t,"Edg/")?Xr:rr(t,"FBIOS")?"Facebook "+Pr:rr(t,"UCWEB")||rr(t,"UCBrowser")?"UC Browser":rr(t,"CriOS")?Zr:rr(t,"CrMo")||rr(t,Vr)?Vr:rr(t,Ar)&&rr(t,jr)?si:rr(t,"FxiOS")?ei:rr(t.toLowerCase(),fi.toLowerCase())?fi:((t,e)=>e&&rr(e,Dr)||function(t){return rr(t,jr)&&!rr(t,Vr)&&!rr(t,Ar)}(t))(t,e)?rr(t,Pr)?oi:jr:rr(t,ti)?ti:rr(t,"MSIE")||rr(t,"Trident/")?Gr:rr(t,"Gecko")?ti:""},Si={[Qr]:[new RegExp("rv:"+pi)],[Xr]:[new RegExp(Kr+"?\\/"+pi)],[Vr]:[new RegExp("("+Vr+"|CrMo)\\/"+pi)],[Zr]:[new RegExp("CriOS\\/"+pi)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+pi)],[jr]:[gi],[oi]:[gi],[Jr]:[new RegExp("(Opera|OPR)\\/"+pi)],[ti]:[new RegExp(ti+"\\/"+pi)],[ei]:[new RegExp("FxiOS\\/"+pi)],[fi]:[new RegExp("Konqueror[:/]?"+pi,"i")],[Ur]:[new RegExp(Ur+" "+pi),gi],[si]:[new RegExp("android\\s"+pi,"i")],[zr]:[new RegExp(Br+"\\/"+pi)],[Gr]:[new RegExp("(rv:|MSIE )"+pi)],Mozilla:[new RegExp("rv:"+pi)]},ki=function(t,e){var r=xi(t,e),i=Si[r];if(dr(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},Ci=[[new RegExp(ni+"; "+ni+" (.*?)[);]","i"),t=>[ni,t&&t[1]||""]],[new RegExp(ri,"i"),[ri,""]],[new RegExp(ii,"i"),[ii,""]],[_i,[Ur,""]],[new RegExp(ai,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[ui,""];if(new RegExp(Pr).test(e)&&!/IEMobile\b/.test(e))return[ai+" "+Pr,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=wi[r[1]]||"";return/arm/i.test(e)&&(i="RT"),[ai,i]}return[ai,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[Lr,[t[3],t[4],t[5]||"0"].join(".")]:[Lr,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=dr(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Ar+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ar+")","i"),t=>t&&t[2]?[Ar,[t[2],t[3],t[4]||"0"].join(".")]:[Ar,""]],[/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/,[Wr,""]],[/Linux|debian/i,["Linux",""]]],Ti=function(t){return bi.test(t)?ri:yi.test(t)?ii:mi.test(t)?ni:new RegExp(hi,"i").test(t)?hi:new RegExp("("+ui+"|WPDesktop)","i").test(t)?ui:/iPad/.test(t)?$r:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?qr:_i.test(t)?Ur:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(li,"i").test(t)?li:/(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(Pr).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)?Ar:Nr:new RegExp("(pda|"+Pr+")","i").test(t)?di:new RegExp(Fr,"i").test(t)&&!new RegExp(Fr+" pc","i").test(t)?vi:""},Ii=function(t,e){var r,i,n,s,o=Ti(t);return o===$r||o===Nr||"Kobo"===o||"Kindle Fire"===o||o===vi?Fr:o===ri||o===ni||o===ii||o===hi?"Console":o===qr?"Wearable":o?Pr:"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)?Pr:Fr:"Desktop"},Ei={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}},Ri=Ei.info;function Mi(t){if(br(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(ur(t))return{arrayValue:{values:t.map((t=>Mi(t)))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}function Oi(t){var e=[];for(var r in t){var i=t[r];pr(i)||dr(i)||e.push({key:r,value:Mi(i)})}return e}function Pi(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}function Li(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return Or&&r.length===Mr||(Mr=r.length,Or=r.reduce(((r,i)=>{Rr||(Rr={});var n=Rr[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,Rr[i]=[u,l];break}}return r}),{})),Or}}class Ai{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&&ur(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:Li(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 Fi="?";function Ni(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?Fi:r,in_app:!0};return dr(i)||(s.lineno=i),dr(n)||(s.colno=n),s}var $i=(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]:Fi,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Di=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,qi=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ji=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ui=(t,e)=>{var r=Di.exec(t);if(r){var[,i,n,s]=r;return Ni(e,i,Fi,+n,+s)}var o=qi.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=ji.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[u,l]=$i(o[1]||Fi,o[2]);return Ni(e,l,u,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Hi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Bi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,zi=(t,e)=>{var r=Hi.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=Bi.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]||Fi;return[s,n]=$i(s,n),Ni(e,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Vi=/\(error: (.*)\)/,Wi=50;class Zi{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=vr(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 xr(t,"DOMException")}isDOMError(t){return xr(t,"DOMError")}}class Gi{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 Qi{constructor(){}match(t){return xr(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 Ji=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Yi{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(Ji);return i&&(e=i[1],r=i[2]),[e,r]}}var Ki=["fatal","error","warning","log","info","debug"];function Xi(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 tn{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 Sr(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: "+Xi(t)}isSeverityLevel(t){return vr(t)&&!fr(t)&&Ki.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 en{match(t){return Sr(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Xi(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class rn{match(t){return wr(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 nn{match(t){return xr(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Sr(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 wr(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 sn="$message",on="$timestamp",an=new Set([sn,on]),un={enabled:!0,max_bytes:32768};function ln(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:un.enabled,max_bytes:cn(t.max_bytes,un.max_bytes)}:r({},un)}class hn{constructor(t){this.Yt=[],this.Xt=0,this.qt=ln(t)}setConfig(t){this.qt=ln(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(!hr(r))return;var i=r,n=i[sn],s=i[on];if(!vr(n)||0===n.trim().length)return;if(!vr(s)&&!mr(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 cn(t,e){if(!mr(t)||t===1/0||t===-1/0)return e;var r=Math.floor(t);return 0>r?e:r}var dn="undefined"!=typeof window?window:void 0,vn="undefined"!=typeof globalThis?globalThis:dn;"undefined"==typeof self&&(vn.self=vn),"undefined"==typeof File&&(vn.File=function(){});var fn=null==vn?void 0:vn.navigator,pn=null==vn?void 0:vn.document,gn=null==vn?void 0:vn.location,mn=null==vn?void 0:vn.fetch,yn=null!=vn&&vn.XMLHttpRequest&&"withCredentials"in new vn.XMLHttpRequest?vn.XMLHttpRequest:void 0,bn=null==vn?void 0:vn.AbortController,_n=null==vn?void 0:vn.CompressionStream,wn=null==fn?void 0:fn.userAgent,xn=null!=dn?dn:{},Sn=t=>t instanceof Document,kn="1.373.3",Cn={DEBUG:!1,LIB_VERSION:kn,LIB_NAME:"web",JS_SDK_VERSION:kn},Tn=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={k(e){if(dn&&(Cn.DEBUG||xn.POSTHOG_DEBUG||r)&&!dr(dn.console)&&dn.console){for(var i=("__rrweb_original__"in dn.console[e]?dn.console[e].__rrweb_original__:dn.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)=>Tn(t+" "+e,r)};return i},In=Tn("[PostHog.js]"),En=In.createLogger;function Rn(t,e){ur(t)&&t.forEach(e)}function Mn(t,e){if(!gr(t))if(ur(t))t.forEach(e);else if(_r(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)or.call(t,r)&&e(t[r],r)}var On=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 Pn(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 Ln=function(t){try{return t()}catch(t){return}},An=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){In.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),In.critical(t)}}},Fn=function(t){var e={};return Mn(t,(function(t,r){(vr(t)&&t.length>0||mr(t))&&(e[r]=t)})),e};var Nn=["herokuapp.com","vercel.app","netlify.app"];function $n(t){var e=null==t?void 0:t.hostname;if(!vr(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of Nn)if(r===i)return!1;return!0}function Dn(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 qn(t){return"ph_toolbar_internal"===t.name}var jn=t=>{var e=null==pn?void 0:pn.createElement("a");return dr(e)?null:(e.href=t,e)},Un=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return Mn(t,(function(t,e){dr(t)||dr(e)||"undefined"===e||(r=encodeURIComponent(t instanceof File?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},Hn=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(!ur(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){In.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Bn=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("=");ur(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 Vn(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return lr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}function Wn(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 Zn="$people_distinct_id",Gn="$device_id",Qn="__alias",Jn="__timers",Yn="$autocapture_disabled_server_side",Kn="$heatmaps_enabled_server_side",Xn="$exception_capture_enabled_server_side",ts="$error_tracking_suppression_rules",es="$error_tracking_capture_extension_exceptions",rs="$web_vitals_enabled_server_side",is="$dead_clicks_enabled_server_side",ns="$product_tours_enabled_server_side",ss="$web_vitals_allowed_metrics",os="$session_recording_remote_config",as="$replay_override_sampling",us="$replay_override_linked_flag",ls="$replay_override_url_trigger",hs="$replay_override_event_trigger",cs="$sesid",ds="$session_is_sampled",vs="$enabled_feature_flags",fs="$active_feature_flags",ps="$early_access_features",gs="$feature_flag_details",ms="$feature_flag_payloads",ys="$feature_flag_request_id",bs="$override_feature_flags",_s="$override_feature_flag_payloads",ws="$stored_person_properties",xs="$stored_group_properties",Ss="$surveys",ks="$surveys_activated",Cs="ph_product_tours",Ts="$flag_call_reported",Is="$flag_call_reported_session_id",Es="$feature_flag_errors",Rs="$feature_flag_evaluated_at",Ms="$user_state",Os="$client_session_props",Ps="$capture_rate_limit",Ls="$initial_campaign_params",As="$initial_referrer_info",Fs="$initial_person_info",Ns="$epp",$s="__POSTHOG_TOOLBAR__",Ds="$posthog_cookieless",qs="$sdk_debug_extensions_init_method",js="$sdk_debug_extensions_init_time_ms",Us="$sdk_debug_recording_script_not_loaded",Hs="PostHog loadExternalDependency extension not found.",Bs="on_reject",zs="always",Vs="anonymous",Ws="identified",Zs="identified_only",Gs="visibilitychange",Qs="beforeunload",Js="$pageview",Ys="$pageleave",Ks="$identify",Xs="$groupidentify",to=1,eo=3,ro=11;function io(t){return t instanceof Element&&(t.id===$s||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function no(t){return!!t&&t.nodeType===to}function so(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function oo(t){return!!t&&t.nodeType===eo}function ao(t){return!!t&&t.nodeType===ro&&no(t.host)}function uo(t){return t?ir(t).split(/\s+/):[]}function lo(t){var e=null==dn?void 0:dn.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function ho(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 uo(e)}function co(t){return gr(t)?null:ir(t).split(/(\s+)/).filter((t=>Mo(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function vo(t){var e="";return xo(t)&&!So(t)&&t.childNodes&&t.childNodes.length&&Mn(t.childNodes,(function(t){var r;oo(t)&&t.textContent&&(e+=null!==(r=co(t.textContent))&&void 0!==r?r:"")})),ir(e)}function fo(t){return dr(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var po=["a","button","form","input","select","textarea","label"];function go(t,e){if(dr(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 mo(t){var e=t.parentNode;return!(!e||!no(e))&&e}var yo=["next","previous","prev",">","<"],bo=[".ph-no-rageclick",".ph-no-capture"];var _o=t=>!t||so(t,"html")||!no(t),wo=(t,e)=>{if(!dn||_o(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!so(n,"body");)if(ao(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=mo(n);if(!s)break;if(e||po.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=dn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function xo(t){for(var e=t;e.parentNode&&!so(e,"body");e=e.parentNode){var r=ho(e);if(rr(r,"ph-sensitive")||rr(r,"ph-no-capture"))return!1}if(rr(ho(t),"ph-include"))return!0;var i=t.type||"";if(vr(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!vr(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 So(t){return!!(so(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||so(t,"select")||so(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var ko="(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})",Co=new RegExp("^(?:"+ko+")$"),To=new RegExp(ko),Io="\\d{3}-?\\d{2}-?\\d{4}",Eo=new RegExp("^("+Io+")$"),Ro=new RegExp("("+Io+")");function Mo(t,e){if(void 0===e&&(e=!0),gr(t))return!1;if(vr(t)){if(t=ir(t),(e?Co:To).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Eo:Ro).test(t))return!1}return!0}function Oo(t){var e=vo(t);return Mo(e=(e+" "+Po(t)).trim())?e:""}function Po(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Mn(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=vo(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Po(t)).trim())}catch(t){In.error("[AutoCapture]",t)}})),e}function Lo(t){return t.replace(/"|\\"/g,'\\"')}function Ao(t){var e=t.attr__class;return e?ur(e)?e:uo(e):void 0}var Fo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn: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"]},No=En("[Recorder]"),$o=t=>"navigation"===t.entryType,Do=t=>"resource"===t.entryType;function qo(t,e){return!!e&&(br(e)||e[t])}function jo(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(br(r))return!0;if(ur(r))return s(r);var o=r[e];return br(o)?o:s(o)}function Uo(t,e,r,i,n,s){return Ho.apply(this,arguments)}function Ho(){return Ho=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return No.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(Do(o=t[s])&&o.initiatorType===e&&(dr(i)||o.startTime>=i)&&(dr(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*s))),Uo(t,e,r,i,n,s+1))})),Ho.apply(this,arguments)}function Bo(t){var{body:e,options:r,url:i}=t;if(gr(e))return null;var{hostname:n,isHostDenied:s}=Wn(i,r);if(s)return n+" is in deny list";if(vr(e))return e;if(Sn(e))return e.textContent;if(_r(e))return Un(e);if(hr(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 zo=t=>!pr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function Vo(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:dr(a)?void 0:Math.round(a),endTime:dr(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(zo(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 Wo=["video/","audio/"];function Zo(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 Go(){return Go=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:s}=Wn(i,r);return s?Promise.resolve(n+" is in deny list"):Zo(e)})),Go.apply(this,arguments)}function Qo(){return Qo=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=Wo.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:u}=Wn(n,i);return u?a+" is in deny list":null}({r:e,options:r,url:i});return pr(n)?Zo(e):Promise.resolve(n)})),Qo.apply(this,arguments)}var Jo=null;function Yo(t,i,n){if(!("performance"in i))return()=>{};if(Jo)return No.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Fo,n):Fo,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=>$o(t)||Do(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>Vo({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=>$o(t)||Do(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>Vo({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=qo("request",r.recordHeaders),n=qo("response",r.recordHeaders),s=Vn(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=>(jo({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=Bo({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),jo({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=Bo({body:v.response,options:r,url:a})),Uo(e,"xmlhttprequest",f.url,c,d).then((e=>{var r=Vo({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=qo("request",i.recordHeaders),s=qo("response",i.recordHeaders),o=Vn(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),jo({type:"request",headers:v,url:e,recordBody:i.recordBody})&&(d.requestBody=yield function(t){return Go.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),jo({type:"response",headers:f,url:e,recordBody:i.recordBody})&&(d.responseBody=yield function(t){return Qo.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{Uo(r,"fetch",c.url,l,h).then((e=>{var r,i=Vo({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)),Jo=()=>{a(),u(),l(),Jo=null}}var Ko=t=>({name:"rrweb/network@1",observer:Yo,options:t});xn.__PosthogExtensions__=xn.__PosthogExtensions__||{},xn.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:We,getRecordNetworkPlugin:Ko},xn.__PosthogExtensions__.rrweb={record:Me,version:"v2",wasMaxDepthReached:()=>ht,resetMaxDepthState(){ht=!1,lt=!1}},xn.rrweb={record:Me,version:"v2"},xn.rrwebConsoleRecord={getRecordConsolePlugin:We},xn.getRecordNetworkPlugin=Ko;var Xo,ta,ea,ra,ia,na,sa,oa,aa,ua,la,ha,ca={},da=[],va=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,fa=Array.isArray;function pa(t,e){for(var r in e)t[r]=e[r];return t}function ga(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function ma(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?Xo.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 ya(t,o,i,n,null)}function ya(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?++ea:n,__i:-1,__u:0};return null==n&&null!=ta.vnode&&ta.vnode(s),s}function ba(t){return t.children}function _a(t,e){this.props=t,this.context=e}function wa(t,e){if(null==e)return t.__?wa(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?wa(t):null}function xa(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 xa(t)}}function Sa(t){(!t.__d&&(t.__d=!0)&&ra.push(t)&&!$.__r++||ia!=ta.debounceRendering)&&((ia=ta.debounceRendering)||na)($)}function $(){for(var t,e,r,i,n,s,o,a=1;ra.length;)ra.length>a&&ra.sort(sa),t=ra.shift(),a=ra.length,t.__d&&(r=void 0,i=void 0,n=(i=(e=t).__v).__e,s=[],o=[],e.__P&&((r=pa({},i)).__v=i.__v+1,ta.vnode&&ta.vnode(r),Ma(e.__P,r,i,e.__n,e.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?wa(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,Pa(s,r,o),i.__e=i.__=null,r.__e!=n&&xa(r)));$.__r=0}function ka(t,e,r,i,n,s,o,a,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||da,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]=ya(null,o,null,null,null):fa(o)?o=t.__k[s]=ya(ba,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=ya(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=Ta(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=wa(a)),Fa(a,a));return i}(r,e,y,u,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1==v.__i?ca:y[v.__i]||ca,v.__i=c,g=Ma(t,v,d,n,s,o,a,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Aa(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=Ca(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 Ca(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=Ca(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=wa(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Ta(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 Ia(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||va.test(e)?r:r+"px"}function Ea(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||Ia(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||Ia(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(oa,"$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=aa,t.addEventListener(e,s?la:ua,s)):t.removeEventListener(e,s?la:ua,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 Ra(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e.t)e.t=aa++;else if(r.u>e.t)return;return r(ta.event?ta.event(e):e)}}}function Ma(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=ta.__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 _a(m,_),c.constructor=T,c.render=Na),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=pa({},c.__s)),pa(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=ta.__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=pa(pa({},i),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),k=h,null!=h&&h.type===ba&&null==h.key&&(k=La(h.props.children)),a=ka(t,fa(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--;)ga(s[C]);Oa(e)}else e.__e=r.__e,e.__k=r.__k,t.then||Oa(e);ta.__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||ca,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&&(ta.__m&&ta.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s=s&&Xo.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;Ea(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||Ea(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=""),ka("template"==e.type?t.content:t,fa(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&wa(r,0),a,u),null!=s)for(l=s.length;l--;)ga(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])&&Ea(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&Ea(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,s,o,u,l);return(h=ta.diffed)&&h(e),128&e.__u?void 0:a}function Oa(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Oa)}function Pa(t,e,r){for(var i=0;r.length>i;i++)Aa(r[i],r[++i],r[++i]);ta.__c&&ta.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ta.__e(t,e.__v)}}))}function La(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:fa(t)?t.map(La):pa({},t)}function Aa(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){ta.__e(t,r)}}function Fa(t,e,r){var i,n;if(ta.unmount&&ta.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Aa(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ta.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(n=0;i.length>n;n++)i[n]&&Fa(i[n],e,r||"function"!=typeof t.type);r||ga(t.__e),t.__c=t.__=t.__e=void 0}function Na(t,e,r){return this.constructor(t,r)}function $a(t,e,r){var i,n,s;e==document&&(e=document.documentElement),ta.__&&ta.__(t,e),i=e.__k,n=[],s=[],Ma(e,t=e.__k=ma(ba,null,[t]),i||ca,ca,e.namespaceURI,i?null:e.firstChild?Xo.call(e.childNodes):null,n,i?i.__e:e.firstChild,!1,s),Pa(n,t,s)}Xo=da.slice,ta={__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}},ea=0,_a.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=pa({},this.state),"function"==typeof t&&(t=t(pa({},r),this.props)),t&&pa(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),Sa(this))},_a.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Sa(this))},_a.prototype.render=ba,ra=[],na="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,sa=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,oa=/(PointerCapture)$|Capture$/i,aa=0,ua=Ra(!1),la=Ra(!0),ha=0;var Da,qa,ja,Ua,Ha=0,Ba=[],za=ta,Va=za.__b,Wa=za.__r,Za=za.diffed,Ga=za.__c,Qa=za.unmount,Ja=za.__;function Ya(t,e){za.__h&&za.__h(qa,t,Ha||e),Ha=0;var r=qa.__H||(qa.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function Ka(t){return Ha=1,function(t,e,r){var i=Ya(Da++,2);if(i.t=t,!i.__c&&(i.__=[lu(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=qa,!qa.__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};qa.__f=!0;var s=qa.shouldComponentUpdate,o=qa.componentWillUpdate;qa.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)},qa.shouldComponentUpdate=n}return i.__N||i.__}(lu,t)}function Xa(t,e){var r=Ya(Da++,3);!za.__s&&uu(r.__H,e)&&(r.__=t,r.u=e,qa.__H.__h.push(r))}function tu(t){return Ha=5,eu((function(){return{current:t}}),[])}function eu(t,e){var r=Ya(Da++,7);return uu(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function ru(t){var e=qa.context[t.__c],r=Ya(Da++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(qa)),e.props.value):t.__}function iu(){for(var t;t=Ba.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ou),t.__H.__h.forEach(au),t.__H.__h=[]}catch(e){t.__H.__h=[],za.__e(e,t.__v)}}za.__b=function(t){qa=null,Va&&Va(t)},za.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Ja&&Ja(t,e)},za.__r=function(t){Wa&&Wa(t),Da=0;var e=(qa=t.__c).__H;e&&(ja===qa?(e.__h=[],qa.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach(ou),e.__h.forEach(au),e.__h=[],Da=0)),ja=qa},za.diffed=function(t){Za&&Za(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Ba.push(e)&&Ua===za.requestAnimationFrame||((Ua=za.requestAnimationFrame)||su)(iu)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),ja=qa=null},za.__c=function(t,e){e.some((function(t){try{t.__h.forEach(ou),t.__h=t.__h.filter((function(t){return!t.__||au(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],za.__e(r,t.__v)}})),Ga&&Ga(t,e)},za.unmount=function(t){Qa&&Qa(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{ou(t)}catch(t){e=t}})),r.__H=void 0,e&&za.__e(e,r.__v))};var nu="function"==typeof requestAnimationFrame;function su(t){var e,r=function(){clearTimeout(i),nu&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);nu&&(e=requestAnimationFrame(r))}function ou(t){var e=qa,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),qa=e}function au(t){var e=qa;t.__c=t.__(),qa=e}function uu(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function lu(t,e){return"function"==typeof e?e(t):e}var hu={Activation:"events",Cancellation:"cancelEvents"},cu={Button:"button",Tab:"tab",Selector:"selector"},du={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"},vu={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},fu={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},pu={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},gu={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},mu={Once:"once",Recurring:"recurring",Always:"always"},yu={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},bu={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"},_u={Popover:"popover",Inline:"inline"};function wu(t){return"$survey_response_"+t}function xu(t,e){if(!e)return null;var r=t[wu(e)];return ur(r)?[...r]:r}function Su(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!dr(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=xu(t,e.id);dr(s)||(i[n]=s)}})),r({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:xu(t,e.id)})))},t,i)}function ku(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 Cu(t){return"string"==typeof t&&t.trim()?t.trim():null}function Tu(t){return t.toLowerCase()}function Iu(t,e,r){if(!t||!e)return null;var i=Tu(e),n=Object.keys(t).find((t=>Tu(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=>Tu(t)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}function Eu(t,e,i){var n,s=Iu(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),dr(l.name)||(o.name=l.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),dr(l.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=l.thankYouMessageHeader,a=!0),dr(l.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=l.thankYouMessageDescription,a=!0),dr(l.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=l.thankYouMessageCloseButtonText,a=!0)):function(t){return!dr(t.thankYouMessageHeader)||!dr(t.thankYouMessageDescription)||!dr(t.thankYouMessageCloseButtonText)}(l)&&(a=!0))}var h=t.questions.map((t=>function(t,e,i){var n,s=Iu(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 dr(o.question)||(a.question=o.question,u=!0),dr(o.description)||(a.description=o.description,u=!0),dr(o.buttonText)||(a.buttonText=o.buttonText,u=!0),"link"in a&&!dr(o.link)&&(a.link=o.link,u=!0),"lowerBoundLabel"in a&&!dr(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,u=!0),"upperBoundLabel"in a&&!dr(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,u=!0),"choices"in a&&function(t){return ur(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 Ru=En("[Surveys]");function Mu(t){return!(!t.start_date||t.end_date)}function Ou(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Pu(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Lu="seenSurvey_",Au="inProgressSurvey_",Fu=(t,e)=>{var r=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(r=""+t+e.id+"_"+e.current_iteration),r},Nu=t=>Fu(Lu,t),$u=t=>{try{var e=Nu(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Ru.error("Failed to persist survey seen state",t)}},Du=[fu.Popover,fu.Widget,fu.API],qu={ignoreConditions:!1,ignoreDelay:!1,displayType:_u.Popover};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return mr(t)&&isFinite(t)&&Math.floor(t)===t});class ju{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 ju(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 ju(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 Uu{constructor(){this.S=0,this.C=0,this.I=new zu}generate(){var t=this.generateOrAbort();if(dr(t)){this.S=0;var e=this.generateOrAbort();if(dr(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 ju.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 Hu,Bu=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};dn&&!dr(dn.crypto)&&crypto.getRandomValues&&(Bu=t=>crypto.getRandomValues(t));class zu{constructor(){this.M=new Uint32Array(8),this.O=1/0}nextUint32(){return this.M.length>this.O||(Bu(this.M),this.O=0),this.M[this.O++]}}var Vu=()=>Wu().toString(),Wu=()=>(Hu||(Hu=new Uu)).generate(),Zu=["fatal","error","warning","log","info","debug"],Gu={GZipJS:"gzip-js",Base64:"base64"},Qu=Uint8Array,Ju=Uint16Array,Yu=Uint32Array,Ku=new Qu([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]),Xu=new Qu([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]),tl=new Qu([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),el=function(t,e){for(var r=new Ju(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new Yu(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]},rl=el(Ku,2),il=rl[1];rl[0][28]=258,il[258]=28;for(var nl=el(Xu,0)[1],sl=new Ju(32768),ol=0;32768>ol;++ol){var al=(43690&ol)>>>1|(21845&ol)<<1;sl[ol]=((65280&(al=(61680&(al=(52428&al)>>>2|(13107&al)<<2))>>>4|(3855&al)<<4))>>>8|(255&al)<<8)>>>1}var ul=function(t,e,r){for(var i=t.length,n=0,s=new Ju(e);i>n;++n)++s[t[n]-1];var o,a=new Ju(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new Ju(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[sl[c]>>>u]=l}else for(o=new Ju(i),n=0;i>n;++n)o[n]=sl[a[t[n]-1]++]>>>15-t[n];return o},ll=new Qu(288);for(ol=0;144>ol;++ol)ll[ol]=8;for(ol=144;256>ol;++ol)ll[ol]=9;for(ol=256;280>ol;++ol)ll[ol]=7;for(ol=280;288>ol;++ol)ll[ol]=8;var hl=new Qu(32);for(ol=0;32>ol;++ol)hl[ol]=5;var cl=ul(ll,9,0),dl=ul(hl,5,0),vl=function(t){return(t/8>>0)+(7&t&&1)},fl=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof Ju?Ju:t instanceof Yu?Yu:Qu)(r-e);return i.set(t.subarray(e,r)),i},pl=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},gl=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},ml=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 Qu(0),0];if(1==n){var o=new Qu(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 Ju(d+1),f=yl(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 Qu(v),f]},yl=function(t,e,r){return-1==t.s?Math.max(yl(t.l,e,r+1),yl(t.r,e,r+1)):e[t.s]=r},bl=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new Ju(++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]},_l=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},wl=function(t,e,r){var i=r.length,n=vl(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)},xl=function(t,e,r,i,n,s,o,a,u,l,h){pl(e,h++,r),++n[256];for(var c=ml(n,15),d=c[0],v=c[1],f=ml(s,15),p=f[0],g=f[1],m=bl(d),y=m[0],b=m[1],_=bl(p),w=_[0],x=_[1],S=new Ju(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=ml(S,7),T=C[0],I=C[1],E=19;E>4&&!T[tl[E-1]];--E);var R,M,O,P,L=l+5<<3,A=_l(n,ll)+_l(s,hl)+o,F=_l(n,d)+_l(s,p)+o+14+3*E+_l(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(A>=L&&F>=L)return wl(e,h,t.subarray(u,u+l));if(pl(e,h,1+(A>F)),h+=2,A>F){R=ul(d,v,0),M=d,O=ul(p,g,0),P=p;var N=ul(T,I,0);for(pl(e,h,b-257),pl(e,h+5,x-1),pl(e,h+10,E-4),h+=14,k=0;E>k;++k)pl(e,h+3*k,T[tl[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)pl(e,h,N[U=31&j[k]]),h+=T[U],U>15&&(pl(e,h,j[k]>>>5&127),h+=j[k]>>>12)}}else R=cl,M=ll,O=dl,P=hl;for(k=0;a>k;++k)if(i[k]>255){var U;gl(e,h,R[257+(U=i[k]>>>18&31)]),h+=M[U+257],U>7&&(pl(e,h,i[k]>>>23&31),h+=Ku[U]);var H=31&i[k];gl(e,h,O[H]),h+=P[H],H>3&&(gl(e,h,i[k]>>>5&8191),h+=Xu[H])}else gl(e,h,R[i[k]]),h+=M[i[k]];return gl(e,h,R[256]),h+M[256]},Sl=new Yu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),kl=function(){for(var t=new Yu(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Cl=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Tl(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=kl[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 Qu(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=wl(u,l,t.subarray(h,c)):(u[h]=!0,l=wl(u,l,t.subarray(h,o)))}else{for(var d=Sl[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new Ju(32768),m=new Ju(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 Yu(25e3),x=new Ju(288),S=new Ju(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=xl(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|il[A]<<18|nl[F];var Z=31&il[A],G=31&nl[F];C+=Ku[Z]+Xu[G],++x[257+Z],++S[G],I=h+A,++k}else w[T++]=t[h],++x[t[h]]}}l=xl(t,u,!0,w,x,S,C,T,E,h-E,l)}return fl(a,0,i+vl(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&&Cl(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),Cl(u,l-8,r.d()),Cl(u,l-4,i),u}var Il=!!yn||!!mn,El="text/plain",Rl=!1,Ml=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=Un(a);return l&&u.push(l),s+"?"+u.join("&")},Ol=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Pl=t=>{if(t.tr)return t.tr;var{data:e,compression:r}=t;if(e){if(r===Gu.GZipJS){var i=Tl(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new Qu(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 Qu(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 fl(i,0,n)}(Ol(e)),{mtime:0});return{contentType:El,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===Gu.Base64){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Ol(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Ol(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Ol(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Ll=function(){var t=e((function*(t){var e=Ol(t.data),i=yield function(t,e,r){return Ye.apply(this,arguments)}(e,Cn.DEBUG,{rethrow:!0});if(!i)return t;var n=yield i.arrayBuffer();return r({},t,{tr:{contentType:El,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),Al=(t,e)=>Ml(t,{_:(new Date).getTime().toString(),ver:Cn.JS_SDK_VERSION,compression:e}),Fl=[];mn&&Fl.push({transport:"fetch",method(t){var e,i,{contentType:n,body:s,estimatedSize:o}=null!==(e=Pl(t))&&void 0!==e?e:{},a=new Headers;Mn(t.headers,(function(t,e){a.append(e,t)})),n&&a.append("Content-Type",n);var u=t.url,l=null;if(bn){var h=new bn;l={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}mn(u,r({method:(null==t?void 0:t.method)||"GET",headers:a,keepalive:"POST"===t.method&&52428.8>(o||0),body:s,signal:null==(i=l)?void 0:i.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){In.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{In.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>l?clearTimeout(l.timeout):null))}}),yn&&Fl.push({transport:"XHR",method(t){var e,r=new yn;r.open(t.method||"GET",t.url,!0);var{contentType:i,body:n}=null!==(e=Pl(t))&&void 0!==e?e:{};Mn(t.headers,(function(t,e){r.setRequestHeader(e,t)})),i&&r.setRequestHeader("Content-Type",i),t.timeout&&(r.timeout=t.timeout),t.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(4===r.readyState){var e={statusCode:r.status,text:r.responseText};if(200===r.status)try{e.json=JSON.parse(r.responseText)}catch(t){}null==t.callback||t.callback(e)}},r.send(n)}}),null!=fn&&fn.sendBeacon&&Fl.push({transport:"sendBeacon",method(t){var e=Ml(t.url,{beacon:"1"});try{var r,{contentType:i,body:n}=null!==(r=Pl(t))&&void 0!==r?r:{};if(!n)return;var s=n instanceof Blob?n:new Blob([n],{type:i});fn.sendBeacon(e,s)}catch(t){}}});var Nl=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 $l(t,e,r){return Ol({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var Dl={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=>Nl(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!Nl(e,t))))),icontains:(t,e)=>e.map(ql).some((e=>t.map(ql).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(ql).every((e=>t.map(ql).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)))}))},ql=t=>t.toLowerCase();function jl(t,e){return!t||Object.entries(t).every((t=>{var[r,i]=t,n=null==e?void 0:e[r];if(dr(n)||pr(n))return!1;var s=[String(n)],o=Dl[i.operator];return!!o&&o(i.values,s)}))}var Ul="",Hl=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Bl={R:()=>!!pn,D(t){In.error("cookieStore error: "+t)},A(t){if(pn){try{for(var e=t+"=",r=pn.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(Bl.A(t))||{}}catch(t){}return e},N(t,e,r,i,n){if(pn)try{var s="",o="",a=function(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=pn),Ul)return Ul;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_"+Vu();!Ul&&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",Ul=s)}return Ul}(t);if(!r){var i=(t=>{var e=t.match(Hl);return e?e[0]:""})(t);i!==r&&In.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(pn.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&&In.warn("cookieStore warning: large cookie, len="+l.length),pn.cookie=l,l}catch(t){return}},q(t,e){if(null!=pn&&pn.cookie)try{Bl.N(t,"",-1,e)}catch(t){return}}},zl=null,Vl={R(){if(!pr(zl))return zl;var t=!0;if(dr(dn))t=!1;else try{var e="__mplssupport__";Vl.N(e,"xyz"),'"xyz"'!==Vl.A(e)&&(t=!1),Vl.q(e)}catch(e){t=!1}return t||In.error("localStorage unsupported; falling back to cookie store"),zl=t,t},D(t){In.error("localStorage error: "+t)},A(t){try{return null==dn?void 0:dn.localStorage.getItem(t)}catch(t){Vl.D(t)}return null},F(t){try{return JSON.parse(Vl.A(t))||{}}catch(t){}return null},N(t,e){try{null==dn||dn.localStorage.setItem(t,JSON.stringify(e))}catch(t){Vl.D(t)}},q(t){try{null==dn||dn.localStorage.removeItem(t)}catch(t){Vl.D(t)}}},Wl=[Gn,"distinct_id",cs,ds,Ns,Fs,Ms],Zl={},Gl={R:()=>!0,D(t){In.error("memoryStorage error: "+t)},A:t=>Zl[t]||null,F:t=>Zl[t]||null,N(t,e){Zl[t]=e},q(t){delete Zl[t]}},Ql=null,Jl={R(){if(!pr(Ql))return Ql;if(Ql=!0,dr(dn))Ql=!1;else try{var t="__support__";Jl.N(t,"xyz"),'"xyz"'!==Jl.A(t)&&(Ql=!1),Jl.q(t)}catch(t){Ql=!1}return Ql},D(t){In.error("sessionStorage error: ",t)},A(t){try{return null==dn?void 0:dn.sessionStorage.getItem(t)}catch(t){Jl.D(t)}return null},F(t){try{return JSON.parse(Jl.A(t))||null}catch(t){}return null},N(t,e){try{null==dn||dn.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){Jl.D(t)}},q(t){try{null==dn||dn.sessionStorage.removeItem(t)}catch(t){Jl.D(t)}}},Yl=En("[Stylesheet Loader]"),Kl=dn,Xl=pn,th="#020617",eh={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:du.Right,widgetType:cu.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:th,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},rh=[du.Center,du.Left,du.Right];function ih(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 nh(t){var e;void 0===t&&(t=eh.backgroundColor),"#"===t[0]&&(e=ih(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=ih(r)),!e)return th;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?th:"white"}return th}var sh=(t,e,i)=>{var n=Sh(t),s=Xl.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=Xl.createElement("div");((t,e,i)=>{var n=r({},eh,i),s=t.style,o=!rh.includes(n.position)||e===fu.Widget&&(null==i?void 0:i.widgetType)===cu.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)||nh(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",nh(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||nh(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",nh(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)||nh(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=Xl.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||(Yl.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 Xl.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},oh=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a,surveyLanguage:u}=t;s?($u(i),s.capture(yu.SENT,r({[bu.SURVEY_NAME]:i.name,[bu.SURVEY_ID]:i.id,[bu.SURVEY_ITERATION]:i.current_iteration,[bu.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[bu.SURVEY_SUBMISSION_ID]:n,[bu.SURVEY_COMPLETED]:o},u&&{[bu.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},Su(e,i),a,{$set:{[ku(i,"responded")]:!0}})),o&&(Kl.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),xh(i))):Ru.error("[survey sent] event not captured, PostHog instance not found.")},ah=(t,e,i)=>{return r({[bu.SURVEY_NAME]:t.name,[bu.SURVEY_ID]:t.id,[bu.SURVEY_ITERATION]:t.current_iteration,[bu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[bu.SURVEY_PARTIALLY_COMPLETED]:(n=null==e?void 0:e.responses,void 0===n&&(n={}),Object.values(n).some((t=>!gr(t))))},(null==e?void 0:e.surveyLanguage)&&{[bu.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[bu.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},Su(null==e?void 0:e.responses,t));var n},uh=(t,e,i,n)=>{if(e){if(!i){var s=_h(t);e.capture(yu.DISMISSED,r({},ah(t,s,e),n&&{[bu.SURVEY_LANGUAGE]:n},{$set:{[ku(t,"dismissed")]:!0}})),xh(t),$u(t),Kl.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Ru.error("[survey dismissed] event not captured, PostHog instance not found.")},lh=(t,e)=>{if(e){var r=(t=>Fu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=_h(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture(yu.ABANDONED,ah(t,i,e),{transport:"sendBeacon"})}}else Ru.error("[survey abandoned] event not captured, PostHog instance not found.")},hh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),ch=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,dh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?ch(t.questions,hh(t.questions)):t.questions,vh=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===mu.Always||wh(t)},fh=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,Sa(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"+ha++,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}),ph=()=>ru(fh),gh=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return function(t,e,r){var i,n,s,o,a=pa({},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?Xo.call(arguments,2):r),ya(t.type,a,i||t.key,n||t.ref,null)}(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function mh(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==Kl||null==(r=Kl.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 Dl[o](s,[n])}var yh=t=>{var e=""+Au+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Au+t.id+"_"+t.current_iteration),e},bh=(t,e)=>{try{localStorage.setItem(yh(t),JSON.stringify(e))}catch(t){Ru.error("Error setting in-progress survey state in localStorage",t)}},_h=t=>{try{var e=localStorage.getItem(yh(t));if(e)return JSON.parse(e)}catch(t){Ru.error("Error getting in-progress survey state from localStorage",t)}return null},wh=t=>{var e=_h(t);return!gr(null==e?void 0:e.surveySubmissionId)},xh=t=>{try{localStorage.removeItem(yh(t))}catch(t){Ru.error("Error clearing in-progress survey state from localStorage",t)}};function Sh(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function kh(t,e,r){if(void 0===e&&(e=du.Right),t===fu.ExternalSurvey)return{};switch(e){case du.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case du.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case du.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case du.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case du.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case du.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case du.Left:return{left:"30px"};case du.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===fu.Widget&&r===cu.Tab?"60px":"30px"}}}var Ch=0;function Th(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:--Ch,__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 ta.vnode&&ta.vnode(l),l}var Ih=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Eh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Rh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Mh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Oh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Th("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"})}),Ph=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Th("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"})}),Lh=Th("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Th("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"})}),Ah=function(t){var{fill:e="currentColor"}=void 0===t?{}:t;return Th("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:[Th("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Th("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})]})},Fh=Th("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Th("g",{"clip-path":"url(#clip0_2415_6911)",children:[Th("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Th("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Th("g",{mask:"url(#mask0_2415_6911)",children:[Th("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"}),Th("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"}),Th("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"}),Th("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"}),Th("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"}),Th("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"})]})]}),Th("defs",{children:Th("clipPath",{id:"clip0_2415_6911",children:Th("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Nh(t){var{urlParams:e}=t,r=e?Object.entries(e).map((t=>{var[e,r]=t;return encodeURIComponent(e)+"="+encodeURIComponent(r)})).join("&"):"";return Th("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",Fh]})}function $h(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=t,{isPreviewMode:u}=ru(fh);return Th("div",{className:"bottom-section",children:[!a&&Th("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==dn||dn.open(s)),u?null==o||o():n()},children:e}),!i.whiteLabel&&Th(Nh,{urlParams:{utm_source:"survey-footer"}})]})}function Dh(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return Th("div",{class:"question-header",children:[Th(e.type===pu.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&gh({component:ma("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function qh(t){var{onClick:e}=t,{isPreviewMode:r}=ru(fh);return Th("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:Ah({fill:"black"})})}Th("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Th("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 jh=dn;function Uh(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=t,{isPopup:a}=ru(fh);return Xa((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Dn(jh,"keydown",t),()=>{jh.removeEventListener("keydown",t)}}),[o]),Th("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Th(qh,{onClick:()=>o()}),Th("h3",{className:"thank-you-message-header",children:e}),r&&gh({component:ma("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Th($h,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var Hh=t=>ur(t)&&t.every((t=>vr(t)));function Bh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=t,{isPreviewMode:u}=ph(),l=tu(null),[h,c]=Ka((()=>vr(a)?a:""));Xa((()=>{setTimeout((()=>{var t;u||null==(t=l.current)||t.focus()}),100)}),[u]);var d="surveyQuestion"+o,v=eu((()=>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 tr.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 tr.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=Pi(e.validation,tr.MinLength),p=Pi(e.validation,tr.MaxLength),g=eu((()=>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]);return Th(ba,{children:[Th("div",{className:"question-container",children:[Th(Dh,{question:e,forceDisableHtml:r,htmlFor:d}),Th("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()},value:h}),g&&Th("div",{className:"validation-hint",children:g})]}),Th($h,{text:e.buttonText||"Submit",submitDisabled:!!v,appearance:i,onSubmit(){v||n(h.trim())},onPreviewSubmit(){v||s(h.trim())}})]})}function zh(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=t;return Th(ba,{children:[Th("div",{className:"question-container",children:Th(Dh,{question:e,forceDisableHtml:r})}),Th($h,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function Vh(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]=Ka((()=>mr(u)?u:ur(u)&&u.length>0&&mr(parseInt(u[0]))?parseInt(u[0]):vr(u)&&mr(parseInt(u))?parseInt(u):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=ph(),p=t=>f?a(t):o(t);return Th(ba,{children:[Th("div",{className:"question-container",children:[Th(Dh,{question:r,forceDisableHtml:i}),Th("div",{className:"rating-section",children:[Th("div",{className:"rating-options",children:["emoji"===r.display&&Th("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(e=Yh[r.scale])?void 0:e.map(((t,e)=>Th("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&&Th("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-h+1)+", minmax(0, 1fr))"},children:Kh(r.scale).map(((t,e)=>Th(Wh,{displayQuestionIndex:n,active:c===t,appearance:s,num:t,setActiveNumber(t){d(t),r.skipSubmitButton&&p(t)}},e)))})]}),!v&&Th("div",{className:"rating-text",children:[Th("div",{children:r.lowerBoundLabel}),Th("div",{children:r.upperBoundLabel})]})]})]}),Th($h,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:pr(c)&&!r.optional,appearance:s,onSubmit:()=>o(c),onPreviewSubmit:()=>a(c),skipSubmitButton:r.skipSubmitButton})]})}function Wh(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return Th("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick(){n(e)},children:e})}function Zh(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l=tu(null),h=eu((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=ch(e,hh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[c,d]=Ka((()=>((t,e)=>vr(t)||Hh(t)?t:e===pu.SingleChoice?null:[])(u,e.type))),[v,f]=Ka((()=>((t,e)=>{if(vr(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Hh(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,h))),{isPreviewMode:p}=ph(),g=e.type===pu.SingleChoice,m=e.type===pu.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&&ur(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||!pr(c)&&(!ur(c)||v.isSelected||0!==c.length)&&(!v.isSelected||""!==v.inputValue.trim())),S=()=>{v.isSelected&&m?ur(c)&&(p?a([...c,v.inputValue]):o([...c,v.inputValue])):p?a(c):o(c)};return Th(ba,{children:[Th("div",{className:"question-container",children:[Th(Dh,{question:e,forceDisableHtml:i}),Th("fieldset",{className:"multiple-choice-options limit-height",children:[Th("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:ur(c)&&c.includes(t);return Th("label",{className:i?"choice-option-open":"",children:[Th("div",{className:"response-choice",children:[Th("input",{type:g?"radio":"checkbox",name:s,checked:a,onChange:()=>b(t,i),id:s,"aria-controls":o}),Th("span",{children:i?t+":":t})]}),i&&Th("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)}))]})]}),Th($h,{text:e.buttonText||"Submit",submitDisabled:x(),appearance:s,onSubmit:S,onPreviewSubmit:S,skipSubmitButton:y})]})}var Gh=[1,2,3,4,5],Qh=[1,2,3,4,5,6,7],Jh=[0,1,2,3,4,5,6,7,8,9,10],Yh={2:[Ph,Lh],3:[Rh,Eh,Ih],5:[Mh,Rh,Eh,Ih,Oh]};function Kh(t){switch(t){case 5:default:return Gh;case 7:return Qh;case 10:return Jh}}var Xh=En("[Surveys]");function tc(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?gu.End:s;if(n.branching.type===gu.End)return gu.End;if(n.branching.type===gu.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===gu.ResponseBased){if(n.type===pu.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===gu.End?gu.End:s}}else if(n.type===pu.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===gu.End?gu.End:s}}return s}return Xh.warn("Falling back to next question index due to unexpected branching type"),s}var ec="https?://(.*)",rc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ic=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...rc],nc="<masked>",sc=["li_fat_id"];function oc(t,e,r){if(!pn)return{};var i,n=e?[...rc,...r||[]]:[],s=ac(Bn(pn.URL,n,nc),t),o=(i={},Mn(sc,(function(t){var e=Bl.A(t);i[t]=e||null})),i);return On(o,s)}function ac(t,e){var r=ic.concat(e||[]),i={};return Mn(r,(function(e){var r=Hn(t,e);i[e]=r||null})),i}function uc(t){var e=function(t){return t?0===t.search(ec+"google.([^/?]*)")?"google":0===t.search(ec+"bing.com")?"bing":0===t.search(ec+"yahoo.com")?"yahoo":0===t.search(ec+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!pr(e)){i.$search_engine=e;var n=pn?Hn(pn.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function lc(){return navigator.language||navigator.userLanguage}var hc="$direct";function cc(){return(null==pn?void 0:pn.referrer)||hc}function dc(t,e){var r=t?[...rc,...e||[]]:[],i=null==gn?void 0:gn.href.substring(0,1e3);return{r:cc().substring(0,1e3),u:i?Bn(i,r,nc):void 0}}function vc(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:r==hc?hc:null==(e=jn(r))?void 0:e.host};if(i){n.$current_url=i;var s=jn(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=ac(i);On(n,o)}if(r){var a=uc(r);On(n,a)}return n}function fc(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function pc(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var gc=En("[SurveyTranslations]");function mc(t,e){var r=function(t){return function(t,e){var{overrideLanguage:r,storedPersonProperties:i,locale:n}=t,s=Cu(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?Cu(t.language):null}(i);if(o)return null==e||e.info("Using person property language: "+o),o;var a=Cu(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:lr(t.get_property)?t.get_property(ws):void 0,locale:lc()},gc)}(e);if(!r)return gc.info("No user language detected"),{survey:t,language:null};var i=Eu(t,r,gc);return{survey:i.survey,language:i.matchedKey}}var yc=dn,bc=pn,_c="ph:show_survey_widget",wc="PHWidgetSurveyClickListener";function xc(t,e){try{var r=t.getBoundingClientRect(),i=yc.innerHeight,n=yc.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:eh.zIndex}}catch(t){return Ru.warn("Failed to calculate trigger position:",t),null}}class Sc{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(Ss);if(t)for(var e of t)wh(e)&&lh(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)===du.NextToTrigger&&null!=(s=l.appearance)&&s.widgetSelector){var f,p=bc.querySelector(l.appearance.widgetSelector);p&&(v=xc(p,parseInt((null==(f=l.appearance)?void 0:f.maxWidth)||eh.maxWidth))||{})}var g=(null==(o=l.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:m}=sh(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 $a(Th(Ic,r({},y)),m);var b=setTimeout((()=>{if(this.j.delete(l.id),!mh(l))return this.$(l);$a(Th(Ic,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}=sh(e,this._posthog);n&&$a(Th(Rc,{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(wc),this.H.delete(t.id),Ru.info("Removed click listener for survey "+t.id))},this.J=(t,e)=>{var r=bc.querySelector(e),i=this.H.get(t.id);if(r){if(this.G(t),i){if(r===i.element)return;Ru.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.X(t)}if(!r.hasAttribute(wc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===du.NextToTrigger?xc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||eh.maxWidth)):{};yc.dispatchEvent(new CustomEvent(_c,{detail:{surveyId:t.id,position:n}}))};Dn(r,"click",n),r.setAttribute(wc,"true"),this.H.set(t.id,{element:r,listener:n,survey:t}),Ru.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}=sh(e,this._posthog);$a(Th(Ic,{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)),$a(Th(Ic,{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===fu.Popover||t.type===fu.Widget)),i=e.ne(r),n=new Set;i.forEach((t=>{if(t.type===fu.Widget){var r,i,s,o;if((null==(r=t.appearance)?void 0:r.widgetType)===cu.Tab)return void e.G(t);(null==(i=t.appearance)?void 0:i.widgetType)===cu.Selector&&null!=(s=t.appearance)&&s.widgetSelector&&(n.add(t.id),e.J(t,null==(o=t.appearance)?void 0:o.widgetSelector))}pr(e.ie)&&t.type===fu.Popover&&e.handlePopoverSurvey(t)})),e.H.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.X(r)}))}),t)},this.Z=t=>{pr(this.ie)||Ru.error("Survey "+this.ie+" already in focus. Cannot add survey "+t.id+"."),this.ie=t.id},this.$=t=>{this.ie!==t.id&&Ru.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)&&(Ru.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=wh(t),s=wh(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===mu.Always,a=e.schedule===mu.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 mc(t,this._posthog)}K(t,e){if(this.U.has(t.id))return!1;var{params:r}=function(t){var e={},r=!1,i=yc.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&&!dr(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;Ru.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)&&oh({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)]=ur(o)?o.map(String):[String(o)];Ru.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 oh({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=wu(t.id);try{switch(t.type){case pu.SingleChoice:if(!t.choices||0===t.choices.length)return void In.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 In.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case pu.MultipleChoice:if(!t.choices||0===t.choices.length)return void In.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 In.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(a.map((e=>t.choices[e])))];a.length>u.length&&In.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=u;break;case pu.Rating:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||0>l||l>h)return void In.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=l;break;default:In.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){In.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(i).length)return Ru.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Vu(),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=wu(o.id);dr(r[a])||(n[a]=r[a])}var u=tc(t,i,o.id?r[wu(o.id)]:null);if(u===gu.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=u}return{startQuestionIndex:i,skippedResponses:n}}(t,s,i),u=o>=t.questions.length;return bh(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:o,surveyLanguage:r}),Ru.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return Ru.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||mh(t)&&function(t){var e,r;return function(t,e){var r,i,n;if(!t||0===t.length)return!0;if(!wn)return!1;var s=Ii(wn,{userAgentDataPlatform:null==fn||null==(r=fn.userAgentData)?void 0:r.platform,maxTouchPoints:null==fn?void 0:fn.maxTouchPoints,screenWidth:null==dn||null==(i=dn.screen)?void 0:i.width,screenHeight:null==dn||null==(n=dn.screen)?void 0:n.height,devicePixelRatio:null==dn?void 0:dn.devicePixelRatio});return Dl[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==Xl||!Xl.querySelector(t.conditions.selector))}(t)}se(t){return vh(t)||this.ae(t.internal_targeting_flag_key)||wh(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!Mu(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!Du.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,Vl.A("lastSeenSurveyDate"))?(t=>!!Vl.A(Nu(t))&&!vh(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(!Ou(t)&&!Pu(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=bc.querySelector(Sh(t,!0));null!=e&&e.shadowRoot&&$a(null,e.shadowRoot),null==e||e.remove()}catch(e){Ru.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 kc(t,e){if(bc&&yc){var r,i=new Sc(t);if(t.config.disable_surveys_automatic_display)return Ru.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Ru.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{dr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Dn(bc,"visibilitychange",(()=>{bc.hidden?dr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function Cc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;Xa((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var s=()=>{var t,n=e.type===fu.Widget,s=mh(e),o=(null==(t=e.appearance)?void 0:t.widgetType)===cu.Tab&&n;if(!s)return Ru.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);o&&(Ru.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};Dn(yc,"popstate",s),Dn(yc,"hashchange",s);var o=yc.history.pushState,a=yc.history.replaceState;return yc.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()},yc.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()},()=>{yc.removeEventListener("popstate",s),yc.removeEventListener("hashchange",s),yc.history.pushState=o,yc.history.replaceState=a}}}),[n,e,r,i])}function Tc(t){switch(void 0===t&&(t=vu.Right),t){case vu.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case vu.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case vu.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Ic(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=tu(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]=Ka(n||0===i||t.type===fu.ExternalSurvey),[d,v]=Ka(!1),f=()=>{var e=()=>{o&&s(t),c(!1)};bc.startViewTransition?bc.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 Xa((()=>{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=()=>{mh(t)&&(c(!0),yc.dispatchEvent(new Event("PHSurveyShown")),u||e.capture(yu.SHOWN,r({[bu.SURVEY_NAME]:t.name,[bu.SURVEY_ID]:t.id,[bu.SURVEY_ITERATION]:t.current_iteration,[bu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[bu.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()})),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(Dn(yc,"PHSurveyClosed",p),Dn(yc,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),yc.removeEventListener("PHSurveyClosed",p),yc.removeEventListener("PHSurveySent",s)}}return o(),()=>{yc.removeEventListener("PHSurveyClosed",p),yc.removeEventListener("PHSurveySent",s)}}}else Ru.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Cc({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=eu((()=>{var t=_h(u),e=(null==t?void 0:t.surveySubmissionId)||Vu();return{isPreviewMode:S,previewPageIndex:d,onPopupSurveyDismissed(){w?uh(u,h,S,w):uh(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?Th(fh.Provider,{value:R,children:Th("div",{className:"ph-survey",style:r({},kh(u.type,null==(i=u.appearance)?void 0:i.position,null==(n=u.appearance)?void 0:n.widgetType),c),ref:x,children:E?Th(Uh,{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||eh,onClose(){I(),m()}}):Th(Ec,{survey:u,forceDisableHtml:!!l,posthog:h})})}):null}function Ec(t){var e,{survey:i,forceDisableHtml:n,posthog:s}=t,[o,a]=Ka((()=>{var t=_h(i);return null!=t&&t.responses&&Ru.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}=ru(fh),[g,m]=Ka((()=>{var t=_h(i);return u||(null==t?void 0:t.lastQuestionIndex)||0})),y=eu((()=>dh(i)),[i]);Xa((()=>{v&&!dr(u)&&m(u)}),[u,v]);var b=y.at(g);return b?Th("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=i.appearance)?void 0:e.hideCancelButton)&&Th(qh,{onClick(){l()}}),Th("div",{className:"survey-box","data-question-index":g,children:Mc({question:b,forceDisableHtml:n,displayQuestionIndex:g,appearance:i.appearance||eh,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:u}=t;if(s)if(u){var l=wu(u),h=r({},o,{[l]:e});a(h);var c=tc(i,n,e),v=c===gu.End;v||(m(c),bh(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c,surveyLanguage:p})),(i.enable_partial_responses||v)&&oh({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:s,properties:f,surveyLanguage:p})}else Ru.error("onNextButtonClick called without a questionId.");else Ru.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:g,questionId:b.id}),onPreviewSubmit:c,initialValue:b.id?o[wu(b.id)]:void 0})})]}):null}function Rc(t){var e,r,i,n,s,o,a,{survey:u,forceDisableHtml:l,posthog:h,readOnly:c,surveyLanguage:d}=t,[v,f]=Ka(!0),[p,g]=Ka(!1),[m,y]=Ka({}),b=()=>{g(!p)};if(Xa((()=>{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&&(Ru.info("Received show event for feedback button survey "+u.id),y(r.detail.position||{}),b())};return Dn(yc,_c,e),()=>{yc.removeEventListener(_c,e)}}}else Ru.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]),Cc({survey:u,setSurveyVisible:f}),!v)return null;var _=()=>{u.schedule!==mu.Always&&f(!1),setTimeout((()=>{g(!1)}),200)};return Th(ba,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Th("button",{className:"ph-survey-widget-tab "+((null==(s=u.appearance)?void 0:s.tabPosition)===vu.Top?"widget-tab-top":""),onClick:b,disabled:c,style:Tc(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),p&&Th(Ic,{posthog:h,survey:u,forceDisableHtml:l,style:m,onPopupSurveyDismissed:_,onCloseConfirmationMessage:_,surveyLanguage:d})]})}var Mc=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 pu.Open:return ma(Bh,r({},l,{question:e,key:e.id}));case pu.Link:return ma(zh,r({},l,{question:e,key:e.id}));case pu.Rating:return ma(Vh,r({},l,{question:e,key:e.id}));case pu.SingleChoice:case pu.MultipleChoice:return ma(Zh,r({},l,{question:e,key:e.id}));default:return Ru.error("Unsupported question type: "+e.type),null}};xn.__PosthogExtensions__=xn.__PosthogExtensions__||{},xn.__PosthogExtensions__.generateSurveys=kc,xn.extendPostHogWithSurveys=kc;class Oc{emit(t){}}var Pc=new Oc,Lc=new class{getLogger(t,e,r){return new Oc}};class Ac{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):Pc}}class Fc{getLogger(t,e,r){var i;return null!==(i=this.de(t,e,r))&&void 0!==i?i:new Ac(this,t,e,r)}he(){var t;return null!==(t=this.ce)&&void 0!==t?t:Lc}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 Nc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},$c=Symbol.for("io.opentelemetry.js.api.logs"),Dc=Nc;class qc{constructor(){this.fe=new Fc}static getInstance(){return this._instance||(this._instance=new qc),this._instance}setGlobalLoggerProvider(t){return Dc[$c]?this.getLoggerProvider():(Dc[$c]=(1,e=t,r=Lc,t=>1===t?e:r),this.fe.ve(t),t);var e,r}getLoggerProvider(){var t,e;return null!==(e=null===(t=Dc[$c])||void 0===t?void 0:t.call(Dc,1))&&void 0!==e?e:this.fe}getLogger(t,e,r){return this.getLoggerProvider().getLogger(t,e,r)}disable(){delete Dc[$c],this.fe=new Fc}}var jc=qc.getInstance();class Uc{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 Hc 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 Bc(t){if(Number.isFinite(t)&&t>0)return t;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+t+"')")}class zc{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 Vc(t){return new zc(t.concurrencyLimit)}var Wc="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Zc="1.9.0",Gc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,Qc=function(t){var e=new Set([t]),r=new Set,i=t.match(Gc);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(Gc);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)}}(Zc),Jc=Zc.split(".")[0],Yc=Symbol.for("opentelemetry.js.api."+Jc),Kc=Wc;function Xc(t,e,r,i){var n;void 0===i&&(i=!1);var s=Kc[Yc]=null!==(n=Kc[Yc])&&void 0!==n?n:{version:Zc};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!==Zc?(o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+Zc),r.error(o.stack||o.message),!1):(s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+Zc+"."),!0)}function td(t){var e,r,i=null===(e=Kc[Yc])||void 0===e?void 0:e.version;if(i&&Qc(i))return null===(r=Kc[Yc])||void 0===r?void 0:r[t]}function ed(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+Zc+".");var r=Kc[Yc];r&&delete r[t]}var rd,id=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 nd("debug",this.ye,t)},t.prototype.error=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return nd("error",this.ye,t)},t.prototype.info=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return nd("info",this.ye,t)},t.prototype.warn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return nd("warn",this.ye,t)},t.prototype.verbose=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return nd("verbose",this.ye,t)},t}();function nd(t,e,r){var i=td("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"}(rd||(rd={}));var sd=function(){function t(){function t(t){return function(){for(var e=[],r=0;arguments.length>r;r++)e[r]=arguments[r];var i=td("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:rd.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=td("diag"),u=function(t,e){function r(r,i){var n=e[r];return"function"!=typeof n||i>t?function(){}:n.bind(e)}return rd.NONE>t?t=rd.NONE:t>rd.ALL&&(t=rd.ALL),e=e||{},{error:r("error",rd.ERROR),warn:r("warn",rd.WARN),info:r("info",rd.INFO),debug:r("debug",rd.DEBUG),verbose:r("verbose",rd.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:rd.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 Xc("diag",u,e,!0)},e.disable=function(){ed("diag",e)},e.createComponentLogger=function(t){return new id(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 od(t){return Symbol.for(t)}var ad,ud=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}},ld=function(){function t(){}return t.prototype.active=function(){return ud},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}(),hd="context",cd=new ld,dd=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return Xc(hd,t,sd.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 td(hd)||cd},t.prototype.disable=function(){this.be().disable(),ed(hd,sd.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(ad||(ad={}));var vd="0000000000000000",fd="00000000000000000000000000000000",pd={traceId:fd,spanId:vd,traceFlags:ad.NONE},gd=function(){function t(t){void 0===t&&(t=pd),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}(),md=od("OpenTelemetry Context Key SPAN");function yd(t){return t.getValue(md)||void 0}function bd(){return yd(dd.getInstance().active())}function _d(t,e){return t.setValue(md,e)}function wd(t){return t.deleteValue(md)}function xd(t,e){return _d(t,new gd(e))}function Sd(t){var e;return null===(e=yd(t))||void 0===e?void 0:e.spanContext()}var kd=/^([0-9a-f]{32})$/i,Cd=/^[0-9a-f]{16}$/i;function Td(t){return kd.test(r=t.traceId)&&r!==fd&&Cd.test(e=t.spanId)&&e!==vd;var e,r}function Id(t){return new gd(t)}var Ed=dd.getInstance(),Rd=function(){function t(){}return t.prototype.startSpan=function(t,e,r){if(void 0===r&&(r=Ed.active()),Boolean(null==e?void 0:e.root))return new gd;var i,n=r&&Sd(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&Td(n)?new gd(n):new gd},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:Ed.active(),u=this.startSpan(t,n,a),l=_d(a,u);return Ed.with(l,o,void 0,u)}},t}(),Md=new Rd,Od=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):Md},t}(),Pd=new(function(){function t(){}return t.prototype.getTracer=function(t,e,r){return new Rd},t}()),Ld=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 Od(this,t,e,r)},t.prototype.getDelegate=function(){var t;return null!==(t=this.ce)&&void 0!==t?t:Pd},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}(),Ad=dd.getInstance(),Fd=sd.instance(),Nd="trace",$d=function(){function t(){this.xe=new Ld,this.wrapSpanContext=Id,this.isSpanContextValid=Td,this.deleteSpan=wd,this.getSpan=yd,this.getActiveSpan=bd,this.getSpanContext=Sd,this.setSpan=_d,this.setSpanContext=xd}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=Xc(Nd,this.xe,sd.instance());return e&&this.xe.setDelegate(t),e},t.prototype.getTracerProvider=function(){return td(Nd)||this.xe},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){ed(Nd,sd.instance()),this.xe=new Ld},t}().getInstance(),Dd=od("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function qd(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(jd(i)){e=i;continue}return!1}return!1}}return!0}(t):jd(typeof t))}function jd(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}function Ud(t){try{(t=>{Fd.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 Hd,Bd=performance,zd="telemetry.sdk.language",Vd="telemetry.sdk.name",Wd="telemetry.sdk.version",Zd={[Vd]:"opentelemetry","process.runtime.name":"browser",[zd]:"webjs",[Wd]:"2.2.0"},Gd=Math.pow(10,6),Qd=Math.pow(10,9);function Jd(t){return[Math.trunc(t/1e3),Math.round(t%1e3*Gd)]}function Yd(){var t=Bd.timeOrigin;return"number"!=typeof t&&(t=Bd.timing&&Bd.timing.fetchStart),t}function Kd(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<Yd()?(e=t,r=Jd(Yd()),i=Jd("number"==typeof e?e:Bd.now()),Qd>(n=[r[0]+i[0],r[1]+i[1]])[1]||(n[1]-=Qd,n[0]+=1),n):Jd(t);var e,r,i,n,s;if(t instanceof Date)return Jd(t.getTime());throw TypeError("Invalid input type")}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(Hd||(Hd={}));var Xd="[object Object]",tv="[object Null]",ev="[object Undefined]",rv=function(){}.toString,iv=rv.call(Object),nv=Object.getPrototypeOf,sv=Object.prototype,ov=sv.hasOwnProperty,av=Symbol?Symbol.toStringTag:void 0,uv=sv.toString;function lv(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){return null==t?void 0===t?ev:tv:av&&av in Object(t)?function(t){var e=ov.call(t,av),r=t[av],i=!1;try{t[av]=void 0,i=!0}catch(t){}var n=uv.call(t);return i&&(e?t[av]=r:delete t[av]),n}(t):function(t){return uv.call(t)}(t)}(t)!==Xd)return!1;var e=nv(t);if(null===e)return!0;var r=ov.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&rv.call(r)===iv}function hv(t){return vv(t)?t.slice():t}function cv(t,e,r,i){var n;if(void 0===r&&(r=0),20>=r){if(r++,gv(t)||gv(e)||fv(e))n=hv(e);else if(vv(t)){if(n=t.slice(),vv(e))for(var s=0,o=e.length;o>s;s++)n.push(hv(e[s]));else if(pv(e))for(var a=Object.keys(e),u=0,l=a.length;l>u;u++){var h=a[u];n[h]=hv(e[h])}}else if(pv(t))if(pv(e)){if(!function(t,e){return!(!lv(t)||!lv(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(gv(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(dv(t,f,i)||dv(e,f,i))delete n[f];else{if(pv(g)&&pv(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]=cv(n[f],p,r,i)}}}}else n=e;return n}}function dv(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 vv(t){return Array.isArray(t)}function fv(t){return"function"==typeof t}function pv(t){return!gv(t)&&!vv(t)&&!fv(t)&&"object"==typeof t}function gv(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class mv extends Error{constructor(t){super(t),Object.setPrototypeOf(this,mv.prototype)}}function yv(t,e){var r,i=new Promise((function(t,i){r=setTimeout((function(){i(new mv("Operation timed out."))}),e)}));return Promise.race([t,i]).then((t=>(clearTimeout(r),t)),(t=>{throw clearTimeout(r),t}))}class bv{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 _v{constructor(t,e){this.Te=void 0,this.Me=void 0,this._e=!1,this.Le=new bv,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 wv={Oe:(t,e)=>new Promise((r=>{Ad.with(function(t){return t.setValue(Dd,!0)}(Ad.active()),(()=>{t.export(e,(t=>{r(t)}))}))}))};class xv{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=Fd.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,e){if(this.qe.debug("items to be sent",t),this.Ae.hasReachedLimit())e({code:Hd.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:Hd.FAILED,error:t.error}:"retryable"===t.status?{code:Hd.FAILED,error:new Hc("Export failed with retryable status")}:{code:Hd.FAILED,error:new Hc("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:Hd.SUCCESS})}}),(t=>e({code:Hd.FAILED,error:t})))):e({code:Hd.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 Sv(t,e,r){return i={transport:r,serializer:e,promiseHandler:Vc(t)},new xv(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&&Fd.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}},i.promiseHandler,{timeout:t.timeoutMillis}.timeout);var i}function kv(t){return 48>t||t>57?97>t||t>102?t-55:t-87:t-48}function Cv(t){for(var e=new Uint8Array(t.length/2),r=0,i=0;t.length>i;i+=2){var n=kv(t.charCodeAt(i)),s=kv(t.charCodeAt(i+1));e[r++]=n<<4|s}return e}function Tv(t){var e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Iv(t){var e;return e=Tv(t),{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var Ev="undefined"!=typeof BigInt?function(t){return Tv(t).toString()}:function(t){return t[0]*Qd+t[1]};function Rv(t){return t}function Mv(t){if(void 0!==t)return Cv(t)}var Ov={encodeHrTime:Iv,encodeSpanContext:Cv,encodeOptionalSpanContext:Mv};function Pv(t,e){return{key:t,value:Lv(e)}}function Lv(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(Lv)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((t=>{var[e,r]=t;return Pv(e,r)}))}}:{}}function Av(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=>Pv(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:Lv(t.body),eventName:t.eventName,attributes:(s=t.attributes,Object.keys(s).map((t=>Pv(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 Fv=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class Nv{static FromAttributeList(t,e){var r=new Nv({},e);return r.De=Dv(t),r.Fe=t.filter((t=>{var[e,r]=t;return Fv(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 Fv(r)&&(this.Fe=!0),[e,r]})),this.De=Dv(this.De),this.je=function(t){if("string"==typeof t||void 0===t)return t;Fd.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,Fv(i)?yield i:i]}t.Fe=!1}}))()}get attributes(){if(this.asyncAttributesPending&&Fd.error("Accessing resource attributes before async attributes settled"),this.He)return this.He;var t={};for(var[e,r]of this.De){var i;Fv(r)?Fd.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 Fd.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 Nv.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],o)}}function $v(t,e){return Nv.FromAttributeList(Object.entries(t),e)}function Dv(t){return t.map((t=>{var[e,r]=t;return Fv(r)?[e,r.catch((t=>{Fd.debug("promise rejection for resource attribute: %s - %s",e,t)}))]:[e,r]}))}var qv={serializeRequest(t){var e,r,i=(e=t,r=function(t){var e,r;if(void 0===t)return Ov;var i=null===(e=t.useLongBits)||void 0===e||e,n=null!==(r=t.useHex)&&void 0!==r&&r;return{encodeHrTime:i?Iv:Ev,encodeSpanContext:n?Rv:Cv,encodeOptionalSpanContext:n?Rv:Mv}}({useHex:!0,useLongBits:!1}),{resourceLogs:Av(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 jv{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 Uv(t){return new jv(t.transport)}function Hv(t){return[429,502,503,504].includes(t)}function Bv(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 zv{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&&Hv(s.status)?n({status:"retryable",retryInMillis:Bv(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")}):(Fd.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 Vv{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}))?(Fd.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class Wv{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?Hv(u.status)?{status:"retryable",retryInMillis:Bv(u.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}:(Fd.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 Zv(t,e){return Sv(t,e,Uv({transport:(r=t,new zv(r))}));var r}function Gv(t,e){return Sv(t,e,Uv({transport:(r=t,new Wv(r))}));var r}function Qv(t,e){return Sv(t,e,Uv({transport:(r={url:t.url,headers:t.headers},new Vv(r))}));var r}function Jv(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 Yv(t){return"function"==typeof t.headers?t.headers:function(t){if(null!=t)return e((function*(){return t}))}(t.headers)}function Kv(t,i,n){return s={url:t.url,timeoutMillis:t.timeoutMillis,headers:Yv(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:Bc(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):Fd.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),e}(yield h())),Object.assign(e,t)}))),url:null!==(u=null!==(l=Jv(s.url))&&void 0!==l?l:o.url)&&void 0!==u?u:a.url});var s,o,a,u,l,h,c,d}function Xv(t,e,r,i){return(t.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?Gv:Zv:Qv)(Kv(t,r,i),e)}class tf extends Uc{constructor(t){void 0===t&&(t={}),super(Xv(t,qv,"v1/logs",{"Content-Type":"application/json"}))}}class ef{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=Kd(null!=i?i:c),this.hrTimeObserved=Kd(null!=n?n:c),h){var d=$d.getSpanContext(h);d&&Td(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?(Fd.warn("Invalid attribute key: "+t),this):qd(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]=qd(e)?this.Xe(e):e,this):(1===this.droppedAttributesCount&&Fd.warn("Dropping extra attributes."),this)):(Fd.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:(Fd.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&&Fd.warn("Can not execute the operation on emitted log record"),this.Qe}}class rf{constructor(t,e){this.instrumentationScope=void 0,this.Ke=void 0,this.instrumentationScope=t,this.Ke=e}emit(t){var e=t.context||Ad.active(),i=new ef(this.Ke,this.instrumentationScope,r({context:e},t));this.Ke.activeProcessor.onEmit(i,e),i.Ye()}}class nf{forceFlush(){return Promise.resolve()}onEmit(t,e){}shutdown(){return Promise.resolve()}}class sf{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=>yv(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 of{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 sf(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new nf}}class af{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=cv(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:$v({"service.name":"unknown_service",[zd]:Zd[zd],[Vd]:Zd[Vd],[Wd]:Zd[Wd]});this.Ke=new of(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 _v(this.tt,this)}getLogger(t,e,r){if(this.et.isCalled)return Fd.warn("A shutdown LoggerProvider cannot provide a Logger"),Pc;t||Fd.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 rf({name:i,version:e,schemaUrl:null==r?void 0:r.schemaUrl},this.Ke)),this.Ke.loggers.get(n)}forceFlush(){return this.et.isCalled?(Fd.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.et.promise):this.Ke.activeProcessor.forceFlush()}shutdown(){return this.et.isCalled?(Fd.warn("shutdown may only be called once per LoggerProvider"),this.et.promise):this.et.call()}tt(){return this.Ke.activeProcessor.shutdown()}}class uf{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 _v(this.tt,this),this.nt>this.it&&(Fd.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)=>{yv(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,Ud(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=()=>wv.Oe(this.rt,t).then((t=>{var e;t.code!==Hd.SUCCESS&&Ud(null!==(e=t.error)&&void 0!==e?e:new Error("BatchLogRecordProcessor: log record export failed (status "+t+")"))})).catch(Ud),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,Ud)}}class lf extends uf{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 hf=1e4,cf=function(t,e){if(void 0===e&&(e=new WeakSet),!hr(t)&&!ur(t))return t;if(e.has(t))return"[Circular]";e.add(t);var r,i=ur(t)?[]:{};try{r=Object.keys(t)}catch(t){return}for(var n of r)try{i[n]=cf(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},df=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=hf),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(hr(a))df(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},vf={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};xn.__PosthogExtensions__=xn.__PosthogExtensions__||{},xn.__PosthogExtensions__.logs={initializeLogs(t){(t=>{var e,i={"service.name":(null==(e=t.config.logs)?void 0:e.serviceName)||"posthog-browser-logs",host:xn.location.host};if(t.sessionManager){var{sessionId:n,windowId:s}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i=r({},i,{"session.id":n,"window.id":s})}jc.setGlobalLoggerProvider(new af({resource:$v(i),processors:[new lf(new tf({url:t.config.api_host+"/i/v1/logs?token="+t.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(t);var e=jc.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;xn.console[n]=(s=xn.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(cf(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&&!pr(i)){if(e.has(i))return"[Circular]";e.add(i)}return i}));var e})).join(" ");l.length>hf&&(l=l.slice(0,hf)+"...",i.body_truncated="true"),e.emit({severityText:vf[n],body:l,attributes:r({"log.source":"console."+n,distinct_id:t.get_distinct_id(),"location.href":xn.location.href},i,hr(a[0])?df(a[0]):{})}),s.apply(xn.console,a)}})};for(var a of["debug","log","warn","error","info"])o(a)}};var ff=En("[Error tracking]");function pf(){return new Ai([new Zi,new nn,new Qi,new Gi,new en,new tn,new Yi,new rn],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=Vi.test(u)?u.replace(Vi,"$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>=Wi)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,Wi).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||Fi});var i}))}(s)}}("web:javascript",Ui,zi))}var gf=En("[ExceptionAutocapture]"),mf=pf(),yf={wrapOnError(t){var e=dn;e||gf.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=mf.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=dn;e||gf.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(e){var i,n=mf.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||gf.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=mf.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}}};xn.__PosthogExtensions__=xn.__PosthogExtensions__||{},xn.__PosthogExtensions__.errorWrappingFunctions=yf,xn.posthogErrorWrappingFunctions=yf;var bf=(t,e,r,i)=>{var n;try{n=new URL(i.url).hostname}catch(t){return}if(!ur(t)||t.includes(n)){if(r){var{sessionId:s,windowId:o}=r.checkAndGetSessionAndWindowId(!0);i.headers.set("X-POSTHOG-SESSION-ID",s),i.headers.set("X-POSTHOG-WINDOW-ID",o)}e!==Ds&&i.headers.set("X-POSTHOG-DISTINCT-ID",e)}};xn.__PosthogExtensions__=xn.__PosthogExtensions__||{};var _f={_patchFetch:(t,r,i)=>Vn(dn,"fetch",(n=>function(){var s=e((function*(e,s){var o=new Request(e,s);return bf(t,r,i,o),n(o)}));return function(t,e){return s.apply(this,arguments)}}())),_patchXHR:(t,e,r)=>Vn(dn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,u){void 0===o&&(o=!0);var l=new Request(s);return bf(t,e,r,l),i.call(this,n,l.url,o,a,u)}))};xn.__PosthogExtensions__.tracingHeadersPatchFns=_f,xn.postHogTracingHeadersPatchFns=_f;var wf=-1,xf=t=>{addEventListener("pageshow",(e=>{e.persisted&&(wf=e.timeStamp,t(e))}),!0)},Sf=(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))}},kf=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},Cf=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Tf=()=>{var t,e=Cf();return null!==(t=null==e?void 0:e.activationStart)&&void 0!==t?t:0},If=function(t,e){void 0===e&&(e=-1);var r=Cf(),i="navigate";return 0>wf?r&&(document.prerendering||Tf()>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}},Ef=new WeakMap;function Rf(t,e){return Ef.get(t)||Ef.set(t,new e),Ef.get(t)}class Mf{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 Of,Pf=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){}},Lf=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Af=-1,Ff=new Set,Nf=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,$f=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Ff)e();isFinite(Af)||(Af="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",$f,!0))}},Df=()=>{if(0>Af){var t,e=Tf(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0])?void 0:t.startTime;Af=null!=r?r:Nf(),addEventListener("visibilitychange",$f,!0),addEventListener("prerenderingchange",$f,!0),xf((()=>{setTimeout((()=>{Af=Nf()}))}))}return{get firstHiddenTime(){return Af},onHidden(t){Ff.add(t)}}},qf=t=>{document.prerendering?addEventListener("prerenderingchange",(()=>t()),!0):t()},jf=[1800,3e3],Uf=function(t,e){void 0===e&&(e={}),qf((()=>{var r,i=Df(),n=If("FCP"),s=Pf("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),i.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-Tf(),0),n.entries.push(e),r(!0)))}));s&&(r=Sf(t,n,jf,e.reportAllChanges),xf((i=>{n=If("FCP"),r=Sf(t,n,jf,e.reportAllChanges),kf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},Hf=[.1,.25],Bf=0,zf=1/0,Vf=0,Wf=t=>{for(var e of t)e.interactionId&&(zf=Math.min(zf,e.interactionId),Vf=Math.max(Vf,e.interactionId),Bf=Vf?(Vf-zf)/7+1:0)},Zf=()=>{var t;return Of?Bf:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Gf=0;class Qf{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){Gf=Zf(),this.u.length=0,this.l.clear()}L(){var t=Math.min(this.u.length-1,Math.floor((Zf()-Gf)/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 Jf=t=>{var e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=Lf(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e((()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})})))},Yf=[200,500];class Kf{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var Xf=[2500,4e3],tp={onLCP(t,e){void 0===e&&(e={}),qf((()=>{var r,i=Df(),n=If("LCP"),s=Rf(e,Kf),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-Tf(),0),n.entries=[o],r())},a=Pf("largest-contentful-paint",o);if(a){r=Sf(t,n,Xf,e.reportAllChanges);var u=Lf((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),l=t=>{t.isTrusted&&(Jf(u),removeEventListener(t.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});xf((i=>{n=If("LCP"),r=Sf(t,n,Xf,e.reportAllChanges),kf((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var r=Df();Uf(Lf((()=>{var i,n=If("CLS",0),s=Rf(e,Mf),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=Pf("layout-shift",o);a&&(i=Sf(t,n,Hf,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),xf((()=>{s.i=0,n=If("CLS",0),i=Sf(t,n,Hf,e.reportAllChanges),kf((()=>i()))})),setTimeout(i))})))},onFCP:Uf,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Df();qf((()=>{var i;"interactionCount"in performance||Of||(Of=Pf("event",Wf,{type:"event",buffered:!0,durationThreshold:0}));var n,s=If("INP"),o=Rf(e,Qf),a=t=>{Jf((()=>{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=Pf("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=Sf(t,s,Yf,e.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(u.takeRecords()),n(!0)})),xf((()=>{o.v(),s=If("INP"),n=Sf(t,s,Yf,e.reportAllChanges)})))}))}}};xn.__PosthogExtensions__=xn.__PosthogExtensions__||{},xn.__PosthogExtensions__.postHogWebVitalsCallbacks=tp,xn.postHogWebVitalsCallbacks=tp,xn.__PosthogExtensions__.loadWebVitalsCallbacks=()=>tp;class ep{constructor(t){this.disabled=!1===t;var e=hr(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 rp="$copy_autocapture",ip=En("[AutoCapture]");function np(t,e){return e.length>t?e.slice(0,t)+"...":e}function sp(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!no(e));return e}function op(t,e){var i,n,{e:s,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:u,elementsChainAsString:l}=e;if(!no(t))return{props:{}};for(var h=[t],c=t;c.parentNode&&!so(c,"body");)if(ao(c.parentNode))h.push(c.parentNode.host),c=c.parentNode.host;else{if(!no(c.parentNode))break;h.push(c.parentNode),c=c.parentNode}var d,v,f=[],p={},g=!1,m=!1;if(Mn(h,(t=>{var e=xo(t);if(so(t,"a")){var r=t.getAttribute("href");g=e&&!!r&&Mo(r)&&r}rr(ho(t),"ph-no-capture")&&(m=!0),f.push(function(t,e,r,i){var n=t.tagName.toLowerCase(),s={tag_name:n};po.indexOf(n)>-1&&!r&&(s.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?np(1024,Oo(t)):np(1024,vo(t)));var o=ho(t);o.length>0&&(s.classes=o.filter((function(t){return""!==t}))),Mn(t.attributes,(function(r){var n;if((!So(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&Mo(r.value)&&(!vr(n=r.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=r.value;"class"===r.name&&(o=uo(o).join(" ")),s["attr__"+r.name]=np(1024,o)}}));for(var a=1,u=1,l=t;l=sp(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(!xo(t))return{};var e={};return Mn(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&&Mo(i)&&(e[r]=i)}})),e}(t);On(p,i)})),m)return{props:{},explicitNoCapture:m};if(a||(f[0].$el_text=so(t,"a")||so(t,"button")?Oo(t):vo(t)),g){var y,b;f[0].attr__href=g;var _=null==(y=jn(g))?void 0:y.host,w=null==dn||null==(b=dn.location)?void 0:b.host;_&&w&&_!==w&&(d=g)}return{props:On({$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 Pn(o).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[Lo(e.toString())]=Lo(r.toString())})),(n+=":")+Pn(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:Ao(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Pn(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 ap={};function up(t){return function(t,e){var r=ap[t];if(r)return r;var i,n=e[t];if(lr(i=n)&&-1!==i.toString().indexOf("[native code]")&&!dn.Zone)return ap[t]=n.bind(e);var s=e.document;if(s&&lr(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){In.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return n&&lr(n)?ap[t]=n.bind(e):n}("MutationObserver",t)}function lp(t,e){return mr(t)&&t>=e}class hp{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,__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=fo(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);pr(e)||this._t(e)||this.Tt.push(e),this.Tt.length&&dr(this.Lt)&&(this.Lt=xn.setTimeout((()=>{this.Ot()}),1e3))},this.Et=()=>{var t=Date.now();t%50==0&&this.Tt.forEach((e=>{dr(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Rt=()=>{this.Nt=Date.now()},this.At=()=>{"visible"===(null==pn?void 0:pn.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=up(xn);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,xn.removeEventListener("click",this.Mt),xn.removeEventListener("scroll",this.Et,{capture:!0}),xn.removeEventListener("selectionchange",this.Rt),null==pn||pn.removeEventListener("visibilitychange",this.At)}Vt(t){this.Wt=Date.now()}Dt(){Dn(xn,"click",this.Mt)}Ft(){Dn(xn,"scroll",this.Et,{capture:!0})}jt(){Dn(xn,"selectionchange",this.Rt)}Ht(){Dn(pn,"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(io(t.node))return!0;var r=this.Tt.some((e=>e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!!r||!(!so(t.node,"html")&&no(t.node)&&!po.includes(t.node.tagName.toLowerCase()))}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=lp(e.scrollDelayMs,this.qt.scroll_threshold_ms),n=lp(e.selectionChangedDelayMs,this.qt.selection_change_threshold_ms),s=lp(e.mutationDelayMs,this.qt.mutation_threshold_ms),o=lp(e.absoluteDelayMs,1.1*this.qt.mutation_threshold_ms),a=mr(e.scrollDelayMs)&&this.qt.scroll_threshold_ms>e.scrollDelayMs,u=mr(e.mutationDelayMs)&&this.qt.mutation_threshold_ms>e.mutationDelayMs,l=mr(e.selectionChangedDelayMs)&&this.qt.selection_change_threshold_ms>e.selectionChangedDelayMs,h=mr(e.visibilityChangedDelayMs)&&this.qt.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(a||u||l||h)){var c=lp(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&&dr(this.Lt)&&(this.Lt=xn.setTimeout((()=>{this.Ot()}),1e3))}}It(t,e){this.instance.capture("$dead_click",r({},e,op(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)})}}xn.__PosthogExtensions__=xn.__PosthogExtensions__||{},xn.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new hp(t,e);var cp=En("[ExternalScriptsLoader]"),dp=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return cp.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==pn?void 0:pn.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(!pn)return r("document not found");var i=pn.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)pn.head.appendChild(i);else{var n,s=pn.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):pn.body.appendChild(i)}};null!=pn&&pn.body?a():null==pn||pn.addEventListener("DOMContentLoaded",a)};xn.__PosthogExtensions__=xn.__PosthogExtensions__||{},xn.__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)}dp(t,i,r)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");dp(t,o,r)}},xn.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);dp(t,i,r)};class vp{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===Bs}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 Cr(t)?1:rr(Tr,t)?0:-1}get nr(){var t=this.qt.opt_out_capturing_persistence_type,e="localStorage"===t?Vl:Bl;if(!this.ar||this.ar!==e){this.ar=e;var r="localStorage"===t?Bl:Vl;r.A(this.sr)&&(this.ar.A(this.sr)||this.optInOut(Cr(r.A(this.sr))),r.q(this.sr,this.qt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.qt.respect_dnt&&[null==fn?void 0:fn.doNotTrack,null==fn?void 0:fn.msDoNotTrack,xn.doNotTrack].some((t=>Cr(t)))}}var fp=En("[Dead Clicks]"),pp=()=>!0,gp=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(is)),i=t.instance.config.capture_dead_clicks;return br(i)?i:!!hr(i)||r};class mp{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({[is]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.lr((()=>{this.hr()})):this.stop()}lr(t){var e,r;null!=(e=xn.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=xn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?fp.error("failed to load script",e):t()}))}hr(){var t;if(pn){if(!this.ur&&null!=(t=xn.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=hr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.ur=xn.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.ur.start(pn),fp.info("starting...")}}else fp.error("`document` not found. Cannot start.")}stop(){this.ur&&(this.ur.stop(),this.ur=void 0,fp.info("stopping..."))}}var yp=En("[SegmentIntegration]");var bp="posthog-js";function _p(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 wp{constructor(t,e,r,i,n,s){this.name=bp,this.setupOnce=function(o){o(_p(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class xp{constructor(t){this.cr=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(In.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==dn?void 0:dn.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(!(dr(s)||dr(o)||dr(a)||dr(u)||dr(l)||dr(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?Ir(o/s,0,1,In):1,d=s>1?Ir(a/s,0,1,In):1,v=u>1?Ir(l/u,0,1,In):1,f=u>1?Ir(h/u,0,1,In):1;i=On(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 Sp={[Zn]:{exposure:"hidden"},[Qn]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Jn]:{exposure:"hidden"},[Yn]:{exposure:"event"},[Kn]:{exposure:"hidden"},[Xn]:{exposure:"event"},[ts]:{exposure:"hidden"},[es]:{exposure:"event"},[rs]:{exposure:"event"},[is]:{exposure:"event"},[ns]:{exposure:"hidden"},[ss]:{exposure:"event"},[os]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[cs]:{exposure:"hidden"},[ds]:{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"},[vs]:{exposure:"derived",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!hr(t))return{};for(var e={},r=Object.keys(t),i=0;r.length>i;i++)e["$feature/"+r[i]]=t[r[i]];return e}},[fs]:{exposure:"event"},[ps]:{exposure:"hidden"},[gs]:{exposure:"hidden"},[ms]:{exposure:"event"},[ys]:{exposure:"event"},[bs]:{exposure:"event"},[_s]:{exposure:"hidden"},[ws]:{exposure:"hidden"},[xs]:{exposure:"hidden"},[Ss]:{exposure:"hidden"},[ks]:{exposure:"event"},[Cs]:{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"},[Ts]:{exposure:"hidden"},[Is]:{exposure:"hidden"},[Es]:{exposure:"hidden"},[Rs]:{exposure:"hidden"},[Ms]:{exposure:"hidden"},[Os]:{exposure:"hidden"},[Ps]:{exposure:"hidden"},[Ls]:{exposure:"hidden"},[As]:{exposure:"hidden"},[Fs]:{exposure:"hidden"},[Ns]:{exposure:"hidden"},[as]:{exposure:"event"},[us]:{exposure:"event"},[ls]:{exposure:"event"},[hs]:{exposure:"event"},[qs]:{exposure:"event"},[js]:{exposure:"event"},[Us]:{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"}},kp=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Cp=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Tp{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&&In.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save()}isDisabled(){return!!this._r}br(t){-1===Cp.indexOf(t.persistence.toLowerCase())&&(In.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=[...Wl,...t];return r({},Vl,{F(t){try{var e={};try{e=Bl.F(t)||{}}catch(t){}var r=On(e,JSON.parse(Vl.A(t)||"{}"));return Vl.N(t,r),r}catch(t){}return null},N(t,r,i,n,s,o){try{Vl.N(t,r,void 0,void 0,o);var a={};e.forEach((t=>{r[t]&&(a[t]=r[t])})),Object.keys(a).length&&Bl.N(t,a,i,n,s,o)}catch(t){Vl.D(t)}},q(t,e){try{null==dn||dn.localStorage.removeItem(t),Bl.q(t,e)}catch(t){Vl.D(t)}}})}(t.cookie_persisted_properties||[]),i=t.persistence.toLowerCase();return"localstorage"===i&&Vl.R()?Vl:"localstorage+cookie"===i&&e.R()?e:"sessionstorage"===i&&Jl.R()?Jl:"memory"===i?Gl:"cookie"===i?Bl:e.R()?e:Bl}wr(t){var e=null!=t?t:this.qt.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var r=this.props[Rs];return!r||"number"!=typeof r||Date.now()-r>e}properties(){var t={};return Mn(this.props,((e,r)=>{var i=(t=>{var e=Sp[t];if(e)return e;for(var[r,i]of kp)if(0===t.indexOf(r))return i})(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,r===vs?()=>this.wr():()=>!1))return;i.transformToEventProperties&&On(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=On({},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(hr(t)){dr(e)&&(e="None"),this.Sr=dr(r)?this.Ir:r;var i=!1;if(Mn(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(hr(t)){this.Sr=dr(e)?this.Ir:e;var r=!1;if(Mn(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=oc(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);cr(Fn(t))||this.register(t),this.mr=!0}}update_search_keyword(){var t;this.register((t=null==pn?void 0:pn.referrer)?uc(t):{})}update_referrer_info(){var t;this.register_once({$referrer:cc(),$referring_domain:null!=pn&&pn.referrer&&(null==(t=jn(pn.referrer))?void 0:t.host)||hc},void 0)}set_initial_person_info(){this.props[Ls]||this.props[As]||this.register_once({[Fs]:dc(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Mn([As,Ls],(e=>{var r=this.props[e];r&&Mn(r,(function(e,r){t["$initial_"+nr(r)]=e}))}));var e,r,i=this.props[Fs];if(i){var n=(e=vc(i),r={},Mn(e,(function(t,e){r["$initial_"+nr(e)]=t})),r);On(t,n)}return t}safe_merge(t){return Mn(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[Jn]||{};r[t]=e,this.Tr(Jn,r),this.save()}remove_event_timer(t){var e=this.props[Jn]||{},r=e[t];return dr(r)||(delete e[t],this.Tr(Jn,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 Ip={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},Ep={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"},Rp={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"},Mp=En("[RateLimiter]");class Op{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=>{Mp.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void Mp.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(Ps))&&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(Ps,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Pp=En("[RemoteConfig]");class Lp{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=xn._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Mr(t){var e,r;null!=(e=xn.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=xn.__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 Pp.info("Using preloaded remote config",this.remoteConfig),this.Rr(this.remoteConfig),void this.Or();if(this._instance.Lr())return void Pp.warn("Remote config is disabled. Falling back to local config.");this.Mr((t=>{if(!t)return Pp.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){Pp.error("Error loading remote config",t)}}stop(){this.Fr&&(clearInterval(this.Fr),this.Fr=void 0)}refresh(){!this._instance.Lr()&&pn&&"hidden"!==pn.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||Pp.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 Ap=3e3;class Fp{constructor(t,e){this.Ar=!0,this.Nr=[],this.$r=Ir((null==e?void 0:e.flush_interval_ms)||Ap,250,5e3,In.createLogger("flush interval"),Ap),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&&ur(r.data)&&Mn(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 Mn(this.Nr,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;dr(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.Nr=[],t}}var Np=["retriesPerformedSoFar"];class $p{constructor(t){this.Br=!1,this.zr=3e3,this.Nr=[],this._instance=t,this.Nr=[],this.Vr=!0,!dr(dn)&&"onLine"in dn.navigator&&(this.Vr=dn.navigator.onLine,this.Wr=()=>{this.Vr=!0,this.Zr()},this.Gr=()=>{this.Vr=!1},Dn(dn,"online",this.Wr),Dn(dn,"offline",this.Gr))}get length(){return this.Nr.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,Np);yr(e)&&(n.url=Ml(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)"),In.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,dr(dn)||(this.Wr&&(dn.removeEventListener("online",this.Wr),this.Wr=void 0),this.Gr&&(dn.removeEventListener("offline",this.Gr),this.Gr=void 0)),this.Nr))try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(t){In.error(t)}this.Nr=[]}}class Dp{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(){Dn(dn,"scroll",this.Yr,{capture:!0}),Dn(dn,"scrollend",this.Yr,{capture:!0}),Dn(dn,"resize",this.Yr)}scrollElement(){if(!this.ei)return null==dn?void 0:dn.document.documentElement;var t=ur(this.ei)?this.ei:[this.ei];for(var e of t){var r=null==dn?void 0:dn.document.querySelector(e);if(r)return r}}scrollY(){if(this.ei){var t=this.scrollElement();return t&&t.scrollTop||0}return dn&&(dn.scrollY||dn.pageYOffset||dn.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var t=this.scrollElement();return t&&t.scrollLeft||0}return dn&&(dn.scrollX||dn.pageXOffset||dn.document.documentElement.scrollLeft)||0}}var qp=t=>dc(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({[Os]:r})}},this._instance=t,this.si=e,this.ni=r,this.ii=i||qp,this.si.onSessionId(this.ti)}ri(){return this.ni.props[Os]}getSetOnceProps(){var t,e=null==(t=this.ri())?void 0:t.props;return e?"r"in e?vc(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 Mn(Fn(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+nr(r)]=e})),t}}class Up{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 Hp=En("[SessionId]");class Bp{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 Up,this.hi=(t,e)=>!(!yr(t)||!yr(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||Vu,this.fi=r||Vu;var n=this.qt.persistence_name||this.qt.token;if(this._sessionTimeoutMs=1e3*Ir(this.qt.session_idle_timeout_seconds||1800,60,36e3,Hp.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=Jl.F(this.gi),o=Jl.F(this.mi);s&&!o?this.ci=s:Jl.q(this.gi),Jl.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){Hp.error("Invalid sessionID in bootstrap",t)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return dr(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&&Jl.R()}xi(t){t!==this.ci&&(this.ci=t,this.yi()&&Jl.N(this.gi,t))}Si(){return this.ci?this.ci:this.yi()?Jl.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({[cs]:[e,t,r]}))}ki(){var t=this.ni.props[cs];return ur(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&&dn&&(dn.removeEventListener(Qs,this.li,{capture:!1}),this.li=void 0),this.ui=[]}wi(){this.li=()=>{this.yi()&&Jl.q(this.mi)},Dn(dn,Qs,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=yr(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(),Hp.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=yr(i)&&t&&!a?i:r,d=yr(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 zp=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&Xe(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>Xe(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},Vp="custom",Wp="i.posthog.com",Zp=/^\/static\//;class Gp{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("."+Wp,".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":Vp),this.Ii[this.apiHost]}Ti(t){var e=this.instance.config.__preview_external_dependency_versioned_paths;if("string"==typeof e&&Zp.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===Vp)return this.apiHost+e;var i=Wp+e;switch(t){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var Qp=En("[PostHog ExternalIntegrations]"),Jp={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Yp{constructor(t){this._instance=t}lr(t,e){var r;null==(r=xn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return Qp.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,s;!i||null!=(r=xn.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.lr(Jp[e],(()=>{var r;null==(r=xn.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=xn.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e]&&(null==(s=xn.__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 Kp,Xp={},tg=0,eg=()=>{},rg='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ig="Surveys module not available",ng="sanitize_properties is deprecated. Use before_send instead",sg="Invalid value for property_denylist config: ",og="posthog",ag=!Il&&-1===(null==wn?void 0:wn.indexOf("MSIE"))&&-1===(null==wn?void 0:wn.indexOf("Mozilla")),ug=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:$n(null==pn?void 0:pn.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:eg,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:gn&&vr(null==gn?void 0:gn.search)&&-1!==gn.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==dn||null==(e=dn.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){In.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:Zs,before_send:void 0,request_queue_config:{flush_interval_ms:Ap},error_tracking:{},_onCapture:eg,__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))},lg=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],hg=t=>{var e={};for(var[r,i]of lg)dr(t[r])||(e[i]=t[r]);var n=On({},e,t);return ur(t.property_blacklist)&&(dr(t.property_denylist)?n.property_denylist=t.property_blacklist:ur(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:In.error(sg+t.property_denylist)),n};class cg{constructor(){this.__forceAllowLocalhost=!1}get Ei(){return this.__forceAllowLocalhost}set Ei(t){In.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class dg{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===Bs&&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 cg,this.Oi=!1,this.version=Cn.LIB_VERSION,this.Li=new Up,this.Pi=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ug(),this.SentryIntegration=wp,this.sentryIntegration=t=>function(t,e){var r=_p(t,e);return{name:bp,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 Dp(this),this.pageViewManager=new xp(this),this.rateLimiter=new Op(this),this.requestRouter=new Gp(this),this.consent=new vp(this),this.externalIntegrations=new Yp(this);var e=null!==(t=dg.__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=vr(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=vr(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>In.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==og){var i,n=null!==(i=Xp[r])&&void 0!==i?i:new dg;return n._init(t,e,r),Xp[r]=n,Xp[og][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n,s;if(void 0===e&&(e={}),dr(t)||fr(t))return In.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(On({},ug(e.defaults),hg(e),{name:i,token:t})),this.config.on_xhr_error&&In.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:Gu.GZipJS;var o=this.Hi();this.persistence=new Tp(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Tp(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 Fp((t=>this.Bi(t)),this.config.request_queue_config),this.zi=new $p(this),this.__request_queue=[];var l=this.Ri();if(l||(this.sessionManager=new Bp(this),this.sessionPropsManager=new jp(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(In.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Vi(l)}),0)):(In.info("Initializing extensions synchronously"),this.Vi(l)),Cn.DEBUG=Cn.DEBUG||this.config.debug,Cn.DEBUG&&In.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(Ms);if(e.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===Vs)this.identify(h);else if(e.bootstrap.isIdentifiedID&&null!=c&&c!==h&&d===Ws)In.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(Vu()),f=e.bootstrap.isIdentifiedID?v:h;this.persistence.set_property(Ms,e.bootstrap.isIdentifiedID?Ws:Vs),this.register({distinct_id:h,$device_id:f})}}if(l)this.register_once({distinct_id:Ds,$device_id:null},"");else if(!this.get_distinct_id()){var p=this.config.get_device_id(Vu());this.register_once({distinct_id:p,$device_id:p},""),this.persistence.set_property(Ms,Vs)}return Dn(dn,"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()||Vu();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(Ms,Ws)),e()},n=r.user();"then"in n&&lr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||yp.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()||(yp.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(yp.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,Js),identify:t=>e(t,Ks),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Wi())):this.Wi(),lr(this.config._onCapture)&&this.config._onCapture!==eg&&(In.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&In.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({},dg.__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,gp)),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){In.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({[qs]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[js]:i}),this.config.__preview_deferred_init_extensions&&In.info("PostHog extensions initialized ("+i+"ms)")}Rr(t){var e;if(!pn||!pn.body)return In.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=rr(t.supportedCompression,Gu.GZipJS)?Gu.GZipJS:rr(t.supportedCompression,Gu.Base64)?Gu.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ni?this.Ni:Zs}),this.Pi.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Wi(){try{this.config.loaded(this)}catch(t){In.critical("`loaded` function failed",t)}if(this.Ji(),this.config.internal_or_test_user_hostname&&null!=gn&&gn.hostname){var t=gn.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 Lp(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()&&Rn(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(Ys),null==(e=this.logs)||e.flushLogs("sendBeacon"),null==(r=this.Ui)||r.unload(),null==(i=this.zi)||i.unload()):this.Xi()&&this.capture(Ys,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(ag?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Ml(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=Al(s.url,s.compression);var o=null!==(e=s.transport)&&void 0!==e?e:"fetch",a=Fl.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===Gu.GZipJS&&_n&&!Rl?Ll(s).then((t=>{u(t)})).catch((e=>{if(Ge(e))return Rl=!0,void u(r({},s,{compression:void 0,url:Al(t.url,void 0)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Ge(t)||e===Ze})(e)&&(Rl=!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){tg++;try{var e,r=[],i=[],n=[];Rn(t,(t=>{if(t)if(ur(e=t[0]))n.push(t);else if(lr(t))try{t.call(this)}catch(e){In.error("Error executing queued PostHog call",t,e)}else ur(t)&&"alias"===e?r.push(t):ur(t)&&-1!==e.indexOf("capture")&&lr(this[e])?n.push(t):i.push(t)}));var s=function(t,e){Rn(t,(function(t){try{if(ur(t[0])){var r=e;Mn(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){In.error("Error executing queued PostHog call",t,e)}}))};s(r,this),s(i,this),s(n,this)}finally{tg--}}push(t){if(tg>0&&ur(t)&&vr(t[0])){var e=dg.prototype[t[0]];lr(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(!dr(t)&&vr(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&&!vr(null==e?void 0:e.$current_url)&&(In.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||In.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)||Vu(),f={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===Js&&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!==Xs,t===Ks);if(p&&(f.$set_once=p),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=f,a=t=>vr(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),ur(e)?(i=[],Rn(e,(e=>{i.push(t(e))}))):(i={},Mn(e,((e,r)=>{u.has(e)||(i[r]=t(e,r))}))),i);var i}(o)),f.timestamp=d,dr(null==i?void 0:i.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=c),t===yu.DISMISSED||t===yu.SENT){var g=null==e?void 0:e[bu.SURVEY_ID],m=null==e?void 0:e[bu.SURVEY_ITERATION];$u({id:g,current_iteration:m}),f.$set=r({},f.$set,{[ku({id:g,current_iteration:m},t===yu.SENT?"responded":"dismissed")]:!0})}else t===yu.SHOWN&&(f.$set=r({},f.$set,{[bu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===Ep.SHOWN){var y=null==e?void 0:e[Rp.TOUR_TYPE];y&&(f.$set=r({},f.$set,{[Rp.TOUR_LAST_SEEN_DATE+"/"+y]:(new Date).toISOString()}))}var b=r({},f.properties.$set,f.$set);if(cr(b)||this.setPersonPropertiesForFlags(b),!gr(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};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Bi(w):this.Ui.enqueue(w),f}In.critical("This capture call is ignored due to client rate limiting.")}}else In.error("No event name provided to posthog.capture")}else In.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,(!vr(a.distinct_id)&&!mr(a.distinct_id)||fr(a.distinct_id))&&In.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(!wn)return{};var o,a=t?[...rc,...e||[]]:[],[u,l]=function(t){for(var e=0;Ci.length>e;e++){var[r,i]=Ci[e],n=r.exec(t),s=n&&(lr(i)?i(n,t):i);if(s)return s}return["",""]}(wn);return On(Fn({$os:u,$os_version:l,$browser:xi(wn,navigator.vendor),$device:Ti(wn),$device_type:Ii(wn,{userAgentDataPlatform:null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,maxTouchPoints:null==(i=navigator)?void 0:i.maxTouchPoints,screenWidth:null==dn||null==(n=dn.screen)?void 0:n.width,screenHeight:null==dn||null==(s=dn.screen)?void 0:s.height,devicePixelRatio:null==dn?void 0:dn.devicePixelRatio}),$timezone:fc(),$timezone_offset:pc()}),{$current_url:Bn(null==gn?void 0:gn.href,a,nc),$host:null==gn?void 0:gn.host,$pathname:null==gn?void 0:gn.pathname,$raw_user_agent:wn.length>1e3?wn.substring(0,997)+"...":wn,$browser_version:ki(wn,navigator.vendor),$browser_language:lc(),$browser_language_prefix:(o=lc(),"string"==typeof o?o.split("-")[0]:void 0),$screen_height:null==dn?void 0:dn.screen.height,$screen_width:null==dn?void 0:dn.screen.width,$viewport_height:null==dn?void 0:dn.innerHeight,$viewport_width:null==dn?void 0:dn.innerWidth,$lib:Cn.LIB_NAME,$lib_version:Cn.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&&On(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&On(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===Vp&&(a.$lib_custom_api_host=this.config.api_host),l=t!==Js||s?t!==Ys||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=On(a,l),t===Js&&pn&&(a.title=pn.title),!dr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}wn&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=On({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),ur(this.config.property_denylist)?Mn(this.config.property_denylist,(function(t){delete a[t]})):In.error(sg+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(In.error(ng),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=On({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&(In.error(ng),o=a(o,"$set_once")),e&&(this.Oi=!0),cr(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:ig}),()=>{})}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:ig})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:ig})}renderSurvey(t,e){var r;null==(r=this.surveys)||r.renderSurvey(t,e)}displaySurvey(t,e){var r;void 0===e&&(e=qu),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:ig}}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:ig})}un(t){return!t||fr(t)?(In.critical("Unique user id has not been set in posthog.identify"),!1):t===Ds?(In.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())||(In.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 In.uninitializedWarning("posthog.identify");if(mr(t)&&(t=t.toString(),In.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(Gn)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(Qn)&&(this.unregister(Qn),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(Ms)||Vs)===Vs;t!==i&&s?(this.persistence.set_property(Ms,Ws),this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!1),this.capture(Ks,{distinct_id:t,$anon_distinct_id:i},{$set:e||{},$set_once:r||{}}),this.$i=$l(t,e,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(e||r)&&this.setPersonProperties(e,r),t!==i&&(this.reloadFeatureFlags(),this.unregister(Ts))}}setPersonProperties(t,e){if((t||e)&&this.sn("posthog.setPersonProperties")){var r=$l(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):In.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(Xs,o)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else In.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(In.info("reset"),!this.__loaded)return In.uninitializedWarning("posthog.reset");var l=this.get_property(Gn);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),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(Ms,Vs),null==(u=this.sessionManager)||u.resetSessionId(),this.$i=null,this.config.cookieless_mode===zs)this.register_once({distinct_id:Ds,$device_id:null},"");else{var h=this.config.get_device_id(Vu());this.register_once({distinct_id:h,$device_id:t?h:l},"")}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(Zn)?(In.critical("Attempting to create alias for existing People user - aborting."),-2):this.sn("posthog.alias")?(dr(e)&&(e=this.get_distinct_id()),t!==e?(this.an(Qn,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(In.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(hr(t)){var i,n,s,o,a,u,l,h,c,d;On(this.config,hg(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 Tp(r({},this.config,{persistence:"sessionStorage"}),v);var f=this.Di(this.config.debug);br(f)&&(this.config.debug=f),br(this.config.debug)&&(this.config.debug?(Cn.DEBUG=!0,Vl.R()&&Vl.N("ph_debug",!0),In.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):(Cn.DEBUG=!1,Vl.R()&&Vl.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){Cn.LIB_NAME=t,Cn.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:dg.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:og;return e!==og&&(e=og+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Ms))===Ws||(null==(e=this.sessionPersistence)?void 0:e.get_property(Ms))===Ws}nn(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Zs&&!this._isIdentified()&&cr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Qn])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Ns]))}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?(In.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.an(Ns,!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!==Bs)}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 Bp(this),this.pageViewManager=new xp(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=dg.__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==Bs&&(null==(l=this.surveys)||l.loadIfEnabled()),(dr(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 In.warn(rg)}opt_out_capturing(){var t,e,r;this.config.cookieless_mode!==zs?(this.config.cookieless_mode===Bs&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===Bs&&(this.register({distinct_id:Ds,$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())):In.warn(rg)}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===Bs?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return fn?zp(fn,this.config.custom_blocked_useragents):void 0}Ki(){pn&&("visible"===pn.visibilityState?this.Fi||(this.Fi=!0,this.capture(Js,{title:pn.title},{send_instantly:!0}),this.Ai&&(pn.removeEventListener(Gs,this.Ai),this.Ai=null)):this.Ai||(this.Ai=this.Ki.bind(this),Dn(pn,Gs,this.Ai)))}debug(t){!1===t?(null==dn||dn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==dn||dn.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?(In.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=In,n=(e="advanced_disable_flags")in(t=o)&&!gr(t[e]),s=r in t&&!gr(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(gr(this.config.before_send))return t;var e=ur(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),gr(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return rr(er,t.event)?In.warn(n+". This can cause unexpected behavior."):In.info(n),null}r.properties&&!cr(r.properties)||In.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=br(t)&&!t,r=Vl.R()&&"true"===Vl.A("ph_debug");return!e&&(!!r||t)}}dg.__defaultExtensionClasses={},dg.dn={trace:Kp=()=>{},debug:Kp,info:Kp,warn:Kp,error:Kp,fatal:Kp},function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=An(t.prototype[e[r]])}(dg,["identify"]);var vg=En("[ExceptionAutocapture]"),fg=En("[TracingHeaders]"),pg=En("[Web Vitals]"),gg=9e5,mg="disabled",yg="lazy_loading",bg="awaiting_config",_g="missing_config";En("[SessionRecording]"),En("[SessionRecording]");var wg="[SessionRecording]",xg=En(wg),Sg=En("[Heatmaps]");function kg(t){return hr(t)&&"clientX"in t&&"clientY"in t&&mr(t.clientX)&&mr(t.clientY)}var Cg=En("[Product Tours]"),Tg=["$set_once","$set"],Ig=En("[SiteApps]"),Eg="Error while initializing PostHog app with config id ";function Rg(t,e,r){if(gr(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 Mg{constructor(t){this.vn=new Up,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;dr(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(!dr(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(!Rg(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=>Rg(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&Rg((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=>Rg(t.text,e.text,e.text_matching||"exact")||Rg(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;!gr(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=>Rg(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||jl(e.properties.reduce(((t,e)=>{var r=ur(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 Og{constructor(t){this._instance=t,this.Tn=new Map,this.En=new Map,this.Mn=new Map}Pn(t,e){return!!t&&jl(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===hu.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;dr(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 Mg(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,hu.Activation),this.En=this.Rn(t,hu.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,hu.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,hu.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 Pg extends Og{constructor(t){super(t)}$n(){return ks}Dn(){return yu.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 Ru}Un(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ks]:t})}Hn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Lg="SDK is not enabled or survey functionality is not yet loaded",Ag="Disabled. Not loading surveys.",Fg=null!=dn&&dn.location?zn(dn.location.hash,"__posthog")||zn(location.hash,"state"):null,Ng="_postHogToolbarParams",$g=En("[Toolbar]"),Dg=En("[FeatureFlags]"),qg=En("[FeatureFlags]",{debugEnabled:!0}),jg="\" failed. Feature flags didn't load in time.",Ug=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},Hg=t=>{var e={};for(var[r,i]of Pn(t||{}))i&&(e[r]=i);return e},Bg="Refusing to render web experiment since the viewer is a likely bot",zg={icontains:(t,e)=>!!dn&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!dn&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!dn&&Nl(e.href,t),not_regex:(t,e)=>!!dn&&!Nl(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class Vg{get qt(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Vg.zn("retrieved web experiments from the server"),e.Vn=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;e.Vn&&(Vg.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);vr(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];Vg.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())Vg.zn(Bg);else if(!this.qt.disable_web_experiments){if(gr(this.Vn))return this.Vn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Vg.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=Vg.getWindowLocation();if(null!=t&&t.search){var e=Hn(null==t?void 0:t.search,"__experiment_id"),r=Hn(null==t?void 0:t.search,"__experiment_variant");e&&r&&(Vg.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&&(Vg.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!gr(t.conditions)&&Vg.Qn(t)&&Vg.Jn(t)}static Qn(t){var e;if(gr(t.conditions)||gr(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,s=Vg.getWindowLocation();return!!s&&(null==(r=t.conditions)||!r.url||zg[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,s))}static getWindowLocation(){return null==dn?void 0:dn.location}static Jn(t){var e;if(gr(t.conditions)||gr(null==(e=t.conditions)?void 0:e.utm))return!0;var r=oc();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];In.info("[WebExperiments] "+t,r)}Wn(t,e,r){this._is_bot()?Vg.zn(Bg):"control"!==e?r.forEach((r=>{if(r.selector){var i;Vg.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)}))}})):Vg.zn("Control variants leave the page unmodified.")}_is_bot(){return fn&&this._instance?zp(fn,this.qt.custom_blocked_useragents):void 0}}var Wg=En("[Conversations]"),Zg="Conversations not available yet.",Gg={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,Dg.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||(Dg.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||Dg.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}cs(){return this.hs().length>0}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:dr(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(gs),e=this.os(bs),i=this.os(_s);if(!i&&!e)return t||{};var n=On({},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=dr(h)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!h,d=dr(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||(Dg.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.Kn=!0),n}getFlagVariants(){var t=this.os(vs),e=this.os(bs);if(!e)return t||{};for(var r=On({},t),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Kn||(Dg.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Kn=!0),r}getFlagPayloads(){var t=this.os(ms),e=this.os(_s);if(!e)return t||{};for(var r=On({},t||{}),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.Kn||(Dg.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.ds||(this._instance.Li.emit("featureFlagsReloading",!0),this.ds=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.ds),this.ds=void 0}ensureFlagsLoaded(){this.Yn||this.Xn||this.ds||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.es=t}vs(t){var e;if(this.fs(),!this._instance.Lr())if(this.Xn)this.ts=!0;else{var i=this.qt.token,n=this.os(Gn),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(ws)||{}),group_properties:this.os(xs),timezone:fc()};pr(n)||dr(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._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:o,data:s,compression:this.qt.disable_compression?void 0:Gu.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 a,u=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(u&&o.push("quota_limited"),null==(i=this.ni)||i.register({[Es]:o}),u)Dg.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(a=t.json)&&void 0!==a?a:{},n,{partialResponse:!!this.qt.advanced_only_evaluate_survey_feature_flags}),this.ts&&(this.ts=!1,this.vs())}}})}}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 Dg.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(ys)||void 0,u=this.os(Rs)||void 0,l=this.os(Ts)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var h,c=this._instance.get_session_id(),d=this.os(Is);c&&c!==d&&(l={},null==(h=this.ni)||h.register({[Ts]:l,[Is]: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;ur(l[t])?l[t].push(o):l[t]=[o],null==(v=this.ni)||v.register({[Ts]:l});var S=this.getFeatureFlagDetails(t),k=[...null!==(f=this.os(Es))&&void 0!==f?f:[]];dr(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};dr(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),dr(null==S?void 0:S.original_variant)&&dr(null==S?void 0:S.original_enabled)||(C.$feature_flag_original_response=dr(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(!dr(s))try{E=JSON.parse(s)}catch(t){}return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:E}}}}else Dg.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()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.qt.disable_compression?void 0:Gu.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 dr(r)?void 0:!!r}Dg.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]})))):Dg.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(ur(l)){Dg.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({[fs]:l,[vs]: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({[fs]:Object.keys(Hg(p)),[vs]:p||{},[ms]:g||{},[gs]:m||{}},c?{[ys]:c}:{},d?{[Rs]:d}:{}))}}}(t,this.ni,n,s,o,i),e||(this.ss=!1),this.ps(e)}}override(t,e){void 0===e&&(e=!1),Dg.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.ni)return Dg.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.ni.unregister(bs),this.ni.unregister(_s),this.ps(),qg.info("All overrides cleared");if(ur(t)){var e=Ug(t);return this.ni.register({[bs]:e}),this.ps(),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(bs),qg.info("Flag overrides cleared");else if(i.flags){if(ur(i.flags)){var n=Ug(i.flags);this.ni.register({[bs]:n})}else this.ni.register({[bs]:i.flags});qg.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.ni.unregister(_s),qg.info("Payload overrides cleared")):i.payloads&&(this.ni.register({[_s]:i.payloads}),qg.info("Payload overrides set",{payloads:i.payloads}))),void this.ps()}if(t&&"object"==typeof t)return this.ni.register({[bs]:t}),this.ps(),qg.info("Flag overrides set",{flags:t});Dg.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Yn){var{flags:e,flagVariants:r}=this.gs();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this.os(ps)||[]).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({[fs]:Object.keys(Hg(u)),[vs]:u}),this.ps()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this.os(ps),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(ps),null==(i=this.ni)||i.register({[ps]:n}),t(n)}}})}gs(){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)),{})}}ps(t){var{flags:e,flagVariants:r}=this.gs();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.os(ws)||{},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({[ws]:r({},i,o,n)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ws)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.os(xs)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[xs]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.os(xs)||{};this._instance.register({[xs]:r({},e,{[t]:{}})})}else this._instance.unregister(xs)}reset(){this.Yn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.fs(),this.Kn=!1}}},Qg={sessionRecording:class{get qt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var t;return!(null==(t=this.ys)||!t.isStarted)}get status(){var t,e;return this.bs===bg||this.bs===_g?this.bs:null!==(t=null==(e=this.ys)?void 0:e.status)&&void 0!==t?t:this.bs}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=mg,this._s=void 0,this._instance=t,!this._instance.sessionManager)throw xg.error("started without valid sessionManager"),new Error(wg+" started without valid sessionManager. This is a bug.");if(this.qt.cookieless_mode===zs)throw new Error(wg+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get ws(){var t,e=!(null==(t=this._instance.get_property(os))||!t.enabled),r=!this.qt.disable_session_recording,i=this.qt.disable_session_recording||this._instance.consent.isOptedOut();return dn&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.ws||null==(e=this.ys)||!e.isStarted){var r=!dr(Object.assign)&&!dr(Array.from);this.ws&&r?(this.xs(t),xg.info("starting")):(this.bs=mg,this.stopRecording())}}xs(t){var e,r,i;this.ws&&(this.bs!==bg&&this.bs!==_g&&(this.bs=yg),null!=xn&&null!=(e=xn.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=xn.__PosthogExtensions__)&&r.initSessionRecording?this.Ss(t):null==(i=xn.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.ks,(e=>{if(e)return xg.error("could not load recorder",e);this.Ss(t)})))}stopRecording(){var t,e;null==(t=this._s)||t.call(this),this._s=void 0,null==(e=this.ys)||e.stop()}Cs(){var t,e;null==(t=this._s)||t.call(this),this._s=void 0,null==(e=this.ys)||e.discard()}Is(){var t;null==(t=this.ni)||t.unregister(ds)}Ts(t,e){if(gr(t))return null;var r,i=mr(t)?t:parseFloat(t);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(xg.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):i}Es(t){if(this.ni){var e,i,n=this.ni,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.Ts(null==(e=this.qt.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.Ts(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;gr(a)&&this.Is();var u=null==i?void 0:i.minimumDurationMilliseconds;n.register({[os]: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:dr(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._s)||e.call(this),this._s=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){return"sessionRecording"in t?!1===t.sessionRecording?(this.Es(t),void this.Cs()):(this.Es(t),void this.startIfEnabledOrStop()):(this.bs===bg&&(this.bs=_g,xg.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.ys)&&r.log?this.ys.log(t,e):xg.warn("log called before recorder was ready")}get ks(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(os);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}Ms(){var t,e,r=this._instance.get_property(os);if(!r)return!1;try{e="object"==typeof r?r:JSON.parse(r)}catch(t){return xg.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}Ss(t){var e,r;if(null==(e=xn.__PosthogExtensions__)||!e.initSessionRecording)return xg.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Us]:!0});if(this.ys||(this.ys=null==(r=xn.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ms()){if(this.bs===_g||this.bs===bg)return;return this.bs=bg,xg.info("persisted remote config is stale, requesting fresh config before starting"),void new Lp(this._instance).load()}this.bs=yg,this.ys.start(t)}onRRwebEmit(t){var e;null==(e=this.ys)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.ys||null==(e=this.ni)||e.register({[us]:!0}),null==(t=this.ys)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.ys||null==(e=this.ni)||e.register({[as]:!0}),null==(t=this.ys)||t.overrideSampling()}overrideTrigger(t){var e,r;this.ys||null==(r=this.ni)||r.register({["url"===t?ls:hs]:!0}),null==(e=this.ys)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.ys)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.ys)||!r.tryAddCustomEvent(t,e))}}},Jg={autocapture:class{constructor(t){this.Ps=!1,this.Rs=null,this.Os=!1,this.instance=t,this.rageclicks=new ep(t.config.rageclick),this.Ls=null}initialize(){this.startIfEnabled()}get qt(){var t,e,r=hr(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}Fs(){if(this.isBrowserSupported()){if(dn&&pn){var t=t=>{t=t||(null==dn?void 0:dn.event);try{this.As(t)}catch(t){ip.error("Failed to capture event",t)}};if(Dn(pn,"submit",t,{capture:!0}),Dn(pn,"change",t,{capture:!0}),Dn(pn,"click",t,{capture:!0}),this.qt.capture_copied_text){var e=t=>{t=t||(null==dn?void 0:dn.event);try{this.As(t,rp)}catch(t){ip.error("Failed to capture copy/cut event",t)}};Dn(pn,"copy",e,{capture:!0}),Dn(pn,"cut",e,{capture:!0})}}}else ip.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ps&&(this.Fs(),this.Ps=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Os=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Yn]:!!t.autocapture_opt_out}),this.Rs=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Ls=t}getElementSelectors(t){var e,r=[];return null==(e=this.Ls)||e.forEach((e=>{var i=null==pn?void 0:pn.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[Yn];if(pr(this.Rs)&&!br(r)&&!this.instance.Lr())return!1;var i=null!==(e=this.Rs)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!i}As(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=fo(t);oo(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(!dn||_o(t))return!1;var r,i,n;if(br(e)?(r=!!e&&bo,i=void 0):(r=null!==(n=null==e?void 0:e.css_selector_ignorelist)&&void 0!==n?n:bo,i=null==e?void 0:e.content_ignorelist),!1===r)return!1;var{targetElementList:s}=wo(t,!1);return!function(t,e){if(!1===t||dr(t))return!1;var r;if(!0===t)r=yo;else{if(!ur(t))return!1;if(t.length>10)return In.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:vo(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!go(s,r)}(i,this.instance.config.rageclick)&&this.As(t,"$rageclick");var n=e===rp;if(i&&function(t,e,r,i,n){var s,o,a,u;if(void 0===r&&(r=void 0),!dn||_o(t))return!1;if(null!=(s=r)&&s.url_allowlist&&!lo(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&lo(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}=wo(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(dr(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(!go(c,null==(u=r)?void 0:u.css_selector_allowlist))return!1;var d=dn.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&&(po.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}(i,t,this.qt,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=op(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.Os});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),e===rp){var u,l=co(null==dn||null==(u=dn.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 lr(null==pn?void 0:pn.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Ns=(null==dn||null==(e=dn.location)?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(In.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.$s&&this.$s(),this.$s=void 0,In.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(dn&&dn.history){var r=this;null!=(t=dn.history.pushState)&&t.__posthog_wrapped__||Vn(dn.history,"pushState",(t=>function(e,i,n){t.call(this,e,i,n),r.Ds("pushState")})),null!=(e=dn.history.replaceState)&&e.__posthog_wrapped__||Vn(dn.history,"replaceState",(t=>function(e,i,n){t.call(this,e,i,n),r.Ds("replaceState")})),this.qs()}}Ds(t){try{var e,r=null==dn||null==(e=dn.location)?void 0:e.pathname;if(!r)return;r!==this.Ns&&this.isEnabled&&this._instance.capture(Js,{navigation_type:t}),this.Ns=r}catch(e){In.error("Error capturing "+t+" pageview",e)}}qs(){if(!this.$s){var t=()=>{this.Ds("popstate")};Dn(dn,"popstate",t),this.$s=()=>{dn&&dn.removeEventListener("popstate",t)}}}},heatmaps:class{get qt(){return this.instance.config}constructor(t){var e;this.js=!1,this.Ps=!1,this.Hs=null,this.instance=t,this.js=!(null==(e=this.instance.persistence)||!e.props[Kn]),this.rageclicks=new ep(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return hr(this.qt.capture_heatmaps)&&this.qt.capture_heatmaps.flush_interval_milliseconds&&(t=this.qt.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return gr(this.qt.capture_heatmaps)?gr(this.qt.enable_heatmaps)?this.js:this.qt.enable_heatmaps:!1!==this.qt.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ps)return;Sg.info("starting..."),this.Us(),this.At()}else{var t;clearInterval(null!==(t=this.Hs)&&void 0!==t?t:void 0),this.Bs(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Kn]:e}),this.js=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.M;return this.M=void 0,t}zs(t){this.Mt(t.originalEvent,"deadclick")}At(){this.Hs&&clearInterval(this.Hs),this.Hs="visible"===(null==pn?void 0:pn.visibilityState)?setInterval(this.Zr.bind(this),this.flushIntervalMilliseconds):null}Us(){dn&&pn&&(this.Vs=this.Zr.bind(this),Dn(dn,Qs,this.Vs),this.Ws=t=>this.Mt(t||(null==dn?void 0:dn.event)),Dn(pn,"click",this.Ws,{capture:!0}),this.Zs=t=>this.Gs(t||(null==dn?void 0:dn.event)),Dn(pn,"mousemove",this.Zs,{capture:!0}),this.Qs=new mp(this.instance,pp,this.zs.bind(this)),this.Qs.startIfEnabledOrStop(),this.Js=this.At.bind(this),Dn(pn,Gs,this.Js),this.Ps=!0)}Bs(){var t;dn&&pn&&(this.Vs&&dn.removeEventListener(Qs,this.Vs),this.Ws&&pn.removeEventListener("click",this.Ws,{capture:!0}),this.Zs&&pn.removeEventListener("mousemove",this.Zs,{capture:!0}),this.Js&&pn.removeEventListener(Gs,this.Js),clearTimeout(this.Ks),null==(t=this.Qs)||t.stop(),this.Ps=!1)}Ys(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&&no(i)&&!so(i,"body");){if(i===r)return!1;if(rr(e,null==dn?void 0:dn.getComputedStyle(i).position))return!0;i=mo(i)}return!1}(fo(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"),!io(t.target)&&kg(t)){var n=this.Ys(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&this.Xs(r({},n,{type:"rageclick"})),this.Xs(n)}}Gs(t){!io(t.target)&&kg(t)&&(clearTimeout(this.Ks),this.Ks=setTimeout((()=>{this.Xs(this.Ys(t,"mousemove"))}),500))}Xs(t){if(dn){var e=dn.location.href,r=this.qt.custom_personal_data_properties,i=this.qt.mask_personal_data_properties?[...rc,...r||[]]:[],n=Bn(e,i,nc);this.M=this.M||{},this.M[n]||(this.M[n]=[]),this.M[n].push(t)}}Zr(){this.M&&!cr(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:mp,webVitalsAutocapture:class{constructor(t){var e;this.js=!1,this.Ps=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.eo=()=>{clearTimeout(this.ro),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,i=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);if(dr(i))pg.error("Could not read session ID. Dropping metrics!");else{this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.io();dr(n)||(gr(null==t?void 0:t.name)||gr(null==t?void 0:t.value)?pg.error("Invalid metric received",t):!this.no||this.no>t.value?(this.M.url!==n&&(this.eo(),this.ro=setTimeout(this.eo,this.flushToCaptureTimeoutMs)),dr(this.M.url)&&(this.M.url=n),this.M.firstMetricTimestamp=dr(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.M.metrics.push(r({},t,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.M.metrics.length===this.allowedMetrics.length&&this.eo()):pg.error("Ignoring metric with value >= "+this.no,t))}},this.so=()=>{if(!this.Ps){var t,e,r,i,n=xn.__PosthogExtensions__;dr(n)||dr(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.Ps=!0):pg.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.js=!(null==(e=this._instance.persistence)||!e.props[rs]),this.startIfEnabled()}get oo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=hr(this.oo)?null==(t=this.oo)?void 0:t.web_vitals_allowed_metrics:void 0;return gr(r)?(null==(e=this._instance.persistence)?void 0:e.props[ss])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(hr(this.oo)?this.oo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=hr(this.oo)?this.oo.web_vitals_attribution:void 0;return null!=t&&t}get no(){var t=hr(this.oo)&&mr(this.oo.__web_vitals_max_value)?this.oo.__web_vitals_max_value:gg;return t>0&&6e4>=t?gg:t}get isEnabled(){var t=null==gn?void 0:gn.protocol;if("http:"!==t&&"https:"!==t)return pg.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=hr(this.oo)?this.oo.web_vitals:br(this.oo)?this.oo:void 0;return br(e)?e:this.js}startIfEnabled(){this.isEnabled&&!this.Ps&&(pg.info("enabled, starting..."),this.lr(this.so))}onRemoteConfig(t){if("capturePerformance"in t){var e=hr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=hr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[rs]:e}),this._instance.persistence.register({[ss]:r})),this.js=e,this.startIfEnabled()}}lr(t){var e,r;null!=(e=xn.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks?t():null==(r=xn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(e=>{e?pg.error("failed to load script",e):t()}))}io(){var t=dn?dn.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...rc,...e||[]]:[];return Bn(t,r,nc)}pg.error("Could not determine current URL")}}},Yg={exceptionObserver:class{constructor(t){var e,r,i;this.so=()=>{var t;if(dn&&this.isEnabled&&null!=(t=xn.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=xn.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=xn.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=xn.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ao&&this.qt.capture_unhandled_errors&&(this.ao=e(this.captureException.bind(this))),!this.uo&&this.qt.capture_unhandled_rejections&&(this.uo=r(this.captureException.bind(this))),!this.lo&&this.qt.capture_console_errors&&(this.lo=i(this.captureException.bind(this)))}catch(t){vg.error("failed to start",t),this.ho()}}},this._instance=t,this.co=!(null==(e=this._instance.persistence)||!e.props[Xn]),this.do=new Er({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:vg}),this.qt=this.vo(),this.startIfEnabledOrStop()}vo(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return hr(t)?e=r({},e,t):(dr(t)?this.co: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?(vg.info("enabled"),this.ho(),this.lr(this.so)):this.ho()}lr(t){var e,r;null!=(e=xn.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=xn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return vg.error("failed to load script",e);t()}))}ho(){var t,e,r;null==(t=this.ao)||t.call(this),this.ao=void 0,null==(e=this.uo)||e.call(this),this.uo=void 0,null==(r=this.lo)||r.call(this),this.lo=void 0}onRemoteConfig(t){"autocaptureExceptions"in t&&(this.co=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Xn]:this.co}),this.qt=this.vo(),this.startIfEnabledOrStop())}onConfigChange(){this.qt=this.vo()}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.do.consumeRateLimit(n)?vg.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.fo=[],this.po=pf(),this._instance=t,this.fo=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(ts))&&void 0!==e?e:[],this.mo=ln(this.yo()),this.bo=new hn(this.mo)}onConfigChange(){this.mo=ln(this.yo()),this.bo.setConfig(this.mo)}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.fo=n,this._instance.persistence&&this._instance.persistence.register({[ts]:this.fo,[es]:s})}}get _o(){var t,e=!!this._instance.get_property(es),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.po.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.mo.enabled)try{if(!vr(t)||0===t.trim().length)return void ff.warn("Ignoring exception step because message must be a non-empty string");var i=this.wo(e),{sanitizedProperties:n,droppedKeys:s}=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((r,i)=>an.has(i)?(e.push(i),r):(r[i]=t[i],r)),{}),droppedKeys:e}}(i);s.length>0&&ff.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.bo.add(r({[sn]:t,[on]:(new Date).toISOString()},n))}catch(t){ff.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.xo(e)){if(this.So(e))return this.ko("Exception dropped: matched a suppression rule"),void ff.info("Skipping exception capture because a suppression rule matched");if(!this._o&&this.Co(e))return this.ko("Exception dropped: thrown by a browser extension"),void ff.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Io(e))return this.ko("Exception dropped: thrown by the PostHog SDK"),void ff.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.mo.enabled&&gr(t.$exception_steps)?this.To(t):t;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",en:!0});return i&&this.bo.clear(),i}catch(t){return ff.error("Failed to capture exception event. Dropping this exception.",t),void this.bo.clear()}}catch(t){return void ff.error("Failed to process exception event. Ignoring this exception.",t)}}To(t){try{var e=this.bo.getAttachable();return 0===e.length?t:r({},t,{$exception_steps:e})}catch(e){return ff.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}ko(t){this.mo.enabled&&this.bo.add({[sn]:t,[on]:(new Date).toISOString()})}wo(t){return hr(t)?r({},t):{}}yo(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}So(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:r,value:i}=e;return vr(r)&&r.length>0&&t.$exception_types.push(r),vr(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.fo.some((t=>{var r=t.values.map((t=>{var r,i=Dl[t.operator],n=ur(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)}))}Co(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://")))}Io(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}xo(t){return!gr(t)&&ur(t)}}},Kg=r({productTours:class{get ni(){return this._instance.persistence}constructor(t){this.Eo=null,this.Mo=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){"productTours"in t&&(this.ni&&this.ni.register({[ns]:!!t.productTours}),this.loadIfEnabled())}loadIfEnabled(){var t,e;this.Eo||(t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(ns)||this.lr((()=>this.Po()))}lr(t){var e,r;null!=(e=xn.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=xn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?Cg.error("Could not load product tours script",e):t()}))}Po(){var t;!this.Eo&&null!=(t=xn.__PosthogExtensions__)&&t.generateProductTours&&(this.Eo=xn.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!ur(this.Mo)||e){var r=this.ni;if(r){var i=r.props[Cs];if(ur(i)&&!e)return this.Mo=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 Cg.error(n),void t([],{isLoaded:!1,error:n})}var s=ur(e.json.product_tours)?e.json.product_tours:[];this.Mo=s,r&&r.register({[Cs]:s}),t(s,{isLoaded:!0})}})}else t(this.Mo,{isLoaded:!0})}getActiveProductTours(t){gr(this.Eo)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Eo.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Eo)||e.showTourById(t)}previewTour(t){this.Eo?this.Eo.previewTour(t):this.lr((()=>{var e;this.Po(),null==(e=this.Eo)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Eo)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Eo)||t.nextStep()}previousStep(){var t;null==(t=this.Eo)||t.previousStep()}clearCache(){var t;this.Mo=null,null==(t=this.ni)||t.unregister(Cs)}resetTour(t){var e;null==(e=this.Eo)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Eo)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Eo)||e.cancelPendingTour(t)}}},Gg),Xg={siteApps:class{constructor(t){this._instance=t,this.Ro=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Oo(t,e){if(e){var r=this.globalsForEvent(e);this.Ro.push(r),this.Ro.length>1e3&&(this.Ro=this.Ro.slice(10))}}get siteAppLoaders(){var t;return null==(t=xn._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Oo.bind(this));this.Lo=()=>{t(),this.Ro=[],this.Lo=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,Tg),{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.Ro.length&&(Ig.info("Processing "+this.Ro.length+" events for site app with id "+t.id),this.Ro.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.Lo)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,Ig.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){Ig.error(Eg+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){Ig.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}Fo(){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)}Ao(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){Ig.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.Fo(),void this._instance.on("eventCaptured",(t=>this.Ao(t)))):void Ig.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.Lo)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var s=function(t){var e;xn["__$$ph_site_app_"+t]=n._instance,null==(e=xn.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return Ig.error(Eg+t,e)}))};for(var{id:o,url:a}of t.siteApps)s(o)}else Ig.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},tm={tracingHeaders:class{constructor(t){this.No=void 0,this.$o=void 0,this.so=()=>{var t,e,r=this.Do()||[];dr(this.No)&&(null==(t=xn.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchXHR(r,this._instance.get_distinct_id(),this._instance.sessionManager)),dr(this.$o)&&(null==(e=xn.__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=xn.__PosthogExtensions__)&&e.tracingHeadersPatchFns&&t(),null==(r=xn.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return fg.error("failed to load script",e);t()}))}Do(){var t;return null!==(t=this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var t,e;this.Do()?this.lr(this.so):(null==(t=this.No)||t.call(this),null==(e=this.$o)||e.call(this),this.No=void 0,this.$o=void 0)}}},em=r({surveys:class{get qt(){return this._instance.config}constructor(t){this.qo=void 0,this._surveyManager=null,this.jo=!1,this.Ho=[],this.Uo=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.qt.disable_surveys){var e=t.surveys;if(gr(e))return Ru.warn("Flags not loaded yet. Not loading surveys.");var r=ur(e);this.qo=r?e.length>0:e,Ru.info("flags response received, isSurveysEnabled: "+this.qo),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith(Lu)||null!=r&&r.startsWith(Au))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.jo)Ru.info("Already initializing surveys, skipping...");else if(this.qt.disable_surveys)Ru.info(Ag);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())Ru.info("Not loading surveys in cookieless mode without consent.");else{var t=null==xn?void 0:xn.__PosthogExtensions__;if(t){if(!dr(this.qo)||this.qt.advanced_enable_surveys){var e=this.qo||this.qt.advanced_enable_surveys;this.jo=!0;try{var r=t.generateSurveys;if(r)return void this.Bo(r,e);var i=t.loadExternalDependency;if(!i)return void this.zo(Hs);i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.zo("Could not load surveys script",r):this.Bo(t.generateSurveys,e)}))}catch(t){throw this.zo("Error initializing surveys",t),t}finally{this.jo=!1}}}else Ru.error("PostHog Extensions not found.")}}Bo(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Pg(this._instance),Ru.info("Surveys loaded successfully"),this.Vo({isLoaded:!0})}zo(t,e){Ru.error(t,e),this.Vo({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Ho.push(t),this._surveyManager&&this.Vo({isLoaded:!0}),()=>{this.Ho=this.Ho.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.qt.disable_surveys)return Ru.info(Ag),t([]);var r,i=this._instance.get_property(Ss);if(i&&!e)return t(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.Uo?this.Uo.then((e=>{var{surveys:r,context:i}=e;return t(r,i)})):("undefined"!=typeof Promise&&(this.Uo=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.Uo=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;Ru.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=>Mu(t)&&(Ou(t)||Pu(t))));l.length>0&&(null==(a=this._surveyEventReceiver)||a.register(l)),null==(i=this._instance.persistence)||i.register({[Ss]:u});var h={isLoaded:!0};t(u,h),null==r||r({surveys:u,context:h})}}))}Vo(t){for(var e of this.Ho)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Ru.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!gr(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Ru.warn("init was not called")}Wo(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}Zo(t){if(gr(this._surveyManager))return{eligible:!1,reason:Lg};var e="string"==typeof t?this.Wo(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(gr(this._surveyManager))return Ru.warn("init was not called"),{visible:!1,disabledReason:Lg};var e=this.Zo(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return gr(this._surveyManager)?(Ru.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Lg})):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.Zo(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if(gr(this._surveyManager))Ru.warn("init was not called");else{var n="string"==typeof t?this.Wo(t):t;if(null!=n&&n.id)if(Du.includes(n.type)){var s=null==pn?void 0:pn.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Ru.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Ru.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),Ru.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Ru.warn("Survey element not found")}else Ru.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Ru.warn("Survey not found")}}displaySurvey(t,e){var i;if(gr(this._surveyManager))Ru.warn("init was not called");else{var n=this.Wo(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!==_u.Popover&&e.initialResponses&&Ru.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 Ru.warn("Survey is not eligible to be displayed: ",o.disabledReason)}e.displayType!==_u.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Ru.warn("Survey not found")}}cancelPendingSurvey(t){gr(this._surveyManager)?Ru.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}},Gg),rm={toolbar:class{constructor(t){this.instance=t}Go(t){xn.ph_toolbar_state=t}Qo(){var t;return null!==(t=xn.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),qn(this.instance.config))return!1;if(!dn||!pn)return!1;t=null!=t?t:dn.location,r=null!=r?r:dn.history;try{if(!e){try{dn.localStorage.setItem("test","test"),dn.localStorage.removeItem("test")}catch(t){return!1}e=null==dn?void 0:dn.localStorage}var i,n=Fg||zn(t.hash,"__posthog")||zn(t.hash,"state"),s=n?Ln((()=>JSON.parse(atob(decodeURIComponent(n)))))||Ln((()=>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(Ng)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(t){return!1}}Jo(t){var e=xn.ph_load_toolbar||xn.ph_load_editor;!gr(e)&&lr(e)?e(t,this.instance):$g.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==pn||!pn.getElementById($s));if(!dn||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(dn.localStorage.setItem(Ng,JSON.stringify(r({},n,{source:void 0}))),2===this.Qo())this.Jo(n);else if(0===this.Qo()){var s;this.Go(1),null==(s=xn.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return $g.error("[Toolbar] Failed to load",t),void this.Go(0);this.Go(2),this.Jo(n)})),Dn(dn,"turbolinks:load",(()=>{this.Go(0),this.loadToolbar(n)}))}return!0}Ko(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)}}},im=r({experiments:Vg},Gg),nm={conversations:class{constructor(t){this.Yo=void 0,this._conversationsManager=null,this.Xo=!1,this.ea=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;gr(e)||(br(e)?this.Yo=e:(this.Yo=e.enabled,this.ea=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Yo=void 0,this.ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Xo||this._instance.config.disable_conversations||qn(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==xn?void 0:xn.__PosthogExtensions__;if(t&&!dr(this.Yo)&&this.Yo)if(this.ea&&this.ea.token){this.Xo=!0;try{var e=t.initConversations;if(e)return this.ta(e),void(this.Xo=!1);var r=t.loadExternalDependency;if(!r)return void this.ra(Hs);r(this._instance,"conversations",(e=>{e||!t.initConversations?this.ra("Could not load conversations script",e):this.ta(t.initConversations),this.Xo=!1}))}catch(t){this.ra("Error initializing conversations",t),this.Xo=!1}}else Wg.error("Conversations enabled but missing token in remote config.")}}ta(t){if(this.ea)try{this._conversationsManager=t(this.ea,this._instance),Wg.info("Conversations loaded successfully")}catch(t){this.ra("Error completing conversations initialization",t)}else Wg.error("Cannot complete initialization: remote config is null")}ra(t,e){Wg.error(t,e),this._conversationsManager=null,this.Xo=!1}show(){this._conversationsManager?this._conversationsManager.show():Wg.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Yo&&!pr(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):(Wg.warn(Zg),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(Wg.warn(Zg),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(Wg.warn(Zg),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(Wg.warn(Zg),null)}))()}requestRestoreLink(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(t):(Wg.warn(Zg),null)}))()}restoreFromToken(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(t):(Wg.warn(Zg),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Wg.warn(Zg),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()}}},sm={logs:class{constructor(t){var e;this.ia=!1,this.na=!1,this.Gt=En("[logs]"),this.sa=[],this.oa=0,this.aa=0,this.ua=!1,this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.ia=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e,r=null==(e=t.logs)?void 0:e.captureConsoleLogs;!gr(r)&&r&&(this.ia=!0,this.loadIfEnabled())}reset(){this.sa=[],this.qr&&(clearTimeout(this.qr),this.qr=void 0),this.oa=0,this.aa=0,this.ua=!1}loadIfEnabled(){if(this.ia&&!this.na){var t=null==xn?void 0:xn.__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.na=!0)})):this.Gt.error(Hs)}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.aa||(this.aa=h,this.oa=0,this.ua=!1),l>this.oa){this.oa++;var c=function(t,e){var i=t.level||"info",{text:n,number:s}=Ei[i]||Ri,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:Oi(u)};return t.trace_id&&(l.traceId=t.trace_id),t.span_id&&(l.spanId=t.span_id),dr(t.trace_flags)||(l.flags=t.trace_flags),l}(t,this.la());this.sa.push({record:c}),(null!==(o=null==(a=this._instance.config.logs)?void 0:a.maxBufferSize)&&void 0!==o?o:100)>this.sa.length?this.ha():this.flushLogs()}else this.ua||(this.Gt.warn("captureLog dropping logs: exceeded "+l+" logs per "+u+"ms"),this.ua=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.ca||(this.ca={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.ca}flushLogs(t){if(this.qr&&(clearTimeout(this.qr),this.qr=void 0),0!==this.sa.length){var e=this.sa;this.sa=[];var i=this._instance.config.logs,n=r({"service.name":(null==i?void 0:i.serviceName)||"unknown_service"},(null==i?void 0:i.environment)&&{"deployment.environment":i.environment},(null==i?void 0:i.serviceVersion)&&{"service.version":i.serviceVersion},null==i?void 0:i.resourceAttributes),s=function(t,e,r,i){return{resourceLogs:[{resource:{attributes:Oi(e)},scopeLogs:[{scope:{name:r,version:i},logRecords:t}]}]}}(e.map((t=>t.record)),n,Cn.LIB_NAME,Cn.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})}}ha(){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))}la(){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!=xn&&null!=(t=xn.location)&&t.href&&(e.currentUrl=xn.location.href),this._instance.featureFlags){var i=this._instance.featureFlags.getFlags();i&&i.length>0&&(e.activeFeatureFlags=i)}return e}}},om=r({},Gg,Qg,Jg,Yg,Kg,Xg,em,tm,rm,im,nm,sm);dg.__defaultExtensionClasses=r({},om);var am,um=(am=Xp[og]=new dg,function(){function t(){t.done||(t.done=!0,ag=!1,Mn(Xp,(function(t){t._dom_loaded()})))}null!=pn&&pn.addEventListener?"complete"===pn.readyState?t():Dn(pn,"DOMContentLoaded",t,{capture:!1}):dn&&In.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),am);export{Gu as Compression,Ip as DEFAULT_PRODUCT_TOUR_APPEARANCE,_u as DisplaySurveyType,dg as PostHog,Ep as ProductTourEventName,Rp as ProductTourEventProperties,yu as SurveyEventName,bu as SurveyEventProperties,hu as SurveyEventType,du as SurveyPosition,gu as SurveyQuestionBranchingType,pu as SurveyQuestionType,mu as SurveySchedule,vu as SurveyTabPosition,fu as SurveyType,cu as SurveyWidgetType,um as default,um as posthog,Zu as severityLevels};
2
2
  //# sourceMappingURL=module.full.js.map