posthog-js 1.384.0 → 1.384.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.js +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/rrweb.d.ts +1 -0
- package/dist/rrweb.js +1 -1
- package/dist/rrweb.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +7 -7
package/dist/module.full.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function t(t,e,r,i,n,s,o){try{var a=t[s](o),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=e.apply(r,i);function a(e){t(o,n,s,a,u,"next",e)}function u(e){t(o,n,s,a,u,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),u=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(u||{}),l=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(l||{}),h=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(h||{}),c=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(c||{}),d=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(d||{}),v=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(v||{}),f=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(f||{}),p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},g={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},m={};function y(t){if(m[t])return m[t];var e=function(t){var e,r,i=null==(r=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in p?p[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in g?g[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return m[t]=e.prototype,e.prototype;var a=document.createElement("iframe");try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return l?m[t]=l:r}catch(t){return r}finally{a.parentNode&&document.body.removeChild(a)}}var b={};function _(t,e,r){var i,n=t+"."+String(r);if(b[n])return b[n].call(e);var s=y(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(b[n]=o,o.call(e)):e[r]}var w={};function x(t,e,r){var i=t+"."+String(r);if(w[i])return w[i].bind(e);var n=y(t)[r];return"function"!=typeof n?e[r]:(w[i]=n,n.bind(e))}function S(){return y("MutationObserver").constructor}function k(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}var C={childNodes:t=>_("Node",t,"childNodes"),parentNode:t=>_("Node",t,"parentNode"),parentElement:t=>_("Node",t,"parentElement"),textContent:t=>_("Node",t,"textContent"),contains:(t,e)=>x("Node",t,"contains")(e),getRootNode:t=>x("Node",t,"getRootNode")(),host:t=>t&&"host"in t?_("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?_("Element",t,"shadowRoot"):null,querySelector:(t,e)=>x("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>x("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:k};function T(t){return t.nodeType===t.ELEMENT_NODE}function I(t){var e=t&&"host"in t&&"mode"in t&&C.host(t)||null;return Boolean(e&&"shadowRoot"in e&&C.shadowRoot(e)===t)}function E(t){return"[object ShadowRoot]"==={}.toString.call(t)}function R(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=t.href;return!r&&t.ownerNode&&(r=t.ownerNode.baseURI),(i=Array.from(e,(t=>M(t,r))).join("")).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function M(t,e){var r;if(function(t){return"styleSheet"in t}(t)){var i;try{i=R(t.styleSheet)||function(t){var{cssText:e}=t;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){i=t.cssText}try{if(i&&(null==(r=t.styleSheet)?void 0:r.href))return U(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?U(n,e):n}class O{constructor(){a(this,"idNodeMap",new Map),a(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),T(t)){var r=C.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function P(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=t,a=s||"",u=n&&L(n);return(r[i.toLowerCase()]||u&&r[u])&&(a=o?o(a,e):"*".repeat(a.length)),a}function L(t){return t.toLowerCase()}var A="__rrweb_original__";function N(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?L(e):null}var F=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,D=/^(?:[a-z+]+:)?\/\//i,q=/^www\..*/i,j=/^(data:)([^,]*),(.*)/i;function U(t,e){return(t||"").replace(F,((t,r,i,n,s,o)=>{var a,u=i||s||o,l=r||n||"";if(!u)return t;if(D.test(u)||q.test(u))return"url("+l+u+l+")";if(j.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var H,B,z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",V=4096,W=1,Z=new RegExp("[^a-z0-9-_:]"),G=-2;function Q(){return W++}var J=/^[^ \t\n\r\u000c]+/,K=/^[, \t\n\r\u000c]+/,Y=new WeakMap;function X(t,e){return e&&""!==e.trim()?tt(t,e):e}function tt(t,e){var r=Y.get(t);if(r||(r=t.createElement("a"),Y.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function et(t,e,r,i,n,s){var o,a,u;if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var l=null==(o=n.sheet)?void 0:o.href;if(l)return l}var h=X(t,i);if("img"===e&&h.startsWith("data:")&&n){var c=h;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(c=function(t,e,r,i){if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>V||t.naturalHeight>V)return e;try{var n=document.createElement("canvas");n.width=t.naturalWidth,n.height=t.naturalHeight;var s=n.getContext("2d");return s?(s.drawImage(t,0,0),n.toDataURL(r||"image/webp",null!=i?i:.4)):e}catch(t){return e}}(n,h,s.type,s.quality)),(null==s?void 0:s.maxBase64ImageLength)&&(a=c,c=(u=s.maxBase64ImageLength)&&a.length>u?z:a),c}return h}return"xlink:href"===r&&"#"!==i[0]?X(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(K),e.length>r;){var s=i(J);if(","===s.slice(-1))s=X(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=X(t,s);for(var a=!1;;){var u=e.charAt(r);if(""===u){n.push((s+o).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,n.push((s+o).trim());break}"("===u&&(a=!0)}o+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?U(i,tt(t)):"object"===e&&"data"===r?X(t,i):i:X(t,i)}function rt(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function it(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&it(C.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&it(C.parentNode(t),e,r)}function nt(t,e,r,i){var n;if(T(t)){if(!C.childNodes(n=t).length)return!1}else{if(null===C.parentElement(t))return!1;n=C.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(it(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}var st=new Map;function ot(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function at(t){return null==t?"":t.toLowerCase()}var ut=50,lt=!1,ht=!1;function ct(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:h={},maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_=5e3,onIframeListenerRegistered:w,onStylesheetLoad:x,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:k=(()=>!1),newlyAddedElement:M=!1,depth:O=0,maxDepth:F=ut}=e,{needsMask:D}=e,{preserveWhiteSpace:q=!0}=e;if(O>=F)return ht=!0,lt||(lt=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+F+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;D||(D=nt(t,o,a,void 0===D));var j,z=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,s,{doc:o,blockClass:a,blockSelector:u,inlineStylesheet:l,maskInputOptions:h={},maskInputFn:c,dataURLOptions:d={},inlineImages:v,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:m=!1,rootId:y}=e,b=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,a,u),_=function(t){if(t instanceof HTMLFormElement)return"form";var e=L(t.tagName);return Z.test(e)?"div":e}(t),w={},x=t.attributes.length,S=0;x>S;S++){var k=t.attributes[S];rt(_,k.name)||(w[k.name]=et(o,_,L(k.name),k.value,t,d))}if("link"===_&&l){var T=t.sheet;if(!T){var I=function(t){return t.href}(t);I&&!(T=ot(o,I))&&I.includes(".css")&&(T=ot(o,window.location.origin+"/"+I.replace(window.location.href,"")))}var E=null;T&&(E=R(T)),E&&(delete w.rel,delete w.href,w._cssText=E)}if("style"===_&&t.sheet&&!(t.innerText||C.textContent(t)||"").trim().length){var M=R(t.sheet);M&&(w._cssText=M)}if("input"===_||"textarea"===_||"select"===_){var O=t.value,F=t.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&O?w.value=P({element:t,type:N(t),tagName:_,value:O,maskInputOptions:h,maskInputFn:c}):F&&(w.checked=F)}if("option"===_&&(t.selected&&!h.select?w.selected=!0:delete w.selected),"dialog"===_&&t.open)try{w.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){w.rr_open_mode="modal",w.ph_rr_could_not_detect_modal=!0}if("canvas"===_&&p)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)||(w.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){var D=t.toDataURL(d.type,d.quality),q=o.createElement("canvas");q.width=t.width,q.height=t.height,D!==q.toDataURL(d.type,d.quality)&&(w.rr_dataURL=D)}if("img"===_&&v){H||(H=o.createElement("canvas"),B=H.getContext("2d"));var j=t,U=j.currentSrc||j.getAttribute("src")||"<unknown-src>",z=j.crossOrigin,V=()=>{j.removeEventListener("load",V);try{H.width=j.naturalWidth,H.height=j.naturalHeight,B.drawImage(j,0,0),w.rr_dataURL=H.toDataURL(d.type,d.quality)}catch(t){if("anonymous"!==j.crossOrigin)return j.crossOrigin="anonymous",void(j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V));console.warn("Cannot inline img src="+U+"! Error: "+t)}"anonymous"===j.crossOrigin&&(z?w.crossOrigin=z:j.removeAttribute("crossorigin"))};j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V)}if("audio"===_||"video"===_){var W=w;W.rr_mediaState=t.paused?"paused":"played",W.rr_mediaCurrentTime=t.currentTime,W.rr_mediaPlaybackRate=t.playbackRate,W.rr_mediaMuted=t.muted,W.rr_mediaLoop=t.loop,W.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(w.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(w.rr_scrollTop=t.scrollTop)),b){var{width:G,height:Q,left:J,top:K}=t.getBoundingClientRect(),Y=null==(r=o.defaultView)?void 0:r.getComputedStyle(t);w={class:w.class,rr_width:G+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null==(i=o.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(K+((null==(n=o.defaultView)?void 0:n.scrollY)||0))+"px"},Y&&(w.rr_position=Y.position||"static",Y.transform&&"none"!==Y.transform&&(w.rr_transform=Y.transform),Y.display&&Y.display.startsWith("inline")&&(w.rr_display=Y.display))}"iframe"!==_||g(w.src)||(t.contentDocument||(w.rr_src=w.src),delete w.src);try{customElements.get(_)&&(s=!0)}catch(t){}return{type:f.Element,tagName:_,attributes:w,childNodes:[],isSVG:(X=t,Boolean("svg"===X.tagName||X.ownerSVGElement)||void 0),needBlock:b,rootId:y,isCustom:s};var X}(t,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,dataURLOptions:c,inlineImages:d,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:s}=e,o=C.parentNode(t),a=o&&o.tagName,u=C.textContent(t),l="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(l&&u){try{if(t.nextSibling||t.previousSibling);else if(null==(r=o.sheet)?void 0:r.cssRules){var c=R(o.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(u=c)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=U(u,tt(e.doc))}return h&&(u="SCRIPT_PLACEHOLDER"),!l&&!h&&u&&i&&(u=n?n(u,C.parentElement(t)):u.replace(/[\S]/g,"*")),{type:f.Text,textContent:u||"",isStyle:l,rootId:s}}(t,{doc:r,needsMask:o,maskTextFn:l,rootId:m});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:f.Comment,textContent:C.textContent(t)||"",rootId:m};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:D,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:k,newlyAddedElement:M});if(!z)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"===function(t,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(at(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===at(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(at(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&at(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(at(t.attributes.property).match(/^(og|twitter|fb):/)||at(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===at(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(at(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(at(t.attributes.name))||at(t.attributes.property).match(/^article:/)||at(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(at(t.attributes.name)))return!0}}return!1}(z,v)||!q&&z.type===f.Text&&!z.isStyle&&!z.textContent.replace(/^\s+|\s+$/gm,"").length?G:Q();var V=Object.assign(z,{id:j});if(i.add(t,V),j===G)return null;y&&y(t);var W=!u;if(V.type===f.Element){W=W&&!V.needBlock,delete V.needBlock;var J=C.shadowRoot(t);J&&E(J)&&(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 K={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:_,onIframeListenerRegistered:w,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:k,depth:O+1,maxDepth:F};if(V.type===f.Element&&"textarea"===V.tagName&&void 0!==V.attributes.value);else for(var Y of Array.from(C.childNodes(t))){var X=ct(Y,K);X&&V.childNodes.push(X)}var it=null;if(T(t)&&(it=C.shadowRoot(t)))for(var dt of Array.from(C.childNodes(it))){var vt=ct(dt,K);vt&&(E(it)&&(vt.isShadow=!0),V.childNodes.push(vt))}}var ft=C.parentNode(t);if(ft&&I(ft)&&E(ft)&&(V.isShadow=!0),V.type===f.Element&&"iframe"===V.tagName){var pt=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==i){var a=!1,u=null,l=()=>{a||(a=!0,null!==u&&(clearTimeout(u),u=null),t.removeEventListener("load",h),t.addEventListener("load",o),e())},h=()=>l();return u=setTimeout(l,r),t.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),a?t.removeEventListener("load",o):(a=!0,t.removeEventListener("load",h))}}var c,d="about:blank";try{c=s.location.href}catch(t){return n}if(c!==d||t.src===d||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(v),t.removeEventListener("load",o)}}return t.addEventListener("load",o),()=>{t.removeEventListener("load",o)}}(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:_,onIframeListenerRegistered:w,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:k,depth:O+1,maxDepth:F});r&&b(t,r)}}),_);null==w||w(t,pt)}return V.type===f.Element&&"link"===V.tagName&&"stylesheet"===V.attributes.rel&&function(e,u,f){if(!st.has(e)){var w;try{w=e.sheet}catch(t){return}if(!w){var C=new AbortController,T=!1,I=()=>{if(!T){T=!0;try{(()=>{if(x){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:x,stylesheetLoadTimeout:S,keepIframeSrcFn:k,depth:O,maxDepth:F});e&&x(t,e)}})()}finally{st.delete(e),C.abort()}}},E=setTimeout(I,f);C.signal.addEventListener("abort",(()=>clearTimeout(E)),{once:!0}),e.addEventListener("load",I,{signal:C.signal,once:!0}),st.set(e,C)}}}(t,0,S),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(it(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Tt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===G}function It(t,e){if(I(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=C.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||It(i,e))}function Et(t){return Boolean(t.changedTouches)}function Rt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Mt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Ot(t){return!!t&&(t instanceof vt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(C.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(_t=()=>(new Date).getTime());class Pt{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Lt(t){var e,r=null;return"getRootNode"in t&&(null==(e=C.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(t))&&(r=C.host(C.getRootNode(t))),r}function At(t){var e=t.ownerDocument;return!!e&&(C.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Lt(r);)r=e;return r}(t);return C.contains(e,r)}(t))}function Nt(t){return"__ln"in t}class Ft{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Nt(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Nt(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var $t,Dt=(t,e)=>t+"@"+e;class qt{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"removesSubTreeCache",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"canvasManagerReleased",!1),a(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Ft,i=t=>{for(var e=t,r=G;r===G;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=C.parentNode(n);if(s&&At(n)&&"TEXTAREA"!==s.tagName){var o=I(s)?this.mirror.getId(Lt(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var u=ct(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{Rt(t,this.mirror)&&this.iframeManager.addIframe(t),Mt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Ot(n)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:o,nextId:a,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Ut(this.removesSubTreeCache,s)&&!this.movedSet.has(C.parentNode(s))||n(s);for(var o of this.addedSet)Ht(this.droppedSet,o)||Ut(this.removesSubTreeCache,o)?Ht(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(C.parentNode(a.value)),h=i(a.value);-1!==l&&-1!==h&&(u=a)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(C.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=C.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=C.host(f);if(-1!==this.mirror.getId(p)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),n(u.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=C.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))}})),a(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(C.childNodes(t),(t=>C.textContent(t)||"")).join("");e.attributes.value=P({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:N(t),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(t=>{if(!Tt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=C.textContent(t.target);Ct(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:nt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,kt(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=N(r);n=P({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Ct(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!rt(r.tagName,i))if(o.attributes[i]=et(this.doc,L(r.tagName),L(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),h=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||h!==a.style.getPropertyPriority(u)?o.styleDiff[u]=""===h?l:[l,h]:o._unchangedStyles[u]=[l,h]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(o.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ct(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=I(t.target)?this.mirror.getId(C.host(t.target)):this.mirror.getId(t.target);Ct(t.target,this.blockClass,this.blockSelector,!1)||Tt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(jt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||It(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Dt(r,i)]?jt(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!I(t.target)||!E(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),C.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Tt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[Dt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ct(t,this.blockClass,this.blockSelector,!1)||(C.childNodes(t).forEach((t=>this.genAdds(t))),Ot(t)&&C.childNodes(C.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),this.canvasManager.acquire()}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.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}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)}function Qt(t,e){for(var r=Vt.length-1;r>=0;r--){var i=Vt[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),Vt.splice(r,1))}}}var Jt=["INPUT","TEXTAREA","SELECT"],Kt=new WeakMap;function Yt(t){return function t(e,r){if(re("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||re("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||re("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||re("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 Xt(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function te(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 ee(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&&Jt.indexOf(n)>=0&&!Ct(e,s,o,!0)&&!(e.classList.contains(a)||u&&e.matches(u))){var c=e.value,v=!1,p=N(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(l[n.toLowerCase()]||l[p])&&(c=P({element:e,maskInputOptions:l,tagName:n,type:p,value:c,maskInputFn:h})),f(e,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=e.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,i){var s=Kt.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){Kt.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}=Xt(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}=Xt(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}=Xt(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}=Xt(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:o}),t.apply(e,s)}))}));var h={};ie("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(ie("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),ie("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),ie("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}=Xt(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}=Xt(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=te(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}=Xt(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}=Xt(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 re(t){return void 0!==window[t]}function ie(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ne{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 se{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ne(Q)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"pageHideListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),a(this,"messageHandler"),a(this,"nestedIframeListeners",new Map),a(this,"attachedWindows",new WeakMap),a(this,"attachedDocuments",new WeakMap),a(this,"attachedIframes",new Map),a(this,"loadListenerDisposers",new WeakMap),a(this,"iframeElementsById",new Map),a(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ne(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)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null==(i=this.attachedIframes.get(t))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>pt(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{var{win:e,handler:r}=t;pt((()=>e.removeEventListener("pagehide",r)))})),this.pageHideHandlers.delete(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);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);pt((()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}pt((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),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.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);if(n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(pt((()=>t.removeEventListener("message",e))),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)){var s=this.nestedIframeListeners.get(i);pt((()=>i.removeEventListener("message",s))),this.nestedIframeListeners.delete(i)}i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var o=this.attachedDocuments.get(r);o&&(o.forEach((t=>{pt((()=>this.mirror.removeNodeFromMap(t)))})),pt((()=>Qt(r,o))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(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();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>{var{element:r}=e;return t.add(r)})),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class oe{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(),n.releaseCanvasManager();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(te({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 ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ue="undefined"==typeof Uint8Array?[]:new Uint8Array(256),le=0;64>le;le++)ue[ae.charCodeAt(le)]=le;var he=new Map,ce=(t,e,r)=>{if(t&&(fe(t,e)||"object"==typeof t)){var i=function(t,e){var r=he.get(t);return r||he.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 de(t,e,r,i){if(t instanceof Array)return t.map((t=>de(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+=ae[r[e]>>2],n+=ae[(3&r[e])<<4|r[e+1]>>4],n+=ae[(15&r[e+1])<<2|r[e+2]>>6],n+=ae[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:[de(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:[de(t.data,e,r,i),t.width,t.height]}:fe(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ce(t,e,r)}:t}var ve=(t,e,r,i)=>t.map((t=>de(t,e,r,i))),fe=(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])))},pe=["webgl","webgl2"];function ge(t){return"nodeType"in t}function me(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||ge(o)&&Ct(o,e,i,!0))return n.call(this,s);ge(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&&pe.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 ye(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(ce(c,s,this),"tagName"in this.canvas&&!Ct(this.canvas,i,n,!0)){var d=ve(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 be,_e,we,xe='(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',Se="undefined"!=typeof self&&self.Blob&&new Blob([xe],{type:"text/javascript;charset=utf-8"});function ke(t){var e;try{if(!(e=Se&&(self.URL||self.webkitURL).createObjectURL(Se)))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(xe),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Ce{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,"refCount",0),a(this,"torndown",!1),a(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var{sampling:e="all",win: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})}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,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=me(r,i,n,!0),u=new Map,l=new ke;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=me(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=ve(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(...ye(e.WebGLRenderingContext.prototype,d.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...ye(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 Te{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Pt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:M(e,t.href),index:r})))})),i.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,st.forEach((t=>t.abort())),st.clear()}trackStylesheetInLinkElement(t){}}class Ie{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 Ee=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Re=document.createElement("iframe");document.body.appendChild(Re),Array.from=(null==(n=Re.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Re)}}catch(t){console.debug("Unable to override Array.from",t)}var Me=new O;function Oe(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:h=null,maskTextClass:c="rr-mask",maskTextSelector:d=null,inlineStylesheet:v=!0,maskAllInputs:f,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:y,hooks:b,packFn:_,sampling:w={},dataURLOptions:x={},mousemoveWait:S,recordDOM:k=!0,recordCanvas:T=!1,recordCrossOriginIframes:I=!1,recordAfter:E=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:R=!1,collectFonts:M=!1,inlineImages:P=!1,plugins:L,keepIframeSrcFn:A=(()=>!1),ignoreCSSAttributes:N=new Set([]),errorHandler:F}=t;$t=F;var D=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},x),q=!I||window.parent===window,j=!1;if(!q)try{window.parent.document&&(j=!1)}catch(t){j=!0}if(q&&!e)throw new Error("emit function is required");if(!q&&!j)return()=>{};void 0!==S&&void 0===w.mousemove&&(w.mousemove=S),Me.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,V,W=0,Z=new Map,G=t=>{for(var e of L||[])e.eventProcessor&&(t=e.eventProcessor(t));return _&&!j&&(t=_(t)),t};be=(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(G(o),r);else if(j){var a={type:"rrweb",event:G(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===u.FullSnapshot)U=o,W=0;else if(o.type===u.IncrementalSnapshot){if(o.data.source===l.Mutation&&o.data.isAttachIframe)return;W++,(n&&W>=n||i&&o.timestamp-U.timestamp>i)&&_e(!0)}};var Q=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var n of t.adds){var s=Me.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}t.removes.forEach((t=>{var{id:r}=t;if(!e||!e.has(r)){var n=X.getIframeElementById(r);n&&i.has(n)?X.forgetIframeId(r):(null==z||z(r),X.removeIframeById(r))}})),null==V||V(),X.cleanupDetachedIframes()}be({type:u.IncrementalSnapshot,data:r({source:l.Mutation},t)})},J=t=>be({type:u.IncrementalSnapshot,data:r({source:l.Scroll},t)}),K=t=>be({type:u.IncrementalSnapshot,data:r({source:l.CanvasMutation},t)}),Y=new Te({mutationCb:Q,adoptedStyleSheetCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.AdoptedStyleSheet},t)})}),X=new se({mirror:Me,mutationCb:Q,stylesheetManager:Y,recordCrossOriginIframes:I,wrappedEmit:be});for(var tt of L||[])tt.getMirror&&tt.getMirror({nodeMirror:Me,crossOriginIframeMirror:X.crossOriginIframeMirror,crossOriginIframeStyleMirror:X.crossOriginIframeStyleMirror});var et=new Ie;we=new Ce({recordCanvas:T,mutationCb:K,win:window,blockClass:s,blockSelector:o,mirror:Me,sampling:w.canvas,dataURLOptions:D});var rt=new oe({mutationCb:Q,scrollCb:J,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:X,stylesheetManager:Y,canvasManager:we,keepIframeSrcFn:A,processedNodeManager:et},mirror:Me});_e=function(t){if(void 0===t&&(t=!1),k){be({type:u.Meta,data:{href:window.location.href,width:St(),height:xt()}},t),Y.reset(),rt.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,onIframeListenerRegistered:b,onStylesheetLoad:_,stylesheetLoadTimeout:w,keepIframeSrcFn:x=(()=>!1),maxDepth:S}=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,onIframeListenerRegistered:b,onStylesheetLoad:_,stylesheetLoadTimeout:w,keepIframeSrcFn:x,newlyAddedElement:!1,maxDepth:S})}(document,{mirror:Me,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,Me)&&X.addIframe(t),Mt(t,Me)&&Y.trackLinkElement(t),Ot(t)&&rt.addShadowRoot(C.shadowRoot(t),document)},onIframeLoad(t,e){X.attachIframe(t,e),rt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){X.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){Y.attachLinkElement(t,e)},keepIframeSrcFn:A});if(!e)return console.warn("Failed to snapshot the document");be({type:u.FullSnapshot,data:{node:e,initialOffset:wt(window)}},t),Vt.forEach((t=>t.unlock())),I&&X.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,Me.getId(document))}};try{var it=[];z=t=>{var e=Z.get(t);e&&(e.forEach((t=>{pt(t);var e=it.indexOf(t);-1!==e&&it.splice(e,1)})),Z.delete(t))},V=()=>{for(var[t]of Z){var e=Me.getNode(t);if(e)try{e.contentDocument&&e.contentDocument.defaultView||null==z||z(t)}catch(e){null==z||z(t)}else null==z||z(t)}};var nt=t=>{var e;return zt(ee)({mutationCb:Q,mousemoveCb:(t,e)=>be({type:u.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.MouseInteraction},t)}),scrollCb:J,viewportResizeCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.ViewportResize},t)}),inputCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.Input},t)}),mediaInteractionCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.MediaInteraction},t)}),styleSheetRuleCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.StyleSheetRule},t)}),styleDeclarationCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.StyleDeclaration},t)}),canvasMutationCb:K,fontCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.Font},t)}),selectionCb(t){be({type:u.IncrementalSnapshot,data:r({source:l.Selection},t)})},customElementCb(t){be({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:Me,iframeManager:X,stylesheetManager:Y,shadowDomManager:rt,processedNodeManager:et,canvasManager:we,ignoreCSSAttributes:N,plugins:(null==(e=null==L?void 0:L.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>be({type:u.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},b)};X.addLoadListener((t=>{try{var e=Me.getId(t),r=nt(t.contentDocument);if(it.push(r),-1!==e){var i=Z.get(e);i||Z.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),X.addPageHideListener((t=>{var e=Me.getId(t);null==z||z(e),Qt(t)}));var st=()=>{_e(),it.push(nt(document)),Ee=!0};return["interactive","complete"].includes(document.readyState)?st():(it.push(ft("DOMContentLoaded",(()=>{be({type:u.DomContentLoaded,data:{}}),"DOMContentLoaded"===E&&st()}))),it.push(ft("load",(()=>{be({type:u.Load,data:{}}),"load"===E&&st()}),window))),()=>{it.forEach((t=>pt(t))),et.destroy(),X.removeLoadListener(),X.destroy(),Z.clear(),Me.reset(),Ee=!1,$t=void 0}}catch(t){console.warn(t)}}Oe.addCustomEvent=(t,e)=>{if(!Ee)throw new Error("please add custom event after start recording");be({type:u.Custom,data:{tag:t,payload:e}})},Oe.freezePage=()=>{Vt.forEach((t=>t.freeze()))},Oe.takeFullSnapshot=t=>{if(!Ee)throw new Error("please take full snapshot after start recording");_e(t)},Oe.mirror=Me;var Pe=Object.defineProperty,Le=(t,e,r)=>((t,e,r)=>e in t?Pe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class Ae{constructor(t){Le(this,"fileName"),Le(this,"functionName"),Le(this,"lineNumber"),Le(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 Ne=/(^|@)\S+:\d+/,Fe=/^\s*at .*(\S+:\d+|\(native\))/m,$e=/^(eval@)?(\[native code])?$/,De={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 Ae({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match($e)}),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 Ae({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ae({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 Ae({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 Ae({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(Ne)&&!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 Ae({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function qe(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 je(t){return Array.isArray(t)}function Ue(t){return"object"==typeof t&&null!==t&&!je(t)}function He(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Ue(t[i])&&He(t[i],e-1))return!0;return!1}function Be(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(Ue(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Ue(o)&&He(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]=je(l)?qe(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 ze={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 Ve(t,e,r){var i,n=r?Object.assign({},ze,r):ze,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=De.parse(e.error).map((t=>t.toString())),s=[Be(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=[Be("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Be("Uncaught (in promise)",n.stringifyOptions),Be(e.reason,n.stringifyOptions)]);var s=De.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=De.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>Be(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:r,trace:h,payload:c}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Be("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 We,Ze=t=>({name:"rrweb/console@1",observer:Ve,options:t}),Ge=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Qe=function(t){return t.MinLength="min_length",t.MaxLength="max_length",t}({}),Je=["$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"],Ke="NativeGzipValidationError",Ye=t=>t.length>=2&&31===t[0]&&139===t[1],Xe=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),tr=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Ke,e},er=function(){var t=e((function*(t,e){18>t.size&&tr("too-short");var r=new Uint8Array(yield t.slice(0,10).arrayBuffer());Ye(r)&&8===r[2]||tr("invalid-header");var i=new DataView(yield t.slice(t.size-8).arrayBuffer());i.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(We)return We;We=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;We[t]=e>>>0}return We})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&tr("invalid-crc");var n=e.length>>>0;i.getUint32(4,!0)!==n&&tr("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function rr(){return rr=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 er(l,n),l}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),null}})),rr.apply(this,arguments)}var ir=["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"],nr=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return ir.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))};function sr(t,e){return-1!==t.indexOf(e)}var or=function(t){return t.trim()},ar=function(t){return t.replace(/^\$/,"")},ur=Object.prototype,lr=ur.hasOwnProperty,hr=ur.toString,cr=Array.isArray||function(t){return"[object Array]"===hr.call(t)},dr=t=>"function"==typeof t,vr=t=>t===Object(t)&&!cr(t),fr=t=>{if(vr(t)){for(var e in t)if(lr.call(t,e))return!1;return!0}return!1},pr=t=>void 0===t,gr=t=>"[object String]"==hr.call(t),mr=t=>gr(t)&&0===t.trim().length,yr=t=>null===t,br=t=>pr(t)||yr(t),_r=t=>"[object Number]"==hr.call(t)&&t==t,wr=t=>_r(t)&&t>0,xr=t=>"[object Boolean]"===hr.call(t),Sr=t=>t instanceof FormData;function kr(t){return null===t||"object"!=typeof t}function Cr(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Tr(t){return"undefined"!=typeof Event&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var Ir=[!0,"true",1,"1","yes"],Er=t=>sr(Ir,t),Rr=[!1,"false",0,"0","no"];function Mr(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),_r(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),Mr(n||r,e,r,i))}class Or{constructor(t){this.$t={},this.zt=t.zt,this.Zt=Mr(t.bucketSize,0,100,t.Gt),this.Qt=Mr(t.refillRate,0,this.Zt,t.Gt),this.Jt=Mr(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 Pr,Lr,Ar,Nr="Mobile",Fr="iOS",$r="Android",Dr="Tablet",qr=$r+" "+Dr,jr="iPad",Ur="Apple",Hr=Ur+" Watch",Br="Safari",zr="BlackBerry",Vr="Samsung",Wr=Vr+"Browser",Zr=Vr+" Internet",Gr="Chrome",Qr=Gr+" OS",Jr=Gr+" "+Fr,Kr="Internet Explorer",Yr=Kr+" "+Nr,Xr="Opera",ti=Xr+" Mini",ei="Edge",ri="Microsoft "+ei,ii="Firefox",ni=ii+" "+Fr,si="Nintendo",oi="PlayStation",ai="Xbox",ui=$r+" "+Nr,li=Nr+" "+Br,hi="Windows",ci=hi+" Phone",di="Nokia",vi="Ouya",fi="Generic",pi=fi+" "+Nr.toLowerCase(),gi=fi+" "+Dr.toLowerCase(),mi="Konqueror",yi="Oculus Browser",bi="Vivaldi",_i="Yandex",wi="Whale",xi="DuckDuckGo",Si="Pale Moon",ki="Waterfox",Ci="Brave",Ti="Google Search App",Ii="(\\d+(\\.\\d+)?)",Ei=new RegExp("Version/"+Ii),Ri=new RegExp(ai,"i"),Mi=new RegExp(oi+" \\w+","i"),Oi=new RegExp(si+" \\w+","i"),Pi=new RegExp(zr+"|PlayBook|BB10","i"),Li={"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"},Ai=function(t,e,r,i){e=e||"";var n=function(t){return null!=t&&t.brave?Ci:null}(r);return n||(null!=i&&i.detectGoogleSearchApp&&sr(t,"GSA/")?Ti:sr(t," OPR/")&&sr(t,"Mini")?ti:sr(t," OPR/")?Xr:Pi.test(t)?zr:sr(t,"IE"+Nr)||sr(t,"WPDesktop")?Yr:sr(t,"OculusBrowser")?yi:sr(t,Wr)?Zr:sr(t,ei)||sr(t,"Edg/")?ri:sr(t,bi+"/")?bi:sr(t,"YaBrowser/")?_i:sr(t,wi+"/")?wi:sr(t,xi+"/")||sr(t,"Ddg/")?xi:sr(t,"FBIOS")?"Facebook "+Nr:sr(t,"UCWEB")||sr(t,"UCBrowser")?"UC Browser":sr(t,"CriOS")?Jr:sr(t,"CrMo")||sr(t,Gr)?Gr:sr(t,$r)&&sr(t,Br)?ui:sr(t,"FxiOS")?ni:sr(t.toLowerCase(),mi.toLowerCase())?mi:sr(t,Ci+"/")?Ci:((t,e)=>e&&sr(e,Ur)||function(t){return sr(t,Br)&&!sr(t,Gr)&&!sr(t,$r)}(t))(t,e)?sr(t,Nr)?li:Br:sr(t,"PaleMoon/")?Si:sr(t,ki+"/")?ki:sr(t,ii)?ii:sr(t,"MSIE")||sr(t,"Trident/")?Kr:sr(t,"Gecko")?ii:"")},Ni={[Yr]:[new RegExp("rv:"+Ii)],[ri]:[new RegExp(ei+"?\\/"+Ii)],[Gr]:[new RegExp("("+Gr+"|CrMo)\\/"+Ii)],[Jr]:[new RegExp("CriOS\\/"+Ii)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ii)],[Br]:[Ei],[li]:[Ei],[Xr]:[new RegExp("(Opera|OPR)\\/"+Ii)],[ii]:[new RegExp(ii+"\\/"+Ii)],[ni]:[new RegExp("FxiOS\\/"+Ii)],[mi]:[new RegExp("Konqueror[:/]?"+Ii,"i")],[zr]:[new RegExp(zr+" "+Ii),Ei],[ui]:[new RegExp("android\\s"+Ii,"i")],[Zr]:[new RegExp(Wr+"\\/"+Ii)],[yi]:[new RegExp("OculusBrowser\\/"+Ii)],[bi]:[new RegExp(bi+"\\/"+Ii)],[_i]:[new RegExp("YaBrowser\\/"+Ii)],[wi]:[new RegExp(wi+"\\/"+Ii)],[Ci]:[new RegExp(Ci+"\\/"+Ii)],[xi]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Ii)],[Si]:[new RegExp("PaleMoon\\/"+Ii)],[ki]:[new RegExp(ki+"\\/"+Ii)],[Ti]:[new RegExp("GSA\\/"+Ii)],[Kr]:[new RegExp("(rv:|MSIE )"+Ii)],Mozilla:[new RegExp("rv:"+Ii)]},Fi=function(t,e,r,i){var n=Ai(t,e,r,i),s=Ni[n];if(pr(s))return null;for(var o=0;s.length>o;o++){var a=t.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},$i=[[new RegExp(ai+"; "+ai+" (.*?)[);]","i"),t=>[ai,t&&t[1]||""]],[new RegExp(si,"i"),[si,""]],[new RegExp(oi,"i"),[oi,""]],[Pi,[zr,""]],[new RegExp(hi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[ci,""];if(new RegExp(Nr).test(e)&&!/IEMobile\b/.test(e))return[hi+" "+Nr,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=Li[r[1]]||"";return/arm/i.test(e)&&(i="RT"),[hi,i]}return[hi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[Fr,[t[3],t[4],t[5]||"0"].join(".")]:[Fr,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=pr(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+$r+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+$r+")","i"),t=>t&&t[2]?[$r,[t[2],t[3],t[4]||"0"].join(".")]:[$r,""]],[/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/,[Qr,""]],[/Linux|debian/i,["Linux",""]]],Di=function(t){return Oi.test(t)?si:Mi.test(t)?oi:Ri.test(t)?ai:new RegExp(vi,"i").test(t)?vi:new RegExp("("+ci+"|WPDesktop)","i").test(t)?ci:/iPad/.test(t)?jr:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Hr:Pi.test(t)?zr:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(di,"i").test(t)?di:/(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(Nr).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)?$r:qr:new RegExp("(pda|"+Nr+")","i").test(t)?pi:new RegExp(Dr,"i").test(t)&&!new RegExp(Dr+" pc","i").test(t)?gi:""},qi=function(t,e){var r,i,n,s,o=Di(t);return o===jr||o===qr||"Kobo"===o||"Kindle Fire"===o||o===gi?Dr:o===si||o===ai||o===oi||o===vi?"Console":o===Hr?"Wearable":o?Nr:"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)?Nr:Dr:"Desktop"},ji={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}},Ui=ji.info;function Hi(t){if(xr(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(cr(t))return{arrayValue:{values:t.map((t=>Hi(t)))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}function Bi(t){var e=[];for(var r in t){var i=t[r];yr(i)||pr(i)||e.push({key:r,value:Hi(i)})}return e}function zi(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}function Vi(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return Ar&&r.length===Lr||(Lr=r.length,Ar=r.reduce(((r,i)=>{Pr||(Pr={});var n=Pr[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,Pr[i]=[u,l];break}}return r}),{})),Ar}}class Wi{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&&cr(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:Vi(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 Zi="?";function Gi(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?Zi:r,in_app:!0};return pr(i)||(s.lineno=i),pr(n)||(s.colno=n),s}var Qi=(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]:Zi,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Ji=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ki=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Yi=/\((\S*)(?::(\d+))(?::(\d+))\)/,Xi=(t,e)=>{var r=Ji.exec(t);if(r){var[,i,n,s]=r;return Gi(e,i,Zi,+n,+s)}var o=Ki.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=Yi.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[u,l]=Qi(o[1]||Zi,o[2]);return Gi(e,l,u,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},tn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,en=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,rn=(t,e)=>{var r=tn.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=en.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]||Zi;return[s,n]=Qi(s,n),Gi(e,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},nn=/\(error: (.*)\)/,sn=50;class on{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=gr(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 Cr(t,"DOMException")}isDOMError(t){return Cr(t,"DOMError")}}class an{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 un{constructor(){}match(t){return Cr(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 ln=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class hn{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(ln);return i&&(e=i[1],r=i[2]),[e,r]}}var cn=["fatal","error","warning","log","info","debug"];function dn(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 vn{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 Tr(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: "+dn(t)}isSeverityLevel(t){return gr(t)&&!mr(t)&&cn.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 fn{match(t){return Tr(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+dn(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class pn{match(t){return kr(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 gn{match(t){return Cr(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Tr(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 kr(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 mn="$message",yn="$timestamp",bn=new Set([mn,yn]),_n={enabled:!0,max_bytes:32768};function wn(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:_n.enabled,max_bytes:Sn(t.max_bytes,_n.max_bytes)}:r({},_n)}class xn{constructor(t){this.Yt=[],this.Xt=0,this.qt=wn(t)}setConfig(t){this.qt=wn(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(!vr(r))return;var i=r,n=i[mn],s=i[yn];if(!gr(n)||0===n.trim().length)return;if(!gr(s)&&!_r(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 Sn(t,e){if(!_r(t)||t===1/0||t===-1/0)return e;var r=Math.floor(t);return 0>r?e:r}var kn="undefined"!=typeof window?window:void 0,Cn="undefined"!=typeof globalThis?globalThis:kn;"undefined"==typeof self&&(Cn.self=Cn),"undefined"==typeof File&&(Cn.File=function(){});var Tn=null==Cn?void 0:Cn.navigator,In=null==Cn?void 0:Cn.document,En=null==Cn?void 0:Cn.location,Rn=null==Cn?void 0:Cn.fetch,Mn=null!=Cn&&Cn.XMLHttpRequest&&"withCredentials"in new Cn.XMLHttpRequest?Cn.XMLHttpRequest:void 0,On=null==Cn?void 0:Cn.AbortController,Pn=null==Cn?void 0:Cn.CompressionStream,Ln=null==Tn?void 0:Tn.userAgent,An=null!=kn?kn:{},Nn=t=>t instanceof Document,Fn="1.384.0",$n={DEBUG:!1,LIB_VERSION:Fn,LIB_NAME:"web",JS_SDK_VERSION:Fn},Dn=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={k(e){if(kn&&($n.DEBUG||An.POSTHOG_DEBUG||r)&&!pr(kn.console)&&kn.console){for(var i=("__rrweb_original__"in kn.console[e]?kn.console[e].__rrweb_original__:kn.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)=>Dn(t+" "+e,r)};return i},qn=Dn("[PostHog.js]"),jn=qn.createLogger;function Un(t,e){cr(t)&&t.forEach(e)}function Hn(t,e){if(!br(t))if(cr(t))t.forEach(e);else if(Sr(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)lr.call(t,r)&&e(t[r],r)}var Bn=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 zn(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 Vn=function(t){try{return t()}catch(t){return}},Wn=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){qn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),qn.critical(t)}}},Zn=function(t){var e={};return Hn(t,(function(t,r){(gr(t)&&t.length>0||_r(t))&&(e[r]=t)})),e};var Gn=["herokuapp.com","vercel.app","netlify.app"];function Qn(t){var e=null==t?void 0:t.hostname;if(!gr(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of Gn)if(r===i)return!1;return!0}function Jn(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 Kn(t){return"ph_toolbar_internal"===t.name}var Yn=t=>{var e=null==In?void 0:In.createElement("a");return pr(e)?null:(e.href=t,e)},Xn=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return Hn(t,(function(t,e){pr(t)||pr(e)||"undefined"===e||(r=encodeURIComponent(t instanceof File?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},ts=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(!cr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){qn.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},es=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("=");cr(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},rs=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null};function is(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return dr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]===n&&(t[e]=i)}}catch(t){return()=>{}}}function ns(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 ss="$people_distinct_id",os="$device_id",as="__alias",us="__timers",ls="$autocapture_disabled_server_side",hs="$heatmaps_enabled_server_side",cs="$exception_capture_enabled_server_side",ds="$error_tracking_suppression_rules",vs="$error_tracking_capture_extension_exceptions",fs="$web_vitals_enabled_server_side",ps="$dead_clicks_enabled_server_side",gs="$product_tours_enabled_server_side",ms="$web_vitals_allowed_metrics",ys="$session_recording_remote_config",bs="$replay_override_sampling",_s="$replay_override_linked_flag",ws="$replay_override_url_trigger",xs="$replay_override_event_trigger",Ss="$sesid",ks="$session_is_sampled",Cs="$enabled_feature_flags",Ts="$active_feature_flags",Is="$early_access_features",Es="$feature_flag_details",Rs="$feature_flag_payloads",Ms="$feature_flag_request_id",Os="$override_feature_flags",Ps="$override_feature_flag_payloads",Ls="$stored_person_properties",As="$stored_group_properties",Ns="$surveys",Fs="$surveys_loaded_at",$s="$surveys_activated",Ds="ph_product_tours",qs="$flag_call_reported",js="$flag_call_reported_session_id",Us="$feature_flag_errors",Hs="$feature_flag_evaluated_at",Bs="$user_state",zs="$client_session_props",Vs="$capture_rate_limit",Ws="$initial_campaign_params",Zs="$initial_referrer_info",Gs="$initial_person_info",Qs="$epp",Js="__POSTHOG_TOOLBAR__",Ks="$posthog_cookieless",Ys="$sdk_debug_extensions_init_method",Xs="$sdk_debug_extensions_init_time_ms",to="$sdk_debug_recording_script_not_loaded",eo="PostHog loadExternalDependency extension not found.",ro="on_reject",io="always",no="anonymous",so="identified",oo="identified_only",ao="visibilitychange",uo="beforeunload",lo="$pageview",ho="$pageleave",co="$identify",vo="$groupidentify",fo=1,po=3,go=11;function mo(t){return t instanceof Element&&(t.id===Js||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function yo(t){return!!t&&t.nodeType===fo}function bo(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function _o(t){return!!t&&t.nodeType===po}function wo(t){return!!t&&t.nodeType===go&&yo(t.host)}function xo(t){return t?or(t).split(/\s+/):[]}function So(t){var e=null==kn?void 0:kn.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function ko(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 xo(e)}function Co(t){return br(t)?null:or(t).split(/(\s+)/).filter((t=>Go(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function To(t){var e="";return jo(t)&&!Uo(t)&&t.childNodes&&t.childNodes.length&&Hn(t.childNodes,(function(t){var r;_o(t)&&t.textContent&&(e+=null!==(r=Co(t.textContent))&&void 0!==r?r:"")})),or(e)}function Io(t){return pr(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Eo=["a","button","form","input","select","textarea","label"];function Ro(t,e){if(pr(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||!yo(e))&&e}var Oo=["next","previous","prev",">","<"],Po=[...Oo,"+","-","−","–"],Lo=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,Ao=[".ph-no-deadclick",".ph-no-capture"],No=[".ph-no-rageclick",".ph-no-capture"],Fo=["","text","search","email","password","url","tel","number"];function $o(t,e){if(!kn||Do(t))return!1;var r,i,n,s,o;if(xr(e)?(r=!!e&&No,i=void 0,n=!1):(r=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:No,i=null==e?void 0:e.content_ignorelist,n=null!==(o=null==e?void 0:e.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(n&&function(t){return!(!t||!yo(t))&&(!!bo(t,"textarea")||(bo(t,"input")?sr(Fo,(t.getAttribute("type")||"").toLowerCase()):function(t){if(t.isContentEditable)return!0;var e=null==t.getAttribute?void 0:t.getAttribute("contenteditable");return"true"===e||""===e}(t)))}(t))return!1;var{targetElementList:a}=qo(t,!1);return!function(t,e){if(!1===t||pr(t))return!1;var r;if(!0===t)r=Oo;else{if(!cr(t))return!1;if(t.length>10)return qn.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=>Lo(e,t)||Lo(i,t)))}))}(i,a.map((t=>{var e;return{safeText:To(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Ro(a,r)}var Do=t=>!t||bo(t,"html")||!yo(t),qo=(t,e)=>{if(!kn||Do(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!bo(n,"body");)if(wo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=Mo(n);if(!s)break;if(e||Eo.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=kn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function jo(t){for(var e=t;e.parentNode&&!bo(e,"body");e=e.parentNode){var r=ko(e);if(sr(r,"ph-sensitive")||sr(r,"ph-no-capture"))return!1}if(sr(ko(t),"ph-include"))return!0;var i=t.type||"";if(gr(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!gr(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 Uo(t){return!!(bo(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||bo(t,"select")||bo(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Ho="(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})",Bo=new RegExp("^(?:"+Ho+")$"),zo=new RegExp(Ho),Vo="\\d{3}-?\\d{2}-?\\d{4}",Wo=new RegExp("^("+Vo+")$"),Zo=new RegExp("("+Vo+")");function Go(t,e){if(void 0===e&&(e=!0),br(t))return!1;if(gr(t)){if(t=or(t),(e?Bo:zo).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Wo:Zo).test(t))return!1}return!0}function Qo(t){var e=To(t);return Go(e=(e+" "+Jo(t)).trim())?e:""}function Jo(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Hn(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=To(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Jo(t)).trim())}catch(t){qn.error("[AutoCapture]",t)}})),e}function Ko(t){return t.replace(/"|\\"/g,'\\"')}function Yo(t){var e=t.attr__class;return e?cr(e)?e:xo(e):void 0}var Xo={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"]},ta=jn("[Recorder]"),ea=t=>"navigation"===t.entryType,ra=t=>"resource"===t.entryType;function ia(t,e){return!!e&&(xr(e)||e[t])}function na(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}function sa(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:!!na(e)&&t(e.url)}catch(t){return!1}}(n))return!1;if(xr(r))return!0;if(cr(r))return s(r);var o=r[e];return xr(o)?o:s(o)}function oa(t,e,r,i,n,s){return aa.apply(this,arguments)}function aa(){return aa=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return ta.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(ra(o=t[s])&&o.initiatorType===e&&(pr(i)||o.startTime>=i)&&(pr(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*s))),oa(t,e,r,i,n,s+1))})),aa.apply(this,arguments)}function ua(t){var{body:e,options:r,url:i}=t;if(br(e))return null;var{hostname:n,isHostDenied:s}=ns(i,r);if(s)return n+" is in deny list";if(gr(e))return e;if(Nn(e))return e.textContent;if(Sr(e))return Xn(e);if(vr(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 la=t=>!yr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ha(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:pr(a)?void 0:Math.round(a),endTime:pr(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(la(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 ca=["video/","audio/"];function da(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 va(){return va=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:s}=ns(i,r);return s?Promise.resolve(n+" is in deny list"):da(e)})),va.apply(this,arguments)}function fa(){return fa=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=ca.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:u}=ns(n,i);return u?a+" is in deny list":null}({r:e,options:r,url:i});return yr(n)?da(e):Promise.resolve(n)})),fa.apply(this,arguments)}var pa=null;function ga(t,i,n){if(!("performance"in i))return()=>{};if(pa)return ta.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Xo,n):Xo,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=>ea(t)||ra(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>ha({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=>ea(t)||ra(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>ha({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=ia("request",r.recordHeaders),n=ia("response",r.recordHeaders),s=is(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=>(sa({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=ua({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),sa({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=ua({body:v.response,options:r,url:a})),oa(e,"xmlhttprequest",f.url,c,d).then((e=>{var r=ha({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=ia("request",i.recordHeaders),s=ia("response",i.recordHeaders),o=is(r,"fetch",(o=>function(){var a=e((function*(e,a){var u,l,h,c,d=new Request(e,a),v={};try{var f={};d.headers.forEach(((t,e)=>{f[e]=t})),n&&(v.requestHeaders=f),!(vr(c=null==a?void 0:a.body)&&dr(c.getReader)&&dr(c.tee))&&sa({type:"request",headers:f,url:e,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return va.apply(this,arguments)}({r:d,options:i,url:e})),l=r.performance.now(),u=na(e)?yield o(d):yield o(e,a),h=r.performance.now();var p={};return u.headers.forEach(((t,e)=>{p[e]=t})),s&&(v.responseHeaders=p),sa({type:"response",headers:p,url:e,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return fa.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{oa(r,"fetch",d.url,l,h).then((e=>{var r,i=ha({entry:e,method:d.method,status:null==(r=u)?void 0:r.status,networkRequest:v,start:l,end:h,url:d.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),pa=()=>{a(),u(),l(),pa=null}}var ma=t=>({name:"rrweb/network@1",observer:ga,options:t});An.__PosthogExtensions__=An.__PosthogExtensions__||{},An.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Ze,getRecordNetworkPlugin:ma},An.__PosthogExtensions__.rrweb={record:Oe,version:"v2",wasMaxDepthReached:()=>ht,resetMaxDepthState(){ht=!1,lt=!1}},An.rrweb={record:Oe,version:"v2"},An.rrwebConsoleRecord={getRecordConsolePlugin:Ze},An.getRecordNetworkPlugin=ma;var ya,ba,_a,wa,xa,Sa,ka,Ca,Ta,Ia,Ea,Ra,Ma={},Oa=[],Pa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,La=Array.isArray;function Aa(t,e){for(var r in e)t[r]=e[r];return t}function Na(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Fa(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?ya.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 $a(t,o,i,n,null)}function $a(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?++_a:n,__i:-1,__u:0};return null==n&&null!=ba.vnode&&ba.vnode(s),s}function Da(t){return t.children}function qa(t,e){this.props=t,this.context=e}function ja(t,e){if(null==e)return t.__?ja(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?ja(t):null}function Ua(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 Ua(t)}}function Ha(t){(!t.__d&&(t.__d=!0)&&wa.push(t)&&!$.__r++||xa!=ba.debounceRendering)&&((xa=ba.debounceRendering)||Sa)($)}function $(){for(var t,e,r,i,n,s,o,a=1;wa.length;)wa.length>a&&wa.sort(ka),t=wa.shift(),a=wa.length,t.__d&&(r=void 0,i=void 0,n=(i=(e=t).__v).__e,s=[],o=[],e.__P&&((r=Aa({},i)).__v=i.__v+1,ba.vnode&&ba.vnode(r),Qa(e.__P,r,i,e.__n,e.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?ja(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,Ka(s,r,o),i.__e=i.__=null,r.__e!=n&&Ua(r)));$.__r=0}function Ba(t,e,r,i,n,s,o,a,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||Oa,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]=$a(null,o,null,null,null):La(o)?o=t.__k[s]=$a(Da,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=$a(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=Va(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=ja(a)),tu(a,a));return i}(r,e,y,u,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1==v.__i?Ma:y[v.__i]||Ma,v.__i=c,g=Qa(t,v,d,n,s,o,a,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Xa(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=za(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 za(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=za(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=ja(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Va(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 Wa(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||Pa.test(e)?r:r+"px"}function Za(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||Wa(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||Wa(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Ca,"$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=Ta,t.addEventListener(e,s?Ea:Ia,s)):t.removeEventListener(e,s?Ea:Ia,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 Ga(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e.t)e.t=Ta++;else if(r.u>e.t)return;return r(ba.event?ba.event(e):e)}}}function Qa(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=ba.__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 qa(m,_),c.constructor=T,c.render=eu),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=Aa({},c.__s)),Aa(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=ba.__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=Aa(Aa({},i),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),k=h,null!=h&&h.type===Da&&null==h.key&&(k=Ya(h.props.children)),a=Ba(t,La(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--;)Na(s[C]);Ja(e)}else e.__e=r.__e,e.__k=r.__k,t.then||Ja(e);ba.__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||Ma,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&&(ba.__m&&ba.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s=s&&ya.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;Za(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||Za(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=""),Ba("template"==e.type?t.content:t,La(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&ja(r,0),a,u),null!=s)for(l=s.length;l--;)Na(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])&&Za(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&Za(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,s,o,u,l);return(h=ba.diffed)&&h(e),128&e.__u?void 0:a}function Ja(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Ja)}function Ka(t,e,r){for(var i=0;r.length>i;i++)Xa(r[i],r[++i],r[++i]);ba.__c&&ba.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ba.__e(t,e.__v)}}))}function Ya(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:La(t)?t.map(Ya):Aa({},t)}function Xa(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){ba.__e(t,r)}}function tu(t,e,r){var i,n;if(ba.unmount&&ba.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Xa(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ba.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(n=0;i.length>n;n++)i[n]&&tu(i[n],e,r||"function"!=typeof t.type);r||Na(t.__e),t.__c=t.__=t.__e=void 0}function eu(t,e,r){return this.constructor(t,r)}function ru(t,e,r){var i,n,s;e==document&&(e=document.documentElement),ba.__&&ba.__(t,e),i=e.__k,n=[],s=[],Qa(e,t=e.__k=Fa(Da,null,[t]),i||Ma,Ma,e.namespaceURI,i?null:e.firstChild?ya.call(e.childNodes):null,n,i?i.__e:e.firstChild,!1,s),Ka(n,t,s)}ya=Oa.slice,ba={__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}},_a=0,qa.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Aa({},this.state),"function"==typeof t&&(t=t(Aa({},r),this.props)),t&&Aa(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),Ha(this))},qa.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ha(this))},qa.prototype.render=Da,wa=[],Sa="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ka=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,Ca=/(PointerCapture)$|Capture$/i,Ta=0,Ia=Ga(!1),Ea=Ga(!0),Ra=0;var iu,nu,su,ou,au=0,uu=[],lu=ba,hu=lu.__b,cu=lu.__r,du=lu.diffed,vu=lu.__c,fu=lu.unmount,pu=lu.__;function gu(t,e){lu.__h&&lu.__h(nu,t,au||e),au=0;var r=nu.__H||(nu.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function mu(t){return au=1,function(t,e,r){var i=gu(iu++,2);if(i.t=t,!i.__c&&(i.__=[Eu(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=nu,!nu.__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};nu.__f=!0;var s=nu.shouldComponentUpdate,o=nu.componentWillUpdate;nu.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)},nu.shouldComponentUpdate=n}return i.__N||i.__}(Eu,t)}function yu(t,e){var r=gu(iu++,3);!lu.__s&&Iu(r.__H,e)&&(r.__=t,r.u=e,nu.__H.__h.push(r))}function bu(t){return au=5,_u((function(){return{current:t}}),[])}function _u(t,e){var r=gu(iu++,7);return Iu(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function wu(t){var e=nu.context[t.__c],r=gu(iu++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(nu)),e.props.value):t.__}function xu(){for(var t;t=uu.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Cu),t.__H.__h.forEach(Tu),t.__H.__h=[]}catch(e){t.__H.__h=[],lu.__e(e,t.__v)}}lu.__b=function(t){nu=null,hu&&hu(t)},lu.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),pu&&pu(t,e)},lu.__r=function(t){cu&&cu(t),iu=0;var e=(nu=t.__c).__H;e&&(su===nu?(e.__h=[],nu.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach(Cu),e.__h.forEach(Tu),e.__h=[],iu=0)),su=nu},lu.diffed=function(t){du&&du(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==uu.push(e)&&ou===lu.requestAnimationFrame||((ou=lu.requestAnimationFrame)||ku)(xu)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),su=nu=null},lu.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Cu),t.__h=t.__h.filter((function(t){return!t.__||Tu(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],lu.__e(r,t.__v)}})),vu&&vu(t,e)},lu.unmount=function(t){fu&&fu(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{Cu(t)}catch(t){e=t}})),r.__H=void 0,e&&lu.__e(e,r.__v))};var Su="function"==typeof requestAnimationFrame;function ku(t){var e,r=function(){clearTimeout(i),Su&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);Su&&(e=requestAnimationFrame(r))}function Cu(t){var e=nu,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),nu=e}function Tu(t){var e=nu;t.__c=t.__(),nu=e}function Iu(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function Eu(t,e){return"function"==typeof e?e(t):e}var Ru={Activation:"events",Cancellation:"cancelEvents"},Mu={Button:"button",Tab:"tab",Selector:"selector"},Ou={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"},Pu={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Lu={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Au={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Nu={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Fu={Once:"once",Recurring:"recurring",Always:"always"},$u={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Du={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"},qu={Popover:"popover",Inline:"inline"};function ju(t){return"$survey_response_"+t}function Uu(t,e){if(!e)return null;var r=t[ju(e)];return cr(r)?[...r]:r}function Hu(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!pr(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=Uu(t,e.id);pr(s)||(i[n]=s)}})),r({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:Uu(t,e.id)})))},t,i)}function Bu(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 zu(t){return"string"==typeof t&&t.trim()?t.trim():null}function Vu(t){return t.toLowerCase()}function Wu(t,e,r){if(!t||!e)return null;var i=Vu(e),n=Object.keys(t).find((t=>Vu(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=>Vu(t)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}function Zu(t,e,i){var n,s=Wu(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),pr(l.name)||(o.name=l.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),pr(l.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=l.thankYouMessageHeader,a=!0),pr(l.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=l.thankYouMessageDescription,a=!0),pr(l.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=l.thankYouMessageCloseButtonText,a=!0)):function(t){return!pr(t.thankYouMessageHeader)||!pr(t.thankYouMessageDescription)||!pr(t.thankYouMessageCloseButtonText)}(l)&&(a=!0))}var h=t.questions.map((t=>function(t,e,i){var n,s=Wu(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 pr(o.question)||(a.question=o.question,u=!0),pr(o.description)||(a.description=o.description,u=!0),pr(o.buttonText)||(a.buttonText=o.buttonText,u=!0),"link"in a&&!pr(o.link)&&(a.link=o.link,u=!0),"lowerBoundLabel"in a&&!pr(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,u=!0),"upperBoundLabel"in a&&!pr(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,u=!0),"choices"in a&&function(t){return cr(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 Gu=jn("[Surveys]");function Qu(t){return!(!t.start_date||t.end_date)}function Ju(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Ku(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Yu="seenSurvey_",Xu="inProgressSurvey_",tl=(t,e)=>{var r=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(r=""+t+e.id+"_"+e.current_iteration),r},el=t=>tl(Yu,t),rl=t=>{try{var e=el(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Gu.error("Failed to persist survey seen state",t)}},il=[Lu.Popover,Lu.Widget,Lu.API],nl={ignoreConditions:!1,ignoreDelay:!1,displayType:qu.Popover};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return _r(t)&&isFinite(t)&&Math.floor(t)===t});class sl{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 sl(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 sl(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 ol{constructor(){this.S=0,this.C=0,this.I=new ll}generate(){var t=this.generateOrAbort();if(pr(t)){this.S=0;var e=this.generateOrAbort();if(pr(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 sl.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 al,ul=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};kn&&!pr(kn.crypto)&&crypto.getRandomValues&&(ul=t=>crypto.getRandomValues(t));class ll{constructor(){this.M=new Uint32Array(8),this.R=1/0}nextUint32(){return this.M.length>this.R||(ul(this.M),this.R=0),this.M[this.R++]}}var hl=()=>cl().toString(),cl=()=>(al||(al=new ol)).generate(),dl=["fatal","error","warning","log","info","debug"],vl={GZipJS:"gzip-js",Base64:"base64"},fl=Uint8Array,pl=Uint16Array,gl=Uint32Array,ml=new fl([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]),yl=new fl([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]),bl=new fl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_l=function(t,e){for(var r=new pl(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new gl(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]},wl=_l(ml,2),xl=wl[1];wl[0][28]=258,xl[258]=28;for(var Sl=_l(yl,0)[1],kl=new pl(32768),Cl=0;32768>Cl;++Cl){var Tl=(43690&Cl)>>>1|(21845&Cl)<<1;kl[Cl]=((65280&(Tl=(61680&(Tl=(52428&Tl)>>>2|(13107&Tl)<<2))>>>4|(3855&Tl)<<4))>>>8|(255&Tl)<<8)>>>1}var Il=function(t,e,r){for(var i=t.length,n=0,s=new pl(e);i>n;++n)++s[t[n]-1];var o,a=new pl(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new pl(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[kl[c]>>>u]=l}else for(o=new pl(i),n=0;i>n;++n)o[n]=kl[a[t[n]-1]++]>>>15-t[n];return o},El=new fl(288);for(Cl=0;144>Cl;++Cl)El[Cl]=8;for(Cl=144;256>Cl;++Cl)El[Cl]=9;for(Cl=256;280>Cl;++Cl)El[Cl]=7;for(Cl=280;288>Cl;++Cl)El[Cl]=8;var Rl=new fl(32);for(Cl=0;32>Cl;++Cl)Rl[Cl]=5;var Ml=Il(El,9,0),Ol=Il(Rl,5,0),Pl=function(t){return(t/8>>0)+(7&t&&1)},Ll=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof pl?pl:t instanceof gl?gl:fl)(r-e);return i.set(t.subarray(e,r)),i},Al=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},Nl=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Fl=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 fl(0),0];if(1==n){var o=new fl(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 pl(d+1),f=$l(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 fl(v),f]},$l=function(t,e,r){return-1==t.s?Math.max($l(t.l,e,r+1),$l(t.r,e,r+1)):e[t.s]=r},Dl=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new pl(++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]},ql=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},jl=function(t,e,r){var i=r.length,n=Pl(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)},Ul=function(t,e,r,i,n,s,o,a,u,l,h){Al(e,h++,r),++n[256];for(var c=Fl(n,15),d=c[0],v=c[1],f=Fl(s,15),p=f[0],g=f[1],m=Dl(d),y=m[0],b=m[1],_=Dl(p),w=_[0],x=_[1],S=new pl(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=Fl(S,7),T=C[0],I=C[1],E=19;E>4&&!T[bl[E-1]];--E);var R,M,O,P,L=l+5<<3,A=ql(n,El)+ql(s,Rl)+o,N=ql(n,d)+ql(s,p)+o+14+3*E+ql(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(A>=L&&N>=L)return jl(e,h,t.subarray(u,u+l));if(Al(e,h,1+(A>N)),h+=2,A>N){R=Il(d,v,0),M=d,O=Il(p,g,0),P=p;var F=Il(T,I,0);for(Al(e,h,b-257),Al(e,h+5,x-1),Al(e,h+10,E-4),h+=14,k=0;E>k;++k)Al(e,h+3*k,T[bl[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)Al(e,h,F[U=31&j[k]]),h+=T[U],U>15&&(Al(e,h,j[k]>>>5&127),h+=j[k]>>>12)}}else R=Ml,M=El,O=Ol,P=Rl;for(k=0;a>k;++k)if(i[k]>255){var U;Nl(e,h,R[257+(U=i[k]>>>18&31)]),h+=M[U+257],U>7&&(Al(e,h,i[k]>>>23&31),h+=ml[U]);var H=31&i[k];Nl(e,h,O[H]),h+=P[H],H>3&&(Nl(e,h,i[k]>>>5&8191),h+=yl[H])}else Nl(e,h,R[i[k]]),h+=M[i[k]];return Nl(e,h,R[256]),h+M[256]},Hl=new gl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Bl=function(){for(var t=new gl(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),zl=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Vl(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=Bl[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 fl(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=jl(u,l,t.subarray(h,c)):(u[h]=!0,l=jl(u,l,t.subarray(h,o)))}else{for(var d=Hl[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new pl(32768),m=new pl(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 gl(25e3),x=new pl(288),S=new pl(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=Ul(t,u,0,w,x,S,C,T,E,h-E,l),T=k=C=0,E=h;for(var L=0;286>L;++L)x[L]=0;for(L=0;30>L;++L)S[L]=0}var A=2,N=0,F=f,D=M-O&32767;if(P>2&&R==_(h-D))for(var q=Math.min(v,P)-1,j=Math.min(32767,h),U=Math.min(258,P);j>=D&&--F&&M!=O;){if(t[h+A]==t[h+A-D]){for(var H=0;U>H&&t[h+H]==t[h+H-D];++H);if(H>A){if(A=H,N=D,H>q)break;var B=Math.min(D,H-2),z=0;for(L=0;B>L;++L){var V=h-D+L+32768&32767,W=V-g[V]+32768&32767;W>z&&(z=W,O=V)}}}D+=(M=O)-(O=g[M])+32768&32767}if(N){w[T++]=268435456|xl[A]<<18|Sl[N];var Z=31&xl[A],G=31&Sl[N];C+=ml[Z]+yl[G],++x[257+Z],++S[G],I=h+A,++k}else w[T++]=t[h],++x[t[h]]}}l=Ul(t,u,!0,w,x,S,C,T,E,h-E,l)}return Ll(a,0,i+Pl(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&&zl(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),zl(u,l-8,r.d()),zl(u,l-4,i),u}var Wl=!!Mn||!!Rn,Zl="text/plain",Gl=!1,Ql=(t,e)=>{var[r,i]=t.split("#"),[n,s]=r.split("?");if(!s)return t;var o=s.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return n+(o?"?"+o:"")+(i?"#"+i:"")},Jl=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=Xn(a);return l&&u.push(l),s+"?"+u.join("&")},Kl=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Yl=t=>{if(t.tr)return t.tr;var{data:e,compression:r}=t;if(e){if(r===vl.GZipJS){var i=Vl(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new fl(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 fl(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 Ll(i,0,n)}(Kl(e)),{mtime:0});return{contentType:Zl,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===vl.Base64){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Kl(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Kl(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Kl(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Xl=t=>{var e,i,n,s=Yl(t);return!s||(i=t.compression,n=ts(t.url,"compression"),i!==Ge.GZipJS&&n!==Ge.GZipJS&&"gzip"!==n)||((e=s.body)instanceof ArrayBuffer?Ye(new Uint8Array(e)):ArrayBuffer.isView(e)&&Ye(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))?{url:t.url,encodedBody:s}:(Gl=!0,{url:Ql(t.url,"compression"),encodedBody:Yl(r({},t,{compression:void 0,tr:void 0}))})},th=function(){var t=e((function*(t){var e=Kl(t.data),i=yield function(t,e,r){return rr.apply(this,arguments)}(e,$n.DEBUG,{rethrow:!0});if(!i)return t;var n=yield i.arrayBuffer();return r({},t,{tr:{contentType:Zl,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),eh=(t,e)=>Jl(t,{_:(new Date).getTime().toString(),ver:$n.JS_SDK_VERSION,compression:e}),rh=[];Rn&&rh.push({transport:"fetch",method(t){var e,{url:i,encodedBody:n}=Xl(t),{contentType:s,body:o,estimatedSize:a}=null!=n?n:{},u=new Headers;Hn(t.headers,(function(t,e){u.append(e,t)})),s&&u.append("Content-Type",s);var l=null;if(On){var h=new On;l={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}Rn(i,r({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&52428.8>(a||0),body:o,signal:null==(e=l)?void 0:e.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){qn.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{qn.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>l?clearTimeout(l.timeout):null))}}),Mn&&rh.push({transport:"XHR",method(t){var e=new Mn,{url:r,encodedBody:i}=Xl(t);e.open(t.method||"GET",r,!0);var{contentType:n,body:s}=null!=i?i:{};Hn(t.headers,(function(t,r){e.setRequestHeader(r,t)})),n&&e.setRequestHeader("Content-Type",n),t.timeout&&(e.timeout=t.timeout),t.disableXHRCredentials||(e.withCredentials=!0),e.onreadystatechange=()=>{if(4===e.readyState){var r={statusCode:e.status,text:e.responseText};if(200===e.status)try{r.json=JSON.parse(e.responseText)}catch(t){}null==t.callback||t.callback(r)}},e.send(s)}}),null!=Tn&&Tn.sendBeacon&&rh.push({transport:"sendBeacon",method(t){try{var{url:e,encodedBody:r}=Xl(t),i=Jl(e,{beacon:"1"}),{contentType:n,body:s}=null!=r?r:{};if(!s)return;var o=s instanceof Blob?s:new Blob([s],{type:n});Tn.sendBeacon(i,o)}catch(t){}}});var ih=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 nh(t,e,r){return Kl({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var sh={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=>ih(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!ih(e,t))))),icontains:(t,e)=>e.map(oh).some((e=>t.map(oh).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(oh).every((e=>t.map(oh).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)))}))},oh=t=>t.toLowerCase();function ah(t,e){return!t||Object.entries(t).every((t=>{var[r,i]=t,n=null==e?void 0:e[r];if(pr(n)||yr(n))return!1;var s=[String(n)],o=sh[i.operator];return!!o&&o(i.values,s)}))}var uh="",lh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var hh={O:()=>!!In,D(t){qn.error("cookieStore error: "+t)},A(t){if(In){try{for(var e=t+"=",r=In.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(hh.A(t))||{}}catch(t){}return e},N(t,e,r,i,n){if(!In)return!1;try{var s="",o="",a=function(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=In),uh)return uh;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_"+hl();!uh&&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",uh=s)}return uh}(t);if(!r){var i=(t=>{var e=t.match(lh);return e?e[0]:""})(t);i!==r&&qn.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(In.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&&qn.warn("cookieStore warning: large cookie, len="+l.length),In.cookie=l,!0}catch(t){return!1}},q(t,e){if(null!=In&&In.cookie)try{hh.N(t,"",-1,e)}catch(t){return}}},ch=null,dh={O(){if(!yr(ch))return ch;var t=!0;if(pr(kn))t=!1;else try{var e="__mplssupport__";dh.N(e,"xyz"),'"xyz"'!==dh.A(e)&&(t=!1),dh.q(e)}catch(e){t=!1}return t||qn.error("localStorage unsupported; falling back to cookie store"),ch=t,t},D(t){qn.error("localStorage error: "+t)},A(t){try{return null==kn?void 0:kn.localStorage.getItem(t)}catch(t){dh.D(t)}return null},F(t){try{return JSON.parse(dh.A(t))||{}}catch(t){}return null},N(t,e){try{return null==kn||kn.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){dh.D(t)}return!1},q(t){try{null==kn||kn.localStorage.removeItem(t)}catch(t){dh.D(t)}}},vh=[os,"distinct_id",Ss,ks,Qs,Gs,Bs],fh={},ph={O:()=>!0,D(t){qn.error("memoryStorage error: "+t)},A:t=>fh[t]||null,F:t=>fh[t]||null,N:(t,e)=>(fh[t]=e,!0),q(t){delete fh[t]}},gh=null,mh={O(){if(!yr(gh))return gh;if(gh=!0,pr(kn))gh=!1;else try{var t="__support__";mh.N(t,"xyz"),'"xyz"'!==mh.A(t)&&(gh=!1),mh.q(t)}catch(t){gh=!1}return gh},D(t){qn.error("sessionStorage error: ",t)},A(t){try{return null==kn?void 0:kn.sessionStorage.getItem(t)}catch(t){mh.D(t)}return null},F(t){try{return JSON.parse(mh.A(t))||null}catch(t){}return null},N(t,e){try{return null==kn||kn.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){mh.D(t)}return!1},q(t){try{null==kn||kn.sessionStorage.removeItem(t)}catch(t){mh.D(t)}}},yh=jn("[Stylesheet Loader]"),bh=kn,_h=In,wh="#020617",xh={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:Ou.Right,widgetType:Mu.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:wh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Sh=[Ou.Center,Ou.Left,Ou.Right];function kh(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 Ch(t){var e;void 0===t&&(t=xh.backgroundColor),"#"===t[0]&&(e=kh(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=kh(r)),!e)return wh;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?wh:"white"}return wh}var Th=(t,e,i)=>{var n=zh(t),s=_h.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=_h.createElement("div");((t,e,i)=>{var n=r({},xh,i),s=t.style,o=!Sh.includes(n.position)||e===Lu.Widget&&(null==i?void 0:i.widgetType)===Mu.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)||Ch(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",Ch(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Ch(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",Ch(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)||Ch(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=_h.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}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~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||(yh.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 _h.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},Ih=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a,surveyLanguage:u}=t;s?(rl(i),s.capture($u.SENT,r({[Du.SURVEY_NAME]:i.name,[Du.SURVEY_ID]:i.id,[Du.SURVEY_ITERATION]:i.current_iteration,[Du.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Du.SURVEY_SUBMISSION_ID]:n,[Du.SURVEY_COMPLETED]:o},u&&{[Du.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},Hu(e,i),a,{$set:{[Bu(i,"responded")]:!0}})),o&&(bh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Bh(i))):Gu.error("[survey sent] event not captured, PostHog instance not found.")},Eh=(t,e,i)=>{return r({[Du.SURVEY_NAME]:t.name,[Du.SURVEY_ID]:t.id,[Du.SURVEY_ITERATION]:t.current_iteration,[Du.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Du.SURVEY_PARTIALLY_COMPLETED]:(n=null==e?void 0:e.responses,void 0===n&&(n={}),Object.values(n).some((t=>!br(t))))},(null==e?void 0:e.surveyLanguage)&&{[Du.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Du.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},Hu(null==e?void 0:e.responses,t));var n},Rh=(t,e,i,n)=>{if(e){if(!i){var s=Uh(t);e.capture($u.DISMISSED,r({},Eh(t,s,e),n&&{[Du.SURVEY_LANGUAGE]:n},{$set:{[Bu(t,"dismissed")]:!0}})),Bh(t),rl(t),bh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Gu.error("[survey dismissed] event not captured, PostHog instance not found.")},Mh=(t,e)=>{if(e){var r=(t=>tl("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=Uh(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture($u.ABANDONED,Eh(t,i,e),{transport:"sendBeacon"})}}else Gu.error("[survey abandoned] event not captured, PostHog instance not found.")},Oh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),Ph=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,Lh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?Ph(t.questions,Oh(t.questions)):t.questions,Ah=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===Fu.Always||Hh(t)},Nh=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,Ha(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"+Ra++,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}),Fh=()=>wu(Nh),$h=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return function(t,e,r){var i,n,s,o,a=Aa({},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?ya.call(arguments,2):r),$a(t.type,a,i||t.key,n||t.ref,null)}(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function Dh(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==bh||null==(r=bh.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 sh[o](s,[n])}var qh=t=>{var e=""+Xu+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Xu+t.id+"_"+t.current_iteration),e},jh=(t,e)=>{try{localStorage.setItem(qh(t),JSON.stringify(e))}catch(t){Gu.error("Error setting in-progress survey state in localStorage",t)}},Uh=t=>{try{var e=localStorage.getItem(qh(t));if(e)return JSON.parse(e)}catch(t){Gu.error("Error getting in-progress survey state from localStorage",t)}return null},Hh=t=>{var e=Uh(t);return!br(null==e?void 0:e.surveySubmissionId)},Bh=t=>{try{localStorage.removeItem(qh(t))}catch(t){Gu.error("Error clearing in-progress survey state from localStorage",t)}};function zh(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function Vh(t,e,r){if(void 0===e&&(e=Ou.Right),t===Lu.ExternalSurvey)return{};switch(e){case Ou.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Ou.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Ou.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Ou.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Ou.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Ou.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Ou.Left:return{left:"30px"};case Ou.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Lu.Widget&&r===Mu.Tab?"60px":"30px"}}}var Wh=0;function Zh(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:--Wh,__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 ba.vnode&&ba.vnode(l),l}var Gh=Zh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Zh("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"})}),Qh=Zh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Zh("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"})}),Jh=Zh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Zh("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"})}),Kh=Zh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Zh("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"})}),Yh=Zh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Zh("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Xh=Zh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Zh("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"})}),tc=Zh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Zh("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"})}),ec=function(t){var{fill:e="currentColor"}=void 0===t?{}:t;return Zh("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:[Zh("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Zh("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})]})},rc=Zh("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Zh("g",{"clip-path":"url(#clip0_2415_6911)",children:[Zh("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Zh("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Zh("g",{mask:"url(#mask0_2415_6911)",children:[Zh("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"}),Zh("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"}),Zh("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"}),Zh("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"}),Zh("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"}),Zh("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"})]})]}),Zh("defs",{children:Zh("clipPath",{id:"clip0_2415_6911",children:Zh("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function ic(t){var{urlParams:e}=t,r=e?Object.entries(e).map((t=>{var[e,r]=t;return encodeURIComponent(e)+"="+encodeURIComponent(r)})).join("&"):"";return Zh("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",rc]})}function nc(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=t,{isPreviewMode:u}=wu(Nh);return Zh("div",{className:"bottom-section",children:[!a&&Zh("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==kn||kn.open(s)),u?null==o||o():n()},children:e}),!i.whiteLabel&&Zh(ic,{urlParams:{utm_source:"survey-footer"}})]})}function sc(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return Zh("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Zh(e.type===Au.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&$h({component:Fa("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function oc(t){var{onClick:e}=t,{isPreviewMode:r}=wu(Nh);return Zh("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:ec({fill:"black"})})}Zh("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Zh("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 ac=kn;function uc(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=t,{isPopup:a}=wu(Nh);return yu((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Jn(ac,"keydown",t),()=>{ac.removeEventListener("keydown",t)}}),[o]),Zh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Zh(oc,{onClick:()=>o()}),Zh("h3",{className:"thank-you-message-header",children:e}),r&&$h({component:Fa("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Zh(nc,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var lc=t=>cr(t)&&t.every((t=>gr(t)));function hc(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=t,{isPreviewMode:u}=Fh(),l=bu(null),[h,c]=mu((()=>gr(a)?a:""));yu((()=>{setTimeout((()=>{var t;u||null==(t=l.current)||t.focus()}),100)}),[u]);var d="surveyQuestion"+o,v=_u((()=>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 Qe.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 Qe.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=zi(e.validation,Qe.MinLength),p=zi(e.validation,Qe.MaxLength),g=_u((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(f,p)),[f,p]),m=()=>{v||n(h.trim())},y=()=>{v||s(h.trim())};return Zh(Da,{children:[Zh("div",{className:"question-container",children:[Zh(sc,{question:e,forceDisableHtml:r,htmlFor:d}),Zh("textarea",{ref:l,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:f,maxLength:p,onInput(t){c(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||v||(t.preventDefault(),u?y():m())},value:h}),g&&Zh("div",{className:"validation-hint",children:g})]}),Zh(nc,{text:e.buttonText||"Submit",submitDisabled:!!v,appearance:i,onSubmit:m,onPreviewSubmit:y})]})}function cc(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=t;return Zh(Da,{children:[Zh("div",{className:"question-container",children:Zh(sc,{question:e,forceDisableHtml:r})}),Zh(nc,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function dc(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]=mu((()=>_r(u)?u:cr(u)&&u.length>0&&_r(parseInt(u[0]))?parseInt(u[0]):gr(u)&&_r(parseInt(u))?parseInt(u):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=Fh(),p=t=>f?a(t):o(t);return Zh(Da,{children:[Zh("div",{className:"question-container",children:[Zh(sc,{question:r,forceDisableHtml:i}),Zh("div",{className:"rating-section",children:[Zh("div",{className:"rating-options",children:["emoji"===r.display&&Zh("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(e=yc[r.scale])?void 0:e.map(((t,e)=>Zh("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&&Zh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-h+1)+", minmax(0, 1fr))"},children:bc(r.scale).map(((t,e)=>Zh(vc,{displayQuestionIndex:n,active:c===t,appearance:s,num:t,setActiveNumber(t){d(t),r.skipSubmitButton&&p(t)}},e)))})]}),!v&&Zh("div",{className:"rating-text",children:[Zh("div",{children:r.lowerBoundLabel}),Zh("div",{children:r.upperBoundLabel})]})]})]}),Zh(nc,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:yr(c)&&!r.optional,appearance:s,onSubmit:()=>o(c),onPreviewSubmit:()=>a(c),skipSubmitButton:r.skipSubmitButton})]})}function vc(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return Zh("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick(){n(e)},children:e})}function fc(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l=bu(null),h=_u((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=Ph(e,Oh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[c,d]=mu((()=>((t,e)=>gr(t)||lc(t)?t:e===Au.SingleChoice?null:[])(u,e.type))),[v,f]=mu((()=>((t,e)=>{if(gr(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(lc(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,h))),{isPreviewMode:p}=Fh(),g=e.type===Au.SingleChoice,m=e.type===Au.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&&cr(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||!yr(c)&&(!cr(c)||v.isSelected||0!==c.length)&&(!v.isSelected||""!==v.inputValue.trim())),S=()=>{v.isSelected&&m?cr(c)&&(p?a([...c,v.inputValue]):o([...c,v.inputValue])):p?a(c):o(c)};return Zh(Da,{children:[Zh("div",{className:"question-container",children:[Zh(sc,{question:e,forceDisableHtml:i}),Zh("fieldset",{className:"multiple-choice-options limit-height",children:[Zh("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:cr(c)&&c.includes(t);return Zh("label",{className:i?"choice-option-open":"",children:[Zh("div",{className:"response-choice",children:[Zh("input",{type:g?"radio":"checkbox",name:s,checked:a,onChange:()=>b(t,i),id:s,"aria-controls":o}),Zh("span",{children:i?t+":":t})]}),i&&Zh("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)}))]})]}),Zh(nc,{text:e.buttonText||"Submit",submitDisabled:x(),appearance:s,onSubmit:S,onPreviewSubmit:S,skipSubmitButton:y})]})}var pc=[1,2,3,4,5],gc=[1,2,3,4,5,6,7],mc=[0,1,2,3,4,5,6,7,8,9,10],yc={2:[Xh,tc],3:[Jh,Qh,Gh],5:[Kh,Jh,Qh,Gh,Yh]};function bc(t){switch(t){case 5:default:return pc;case 7:return gc;case 10:return mc}}var _c=jn("[Surveys]");function wc(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?Nu.End:s;if(n.branching.type===Nu.End)return Nu.End;if(n.branching.type===Nu.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Nu.ResponseBased){if(n.type===Au.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===Nu.End?Nu.End:s}}else if(n.type===Au.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===Nu.End?Nu.End:s}}return s}return _c.warn("Falling back to next question index due to unexpected branching type"),s}var xc="https?://(.*)",Sc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],kc=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Sc],Cc="<masked>",Tc=["li_fat_id"];function Ic(t,e,r){if(!In)return{};var i,n=e?[...Sc,...r||[]]:[],s=Ec(es(In.URL,n,Cc),t),o=(i={},Hn(Tc,(function(t){var e=hh.A(t);i[t]=e||null})),i);return Bn(o,s)}function Ec(t,e){var r=kc.concat(e||[]),i={};return Hn(r,(function(e){var r=ts(t,e);i[e]=r||null})),i}function Rc(t){var e=function(t){return t?0===t.search(xc+"google.([^/?]*)")?"google":0===t.search(xc+"bing.com")?"bing":0===t.search(xc+"yahoo.com")?"yahoo":0===t.search(xc+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!yr(e)){i.$search_engine=e;var n=In?ts(In.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function Mc(){return navigator.language||navigator.userLanguage}var Oc="$direct";function Pc(){return(null==In?void 0:In.referrer)||Oc}function Lc(t,e){var r=t?[...Sc,...e||[]]:[],i=null==En?void 0:En.href.substring(0,1e3);return{r:Pc().substring(0,1e3),u:i?es(i,r,Cc):void 0}}function Ac(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:r==Oc?Oc:null==(e=Yn(r))?void 0:e.host};if(i){n.$current_url=i;var s=Yn(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=Ec(i);Bn(n,o)}if(r){var a=Rc(r);Bn(n,a)}return n}function Nc(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Fc(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var $c=jn("[SurveyTranslations]");function Dc(t,e){var r=function(t){return function(t,e){var{overrideLanguage:r,storedPersonProperties:i,locale:n}=t,s=zu(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?zu(t.language):null}(i);if(o)return null==e||e.info("Using person property language: "+o),o;var a=zu(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:dr(t.get_property)?t.get_property(Ls):void 0,locale:Mc()},$c)}(e);if(!r)return $c.info("No user language detected"),{survey:t,language:null};var i=Zu(t,r,$c);return{survey:i.survey,language:i.matchedKey}}var qc=kn,jc=In,Uc="ph:show_survey_widget",Hc="PHWidgetSurveyClickListener";function Bc(t,e){try{var r=t.getBoundingClientRect(),i=qc.innerHeight,n=qc.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:xh.zIndex}}catch(t){return Gu.warn("Failed to calculate trigger position:",t),null}}class zc{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(Ns);if(t)for(var e of t)Hh(e)&&Mh(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)===Ou.NextToTrigger&&null!=(s=l.appearance)&&s.widgetSelector){var f,p=jc.querySelector(l.appearance.widgetSelector);p&&(v=Bc(p,parseInt((null==(f=l.appearance)?void 0:f.maxWidth)||xh.maxWidth))||{})}var g=(null==(o=l.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:m}=Th(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 ru(Zh(Gc,r({},y)),m);var b=setTimeout((()=>{if(this.j.delete(l.id),!Dh(l))return this.$(l);ru(Zh(Gc,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}=Th(e,this._posthog);n&&ru(Zh(Jc,{posthog:this._posthog,survey:e,surveyLanguage:r},t.id),i)},this.J=t=>{this.X(t);var e=this.H.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Hc),this.H.delete(t.id),Gu.info("Removed click listener for survey "+t.id))},this.Y=(t,e)=>{var r=jc.querySelector(e),i=this.H.get(t.id);if(r){if(this.G(t),i){if(r===i.element)return;Gu.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.J(t)}if(!r.hasAttribute(Hc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===Ou.NextToTrigger?Bc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||xh.maxWidth)):{};qc.dispatchEvent(new CustomEvent(Uc,{detail:{surveyId:t.id,position:n}}))};Jn(r,"click",n),r.setAttribute(Hc,"true"),this.H.set(t.id,{element:r,listener:n,survey:t}),Gu.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.J(t)},this.renderPopover=t=>{var{survey:e,language:r}=this.B(t),{shadow:i}=Th(e,this._posthog);ru(Zh(Gc,{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)),ru(Zh(Gc,{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===Lu.Popover||t.type===Lu.Widget)),i=e.ne(r),n=new Set;i.forEach((t=>{if(t.type===Lu.Widget){var r,i,s,o;if((null==(r=t.appearance)?void 0:r.widgetType)===Mu.Tab)return void e.G(t);(null==(i=t.appearance)?void 0:i.widgetType)===Mu.Selector&&null!=(s=t.appearance)&&s.widgetSelector&&(n.add(t.id),e.Y(t,null==(o=t.appearance)?void 0:o.widgetSelector))}yr(e.ie)&&t.type===Lu.Popover&&e.handlePopoverSurvey(t)})),e.H.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.J(r)}))}),t)},this.Z=t=>{yr(this.ie)||Gu.error("Survey "+this.ie+" already in focus. Cannot add survey "+t.id+"."),this.ie=t.id},this.$=t=>{this.ie!==t.id&&Gu.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.V(t.id),this.ie=null,this.X(t)},this._posthog=t,this.ie=null}V(t){var e=this.j.get(t);e&&(clearTimeout(e),this.j.delete(t))}cancelSurvey(t){this.j.has(t)&&(Gu.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=Hh(t),s=Hh(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===Fu.Always,a=e.schedule===Fu.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 Dc(t,this._posthog)}K(t,e){if(this.U.has(t.id))return!1;var{params:r}=function(t){var e={},r=!1,i=qc.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&&!pr(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;Gu.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)&&Ih({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)]=cr(o)?o.map(String):[String(o)];Gu.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 Ih({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=ju(t.id);try{switch(t.type){case Au.SingleChoice:if(!t.choices||0===t.choices.length)return void qn.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 qn.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case Au.MultipleChoice:if(!t.choices||0===t.choices.length)return void qn.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 qn.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(a.map((e=>t.choices[e])))];a.length>u.length&&qn.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=u;break;case Au.Rating:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||0>l||l>h)return void qn.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=l;break;default:qn.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){qn.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(i).length)return Gu.warn("[Survey Prefill] No valid responses after conversion"),null;var n=hl(),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=ju(o.id);pr(r[a])||(n[a]=r[a])}var u=wc(t,i,o.id?r[ju(o.id)]:null);if(u===Nu.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=u}return{startQuestionIndex:i,skippedResponses:n}}(t,s,i),u=o>=t.questions.length;return jh(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:o,surveyLanguage:r}),Gu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return Gu.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||Dh(t)&&function(t){var e,r;return function(t,e){var r,i,n;if(!t||0===t.length)return!0;if(!Ln)return!1;var s=qi(Ln,{userAgentDataPlatform:null==Tn||null==(r=Tn.userAgentData)?void 0:r.platform,maxTouchPoints:null==Tn?void 0:Tn.maxTouchPoints,screenWidth:null==kn||null==(i=kn.screen)?void 0:i.width,screenHeight:null==kn||null==(n=kn.screen)?void 0:n.height,devicePixelRatio:null==kn?void 0:kn.devicePixelRatio});return sh[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==_h||!_h.querySelector(t.conditions.selector))}(t)}se(t){return Ah(t)||this.ae(t.internal_targeting_flag_key)||Hh(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!Qu(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!il.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,dh.A("lastSeenSurveyDate"))?(t=>!!dh.A(el(t))&&!Ah(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(!Ju(t)&&!Ku(t))return!0;var r=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}re(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:r}=t;return!e||!r||this.ae(r)}))}X(t){try{var e=jc.querySelector(zh(t,!0));null!=e&&e.shadowRoot&&ru(null,e.shadowRoot),null==e||e.remove()}catch(e){Gu.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.ie,surveyTimeouts:this.j,handleWidget:this.G,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Y,sortSurveysByAppearanceDelay:this.ne,checkFlags:this.re.bind(this),isSurveyFeatureFlagEnabled:this.ae.bind(this)}}}function Vc(t,e){if(jc&&qc){var r,i=new zc(t);if(t.config.disable_surveys_automatic_display)return Gu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Gu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{pr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Jn(jc,"visibilitychange",(()=>{jc.hidden?pr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function Wc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;yu((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var s=()=>{var t,n=e.type===Lu.Widget,s=Dh(e),o=(null==(t=e.appearance)?void 0:t.widgetType)===Mu.Tab&&n;if(!s)return Gu.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);o&&(Gu.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};Jn(qc,"popstate",s),Jn(qc,"hashchange",s);var o=qc.history.pushState,a=qc.history.replaceState;return qc.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()},qc.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()},()=>{qc.removeEventListener("popstate",s),qc.removeEventListener("hashchange",s),qc.history.pushState=o,qc.history.replaceState=a}}}),[n,e,r,i])}function Zc(t){switch(void 0===t&&(t=Pu.Right),t){case Pu.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Pu.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Pu.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Gc(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=bu(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]=mu(n||0===i||t.type===Lu.ExternalSurvey),[d,v]=mu(!1),f=()=>{var e=()=>{o&&s(t),c(!1)};jc.startViewTransition?jc.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 yu((()=>{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=()=>{Dh(t)&&(c(!0),qc.dispatchEvent(new Event("PHSurveyShown")),u||e.capture($u.SHOWN,r({[Du.SURVEY_NAME]:t.name,[Du.SURVEY_ID]:t.id,[Du.SURVEY_ITERATION]:t.current_iteration,[Du.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[Du.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()})),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(Jn(qc,"PHSurveyClosed",p),Jn(qc,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),qc.removeEventListener("PHSurveyClosed",p),qc.removeEventListener("PHSurveySent",s)}}return o(),()=>{qc.removeEventListener("PHSurveyClosed",p),qc.removeEventListener("PHSurveySent",s)}}}else Gu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Wc({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=_u((()=>{var t=Uh(u),e=(null==t?void 0:t.surveySubmissionId)||hl();return{isPreviewMode:S,previewPageIndex:d,onPopupSurveyDismissed(){w?Rh(u,h,S,w):Rh(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?Zh(Nh.Provider,{value:R,children:Zh("div",{className:"ph-survey",style:r({},Vh(u.type,null==(i=u.appearance)?void 0:i.position,null==(n=u.appearance)?void 0:n.widgetType),c),ref:x,children:E?Zh(uc,{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||xh,onClose(){I(),m()}}):Zh(Qc,{survey:u,forceDisableHtml:!!l,posthog:h})})}):null}function Qc(t){var e,{survey:i,forceDisableHtml:n,posthog:s}=t,[o,a]=mu((()=>{var t=Uh(i);return null!=t&&t.responses&&Gu.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}=wu(Nh),[g,m]=mu((()=>{var t=Uh(i);return u||(null==t?void 0:t.lastQuestionIndex)||0})),y=_u((()=>Lh(i)),[i]);yu((()=>{v&&!pr(u)&&m(u)}),[u,v]);var b=y.at(g);return b?Zh("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=i.appearance)?void 0:e.hideCancelButton)&&Zh(oc,{onClick(){l()}}),Zh("div",{className:"survey-box","data-question-index":g,children:Kc({question:b,forceDisableHtml:n,displayQuestionIndex:g,appearance:i.appearance||xh,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:u}=t;if(s)if(u){var l=ju(u),h=r({},o,{[l]:e});a(h);var c=wc(i,n,e),v=c===Nu.End;v||(m(c),jh(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c,surveyLanguage:p})),(i.enable_partial_responses||v)&&Ih({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:s,properties:f,surveyLanguage:p})}else Gu.error("onNextButtonClick called without a questionId.");else Gu.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:g,questionId:b.id}),onPreviewSubmit:c,initialValue:b.id?o[ju(b.id)]:void 0})})]}):null}function Jc(t){var e,r,i,n,s,o,a,{survey:u,forceDisableHtml:l,posthog:h,readOnly:c,surveyLanguage:d}=t,[v,f]=mu(!0),[p,g]=mu(!1),[m,y]=mu({}),b=()=>{g(!p)};if(yu((()=>{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&&(Gu.info("Received show event for feedback button survey "+u.id),y(r.detail.position||{}),b())};return Jn(qc,Uc,e),()=>{qc.removeEventListener(Uc,e)}}}else Gu.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]),Wc({survey:u,setSurveyVisible:f}),!v)return null;var _=()=>{u.schedule!==Fu.Always&&f(!1),setTimeout((()=>{g(!1)}),200)};return Zh(Da,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Zh("button",{className:"ph-survey-widget-tab "+((null==(s=u.appearance)?void 0:s.tabPosition)===Pu.Top?"widget-tab-top":""),onClick:b,disabled:c,style:Zc(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),p&&Zh(Gc,{posthog:h,survey:u,forceDisableHtml:l,style:m,onPopupSurveyDismissed:_,onCloseConfirmationMessage:_,surveyLanguage:d})]})}var Kc=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 Au.Open:return Fa(hc,r({},l,{question:e,key:e.id}));case Au.Link:return Fa(cc,r({},l,{question:e,key:e.id}));case Au.Rating:return Fa(dc,r({},l,{question:e,key:e.id}));case Au.SingleChoice:case Au.MultipleChoice:return Fa(fc,r({},l,{question:e,key:e.id}));default:return Gu.error("Unsupported question type: "+e.type),null}};An.__PosthogExtensions__=An.__PosthogExtensions__||{},An.__PosthogExtensions__.generateSurveys=Vc,An.extendPostHogWithSurveys=Vc;class Yc{emit(t){}}var Xc=new Yc,td=new class{getLogger(t,e,r){return new Yc}};class ed{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.he(this.name,this.version,this.options);return t?(this.ce=t,this.ce):Xc}}class rd{getLogger(t,e,r){var i;return null!==(i=this.he(t,e,r))&&void 0!==i?i:new ed(this,t,e,r)}de(){var t;return null!==(t=this.ce)&&void 0!==t?t:td}ve(t){this.ce=t}he(t,e,r){var i;return null===(i=this.ce)||void 0===i?void 0:i.getLogger(t,e,r)}}var id="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},nd=Symbol.for("io.opentelemetry.js.api.logs"),sd=id;class od{constructor(){this.fe=new rd}static getInstance(){return this._instance||(this._instance=new od),this._instance}setGlobalLoggerProvider(t){return sd[nd]?this.getLoggerProvider():(sd[nd]=(1,e=t,r=td,t=>1===t?e:r),this.fe.ve(t),t);var e,r}getLoggerProvider(){var t,e;return null!==(e=null===(t=sd[nd])||void 0===t?void 0:t.call(sd,1))&&void 0!==e?e:this.fe}getLogger(t,e,r){return this.getLoggerProvider().getLogger(t,e,r)}disable(){delete sd[nd],this.fe=new rd}}var ad=od.getInstance();class ud{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 ld 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 hd(t){if(Number.isFinite(t)&&t>0)return t;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+t+"')")}class cd{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 dd(t){return new cd(t.concurrencyLimit)}var vd="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},fd="1.9.0",pd=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,gd=function(t){var e=new Set([t]),r=new Set,i=t.match(pd);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(pd);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)}}(fd),md=fd.split(".")[0],yd=Symbol.for("opentelemetry.js.api."+md),bd=vd;function _d(t,e,r,i){var n;void 0===i&&(i=!1);var s=bd[yd]=null!==(n=bd[yd])&&void 0!==n?n:{version:fd};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!==fd?(o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+fd),r.error(o.stack||o.message),!1):(s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+fd+"."),!0)}function wd(t){var e,r,i=null===(e=bd[yd])||void 0===e?void 0:e.version;if(i&&gd(i))return null===(r=bd[yd])||void 0===r?void 0:r[t]}function xd(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+fd+".");var r=bd[yd];r&&delete r[t]}var Sd,kd=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 Cd("debug",this.ye,t)},t.prototype.error=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Cd("error",this.ye,t)},t.prototype.info=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Cd("info",this.ye,t)},t.prototype.warn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Cd("warn",this.ye,t)},t.prototype.verbose=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Cd("verbose",this.ye,t)},t}();function Cd(t,e,r){var i=wd("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"}(Sd||(Sd={}));var Td=function(){function t(){function t(t){return function(){for(var e=[],r=0;arguments.length>r;r++)e[r]=arguments[r];var i=wd("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:Sd.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=wd("diag"),u=function(t,e){function r(r,i){var n=e[r];return"function"!=typeof n||i>t?function(){}:n.bind(e)}return Sd.NONE>t?t=Sd.NONE:t>Sd.ALL&&(t=Sd.ALL),e=e||{},{error:r("error",Sd.ERROR),warn:r("warn",Sd.WARN),info:r("info",Sd.INFO),debug:r("debug",Sd.DEBUG),verbose:r("verbose",Sd.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:Sd.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 _d("diag",u,e,!0)},e.disable=function(){xd("diag",e)},e.createComponentLogger=function(t){return new kd(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 Id(t){return Symbol.for(t)}var Ed,Rd=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}},Md=function(){function t(){}return t.prototype.active=function(){return Rd},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}(),Od="context",Pd=new Md,Ld=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return _d(Od,t,Td.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 wd(Od)||Pd},t.prototype.disable=function(){this.be().disable(),xd(Od,Td.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(Ed||(Ed={}));var Ad="0000000000000000",Nd="00000000000000000000000000000000",Fd={traceId:Nd,spanId:Ad,traceFlags:Ed.NONE},$d=function(){function t(t){void 0===t&&(t=Fd),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}(),Dd=Id("OpenTelemetry Context Key SPAN");function qd(t){return t.getValue(Dd)||void 0}function jd(){return qd(Ld.getInstance().active())}function Ud(t,e){return t.setValue(Dd,e)}function Hd(t){return t.deleteValue(Dd)}function Bd(t,e){return Ud(t,new $d(e))}function zd(t){var e;return null===(e=qd(t))||void 0===e?void 0:e.spanContext()}var Vd=/^([0-9a-f]{32})$/i,Wd=/^[0-9a-f]{16}$/i;function Zd(t){return Vd.test(r=t.traceId)&&r!==Nd&&Wd.test(e=t.spanId)&&e!==Ad;var e,r}function Gd(t){return new $d(t)}var Qd=Ld.getInstance(),Jd=function(){function t(){}return t.prototype.startSpan=function(t,e,r){if(void 0===r&&(r=Qd.active()),Boolean(null==e?void 0:e.root))return new $d;var i,n=r&&zd(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&Zd(n)?new $d(n):new $d},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:Qd.active(),u=this.startSpan(t,n,a),l=Ud(a,u);return Qd.with(l,o,void 0,u)}},t}(),Kd=new Jd,Yd=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):Kd},t}(),Xd=new(function(){function t(){}return t.prototype.getTracer=function(t,e,r){return new Jd},t}()),tv=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 Yd(this,t,e,r)},t.prototype.getDelegate=function(){var t;return null!==(t=this.ce)&&void 0!==t?t:Xd},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}(),ev=Ld.getInstance(),rv=Td.instance(),iv="trace",nv=function(){function t(){this.xe=new tv,this.wrapSpanContext=Gd,this.isSpanContextValid=Zd,this.deleteSpan=Hd,this.getSpan=qd,this.getActiveSpan=jd,this.getSpanContext=zd,this.setSpan=Ud,this.setSpanContext=Bd}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=_d(iv,this.xe,Td.instance());return e&&this.xe.setDelegate(t),e},t.prototype.getTracerProvider=function(){return wd(iv)||this.xe},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){xd(iv,Td.instance()),this.xe=new tv},t}().getInstance(),sv=Id("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function ov(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(av(i)){e=i;continue}return!1}return!1}}return!0}(t):av(typeof t))}function av(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}function uv(t){try{(t=>{rv.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 lv,hv=performance,cv="telemetry.sdk.language",dv="telemetry.sdk.name",vv="telemetry.sdk.version",fv={[dv]:"opentelemetry","process.runtime.name":"browser",[cv]:"webjs",[vv]:"2.2.0"},pv=Math.pow(10,6),gv=Math.pow(10,9);function mv(t){return[Math.trunc(t/1e3),Math.round(t%1e3*pv)]}function yv(){var t=hv.timeOrigin;return"number"!=typeof t&&(t=hv.timing&&hv.timing.fetchStart),t}function bv(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<yv()?(e=t,r=mv(yv()),i=mv("number"==typeof e?e:hv.now()),gv>(n=[r[0]+i[0],r[1]+i[1]])[1]||(n[1]-=gv,n[0]+=1),n):mv(t);var e,r,i,n,s;if(t instanceof Date)return mv(t.getTime());throw TypeError("Invalid input type")}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(lv||(lv={}));var _v="[object Object]",wv="[object Null]",xv="[object Undefined]",Sv=function(){}.toString,kv=Sv.call(Object),Cv=Object.getPrototypeOf,Tv=Object.prototype,Iv=Tv.hasOwnProperty,Ev=Symbol?Symbol.toStringTag:void 0,Rv=Tv.toString;function Mv(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){return null==t?void 0===t?xv:wv:Ev&&Ev in Object(t)?function(t){var e=Iv.call(t,Ev),r=t[Ev],i=!1;try{t[Ev]=void 0,i=!0}catch(t){}var n=Rv.call(t);return i&&(e?t[Ev]=r:delete t[Ev]),n}(t):function(t){return Rv.call(t)}(t)}(t)!==_v)return!1;var e=Cv(t);if(null===e)return!0;var r=Iv.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Sv.call(r)===kv}function Ov(t){return Av(t)?t.slice():t}function Pv(t,e,r,i){var n;if(void 0===r&&(r=0),20>=r){if(r++,$v(t)||$v(e)||Nv(e))n=Ov(e);else if(Av(t)){if(n=t.slice(),Av(e))for(var s=0,o=e.length;o>s;s++)n.push(Ov(e[s]));else if(Fv(e))for(var a=Object.keys(e),u=0,l=a.length;l>u;u++){var h=a[u];n[h]=Ov(e[h])}}else if(Fv(t))if(Fv(e)){if(!function(t,e){return!(!Mv(t)||!Mv(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($v(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(Lv(t,f,i)||Lv(e,f,i))delete n[f];else{if(Fv(g)&&Fv(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]=Pv(n[f],p,r,i)}}}}else n=e;return n}}function Lv(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 Av(t){return Array.isArray(t)}function Nv(t){return"function"==typeof t}function Fv(t){return!$v(t)&&!Av(t)&&!Nv(t)&&"object"==typeof t}function $v(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class Dv extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Dv.prototype)}}function qv(t,e){var r,i=new Promise((function(t,i){r=setTimeout((function(){i(new Dv("Operation timed out."))}),e)}));return Promise.race([t,i]).then((t=>(clearTimeout(r),t)),(t=>{throw clearTimeout(r),t}))}class jv{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 Uv{constructor(t,e){this.Te=void 0,this.Me=void 0,this._e=!1,this.Le=new jv,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 Hv={Re:(t,e)=>new Promise((r=>{ev.with(function(t){return t.setValue(sv,!0)}(ev.active()),(()=>{t.export(e,(t=>{r(t)}))}))}))};class Bv{constructor(t,e,r,i,n){this.Oe=void 0,this.Ee=void 0,this.Ne=void 0,this.Ae=void 0,this.Pe=void 0,this.qe=void 0,this.Oe=t,this.Ee=e,this.Ne=r,this.Ae=i,this.Pe=n,this.qe=rv.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,e){if(this.qe.debug("items to be sent",t),this.Ae.hasReachedLimit())e({code:lv.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this.Ee.serializeRequest(t);null!=r?this.Ae.pushPromise(this.Oe.send(r,this.Pe).then((t=>{if("success"!==t.status)e("failure"===t.status&&t.error?{code:lv.FAILED,error:t.error}:"retryable"===t.status?{code:lv.FAILED,error:new ld("Export failed with retryable status")}:{code:lv.FAILED,error:new ld("Export failed with unknown error")});else{if(null!=t.data)try{this.Ne.handleResponse(this.Ee.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:lv.SUCCESS})}}),(t=>e({code:lv.FAILED,error:t})))):e({code:lv.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.Ae.awaitAll()}shutdown(){var t=this;return e((function*(){t.qe.debug("shutdown started"),yield t.forceFlush(),t.Oe.shutdown()}))()}}function zv(t,e,r){return i={transport:r,serializer:e,promiseHandler:dd(t)},new Bv(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&&rv.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}},i.promiseHandler,{timeout:t.timeoutMillis}.timeout);var i}function Vv(t){return 48>t||t>57?97>t||t>102?t-55:t-87:t-48}function Wv(t){for(var e=new Uint8Array(t.length/2),r=0,i=0;t.length>i;i+=2){var n=Vv(t.charCodeAt(i)),s=Vv(t.charCodeAt(i+1));e[r++]=n<<4|s}return e}function Zv(t){var e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Gv(t){var e;return e=Zv(t),{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var Qv="undefined"!=typeof BigInt?function(t){return Zv(t).toString()}:function(t){return t[0]*gv+t[1]};function Jv(t){return t}function Kv(t){if(void 0!==t)return Wv(t)}var Yv={encodeHrTime:Gv,encodeSpanContext:Wv,encodeOptionalSpanContext:Kv};function Xv(t,e){return{key:t,value:tf(e)}}function tf(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(tf)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((t=>{var[e,r]=t;return Xv(e,r)}))}}:{}}function ef(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=>Xv(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:tf(t.body),eventName:t.eventName,attributes:(s=t.attributes,Object.keys(s).map((t=>Xv(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 rf=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class nf{static FromAttributeList(t,e){var r=new nf({},e);return r.De=of(t),r.Fe=t.filter((t=>{var[e,r]=t;return rf(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 rf(r)&&(this.Fe=!0),[e,r]})),this.De=of(this.De),this.je=function(t){if("string"==typeof t||void 0===t)return t;rv.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,rf(i)?yield i:i]}t.Fe=!1}}))()}get attributes(){if(this.asyncAttributesPending&&rv.error("Accessing resource attributes before async attributes settled"),this.He)return this.He;var t={};for(var[e,r]of this.De){var i;rf(r)?rv.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 rv.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 nf.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],o)}}function sf(t,e){return nf.FromAttributeList(Object.entries(t),e)}function of(t){return t.map((t=>{var[e,r]=t;return rf(r)?[e,r.catch((t=>{rv.debug("promise rejection for resource attribute: %s - %s",e,t)}))]:[e,r]}))}var af={serializeRequest(t){var e,r,i=(e=t,r=function(t){var e,r;if(void 0===t)return Yv;var i=null===(e=t.useLongBits)||void 0===e||e,n=null!==(r=t.useHex)&&void 0!==r&&r;return{encodeHrTime:i?Gv:Qv,encodeSpanContext:n?Jv:Wv,encodeOptionalSpanContext:n?Jv:Kv}}({useHex:!0,useLongBits:!1}),{resourceLogs:ef(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 uf{constructor(t){this.Oe=void 0,this.Oe=t}retry(t,e,r){return new Promise(((i,n)=>{setTimeout((()=>{this.Oe.send(t,e).then(i,n)}),r)}))}send(t,r){var i=this;return e((function*(){for(var e=Date.now()+r,n=yield i.Oe.send(t,r),s=5,o=1e3;"retryable"===n.status&&s>0;){var a;s--;var u=Math.max(Math.min(o,5e3)+(.4*Math.random()-.2),0);o*=1.5;var l=null!==(a=n.retryInMillis)&&void 0!==a?a:u,h=e-Date.now();if(l>h)return n;n=yield i.retry(t,h,l)}return n}))()}shutdown(){return this.Oe.shutdown()}}function lf(t){return new uf(t.transport)}function hf(t){return[429,502,503,504].includes(t)}function cf(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 df{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&&hf(s.status)?n({status:"retryable",retryInMillis:cf(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")}):(rv.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 vf{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}))?(rv.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class ff{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?hf(u.status)?{status:"retryable",retryInMillis:cf(u.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}:(rv.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 pf(t,e){return zv(t,e,lf({transport:(r=t,new df(r))}));var r}function gf(t,e){return zv(t,e,lf({transport:(r=t,new ff(r))}));var r}function mf(t,e){return zv(t,e,lf({transport:(r={url:t.url,headers:t.headers},new vf(r))}));var r}function yf(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 bf(t){return"function"==typeof t.headers?t.headers:function(t){if(null!=t)return e((function*(){return t}))}(t.headers)}function _f(t,i,n){return s={url:t.url,timeoutMillis:t.timeoutMillis,headers:bf(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:hd(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):rv.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),e}(yield h())),Object.assign(e,t)}))),url:null!==(u=null!==(l=yf(s.url))&&void 0!==l?l:o.url)&&void 0!==u?u:a.url});var s,o,a,u,l,h,c,d}function wf(t,e,r,i){return(t.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?gf:pf:mf)(_f(t,r,i),e)}class xf extends ud{constructor(t){void 0===t&&(t={}),super(wf(t,af,"v1/logs",{"Content-Type":"application/json"}))}}class Sf{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=bv(null!=i?i:c),this.hrTimeObserved=bv(null!=n?n:c),h){var d=nv.getSpanContext(h);d&&Zd(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?(rv.warn("Invalid attribute key: "+t),this):ov(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]=ov(e)?this.Je(e):e,this):(1===this.droppedAttributesCount&&rv.warn("Dropping extra attributes."),this)):(rv.warn("Invalid attribute value set for key: "+t),this)}setAttributes(t){for(var[e,r]of Object.entries(t))this.setAttribute(e,r);return this}setBody(t){return this.body=t,this}setEventName(t){return this.eventName=t,this}setSeverityNumber(t){return this.severityNumber=t,this}setSeverityText(t){return this.severityText=t,this}Xe(){this.Qe=!0}Je(t){var e=this.Ge.attributeValueLengthLimit;return e>0?"string"==typeof t?this.Ye(t,e):Array.isArray(t)?t.map((t=>"string"==typeof t?this.Ye(t,e):t)):t:(rv.warn("Attribute value limit must be positive, got "+e),t)}Ye(t,e){return t.length>e?t.substring(0,e):t}Ve(){return this.Qe&&rv.warn("Can not execute the operation on emitted log record"),this.Qe}}class kf{constructor(t,e){this.instrumentationScope=void 0,this.Ke=void 0,this.instrumentationScope=t,this.Ke=e}emit(t){var e=t.context||ev.active(),i=new Sf(this.Ke,this.instrumentationScope,r({context:e},t));this.Ke.activeProcessor.onEmit(i,e),i.Xe()}}class Cf{forceFlush(){return Promise.resolve()}onEmit(t,e){}shutdown(){return Promise.resolve()}}class Tf{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=>qv(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 If{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 Tf(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new Cf}}class Ef{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=Pv(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:sf({"service.name":"unknown_service",[cv]:fv[cv],[dv]:fv[dv],[vv]:fv[vv]});this.Ke=new If(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 Uv(this.tt,this)}getLogger(t,e,r){if(this.et.isCalled)return rv.warn("A shutdown LoggerProvider cannot provide a Logger"),Xc;t||rv.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 kf({name:i,version:e,schemaUrl:null==r?void 0:r.schemaUrl},this.Ke)),this.Ke.loggers.get(n)}forceFlush(){return this.et.isCalled?(rv.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.et.promise):this.Ke.activeProcessor.forceFlush()}shutdown(){return this.et.isCalled?(rv.warn("shutdown may only be called once per LoggerProvider"),this.et.promise):this.et.call()}tt(){return this.Ke.activeProcessor.shutdown()}}class Rf{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.ht=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 Uv(this.tt,this),this.nt>this.it&&(rv.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.dt(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()}))()}dt(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)=>{qv(this.Re(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,uv(t)}))};if(this.ct.length>=this.nt)return t();void 0===this.ht&&(this.ht=setTimeout((()=>t()),this.ot),"number"!=typeof this.ht&&this.ht.unref())}}bt(){void 0!==this.ht&&(clearTimeout(this.ht),this.ht=void 0)}Re(t){var e=()=>Hv.Re(this.rt,t).then((t=>{var e;t.code!==lv.SUCCESS&&uv(null!==(e=t.error)&&void 0!==e?e:new Error("BatchLogRecordProcessor: log record export failed (status "+t+")"))})).catch(uv),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,uv)}}class Mf extends Rf{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 Of=(t,e,r)=>r.remaining>0?e.length>r.remaining?(t.push(e.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(t.push(e),r.remaining-=e.length,!0):(r.truncated=!0,!1),Pf=(t,e,r)=>{var i=JSON.stringify(t);if(r.remaining>=i.length)return Of(e,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,s=Math.min(t.length,r.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>r.remaining?s=o-1:n=o}return Of(e,JSON.stringify(t.slice(0,n)),r)},Lf=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Af=function(t,e,r,i,n){if(void 0===n&&(n=!1),!Lf(t))return!n||Of(e,"null",r);if(yr(t)||(t=>{try{return _r(t)||xr(t)}catch(t){return!1}})(t))return Of(e,JSON.stringify(t),r);if("string"==typeof t)return Pf(t,e,r);if(!vr(t)&&!cr(t))return Of(e,JSON.stringify(t),r);if(i.has(t))return Pf("[Circular]",e,r);i.add(t);try{var s=t.toJSON;if(dr(s))return Af(s.call(t),e,r,i,n)}catch(t){}try{var o={}.toString.call(t);if("[object String]"===o)return Pf(String(t.valueOf()),e,r);if("[object Number]"===o||"[object Boolean]"===o)return Of(e,JSON.stringify(t.valueOf()),r)}catch(t){}if(t instanceof Error){var a={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(a[u]=t[u])}catch(t){}try{a.name=t.name}catch(t){}try{a.message=t.message}catch(t){}try{a.stack=t.stack}catch(t){}return Af(a,e,r,i,n)}if(cr(t)){if(!Of(e,"[",r))return!1;for(var l=0;t.length>l;l++){if(l>0&&!Of(e,",",r))return!1;var h=void 0;try{h=t[l]}catch(t){h=void 0}if(!Af(h,e,r,i,!0))return!1}return Of(e,"]",r)}if(!Of(e,"{",r))return!1;var c=!0;try{for(var d in t)if({}.hasOwnProperty.call(t,d)){if(0>=r.remaining)return r.truncated=!0,!1;var v=void 0;try{v=t[d]}catch(t){continue}if(Lf(v)){var f=(c?"":",")+JSON.stringify(d)+":";if(f.length>=r.remaining)return r.truncated=!0,!1;var p=e.length,g=r.remaining,m=r.truncated;if(!Of(e,f,r))return!1;var y=e.length,b=Af(v,e,r,i,!1),_=r.truncated;if(e.length!==y){if(c=!1,!b)return!1}else if(e.length=p,r.remaining=g,r.truncated=b?m:_,!b)return!1}}}catch(t){}return Of(e,"}",r)},Nf=function(t,e,r,i,n,s){if(void 0===e&&(e=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=1e4),void 0===s&&(s=new WeakSet),s.has(t))return r[e||"circular"]="[Circular]",r;s.add(t);try{for(var o in t)try{if(!{}.hasOwnProperty.call(t,o))continue;var a=t[o],u=e?e+"."+o:o;if(vr(a))Nf(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},Ff={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};An.__PosthogExtensions__=An.__PosthogExtensions__||{},An.__PosthogExtensions__.logs={initializeLogs(t){(t=>{var e,i={"service.name":(null==(e=t.config.logs)?void 0:e.serviceName)||"posthog-browser-logs",host:An.location.host};if(t.sessionManager){var{sessionId:n,windowId:s}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i=r({},i,{"session.id":n,"window.id":s})}ad.setGlobalLoggerProvider(new Ef({resource:sf(i),processors:[new Mf(new xf({url:t.config.api_host+"/i/v1/logs?token="+t.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(t);var e=ad.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;An.console[n]=(s=An.console[n],function(){for(var o=arguments.length,a=new Array(o),u=0;o>u;u++)a[u]=arguments[u];if(0!==a.length)if(t.is_capturing()){var{body:l,truncated:h}=((t,e)=>{for(var r=[],i={remaining:1e4,truncated:!1},n=0;t.length>n&&(0>=n||Of(r," ",i))&&Af(t[n],r,i,new WeakSet);n++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated}})(a),c=r({},i,h?{body_truncated:"true"}:{});e.emit({severityText:Ff[n],body:l,attributes:r({"log.source":"console."+n,distinct_id:t.get_distinct_id(),"location.href":An.location.href},c,vr(a[0])?Nf(a[0]):{})}),s.apply(An.console,a)}else s.apply(An.console,a)})};for(var a of["debug","log","warn","error","info"])o(a)}};var $f=jn("[Error tracking]");function Df(){return new Wi([new on,new gn,new un,new an,new fn,new vn,new hn,new pn],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=nn.test(u)?u.replace(nn,"$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>=sn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,sn).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||Zi});var i}))}(s)}}("web:javascript",Xi,rn))}var qf=jn("[ExceptionAutocapture]"),jf=Df(),Uf={wrapOnError(t){var e=kn;e||qf.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=jf.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=kn;e||qf.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(e){var i,n=jf.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||qf.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=jf.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}}};An.__PosthogExtensions__=An.__PosthogExtensions__||{},An.__PosthogExtensions__.errorWrappingFunctions=Uf,An.posthogErrorWrappingFunctions=Uf;var Hf="X-POSTHOG-SESSION-ID",Bf="X-POSTHOG-WINDOW-ID",zf="X-POSTHOG-DISTINCT-ID",Vf=[Hf,Bf,zf],Wf=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Zf=(t,e)=>({}.hasOwnProperty.call(t,e)),Gf=t=>"object"==typeof t&&!yr(t)||dr(t),Qf=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Jf=t=>{try{var e;return Qf(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==kn||null==(e=kn.location)?void 0:e.href).toString()}catch(t){return}},Kf=(t,e,r,i,n)=>{var s;try{s=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(cr(t)&&!t.includes(s))return!1;var o=!1;if(r){var{sessionId:a,windowId:u}=r.checkAndGetSessionAndWindowId(!0);n.set(Hf,a),n.set(Bf,u),o=!0}var l=(t=>dr(t)?t():t)(e);return l&&l!==Ks&&(n.set(zf,l),o=!0),o};An.__PosthogExtensions__=An.__PosthogExtensions__||{};var Yf={_patchFetch:(t,e,i)=>is(kn,"fetch",(n=>function(s,o){var a=arguments.length>1?[s,o]:[s],u=a;try{var l=Jf(s);if(l)if(Qf(s)){var h=new Request(s,o);Kf(t,e,i,h.url,h.headers),u=[h]}else{var c=new Headers(Gf(o)?o.headers:void 0);if(Kf(t,e,i,l,c)){var d=((t,e)=>{if(pr(t)||yr(t))return{headers:e};if(Gf(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(i);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),n}return new Proxy({headers:e},{get:(t,e)=>Zf(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>Zf(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),Wf.forEach((t=>{t in i&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var n=Reflect.getOwnPropertyDescriptor(t,e);if(n)return n;if("string"==typeof e&&Wf.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var s=Reflect.getOwnPropertyDescriptor(i,e);return s?r({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,c);d&&(u=[s,d])}}}catch(t){u=a}return n.apply(this,u)})),_patchXHR:(t,e,r)=>is(kn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,u){void 0===o&&(o=!0);var l=this,h=new Headers,c=Jf(s);c&&Kf(t,e,r,c,h);var d=i.call(l,n,s,o,a,u);return Vf.forEach((t=>{var e=h.get(t);if(e)try{l.setRequestHeader(t,e)}catch(t){}})),d}))};An.__PosthogExtensions__.tracingHeadersPatchFns=Yf,An.postHogTracingHeadersPatchFns=Yf;var Xf=-1,tp=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Xf=e.timeStamp,t(e))}),!0)},ep=(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))}},rp=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},ip=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},np=()=>{var t,e=ip();return null!==(t=null==e?void 0:e.activationStart)&&void 0!==t?t:0},sp=function(t,e){void 0===e&&(e=-1);var r=ip(),i="navigate";return 0>Xf?r&&(document.prerendering||np()>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}},op=new WeakMap;function ap(t,e){return op.get(t)||op.set(t,new e),op.get(t)}class up{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 lp,hp=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){}},cp=t=>{var e=!1;return()=>{e||(t(),e=!0)}},dp=-1,vp=new Set,fp=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,pp=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of vp)e();isFinite(dp)||(dp="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",pp,!0))}},gp=()=>{if(0>dp){var t,e=np(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0])?void 0:t.startTime;dp=null!=r?r:fp(),addEventListener("visibilitychange",pp,!0),addEventListener("prerenderingchange",pp,!0),tp((()=>{setTimeout((()=>{dp=fp()}))}))}return{get firstHiddenTime(){return dp},onHidden(t){vp.add(t)}}},mp=t=>{document.prerendering?addEventListener("prerenderingchange",(()=>t()),!0):t()},yp=[1800,3e3],bp=function(t,e){void 0===e&&(e={}),mp((()=>{var r,i=gp(),n=sp("FCP"),s=hp("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),i.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-np(),0),n.entries.push(e),r(!0)))}));s&&(r=ep(t,n,yp,e.reportAllChanges),tp((i=>{n=sp("FCP"),r=ep(t,n,yp,e.reportAllChanges),rp((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},_p=[.1,.25],wp=0,xp=1/0,Sp=0,kp=t=>{for(var e of t)e.interactionId&&(xp=Math.min(xp,e.interactionId),Sp=Math.max(Sp,e.interactionId),wp=Sp?(Sp-xp)/7+1:0)},Cp=()=>{var t;return lp?wp:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Tp=0;class Ip{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){Tp=Cp(),this.u.length=0,this.l.clear()}L(){var t=Math.min(this.u.length-1,Math.floor((Cp()-Tp)/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 Ep=t=>{var e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=cp(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e((()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})})))},Rp=[200,500];class Mp{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var Op=[2500,4e3],Pp={onLCP(t,e){void 0===e&&(e={}),mp((()=>{var r,i=gp(),n=sp("LCP"),s=ap(e,Mp),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-np(),0),n.entries=[o],r())},a=hp("largest-contentful-paint",o);if(a){r=ep(t,n,Op,e.reportAllChanges);var u=cp((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),l=t=>{t.isTrusted&&(Ep(u),removeEventListener(t.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});tp((i=>{n=sp("LCP"),r=ep(t,n,Op,e.reportAllChanges),rp((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var r=gp();bp(cp((()=>{var i,n=sp("CLS",0),s=ap(e,up),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=hp("layout-shift",o);a&&(i=ep(t,n,_p,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),tp((()=>{s.i=0,n=sp("CLS",0),i=ep(t,n,_p,e.reportAllChanges),rp((()=>i()))})),setTimeout(i))})))},onFCP:bp,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=gp();mp((()=>{var i;"interactionCount"in performance||lp||(lp=hp("event",kp,{type:"event",buffered:!0,durationThreshold:0}));var n,s=sp("INP"),o=ap(e,Ip),a=t=>{Ep((()=>{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=hp("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=ep(t,s,Rp,e.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(u.takeRecords()),n(!0)})),tp((()=>{o.v(),s=sp("INP"),n=ep(t,s,Rp,e.reportAllChanges)})))}))}}};An.__PosthogExtensions__=An.__PosthogExtensions__||{},An.__PosthogExtensions__.postHogWebVitalsCallbacks=Pp,An.postHogWebVitalsCallbacks=Pp,An.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Pp;class Lp{constructor(t){this.disabled=!1===t;var e=vr(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 Ap="$copy_autocapture",Np=jn("[AutoCapture]");function Fp(t,e){return e.length>t?e.slice(0,t)+"...":e}function $p(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!yo(e));return e}function Dp(t,e){var i,n,{e:s,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:u,elementsChainAsString:l}=e;if(!yo(t))return{props:{}};for(var h=[t],c=t;c.parentNode&&!bo(c,"body");)if(wo(c.parentNode))h.push(c.parentNode.host),c=c.parentNode.host;else{if(!yo(c.parentNode))break;h.push(c.parentNode),c=c.parentNode}var d,v,f=[],p={},g=!1,m=!1;if(Hn(h,(t=>{var e=jo(t);if(bo(t,"a")){var r=t.getAttribute("href");g=e&&!!r&&Go(r)&&r}sr(ko(t),"ph-no-capture")&&(m=!0),f.push(function(t,e,r,i){var n=t.tagName.toLowerCase(),s={tag_name:n};Eo.indexOf(n)>-1&&!r&&(s.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?Fp(1024,Qo(t)):Fp(1024,To(t)));var o=ko(t);o.length>0&&(s.classes=o.filter((function(t){return""!==t}))),Hn(t.attributes,(function(r){var n;if((!Uo(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&Go(r.value)&&(!gr(n=r.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=r.value;"class"===r.name&&(o=xo(o).join(" ")),s["attr__"+r.name]=Fp(1024,o)}}));for(var a=1,u=1,l=t;l=$p(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(!jo(t))return{};var e={};return Hn(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&&Go(i)&&(e[r]=i)}})),e}(t);Bn(p,i)})),m)return{props:{},explicitNoCapture:m};if(a||(f[0].$el_text=bo(t,"a")||bo(t,"button")?Qo(t):To(t)),g){var y,b;f[0].attr__href=g;var _=null==(y=Yn(g))?void 0:y.host,w=null==kn||null==(b=kn.location)?void 0:b.host;_&&w&&_!==w&&(d=g)}return{props:Bn({$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 zn(o).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[Ko(e.toString())]=Ko(r.toString())})),(n+=":")+zn(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:Yo(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return zn(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 qp={};function jp(t){return function(t,e){var r=qp[t];if(r)return r;var i,n=e[t];if(dr(i=n)&&-1!==i.toString().indexOf("[native code]")&&!kn.Zone)return qp[t]=n.bind(e);var s=e.document;if(s&&dr(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){qn.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return n&&dr(n)?qp[t]=n.bind(e):n}("MutationObserver",t)}function Up(t,e){return _r(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,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:o.__onCapture}}constructor(t,e){this.Tt=[],this.Ct=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:t}),this.Mt=t=>{var e=function(t){var e=Io(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);yr(e)||this._t(e)||this.Tt.push(e),this.Tt.length&&pr(this.Lt)&&(this.Lt=An.setTimeout((()=>{this.Rt()}),1e3))},this.Ot=()=>{var t=Date.now();t%50==0&&this.Tt.forEach((e=>{pr(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Et=()=>{this.Nt=Date.now()},this.At=()=>{"visible"===(null==In?void 0:In.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=jp(An);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,An.removeEventListener("click",this.Mt),An.removeEventListener("scroll",this.Ot,{capture:!0}),An.removeEventListener("selectionchange",this.Et),null==In||In.removeEventListener("visibilitychange",this.At)}Vt(t){this.Wt=Date.now()}Dt(){Jn(An,"click",this.Mt)}Ft(){Jn(An,"scroll",this.Ot,{capture:!0})}jt(){Jn(An,"selectionchange",this.Et)}Ht(){Jn(In,"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(mo(t.node))return!0;var r=this.Tt.some((e=>e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!r&&!bo(t.node,"html")&&yo(t.node)&&!function(t){if(!kn||Do(t))return!1;var{targetElementList:e}=qo(t,!1);return e.some((t=>bo(t,"a")))}(t.node)&&function(t,e){var r;if(!kn||Do(t))return!1;var i=xr(e)?Ao:null!==(r=null==e?void 0:e.css_selector_ignorelist)&&void 0!==r?r:Ao,{targetElementList:n}=qo(t,!1);return!Ro(n,i)}(t.node,{css_selector_ignorelist:this.qt.css_selector_ignorelist}))}Rt(){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=Up(e.scrollDelayMs,this.qt.scroll_threshold_ms),n=Up(e.selectionChangedDelayMs,this.qt.selection_change_threshold_ms),s=Up(e.mutationDelayMs,this.qt.mutation_threshold_ms),o=Up(e.absoluteDelayMs,1.1*this.qt.mutation_threshold_ms),a=_r(e.scrollDelayMs)&&this.qt.scroll_threshold_ms>e.scrollDelayMs,u=_r(e.mutationDelayMs)&&this.qt.mutation_threshold_ms>e.mutationDelayMs,l=_r(e.selectionChangedDelayMs)&&this.qt.selection_change_threshold_ms>e.selectionChangedDelayMs,h=_r(e.visibilityChangedDelayMs)&&this.qt.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(a||u||l||h)){var c=Up(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&&pr(this.Lt)&&(this.Lt=An.setTimeout((()=>{this.Rt()}),1e3))}}It(t,e){this.instance.capture("$dead_click",r({},e,Dp(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)})}}An.__PosthogExtensions__=An.__PosthogExtensions__||{},An.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Hp(t,e);var Bp=jn("[ExternalScriptsLoader]"),zp=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return Bp.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==In?void 0:In.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(!In)return r("document not found");var i=In.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)In.head.appendChild(i);else{var n,s=In.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):In.body.appendChild(i)}};null!=In&&In.body?a():null==In||In.addEventListener("DOMContentLoaded",a)};An.__PosthogExtensions__=An.__PosthogExtensions__||{},An.__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)}zp(t,i,r)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");zp(t,o,r)}},An.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);zp(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===io||this.isRejected()||-1===this.consent&&this.qt.cookieless_mode===ro}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 Er(t)?1:sr(Rr,t)?0:-1}get nr(){var t=this.qt.opt_out_capturing_persistence_type,e="localStorage"===t?dh:hh;if(!this.ar||this.ar!==e){this.ar=e;var r="localStorage"===t?hh:dh;r.A(this.sr)&&(this.ar.A(this.sr)||this.optInOut(Er(r.A(this.sr))),r.q(this.sr,this.qt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.qt.respect_dnt&&[null==Tn?void 0:Tn.doNotTrack,null==Tn?void 0:Tn.msDoNotTrack,An.doNotTrack].some((t=>Er(t)))}}var Wp=jn("[Dead Clicks]"),Zp=()=>!0,Gp=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(ps)),i=t.instance.config.capture_dead_clicks;return xr(i)?i:!!vr(i)||r};class Qp{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({[ps]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.lr((()=>{this.hr()})):this.stop()}lr(t){var e,r;null!=(e=An.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=An.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Wp.error("failed to load script",e):t()}))}hr(){var t;if(In){if(!this.ur&&null!=(t=An.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=vr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.ur=An.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.ur.start(In),Wp.info("starting...")}}else Wp.error("`document` not found. Cannot start.")}stop(){this.ur&&(this.ur.stop(),this.ur=void 0,Wp.info("stopping..."))}}var Jp=jn("[SegmentIntegration]");var Kp="posthog-js";function Yp(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 Xp{constructor(t,e,r,i,n,s){this.name=Kp,this.setupOnce=function(o){o(Yp(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class tg{constructor(t){this.cr=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(qn.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==kn?void 0:kn.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(!(pr(s)||pr(o)||pr(a)||pr(u)||pr(l)||pr(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?Mr(o/s,0,1,qn):1,d=s>1?Mr(a/s,0,1,qn):1,v=u>1?Mr(l/u,0,1,qn):1,f=u>1?Mr(h/u,0,1,qn):1;i=Bn(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 eg=["flags","surveys"],rg={[ss]:{exposure:"hidden"},[as]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[us]:{exposure:"hidden"},[ls]:{exposure:"event"},[hs]:{exposure:"hidden"},[cs]:{exposure:"event"},[ds]:{exposure:"hidden"},[vs]:{exposure:"event"},[fs]:{exposure:"event"},[ps]:{exposure:"event"},[gs]:{exposure:"hidden"},[ms]:{exposure:"event"},[ys]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Ss]:{exposure:"hidden"},[ks]:{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"},[Cs]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!vr(t))return{};for(var e={},r=Object.keys(t),i=0;r.length>i;i++)e["$feature/"+r[i]]=t[r[i]];return e}},[Ts]:{exposure:"event",storageGroup:"flags"},[Is]:{exposure:"hidden"},[Es]:{exposure:"hidden",storageGroup:"flags"},[Rs]:{exposure:"event",storageGroup:"flags"},[Ms]:{exposure:"event",storageGroup:"flags"},[Os]:{exposure:"event"},[Ps]:{exposure:"hidden"},[Ls]:{exposure:"hidden"},[As]:{exposure:"hidden"},[Ns]:{exposure:"hidden",storageGroup:"surveys"},[Fs]:{exposure:"hidden",storageGroup:"surveys"},[$s]:{exposure:"event"},[Ds]:{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"},[qs]:{exposure:"hidden"},[js]:{exposure:"hidden"},[Us]:{exposure:"hidden"},[Hs]:{exposure:"hidden",storageGroup:"flags"},[Bs]:{exposure:"hidden"},[zs]:{exposure:"hidden"},[Vs]:{exposure:"hidden"},[Ws]:{exposure:"hidden"},[Zs]:{exposure:"hidden"},[Gs]:{exposure:"hidden"},[Qs]:{exposure:"hidden"},[bs]:{exposure:"event"},[_s]:{exposure:"event"},[ws]:{exposure:"event"},[xs]:{exposure:"event"},[Ys]:{exposure:"event"},[Xs]:{exposure:"event"},[to]:{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"}},ig=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ng=t=>{var e=rg[t];if(e)return e;for(var[r,i]of ig)if(0===t.indexOf(r))return i},sg={flags:Hs,surveys:Fs},og=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],ag="main";class ug{constructor(t,e,i){if(void 0===i&&(i=!0),this.mr={},this.yr=!1,this.br=!1,this.qt=t,this._r=i,this.props={},this.wr=!1,this.Sr=(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.kr(t),this.br=this.Cr(t),this.load(),t.debug&&qn.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save(),kn){var n=()=>this.flush();Jn(kn,"beforeunload",n,{capture:!1}),Jn(kn,"pagehide",n,{capture:!1})}}Ir(){var t,e=null==(t=this.qt)?void 0:t.persistence_save_debounce_ms;return _r(e)&&e>0?e:0}isDisabled(){return!!this.Tr}kr(t){-1===og.indexOf(t.persistence.toLowerCase())&&(qn.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,i=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var i=[...vh,...t];return r({},dh,{F(t){try{var r={};try{r=hh.F(t)||{}}catch(t){}var i,n=JSON.parse(dh.A(t)||"{}");if(e){var s={};for(var o in r){var a=r[o];yr(a)||""===a||(s[o]=a)}i=Bn(n,s)}else i=Bn(r,n);return dh.N(t,i),i}catch(t){}return null},N(t,e,r,n,s,o){var a=dh.N(t,e,void 0,void 0,o);try{var u={};i.forEach((t=>{e[t]&&(u[t]=e[t])})),Object.keys(u).length&&hh.N(t,u,r,n,s,o)}catch(t){dh.D(t)}return a},q(t,e){try{null==kn||kn.localStorage.removeItem(t),hh.q(t,e)}catch(t){dh.D(t)}}})}(t.cookie_persisted_properties||[],t.__preview_cookie_wins_on_conflict||!1),n=!1,s=t.persistence.toLowerCase();return"localstorage"===s&&dh.O()?(e=dh,n=!0):"localstorage+cookie"===s&&i.O()?(e=i,n=!0):"sessionstorage"===s&&mh.O()?e=mh:"memory"===s?e=ph:"cookie"===s?e=hh:i.O()?(e=i,n=!0):e=hh,this.yr=n,e}Er(t){return this.Sr+"__"+t}Cr(t){return this.yr&&!!t.split_storage}Mr(t){var e=null!=t?t:this.qt.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var r=this.props[Hs];return!r||"number"!=typeof r||Date.now()-r>e}properties(){var t={};return Hn(this.props,((e,r)=>{var i=ng(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,r===Cs?()=>this.Mr():()=>!1))return;i.transformToEventProperties&&Bn(t,i.transformToEventProperties(e))}else i&&"event"!==i.exposure||(t[r]=e)})),t}load(){if(!this.Tr){var t=this.nr.F(this.Sr);t&&(this.props=Bn({},t)),this.br&&this.Rr()}}Rr(){for(var t of eg){var e=dh.F(this.Er(t));if(e&&!fr(e)){var r=this.Pr(t);r.persisted=!0,this.Or(t)||(r.fingerprint=this.Lr(e,t)),this.Ar(t,e)||Bn(this.props,e)}}}Or(t){return Object.keys(this.props).some((e=>{var r;return(null==(r=ng(e))?void 0:r.storageGroup)===t}))}Ar(t,e){var r=sg[t];if(!r)return!1;var i=e[r],n=this.props[r];return _r(i)&&_r(n)&&n>i}refreshKey(t){var e;if(!this.Tr){var r=this.br?null==(e=ng(t))?void 0:e.storageGroup:void 0,i=r?dh.F(this.Er(r)):this.nr.F(this.Sr);if(i&&t in i)this.Fr(t,i[t]);else{if(r){var n=this.nr.F(this.Sr);if(n&&t in n)return void this.Fr(t,n[t])}this.Nr(t)}}}save(){if(!this.Tr){var t=this.Ir();t>0?pr(this.Dr)&&(this.Dr=setTimeout((()=>{this.Dr=void 0,this.$r()}),t)):this.$r()}}flush(){pr(this.Dr)||(clearTimeout(this.Dr),this.Dr=void 0,this.$r())}$r(){this.Tr||(this.br?this.qr():this.jr(this.nr,this.Sr,this.props,ag))}qr(){var{main:t,groups:e}=this.Hr();for(var r of(this.jr(this.nr,this.Sr,t,ag),eg)){var i,n=e[r];(!fr(n)||null!=(i=this.mr[r])&&i.persisted)&&this.jr(dh,this.Er(r),n,r)}}Hr(){var t={},e={};for(var r of eg)e[r]={};return Hn(this.props,((r,i)=>{var n,s=null==(n=ng(i))?void 0:n.storageGroup;s?e[s][i]=r:t[i]=r})),{main:t,groups:e}}Lr(t,e){var r=JSON.stringify(t);return e===ag?r+"|"+this.Ur+"|"+this.Br+"|"+this.zr:r}jr(t,e,r,i){var n=this.Pr(i);if(i===ag||n.dirty||pr(n.fingerprint)){var s;try{if((s=this.Lr(r,i))===n.fingerprint)return void(n.dirty=!1)}catch(t){s=void 0}t.N(e,r,this.Ur,this.Br,this.zr,this.qt.debug)?(n.dirty=!1,i!==ag&&(n.persisted=!0),pr(s)||(n.fingerprint=s)):this.qt.debug&&qn.warn('failed to persist storage entry "'+e+'"; will retry on next save')}}remove(t){var{keepGroupEntries:e=!1}=void 0===t?{}:t;if(pr(this.Dr)||(clearTimeout(this.Dr),this.Dr=void 0),this.nr.q(this.Sr,!1),this.nr.q(this.Sr,!0),!e&&this._r)for(var r of eg)dh.q(this.Er(r));e?delete this.mr[ag]:this.mr={}}clear(){this.remove(),this.props={}}register_once(t,e,r){if(vr(t)){pr(e)&&(e="None"),this.Ur=pr(r)?this.Vr:r;var i=!1;if(Hn(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.Fr(r,t),i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(vr(t)){this.Ur=pr(e)?this.Vr:e;var r=!1;if(Hn(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.Fr(i,e),r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Nr(t),this.save())}update_campaign_params(){if(!this.wr){var t=Ic(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);fr(Zn(t))||this.register(t),this.wr=!0}}update_search_keyword(){var t;this.register((t=null==In?void 0:In.referrer)?Rc(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Pc(),$referring_domain:null!=In&&In.referrer&&(null==(t=Yn(In.referrer))?void 0:t.host)||Oc},void 0)}set_initial_person_info(){this.props[Ws]||this.props[Zs]||this.register_once({[Gs]:Lc(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Hn([Zs,Ws],(e=>{var r=this.props[e];r&&Hn(r,(function(e,r){t["$initial_"+ar(r)]=e}))}));var e,r,i=this.props[Gs];if(i){var n=(e=Ac(i),r={},Hn(e,(function(t,e){r["$initial_"+ar(e)]=t})),r);Bn(t,n)}return t}safe_merge(t){return Hn(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){this.Vr=this.Ur=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie);var i=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||[]),n=i?this.kr(t):this.nr,s=this.Cr(t);if(i||s!==this.br){var o=this.props;this.clear(),this.nr=n,this.br=s,this.props=o,this.save()}}set_disabled(t){this.Tr=t,this.Tr?this.remove():this.save()}set_cross_subdomain(t){t!==this.Br&&(this.Br=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.zr&&(this.zr=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var r=this.props[us]||{};r[t]=e,this.Fr(us,r),this.save()}remove_event_timer(t){var e=this.props[us]||{},r=e[t];return pr(r)||(delete e[t],this.Fr(us,e),this.save()),r}get_property(t){return this.props[t]}set_property(t,e){this.Fr(t,e),this.save()}Fr(t,e){this.props[t]=e,this.Wr(t)}Nr(t){delete this.props[t],this.Wr(t)}Wr(t){var e,r=null==(e=ng(t))?void 0:e.storageGroup;r&&(this.Pr(r).dirty=!0)}Pr(t){return this.mr[t]||(this.mr[t]={})}}var lg={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},hg={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"},cg={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"},dg=jn("[RateLimiter]");class vg{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=>{dg.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void dg.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(Vs))&&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(Vs,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var fg=jn("[RemoteConfig]");class pg{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=An._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Zr(t){var e,r;null!=(e=An.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=An.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Gr(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 fg.info("Using preloaded remote config",this.remoteConfig),this.Qr(this.remoteConfig),void this.Jr();if(this._instance.Kr())return void fg.warn("Remote config is disabled. Falling back to local config.");this.Zr((t=>{if(!t)return fg.info("No config found after loading remote JS config. Falling back to JSON."),void this.Gr((t=>{this.Qr(t),this.Jr()}));this.Qr(t),this.Jr()}))}catch(t){fg.error("Error loading remote config",t)}}stop(){this.Yr&&(clearInterval(this.Yr),this.Yr=void 0)}refresh(){!this._instance.Kr()&&In&&"hidden"!==In.visibilityState&&this._instance.reloadFeatureFlags()}Jr(){var t;if(!this.Yr){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.Yr=setInterval((()=>{this.refresh()}),e))}}Qr(t){var e;t||fg.error("Failed to fetch remote config from PostHog."),this._instance.Qr(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 gg=3e3;class mg{constructor(t,e){this.Xr=!0,this.ei=[],this.ti=Mr((null==e?void 0:e.flush_interval_ms)||gg,250,5e3,qn.createLogger("flush interval"),gg),this.ri=t}enqueue(t){this.ei.push(t),this.ii||this.ni()}unload(){this.si();var t=this.ei.length>0?this.oi():{},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.ri(r({},t,{transport:"sendBeacon"}))}))}enable(){this.Xr=!1,this.ni()}ni(){var t=this;this.Xr||(this.ii=setTimeout((()=>{if(this.si(),this.ei.length>0){var e=this.oi(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&cr(r.data)&&Hn(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.ri(r)};for(var i in e)r()}}),this.ti))}si(){clearTimeout(this.ii),this.ii=void 0}oi(){var t={};return Hn(this.ei,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;pr(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.ei=[],t}}var yg=["retriesPerformedSoFar"];class bg{constructor(t){this.ai=!1,this.ui=3e3,this.ei=[],this._instance=t,this.ei=[],this.li=!0,!pr(kn)&&"onLine"in kn.navigator&&(this.li=kn.navigator.onLine,this.hi=()=>{this.li=!0,this.ci()},this.di=()=>{this.li=!1},Jn(kn,"online",this.hi),Jn(kn,"offline",this.di))}get length(){return this.ei.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,yg);wr(e)&&(n.url=Jl(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.vi(r({retriesPerformedSoFar:e},n))}}))}vi(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.ei.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),qn.warn(n),this.ai||(this.ai=!0,this.fi())}fi(){if(this.pi&&clearTimeout(this.pi),0===this.ei.length)return this.ai=!1,void(this.pi=void 0);this.pi=setTimeout((()=>{this.li&&this.ei.length>0&&this.ci(),this.fi()}),this.ui)}ci(){var t=Date.now(),e=[],r=this.ei.filter((r=>t>r.retryAt||(e.push(r),!1)));if(this.ei=e,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.pi&&(clearTimeout(this.pi),this.pi=void 0),this.ai=!1,pr(kn)||(this.hi&&(kn.removeEventListener("online",this.hi),this.hi=void 0),this.di&&(kn.removeEventListener("offline",this.di),this.di=void 0)),this.ei))try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(t){qn.error(t)}this.ei=[]}}class _g{constructor(t){this.gi=()=>{var t,e,r,i;this.mi||(this.mi={});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.mi.lastScrollY=Math.ceil(s),this.mi.maxScrollY=Math.max(s,null!==(t=this.mi.maxScrollY)&&void 0!==t?t:0),this.mi.maxScrollHeight=Math.max(o,null!==(e=this.mi.maxScrollHeight)&&void 0!==e?e:0),this.mi.lastContentY=a,this.mi.maxContentY=Math.max(a,null!==(r=this.mi.maxContentY)&&void 0!==r?r:0),this.mi.maxContentHeight=Math.max(u,null!==(i=this.mi.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}get yi(){return this._instance.config.scroll_root_selector}getContext(){return this.mi}resetContext(){var t=this.mi;return setTimeout(this.gi,0),t}startMeasuringScrollPosition(){Jn(kn,"scroll",this.gi,{capture:!0}),Jn(kn,"scrollend",this.gi,{capture:!0}),Jn(kn,"resize",this.gi)}scrollElement(){if(!this.yi)return null==kn?void 0:kn.document.documentElement;var t=cr(this.yi)?this.yi:[this.yi];for(var e of t){var r=null==kn?void 0:kn.document.querySelector(e);if(r)return r}}bi(t){var e="y"===t?"scrollTop":"scrollLeft";if(this.yi){var r=this.scrollElement();return r&&r[e]||0}return kn?"y"===t?kn.scrollY||kn.pageYOffset||kn.document.documentElement.scrollTop||0:kn.scrollX||kn.pageXOffset||kn.document.documentElement.scrollLeft||0:0}scrollY(){return this.bi("y")}scrollX(){return this.bi("x")}}var wg=t=>Lc(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class xg{constructor(t,e,r,i){this.wi=t=>{var e=this.xi();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.Si(this._instance)};this.ki.register({[zs]:r})}},this._instance=t,this.Ci=e,this.ki=r,this.Si=i||wg,this.Ci.onSessionId(this.wi)}xi(){return this.ki.props[zs]}getSetOnceProps(){var t,e=null==(t=this.xi())?void 0:t.props;return e?"r"in e?Ac(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 Hn(Zn(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+ar(r)]=e})),t}}class Sg{constructor(){this.Ii={}}on(t,e){return this.Ii[t]||(this.Ii[t]=[]),this.Ii[t].push(e),()=>{this.Ii[t]=this.Ii[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.Ii[t]||[])r(e);for(var i of this.Ii["*"]||[])i(t,e)}}var kg=jn("[SessionId]");class Cg{on(t,e){return this.Ti.on(t,e)}constructor(t,e,r){var i;if(this.Ei=null,this.Mi=[],this.Ri=void 0,this.Ti=new Sg,this.Pi=(t,e)=>!(!wr(t)||!wr(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===io)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qt=t.config,this.ki=t.persistence,this.Oi=void 0,this.Li=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ai=e||hl,this.Fi=r||hl;var n=this.qt.persistence_name||this.qt.token;if(this._sessionTimeoutMs=1e3*Mr(this.qt.session_idle_timeout_seconds||1800,60,36e3,kg.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ni(),this.Di="ph_"+n+"_window_id",this.$i="ph_"+n+"_primary_window_exists",this.qi()){var s=mh.F(this.Di),o=mh.F(this.$i);s&&!o?this.Oi=s:mh.q(this.Di),mh.N(this.$i,!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.ji(this.qt.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){kg.error("Invalid sessionID in bootstrap",t)}this.Hi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return pr(this.Mi)&&(this.Mi=[]),this.Mi.push(t),this.Li&&t(this.Li,this.Oi),()=>{this.Mi=this.Mi.filter((e=>e!==t))}}qi(){return"memory"!==this.qt.persistence&&!this.ki.Tr&&mh.O()}Ui(t){t!==this.Oi&&(this.Oi=t,this.qi()&&mh.N(this.Di,t))}Bi(){return this.Oi?this.Oi:this.qi()?mh.F(this.Di):null}zi(t){var e=this.Ei;return!yr(e)&&!yr(t)&&5e3>Math.abs(t-e)}ji(t,e,r){var i=e!==this._sessionActivityTimestamp,n=!(t!==this.Li||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.Li=t,n&&!i||n&&this.zi(e)||(this.Ei=e,this.ki.register({[Ss]:[e,t,r]}))}Vi(){var t,e=null==(t=this.qt)?void 0:t.persistence_save_debounce_ms;return wr(e)&&e>0}Wi(){var t;if(!yr(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Ei){this.Vi()?this.ki.refreshKey(Ss):(this.ki.flush(),this.ki.load());var[,e,r]=this.Zi();e===this.Li&&r===this._sessionStartTimestamp&&(this.Ei=this._sessionActivityTimestamp,this.ki.register({[Ss]:[this._sessionActivityTimestamp,null!==(t=this.Li)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.ki.flush())}}Gi(){var[t]=this.Zi(),e=wr(t)?t:0,r=wr(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,r)}Zi(){var t=this.ki.props[Ss];return cr(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Ei=null,clearTimeout(this.Qi),this.Qi=void 0,this.ji(null,null,null)}destroy(){this.Wi(),clearTimeout(this.Qi),this.Qi=void 0,this.Ri&&kn&&(kn.removeEventListener(uo,this.Ri,{capture:!1}),this.Ri=void 0),this.Mi=[]}Hi(){this.Ri=()=>{this.Wi(),this.qi()&&mh.q(this.$i)},Jn(kn,uo,this.Ri,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.qt.cookieless_mode===io)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),[,i,n]=this.Zi(),s=this.Gi(),o=this.Bi(),a=wr(n)&&Math.abs(r-n)>864e5,u=!1,l=!i,h=!l&&!t&&this.Pi(r,s);l||h||a?(i=this.Ai(),o=this.Fi(),kg.info("new session ID generated",{sessionId:i,windowId:o,changeReason:{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}}),n=r,u=!0):o||(o=this.Fi(),u=!0);var c=wr(s)&&t&&!a?s:r,d=wr(n)?n:(new Date).getTime();return this.Ui(o),this.ji(i,c,d),t||this.Ni(),u&&this.Mi.forEach((t=>t(i,o,u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:i,windowId:o,sessionStartTimestamp:d,changeReason:u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:s}}Ni(){clearTimeout(this.Qi),this.Qi=setTimeout((()=>{var t=this.Gi();if(this.Pi((new Date).getTime(),t)){var e=this.Li;this.resetSessionId(),this.Ti.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var Tg=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&nr(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>nr(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},Ig="custom",Eg="i.posthog.com",Rg=/^\/static\//;class Mg{constructor(t){this.Ji={},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("."+Eg,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Ji[this.apiHost]||(this.Ji[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Ig),this.Ji[this.apiHost]}Ki(t){var e=this.instance.config.__preview_external_dependency_versioned_paths;if("string"==typeof e&&Rg.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.Ki(e);if(r)return""+r+e}if(this.region===Ig)return this.apiHost+e;var i=Eg+e;switch(t){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var Og=jn("[PostHog ExternalIntegrations]"),Pg={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Lg{constructor(t){this._instance=t}lr(t,e){var r;null==(r=An.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return Og.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,s;!i||null!=(r=An.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.lr(Pg[e],(()=>{var r;null==(r=An.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=An.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e]&&(null==(s=An.__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 Ag,Ng={},Fg=0,$g=()=>{},Dg='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',qg="Surveys module not available",jg="sanitize_properties is deprecated. Use before_send instead",Ug="Invalid value for property_denylist config: ",Hg="posthog",Bg=!Wl&&-1===(null==Ln?void 0:Ln.indexOf("MSIE"))&&-1===(null==Ln?void 0:Ln.indexOf("Mozilla")),zg=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:Qn(null==In?void 0:In.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:$g,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,__preview_cookie_wins_on_conflict:!1,debug:En&&gr(null==En?void 0:En.search)&&-1!==En.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==kn||null==(e=kn.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){qn.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:oo,before_send:void 0,request_queue_config:{flush_interval_ms:gg},error_tracking:{},_onCapture:$g,__preview_eager_load_replay:!1},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Po,ignore_text_selection:!0}:!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,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t)}))(t))},Vg=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],Wg=t=>{var e={};for(var[r,i]of Vg)pr(t[r])||(e[i]=t[r]);var n=Bn({},e,t);return cr(t.property_blacklist)&&(pr(t.property_denylist)?n.property_denylist=t.property_blacklist:cr(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:qn.error(Ug+t.property_denylist)),n};class Zg{constructor(){this.__forceAllowLocalhost=!1}get Yi(){return this.__forceAllowLocalhost}set Yi(t){qn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Gg{Xi(t,e){if(t){var r=this.en.indexOf(t);-1!==r&&this.en.splice(r,1)}return this.en.push(e),null==e.initialize||e.initialize(),e}tn(){return this.config.cookieless_mode===io||this.config.cookieless_mode===ro&&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 Zg,this.rn=!1,this.version=$n.LIB_VERSION,this.nn=new Sg,this.en=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=zg(),this.SentryIntegration=Xp,this.sentryIntegration=t=>function(t,e){var r=Yp(t,e);return{name:Kp,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.sn=!1,this.an=null,this.un=null,this.ln=null,this.scrollManager=new _g(this),this.pageViewManager=new tg(this),this.rateLimiter=new vg(this),this.requestRouter=new Mg(this),this.consent=new Vp(this),this.externalIntegrations=new Lg(this);var e=null!==(t=Gg.__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=gr(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=gr(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>qn.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==Hg){var i,n=null!==(i=Ng[r])&&void 0!==i?i:new Gg;return n._init(t,e,r),Ng[r]=n,Ng[Hg][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n,s;void 0===e&&(e={});var o=gr(t)?t.trim():"";if(!o)return qn.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.hn(e.debug),this.cn=e,this.dn=[],e.person_profiles?this.un=e.person_profiles:e.process_person&&(this.un=e.process_person);var a=zg(e.defaults),u=Wg(e),l=Bn({},a,u,{name:i,token:o});vr(a.rageclick)&&vr(u.rageclick)&&(l.rageclick=Bn({},a.rageclick,u.rageclick)),this.set_config(l),this.config.on_xhr_error&&qn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:vl.GZipJS;var h=this.vn();this.persistence=new ug(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ug(r({},this.config,{persistence:"sessionStorage"}),h,!1);var c=r({},this.persistence.props),d=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.fn=new mg((t=>this.pn(t)),this.config.request_queue_config),this.gn=new bg(this),this.__request_queue=[];var v=this.tn();if(v||(this.sessionManager=new Cg(this),this.sessionPropsManager=new xg(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(qn.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.mn(v)}),0)):(qn.info("Initializing extensions synchronously"),this.mn(v)),$n.DEBUG=$n.DEBUG||this.config.debug,$n.DEBUG&&qn.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:c,s:d}),!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 f=e.bootstrap.distinctID,p=this.get_distinct_id(),g=this.persistence.get_property(Bs);if(e.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===no)this.identify(f);else if(e.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===so)qn.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 m=this.config.get_device_id(hl()),y=e.bootstrap.isIdentifiedID?m:f;this.persistence.set_property(Bs,e.bootstrap.isIdentifiedID?so:no),this.register({distinct_id:f,$device_id:y})}}if(v)this.register_once({distinct_id:Ks,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(hl());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(Bs,no)}return Jn(kn,"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()||hl();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(Bs,so)),e()},n=r.user();"then"in n&&dr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||Jp.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()||(Jp.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Jp.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,lo),identify:t=>e(t,co),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.yn())):this.yn(),dr(this.config._onCapture)&&this.config._onCapture!==$g&&(qn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&qn.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}mn(t){var e,i,n,s,o,a,u,l=performance.now(),h=r({},Gg.__defaultExtensionClasses,this.config.__extensionClasses),c=[];h.featureFlags&&this.en.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new h.featureFlags(this)),h.exceptions&&this.en.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new h.exceptions(this)),h.historyAutocapture&&this.en.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.en.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this.en.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!t&&this.en.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||c.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),h.autocapture&&this.en.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.en.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new h.surveys(this)),h.logs&&this.en.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new h.logs(this)),h.conversations&&this.en.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new h.conversations(this)),h.productTours&&this.en.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.en.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.en.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.en.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.en.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,Gp)),h.toolbar&&this.en.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new h.toolbar(this)),h.experiments&&this.en.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new h.experiments(this)),this.en.forEach((t=>{t.initialize&&c.push((()=>{null==t.initialize||t.initialize()}))})),c.push((()=>{if(this.bn){var t=this.bn;this.bn=void 0,this.Qr(t)}})),this._n(c,l)}_n(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this._n(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){qn.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({[Ys]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Xs]:i}),this.config.__preview_deferred_init_extensions&&qn.info("PostHog extensions initialized ("+i+"ms)")}Qr(t){var e;if(!In||!In.body)return qn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Qr(t)}),500);this.config.__preview_deferred_init_extensions&&(this.bn=t),this.wn=t,this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=sr(t.supportedCompression,vl.GZipJS)?vl.GZipJS:sr(t.supportedCompression,vl.Base64)?vl.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.un?this.un:oo}),this.en.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}yn(){try{this.config.loaded(this)}catch(t){qn.critical("`loaded` function failed",t)}if(this.xn(),this.config.internal_or_test_user_hostname&&null!=En&&En.hostname){var t=En.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.tn())&&this.Sn()}),1),this.kn=new pg(this),this.kn.load()}xn(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.fn)||t.enable())}_dom_loaded(){this.is_capturing()&&Un(this.__request_queue,(t=>this.pn(t))),this.__request_queue=[],this.xn()}_handle_unload(){var t,e,r,i;null==(t=this.surveys)||t.handlePageUnload(),this.config.request_batching?(this.Cn()&&this.capture(ho),null==(e=this.logs)||e.flushLogs("sendBeacon"),null==(r=this.fn)||r.unload(),null==(i=this.gn)||i.unload()):this.Cn()&&this.capture(ho,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(Bg?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Jl(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=eh(s.url,s.compression);var o=null!==(e=s.transport)&&void 0!==e?e:"fetch",a=rh.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===vl.GZipJS&&Pn&&!Gl?th(s).then((t=>{u(t)})).catch((e=>{if(Xe(e))return Gl=!0,void u(r({},s,{compression:void 0,url:eh(t.url,void 0)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Xe(t)||e===Ke})(e)&&(Gl=!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)}}))))}pn(t){this.gn?this.gn.retriableRequest(t):this._send_request(t)}_execute_array(t){Fg++;try{var e,r=[],i=[],n=[];Un(t,(t=>{if(t)if(cr(e=t[0]))n.push(t);else if(dr(t))try{t.call(this)}catch(e){qn.error("Error executing queued PostHog call",t,e)}else cr(t)&&"alias"===e?r.push(t):cr(t)&&-1!==e.indexOf("capture")&&dr(this[e])?n.push(t):i.push(t)}));var s=function(t,e){Un(t,(function(t){try{if(cr(t[0])){var r=e;Hn(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){qn.error("Error executing queued PostHog call",t,e)}}))};s(r,this),s(i,this),s(n,this)}finally{Fg--}}push(t){if(Fg>0&&cr(t)&&gr(t[0])){var e=Gg.prototype[t[0]];dr(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.fn){if(this.is_capturing())if(!pr(t)&&gr(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&&!gr(null==e?void 0:e.$current_url)&&(qn.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.In||qn.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)||hl(),f={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===lo&&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!==vo,t===co);if(p&&(f.$set_once=p),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=f,a=t=>gr(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),cr(e)?(i=[],Un(e,(e=>{i.push(t(e))}))):(i={},Hn(e,((e,r)=>{u.has(e)||(i[r]=t(e,r))}))),i);var i}(o)),f.timestamp=d,pr(null==i?void 0:i.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=c),t===$u.DISMISSED||t===$u.SENT){var g=null==e?void 0:e[Du.SURVEY_ID],m=null==e?void 0:e[Du.SURVEY_ITERATION];rl({id:g,current_iteration:m}),f.$set=r({},f.$set,{[Bu({id:g,current_iteration:m},t===$u.SENT?"responded":"dismissed")]:!0})}else t===$u.SHOWN&&(f.$set=r({},f.$set,{[Du.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===hg.SHOWN){var y=null==e?void 0:e[cg.TOUR_TYPE];y&&(f.$set=r({},f.$set,{[cg.TOUR_LAST_SEEN_DATE+"/"+y]:(new Date).toISOString()}))}var b=r({},f.properties.$set,f.$set);if(fr(b)||this.setPersonPropertiesForFlags(b),!br(this.config.before_send)){var _=this.En(f);if(!_)return;f=_}this.nn.emit("eventCaptured",f);var w={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:f,compression:"best-available",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.pn(w):this.fn.enqueue(w),f}qn.critical("This capture call is ignored due to client rate limiting.")}}else qn.error("No event name provided to posthog.capture")}else qn.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.tn()&&(a.$cookieless_mode=!0),"$snapshot"===t){var u=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!gr(a.distinct_id)&&!_r(a.distinct_id)||mr(a.distinct_id))&&qn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,h=function(t,e,r){var i,n,s,o;if(!Ln)return{};var a,u,l=t?[...Sc,...e||[]]:[],[h,c]=function(t){for(var e=0;$i.length>e;e++){var[r,i]=$i[e],n=r.exec(t),s=n&&(dr(i)?i(n,t):i);if(s)return s}return["",""]}(Ln),d=null!=(a="undefined"!=typeof navigator?navigator:void 0)&&a.brave?{brave:!0}:{},v={detectGoogleSearchApp:r},f=Bn(Zn({$os:h,$os_version:c,$browser:Ai(Ln,navigator.vendor,d,v),$device:Di(Ln),$device_type:qi(Ln,{userAgentDataPlatform:null==(i=navigator)||null==(i=i.userAgentData)?void 0:i.platform,maxTouchPoints:null==(n=navigator)?void 0:n.maxTouchPoints,screenWidth:null==kn||null==(s=kn.screen)?void 0:s.width,screenHeight:null==kn||null==(o=kn.screen)?void 0:o.height,devicePixelRatio:null==kn?void 0:kn.devicePixelRatio}),$timezone:Nc(),$timezone_offset:Fc()}),{$current_url:es(null==En?void 0:En.href,l,Cc),$host:null==En?void 0:En.host,$pathname:null==En?void 0:En.pathname,$raw_user_agent:Ln.length>1e3?Ln.substring(0,997)+"...":Ln,$browser_version:Fi(Ln,navigator.vendor,d,v),$browser_language:Mc(),$browser_language_prefix:(u=Mc(),"string"==typeof u?u.split("-")[0]:void 0),$screen_height:null==kn?void 0:kn.screen.height,$screen_width:null==kn?void 0:kn.screen.width,$viewport_height:null==kn?void 0:kn.innerHeight,$viewport_width:null==kn?void 0:kn.innerWidth,$lib:$n.LIB_NAME,$lib_version:$n.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return $n.SDK_DIST_CHANNEL&&(f.$sdk_dist_channel=$n.SDK_DIST_CHANNEL),f}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&Bn(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&Bn(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.gn)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===Ig&&(a.$lib_custom_api_host=this.config.api_host),l=t!==lo||s?t!==ho||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=Bn(a,l),t===lo&&In&&(a.title=In.title),!pr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}Ln&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=Bn({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),cr(this.config.property_denylist)?Hn(this.config.property_denylist,(function(t){delete a[t]})):qn.error(Ug+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(qn.error(jg),a=p(a,t));var g=this.Mn();return a.$process_person_profile=g,g&&!s&&this.Rn("_calculate_event_properties"),a}Tn(t,e,r){var i;if(void 0===e&&(e=!0),void 0===r&&(r=!1),!this.persistence||!this.Mn())return t;if(this.rn&&!r)return t;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=Bn({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&(qn.error(jg),o=a(o,"$set_once")),e&&(this.rn=!0),fr(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)}Pn(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.nn.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:qg}),()=>{})}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:qg})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:qg})}renderSurvey(t,e){var r;null==(r=this.surveys)||r.renderSurvey(t,e)}displaySurvey(t,e){var r;void 0===e&&(e=nl),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:qg}}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:qg})}On(t){return!t||mr(t)?(qn.critical("Unique user id has not been set in posthog.identify"),!1):t===Ks?(qn.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())||(qn.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 qn.uninitializedWarning("posthog.identify");if(_r(t)&&(t=t.toString(),qn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.On(t)&&this.Rn("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:t}),this.get_property(os)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(as)&&(this.unregister(as),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(Bs)||no)===no;t!==i&&s?(this.persistence.set_property(Bs,so),this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!1),this.capture(co,{distinct_id:t,$anon_distinct_id:i},{$set:e||{},$set_once:r||{}}),this.ln=nh(t,e,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(e||r)&&this.setPersonProperties(e,r),t!==i&&(this.reloadFeatureFlags(),this.unregister(qs))}}setPersonProperties(t,e){if((t||e)&&this.Rn("posthog.setPersonProperties")){var r=nh(this.get_distinct_id(),t,e);this.ln!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.ln=r):qn.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(vo,o)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else qn.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.Rn("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(qn.info("reset"),!this.__loaded)return qn.uninitializedWarning("posthog.reset");var l,h=this.get_property(os),c=this.get_property(ys);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),pr(c)||null==(l=this.persistence)||l.register({[ys]:c}),null==(i=this.surveys)||i.reset(),null==(n=this.kn)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.persistence)||a.set_property(Bs,no),null==(u=this.sessionManager)||u.resetSessionId(),this.ln=null,this.config.cookieless_mode===io)this.register_once({distinct_id:Ks,$device_id:null},"");else{var d=this.config.get_device_id(hl());this.register_once({distinct_id:d,$device_id:t?d:h},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(t,e){var r;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(r=this.conversations)||r.Ln()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.An()}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(ss)?(qn.critical("Attempting to create alias for existing People user - aborting."),-2):this.Rn("posthog.alias")?(pr(e)&&(e=this.get_distinct_id()),t!==e?(this.Pn(as,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(qn.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(vr(t)){var i,n,s,o,a,u,l,h,c,d,v;Bn(this.config,Wg(t));var f=this.vn();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ug(r({},this.config,{persistence:"sessionStorage"}),f,!1);var p=this.hn(this.config.debug);xr(p)&&(this.config.debug=p),xr(this.config.debug)&&(this.config.debug?($n.DEBUG=!0,dh.O()&&dh.N("ph_debug",!0),qn.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):($n.DEBUG=!1,dh.O()&&dh.q("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||c.startIfEnabledOrStop(),null==(d=this.surveys)||d.loadIfEnabled(),this.Fn(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){$n.LIB_NAME=t,$n.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:Gg.Nn}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:Hg;return e!==Hg&&(e=Hg+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Bs))===so||(null==(e=this.sessionPersistence)?void 0:e.get_property(Bs))===so}Mn(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===oo&&!this._isIdentified()&&fr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[as])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Qs]))}Cn(){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.Mn()||this.Rn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Rn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Rn(t){return"never"===this.config.person_profiles?(qn.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Pn(Qs,!0),!0)}vn(){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!==ro)}Fn(){var t,e,r,i,n=this.vn();return(null==(t=this.persistence)?void 0:t.Tr)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.Tr)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==io){if(this.tn()){var r,i,n,s,o;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new Cg(this),this.pageViewManager=new tg(this),this.persistence&&(this.sessionPropsManager=new xg(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=Gg.__defaultExtensionClasses)?void 0:o.sessionRecording;u&&(this.sessionRecording=this.Xi(this.sessionRecording,new u(this)),this.wn&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.wn)))}var l,h;this.consent.optInOut(!0),this.Fn(),this.xn(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==ro&&(null==(l=this.surveys)||l.loadIfEnabled()),(pr(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.Sn()}else qn.warn(Dg)}opt_out_capturing(){var t,e,r;this.config.cookieless_mode!==io?(this.config.cookieless_mode===ro&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Fn(),this.config.cookieless_mode===ro&&(this.register({distinct_id:Ks,$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.config.capture_pageview&&this.Sn(),this.xn())):qn.warn(Dg)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===io||(this.config.cookieless_mode===ro?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Fn()}_is_bot(){return Tn?Tg(Tn,this.config.custom_blocked_useragents):void 0}Sn(){In&&("visible"===In.visibilityState?this.sn||(this.sn=!0,this.capture(lo,{title:In.title},{send_instantly:!0}),this.an&&(In.removeEventListener(ao,this.an),this.an=null)):this.an||(this.an=this.Sn.bind(this),Jn(In,ao,this.an)))}debug(t){!1===t?(null==kn||kn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==kn||kn.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}))}Kr(){var t,e,r,i,n,s,o=this.cn||{};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?(qn.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=qn,n=(e="advanced_disable_flags")in(t=o)&&!br(t[e]),s=r in t&&!br(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]))}En(t){if(br(this.config.before_send))return t;var e=cr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),br(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return sr(Je,t.event)?qn.warn(n+". This can cause unexpected behavior."):qn.info(n),null}r.properties&&!fr(r.properties)||qn.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)})}hn(t){var e=xr(t)&&!t,r=dh.O()&&"true"===dh.A("ph_debug");return!e&&(!!r||t)}}Gg.__defaultExtensionClasses={},Gg.Nn={trace:Ag=()=>{},debug:Ag,info:Ag,warn:Ag,error:Ag,fatal:Ag},function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=Wn(t.prototype[e[r]])}(Gg,["identify"]);var Qg=jn("[ExceptionAutocapture]"),Jg=jn("[TracingHeaders]"),Kg=jn("[Web Vitals]"),Yg=9e5,Xg="disabled",tm="lazy_loading",em="awaiting_config",rm="missing_config";jn("[SessionRecording]"),jn("[SessionRecording]");var im="[SessionRecording]",nm=jn(im),sm=jn("[Heatmaps]");function om(t){return vr(t)&&"clientX"in t&&"clientY"in t&&_r(t.clientX)&&_r(t.clientY)}var am=jn("[Product Tours]"),um=["$set_once","$set"],lm=jn("[SiteApps]"),hm="Error while initializing PostHog app with config id ";function cm(t,e,r){if(br(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 dm{constructor(t){this.Dn=new Sg,this.$n=(t,e)=>this.qn(t,e)&&this.jn(t,e)&&this.Hn(t,e)&&this.Un(t,e),this.qn=(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.zn=new Set}init(){var t,e;pr(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(!pr(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,r;null==(e=this.zn)||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.zn&&(null==(r=this.zn)?void 0:r.size)>0&&this.zn.forEach((t=>{this.Vn(e,t)&&this.Dn.emit("actionCaptured",t.name)}))}Wn(t){this.onAction("actionCaptured",(e=>t(e)))}Vn(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.$n(t,r))return!0;return!1}onAction(t,e){return this.Dn.on(t,e)}jn(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(!cm(i,e.url,e.url_matching||"contains"))return!1}return!0}Hn(t,e){return!!this.Zn(t,e)&&!!this.Gn(t,e)&&!!this.Qn(t,e)}Zn(t,e){var r;if(null==e||!e.href)return!0;var i=this.Jn(t);if(i.length>0)return i.some((t=>cm(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&cm((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Gn(t,e){var r;if(null==e||!e.text)return!0;var i=this.Jn(t);if(i.length>0)return i.some((t=>cm(t.text,e.text,e.text_matching||"exact")||cm(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;!br(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=>cm(t,s,o))))}Qn(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}Jn(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Un(t,e){return null==e||!e.properties||0===e.properties.length||ah(e.properties.reduce(((t,e)=>{var r=cr(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 vm{constructor(t){this._instance=t,this.Kn=new Map,this.Yn=new Map,this.Xn=new Map}es(t,e){return!!t&&ah(t.propertyFilters,null==e?void 0:e.properties)}ts(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}rs(t,e,r){var i=(r===Ru.Activation?this.Kn:this.Yn).get(t),n=[];return this.ns((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.es(s,e)}))}register(t){var e;pr(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.ss(t),this.os(t))}os(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.us&&(this.us=new dm(this._instance),this.us.init(),this.us.Wn((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.us)||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.Xn.get(e.name);r&&r.push(t.id),this.Xn.set(e.name,r||[t.id])}})))})))}ss(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.Kn=this.ts(t,Ru.Activation),this.Yn=this.ts(t,Ru.Cancellation))}onEvent(t,e){var r,i=this.le(),n=this.ls(),s=this.hs(),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.cs(o))}}else{if(this.Yn.has(t)){var c=this.rs(t,e,Ru.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.ds(t.id)})),this.cs(o))}if(this.Kn.has(t)){i.info("event name matched",{event:t,eventPayload:e,items:this.Kn.get(t)});var d=this.rs(t,e,Ru.Activation);this.cs(o.concat(d.map((t=>t.id))||[]))}}}onAction(t){var e,r=this.ls(),i=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[r])||[];this.Xn.has(t)&&this.cs(i.concat(this.Xn.get(t)||[]))}cs(t){var e=this.le(),r=[...new Set(t)].filter((t=>!this.vs(t)));e.info("updating activated items",{activatedItems:r}),this.fs(r)}getActivatedIds(){var t,e=this.ls();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}getEventToItemsMap(){return this.Kn}ps(){return this.us}}class fm extends vm{constructor(t){super(t)}ls(){return $s}hs(){return $u.SHOWN}ns(t){var e;null==(e=this._instance)||e.getSurveys(t)}ds(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}le(){return Gu}fs(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[$s]:t})}vs(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var pm="SDK is not enabled or survey functionality is not yet loaded",gm="Disabled. Not loading surveys.",mm=null!=kn&&kn.location?rs(kn.location.hash,"__posthog")||rs(location.hash,"state"):null,ym="_postHogToolbarParams",bm=jn("[Toolbar]"),_m=jn("[FeatureFlags]"),wm=jn("[FeatureFlags]",{debugEnabled:!0}),xm="\" failed. Feature flags didn't load in time.",Sm=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},km=t=>{var e={};for(var[r,i]of zn(t||{}))i&&(e[r]=i);return e},Cm="Refusing to render web experiment since the viewer is a likely bot",Tm={icontains:(t,e)=>!!kn&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!kn&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!kn&&ih(e.href,t),not_regex:(t,e)=>!!kn&&!ih(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class Im{get qt(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Im.gs("retrieved web experiments from the server"),e.ys=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;e.ys&&(Im.gs("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.ys)||r.set(t.feature_flag_key,t));var i=e._instance.getFeatureFlag(t.feature_flag_key);gr(i)&&t.variants[i]&&e.bs(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];Im._s(s)&&e.bs(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Im.gs(Cm);else if(!this.qt.disable_web_experiments){if(br(this.ys))return this.ys=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Im.gs("applying feature flags",t),t.forEach((t=>{var e;if(this.ys&&null!=(e=this.ys)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.ys)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.bs(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=Im.getWindowLocation();if(null!=t&&t.search){var e=ts(null==t?void 0:t.search,"__experiment_id"),r=ts(null==t?void 0:t.search,"__experiment_variant");e&&r&&(Im.gs("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.ws(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||[])})}ws(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(Im.gs("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.bs(i[0].name,e,i[0].variants[e].transforms))}static _s(t){return!br(t.conditions)&&Im.xs(t)&&Im.Ss(t)}static xs(t){var e;if(br(t.conditions)||br(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,s=Im.getWindowLocation();return!!s&&(null==(r=t.conditions)||!r.url||Tm[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,s))}static getWindowLocation(){return null==kn?void 0:kn.location}static Ss(t){var e;if(br(t.conditions)||br(null==(e=t.conditions)?void 0:e.utm))return!0;var r=Ic();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 gs(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];qn.info("[WebExperiments] "+t,r)}bs(t,e,r){this._is_bot()?Im.gs(Cm):"control"!==e?r.forEach((r=>{if(r.selector){var i;Im.gs("applying transform of variant "+e+" for experiment "+t+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}})):Im.gs("Control variants leave the page unmodified.")}_is_bot(){return Tn&&this._instance?Tg(Tn,this.qt.custom_blocked_useragents):void 0}}var Em=jn("[Conversations]"),Rm="Conversations not available yet.",Mm={featureFlags:class{constructor(t){this.ks=!1,this.Cs=!1,this.Is=!1,this.Ts=!1,this.Es=!1,this.Ms=!1,this.Rs=!1,this.Ps=!1,this._instance=t,this.featureFlagEventHandlers=[]}get qt(){return this._instance.config}get ki(){return this._instance.persistence}Os(t){return this._instance.get_property(t)}Ls(){var t,e;return null!==(t=null==(e=this.ki)?void 0:e.Mr(this.qt.feature_flag_cache_ttl_ms))&&void 0!==t&&t}As(){return!!this.Ls()&&(this.Ps||this.Is||(this.Ps=!0,_m.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Fs(){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.Rs||(_m.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Rs=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||_m.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}Ns(){return this.Fs().length>0}Ds(){var t=this.qt.flag_keys;if(!pr(t)){if(cr(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||_m.error("Invalid flag key found:",t,"Expected non-empty string"),e}));_m.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,{config:r}=this._instance,i=null!==(t=null==(e=r.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((t=>!!i[t])).reduce(((t,e)=>(t[e]=i[e]||!1,t)),{}),u=Object.keys(o).filter((t=>a[t])).reduce(((t,e)=>(o[e]&&(t[e]=o[e]),t)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:u})}}updateFlags(t,e,i){var n=null!=i&&i.merge?this.getFlagVariants():{},s=null!=i&&i.merge?this.getFlagPayloads():{},o=r({},n,t),a=r({},s,e),u={};for(var[l,h]of Object.entries(o)){var c="string"==typeof h;u[l]={key:l,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:pr(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.Cs}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Os(Es),e=this.Os(Os),i=this.Os(Ps);if(!i&&!e)return t||{};var n=Bn({},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=pr(h)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!h,d=pr(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.ks||(_m.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.ks=!0),n}getFlagVariants(){var t=this.Os(Cs),e=this.Os(Os);if(!e)return t||{};for(var r=Bn({},t),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.ks||(_m.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.ks=!0),r}getFlagPayloads(){var t=this.Os(Rs),e=this.Os(Ps);if(!e)return t||{};for(var r=Bn({},t||{}),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.ks||(_m.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.ks=!0),r}reloadFeatureFlags(){this.Ts||this.qt.advanced_disable_feature_flags||this.$s||(this._instance.nn.emit("featureFlagsReloading",!0),this.$s=setTimeout((()=>{this.qs()}),5))}js(){clearTimeout(this.$s),this.$s=void 0}ensureFlagsLoaded(){this.Cs||this.Is||this.$s||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Ts=t}qs(t){var e;if(this.js(),!this._instance.Kr())if(this.Is)this.Es=!0;else{var i=this.qt.token,n=this.Os(os),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.ki)?void 0:e.get_initial_props())||{},this.Os(Ls)||{}),group_properties:this.Os(As),timezone:Nc()};yr(n)||pr(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this.qt.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Ns()&&(s.evaluation_contexts=this.Fs());var o=this.Ds();pr(o)||(s.flag_keys=o);var a=!!this.qt.advanced_only_evaluate_survey_feature_flags,u=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.qt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Is=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this.qt.disable_compression?void 0:vl.Base64,timeout:this.qt.feature_flag_request_timeout_ms,callback:t=>{var e,r,i,n=!0;if(200===t.statusCode&&(this.Es||(this.$anon_distinct_id=void 0),n=!1),this.Is=!1,!s.disable_flags||this.Es){this.Ms=!n;var o=[];t.error?t.error instanceof Error?o.push("AbortError"===t.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==t.statusCode&&o.push("api_error_"+t.statusCode),null!=(e=t.json)&&e.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var u,l=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(l&&o.push("quota_limited"),null==(i=this.ki)||i.register({[Us]:o}),l)_m.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(u=t.json)&&void 0!==u?u:{},n,{partialResponse:a}),this.Es&&(this.Es=!1,this.qs())}}})}}getFeatureFlag(t,e){var r;if(void 0===e&&(e={}),!e.fresh||this.Ms)if(this.Cs||this.getFlags()&&this.getFlags().length>0){if(!this.As()){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 _m.warn('getFeatureFlag for key "'+t+xm)}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.Ms)if(this.Cs||this.getFlags()&&this.getFlags().length>0){if(!this.As()){var r=this.getFlagVariants(),i=t in r,n=r[t],s=this.getFlagPayloads()[t],o=String(n),a=this.Os(Ms)||void 0,u=this.Os(Hs)||void 0,l=this.Os(qs)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var h,c=this._instance.get_session_id(),d=this.Os(js);c&&c!==d&&(l={},null==(h=this.ki)||h.register({[qs]:l,[js]: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;cr(l[t])?l[t].push(o):l[t]=[o],null==(v=this.ki)||v.register({[qs]:l});var S=this.getFeatureFlagDetails(t),k=[...null!==(f=this.Os(Us))&&void 0!==f?f:[]];pr(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.Ms};pr(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),pr(null==S?void 0:S.original_variant)&&pr(null==S?void 0:S.original_enabled)||(C.$feature_flag_original_response=pr(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(!pr(s))try{E=JSON.parse(s)}catch(t){}return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:E}}}}else _m.warn('getFeatureFlagResult for key "'+t+xm)}getRemoteConfigPayload(t,e){var r=this.qt.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.Ns()&&(i.evaluation_contexts=this.Fs());var n=this.Ds();pr(n)||(i.flag_keys=n),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.qt.disable_compression?void 0:vl.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.Ms){if(this.Cs||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return pr(r)?void 0:!!r}_m.warn('isFeatureEnabled for key "'+t+xm)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,i){if(this.ki){this.Cs=!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]})))):_m.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(cr(l)){_m.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({[Ts]:l,[Cs]: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({[Ts]:Object.keys(km(p)),[Cs]:p||{},[Rs]:g||{},[Es]:m||{}},c?{[Ms]:c}:{},d?{[Hs]:d}:{}))}}}(t,this.ki,n,s,o,i),e||(this.Ps=!1),this.Hs(e)}}override(t,e){void 0===e&&(e=!1),_m.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.ki)return _m.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.ki.unregister(Os),this.ki.unregister(Ps),this.Hs(),wm.info("All overrides cleared");if(cr(t)){var e=Sm(t);return this.ki.register({[Os]:e}),this.Hs(),wm.info("Flag overrides set",{flags:t})}if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var r,i=t;if(this.ks=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.ki.unregister(Os),wm.info("Flag overrides cleared");else if(i.flags){if(cr(i.flags)){var n=Sm(i.flags);this.ki.register({[Os]:n})}else this.ki.register({[Os]:i.flags});wm.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.ki.unregister(Ps),wm.info("Payload overrides cleared")):i.payloads&&(this.ki.register({[Ps]:i.payloads}),wm.info("Payload overrides set",{payloads:i.payloads}))),void this.Hs()}if(t&&"object"==typeof t)return this.ki.register({[Os]:t}),this.Hs(),wm.info("Flag overrides set",{flags:t});_m.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Cs){var{flags:e,flagVariants:r}=this.Us();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this.Os(Is)||[]).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.ki)||n.register({[Ts]:Object.keys(km(u)),[Cs]:u}),this.Hs()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this.Os(Is),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.ki)||r.unregister(Is),null==(i=this.ki)||i.register({[Is]:n}),t(n)}}})}Us(){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)),{})}}Hs(t){var{flags:e,flagVariants:r}=this.Us();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Os(Ls)||{},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({[Ls]:r({},i,o,n)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Ls)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Os(As)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[As]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Os(As)||{};this._instance.register({[As]:r({},e,{[t]:{}})})}else this._instance.unregister(As)}reset(){this.Cs=!1,this.Is=!1,this.Ts=!1,this.Es=!1,this.Ms=!1,this.$anon_distinct_id=void 0,this.js(),this.ks=!1}}},Om={sessionRecording:class{get qt(){return this._instance.config}get ki(){return this._instance.persistence}get started(){var t;return!(null==(t=this.Bs)||!t.isStarted)}get status(){var t,e;return this.zs===em||this.zs===rm?this.zs:null!==(t=null==(e=this.Bs)?void 0:e.status)&&void 0!==t?t:this.zs}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.zs=Xg,this.Vs=void 0,this._instance=t,!this._instance.sessionManager)throw nm.error("started without valid sessionManager"),new Error(im+" started without valid sessionManager. This is a bug.");if(this.qt.cookieless_mode===io)throw new Error(im+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ws(){var t,e=!(null==(t=this._instance.get_property(ys))||!t.enabled),r=!this.qt.disable_session_recording,i=this.qt.disable_session_recording||this._instance.consent.isOptedOut();return kn&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.Ws||null==(e=this.Bs)||!e.isStarted){var r=!pr(Object.assign)&&!pr(Array.from);this.Ws&&r?(this.Zs(t),nm.info("starting")):(this.zs=Xg,this.stopRecording())}}Zs(t){var e,r,i;this.Ws&&(this.zs!==em&&this.zs!==rm&&(this.zs=tm),null!=An&&null!=(e=An.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=An.__PosthogExtensions__)&&r.initSessionRecording?this.Gs(t):null==(i=An.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Qs,(e=>{if(e)return nm.error("could not load recorder",e);this.Gs(t)})))}stopRecording(){var t,e;null==(t=this.Vs)||t.call(this),this.Vs=void 0,null==(e=this.Bs)||e.stop()}Js(){var t,e;null==(t=this.Vs)||t.call(this),this.Vs=void 0,null==(e=this.Bs)||e.discard()}Ks(){var t;null==(t=this.ki)||t.unregister(ks)}Ys(t,e){if(br(t))return null;var r,i=_r(t)?t:parseFloat(t);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(nm.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):i}Xs(t){if(this.ki){var e,i,n=this.ki,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.Ys(null==(e=this.qt.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.Ys(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;br(a)&&this.Ks();var u=null==i?void 0:i.minimumDurationMilliseconds;n.register({[ys]: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:pr(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.Vs)||e.call(this),this.Vs=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){return"sessionRecording"in t?!1===t.sessionRecording?(this.Xs(t),void this.Js()):(this.Xs(t),void this.startIfEnabledOrStop()):(this.zs===em&&(this.zs=rm,nm.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.Bs)&&r.log?this.Bs.log(t,e):nm.warn("log called before recorder was ready")}get Qs(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(ys);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}eo(){var t,e,r=this._instance.get_property(ys);if(!r)return!1;try{e="object"==typeof r?r:JSON.parse(r)}catch(t){return nm.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}Gs(t){var e,r;if(null==(e=An.__PosthogExtensions__)||!e.initSessionRecording)return nm.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[to]:!0});if(this.Bs||(this.Bs=null==(r=An.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.Bs._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.eo()){if(this.zs===rm||this.zs===em)return;return this.zs=em,nm.info("persisted remote config is stale, requesting fresh config before starting"),void new pg(this._instance).load()}this.zs=tm,this.Bs.start(t)}onRRwebEmit(t){var e;null==(e=this.Bs)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Bs||null==(e=this.ki)||e.register({[_s]:!0}),null==(t=this.Bs)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Bs||null==(e=this.ki)||e.register({[bs]:!0}),null==(t=this.Bs)||t.overrideSampling()}overrideTrigger(t){var e,r;this.Bs||null==(r=this.ki)||r.register({["url"===t?ws:xs]:!0}),null==(e=this.Bs)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Bs)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.Bs)||!r.tryAddCustomEvent(t,e))}}},Pm={autocapture:class{constructor(t){this.ro=!1,this.io=null,this.no=!1,this.instance=t,this.rageclicks=new Lp(t.config.rageclick),this.so=null}initialize(){this.startIfEnabled()}get qt(){var t,e,r=vr(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}oo(){if(this.isBrowserSupported()){if(kn&&In){var t=t=>{t=t||(null==kn?void 0:kn.event);try{this.ao(t)}catch(t){Np.error("Failed to capture event",t)}};if(Jn(In,"submit",t,{capture:!0}),Jn(In,"change",t,{capture:!0}),Jn(In,"click",t,{capture:!0}),this.qt.capture_copied_text){var e=t=>{t=t||(null==kn?void 0:kn.event);try{this.ao(t,Ap)}catch(t){Np.error("Failed to capture copy/cut event",t)}};Jn(In,"copy",e,{capture:!0}),Jn(In,"cut",e,{capture:!0})}}}else Np.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.ro&&(this.oo(),this.ro=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.no=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ls]:!!t.autocapture_opt_out}),this.io=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.so=t}getElementSelectors(t){var e,r=[];return null==(e=this.so)||e.forEach((e=>{var i=null==In?void 0:In.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[ls];if(yr(this.io)&&!xr(r)&&!this.instance.Kr())return!1;var i=null!==(e=this.io)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!i}ao(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=Io(t);_o(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())&&$o(i,this.instance.config.rageclick)&&this.ao(t,"$rageclick");var n=e===Ap;if(i&&function(t,e,r,i,n){var s,o,a,u;if(void 0===r&&(r=void 0),!kn||Do(t))return!1;if(null!=(s=r)&&s.url_allowlist&&!So(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&So(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}=qo(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(pr(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(!Ro(c,null==(u=r)?void 0:u.css_selector_allowlist))return!1;var d=kn.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&&(Eo.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}(i,t,this.qt,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=Dp(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.no});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),e===Ap){var u,l=Co(null==kn||null==(u=kn.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 dr(null==In?void 0:In.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.uo=(null==kn||null==(e=kn.location)?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(qn.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.lo&&this.lo(),this.lo=void 0,qn.info("History API monitoring stopped")}monitorHistoryChanges(){kn&&kn.history&&(this.ho("pushState"),this.ho("replaceState"),this.co())}ho(t){var e;if(kn&&(null==(e=kn.history[t])||!e.__posthog_wrapped__)){var r=this;is(kn.history,t,(e=>function(i,n,s){e.call(this,i,n,s),r.do(t)}))}}do(t){try{var e,r=null==kn||null==(e=kn.location)?void 0:e.pathname;if(!r)return;r!==this.uo&&this.isEnabled&&this._instance.capture(lo,{navigation_type:t}),this.uo=r}catch(e){qn.error("Error capturing "+t+" pageview",e)}}co(){if(!this.lo){var t=()=>{this.do("popstate")};Jn(kn,"popstate",t),this.lo=()=>{kn&&kn.removeEventListener("popstate",t)}}}},heatmaps:class{get qt(){return this.instance.config}constructor(t){var e;this.vo=!1,this.ro=!1,this.fo=null,this.instance=t,this.vo=!(null==(e=this.instance.persistence)||!e.props[hs]),this.rageclicks=new Lp(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return vr(this.qt.capture_heatmaps)&&this.qt.capture_heatmaps.flush_interval_milliseconds&&(t=this.qt.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return br(this.qt.capture_heatmaps)?br(this.qt.enable_heatmaps)?this.vo:this.qt.enable_heatmaps:!1!==this.qt.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.ro)return;sm.info("starting..."),this.po(),this.At()}else{var t;clearInterval(null!==(t=this.fo)&&void 0!==t?t:void 0),this.mo(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[hs]:e}),this.vo=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.M;return this.M=void 0,t}yo(t){this.Mt(t.originalEvent,"deadclick")}At(){this.fo&&clearInterval(this.fo),this.fo="visible"===(null==In?void 0:In.visibilityState)?setInterval(this.ci.bind(this),this.flushIntervalMilliseconds):null}po(){kn&&In&&(this.bo=this.ci.bind(this),Jn(kn,uo,this.bo),this._o=t=>this.Mt(t||(null==kn?void 0:kn.event)),Jn(In,"click",this._o,{capture:!0}),this.wo=t=>this.xo(t||(null==kn?void 0:kn.event)),Jn(In,"mousemove",this.wo,{capture:!0}),this.So=new Qp(this.instance,Zp,this.yo.bind(this)),this.So.startIfEnabledOrStop(),this.ko=this.At.bind(this),Jn(In,ao,this.ko),this.ro=!0)}mo(){var t;kn&&In&&(this.bo&&kn.removeEventListener(uo,this.bo),this._o&&In.removeEventListener("click",this._o,{capture:!0}),this.wo&&In.removeEventListener("mousemove",this.wo,{capture:!0}),this.ko&&In.removeEventListener(ao,this.ko),clearTimeout(this.Co),null==(t=this.So)||t.stop(),this.ro=!1)}Io(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&&yo(i)&&!bo(i,"body");){if(i===r)return!1;if(sr(e,null==kn?void 0:kn.getComputedStyle(i).position))return!0;i=Mo(i)}return!1}(Io(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"),!mo(t.target)&&om(t)){var n=this.Io(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&$o(Io(t),this.instance.config.rageclick)&&this.To(r({},n,{type:"rageclick"})),this.To(n)}}xo(t){!mo(t.target)&&om(t)&&(clearTimeout(this.Co),this.Co=setTimeout((()=>{this.To(this.Io(t,"mousemove"))}),500))}To(t){if(kn){var e=kn.location.href,r=this.qt.custom_personal_data_properties,i=this.qt.mask_personal_data_properties?[...Sc,...r||[]]:[],n=es(e,i,Cc);this.M=this.M||{},this.M[n]||(this.M[n]=[]),this.M[n].push(t)}}ci(){this.M&&!fr(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Qp,webVitalsAutocapture:class{constructor(t){var e;this.vo=!1,this.ro=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Eo=()=>{clearTimeout(this.Mo),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.dt=t=>{var e;this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Ro();if(!pr(i))if(br(null==t?void 0:t.name)||br(null==t?void 0:t.value))Kg.error("Invalid metric received",t);else if(!this.Po||this.Po>t.value){this.M.url!==i&&(this.Eo(),this.Mo=setTimeout(this.Eo,this.flushToCaptureTimeoutMs)),pr(this.M.url)&&(this.M.url=i),this.M.firstMetricTimestamp=pr(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0);var n=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),s=r({},t,{$current_url:i,timestamp:Date.now()});pr(n)||(s.$session_id=n.sessionId,s.$window_id=n.windowId),this.M.metrics.push(s),this.M.metrics.length===this.allowedMetrics.length&&this.Eo()}else Kg.error("Ignoring metric with value >= "+this.Po,t)},this.Oo=()=>{if(!this.ro){var t,e,r,i,n=An.__PosthogExtensions__;pr(n)||pr(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.dt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.dt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.dt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.dt.bind(this)),this.ro=!0):Kg.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.vo=!(null==(e=this._instance.persistence)||!e.props[fs]),this.startIfEnabled()}get Lo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=vr(this.Lo)?null==(t=this.Lo)?void 0:t.web_vitals_allowed_metrics:void 0;return br(r)?(null==(e=this._instance.persistence)?void 0:e.props[ms])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(vr(this.Lo)?this.Lo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=vr(this.Lo)?this.Lo.web_vitals_attribution:void 0;return null!=t&&t}get Po(){var t=vr(this.Lo)&&_r(this.Lo.__web_vitals_max_value)?this.Lo.__web_vitals_max_value:Yg;return t>0&&6e4>=t?Yg:t}get isEnabled(){var t=null==En?void 0:En.protocol;if("http:"!==t&&"https:"!==t)return Kg.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=vr(this.Lo)?this.Lo.web_vitals:xr(this.Lo)?this.Lo:void 0;return xr(e)?e:this.vo}startIfEnabled(){this.isEnabled&&!this.ro&&(Kg.info("enabled, starting..."),this.lr(this.Oo))}onRemoteConfig(t){if("capturePerformance"in t){var e=vr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=vr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[fs]:e}),this._instance.persistence.register({[ms]:r})),this.vo=e,this.startIfEnabled()}}lr(t){var e,r;null!=(e=An.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks?t():null==(r=An.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(e=>{e?Kg.error("failed to load script",e):t()}))}Ro(){var t=kn?kn.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...Sc,...e||[]]:[];return es(t,r,Cc)}Kg.error("Could not determine current URL")}}},Lm={exceptionObserver:class{constructor(t){var e,r,i;this.Oo=()=>{var t;if(kn&&this.isEnabled&&null!=(t=An.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=An.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=An.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=An.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Ao&&this.qt.capture_unhandled_errors&&(this.Ao=e(this.captureException.bind(this))),!this.Fo&&this.qt.capture_unhandled_rejections&&(this.Fo=r(this.captureException.bind(this))),!this.No&&this.qt.capture_console_errors&&(this.No=i(this.captureException.bind(this)))}catch(t){Qg.error("failed to start",t),this.Do()}}},this._instance=t,this.$o=!(null==(e=this._instance.persistence)||!e.props[cs]),this.qo=new Or({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:Qg}),this.qt=this.jo(),this.startIfEnabledOrStop()}jo(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return vr(t)?e=r({},e,t):(pr(t)?this.$o: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?(Qg.info("enabled"),this.Do(),this.lr(this.Oo)):this.Do()}lr(t){var e,r;null!=(e=An.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=An.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Qg.error("failed to load script",e);t()}))}Do(){var t,e,r;null==(t=this.Ao)||t.call(this),this.Ao=void 0,null==(e=this.Fo)||e.call(this),this.Fo=void 0,null==(r=this.No)||r.call(this),this.No=void 0}onRemoteConfig(t){"autocaptureExceptions"in t&&(this.$o=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[cs]:this.$o}),this.qt=this.jo(),this.startIfEnabledOrStop())}onConfigChange(){this.qt=this.jo()}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.qo.consumeRateLimit(n)?Qg.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.Ho=[],this.Uo=Df(),this._instance=t,this.Ho=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(ds))&&void 0!==e?e:[],this.Bo=wn(this.zo()),this.Vo=new xn(this.Bo)}onConfigChange(){this.Bo=wn(this.zo()),this.Vo.setConfig(this.Bo)}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.Ho=n,this._instance.persistence&&this._instance.persistence.register({[ds]:this.Ho,[vs]:s})}}get Wo(){var t,e=!!this._instance.get_property(vs),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.Uo.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.Bo.enabled)try{if(!gr(t)||0===t.trim().length)return void $f.warn("Ignoring exception step because message must be a non-empty string");var i=this.Zo(e),{sanitizedProperties:n,droppedKeys:s}=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((r,i)=>bn.has(i)?(e.push(i),r):(r[i]=t[i],r)),{}),droppedKeys:e}}(i);s.length>0&&$f.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Vo.add(r({[mn]:t,[yn]:(new Date).toISOString()},n))}catch(t){$f.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Go(e)){if(this.Qo(e))return this.Jo("Exception dropped: matched a suppression rule"),void $f.info("Skipping exception capture because a suppression rule matched");if(!this.Wo&&this.Ko(e))return this.Jo("Exception dropped: thrown by a browser extension"),void $f.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Yo(e))return this.Jo("Exception dropped: thrown by the PostHog SDK"),void $f.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.Bo.enabled&&br(t.$exception_steps)?this.Xo(t):t;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",In:!0});return i&&this.Vo.clear(),i}catch(t){return $f.error("Failed to capture exception event. Dropping this exception.",t),void this.Vo.clear()}}catch(t){return void $f.error("Failed to process exception event. Ignoring this exception.",t)}}Xo(t){try{var e=this.Vo.getAttachable();return 0===e.length?t:r({},t,{$exception_steps:e})}catch(e){return $f.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Jo(t){this.Bo.enabled&&this.Vo.add({[mn]:t,[yn]:(new Date).toISOString()})}Zo(t){return vr(t)?r({},t):{}}zo(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}Qo(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:r,value:i}=e;return gr(r)&&r.length>0&&t.$exception_types.push(r),gr(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.Ho.some((t=>{var r=t.values.map((t=>{var r,i=sh[t.operator],n=cr(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)}))}Ko(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://")))}Yo(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}Go(t){return!br(t)&&cr(t)}}},Am=r({productTours:class{get ki(){return this._instance.persistence}constructor(t){this.ea=null,this.ta=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){"productTours"in t&&(this.ki&&this.ki.register({[gs]:!!t.productTours}),this.loadIfEnabled())}loadIfEnabled(){var t,e;this.ea||(t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(gs)||this.lr((()=>this.ra()))}lr(t){var e,r;null!=(e=An.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=An.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?am.error("Could not load product tours script",e):t()}))}ra(){var t;!this.ea&&null!=(t=An.__PosthogExtensions__)&&t.generateProductTours&&(this.ea=An.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!cr(this.ta)||e){var r=this.ki;if(r){var i=r.props[Ds];if(cr(i)&&!e)return this.ta=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 am.error(n),void t([],{isLoaded:!1,error:n})}var s=cr(e.json.product_tours)?e.json.product_tours:[];this.ta=s,r&&r.register({[Ds]:s}),t(s,{isLoaded:!0})}})}else t(this.ta,{isLoaded:!0})}getActiveProductTours(t){br(this.ea)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.ea.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.ea)||e.showTourById(t)}previewTour(t){this.ea?this.ea.previewTour(t):this.lr((()=>{var e;this.ra(),null==(e=this.ea)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.ea)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.ea)||t.nextStep()}previousStep(){var t;null==(t=this.ea)||t.previousStep()}clearCache(){var t;this.ta=null,null==(t=this.ki)||t.unregister(Ds)}resetTour(t){var e;null==(e=this.ea)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.ea)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.ea)||e.cancelPendingTour(t)}}},Mm),Nm={siteApps:class{constructor(t){this._instance=t,this.ia=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}na(t,e){if(e){var r=this.globalsForEvent(e);this.ia.push(r),this.ia.length>1e3&&(this.ia=this.ia.slice(10))}}get siteAppLoaders(){var t;return null==(t=An._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.na.bind(this));this.sa=()=>{t(),this.ia=[],this.sa=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,um),{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.ia.length&&(lm.info("Processing "+this.ia.length+" events for site app with id "+t.id),this.ia.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.sa)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,lm.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){lm.error(hm+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){lm.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}oa(){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)}aa(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){lm.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.oa(),void this._instance.on("eventCaptured",(t=>this.aa(t)))):void lm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.sa)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var s=function(t){var e;An["__$$ph_site_app_"+t]=n._instance,null==(e=An.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return lm.error(hm+t,e)}))};for(var{id:o,url:a}of t.siteApps)s(o)}else lm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Fm={tracingHeaders:class{constructor(t){this.ua=void 0,this.la=void 0,this.ha=void 0,this.Oo=()=>{var t,e,r=this.ca();r?(pr(this.ua)&&(this.ua=null==(t=An.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),pr(this.la)&&(this.la=null==(e=An.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Do()},this._instance=t}initialize(){this.startIfEnabledOrStop()}lr(t){var e,r;null!=(e=An.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(r=An.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return Jg.error("failed to load script",e);t()}))}da(){var t,e;return null!==(t=null!==(e=this._instance.config.tracing_headers)&&void 0!==e?e:this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}ca(){var t=this.da();return cr(t)?(cr(this.ha)?this.ha.splice(0,this.ha.length,...t):this.ha=[...t],t.length>0?this.ha:void 0):(cr(this.ha)&&this.ha.splice(0),this.ha=t||void 0,this.ha)}Do(){var t,e;null==(t=this.ua)||t.call(this),null==(e=this.la)||e.call(this),this.ua=void 0,this.la=void 0}startIfEnabledOrStop(){this.ca()?this.lr(this.Oo):this.Do()}}},$m=r({surveys:class{get qt(){return this._instance.config}constructor(t){this.va=void 0,this._surveyManager=null,this.fa=!1,this.pa=[],this.ga=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.qt.disable_surveys){var e=t.surveys;if(br(e))return Gu.warn("Flags not loaded yet. Not loading surveys.");var r=cr(e);this.va=r?e.length>0:e,Gu.info("flags response received, isSurveysEnabled: "+this.va),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith(Yu)||null!=r&&r.startsWith(Xu))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.fa)Gu.info("Already initializing surveys, skipping...");else if(this.qt.disable_surveys)Gu.info(gm);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())Gu.info("Not loading surveys in cookieless mode without consent.");else{var t=null==An?void 0:An.__PosthogExtensions__;if(t){if(!pr(this.va)||this.qt.advanced_enable_surveys){var e=this.va||this.qt.advanced_enable_surveys;this.fa=!0;try{var r=t.generateSurveys;if(r)return void this.ma(r,e);var i=t.loadExternalDependency;if(!i)return void this.ya(eo);i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.ya("Could not load surveys script",r):this.ma(t.generateSurveys,e)}))}catch(t){throw this.ya("Error initializing surveys",t),t}finally{this.fa=!1}}}else Gu.error("PostHog Extensions not found.")}}ma(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new fm(this._instance),Gu.info("Surveys loaded successfully"),this.ba({isLoaded:!0})}ya(t,e){Gu.error(t,e),this.ba({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.pa.push(t),this._surveyManager&&this.ba({isLoaded:!0}),()=>{this.pa=this.pa.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.qt.disable_surveys)return Gu.info(gm),t([]);var r,i=this._instance.get_property(Ns);if(i&&!e)return t(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.ga?this.ga.then((e=>{var{surveys:r,context:i}=e;return t(r,i)})):("undefined"!=typeof Promise&&(this.ga=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.ga=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;Gu.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=>Qu(t)&&(Ju(t)||Ku(t))));l.length>0&&(null==(a=this._surveyEventReceiver)||a.register(l)),null==(i=this._instance.persistence)||i.register({[Ns]:u,[Fs]:Date.now()});var h={isLoaded:!0};t(u,h),null==r||r({surveys:u,context:h})}}))}ba(t){for(var e of this.pa)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Gu.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!br(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Gu.warn("init was not called")}_a(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}wa(t){if(br(this._surveyManager))return{eligible:!1,reason:pm};var e="string"==typeof t?this._a(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(br(this._surveyManager))return Gu.warn("init was not called"),{visible:!1,disabledReason:pm};var e=this.wa(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return br(this._surveyManager)?(Gu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:pm})):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.wa(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if(br(this._surveyManager))Gu.warn("init was not called");else{var n="string"==typeof t?this._a(t):t;if(null!=n&&n.id)if(il.includes(n.type)){var s=null==In?void 0:In.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Gu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Gu.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),Gu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Gu.warn("Survey element not found")}else Gu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Gu.warn("Survey not found")}}displaySurvey(t,e){var i;if(br(this._surveyManager))Gu.warn("init was not called");else{var n=this._a(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!==qu.Popover&&e.initialResponses&&Gu.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 Gu.warn("Survey is not eligible to be displayed: ",o.disabledReason)}e.displayType!==qu.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Gu.warn("Survey not found")}}cancelPendingSurvey(t){br(this._surveyManager)?Gu.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}},Mm),Dm={toolbar:class{constructor(t){this.instance=t}xa(t){An.ph_toolbar_state=t}Sa(){var t;return null!==(t=An.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),Kn(this.instance.config))return!1;if(!kn||!In)return!1;t=null!=t?t:kn.location,r=null!=r?r:kn.history;try{if(!e){try{kn.localStorage.setItem("test","test"),kn.localStorage.removeItem("test")}catch(t){return!1}e=null==kn?void 0:kn.localStorage}var i,n=mm||rs(t.hash,"__posthog")||rs(t.hash,"state"),s=n?Vn((()=>JSON.parse(atob(decodeURIComponent(n)))))||Vn((()=>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(ym)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(t){return!1}}ka(t){var e=An.ph_load_toolbar||An.ph_load_editor;!br(e)&&dr(e)?e(t,this.instance):bm.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==In||!In.getElementById(Js));if(!kn||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(kn.localStorage.setItem(ym,JSON.stringify(r({},n,{source:void 0}))),2===this.Sa())this.ka(n);else if(0===this.Sa()){var s;this.xa(1),null==(s=An.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return bm.error("[Toolbar] Failed to load",t),void this.xa(0);this.xa(2),this.ka(n)})),Jn(kn,"turbolinks:load",(()=>{this.xa(0),this.loadToolbar(n)}))}return!0}Ca(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)}}},qm=r({experiments:Im},Mm),jm={conversations:class{constructor(t){this.Ia=void 0,this._conversationsManager=null,this.Ta=!1,this.Ea=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;br(e)||(xr(e)?this.Ia=e:(this.Ia=e.enabled,this.Ea=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Ia=void 0,this.Ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ta||this._instance.config.disable_conversations||Kn(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==An?void 0:An.__PosthogExtensions__;if(t&&!pr(this.Ia)&&this.Ia)if(this.Ea&&this.Ea.token){this.Ta=!0;try{var e=t.initConversations;if(e)return this.Ma(e),void(this.Ta=!1);var r=t.loadExternalDependency;if(!r)return void this.Ra(eo);r(this._instance,"conversations",(e=>{e||!t.initConversations?this.Ra("Could not load conversations script",e):this.Ma(t.initConversations),this.Ta=!1}))}catch(t){this.Ra("Error initializing conversations",t),this.Ta=!1}}else Em.error("Conversations enabled but missing token in remote config.")}}Ma(t){if(this.Ea)try{this._conversationsManager=t(this.Ea,this._instance),Em.info("Conversations loaded successfully")}catch(t){this.Ra("Error completing conversations initialization",t)}else Em.error("Cannot complete initialization: remote config is null")}Ra(t,e){Em.error(t,e),this._conversationsManager=null,this.Ta=!1}show(){this._conversationsManager?this._conversationsManager.show():Em.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ia&&!yr(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):(Em.warn(Rm),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(Em.warn(Rm),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(Em.warn(Rm),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(Em.warn(Rm),null)}))()}requestRestoreLink(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(t):(Em.warn(Rm),null)}))()}restoreFromToken(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(t):(Em.warn(Rm),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Em.warn(Rm),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()}An(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},Um={logs:class{constructor(t){var e;this.Pa=!1,this.Oa=!1,this.Gt=jn("[logs]"),this.La=[],this.Aa=0,this.Fa=0,this.Na=!1,this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.Pa=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e,r=null==(e=t.logs)?void 0:e.captureConsoleLogs;!br(r)&&r&&(this.Pa=!0,this.loadIfEnabled())}reset(){this.La=[],this.ii&&(clearTimeout(this.ii),this.ii=void 0),this.Aa=0,this.Fa=0,this.Na=!1}loadIfEnabled(){if(this.Pa&&!this.Oa){var t=null==An?void 0:An.__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.Oa=!0)})):this.Gt.error(eo)}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.Fa||(this.Fa=h,this.Aa=0,this.Na=!1),l>this.Aa){this.Aa++;var c=function(t,e){var i=t.level||"info",{text:n,number:s}=ji[i]||Ui,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:Bi(u)};return t.trace_id&&(l.traceId=t.trace_id),t.span_id&&(l.spanId=t.span_id),pr(t.trace_flags)||(l.flags=t.trace_flags),l}(t,this.Da());this.La.push({record:c}),(null!==(o=null==(a=this._instance.config.logs)?void 0:a.maxBufferSize)&&void 0!==o?o:100)>this.La.length?this.$a():this.flushLogs()}else this.Na||(this.Gt.warn("captureLog dropping logs: exceeded "+l+" logs per "+u+"ms"),this.Na=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.qa||(this.qa={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.qa}flushLogs(t){if(this.ii&&(clearTimeout(this.ii),this.ii=void 0),0!==this.La.length){var e=this.La;this.La=[];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:Bi(e)},scopeLogs:[{scope:{name:r,version:i},logRecords:t}]}]}}(e.map((t=>t.record)),n,$n.LIB_NAME,$n.LIB_VERSION),o=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.pn({method:"POST",url:o,data:s,compression:"best-available",batchKey:"logs",transport:t})}}$a(){var t,e;this.ii||(this.ii=setTimeout((()=>{this.ii=void 0,this.flushLogs()}),null!==(t=null==(e=this._instance.config.logs)?void 0:e.flushIntervalMs)&&void 0!==t?t:3e3))}Da(){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!=An&&null!=(t=An.location)&&t.href&&(e.currentUrl=An.location.href),this._instance.featureFlags){var i=this._instance.featureFlags.getFlags();i&&i.length>0&&(e.activeFeatureFlags=i)}return e}}},Hm=r({},Mm,Om,Pm,Lm,Am,Nm,$m,Fm,Dm,qm,jm,Um);Gg.__defaultExtensionClasses=r({},Hm);var Bm=function(){$n.SDK_DIST_CHANNEL="npm";var t=Ng[Hg]=new Gg;return function(){function t(){t.done||(t.done=!0,Bg=!1,Hn(Ng,(function(t){t._dom_loaded()})))}null!=In&&In.addEventListener?"complete"===In.readyState?t():Jn(In,"DOMContentLoaded",t,{capture:!1}):kn&&qn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}();export{vl as Compression,lg as DEFAULT_PRODUCT_TOUR_APPEARANCE,qu as DisplaySurveyType,Gg as PostHog,hg as ProductTourEventName,cg as ProductTourEventProperties,$u as SurveyEventName,Du as SurveyEventProperties,Ru as SurveyEventType,Ou as SurveyPosition,Nu as SurveyQuestionBranchingType,Au as SurveyQuestionType,Fu as SurveySchedule,Pu as SurveyTabPosition,Lu as SurveyType,Mu as SurveyWidgetType,Bm as default,Bm as posthog,dl as severityLevels};
|
|
1
|
+
function t(t,e,r,i,n,s,o){try{var a=t[s](o),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(i,n)}function e(e){return function(){var r=this,i=arguments;return new Promise((function(n,s){var o=e.apply(r,i);function a(e){t(o,n,s,a,u,"next",e)}function u(e){t(o,n,s,a,u,"throw",e)}a(void 0)}))}}function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},r.apply(null,arguments)}function i(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}var n,s=["type"],o=Object.defineProperty,a=(t,e,r)=>((t,e,r)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r),u=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(u||{}),l=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(l||{}),h=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(h||{}),c=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(c||{}),d=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(d||{}),v=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(v||{}),f=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(f||{}),p={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},g={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},m={};function y(t){if(m[t])return m[t];var e=function(t){var e,r,i=null==(r=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in p?p[t]:void 0,n=Boolean(i&&i.every((t=>{var e,i;return Boolean(null==(i=null==(e=Object.getOwnPropertyDescriptor(r,t))?void 0:e.get)?void 0:i.toString().includes("[native code]"))}))),s=t in g?g[t]:void 0,o=Boolean(s&&s.every((t=>{var e;return"function"==typeof r[t]&&(null==(e=r[t])?void 0:e.toString().includes("[native code]"))})));if(n&&o)return m[t]=e.prototype,e.prototype;var a=document.createElement("iframe");try{document.body.appendChild(a);var u=a.contentWindow;if(!u)return e.prototype;var l=u[t].prototype;return l?m[t]=l:r}catch(t){return r}finally{a.parentNode&&document.body.removeChild(a)}}var b={};function _(t,e,r){var i,n=t+"."+String(r);if(b[n])return b[n].call(e);var s=y(t),o=null==(i=Object.getOwnPropertyDescriptor(s,r))?void 0:i.get;return o?(b[n]=o,o.call(e)):e[r]}var w={};function x(t,e,r){var i=t+"."+String(r);if(w[i])return w[i].bind(e);var n=y(t)[r];return"function"!=typeof n?e[r]:(w[i]=n,n.bind(e))}function S(){return y("MutationObserver").constructor}function k(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:i}})),t[e]=n,()=>{t[e]=i}}catch(t){return()=>{}}}var C={childNodes:t=>_("Node",t,"childNodes"),parentNode:t=>_("Node",t,"parentNode"),parentElement:t=>_("Node",t,"parentElement"),textContent:t=>_("Node",t,"textContent"),contains:(t,e)=>x("Node",t,"contains")(e),getRootNode:t=>x("Node",t,"getRootNode")(),host:t=>t&&"host"in t?_("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?_("Element",t,"shadowRoot"):null,querySelector:(t,e)=>x("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>x("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:k};function T(t){return t.nodeType===t.ELEMENT_NODE}function I(t){var e=t&&"host"in t&&"mode"in t&&C.host(t)||null;return Boolean(e&&"shadowRoot"in e&&C.shadowRoot(e)===t)}function E(t){return"[object ShadowRoot]"==={}.toString.call(t)}function R(t){try{var e=t.rules||t.cssRules;if(!e)return null;var r=t.href;return!r&&t.ownerNode&&(r=t.ownerNode.baseURI),(i=Array.from(e,(t=>M(t,r))).join("")).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(t){return null}var i}function M(t,e){var r;if(function(t){return"styleSheet"in t}(t)){var i;try{i=R(t.styleSheet)||function(t){var{cssText:e}=t;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}(t)}catch(e){i=t.cssText}try{if(i&&(null==(r=t.styleSheet)?void 0:r.href))return U(i,t.styleSheet.href)}catch(t){}return i}var n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?U(n,e):n}class O{constructor(){a(this,"idNodeMap",new Map),a(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var r=null==(e=this.getMeta(t))?void 0:e.id;return null!=r?r:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),T(t)){var r=C.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function P(t){var{element:e,maskInputOptions:r,tagName:i,type:n,value:s,maskInputFn:o}=t,a=s||"",u=n&&L(n);return(r[i.toLowerCase()]||u&&r[u])&&(a=o?o(a,e):"*".repeat(a.length)),a}function L(t){return t.toLowerCase()}var A="__rrweb_original__";function N(t){var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?L(e):null}var F=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,D=/^(?:[a-z+]+:)?\/\//i,q=/^www\..*/i,j=/^(data:)([^,]*),(.*)/i;function U(t,e){return(t||"").replace(F,((t,r,i,n,s,o)=>{var a,u=i||s||o,l=r||n||"";if(!u)return t;if(D.test(u)||q.test(u))return"url("+l+u+l+")";if(j.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((a=e).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+u)+l+")";var h=e.split("/"),c=u.split("/");for(var d of(h.pop(),c))"."!==d&&(".."===d?h.pop():h.push(d));return"url("+l+h.join("/")+l+")"}))}var H,B,z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",V=4096,W=1,Z=new RegExp("[^a-z0-9-_:]"),G=-2;function Q(){return W++}var J=/^[^ \t\n\r\u000c]+/,K=/^[, \t\n\r\u000c]+/,Y=new WeakMap;function X(t,e){return e&&""!==e.trim()?tt(t,e):e}function tt(t,e){var r=Y.get(t);if(r||(r=t.createElement("a"),Y.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function et(t,e,r,i,n,s){var o,a,u;if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var l=null==(o=n.sheet)?void 0:o.href;if(l)return l}var h=X(t,i);if("img"===e&&h.startsWith("data:")&&n){var c=h;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(c=function(t,e,r,i){if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>V||t.naturalHeight>V)return e;try{var n=document.createElement("canvas");n.width=t.naturalWidth,n.height=t.naturalHeight;var s=n.getContext("2d");return s?(s.drawImage(t,0,0),n.toDataURL(r||"image/webp",null!=i?i:.4)):e}catch(t){return e}}(n,h,s.type,s.quality)),(null==s?void 0:s.maxBase64ImageLength)&&(a=c,c=(u=s.maxBase64ImageLength)&&a.length>u?z:a),c}return h}return"xlink:href"===r&&"#"!==i[0]?X(t,i):"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(K),e.length>r;){var s=i(J);if(","===s.slice(-1))s=X(t,s.substring(0,s.length-1)),n.push(s);else{var o="";s=X(t,s);for(var a=!1;;){var u=e.charAt(r);if(""===u){n.push((s+o).trim());break}if(a)")"===u&&(a=!1);else{if(","===u){r+=1,n.push((s+o).trim());break}"("===u&&(a=!0)}o+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?U(i,tt(t)):"object"===e&&"data"===r?X(t,i):i:X(t,i)}function rt(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function it(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&it(C.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&it(C.parentNode(t),e,r)}function nt(t,e,r,i){var n;if(T(t)){if(!C.childNodes(n=t).length)return!1}else{if(null===C.parentElement(t))return!1;n=C.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(it(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}var st=new Map;function ot(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function at(t){return null==t?"":t.toLowerCase()}var ut=50,lt=!1,ht=!1;function ct(t,e){var{doc:r,mirror:i,blockClass:n,blockSelector:s,maskTextClass:o,maskTextSelector:a,skipChild:u=!1,inlineStylesheet:l=!0,maskInputOptions:h={},maskTextFn:c,maskInputFn:d,slimDOMOptions:v,dataURLOptions:p={},inlineImages:g=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:_=5e3,onIframeListenerRegistered:w,onStylesheetLoad:x,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:k=(()=>!1),newlyAddedElement:M=!1,depth:O=0,maxDepth:F=ut}=e,{needsMask:D}=e,{preserveWhiteSpace:q=!0}=e;if(O>=F)return ht=!0,lt||(lt=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+F+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;D||(D=nt(t,o,a,void 0===D));var j,z=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,s,{doc:o,blockClass:a,blockSelector:u,inlineStylesheet:l,maskInputOptions:h={},maskInputFn:c,dataURLOptions:d={},inlineImages:v,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:m=!1,rootId:y}=e,b=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,a,u),_=function(t){if(t instanceof HTMLFormElement)return"form";var e=L(t.tagName);return Z.test(e)?"div":e}(t),w={},x=t.attributes.length,S=0;x>S;S++){var k=t.attributes[S];rt(_,k.name)||(w[k.name]=et(o,_,L(k.name),k.value,t,d))}if("link"===_&&l){var T=t.sheet;if(!T){var I=function(t){return t.href}(t);I&&!(T=ot(o,I))&&I.includes(".css")&&(T=ot(o,window.location.origin+"/"+I.replace(window.location.href,"")))}var E=null;T&&(E=R(T)),E&&(delete w.rel,delete w.href,w._cssText=E)}if("style"===_&&t.sheet&&!(t.innerText||C.textContent(t)||"").trim().length){var M=R(t.sheet);M&&(w._cssText=M)}if("input"===_||"textarea"===_||"select"===_){var O=t.value,F=t.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&O?w.value=P({element:t,type:N(t),tagName:_,value:O,maskInputOptions:h,maskInputFn:c}):F&&(w.checked=F)}if("option"===_&&(t.selected&&!h.select?w.selected=!0:delete w.selected),"dialog"===_&&t.open)try{w.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){w.rr_open_mode="modal",w.ph_rr_could_not_detect_modal=!0}if("canvas"===_&&p)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)||(w.rr_dataURL=t.toDataURL(d.type,d.quality));else if(!("__context"in t)){var D=t.toDataURL(d.type,d.quality),q=o.createElement("canvas");q.width=t.width,q.height=t.height,D!==q.toDataURL(d.type,d.quality)&&(w.rr_dataURL=D)}if("img"===_&&v){H||(H=o.createElement("canvas"),B=H.getContext("2d"));var j=t,U=j.currentSrc||j.getAttribute("src")||"<unknown-src>",z=j.crossOrigin,V=()=>{j.removeEventListener("load",V);try{H.width=j.naturalWidth,H.height=j.naturalHeight,B.drawImage(j,0,0),w.rr_dataURL=H.toDataURL(d.type,d.quality)}catch(t){if("anonymous"!==j.crossOrigin)return j.crossOrigin="anonymous",void(j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V));console.warn("Cannot inline img src="+U+"! Error: "+t)}"anonymous"===j.crossOrigin&&(z?w.crossOrigin=z:j.removeAttribute("crossorigin"))};j.complete&&0!==j.naturalWidth?V():j.addEventListener("load",V)}if("audio"===_||"video"===_){var W=w;W.rr_mediaState=t.paused?"paused":"played",W.rr_mediaCurrentTime=t.currentTime,W.rr_mediaPlaybackRate=t.playbackRate,W.rr_mediaMuted=t.muted,W.rr_mediaLoop=t.loop,W.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(w.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(w.rr_scrollTop=t.scrollTop)),b){var{width:G,height:Q,left:J,top:K}=t.getBoundingClientRect(),Y=null==(r=o.defaultView)?void 0:r.getComputedStyle(t);w={class:w.class,rr_width:G+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null==(i=o.defaultView)?void 0:i.scrollX)||0))+"px",rr_top:Math.floor(K+((null==(n=o.defaultView)?void 0:n.scrollY)||0))+"px"},Y&&(w.rr_position=Y.position||"static",Y.transform&&"none"!==Y.transform&&(w.rr_transform=Y.transform),Y.display&&Y.display.startsWith("inline")&&(w.rr_display=Y.display))}"iframe"!==_||g(w.src)||(t.contentDocument||(w.rr_src=w.src),delete w.src);try{customElements.get(_)&&(s=!0)}catch(t){}return{type:f.Element,tagName:_,attributes:w,childNodes:[],isSVG:(X=t,Boolean("svg"===X.tagName||X.ownerSVGElement)||void 0),needBlock:b,rootId:y,isCustom:s};var X}(t,{doc:r,blockClass:n,blockSelector:s,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,dataURLOptions:c,inlineImages:d,recordCanvas:v,keepIframeSrcFn:p,newlyAddedElement:g,rootId:m});case t.TEXT_NODE:return function(t,e){var r,{needsMask:i,maskTextFn:n,rootId:s}=e,o=C.parentNode(t),a=o&&o.tagName,u=C.textContent(t),l="STYLE"===a||void 0,h="SCRIPT"===a||void 0;if(l&&u){try{if(t.nextSibling||t.previousSibling);else if(null==(r=o.sheet)?void 0:r.cssRules){var c=R(o.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(u=c)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}u=U(u,tt(e.doc))}return h&&(u="SCRIPT_PLACEHOLDER"),!l&&!h&&u&&i&&(u=n?n(u,C.parentElement(t)):u.replace(/[\S]/g,"*")),{type:f.Text,textContent:u||"",isStyle:l,rootId:s}}(t,{doc:r,needsMask:o,maskTextFn:l,rootId:m});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:m};case t.COMMENT_NODE:return{type:f.Comment,textContent:C.textContent(t)||"",rootId:m};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:s,needsMask:D,inlineStylesheet:l,maskInputOptions:h,maskTextFn:c,maskInputFn:d,dataURLOptions:p,inlineImages:g,recordCanvas:m,keepIframeSrcFn:k,newlyAddedElement:M});if(!z)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"===function(t,e){var r,i;try{i=new URL(t,window.location.href)}catch(t){return null}var n=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(r=null==n?void 0:n[1])&&void 0!==r?r:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(at(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===at(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(at(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&at(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(at(t.attributes.property).match(/^(og|twitter|fb):/)||at(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===at(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(at(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(at(t.attributes.name))||at(t.attributes.property).match(/^article:/)||at(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(at(t.attributes.name)))return!0}}return!1}(z,v)||!q&&z.type===f.Text&&!z.isStyle&&!z.textContent.replace(/^\s+|\s+$/gm,"").length?G:Q();var V=Object.assign(z,{id:j});if(i.add(t,V),j===G)return null;y&&y(t);var W=!u;if(V.type===f.Element){W=W&&!V.needBlock,delete V.needBlock;var J=C.shadowRoot(t);J&&E(J)&&(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 K={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:_,onIframeListenerRegistered:w,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:k,depth:O+1,maxDepth:F};if(V.type===f.Element&&"textarea"===V.tagName&&void 0!==V.attributes.value);else for(var Y of Array.from(C.childNodes(t))){var X=ct(Y,K);X&&V.childNodes.push(X)}var it=null;if(T(t)&&(it=C.shadowRoot(t)))for(var dt of Array.from(C.childNodes(it))){var vt=ct(dt,K);vt&&(E(it)&&(vt.isShadow=!0),V.childNodes.push(vt))}}var ft=C.parentNode(t);if(ft&&I(ft)&&E(ft)&&(V.isShadow=!0),V.type===f.Element&&"iframe"===V.tagName){var pt=function(t,e,r){var i,n=()=>{},s=t.contentWindow;if(!s)return n;try{i=s.document.readyState}catch(t){return n}var o=()=>e();if("complete"!==i){var a=!1,u=null,l=()=>{a||(a=!0,null!==u&&(clearTimeout(u),u=null),t.removeEventListener("load",h),t.addEventListener("load",o),e())},h=()=>l();return u=setTimeout(l,r),t.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),a?t.removeEventListener("load",o):(a=!0,t.removeEventListener("load",h))}}var c,d="about:blank";try{c=s.location.href}catch(t){return n}if(c!==d||t.src===d||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",o),()=>{clearTimeout(v),t.removeEventListener("load",o)}}return t.addEventListener("load",o),()=>{t.removeEventListener("load",o)}}(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:_,onIframeListenerRegistered:w,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:k,depth:O+1,maxDepth:F});r&&b(t,r)}}),_);null==w||w(t,pt)}return V.type===f.Element&&"link"===V.tagName&&"stylesheet"===V.attributes.rel&&function(e,u,f){if(!st.has(e)){var w;try{w=e.sheet}catch(t){return}if(!w){var C=new AbortController,T=!1,I=()=>{if(!T){T=!0;try{(()=>{if(x){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:x,stylesheetLoadTimeout:S,keepIframeSrcFn:k,depth:O,maxDepth:F});e&&x(t,e)}})()}finally{st.delete(e),C.abort()}}},E=setTimeout(I,f);C.signal.addEventListener("abort",(()=>clearTimeout(E)),{once:!0}),e.addEventListener("load",I,{signal:C.signal,once:!0}),st.set(e,C)}}}(t,0,S),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(it(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function Tt(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||e.getId(t)===G}function It(t,e){if(I(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=C.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||It(i,e))}function Et(t){return Boolean(t.changedTouches)}function Rt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Mt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Ot(t){return!!t&&(t instanceof vt&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(C.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(_t=()=>(new Date).getTime());class Pt{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Lt(t){var e,r=null;return"getRootNode"in t&&(null==(e=C.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(t))&&(r=C.host(C.getRootNode(t))),r}function At(t){var e=t.ownerDocument;return!!e&&(C.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Lt(r);)r=e;return r}(t);return C.contains(e,r)}(t))}function Nt(t){return"__ln"in t}class Ft{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Nt(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Nt(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var $t,Dt=(t,e)=>t+"@"+e;class qt{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"removesSubTreeCache",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"canvasManagerReleased",!1),a(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),a(this,"emit",(()=>{if(!this.frozen&&!this.locked){for(var t=[],e=new Set,r=new Ft,i=t=>{for(var e=t,r=G;r===G;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var s=C.parentNode(n);if(s&&At(n)&&"TEXTAREA"!==s.tagName){var o=I(s)?this.mirror.getId(Lt(n)):this.mirror.getId(s),a=i(n);if(-1===o||-1===a)return r.addNode(n);var u=ct(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:t=>{Rt(t,this.mirror)&&this.iframeManager.addIframe(t),Mt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Ot(n)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(n),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:o,nextId:a,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)Ut(this.removesSubTreeCache,s)&&!this.movedSet.has(C.parentNode(s))||n(s);for(var o of this.addedSet)Ht(this.droppedSet,o)||Ut(this.removesSubTreeCache,o)?Ht(this.movedSet,o)?n(o):this.droppedSet.add(o):n(o);for(var a=null;r.length;){var u=null;if(a){var l=this.mirror.getId(C.parentNode(a.value)),h=i(a.value);-1!==l&&-1!==h&&(u=a)}if(!u)for(var c=r.tail;c;){var d=c;if(c=c.previous,d){var v=this.mirror.getId(C.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=C.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=C.host(f);if(-1!==this.mirror.getId(p)){u=d;break}}}}if(!u){for(;r.head;)r.removeNode(r.head.value);break}a=u.previous,r.removeNode(u.value),n(u.value)}var g={texts:this.texts.map((t=>{var e=t.node,r=C.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var{attributes:e}=t;if("string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(g))}})),a(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),a(this,"genTextAreaValueMutation",(t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(C.childNodes(t),(t=>C.textContent(t)||"")).join("");e.attributes.value=P({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:N(t),value:r,maskInputFn:this.maskInputFn})})),a(this,"processMutation",(t=>{if(!Tt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=C.textContent(t.target);Ct(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:nt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,kt(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,n=t.target.getAttribute(i);if("value"===i){var s=N(r);n=P({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Ct(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var o=this.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!this.keepIframeSrcFn(n)){if(r.contentDocument)return;i="rr_src"}if(o||(this.attributes.push(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,o)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!rt(r.tagName,i))if(o.attributes[i]=et(this.doc,L(r.tagName),L(i),n,r,this.dataURLOptions),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var a=this.unattachedDoc.createElement("span");for(var u of(t.oldValue&&a.setAttribute("style",t.oldValue),Array.from(r.style))){var l=r.style.getPropertyValue(u),h=r.style.getPropertyPriority(u);l!==a.style.getPropertyValue(u)||h!==a.style.getPropertyPriority(u)?o.styleDiff[u]=""===h?l:[l,h]:o._unchangedStyles[u]=[l,h]}for(var c of Array.from(a.style))""===r.style.getPropertyValue(c)&&(o.styleDiff[c]=!1)}else"open"===i&&"DIALOG"===r.tagName&&(o.attributes.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Ct(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var r=this.mirror.getId(e),i=I(t.target)?this.mirror.getId(C.host(t.target)):this.mirror.getId(t.target);Ct(t.target,this.blockClass,this.blockSelector,!1)||Tt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(jt(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||It(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Dt(r,i)]?jt(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!I(t.target)||!E(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),C.childNodes(i).forEach((t=>r.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),a(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Tt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[Dt(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Ct(t,this.blockClass,this.blockSelector,!1)||(C.childNodes(t).forEach((t=>this.genAdds(t))),Ot(t)&&C.childNodes(C.shadowRoot(t)).forEach((e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)})))}}))}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((e=>{this[e]=t[e]})),this.canvasManager.acquire()}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.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}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)}function Qt(t,e){for(var r=Vt.length-1;r>=0;r--){var i=Vt[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),Vt.splice(r,1))}}}var Jt=["INPUT","TEXTAREA","SELECT"],Kt=new WeakMap;function Yt(t){return function t(e,r){if(re("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||re("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||re("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||re("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 Xt(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function te(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 ee(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&&Jt.indexOf(n)>=0&&!Ct(e,s,o,!0)&&!(e.classList.contains(a)||u&&e.matches(u))){var c=e.value,v=!1,p=N(e)||"";"radio"===p||"checkbox"===p?v=e.checked:(l[n.toLowerCase()]||l[p])&&(c=P({element:e,maskInputOptions:l,tagName:n,type:p,value:c,maskInputFn:h})),f(e,d?{text:c,isChecked:v,userTriggered:r}:{text:c,isChecked:v});var g=e.name;"radio"===p&&g&&v&&i.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach((t=>{if(t!==e){var r=t.value;f(t,d?{text:r,isChecked:!v,userTriggered:!1}:{text:r,isChecked:!v})}}))}}function f(t,i){var s=Kt.get(t);if(!s||s.text!==i.text||s.isChecked!==i.isChecked){Kt.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}=Xt(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}=Xt(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}=Xt(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}=Xt(e,i,n.styleMirror);return(a&&-1!==a||u&&-1!==u)&&r({id:a,styleId:u,replaceSync:o}),t.apply(e,s)}))}));var h={};ie("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(ie("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),ie("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),ie("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}=Xt(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}=Xt(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=te(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}=Xt(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}=Xt(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 re(t){return void 0!==window[t]}function ie(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class ne{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 se{constructor(t){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new ne(Q)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"pageHideListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),a(this,"messageHandler"),a(this,"nestedIframeListeners",new Map),a(this,"attachedWindows",new WeakMap),a(this,"attachedDocuments",new WeakMap),a(this,"attachedIframes",new Map),a(this,"loadListenerDisposers",new WeakMap),a(this,"iframeElementsById",new Map),a(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ne(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)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null==(i=this.attachedIframes.get(t))?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach((t=>pt(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{var{win:e,handler:r}=t;pt((()=>e.removeEventListener("pagehide",r)))})),this.pageHideHandlers.delete(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);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var o=this.handleMessage.bind(this);pt((()=>{s.addEventListener("message",o),this.nestedIframeListeners.set(s,o);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}pt((()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null==(e=this.pageHideListener)||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument),t.contentWindow&&this.crossOriginIframeMap.delete(t.contentWindow)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}})),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.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);if(n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(pt((()=>t.removeEventListener("message",e))),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)){var s=this.nestedIframeListeners.get(i);pt((()=>i.removeEventListener("message",s))),this.nestedIframeListeners.delete(i)}i&&this.crossOriginIframeMap.delete(i),this.iframes.delete(r),this.disposeLoadListeners(r),this.removePageHideListener(r);var o=this.attachedDocuments.get(r);o&&(o.forEach((t=>{pt((()=>this.mirror.removeNodeFromMap(t)))})),pt((()=>Qt(r,o))),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,r)=>{this.mirror.has(r)||t.push(r)})),t.forEach((t=>this.removeIframeById(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();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>{var{element:r}=e;return t.add(r)})),t.forEach((t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)})),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}}class oe{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(),n.releaseCanvasManager();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(te({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 ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ue="undefined"==typeof Uint8Array?[]:new Uint8Array(256),le=0;64>le;le++)ue[ae.charCodeAt(le)]=le;var he=new Map,ce=(t,e,r)=>{if(t&&(fe(t,e)||"object"==typeof t)){var i=function(t,e){var r=he.get(t);return r||he.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 de(t,e,r,i){if(t instanceof Array)return t.map((t=>de(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+=ae[r[e]>>2],n+=ae[(3&r[e])<<4|r[e+1]>>4],n+=ae[(15&r[e+1])<<2|r[e+2]>>6],n+=ae[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:[de(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:[de(t.data,e,r,i),t.width,t.height]}:fe(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:ce(t,e,r)}:t}var ve=(t,e,r,i)=>t.map((t=>de(t,e,r,i))),fe=(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])))},pe=["webgl","webgl2"];function ge(t){return"nodeType"in t}function me(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||ge(o)&&Ct(o,e,i,!0))return n.call(this,s);ge(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&&pe.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 ye(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(ce(c,s,this),"tagName"in this.canvas&&!Ct(this.canvas,i,n,!0)){var d=ve(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 be,_e,we,xe='(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',Se="undefined"!=typeof self&&self.Blob&&new Blob([xe],{type:"text/javascript;charset=utf-8"});function ke(t){var e;try{if(!(e=Se&&(self.URL||self.webkitURL).createObjectURL(Se)))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(xe),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Ce{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,"refCount",0),a(this,"torndown",!1),a(this,"processMutation",((t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)}));var{sampling:e="all",win: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})}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,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=me(r,i,n,!0),u=new Map,l=new ke;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=me(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=ve(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(...ye(e.WebGLRenderingContext.prototype,d.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...ye(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 Te{constructor(t){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Pt),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],s=function(t){var e;r.styleMirror.has(t)?e=r.styleMirror.getId(t):(e=r.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,r)=>({rule:M(e,t.href),index:r})))})),i.styleIds.push(e)};for(var o of t)s(o);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,st.forEach((t=>t.abort())),st.clear()}trackStylesheetInLinkElement(t){}}class Ie{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 Ee=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Re=document.createElement("iframe");document.body.appendChild(Re),Array.from=(null==(n=Re.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Re)}}catch(t){console.debug("Unable to override Array.from",t)}var Me=new O;function Oe(t){void 0===t&&(t={});var{emit:e,checkoutEveryNms:i,checkoutEveryNth:n,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:h=null,maskTextClass:c="rr-mask",maskTextSelector:d=null,inlineStylesheet:v=!0,maskAllInputs:f,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:y,hooks:b,packFn:_,sampling:w={},dataURLOptions:x={},mousemoveWait:S,recordDOM:k=!0,recordCanvas:T=!1,recordCrossOriginIframes:I=!1,recordAfter:E=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:R=!1,collectFonts:M=!1,inlineImages:P=!1,plugins:L,keepIframeSrcFn:A=(()=>!1),ignoreCSSAttributes:N=new Set([]),errorHandler:F}=t;$t=F;var D=r({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},x),q=!I||window.parent===window,j=!1;if(!q)try{window.parent.document&&(j=!1)}catch(t){j=!0}if(q&&!e)throw new Error("emit function is required");if(!q&&!j)return()=>{};void 0!==S&&void 0===w.mousemove&&(w.mousemove=S),Me.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,V,W=0,Z=new Map,G=t=>{for(var e of L||[])e.eventProcessor&&(t=e.eventProcessor(t));return _&&!j&&(t=_(t)),t};be=(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(G(o),r);else if(j){var a={type:"rrweb",event:G(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(a,"*")}if(o.type===u.FullSnapshot)U=o,W=0;else if(o.type===u.IncrementalSnapshot){if(o.data.source===l.Mutation&&o.data.isAttachIframe)return;W++,(n&&W>=n||i&&o.timestamp-U.timestamp>i)&&_e(!0)}};var Q=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,i=new Set;if(t.adds.length>0)for(var n of t.adds){var s=Me.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&i.add(s)}t.removes.forEach((t=>{var{id:r}=t;if(!e||!e.has(r)){var n=X.getIframeElementById(r);n&&i.has(n)?X.forgetIframeId(r):(null==z||z(r),X.removeIframeById(r))}})),null==V||V(),X.cleanupDetachedIframes()}be({type:u.IncrementalSnapshot,data:r({source:l.Mutation},t)})},J=t=>be({type:u.IncrementalSnapshot,data:r({source:l.Scroll},t)}),K=t=>be({type:u.IncrementalSnapshot,data:r({source:l.CanvasMutation},t)}),Y=new Te({mutationCb:Q,adoptedStyleSheetCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.AdoptedStyleSheet},t)})}),X=new se({mirror:Me,mutationCb:Q,stylesheetManager:Y,recordCrossOriginIframes:I,wrappedEmit:be});for(var tt of L||[])tt.getMirror&&tt.getMirror({nodeMirror:Me,crossOriginIframeMirror:X.crossOriginIframeMirror,crossOriginIframeStyleMirror:X.crossOriginIframeStyleMirror});var et=new Ie;we=new Ce({recordCanvas:T,mutationCb:K,win:window,blockClass:s,blockSelector:o,mirror:Me,sampling:w.canvas,dataURLOptions:D});var rt=new oe({mutationCb:Q,scrollCb:J,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:X,stylesheetManager:Y,canvasManager:we,keepIframeSrcFn:A,processedNodeManager:et},mirror:Me});_e=function(t){if(void 0===t&&(t=!1),k){be({type:u.Meta,data:{href:window.location.href,width:St(),height:xt()}},t),Y.reset(),rt.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,onIframeListenerRegistered:b,onStylesheetLoad:_,stylesheetLoadTimeout:w,keepIframeSrcFn:x=(()=>!1),maxDepth:S}=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,onIframeListenerRegistered:b,onStylesheetLoad:_,stylesheetLoadTimeout:w,keepIframeSrcFn:x,newlyAddedElement:!1,maxDepth:S})}(document,{mirror:Me,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,Me)&&X.addIframe(t),Mt(t,Me)&&Y.trackLinkElement(t),Ot(t)&&rt.addShadowRoot(C.shadowRoot(t),document)},onIframeLoad(t,e){X.attachIframe(t,e),rt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){X.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){Y.attachLinkElement(t,e)},keepIframeSrcFn:A});if(!e)return console.warn("Failed to snapshot the document");be({type:u.FullSnapshot,data:{node:e,initialOffset:wt(window)}},t),Vt.forEach((t=>t.unlock())),I&&X.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Y.adoptStyleSheets(document.adoptedStyleSheets,Me.getId(document))}};try{var it=[];z=t=>{var e=Z.get(t);e&&(e.forEach((t=>{pt(t);var e=it.indexOf(t);-1!==e&&it.splice(e,1)})),Z.delete(t))},V=()=>{for(var[t]of Z){var e=Me.getNode(t);if(e)try{e.contentDocument&&e.contentDocument.defaultView||null==z||z(t)}catch(e){null==z||z(t)}else null==z||z(t)}};var nt=t=>{var e;return zt(ee)({mutationCb:Q,mousemoveCb:(t,e)=>be({type:u.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.MouseInteraction},t)}),scrollCb:J,viewportResizeCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.ViewportResize},t)}),inputCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.Input},t)}),mediaInteractionCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.MediaInteraction},t)}),styleSheetRuleCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.StyleSheetRule},t)}),styleDeclarationCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.StyleDeclaration},t)}),canvasMutationCb:K,fontCb:t=>be({type:u.IncrementalSnapshot,data:r({source:l.Font},t)}),selectionCb(t){be({type:u.IncrementalSnapshot,data:r({source:l.Selection},t)})},customElementCb(t){be({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:Me,iframeManager:X,stylesheetManager:Y,shadowDomManager:rt,processedNodeManager:et,canvasManager:we,ignoreCSSAttributes:N,plugins:(null==(e=null==L?void 0:L.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>be({type:u.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},b)};X.addLoadListener((t=>{try{var e=Me.getId(t),r=nt(t.contentDocument);if(it.push(r),-1!==e){var i=Z.get(e);i||Z.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}})),X.addPageHideListener((t=>{var e=Me.getId(t);null==z||z(e),Qt(t)}));var st=()=>{_e(),it.push(nt(document)),Ee=!0};return["interactive","complete"].includes(document.readyState)?st():(it.push(ft("DOMContentLoaded",(()=>{be({type:u.DomContentLoaded,data:{}}),"DOMContentLoaded"===E&&st()}))),it.push(ft("load",(()=>{be({type:u.Load,data:{}}),"load"===E&&st()}),window))),()=>{it.forEach((t=>pt(t))),et.destroy(),X.removeLoadListener(),X.destroy(),Z.clear(),Me.reset(),Ee=!1,$t=void 0}}catch(t){console.warn(t)}}Oe.addCustomEvent=(t,e)=>{if(!Ee)throw new Error("please add custom event after start recording");be({type:u.Custom,data:{tag:t,payload:e}})},Oe.freezePage=()=>{Vt.forEach((t=>t.freeze()))},Oe.takeFullSnapshot=t=>{if(!Ee)throw new Error("please take full snapshot after start recording");_e(t)},Oe.mirror=Me;var Pe=Object.defineProperty,Le=(t,e,r)=>((t,e,r)=>e in t?Pe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r)(t,"symbol"!=typeof e?e+"":e,r);class Ae{constructor(t){Le(this,"fileName"),Le(this,"functionName"),Le(this,"lineNumber"),Le(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 Ne=/(^|@)\S+:\d+/,Fe=/^\s*at .*(\S+:\d+|\(native\))/m,$e=/^(eval@)?(\[native code])?$/,De={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 Ae({functionName:s,fileName:o,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match($e)}),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 Ae({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ae({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 Ae({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 Ae({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(Ne)&&!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 Ae({functionName:i,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})}),this)}};function qe(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 je(t){return Array.isArray(t)}function Ue(t){return"object"==typeof t&&null!==t&&!je(t)}function He(t,e){if(0===e)return!0;var r=Object.keys(t);for(var i of r)if(Ue(t[i])&&He(t[i],e-1))return!0;return!1}function Be(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(Ue(o=e)&&Object.keys(o).length>r.numOfKeysLimit||"function"==typeof o||Ue(o)&&He(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]=je(l)?qe(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 ze={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 Ve(t,e,r){var i,n=r?Object.assign({},ze,r):ze,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=De.parse(e.error).map((t=>t.toString())),s=[Be(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=[Be("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Be("Uncaught (in promise)",n.stringifyOptions),Be(e.reason,n.stringifyOptions)]);var s=De.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=De.parse(new Error).map((t=>t.toString())).splice(1),c=("assert"===r?u.slice(1):u).map((t=>Be(t,n.stringifyOptions)));o++,n.lengthThreshold>o?t({level:r,trace:h,payload:c}):o===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Be("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 We,Ze=t=>({name:"rrweb/console@1",observer:Ve,options:t}),Ge=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Qe=function(t){return t.MinLength="min_length",t.MaxLength="max_length",t}({}),Je=["$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"],Ke="NativeGzipValidationError",Ye=t=>t.length>=2&&31===t[0]&&139===t[1],Xe=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),tr=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Ke,e},er=function(){var t=e((function*(t,e){18>t.size&&tr("too-short");var r=new Uint8Array(yield t.slice(0,10).arrayBuffer());Ye(r)&&8===r[2]||tr("invalid-header");var i=new DataView(yield t.slice(t.size-8).arrayBuffer());i.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(We)return We;We=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;We[t]=e>>>0}return We})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&tr("invalid-crc");var n=e.length>>>0;i.getUint32(4,!0)!==n&&tr("invalid-size")}));return function(e,r){return t.apply(this,arguments)}}();function rr(){return rr=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 er(l,n),l}catch(t){if(null!=i&&i.rethrow)throw t;return r&&console.error("Failed to gzip compress data",t),null}})),rr.apply(this,arguments)}var ir=["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"],nr=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var r=t.toLowerCase();return ir.concat(e).some((t=>{var e=t.toLowerCase();return-1!==r.indexOf(e)}))};function sr(t,e){return-1!==t.indexOf(e)}var or=function(t){return t.trim()},ar=function(t){return t.replace(/^\$/,"")},ur=Object.prototype,lr=ur.hasOwnProperty,hr=ur.toString,cr=Array.isArray||function(t){return"[object Array]"===hr.call(t)},dr=t=>"function"==typeof t,vr=t=>t===Object(t)&&!cr(t),fr=t=>{if(vr(t)){for(var e in t)if(lr.call(t,e))return!1;return!0}return!1},pr=t=>void 0===t,gr=t=>"[object String]"==hr.call(t),mr=t=>gr(t)&&0===t.trim().length,yr=t=>null===t,br=t=>pr(t)||yr(t),_r=t=>"[object Number]"==hr.call(t)&&t==t,wr=t=>_r(t)&&t>0,xr=t=>"[object Boolean]"===hr.call(t),Sr=t=>t instanceof FormData;function kr(t){return null===t||"object"!=typeof t}function Cr(t,e){return{}.toString.call(t)==="[object "+e+"]"}function Tr(t){return"undefined"!=typeof Event&&function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Event)}var Ir=[!0,"true",1,"1","yes"],Er=t=>sr(Ir,t),Rr=[!1,"false",0,"0","no"];function Mr(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),_r(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),Mr(n||r,e,r,i))}class Or{constructor(t){this.$t={},this.zt=t.zt,this.Zt=Mr(t.bucketSize,0,100,t.Gt),this.Qt=Mr(t.refillRate,0,this.Zt,t.Gt),this.Jt=Mr(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 Pr,Lr,Ar,Nr="Mobile",Fr="iOS",$r="Android",Dr="Tablet",qr=$r+" "+Dr,jr="iPad",Ur="Apple",Hr=Ur+" Watch",Br="Safari",zr="BlackBerry",Vr="Samsung",Wr=Vr+"Browser",Zr=Vr+" Internet",Gr="Chrome",Qr=Gr+" OS",Jr=Gr+" "+Fr,Kr="Internet Explorer",Yr=Kr+" "+Nr,Xr="Opera",ti=Xr+" Mini",ei="Edge",ri="Microsoft "+ei,ii="Firefox",ni=ii+" "+Fr,si="Nintendo",oi="PlayStation",ai="Xbox",ui=$r+" "+Nr,li=Nr+" "+Br,hi="Windows",ci=hi+" Phone",di="Nokia",vi="Ouya",fi="Generic",pi=fi+" "+Nr.toLowerCase(),gi=fi+" "+Dr.toLowerCase(),mi="Konqueror",yi="Oculus Browser",bi="Vivaldi",_i="Yandex",wi="Whale",xi="DuckDuckGo",Si="Pale Moon",ki="Waterfox",Ci="Brave",Ti="Google Search App",Ii="(\\d+(\\.\\d+)?)",Ei=new RegExp("Version/"+Ii),Ri=new RegExp(ai,"i"),Mi=new RegExp(oi+" \\w+","i"),Oi=new RegExp(si+" \\w+","i"),Pi=new RegExp(zr+"|PlayBook|BB10","i"),Li={"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"},Ai=function(t,e,r,i){e=e||"";var n=function(t){return null!=t&&t.brave?Ci:null}(r);return n||(null!=i&&i.detectGoogleSearchApp&&sr(t,"GSA/")?Ti:sr(t," OPR/")&&sr(t,"Mini")?ti:sr(t," OPR/")?Xr:Pi.test(t)?zr:sr(t,"IE"+Nr)||sr(t,"WPDesktop")?Yr:sr(t,"OculusBrowser")?yi:sr(t,Wr)?Zr:sr(t,ei)||sr(t,"Edg/")?ri:sr(t,bi+"/")?bi:sr(t,"YaBrowser/")?_i:sr(t,wi+"/")?wi:sr(t,xi+"/")||sr(t,"Ddg/")?xi:sr(t,"FBIOS")?"Facebook "+Nr:sr(t,"UCWEB")||sr(t,"UCBrowser")?"UC Browser":sr(t,"CriOS")?Jr:sr(t,"CrMo")||sr(t,Gr)?Gr:sr(t,$r)&&sr(t,Br)?ui:sr(t,"FxiOS")?ni:sr(t.toLowerCase(),mi.toLowerCase())?mi:sr(t,Ci+"/")?Ci:((t,e)=>e&&sr(e,Ur)||function(t){return sr(t,Br)&&!sr(t,Gr)&&!sr(t,$r)}(t))(t,e)?sr(t,Nr)?li:Br:sr(t,"PaleMoon/")?Si:sr(t,ki+"/")?ki:sr(t,ii)?ii:sr(t,"MSIE")||sr(t,"Trident/")?Kr:sr(t,"Gecko")?ii:"")},Ni={[Yr]:[new RegExp("rv:"+Ii)],[ri]:[new RegExp(ei+"?\\/"+Ii)],[Gr]:[new RegExp("("+Gr+"|CrMo)\\/"+Ii)],[Jr]:[new RegExp("CriOS\\/"+Ii)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ii)],[Br]:[Ei],[li]:[Ei],[Xr]:[new RegExp("(Opera|OPR)\\/"+Ii)],[ii]:[new RegExp(ii+"\\/"+Ii)],[ni]:[new RegExp("FxiOS\\/"+Ii)],[mi]:[new RegExp("Konqueror[:/]?"+Ii,"i")],[zr]:[new RegExp(zr+" "+Ii),Ei],[ui]:[new RegExp("android\\s"+Ii,"i")],[Zr]:[new RegExp(Wr+"\\/"+Ii)],[yi]:[new RegExp("OculusBrowser\\/"+Ii)],[bi]:[new RegExp(bi+"\\/"+Ii)],[_i]:[new RegExp("YaBrowser\\/"+Ii)],[wi]:[new RegExp(wi+"\\/"+Ii)],[Ci]:[new RegExp(Ci+"\\/"+Ii)],[xi]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Ii)],[Si]:[new RegExp("PaleMoon\\/"+Ii)],[ki]:[new RegExp(ki+"\\/"+Ii)],[Ti]:[new RegExp("GSA\\/"+Ii)],[Kr]:[new RegExp("(rv:|MSIE )"+Ii)],Mozilla:[new RegExp("rv:"+Ii)]},Fi=function(t,e,r,i){var n=Ai(t,e,r,i),s=Ni[n];if(pr(s))return null;for(var o=0;s.length>o;o++){var a=t.match(s[o]);if(a)return parseFloat(a[a.length-2])}return null},$i=[[new RegExp(ai+"; "+ai+" (.*?)[);]","i"),t=>[ai,t&&t[1]||""]],[new RegExp(si,"i"),[si,""]],[new RegExp(oi,"i"),[oi,""]],[Pi,[zr,""]],[new RegExp(hi,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[ci,""];if(new RegExp(Nr).test(e)&&!/IEMobile\b/.test(e))return[hi+" "+Nr,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var i=Li[r[1]]||"";return/arm/i.test(e)&&(i="RT"),[hi,i]}return[hi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[Fr,[t[3],t[4],t[5]||"0"].join(".")]:[Fr,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=pr(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+$r+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+$r+")","i"),t=>t&&t[2]?[$r,[t[2],t[3],t[4]||"0"].join(".")]:[$r,""]],[/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/,[Qr,""]],[/Linux|debian/i,["Linux",""]]],Di=function(t){return Oi.test(t)?si:Mi.test(t)?oi:Ri.test(t)?ai:new RegExp(vi,"i").test(t)?vi:new RegExp("("+ci+"|WPDesktop)","i").test(t)?ci:/iPad/.test(t)?jr:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Hr:Pi.test(t)?zr:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(di,"i").test(t)?di:/(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(Nr).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)?$r:qr:new RegExp("(pda|"+Nr+")","i").test(t)?pi:new RegExp(Dr,"i").test(t)&&!new RegExp(Dr+" pc","i").test(t)?gi:""},qi=function(t,e){var r,i,n,s,o=Di(t);return o===jr||o===qr||"Kobo"===o||"Kindle Fire"===o||o===gi?Dr:o===si||o===ai||o===oi||o===vi?"Console":o===Hr?"Wearable":o?Nr:"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)?Nr:Dr:"Desktop"},ji={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}},Ui=ji.info;function Hi(t){if(xr(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(cr(t))return{arrayValue:{values:t.map((t=>Hi(t)))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}function Bi(t){var e=[];for(var r in t){var i=t[r];yr(i)||pr(i)||e.push({key:r,value:Hi(i)})}return e}function zi(t,e){if(t){var r=t.find((t=>t.type===e));return null==r?void 0:r.value}}function Vi(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return Ar&&r.length===Lr||(Lr=r.length,Ar=r.reduce(((r,i)=>{Pr||(Pr={});var n=Pr[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,Pr[i]=[u,l];break}}return r}),{})),Ar}}class Wi{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&&cr(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:Vi(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 Zi="?";function Gi(t,e,r,i,n){var s={platform:t,filename:e,function:"<anonymous>"===r?Zi:r,in_app:!0};return pr(i)||(s.lineno=i),pr(n)||(s.colno=n),s}var Qi=(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]:Zi,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Ji=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ki=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Yi=/\((\S*)(?::(\d+))(?::(\d+))\)/,Xi=(t,e)=>{var r=Ji.exec(t);if(r){var[,i,n,s]=r;return Gi(e,i,Zi,+n,+s)}var o=Ki.exec(t);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=Yi.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[u,l]=Qi(o[1]||Zi,o[2]);return Gi(e,l,u,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},tn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,en=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,rn=(t,e)=>{var r=tn.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=en.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]||Zi;return[s,n]=Qi(s,n),Gi(e,n,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},nn=/\(error: (.*)\)/,sn=50;class on{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=gr(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 Cr(t,"DOMException")}isDOMError(t){return Cr(t,"DOMError")}}class an{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 un{constructor(){}match(t){return Cr(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 ln=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class hn{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(ln);return i&&(e=i[1],r=i[2]),[e,r]}}var cn=["fatal","error","warning","log","info","debug"];function dn(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 vn{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 Tr(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: "+dn(t)}isSeverityLevel(t){return gr(t)&&!mr(t)&&cn.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 fn{match(t){return Tr(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+dn(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}class pn{match(t){return kr(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 gn{match(t){return Cr(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Tr(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 kr(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 mn="$message",yn="$timestamp",bn=new Set([mn,yn]),_n={enabled:!0,max_bytes:32768};function wn(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:_n.enabled,max_bytes:Sn(t.max_bytes,_n.max_bytes)}:r({},_n)}class xn{constructor(t){this.Yt=[],this.Xt=0,this.qt=wn(t)}setConfig(t){this.qt=wn(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(!vr(r))return;var i=r,n=i[mn],s=i[yn];if(!gr(n)||0===n.trim().length)return;if(!gr(s)&&!_r(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 Sn(t,e){if(!_r(t)||t===1/0||t===-1/0)return e;var r=Math.floor(t);return 0>r?e:r}var kn="undefined"!=typeof window?window:void 0,Cn="undefined"!=typeof globalThis?globalThis:kn;"undefined"==typeof self&&(Cn.self=Cn),"undefined"==typeof File&&(Cn.File=function(){});var Tn=null==Cn?void 0:Cn.navigator,In=null==Cn?void 0:Cn.document,En=null==Cn?void 0:Cn.location,Rn=null==Cn?void 0:Cn.fetch,Mn=null!=Cn&&Cn.XMLHttpRequest&&"withCredentials"in new Cn.XMLHttpRequest?Cn.XMLHttpRequest:void 0,On=null==Cn?void 0:Cn.AbortController,Pn=null==Cn?void 0:Cn.CompressionStream,Ln=null==Tn?void 0:Tn.userAgent,An=null!=kn?kn:{},Nn=t=>t instanceof Document,Fn="1.384.1",$n={DEBUG:!1,LIB_VERSION:Fn,LIB_NAME:"web",JS_SDK_VERSION:Fn},Dn=function(t,e){var{debugEnabled:r}=void 0===e?{}:e,i={k(e){if(kn&&($n.DEBUG||An.POSTHOG_DEBUG||r)&&!pr(kn.console)&&kn.console){for(var i=("__rrweb_original__"in kn.console[e]?kn.console[e].__rrweb_original__:kn.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)=>Dn(t+" "+e,r)};return i},qn=Dn("[PostHog.js]"),jn=qn.createLogger;function Un(t,e){cr(t)&&t.forEach(e)}function Hn(t,e){if(!br(t))if(cr(t))t.forEach(e);else if(Sr(t))t.forEach(((t,r)=>e(t,r)));else for(var r in t)lr.call(t,r)&&e(t[r],r)}var Bn=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 zn(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 Vn=function(t){try{return t()}catch(t){return}},Wn=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){qn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),qn.critical(t)}}},Zn=function(t){var e={};return Hn(t,(function(t,r){(gr(t)&&t.length>0||_r(t))&&(e[r]=t)})),e};var Gn=["herokuapp.com","vercel.app","netlify.app"];function Qn(t){var e=null==t?void 0:t.hostname;if(!gr(e))return!1;var r=e.split(".").slice(-2).join(".");for(var i of Gn)if(r===i)return!1;return!0}function Jn(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 Kn(t){return"ph_toolbar_internal"===t.name}var Yn=t=>{var e=null==In?void 0:In.createElement("a");return pr(e)?null:(e.href=t,e)},Xn=function(t,e){var r,i;void 0===e&&(e="&");var n=[];return Hn(t,(function(t,e){pr(t)||pr(e)||"undefined"===e||(r=encodeURIComponent(t instanceof File?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)})),n.join(e)},ts=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(!cr(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch(t){qn.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},es=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("=");cr(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},rs=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null};function is(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n=r(i);return dr(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=n,()=>{t[e]===n&&(t[e]=i)}}catch(t){return()=>{}}}function ns(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 ss="$people_distinct_id",os="$device_id",as="__alias",us="__timers",ls="$autocapture_disabled_server_side",hs="$heatmaps_enabled_server_side",cs="$exception_capture_enabled_server_side",ds="$error_tracking_suppression_rules",vs="$error_tracking_capture_extension_exceptions",fs="$web_vitals_enabled_server_side",ps="$dead_clicks_enabled_server_side",gs="$product_tours_enabled_server_side",ms="$web_vitals_allowed_metrics",ys="$session_recording_remote_config",bs="$replay_override_sampling",_s="$replay_override_linked_flag",ws="$replay_override_url_trigger",xs="$replay_override_event_trigger",Ss="$sesid",ks="$session_is_sampled",Cs="$enabled_feature_flags",Ts="$active_feature_flags",Is="$early_access_features",Es="$feature_flag_details",Rs="$feature_flag_payloads",Ms="$feature_flag_request_id",Os="$override_feature_flags",Ps="$override_feature_flag_payloads",Ls="$stored_person_properties",As="$stored_group_properties",Ns="$surveys",Fs="$surveys_loaded_at",$s="$surveys_activated",Ds="ph_product_tours",qs="$flag_call_reported",js="$flag_call_reported_session_id",Us="$feature_flag_errors",Hs="$feature_flag_evaluated_at",Bs="$user_state",zs="$client_session_props",Vs="$capture_rate_limit",Ws="$initial_campaign_params",Zs="$initial_referrer_info",Gs="$initial_person_info",Qs="$epp",Js="__POSTHOG_TOOLBAR__",Ks="$posthog_cookieless",Ys="$sdk_debug_extensions_init_method",Xs="$sdk_debug_extensions_init_time_ms",to="$sdk_debug_recording_script_not_loaded",eo="PostHog loadExternalDependency extension not found.",ro="on_reject",io="always",no="anonymous",so="identified",oo="identified_only",ao="visibilitychange",uo="beforeunload",lo="$pageview",ho="$pageleave",co="$identify",vo="$groupidentify",fo=1,po=3,go=11;function mo(t){return t instanceof Element&&(t.id===Js||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function yo(t){return!!t&&t.nodeType===fo}function bo(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function _o(t){return!!t&&t.nodeType===po}function wo(t){return!!t&&t.nodeType===go&&yo(t.host)}function xo(t){return t?or(t).split(/\s+/):[]}function So(t){var e=null==kn?void 0:kn.location.href;return!!(e&&t&&t.some((t=>e.match(t))))}function ko(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 xo(e)}function Co(t){return br(t)?null:or(t).split(/(\s+)/).filter((t=>Go(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function To(t){var e="";return jo(t)&&!Uo(t)&&t.childNodes&&t.childNodes.length&&Hn(t.childNodes,(function(t){var r;_o(t)&&t.textContent&&(e+=null!==(r=Co(t.textContent))&&void 0!==r?r:"")})),or(e)}function Io(t){return pr(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Eo=["a","button","form","input","select","textarea","label"];function Ro(t,e){if(pr(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||!yo(e))&&e}var Oo=["next","previous","prev",">","<"],Po=[...Oo,"+","-","−","–"],Lo=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,Ao=[".ph-no-deadclick",".ph-no-capture"],No=[".ph-no-rageclick",".ph-no-capture"],Fo=["","text","search","email","password","url","tel","number"];function $o(t,e){if(!kn||Do(t))return!1;var r,i,n,s,o;if(xr(e)?(r=!!e&&No,i=void 0,n=!1):(r=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:No,i=null==e?void 0:e.content_ignorelist,n=null!==(o=null==e?void 0:e.ignore_text_selection)&&void 0!==o&&o),!1===r)return!1;if(n&&function(t){return!(!t||!yo(t))&&(!!bo(t,"textarea")||(bo(t,"input")?sr(Fo,(t.getAttribute("type")||"").toLowerCase()):function(t){if(t.isContentEditable)return!0;var e=null==t.getAttribute?void 0:t.getAttribute("contenteditable");return"true"===e||""===e}(t)))}(t))return!1;var{targetElementList:a}=qo(t,!1);return!function(t,e){if(!1===t||pr(t))return!1;var r;if(!0===t)r=Oo;else{if(!cr(t))return!1;if(t.length>10)return qn.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=>Lo(e,t)||Lo(i,t)))}))}(i,a.map((t=>{var e;return{safeText:To(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Ro(a,r)}var Do=t=>!t||bo(t,"html")||!yo(t),qo=(t,e)=>{if(!kn||Do(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],n=t;n.parentNode&&!bo(n,"body");)if(wo(n.parentNode))i.push(n.parentNode.host),n=n.parentNode.host;else{var s=Mo(n);if(!s)break;if(e||Eo.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=kn.getComputedStyle(s);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}i.push(s),n=s}return{parentIsUsefulElement:r,targetElementList:i}};function jo(t){for(var e=t;e.parentNode&&!bo(e,"body");e=e.parentNode){var r=ko(e);if(sr(r,"ph-sensitive")||sr(r,"ph-no-capture"))return!1}if(sr(ko(t),"ph-include"))return!0;var i=t.type||"";if(gr(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var n=t.name||t.id||"";return!gr(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 Uo(t){return!!(bo(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||bo(t,"select")||bo(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var Ho="(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})",Bo=new RegExp("^(?:"+Ho+")$"),zo=new RegExp(Ho),Vo="\\d{3}-?\\d{2}-?\\d{4}",Wo=new RegExp("^("+Vo+")$"),Zo=new RegExp("("+Vo+")");function Go(t,e){if(void 0===e&&(e=!0),br(t))return!1;if(gr(t)){if(t=or(t),(e?Bo:zo).test((t||"").replace(/[- ]/g,"")))return!1;if((e?Wo:Zo).test(t))return!1}return!0}function Qo(t){var e=To(t);return Go(e=(e+" "+Jo(t)).trim())?e:""}function Jo(t){var e="";return t&&t.childNodes&&t.childNodes.length&&Hn(t.childNodes,(function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=To(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Jo(t)).trim())}catch(t){qn.error("[AutoCapture]",t)}})),e}function Ko(t){return t.replace(/"|\\"/g,'\\"')}function Yo(t){var e=t.attr__class;return e?cr(e)?e:xo(e):void 0}var Xo={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"]},ta=jn("[Recorder]"),ea=t=>"navigation"===t.entryType,ra=t=>"resource"===t.entryType;function ia(t,e){return!!e&&(xr(e)||e[t])}function na(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}function sa(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:!!na(e)&&t(e.url)}catch(t){return!1}}(n))return!1;if(xr(r))return!0;if(cr(r))return s(r);var o=r[e];return xr(o)?o:s(o)}function oa(t,e,r,i,n,s){return aa.apply(this,arguments)}function aa(){return aa=e((function*(t,e,r,i,n,s){if(void 0===s&&(s=0),s>10)return ta.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(ra(o=t[s])&&o.initiatorType===e&&(pr(i)||o.startTime>=i)&&(pr(n)||n>=o.startTime))return t[s];var o}(t.performance.getEntriesByName(r));return o||(yield new Promise((t=>setTimeout(t,50*s))),oa(t,e,r,i,n,s+1))})),aa.apply(this,arguments)}function ua(t){var{body:e,options:r,url:i}=t;if(br(e))return null;var{hostname:n,isHostDenied:s}=ns(i,r);if(s)return n+" is in deny list";if(gr(e))return e;if(Nn(e))return e.textContent;if(Sr(e))return Xn(e);if(vr(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 la=t=>!yr(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ha(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:pr(a)?void 0:Math.round(a),endTime:pr(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(la(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 ca=["video/","audio/"];function da(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 va(){return va=e((function*(t){var{r:e,options:r,url:i}=t,{hostname:n,isHostDenied:s}=ns(i,r);return s?Promise.resolve(n+" is in deny list"):da(e)})),va.apply(this,arguments)}function fa(){return fa=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=ca.some((t=>null==s?void 0:s.startsWith(t)));if(s&&o)return"Content-Type "+s+" is not supported";var{hostname:a,isHostDenied:u}=ns(n,i);return u?a+" is in deny list":null}({r:e,options:r,url:i});return yr(n)?da(e):Promise.resolve(n)})),fa.apply(this,arguments)}var pa=null;function ga(t,i,n){if(!("performance"in i))return()=>{};if(pa)return ta.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Xo,n):Xo,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=>ea(t)||ra(t)&&r.initiatorTypes.includes(t.initiatorType)));t({requests:i.flatMap((t=>ha({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=>ea(t)||ra(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:i.flatMap((t=>ha({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=ia("request",r.recordHeaders),n=ia("response",r.recordHeaders),s=is(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=>(sa({type:"request",headers:g,url:a,recordBody:r.recordBody})&&(p.requestBody=ua({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),sa({type:"response",headers:i,url:a,recordBody:r.recordBody})&&(p.responseBody=ua({body:v.response,options:r,url:a})),oa(e,"xmlhttprequest",f.url,c,d).then((e=>{var r=ha({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=ia("request",i.recordHeaders),s=ia("response",i.recordHeaders),o=is(r,"fetch",(o=>function(){var a=e((function*(e,a){var u,l,h,c,d=new Request(e,a),v={};try{var f={};d.headers.forEach(((t,e)=>{f[e]=t})),n&&(v.requestHeaders=f),!(vr(c=null==a?void 0:a.body)&&dr(c.getReader)&&dr(c.tee))&&sa({type:"request",headers:f,url:e,recordBody:i.recordBody})&&(v.requestBody=yield function(t){return va.apply(this,arguments)}({r:d,options:i,url:e})),l=r.performance.now(),u=na(e)?yield o(d):yield o(e,a),h=r.performance.now();var p={};return u.headers.forEach(((t,e)=>{p[e]=t})),s&&(v.responseHeaders=p),sa({type:"response",headers:p,url:e,recordBody:i.recordBody})&&(v.responseBody=yield function(t){return fa.apply(this,arguments)}({r:u,options:i,url:e})),u}finally{oa(r,"fetch",d.url,l,h).then((e=>{var r,i=ha({entry:e,method:d.method,status:null==(r=u)?void 0:r.status,networkRequest:v,start:l,end:h,url:d.url,initiatorType:"fetch"});t({requests:i})})).catch((()=>{}))}}));return function(t,e){return a.apply(this,arguments)}}()));return()=>{o()}}(o,i,s)),pa=()=>{a(),u(),l(),pa=null}}var ma=t=>({name:"rrweb/network@1",observer:ga,options:t});An.__PosthogExtensions__=An.__PosthogExtensions__||{},An.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Ze,getRecordNetworkPlugin:ma},An.__PosthogExtensions__.rrweb={record:Oe,version:"v2",wasMaxDepthReached:()=>ht,resetMaxDepthState(){ht=!1,lt=!1}},An.rrweb={record:Oe,version:"v2"},An.rrwebConsoleRecord={getRecordConsolePlugin:Ze},An.getRecordNetworkPlugin=ma;var ya,ba,_a,wa,xa,Sa,ka,Ca,Ta,Ia,Ea,Ra,Ma={},Oa=[],Pa=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,La=Array.isArray;function Aa(t,e){for(var r in e)t[r]=e[r];return t}function Na(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Fa(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?ya.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 $a(t,o,i,n,null)}function $a(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?++_a:n,__i:-1,__u:0};return null==n&&null!=ba.vnode&&ba.vnode(s),s}function Da(t){return t.children}function qa(t,e){this.props=t,this.context=e}function ja(t,e){if(null==e)return t.__?ja(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?ja(t):null}function Ua(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 Ua(t)}}function Ha(t){(!t.__d&&(t.__d=!0)&&wa.push(t)&&!$.__r++||xa!=ba.debounceRendering)&&((xa=ba.debounceRendering)||Sa)($)}function $(){for(var t,e,r,i,n,s,o,a=1;wa.length;)wa.length>a&&wa.sort(ka),t=wa.shift(),a=wa.length,t.__d&&(r=void 0,i=void 0,n=(i=(e=t).__v).__e,s=[],o=[],e.__P&&((r=Aa({},i)).__v=i.__v+1,ba.vnode&&ba.vnode(r),Qa(e.__P,r,i,e.__n,e.__P.namespaceURI,32&i.__u?[n]:null,s,null==n?ja(i):n,!!(32&i.__u),o),r.__v=i.__v,r.__.__k[r.__i]=r,Ka(s,r,o),i.__e=i.__=null,r.__e!=n&&Ua(r)));$.__r=0}function Ba(t,e,r,i,n,s,o,a,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||Oa,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]=$a(null,o,null,null,null):La(o)?o=t.__k[s]=$a(Da,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=t.__k[s]=$a(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=Va(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=ja(a)),tu(a,a));return i}(r,e,y,u,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1==v.__i?Ma:y[v.__i]||Ma,v.__i=c,g=Qa(t,v,d,n,s,o,a,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&Xa(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=za(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 za(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=za(n[s],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=ja(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function Va(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 Wa(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||Pa.test(e)?r:r+"px"}function Za(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||Wa(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||Wa(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace(Ca,"$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=Ta,t.addEventListener(e,s?Ea:Ia,s)):t.removeEventListener(e,s?Ea:Ia,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 Ga(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e.t)e.t=Ta++;else if(r.u>e.t)return;return r(ba.event?ba.event(e):e)}}}function Qa(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=ba.__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 qa(m,_),c.constructor=T,c.render=eu),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=Aa({},c.__s)),Aa(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=ba.__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=Aa(Aa({},i),c.getChildContext())),y&&!d&&null!=c.getSnapshotBeforeUpdate&&(p=c.getSnapshotBeforeUpdate(v,f)),k=h,null!=h&&h.type===Da&&null==h.key&&(k=Ya(h.props.children)),a=Ba(t,La(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--;)Na(s[C]);Ja(e)}else e.__e=r.__e,e.__k=r.__k,t.then||Ja(e);ba.__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||Ma,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&&(ba.__m&&ba.__m(e,s),a=!1),s=null}if(null==y)g===m||a&&t.data==m||(t.data=m);else{if(s=s&&ya.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;Za(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||Za(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=""),Ba("template"==e.type?t.content:t,La(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:r.__k&&ja(r,0),a,u),null!=s)for(l=s.length;l--;)Na(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])&&Za(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&Za(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,s,o,u,l);return(h=ba.diffed)&&h(e),128&e.__u?void 0:a}function Ja(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Ja)}function Ka(t,e,r){for(var i=0;r.length>i;i++)Xa(r[i],r[++i],r[++i]);ba.__c&&ba.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){ba.__e(t,e.__v)}}))}function Ya(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:La(t)?t.map(Ya):Aa({},t)}function Xa(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){ba.__e(t,r)}}function tu(t,e,r){var i,n;if(ba.unmount&&ba.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Xa(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){ba.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(n=0;i.length>n;n++)i[n]&&tu(i[n],e,r||"function"!=typeof t.type);r||Na(t.__e),t.__c=t.__=t.__e=void 0}function eu(t,e,r){return this.constructor(t,r)}function ru(t,e,r){var i,n,s;e==document&&(e=document.documentElement),ba.__&&ba.__(t,e),i=e.__k,n=[],s=[],Qa(e,t=e.__k=Fa(Da,null,[t]),i||Ma,Ma,e.namespaceURI,i?null:e.firstChild?ya.call(e.childNodes):null,n,i?i.__e:e.firstChild,!1,s),Ka(n,t,s)}ya=Oa.slice,ba={__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}},_a=0,qa.prototype.setState=function(t,e){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Aa({},this.state),"function"==typeof t&&(t=t(Aa({},r),this.props)),t&&Aa(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),Ha(this))},qa.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ha(this))},qa.prototype.render=Da,wa=[],Sa="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ka=function(t,e){return t.__v.__b-e.__v.__b},$.__r=0,Ca=/(PointerCapture)$|Capture$/i,Ta=0,Ia=Ga(!1),Ea=Ga(!0),Ra=0;var iu,nu,su,ou,au=0,uu=[],lu=ba,hu=lu.__b,cu=lu.__r,du=lu.diffed,vu=lu.__c,fu=lu.unmount,pu=lu.__;function gu(t,e){lu.__h&&lu.__h(nu,t,au||e),au=0;var r=nu.__H||(nu.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function mu(t){return au=1,function(t,e,r){var i=gu(iu++,2);if(i.t=t,!i.__c&&(i.__=[Eu(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=nu,!nu.__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};nu.__f=!0;var s=nu.shouldComponentUpdate,o=nu.componentWillUpdate;nu.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)},nu.shouldComponentUpdate=n}return i.__N||i.__}(Eu,t)}function yu(t,e){var r=gu(iu++,3);!lu.__s&&Iu(r.__H,e)&&(r.__=t,r.u=e,nu.__H.__h.push(r))}function bu(t){return au=5,_u((function(){return{current:t}}),[])}function _u(t,e){var r=gu(iu++,7);return Iu(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function wu(t){var e=nu.context[t.__c],r=gu(iu++,9);return r.c=t,e?(null==r.__&&(r.__=!0,e.sub(nu)),e.props.value):t.__}function xu(){for(var t;t=uu.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Cu),t.__H.__h.forEach(Tu),t.__H.__h=[]}catch(e){t.__H.__h=[],lu.__e(e,t.__v)}}lu.__b=function(t){nu=null,hu&&hu(t)},lu.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),pu&&pu(t,e)},lu.__r=function(t){cu&&cu(t),iu=0;var e=(nu=t.__c).__H;e&&(su===nu?(e.__h=[],nu.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.forEach(Cu),e.__h.forEach(Tu),e.__h=[],iu=0)),su=nu},lu.diffed=function(t){du&&du(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==uu.push(e)&&ou===lu.requestAnimationFrame||((ou=lu.requestAnimationFrame)||ku)(xu)),e.__H.__.forEach((function(t){t.u&&(t.__H=t.u),t.u=void 0}))),su=nu=null},lu.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Cu),t.__h=t.__h.filter((function(t){return!t.__||Tu(t)}))}catch(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],lu.__e(r,t.__v)}})),vu&&vu(t,e)},lu.unmount=function(t){fu&&fu(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach((function(t){try{Cu(t)}catch(t){e=t}})),r.__H=void 0,e&&lu.__e(e,r.__v))};var Su="function"==typeof requestAnimationFrame;function ku(t){var e,r=function(){clearTimeout(i),Su&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);Su&&(e=requestAnimationFrame(r))}function Cu(t){var e=nu,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),nu=e}function Tu(t){var e=nu;t.__c=t.__(),nu=e}function Iu(t,e){return!t||t.length!==e.length||e.some((function(e,r){return e!==t[r]}))}function Eu(t,e){return"function"==typeof e?e(t):e}var Ru={Activation:"events",Cancellation:"cancelEvents"},Mu={Button:"button",Tab:"tab",Selector:"selector"},Ou={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"},Pu={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Lu={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Au={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Nu={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Fu={Once:"once",Recurring:"recurring",Always:"always"},$u={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Du={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"},qu={Popover:"popover",Inline:"inline"};function ju(t){return"$survey_response_"+t}function Uu(t,e){if(!e)return null;var r=t[ju(e)];return cr(r)?[...r]:r}function Hu(t,e){void 0===t&&(t={});var i={};return e.questions.forEach((e=>{if(!pr(e.originalQuestionIndex)){var r,n=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,s=Uu(t,e.id);pr(s)||(i[n]=s)}})),r({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:Uu(t,e.id)})))},t,i)}function Bu(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 zu(t){return"string"==typeof t&&t.trim()?t.trim():null}function Vu(t){return t.toLowerCase()}function Wu(t,e,r){if(!t||!e)return null;var i=Vu(e),n=Object.keys(t).find((t=>Vu(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=>Vu(t)===s));if(o)return null==r||r.debug("Found base language translation match: "+o+" (from "+e+")"),o}return null}function Zu(t,e,i){var n,s=Wu(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),pr(l.name)||(o.name=l.name,a=!0),o.appearance?(o.appearance=r({},o.appearance),pr(l.thankYouMessageHeader)||(o.appearance.thankYouMessageHeader=l.thankYouMessageHeader,a=!0),pr(l.thankYouMessageDescription)||(o.appearance.thankYouMessageDescription=l.thankYouMessageDescription,a=!0),pr(l.thankYouMessageCloseButtonText)||(o.appearance.thankYouMessageCloseButtonText=l.thankYouMessageCloseButtonText,a=!0)):function(t){return!pr(t.thankYouMessageHeader)||!pr(t.thankYouMessageDescription)||!pr(t.thankYouMessageCloseButtonText)}(l)&&(a=!0))}var h=t.questions.map((t=>function(t,e,i){var n,s=Wu(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 pr(o.question)||(a.question=o.question,u=!0),pr(o.description)||(a.description=o.description,u=!0),pr(o.buttonText)||(a.buttonText=o.buttonText,u=!0),"link"in a&&!pr(o.link)&&(a.link=o.link,u=!0),"lowerBoundLabel"in a&&!pr(o.lowerBoundLabel)&&(a.lowerBoundLabel=o.lowerBoundLabel,u=!0),"upperBoundLabel"in a&&!pr(o.upperBoundLabel)&&(a.upperBoundLabel=o.upperBoundLabel,u=!0),"choices"in a&&function(t){return cr(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 Gu=jn("[Surveys]");function Qu(t){return!(!t.start_date||t.end_date)}function Ju(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function Ku(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var Yu="seenSurvey_",Xu="inProgressSurvey_",tl=(t,e)=>{var r=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(r=""+t+e.id+"_"+e.current_iteration),r},el=t=>tl(Yu,t),rl=t=>{try{var e=el(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Gu.error("Failed to persist survey seen state",t)}},il=[Lu.Popover,Lu.Widget,Lu.API],nl={ignoreConditions:!1,ignoreDelay:!1,displayType:qu.Popover};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return _r(t)&&isFinite(t)&&Math.floor(t)===t});class sl{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 sl(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 sl(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 ol{constructor(){this.S=0,this.C=0,this.I=new ll}generate(){var t=this.generateOrAbort();if(pr(t)){this.S=0;var e=this.generateOrAbort();if(pr(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 sl.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 al,ul=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};kn&&!pr(kn.crypto)&&crypto.getRandomValues&&(ul=t=>crypto.getRandomValues(t));class ll{constructor(){this.M=new Uint32Array(8),this.R=1/0}nextUint32(){return this.M.length>this.R||(ul(this.M),this.R=0),this.M[this.R++]}}var hl=()=>cl().toString(),cl=()=>(al||(al=new ol)).generate(),dl=["fatal","error","warning","log","info","debug"],vl={GZipJS:"gzip-js",Base64:"base64"},fl=Uint8Array,pl=Uint16Array,gl=Uint32Array,ml=new fl([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]),yl=new fl([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]),bl=new fl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_l=function(t,e){for(var r=new pl(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new gl(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]},wl=_l(ml,2),xl=wl[1];wl[0][28]=258,xl[258]=28;for(var Sl=_l(yl,0)[1],kl=new pl(32768),Cl=0;32768>Cl;++Cl){var Tl=(43690&Cl)>>>1|(21845&Cl)<<1;kl[Cl]=((65280&(Tl=(61680&(Tl=(52428&Tl)>>>2|(13107&Tl)<<2))>>>4|(3855&Tl)<<4))>>>8|(255&Tl)<<8)>>>1}var Il=function(t,e,r){for(var i=t.length,n=0,s=new pl(e);i>n;++n)++s[t[n]-1];var o,a=new pl(e);for(n=0;e>n;++n)a[n]=a[n-1]+s[n-1]<<1;if(r){o=new pl(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[kl[c]>>>u]=l}else for(o=new pl(i),n=0;i>n;++n)o[n]=kl[a[t[n]-1]++]>>>15-t[n];return o},El=new fl(288);for(Cl=0;144>Cl;++Cl)El[Cl]=8;for(Cl=144;256>Cl;++Cl)El[Cl]=9;for(Cl=256;280>Cl;++Cl)El[Cl]=7;for(Cl=280;288>Cl;++Cl)El[Cl]=8;var Rl=new fl(32);for(Cl=0;32>Cl;++Cl)Rl[Cl]=5;var Ml=Il(El,9,0),Ol=Il(Rl,5,0),Pl=function(t){return(t/8>>0)+(7&t&&1)},Ll=function(t,e,r){(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof pl?pl:t instanceof gl?gl:fl)(r-e);return i.set(t.subarray(e,r)),i},Al=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},Nl=function(t,e,r){var i=e/8>>0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},Fl=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 fl(0),0];if(1==n){var o=new fl(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 pl(d+1),f=$l(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 fl(v),f]},$l=function(t,e,r){return-1==t.s?Math.max($l(t.l,e,r+1),$l(t.r,e,r+1)):e[t.s]=r},Dl=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new pl(++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]},ql=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},jl=function(t,e,r){var i=r.length,n=Pl(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)},Ul=function(t,e,r,i,n,s,o,a,u,l,h){Al(e,h++,r),++n[256];for(var c=Fl(n,15),d=c[0],v=c[1],f=Fl(s,15),p=f[0],g=f[1],m=Dl(d),y=m[0],b=m[1],_=Dl(p),w=_[0],x=_[1],S=new pl(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=Fl(S,7),T=C[0],I=C[1],E=19;E>4&&!T[bl[E-1]];--E);var R,M,O,P,L=l+5<<3,A=ql(n,El)+ql(s,Rl)+o,N=ql(n,d)+ql(s,p)+o+14+3*E+ql(S,T)+(2*S[16]+3*S[17]+7*S[18]);if(A>=L&&N>=L)return jl(e,h,t.subarray(u,u+l));if(Al(e,h,1+(A>N)),h+=2,A>N){R=Il(d,v,0),M=d,O=Il(p,g,0),P=p;var F=Il(T,I,0);for(Al(e,h,b-257),Al(e,h+5,x-1),Al(e,h+10,E-4),h+=14,k=0;E>k;++k)Al(e,h+3*k,T[bl[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)Al(e,h,F[U=31&j[k]]),h+=T[U],U>15&&(Al(e,h,j[k]>>>5&127),h+=j[k]>>>12)}}else R=Ml,M=El,O=Ol,P=Rl;for(k=0;a>k;++k)if(i[k]>255){var U;Nl(e,h,R[257+(U=i[k]>>>18&31)]),h+=M[U+257],U>7&&(Al(e,h,i[k]>>>23&31),h+=ml[U]);var H=31&i[k];Nl(e,h,O[H]),h+=P[H],H>3&&(Nl(e,h,i[k]>>>5&8191),h+=yl[H])}else Nl(e,h,R[i[k]]),h+=M[i[k]];return Nl(e,h,R[256]),h+M[256]},Hl=new gl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Bl=function(){for(var t=new gl(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),zl=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Vl(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=Bl[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 fl(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=jl(u,l,t.subarray(h,c)):(u[h]=!0,l=jl(u,l,t.subarray(h,o)))}else{for(var d=Hl[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new pl(32768),m=new pl(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 gl(25e3),x=new pl(288),S=new pl(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=Ul(t,u,0,w,x,S,C,T,E,h-E,l),T=k=C=0,E=h;for(var L=0;286>L;++L)x[L]=0;for(L=0;30>L;++L)S[L]=0}var A=2,N=0,F=f,D=M-O&32767;if(P>2&&R==_(h-D))for(var q=Math.min(v,P)-1,j=Math.min(32767,h),U=Math.min(258,P);j>=D&&--F&&M!=O;){if(t[h+A]==t[h+A-D]){for(var H=0;U>H&&t[h+H]==t[h+H-D];++H);if(H>A){if(A=H,N=D,H>q)break;var B=Math.min(D,H-2),z=0;for(L=0;B>L;++L){var V=h-D+L+32768&32767,W=V-g[V]+32768&32767;W>z&&(z=W,O=V)}}}D+=(M=O)-(O=g[M])+32768&32767}if(N){w[T++]=268435456|xl[A]<<18|Sl[N];var Z=31&xl[A],G=31&Sl[N];C+=ml[Z]+yl[G],++x[257+Z],++S[G],I=h+A,++k}else w[T++]=t[h],++x[t[h]]}}l=Ul(t,u,!0,w,x,S,C,T,E,h-E,l)}return Ll(a,0,i+Pl(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&&zl(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),zl(u,l-8,r.d()),zl(u,l-4,i),u}var Wl=!!Mn||!!Rn,Zl="text/plain",Gl=!1,Ql=(t,e)=>{var[r,i]=t.split("#"),[n,s]=r.split("?");if(!s)return t;var o=s.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return n+(o?"?"+o:"")+(i?"#"+i:"")},Jl=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=Xn(a);return l&&u.push(l),s+"?"+u.join("&")},Kl=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Yl=t=>{if(t.tr)return t.tr;var{data:e,compression:r}=t;if(e){if(r===vl.GZipJS){var i=Vl(function(t,e){var r=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new fl(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 fl(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 Ll(i,0,n)}(Kl(e)),{mtime:0});return{contentType:Zl,body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(r===vl.Base64){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Kl(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Kl(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Kl(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Xl=t=>{var e,i,n,s=Yl(t);return!s||(i=t.compression,n=ts(t.url,"compression"),i!==Ge.GZipJS&&n!==Ge.GZipJS&&"gzip"!==n)||((e=s.body)instanceof ArrayBuffer?Ye(new Uint8Array(e)):ArrayBuffer.isView(e)&&Ye(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))?{url:t.url,encodedBody:s}:(Gl=!0,{url:Ql(t.url,"compression"),encodedBody:Yl(r({},t,{compression:void 0,tr:void 0}))})},th=function(){var t=e((function*(t){var e=Kl(t.data),i=yield function(t,e,r){return rr.apply(this,arguments)}(e,$n.DEBUG,{rethrow:!0});if(!i)return t;var n=yield i.arrayBuffer();return r({},t,{tr:{contentType:Zl,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),eh=(t,e)=>Jl(t,{_:(new Date).getTime().toString(),ver:$n.JS_SDK_VERSION,compression:e}),rh=[];Rn&&rh.push({transport:"fetch",method(t){var e,{url:i,encodedBody:n}=Xl(t),{contentType:s,body:o,estimatedSize:a}=null!=n?n:{},u=new Headers;Hn(t.headers,(function(t,e){u.append(e,t)})),s&&u.append("Content-Type",s);var l=null;if(On){var h=new On;l={signal:h.signal,timeout:setTimeout((()=>h.abort()),t.timeout)}}Rn(i,r({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&52428.8>(a||0),body:o,signal:null==(e=l)?void 0:e.signal},t.fetchOptions)).then((e=>e.text().then((r=>{var i={statusCode:e.status,text:r};if(200===e.status)try{i.json=JSON.parse(r)}catch(t){qn.error(t)}null==t.callback||t.callback(i)})))).catch((e=>{qn.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>l?clearTimeout(l.timeout):null))}}),Mn&&rh.push({transport:"XHR",method(t){var e=new Mn,{url:r,encodedBody:i}=Xl(t);e.open(t.method||"GET",r,!0);var{contentType:n,body:s}=null!=i?i:{};Hn(t.headers,(function(t,r){e.setRequestHeader(r,t)})),n&&e.setRequestHeader("Content-Type",n),t.timeout&&(e.timeout=t.timeout),t.disableXHRCredentials||(e.withCredentials=!0),e.onreadystatechange=()=>{if(4===e.readyState){var r={statusCode:e.status,text:e.responseText};if(200===e.status)try{r.json=JSON.parse(e.responseText)}catch(t){}null==t.callback||t.callback(r)}},e.send(s)}}),null!=Tn&&Tn.sendBeacon&&rh.push({transport:"sendBeacon",method(t){try{var{url:e,encodedBody:r}=Xl(t),i=Jl(e,{beacon:"1"}),{contentType:n,body:s}=null!=r?r:{};if(!s)return;var o=s instanceof Blob?s:new Blob([s],{type:n});Tn.sendBeacon(i,o)}catch(t){}}});var ih=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 nh(t,e,r){return Kl({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var sh={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=>ih(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!ih(e,t))))),icontains:(t,e)=>e.map(oh).some((e=>t.map(oh).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(oh).every((e=>t.map(oh).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)))}))},oh=t=>t.toLowerCase();function ah(t,e){return!t||Object.entries(t).every((t=>{var[r,i]=t,n=null==e?void 0:e[r];if(pr(n)||yr(n))return!1;var s=[String(n)],o=sh[i.operator];return!!o&&o(i.values,s)}))}var uh="",lh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var hh={O:()=>!!In,D(t){qn.error("cookieStore error: "+t)},A(t){if(In){try{for(var e=t+"=",r=In.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(hh.A(t))||{}}catch(t){}return e},N(t,e,r,i,n){if(!In)return!1;try{var s="",o="",a=function(t,e){if(e){var r=function(t,e){if(void 0===e&&(e=In),uh)return uh;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_"+hl();!uh&&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",uh=s)}return uh}(t);if(!r){var i=(t=>{var e=t.match(lh);return e?e[0]:""})(t);i!==r&&qn.info("Warning: cookie subdomain discovery mismatch",i,r),r=i}return r?"; domain=."+r:""}return""}(In.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&&qn.warn("cookieStore warning: large cookie, len="+l.length),In.cookie=l,!0}catch(t){return!1}},q(t,e){if(null!=In&&In.cookie)try{hh.N(t,"",-1,e)}catch(t){return}}},ch=null,dh={O(){if(!yr(ch))return ch;var t=!0;if(pr(kn))t=!1;else try{var e="__mplssupport__";dh.N(e,"xyz"),'"xyz"'!==dh.A(e)&&(t=!1),dh.q(e)}catch(e){t=!1}return t||qn.error("localStorage unsupported; falling back to cookie store"),ch=t,t},D(t){qn.error("localStorage error: "+t)},A(t){try{return null==kn?void 0:kn.localStorage.getItem(t)}catch(t){dh.D(t)}return null},F(t){try{return JSON.parse(dh.A(t))||{}}catch(t){}return null},N(t,e){try{return null==kn||kn.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){dh.D(t)}return!1},q(t){try{null==kn||kn.localStorage.removeItem(t)}catch(t){dh.D(t)}}},vh=[os,"distinct_id",Ss,ks,Qs,Gs,Bs],fh={},ph={O:()=>!0,D(t){qn.error("memoryStorage error: "+t)},A:t=>fh[t]||null,F:t=>fh[t]||null,N:(t,e)=>(fh[t]=e,!0),q(t){delete fh[t]}},gh=null,mh={O(){if(!yr(gh))return gh;if(gh=!0,pr(kn))gh=!1;else try{var t="__support__";mh.N(t,"xyz"),'"xyz"'!==mh.A(t)&&(gh=!1),mh.q(t)}catch(t){gh=!1}return gh},D(t){qn.error("sessionStorage error: ",t)},A(t){try{return null==kn?void 0:kn.sessionStorage.getItem(t)}catch(t){mh.D(t)}return null},F(t){try{return JSON.parse(mh.A(t))||null}catch(t){}return null},N(t,e){try{return null==kn||kn.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){mh.D(t)}return!1},q(t){try{null==kn||kn.sessionStorage.removeItem(t)}catch(t){mh.D(t)}}},yh=jn("[Stylesheet Loader]"),bh=kn,_h=In,wh="#020617",xh={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:Ou.Right,widgetType:Mu.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:wh,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Sh=[Ou.Center,Ou.Left,Ou.Right];function kh(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 Ch(t){var e;void 0===t&&(t=xh.backgroundColor),"#"===t[0]&&(e=kh(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=kh(r)),!e)return wh;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?wh:"white"}return wh}var Th=(t,e,i)=>{var n=zh(t),s=_h.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var o=_h.createElement("div");((t,e,i)=>{var n=r({},xh,i),s=t.style,o=!Sh.includes(n.position)||e===Lu.Widget&&(null==i?void 0:i.widgetType)===Mu.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)||Ch(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",Ch(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Ch(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",Ch(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)||Ch(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=_h.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}:is(.survey-box .question-header--empty)~.multiple-choice-options,:is(.survey-box .question-header--empty)~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||(yh.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 _h.body.appendChild(o),{shadow:a,isNewlyCreated:!0}},Ih=t=>{var{responses:e,survey:i,surveySubmissionId:n,posthog:s,isSurveyCompleted:o,properties:a,surveyLanguage:u}=t;s?(rl(i),s.capture($u.SENT,r({[Du.SURVEY_NAME]:i.name,[Du.SURVEY_ID]:i.id,[Du.SURVEY_ITERATION]:i.current_iteration,[Du.SURVEY_ITERATION_START_DATE]:i.current_iteration_start_date,[Du.SURVEY_SUBMISSION_ID]:n,[Du.SURVEY_COMPLETED]:o},u&&{[Du.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},Hu(e,i),a,{$set:{[Bu(i,"responded")]:!0}})),o&&(bh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Bh(i))):Gu.error("[survey sent] event not captured, PostHog instance not found.")},Eh=(t,e,i)=>{return r({[Du.SURVEY_NAME]:t.name,[Du.SURVEY_ID]:t.id,[Du.SURVEY_ITERATION]:t.current_iteration,[Du.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[Du.SURVEY_PARTIALLY_COMPLETED]:(n=null==e?void 0:e.responses,void 0===n&&(n={}),Object.values(n).some((t=>!br(t))))},(null==e?void 0:e.surveyLanguage)&&{[Du.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[Du.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},Hu(null==e?void 0:e.responses,t));var n},Rh=(t,e,i,n)=>{if(e){if(!i){var s=Uh(t);e.capture($u.DISMISSED,r({},Eh(t,s,e),n&&{[Du.SURVEY_LANGUAGE]:n},{$set:{[Bu(t,"dismissed")]:!0}})),Bh(t),rl(t),bh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else Gu.error("[survey dismissed] event not captured, PostHog instance not found.")},Mh=(t,e)=>{if(e){var r=(t=>tl("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=Uh(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture($u.ABANDONED,Eh(t,i,e),{transport:"sendBeacon"})}}else Gu.error("[survey abandoned] event not captured, PostHog instance not found.")},Oh=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),Ph=(t,e)=>t.length===e.length&&t.every(((t,r)=>t===e[r]))?e.reverse():e,Lh=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?Ph(t.questions,Oh(t.questions)):t.questions,Ah=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===Fu.Always||Hh(t)},Nh=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,Ha(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"+Ra++,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}),Fh=()=>wu(Nh),$h=t=>{var{component:e,children:r,renderAsHtml:i,style:n}=t;return function(t,e,r){var i,n,s,o,a=Aa({},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?ya.call(arguments,2):r),$a(t.type,a,i||t.key,n||t.ref,null)}(e,i?{dangerouslySetInnerHTML:{__html:r},style:n}:{children:r,style:n})};function Dh(t){var e,r,i;if(null==(e=t.conditions)||!e.url)return!0;var n=null==bh||null==(r=bh.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 sh[o](s,[n])}var qh=t=>{var e=""+Xu+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Xu+t.id+"_"+t.current_iteration),e},jh=(t,e)=>{try{localStorage.setItem(qh(t),JSON.stringify(e))}catch(t){Gu.error("Error setting in-progress survey state in localStorage",t)}},Uh=t=>{try{var e=localStorage.getItem(qh(t));if(e)return JSON.parse(e)}catch(t){Gu.error("Error getting in-progress survey state from localStorage",t)}return null},Hh=t=>{var e=Uh(t);return!br(null==e?void 0:e.surveySubmissionId)},Bh=t=>{try{localStorage.removeItem(qh(t))}catch(t){Gu.error("Error clearing in-progress survey state from localStorage",t)}};function zh(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function Vh(t,e,r){if(void 0===e&&(e=Ou.Right),t===Lu.ExternalSurvey)return{};switch(e){case Ou.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Ou.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Ou.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Ou.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Ou.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Ou.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Ou.Left:return{left:"30px"};case Ou.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Lu.Widget&&r===Mu.Tab?"60px":"30px"}}}var Wh=0;function Zh(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:--Wh,__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 ba.vnode&&ba.vnode(l),l}var Gh=Zh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Zh("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"})}),Qh=Zh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Zh("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"})}),Jh=Zh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Zh("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"})}),Kh=Zh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Zh("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"})}),Yh=Zh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Zh("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Xh=Zh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Zh("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"})}),tc=Zh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Zh("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"})}),ec=function(t){var{fill:e="currentColor"}=void 0===t?{}:t;return Zh("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:[Zh("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Zh("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})]})},rc=Zh("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Zh("g",{"clip-path":"url(#clip0_2415_6911)",children:[Zh("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Zh("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Zh("g",{mask:"url(#mask0_2415_6911)",children:[Zh("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"}),Zh("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"}),Zh("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"}),Zh("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"}),Zh("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"}),Zh("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"})]})]}),Zh("defs",{children:Zh("clipPath",{id:"clip0_2415_6911",children:Zh("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function ic(t){var{urlParams:e}=t,r=e?Object.entries(e).map((t=>{var[e,r]=t;return encodeURIComponent(e)+"="+encodeURIComponent(r)})).join("&"):"";return Zh("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",rc]})}function nc(t){var{text:e,submitDisabled:r,appearance:i,onSubmit:n,link:s,onPreviewSubmit:o,skipSubmitButton:a}=t,{isPreviewMode:u}=wu(Nh);return Zh("div",{className:"bottom-section",children:[!a&&Zh("button",{className:"form-submit",disabled:r,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==kn||kn.open(s)),u?null==o||o():n()},children:e}),!i.whiteLabel&&Zh(ic,{urlParams:{utm_source:"survey-footer"}})]})}function sc(t){var{question:e,forceDisableHtml:r,htmlFor:i}=t;return Zh("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Zh(e.type===Au.Open?"label":"h3",{className:"survey-question",htmlFor:i,children:e.question}),e.description&&$h({component:Fa("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function oc(t){var{onClick:e}=t,{isPreviewMode:r}=wu(Nh);return Zh("button",{className:"form-cancel",onClick:e,disabled:r,"aria-label":"Close survey",type:"button",children:ec({fill:"black"})})}Zh("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Zh("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 ac=kn;function uc(t){var{header:e,description:r,contentType:i,forceDisableHtml:n,appearance:s,onClose:o}=t,{isPopup:a}=wu(Nh);return yu((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),o())};return Jn(ac,"keydown",t),()=>{ac.removeEventListener("keydown",t)}}),[o]),Zh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[a&&!0!==s.hideCancelButton&&Zh(oc,{onClick:()=>o()}),Zh("h3",{className:"thank-you-message-header",children:e}),r&&$h({component:Fa("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),a&&Zh(nc,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>o()})]})}var lc=t=>cr(t)&&t.every((t=>gr(t)));function hc(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s,displayQuestionIndex:o,initialValue:a}=t,{isPreviewMode:u}=Fh(),l=bu(null),[h,c]=mu((()=>gr(a)?a:""));yu((()=>{setTimeout((()=>{var t;u||null==(t=l.current)||t.focus()}),100)}),[u]);var d="surveyQuestion"+o,v=_u((()=>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 Qe.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 Qe.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=zi(e.validation,Qe.MinLength),p=zi(e.validation,Qe.MaxLength),g=_u((()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(f,p)),[f,p]),m=()=>{v||n(h.trim())},y=()=>{v||s(h.trim())};return Zh(Da,{children:[Zh("div",{className:"question-container",children:[Zh(sc,{question:e,forceDisableHtml:r,htmlFor:d}),Zh("textarea",{ref:l,id:d,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:f,maxLength:p,onInput(t){c(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||v||(t.preventDefault(),u?y():m())},value:h}),g&&Zh("div",{className:"validation-hint",children:g})]}),Zh(nc,{text:e.buttonText||"Submit",submitDisabled:!!v,appearance:i,onSubmit:m,onPreviewSubmit:y})]})}function cc(t){var{question:e,forceDisableHtml:r,appearance:i,onSubmit:n,onPreviewSubmit:s}=t;return Zh(Da,{children:[Zh("div",{className:"question-container",children:Zh(sc,{question:e,forceDisableHtml:r})}),Zh(nc,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>n("link clicked"),onPreviewSubmit:()=>s("link clicked")})]})}function dc(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]=mu((()=>_r(u)?u:cr(u)&&u.length>0&&_r(parseInt(u[0]))?parseInt(u[0]):gr(u)&&_r(parseInt(u))?parseInt(u):null)),v="emoji"===r.display&&2===r.scale,{isPreviewMode:f}=Fh(),p=t=>f?a(t):o(t);return Zh(Da,{children:[Zh("div",{className:"question-container",children:[Zh(sc,{question:r,forceDisableHtml:i}),Zh("div",{className:"rating-section",children:[Zh("div",{className:"rating-options",children:["emoji"===r.display&&Zh("div",{className:"rating-options-emoji"+(v?" rating-options-emoji-2":""),children:null==(e=yc[r.scale])?void 0:e.map(((t,e)=>Zh("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&&Zh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(l-h+1)+", minmax(0, 1fr))"},children:bc(r.scale).map(((t,e)=>Zh(vc,{displayQuestionIndex:n,active:c===t,appearance:s,num:t,setActiveNumber(t){d(t),r.skipSubmitButton&&p(t)}},e)))})]}),!v&&Zh("div",{className:"rating-text",children:[Zh("div",{children:r.lowerBoundLabel}),Zh("div",{children:r.upperBoundLabel})]})]})]}),Zh(nc,{text:r.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:yr(c)&&!r.optional,appearance:s,onSubmit:()=>o(c),onPreviewSubmit:()=>a(c),skipSubmitButton:r.skipSubmitButton})]})}function vc(t){var{num:e,active:r,displayQuestionIndex:i,setActiveNumber:n}=t;return Zh("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+i+"-rating-"+e+" "+(r?"rating-active":""),type:"button",onClick(){n(e)},children:e})}function fc(t){var{question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:s,onSubmit:o,onPreviewSubmit:a,initialValue:u}=t,l=bu(null),h=_u((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=Ph(e,Oh(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(e)),[e]),[c,d]=mu((()=>((t,e)=>gr(t)||lc(t)?t:e===Au.SingleChoice?null:[])(u,e.type))),[v,f]=mu((()=>((t,e)=>{if(gr(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(lc(t)){var r=t.find((t=>!e.includes(t)));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,h))),{isPreviewMode:p}=Fh(),g=e.type===Au.SingleChoice,m=e.type===Au.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&&cr(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||!yr(c)&&(!cr(c)||v.isSelected||0!==c.length)&&(!v.isSelected||""!==v.inputValue.trim())),S=()=>{v.isSelected&&m?cr(c)&&(p?a([...c,v.inputValue]):o([...c,v.inputValue])):p?a(c):o(c)};return Zh(Da,{children:[Zh("div",{className:"question-container",children:[Zh(sc,{question:e,forceDisableHtml:i}),Zh("fieldset",{className:"multiple-choice-options limit-height",children:[Zh("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:cr(c)&&c.includes(t);return Zh("label",{className:i?"choice-option-open":"",children:[Zh("div",{className:"response-choice",children:[Zh("input",{type:g?"radio":"checkbox",name:s,checked:a,onChange:()=>b(t,i),id:s,"aria-controls":o}),Zh("span",{children:i?t+":":t})]}),i&&Zh("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)}))]})]}),Zh(nc,{text:e.buttonText||"Submit",submitDisabled:x(),appearance:s,onSubmit:S,onPreviewSubmit:S,skipSubmitButton:y})]})}var pc=[1,2,3,4,5],gc=[1,2,3,4,5,6,7],mc=[0,1,2,3,4,5,6,7,8,9,10],yc={2:[Xh,tc],3:[Jh,Qh,Gh],5:[Kh,Jh,Qh,Gh,Yh]};function bc(t){switch(t){case 5:default:return pc;case 7:return gc;case 10:return mc}}var _c=jn("[Surveys]");function wc(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?Nu.End:s;if(n.branching.type===Nu.End)return Nu.End;if(n.branching.type===Nu.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Nu.ResponseBased){if(n.type===Au.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===Nu.End?Nu.End:s}}else if(n.type===Au.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===Nu.End?Nu.End:s}}return s}return _c.warn("Falling back to next question index due to unexpected branching type"),s}var xc="https?://(.*)",Sc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],kc=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Sc],Cc="<masked>",Tc=["li_fat_id"];function Ic(t,e,r){if(!In)return{};var i,n=e?[...Sc,...r||[]]:[],s=Ec(es(In.URL,n,Cc),t),o=(i={},Hn(Tc,(function(t){var e=hh.A(t);i[t]=e||null})),i);return Bn(o,s)}function Ec(t,e){var r=kc.concat(e||[]),i={};return Hn(r,(function(e){var r=ts(t,e);i[e]=r||null})),i}function Rc(t){var e=function(t){return t?0===t.search(xc+"google.([^/?]*)")?"google":0===t.search(xc+"bing.com")?"bing":0===t.search(xc+"yahoo.com")?"yahoo":0===t.search(xc+"duckduckgo.com")?"duckduckgo":null:null}(t),r="yahoo"!=e?"q":"p",i={};if(!yr(e)){i.$search_engine=e;var n=In?ts(In.referrer,r):"";n.length&&(i.ph_keyword=n)}return i}function Mc(){return navigator.language||navigator.userLanguage}var Oc="$direct";function Pc(){return(null==In?void 0:In.referrer)||Oc}function Lc(t,e){var r=t?[...Sc,...e||[]]:[],i=null==En?void 0:En.href.substring(0,1e3);return{r:Pc().substring(0,1e3),u:i?es(i,r,Cc):void 0}}function Ac(t){var e,{r:r,u:i}=t,n={$referrer:r,$referring_domain:null==r?void 0:r==Oc?Oc:null==(e=Yn(r))?void 0:e.host};if(i){n.$current_url=i;var s=Yn(i);n.$host=null==s?void 0:s.host,n.$pathname=null==s?void 0:s.pathname;var o=Ec(i);Bn(n,o)}if(r){var a=Rc(r);Bn(n,a)}return n}function Nc(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Fc(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var $c=jn("[SurveyTranslations]");function Dc(t,e){var r=function(t){return function(t,e){var{overrideLanguage:r,storedPersonProperties:i,locale:n}=t,s=zu(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?zu(t.language):null}(i);if(o)return null==e||e.info("Using person property language: "+o),o;var a=zu(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:dr(t.get_property)?t.get_property(Ls):void 0,locale:Mc()},$c)}(e);if(!r)return $c.info("No user language detected"),{survey:t,language:null};var i=Zu(t,r,$c);return{survey:i.survey,language:i.matchedKey}}var qc=kn,jc=In,Uc="ph:show_survey_widget",Hc="PHWidgetSurveyClickListener";function Bc(t,e){try{var r=t.getBoundingClientRect(),i=qc.innerHeight,n=qc.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:xh.zIndex}}catch(t){return Gu.warn("Failed to calculate trigger position:",t),null}}class zc{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(Ns);if(t)for(var e of t)Hh(e)&&Mh(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)===Ou.NextToTrigger&&null!=(s=l.appearance)&&s.widgetSelector){var f,p=jc.querySelector(l.appearance.widgetSelector);p&&(v=Bc(p,parseInt((null==(f=l.appearance)?void 0:f.maxWidth)||xh.maxWidth))||{})}var g=(null==(o=l.appearance)?void 0:o.surveyPopupDelaySeconds)||0,{shadow:m}=Th(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 ru(Zh(Gc,r({},y)),m);var b=setTimeout((()=>{if(this.j.delete(l.id),!Dh(l))return this.$(l);ru(Zh(Gc,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}=Th(e,this._posthog);n&&ru(Zh(Jc,{posthog:this._posthog,survey:e,surveyLanguage:r},t.id),i)},this.J=t=>{this.X(t);var e=this.H.get(t.id);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Hc),this.H.delete(t.id),Gu.info("Removed click listener for survey "+t.id))},this.Y=(t,e)=>{var r=jc.querySelector(e),i=this.H.get(t.id);if(r){if(this.G(t),i){if(r===i.element)return;Gu.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.J(t)}if(!r.hasAttribute(Hc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===Ou.NextToTrigger?Bc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||xh.maxWidth)):{};qc.dispatchEvent(new CustomEvent(Uc,{detail:{surveyId:t.id,position:n}}))};Jn(r,"click",n),r.setAttribute(Hc,"true"),this.H.set(t.id,{element:r,listener:n,survey:t}),Gu.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.J(t)},this.renderPopover=t=>{var{survey:e,language:r}=this.B(t),{shadow:i}=Th(e,this._posthog);ru(Zh(Gc,{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)),ru(Zh(Gc,{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===Lu.Popover||t.type===Lu.Widget)),i=e.ne(r),n=new Set;i.forEach((t=>{if(t.type===Lu.Widget){var r,i,s,o;if((null==(r=t.appearance)?void 0:r.widgetType)===Mu.Tab)return void e.G(t);(null==(i=t.appearance)?void 0:i.widgetType)===Mu.Selector&&null!=(s=t.appearance)&&s.widgetSelector&&(n.add(t.id),e.Y(t,null==(o=t.appearance)?void 0:o.widgetSelector))}yr(e.ie)&&t.type===Lu.Popover&&e.handlePopoverSurvey(t)})),e.H.forEach((t=>{var{survey:r}=t;n.has(r.id)||e.J(r)}))}),t)},this.Z=t=>{yr(this.ie)||Gu.error("Survey "+this.ie+" already in focus. Cannot add survey "+t.id+"."),this.ie=t.id},this.$=t=>{this.ie!==t.id&&Gu.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.V(t.id),this.ie=null,this.X(t)},this._posthog=t,this.ie=null}V(t){var e=this.j.get(t);e&&(clearTimeout(e),this.j.delete(t))}cancelSurvey(t){this.j.has(t)&&(Gu.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=Hh(t),s=Hh(e);if(n&&!s)return-1;if(!n&&s)return 1;var o=t.schedule===Fu.Always,a=e.schedule===Fu.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 Dc(t,this._posthog)}K(t,e){if(this.U.has(t.id))return!1;var{params:r}=function(t){var e={},r=!1,i=qc.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&&!pr(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;Gu.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)&&Ih({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)]=cr(o)?o.map(String):[String(o)];Gu.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 Ih({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=ju(t.id);try{switch(t.type){case Au.SingleChoice:if(!t.choices||0===t.choices.length)return void qn.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 qn.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[s]=t.choices[o];break;case Au.MultipleChoice:if(!t.choices||0===t.choices.length)return void qn.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 qn.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(a.map((e=>t.choices[e])))];a.length>u.length&&qn.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[s]=u;break;case Au.Rating:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||0>l||l>h)return void qn.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[s]=l;break;default:qn.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){qn.error("[Survey Prefill] Error converting q"+i+":",t)}}})),r}(t,e);if(0===Object.keys(i).length)return Gu.warn("[Survey Prefill] No valid responses after conversion"),null;var n=hl(),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=ju(o.id);pr(r[a])||(n[a]=r[a])}var u=wc(t,i,o.id?r[ju(o.id)]:null);if(u===Nu.End)return{startQuestionIndex:t.questions.length,skippedResponses:n};i=u}return{startQuestionIndex:i,skippedResponses:n}}(t,s,i),u=o>=t.questions.length;return jh(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:o,surveyLanguage:r}),Gu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:a}}catch(t){return Gu.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||Dh(t)&&function(t){var e,r;return function(t,e){var r,i,n;if(!t||0===t.length)return!0;if(!Ln)return!1;var s=qi(Ln,{userAgentDataPlatform:null==Tn||null==(r=Tn.userAgentData)?void 0:r.platform,maxTouchPoints:null==Tn?void 0:Tn.maxTouchPoints,screenWidth:null==kn||null==(i=kn.screen)?void 0:i.width,screenHeight:null==kn||null==(n=kn.screen)?void 0:n.height,devicePixelRatio:null==kn?void 0:kn.devicePixelRatio});return sh[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==_h||!_h.querySelector(t.conditions.selector))}(t)}se(t){return Ah(t)||this.ae(t.internal_targeting_flag_key)||Hh(t)}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!Qu(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!il.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,dh.A("lastSeenSurveyDate"))?(t=>!!dh.A(el(t))&&!Ah(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(!Ju(t)&&!Ku(t))return!0;var r=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==r||!r.includes(t.id))}re(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var{key:e,value:r}=t;return!e||!r||this.ae(r)}))}X(t){try{var e=jc.querySelector(zh(t,!0));null!=e&&e.shadowRoot&&ru(null,e.shadowRoot),null==e||e.remove()}catch(e){Gu.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Z,removeSurveyFromFocus:this.$,surveyInFocus:this.ie,surveyTimeouts:this.j,handleWidget:this.G,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Y,sortSurveysByAppearanceDelay:this.ne,checkFlags:this.re.bind(this),isSurveyFeatureFlagEnabled:this.ae.bind(this)}}}function Vc(t,e){if(jc&&qc){var r,i=new zc(t);if(t.config.disable_surveys_automatic_display)return Gu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return Gu.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{pr(r)&&(r=setInterval((()=>{i.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Jn(jc,"visibilitychange",(()=>{jc.hidden?pr(r)||(clearInterval(r),r=void 0):(i.callSurveysAndEvaluateDisplayLogic(!1),n())})),i}}function Wc(t){var{survey:e,removeSurveyFromFocus:r=(()=>{}),setSurveyVisible:i,isPreviewMode:n=!1}=t;yu((()=>{var t;if(!n&&null!=(t=e.conditions)&&t.url){var s=()=>{var t,n=e.type===Lu.Widget,s=Dh(e),o=(null==(t=e.appearance)?void 0:t.widgetType)===Mu.Tab&&n;if(!s)return Gu.info("Hiding survey "+e.id+" because URL does not match"),i(!1),r(e);o&&(Gu.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),i(!0))};Jn(qc,"popstate",s),Jn(qc,"hashchange",s);var o=qc.history.pushState,a=qc.history.replaceState;return qc.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()},qc.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()},()=>{qc.removeEventListener("popstate",s),qc.removeEventListener("hashchange",s),qc.history.pushState=o,qc.history.replaceState=a}}}),[n,e,r,i])}function Zc(t){switch(void 0===t&&(t=Pu.Right),t){case Pu.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Pu.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Pu.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Gc(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=bu(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]=mu(n||0===i||t.type===Lu.ExternalSurvey),[d,v]=mu(!1),f=()=>{var e=()=>{o&&s(t),c(!1)};jc.startViewTransition?jc.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 yu((()=>{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=()=>{Dh(t)&&(c(!0),qc.dispatchEvent(new Event("PHSurveyShown")),u||e.capture($u.SHOWN,r({[Du.SURVEY_NAME]:t.name,[Du.SURVEY_ID]:t.id,[Du.SURVEY_ITERATION]:t.current_iteration,[Du.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},l&&{[Du.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()})),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString()))};if(Jn(qc,"PHSurveyClosed",p),Jn(qc,"PHSurveySent",s),i>0){var a=setTimeout(o,i);return()=>{clearTimeout(a),qc.removeEventListener("PHSurveyClosed",p),qc.removeEventListener("PHSurveySent",s)}}return o(),()=>{qc.removeEventListener("PHSurveyClosed",p),qc.removeEventListener("PHSurveySent",s)}}}else Gu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Wc({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=_u((()=>{var t=Uh(u),e=(null==t?void 0:t.surveySubmissionId)||hl();return{isPreviewMode:S,previewPageIndex:d,onPopupSurveyDismissed(){w?Rh(u,h,S,w):Rh(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?Zh(Nh.Provider,{value:R,children:Zh("div",{className:"ph-survey",style:r({},Vh(u.type,null==(i=u.appearance)?void 0:i.position,null==(n=u.appearance)?void 0:n.widgetType),c),ref:x,children:E?Zh(uc,{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||xh,onClose(){I(),m()}}):Zh(Qc,{survey:u,forceDisableHtml:!!l,posthog:h})})}):null}function Qc(t){var e,{survey:i,forceDisableHtml:n,posthog:s}=t,[o,a]=mu((()=>{var t=Uh(i);return null!=t&&t.responses&&Gu.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}=wu(Nh),[g,m]=mu((()=>{var t=Uh(i);return u||(null==t?void 0:t.lastQuestionIndex)||0})),y=_u((()=>Lh(i)),[i]);yu((()=>{v&&!pr(u)&&m(u)}),[u,v]);var b=y.at(g);return b?Zh("form",{className:"survey-form",name:"surveyForm",children:[h&&!0!==(null==(e=i.appearance)?void 0:e.hideCancelButton)&&Zh(oc,{onClick(){l()}}),Zh("div",{className:"survey-box","data-question-index":g,children:Kc({question:b,forceDisableHtml:n,displayQuestionIndex:g,appearance:i.appearance||xh,onSubmit:t=>(t=>{var{res:e,displayQuestionIndex:n,questionId:u}=t;if(s)if(u){var l=ju(u),h=r({},o,{[l]:e});a(h);var c=wc(i,n,e),v=c===Nu.End;v||(m(c),jh(i,{surveySubmissionId:d,responses:h,lastQuestionIndex:c,surveyLanguage:p})),(i.enable_partial_responses||v)&&Ih({responses:h,survey:i,surveySubmissionId:d,isSurveyCompleted:v,posthog:s,properties:f,surveyLanguage:p})}else Gu.error("onNextButtonClick called without a questionId.");else Gu.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:g,questionId:b.id}),onPreviewSubmit:c,initialValue:b.id?o[ju(b.id)]:void 0})})]}):null}function Jc(t){var e,r,i,n,s,o,a,{survey:u,forceDisableHtml:l,posthog:h,readOnly:c,surveyLanguage:d}=t,[v,f]=mu(!0),[p,g]=mu(!1),[m,y]=mu({}),b=()=>{g(!p)};if(yu((()=>{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&&(Gu.info("Received show event for feedback button survey "+u.id),y(r.detail.position||{}),b())};return Jn(qc,Uc,e),()=>{qc.removeEventListener(Uc,e)}}}else Gu.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]),Wc({survey:u,setSurveyVisible:f}),!v)return null;var _=()=>{u.schedule!==Fu.Always&&f(!1),setTimeout((()=>{g(!1)}),200)};return Zh(Da,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Zh("button",{className:"ph-survey-widget-tab "+((null==(s=u.appearance)?void 0:s.tabPosition)===Pu.Top?"widget-tab-top":""),onClick:b,disabled:c,style:Zc(null==(o=u.appearance)?void 0:o.tabPosition),children:(null==(a=u.appearance)?void 0:a.widgetLabel)||""}),p&&Zh(Gc,{posthog:h,survey:u,forceDisableHtml:l,style:m,onPopupSurveyDismissed:_,onCloseConfirmationMessage:_,surveyLanguage:d})]})}var Kc=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 Au.Open:return Fa(hc,r({},l,{question:e,key:e.id}));case Au.Link:return Fa(cc,r({},l,{question:e,key:e.id}));case Au.Rating:return Fa(dc,r({},l,{question:e,key:e.id}));case Au.SingleChoice:case Au.MultipleChoice:return Fa(fc,r({},l,{question:e,key:e.id}));default:return Gu.error("Unsupported question type: "+e.type),null}};An.__PosthogExtensions__=An.__PosthogExtensions__||{},An.__PosthogExtensions__.generateSurveys=Vc,An.extendPostHogWithSurveys=Vc;class Yc{emit(t){}}var Xc=new Yc,td=new class{getLogger(t,e,r){return new Yc}};class ed{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.he(this.name,this.version,this.options);return t?(this.ce=t,this.ce):Xc}}class rd{getLogger(t,e,r){var i;return null!==(i=this.he(t,e,r))&&void 0!==i?i:new ed(this,t,e,r)}de(){var t;return null!==(t=this.ce)&&void 0!==t?t:td}ve(t){this.ce=t}he(t,e,r){var i;return null===(i=this.ce)||void 0===i?void 0:i.getLogger(t,e,r)}}var id="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},nd=Symbol.for("io.opentelemetry.js.api.logs"),sd=id;class od{constructor(){this.fe=new rd}static getInstance(){return this._instance||(this._instance=new od),this._instance}setGlobalLoggerProvider(t){return sd[nd]?this.getLoggerProvider():(sd[nd]=(1,e=t,r=td,t=>1===t?e:r),this.fe.ve(t),t);var e,r}getLoggerProvider(){var t,e;return null!==(e=null===(t=sd[nd])||void 0===t?void 0:t.call(sd,1))&&void 0!==e?e:this.fe}getLogger(t,e,r){return this.getLoggerProvider().getLogger(t,e,r)}disable(){delete sd[nd],this.fe=new rd}}var ad=od.getInstance();class ud{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 ld 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 hd(t){if(Number.isFinite(t)&&t>0)return t;throw new Error("Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '"+t+"')")}class cd{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 dd(t){return new cd(t.concurrencyLimit)}var vd="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},fd="1.9.0",pd=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,gd=function(t){var e=new Set([t]),r=new Set,i=t.match(pd);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(pd);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)}}(fd),md=fd.split(".")[0],yd=Symbol.for("opentelemetry.js.api."+md),bd=vd;function _d(t,e,r,i){var n;void 0===i&&(i=!1);var s=bd[yd]=null!==(n=bd[yd])&&void 0!==n?n:{version:fd};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!==fd?(o=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+fd),r.error(o.stack||o.message),!1):(s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+fd+"."),!0)}function wd(t){var e,r,i=null===(e=bd[yd])||void 0===e?void 0:e.version;if(i&&gd(i))return null===(r=bd[yd])||void 0===r?void 0:r[t]}function xd(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+fd+".");var r=bd[yd];r&&delete r[t]}var Sd,kd=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 Cd("debug",this.ye,t)},t.prototype.error=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Cd("error",this.ye,t)},t.prototype.info=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Cd("info",this.ye,t)},t.prototype.warn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Cd("warn",this.ye,t)},t.prototype.verbose=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Cd("verbose",this.ye,t)},t}();function Cd(t,e,r){var i=wd("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"}(Sd||(Sd={}));var Td=function(){function t(){function t(t){return function(){for(var e=[],r=0;arguments.length>r;r++)e[r]=arguments[r];var i=wd("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:Sd.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=wd("diag"),u=function(t,e){function r(r,i){var n=e[r];return"function"!=typeof n||i>t?function(){}:n.bind(e)}return Sd.NONE>t?t=Sd.NONE:t>Sd.ALL&&(t=Sd.ALL),e=e||{},{error:r("error",Sd.ERROR),warn:r("warn",Sd.WARN),info:r("info",Sd.INFO),debug:r("debug",Sd.DEBUG),verbose:r("verbose",Sd.VERBOSE)}}(null!==(n=r.logLevel)&&void 0!==n?n:Sd.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 _d("diag",u,e,!0)},e.disable=function(){xd("diag",e)},e.createComponentLogger=function(t){return new kd(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 Id(t){return Symbol.for(t)}var Ed,Rd=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}},Md=function(){function t(){}return t.prototype.active=function(){return Rd},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}(),Od="context",Pd=new Md,Ld=function(){function t(){}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalContextManager=function(t){return _d(Od,t,Td.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 wd(Od)||Pd},t.prototype.disable=function(){this.be().disable(),xd(Od,Td.instance())},t}();!function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"}(Ed||(Ed={}));var Ad="0000000000000000",Nd="00000000000000000000000000000000",Fd={traceId:Nd,spanId:Ad,traceFlags:Ed.NONE},$d=function(){function t(t){void 0===t&&(t=Fd),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}(),Dd=Id("OpenTelemetry Context Key SPAN");function qd(t){return t.getValue(Dd)||void 0}function jd(){return qd(Ld.getInstance().active())}function Ud(t,e){return t.setValue(Dd,e)}function Hd(t){return t.deleteValue(Dd)}function Bd(t,e){return Ud(t,new $d(e))}function zd(t){var e;return null===(e=qd(t))||void 0===e?void 0:e.spanContext()}var Vd=/^([0-9a-f]{32})$/i,Wd=/^[0-9a-f]{16}$/i;function Zd(t){return Vd.test(r=t.traceId)&&r!==Nd&&Wd.test(e=t.spanId)&&e!==Ad;var e,r}function Gd(t){return new $d(t)}var Qd=Ld.getInstance(),Jd=function(){function t(){}return t.prototype.startSpan=function(t,e,r){if(void 0===r&&(r=Qd.active()),Boolean(null==e?void 0:e.root))return new $d;var i,n=r&&zd(r);return"object"==typeof(i=n)&&"string"==typeof i.spanId&&"string"==typeof i.traceId&&"number"==typeof i.traceFlags&&Zd(n)?new $d(n):new $d},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:Qd.active(),u=this.startSpan(t,n,a),l=Ud(a,u);return Qd.with(l,o,void 0,u)}},t}(),Kd=new Jd,Yd=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):Kd},t}(),Xd=new(function(){function t(){}return t.prototype.getTracer=function(t,e,r){return new Jd},t}()),tv=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 Yd(this,t,e,r)},t.prototype.getDelegate=function(){var t;return null!==(t=this.ce)&&void 0!==t?t:Xd},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}(),ev=Ld.getInstance(),rv=Td.instance(),iv="trace",nv=function(){function t(){this.xe=new tv,this.wrapSpanContext=Gd,this.isSpanContextValid=Zd,this.deleteSpan=Hd,this.getSpan=qd,this.getActiveSpan=jd,this.getSpanContext=zd,this.setSpan=Ud,this.setSpanContext=Bd}return t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(t){var e=_d(iv,this.xe,Td.instance());return e&&this.xe.setDelegate(t),e},t.prototype.getTracerProvider=function(){return wd(iv)||this.xe},t.prototype.getTracer=function(t,e){return this.getTracerProvider().getTracer(t,e)},t.prototype.disable=function(){xd(iv,Td.instance()),this.xe=new tv},t}().getInstance(),sv=Id("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function ov(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(av(i)){e=i;continue}return!1}return!1}}return!0}(t):av(typeof t))}function av(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}function uv(t){try{(t=>{rv.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 lv,hv=performance,cv="telemetry.sdk.language",dv="telemetry.sdk.name",vv="telemetry.sdk.version",fv={[dv]:"opentelemetry","process.runtime.name":"browser",[cv]:"webjs",[vv]:"2.2.0"},pv=Math.pow(10,6),gv=Math.pow(10,9);function mv(t){return[Math.trunc(t/1e3),Math.round(t%1e3*pv)]}function yv(){var t=hv.timeOrigin;return"number"!=typeof t&&(t=hv.timing&&hv.timing.fetchStart),t}function bv(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<yv()?(e=t,r=mv(yv()),i=mv("number"==typeof e?e:hv.now()),gv>(n=[r[0]+i[0],r[1]+i[1]])[1]||(n[1]-=gv,n[0]+=1),n):mv(t);var e,r,i,n,s;if(t instanceof Date)return mv(t.getTime());throw TypeError("Invalid input type")}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"}(lv||(lv={}));var _v="[object Object]",wv="[object Null]",xv="[object Undefined]",Sv=function(){}.toString,kv=Sv.call(Object),Cv=Object.getPrototypeOf,Tv=Object.prototype,Iv=Tv.hasOwnProperty,Ev=Symbol?Symbol.toStringTag:void 0,Rv=Tv.toString;function Mv(t){if(!function(t){return null!=t&&"object"==typeof t}(t)||function(t){return null==t?void 0===t?xv:wv:Ev&&Ev in Object(t)?function(t){var e=Iv.call(t,Ev),r=t[Ev],i=!1;try{t[Ev]=void 0,i=!0}catch(t){}var n=Rv.call(t);return i&&(e?t[Ev]=r:delete t[Ev]),n}(t):function(t){return Rv.call(t)}(t)}(t)!==_v)return!1;var e=Cv(t);if(null===e)return!0;var r=Iv.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Sv.call(r)===kv}function Ov(t){return Av(t)?t.slice():t}function Pv(t,e,r,i){var n;if(void 0===r&&(r=0),20>=r){if(r++,$v(t)||$v(e)||Nv(e))n=Ov(e);else if(Av(t)){if(n=t.slice(),Av(e))for(var s=0,o=e.length;o>s;s++)n.push(Ov(e[s]));else if(Fv(e))for(var a=Object.keys(e),u=0,l=a.length;l>u;u++){var h=a[u];n[h]=Ov(e[h])}}else if(Fv(t))if(Fv(e)){if(!function(t,e){return!(!Mv(t)||!Mv(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($v(p))void 0===p?delete n[f]:n[f]=p;else{var g=n[f],m=p;if(Lv(t,f,i)||Lv(e,f,i))delete n[f];else{if(Fv(g)&&Fv(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]=Pv(n[f],p,r,i)}}}}else n=e;return n}}function Lv(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 Av(t){return Array.isArray(t)}function Nv(t){return"function"==typeof t}function Fv(t){return!$v(t)&&!Av(t)&&!Nv(t)&&"object"==typeof t}function $v(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||void 0===t||t instanceof Date||t instanceof RegExp||null===t}class Dv extends Error{constructor(t){super(t),Object.setPrototypeOf(this,Dv.prototype)}}function qv(t,e){var r,i=new Promise((function(t,i){r=setTimeout((function(){i(new Dv("Operation timed out."))}),e)}));return Promise.race([t,i]).then((t=>(clearTimeout(r),t)),(t=>{throw clearTimeout(r),t}))}class jv{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 Uv{constructor(t,e){this.Te=void 0,this.Me=void 0,this._e=!1,this.Le=new jv,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 Hv={Re:(t,e)=>new Promise((r=>{ev.with(function(t){return t.setValue(sv,!0)}(ev.active()),(()=>{t.export(e,(t=>{r(t)}))}))}))};class Bv{constructor(t,e,r,i,n){this.Oe=void 0,this.Ee=void 0,this.Ne=void 0,this.Ae=void 0,this.Pe=void 0,this.qe=void 0,this.Oe=t,this.Ee=e,this.Ne=r,this.Ae=i,this.Pe=n,this.qe=rv.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,e){if(this.qe.debug("items to be sent",t),this.Ae.hasReachedLimit())e({code:lv.FAILED,error:new Error("Concurrent export limit reached")});else{var r=this.Ee.serializeRequest(t);null!=r?this.Ae.pushPromise(this.Oe.send(r,this.Pe).then((t=>{if("success"!==t.status)e("failure"===t.status&&t.error?{code:lv.FAILED,error:t.error}:"retryable"===t.status?{code:lv.FAILED,error:new ld("Export failed with retryable status")}:{code:lv.FAILED,error:new ld("Export failed with unknown error")});else{if(null!=t.data)try{this.Ne.handleResponse(this.Ee.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:lv.SUCCESS})}}),(t=>e({code:lv.FAILED,error:t})))):e({code:lv.FAILED,error:new Error("Nothing to send")})}}forceFlush(){return this.Ae.awaitAll()}shutdown(){var t=this;return e((function*(){t.qe.debug("shutdown started"),yield t.forceFlush(),t.Oe.shutdown()}))()}}function zv(t,e,r){return i={transport:r,serializer:e,promiseHandler:dd(t)},new Bv(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&&rv.warn("Received Partial Success response:",JSON.stringify(t.partialSuccess))}},i.promiseHandler,{timeout:t.timeoutMillis}.timeout);var i}function Vv(t){return 48>t||t>57?97>t||t>102?t-55:t-87:t-48}function Wv(t){for(var e=new Uint8Array(t.length/2),r=0,i=0;t.length>i;i+=2){var n=Vv(t.charCodeAt(i)),s=Vv(t.charCodeAt(i+1));e[r++]=n<<4|s}return e}function Zv(t){var e=BigInt(1e9);return BigInt(Math.trunc(t[0]))*e+BigInt(Math.trunc(t[1]))}function Gv(t){var e;return e=Zv(t),{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}var Qv="undefined"!=typeof BigInt?function(t){return Zv(t).toString()}:function(t){return t[0]*gv+t[1]};function Jv(t){return t}function Kv(t){if(void 0!==t)return Wv(t)}var Yv={encodeHrTime:Gv,encodeSpanContext:Wv,encodeOptionalSpanContext:Kv};function Xv(t,e){return{key:t,value:tf(e)}}function tf(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(tf)}}:"object"===e&&null!=t?{kvlistValue:{values:Object.entries(t).map((t=>{var[e,r]=t;return Xv(e,r)}))}}:{}}function ef(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=>Xv(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:tf(t.body),eventName:t.eventName,attributes:(s=t.attributes,Object.keys(s).map((t=>Xv(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 rf=t=>null!==t&&"object"==typeof t&&"function"==typeof t.then;class nf{static FromAttributeList(t,e){var r=new nf({},e);return r.De=of(t),r.Fe=t.filter((t=>{var[e,r]=t;return rf(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 rf(r)&&(this.Fe=!0),[e,r]})),this.De=of(this.De),this.je=function(t){if("string"==typeof t||void 0===t)return t;rv.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,rf(i)?yield i:i]}t.Fe=!1}}))()}get attributes(){if(this.asyncAttributesPending&&rv.error("Accessing resource attributes before async attributes settled"),this.He)return this.He;var t={};for(var[e,r]of this.De){var i;rf(r)?rv.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 rv.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 nf.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],o)}}function sf(t,e){return nf.FromAttributeList(Object.entries(t),e)}function of(t){return t.map((t=>{var[e,r]=t;return rf(r)?[e,r.catch((t=>{rv.debug("promise rejection for resource attribute: %s - %s",e,t)}))]:[e,r]}))}var af={serializeRequest(t){var e,r,i=(e=t,r=function(t){var e,r;if(void 0===t)return Yv;var i=null===(e=t.useLongBits)||void 0===e||e,n=null!==(r=t.useHex)&&void 0!==r&&r;return{encodeHrTime:i?Gv:Qv,encodeSpanContext:n?Jv:Wv,encodeOptionalSpanContext:n?Jv:Kv}}({useHex:!0,useLongBits:!1}),{resourceLogs:ef(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 uf{constructor(t){this.Oe=void 0,this.Oe=t}retry(t,e,r){return new Promise(((i,n)=>{setTimeout((()=>{this.Oe.send(t,e).then(i,n)}),r)}))}send(t,r){var i=this;return e((function*(){for(var e=Date.now()+r,n=yield i.Oe.send(t,r),s=5,o=1e3;"retryable"===n.status&&s>0;){var a;s--;var u=Math.max(Math.min(o,5e3)+(.4*Math.random()-.2),0);o*=1.5;var l=null!==(a=n.retryInMillis)&&void 0!==a?a:u,h=e-Date.now();if(l>h)return n;n=yield i.retry(t,h,l)}return n}))()}shutdown(){return this.Oe.shutdown()}}function lf(t){return new uf(t.transport)}function hf(t){return[429,502,503,504].includes(t)}function cf(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 df{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&&hf(s.status)?n({status:"retryable",retryInMillis:cf(s.getResponseHeader("Retry-After"))}):0!==s.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")}):(rv.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 vf{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}))?(rv.debug("SendBeacon success"),i({status:"success"})):i({status:"failure",error:new Error("SendBeacon failed")})}))}))()}shutdown(){}}class ff{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?hf(u.status)?{status:"retryable",retryInMillis:cf(u.headers.get("Retry-After"))}:{status:"failure",error:new Error("Fetch request failed with non-retryable status")}:(rv.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 pf(t,e){return zv(t,e,lf({transport:(r=t,new df(r))}));var r}function gf(t,e){return zv(t,e,lf({transport:(r=t,new ff(r))}));var r}function mf(t,e){return zv(t,e,lf({transport:(r={url:t.url,headers:t.headers},new vf(r))}));var r}function yf(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 bf(t){return"function"==typeof t.headers?t.headers:function(t){if(null!=t)return e((function*(){return t}))}(t.headers)}function _f(t,i,n){return s={url:t.url,timeoutMillis:t.timeoutMillis,headers:bf(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:hd(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):rv.warn('Header "'+r+'" has invalid value ('+i+") and will be ignored")})),e}(yield h())),Object.assign(e,t)}))),url:null!==(u=null!==(l=yf(s.url))&&void 0!==l?l:o.url)&&void 0!==u?u:a.url});var s,o,a,u,l,h,c,d}function wf(t,e,r,i){return(t.headers||"function"!=typeof navigator.sendBeacon?void 0!==globalThis.fetch?gf:pf:mf)(_f(t,r,i),e)}class xf extends ud{constructor(t){void 0===t&&(t={}),super(wf(t,af,"v1/logs",{"Content-Type":"application/json"}))}}class Sf{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=bv(null!=i?i:c),this.hrTimeObserved=bv(null!=n?n:c),h){var d=nv.getSpanContext(h);d&&Zd(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?(rv.warn("Invalid attribute key: "+t),this):ov(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]=ov(e)?this.Je(e):e,this):(1===this.droppedAttributesCount&&rv.warn("Dropping extra attributes."),this)):(rv.warn("Invalid attribute value set for key: "+t),this)}setAttributes(t){for(var[e,r]of Object.entries(t))this.setAttribute(e,r);return this}setBody(t){return this.body=t,this}setEventName(t){return this.eventName=t,this}setSeverityNumber(t){return this.severityNumber=t,this}setSeverityText(t){return this.severityText=t,this}Xe(){this.Qe=!0}Je(t){var e=this.Ge.attributeValueLengthLimit;return e>0?"string"==typeof t?this.Ye(t,e):Array.isArray(t)?t.map((t=>"string"==typeof t?this.Ye(t,e):t)):t:(rv.warn("Attribute value limit must be positive, got "+e),t)}Ye(t,e){return t.length>e?t.substring(0,e):t}Ve(){return this.Qe&&rv.warn("Can not execute the operation on emitted log record"),this.Qe}}class kf{constructor(t,e){this.instrumentationScope=void 0,this.Ke=void 0,this.instrumentationScope=t,this.Ke=e}emit(t){var e=t.context||ev.active(),i=new Sf(this.Ke,this.instrumentationScope,r({context:e},t));this.Ke.activeProcessor.onEmit(i,e),i.Xe()}}class Cf{forceFlush(){return Promise.resolve()}onEmit(t,e){}shutdown(){return Promise.resolve()}}class Tf{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=>qv(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 If{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 Tf(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new Cf}}class Ef{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=Pv(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:sf({"service.name":"unknown_service",[cv]:fv[cv],[dv]:fv[dv],[vv]:fv[vv]});this.Ke=new If(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 Uv(this.tt,this)}getLogger(t,e,r){if(this.et.isCalled)return rv.warn("A shutdown LoggerProvider cannot provide a Logger"),Xc;t||rv.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 kf({name:i,version:e,schemaUrl:null==r?void 0:r.schemaUrl},this.Ke)),this.Ke.loggers.get(n)}forceFlush(){return this.et.isCalled?(rv.warn("invalid attempt to force flush after LoggerProvider shutdown"),this.et.promise):this.Ke.activeProcessor.forceFlush()}shutdown(){return this.et.isCalled?(rv.warn("shutdown may only be called once per LoggerProvider"),this.et.promise):this.et.call()}tt(){return this.Ke.activeProcessor.shutdown()}}class Rf{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.ht=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 Uv(this.tt,this),this.nt>this.it&&(rv.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.dt(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()}))()}dt(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)=>{qv(this.Re(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,uv(t)}))};if(this.ct.length>=this.nt)return t();void 0===this.ht&&(this.ht=setTimeout((()=>t()),this.ot),"number"!=typeof this.ht&&this.ht.unref())}}bt(){void 0!==this.ht&&(clearTimeout(this.ht),this.ht=void 0)}Re(t){var e=()=>Hv.Re(this.rt,t).then((t=>{var e;t.code!==lv.SUCCESS&&uv(null!==(e=t.error)&&void 0!==e?e:new Error("BatchLogRecordProcessor: log record export failed (status "+t+")"))})).catch(uv),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,uv)}}class Mf extends Rf{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 Of=(t,e,r)=>r.remaining>0?e.length>r.remaining?(t.push(e.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(t.push(e),r.remaining-=e.length,!0):(r.truncated=!0,!1),Pf=(t,e,r)=>{var i=JSON.stringify(t);if(r.remaining>=i.length)return Of(e,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,s=Math.min(t.length,r.remaining-2);s>n;){var o=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,o)).length>r.remaining?s=o-1:n=o}return Of(e,JSON.stringify(t.slice(0,n)),r)},Lf=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Af=function(t,e,r,i,n){if(void 0===n&&(n=!1),!Lf(t))return!n||Of(e,"null",r);if(yr(t)||(t=>{try{return _r(t)||xr(t)}catch(t){return!1}})(t))return Of(e,JSON.stringify(t),r);if("string"==typeof t)return Pf(t,e,r);if(!vr(t)&&!cr(t))return Of(e,JSON.stringify(t),r);if(i.has(t))return Pf("[Circular]",e,r);i.add(t);try{var s=t.toJSON;if(dr(s))return Af(s.call(t),e,r,i,n)}catch(t){}try{var o={}.toString.call(t);if("[object String]"===o)return Pf(String(t.valueOf()),e,r);if("[object Number]"===o||"[object Boolean]"===o)return Of(e,JSON.stringify(t.valueOf()),r)}catch(t){}if(t instanceof Error){var a={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(a[u]=t[u])}catch(t){}try{a.name=t.name}catch(t){}try{a.message=t.message}catch(t){}try{a.stack=t.stack}catch(t){}return Af(a,e,r,i,n)}if(cr(t)){if(!Of(e,"[",r))return!1;for(var l=0;t.length>l;l++){if(l>0&&!Of(e,",",r))return!1;var h=void 0;try{h=t[l]}catch(t){h=void 0}if(!Af(h,e,r,i,!0))return!1}return Of(e,"]",r)}if(!Of(e,"{",r))return!1;var c=!0;try{for(var d in t)if({}.hasOwnProperty.call(t,d)){if(0>=r.remaining)return r.truncated=!0,!1;var v=void 0;try{v=t[d]}catch(t){continue}if(Lf(v)){var f=(c?"":",")+JSON.stringify(d)+":";if(f.length>=r.remaining)return r.truncated=!0,!1;var p=e.length,g=r.remaining,m=r.truncated;if(!Of(e,f,r))return!1;var y=e.length,b=Af(v,e,r,i,!1),_=r.truncated;if(e.length!==y){if(c=!1,!b)return!1}else if(e.length=p,r.remaining=g,r.truncated=b?m:_,!b)return!1}}}catch(t){}return Of(e,"}",r)},Nf=function(t,e,r,i,n,s){if(void 0===e&&(e=""),void 0===r&&(r={}),void 0===i&&(i=50),void 0===n&&(n=1e4),void 0===s&&(s=new WeakSet),s.has(t))return r[e||"circular"]="[Circular]",r;s.add(t);try{for(var o in t)try{if(!{}.hasOwnProperty.call(t,o))continue;var a=t[o],u=e?e+"."+o:o;if(vr(a))Nf(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},Ff={log:"INFO",warn:"WARNING",error:"ERROR",debug:"DEBUG",info:"INFO"};An.__PosthogExtensions__=An.__PosthogExtensions__||{},An.__PosthogExtensions__.logs={initializeLogs(t){(t=>{var e,i={"service.name":(null==(e=t.config.logs)?void 0:e.serviceName)||"posthog-browser-logs",host:An.location.host};if(t.sessionManager){var{sessionId:n,windowId:s}=t.sessionManager.checkAndGetSessionAndWindowId(!0);i=r({},i,{"session.id":n,"window.id":s})}ad.setGlobalLoggerProvider(new Ef({resource:sf(i),processors:[new Mf(new xf({url:t.config.api_host+"/i/v1/logs?token="+t.config.token,headers:{"Content-Type":"text/plain"}}))]}))})(t);var e=ad.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;An.console[n]=(s=An.console[n],function(){for(var o=arguments.length,a=new Array(o),u=0;o>u;u++)a[u]=arguments[u];if(0!==a.length)if(t.is_capturing()){var{body:l,truncated:h}=((t,e)=>{for(var r=[],i={remaining:1e4,truncated:!1},n=0;t.length>n&&(0>=n||Of(r," ",i))&&Af(t[n],r,i,new WeakSet);n++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated}})(a),c=r({},i,h?{body_truncated:"true"}:{});e.emit({severityText:Ff[n],body:l,attributes:r({"log.source":"console."+n,distinct_id:t.get_distinct_id(),"location.href":An.location.href},c,vr(a[0])?Nf(a[0]):{})}),s.apply(An.console,a)}else s.apply(An.console,a)})};for(var a of["debug","log","warn","error","info"])o(a)}};var $f=jn("[Error tracking]");function Df(){return new Wi([new on,new gn,new un,new an,new fn,new vn,new hn,new pn],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=nn.test(u)?u.replace(nn,"$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>=sn)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,sn).map((t=>{return r({},t,{filename:t.filename||(i=e,i[i.length-1]||{}).filename,function:t.function||Zi});var i}))}(s)}}("web:javascript",Xi,rn))}var qf=jn("[ExceptionAutocapture]"),jf=Df(),Uf={wrapOnError(t){var e=kn;e||qf.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=jf.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=kn;e||qf.info("window not available, cannot wrap onUnhandledRejection");var r=e.onunhandledrejection;return e.onunhandledrejection=function(e){var i,n=jf.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||qf.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=jf.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}}};An.__PosthogExtensions__=An.__PosthogExtensions__||{},An.__PosthogExtensions__.errorWrappingFunctions=Uf,An.posthogErrorWrappingFunctions=Uf;var Hf="X-POSTHOG-SESSION-ID",Bf="X-POSTHOG-WINDOW-ID",zf="X-POSTHOG-DISTINCT-ID",Vf=[Hf,Bf,zf],Wf=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],Zf=(t,e)=>({}.hasOwnProperty.call(t,e)),Gf=t=>"object"==typeof t&&!yr(t)||dr(t),Qf=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),Jf=t=>{try{var e;return Qf(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==kn||null==(e=kn.location)?void 0:e.href).toString()}catch(t){return}},Kf=(t,e,r,i,n)=>{var s;try{s=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(cr(t)&&!t.includes(s))return!1;var o=!1;if(r){var{sessionId:a,windowId:u}=r.checkAndGetSessionAndWindowId(!0);n.set(Hf,a),n.set(Bf,u),o=!0}var l=(t=>dr(t)?t():t)(e);return l&&l!==Ks&&(n.set(zf,l),o=!0),o};An.__PosthogExtensions__=An.__PosthogExtensions__||{};var Yf={_patchFetch:(t,e,i)=>is(kn,"fetch",(n=>function(s,o){var a=arguments.length>1?[s,o]:[s],u=a;try{var l=Jf(s);if(l)if(Qf(s)){var h=new Request(s,o);Kf(t,e,i,h.url,h.headers),u=[h]}else{var c=new Headers(Gf(o)?o.headers:void 0);if(Kf(t,e,i,l,c)){var d=((t,e)=>{if(pr(t)||yr(t))return{headers:e};if(Gf(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(i);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),n}return new Proxy({headers:e},{get:(t,e)=>Zf(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>Zf(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach((t=>e.add(t))),Wf.forEach((t=>{t in i&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var n=Reflect.getOwnPropertyDescriptor(t,e);if(n)return n;if("string"==typeof e&&Wf.includes(e)&&e in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,e,i)}};var s=Reflect.getOwnPropertyDescriptor(i,e);return s?r({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(o,c);d&&(u=[s,d])}}}catch(t){u=a}return n.apply(this,u)})),_patchXHR:(t,e,r)=>is(kn.XMLHttpRequest.prototype,"open",(i=>function(n,s,o,a,u){void 0===o&&(o=!0);var l=this,h=new Headers,c=Jf(s);c&&Kf(t,e,r,c,h);var d=i.call(l,n,s,o,a,u);return Vf.forEach((t=>{var e=h.get(t);if(e)try{l.setRequestHeader(t,e)}catch(t){}})),d}))};An.__PosthogExtensions__.tracingHeadersPatchFns=Yf,An.postHogTracingHeadersPatchFns=Yf;var Xf=-1,tp=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Xf=e.timeStamp,t(e))}),!0)},ep=(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))}},rp=t=>{requestAnimationFrame((()=>requestAnimationFrame((()=>t()))))},ip=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},np=()=>{var t,e=ip();return null!==(t=null==e?void 0:e.activationStart)&&void 0!==t?t:0},sp=function(t,e){void 0===e&&(e=-1);var r=ip(),i="navigate";return 0>Xf?r&&(document.prerendering||np()>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}},op=new WeakMap;function ap(t,e){return op.get(t)||op.set(t,new e),op.get(t)}class up{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 lp,hp=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){}},cp=t=>{var e=!1;return()=>{e||(t(),e=!0)}},dp=-1,vp=new Set,fp=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,pp=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of vp)e();isFinite(dp)||(dp="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",pp,!0))}},gp=()=>{if(0>dp){var t,e=np(),r=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0])?void 0:t.startTime;dp=null!=r?r:fp(),addEventListener("visibilitychange",pp,!0),addEventListener("prerenderingchange",pp,!0),tp((()=>{setTimeout((()=>{dp=fp()}))}))}return{get firstHiddenTime(){return dp},onHidden(t){vp.add(t)}}},mp=t=>{document.prerendering?addEventListener("prerenderingchange",(()=>t()),!0):t()},yp=[1800,3e3],bp=function(t,e){void 0===e&&(e={}),mp((()=>{var r,i=gp(),n=sp("FCP"),s=hp("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),i.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-np(),0),n.entries.push(e),r(!0)))}));s&&(r=ep(t,n,yp,e.reportAllChanges),tp((i=>{n=sp("FCP"),r=ep(t,n,yp,e.reportAllChanges),rp((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))})))}))},_p=[.1,.25],wp=0,xp=1/0,Sp=0,kp=t=>{for(var e of t)e.interactionId&&(xp=Math.min(xp,e.interactionId),Sp=Math.max(Sp,e.interactionId),wp=Sp?(Sp-xp)/7+1:0)},Cp=()=>{var t;return lp?wp:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Tp=0;class Ip{constructor(){this.u=[],this.l=new Map,this.m=void 0,this.p=void 0}v(){Tp=Cp(),this.u.length=0,this.l.clear()}L(){var t=Math.min(this.u.length-1,Math.floor((Cp()-Tp)/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 Ep=t=>{var e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=cp(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e((()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})})))},Rp=[200,500];class Mp{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var Op=[2500,4e3],Pp={onLCP(t,e){void 0===e&&(e={}),mp((()=>{var r,i=gp(),n=sp("LCP"),s=ap(e,Mp),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-np(),0),n.entries=[o],r())},a=hp("largest-contentful-paint",o);if(a){r=ep(t,n,Op,e.reportAllChanges);var u=cp((()=>{o(a.takeRecords()),a.disconnect(),r(!0)})),l=t=>{t.isTrusted&&(Ep(u),removeEventListener(t.type,l,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,l,{capture:!0});tp((i=>{n=sp("LCP"),r=ep(t,n,Op,e.reportAllChanges),rp((()=>{n.value=performance.now()-i.timeStamp,r(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var r=gp();bp(cp((()=>{var i,n=sp("CLS",0),s=ap(e,up),o=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},a=hp("layout-shift",o);a&&(i=ep(t,n,_p,e.reportAllChanges),r.onHidden((()=>{o(a.takeRecords()),i(!0)})),tp((()=>{s.i=0,n=sp("CLS",0),i=ep(t,n,_p,e.reportAllChanges),rp((()=>i()))})),setTimeout(i))})))},onFCP:bp,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=gp();mp((()=>{var i;"interactionCount"in performance||lp||(lp=hp("event",kp,{type:"event",buffered:!0,durationThreshold:0}));var n,s=sp("INP"),o=ap(e,Ip),a=t=>{Ep((()=>{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=hp("event",a,{durationThreshold:null!==(i=e.durationThreshold)&&void 0!==i?i:40});n=ep(t,s,Rp,e.reportAllChanges),u&&(u.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{a(u.takeRecords()),n(!0)})),tp((()=>{o.v(),s=sp("INP"),n=ep(t,s,Rp,e.reportAllChanges)})))}))}}};An.__PosthogExtensions__=An.__PosthogExtensions__||{},An.__PosthogExtensions__.postHogWebVitalsCallbacks=Pp,An.postHogWebVitalsCallbacks=Pp,An.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Pp;class Lp{constructor(t){this.disabled=!1===t;var e=vr(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 Ap="$copy_autocapture",Np=jn("[AutoCapture]");function Fp(t,e){return e.length>t?e.slice(0,t)+"...":e}function $p(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!yo(e));return e}function Dp(t,e){var i,n,{e:s,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:u,elementsChainAsString:l}=e;if(!yo(t))return{props:{}};for(var h=[t],c=t;c.parentNode&&!bo(c,"body");)if(wo(c.parentNode))h.push(c.parentNode.host),c=c.parentNode.host;else{if(!yo(c.parentNode))break;h.push(c.parentNode),c=c.parentNode}var d,v,f=[],p={},g=!1,m=!1;if(Hn(h,(t=>{var e=jo(t);if(bo(t,"a")){var r=t.getAttribute("href");g=e&&!!r&&Go(r)&&r}sr(ko(t),"ph-no-capture")&&(m=!0),f.push(function(t,e,r,i){var n=t.tagName.toLowerCase(),s={tag_name:n};Eo.indexOf(n)>-1&&!r&&(s.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?Fp(1024,Qo(t)):Fp(1024,To(t)));var o=ko(t);o.length>0&&(s.classes=o.filter((function(t){return""!==t}))),Hn(t.attributes,(function(r){var n;if((!Uo(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&Go(r.value)&&(!gr(n=r.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=r.value;"class"===r.name&&(o=xo(o).join(" ")),s["attr__"+r.name]=Fp(1024,o)}}));for(var a=1,u=1,l=t;l=$p(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(!jo(t))return{};var e={};return Hn(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&&Go(i)&&(e[r]=i)}})),e}(t);Bn(p,i)})),m)return{props:{},explicitNoCapture:m};if(a||(f[0].$el_text=bo(t,"a")||bo(t,"button")?Qo(t):To(t)),g){var y,b;f[0].attr__href=g;var _=null==(y=Yn(g))?void 0:y.host,w=null==kn||null==(b=kn.location)?void 0:b.host;_&&w&&_!==w&&(d=g)}return{props:Bn({$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 zn(o).sort(((t,e)=>{var[r]=t,[i]=e;return r.localeCompare(i)})).forEach((t=>{var[e,r]=t;return a[Ko(e.toString())]=Ko(r.toString())})),(n+=":")+zn(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:Yo(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return zn(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 qp={};function jp(t){return function(t,e){var r=qp[t];if(r)return r;var i,n=e[t];if(dr(i=n)&&-1!==i.toString().indexOf("[native code]")&&!kn.Zone)return qp[t]=n.bind(e);var s=e.document;if(s&&dr(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){qn.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}return n&&dr(n)?qp[t]=n.bind(e):n}("MutationObserver",t)}function Up(t,e){return _r(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,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:o.__onCapture}}constructor(t,e){this.Tt=[],this.Ct=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,__onCapture:t}),this.Mt=t=>{var e=function(t){var e=Io(t);return e?{node:e,originalEvent:t,timestamp:Date.now()}:null}(t);yr(e)||this._t(e)||this.Tt.push(e),this.Tt.length&&pr(this.Lt)&&(this.Lt=An.setTimeout((()=>{this.Rt()}),1e3))},this.Ot=()=>{var t=Date.now();t%50==0&&this.Tt.forEach((e=>{pr(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Et=()=>{this.Nt=Date.now()},this.At=()=>{"visible"===(null==In?void 0:In.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=jp(An);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,An.removeEventListener("click",this.Mt),An.removeEventListener("scroll",this.Ot,{capture:!0}),An.removeEventListener("selectionchange",this.Et),null==In||In.removeEventListener("visibilitychange",this.At)}Vt(t){this.Wt=Date.now()}Dt(){Jn(An,"click",this.Mt)}Ft(){Jn(An,"scroll",this.Ot,{capture:!0})}jt(){Jn(An,"selectionchange",this.Et)}Ht(){Jn(In,"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(mo(t.node))return!0;var r=this.Tt.some((e=>e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!r&&!bo(t.node,"html")&&yo(t.node)&&!function(t){if(!kn||Do(t))return!1;var{targetElementList:e}=qo(t,!1);return e.some((t=>bo(t,"a")))}(t.node)&&function(t,e){var r;if(!kn||Do(t))return!1;var i=xr(e)?Ao:null!==(r=null==e?void 0:e.css_selector_ignorelist)&&void 0!==r?r:Ao,{targetElementList:n}=qo(t,!1);return!Ro(n,i)}(t.node,{css_selector_ignorelist:this.qt.css_selector_ignorelist}))}Rt(){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=Up(e.scrollDelayMs,this.qt.scroll_threshold_ms),n=Up(e.selectionChangedDelayMs,this.qt.selection_change_threshold_ms),s=Up(e.mutationDelayMs,this.qt.mutation_threshold_ms),o=Up(e.absoluteDelayMs,1.1*this.qt.mutation_threshold_ms),a=_r(e.scrollDelayMs)&&this.qt.scroll_threshold_ms>e.scrollDelayMs,u=_r(e.mutationDelayMs)&&this.qt.mutation_threshold_ms>e.mutationDelayMs,l=_r(e.selectionChangedDelayMs)&&this.qt.selection_change_threshold_ms>e.selectionChangedDelayMs,h=_r(e.visibilityChangedDelayMs)&&this.qt.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(a||u||l||h)){var c=Up(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&&pr(this.Lt)&&(this.Lt=An.setTimeout((()=>{this.Rt()}),1e3))}}It(t,e){this.instance.capture("$dead_click",r({},e,Dp(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)})}}An.__PosthogExtensions__=An.__PosthogExtensions__||{},An.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new Hp(t,e);var Bp=jn("[ExternalScriptsLoader]"),zp=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return Bp.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var i=null==In?void 0:In.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(!In)return r("document not found");var i=In.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)In.head.appendChild(i);else{var n,s=In.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(i,s[0]):In.body.appendChild(i)}};null!=In&&In.body?a():null==In||In.addEventListener("DOMContentLoaded",a)};An.__PosthogExtensions__=An.__PosthogExtensions__||{},An.__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)}zp(t,i,r)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");zp(t,o,r)}},An.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var i=t.requestRouter.endpointFor("api",e);zp(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===io||this.isRejected()||-1===this.consent&&this.qt.cookieless_mode===ro}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 Er(t)?1:sr(Rr,t)?0:-1}get nr(){var t=this.qt.opt_out_capturing_persistence_type,e="localStorage"===t?dh:hh;if(!this.ar||this.ar!==e){this.ar=e;var r="localStorage"===t?hh:dh;r.A(this.sr)&&(this.ar.A(this.sr)||this.optInOut(Er(r.A(this.sr))),r.q(this.sr,this.qt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.qt.respect_dnt&&[null==Tn?void 0:Tn.doNotTrack,null==Tn?void 0:Tn.msDoNotTrack,An.doNotTrack].some((t=>Er(t)))}}var Wp=jn("[Dead Clicks]"),Zp=()=>!0,Gp=t=>{var e,r=!(null==(e=t.instance.persistence)||!e.get_property(ps)),i=t.instance.config.capture_dead_clicks;return xr(i)?i:!!vr(i)||r};class Qp{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({[ps]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.lr((()=>{this.hr()})):this.stop()}lr(t){var e,r;null!=(e=An.__PosthogExtensions__)&&e.initDeadClicksAutocapture&&t(),null==(r=An.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?Wp.error("failed to load script",e):t()}))}hr(){var t;if(In){if(!this.ur&&null!=(t=An.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=vr(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};e.__onCapture=this.onCapture,this.ur=An.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.ur.start(In),Wp.info("starting...")}}else Wp.error("`document` not found. Cannot start.")}stop(){this.ur&&(this.ur.stop(),this.ur=void 0,Wp.info("stopping..."))}}var Jp=jn("[SegmentIntegration]");var Kp="posthog-js";function Yp(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 Xp{constructor(t,e,r,i,n,s){this.name=Kp,this.setupOnce=function(o){o(Yp(t,{organization:e,projectId:r,prefix:i,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class tg{constructor(t){this.cr=(t,e,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(qn.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==kn?void 0:kn.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(!(pr(s)||pr(o)||pr(a)||pr(u)||pr(l)||pr(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?Mr(o/s,0,1,qn):1,d=s>1?Mr(a/s,0,1,qn):1,v=u>1?Mr(l/u,0,1,qn):1,f=u>1?Mr(h/u,0,1,qn):1;i=Bn(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 eg=["flags","surveys"],rg={[ss]:{exposure:"hidden"},[as]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[us]:{exposure:"hidden"},[ls]:{exposure:"event"},[hs]:{exposure:"hidden"},[cs]:{exposure:"event"},[ds]:{exposure:"hidden"},[vs]:{exposure:"event"},[fs]:{exposure:"event"},[ps]:{exposure:"event"},[gs]:{exposure:"hidden"},[ms]:{exposure:"event"},[ys]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Ss]:{exposure:"hidden"},[ks]:{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"},[Cs]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!vr(t))return{};for(var e={},r=Object.keys(t),i=0;r.length>i;i++)e["$feature/"+r[i]]=t[r[i]];return e}},[Ts]:{exposure:"event",storageGroup:"flags"},[Is]:{exposure:"hidden"},[Es]:{exposure:"hidden",storageGroup:"flags"},[Rs]:{exposure:"event",storageGroup:"flags"},[Ms]:{exposure:"event",storageGroup:"flags"},[Os]:{exposure:"event"},[Ps]:{exposure:"hidden"},[Ls]:{exposure:"hidden"},[As]:{exposure:"hidden"},[Ns]:{exposure:"hidden",storageGroup:"surveys"},[Fs]:{exposure:"hidden",storageGroup:"surveys"},[$s]:{exposure:"event"},[Ds]:{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"},[qs]:{exposure:"hidden"},[js]:{exposure:"hidden"},[Us]:{exposure:"hidden"},[Hs]:{exposure:"hidden",storageGroup:"flags"},[Bs]:{exposure:"hidden"},[zs]:{exposure:"hidden"},[Vs]:{exposure:"hidden"},[Ws]:{exposure:"hidden"},[Zs]:{exposure:"hidden"},[Gs]:{exposure:"hidden"},[Qs]:{exposure:"hidden"},[bs]:{exposure:"event"},[_s]:{exposure:"event"},[ws]:{exposure:"event"},[xs]:{exposure:"event"},[Ys]:{exposure:"event"},[Xs]:{exposure:"event"},[to]:{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"}},ig=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ng=t=>{var e=rg[t];if(e)return e;for(var[r,i]of ig)if(0===t.indexOf(r))return i},sg={flags:Hs,surveys:Fs},og=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],ag="main";class ug{constructor(t,e,i){if(void 0===i&&(i=!0),this.mr={},this.yr=!1,this.br=!1,this.qt=t,this._r=i,this.props={},this.wr=!1,this.Sr=(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.kr(t),this.br=this.Cr(t),this.load(),t.debug&&qn.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t,e),this.save(),kn){var n=()=>this.flush();Jn(kn,"beforeunload",n,{capture:!1}),Jn(kn,"pagehide",n,{capture:!1})}}Ir(){var t,e=null==(t=this.qt)?void 0:t.persistence_save_debounce_ms;return _r(e)&&e>0?e:0}isDisabled(){return!!this.Tr}kr(t){-1===og.indexOf(t.persistence.toLowerCase())&&(qn.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,i=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var i=[...vh,...t];return r({},dh,{F(t){try{var r={};try{r=hh.F(t)||{}}catch(t){}var i,n=JSON.parse(dh.A(t)||"{}");if(e){var s={};for(var o in r){var a=r[o];yr(a)||""===a||(s[o]=a)}i=Bn(n,s)}else i=Bn(r,n);return dh.N(t,i),i}catch(t){}return null},N(t,e,r,n,s,o){var a=dh.N(t,e,void 0,void 0,o);try{var u={};i.forEach((t=>{e[t]&&(u[t]=e[t])})),Object.keys(u).length&&hh.N(t,u,r,n,s,o)}catch(t){dh.D(t)}return a},q(t,e){try{null==kn||kn.localStorage.removeItem(t),hh.q(t,e)}catch(t){dh.D(t)}}})}(t.cookie_persisted_properties||[],t.__preview_cookie_wins_on_conflict||!1),n=!1,s=t.persistence.toLowerCase();return"localstorage"===s&&dh.O()?(e=dh,n=!0):"localstorage+cookie"===s&&i.O()?(e=i,n=!0):"sessionstorage"===s&&mh.O()?e=mh:"memory"===s?e=ph:"cookie"===s?e=hh:i.O()?(e=i,n=!0):e=hh,this.yr=n,e}Er(t){return this.Sr+"__"+t}Cr(t){return this.yr&&!!t.split_storage}Mr(t){var e=null!=t?t:this.qt.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var r=this.props[Hs];return!r||"number"!=typeof r||Date.now()-r>e}properties(){var t={};return Hn(this.props,((e,r)=>{var i=ng(r);if("derived"===(null==i?void 0:i.exposure)){if(null!=i.shouldSkipFromEventProperties&&i.shouldSkipFromEventProperties(e,r===Cs?()=>this.Mr():()=>!1))return;i.transformToEventProperties&&Bn(t,i.transformToEventProperties(e))}else i&&"event"!==i.exposure||(t[r]=e)})),t}load(){if(!this.Tr){var t=this.nr.F(this.Sr);t&&(this.props=Bn({},t)),this.br&&this.Rr()}}Rr(){for(var t of eg){var e=dh.F(this.Er(t));if(e&&!fr(e)){var r=this.Pr(t);r.persisted=!0,this.Or(t)||(r.fingerprint=this.Lr(e,t)),this.Ar(t,e)||Bn(this.props,e)}}}Or(t){return Object.keys(this.props).some((e=>{var r;return(null==(r=ng(e))?void 0:r.storageGroup)===t}))}Ar(t,e){var r=sg[t];if(!r)return!1;var i=e[r],n=this.props[r];return _r(i)&&_r(n)&&n>i}refreshKey(t){var e;if(!this.Tr){var r=this.br?null==(e=ng(t))?void 0:e.storageGroup:void 0,i=r?dh.F(this.Er(r)):this.nr.F(this.Sr);if(i&&t in i)this.Fr(t,i[t]);else{if(r){var n=this.nr.F(this.Sr);if(n&&t in n)return void this.Fr(t,n[t])}this.Nr(t)}}}save(){if(!this.Tr){var t=this.Ir();t>0?pr(this.Dr)&&(this.Dr=setTimeout((()=>{this.Dr=void 0,this.$r()}),t)):this.$r()}}flush(){pr(this.Dr)||(clearTimeout(this.Dr),this.Dr=void 0,this.$r())}$r(){this.Tr||(this.br?this.qr():this.jr(this.nr,this.Sr,this.props,ag))}qr(){var{main:t,groups:e}=this.Hr();for(var r of(this.jr(this.nr,this.Sr,t,ag),eg)){var i,n=e[r];(!fr(n)||null!=(i=this.mr[r])&&i.persisted)&&this.jr(dh,this.Er(r),n,r)}}Hr(){var t={},e={};for(var r of eg)e[r]={};return Hn(this.props,((r,i)=>{var n,s=null==(n=ng(i))?void 0:n.storageGroup;s?e[s][i]=r:t[i]=r})),{main:t,groups:e}}Lr(t,e){var r=JSON.stringify(t);return e===ag?r+"|"+this.Ur+"|"+this.Br+"|"+this.zr:r}jr(t,e,r,i){var n=this.Pr(i);if(i===ag||n.dirty||pr(n.fingerprint)){var s;try{if((s=this.Lr(r,i))===n.fingerprint)return void(n.dirty=!1)}catch(t){s=void 0}t.N(e,r,this.Ur,this.Br,this.zr,this.qt.debug)?(n.dirty=!1,i!==ag&&(n.persisted=!0),pr(s)||(n.fingerprint=s)):this.qt.debug&&qn.warn('failed to persist storage entry "'+e+'"; will retry on next save')}}remove(t){var{keepGroupEntries:e=!1}=void 0===t?{}:t;if(pr(this.Dr)||(clearTimeout(this.Dr),this.Dr=void 0),this.nr.q(this.Sr,!1),this.nr.q(this.Sr,!0),!e&&this._r)for(var r of eg)dh.q(this.Er(r));e?delete this.mr[ag]:this.mr={}}clear(){this.remove(),this.props={}}register_once(t,e,r){if(vr(t)){pr(e)&&(e="None"),this.Ur=pr(r)?this.Vr:r;var i=!1;if(Hn(t,((t,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==e||(this.Fr(r,t),i=!0)})),i)return this.save(),!0}return!1}register(t,e){if(vr(t)){this.Ur=pr(e)?this.Vr:e;var r=!1;if(Hn(t,((e,i)=>{t.hasOwnProperty(i)&&this.props[i]!==e&&(this.Fr(i,e),r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Nr(t),this.save())}update_campaign_params(){if(!this.wr){var t=Ic(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);fr(Zn(t))||this.register(t),this.wr=!0}}update_search_keyword(){var t;this.register((t=null==In?void 0:In.referrer)?Rc(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Pc(),$referring_domain:null!=In&&In.referrer&&(null==(t=Yn(In.referrer))?void 0:t.host)||Oc},void 0)}set_initial_person_info(){this.props[Ws]||this.props[Zs]||this.register_once({[Gs]:Lc(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Hn([Zs,Ws],(e=>{var r=this.props[e];r&&Hn(r,(function(e,r){t["$initial_"+ar(r)]=e}))}));var e,r,i=this.props[Gs];if(i){var n=(e=Ac(i),r={},Hn(e,(function(t,e){r["$initial_"+ar(e)]=t})),r);Bn(t,n)}return t}safe_merge(t){return Hn(this.props,(function(e,r){r in t||(t[r]=e)})),t}update_config(t,e,r){this.Vr=this.Ur=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie);var i=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||[]),n=i?this.kr(t):this.nr,s=this.Cr(t);if(i||s!==this.br){var o=this.props;this.clear(),this.nr=n,this.br=s,this.props=o,this.save()}}set_disabled(t){this.Tr=t,this.Tr?this.remove():this.save()}set_cross_subdomain(t){t!==this.Br&&(this.Br=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.zr&&(this.zr=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var r=this.props[us]||{};r[t]=e,this.Fr(us,r),this.save()}remove_event_timer(t){var e=this.props[us]||{},r=e[t];return pr(r)||(delete e[t],this.Fr(us,e),this.save()),r}get_property(t){return this.props[t]}set_property(t,e){this.Fr(t,e),this.save()}Fr(t,e){this.props[t]=e,this.Wr(t)}Nr(t){delete this.props[t],this.Wr(t)}Wr(t){var e,r=null==(e=ng(t))?void 0:e.storageGroup;r&&(this.Pr(r).dirty=!0)}Pr(t){return this.mr[t]||(this.mr[t]={})}}var lg={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},hg={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"},cg={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"},dg=jn("[RateLimiter]");class vg{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=>{dg.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void dg.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(Vs))&&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(Vs,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var fg=jn("[RemoteConfig]");class pg{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=An._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Zr(t){var e,r;null!=(e=An.__PosthogExtensions__)&&e.loadExternalDependency?null==(r=An.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Gr(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 fg.info("Using preloaded remote config",this.remoteConfig),this.Qr(this.remoteConfig),void this.Jr();if(this._instance.Kr())return void fg.warn("Remote config is disabled. Falling back to local config.");this.Zr((t=>{if(!t)return fg.info("No config found after loading remote JS config. Falling back to JSON."),void this.Gr((t=>{this.Qr(t),this.Jr()}));this.Qr(t),this.Jr()}))}catch(t){fg.error("Error loading remote config",t)}}stop(){this.Yr&&(clearInterval(this.Yr),this.Yr=void 0)}refresh(){!this._instance.Kr()&&In&&"hidden"!==In.visibilityState&&this._instance.reloadFeatureFlags()}Jr(){var t;if(!this.Yr){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.Yr=setInterval((()=>{this.refresh()}),e))}}Qr(t){var e;t||fg.error("Failed to fetch remote config from PostHog."),this._instance.Qr(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 gg=3e3;class mg{constructor(t,e){this.Xr=!0,this.ei=[],this.ti=Mr((null==e?void 0:e.flush_interval_ms)||gg,250,5e3,qn.createLogger("flush interval"),gg),this.ri=t}enqueue(t){this.ei.push(t),this.ii||this.ni()}unload(){this.si();var t=this.ei.length>0?this.oi():{},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.ri(r({},t,{transport:"sendBeacon"}))}))}enable(){this.Xr=!1,this.ni()}ni(){var t=this;this.Xr||(this.ii=setTimeout((()=>{if(this.si(),this.ei.length>0){var e=this.oi(),r=function(){var r=e[i],n=(new Date).getTime();r.data&&cr(r.data)&&Hn(r.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.ri(r)};for(var i in e)r()}}),this.ti))}si(){clearTimeout(this.ii),this.ii=void 0}oi(){var t={};return Hn(this.ei,(e=>{var i,n=e,s=(n?n.batchKey:null)||n.url;pr(t[s])&&(t[s]=r({},n,{data:[]})),null==(i=t[s].data)||i.push(n.data)})),this.ei=[],t}}var yg=["retriesPerformedSoFar"];class bg{constructor(t){this.ai=!1,this.ui=3e3,this.ei=[],this._instance=t,this.ei=[],this.li=!0,!pr(kn)&&"onLine"in kn.navigator&&(this.li=kn.navigator.onLine,this.hi=()=>{this.li=!0,this.ci()},this.di=()=>{this.li=!1},Jn(kn,"online",this.hi),Jn(kn,"offline",this.di))}get length(){return this.ei.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,n=i(t,yg);wr(e)&&(n.url=Jl(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.vi(r({retriesPerformedSoFar:e},n))}}))}vi(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.ei.push({retryAt:i,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),qn.warn(n),this.ai||(this.ai=!0,this.fi())}fi(){if(this.pi&&clearTimeout(this.pi),0===this.ei.length)return this.ai=!1,void(this.pi=void 0);this.pi=setTimeout((()=>{this.li&&this.ei.length>0&&this.ci(),this.fi()}),this.ui)}ci(){var t=Date.now(),e=[],r=this.ei.filter((r=>t>r.retryAt||(e.push(r),!1)));if(this.ei=e,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.pi&&(clearTimeout(this.pi),this.pi=void 0),this.ai=!1,pr(kn)||(this.hi&&(kn.removeEventListener("online",this.hi),this.hi=void 0),this.di&&(kn.removeEventListener("offline",this.di),this.di=void 0)),this.ei))try{this._instance._send_request(r({},t,{transport:"sendBeacon"}))}catch(t){qn.error(t)}this.ei=[]}}class _g{constructor(t){this.gi=()=>{var t,e,r,i;this.mi||(this.mi={});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.mi.lastScrollY=Math.ceil(s),this.mi.maxScrollY=Math.max(s,null!==(t=this.mi.maxScrollY)&&void 0!==t?t:0),this.mi.maxScrollHeight=Math.max(o,null!==(e=this.mi.maxScrollHeight)&&void 0!==e?e:0),this.mi.lastContentY=a,this.mi.maxContentY=Math.max(a,null!==(r=this.mi.maxContentY)&&void 0!==r?r:0),this.mi.maxContentHeight=Math.max(u,null!==(i=this.mi.maxContentHeight)&&void 0!==i?i:0)},this._instance=t}get yi(){return this._instance.config.scroll_root_selector}getContext(){return this.mi}resetContext(){var t=this.mi;return setTimeout(this.gi,0),t}startMeasuringScrollPosition(){Jn(kn,"scroll",this.gi,{capture:!0}),Jn(kn,"scrollend",this.gi,{capture:!0}),Jn(kn,"resize",this.gi)}scrollElement(){if(!this.yi)return null==kn?void 0:kn.document.documentElement;var t=cr(this.yi)?this.yi:[this.yi];for(var e of t){var r=null==kn?void 0:kn.document.querySelector(e);if(r)return r}}bi(t){var e="y"===t?"scrollTop":"scrollLeft";if(this.yi){var r=this.scrollElement();return r&&r[e]||0}return kn?"y"===t?kn.scrollY||kn.pageYOffset||kn.document.documentElement.scrollTop||0:kn.scrollX||kn.pageXOffset||kn.document.documentElement.scrollLeft||0:0}scrollY(){return this.bi("y")}scrollX(){return this.bi("x")}}var wg=t=>Lc(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class xg{constructor(t,e,r,i){this.wi=t=>{var e=this.xi();if(!e||e.sessionId!==t){var r={sessionId:t,props:this.Si(this._instance)};this.ki.register({[zs]:r})}},this._instance=t,this.Ci=e,this.ki=r,this.Si=i||wg,this.Ci.onSessionId(this.wi)}xi(){return this.ki.props[zs]}getSetOnceProps(){var t,e=null==(t=this.xi())?void 0:t.props;return e?"r"in e?Ac(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 Hn(Zn(this.getSetOnceProps()),((e,r)=>{"$current_url"===r&&(r="url"),t["$session_entry_"+ar(r)]=e})),t}}class Sg{constructor(){this.Ii={}}on(t,e){return this.Ii[t]||(this.Ii[t]=[]),this.Ii[t].push(e),()=>{this.Ii[t]=this.Ii[t].filter((t=>t!==e))}}emit(t,e){for(var r of this.Ii[t]||[])r(e);for(var i of this.Ii["*"]||[])i(t,e)}}var kg=jn("[SessionId]");class Cg{on(t,e){return this.Ti.on(t,e)}constructor(t,e,r){var i;if(this.Ei=null,this.Mi=[],this.Ri=void 0,this.Ti=new Sg,this.Pi=(t,e)=>!(!wr(t)||!wr(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===io)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qt=t.config,this.ki=t.persistence,this.Oi=void 0,this.Li=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ai=e||hl,this.Fi=r||hl;var n=this.qt.persistence_name||this.qt.token;if(this._sessionTimeoutMs=1e3*Mr(this.qt.session_idle_timeout_seconds||1800,60,36e3,kg.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ni(),this.Di="ph_"+n+"_window_id",this.$i="ph_"+n+"_primary_window_exists",this.qi()){var s=mh.F(this.Di),o=mh.F(this.$i);s&&!o?this.Oi=s:mh.q(this.Di),mh.N(this.$i,!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.ji(this.qt.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){kg.error("Invalid sessionID in bootstrap",t)}this.Hi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return pr(this.Mi)&&(this.Mi=[]),this.Mi.push(t),this.Li&&t(this.Li,this.Oi),()=>{this.Mi=this.Mi.filter((e=>e!==t))}}qi(){return"memory"!==this.qt.persistence&&!this.ki.Tr&&mh.O()}Ui(t){t!==this.Oi&&(this.Oi=t,this.qi()&&mh.N(this.Di,t))}Bi(){return this.Oi?this.Oi:this.qi()?mh.F(this.Di):null}zi(t){var e=this.Ei;return!yr(e)&&!yr(t)&&5e3>Math.abs(t-e)}ji(t,e,r){var i=e!==this._sessionActivityTimestamp,n=!(t!==this.Li||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=e,this.Li=t,n&&!i||n&&this.zi(e)||(this.Ei=e,this.ki.register({[Ss]:[e,t,r]}))}Vi(){var t,e=null==(t=this.qt)?void 0:t.persistence_save_debounce_ms;return wr(e)&&e>0}Wi(){var t;if(!yr(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Ei){this.Vi()?this.ki.refreshKey(Ss):(this.ki.flush(),this.ki.load());var[,e,r]=this.Zi();e===this.Li&&r===this._sessionStartTimestamp&&(this.Ei=this._sessionActivityTimestamp,this.ki.register({[Ss]:[this._sessionActivityTimestamp,null!==(t=this.Li)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.ki.flush())}}Gi(){var[t]=this.Zi(),e=wr(t)?t:0,r=wr(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,r)}Zi(){var t=this.ki.props[Ss];return cr(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Ei=null,clearTimeout(this.Qi),this.Qi=void 0,this.ji(null,null,null)}destroy(){this.Wi(),clearTimeout(this.Qi),this.Qi=void 0,this.Ri&&kn&&(kn.removeEventListener(uo,this.Ri,{capture:!1}),this.Ri=void 0),this.Mi=[]}Hi(){this.Ri=()=>{this.Wi(),this.qi()&&mh.q(this.$i)},Jn(kn,uo,this.Ri,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.qt.cookieless_mode===io)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),[,i,n]=this.Zi(),s=this.Gi(),o=this.Bi(),a=wr(n)&&Math.abs(r-n)>864e5,u=!1,l=!i,h=!l&&!t&&this.Pi(r,s);l||h||a?(i=this.Ai(),o=this.Fi(),kg.info("new session ID generated",{sessionId:i,windowId:o,changeReason:{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}}),n=r,u=!0):o||(o=this.Fi(),u=!0);var c=wr(s)&&t&&!a?s:r,d=wr(n)?n:(new Date).getTime();return this.Ui(o),this.ji(i,c,d),t||this.Ni(),u&&this.Mi.forEach((t=>t(i,o,u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0))),{sessionId:i,windowId:o,sessionStartTimestamp:d,changeReason:u?{noSessionId:l,activityTimeout:h,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:s}}Ni(){clearTimeout(this.Qi),this.Qi=setTimeout((()=>{var t=this.Gi();if(this.Pi((new Date).getTime(),t)){var e=this.Li;this.resetSessionId(),this.Ti.emit("forcedIdleReset",{idleSessionId:e})}}),1.1*this.sessionTimeoutMs)}}var Tg=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&nr(r,e))return!0;try{var i=null==t?void 0:t.userAgentData;if(null!=i&&i.brands&&i.brands.some((t=>nr(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver},Ig="custom",Eg="i.posthog.com",Rg=/^\/static\//;class Mg{constructor(t){this.Ji={},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("."+Eg,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Ji[this.apiHost]||(this.Ji[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Ig),this.Ji[this.apiHost]}Ki(t){var e=this.instance.config.__preview_external_dependency_versioned_paths;if("string"==typeof e&&Rg.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.Ki(e);if(r)return""+r+e}if(this.region===Ig)return this.apiHost+e;var i=Eg+e;switch(t){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var Og=jn("[PostHog ExternalIntegrations]"),Pg={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Lg{constructor(t){this._instance=t}lr(t,e){var r;null==(r=An.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,t,(t=>{if(t)return Og.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var r,n,s;!i||null!=(r=An.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]||t.lr(Pg[e],(()=>{var r;null==(r=An.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[e])||r.start(t._instance)})),!i&&null!=(n=An.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[e]&&(null==(s=An.__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 Ag,Ng={},Fg=0,$g=()=>{},Dg='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',qg="Surveys module not available",jg="sanitize_properties is deprecated. Use before_send instead",Ug="Invalid value for property_denylist config: ",Hg="posthog",Bg=!Wl&&-1===(null==Ln?void 0:Ln.indexOf("MSIE"))&&-1===(null==Ln?void 0:Ln.indexOf("Mozilla")),zg=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:Qn(null==In?void 0:In.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:$g,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,__preview_cookie_wins_on_conflict:!1,debug:En&&gr(null==En?void 0:En.search)&&-1!==En.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==kn||null==(e=kn.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){qn.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:oo,before_send:void 0,request_queue_config:{flush_interval_ms:gg},error_tracking:{},_onCapture:$g,__preview_eager_load_replay:!1},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Po,ignore_text_selection:!0}:!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,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t)}))(t))},Vg=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],Wg=t=>{var e={};for(var[r,i]of Vg)pr(t[r])||(e[i]=t[r]);var n=Bn({},e,t);return cr(t.property_blacklist)&&(pr(t.property_denylist)?n.property_denylist=t.property_blacklist:cr(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:qn.error(Ug+t.property_denylist)),n};class Zg{constructor(){this.__forceAllowLocalhost=!1}get Yi(){return this.__forceAllowLocalhost}set Yi(t){qn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Gg{Xi(t,e){if(t){var r=this.en.indexOf(t);-1!==r&&this.en.splice(r,1)}return this.en.push(e),null==e.initialize||e.initialize(),e}tn(){return this.config.cookieless_mode===io||this.config.cookieless_mode===ro&&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 Zg,this.rn=!1,this.version=$n.LIB_VERSION,this.nn=new Sg,this.en=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=zg(),this.SentryIntegration=Xp,this.sentryIntegration=t=>function(t,e){var r=Yp(t,e);return{name:Kp,processEvent:t=>r(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.sn=!1,this.an=null,this.un=null,this.ln=null,this.scrollManager=new _g(this),this.pageViewManager=new tg(this),this.rateLimiter=new vg(this),this.requestRouter=new Mg(this),this.consent=new Vp(this),this.externalIntegrations=new Lg(this);var e=null!==(t=Gg.__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=gr(t)?{[t]:e}:t;this.setPersonProperties(i),null==r||r({})},set_once:(t,e,r)=>{var i=gr(t)?{[t]:e}:t;this.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(t=>qn.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,r){if(r&&r!==Hg){var i,n=null!==(i=Ng[r])&&void 0!==i?i:new Gg;return n._init(t,e,r),Ng[r]=n,Ng[Hg][r]=n,n}return this._init(t,e,r)}_init(t,e,i){var n,s;void 0===e&&(e={});var o=gr(t)?t.trim():"";if(!o)return qn.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.hn(e.debug),this.cn=e,this.dn=[],e.person_profiles?this.un=e.person_profiles:e.process_person&&(this.un=e.process_person);var a=zg(e.defaults),u=Wg(e),l=Bn({},a,u,{name:i,token:o});vr(a.rageclick)&&vr(u.rageclick)&&(l.rageclick=Bn({},a.rageclick,u.rageclick)),this.set_config(l),this.config.on_xhr_error&&qn.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:vl.GZipJS;var h=this.vn();this.persistence=new ug(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ug(r({},this.config,{persistence:"sessionStorage"}),h,!1);var c=r({},this.persistence.props),d=r({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.fn=new mg((t=>this.pn(t)),this.config.request_queue_config),this.gn=new bg(this),this.__request_queue=[];var v=this.tn();if(v||(this.sessionManager=new Cg(this),this.sessionPropsManager=new xg(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(qn.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.mn(v)}),0)):(qn.info("Initializing extensions synchronously"),this.mn(v)),$n.DEBUG=$n.DEBUG||this.config.debug,$n.DEBUG&&qn.info("Starting in debug mode",{this:this,config:e,thisC:r({},this.config),p:c,s:d}),!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 f=e.bootstrap.distinctID,p=this.get_distinct_id(),g=this.persistence.get_property(Bs);if(e.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===no)this.identify(f);else if(e.bootstrap.isIdentifiedID&&null!=p&&p!==f&&g===so)qn.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 m=this.config.get_device_id(hl()),y=e.bootstrap.isIdentifiedID?m:f;this.persistence.set_property(Bs,e.bootstrap.isIdentifiedID?so:no),this.register({distinct_id:f,$device_id:y})}}if(v)this.register_once({distinct_id:Ks,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(hl());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(Bs,no)}return Jn(kn,"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()||hl();t.config.get_device_id=i,r.id()&&(t.register({distinct_id:r.id(),$device_id:i()}),t.persistence.set_property(Bs,so)),e()},n=r.user();"then"in n&&dr(n.then)?n.then(i):i(n)}(t,(()=>{r.register((t=>{Promise&&Promise.resolve||Jp.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()||(Jp.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(Jp.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,lo),identify:t=>e(t,co),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.yn())):this.yn(),dr(this.config._onCapture)&&this.config._onCapture!==$g&&(qn.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&qn.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}mn(t){var e,i,n,s,o,a,u,l=performance.now(),h=r({},Gg.__defaultExtensionClasses,this.config.__extensionClasses),c=[];h.featureFlags&&this.en.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new h.featureFlags(this)),h.exceptions&&this.en.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new h.exceptions(this)),h.historyAutocapture&&this.en.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.en.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this.en.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!t&&this.en.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||c.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),h.autocapture&&this.en.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.en.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new h.surveys(this)),h.logs&&this.en.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new h.logs(this)),h.conversations&&this.en.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new h.conversations(this)),h.productTours&&this.en.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.en.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.en.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.en.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.en.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,Gp)),h.toolbar&&this.en.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new h.toolbar(this)),h.experiments&&this.en.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new h.experiments(this)),this.en.forEach((t=>{t.initialize&&c.push((()=>{null==t.initialize||t.initialize()}))})),c.push((()=>{if(this.bn){var t=this.bn;this.bn=void 0,this.Qr(t)}})),this._n(c,l)}_n(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this._n(t,e)}),0);var r=t.shift();if(r)try{r()}catch(t){qn.error("Error initializing extension:",t)}}var i=Math.round(performance.now()-e);this.register_for_session({[Ys]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Xs]:i}),this.config.__preview_deferred_init_extensions&&qn.info("PostHog extensions initialized ("+i+"ms)")}Qr(t){var e;if(!In||!In.body)return qn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Qr(t)}),500);this.config.__preview_deferred_init_extensions&&(this.bn=t),this.wn=t,this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=sr(t.supportedCompression,vl.GZipJS)?vl.GZipJS:sr(t.supportedCompression,vl.Base64)?vl.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.un?this.un:oo}),this.en.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}yn(){try{this.config.loaded(this)}catch(t){qn.critical("`loaded` function failed",t)}if(this.xn(),this.config.internal_or_test_user_hostname&&null!=En&&En.hostname){var t=En.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.tn())&&this.Sn()}),1),this.kn=new pg(this),this.kn.load()}xn(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.fn)||t.enable())}_dom_loaded(){this.is_capturing()&&Un(this.__request_queue,(t=>this.pn(t))),this.__request_queue=[],this.xn()}_handle_unload(){var t,e,r,i;null==(t=this.surveys)||t.handlePageUnload(),this.config.request_batching?(this.Cn()&&this.capture(ho),null==(e=this.logs)||e.flushLogs("sendBeacon"),null==(r=this.fn)||r.unload(),null==(i=this.gn)||i.unload()):this.Cn()&&this.capture(ho,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(Bg?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Jl(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=eh(s.url,s.compression);var o=null!==(e=s.transport)&&void 0!==e?e:"fetch",a=rh.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===vl.GZipJS&&Pn&&!Gl?th(s).then((t=>{u(t)})).catch((e=>{if(Xe(e))return Gl=!0,void u(r({},s,{compression:void 0,url:eh(t.url,void 0)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Xe(t)||e===Ke})(e)&&(Gl=!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)}}))))}pn(t){this.gn?this.gn.retriableRequest(t):this._send_request(t)}_execute_array(t){Fg++;try{var e,r=[],i=[],n=[];Un(t,(t=>{if(t)if(cr(e=t[0]))n.push(t);else if(dr(t))try{t.call(this)}catch(e){qn.error("Error executing queued PostHog call",t,e)}else cr(t)&&"alias"===e?r.push(t):cr(t)&&-1!==e.indexOf("capture")&&dr(this[e])?n.push(t):i.push(t)}));var s=function(t,e){Un(t,(function(t){try{if(cr(t[0])){var r=e;Hn(t,(function(t){r=r[t[0]].apply(r,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){qn.error("Error executing queued PostHog call",t,e)}}))};s(r,this),s(i,this),s(n,this)}finally{Fg--}}push(t){if(Fg>0&&cr(t)&&gr(t[0])){var e=Gg.prototype[t[0]];dr(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.fn){if(this.is_capturing())if(!pr(t)&&gr(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&&!gr(null==e?void 0:e.$current_url)&&(qn.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.In||qn.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)||hl(),f={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===lo&&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!==vo,t===co);if(p&&(f.$set_once=p),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,o=f,a=t=>gr(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),cr(e)?(i=[],Un(e,(e=>{i.push(t(e))}))):(i={},Hn(e,((e,r)=>{u.has(e)||(i[r]=t(e,r))}))),i);var i}(o)),f.timestamp=d,pr(null==i?void 0:i.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=c),t===$u.DISMISSED||t===$u.SENT){var g=null==e?void 0:e[Du.SURVEY_ID],m=null==e?void 0:e[Du.SURVEY_ITERATION];rl({id:g,current_iteration:m}),f.$set=r({},f.$set,{[Bu({id:g,current_iteration:m},t===$u.SENT?"responded":"dismissed")]:!0})}else t===$u.SHOWN&&(f.$set=r({},f.$set,{[Du.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===hg.SHOWN){var y=null==e?void 0:e[cg.TOUR_TYPE];y&&(f.$set=r({},f.$set,{[cg.TOUR_LAST_SEEN_DATE+"/"+y]:(new Date).toISOString()}))}var b=r({},f.properties.$set,f.$set);if(fr(b)||this.setPersonPropertiesForFlags(b),!br(this.config.before_send)){var _=this.En(f);if(!_)return;f=_}this.nn.emit("eventCaptured",f);var w={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:f,compression:"best-available",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.pn(w):this.fn.enqueue(w),f}qn.critical("This capture call is ignored due to client rate limiting.")}}else qn.error("No event name provided to posthog.capture")}else qn.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.tn()&&(a.$cookieless_mode=!0),"$snapshot"===t){var u=r({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=u.distinct_id,(!gr(a.distinct_id)&&!_r(a.distinct_id)||mr(a.distinct_id))&&qn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,h=function(t,e,r){var i,n,s,o;if(!Ln)return{};var a,u,l=t?[...Sc,...e||[]]:[],[h,c]=function(t){for(var e=0;$i.length>e;e++){var[r,i]=$i[e],n=r.exec(t),s=n&&(dr(i)?i(n,t):i);if(s)return s}return["",""]}(Ln),d=null!=(a="undefined"!=typeof navigator?navigator:void 0)&&a.brave?{brave:!0}:{},v={detectGoogleSearchApp:r},f=Bn(Zn({$os:h,$os_version:c,$browser:Ai(Ln,navigator.vendor,d,v),$device:Di(Ln),$device_type:qi(Ln,{userAgentDataPlatform:null==(i=navigator)||null==(i=i.userAgentData)?void 0:i.platform,maxTouchPoints:null==(n=navigator)?void 0:n.maxTouchPoints,screenWidth:null==kn||null==(s=kn.screen)?void 0:s.width,screenHeight:null==kn||null==(o=kn.screen)?void 0:o.height,devicePixelRatio:null==kn?void 0:kn.devicePixelRatio}),$timezone:Nc(),$timezone_offset:Fc()}),{$current_url:es(null==En?void 0:En.href,l,Cc),$host:null==En?void 0:En.host,$pathname:null==En?void 0:En.pathname,$raw_user_agent:Ln.length>1e3?Ln.substring(0,997)+"...":Ln,$browser_version:Fi(Ln,navigator.vendor,d,v),$browser_language:Mc(),$browser_language_prefix:(u=Mc(),"string"==typeof u?u.split("-")[0]:void 0),$screen_height:null==kn?void 0:kn.screen.height,$screen_width:null==kn?void 0:kn.screen.width,$viewport_height:null==kn?void 0:kn.innerHeight,$viewport_width:null==kn?void 0:kn.innerWidth,$lib:$n.LIB_NAME,$lib_version:$n.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return $n.SDK_DIST_CHANNEL&&(f.$sdk_dist_channel=$n.SDK_DIST_CHANNEL),f}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app);if(this.sessionManager){var{sessionId:c,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime());a.$session_id=c,a.$window_id=d}this.sessionPropsManager&&Bn(a,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&Bn(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(v=this.gn)?void 0:v.length}catch(t){a.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===Ig&&(a.$lib_custom_api_host=this.config.api_host),l=t!==lo||s?t!==ho||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,n),a=Bn(a,l),t===lo&&In&&(a.title=In.title),!pr(o)){var f=i.getTime()-o;a.$duration=parseFloat((f/1e3).toFixed(3))}Ln&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=Bn({},h,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),cr(this.config.property_denylist)?Hn(this.config.property_denylist,(function(t){delete a[t]})):qn.error(Ug+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(qn.error(jg),a=p(a,t));var g=this.Mn();return a.$process_person_profile=g,g&&!s&&this.Rn("_calculate_event_properties"),a}Tn(t,e,r){var i;if(void 0===e&&(e=!0),void 0===r&&(r=!1),!this.persistence||!this.Mn())return t;if(this.rn&&!r)return t;var n=this.persistence.get_initial_props(),s=null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps(),o=Bn({},n,s||{},t||{}),a=this.config.sanitize_properties;return a&&(qn.error(jg),o=a(o,"$set_once")),e&&(this.rn=!0),fr(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)}Pn(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.nn.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:qg}),()=>{})}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:qg})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:qg})}renderSurvey(t,e){var r;null==(r=this.surveys)||r.renderSurvey(t,e)}displaySurvey(t,e){var r;void 0===e&&(e=nl),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:qg}}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:qg})}On(t){return!t||mr(t)?(qn.critical("Unique user id has not been set in posthog.identify"),!1):t===Ks?(qn.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())||(qn.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 qn.uninitializedWarning("posthog.identify");if(_r(t)&&(t=t.toString(),qn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.On(t)&&this.Rn("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:t}),this.get_property(os)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(as)&&(this.unregister(as),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(Bs)||no)===no;t!==i&&s?(this.persistence.set_property(Bs,so),this.setPersonPropertiesForFlags({$set:e||{},$set_once:r||{}},!1),this.capture(co,{distinct_id:t,$anon_distinct_id:i},{$set:e||{},$set_once:r||{}}),this.ln=nh(t,e,r),null==(n=this.featureFlags)||n.setAnonymousDistinctId(i)):(e||r)&&this.setPersonProperties(e,r),t!==i&&(this.reloadFeatureFlags(),this.unregister(qs))}}setPersonProperties(t,e){if((t||e)&&this.Rn("posthog.setPersonProperties")){var r=nh(this.get_distinct_id(),t,e);this.ln!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.ln=r):qn.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(vo,o)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else qn.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.Rn("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(qn.info("reset"),!this.__loaded)return qn.uninitializedWarning("posthog.reset");var l,h=this.get_property(os),c=this.get_property(ys);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(r=this.sessionPersistence)||r.clear(),pr(c)||null==(l=this.persistence)||l.register({[ys]:c}),null==(i=this.surveys)||i.reset(),null==(n=this.kn)||n.stop(),null==(s=this.featureFlags)||s.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.persistence)||a.set_property(Bs,no),null==(u=this.sessionManager)||u.resetSessionId(),this.ln=null,this.config.cookieless_mode===io)this.register_once({distinct_id:Ks,$device_id:null},"");else{var d=this.config.get_device_id(hl());this.register_once({distinct_id:d,$device_id:t?d:h},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(t,e){var r;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(r=this.conversations)||r.Ln()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.An()}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(ss)?(qn.critical("Attempting to create alias for existing People user - aborting."),-2):this.Rn("posthog.alias")?(pr(e)&&(e=this.get_distinct_id()),t!==e?(this.Pn(as,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(qn.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=r({},this.config);if(vr(t)){var i,n,s,o,a,u,l,h,c,d,v;Bn(this.config,Wg(t));var f=this.vn();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ug(r({},this.config,{persistence:"sessionStorage"}),f,!1);var p=this.hn(this.config.debug);xr(p)&&(this.config.debug=p),xr(this.config.debug)&&(this.config.debug?($n.DEBUG=!0,dh.O()&&dh.N("ph_debug",!0),qn.info("set_config",{config:t,oldConfig:e,newConfig:r({},this.config)})):($n.DEBUG=!1,dh.O()&&dh.q("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||c.startIfEnabledOrStop(),null==(d=this.surveys)||d.loadIfEnabled(),this.Fn(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){$n.LIB_NAME=t,$n.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:Gg.Nn}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:Hg;return e!==Hg&&(e=Hg+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Bs))===so||(null==(e=this.sessionPersistence)?void 0:e.get_property(Bs))===so}Mn(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===oo&&!this._isIdentified()&&fr(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[as])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Qs]))}Cn(){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.Mn()||this.Rn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Rn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Rn(t){return"never"===this.config.person_profiles?(qn.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Pn(Qs,!0),!0)}vn(){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!==ro)}Fn(){var t,e,r,i,n=this.vn();return(null==(t=this.persistence)?void 0:t.Tr)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.Tr)!==n&&(null==(i=this.sessionPersistence)||i.set_disabled(n)),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==io){if(this.tn()){var r,i,n,s,o;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=new Cg(this),this.pageViewManager=new tg(this),this.persistence&&(this.sessionPropsManager=new xg(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=Gg.__defaultExtensionClasses)?void 0:o.sessionRecording;u&&(this.sessionRecording=this.Xi(this.sessionRecording,new u(this)),this.wn&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.wn)))}var l,h;this.consent.optInOut(!0),this.Fn(),this.xn(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==ro&&(null==(l=this.surveys)||l.loadIfEnabled()),(pr(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.Sn()}else qn.warn(Dg)}opt_out_capturing(){var t,e,r;this.config.cookieless_mode!==io?(this.config.cookieless_mode===ro&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Fn(),this.config.cookieless_mode===ro&&(this.register({distinct_id:Ks,$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.config.capture_pageview&&this.Sn(),this.xn())):qn.warn(Dg)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===io||(this.config.cookieless_mode===ro?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Fn()}_is_bot(){return Tn?Tg(Tn,this.config.custom_blocked_useragents):void 0}Sn(){In&&("visible"===In.visibilityState?this.sn||(this.sn=!0,this.capture(lo,{title:In.title},{send_instantly:!0}),this.an&&(In.removeEventListener(ao,this.an),this.an=null)):this.an||(this.an=this.Sn.bind(this),Jn(In,ao,this.an)))}debug(t){!1===t?(null==kn||kn.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==kn||kn.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}))}Kr(){var t,e,r,i,n,s,o=this.cn||{};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?(qn.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=qn,n=(e="advanced_disable_flags")in(t=o)&&!br(t[e]),s=r in t&&!br(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]))}En(t){if(br(this.config.before_send))return t;var e=cr(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of e){if(r=i(r),br(r)){var n="Event '"+t.event+"' was rejected in beforeSend function";return sr(Je,t.event)?qn.warn(n+". This can cause unexpected behavior."):qn.info(n),null}r.properties&&!fr(r.properties)||qn.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)})}hn(t){var e=xr(t)&&!t,r=dh.O()&&"true"===dh.A("ph_debug");return!e&&(!!r||t)}}Gg.__defaultExtensionClasses={},Gg.Nn={trace:Ag=()=>{},debug:Ag,info:Ag,warn:Ag,error:Ag,fatal:Ag},function(t,e){for(var r=0;e.length>r;r++)t.prototype[e[r]]=Wn(t.prototype[e[r]])}(Gg,["identify"]);var Qg=jn("[ExceptionAutocapture]"),Jg=jn("[TracingHeaders]"),Kg=jn("[Web Vitals]"),Yg=9e5,Xg="disabled",tm="lazy_loading",em="awaiting_config",rm="missing_config";jn("[SessionRecording]"),jn("[SessionRecording]");var im="[SessionRecording]",nm=jn(im),sm=jn("[Heatmaps]");function om(t){return vr(t)&&"clientX"in t&&"clientY"in t&&_r(t.clientX)&&_r(t.clientY)}var am=jn("[Product Tours]"),um=["$set_once","$set"],lm=jn("[SiteApps]"),hm="Error while initializing PostHog app with config id ";function cm(t,e,r){if(br(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 dm{constructor(t){this.Dn=new Sg,this.$n=(t,e)=>this.qn(t,e)&&this.jn(t,e)&&this.Hn(t,e)&&this.Un(t,e),this.qn=(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.zn=new Set}init(){var t,e;pr(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(!pr(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,r;null==(e=this.zn)||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.zn&&(null==(r=this.zn)?void 0:r.size)>0&&this.zn.forEach((t=>{this.Vn(e,t)&&this.Dn.emit("actionCaptured",t.name)}))}Wn(t){this.onAction("actionCaptured",(e=>t(e)))}Vn(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var r of e.steps)if(this.$n(t,r))return!0;return!1}onAction(t,e){return this.Dn.on(t,e)}jn(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(!cm(i,e.url,e.url_matching||"contains"))return!1}return!0}Hn(t,e){return!!this.Zn(t,e)&&!!this.Gn(t,e)&&!!this.Qn(t,e)}Zn(t,e){var r;if(null==e||!e.href)return!0;var i=this.Jn(t);if(i.length>0)return i.some((t=>cm(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";return!!s&&cm((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}Gn(t,e){var r;if(null==e||!e.text)return!0;var i=this.Jn(t);if(i.length>0)return i.some((t=>cm(t.text,e.text,e.text_matching||"exact")||cm(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;!br(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=>cm(t,s,o))))}Qn(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}Jn(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Un(t,e){return null==e||!e.properties||0===e.properties.length||ah(e.properties.reduce(((t,e)=>{var r=cr(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 vm{constructor(t){this._instance=t,this.Kn=new Map,this.Yn=new Map,this.Xn=new Map}es(t,e){return!!t&&ah(t.propertyFilters,null==e?void 0:e.properties)}ts(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}rs(t,e,r){var i=(r===Ru.Activation?this.Kn:this.Yn).get(t),n=[];return this.ns((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.es(s,e)}))}register(t){var e;pr(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.ss(t),this.os(t))}os(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.us&&(this.us=new dm(this._instance),this.us.init(),this.us.Wn((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.us)||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.Xn.get(e.name);r&&r.push(t.id),this.Xn.set(e.name,r||[t.id])}})))})))}ss(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.Kn=this.ts(t,Ru.Activation),this.Yn=this.ts(t,Ru.Cancellation))}onEvent(t,e){var r,i=this.le(),n=this.ls(),s=this.hs(),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.cs(o))}}else{if(this.Yn.has(t)){var c=this.rs(t,e,Ru.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.ds(t.id)})),this.cs(o))}if(this.Kn.has(t)){i.info("event name matched",{event:t,eventPayload:e,items:this.Kn.get(t)});var d=this.rs(t,e,Ru.Activation);this.cs(o.concat(d.map((t=>t.id))||[]))}}}onAction(t){var e,r=this.ls(),i=(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[r])||[];this.Xn.has(t)&&this.cs(i.concat(this.Xn.get(t)||[]))}cs(t){var e=this.le(),r=[...new Set(t)].filter((t=>!this.vs(t)));e.info("updating activated items",{activatedItems:r}),this.fs(r)}getActivatedIds(){var t,e=this.ls();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}getEventToItemsMap(){return this.Kn}ps(){return this.us}}class fm extends vm{constructor(t){super(t)}ls(){return $s}hs(){return $u.SHOWN}ns(t){var e;null==(e=this._instance)||e.getSurveys(t)}ds(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}le(){return Gu}fs(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[$s]:t})}vs(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var pm="SDK is not enabled or survey functionality is not yet loaded",gm="Disabled. Not loading surveys.",mm=null!=kn&&kn.location?rs(kn.location.hash,"__posthog")||rs(location.hash,"state"):null,ym="_postHogToolbarParams",bm=jn("[Toolbar]"),_m=jn("[FeatureFlags]"),wm=jn("[FeatureFlags]",{debugEnabled:!0}),xm="\" failed. Feature flags didn't load in time.",Sm=t=>{for(var e={},r=0;t.length>r;r++)e[t[r]]=!0;return e},km=t=>{var e={};for(var[r,i]of zn(t||{}))i&&(e[r]=i);return e},Cm="Refusing to render web experiment since the viewer is a likely bot",Tm={icontains:(t,e)=>!!kn&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!kn&&-1===e.href.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>!!kn&&ih(e.href,t),not_regex:(t,e)=>!!kn&&!ih(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class Im{get qt(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Im.gs("retrieved web experiments from the server"),e.ys=new Map,t.forEach((t=>{if(t.feature_flag_key){var r;e.ys&&(Im.gs("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(r=e.ys)||r.set(t.feature_flag_key,t));var i=e._instance.getFeatureFlag(t.feature_flag_key);gr(i)&&t.variants[i]&&e.bs(t.name,i,t.variants[i].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];Im._s(s)&&e.bs(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Im.gs(Cm);else if(!this.qt.disable_web_experiments){if(br(this.ys))return this.ys=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Im.gs("applying feature flags",t),t.forEach((t=>{var e;if(this.ys&&null!=(e=this.ys)&&e.has(t)){var r,i=this._instance.getFeatureFlag(t),n=null==(r=this.ys)?void 0:r.get(t);i&&null!=n&&n.variants[i]&&this.bs(n.name,i,n.variants[i].transforms)}}))}}previewWebExperiment(){var t=Im.getWindowLocation();if(null!=t&&t.search){var e=ts(null==t?void 0:t.search,"__experiment_id"),r=ts(null==t?void 0:t.search,"__experiment_variant");e&&r&&(Im.gs("previewing web experiments "+e+" && "+r),this.getWebExperiments((t=>{this.ws(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||[])})}ws(t,e,r){var i=r.filter((e=>e.id===t));i&&i.length>0&&(Im.gs("Previewing web experiment ["+i[0].name+"] with variant ["+e+"]"),this.bs(i[0].name,e,i[0].variants[e].transforms))}static _s(t){return!br(t.conditions)&&Im.xs(t)&&Im.Ss(t)}static xs(t){var e;if(br(t.conditions)||br(null==(e=t.conditions)?void 0:e.url))return!0;var r,i,n,s=Im.getWindowLocation();return!!s&&(null==(r=t.conditions)||!r.url||Tm[null!==(i=null==(n=t.conditions)?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](t.conditions.url,s))}static getWindowLocation(){return null==kn?void 0:kn.location}static Ss(t){var e;if(br(t.conditions)||br(null==(e=t.conditions)?void 0:e.utm))return!0;var r=Ic();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 gs(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];qn.info("[WebExperiments] "+t,r)}bs(t,e,r){this._is_bot()?Im.gs(Cm):"control"!==e?r.forEach((r=>{if(r.selector){var i;Im.gs("applying transform of variant "+e+" for experiment "+t+" ",r);var n=null==(i=document)?void 0:i.querySelectorAll(r.selector);null==n||n.forEach((t=>{var e=t;r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)}))}})):Im.gs("Control variants leave the page unmodified.")}_is_bot(){return Tn&&this._instance?Tg(Tn,this.qt.custom_blocked_useragents):void 0}}var Em=jn("[Conversations]"),Rm="Conversations not available yet.",Mm={featureFlags:class{constructor(t){this.ks=!1,this.Cs=!1,this.Is=!1,this.Ts=!1,this.Es=!1,this.Ms=!1,this.Rs=!1,this.Ps=!1,this._instance=t,this.featureFlagEventHandlers=[]}get qt(){return this._instance.config}get ki(){return this._instance.persistence}Os(t){return this._instance.get_property(t)}Ls(){var t,e;return null!==(t=null==(e=this.ki)?void 0:e.Mr(this.qt.feature_flag_cache_ttl_ms))&&void 0!==t&&t}As(){return!!this.Ls()&&(this.Ps||this.Is||(this.Ps=!0,_m.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Fs(){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.Rs||(_m.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Rs=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||_m.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}Ns(){return this.Fs().length>0}Ds(){var t=this.qt.flag_keys;if(!pr(t)){if(cr(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||_m.error("Invalid flag key found:",t,"Expected non-empty string"),e}));_m.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,{config:r}=this._instance,i=null!==(t=null==(e=r.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(i).length){var n,s,o=null!==(n=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},a=Object.keys(i).filter((t=>!!i[t])).reduce(((t,e)=>(t[e]=i[e]||!1,t)),{}),u=Object.keys(o).filter((t=>a[t])).reduce(((t,e)=>(o[e]&&(t[e]=o[e]),t)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:u})}}updateFlags(t,e,i){var n=null!=i&&i.merge?this.getFlagVariants():{},s=null!=i&&i.merge?this.getFlagPayloads():{},o=r({},n,t),a=r({},s,e),u={};for(var[l,h]of Object.entries(o)){var c="string"==typeof h;u[l]={key:l,enabled:!!c||Boolean(h),variant:c?h:void 0,reason:void 0,metadata:pr(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.Cs}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Os(Es),e=this.Os(Os),i=this.Os(Ps);if(!i&&!e)return t||{};var n=Bn({},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=pr(h)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!h,d=pr(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.ks||(_m.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:i,finalDetails:n}),this.ks=!0),n}getFlagVariants(){var t=this.Os(Cs),e=this.Os(Os);if(!e)return t||{};for(var r=Bn({},t),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.ks||(_m.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.ks=!0),r}getFlagPayloads(){var t=this.Os(Rs),e=this.Os(Ps);if(!e)return t||{};for(var r=Bn({},t||{}),i=Object.keys(e),n=0;i.length>n;n++)r[i[n]]=e[i[n]];return this.ks||(_m.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.ks=!0),r}reloadFeatureFlags(){this.Ts||this.qt.advanced_disable_feature_flags||this.$s||(this._instance.nn.emit("featureFlagsReloading",!0),this.$s=setTimeout((()=>{this.qs()}),5))}js(){clearTimeout(this.$s),this.$s=void 0}ensureFlagsLoaded(){this.Cs||this.Is||this.$s||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Ts=t}qs(t){var e;if(this.js(),!this._instance.Kr())if(this.Is)this.Es=!0;else{var i=this.qt.token,n=this.Os(os),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.ki)?void 0:e.get_initial_props())||{},this.Os(Ls)||{}),group_properties:this.Os(As),timezone:Nc()};yr(n)||pr(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this.qt.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Ns()&&(s.evaluation_contexts=this.Fs());var o=this.Ds();pr(o)||(s.flag_keys=o);var a=!!this.qt.advanced_only_evaluate_survey_feature_flags,u=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.qt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Is=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this.qt.disable_compression?void 0:vl.Base64,timeout:this.qt.feature_flag_request_timeout_ms,callback:t=>{var e,r,i,n=!0;if(200===t.statusCode&&(this.Es||(this.$anon_distinct_id=void 0),n=!1),this.Is=!1,!s.disable_flags||this.Es){this.Ms=!n;var o=[];t.error?t.error instanceof Error?o.push("AbortError"===t.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==t.statusCode&&o.push("api_error_"+t.statusCode),null!=(e=t.json)&&e.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var u,l=!(null==(r=t.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));if(l&&o.push("quota_limited"),null==(i=this.ki)||i.register({[Us]:o}),l)_m.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else s.disable_flags||this.receivedFeatureFlags(null!==(u=t.json)&&void 0!==u?u:{},n,{partialResponse:a}),this.Es&&(this.Es=!1,this.qs())}}})}}getFeatureFlag(t,e){var r;if(void 0===e&&(e={}),!e.fresh||this.Ms)if(this.Cs||this.getFlags()&&this.getFlags().length>0){if(!this.As()){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 _m.warn('getFeatureFlag for key "'+t+xm)}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.Ms)if(this.Cs||this.getFlags()&&this.getFlags().length>0){if(!this.As()){var r=this.getFlagVariants(),i=t in r,n=r[t],s=this.getFlagPayloads()[t],o=String(n),a=this.Os(Ms)||void 0,u=this.Os(Hs)||void 0,l=this.Os(qs)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var h,c=this._instance.get_session_id(),d=this.Os(js);c&&c!==d&&(l={},null==(h=this.ki)||h.register({[qs]:l,[js]: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;cr(l[t])?l[t].push(o):l[t]=[o],null==(v=this.ki)||v.register({[qs]:l});var S=this.getFeatureFlagDetails(t),k=[...null!==(f=this.Os(Us))&&void 0!==f?f:[]];pr(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.Ms};pr(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),pr(null==S?void 0:S.original_variant)&&pr(null==S?void 0:S.original_enabled)||(C.$feature_flag_original_response=pr(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(!pr(s))try{E=JSON.parse(s)}catch(t){}return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:E}}}}else _m.warn('getFeatureFlagResult for key "'+t+xm)}getRemoteConfigPayload(t,e){var r=this.qt.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.Ns()&&(i.evaluation_contexts=this.Fs());var n=this.Ds();pr(n)||(i.flag_keys=n),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.qt.disable_compression?void 0:vl.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.Ms){if(this.Cs||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return pr(r)?void 0:!!r}_m.warn('isFeatureEnabled for key "'+t+xm)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,i){if(this.ki){this.Cs=!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]})))):_m.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(cr(l)){_m.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({[Ts]:l,[Cs]: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({[Ts]:Object.keys(km(p)),[Cs]:p||{},[Rs]:g||{},[Es]:m||{}},c?{[Ms]:c}:{},d?{[Hs]:d}:{}))}}}(t,this.ki,n,s,o,i),e||(this.Ps=!1),this.Hs(e)}}override(t,e){void 0===e&&(e=!1),_m.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.ki)return _m.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.ki.unregister(Os),this.ki.unregister(Ps),this.Hs(),wm.info("All overrides cleared");if(cr(t)){var e=Sm(t);return this.ki.register({[Os]:e}),this.Hs(),wm.info("Flag overrides set",{flags:t})}if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var r,i=t;if(this.ks=Boolean(null!==(r=i.suppressWarning)&&void 0!==r&&r),"flags"in i)if(!1===i.flags)this.ki.unregister(Os),wm.info("Flag overrides cleared");else if(i.flags){if(cr(i.flags)){var n=Sm(i.flags);this.ki.register({[Os]:n})}else this.ki.register({[Os]:i.flags});wm.info("Flag overrides set",{flags:i.flags})}return"payloads"in i&&(!1===i.payloads?(this.ki.unregister(Ps),wm.info("Payload overrides cleared")):i.payloads&&(this.ki.register({[Ps]:i.payloads}),wm.info("Payload overrides set",{payloads:i.payloads}))),void this.Hs()}if(t&&"object"==typeof t)return this.ki.register({[Os]:t}),this.Hs(),wm.info("Flag overrides set",{flags:t});_m.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Cs){var{flags:e,flagVariants:r}=this.Us();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,i){var n,s=(this.Os(Is)||[]).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.ki)||n.register({[Ts]:Object.keys(km(u)),[Cs]:u}),this.Hs()}getEarlyAccessFeatures(t,e,r){void 0===e&&(e=!1);var i=this.Os(Is),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.ki)||r.unregister(Is),null==(i=this.ki)||i.register({[Is]:n}),t(n)}}})}Us(){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)),{})}}Hs(t){var{flags:e,flagVariants:r}=this.Us();this.featureFlagEventHandlers.forEach((i=>i(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Os(Ls)||{},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({[Ls]:r({},i,o,n)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Ls)}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var i=this.Os(As)||{};0!==Object.keys(i).length&&Object.keys(i).forEach((e=>{i[e]=r({},i[e],t[e]),delete t[e]})),this._instance.register({[As]:r({},i,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Os(As)||{};this._instance.register({[As]:r({},e,{[t]:{}})})}else this._instance.unregister(As)}reset(){this.Cs=!1,this.Is=!1,this.Ts=!1,this.Es=!1,this.Ms=!1,this.$anon_distinct_id=void 0,this.js(),this.ks=!1}}},Om={sessionRecording:class{get qt(){return this._instance.config}get ki(){return this._instance.persistence}get started(){var t;return!(null==(t=this.Bs)||!t.isStarted)}get status(){var t,e;return this.zs===em||this.zs===rm?this.zs:null!==(t=null==(e=this.Bs)?void 0:e.status)&&void 0!==t?t:this.zs}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.zs=Xg,this.Vs=void 0,this._instance=t,!this._instance.sessionManager)throw nm.error("started without valid sessionManager"),new Error(im+" started without valid sessionManager. This is a bug.");if(this.qt.cookieless_mode===io)throw new Error(im+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ws(){var t,e=!(null==(t=this._instance.get_property(ys))||!t.enabled),r=!this.qt.disable_session_recording,i=this.qt.disable_session_recording||this._instance.consent.isOptedOut();return kn&&e&&r&&!i}startIfEnabledOrStop(t){var e;if(!this.Ws||null==(e=this.Bs)||!e.isStarted){var r=!pr(Object.assign)&&!pr(Array.from);this.Ws&&r?(this.Zs(t),nm.info("starting")):(this.zs=Xg,this.stopRecording())}}Zs(t){var e,r,i;this.Ws&&(this.zs!==em&&this.zs!==rm&&(this.zs=tm),null!=An&&null!=(e=An.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(r=An.__PosthogExtensions__)&&r.initSessionRecording?this.Gs(t):null==(i=An.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.Qs,(e=>{if(e)return nm.error("could not load recorder",e);this.Gs(t)})))}stopRecording(){var t,e;null==(t=this.Vs)||t.call(this),this.Vs=void 0,null==(e=this.Bs)||e.stop()}Js(){var t,e;null==(t=this.Vs)||t.call(this),this.Vs=void 0,null==(e=this.Bs)||e.discard()}Ks(){var t;null==(t=this.ki)||t.unregister(ks)}Ys(t,e){if(br(t))return null;var r,i=_r(t)?t:parseFloat(t);return"number"!=typeof(r=i)||!Number.isFinite(r)||0>r||r>1?(nm.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):i}Xs(t){if(this.ki){var e,i,n=this.ki,s=()=>{var e,i=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.Ys(null==(e=this.qt.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),o=this.Ys(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:o;br(a)&&this.Ks();var u=null==i?void 0:i.minimumDurationMilliseconds;n.register({[ys]: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:pr(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.Vs)||e.call(this),this.Vs=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(t){return"sessionRecording"in t?!1===t.sessionRecording?(this.Xs(t),void this.Js()):(this.Xs(t),void this.startIfEnabledOrStop()):(this.zs===em&&(this.zs=rm,nm.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var r;void 0===e&&(e="log"),null!=(r=this.Bs)&&r.log?this.Bs.log(t,e):nm.warn("log called before recorder was ready")}get Qs(){var t,e,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(ys);return(null==r||null==(e=r.scriptConfig)?void 0:e.script)||"lazy-recorder"}eo(){var t,e,r=this._instance.get_property(ys);if(!r)return!1;try{e="object"==typeof r?r:JSON.parse(r)}catch(t){return nm.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}Gs(t){var e,r;if(null==(e=An.__PosthogExtensions__)||!e.initSessionRecording)return nm.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[to]:!0});if(this.Bs||(this.Bs=null==(r=An.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.Bs._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.eo()){if(this.zs===rm||this.zs===em)return;return this.zs=em,nm.info("persisted remote config is stale, requesting fresh config before starting"),void new pg(this._instance).load()}this.zs=tm,this.Bs.start(t)}onRRwebEmit(t){var e;null==(e=this.Bs)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Bs||null==(e=this.ki)||e.register({[_s]:!0}),null==(t=this.Bs)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Bs||null==(e=this.ki)||e.register({[bs]:!0}),null==(t=this.Bs)||t.overrideSampling()}overrideTrigger(t){var e,r;this.Bs||null==(r=this.ki)||r.register({["url"===t?ws:xs]:!0}),null==(e=this.Bs)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Bs)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!(null==(r=this.Bs)||!r.tryAddCustomEvent(t,e))}}},Pm={autocapture:class{constructor(t){this.ro=!1,this.io=null,this.no=!1,this.instance=t,this.rageclicks=new Lp(t.config.rageclick),this.so=null}initialize(){this.startIfEnabled()}get qt(){var t,e,r=vr(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}oo(){if(this.isBrowserSupported()){if(kn&&In){var t=t=>{t=t||(null==kn?void 0:kn.event);try{this.ao(t)}catch(t){Np.error("Failed to capture event",t)}};if(Jn(In,"submit",t,{capture:!0}),Jn(In,"change",t,{capture:!0}),Jn(In,"click",t,{capture:!0}),this.qt.capture_copied_text){var e=t=>{t=t||(null==kn?void 0:kn.event);try{this.ao(t,Ap)}catch(t){Np.error("Failed to capture copy/cut event",t)}};Jn(In,"copy",e,{capture:!0}),Jn(In,"cut",e,{capture:!0})}}}else Np.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.ro&&(this.oo(),this.ro=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.no=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ls]:!!t.autocapture_opt_out}),this.io=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.so=t}getElementSelectors(t){var e,r=[];return null==(e=this.so)||e.forEach((e=>{var i=null==In?void 0:In.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[ls];if(yr(this.io)&&!xr(r)&&!this.instance.Kr())return!1;var i=null!==(e=this.io)&&void 0!==e?e:!!r;return!!this.instance.config.autocapture&&!i}ao(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var r,i=Io(t);_o(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())&&$o(i,this.instance.config.rageclick)&&this.ao(t,"$rageclick");var n=e===Ap;if(i&&function(t,e,r,i,n){var s,o,a,u;if(void 0===r&&(r=void 0),!kn||Do(t))return!1;if(null!=(s=r)&&s.url_allowlist&&!So(r.url_allowlist))return!1;if(null!=(o=r)&&o.url_ignorelist&&So(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}=qo(t,i);if(!function(t,e){var r=null==e?void 0:e.element_allowlist;if(pr(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(!Ro(c,null==(u=r)?void 0:u.css_selector_allowlist))return!1;var d=kn.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&&(Eo.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}(i,t,this.qt,n,n?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=Dp(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.no});if(o)return!1;var a=this.getElementSelectors(i);if(a&&a.length>0&&(s.$element_selectors=a),e===Ap){var u,l=Co(null==kn||null==(u=kn.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 dr(null==In?void 0:In.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.uo=(null==kn||null==(e=kn.location)?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(qn.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.lo&&this.lo(),this.lo=void 0,qn.info("History API monitoring stopped")}monitorHistoryChanges(){kn&&kn.history&&(this.ho("pushState"),this.ho("replaceState"),this.co())}ho(t){var e;if(kn&&(null==(e=kn.history[t])||!e.__posthog_wrapped__)){var r=this;is(kn.history,t,(e=>function(i,n,s){e.call(this,i,n,s),r.do(t)}))}}do(t){try{var e,r=null==kn||null==(e=kn.location)?void 0:e.pathname;if(!r)return;r!==this.uo&&this.isEnabled&&this._instance.capture(lo,{navigation_type:t}),this.uo=r}catch(e){qn.error("Error capturing "+t+" pageview",e)}}co(){if(!this.lo){var t=()=>{this.do("popstate")};Jn(kn,"popstate",t),this.lo=()=>{kn&&kn.removeEventListener("popstate",t)}}}},heatmaps:class{get qt(){return this.instance.config}constructor(t){var e;this.vo=!1,this.ro=!1,this.fo=null,this.instance=t,this.vo=!(null==(e=this.instance.persistence)||!e.props[hs]),this.rageclicks=new Lp(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return vr(this.qt.capture_heatmaps)&&this.qt.capture_heatmaps.flush_interval_milliseconds&&(t=this.qt.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return br(this.qt.capture_heatmaps)?br(this.qt.enable_heatmaps)?this.vo:this.qt.enable_heatmaps:!1!==this.qt.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.ro)return;sm.info("starting..."),this.po(),this.At()}else{var t;clearInterval(null!==(t=this.fo)&&void 0!==t?t:void 0),this.mo(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[hs]:e}),this.vo=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.M;return this.M=void 0,t}yo(t){this.Mt(t.originalEvent,"deadclick")}At(){this.fo&&clearInterval(this.fo),this.fo="visible"===(null==In?void 0:In.visibilityState)?setInterval(this.ci.bind(this),this.flushIntervalMilliseconds):null}po(){kn&&In&&(this.bo=this.ci.bind(this),Jn(kn,uo,this.bo),this._o=t=>this.Mt(t||(null==kn?void 0:kn.event)),Jn(In,"click",this._o,{capture:!0}),this.wo=t=>this.xo(t||(null==kn?void 0:kn.event)),Jn(In,"mousemove",this.wo,{capture:!0}),this.So=new Qp(this.instance,Zp,this.yo.bind(this)),this.So.startIfEnabledOrStop(),this.ko=this.At.bind(this),Jn(In,ao,this.ko),this.ro=!0)}mo(){var t;kn&&In&&(this.bo&&kn.removeEventListener(uo,this.bo),this._o&&In.removeEventListener("click",this._o,{capture:!0}),this.wo&&In.removeEventListener("mousemove",this.wo,{capture:!0}),this.ko&&In.removeEventListener(ao,this.ko),clearTimeout(this.Co),null==(t=this.So)||t.stop(),this.ro=!1)}Io(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&&yo(i)&&!bo(i,"body");){if(i===r)return!1;if(sr(e,null==kn?void 0:kn.getComputedStyle(i).position))return!0;i=Mo(i)}return!1}(Io(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"),!mo(t.target)&&om(t)){var n=this.Io(t,e);null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&$o(Io(t),this.instance.config.rageclick)&&this.To(r({},n,{type:"rageclick"})),this.To(n)}}xo(t){!mo(t.target)&&om(t)&&(clearTimeout(this.Co),this.Co=setTimeout((()=>{this.To(this.Io(t,"mousemove"))}),500))}To(t){if(kn){var e=kn.location.href,r=this.qt.custom_personal_data_properties,i=this.qt.mask_personal_data_properties?[...Sc,...r||[]]:[],n=es(e,i,Cc);this.M=this.M||{},this.M[n]||(this.M[n]=[]),this.M[n].push(t)}}ci(){this.M&&!fr(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Qp,webVitalsAutocapture:class{constructor(t){var e;this.vo=!1,this.ro=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Eo=()=>{clearTimeout(this.Mo),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.dt=t=>{var e;this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Ro();if(!pr(i))if(br(null==t?void 0:t.name)||br(null==t?void 0:t.value))Kg.error("Invalid metric received",t);else if(!this.Po||this.Po>t.value){this.M.url!==i&&(this.Eo(),this.Mo=setTimeout(this.Eo,this.flushToCaptureTimeoutMs)),pr(this.M.url)&&(this.M.url=i),this.M.firstMetricTimestamp=pr(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0);var n=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),s=r({},t,{$current_url:i,timestamp:Date.now()});pr(n)||(s.$session_id=n.sessionId,s.$window_id=n.windowId),this.M.metrics.push(s),this.M.metrics.length===this.allowedMetrics.length&&this.Eo()}else Kg.error("Ignoring metric with value >= "+this.Po,t)},this.Oo=()=>{if(!this.ro){var t,e,r,i,n=An.__PosthogExtensions__;pr(n)||pr(n.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:e,onFCP:r,onINP:i}=n.postHogWebVitalsCallbacks),t&&e&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.dt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&e(this.dt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.dt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.dt.bind(this)),this.ro=!0):Kg.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.vo=!(null==(e=this._instance.persistence)||!e.props[fs]),this.startIfEnabled()}get Lo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,r=vr(this.Lo)?null==(t=this.Lo)?void 0:t.web_vitals_allowed_metrics:void 0;return br(r)?(null==(e=this._instance.persistence)?void 0:e.props[ms])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(vr(this.Lo)?this.Lo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=vr(this.Lo)?this.Lo.web_vitals_attribution:void 0;return null!=t&&t}get Po(){var t=vr(this.Lo)&&_r(this.Lo.__web_vitals_max_value)?this.Lo.__web_vitals_max_value:Yg;return t>0&&6e4>=t?Yg:t}get isEnabled(){var t=null==En?void 0:En.protocol;if("http:"!==t&&"https:"!==t)return Kg.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=vr(this.Lo)?this.Lo.web_vitals:xr(this.Lo)?this.Lo:void 0;return xr(e)?e:this.vo}startIfEnabled(){this.isEnabled&&!this.ro&&(Kg.info("enabled, starting..."),this.lr(this.Oo))}onRemoteConfig(t){if("capturePerformance"in t){var e=vr(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=vr(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[fs]:e}),this._instance.persistence.register({[ms]:r})),this.vo=e,this.startIfEnabled()}}lr(t){var e,r;null!=(e=An.__PosthogExtensions__)&&e.postHogWebVitalsCallbacks?t():null==(r=An.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(e=>{e?Kg.error("failed to load script",e):t()}))}Ro(){var t=kn?kn.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...Sc,...e||[]]:[];return es(t,r,Cc)}Kg.error("Could not determine current URL")}}},Lm={exceptionObserver:class{constructor(t){var e,r,i;this.Oo=()=>{var t;if(kn&&this.isEnabled&&null!=(t=An.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=An.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=An.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=An.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Ao&&this.qt.capture_unhandled_errors&&(this.Ao=e(this.captureException.bind(this))),!this.Fo&&this.qt.capture_unhandled_rejections&&(this.Fo=r(this.captureException.bind(this))),!this.No&&this.qt.capture_console_errors&&(this.No=i(this.captureException.bind(this)))}catch(t){Qg.error("failed to start",t),this.Do()}}},this._instance=t,this.$o=!(null==(e=this._instance.persistence)||!e.props[cs]),this.qo=new Or({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:Qg}),this.qt=this.jo(),this.startIfEnabledOrStop()}jo(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return vr(t)?e=r({},e,t):(pr(t)?this.$o: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?(Qg.info("enabled"),this.Do(),this.lr(this.Oo)):this.Do()}lr(t){var e,r;null!=(e=An.__PosthogExtensions__)&&e.errorWrappingFunctions&&t(),null==(r=An.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return Qg.error("failed to load script",e);t()}))}Do(){var t,e,r;null==(t=this.Ao)||t.call(this),this.Ao=void 0,null==(e=this.Fo)||e.call(this),this.Fo=void 0,null==(r=this.No)||r.call(this),this.No=void 0}onRemoteConfig(t){"autocaptureExceptions"in t&&(this.$o=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[cs]:this.$o}),this.qt=this.jo(),this.startIfEnabledOrStop())}onConfigChange(){this.qt=this.jo()}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.qo.consumeRateLimit(n)?Qg.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.Ho=[],this.Uo=Df(),this._instance=t,this.Ho=null!==(e=null==(r=this._instance.persistence)?void 0:r.get_property(ds))&&void 0!==e?e:[],this.Bo=wn(this.zo()),this.Vo=new xn(this.Bo)}onConfigChange(){this.Bo=wn(this.zo()),this.Vo.setConfig(this.Bo)}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.Ho=n,this._instance.persistence&&this._instance.persistence.register({[ds]:this.Ho,[vs]:s})}}get Wo(){var t,e=!!this._instance.get_property(vs),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=r?r:e)&&void 0!==t&&t}buildProperties(t,e){return this.Uo.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.Bo.enabled)try{if(!gr(t)||0===t.trim().length)return void $f.warn("Ignoring exception step because message must be a non-empty string");var i=this.Zo(e),{sanitizedProperties:n,droppedKeys:s}=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((r,i)=>bn.has(i)?(e.push(i),r):(r[i]=t[i],r)),{}),droppedKeys:e}}(i);s.length>0&&$f.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Vo.add(r({[mn]:t,[yn]:(new Date).toISOString()},n))}catch(t){$f.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Go(e)){if(this.Qo(e))return this.Jo("Exception dropped: matched a suppression rule"),void $f.info("Skipping exception capture because a suppression rule matched");if(!this.Wo&&this.Ko(e))return this.Jo("Exception dropped: thrown by a browser extension"),void $f.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Yo(e))return this.Jo("Exception dropped: thrown by the PostHog SDK"),void $f.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.Bo.enabled&&br(t.$exception_steps)?this.Xo(t):t;try{var i=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",In:!0});return i&&this.Vo.clear(),i}catch(t){return $f.error("Failed to capture exception event. Dropping this exception.",t),void this.Vo.clear()}}catch(t){return void $f.error("Failed to process exception event. Ignoring this exception.",t)}}Xo(t){try{var e=this.Vo.getAttachable();return 0===e.length?t:r({},t,{$exception_steps:e})}catch(e){return $f.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}Jo(t){this.Bo.enabled&&this.Vo.add({[mn]:t,[yn]:(new Date).toISOString()})}Zo(t){return vr(t)?r({},t):{}}zo(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}Qo(t){if(0===t.length)return!1;var e=t.reduce(((t,e)=>{var{type:r,value:i}=e;return gr(r)&&r.length>0&&t.$exception_types.push(r),gr(i)&&i.length>0&&t.$exception_values.push(i),t}),{$exception_types:[],$exception_values:[]});return this.Ho.some((t=>{var r=t.values.map((t=>{var r,i=sh[t.operator],n=cr(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)}))}Ko(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://")))}Yo(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}Go(t){return!br(t)&&cr(t)}}},Am=r({productTours:class{get ki(){return this._instance.persistence}constructor(t){this.ea=null,this.ta=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){"productTours"in t&&(this.ki&&this.ki.register({[gs]:!!t.productTours}),this.loadIfEnabled())}loadIfEnabled(){var t,e;this.ea||(t=this._instance).config.disable_product_tours||null==(e=t.persistence)||!e.get_property(gs)||this.lr((()=>this.ra()))}lr(t){var e,r;null!=(e=An.__PosthogExtensions__)&&e.generateProductTours?t():null==(r=An.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",(e=>{e?am.error("Could not load product tours script",e):t()}))}ra(){var t;!this.ea&&null!=(t=An.__PosthogExtensions__)&&t.generateProductTours&&(this.ea=An.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!cr(this.ta)||e){var r=this.ki;if(r){var i=r.props[Ds];if(cr(i)&&!e)return this.ta=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 am.error(n),void t([],{isLoaded:!1,error:n})}var s=cr(e.json.product_tours)?e.json.product_tours:[];this.ta=s,r&&r.register({[Ds]:s}),t(s,{isLoaded:!0})}})}else t(this.ta,{isLoaded:!0})}getActiveProductTours(t){br(this.ea)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.ea.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.ea)||e.showTourById(t)}previewTour(t){this.ea?this.ea.previewTour(t):this.lr((()=>{var e;this.ra(),null==(e=this.ea)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.ea)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.ea)||t.nextStep()}previousStep(){var t;null==(t=this.ea)||t.previousStep()}clearCache(){var t;this.ta=null,null==(t=this.ki)||t.unregister(Ds)}resetTour(t){var e;null==(e=this.ea)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.ea)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.ea)||e.cancelPendingTour(t)}}},Mm),Nm={siteApps:class{constructor(t){this._instance=t,this.ia=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}na(t,e){if(e){var r=this.globalsForEvent(e);this.ia.push(r),this.ia.length>1e3&&(this.ia=this.ia.slice(10))}}get siteAppLoaders(){var t;return null==(t=An._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.na.bind(this));this.sa=()=>{t(),this.ia=[],this.sa=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,um),{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.ia.length&&(lm.info("Processing "+this.ia.length+" events for site app with id "+t.id),this.ia.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.sa)||r.call(this))},i=!1,n=n=>{e.errored=!n,e.loaded=!0,lm.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){lm.error(hm+t.id,e),n(!1)}if(i&&e.loaded)try{r()}catch(r){lm.error("Error while processing buffered events PostHog app with config id "+t.id,r),e.errored=!0}}oa(){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)}aa(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){lm.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.oa(),void this._instance.on("eventCaptured",(t=>this.aa(t)))):void lm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this.sa)||r.call(this),null!=(i=t.siteApps)&&i.length)if(this.isEnabled){var s=function(t){var e;An["__$$ph_site_app_"+t]=n._instance,null==(e=An.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(n._instance,a,(e=>{if(e)return lm.error(hm+t,e)}))};for(var{id:o,url:a}of t.siteApps)s(o)}else lm.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Fm={tracingHeaders:class{constructor(t){this.ua=void 0,this.la=void 0,this.ha=void 0,this.Oo=()=>{var t,e,r=this.ca();r?(pr(this.ua)&&(this.ua=null==(t=An.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),pr(this.la)&&(this.la=null==(e=An.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Do()},this._instance=t}initialize(){this.startIfEnabledOrStop()}lr(t){var e,r;null!=(e=An.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(r=An.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return Jg.error("failed to load script",e);t()}))}da(){var t,e;return null!==(t=null!==(e=this._instance.config.tracing_headers)&&void 0!==e?e:this._instance.config.addTracingHeaders)&&void 0!==t?t:this._instance.config.__add_tracing_headers}ca(){var t=this.da();return cr(t)?(cr(this.ha)?this.ha.splice(0,this.ha.length,...t):this.ha=[...t],t.length>0?this.ha:void 0):(cr(this.ha)&&this.ha.splice(0),this.ha=t||void 0,this.ha)}Do(){var t,e;null==(t=this.ua)||t.call(this),null==(e=this.la)||e.call(this),this.ua=void 0,this.la=void 0}startIfEnabledOrStop(){this.ca()?this.lr(this.Oo):this.Do()}}},$m=r({surveys:class{get qt(){return this._instance.config}constructor(t){this.va=void 0,this._surveyManager=null,this.fa=!1,this.pa=[],this.ga=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.qt.disable_surveys){var e=t.surveys;if(br(e))return Gu.warn("Flags not loaded yet. Not loading surveys.");var r=cr(e);this.va=r?e.length>0:e,Gu.info("flags response received, isSurveysEnabled: "+this.va),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(null!=r&&r.startsWith(Yu)||null!=r&&r.startsWith(Xu))&&t.push(r)}t.forEach((t=>localStorage.removeItem(t)))}loadIfEnabled(){if(!this._surveyManager)if(this.fa)Gu.info("Already initializing surveys, skipping...");else if(this.qt.disable_surveys)Gu.info(gm);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())Gu.info("Not loading surveys in cookieless mode without consent.");else{var t=null==An?void 0:An.__PosthogExtensions__;if(t){if(!pr(this.va)||this.qt.advanced_enable_surveys){var e=this.va||this.qt.advanced_enable_surveys;this.fa=!0;try{var r=t.generateSurveys;if(r)return void this.ma(r,e);var i=t.loadExternalDependency;if(!i)return void this.ya(eo);i(this._instance,"surveys",(r=>{r||!t.generateSurveys?this.ya("Could not load surveys script",r):this.ma(t.generateSurveys,e)}))}catch(t){throw this.ya("Error initializing surveys",t),t}finally{this.fa=!1}}}else Gu.error("PostHog Extensions not found.")}}ma(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new fm(this._instance),Gu.info("Surveys loaded successfully"),this.ba({isLoaded:!0})}ya(t,e){Gu.error(t,e),this.ba({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.pa.push(t),this._surveyManager&&this.ba({isLoaded:!0}),()=>{this.pa=this.pa.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.qt.disable_surveys)return Gu.info(gm),t([]);var r,i=this._instance.get_property(Ns);if(i&&!e)return t(i,{isLoaded:!0});"undefined"!=typeof Promise&&this.ga?this.ga.then((e=>{var{surveys:r,context:i}=e;return t(r,i)})):("undefined"!=typeof Promise&&(this.ga=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.ga=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;Gu.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=>Qu(t)&&(Ju(t)||Ku(t))));l.length>0&&(null==(a=this._surveyEventReceiver)||a.register(l)),null==(i=this._instance.persistence)||i.register({[Ns]:u,[Fs]:Date.now()});var h={isLoaded:!0};t(u,h),null==r||r({surveys:u,context:h})}}))}ba(t){for(var e of this.pa)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){Gu.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!br(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);Gu.warn("init was not called")}_a(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}wa(t){if(br(this._surveyManager))return{eligible:!1,reason:pm};var e="string"==typeof t?this._a(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(br(this._surveyManager))return Gu.warn("init was not called"),{visible:!1,disabledReason:pm};var e=this.wa(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return br(this._surveyManager)?(Gu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:pm})):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.wa(n);r({visible:s.eligible,disabledReason:s.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var i;if(br(this._surveyManager))Gu.warn("init was not called");else{var n="string"==typeof t?this._a(t):t;if(null!=n&&n.id)if(il.includes(n.type)){var s=null==In?void 0:In.querySelector(e);if(s)return null!=(i=n.appearance)&&i.surveyPopupDelaySeconds?(Gu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;Gu.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),Gu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,r);Gu.warn("Survey element not found")}else Gu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else Gu.warn("Survey not found")}}displaySurvey(t,e){var i;if(br(this._surveyManager))Gu.warn("init was not called");else{var n=this._a(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!==qu.Popover&&e.initialResponses&&Gu.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 Gu.warn("Survey is not eligible to be displayed: ",o.disabledReason)}e.displayType!==qu.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else Gu.warn("Survey not found")}}cancelPendingSurvey(t){br(this._surveyManager)?Gu.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||t.handlePageUnload()}}},Mm),Dm={toolbar:class{constructor(t){this.instance=t}xa(t){An.ph_toolbar_state=t}Sa(){var t;return null!==(t=An.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),Kn(this.instance.config))return!1;if(!kn||!In)return!1;t=null!=t?t:kn.location,r=null!=r?r:kn.history;try{if(!e){try{kn.localStorage.setItem("test","test"),kn.localStorage.removeItem("test")}catch(t){return!1}e=null==kn?void 0:kn.localStorage}var i,n=mm||rs(t.hash,"__posthog")||rs(t.hash,"state"),s=n?Vn((()=>JSON.parse(atob(decodeURIComponent(n)))))||Vn((()=>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(ym)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch(t){return!1}}ka(t){var e=An.ph_load_toolbar||An.ph_load_editor;!br(e)&&dr(e)?e(t,this.instance):bm.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==In||!In.getElementById(Js));if(!kn||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(kn.localStorage.setItem(ym,JSON.stringify(r({},n,{source:void 0}))),2===this.Sa())this.ka(n);else if(0===this.Sa()){var s;this.xa(1),null==(s=An.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return bm.error("[Toolbar] Failed to load",t),void this.xa(0);this.xa(2),this.ka(n)})),Jn(kn,"turbolinks:load",(()=>{this.xa(0),this.loadToolbar(n)}))}return!0}Ca(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)}}},qm=r({experiments:Im},Mm),jm={conversations:class{constructor(t){this.Ia=void 0,this._conversationsManager=null,this.Ta=!1,this.Ea=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;br(e)||(xr(e)?this.Ia=e:(this.Ia=e.enabled,this.Ea=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Ia=void 0,this.Ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ta||this._instance.config.disable_conversations||Kn(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==An?void 0:An.__PosthogExtensions__;if(t&&!pr(this.Ia)&&this.Ia)if(this.Ea&&this.Ea.token){this.Ta=!0;try{var e=t.initConversations;if(e)return this.Ma(e),void(this.Ta=!1);var r=t.loadExternalDependency;if(!r)return void this.Ra(eo);r(this._instance,"conversations",(e=>{e||!t.initConversations?this.Ra("Could not load conversations script",e):this.Ma(t.initConversations),this.Ta=!1}))}catch(t){this.Ra("Error initializing conversations",t),this.Ta=!1}}else Em.error("Conversations enabled but missing token in remote config.")}}Ma(t){if(this.Ea)try{this._conversationsManager=t(this.Ea,this._instance),Em.info("Conversations loaded successfully")}catch(t){this.Ra("Error completing conversations initialization",t)}else Em.error("Cannot complete initialization: remote config is null")}Ra(t,e){Em.error(t,e),this._conversationsManager=null,this.Ta=!1}show(){this._conversationsManager?this._conversationsManager.show():Em.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ia&&!yr(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):(Em.warn(Rm),null)}))()}getMessages(t,r){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getMessages(t,r):(Em.warn(Rm),null)}))()}markAsRead(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.markAsRead(t):(Em.warn(Rm),null)}))()}getTickets(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getTickets(t):(Em.warn(Rm),null)}))()}requestRestoreLink(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.requestRestoreLink(t):(Em.warn(Rm),null)}))()}restoreFromToken(t){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.restoreFromToken(t):(Em.warn(Rm),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Em.warn(Rm),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()}An(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},Um={logs:class{constructor(t){var e;this.Pa=!1,this.Oa=!1,this.Gt=jn("[logs]"),this.La=[],this.Aa=0,this.Fa=0,this.Na=!1,this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.Pa=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e,r=null==(e=t.logs)?void 0:e.captureConsoleLogs;!br(r)&&r&&(this.Pa=!0,this.loadIfEnabled())}reset(){this.La=[],this.ii&&(clearTimeout(this.ii),this.ii=void 0),this.Aa=0,this.Fa=0,this.Na=!1}loadIfEnabled(){if(this.Pa&&!this.Oa){var t=null==An?void 0:An.__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.Oa=!0)})):this.Gt.error(eo)}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.Fa||(this.Fa=h,this.Aa=0,this.Na=!1),l>this.Aa){this.Aa++;var c=function(t,e){var i=t.level||"info",{text:n,number:s}=ji[i]||Ui,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:Bi(u)};return t.trace_id&&(l.traceId=t.trace_id),t.span_id&&(l.spanId=t.span_id),pr(t.trace_flags)||(l.flags=t.trace_flags),l}(t,this.Da());this.La.push({record:c}),(null!==(o=null==(a=this._instance.config.logs)?void 0:a.maxBufferSize)&&void 0!==o?o:100)>this.La.length?this.$a():this.flushLogs()}else this.Na||(this.Gt.warn("captureLog dropping logs: exceeded "+l+" logs per "+u+"ms"),this.Na=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.qa||(this.qa={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.qa}flushLogs(t){if(this.ii&&(clearTimeout(this.ii),this.ii=void 0),0!==this.La.length){var e=this.La;this.La=[];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:Bi(e)},scopeLogs:[{scope:{name:r,version:i},logRecords:t}]}]}}(e.map((t=>t.record)),n,$n.LIB_NAME,$n.LIB_VERSION),o=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.pn({method:"POST",url:o,data:s,compression:"best-available",batchKey:"logs",transport:t})}}$a(){var t,e;this.ii||(this.ii=setTimeout((()=>{this.ii=void 0,this.flushLogs()}),null!==(t=null==(e=this._instance.config.logs)?void 0:e.flushIntervalMs)&&void 0!==t?t:3e3))}Da(){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!=An&&null!=(t=An.location)&&t.href&&(e.currentUrl=An.location.href),this._instance.featureFlags){var i=this._instance.featureFlags.getFlags();i&&i.length>0&&(e.activeFeatureFlags=i)}return e}}},Hm=r({},Mm,Om,Pm,Lm,Am,Nm,$m,Fm,Dm,qm,jm,Um);Gg.__defaultExtensionClasses=r({},Hm);var Bm=function(){$n.SDK_DIST_CHANNEL="npm";var t=Ng[Hg]=new Gg;return function(){function t(){t.done||(t.done=!0,Bg=!1,Hn(Ng,(function(t){t._dom_loaded()})))}null!=In&&In.addEventListener?"complete"===In.readyState?t():Jn(In,"DOMContentLoaded",t,{capture:!1}):kn&&qn.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}();export{vl as Compression,lg as DEFAULT_PRODUCT_TOUR_APPEARANCE,qu as DisplaySurveyType,Gg as PostHog,hg as ProductTourEventName,cg as ProductTourEventProperties,$u as SurveyEventName,Du as SurveyEventProperties,Ru as SurveyEventType,Ou as SurveyPosition,Nu as SurveyQuestionBranchingType,Au as SurveyQuestionType,Fu as SurveySchedule,Pu as SurveyTabPosition,Lu as SurveyType,Mu as SurveyWidgetType,Bm as default,Bm as posthog,dl as severityLevels};
|
|
2
2
|
//# sourceMappingURL=module.full.js.map
|