posthog-js 1.412.0 → 1.412.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.
@@ -1,2 +1,2 @@
1
- !function(){"use strict";function t(t,e,i,r,n,s,a){try{var o=t[s](a),l=o.value}catch(t){return void i(t)}o.done?e(l):Promise.resolve(l).then(r,n)}function e(e){return function(){var i=this,r=arguments;return new Promise((function(n,s){var a=e.apply(i,r);function o(e){t(a,n,s,o,l,"next",e)}function l(e){t(a,n,s,o,l,"throw",e)}o(void 0)}))}}function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},i.apply(null,arguments)}function r(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}var n,s=["type"],a=Object.defineProperty,o=(t,e,i)=>((t,e,i)=>e in t?a(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),l=(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))(l||{}),u=(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))(u||{}),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||{}),d=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(d||{}),v=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(v||{}),c=(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))(c||{}),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||{});function p(t,e){return-1!==t.indexOf(e)}var g={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},m={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},y={};function b(t){if(y[t])return y[t];var e=function(t){var e,i,r=null==(i=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:i.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],i=e.prototype,r=t in g?g[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in m?m[t]:void 0,a=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&a)return y[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var l=!1;try{document.body.appendChild(o);var u=o.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return p(t,"AppleWebKit")&&!p(t,"Chrome")}(navigator.userAgent)&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),y[t]=h):i}catch(t){return i}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var _={};function w(t,e,i){var r,n=t+"."+String(i);if(_[n])return _[n].call(e);var s=b(t),a=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return a?(_[n]=a,a.call(e)):e[i]}var x={};function k(t,e,i){var r=t+"."+String(i);if(x[r])return x[r].bind(e);var n=b(t)[i];return"function"!=typeof n?e[i]:(x[r]=n,n.bind(e))}function S(){return b("MutationObserver").constructor}function C(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n={next:r},s=i((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var i=t[e];"function"==typeof i&&i.__rrweb_layer__;){var r=i.__rrweb_layer__;if(r.next===s)return void(r.next=n.next);i=r.next}else t[e]=n.next}}catch(t){return()=>{}}}var M={childNodes:t=>w("Node",t,"childNodes"),parentNode:t=>w("Node",t,"parentNode"),parentElement:t=>w("Node",t,"parentElement"),textContent:t=>w("Node",t,"textContent"),contains:(t,e)=>k("Node",t,"contains")(e),getRootNode:t=>k("Node",t,"getRootNode")(),host:t=>t&&"host"in t?w("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?w("Element",t,"shadowRoot"):null,querySelector:(t,e)=>k("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>k("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:C},T=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,deferredStylesheetCount:0});function E(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var I=0,P=0,R=T(),L=null,O=null,F=[],A={slowestBatchMs:0},D=t=>t&&t>0?t:null,N=32;function q(t,e,i){var r=t.length;if(i>=N)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)r+=q(a,e,i+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var l=o.rules||o.cssRules;l&&(r+=q(l,e,i+1))}}}catch(t){}}return r}function j(t){return 0!==I&&null!==O&&(R.cssRuleCount>=O||R.cssRuleCount+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),q(e,i,0)}catch(t){return 0}}(t)>O)}function B(t){return t.nodeType===t.ELEMENT_NODE}function H(t){var e=t&&"host"in t&&"mode"in t&&M.host(t)||null;return Boolean(e&&"shadowRoot"in e&&M.shadowRoot(e)===t)}function U(t){return"[object ShadowRoot]"==={}.toString.call(t)}var z=0;function W(t){var e,i,r=0===z,n=r?E():0;z+=1;try{var s=t.rules||t.cssRules;if(!s)return null;!function(t){0!==I&&(R.cssRuleCount+=q(t,null,0))}(s);var a=t.href;return!a&&t.ownerNode&&(a=t.ownerNode.baseURI),(i=Array.from(s,(t=>V(t,a))).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}finally{z-=1,r&&(e=E()-n,I>0&&(R.stylesheetMs+=e))}}function V(t,e){var i;if(function(t){return"styleSheet"in t}(t)){var r;try{r=W(t.styleSheet)||function(t){var e=t.cssText;if(3>e.split('"').length)return e;var i=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?i.push("layer"):t.layerName&&i.push("layer("+t.layerName+")"),t.supportsText&&i.push("supports("+t.supportsText+")"),t.media.length&&i.push(t.media.mediaText),i.join(" ")+";"}(t)}catch(e){r=t.cssText}try{if(r&&(null==(i=t.styleSheet)?void 0:i.href))return it(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?it(n,e):n}class Z{constructor(){o(this,"idNodeMap",new Map),o(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var i=null==(e=this.getMeta(t))?void 0:e.id;return null!=i?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),B(t)){var i=M.shadowRoot(t);i&&this.removeNodeFromMap(i),"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 i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function G(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&Q(n);return(i[r.toLowerCase()]||o&&i[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function Q(t){return t.toLowerCase()}var J="__rrweb_original__";function K(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Q(e):null}catch(t){return null}}var Y=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,X=/^(?:[a-z+]+:)?\/\//i,tt=/^www\..*/i,et=/^(data:)([^,]*),(.*)/i;function it(t,e){return(t||"").replace(Y,((t,i,r,n,s,a)=>{var o,l=r||s||a,u=i||n||"";if(!l)return t;if(X.test(l)||tt.test(l))return"url("+u+l+u+")";if(et.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((o=e).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var v of(h.pop(),d))"."!==v&&(".."===v?h.pop():h.push(v));return"url("+u+h.join("/")+u+")"}))}var rt,nt,st="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",at=4096,ot=1e5,lt=10,ut=new Map,ht=1,dt=new RegExp("[^a-z0-9-_:]"),vt=-2;function ct(){return ht++}var ft=/^[^ \t\n\r\u000c]+/,pt=/^[, \t\n\r\u000c]+/,gt=new WeakMap;function mt(t,e){return e&&""!==e.trim()?yt(t,e):e}function yt(t,e){var i=gt.get(t);if(i||(i=t.createElement("a"),gt.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function bt(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?st:t}(t,e.maxBase64ImageLength):t}function _t(t,e,i,r,n,s){var a;if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var o=null==(a=n.sheet)?void 0:a.href;if(o)return o}var l=mt(t,r);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,i,r){if(ot>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>at||t.naturalHeight>at)return e;var n=ut.get(e);if(n&&n.type===i&&n.quality===r)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>o.length?o:e;if(ut.size>=lt){var u=ut.keys().next().value;void 0!==u&&ut.delete(u)}return ut.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),bt(u,s)}if("image"===e)return bt(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=mt(t,r);return"image"===e&&h.startsWith("data:")?bt(h,s):h}return"background"!==i||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===i?function(t,e){if(""===e.trim())return e;var i=0;function r(t){var r,n=t.exec(e.substring(i));return n?(i+=(r=n[0]).length,r):""}for(var n=[];r(pt),e.length>i;){var s=r(ft);if(","===s.slice(-1))s=mt(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=mt(t,s);for(var o=!1;;){var l=e.charAt(i);if(""===l){n.push((s+a).trim());break}if(o)")"===l&&(o=!1);else{if(","===l){i+=1,n.push((s+a).trim());break}"("===l&&(o=!0)}a+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?it(r,yt(t)):"object"===e&&"data"===i?mt(t,r):r:mt(t,r)}function wt(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function xt(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&xt(M.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&xt(M.parentNode(t),e,i)}function kt(t,e,i,r){var n;if(B(t)){if(!M.childNodes(n=t).length)return!1}else{if(null===M.parentElement(t))return!1;n=M.parentElement(t)}try{if("string"==typeof e){if(r){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(xt(n,e,r))return!0;if(i)if(r){if(n.closest(i))return!0}else if(n.matches(i))return!0}catch(t){}return!1}function St(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var Ct=new Map;function Mt(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Tt(t){return null==t?"":t.toLowerCase()}var Et=50,It=!1,Pt=!1;function Rt(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,v=e.maskInputOptions,c=void 0===v?{}:v,p=e.maskTextFn,g=e.maskInputFn,m=e.slimDOMOptions,y=e.dataURLOptions,b=void 0===y?{}:y,_=e.inlineImages,w=void 0!==_&&_,x=e.recordCanvas,k=void 0!==x&&x,S=e.canvasMaskingConfigured,C=e.onSerialize,T=e.onIframeLoad,E=e.iframeLoadTimeout,P=void 0===E?5e3:E,L=e.onIframeListenerRegistered,O=e.onStylesheetLoad,A=e.stylesheetLoadTimeout,D=void 0===A?5e3:A,N=e.keepIframeSrcFn,q=void 0===N?()=>!1:N,z=e.newlyAddedElement,V=void 0!==z&&z,Z=e.depth,Y=void 0===Z?0:Z,X=e.maxDepth,tt=void 0===X?Et:X,et=e.needsMask,st=e.preserveWhiteSpace,at=void 0===st||st;if(Y>=tt)return Pt=!0,It||(It=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+tt+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;et||(et=kt(t,a,o,void 0===et)),I>0&&(R.nodeCount+=1);var ot,lt=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,l=void 0===o?{}:o,u=e.maskTextFn,h=e.maskInputFn,d=e.dataURLOptions,v=void 0===d?{}:d,c=e.inlineImages,p=e.recordCanvas,g=e.canvasMaskingConfigured,m=e.keepIframeSrcFn,y=e.newlyAddedElement,b=void 0!==y&&y,_=function(t,e){if(e.hasNode(t)){var i=e.getId(t);return 1===i?void 0:i}}(i,e.mirror);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:_};case t.ELEMENT_NODE:return function(t,e){for(var i,r,n,s,a=e.doc,o=e.inlineStylesheet,l=e.maskInputOptions,u=void 0===l?{}:l,h=e.maskInputFn,d=e.dataURLOptions,v=void 0===d?{}:d,c=e.inlineImages,p=e.recordCanvas,g=e.canvasMaskingConfigured,m=e.keepIframeSrcFn,y=e.newlyAddedElement,b=void 0!==y&&y,_=e.rootId,w=function(t,e,i){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;if(i)return t.matches(i)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),x=function(t){if(t instanceof HTMLFormElement)return"form";var e=Q(t.tagName);return dt.test(e)?"div":e}(t),k={},S=t.attributes.length,C=0;S>C;C++){var T=t.attributes[C];wt(x,T.name)||(k[T.name]=_t(a,x,Q(T.name),T.value,t,v))}if("link"===x&&o&&!w){var E=t.sheet;if(!E){var P=function(t){return t.href}(t);P&&!(E=Mt(a,P))&&P.includes(".css")&&(E=Mt(a,window.location.origin+"/"+P.replace(window.location.href,"")))}var R=null;E&&(j(E)?I>0&&F.push(t):R=W(E)),R&&(delete k.rel,delete k.href,k._cssText=R)}var L;if("style"===x&&t.sheet&&!(t.innerText||M.textContent(t)||"").trim().length){var O=W(t.sheet);O&&(k._cssText=O)}if("input"===x||"textarea"===x||"select"===x){var A=t.value,D=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&A?k.value=G({element:t,type:K(t),tagName:x,value:A,maskInputOptions:u,maskInputFn:h}):D&&(k.checked=D)}if("option"===x&&(t.selected&&!u.select?k.selected=!0:delete k.selected),"dialog"===x&&t.open)try{k.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}if("canvas"===x&&p&&!(null==g?void 0:g()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var i=0;t.width>i;i+=50)for(var r=0;t.height>r;r+=50){var n=e.getImageData;if(new Uint32Array((J in n?n[J]:n).call(e,i,r,Math.min(50,t.width-i),Math.min(50,t.height-r)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(k.rr_dataURL=t.toDataURL(v.type,v.quality));else if(!("__context"in t)){var N=t.toDataURL(v.type,v.quality),q=a.createElement("canvas");q.width=t.width,q.height=t.height,N!==q.toDataURL(v.type,v.quality)&&(k.rr_dataURL=N)}if("img"===x&&c){rt||(rt=a.createElement("canvas"),nt=rt.getContext("2d"));var B=t,H=B.currentSrc||B.getAttribute("src")||"<unknown-src>",U=B.crossOrigin,z=()=>{St(B,"load",z);try{rt.width=B.naturalWidth,rt.height=B.naturalHeight,nt.drawImage(B,0,0),k.rr_dataURL=rt.toDataURL(v.type,v.quality)}catch(t){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z));console.warn("Cannot inline img src="+H+"! Error: "+t)}"anonymous"===B.crossOrigin&&(U?k.crossOrigin=U:B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z)}if("audio"===x||"video"===x){var V=k;V.rr_mediaState=t.paused?"paused":"played",V.rr_mediaCurrentTime=t.currentTime,V.rr_mediaPlaybackRate=t.playbackRate,V.rr_mediaMuted=t.muted,V.rr_mediaLoop=t.loop,V.rr_mediaVolume=t.volume}if(b||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),w){var Z=t.getBoundingClientRect(),Y=Z.width,X=Z.height,tt=Z.left,et=Z.top,it=null==(i=a.defaultView)?void 0:i.getComputedStyle(t);k={class:k.class,rr_width:Y+"px",rr_height:X+"px",rr_left:Math.floor(tt+((null==(r=a.defaultView)?void 0:r.scrollX)||0))+"px",rr_top:Math.floor(et+((null==(n=a.defaultView)?void 0:n.scrollY)||0))+"px"},it&&(k.rr_position=it.position||"static",it.transform&&"none"!==it.transform&&(k.rr_transform=it.transform),it.display&&it.display.startsWith("inline")&&(k.rr_display=it.display))}"iframe"!==x||m(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src);try{customElements.get(x)&&(s=!0)}catch(t){}return{type:f.Element,tagName:x,attributes:k,childNodes:[],isSVG:(L=t,Boolean("svg"===L.tagName||L.ownerSVGElement)||void 0),needBlock:w,rootId:_,isCustom:s}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:a,maskInputOptions:l,maskInputFn:h,dataURLOptions:v,inlineImages:c,recordCanvas:p,canvasMaskingConfigured:g,keepIframeSrcFn:m,newlyAddedElement:b,rootId:_});case t.TEXT_NODE:return function(t,e){var i,r=e.needsMask,n=e.maskTextFn,s=e.rootId,a=M.parentNode(t),o=a&&a.tagName,l=M.textContent(t),u="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(j(a.sheet));else if(null==(i=a.sheet)?void 0:i.cssRules){var d=W(a.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=it(l,yt(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&r&&(l=n?n(l,M.parentElement(t)):l.replace(/[\S]/g,"*")),{type:f.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:_});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:_};case t.COMMENT_NODE:return{type:f.Comment,textContent:M.textContent(t)||"",rootId:_};default:return!1}}(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:et,inlineStylesheet:d,maskInputOptions:c,maskTextFn:p,maskInputFn:g,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,keepIframeSrcFn:q,newlyAddedElement:V});if(!lt)return console.warn(t,"not serialized"),null;ot=r.hasNode(t)?r.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 i,r;try{r=new URL(t,window.location.href)}catch(t){return null}var n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(i=null==n?void 0:n[1])&&void 0!==i?i:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Tt(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Tt(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Tt(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Tt(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Tt(t.attributes.property).match(/^(og|twitter|fb):/)||Tt(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Tt(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Tt(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(Tt(t.attributes.name))||Tt(t.attributes.property).match(/^article:/)||Tt(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(Tt(t.attributes.name)))return!0}}return!1}(lt,m)||!at&&lt.type===f.Text&&!lt.isStyle&&!lt.textContent.replace(/^\s+|\s+$/gm,"").length?vt:ct();var ut=Object.assign(lt,{id:ot});if(r.add(t,ut),ot===vt)return null;C&&C(t);var ht=!u;if(ut.type===f.Element){ht=ht&&!ut.needBlock,delete ut.needBlock;var ft=M.shadowRoot(t);ft&&U(ft)&&(ut.isShadowHost=!0)}if((ut.type===f.Document||ut.type===f.Element)&&ht){m.headWhitespace&&ut.type===f.Element&&"head"===ut.tagName&&(at=!1);var pt={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:a,maskTextSelector:o,skipChild:u,inlineStylesheet:d,maskInputOptions:c,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:at,onSerialize:C,onIframeLoad:T,iframeLoadTimeout:P,onIframeListenerRegistered:L,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:q,depth:Y+1,maxDepth:tt};if(ut.type===f.Element&&"textarea"===ut.tagName&&void 0!==ut.attributes.value);else for(var gt of Array.from(M.childNodes(t))){var mt=Rt(gt,pt);mt&&ut.childNodes.push(mt)}var bt=null;if(B(t)&&(bt=M.shadowRoot(t)))for(var xt of Array.from(M.childNodes(bt))){var Lt=Rt(xt,pt);Lt&&(U(bt)&&(Lt.isShadow=!0),ut.childNodes.push(Lt))}}var Ot=M.parentNode(t);if(Ot&&H(Ot)&&U(Ot)&&(ut.isShadow=!0),ut.type===f.Element&&"iframe"===ut.tagName){var Ft=function(t,e,i){var r,n=()=>{},s=t.contentWindow;if(!s)return n;try{r=s.document.readyState}catch(t){return n}var a=()=>e();if("complete"!==r){var o=!1,l=null,u=()=>{o||(o=!0,null!==l&&(clearTimeout(l),l=null),St(t,"load",h),t.addEventListener("load",a),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),o?St(t,"load",a):(o=!0,St(t,"load",h))}}var d,v="about:blank";try{d=s.location.href}catch(t){return n}if(d!==v||t.src===v||""===t.src){var c=setTimeout(e,0);return t.addEventListener("load",a),()=>{clearTimeout(c),St(t,"load",a)}}return t.addEventListener("load",a),()=>{St(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&T){var i=Rt(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:at,onSerialize:C,onIframeLoad:T,iframeLoadTimeout:P,onIframeListenerRegistered:L,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:q,depth:Y+1,maxDepth:tt});i&&T(t,i)}}),P);null==L||L(t,Ft)}return ut.type===f.Element&&"link"===ut.tagName&&"stylesheet"===ut.attributes.rel&&function(e,l,u){if(!Ct.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var v=new AbortController,f=!1,y=()=>{if(!f){f=!0;try{(()=>{if(O){var e=Rt(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:at,onSerialize:C,onIframeLoad:T,iframeLoadTimeout:P,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:q,depth:Y,maxDepth:tt});e&&O(t,e)}})()}finally{Ct.delete(e),v.abort()}}},_=setTimeout(y,u);v.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),e.addEventListener("load",y,{signal:v.signal,once:!0}),Ct.set(e,v)}}}(t,0,D),ut}function Lt(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 Ot{constructor(){o(this,"parentElement",null),o(this,"parentNode",null),o(this,"ownerDocument"),o(this,"firstChild",null),o(this,"lastChild",null),o(this,"previousSibling",null),o(this,"nextSibling",null),o(this,"ELEMENT_NODE",1),o(this,"TEXT_NODE",3),o(this,"nodeType"),o(this,"nodeName"),o(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Ot))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,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>At(i,t,e,r)}function At(t,e,i,r){Dt((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))}))}function Dt(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var $t="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.",Nt={map:{},getId(){return console.error($t),-1},getNode(){return console.error($t),null},removeNodeFromMap(){console.error($t)},has(){return console.error($t),!1},reset(){console.error($t)}};function qt(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,a=new Array(s),o=0;s>o;o++)a[o]=arguments[o];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,a)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,a)}),u))}}function jt(t,e,i,r,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,r?i:{set(t){if(setTimeout((()=>{try{i.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>jt(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Nt=new Proxy(Nt,{get(t,e,i){return"map"===e&&console.error($t),Reflect.get(t,e,i)}}));var Bt=Date.now;function Ht(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=M.parentElement(s.body))?void 0:e.scrollLeft)||(null==(i=null==s?void 0:s.body)?void 0:i.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(r=M.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function Ut(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function zt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Wt(t){return t?t.nodeType===t.ELEMENT_NODE?t:M.parentElement(t):null}function Vt(t,e,i,r){if(!t)return!1;var n=Wt(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if(xt(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1}function Zt(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||e.getId(t)===vt}function Gt(t,e){if(H(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=M.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||Gt(r,e))}function Qt(t){return Boolean(t.changedTouches)}function Jt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Kt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Yt(t){return!!t&&(t instanceof Ot&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(M.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Bt=()=>(new Date).getTime());class Xt{constructor(){o(this,"id",1),o(this,"styleIDMap",new WeakMap),o(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function te(t){var e,i=null;return"getRootNode"in t&&(null==(e=M.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&M.host(M.getRootNode(t))&&(i=M.host(M.getRootNode(t))),i}function ee(t){var e=t.ownerDocument;return!!e&&(M.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=te(i);)i=e;return i}(t);return M.contains(e,i)}(t))}function ie(t){return"__ln"in t}class re{constructor(){o(this,"length",0),o(this,"head",null),o(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,i=0;t>i;i++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&ie(t.previousSibling)){var i=t.previousSibling.__ln.next;e.next=i,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,i&&(i.previous=e)}else if(t.nextSibling&&ie(t.nextSibling)&&t.nextSibling.__ln.previous){var r=t.nextSibling.__ln.previous;e.previous=r,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,r&&(r.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var ne,se=(t,e)=>t+"@"+e;class ae{constructor(){o(this,"frozen",!1),o(this,"locked",!1),o(this,"texts",[]),o(this,"attributes",[]),o(this,"attributeMap",new WeakMap),o(this,"removes",[]),o(this,"mapRemoves",[]),o(this,"movedMap",{}),o(this,"addedSet",new Set),o(this,"movedSet",new Set),o(this,"droppedSet",new Set),o(this,"removesSubTreeCache",new Set),o(this,"mutationCb"),o(this,"blockClass"),o(this,"blockSelector"),o(this,"maskTextClass"),o(this,"maskTextSelector"),o(this,"inlineStylesheet"),o(this,"maskInputOptions"),o(this,"maskTextFn"),o(this,"maskInputFn"),o(this,"keepIframeSrcFn"),o(this,"recordCanvas"),o(this,"canvasMaskingConfigured"),o(this,"inlineImages"),o(this,"slimDOMOptions"),o(this,"dataURLOptions"),o(this,"doc"),o(this,"mirror"),o(this,"iframeManager"),o(this,"stylesheetManager"),o(this,"shadowDomManager"),o(this,"canvasManager"),o(this,"processedNodeManager"),o(this,"unattachedDoc"),o(this,"canvasManagerReleased",!1),o(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),o(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e=E();try{this.processBufferedMutations()}finally{(t=E()-e)>A.slowestBatchMs&&(A.slowestBatchMs=t)}}})),o(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,i=new re,r=t=>{for(var e=t,i=vt;i===vt;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=M.parentNode(n);if(s&&ee(n)&&"TEXTAREA"!==s.tagName){var a=H(s)?this.mirror.getId(te(n)):this.mirror.getId(s),o=r(n);if(-1===a||-1===o)return i.addNode(n);var l=Rt(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,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{Jt(t,this.mirror)&&this.iframeManager.addIframe(t),Kt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Yt(n)&&this.shadowDomManager.addShadowRoot(M.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)}});l&&(t.push({parentId:a,nextId:o,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)le(this.removesSubTreeCache,s)&&!this.movedSet.has(M.parentNode(s))||n(s);for(var a of this.addedSet)ue(this.droppedSet,a)||le(this.removesSubTreeCache,a)?ue(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var o=null;i.length;){var l=null;if(o){var u=this.mirror.getId(M.parentNode(o.value)),h=r(o.value);-1!==u&&-1!==h&&(l=o)}if(!l)for(var d=i.tail;d;){var v=d;if(d=d.previous,v){var c=this.mirror.getId(M.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=M.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=M.host(f);if(-1!==this.mirror.getId(p)){l=v;break}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}o=l.previous,i.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((t=>{var e=t.node,i=M.parentNode(e);return i&&"TEXTAREA"===i.tagName&&this.genTextAreaValueMutation(i),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e=t.attributes;if("string"==typeof e.style){var i=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);e.style.length>i.length&&(i+r).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(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))})),o(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),o(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 i=Array.from(M.childNodes(t),(t=>M.textContent(t)||"")).join("");e.attributes.value=G({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:K(t),value:i,maskInputFn:this.maskInputFn})})),o(this,"processMutation",(t=>{if(!Zt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=M.textContent(t.target);Vt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:kt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Wt(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var i=t.target,r=t.attributeName,n=t.target.getAttribute(r);if("value"===r){var s=K(i);n=G({element:i,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Vt(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var a=this.attributeMap.get(t.target);if("IFRAME"===i.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(i.contentDocument)return;r="rr_src"}if(a||(this.attributes.push(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,a)),"type"===r&&"INPUT"===i.tagName&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!wt(i.tagName,r))if(a.attributes[r]=_t(this.doc,Q(i.tagName),Q(r),n,i,this.dataURLOptions),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var o=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&(o.style.cssText=t.oldValue),Array.from(i.style))){var u=i.style.getPropertyValue(l),h=i.style.getPropertyPriority(l);u!==o.style.getPropertyValue(l)||h!==o.style.getPropertyPriority(l)?a.styleDiff[l]=""===h?u:[u,h]:a._unchangedStyles[l]=[u,h]}for(var d of Array.from(o.style))""===i.style.getPropertyValue(d)&&(a.styleDiff[d]=!1)}else"open"===r&&"DIALOG"===i.tagName&&(a.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Vt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var i=this.mirror.getId(e),r=H(t.target)?this.mirror.getId(M.host(t.target)):this.mirror.getId(t.target);Vt(t.target,this.blockClass,this.blockSelector,!1)||Zt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(oe(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||Gt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[se(i,r)]?oe(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!H(t.target)||!U(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),M.childNodes(r).forEach((t=>i.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),o(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Zt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var i=null;e&&this.mirror.hasNode(e)&&(i=this.mirror.getId(e)),i&&-1!==i&&(this.movedMap[se(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Vt(t,this.blockClass,this.blockSelector,!1)||(M.childNodes(t).forEach((t=>this.genAdds(t))),Yt(t)&&M.childNodes(M.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","canvasMaskingConfigured","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.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 oe(t,e){t.delete(e),M.childNodes(e).forEach((e=>oe(t,e)))}function le(t,e,i){return 0!==t.size&&function(t,e,i){var r=M.parentNode(e);return!!r&&t.has(r)}(t,e)}function ue(t,e){return 0!==t.size&&he(t,e)}function he(t,e){var i=M.parentNode(e);return!!i&&(!!t.has(i)||he(t,i))}var de=t=>ne?function(){try{return t(...arguments)}catch(t){if(ne&&!0===ne(t))return;throw t}}:t,ve=[];function ce(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 fe(t,e){var i=new ae;ve.push(i),i.init(t);var r=new(S())(de(i.processMutations.bind(i))),n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),r.observe(e,n),{observer:r,buffer:i}}function pe(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,l=t=>{var a=ce(t);if(a&&!Vt(a,n,s,!0)){var l,u,h=r.getId(a);if(a===i&&i.defaultView){var d=Ht(i.defaultView);l=d.left,u=d.top}else l=a.scrollLeft,u=a.scrollTop;var v=l+","+u;o.get(h)!==v&&(o.set(h,v),e({id:h,x:l,y:u}))}},u=[Ft("scroll",de(qt(de((t=>l(t))),a.scroll||100)),i)];return"onscrollend"in i&&u.push(Ft("scrollend",de(l),i)),()=>u.forEach((t=>t()))}function ge(t,e){for(var i=ve.length-1;i>=0;i--){var r=ve[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),ve.splice(i,1))}}}var me=["INPUT","TEXTAREA","SELECT"],ye=new WeakMap;function be(t){return function t(e,i){if(ke("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ke("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ke("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ke("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);return i.unshift(r),t(e.parentRule,i)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);i.unshift(n)}return i}(t,[])}function _e(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}function we(t,e){var i,r,n,s,a=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:M.host(e));var o="#document"===e.nodeName?null==(i=e.defaultView)?void 0:i.Document:null==(n=null==(r=e.ownerDocument)?void 0:r.defaultView)?void 0:n.ShadowRoot,l=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&o&&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,i;try{i=null==(e=l.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return i}}),de((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function xe(t,e){void 0===e&&(e={});var r,n,s=t.doc.defaultView;if(!s)return()=>{};if(function(t,e){var i=t.mutationCb,r=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,a=t.viewportResizeCb,o=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,v=t.fontCb,c=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),i(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),r(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),v(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),c(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM){var a=fe(t,t.doc);r=a.observer,n=a.buffer}var o,l,v,f,p,g,m,y,b,_=function(t){var e=t.mousemoveCb,i=t.sampling,r=t.doc,n=t.mirror;if(!1===i.mousemove)return()=>{};var s,a="number"==typeof i.mousemove?i.mousemove:50,o="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],h=qt(de((t=>{var i=Date.now()-s;e(l.map((t=>(t.timeOffset-=i,t))),t),l=[],s=null})),o),d=de(qt(de((t=>{var e=ce(t),i=Qt(t)?t.changedTouches[0]:t,r=i.clientX,a=i.clientY;s||(s=Bt()),l.push({x:r,y:a,id:n.getId(e),timeOffset:Bt()-s}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?u.Drag:t instanceof MouseEvent?u.MouseMove:u.TouchMove)})),a,{trailing:!1})),v=[Ft("mousemove",d,r),Ft("touchmove",d,r),Ft("drag",d,r)];return de((()=>{v.forEach((t=>t()))}))}(t),w=function(t){var e=t.mouseInteractionCb,r=t.doc,n=t.mirror,s=t.blockClass,a=t.blockSelector,o=t.sampling;if(!1===o.mouseInteraction)return()=>{};var l=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,u=[],v=null;return Object.keys(h).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var o=Q(t),l=(t=>r=>{var o=ce(r);if(!Vt(o,s,a,!0)){var l=null,u=t;if("pointerType"in r){switch(r.pointerType){case"mouse":l=d.Mouse;break;case"touch":l=d.Touch;break;case"pen":l=d.Pen}l===d.Touch&&(h[t]===h.MouseDown?u="TouchStart":h[t]===h.MouseUp&&(u="TouchEnd"))}else Qt(r)&&(l=d.Touch);null!==l?(v=l,(u.startsWith("Touch")&&l===d.Touch||u.startsWith("Mouse")&&l===d.Mouse)&&(l=null)):h[t]===h.Click&&(l=v,v=null);var c=Qt(r)?r.changedTouches[0]:r;if(c){var f=n.getId(o),p=c.clientX,g=c.clientY;de(e)(i({type:h[u],id:f,x:p,y:g},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(h[t]){case h.MouseDown:case h.MouseUp:o=o.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}u.push(Ft(o,l,r))})),de((()=>{u.forEach((t=>t()))}))}(t),x=pe(t),k=function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return Ft("resize",de(qt(de((()=>{var t=Ut(),e=zt();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),r)}(t,{win:s}),S=function(t){var e=t.inputCb,r=t.doc,n=t.mirror,s=t.blockClass,a=t.blockSelector,o=t.ignoreClass,l=t.ignoreSelector,u=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function v(t){var e=ce(t),i=t.isTrusted,n=r.defaultView;if(!e||!n||e instanceof n.HTMLElement){var v=e&&e.tagName;if(e&&"OPTION"===v&&(e=M.parentElement(e)),e&&v&&me.indexOf(v)>=0&&!Vt(e,s,a,!0)&&!(e.classList.contains(o)||l&&e.matches(l))){var f=e.value,p=!1,g=K(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[v.toLowerCase()]||u[g])&&(f=G({element:e,maskInputOptions:u,tagName:v,type:g,value:f,maskInputFn:h})),c(e,d?{text:f,isChecked:p,userTriggered:i}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&r.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var i=t.value;c(t,d?{text:i,isChecked:!p,userTriggered:!1}:{text:i,isChecked:!p})}}))}}}function c(t,r){var s=ye.get(t);if(!s||s.text!==r.text||s.isChecked!==r.isChecked){ye.set(t,r);var a=n.getId(t);de(e)(i({},r,{id:a}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>Ft(t,de(v),r))),p=r.defaultView;if(!p)return()=>{f.forEach((t=>t()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((t=>jt(t[0],t[1],{set(){de(v)({target:this,isTrusted:!1})}},!1,p)))),de((()=>{f.forEach((t=>t()))}))}(t),T=(l=(o=t).mediaInteractionCb,v=o.blockClass,f=o.blockSelector,p=o.mirror,g=o.sampling,m=o.doc,y=de((t=>qt(de((e=>{var i=ce(e);if(i&&!Vt(i,v,f,!0)){var r=i.currentTime,n=i.volume,s=i.muted,a=i.playbackRate,o=i.loop;l({type:t,id:p.getId(i),currentTime:r,volume:n,muted:s,playbackRate:a,loop:o})}})),g.media||500))),b=[Ft("play",y(c.Play),m),Ft("pause",y(c.Pause),m),Ft("seeked",y(c.Seeked),m),Ft("volumechange",y(c.VolumeChange),m),Ft("ratechange",y(c.RateChange),m)],de((()=>{b.forEach((t=>t()))}))),E=()=>{},I=()=>{},P=()=>{},R=()=>{};t.recordDOM&&(E=function(t,e){var i=t.styleSheetRuleCb,r=t.mirror,n=t.stylesheetManager,s=e.win;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var a=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:de(((t,e,s)=>{var a=s[0],o=s[1],l=_e(e,r,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&i({id:u,styleId:h,adds:[{rule:a,index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,i){return void 0===i&&(i=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",i])};var o,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:de(((t,e,s)=>{var a=s[0],o=_e(e,r,n.styleMirror),l=o.id,u=o.styleId;return(l&&-1!==l||u&&-1!==u)&&i({id:l,styleId:u,removes:[{index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(o=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:de(((t,e,s)=>{var a=s[0],o=_e(e,r,n.styleMirror),l=o.id,u=o.styleId;return(l&&-1!==l||u&&-1!==u)&&i({id:l,styleId:u,replace:a}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:de(((t,e,s)=>{var a=s[0],o=_e(e,r,n.styleMirror),l=o.id,u=o.styleId;return(l&&-1!==l||u&&-1!==u)&&i({id:l,styleId:u,replaceSync:a}),t.apply(e,s)}))}));var h={};Se("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(Se("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),Se("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),Se("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((t=>{var e=t[0],s=t[1];d[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[e].insertRule,{apply:de(((t,e,s)=>{var a=s[0],o=s[1],l=_e(e.parentStyleSheet,r,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&i({id:u,styleId:h,adds:[{rule:a,index:[...be(e),o||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:de(((t,e,s)=>{var a=s[0],o=_e(e.parentStyleSheet,r,n.styleMirror),l=o.id,u=o.styleId;return(l&&-1!==l||u&&-1!==u)&&i({id:l,styleId:u,removes:[{index:[...be(e),a]}]}),t.apply(e,s)}))})})),de((()=>{s.CSSStyleSheet.prototype.insertRule=a,s.CSSStyleSheet.prototype.deleteRule=u,o&&(s.CSSStyleSheet.prototype.replace=o),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((t=>{var e=t[0],i=t[1];i.prototype.insertRule=d[e].insertRule,i.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:s}),I=we(t,t.doc),P=function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:de(((t,e,a)=>{var l,u=a[0],h=a[1],d=a[2];if(n.has(u))return o.apply(e,[u,h,d]);var v=_e(null==(l=e.parentRule)?void 0:l.parentStyleSheet,r,s.styleMirror),c=v.id,f=v.styleId;return(c&&-1!==c||f&&-1!==f)&&i({id:c,styleId:f,set:{property:u,value:h,priority:d},index:be(e.parentRule)}),t.apply(e,a)}))});var l=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:de(((t,e,a)=>{var o,u=a[0];if(n.has(u))return l.apply(e,[u]);var h=_e(null==(o=e.parentRule)?void 0:o.parentStyleSheet,r,s.styleMirror),d=h.id,v=h.styleId;return(d&&-1!==d||v&&-1!==v)&&i({id:d,styleId:v,remove:{property:u},index:be(e.parentRule)}),t.apply(e,a)}))}),de((()=>{a.CSSStyleDeclaration.prototype.setProperty=o,a.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:s}),t.collectFonts&&(R=function(t){var e=t.fontCb,i=t.doc,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,a=r.FontFace;r.FontFace=function(t,e,i){var r=new a(t,e,i);return s.set(r,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};var o=C(i.fonts,"add",(function(t){return function(i){return setTimeout(de((()=>{var t=s.get(i);t&&(e(t),s.delete(i))})),0),t.apply(this,[i])}}));return n.push((()=>{r.FontFace=a})),n.push(o),de((()=>{n.forEach((t=>t()))}))}(t)));var L=function(t){var e=t.doc,i=t.mirror,r=t.blockClass,n=t.blockSelector,s=t.selectionCb,a=!0,o=de((()=>{var t=e.getSelection();if(!(!t||a&&(null==t?void 0:t.isCollapsed))){a=t.isCollapsed||!1;for(var o=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),d=h.startContainer,v=h.startOffset,c=h.endContainer,f=h.endOffset;Vt(d,r,n,!0)||Vt(c,r,n,!0)||o.push({start:i.getId(d),startOffset:v,end:i.getId(c),endOffset:f})}s({ranges:o})}}));return o(),Ft("selectionchange",o)}(t),O=function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?C(i.customElements,"define",(function(t){return function(i,r,n){try{e({define:{name:i}})}catch(t){console.warn("Custom element callback failed for "+i)}return t.apply(this,[i,r,n])}})):()=>{}}(t),F=[];for(var A of t.plugins)F.push(A.observer(A.callback,s,A.options));return de((()=>{if(n){n.destroy(),n.reset();var e=ve.indexOf(n);-1!==e&&ve.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==r||r.disconnect(),_(),w(),x(),k(),S(),T(),E(),I(),P(),R(),L(),O(),F.forEach((t=>t()))}))}function ke(t){return void 0!==window[t]}function Se(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Ce{constructor(t){o(this,"iframeIdToRemoteIdMap",new WeakMap),o(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,r){var n=i||this.getIdToRemoteIdMap(t),s=r||this.getRemoteIdToIdMap(t),a=n.get(e);return a||(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}getIds(t,e){var i=this.getIdToRemoteIdMap(t),r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,i,r)))}getRemoteId(t,e,i){var r=i||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:r.get(e)||-1}getRemoteIds(t,e){var i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,i)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||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 Me{constructor(t){o(this,"iframes",new WeakMap),o(this,"crossOriginIframeMap",new WeakMap),o(this,"crossOriginIframeMirror",new Ce(ct)),o(this,"crossOriginIframeStyleMirror"),o(this,"crossOriginIframeRootIdMap",new WeakMap),o(this,"mirror"),o(this,"mutationCb"),o(this,"wrappedEmit"),o(this,"loadListener"),o(this,"pageHideListener"),o(this,"stylesheetManager"),o(this,"recordCrossOriginIframes"),o(this,"messageHandler"),o(this,"nestedIframeListeners",new Map),o(this,"attachedWindows",new WeakMap),o(this,"attachedDocuments",new WeakMap),o(this,"attachedIframes",new Map),o(this,"loadListenerDisposers",new WeakMap),o(this,"iframeElementsById",new Map),o(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ce(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.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 i=this.loadListenerDisposers.get(t);i||this.loadListenerDisposers.set(t,i=new Set),i.add(e);var r=this.mirror.getId(t);-1!==r&&this.iframeElementsById.set(r,t)}getIframeElementById(t){var e,i,r;return null!==(e=null!==(i=null==(r=this.attachedIframes.get(t))?void 0:r.element)&&void 0!==i?i: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=>Dt(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{At(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var i=this.mirror.getId(t);return this.attachedIframes.set(i,{element:t,content:e}),i}attachIframe(t,e){var i,r=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:r,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var a=this.handleMessage.bind(this);Dt((()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}Dt((()=>{var e=t.contentWindow;if(e){var i=this.pageHideHandlers.get(t);if(i)for(var r of i)if(r.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),i||this.pageHideHandlers.set(t,i=new Set),i.add({win:e,handler:n})}})),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var i=this.crossOriginIframeMap.get(t.source);if(i){var r=this.transformCrossOriginEvent(i,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var i;switch(e.type){case l.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:l.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case l.Meta:case l.Load:case l.DomContentLoaded:return!1;case l.Plugin:return e;case l.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case l.IncrementalSnapshot:switch(e.data.source){case u.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(e.node,i)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.Drag:case u.TouchMove:case u.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(e.data,t,["id"]),e;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case u.Font:return e;case u.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case u.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(i=e.data.styles)||i.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,i,r){for(var n of r)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(i,e[n]):t.getId(i,e[n]));return e}replaceIds(t,e,i){return this.replace(this.crossOriginIframeMirror,t,e,i)}replaceStyleIds(t,e,i){return this.replace(this.crossOriginIframeStyleMirror,t,e,i)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===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),i=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),i){var r=i.contentWindow,n=this.attachedWindows.get(i);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(At(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(At(r,"message",this.nestedIframeListeners.get(r)),this.nestedIframeListeners.delete(r)),r&&this.crossOriginIframeMap.delete(r),this.iframes.delete(i),this.disposeLoadListeners(i),this.removePageHideListener(i);var s=this.attachedDocuments.get(i);s&&(s.forEach((t=>{Dt((()=>this.mirror.removeNodeFromMap(t)))})),Dt((()=>ge(i,s))),this.attachedDocuments.delete(i))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,i)=>{this.mirror.has(i)||t.push(i)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var i=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:i}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&At(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{At(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),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 Te{constructor(t){o(this,"shadowDoms",new WeakSet),o(this,"mutationCb"),o(this,"scrollCb"),o(this,"bypassOptions"),o(this,"mirror"),o(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){var r,n;if(U(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(r=null==(n=M.host(t))?void 0:n.ownerDocument)&&void 0!==r?r:e,a=fe(i({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),o=a.observer,l=a.buffer;this.restoreHandlers.push({doc:s,handler(){o.disconnect(),l.destroy(),l.releaseCanvasManager();var t=ve.indexOf(l);-1!==t&&ve.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:pe(i({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(M.host(t))),this.restoreHandlers.push({doc:s,handler:we({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var i=this;this.restoreHandlers.push({doc:e,handler:C(t.prototype,"attachShadow",(function(t){return function(r){var n=t.call(this,r),s=M.shadowRoot(this);return s&&ee(this)&&i.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var i of this.restoreHandlers)if(i.doc===t)try{i.handler()}catch(t){}else e.push(i);this.restoreHandlers=e}}var Ee="skip-frame";function Ie(t){if("object"!=typeof t||null===t)return!1;var e=t.y,i=t.width,r=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var Pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Re="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Le=0;64>Le;Le++)Re[Pe.charCodeAt(Le)]=Le;var Oe=new Map,Fe=(t,e,i)=>{if(t&&($e(t,e)||"object"==typeof t)){var r=function(t,e){var i=Oe.get(t);return i||Oe.set(t,i=new Map),i.has(e)||i.set(e,[]),i.get(e)}(i,t.constructor.name),n=r.indexOf(t);return-1===n&&(n=r.length,r.push(t)),n}};function Ae(t,e,i,r){if(t instanceof Array)return t.map((t=>Ae(t,e,i,r)));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,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=Pe[i[e]>>2],n+=Pe[(3&i[e])<<4|i[e+1]>>4],n+=Pe[(15&i[e+1])<<2|i[e+2]>>6],n+=Pe[63&i[e+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[Ae(t.buffer,e,i,r),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(r.type,r.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Ae(t.data,e,i,r),t.width,t.height]}:$e(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Fe(t,e,i)}:t}var De=(t,e,i,r)=>t.map((t=>Ae(t,e,i,r))),$e=(t,e)=>{var i=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(i.find((i=>t instanceof e[i])))},Ne=["webgl","webgl2"];function qe(t){return"nodeType"in t}function je(t,e,r,n){var s=[];try{if(n){var a=function(t,e,r){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return C(n.prototype,"configure",(function(n){return function(s){var a=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!a||qe(a)&&Vt(a,e,r,!0))return n.call(this,s);qe(a)&&!("__context"in a)&&(a.__context="webgpu");var o=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==o&&s?i({},s,{usage:"number"==typeof s.usage?s.usage|o:o}):s)}}))}(t,e,r);a&&s.push(a)}var o=C(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(i){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(i),a=arguments.length,o=new Array(a>1?a-1:0),l=1;a>l;l++)o[l-1]=arguments[l];if(!Vt(this,e,r,!0)&&("__context"in this||(this.__context=s),n&&Ne.includes(s)))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[i,...o])}}));s.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((t=>t()))}}function Be(t,e,i,r,n,s,a){var o=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=C(t,l,(function(t){return function(){for(var o=arguments.length,u=new Array(o),h=0;o>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(Fe(d,s,this),"tagName"in this.canvas&&!Vt(this.canvas,r,n,!0)){var v=De(u,s,this,a);i(this.canvas,{type:e,property:l,args:v})}return d}}));o.push(u)}catch(r){var h=jt(t,l,{set(t){i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});o.push(h)}};for(var h of l)u(h);return o}var He,Ue,ze,We='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\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',Ve="undefined"!=typeof self&&self.Blob&&new Blob([We],{type:"text/javascript;charset=utf-8"});function Ze(t){var e;try{if(!(e=Ve&&(self.URL||self.webkitURL).createObjectURL(Ve)))throw"";var i=new Worker(e,{name:null==t?void 0:t.name});return i.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),i}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(We),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Ge{constructor(t){o(this,"pendingCanvasMutations",new Map),o(this,"rafStamps",{latestId:0,invokeId:null}),o(this,"mirror"),o(this,"mutationCb"),o(this,"resetObservers"),o(this,"frozen",!1),o(this,"locked",!1),o(this,"rafIdTimestamp",null),o(this,"rafIdFlush",null),o(this,"refCount",0),o(this,"torndown",!1),o(this,"resetFrameDedup",null),o(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 e=t.sampling,i=void 0===e?"all":e,r=t.win,n=t.blockClass,s=t.blockSelector,a=t.recordCanvas,l=t.dataURLOptions,u=t.resolutionScale,h=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===i&&this.initCanvasMutationObserver(r,n,s,l),a&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:l,resolutionScale:u,canvasMasking:h})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||t.call(this)}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,i,r,n,s){var a=this;if("OffscreenCanvas"in i){var o,l="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,u=je(i,r,n,!0),h=new Map;try{o=new Ze}catch(t){return}var d=!1;o.onerror=()=>{var t;d=!0,cancelAnimationFrame(c),null==(t=o.terminate)||t.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var i=t.data,r=i.displayWidth,n=i.displayHeight;this.mutationCb({id:e,type:v["2D"],commands:[{property:"clearRect",args:[0,0,r,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i.base64}],type:i.type}]},0,0,r,n]}],displayWidth:r,displayHeight:n})}};var c,f=1e3/t,p=0,g=t=>{var u,v;d||(p&&f>t-p||(p=t,(u=[],v=t=>{try{t.querySelectorAll("canvas").forEach((t=>{Vt(t,r,n,!0)||u.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&v(t.shadowRoot)}))}catch(t){}},v(i.document),u).forEach(function(){var t=e((function*(t){var e,i,r=a.mirror.getId(t);if(!h.get(r)&&0!==t.width&&0!==t.height){h.set(r,!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 h.set(r,!1);!1===(null==(i=null==n?void 0:n.getContextAttributes())?void 0:i.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var u=t.clientWidth||t.width,d=t.clientHeight||t.height,v=Math.max(1,Math.round(u*l)),c=Math.max(1,Math.round(d*l)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return Ee}if(void 0!==a){if(!Array.isArray(a)||!a.every(Ie))return Ee;var o=i/n,l=r/s;return a.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*o),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*l)-i}}))}}}(s.canvasMasking,t,v,c,u,d);if(f===Ee)return void h.set(r,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});o.postMessage({id:r,bitmap:p,width:v,height:c,displayWidth:u,displayHeight:d,dataURLOptions:s.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(r,!1)}}}));return function(e){return t.apply(this,arguments)}}())),c=requestAnimationFrame(g))};c=requestAnimationFrame(g),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(c),null==(t=o.terminate)||t.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=je(t,e,i,!1),s=function(t,e,i,r,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var o=C(e.CanvasRenderingContext2D.prototype,a,(function(s){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];return Vt(this.canvas,i,r,!0)||setTimeout((()=>{var i=De(l,e,this,n);t(this.canvas,{type:v["2D"],property:a,args:i})}),0),s.apply(this,l)}}));s.push(o)}catch(i){var l=jt(e.CanvasRenderingContext2D.prototype,a,{set(e){t(this.canvas,{type:v["2D"],property:a,args:[e],setter:!0})}});s.push(l)}};for(var l of a)o(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r),a=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...Be(e.WebGLRenderingContext.prototype,v.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...Be(e.WebGL2RenderingContext.prototype,v.WebGL2,t,i,r,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),a()}}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 i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var i=this.pendingCanvasMutations.get(t);if(i&&-1!==e){var n=i.map((t=>r(t,s)));this.mutationCb({id:e,type:i[0].type,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Qe{constructor(t){o(this,"trackedLinkElements",new WeakSet),o(this,"mutationCb"),o(this,"adoptedStyleSheetCb"),o(this,"styleMirror",new Xt),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)}inlineDeferredLinkElement(t,e){if(-1!==e&&t.isConnected){var i=null;try{var r=t.sheet;r&&(i=W(r))}catch(t){}i&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:i}}]})}}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var i=this;if(0!==t.length){var r={id:e,styleIds:[]},n=[],s=function(t){var e;i.styleMirror.has(t)?e=i.styleMirror.getId(t):(e=i.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,i)=>({rule:V(e,t.href),index:i})))})),r.styleIds.push(e)};for(var a of t)s(a);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,Ct.forEach((t=>t.abort())),Ct.clear()}trackStylesheetInLinkElement(t){}}class Je{constructor(){o(this,"nodeMap",new WeakMap),o(this,"active",!1)}inOtherBuffer(t,e){var i=this.nodeMap.get(t);return i&&Array.from(i).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Ke=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Ye=document.createElement("iframe");document.body.appendChild(Ye),Array.from=(null==(n=Ye.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Ye)}}catch(t){console.debug("Unable to override Array.from",t)}var Xe=new Z,ti=new Set([u.Mutation,u.MediaInteraction,u.StyleSheetRule,u.CanvasMutation,u.Font,u.Log,u.StyleDeclaration,u.AdoptedStyleSheet]);function ei(t){var e=window;if("function"==typeof e.requestIdleCallback){var i=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null==(t=e.cancelIdleCallback)?void 0:t.call(e,i)}}}var r=setTimeout(t,250);return{cancel:()=>clearTimeout(r)}}function ii(t){var e;void 0===t&&(t={});var r=t,n=r.emit,s=r.checkoutEveryNms,a=r.checkoutEveryNth,o=r.blockClass,h=void 0===o?"rr-block":o,d=r.blockSelector,v=void 0===d?null:d,c=r.ignoreClass,f=void 0===c?"rr-ignore":c,p=r.ignoreSelector,g=void 0===p?null:p,m=r.maskTextClass,y=void 0===m?"rr-mask":m,b=r.maskTextSelector,_=void 0===b?null:b,w=r.inlineStylesheet,x=void 0===w||w,k=r.inlineStylesheetBudgetRules,S=void 0===k?1e4:k,C=r.maskAllInputs,A=r.maskInputOptions,N=r.slimDOMOptions,q=r.maskInputFn,j=r.maskTextFn,B=r.hooks,H=r.packFn,U=r.sampling,z=void 0===U?{}:U,W=r.dataURLOptions,V=void 0===W?{}:W,G=r.canvasResolutionScale,Q=r.canvasMasking,J=r.mousemoveWait,K=r.recordDOM,Y=void 0===K||K,X=r.recordCanvas,tt=void 0!==X&&X,et=r.recordCrossOriginIframes,it=void 0!==et&&et,rt=r.recordAfter,nt=void 0===rt?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":rt,st=r.userTriggeredOnInput,at=void 0!==st&&st,ot=r.collectFonts,lt=void 0!==ot&&ot,ut=r.inlineImages,ht=void 0!==ut&&ut,dt=r.plugins,vt=r.keepIframeSrcFn,ct=void 0===vt?()=>!1:vt,ft=r.ignoreCSSAttributes,pt=void 0===ft?new Set([]):ft,gt=r.attributeFilter;ne=r.errorHandler;var mt=i({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},V),yt=!it||window.parent===window,bt=!1;if(!yt)try{window.parent.document&&(bt=!1)}catch(t){bt=!0}if(yt&&!n)throw new Error("emit function is required");if(!yt&&!bt)return()=>{};void 0!==J&&void 0===z.mousemove&&(z.mousemove=J),Xe.reset();var _t,wt=!0===C?{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!==A?A:{password:!0},xt=Lt(void 0!==N&&N);!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 kt,St,Ct=0,Mt=new Map,Tt=t=>{for(var e of dt||[])e.eventProcessor&&(t=e.eventProcessor(t));return H&&!bt&&(t=H(t)),t};He=(t,e)=>{var i,r=t;if(r.timestamp=Bt(),!(null==(i=ve[0])?void 0:i.isFrozen())||r.type===l.FullSnapshot||r.type===l.IncrementalSnapshot&&ti.has(r.data.source)||ve.forEach((t=>t.unfreeze())),yt)null==n||n(Tt(r),e);else if(bt){var o={type:"rrweb",event:Tt(r),origin:window.location.origin,isCheckout:e};window.parent.postMessage(o,"*")}if(r.type===l.FullSnapshot)_t=r,Ct=0;else if(r.type===l.IncrementalSnapshot){if(r.data.source===u.Mutation&&r.data.isAttachIframe)return;Ct++,(a&&Ct>=a||s&&r.timestamp-_t.timestamp>s)&&Ue(!0)}};var Et=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,r=new Set;if(t.adds.length>0)for(var n of t.adds){var s=Xe.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&r.add(s)}t.removes.forEach((t=>{var i=t.id;if(!e||!e.has(i)){var n=At.getIframeElementById(i);n&&r.has(n)?At.forgetIframeId(i):(null==kt||kt(i),At.removeIframeById(i))}})),null==St||St(),At.cleanupDetachedIframes()}He({type:l.IncrementalSnapshot,data:i({source:u.Mutation},t)})},It=t=>He({type:l.IncrementalSnapshot,data:i({source:u.Scroll},t)}),Pt=t=>He({type:l.IncrementalSnapshot,data:i({source:u.CanvasMutation},t)}),Ot=new Qe({mutationCb:Et,adoptedStyleSheetCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.AdoptedStyleSheet},t)})}),At=new Me({mirror:Xe,mutationCb:Et,stylesheetManager:Ot,recordCrossOriginIframes:it,wrappedEmit:He});for(var $t of dt||[])$t.getMirror&&$t.getMirror({nodeMirror:Xe,crossOriginIframeMirror:At.crossOriginIframeMirror,crossOriginIframeStyleMirror:At.crossOriginIframeStyleMirror});var Nt=new Je,qt=null==Q?void 0:Q.configured;ze=new Ge({recordCanvas:tt,mutationCb:Pt,win:window,blockClass:h,blockSelector:v,mirror:Xe,sampling:z.canvas,dataURLOptions:mt,resolutionScale:G,canvasMasking:Q});var jt=new Te({mutationCb:Et,scrollCb:It,bypassOptions:{blockClass:h,blockSelector:v,maskTextClass:y,maskTextSelector:_,inlineStylesheet:x,maskInputOptions:wt,dataURLOptions:mt,maskTextFn:j,maskInputFn:q,recordCanvas:tt,canvasMaskingConfigured:qt,inlineImages:ht,sampling:z,slimDOMOptions:xt,iframeManager:At,stylesheetManager:Ot,canvasManager:ze,keepIframeSrcFn:ct,processedNodeManager:Nt,attributeFilter:gt},mirror:Xe});Ue=function(t){if(void 0===t&&(t=!1),Y){He({type:l.Meta,data:{href:window.location.href,width:zt(),height:Ut()}},t),null==e||e(),e=void 0,Ot.reset(),jt.init(),ve.forEach((t=>t.lock()));var i,r,n=null;try{n=function(t,e){var i,r=e||{},n=r.mirror,s=void 0===n?new Z:n,a=r.blockClass,o=void 0===a?"rr-block":a,l=r.blockSelector,u=void 0===l?null:l,h=r.maskTextClass,d=void 0===h?"rr-mask":h,v=r.maskTextSelector,c=void 0===v?null:v,f=r.inlineStylesheet,p=void 0===f||f,g=r.inlineImages,m=void 0!==g&&g,y=r.recordCanvas,b=void 0!==y&&y,_=r.canvasMaskingConfigured,w=r.maskAllInputs,x=void 0!==w&&w,k=r.maskTextFn,S=r.maskInputFn,C=r.slimDOM,M=r.dataURLOptions,A=r.preserveWhiteSpace,N=r.onSerialize,q=r.onIframeLoad,j=r.iframeLoadTimeout,B=r.onIframeListenerRegistered,H=r.onStylesheetLoad,U=r.stylesheetLoadTimeout,z=r.keepIframeSrcFn,W=void 0===z?()=>!1:z,V=r.maxDepth,G=r.inlineStylesheetBudgetRules,Q=!0===x?{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===x?{password:!0}:x,J=Lt(void 0!==C&&C);i=G,(I+=1)>1||(R=T(),F=[],O=D(i),P=E());try{return Rt(t,{doc:t,mirror:s,blockClass:o,blockSelector:u,maskTextClass:d,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:Q,maskTextFn:k,maskInputFn:S,slimDOMOptions:J,dataURLOptions:M,inlineImages:m,recordCanvas:b,canvasMaskingConfigured:_,preserveWhiteSpace:A,onSerialize:N,onIframeLoad:q,iframeLoadTimeout:j,onIframeListenerRegistered:B,onStylesheetLoad:H,stylesheetLoadTimeout:U,keepIframeSrcFn:W,newlyAddedElement:!1,maxDepth:V})}finally{0===I?L||T():(I-=1)>0||(R.durationMs=E()-P,R.deferredStylesheetCount=F.length,O=null,L=R)}}(document,{mirror:Xe,blockClass:h,blockSelector:v,maskTextClass:y,maskTextSelector:_,inlineStylesheet:x,maskAllInputs:wt,inlineStylesheetBudgetRules:S,maskTextFn:j,maskInputFn:q,slimDOM:xt,dataURLOptions:mt,recordCanvas:tt,canvasMaskingConfigured:qt,inlineImages:ht,onSerialize(t){Jt(t,Xe)&&At.addIframe(t),Kt(t,Xe)&&Ot.trackLinkElement(t),Yt(t)&&jt.addShadowRoot(M.shadowRoot(t),document)},onIframeLoad(t,e){At.attachIframe(t,e),jt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){At.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){Ot.attachLinkElement(t,e)},keepIframeSrcFn:ct})}finally{i=F,F=[],r=i}if(!n)return console.warn("Failed to snapshot the document");He({type:l.FullSnapshot,data:{node:n,initialOffset:Ht(window)}},t),ve.forEach((t=>t.unlock())),ze.onFullSnapshot(),r.length&&(e=function(t,i,r){var n=!1,s=null,a=0,o=r=>{if(s=null,!n){var l=function(){var e=t[a];t[a]=null,a+=1,e&&Dt((()=>i.inlineDeferredLinkElement(e,Xe.getId(e))))};do{l()}while(t.length>a&&r&&!r.didTimeout&&r.timeRemaining()>5);t.length>a?s=ei(o):e=void 0}};return s=ei(o),()=>{n=!0,null==s||s.cancel(),s=null}}(r,Ot)),it&&At.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ot.adoptStyleSheets(document.adoptedStyleSheets,Xe.getId(document))}};try{var Wt=[];kt=t=>{var e=Mt.get(t);e&&(e.forEach((t=>{Dt(t);var e=Wt.indexOf(t);-1!==e&&Wt.splice(e,1)})),Mt.delete(t))},St=()=>{for(var t of Mt){var e=t[0],i=Xe.getNode(e);if(i)try{i.contentDocument&&i.contentDocument.defaultView||null==kt||kt(e)}catch(t){null==kt||kt(e)}else null==kt||kt(e)}};var Vt=t=>{var e;return de(xe)({mutationCb:Et,mousemoveCb:(t,e)=>He({type:l.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.MouseInteraction},t)}),scrollCb:It,viewportResizeCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.ViewportResize},t)}),inputCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.Input},t)}),mediaInteractionCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.MediaInteraction},t)}),styleSheetRuleCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.StyleSheetRule},t)}),styleDeclarationCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.StyleDeclaration},t)}),canvasMutationCb:Pt,fontCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.Font},t)}),selectionCb(t){He({type:l.IncrementalSnapshot,data:i({source:u.Selection},t)})},customElementCb(t){He({type:l.IncrementalSnapshot,data:i({source:u.CustomElement},t)})},blockClass:h,ignoreClass:f,ignoreSelector:g,maskTextClass:y,maskTextSelector:_,maskInputOptions:wt,inlineStylesheet:x,sampling:z,recordDOM:Y,recordCanvas:tt,canvasMaskingConfigured:qt,inlineImages:ht,userTriggeredOnInput:at,collectFonts:lt,doc:t,maskInputFn:q,maskTextFn:j,keepIframeSrcFn:ct,blockSelector:v,slimDOMOptions:xt,dataURLOptions:mt,mirror:Xe,iframeManager:At,stylesheetManager:Ot,shadowDomManager:jt,processedNodeManager:Nt,canvasManager:ze,ignoreCSSAttributes:pt,attributeFilter:gt,plugins:(null==(e=null==dt?void 0:dt.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>He({type:l.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},B)};At.addLoadListener((t=>{try{var e=Xe.getId(t),i=Vt(t.contentDocument);if(Wt.push(i),-1!==e){var r=Mt.get(e);r||Mt.set(e,r=new Set),r.add(i)}}catch(t){console.warn(t)}})),At.addPageHideListener((t=>{var e=Xe.getId(t);null==kt||kt(e),ge(t)}));var Zt=-1,Gt=t=>He({type:l.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Qt=()=>{var t,e,i,r,n=document,s=null!==(t=null!==(e=null!==(i=null!==(r=n.fullscreenElement)&&void 0!==r?r:n.webkitFullscreenElement)&&void 0!==i?i:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,a=s?Xe.getId(s):-1;a!==Zt&&(-1!==Zt&&Gt({id:Zt,enter:!1}),Zt=a,-1!==a&&Gt({id:a,enter:!0}))},Xt=()=>{Ue(),Wt.push(Vt(document)),Wt.push(Ft("fullscreenchange",Qt)),Wt.push(Ft("webkitfullscreenchange",Qt)),Wt.push(Ft("mozfullscreenchange",Qt)),Wt.push(Ft("MSFullscreenChange",Qt)),Ke=!0};return["interactive","complete"].includes(document.readyState)?Xt():(Wt.push(Ft("DOMContentLoaded",(()=>{He({type:l.DomContentLoaded,data:{}}),"DOMContentLoaded"===nt&&Xt()}))),Wt.push(Ft("load",(()=>{He({type:l.Load,data:{}}),"load"===nt&&Xt()}),window))),()=>{null==e||e(),e=void 0,Wt.forEach((t=>Dt(t))),Nt.destroy(),At.removeLoadListener(),At.destroy(),Mt.clear(),jt.reset(),Xe.reset(),Ke=!1,ne=void 0}}catch(t){console.warn(t)}}ii.addCustomEvent=(t,e)=>{if(!Ke)throw new Error("please add custom event after start recording");He({type:l.Custom,data:{tag:t,payload:e}})},ii.freezePage=()=>{ve.forEach((t=>t.freeze()))},ii.takeFullSnapshot=t=>{if(!Ke)throw new Error("please take full snapshot after start recording");Ue(t)},ii.mirror=Xe;var ri=Object.defineProperty,ni=(t,e,i)=>((t,e,i)=>e in t?ri(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class si{constructor(t){ni(this,"fileName"),ni(this,"functionName"),ni(this,"lineNumber"),ni(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 ai=/(^|@)\S+:\d+/,oi=/^\s*at .*(\S+:\d+|\(native\))/m,li=/^(eval@)?(\[native code])?$/,ui={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(oi)?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(oi)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),i=e.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(e=i?e.replace(i[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(i?i[1]:r.pop()),s=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new si({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(li)}),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 si({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new si({functionName:r,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,i=t.message.split("\n"),r=[],n=2,s=i.length;s>n;n+=2){var a=e.exec(i[n]);a&&r.push(new si({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=t.stacktrace.split("\n"),r=[],n=0,s=i.length;s>n;n+=2){var a=e.exec(i[n]);a&&r.push(new si({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(ai)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),i=this.extractLocation(e.pop()),r=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new si({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)}};function hi(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var i=t.localName;if(!i)break;i=i.toLowerCase();var r=t.parentElement,n=[];if(r.children&&r.children.length>0)for(var s=0;r.children.length>s;s++){var a=r.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===i&&n.push(a)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function di(t){return Array.isArray(t)}function vi(t){return"object"==typeof t&&null!==t&&!di(t)}function ci(t,e){if(0===e)return!0;var i=Object.keys(t);for(var r of i)if(vi(t[r])&&ci(t[r],e-1))return!0;return!1}function fi(t,e){var i={numOfKeysLimit:50,depthOfLimit:4};Object.assign(i,e);var r=[],n=[];return JSON.stringify(t,(function(t,e){if(r.length>0){var s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?n.splice(s,1/0,t):n.push(t),~r.indexOf(e)&&(e=r[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(e)).join(".")+"]")}else r.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(vi(a=e)&&Object.keys(a).length>i.numOfKeysLimit||"function"==typeof a||vi(a)&&ci(a,i.depthOfLimit))return function(t){var e=t.toString();return i.stringLengthLimit&&e.length>i.stringLengthLimit&&(e=e.slice(0,i.stringLengthLimit)+"..."),e}(e);var a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var l in e){var u=e[l];o[l]=di(u)?hi(u.length?u[0]:null):u}return o}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var pi={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 gi(t,e,i){var r,n=i?Object.assign({},pi,i):pi,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var a=0,o=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message,r=ui.parse(e.error).map((t=>t.toString())),s=[fi(i,n.stringifyOptions)];t({level:"error",trace:r,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var i,r;e.reason instanceof Error?r=[fi("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[fi("Uncaught (in promise)",n.stringifyOptions),fi(e.reason,n.stringifyOptions)]);var s=ui.parse(i).map((t=>t.toString()));t({level:"error",trace:s,payload:r})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(v(r,d));return()=>{l.forEach((t=>t()))};function v(e,i){var r=this;return e[i]?function(e,s,l){try{if(!(s in e))return()=>{};var u=e[s],h={next:u},d=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(r,l),!("assert"===i&&l[0]||o)){o=!0;try{var h=ui.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===i?l.slice(1):l).map((t=>fi(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:i,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[fi("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{o=!1}}})((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=e[s];"function"==typeof t&&t.__rrweb_layer__;){var i=t.__rrweb_layer__;if(i.next===d)return void(i.next=h.next);t=i.next}else e[s]=h.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var mi=t=>({name:"rrweb/console@1",observer:gi,options:t}),yi=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function bi(t){return"string"==typeof t||t}function _i(t){return"string"==typeof t?t:void 0}var wi,xi=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],ki=function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),Si=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Ci="min_length",Mi="max_length",Ti=["$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"],Ei=["token"],Ii="NativeGzipValidationError",Pi=t=>t.length>=2&&31===t[0]&&139===t[1],Ri=(t,e)=>t===Si.GZipJS||e===Si.GZipJS||"gzip"===e,Li=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Oi=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Ii,e},Fi=function(){var t=e((function*(t,e){18>t.size&&Oi("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());Pi(i)&&8===i[2]||Oi("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(wi)return wi;wi=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;wi[t]=e>>>0}return wi})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&Oi("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&Oi("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function Ai(){return Ai=e((function*(t,i,r){void 0===i&&(i=!0);try{var n=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),a=s.writable.getWriter(),o=a.write(n).then((()=>a.close())).catch(function(){var t=e((function*(t){try{yield a.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),l=new Response(s.readable).blob(),u=(yield Promise.all([l,o]))[0];return yield Fi(u,n),u}catch(t){if(null!=r&&r.rethrow)throw t;return i&&console.error("Failed to gzip compress data",t),null}})),Ai.apply(this,arguments)}var Di=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],$i=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return Di.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function Ni(t,e){return-1!==t.indexOf(e)}var qi=function(t){return t.trim()},ji=function(t){return t.replace(/^\$/,"")};function Bi(t){var e,i=[];return null!==(e=JSON.stringify(t,(function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(e))return"[Circular]";i.push(e)}return e}})))&&void 0!==e?e:"null"}var Hi=Object.prototype,Ui=Hi.hasOwnProperty,zi=Hi.toString,Wi=Array.isArray||function(t){return"[object Array]"===zi.call(t)},Vi=t=>"function"==typeof t,Zi=t=>t===Object(t)&&!Wi(t),Gi=t=>{if(Zi(t)){for(var e in t)if(Ui.call(t,e))return!1;return!0}return!1},Qi=t=>void 0===t,Ji=t=>"[object String]"==zi.call(t),Ki=t=>Ji(t)&&0===t.trim().length,Yi=t=>null===t,Xi=t=>Qi(t)||Yi(t),tr=t=>"[object Number]"==zi.call(t)&&t==t,er=t=>tr(t)&&t>0,ir=t=>"[object Boolean]"===zi.call(t),rr=t=>t instanceof FormData,nr=t=>Ni(Ti,t),sr=t=>Ni(Ei,t);function ar(t){return null===t||"object"!=typeof t}function or(t,e){return{}.toString.call(t)==="[object "+e+"]"}function lr(t){return"undefined"!=typeof Event&&ur(t,Event)}function ur(t,e){try{return t instanceof e}catch(t){return!1}}var hr=[!0,"true",1,"1","yes"],dr=t=>Ni(hr,t),vr=[!1,"false",0,"0","no"];function cr(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),tr(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+n),cr(n||i,e,i,r))}class fr{constructor(t){this.tt={},this.et=t.et,this.it=cr(t.bucketSize,0,100,t.rt),this.nt=cr(t.refillRate,0,this.it,t.rt),this.st=cr(t.refillInterval,0,864e5,t.rt)}ot(t,e){var i=Math.floor((e-t.lastAccess)/this.st);i>0&&(t.tokens=Math.min(t.tokens+i*this.nt,this.it),t.lastAccess=t.lastAccess+i*this.st)}consumeRateLimit(t){var e,i=Date.now(),r=String(t),n=this.tt[r];return n?this.ot(n,i):this.tt[r]=n={tokens:this.it,lastAccess:i},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.et)||e.call(this,t)),0===n.tokens)}stop(){this.tt={}}}var pr="Mobile",gr="iOS",mr="Android",yr="Tablet",br=mr+" "+yr,_r="iPad",wr="Apple",xr=wr+" Watch",kr="Safari",Sr="BlackBerry",Cr="Samsung",Mr=Cr+"Browser",Tr=Cr+" Internet",Er="Chrome",Ir=Er+" OS",Pr=Er+" "+gr,Rr="Internet Explorer",Lr=Rr+" "+pr,Or="Opera",Fr=Or+" Mini",Ar="Edge",Dr="Microsoft "+Ar,$r="Firefox",Nr=$r+" "+gr,qr="Nintendo",jr="PlayStation",Br="Xbox",Hr=mr+" "+pr,Ur=pr+" "+kr,zr="Windows",Wr=zr+" Phone",Vr="Nokia",Zr="Ouya",Gr="Generic",Qr=Gr+" "+pr.toLowerCase(),Jr=Gr+" "+yr.toLowerCase(),Kr="Konqueror",Yr="Oculus Browser",Xr="Vivaldi",tn="Yandex",en="Whale",rn="DuckDuckGo",nn="Pale Moon",sn="Waterfox",an="Brave",on="Google Search App",ln="(\\d+(\\.\\d+)?)",un=new RegExp("Version/"+ln),hn=new RegExp(Br,"i"),dn=new RegExp(jr+" \\w+","i"),vn=new RegExp(qr+" \\w+","i"),cn=new RegExp(Sr+"|PlayBook|BB10","i"),fn={"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"},pn=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?an:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&Ni(t,"GSA/")?on:Ni(t," OPR/")&&Ni(t,"Mini")?Fr:Ni(t," OPR/")?Or:cn.test(t)?Sr:Ni(t,"IE"+pr)||Ni(t,"WPDesktop")?Lr:Ni(t,"OculusBrowser")?Yr:Ni(t,Mr)?Tr:Ni(t,Ar)||Ni(t,"Edg/")?Dr:Ni(t,Xr+"/")?Xr:Ni(t,"YaBrowser/")?tn:Ni(t,en+"/")?en:Ni(t,rn+"/")||Ni(t,"Ddg/")?rn:Ni(t,"FBIOS")?"Facebook "+pr:Ni(t,"UCWEB")||Ni(t,"UCBrowser")?"UC Browser":Ni(t,"CriOS")?Pr:Ni(t,"CrMo")||Ni(t,Er)?Er:Ni(t,mr)&&Ni(t,kr)?Hr:Ni(t,"FxiOS")?Nr:Ni(t.toLowerCase(),Kr.toLowerCase())?Kr:Ni(t,an+"/")?an:((t,e)=>e&&Ni(e,wr)||function(t){return Ni(t,kr)&&!Ni(t,Er)&&!Ni(t,mr)}(t))(t,e)?Ni(t,pr)?Ur:kr:Ni(t,"PaleMoon/")?nn:Ni(t,sn+"/")?sn:Ni(t,$r)?$r:Ni(t,"MSIE")||Ni(t,"Trident/")?Rr:Ni(t,"Gecko")?$r:"")},gn={[Lr]:[new RegExp("rv:"+ln)],[Dr]:[new RegExp(Ar+"?\\/"+ln)],[Er]:[new RegExp("("+Er+"|CrMo)\\/"+ln)],[Pr]:[new RegExp("CriOS\\/"+ln)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ln)],[kr]:[un],[Ur]:[un],[Or]:[new RegExp("(Opera|OPR)\\/"+ln)],[$r]:[new RegExp($r+"\\/"+ln)],[Nr]:[new RegExp("FxiOS\\/"+ln)],[Kr]:[new RegExp("Konqueror[:/]?"+ln,"i")],[Sr]:[new RegExp(Sr+" "+ln),un],[Hr]:[new RegExp("android\\s"+ln,"i")],[Tr]:[new RegExp(Mr+"\\/"+ln)],[Yr]:[new RegExp("OculusBrowser\\/"+ln)],[Xr]:[new RegExp(Xr+"\\/"+ln)],[tn]:[new RegExp("YaBrowser\\/"+ln)],[en]:[new RegExp(en+"\\/"+ln)],[an]:[new RegExp(an+"\\/"+ln)],[rn]:[new RegExp("(DuckDuckGo|Ddg)\\/"+ln)],[nn]:[new RegExp("PaleMoon\\/"+ln)],[sn]:[new RegExp(sn+"\\/"+ln)],[on]:[new RegExp("GSA\\/"+ln)],[Rr]:[new RegExp("(rv:|MSIE )"+ln)],Mozilla:[new RegExp("rv:"+ln)]},mn=function(t,e,i,r){var n=pn(t,e,i,r),s=gn[n];if(Qi(s))return null;for(var a=0;s.length>a;a++){var o=t.match(s[a]);if(o)return parseFloat(o[o.length-2])}return null},yn=[[new RegExp(Br+"; "+Br+" (.*?)[);]","i"),t=>[Br,t&&t[1]||""]],[new RegExp(qr,"i"),[qr,""]],[new RegExp(jr,"i"),[jr,""]],[cn,[Sr,""]],[new RegExp(zr,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Wr,""];if(new RegExp(pr).test(e)&&!/IEMobile\b/.test(e))return[zr+" "+pr,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=fn[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[zr,r]}return[zr,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[gr,[t[3],t[4],t[5]||"0"].join(".")]:[gr,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Qi(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+mr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+mr+")","i"),t=>t&&t[2]?[mr,[t[2],t[3],t[4]||"0"].join(".")]:[mr,""]],[/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/,[Ir,""]],[/Linux|debian/i,["Linux",""]]],bn=function(t){return vn.test(t)?qr:dn.test(t)?jr:hn.test(t)?Br:new RegExp(Zr,"i").test(t)?Zr:new RegExp("("+Wr+"|WPDesktop)","i").test(t)?Wr:/iPad/.test(t)?_r:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?xr:cn.test(t)?Sr:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Vr,"i").test(t)?Vr:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(pr).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?mr:br:new RegExp("(pda|"+pr+")","i").test(t)?Qr:new RegExp(yr,"i").test(t)&&!new RegExp(yr+" pc","i").test(t)?Jr:""},_n=function(t,e){var i,r,n,s,a=bn(t);return a===_r||a===br||"Kobo"===a||"Kindle Fire"===a||a===Jr?yr:a===qr||a===Br||a===jr||a===Zr?"Console":a===xr?"Wearable":a?pr:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(i=null==e?void 0:e.maxTouchPoints)&&void 0!==i?i:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?pr:yr:"Desktop"},wn=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function xn(t,e){return"string"==typeof(i=t)&&wn.test(i)?t:e();var i}function kn(t){return t?t.split("#")[0]:t}function Sn(t,e){var i=setTimeout(t,e);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function Cn(t,e,i){return Mn.apply(this,arguments)}function Mn(){return(Mn=e((function*(t,e,i){var r;try{return yield Promise.race([t,new Promise(((t,n)=>{r=Sn((()=>{try{null==i||i(),t()}catch(t){n(t)}}),e)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}var Tn=t=>t instanceof Error,En={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}},In=En.info;function Pn(t){if(ir(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(Wi(t))return{arrayValue:{values:t.map((t=>Pn(t)))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}function Rn(t){var e=[];for(var i in t){var r=t[i];Yi(r)||Qi(r)||e.push({key:i,value:Pn(r)})}return e}function Ln(t,e){var r=En[t.level||"info"]||In,n=r.text,s=r.number,a=String(Date.now())+"000000",o={};e.distinctId&&(o.posthogDistinctId=e.distinctId),e.sessionId&&(o.sessionId=e.sessionId),e.windowId&&(o["window.id"]=e.windowId),Xi(e.sessionStartTimestamp)||(o.sessionStartTimestamp=String(e.sessionStartTimestamp)),Xi(e.lastActivityTimestamp)||(o.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(o["url.full"]=e.currentUrl),e.screenName&&(o["screen.name"]=e.screenName),e.appState&&(o["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(o.feature_flags=e.activeFeatureFlags);var l=i({},o,t.attributes||{}),u={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:s,severityText:n,body:{stringValue:t.body},attributes:Rn(l)};return t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),Qi(t.trace_flags)||(u.flags=t.trace_flags),u}function On(t,e,r){return i({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":r})}function Fn(t,e,i,r){return{resourceLogs:[{resource:{attributes:Rn(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}let An=class{constructor(t,e,i,r,n,s,a){var o;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.Pe=e,this.rt=i,this.ut=r,this.ht=n,this.dt=s,this.vt=a,this.ct=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.xt=e.maxBufferSize,this.kt=Math.max(null!==(o=e.maxQueueSize)&&void 0!==o?o:e.maxBufferSize,e.maxBufferSize),this.St=e.flushIntervalMs,this.Ct=e.maxBatchRecordsPerPost,this.Mt=e.rateCapWindowMs,this.Tt=e.maxLogsPerInterval}reset(){this.Et(),this.ct=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Pe.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.It()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var e=this.Pt(t);if(null!==e)if(e.body){if(this.Rt()){var i={record:Ln(e,this.ut())};this.ht((()=>this.Lt(i)))}}else this.rt.info("Log was rejected in beforeSend function")}}Pt(t){var e=this.Pe.beforeSend;if(!e)return t;var i=Wi(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.rt.info("Log was rejected in beforeSend function"),null;r=s}catch(t){return this.rt.error("Error in beforeSend function for log:",t),null}return r}Rt(){if(void 0===this.Tt)return!0;var t=Date.now(),e=t-this.bt;return this.Mt>e&&e>=0||(this.bt=t,this._t=0,this.wt=!1),this.Tt>this._t?(this._t++,!0):(this.wt||(this.rt.warn("captureLog dropping logs: exceeded "+this.Tt+" logs per "+this.Mt+"ms"),this.wt=!0),!1)}flush(){var t=this;return e((function*(){if(!t._instance.isDisabled)return t.ct||(t.ct=t.Ot().finally((()=>{t.ct=null}))),t.ct}))()}Ot(){var t=this;return e((function*(){var e;t.Et();var i=null!==(e=t._instance.getPersistedProperty(ki.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,a;t.ft=0;var o=Math.min(i.length,t.Ct),l=i.slice(0,o),u=l.map((t=>t.record)),h=Fn(u,t.Ft(),null!==(s=t.vt)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.At(h);if("too-large"===d.kind&&l.length>1)t.Ct=Math.max(1,Math.floor(l.length/2)),t.rt.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.Ct);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.rt.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&t.Pe.maxBatchRecordsPerPost>t.Ct&&(t.Ct=Math.min(t.Pe.maxBatchRecordsPerPost,t.Ct+1)),yield t.Dt(l.length),i=null!==(a=t._instance.getPersistedProperty(ki.LogsQueue))&&void 0!==a?a:[],n+=l.length,"fatal"===d.kind)throw d.error}}}))()}Dt(t){var i=this;return e((function*(){var e,r=Math.max(0,t-i.ft),n=null!==(e=i._instance.getPersistedProperty(ki.LogsQueue))&&void 0!==e?e:[];i._instance.setPersistedProperty(ki.LogsQueue,n.slice(r)),yield i.dt()}))()}Ft(){return On(this.Pe,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Lt(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(ki.LogsQueue))&&void 0!==e?e:[];this.kt>i.length||(i.shift(),this.ft++,this.rt.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(ki.LogsQueue,i),this.xt>i.length?this.$t():this.It()}}$t(t){void 0===t&&(t=this.St),this.Nt||(this.Nt=Sn((()=>{this.Nt=void 0,this.It()}),t))}qt(){var t=Math.min(Math.max(0,this.yt-1),6);return this.St*Math.pow(2,t)}jt(){var t=this._instance.getPersistedProperty(ki.LogsQueue);return!!t&&t.length>0}shutdown(t){var i=this;return e((function*(){i.Et();var e=i.flush().catch((()=>{}));void 0!==t?yield Cn(e,t):yield e}))()}flushWithTimeout(t){var i=this;return e((function*(){var e=i.flush();yield Cn(e,t,(()=>{e.catch((()=>{}))}))}))()}It(){this.flush().then((()=>{this.yt=0}),(t=>{this.yt++,this.rt.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.jt()&&this.$t(this.qt())}))}Et(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}};var Dn=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function $n(t){return String(t)+"000000"}function Nn(t,e,i,r){var n="";return r&&(n=Object.keys(r).sort().map((t=>JSON.stringify(t)+":"+JSON.stringify(r[t]))).join(",")),t+"\0"+e+"\0"+(null!=i?i:"")+"\0"+n}let qn=class{constructor(t,e,i){this._instance=t,this.Pe=e,this.rt=i,this.Bt=new Map,this.ct=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Wt=0}count(t,e,i){void 0===e&&(e=1),this.Vt({name:t,type:"count",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(t,e,i){this.Vt({name:t,type:"gauge",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(t,e,i){this.Vt({name:t,type:"histogram",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var t=this,i=this.ct,r=function(){var r=e((function*(){i&&(yield i.catch((()=>{}))),yield t.Zt()}));return function(){return r.apply(this,arguments)}}(),n=r().finally((()=>{this.ct===n&&(this.ct=null)}));return this.ct=n,n}drainWindow(){if(0===this.Bt.size)return null;var t=this.Bt;return this.Bt=new Map,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Gt(t)}reset(){this.Wt++,this.Et(),this.Bt=new Map,this.ct=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set}Vt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Pt(t);if(null!==e)if(e.name&&"string"==typeof e.name)if("number"==typeof e.value&&Number.isFinite(e.value))if("count"===e.type&&0>e.value)this.rt.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var r,n;try{r=e.attributes?i({},e.attributes):void 0,n=Nn(e.type,e.name,e.unit,r)}catch(t){return void this.rt.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var s=this.Bt.get(n);if(!s){if(!this.Qt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:r,windowStartMs:Date.now()},this.Bt.set(n,s)}var a=this.Ut.get(e.name);void 0===a?this.Ut.set(e.name,e.type):a===e.type||this.zt.has(e.name)||(this.zt.add(e.name),this.rt.warn("Metric name '"+e.name+"' is already used as a "+a+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Jt(s,e.value),this.$t()}else this.rt.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.rt.warn("Dropping metric with empty name")}}Qt(){return this.Pe.maxSeriesPerFlush>this.Bt.size||(this.Ht||(this.Ht=!0,this.rt.warn("Metric series cap reached ("+this.Pe.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Jt(t,e){var i;switch(t.type){case"count":t.total=(null!==(i=t.total)&&void 0!==i?i:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(Dn.length+1).fill(0)});var r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[function(t,e){for(var i=0;e.length>i;i++)if(e[i]>=t)return i;return e.length}(e,Dn)]+=1}}Pt(t){var e=this.Pe.beforeSend;if(!e)return t;var i=Wi(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.rt.info("Metric was rejected in beforeSend function"),null;r=s}catch(t){return this.rt.error("Error in beforeSend function for metric:",t),null}return r}$t(){this.Nt||(this.Nt=Sn((()=>{this.Nt=void 0,this.flush().catch((t=>{this.rt.error("Metrics flush failed:",t)}))}),this.Pe.flushIntervalMs))}Et(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}Zt(){var t=this;return e((function*(){if(0!==t.Bt.size){var e=t.Bt;t.Bt=new Map,t.Ht=!1,t.Ut=new Map,t.zt=new Set;var i=t.Wt,r=yield t._instance.Kt(t.Gt(e));if(i===t.Wt)switch(r.kind){case"ok":return;case"retry-later":return t.Yt(e),void t.$t();case"too-large":return void t.rt.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.rt.error("Failed to send metrics batch:",r.error)}}}))()}Gt(t){return e=this.Xt(t),r=function(t,e,r){return i({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":r})}(this.Pe,this._instance.getLibraryId(),this._instance.getLibraryVersion()),n=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Rn(r)},scopeMetrics:[{scope:{name:n,version:s},metrics:e}]}]};var e,r,n,s}Xt(t){var e=$n(Date.now()),r=new Map;for(var n of t.values()){var s,a=Nn(n.type,n.name,n.unit,void 0),o=r.get(a);o||(o=i({name:n.name},n.unit&&{unit:n.unit}),"count"===n.type?o.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===n.type?o.gauge={dataPoints:[]}:o.histogram={aggregationTemporality:1,dataPoints:[]},r.set(a,o));var l=Rn(null!==(s=n.attributes)&&void 0!==s?s:{}),u=$n(n.windowStartMs);if("count"===n.type){var h,d={attributes:l,startTimeUnixNano:u,timeUnixNano:e,asDouble:null!==(h=n.total)&&void 0!==h?h:0};o.sum.dataPoints.push(d)}else if("gauge"===n.type){var v,c={attributes:l,timeUnixNano:e,asDouble:null!==(v=n.last)&&void 0!==v?v:0};o.gauge.dataPoints.push(c)}else n.hist&&o.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:e,count:n.hist.count,sum:n.hist.sum,min:n.hist.min,max:n.hist.max,bucketCounts:n.hist.bucketCounts,explicitBounds:Dn})}return Array.from(r.values())}Yt(t){var e,i;for(var r of t){var n=r[0],s=r[1],a=this.Bt.get(n);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,s.windowStartMs),a.type){case"count":a.total=(null!==(e=a.total)&&void 0!==e?e:0)+(null!==(i=s.total)&&void 0!==i?i:0);break;case"gauge":break;case"histogram":if(s.hist)if(a.hist){a.hist.count+=s.hist.count,a.hist.sum+=s.hist.sum,a.hist.min=Math.min(a.hist.min,s.hist.min),a.hist.max=Math.max(a.hist.max,s.hist.max);for(var o=0;a.hist.bucketCounts.length>o;o++)a.hist.bucketCounts[o]+=s.hist.bucketCounts[o]}else a.hist=s.hist}else this.Qt()&&this.Bt.set(n,s)}}};function jn(t,e){if(t){var i=t.find((t=>t.type===e));return null==i?void 0:i.value}}var Bn,Hn,Un;function zn(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return Un&&i.length===Hn||(Hn=i.length,Un=i.reduce(((i,r)=>{Bn||(Bn={});var n=Bn[r];if(n)i[n[0]]=n[1];else for(var s=t(r),a=s.length-1;a>=0;a--){var o=s[a],l=null==o?void 0:o.filename,u=e[r];if(l&&u){i[l]=u,Bn[r]=[l,u];break}}return i}),{})),Un}}class Wn{constructor(t,e,i){void 0===i&&(i=[]),this.coercers=t,this.stackParser=e,this.modifiers=i}buildFromUnknown(t,e){void 0===e&&(e={});var i=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(s,i),$exception_level:"error"}}modifyFrames(t){var i=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Wi(e.stacktrace.frames)&&(e.stacktrace.frames=yield i.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var r,n;return null!=t.cause&&(r=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),i({},t,{cause:r,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var i of this.coercers)if(i.match(t))return i.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var i=this;return e((function*(){var e=t;for(var r of i.modifiers)e=yield r(e);return e}))()}convertToExceptionList(t,e){var r,n,s,a={type:t.type,value:t.value,mechanism:{type:null!==(r=e.type)&&void 0!==r?r:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(a.stacktrace={type:"raw",frames:t.stack});var o=[a];return null!=t.cause&&o.push(...this.convertToExceptionList(t.cause,i({},e,{handled:!0}))),o}buildParsingContext(t){var e;return{chunkIdMap:zn(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,r){void 0===r&&(r=0);var n=(i,r)=>{if(4>=r){var n=this.buildCoercingContext(t,e,r);return this.applyCoercers(i,n)}};return i({},e,{syntheticException:0==r?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,r),next:t=>n(t,r+1)})}}var Vn="?";function Zn(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?Vn:i,in_app:!0};return Qi(r)||(s.lineno=r),Qi(n)||(s.colno=n),s}var Gn=(t,e)=>{var i=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return i||r?[-1!==t.indexOf("@")?t.split("@")[0]:Vn,i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Qn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Jn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Kn=/\((\S*)(?::(\d+))(?::(\d+))\)/,Yn=(t,e)=>{var i=Qn.exec(t);if(i)return Zn(e,i[1],Vn,+i[2],+i[3]);var r=Jn.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=Kn.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=Gn(r[1]||Vn,r[2]);return Zn(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Xn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ts=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,es=(t,e)=>{var i=Xn.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=ts.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var n=i[3],s=i[1]||Vn,a=Gn(s,n);return Zn(e,n=a[1],s=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},is=/\(error: (.*)\)/,rs=50;class ns{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Ji(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:i?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return or(t,"DOMException")}isDOMError(t){return or(t,"DOMError")}}class ss{match(t){return function(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return ur(t,Error)}}(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var i=t.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(t){return t.stacktrace||t.stack||void 0}}class as{constructor(){}match(t){return!!or(t,"ErrorEvent")&&(null!=t.error||this.fe(t))}coerce(t,e){var r;if(null!=t.error)return e.apply(t.error);var n=e.apply(t.message);return i({},n,{stack:null!==(r=this.pe(t))&&void 0!==r?r:n.stack,synthetic:!0})}fe(t){return Ji(t.message)&&t.message.length>0}pe(t){var e=t;if(Ji(e.filename)&&e.filename.length>0){var i,r,n=null!==(i=e.lineno)&&void 0!==i?i:0,s=null!==(r=e.colno)&&void 0!==r?r:0;return"Error\n at "+e.filename+":"+n+":"+s}}}var os=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class ls{match(t){return"string"==typeof t}coerce(t,e){var i,r=this.getInfos(t),n=r[0],s=r[1];return{type:null!=n?n:"Error",value:null!=s?s:t,stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(t){var e="Error",i=t,r=t.match(os);return r&&(e=r[1],i=r[2]),[e,i]}}var us=["fatal","error","warning","log","info","debug"];function hs(t,e){void 0===e&&(e=40);var i=Object.keys(t);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var n=i.slice(0,r).join(", ");if(e>=n.length)return r===i.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class ds{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var i,r,n=this.getErrorPropertyFromObject(t);return n?e.apply(n):{type:this.getType(t),value:this.getValue(t),stack:null!==(i=this.getStack(t))&&void 0!==i?i:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return lr(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var i=this.getObjectClassName(t);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+hs(t)}isSeverityLevel(t){return Ji(t)&&!Ki(t)&&us.indexOf(t)>=0}getStack(t){try{return Ji(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Ji(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var i=t[e];if(Tn(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class vs{match(t){return lr(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+hs(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class cs{match(t){return ar(t)}coerce(t,e){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class fs{match(t){return or(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!lr(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 i,r=this.getUnhandledRejectionReason(t);return ar(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){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 ps="$message",gs="$timestamp",ms=new Set([ps,gs]),ys={enabled:!0,max_bytes:32768};function bs(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:ys.enabled,max_bytes:ws(t.max_bytes,ys.max_bytes)}:i({},ys)}class _s{constructor(t){this.Je=[],this.Ke=0,this.Pe=bs(t)}setConfig(t){this.Pe=bs(t),this.Xe()}add(t){var e=function(t){var e;try{e=Bi(t)}catch(t){return}try{var i=JSON.parse(e);if(!Zi(i))return;var r=i,n=r[ps],s=r[gs];if(!Ji(n)||0===n.trim().length)return;if(!Ji(s)&&!tr(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),i=0,r=0;e.length>r;r++)"%"===e[r]?(i+=1,r+=2):i+=1;return i}(e.json);i>this.Pe.max_bytes||(this.Je.push({step:e.step,bytes:i}),this.Ke+=i,this.Xe())}}getAttachable(){return this.Je.map((t=>t.step))}clear(){this.Je=[],this.Ke=0}size(){return this.Je.length}Xe(){for(;this.Ke>this.Pe.max_bytes&&this.Je.length>0;){var t=this.Je.shift();t&&(this.Ke-=t.bytes)}}}function ws(t,e){if(!tr(t)||t===1/0||t===-1/0)return e;var i=Math.floor(t);return 0>i?e:i}var xs="undefined"!=typeof window?window:void 0,ks="undefined"!=typeof globalThis?globalThis:xs,Ss=null==ks?void 0:ks.navigator,Cs=null==ks?void 0:ks.document,Ms=null==ks?void 0:ks.location,Ts=null==ks?void 0:ks.fetch,Es=null!=ks&&ks.XMLHttpRequest&&"withCredentials"in new ks.XMLHttpRequest?ks.XMLHttpRequest:void 0,Is=null==ks?void 0:ks.AbortController,Ps=null==ks?void 0:ks.CompressionStream,Rs=null==Ss?void 0:Ss.userAgent;function Ls(){return!(!xs||!1===xs.navigator.onLine)}var Os=t=>"undefined"!=typeof Document&&t instanceof Document,Fs={DEBUG:!1,LIB_VERSION:"0.3.1",LIB_NAME:"browser-common"},As=function(t,e){var i=(void 0===e?{}:e).debugEnabled,r={k(e){if(xs&&(Fs.DEBUG||xs.POSTHOG_DEBUG||i)&&!Qi(xs.console)&&xs.console){for(var r=("__rrweb_original__"in xs.console[e]?xs.console[e].__rrweb_original__:xs.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),a=1;n>a;a++)s[a-1]=arguments[a];r(t,...s)}},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.k("error",...e)},critical(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning(t){r.error("You must initialize PostHog before calling "+t)},createLogger:(e,i)=>As(t+" "+e,i)};return r},Ds=As("[PostHog.js]"),$s=Ds.createLogger;function Ns(t,e){Wi(t)&&t.forEach(e)}function qs(t,e){if(!Xi(t))if(Wi(t))t.forEach(e);else if(rr(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)Ui.call(t,i)&&e(t[i],i)}var js=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];for(var n of i)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function Bs(t){for(var e=Object.keys(t),i=e.length,r=new Array(i);i--;)r[i]=[e[i],t[e[i]]];return r}var Hs=function(t){try{return t()}catch(t){return}},Us=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){Ds.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Ds.critical(t)}}},zs=function(t){var e={};return qs(t,(function(t,i){(Ji(t)&&t.length>0||tr(t))&&(e[i]=t)})),e};var Ws=["herokuapp.com","vercel.app","netlify.app"];function Vs(t){var e=null==t?void 0:t.hostname;if(!Ji(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Ws)if(i===r)return!1;return!0}function Zs(t,e,i,r){var n=null!=r?r:{},s=n.capture,a=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===a||a})}function Gs(t){return"ph_toolbar_internal"===t.name}var Qs=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return Bi(t)}},Js=t=>{var e=null==Cs?void 0:Cs.createElement("a");return Qi(e)?null:(e.href=t,e)},Ks=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return qs(t,(function(t,e){Qi(t)||Qi(e)||"undefined"===e||(i=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(e),n[n.length]=r+"="+i)})),n.join(e)},Ys=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;r.length>n;n++){var s=r[n].split("=");if(s[0]===e){i=s;break}}if(!Wi(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(t){Ds.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Xs=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),a=s[1],o=s[0],l=(a||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");Wi(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=o;return null!=a&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},ta=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},ea=(t,e)=>t>=e&&Ls(),ia=(t,e,i,r)=>{if(0===t){if(Ls()){var n=e+1;return n===i&&r(),n}return e}return 0},ra=()=>{};function na(t,e,i){try{if(!(e in t))return ra;var r={next:t[e]},n=i((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return r.next.apply(this,e)}));return Vi(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=n,()=>{if(t[e]!==n)for(var i=t[e];Vi(i)&&i.__posthog_layer__;){var s=i.__posthog_layer__;if(s.next===n)return void(s.next=r.next);i=s.next}else t[e]=r.next}}catch(t){return ra}}function sa(t,e){var i,r=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:r,isHostDenied:!1};if(null==(i=e.payloadHostDenyList)||!i.length||null==r||!r.trim().length)return n;for(var s of e.payloadHostDenyList)if(r.endsWith(s))return{hostname:r,isHostDenied:!0};return n}function aa(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Vi(r))return e;try{var n=r(e);return Ji(n)&&n?n:e}catch(t){return Ds.error("Error in get_current_url, falling back to window.location.href",t),e}}function oa(t){var e,i=null==xs||null==(e=xs.location)?void 0:e.href;return Qi(i)?void 0:aa(t,i)}var la="__POSTHOG_TOOLBAR__",ua=1,ha=3,da=11;function va(t){return t instanceof Element&&(t.id===la||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function ca(t){return!!t&&t.nodeType===ua}function fa(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function pa(t){return!!t&&t.nodeType===ha}function ga(t){return!!t&&t.nodeType===da&&ca(t.host)}var ma=1e3;function ya(t){return t?qi(t).split(/\s+/):[]}function ba(t,e){var i=oa(e);return!!(i&&t&&t.some((t=>i.match(t))))}function _a(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 ya(e)}function wa(t){return Xi(t)?null:qi(t).split(/(\s+)/).filter((t=>Va(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function xa(t){var e="";return $a(t)&&!Na(t)&&t.childNodes&&t.childNodes.length&&qs(t.childNodes,(function(t){var i;pa(t)&&t.textContent&&(e+=null!==(i=wa(t.textContent))&&void 0!==i?i:"")})),qi(e)}function ka(t){var e;return Qi(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var Sa=["a","button","form","input","select","textarea","label"];function Ca(t,e){if(Qi(e))return!0;var i,r=function(t){if(e.some((e=>function(t,e){var i=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!i&&i.call(t,e)}catch(t){return!1}}(t,e))))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function Ma(t){var e=t.parentNode;return!(!e||!ca(e))&&e}var Ta=[".ph-no-autocapture","[data-ph-no-autocapture]"],Ea=["next","previous","prev",">","<"],Ia=[...Ea,"+","-","−","–"],Pa=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,Ra=[".ph-no-deadclick",".ph-no-capture"],La=[".ph-no-rageclick",".ph-no-capture"],Oa=["","text","search","email","password","url","tel","number"];function Fa(t,e){if(!xs||Aa(t))return!1;var i,r,n,s,a;if(ir(e)?(i=!!e&&La,r=void 0,n=!1):(i=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:La,r=null==e?void 0:e.content_ignorelist,n=null!==(a=null==e?void 0:e.ignore_text_selection)&&void 0!==a&&a),!1===i)return!1;if(n&&function(t){return!(!t||!ca(t))&&(!!fa(t,"textarea")||(fa(t,"input")?Ni(Oa,(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 o=Da(t,!1).targetElementList;return!function(t,e){if(!1===t||Qi(t))return!1;var i;if(!0===t)i=Ea;else{if(!Wi(t))return!1;if(t.length>10)return Ds.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=t.map((t=>t.toLowerCase()))}return e.some((t=>{var e=t.safeText,r=t.ariaLabel;return i.some((t=>Pa(e,t)||Pa(r,t)))}))}(r,o.map((t=>{var e;return{safeText:xa(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Ca(o,i)}var Aa=t=>!t||fa(t,"html")||!ca(t),Da=(t,e)=>{if(!xs||Aa(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[t],n=t;n.parentNode&&!fa(n,"body");)if(ga(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var s=Ma(n);if(!s)break;if(e||Sa.indexOf(s.tagName.toLowerCase())>-1)i=!0;else try{var a=xs.getComputedStyle(s);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(s),n=s}return{parentIsUsefulElement:i,targetElementList:r}};function $a(t){for(var e=new Set,i=0,r=t;r.parentNode&&!fa(r,"body");r=r.parentNode){if(i++>=ma||e.has(r))return!1;e.add(r);var n=_a(r);if(Ni(n,"ph-sensitive")||Ni(n,"ph-no-capture"))return!1}if(Ni(_a(t),"ph-include"))return!0;var s=t.type||"";if(Ji(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!Ji(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function Na(t){return!!(fa(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||fa(t,"select")||fa(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var qa=new RegExp("^(?:(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}))$"),ja=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Ba=[16,15,14,13],Ha=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Ua=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),za=/[0-9A-Za-z_]/;function Wa(t){for(var e=0,i=!1,r=t.length-1;r>=0;r--){var n=t.charCodeAt(r)-48;i&&(n*=2)>9&&(n-=9),e+=n,i=!i}return e%10==0}function Va(t,e){if(void 0===e&&(e=!0),Xi(t))return!1;if(Ji(t)){t=qi(t);var i=e?qa.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(ja.lastIndex=0;e=ja.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Ba){var a=n+s;if(r.length>=a){var o=r.slice(n,a);if(qa.test(o)&&Wa(o))return!0}}}return!1}(t);if(i)return!1;var r=e?Ha.test(t):function(t){var e;for(Ua.lastIndex=0;e=Ua.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&za.test(i)&&za.test(r)))return!0}return!1}(t);if(r)return!1}return!0}function Za(t){var e=xa(t);return Va(e=(e+" "+Ga(t)).trim())?e:""}function Ga(t){var e="";return t&&t.childNodes&&t.childNodes.length&&qs(t.childNodes,(function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=xa(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Ga(t)).trim())}catch(t){Ds.error("[AutoCapture]",t)}})),e}function Qa(t){return t.replace(/"|\\"/g,'\\"')}function Ja(t){var e=t.attr__class;if(e)return Wi(e)?e:ya(e)}var Ka=1e6,Ya={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Ka,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},Xa=$s("[Recorder]"),to=t=>"navigation"===t.entryType,eo=t=>"resource"===t.entryType;function io(t,e){return!!e&&(ir(e)||e[t])}function ro(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var no=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function so(t){var e=t.type,i=t.recordBody,r=t.headers;function n(t){var e=Object.keys(r).find((t=>"content-type"===t.toLowerCase())),i=e&&r[e];return t.some((t=>null==i?void 0:i.toLowerCase().includes(t)))}if(!i)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!ro(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(no))return!1;if(ir(i))return!0;if(Wi(i))return n(i);var s=i[e];return ir(s)?s:n(s)}function ao(t,e,i,r,n,s){return oo.apply(this,arguments)}function oo(){return oo=e((function*(t,e,i,r,n,s){if(void 0===s&&(s=0),s>10)return Xa.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null;var a=function(t,i){for(var s=t.length-1;s>=0;s-=1)if(eo(a=t[s])&&a.initiatorType===e&&(Qi(r)||a.startTime>=r)&&(Qi(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(i));return a||(yield new Promise((t=>setTimeout(t,50*s))),ao(t,e,i,r,n,s+1))})),oo.apply(this,arguments)}function lo(t){var e=t.body,i=t.options,r=t.url;if(Xi(e))return null;var n=sa(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Ji(e))return e;if(Os(e))return e.textContent;if(rr(e))return Ks(e);if(Zi(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 uo=t=>!Yi(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ho(t){var e=t.entry,r=t.method,n=t.status,s=t.networkRequest,a=t.isInitial,o=t.start,l=t.end,u=t.url,h=t.initiatorType;o=e?e.startTime:o,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),v=Math.floor(d+(o||0)),c=[i({},e?e.toJSON():{name:u},{startTime:Qi(o)?void 0:Math.round(o),endTime:Qi(l)?void 0:Math.round(l),timeOrigin:d,timestamp:v,method:r,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:a})];if(uo(e))for(var f of e.serverTiming||[])c.push({timeOrigin:d,timestamp:v,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return c}var vo=["video/","audio/"];function co(t){return Zi(t)&&Vi(t.getReader)&&Vi(t.tee)}var fo=500,po="[SessionReplay] Timeout while trying to read body",go="[SessionReplay] Failed to read body";function mo(t){return go+": "+t}function yo(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function bo(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var i=setTimeout((()=>e(po)),fo);try{t.clone().text().then((t=>e(t)),(t=>e(mo(t)))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e(go)}}))}(t);var i=function(t){var e;return Math.min(Ka,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Ka)}(e);return function(t,e){try{var i,r=null==(i=t.headers)||null==i.get?void 0:i.get("content-length");if(!r)return!1;var n=parseInt(r,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,i)?Promise.resolve(yo(i)):function(t,e){return new Promise((i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel()}catch(t){}}function a(t){n||(n=!0,clearTimeout(l),s(),i(t))}var o,l=setTimeout((()=>a(po)),fo);try{o=t.clone()}catch(t){return void a(go)}var u=o.body;if(co(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void a(go)}var h=[],d=0;!function t(){r.read().then((i=>{var r=i.done,o=i.value;if(n)s();else if(r)a((new TextDecoder).decode(function(t,e){var i=new Uint8Array(e),r=0;for(var n of t)i.set(n,r),r+=n.byteLength;return i}(h,d)));else{if(o){if(d+o.byteLength>e)return void a(yo(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(mo(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(mo(t))))}catch(t){a(go)}}))}(t,i)}function _o(){return _o=e((function*(t){var e=t.r,i=t.options,r=sa(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):bo(e,i)})),_o.apply(this,arguments)}function wo(){return wo=e((function*(t){var e=t.r,i=t.options,r=function(t){var e,i=t.r,r=t.options,n=t.url;if("chunked"===i.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=i.headers.get("Content-Type"))?void 0:e.toLowerCase(),a=vo.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=sa(n,r);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return Yi(r)?bo(e,i):Promise.resolve(r)})),wo.apply(this,arguments)}var xo=null;function ko(t,r,n){if(!("performance"in r))return()=>{};if(xo)return Xa.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Ya,n):Ya,a=e=>{var r=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var i=s.maskRequestFn(t);e||(n=!i),i&&r.push(i)}})),r.length>0&&t(i({},e,{requests:r}))},o=function(t,e,i){if(i.recordInitialRequests){var r=e.performance.getEntries().filter((t=>to(t)||eo(t)&&i.initiatorTypes.includes(t.initiatorType)));t({requests:r.flatMap((t=>ho({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var r=e.getEntries().filter((t=>to(t)||eo(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:r.flatMap((t=>ho({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>i.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(a,r,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=io("request",i.recordHeaders),n=io("response",i.recordHeaders),s=na(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(o),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),r&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(so({type:"request",headers:g,url:o,recordBody:i.recordBody})&&(p.requestBody=lo({body:t,options:i,url:o})),v=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",_),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},_=()=>{if(d.readyState===d.DONE){b(),c=e.performance.now();var r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),i=e.shift(),n=e.join(": ");i&&(r[i]=n)})),n&&(p.responseHeaders=r),so({type:"response",headers:r,url:o,recordBody:i.recordBody})&&(p.responseBody=lo({body:d.response,options:i,url:o})),ao(e,"xmlhttprequest",f.url,v,c).then((e=>{var i=ho({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:i})})).catch((()=>{}))}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){Xa.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),l,u,h)}));return()=>{s()}}(a,r,s),u=function(t,i,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var n=io("request",r.recordHeaders),s=io("response",r.recordHeaders),a=na(i,"fetch",(a=>function(){var o=e((function*(e,o){var l,u;try{l=new Request(e,o)}catch(t){return Xa.error("Failed to instrument fetch for network capture",t),a(e,o)}var h,d,v={};try{try{var c={};l.headers.forEach(((t,e)=>{c[e]=t})),n&&(v.requestHeaders=c),!co(null==o?void 0:o.body)&&so({type:"request",headers:c,url:e,recordBody:r.recordBody})&&(v.requestBody=yield function(t){return _o.apply(this,arguments)}({r:l,options:r,url:e}))}catch(t){Xa.error("Failed to record fetch request for network capture",t)}h=i.performance.now(),u=ro(e)?yield a(l):yield a(e,o),d=i.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),s&&(v.responseHeaders=f),so({type:"response",headers:f,url:e,recordBody:r.recordBody})&&(v.responseBody=yield function(t){return wo.apply(this,arguments)}({r:u,options:r,url:e})),u}finally{ao(i,"fetch",l.url,h,d).then((e=>{var i,r=ho({entry:e,method:l.method,status:null==(i=u)?void 0:i.status,networkRequest:v,start:h,end:d,url:l.url,initiatorType:"fetch"});t({requests:r})})).catch((()=>{}))}}));return function(t,e){return o.apply(this,arguments)}}()));return()=>{a()}}(a,r,s)),xo=()=>{o(),l(),u(),xo=null}}var So=t=>({name:"rrweb/network@1",observer:ko,options:t}),Co="undefined"!=typeof globalThis?globalThis:xs;Co&&"undefined"==typeof self&&(Co.self=Co),Co&&"undefined"==typeof File&&(Co.File=function(){});var Mo=null!=xs?xs:{};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:mi,getRecordNetworkPlugin:So},Mo.__PosthogExtensions__.rrweb={record:ii,version:"v2",wasMaxDepthReached:()=>Pt,resetMaxDepthState(){Pt=!1,It=!1},getLastSnapshotCost:()=>L,getMutationCost:()=>i({},A),resetSnapshotCostState(){I=0,P=0,R=T(),L=null,O=null,F=[],A={slowestBatchMs:0}}},Mo.rrweb={record:ii,version:"v2"},Mo.rrwebConsoleRecord={getRecordConsolePlugin:mi},Mo.getRecordNetworkPlugin=So;var To,Eo,Io,Po,Ro,Lo,Oo,Fo,Ao,Do,$o,No,qo,jo,Bo,Ho={},Uo=[],zo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Wo=Array.isArray;function Vo(t,e){for(var i in e)t[i]=e[i];return t}function Zo(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Go(t,e,i){var r,n,s,a={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?To.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return Qo(t,a,r,n,null)}function Qo(t,e,i,r,n){var s={type:t,props:e,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Io:n,__i:-1,__u:0};return null==n&&null!=Eo.vnode&&Eo.vnode(s),s}function Jo(t){return t.children}function Ko(t,e){this.props=t,this.context=e}function Yo(t,e){if(null==e)return t.__?Yo(t.__,t.__i+1):null;for(var i;t.__k.length>e;e++)if(null!=(i=t.__k[e])&&null!=i.__e)return i.__e;return"function"==typeof t.type?Yo(t):null}function Xo(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Vo({},e);s.__v=e.__v+1,Eo.vnode&&Eo.vnode(s),ul(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?Yo(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,dl(r,s,n),e.__e=e.__=null,s.__e!=i&&tl(s)}}function tl(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some((function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e})),tl(t)}function el(t){(!t.__d&&(t.__d=!0)&&Po.push(t)&&!il.__r++||Ro!=Eo.debounceRendering)&&((Ro=Eo.debounceRendering)||Lo)(il)}function il(){try{for(var t,e=1;Po.length;)Po.length>e&&Po.sort(Oo),t=Po.shift(),e=Po.length,Xo(t)}finally{Po.length=il.__r=0}}function rl(t,e,i,r,n,s,a,o,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||Uo,b=e.length;for(l=function(t,e,i,r,n){var s,a,o,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(a=e[s])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=t.__k[s]=Qo(null,a,null,null,null):Wo(a)?a=t.__k[s]=Qo(Jo,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=t.__k[s]=Qo(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[s]=a,l=s+v,a.__=t,a.__b=t.__b+1,o=null,-1!=(u=a.__i=sl(a,i,l,d))&&(d--,(o=i[u])&&(o.__u|=2)),null==o||null==o.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof a.type&&(a.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,a.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(o=i[s])&&0==(2&o.__u)&&(o.__e==r&&(r=Yo(o)),fl(o,o));return r}(i,e,y,l,b),d=0;b>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||Ho,c.__i=d,g=ul(t,c,v,n,s,a,o,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&cl(v.ref,null,c),h.push(c.ref,c.__c||f,c)),null==p&&null!=f&&(p=f),(m=!!(4&c.__u))||v.__k===c.__k?(l=nl(c,l,t,m),m&&v.__e&&(v.__e=null)):"function"==typeof c.type&&void 0!==g?l=g:f&&(l=f.nextSibling),c.__u&=-7);return i.__e=p,l}function nl(t,e,i,r){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=nl(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Yo(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function sl(t,e,i,r){var n,s,a,o=t.key,l=t.type,u=e[i],h=null!=u&&0==(2&u.__u);if(null===u&&null==o||h&&o==u.key&&l==u.type)return i;if(r>(h?1:0))for(n=i-1,s=i+1;n>=0||e.length>s;)if(null!=(u=e[a=0>n?s++:n--])&&0==(2&u.__u)&&o==u.key&&l==u.type)return a;return-1}function al(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||zo.test(e)?i:i+"px"}function ol(t,e,i,r,n){var s,a;t:if("style"==e)if("string"==typeof i)t.style.cssText=i;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)i&&e in i||al(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||al(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace($o,"$1")),a=e.toLowerCase(),e=a in t||"onFocusOut"==e||"onFocusIn"==e?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[Do]=r[Do]:(i[Do]=No,t.addEventListener(e,s?jo:qo,s)):t.removeEventListener(e,s?jo:qo,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==i?"":i;break t}catch(t){}"function"==typeof i||(null==i||!1===i&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==i?"":i))}}function ll(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[Ao])e[Ao]=No++;else if(i[Do]>e[Ao])return;return i(Eo.event?Eo.event(e):e)}}}function ul(t,e,i,r,n,s,a,o,l,u){var h,d,v,c,f,p,g,m,y,b,$,_,w,x,k,S,C=e.type;if(void 0!==e.constructor)return null;128&i.__u&&(l=!!(32&i.__u),s=[o=e.__e=i.__e]),(h=Eo.__b)&&h(e);t:if("function"==typeof C){d=a.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&r[h.__c],_=h?$?$.props.value:h.__:r,i.__c?m=(v=e.__c=i.__c).__=v.__E:(b?e.__c=v=new C(y,_):(e.__c=v=new Ko(y,_),v.constructor=C,v.render=pl),$&&$.sub(v),v.state||(v.state={}),v.__n=r,c=v.__d=!0,v.__h=[],v._sb=[]),b&&null==v.__s&&(v.__s=v.state),b&&null!=C.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=Vo({},v.__s)),Vo(v.__s,C.getDerivedStateFromProps(y,v.__s))),f=v.props,p=v.state,v.__v=e,c)b&&null==C.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),b&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(y,_),e.__v==i.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(y,v.__s,_)){e.__v!=i.__v&&(v.props=y,v.state=v.__s,v.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some((function(t){t&&(t.__=e)})),Uo.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&a.push(v);break t}null!=v.componentWillUpdate&&v.componentWillUpdate(y,v.__s,_),b&&null!=v.componentDidUpdate&&v.__h.push((function(){v.componentDidUpdate(f,p,g)}))}if(v.context=_,v.props=y,v.__P=t,v.__e=!1,w=Eo.__r,x=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),Uo.push.apply(v.__h,v._sb),v._sb=[];else do{v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),v.state=v.__s}while(v.__d&&25>++x);v.state=v.__s,null!=v.getChildContext&&(r=Vo(Vo({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),k=null!=h&&h.type===Jo&&null==h.key?vl(h.props.children):h,o=rl(t,Wo(k)?k:[k],e,i,r,n,s,a,o,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&a.push(v),m&&(v.__E=v.__=null)}catch(t){if(a.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;null!=s&&(s[s.indexOf(o)]=null),e.__e=o}else{if(null!=s)for(S=s.length;S--;)Zo(s[S]);hl(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||hl(e);Eo.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):o=e.__e=function(t,e,i,r,n,s,a,o,l){var u,h,d,v,c,f,p,g=i.props||Ho,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(u=0;s.length>u;u++)if((c=s[u])&&"setAttribute"in c==!!y&&(y?c.localName==y:3==c.nodeType)){t=c,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),o&&(Eo.__m&&Eo.__m(e,s),o=!1),s=null}if(null==y)g===m||o&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&To.call(t.childNodes),!o&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(c=t.attributes[u]).name]=c.value;for(u in g)c=g[u],"dangerouslySetInnerHTML"==u?d=c:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||ol(t,u,null,c,n);for(u in m)c=m[u],"children"==u?v=c:"dangerouslySetInnerHTML"==u?h=c:"value"==u?f=c:"checked"==u?p=c:o&&"function"!=typeof c||g[u]===c||ol(t,u,c,g[u],n);if(h)o||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),rl("template"==e.type?t.content:t,Wo(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,a,s?s[0]:i.__k&&Yo(i,0),o,l),null!=s)for(u=s.length;u--;)Zo(s[u]);o&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&ol(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&ol(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,a,l,u);return(h=Eo.diffed)&&h(e),128&e.__u?void 0:o}function hl(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(hl))}function dl(t,e,i){for(var r=0;i.length>r;r++)cl(i[r],i[++r],i[++r]);Eo.__c&&Eo.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Eo.__e(t,e.__v)}}))}function vl(t){return"object"!=typeof t||null==t||t.__b>0?t:Wo(t)?t.map(vl):void 0!==t.constructor?null:Vo({},t)}function cl(t,e,i){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==e||(t.__u=t(e))}else t.current=e}catch(t){Eo.__e(t,i)}}function fl(t,e,i){var r,n;if(Eo.unmount&&Eo.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||cl(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){Eo.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&fl(r[n],e,i||"function"!=typeof t.type);i||Zo(t.__e),t.__c=t.__=t.__e=void 0}function pl(t,e,i){return this.constructor(t,i)}function gl(t,e,i){var r,n,s;e==document&&(e=document.documentElement),Eo.__&&Eo.__(t,e),r=e.__k,n=[],s=[],ul(e,t=e.__k=Go(Jo,null,[t]),r||Ho,Ho,e.namespaceURI,r?null:e.firstChild?To.call(e.childNodes):null,n,r?r.__e:e.firstChild,!1,s),dl(n,t,s),t.props.children=null}To=Uo.slice,Eo={__e(t,e,i,r){for(var n,s,a;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),a=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),a=n.__d),a)return n.__E=n}catch(e){t=e}throw t}},Io=0,Ko.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Vo({},this.state),"function"==typeof t&&(t=t(Vo({},i),this.props)),t&&Vo(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),el(this))},Ko.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),el(this))},Ko.prototype.render=Jo,Po=[],Lo="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Oo=function(t,e){return t.__v.__b-e.__v.__b},il.__r=0,Fo=Math.random().toString(8),Ao="__d"+Fo,Do="__a"+Fo,$o=/(PointerCapture)$|Capture$/i,No=0,qo=ll(!1),jo=ll(!0),Bo=0;var ml,yl,bl,_l,wl=0,xl=[],kl=Eo,Sl=kl.__b,Cl=kl.__r,Ml=kl.diffed,Tl=kl.__c,El=kl.unmount,Il=kl.__;function Pl(t,e){kl.__h&&kl.__h(yl,t,wl||e),wl=0;var i=yl.__H||(yl.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Rl(t){return wl=1,function(t,e,i){var r=Pl(ml++,2);if(r.t=t,!r.__c&&(r.__=[Hl(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],i=r.t(e,t);e!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=yl,!yl.__f)){var n=function(t,e,i){if(!r.__c.__H)return!0;var n=!1,a=r.__c.props!==t;if(r.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}})),s){var o=s.call(this,t,e,i);return n?o||a:o}return!n||a};yl.__f=!0;var s=yl.shouldComponentUpdate,a=yl.componentWillUpdate;yl.componentWillUpdate=function(t,e,i){if(this.__e){var r=s;s=void 0,n(t,e,i),s=r}a&&a.call(this,t,e,i)},yl.shouldComponentUpdate=n}return r.__N||r.__}(Hl,t)}function Ll(t,e){var i=Pl(ml++,3);!kl.__s&&Bl(i.__H,e)&&(i.__=t,i.u=e,yl.__H.__h.push(i))}function Ol(t){return wl=5,Fl((function(){return{current:t}}),[])}function Fl(t,e){var i=Pl(ml++,7);return Bl(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function Al(t){var e=yl.context[t.__c],i=Pl(ml++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(yl)),e.props.value):t.__}function Dl(){for(var t;t=xl.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(ql),e.__h.some(jl),e.__h=[]}catch(i){e.__h=[],kl.__e(i,t.__v)}}}kl.__b=function(t){yl=null,Sl&&Sl(t)},kl.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Il&&Il(t,e)},kl.__r=function(t){Cl&&Cl(t),ml=0;var e=(yl=t.__c).__H;e&&(bl===yl?(e.__h=[],yl.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&Dl(),ml=0)),bl=yl},kl.diffed=function(t){Ml&&Ml(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==xl.push(e)&&_l===kl.requestAnimationFrame||((_l=kl.requestAnimationFrame)||Nl)(Dl)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),bl=yl=null},kl.__c=function(t,e){e.some((function(t){try{t.__h.some(ql),t.__h=t.__h.filter((function(t){return!t.__||jl(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],kl.__e(i,t.__v)}})),Tl&&Tl(t,e)},kl.unmount=function(t){El&&El(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some((function(t){try{ql(t)}catch(t){e=t}})),i.__H=void 0,e&&kl.__e(e,i.__v))};var $l="function"==typeof requestAnimationFrame;function Nl(t){var e,i=function(){clearTimeout(r),$l&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);$l&&(e=requestAnimationFrame(i))}function ql(t){var e=yl,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),yl=e}function jl(t){var e=yl;t.__c=t.__(),yl=e}function Bl(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function Hl(t,e){return"function"==typeof e?e(t):e}function Ul(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Vi(i.then)&&i.then(void 0,(()=>{}))}}}}var zl="gzip-js",Wl="base64",Vl="events",Zl="cancelEvents",Gl={Tab:"tab",Selector:"selector"},Ql={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Jl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Kl={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Yl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Xl={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},tu="always",eu={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},iu={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},ru="popover";function nu(t){return"$survey_response_"+t}function su(t,e){if(!e)return null;var i=t[nu(e)];return Wi(i)?[...i]:i}function au(t,e){void 0===t&&(t={});var r={};return e.questions.forEach((e=>{if(!Qi(e.originalQuestionIndex)){var i,n=0===(i=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,s=su(t,e.id);Qi(s)||(r[n]=s)}})),i({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:su(t,e.id)})))},t,r)}function ou(t,e){var i="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(i="$survey_"+e+"/"+t.id+"/"+t.current_iteration),i}function lu(t){return"string"==typeof t&&t.trim()?t.trim():null}function uu(t){return t.toLowerCase()}function hu(t,e,i){if(!t||!e)return null;var r=uu(e),n=Object.keys(t).find((t=>uu(t)===r));if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],a=Object.keys(t).find((t=>uu(t)===s));if(a)return null==i||i.debug("Found base language translation match: "+a+" (from "+e+")"),a}return null}function du(t,e,r){var n,s=hu(t.translations,e,r),a=i({},t),o=!1;if(s){var l,u=null==(l=t.translations)?void 0:l[s];u&&(null==r||r.info("Applying survey-level translation for language: "+s),Qi(u.name)||(a.name=u.name,o=!0),a.appearance?(a.appearance=i({},a.appearance),Qi(u.thankYouMessageHeader)||(a.appearance.thankYouMessageHeader=u.thankYouMessageHeader,o=!0),Qi(u.thankYouMessageDescription)||(a.appearance.thankYouMessageDescription=u.thankYouMessageDescription,o=!0),Qi(u.thankYouMessageCloseButtonText)||(a.appearance.thankYouMessageCloseButtonText=u.thankYouMessageCloseButtonText,o=!0),Qi(u.submitButtonText)||(a.appearance.submitButtonText=u.submitButtonText,o=!0),Qi(u.backButtonText)||(a.appearance.backButtonText=u.backButtonText,o=!0)):function(t){return!(Qi(t.thankYouMessageHeader)&&Qi(t.thankYouMessageDescription)&&Qi(t.thankYouMessageCloseButtonText)&&Qi(t.submitButtonText)&&Qi(t.backButtonText))}(u)&&(o=!0))}var h=t.questions.map((t=>function(t,e,r){var n,s=hu(t.translations,e,r);if(!s)return{question:t,matchedKey:null,hasChanges:!1};var a=null==(n=t.translations)?void 0:n[s];if(!a)return{question:t,matchedKey:null,hasChanges:!1};var o=i({},t),l=!1;return Qi(a.question)||(o.question=a.question,l=!0),Qi(a.description)||(o.description=a.description,l=!0),Qi(a.buttonText)||(o.buttonText=a.buttonText,l=!0),"link"in o&&!Qi(a.link)&&(o.link=a.link,l=!0),"lowerBoundLabel"in o&&!Qi(a.lowerBoundLabel)&&(o.lowerBoundLabel=a.lowerBoundLabel,l=!0),"upperBoundLabel"in o&&!Qi(a.upperBoundLabel)&&(o.upperBoundLabel=a.upperBoundLabel,l=!0),"choices"in o&&function(t){return Wi(t.choices)}(a)&&(o.choices=a.choices,l=!0),{question:l?o:t,matchedKey:l?s:null,hasChanges:l}}(t,e,r))),d=h.map((t=>t.question)),v=h.some((t=>t.hasChanges)),c=null;return s||(c=(null==(n=h.find((t=>t.matchedKey)))?void 0:n.matchedKey)||null),v&&(a.questions=d,o=!0,null==r||r.info("Applied question-level translations for language: "+e)),{survey:a,matchedKey:o?s||c:null}}function vu(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function cu(t){var e;return vu(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var fu=$s("[Surveys]");function pu(t){return!(!t.start_date||t.end_date)}function gu(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var mu="seenSurvey_",yu="inProgressSurvey_",bu=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),_u=t=>bu(mu,t),wu=t=>{try{var e=_u(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){fu.error("Failed to persist survey seen state",t)}},xu=[Kl.Popover,Kl.Widget,Kl.API],ku={ignoreConditions:!1,ignoreDelay:!1,displayType:ru},Su="$people_distinct_id",Cu="$device_id",Mu="$device_model",Tu="__alias",Eu="__timers",Iu="$autocapture_disabled_server_side",Pu="$heatmaps_enabled_server_side",Ru="$exception_capture_enabled_server_side",Lu="$error_tracking_suppression_rules",Ou="$error_tracking_capture_extension_exceptions",Fu="$web_vitals_enabled_server_side",Au="$dead_clicks_enabled_server_side",Du="$product_tours_enabled_server_side",$u="$web_vitals_allowed_metrics",Nu="$session_recording_remote_config",qu="$replay_sample_rate",ju="$replay_override_sampling",Bu="$replay_override_linked_flag",Hu="$replay_override_url_trigger",Uu="$replay_override_event_trigger",zu="$sesid",Wu="$session_is_sampled",Vu="$enabled_feature_flags",Zu="$active_feature_flags",Gu="$early_access_features",Qu="$feature_flag_details",Ju="$feature_flag_payloads",Ku="$feature_flag_request_id",Yu="$minimal_flag_called_events",Xu="$override_feature_flags",th="$override_feature_flag_payloads",eh="$stored_person_properties",ih="$stored_group_properties",rh="$surveys",nh="$surveys_loaded_at",sh="$surveys_activated",ah="$surveys_activated_session",oh="$surveys_activated_timestamps",lh="ph_product_tours",uh="$flag_call_reported",hh="$flag_call_reported_session_id",dh="$feature_flag_errors",vh="$feature_flag_evaluated_at",ch="$user_state",fh="$client_session_props",ph="$capture_rate_limit",gh="$initial_campaign_params",mh="$initial_referrer_info",yh="$initial_person_info",bh="$epp",_h="$posthog_cookieless",wh="$cookieless_mode",xh="$sdk_debug_extensions_init_method",kh="$sdk_debug_extensions_init_time_ms",Sh="$sdk_debug_recording_script_not_loaded",Ch="PostHog loadExternalDependency extension not found.",Mh="on_reject",Th="always",Eh="anonymous",Ih="identified",Ph="identified_only",Rh="visibilitychange",Lh="beforeunload",Oh="$pageview",Fh="$pageleave",Ah="$identify",Dh="$groupidentify";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return tr(t)&&isFinite(t)&&Math.floor(t)===t});class $h{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,i,r){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>e||0>i||0>r||t>0xffffffffffff||e>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new $h(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 $h(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}}class Nh{generate(){var t=this.generateOrAbort();if(!Qi(t))return t;this.S=0;var e=this.generateOrAbort();if(Qi(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.S)this.S=t,this.C();else{if(this.S>=t+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return $h.fromFieldsV7(this.S,Math.trunc(this.I/Math.pow(2,30)),this.I&Math.pow(2,30)-1,this.R.nextUint32())}C(){this.I=1024*this.R.nextUint32()+(1023&this.R.nextUint32())}constructor(){this.S=0,this.I=0,this.R=new Bh}}var qh,jh=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};xs&&!Qi(xs.crypto)&&crypto.getRandomValues&&(jh=t=>crypto.getRandomValues(t));class Bh{nextUint32(){return this.O.length>this.N||(jh(this.O),this.N=0),this.O[this.N++]}constructor(){this.O=new Uint32Array(8),this.N=1/0}}var Hh=()=>Uh().toString(),Uh=()=>(qh||(qh=new Nh)).generate(),zh=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 Wh(t,e,i){return Qs({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var Vh={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=>zh(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!zh(e,t))))),icontains:(t,e)=>e.map(Zh).some((e=>t.map(Zh).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Zh).every((e=>t.map(Zh).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i<parseFloat(t)))}))},Zh=t=>t.toLowerCase();function Gh(t,e){return!t||Object.entries(t).every((t=>{var i=t[1],r=null==e?void 0:e[t[0]];if(Qi(r)||Yi(r))return!1;var n=[String(r)],s=Vh[i.operator];return!!s&&s(i.values,n)}))}var Qh=t=>{if(Cs){try{for(var e=t+"=",i=Cs.cookie.split(";").filter((t=>t.length)),r=0;i.length>r;r++){for(var n=i[r];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},Jh="",Kh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Yh={P:()=>!!Cs,j(t){Ds.error("cookieStore error: "+t)},q:Qh,H(t){var e;try{e=JSON.parse(Yh.q(t))||{}}catch(t){}return e},A(t,e,i,r,n){if(!Cs)return!1;try{var s="",a="",o=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=Cs),Jh)return Jh;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),r=Math.min(i.length,8),n="dmn_chk_"+Hh();!Jh&&r--;){var s=i.slice(r).join("."),a=n+"=1;domain=."+s+";path=/";e.cookie=a+";max-age=3",e.cookie.includes(n)&&(e.cookie=a+";max-age=0",Jh=s)}return Jh}(t);if(!i){var r=(t=>{var e=t.match(Kh);return e?e[0]:""})(t);r!==i&&Ds.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(Cs.location.hostname,r);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),s="; expires="+l.toUTCString()}n&&(a="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+o+a;return u.length>3686.4&&Ds.warn("cookieStore warning: large cookie, len="+u.length),Cs.cookie=u,!0}catch(t){return!1}},F(t,e){if(null!=Cs&&Cs.cookie)try{Yh.A(t,"",-1,e)}catch(t){return}}},Xh=null,td={P(){if(!Yi(Xh))return Xh;var t=!0;if(Qi(xs))t=!1;else try{var e="__mplssupport__";td.A(e,"xyz"),'"xyz"'!==td.q(e)&&(t=!1),td.F(e)}catch(e){t=!1}return t||Ds.error("localStorage unsupported; falling back to cookie store"),Xh=t,t},j(t){Ds.error("localStorage error: "+t)},q(t){try{return null==xs?void 0:xs.localStorage.getItem(t)}catch(t){td.j(t)}return null},H(t){try{return JSON.parse(td.q(t))||{}}catch(t){}return null},A(t,e){try{return null==xs||xs.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){td.j(t)}return!1},F(t){try{null==xs||xs.localStorage.removeItem(t)}catch(t){td.j(t)}}},ed=[Cu,"distinct_id",zu,Wu,bh,yh,ch],id={},rd={P:()=>!0,j(t){Ds.error("memoryStorage error: "+t)},q:t=>id[t]||null,H:t=>id[t]||null,A:(t,e)=>(id[t]=e,!0),F(t){delete id[t]}},nd=null,sd={P(){if(!Yi(nd))return nd;if(nd=!0,Qi(xs))nd=!1;else try{var t="__support__";sd.A(t,"xyz"),'"xyz"'!==sd.q(t)&&(nd=!1),sd.F(t)}catch(t){nd=!1}return nd},j(t){Ds.error("sessionStorage error: ",t)},q(t){try{return null==xs?void 0:xs.sessionStorage.getItem(t)}catch(t){sd.j(t)}return null},H(t){try{return JSON.parse(sd.q(t))||null}catch(t){}return null},A(t,e){try{return null==xs||xs.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){sd.j(t)}return!1},F(t){try{null==xs||xs.sessionStorage.removeItem(t)}catch(t){sd.j(t)}}},ad=$s("[Stylesheet Loader]"),od=xs,ld=Cs,ud="#020617",hd={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:Ql.Right,widgetType:Gl.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:ud,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},dd=[Ql.Center,Ql.Left,Ql.Right];function vd(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 cd(t){var e;void 0===t&&(t=hd.backgroundColor),"#"===t[0]&&(e=vd(t)),t.startsWith("rgb")&&(e=t);var i={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(i&&(e=vd(i)),!e)return ud;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),a=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+a*a*.114)>127.5?ud:"white"}return ud}var fd=(t,e,r)=>{var n=Ld(t),s=ld.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var a=ld.createElement("div");((t,e,r)=>{var n=i({},hd,r),s=t.style,a=!dd.includes(n.position)||e===Kl.Widget&&(null==r?void 0:r.widgetType)===Gl.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),a?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==r?void 0:r.submitButtonTextColor)||cd(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",cd(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==r?void 0:r.textColor)||cd(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",cd(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var o=(null==r?void 0:r.inputBackground)||(null==r?void 0:r.inputBackgroundColor),l=o||n.inputBackground;o||"white"!==n.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==r?void 0:r.inputTextColor)||cd(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(a,t.type,t.appearance),a.className=n;var o=a.attachShadow({mode:"open"}),l=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return Vi(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(ad.error("prepare_external_dependency_stylesheet returned null"),null)})(ld,':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{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.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)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(l){var u=o.querySelector("style");u&&o.removeChild(u),o.appendChild(l)}return ld.body.appendChild(a),{shadow:o,isNewlyCreated:!0}},pd=t=>{var e=t.responses,r=t.survey,n=t.surveySubmissionId,s=t.posthog,a=t.isSurveyCompleted,o=t.properties,l=t.surveyLanguage;s?(wu(r),s.capture(eu.SENT,i({[iu.SURVEY_NAME]:r.name,[iu.SURVEY_ID]:r.id,[iu.SURVEY_ITERATION]:r.current_iteration,[iu.SURVEY_ITERATION_START_DATE]:r.current_iteration_start_date,[iu.SURVEY_SUBMISSION_ID]:n,[iu.SURVEY_COMPLETED]:a},l&&{[iu.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},au(e,r),o,{$set:{[ou(r,"responded")]:!0}})),a&&(od.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:r.id}})),Rd(r),s.reloadFeatureFlags())):fu.error("[survey sent] event not captured, PostHog instance not found.")},gd=(t,e,r)=>{return i({[iu.SURVEY_NAME]:t.name,[iu.SURVEY_ID]:t.id,[iu.SURVEY_ITERATION]:t.current_iteration,[iu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[iu.SURVEY_PARTIALLY_COMPLETED]:(n=null==e?void 0:e.responses,void 0===n&&(n={}),Object.values(n).some((t=>!Xi(t))))},(null==e?void 0:e.surveyLanguage)&&{[iu.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==r.get_session_replay_url?void 0:r.get_session_replay_url(),[iu.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},au(null==e?void 0:e.responses,t));var n},md=(t,e,r,n)=>{if(e){if(!r){var s=Id(t);e.capture(eu.DISMISSED,i({},gd(t,s,e),n&&{[iu.SURVEY_LANGUAGE]:n},{$set:{[ou(t,"dismissed")]:!0}})),Rd(t),wu(t),od.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else fu.error("[survey dismissed] event not captured, PostHog instance not found.")},yd=(t,e)=>{if(e){var i=(t=>bu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=Id(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(eu.ABANDONED,gd(t,r,e),{transport:"sendBeacon"})}}else fu.error("[survey abandoned] event not captured, PostHog instance not found.")},bd=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),_d=(t,e)=>t.length===e.length&&t.every(((t,i)=>t===e[i]))?e.reverse():e,wd=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?_d(t.questions,bd(t.questions)):t.questions,xd=t=>cu(t)||Pd(t),kd=function(t){function e(t){var i,r;return this.getChildContext||(i=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&i.forEach((function(t){t.__e=!0,el(t)}))},this.sub=function(t){i.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){i&&i.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+Bo++,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(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Sd=()=>Al(kd),Cd=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,a,o=Vo({},t.props);for(s in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=void 0===e[s]&&null!=a?a[s]:e[s];return arguments.length>2&&(o.children=arguments.length>3?To.call(arguments,2):i),Qo(t.type,o,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function Md(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n=oa(e);if(!n)return!1;var s=[t.conditions.url],a=function(t){return null!=t?t:"icontains"}(null==(r=t.conditions)?void 0:r.urlMatchType);return Vh[a](s,[n])}var Td=t=>bu(yu,t),Ed=(t,e)=>{try{localStorage.setItem(Td(t),JSON.stringify(e))}catch(t){fu.error("Error setting in-progress survey state in localStorage",t)}},Id=t=>{try{var e=localStorage.getItem(Td(t));if(e)return JSON.parse(e)}catch(t){fu.error("Error getting in-progress survey state from localStorage",t)}return null},Pd=t=>{var e=Id(t);return!Xi(null==e?void 0:e.surveySubmissionId)},Rd=t=>{try{localStorage.removeItem(Td(t))}catch(t){fu.error("Error clearing in-progress survey state from localStorage",t)}};function Ld(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function Od(t,e,i){if(void 0===e&&(e=Ql.Right),t===Kl.ExternalSurvey)return{};switch(e){case Ql.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Ql.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Ql.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Ql.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Ql.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Ql.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Ql.Left:return{left:"30px"};case Ql.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Kl.Widget&&i===Gl.Tab?"60px":"30px"}}}var Fd=0;function Ad(t,e,i,r,n,s){e||(e={});var a,o,l=e;if("ref"in l)for(o in l={},e)"ref"==o?a=e[o]:l[o]=e[o];var u={type:t,props:l,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Fd,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(a=t.defaultProps))for(o in a)void 0===l[o]&&(l[o]=a[o]);return Eo.vnode&&Eo.vnode(u),u}var Dd=Ad("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ad("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"})}),$d=Ad("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ad("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"})}),Nd=Ad("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ad("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"})}),qd=Ad("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ad("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"})}),jd=Ad("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ad("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"})}),Bd=Ad("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ad("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"})}),Hd=Ad("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ad("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"})}),Ud=function(t){var e=(void 0===t?{}:t).fill,i=void 0===e?"currentColor":e;return Ad("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:i,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Ad("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Ad("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:i})]})},zd=Ad("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ad("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ad("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ad("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ad("g",{mask:"url(#mask0_2415_6911)",children:[Ad("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"}),Ad("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"}),Ad("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"}),Ad("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"}),Ad("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"}),Ad("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"})]})]}),Ad("defs",{children:Ad("clipPath",{id:"clip0_2415_6911",children:Ad("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Wd(t){var e=t.urlParams,i=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return Ad("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",zd]})}function Vd(t){var e=t.text,i=t.submitDisabled,r=t.appearance,n=t.onSubmit,s=t.link,a=t.onPreviewSubmit,o=t.skipSubmitButton,l=t.canGoBack,u=t.onBack,h=Al(kd).isPreviewMode,d=!!l&&!!u,v=!o&&Ad("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==xs||xs.open(s)),h?null==a||a():n()},children:e});return Ad("div",{className:"bottom-section",children:[d?Ad("div",{className:"form-buttons form-buttons-with-back",children:[Ad("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:r.backButtonText||"Back"}),v]}):v,!r.whiteLabel&&Ad(Wd,{urlParams:{utm_source:"survey-footer"}})]})}function Zd(t){var e=t.question,i=t.forceDisableHtml;return Ad("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Ad(e.type===Yl.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&Cd({component:Go("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function Gd(t){return Ad("button",{className:"form-cancel",onClick:t.onClick,disabled:Al(kd).isPreviewMode,"aria-label":"Close survey",type:"button",children:Ud({fill:"black"})})}Ad("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ad("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 Qd=xs;function Jd(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onClose,o=Al(kd).isPopup;return Ll((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),a())};return Zs(Qd,"keydown",t),()=>{Qd.removeEventListener("keydown",t)}}),[a]),Ad("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[o&&!0!==s.hideCancelButton&&Ad(Gd,{onClick:()=>a()}),Ad("h3",{className:"thank-you-message-header",children:e}),i&&Cd({component:Go("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),o&&Ad(Vd,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})}var Kd=t=>Wi(t)&&t.every((t=>Ji(t)));function Yd(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,a=t.displayQuestionIndex,o=t.initialValue,l=t.canGoBack,u=t.onBack,h=Sd().isPreviewMode,d=Ol(null),v=Rl((()=>Ji(o)?o:"")),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Ll((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+a,m=Fl((()=>function(t,e,i){var r,n,s=t.trim();if(!i&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var a of e)switch(a.type){case Ci:if(void 0!==a.value&&a.value>s.length)return null!==(r=a.errorMessage)&&void 0!==r?r:"Please enter at least "+a.value+" characters";break;case Mi:if(void 0!==a.value&&s.length>a.value)return null!==(n=a.errorMessage)&&void 0!==n?n:"Please enter no more than "+a.value+" characters"}return!1}(c,e.validation,e.optional)),[c,e.validation,e.optional]),y=jn(e.validation,Ci),b=jn(e.validation,Mi),_=Fl((()=>function(t,e){var i=1===t?void 0:t;return i&&e?"Enter "+i+"-"+e+" characters":i?"Enter at least "+i+" "+(1===i?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,b)),[y,b]),w=()=>{m||n(c.trim())},x=()=>{m||s(c.trim())};return Ad(Jo,{children:[Ad("div",{className:"question-container",children:[Ad(Zd,{question:e,forceDisableHtml:i,htmlFor:g}),Ad("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:b,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?x():w())},value:c}),_&&Ad("div",{className:"validation-hint",children:_})]}),Ad(Vd,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:x,canGoBack:l,onBack:u})]})}function Xd(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,a=t.onBack;return Ad(Jo,{children:[Ad("div",{className:"question-container",children:Ad(Zd,{question:e,forceDisableHtml:t.forceDisableHtml})}),Ad(Vd,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:a})]})}function tv(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,a=t.onSubmit,o=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=Rl((()=>tr(l)?l:Wi(l)&&l.length>0&&tr(parseInt(l[0]))?parseInt(l[0]):Ji(l)&&tr(parseInt(l))?parseInt(l):null)),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=Sd().isPreviewMode,y=t=>m?o(t):a(t);return Ad(Jo,{children:[Ad("div",{className:"question-container",children:[Ad(Zd,{question:i,forceDisableHtml:r}),Ad("div",{className:"rating-section",children:[Ad("div",{className:"rating-options",children:["emoji"===i.display&&Ad("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=av[i.scale])?void 0:e.map(((t,e)=>Ad("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),i.skipSubmitButton&&y(t)},children:t},e)))}),"number"===i.display&&Ad("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:ov(i.scale).map(((t,e)=>Ad(ev,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e)))})]}),!g&&Ad("div",{className:"rating-text",children:[Ad("div",{children:i.lowerBoundLabel}),Ad("div",{children:i.upperBoundLabel})]})]})]}),Ad(Vd,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Yi(f)&&!i.optional,appearance:s,onSubmit:()=>a(f),onPreviewSubmit:()=>o(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function ev(t){var e=t.num,i=t.setActiveNumber;return Ad("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){i(e)},children:e})}function iv(t){var e=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,a=t.onSubmit,o=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=Ol(null),v=Fl((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=_d(e,bd(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e)),[e]),c=Rl((()=>((t,e)=>Ji(t)||Kd(t)?t:e===Yl.SingleChoice?null:[])(l,e.type))),f=c[0],p=c[1],g=Rl((()=>((t,e)=>{if(Ji(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Kd(t)){var i=t.find((t=>!e.includes(t)));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(l,v))),m=g[0],y=g[1],b=Sd().isPreviewMode,_=e.type===Yl.SingleChoice,w=e.type===Yl.MultipleChoice,x=e.skipSubmitButton&&_&&!e.hasOpenChoice,k=(t,e)=>{if(e){var r=!m.isSelected;return y((t=>i({},t,{isSelected:r,inputValue:r?t.inputValue:""}))),_&&p(""),void(r&&setTimeout((()=>{var t;return null==(t=d.current)?void 0:t.focus()}),75))}if(_)return p(t),y((t=>i({},t,{isSelected:!1,inputValue:""}))),void(x&&(a(t),b&&o(t)));w&&Wi(f)&&(f.includes(t)?p(f.filter((e=>e!==t))):p([...f,t]))},S=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>i({},t,{inputValue:e}))),_&&p(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||M()||(t.preventDefault(),T()),"Escape"===t.key&&(t.preventDefault(),y((t=>i({},t,{isSelected:!1,inputValue:""}))),_&&p(null))},M=()=>!(e.optional||!Yi(f)&&(!Wi(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),T=()=>{m.isSelected&&w?Wi(f)&&(b?o([...f,m.inputValue]):a([...f,m.inputValue])):b?o(f):a(f)};return Ad(Jo,{children:[Ad("div",{className:"question-container",children:[Ad(Zd,{question:e,forceDisableHtml:r}),Ad("fieldset",{className:"multiple-choice-options limit-height",children:[Ad("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),v.map(((t,i)=>{var r=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+n+"Choice"+i,a=s+"Open",o=r?m.isSelected:_?f===t:Wi(f)&&f.includes(t);return Ad("label",{className:r?"choice-option-open":"",children:[Ad("div",{className:"response-choice",children:[Ad("input",{type:_?"radio":"checkbox",name:s,checked:o,onChange:()=>k(t,r),id:s,"aria-controls":a}),Ad("span",{children:r?t+":":t})]}),r&&Ad("input",{type:"text",ref:d,id:a,name:"question"+n+"Open",value:m.inputValue,onKeyDown:C,onInput:S,onClick(e){m.isSelected||k(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},i)}))]})]}),Ad(Vd,{text:e.buttonText||"Submit",submitDisabled:M(),appearance:s,onSubmit:T,onPreviewSubmit:T,skipSubmitButton:x,canGoBack:u,onBack:h})]})}var rv=[1,2,3,4,5],nv=[1,2,3,4,5,6,7],sv=[0,1,2,3,4,5,6,7,8,9,10],av={2:[Bd,Hd],3:[Nd,$d,Dd],5:[qd,Nd,$d,Dd,jd]};function ov(t){switch(t){case 5:default:return rv;case 7:return nv;case 10:return sv}}var lv=$s("[Surveys]");function uv(t,e,i){var r,n=t.questions[e],s=e+1;if(null==(r=n.branching)||!r.type)return e===t.questions.length-1?Xl.End:s;if(n.branching.type===Xl.End)return Xl.End;if(n.branching.type===Xl.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Xl.ResponseBased){if(n.type===Yl.SingleChoice){var a,o=n.choices.indexOf(""+i);if(-1===o&&n.hasOpenChoice&&(o=n.choices.length-1),null!=(a=n.branching)&&null!=(a=a.responseValues)&&a.hasOwnProperty(o)){var l=n.branching.responseValues[o];return Number.isInteger(l)?l:l===Xl.End?Xl.End:s}}else if(n.type===Yl.Rating){var u;if("number"!=typeof i||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(t,e){if(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")}(i,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===Xl.End?Xl.End:s}}return s}return lv.warn("Falling back to next question index due to unexpected branching type"),s}var hv="https?://(.*)",dv=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],vv=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...dv],cv="<masked>",fv=["li_fat_id"];function pv(t,e,i){if(!Cs)return{};var r,n=e?[...dv,...i||[]]:[],s=gv(Xs(Cs.URL,n,cv),t),a=(r={},qs(fv,(function(t){var e=Qh(t);r[t]=e||null})),r);return js(a,s)}function gv(t,e){var i=vv.concat(e||[]),r={};return qs(i,(function(e){var i=Ys(t,e);r[e]=i||null})),r}function mv(t){var e=function(t){return t?0===t.search(hv+"google.([^/?]*)")?"google":0===t.search(hv+"bing.com")?"bing":0===t.search(hv+"yahoo.com")?"yahoo":0===t.search(hv+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",r={};if(!Yi(e)){r.$search_engine=e;var n=Cs?Ys(Cs.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function yv(){return navigator.language||navigator.userLanguage}var bv="$direct";function _v(){return(null==Cs?void 0:Cs.referrer)||bv}function wv(t,e,i){void 0===i&&(i=!1);var r=t?[...dv,...e||[]]:[],n=i?kn(null==Ms?void 0:Ms.href):null==Ms?void 0:Ms.href,s=null==n?void 0:n.substring(0,1e3);return{r:_v().substring(0,1e3),u:s?Xs(s,r,cv):void 0}}function xv(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?kn(n):n,a={$referrer:r,$referring_domain:null==r?void 0:r==bv?bv:null==(i=Js(r))?void 0:i.host};if(s){a.$current_url=s;var o=Js(s);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname;var l=gv(s);js(a,l)}if(r){var u=mv(r);js(a,u)}return a}function kv(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Sv(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Cv=$s("[SurveyTranslations]");function Mv(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=lu(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var s=function(t){return t&&"object"==typeof t&&"language"in t?lu(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var a=lu(r);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:Vi(t.get_property)?t.get_property(eh):void 0,locale:yv()},Cv)}(e);if(!i)return Cv.info("No user language detected"),{survey:t,language:null};var r=du(t,i,Cv);return{survey:r.survey,language:r.matchedKey}}var Tv=xs,Ev=Cs,Iv="ph:show_survey_widget",Pv="PHWidgetSurveyClickListener";function Rv(t,e){try{var i=t.getBoundingClientRect(),r=Tv.innerHeight,n=Tv.innerWidth,s=i.left+i.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var a=r-i.bottom,o=250>a&&i.top>a;return{position:"fixed",top:o?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:o?r-i.top+12+"px":"auto",zIndex:hd.zIndex}}catch(t){return fu.warn("Failed to calculate trigger position:",t),null}}class Lv{constructor(t){var e=this;this.B=new Map,this.U=new Map,this.W=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(rh);if(t)for(var e of t)Pd(e)&&yd(e,this._posthog)},this.handlePopoverSurvey=function(t,r,n){var s,a,o,l,u,h=(void 0===n?{}:n).resumeDelayFromActivation,d=void 0!==h&&h,v=e.V(t),c=v.survey,f=v.language,p=null!=r&&r.position||null!=r&&r.selector?i({},c,{appearance:i({},c.appearance,r.position&&{position:r.position},r.selector&&{widgetSelector:r.selector})}):c;e.Z(p.id);var g=null!=r?r:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.$(p,y,m,f);if(!b||null!=(s=p.appearance)&&s.displayThankYouMessage){e.G(p);var _={};if((null==(a=p.appearance)?void 0:a.position)===Ql.NextToTrigger&&null!=(o=p.appearance)&&o.widgetSelector){var w,x=Ev.querySelector(p.appearance.widgetSelector);x&&(_=Rv(x,parseInt((null==(w=p.appearance)?void 0:w.maxWidth)||hd.maxWidth))||{})}var k=(null==(l=p.appearance)?void 0:l.surveyPopupDelaySeconds)||0,S=fd(p,e._posthog).shadow,C={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.Y,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==r?void 0:r.skipShownEvent,surveyLanguage:f};if(0>=k)return gl(Ad(Dv,i({},C)),S);var M=()=>{if(!e.K(p))return fu.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),e.Y(p);gl(Ad(Dv,i({},C,{survey:i({},p,{appearance:i({},p.appearance,{surveyPopupDelaySeconds:0})})})),S)},T=d?null==(u=e._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,E=tr(T)?Math.max(0,Date.now()-T):0,I=Math.max(0,1e3*k-E);if(0>=I)return M();var P=Tv.setTimeout((()=>{e.B.delete(p.id),M()}),I);e.B.set(p.id,P)}},this.J=t=>{var e=this.V(t),i=e.survey,r=e.language,n=fd(i,this._posthog),s=n.shadow;n.isNewlyCreated&&gl(Ad(Nv,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.X=t=>{var e=this.U.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Pv),this.U.delete(t),fu.info("Removed click listener for survey "+t))},this.ee=t=>{this.te(t)||(this.re(t),this.X(t.id))},this.te=t=>{try{var e,i=Ev.querySelector(Ld(t,!0));return!(null==i||null==(e=i.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.ne=(t,e)=>{var i=Ev.querySelector(e),r=this.U.get(t.id);if(i){if(this.J(t),r){if(i===r.element)return;fu.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.X(t.id)}if(!i.hasAttribute(Pv)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===Ql.NextToTrigger?Rv(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||hd.maxWidth)):{};Tv.dispatchEvent(new CustomEvent(Iv,{detail:{surveyId:t.id,position:n}}))};Zs(i,"click",n),i.setAttribute(Pv,"true"),this.U.set(t.id,{element:i,listener:n,survey:t}),fu.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.ee(t)},this.renderPopover=t=>{var e=this.V(t),i=e.survey,r=e.language,n=fd(i,this._posthog).shadow;gl(Ad(Dv,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.Y,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.V(t),s=n.survey,a=n.language,o=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(o=this.ie(s,a,i)),gl(Ad(Dv,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Y,isPopup:!1,properties:i,isSurveyCompleted:o,surveyLanguage:a}),e)},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||null==(r=r.surveys)||r.getSurveys((i=>{var r=i.filter((t=>e.K(t)));t(r)}),i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var i=t.filter((t=>t.type===Kl.Popover||t.type===Kl.Widget)),r=new Set(i.map((t=>t.id)));for(var n of Array.from(e.B.keys()))r.has(n)||e.cancelSurvey(n);var s=e.ae(i),a=new Set;s.forEach((t=>{if(t.type===Kl.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===Gl.Tab)return void e.J(t);(null==(r=t.appearance)?void 0:r.widgetType)===Gl.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(a.add(t.id),e.ne(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Yi(e.oe)&&t.type===Kl.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.U.forEach((t=>{var i=t.survey;a.has(i.id)||e.ee(i)}))}),t)},this.G=t=>{Yi(this.oe)||fu.error("Survey "+this.oe+" already in focus. Cannot add survey "+t.id+"."),this.oe=t.id},this.Y=t=>{this.oe!==t.id&&fu.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Z(t.id),this.oe=null,this.re(t)},this._posthog=t,this.oe=null}Z(t){var e=this.B.get(t);e&&(clearTimeout(e),this.B.delete(t))}cancelSurvey(t){this.B.has(t)&&(fu.info("Cancelled pending survey "+t),this.Z(t),this.oe===t&&(this.oe=null))}ae(t){return t.sort(((t,e)=>{var i,r,n=Pd(t),s=Pd(e);if(n&&!s)return-1;if(!n&&s)return 1;var a=t.schedule===tu,o=e.schedule===tu;return a&&!o?1:!a&&o?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)}))}V(t){return Mv(t,this._posthog)}ie(t,e,i){if(this.W.has(t.id))return!1;var r=function(t){var e={},i=!1,r=t.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:i};var n=r.split("&");for(var s of n){var a=s.split("="),o=a[0],l=a[1];if(o&&!Qi(l)){var u=decodeURIComponent(o),h=decodeURIComponent(l);if("auto_submit"!==u||"true"!==h){var d=u.match(/^q(\d+)$/);if(d){var v=parseInt(d[1],10);e[v]||(e[v]=[]),e[v].push(h)}}else i=!0}}return{params:e,autoSubmit:i}}(Tv.location.search),n=r.params;if(0===Object.keys(n).length)return!1;fu.info("[Survey Prefill] Detected URL prefill parameters");var s=this.se(t,n,e);if(!s)return!1;var a=s.responses,o=s.submissionId,l=s.isSurveyCompleted,u=s.skippedResponses;return(Object.keys(u).length>0&&t.enable_partial_responses||l)&&pd({responses:l?a:u,survey:t,surveySubmissionId:o,posthog:this._posthog,isSurveyCompleted:l,properties:i,surveyLanguage:e}),this.W.add(t.id),l}$(t,e,i,r){var n={};for(var s of Object.entries(e)){var a=s[1];n[parseInt(s[0])]=Wi(a)?a.map(String):[String(a)]}fu.info("[Survey] Processing initial responses");var o=this.se(t,n,r);if(!o)return!1;var l=o.isSurveyCompleted;return pd({responses:o.responses,survey:t,surveySubmissionId:o.submissionId,posthog:this._posthog,isSurveyCompleted:l,properties:i,surveyLanguage:r}),l}se(t,e,i){try{var r=function(t,e){var i={};return t.questions.forEach(((t,r)=>{if(e[r]&&t.id){var n=e[r],s=nu(t.id);try{switch(t.type){case Yl.SingleChoice:if(!t.choices||0===t.choices.length)return void Ds.warn("[Survey Prefill] Question "+r+" has no choices");var a=parseInt(n[0],10);if(isNaN(a)||0>a||a>=t.choices.length)return void Ds.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[a];break;case Yl.MultipleChoice:if(!t.choices||0===t.choices.length)return void Ds.warn("[Survey Prefill] Question "+r+" has no choices");var o=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===o.length)return void Ds.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(o.map((e=>t.choices[e])))];o.length>l.length&&Ds.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case Yl.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void Ds.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:Ds.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Ds.error("[Survey Prefill] Error converting q"+r+":",t)}}})),i}(t,e);if(0===Object.keys(r).length)return fu.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Hh(),s=Object.keys(e).map((t=>parseInt(t,10))),a=function(t,e,i){for(var r=0,n={},s=[],a=t.questions.length+1,o=0;t.questions.length>r&&a>o&&(o++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=nu(l.id);Qi(i[u])||(n[u]=i[u])}s.push(r);var h=uv(t,r,l.id?i[nu(l.id)]:null);if(h===Xl.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};r=h}return{startQuestionIndex:r,skippedResponses:n,skippedIndices:s}}(t,s,r),o=a.startQuestionIndex,l=a.skippedResponses,u=o>=t.questions.length;return Ed(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,visitedIndices:a.skippedIndices,surveyLanguage:i}),fu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:l}}catch(t){return fu.error("[Survey Prefill] Error handling prefill:",t),null}}ue(t,e){var i;if(void 0===e&&(e=void 0),!t)return!0;var r,n=!(null==(i=this._posthog.featureFlags)||!i.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),s=!0;return e&&(s=(null==(r=this._posthog.featureFlags)?void 0:r.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),n&&s}le(t){return!t.conditions||Md(t,this._posthog)&&function(t){var e,i;return function(t,e){var i,r,n;if(!t||0===t.length)return!0;if(!Rs)return!1;var s=_n(Rs,{userAgentDataPlatform:null==Ss||null==(i=Ss.userAgentData)?void 0:i.platform,maxTouchPoints:null==Ss?void 0:Ss.maxTouchPoints,screenWidth:null==xs||null==(r=xs.screen)?void 0:r.width,screenHeight:null==xs||null==(n=xs.screen)?void 0:n.height,devicePixelRatio:null==xs?void 0:xs.devicePixelRatio});return Vh[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(i=t.conditions)?void 0:i.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==ld||!ld.querySelector(t.conditions.selector))}(t)}ce(t){var e;return xd(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this._posthog.featureFlags)&&e.hasLoadedFlags?{satisfied:this.ue(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,i,r={eligible:!0,reason:void 0};if(!pu(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!xu.includes(t.type))return r.eligible=!1,r.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",r;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.ue(t.linked_flag_key,n))return r.eligible=!1,r.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",r;if(!this.ue(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,a=this.ce(t);return a.satisfied?function(t,e){if(!t||!e)return!0;var i="string"==typeof e?new Date(e):e,r=new Date,n=Math.abs(r.getTime()-i.getTime());return Math.ceil(n/864e5)>t}(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays,td.q("lastSeenSurveyDate"))?(t=>!!td.q(_u(t))&&!xd(t))(t)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason=null!==(s=a.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",r)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.ve(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}ve(t){var e;if(!vu(t)&&!gu(t))return!0;var i=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==i||!i.includes(t.id))}de(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var e=t.value;return!t.key||!e||this.ue(e)}))}K(t){return this.checkSurveyEligibility(t).eligible&&this.le(t)&&this.ve(t)&&this.de(t)}re(t){try{var e=Ev.querySelector(Ld(t,!0));null!=e&&e.shadowRoot&&gl(null,e.shadowRoot),null==e||e.remove()}catch(e){fu.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.G,removeSurveyFromFocus:this.Y,surveyInFocus:this.oe,surveyTimeouts:this.B,handleWidget:this.J,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.ne,sortSurveysByAppearanceDelay:this.ae,checkFlags:this.de.bind(this),isSurveyFeatureFlagEnabled:this.ue.bind(this)}}}function Ov(t,e){if(Ev&&Tv){var i,r=new Lv(t);if(t.config.disable_surveys_automatic_display)return fu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return fu.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Qi(i)&&(i=setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Zs(Ev,"visibilitychange",(()=>{Ev.hidden?Qi(i)||(clearInterval(i),i=void 0):(r.callSurveysAndEvaluateDisplayLogic(!1),n())})),r}}function Fv(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,a=void 0!==s&&s,o=t.posthog;Ll((()=>{var t;if(!a&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===Kl.Widget,s=Md(e,o),a=(null==(t=e.appearance)?void 0:t.widgetType)===Gl.Tab&&i;if(!s)return fu.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);a&&(fu.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Zs(Tv,"popstate",i),Zs(Tv,"hashchange",i);var s=Tv.history.pushState,l=Tv.history.replaceState;return Tv.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.apply(this,e),i()},Tv.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];l.apply(this,e),i()},()=>{Tv.removeEventListener("popstate",i),Tv.removeEventListener("hashchange",i),Tv.history.pushState=s,Tv.history.replaceState=l}}}),[a,e,r,n,o])}function Av(t){switch(void 0===t&&(t=Jl.Right),t){case Jl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Jl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Jl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Dv(t){var e,r,n,s,a,o,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.style,v=void 0===d?{}:d,c=t.previewPageIndex,f=t.removeSurveyFromFocus,p=void 0===f?()=>{}:f,g=t.isPopup,m=void 0===g||g,y=t.onPreviewSubmit,b=void 0===y?()=>{}:y,_=t.onPreviewBack,w=void 0===_?()=>{}:_,x=t.onPopupSurveyDismissed,k=void 0===x?()=>{}:x,S=t.onCloseConfirmationMessage,C=void 0===S?()=>{}:S,M=t.properties,T=t.isSurveyCompleted,E=t.skipShownEvent,I=t.surveyLanguage,P=Ol(null),R=Number.isInteger(c),L=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,O=function(t,e,r,n,s,a,o,l,u){var h=Rl(n||0===r||t.type===Kl.ExternalSurvey),d=h[0],v=h[1],c=Rl(!1),f=c[0],p=c[1],g=()=>{var e=()=>{a&&s(t),v(!1)};Ev.startViewTransition?Ev.startViewTransition((()=>{var t;null==o||null==(t=o.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},m=e=>{e.detail.surveyId===t.id&&g()};return Ll((()=>{if(e){if(!n){var s=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return g();p(!0),null!=(r=t.appearance)&&r.autoDisappear&&setTimeout((()=>{g()}),5e3)}},a=()=>{if(Md(t,e)){v(!0),Tv.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(eu.SHOWN,i({[iu.SURVEY_NAME]:t.name,[iu.SURVEY_ID]:t.id,[iu.SURVEY_ITERATION]:t.current_iteration,[iu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},u&&{[iu.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};if(Zs(Tv,"PHSurveyClosed",m),Zs(Tv,"PHSurveySent",s),r>0){var o=setTimeout(a,r);return()=>{clearTimeout(o),Tv.removeEventListener("PHSurveyClosed",m),Tv.removeEventListener("PHSurveySent",s)}}return a(),()=>{Tv.removeEventListener("PHSurveyClosed",m),Tv.removeEventListener("PHSurveySent",s)}}}else fu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Fv({survey:t,removeSurveyFromFocus:s,setSurveyVisible:v,isPreviewMode:n,posthog:e}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:v,hidePopupWithViewTransition:g}}(l,h,L,R,p,m,P,E,I),F=O.isPopupVisible,A=O.hidePopupWithViewTransition,D=O.isSurveySent||c===l.questions.length||!0===T,N=Fl((()=>{var t=Id(l),e=(null==t?void 0:t.surveySubmissionId)||Hh();return{isPreviewMode:R,previewPageIndex:c,onPopupSurveyDismissed(){I?md(l,h,R,I):md(l,h,R),k()},isPopup:m||!1,surveySubmissionId:e,onPreviewSubmit:b,onPreviewBack:w,posthog:h,properties:M,surveyLanguage:I}}),[R,c,m,h,l,k,b,w,M,I]);return F?Ad(kd.Provider,{value:N,children:Ad("div",{className:"ph-survey",style:i({},Od(l.type,null==(r=l.appearance)?void 0:r.position,null==(n=l.appearance)?void 0:n.widgetType),v),ref:P,children:D?Ad(Jd,{header:(null==(s=l.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(a=l.appearance)?void 0:a.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(o=l.appearance)?void 0:o.thankYouMessageDescriptionContentType,appearance:l.appearance||hd,onClose(){A(),C()}}):Ad($v,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function $v(t){var e,r,n=t.survey,s=t.forceDisableHtml,a=t.posthog,o=Fl((()=>{var t=Id(n);if(!t)return null;var e=tr(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&n.questions.length>t.lastQuestionIndex?t:(Rd(n),null)}),[n]),l=Rl((()=>(null!=o&&o.responses&&fu.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{}))),u=l[0],h=l[1],d=Al(kd),v=d.previewPageIndex,c=d.onPopupSurveyDismissed,f=d.isPopup,p=d.onPreviewSubmit,g=d.onPreviewBack,m=d.surveySubmissionId,y=d.isPreviewMode,b=d.properties,_=d.surveyLanguage,w=Rl((()=>{var t=null==o?void 0:o.lastQuestionIndex,e=tr(t)&&t>=0&&n.questions.length>t?t:0;return v||e})),x=w[0],k=w[1],S=Rl((()=>{var t;return(null!==(t=null==o?void 0:o.visitedIndices)&&void 0!==t?t:[]).filter((t=>t>=0&&n.questions.length>t))})),C=S[0],M=S[1],T=Fl((()=>wd(n)),[n]);Ll((()=>{y&&!Qi(v)&&k(v)}),[v,y]);var E=!(null==(e=n.appearance)||!e.allowGoBack)&&(y?(null!=v?v:0)>0:C.length>0),I=T.at(x);return I?Ad("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(r=n.appearance)?void 0:r.hideCancelButton)&&Ad(Gd,{onClick(){c()}}),Ad("div",{className:"survey-box","data-question-index":x,children:qv({question:I,forceDisableHtml:s,displayQuestionIndex:x,appearance:n.appearance||hd,onSubmit:t=>(t=>{var e=t.res,r=t.displayQuestionIndex,s=t.questionId;if(a)if(s){var o=nu(s),l=i({},u,{[o]:e});h(l);var d=uv(n,r,e),v=d===Xl.End,c=[...C,r];if(v||(M(c),k(d),Ed(n,{surveySubmissionId:m,responses:l,lastQuestionIndex:d,visitedIndices:c,surveyLanguage:_})),n.enable_partial_responses||v){var f=new Set(c.map((t=>{var e;return null==(e=T[t])?void 0:e.id})).filter((t=>!!t)).map((t=>nu(t)))),p=Object.fromEntries(Object.entries(l).filter((t=>f.has(t[0]))));pd({responses:p,survey:n,surveySubmissionId:m,isSurveyCompleted:v,posthog:a,properties:b,surveyLanguage:_})}}else fu.error("onNextButtonClick called without a questionId.");else fu.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:x,questionId:I.id}),onPreviewSubmit:p,initialValue:I.id?u[nu(I.id)]:void 0,canGoBack:E,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);M(e),k(t),Ed(n,{surveySubmissionId:m,responses:u,lastQuestionIndex:t,visitedIndices:e,surveyLanguage:_})}}})})]}):null}function Nv(t){var e,i,r,n,s,a,o,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=Rl(!0),f=c[0],p=c[1],g=Rl(!1),m=g[0],y=g[1],b=Rl({}),_=b[0],w=b[1],x=()=>{y(!m)};if(Ll((()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,i=t;(null==(e=i.detail)?void 0:e.surveyId)===l.id&&(fu.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),x())};return Zs(Tv,Iv,e),()=>{Tv.removeEventListener(Iv,e)}}}else fu.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(i=l.appearance)?void 0:i.widgetSelector,null==(r=l.appearance)?void 0:r.borderColor]),Fv({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var k=()=>{l.schedule!==tu&&p(!1),setTimeout((()=>{y(!1)}),200)};return Ad(Jo,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Ad("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Jl.Top?"widget-tab-top":""),onClick:x,disabled:d,style:Av(null==(a=l.appearance)?void 0:a.tabPosition),children:(null==(o=l.appearance)?void 0:o.widgetLabel)||""}),m&&Ad(Dv,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:v})]})}var qv=t=>{var e=t.question,r=t.onSubmit,n=t.onPreviewSubmit,s={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){n(t)},onSubmit(t){r(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case Yl.Open:return Go(Yd,i({},s,{question:e,key:e.id}));case Yl.Link:return Go(Xd,i({},s,{question:e,key:e.id}));case Yl.Rating:return Go(tv,i({},s,{question:e,key:e.id}));case Yl.SingleChoice:case Yl.MultipleChoice:return Go(iv,i({},s,{question:e,key:e.id}));default:return fu.error("Unsupported question type: "+e.type),null}};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.generateSurveys=Ov,Mo.extendPostHogWithSurveys=Ov;var jv=(t,e,i)=>i.remaining>0?e.length>i.remaining?(t.push(e.slice(0,i.remaining)),i.remaining=0,i.truncated=!0,!1):(t.push(e),i.remaining-=e.length,!0):(i.truncated=!0,!1),Bv=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return jv(e,r,i);if(i.truncated=!0,2>i.remaining)return!1;for(var n=0,s=Math.min(t.length,i.remaining-2);s>n;){var a=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,a)).length>i.remaining?s=a-1:n=a}return jv(e,JSON.stringify(t.slice(0,n)),i)},Hv=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Uv=(t,e,i)=>{if(!i.truncated){if(i.keysRemaining-=1,i.sizeRemaining-=String(e).length+t.length,0>=i.keysRemaining||0>=i.sizeRemaining)return i.truncated=!0,void(i.result.attributes_truncated=!0);i.result[t]=e}},zv=(t,e,i)=>{if(!i.truncated)if(Zi(t)){if(i.seen.has(t))return void Uv(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(zv(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else Uv(e,t,i)},Wv=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!Hv(t))return!n||jv(e,"null",i);if(Yi(t)||(t=>{try{return tr(t)||ir(t)}catch(t){return!1}})(t))return jv(e,JSON.stringify(t),i);if("string"==typeof t)return Bv(t,e,i);if(!Zi(t)&&!Wi(t))return jv(e,JSON.stringify(t),i);if(r.has(t))return Bv("[Circular]",e,i);r.add(t);try{var a=t.toJSON;if(Vi(a))return Wv(a.call(t),e,i,r,n)}catch(t){}try{var o={}.toString.call(t);if("[object String]"===o)return Bv(String(t.valueOf()),e,i);if("[object Number]"===o||"[object Boolean]"===o)return jv(e,JSON.stringify(t.valueOf()),i)}catch(t){}if(t instanceof Error){var l={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(l[u]=t[u])}catch(t){}try{l.name=t.name}catch(t){}try{l.message=t.message}catch(t){}try{l.stack=t.stack}catch(t){}return Wv(l,e,i,r,n,s)}if(Wi(t)){if(!jv(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!jv(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!Wv(d,e,i,r,!0))return!1}return jv(e,"]",i)}if(!jv(e,"{",i))return!1;var v=!0;try{for(var c in t)if({}.hasOwnProperty.call(t,c)){if(0>=i.remaining)return i.truncated=!0,!1;var f=void 0;try{f=t[c]}catch(t){continue}if(s)try{zv(f,c,s)}catch(t){}if(Hv(f)){var p=(v?"":",")+JSON.stringify(c)+":";if(p.length>=i.remaining)return i.truncated=!0,!1;var g=e.length,m=i.remaining,y=i.truncated;if(!jv(e,p,i))return!1;var b=e.length,_=Wv(f,e,i,r,!1),w=i.truncated;if(e.length!==b){if(v=!1,!_)return!1}else if(e.length=g,i.remaining=m,i.truncated=_?y:w,!_)return!1}}}catch(t){}return jv(e,"}",i)},Vv={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.logs={initializeLogs(t){var e={host:Mo.location.host},r=!1,n=function(n){var s=Mo.console[n],a=(s=>function(){for(var a=!1,o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];try{if(l.length>0&&!r&&t.is_capturing()){var h;r=!0,a=!0;var d=((t,e)=>{for(var i=[],r={remaining:1e4,truncated:!1},n=Zi(t[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||jv(i," ",r))&&Wv(t[s],i,r,new WeakSet,!1,0===s?n:void 0);s++);return{body:i.join("")+(r.truncated?"...":""),truncated:r.truncated,attributes:(null==n?void 0:n.result)||{}}})(l),v=d.body,c=d.attributes,f=i({},e,d.truncated?{body_truncated:"true"}:{});null==(h=t.logs)||h.he({level:Vv[n],body:v,attributes:i({"log.source":"console."+n},f,c)})}}catch(t){}finally{a&&(r=!1),s.apply(Mo.console,l)}})(s);a.__rrweb_original__=(t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t})(s),Mo.console[n]=a};for(var s of Object.keys(Vv))n(s)}};var Zv=$s("[Error tracking]");function Gv(){return new Wn([new ns,new fs,new as,new ss,new vs,new ds,new ls,new cs],function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;e>n;n++)r[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],a=e.split("\n"),o=n;a.length>o;o++){var l=a[o];if(1024>=l.length){var u=is.test(l)?l.replace(is,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of r){var d=h(u,t);if(d){s.push(d);break}}if(s.length>=rs)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,rs).map((t=>{return i({},t,{filename:t.filename||(r=e,r[r.length-1]||{}).filename,function:t.function||Vn});var r}))}(s)}}("web:javascript",Yn,es))}var Qv=$s("[ExceptionAutocapture]"),Jv=Gv(),Kv={wrapOnError(t){var e=xs;e||Qv.info("window not available, cannot wrap onerror");var i=e.onerror;return e.onerror=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];var a=Jv.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Ji(e)&&Ji(i)&&i.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:e,filename:i,lineno:r,colno:n})}catch(t){return e}return e})(n),{mechanism:{handled:!1}});return t(a),!!Vi(i)&&null!==(e=i(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=i}},wrapUnhandledRejection(t){var e=xs;e||Qv.info("window not available, cannot wrap onUnhandledRejection");var i=e.onunhandledrejection;return e.onunhandledrejection=function(e){var r,n=Jv.buildFromUnknown(e,{mechanism:{handled:!1}});return t(n),!!Vi(i)&&null!==(r=i(e))&&void 0!==r&&r},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=i}},wrapConsoleError(t){var e=console;e||Qv.info("console not available, cannot wrap console.error");var i=e.error;return e.error=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var a=n.find((t=>t instanceof Error)),o=Jv.buildFromUnknown(a||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(o),Vi(i)&&i(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=i}}};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.errorWrappingFunctions=Kv,Mo.posthogErrorWrappingFunctions=Kv;var Yv="X-POSTHOG-SESSION-ID",Xv="X-POSTHOG-WINDOW-ID",tc="X-POSTHOG-DISTINCT-ID",ec=[Yv,Xv,tc],ic=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],rc=(t,e)=>({}.hasOwnProperty.call(t,e)),nc=t=>"object"==typeof t&&!Yi(t)||Vi(t),sc=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),ac=t=>{try{var e;return sc(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==xs||null==(e=xs.location)?void 0:e.href).toString()}catch(t){return}},oc=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(Wi(t)&&!t.includes(s))return!1;var a=!1;if(i){var o=i.checkAndGetSessionAndWindowId(!0),l=o.windowId;n.set(Yv,o.sessionId),n.set(Xv,l),a=!0}var u=(t=>Vi(t)?t():t)(e);return u&&u!==_h&&(n.set(tc,u),a=!0),a};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{};var lc={_patchFetch:(t,e,r)=>na(xs,"fetch",(n=>function(s,a){var o=arguments.length>1?[s,a]:[s],l=o;try{var u=ac(s);if(u)if(sc(s)){var h=new Request(s,a);oc(t,e,r,h.url,h.headers),l=[h]}else{var d=new Headers(nc(a)?a.headers:void 0);if(oc(t,e,r,u,d)){var v=((t,e)=>{if(Qi(t)||Yi(t))return{headers:e};if(nc(t)){var r=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(r);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),n}return new Proxy({headers:e},{get:(t,e)=>rc(t,e)?Reflect.get(t,e):Reflect.get(r,e,r),has:(t,e)=>rc(t,e)||e in r,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(r).forEach((t=>e.add(t))),ic.forEach((t=>{t in r&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var n=Reflect.getOwnPropertyDescriptor(t,e);if(n)return n;if("string"==typeof e&&ic.includes(e)&&e in r)return{configurable:!0,enumerable:!0,get(){return Reflect.get(r,e,r)}};var s=Reflect.getOwnPropertyDescriptor(r,e);return s?i({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(r)})}})(a,d);v&&(l=[s,v])}}}catch(t){l=o}return n.apply(this,l)})),_patchXHR:(t,e,i)=>na(xs.XMLHttpRequest.prototype,"open",(r=>function(n,s,a,o,l){void 0===a&&(a=!0);var u=this,h=new Headers,d=ac(s);d&&oc(t,e,i,d,h);var v=r.call(u,n,s,a,o,l);return ec.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),v}))};Mo.__PosthogExtensions__.tracingHeadersPatchFns=lc,Mo.postHogTracingHeadersPatchFns=lc,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,i=Math.trunc(t)||0;return 0>i&&(i+=e),0>i||i>=e?void 0:this[i]},writable:!0,enumerable:!1,configurable:!0});let uc=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(!t.hadRecentInput){var i=this.i[0],r=this.i.at(-1);this.o&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var hc=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},dc=t=>{if("loading"===document.readyState)return"loading";var e=hc();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},vc=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},cc=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[vc(n),...Array.from(null!==(r=n.classList)&&void 0!==r?r:[]).sort()].join(".");if(e.length+s.length>99)return e||s;if(e=e?s+">"+e:s,n.id)break;t=n.parentNode}}catch(t){}return e},fc=new WeakMap;function pc(t,e){var i=fc.get(e);return i||(i=new WeakMap,fc.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var gc=-1,mc=()=>gc,yc=t=>{addEventListener("pageshow",(e=>{e.persisted&&(gc=e.timeStamp,t(e))}),!0)},bc=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((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,i),t(e))}},_c=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},wc=()=>{var t,e;return null!==(t=null==(e=hc())?void 0:e.activationStart)&&void 0!==t?t:0},xc=-1,kc=new Set,Sc=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Cc=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of kc)e();isFinite(xc)||(xc="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Cc,!0))}},Mc=function(t){if(void 0===t&&(t=!1),t&&(xc=1/0),0>xc){var e,i=wc(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;xc=null!=r?r:Sc(),addEventListener("visibilitychange",Cc,!0),addEventListener("prerenderingchange",Cc,!0),yc((()=>{setTimeout((()=>{xc=Sc()}))}))}return{get firstHiddenTime(){return xc},onHidden(t){kc.add(t)}}},Tc=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=hc(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>mc()?o&&(document.prerendering||wc()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==o?void 0:o.name),navigationStartTime:a||0}},Ec=function(t,e,r){void 0===r&&(r={});try{var n=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(n.length>0){var s=new PerformanceObserver((t=>{queueMicrotask((()=>{var i=t.getEntries();n.length>1&&i.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(i)}))}));for(var a of n)s.observe(i({type:a,buffered:!0},r));return s}}catch(t){}},Ic=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Pc=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Rc=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let Lc=class{constructor(){this.u=void 0}};var Oc,Fc=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Ac=[1800,3e3],Dc=function(t,e){void 0===e&&(e={});var i=Ic(e);Fc((()=>{var r,n=pc(e,Lc),s=Mc(),a=Tc("FCP"),o=Ec(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-wc(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=bc(t,a,Ac,e.reportAllChanges),yc((i=>{a=Tc("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,mc()),r=bc(t,a,Ac,e.reportAllChanges),_c((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&Ec(["soft-navigation"],(i=>{i.forEach((i=>{n.u&&i.navigationId&&Pc(n.u,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=Tc("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=bc(t,a,Ac,e.reportAllChanges))(!0)}))}),e)}))},$c=[.1,.25],Nc=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],qc=0,jc=1/0,Bc=0,Hc=t=>{for(var e of t)e.interactionId&&(jc=Math.min(jc,e.interactionId),Bc=Math.max(Bc,e.interactionId),qc=Bc?(Bc-jc)/7+1:0)},Uc=()=>{var t;return Oc?qc:null!==(t=performance.interactionCount)&&void 0!==t?t:0},zc=0;let Wc=class{constructor(){this.h=[],this.v=new Map,this.p=void 0,this.m=void 0}M(){zc=Uc(),this.h.length=0,this.v.clear()}T(t){var e=Uc()-zc,i=Math.min(this.h.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.h[i]:{D:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.h.at(-1),r=this.v.get(t.interactionId);if(r||10>this.h.length||t.duration>i.D){var n;if(r?t.duration>r.D?(r.entries=[t],r.D=t.duration):t.duration===r.D&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.v.set((r={id:t.interactionId,entries:[t],D:t.duration}).id,r),this.h.push(r)),this.h.sort(((t,e)=>e.D-t.D)),this.h.length>10){var s=this.h.splice(10);for(var a of s)this.v.delete(a.id)}null==(n=this.m)||n.call(this,r)}}}};var Vc=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Rc(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},Zc=[200,500];let Gc=class{constructor(){this.p=void 0,this.u=void 0}l(t){var e;null==(e=this.p)||e.call(this,t)}};var Qc=[2500,4e3],Jc={onLCP(t,e){void 0===e&&(e={});var r=pc(e=Object.assign({},e),Gc),n=new WeakMap;Ic(e)&&(r.u=new Map),r.p=t=>{var i=t.element;if(i){var r,s=null!==(r=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==r?r:cc(i);n.set(t,s)}else t.id&&n.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=Ic(e);Fc((()=>{var n,s=Mc(),a=Tc("LCP"),o=pc(e,Gc),l=(r,o,l,u,h)=>{a=Tc("LCP",-1,r,o,l,u,h),n=bc(t,a,Qc,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Mc(!0))},u=t=>{o.u&&t.navigationId&&Pc(o.u,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-wc(),0),o.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Ec(d,h);if(v){n=bc(t,a,Qc,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;Vc((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});yc((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,mc()),n=bc(t,a,Qc,e.reportAllChanges),_c((()=>{a.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var s,a,o,l,u,h,d=t.entries.at(-1),v=d.url&&performance.getEntriesByType("resource").find((t=>t.name===d.url));e.target=n.get(d),e.lcpEntry=d,d.url&&(e.url=d.url),v&&(e.lcpResourceEntry=v);var c=0,f=0;if("soft-navigation"!==t.navigationType?(c=null!==(s=null==(a=h=hc())?void 0:a.activationStart)&&void 0!==s?s:0,f=null!==(o=null==(l=h)?void 0:l.responseStart)&&void 0!==o?o:0):(c=t.navigationStartTime||0,h=null==(u=r.u)?void 0:u.get(t.navigationId)),h){var p=Math.max(0,f-c),g=Math.max(p,v?(v.requestStart||v.startTime)-c:0),m=Math.min(t.value,Math.max(g,v?v.responseEnd-c:0));e=i({},e,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:h})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var i=pc(e=Object.assign({},e),uc),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=Nc(t.sources),s=null==n?void 0:n.node;if(s){var a,o=null!==(a=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==a?a:cc(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=Mc();Dc(Rc((()=>{var r,n=Tc("CLS",0),s=pc(e,uc),a=(i,a,o,l,u)=>{n=Tc("CLS",0,i,a,o,l,u),s.o=0,r=bc(t,n,$c,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{o(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.l(e):l(e);o()},h=["layout-shift"];Ic(e)&&h.push("soft-navigation");var d=Ec(h,u);d&&(r=bc(t,n,$c,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),yc((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,mc()),_c(r)})),setTimeout(r))})))}((e=>{t((t=>{var e={};if(t.entries.length){var i,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(i=n.sources)&&i.length){var s=Nc(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:dc(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={});var i=pc(e=Object.assign({},e),Lc);Ic(e)&&(i.u=new Map),Dc((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:dc(mc())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=hc(),n=t.entries.at(-1);if(r){var s=Math.max(0,r.responseStart-(r.activationStart||0));e={timeToFirstByte:s,firstByteToFCP:t.value-s,loadState:dc(t.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}}else{var a,o=null==(a=i.u)?void 0:a.get(t.navigationId);o&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:o})}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var r=pc(e=Object.assign({},e),Wc),n=[],s=[],a=0,o=new WeakMap,l=new WeakMap,u=!1,h=()=>{u||(Vc(d),u=!0)},d=()=>{var t=new Set(r.h.map((t=>o.get(t.entries[0])))),e=s.length-10;s=s.filter(((i,r)=>r>=e||t.has(i)));var i=new Set;for(var l of s){var h=v(l.startTime,l.processingEnd);for(var d of h)i.add(d)}n=n.filter((t=>t.startTime>a||i.has(t))),u=!1};r.p=t=>{var i,r=t.startTime+t.duration;a=Math.max(a,t.processingEnd);for(var n=s.length-1;n>=0;n--){var l=s[n];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),e.includeProcessedEventEntries&&i.entries.push(t);break}}i||s.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&o.set(t,i),h()},r.m=t=>{if(!l.get(t)){var i,r=null==(i=t.entries.find((t=>t.target)))?void 0:i.target;if(r){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:cc(r);l.set(t,s)}else{var a,o=null==(a=t.entries.find((t=>t.targetSelector)))?void 0:a.targetSelector;o&&l.set(t,o)}}};var v=(t,e)=>{var i=[];for(var r of n)if(r.startTime+r.duration>=t){if(r.startTime>e)break;i.push(r)}return i};Ec(["long-animation-frame"],(t=>{n=n.concat(t),h()}),e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Mc();Fc((()=>{var n;"interactionCount"in performance||Oc||(Oc=Ec(["event"],Hc,{durationThreshold:0}));var s,a=Tc("INP"),o=pc(e,Wc),l=(i,r,n,l,u)=>{o.M(),a=Tc("INP",-1,i,r,n,l,u),s=bc(t,a,Zc,e.reportAllChanges)},u=()=>{var t=o.T(a.navigationType);t&&t.D!==a.value&&(a.value=t.D,a.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),Vc((()=>{for(var i of t)"soft-navigation"!==i.entryType?o.l(i):h(i);u(),e&&s(!0)}))},v=["event","first-input"];Ic(e)&&v.push("soft-navigation");var c=Ec(v,d,i({},e,{durationThreshold:null!==(n=e.durationThreshold)&&void 0!==n?n:40}));s=bc(t,a,Zc,e.reportAllChanges),c&&(r.onHidden((()=>{d(c.takeRecords(),!0)})),yc((()=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,mc())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:dc(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var i=t.entries[0],n=o.get(i),s=n.processingStart,a=Math.max(i.startTime+i.duration,s),u=Math.min(n.processingEnd,a),h=n.entries.sort(((t,e)=>t.processingStart-e.processingStart)),d=v(i.startTime,u),c=r.v.get(i.interactionId),f={interactionTarget:l.get(c),interactionType:i.name.startsWith("key")?"keyboard":"pointer",interactionTime:i.startTime,nextPaintTime:a,processedEventEntries:h,longAnimationFrameEntries:d,inputDelay:s-i.startTime,processingDuration:u-s,presentationDelay:a-u,loadState:dc(i.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{var i=t.interactionTime,r=t.nextPaintTime;if(null!=(e=t.longAnimationFrameEntries)&&e.length&&i&&r){var n,s,a=t.inputDelay,o=t.processingDuration,l=0,u=0,h=0,d=0;for(var v of t.longAnimationFrameEntries)for(var c of(u=u+v.startTime+v.duration-v.styleAndLayoutStart,v.scripts)){var f=c.startTime+c.duration;if(f>=i){var p=f-Math.max(i,c.startTime),g=c.duration?p/c.duration*c.forcedStyleAndLayoutDuration:0;l+=p-g,u+=g,p>d&&(s=i+a>c.startTime?"input-delay":i+a+o>c.startTime?"processing-duration":"presentation-delay",n=c,d=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=i+a+o&&(h=r-y),n&&s&&(t.longestScript={entry:n,subpart:s,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=h,t.totalUnattributedDuration=r-i-l-u-h}})(f),Object.assign(t,{attribution:f})})(e))}),e)}};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Jc,Mo.__PosthogExtensions__.postHogWebVitalsCallbacks=Jc,Mo.postHogWebVitalsCallbacks=Jc;var Kc=-1,Yc=()=>Kc,Xc=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Kc=e.timeStamp,t(e))}),!0)},tf=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((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,i),t(e))}},ef=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},rf=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},nf=()=>{var t,e;return null!==(t=null==(e=rf())?void 0:e.activationStart)&&void 0!==t?t:0},sf=-1,af=new Set,of=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,lf=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of af)e();isFinite(sf)||(sf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",lf,!0))}},uf=function(t){if(void 0===t&&(t=!1),t&&(sf=1/0),0>sf){var e,i=nf(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;sf=null!=r?r:of(),addEventListener("visibilitychange",lf,!0),addEventListener("prerenderingchange",lf,!0),Xc((()=>{setTimeout((()=>{sf=of()}))}))}return{get firstHiddenTime(){return sf},onHidden(t){af.add(t)}}},hf=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=rf(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>Yc()?o&&(document.prerendering||nf()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==o?void 0:o.name),navigationStartTime:a||0}},df=new WeakMap;function vf(t,e){var i=df.get(e);return i||(i=new WeakMap,df.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}let cf=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var i=this.o[0],r=this.o.at(-1);this.i&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.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 ff=function(t,e,r){void 0===r&&(r={});try{var n=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(n.length>0){var s=new PerformanceObserver((t=>{queueMicrotask((()=>{var i=t.getEntries();n.length>1&&i.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(i)}))}));for(var a of n)s.observe(i({type:a,buffered:!0},r));return s}}catch(t){}},pf=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},gf=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},mf=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let yf=class{constructor(){this.l=void 0}};var bf,_f=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},wf=[1800,3e3],xf=function(t,e){void 0===e&&(e={});var i=pf(e);_f((()=>{var r,n=vf(e,yf),s=uf(),a=hf("FCP"),o=ff(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-nf(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=tf(t,a,wf,e.reportAllChanges),Xc((i=>{a=hf("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Yc()),r=tf(t,a,wf,e.reportAllChanges),ef((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&ff(["soft-navigation"],(i=>{i.forEach((i=>{n.l&&i.navigationId&&gf(n.l,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=hf("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=tf(t,a,wf,e.reportAllChanges))(!0)}))}),e)}))},kf=[.1,.25],Sf=0,Cf=1/0,Mf=0,Tf=t=>{for(var e of t)e.interactionId&&(Cf=Math.min(Cf,e.interactionId),Mf=Math.max(Mf,e.interactionId),Sf=Mf?(Mf-Cf)/7+1:0)},Ef=()=>{var t;return bf?Sf:null!==(t=performance.interactionCount)&&void 0!==t?t:0},If=0;let Pf=class{constructor(){this.u=[],this.v=new Map,this.m=void 0,this.p=void 0}T(){If=Ef(),this.u.length=0,this.v.clear()}M(t){var e=Ef()-If,i=Math.min(this.u.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.u[i]:{_:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.u.at(-1),r=this.v.get(t.interactionId);if(r||10>this.u.length||t.duration>i._){var n;if(r?t.duration>r._?(r.entries=[t],r._=t.duration):t.duration===r._&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.v.set((r={id:t.interactionId,entries:[t],_:t.duration}).id,r),this.u.push(r)),this.u.sort(((t,e)=>e._-t._)),this.u.length>10){var s=this.u.splice(10);for(var a of s)this.v.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}};var Rf=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=mf(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},Lf=[200,500];let Of=class{constructor(){this.m=void 0,this.l=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}};var Ff=[2500,4e3],Af={onLCP(t,e){void 0===e&&(e={});var i=!1,r=pf(e);_f((()=>{var n,s=uf(),a=hf("LCP"),o=vf(e,Of),l=(r,o,l,u,h)=>{a=hf("LCP",-1,r,o,l,u,h),n=tf(t,a,Ff,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=uf(!0))},u=t=>{o.l&&t.navigationId&&gf(o.l,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-nf(),0),o.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=ff(d,h);if(v){n=tf(t,a,Ff,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;Rf((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});Xc((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Yc()),n=tf(t,a,Ff,e.reportAllChanges),ef((()=>{a.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var i=uf();xf(mf((()=>{var r,n=hf("CLS",0),s=vf(e,cf),a=(i,a,o,l,u)=>{n=hf("CLS",0,i,a,o,l,u),s.i=0,r=tf(t,n,kf,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{o(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.h(e):l(e);o()},h=["layout-shift"];pf(e)&&h.push("soft-navigation");var d=ff(h,u);d&&(r=tf(t,n,kf,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),Xc((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Yc()),ef(r)})),setTimeout(r))})))},onFCP:xf,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=uf();_f((()=>{var n;"interactionCount"in performance||bf||(bf=ff(["event"],Tf,{durationThreshold:0}));var s,a=hf("INP"),o=vf(e,Pf),l=(i,r,n,l,u)=>{o.T(),a=hf("INP",-1,i,r,n,l,u),s=tf(t,a,Lf,e.reportAllChanges)},u=()=>{var t=o.M(a.navigationType);t&&t._!==a.value&&(a.value=t._,a.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),Rf((()=>{for(var i of t)"soft-navigation"!==i.entryType?o.h(i):h(i);u(),e&&s(!0)}))},v=["event","first-input"];pf(e)&&v.push("soft-navigation");var c=ff(v,d,i({},e,{durationThreshold:null!==(n=e.durationThreshold)&&void 0!==n?n:40}));s=tf(t,a,Lf,e.reportAllChanges),c&&(r.onHidden((()=>{d(c.takeRecords(),!0)})),Xc((()=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Yc())})))}))}}};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=Af,Mo.__PosthogExtensions__.postHogWebVitalsCallbacks=Af,Mo.postHogWebVitalsCallbacks=Af,Mo.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Af;let Df=class{constructor(){this.t=void 0,this.o=0,this.i=[]}u(t){var e;if(!t.hadRecentInput){var i=this.i[0],r=this.i.at(-1);this.o&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var $f=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Nf=t=>{if("loading"===document.readyState)return"loading";var e=$f();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},qf=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},jf=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r=t,n=r.id?"#"+r.id:[qf(r),...Array.from(r.classList).sort()].join(".");if(e.length+n.length>99)return e||n;if(e=e?n+">"+e:n,r.id)break;t=r.parentNode}}catch(t){}return e},Bf=new WeakMap;function Hf(t,e){var i=Bf.get(e);return i||(i=new WeakMap,Bf.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var Uf,zf=-1,Wf=()=>zf,Vf=t=>{addEventListener("pageshow",(e=>{e.persisted&&(zf=e.timeStamp,t(e))}),!0)},Zf=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((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,i),t(e))}},Gf=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},Qf=()=>{var t,e;return null!==(t=null==(e=$f())?void 0:e.activationStart)&&void 0!==t?t:0},Jf=function(t,e){void 0===e&&(e=-1);var i=$f(),r="navigate";return 0>Wf()?i&&(document.prerendering||Qf()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-"))):r="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Kf=function(t,e,r){void 0===r&&(r={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return n.observe(i({type:t,buffered:!0},r)),n}}catch(t){}},Yf=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Xf=-1,tp=new Set,ep=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,ip=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of tp)e();isFinite(Xf)||(Xf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",ip,!0))}},rp=()=>{if(0>Xf){var t,e=Qf(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;Xf=null!=i?i:ep(),addEventListener("visibilitychange",ip,!0),addEventListener("prerenderingchange",ip,!0),Vf((()=>{setTimeout((()=>{Xf=ep()}))}))}return{get firstHiddenTime(){return Xf},onHidden(t){tp.add(t)}}},np=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},sp=[1800,3e3],ap=function(t,e){void 0===e&&(e={}),np((()=>{var i,r=rp(),n=Jf("FCP"),s=Kf("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-Qf(),0),n.entries.push(e),i(!0)))}));s&&(i=Zf(t,n,sp,e.reportAllChanges),Vf((r=>{n=Jf("FCP"),i=Zf(t,n,sp,e.reportAllChanges),Gf((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},op=[.1,.25],lp=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],up=0,hp=1/0,dp=0,vp=t=>{for(var e of t)e.interactionId&&(hp=Math.min(hp,e.interactionId),dp=Math.max(dp,e.interactionId),up=dp?(dp-hp)/7+1:0)},cp=()=>{var t;return Uf?up:null!==(t=performance.interactionCount)&&void 0!==t?t:0},fp=0;let pp=class{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){fp=cp(),this.l.length=0,this.h.clear()}M(){var t=Math.min(this.l.length-1,Math.floor((cp()-fp)/50));return this.l[t]}u(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.l.at(-1),r=this.h.get(t.interactionId);if(r||10>this.l.length||t.duration>i.T){var n;if(r?t.duration>r.T?(r.entries=[t],r.T=t.duration):t.duration===r.T&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.h.set((r={id:t.interactionId,entries:[t],T:t.duration}).id,r),this.l.push(r)),this.l.sort(((t,e)=>e.T-t.T)),this.l.length>10){var s=this.l.splice(10);for(var a of s)this.h.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}};var gp=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=Yf(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},mp=[200,500];let yp=class{constructor(){this.m=void 0}u(t){var e;null==(e=this.m)||e.call(this,t)}};var $=[2500,4e3],bp={onLCP(t,e){void 0===e&&(e={});var r=Hf(e=Object.assign({},e),yp),n=new WeakMap;r.m=t=>{var i=t.element;if(i){var r,s=null!==(r=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==r?r:jf(i);n.set(t,s)}else t.id&&n.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={}),np((()=>{var i,r=rp(),n=Jf("LCP"),s=Hf(e,yp),a=t=>{for(var a of(e.reportAllChanges||(t=t.slice(-1)),t))s.u(a),r.firstHiddenTime>a.startTime&&(n.value=Math.max(a.startTime-Qf(),0),n.entries=[a],i())},o=Kf("largest-contentful-paint",a);if(o){i=Zf(t,n,$,e.reportAllChanges);var l=Yf((()=>{a(o.takeRecords()),o.disconnect(),i(!0)})),u=t=>{t.isTrusted&&(gp(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});Vf((r=>{n=Jf("LCP"),i=Zf(t,n,$,e.reportAllChanges),Gf((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var r=t.entries.at(-1),s=r.url&&performance.getEntriesByType("resource").find((t=>t.name===r.url));e.target=n.get(r),e.lcpEntry=r,r.url&&(e.url=r.url),s&&(e.lcpResourceEntry=s);var a=$f();if(a){var o=a.activationStart||0,l=Math.max(0,a.responseStart-o),u=Math.max(l,s?(s.requestStart||s.startTime)-o:0),h=Math.min(t.value,Math.max(u,s?s.responseEnd-o:0));e=i({},e,{timeToFirstByte:l,resourceLoadDelay:u-l,resourceLoadDuration:h-u,elementRenderDelay:t.value-h,navigationEntry:a})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var i=Hf(e=Object.assign({},e),Df),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=lp(t.sources),s=null==n?void 0:n.node;if(s){var a,o=null!==(a=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==a?a:jf(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=rp();ap(Yf((()=>{var r,n=Jf("CLS",0),s=Hf(e,Df),a=t=>{for(var e of t)s.u(e);s.o>n.value&&(n.value=s.o,n.entries=s.i,r())},o=Kf("layout-shift",a);o&&(r=Zf(t,n,op,e.reportAllChanges),i.onHidden((()=>{a(o.takeRecords()),r(!0)})),Vf((()=>{s.o=0,n=Jf("CLS",0),r=Zf(t,n,op,e.reportAllChanges),Gf(r)})),setTimeout(r))})))}((e=>{t((t=>{var e={};if(t.entries.length){var i,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(i=n.sources)&&i.length){var s=lp(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Nf(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={}),ap((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Nf(Wf())};if(t.entries.length){var i=$f(),r=t.entries.at(-1);if(i){var n=Math.max(0,i.responseStart-(i.activationStart||0));e={timeToFirstByte:n,firstByteToFCP:t.value-n,loadState:Nf(t.entries[0].startTime),navigationEntry:i,fcpEntry:r}}}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var i=Hf(e=Object.assign({},e),pp),r=[],n=[],s=0,a=new WeakMap,o=new WeakMap,l=!1,u=()=>{l||(gp(h),l=!0)},h=()=>{var t=new Set(i.l.map((t=>a.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var o=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)o.add(v)}r=r.filter((t=>t.startTime>s||o.has(t))),l=!1};i.m=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var o=n.length-1;o>=0;o--){var l=n[o];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),!1!==e.includeProcessedEventEntries&&i.entries.push(t);break}}i||n.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:!1!==e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&a.set(t,i),u()},i.p=t=>{if(!o.get(t)){var i,r=null==(i=t.entries.find((t=>t.target)))?void 0:i.target;if(r){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:jf(r);o.set(t,s)}else{var a,l=null==(a=t.entries.find((t=>t.targetSelector)))?void 0:a.targetSelector;l&&o.set(t,l)}}};var d=(t,e)=>{var i=[];for(var n of r)if(n.startTime+n.duration>=t){if(n.startTime>e)break;i.push(n)}return i};Kf("long-animation-frame",(t=>{r=r.concat(t),u()})),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=rp();np((()=>{var r;"interactionCount"in performance||Uf||(Uf=Kf("event",vp,{durationThreshold:0}));var n,s=Jf("INP"),a=Hf(e,pp),o=t=>{gp((()=>{for(var e of t)a.u(e);var i=a.M();i&&i.T!==s.value&&(s.value=i.T,s.entries=i.entries,n())}))},l=Kf("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=Zf(t,s,mp,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{o(l.takeRecords()),n(!0)})),Vf((()=>{a.v(),s=Jf("INP"),n=Zf(t,s,mp,e.reportAllChanges)})))}))}}((e=>{t((t=>{var e=t.entries[0],r=a.get(e),n=e.processingStart,s=Math.max(e.startTime+e.duration,n),l=Math.min(r.processingEnd,s),u=r.entries.sort(((t,e)=>t.processingStart-e.processingStart)),h=d(e.startTime,l),v=i.h.get(e.interactionId),c={interactionTarget:o.get(v),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:s,processedEventEntries:u,longAnimationFrameEntries:h,inputDelay:n-e.startTime,processingDuration:l-n,presentationDelay:s-l,loadState:Nf(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{if(null!=(e=t.longAnimationFrameEntries)&&e.length){var i,r,n=t.interactionTime,s=t.inputDelay,a=t.processingDuration,o=0,l=0,u=0,h=0;for(var d of t.longAnimationFrameEntries)for(var v of(l=l+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var c=v.startTime+v.duration;if(c>=n){var f=c-Math.max(n,v.startTime),p=v.duration?f/v.duration*v.forcedStyleAndLayoutDuration:0;o+=f-p,l+=p,f>h&&(r=n+s>v.startTime?"input-delay":n+s+a>v.startTime?"processing-duration":"presentation-delay",i=v,h=f)}}var g=t.longAnimationFrameEntries.at(-1),m=g?g.startTime+g.duration:0;m>=n+s+a&&(u=t.nextPaintTime-m),i&&r&&(t.longestScript={entry:i,subpart:r,intersectingDuration:h}),t.totalScriptDuration=o,t.totalStyleAndLayoutDuration=l,t.totalPaintDuration=u,t.totalUnattributedDuration=t.nextPaintTime-n-o-l-u}})(c),Object.assign(t,{attribution:c})})(e))}),e)}};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=bp,Mo.__PosthogExtensions__.postHogWebVitalsCallbacks=bp,Mo.postHogWebVitalsCallbacks=bp;var _p=-1,wp=t=>{addEventListener("pageshow",(e=>{e.persisted&&(_p=e.timeStamp,t(e))}),!0)},xp=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((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,i),t(e))}},kp=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},Sp=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Cp=()=>{var t,e;return null!==(t=null==(e=Sp())?void 0:e.activationStart)&&void 0!==t?t:0},Mp=function(t,e){void 0===e&&(e=-1);var i=Sp(),r="navigate";return 0>_p?i&&(document.prerendering||Cp()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-"))):r="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Tp=new WeakMap;function Ep(t,e){var i=Tp.get(e);return i||(i=new WeakMap,Tp.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}class Ip{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var i=this.o[0],r=this.o.at(-1);this.i&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.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 Pp,Rp=function(t,e,r){void 0===r&&(r={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return n.observe(i({type:t,buffered:!0},r)),n}}catch(t){}},Lp=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Op=-1,Fp=new Set,Ap=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Dp=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Fp)e();isFinite(Op)||(Op="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Dp,!0))}},$p=()=>{if(0>Op){var t,e=Cp(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;Op=null!=i?i:Ap(),addEventListener("visibilitychange",Dp,!0),addEventListener("prerenderingchange",Dp,!0),wp((()=>{setTimeout((()=>{Op=Ap()}))}))}return{get firstHiddenTime(){return Op},onHidden(t){Fp.add(t)}}},Np=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},qp=[1800,3e3],jp=function(t,e){void 0===e&&(e={}),Np((()=>{var i,r=$p(),n=Mp("FCP"),s=Rp("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-Cp(),0),n.entries.push(e),i(!0)))}));s&&(i=xp(t,n,qp,e.reportAllChanges),wp((r=>{n=Mp("FCP"),i=xp(t,n,qp,e.reportAllChanges),kp((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},Bp=[.1,.25],Hp=0,Up=1/0,zp=0,Wp=t=>{for(var e of t)e.interactionId&&(Up=Math.min(Up,e.interactionId),zp=Math.max(zp,e.interactionId),Hp=zp?(zp-Up)/7+1:0)},Vp=()=>{var t;return Pp?Hp:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Zp=0;class Gp{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){Zp=Vp(),this.l.length=0,this.u.clear()}T(){var t=Math.min(this.l.length-1,Math.floor((Vp()-Zp)/50));return this.l[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.l.at(-1),r=this.u.get(t.interactionId);if(r||10>this.l.length||t.duration>i.L){var n;if(r?t.duration>r.L?(r.entries=[t],r.L=t.duration):t.duration===r.L&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.u.set((r={id:t.interactionId,entries:[t],L:t.duration}).id,r),this.l.push(r)),this.l.sort(((t,e)=>e.L-t.L)),this.l.length>10){var s=this.l.splice(10);for(var a of s)this.u.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}}var Qp=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=Lp(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},Jp=[200,500];class Kp{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var Yp=[2500,4e3],Xp={onLCP(t,e){void 0===e&&(e={}),Np((()=>{var i,r=$p(),n=Mp("LCP"),s=Ep(e,Kp),a=t=>{for(var a of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(a),r.firstHiddenTime>a.startTime&&(n.value=Math.max(a.startTime-Cp(),0),n.entries=[a],i())},o=Rp("largest-contentful-paint",a);if(o){i=xp(t,n,Yp,e.reportAllChanges);var l=Lp((()=>{a(o.takeRecords()),o.disconnect(),i(!0)})),u=t=>{t.isTrusted&&(Qp(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});wp((r=>{n=Mp("LCP"),i=xp(t,n,Yp,e.reportAllChanges),kp((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var i=$p();jp(Lp((()=>{var r,n=Mp("CLS",0),s=Ep(e,Ip),a=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,r())},o=Rp("layout-shift",a);o&&(r=xp(t,n,Bp,e.reportAllChanges),i.onHidden((()=>{a(o.takeRecords()),r(!0)})),wp((()=>{s.i=0,n=Mp("CLS",0),r=xp(t,n,Bp,e.reportAllChanges),kp(r)})),setTimeout(r))})))},onFCP:jp,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=$p();Np((()=>{var r;"interactionCount"in performance||Pp||(Pp=Rp("event",Wp,{durationThreshold:0}));var n,s=Mp("INP"),a=Ep(e,Gp),o=t=>{Qp((()=>{for(var e of t)a.h(e);var i=a.T();i&&i.L!==s.value&&(s.value=i.L,s.entries=i.entries,n())}))},l=Rp("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=xp(t,s,Jp,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{o(l.takeRecords()),n(!0)})),wp((()=>{a.v(),s=Mp("INP"),n=xp(t,s,Jp,e.reportAllChanges)})))}))}}};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=Xp,Mo.__PosthogExtensions__.postHogWebVitalsCallbacks=Xp,Mo.postHogWebVitalsCallbacks=Xp,Mo.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Xp;class tg{constructor(t){this.disabled=!1===t;var e=Zi(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>i-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:i}];return!1}}var eg="$copy_autocapture",ig=$s("[AutoCapture]");function rg(t,e){return e.length>t?e.slice(0,t)+"...":e}function ng(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!ca(e));return e}function sg(t,e){var r,n,s=e.e,a=e.maskAllElementAttributes,o=e.maskAllText,l=e.elementAttributeIgnoreList,u=e.elementsChainAsString,h=e.disableCaptureUrlHashes;if(!ca(t))return{props:{}};for(var d=[t],v=new Set([t]),c=t;c.parentNode&&!fa(c,"body")&&ma>d.length;)if(ga(c.parentNode)){var f=c.parentNode.host;if(v.has(f))break;v.add(f),d.push(f),c=f}else{if(!ca(c.parentNode))break;if(v.has(c.parentNode))break;v.add(c.parentNode),d.push(c.parentNode),c=c.parentNode}var p,g,m=[],y={},b=!1,_=!1;if(qs(d,(t=>{var e=$a(t);if(fa(t,"a")){var i=t.getAttribute("href");b=!!(e&&i&&Va(i))&&(h?kn(i):i)}Ni(_a(t),"ph-no-capture")&&(_=!0),m.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),a={tag_name:s};Sa.indexOf(s)>-1&&!i&&(a.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?rg(1024,Za(t)):rg(1024,xa(t)));var o=_a(t);o.length>0&&(a.classes=o.filter((function(t){return""!==t}))),qs(t.attributes,(function(i){var s;if((!Na(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Va(i.value)&&(!Ji(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var o=i.value;"class"===i.name&&(o=ya(o).join(" ")),a["attr__"+i.name]=rg(1024,"href"===i.name&&n?kn(o):o)}}));for(var l=1,u=1,h=t;h=ng(h);)l++,h.tagName===t.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(t,a,o,l,h));var r=function(t){if(!$a(t))return{};var e={};return qs(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var i=t.name.replace("data-ph-capture-attribute-",""),r=t.value;i&&r&&Va(r)&&(e[i]=r)}})),e}(t);js(y,r)})),_)return{props:{},explicitNoCapture:_};if(o||(m[0].$el_text=fa(t,"a")||fa(t,"button")?Za(t):xa(t)),b){var w,x;m[0].attr__href=b;var k=null==(w=Js(b))?void 0:w.host,S=null==xs||null==(x=xs.location)?void 0:x.host;k&&S&&k!==S&&(p=b)}return{props:js({$event_type:s.type,$ce_version:1},u?{}:{$elements:m},{$elements_chain:(g=m,function(t){return t.map((t=>{var e,r,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var a=i({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(r=t.nth_of_type)&&void 0!==r?r:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),o={};return Bs(a).sort(((t,e)=>t[0].localeCompare(e[0]))).forEach((t=>{var e=t[1];return o[Qa(t[0].toString())]=Qa(e.toString())})),(n+=":")+Bs(o).map((t=>t[0]+'="'+t[1]+'"')).join("")})).join(";")}(function(t){return t.map((t=>{var e,i,r={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(i=t.attr__href)?void 0:i.slice(0,2048),attr_class:Ja(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Bs(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>r.attributes[t[0]]=t[1])),r}))}(g)))},null!=(r=m[0])&&r.$el_text?{$el_text:null==(n=m[0])?void 0:n.$el_text}:{},p&&"click"===s.type?{$external_click_url:p}:{},y)}}var ag={};function og(t,e){var i=ag[t];if(i)return i;var r=e[t];if((t=>Vi(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&(null==xs||!xs.Zone))return ag[t]=r.bind(e);var n=e.document;if(n&&Vi(n.createElement)){var s,a=!1;try{(s=n.createElement("iframe")).hidden=!0,n.head.appendChild(s);var o,l,u=s.contentWindow;u&&u[t]&&(r=u[t],"MutationObserver"===t&&function(t){return Ni(t,"AppleWebKit")&&!Ni(t,"Chrome")}(null!==(o=null==(l=e.navigator)?void 0:l.userAgent)&&void 0!==o?o:"")&&(s.classList.add("rr-block","ph-no-capture"),a=!0))}catch(e){Ds.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var h;!a&&null!=(h=s)&&h.parentNode&&s.parentNode.removeChild(s)}}return r&&Vi(r)?ag[t]=r.bind(e):r}function lg(t,e){var r=ka(t);return r?i({node:r,originalEvent:t,timestamp:Date.now()},e):null}function ug(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function hg(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var dg="canvas,video,audio,embed,object";function vg(t,e){return tr(t)&&t>=e}class cg{me(t){var e,i,r,n,s,a,o,l,u=this.ye((null==t?void 0:t.__onCapture)||this.ge.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(i=null==t?void 0:t.scroll_threshold_ms)&&void 0!==i?i:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==r?r:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(a=null==t?void 0:t.capture_dead_swipes)&&void 0!==a?a:u.capture_dead_swipes,swipe_threshold_px:null!==(o=null==t?void 0:t.swipe_threshold_px)&&void 0!==o?o:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.be=[],this.we=0,this.ye=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.ke=t=>{var e=lg(t,{type:"click"});Yi(e)||this.xe(e)||this.be.push(e),this.Se()},this.Ce=()=>{var t=Date.now();this.Me=t,t%50==0&&this.be.forEach((e=>{Qi(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Te=()=>{this._e=Date.now()},this.Ie=()=>{"visible"===(null==Cs?void 0:Cs.visibilityState)&&(this.Ee=Date.now())},this.Le=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.Re=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.Oe=()=>{this.Re=void 0},this.Ne=t=>{var e,i=this.Re;if(this.Re=void 0,!Qi(i)&&this.Pe.max_dead_swipes_per_page_load>this.we){var r=t,n=null==(e=r.changedTouches)?void 0:e[0];if(n){var s=n.clientX-i.x,a=n.clientY-i.y,o=s*s+a*a,l=this.Pe.swipe_threshold_px;if(o>=l*l&&![this.Me,this.Ae,this._e].some((t=>tr(t)&&t>=i.timestamp))){var u;if(this.De()&&(null!==(u=null==Cs||null==Cs.elementsFromPoint?void 0:Cs.elementsFromPoint(i.x,i.y))&&void 0!==u?u:[]).some((t=>null==t.matches?void 0:t.matches(dg))))return;var h=lg(r,{type:"swipe",swipeDirection:ug(s,a),swipeDistancePx:Math.round(Math.sqrt(o))});Yi(h)||this.xe(h)||this.be.push(h),this.Se()}}}},this.instance=t,this.Pe=this.me(e),this._onCapture=this.Pe.__onCapture}start(t){this.qe(),this.Fe(),this.je(),this.He(),this.Be(t),this.Pe.capture_dead_swipes&&this.Ue()}Be(t){if(!this.We){var e=function(t){return og("MutationObserver",t)}(Mo);this.We=new e((t=>{this.Ve(t)})),this.We.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.We)||t.disconnect(),this.We=void 0,Mo.removeEventListener("click",this.ke),Mo.removeEventListener("scroll",this.Ce,{capture:!0}),Mo.removeEventListener("selectionchange",this.Te),Mo.removeEventListener("touchstart",this.Le,{capture:!0}),Mo.removeEventListener("touchend",this.Ne,{capture:!0}),Mo.removeEventListener("touchcancel",this.Oe,{capture:!0}),null==Cs||Cs.removeEventListener("visibilitychange",this.Ie),this.Re=void 0}Ve(t){this.Ae=Date.now()}qe(){Zs(Mo,"click",this.ke)}Se(){this.be.length&&Qi(this.Ze)&&(this.Ze=Mo.setTimeout((()=>{this.ze()}),1e3))}Fe(){Zs(Mo,"scroll",this.Ce,{capture:!0})}je(){Zs(Mo,"selectionchange",this.Te)}He(){Zs(Cs,"visibilitychange",this.Ie)}Ue(){Zs(Mo,"touchstart",this.Le,{capture:!0,passive:!0}),Zs(Mo,"touchend",this.Ne,{capture:!0,passive:!0}),Zs(Mo,"touchcancel",this.Oe,{capture:!0,passive:!0})}De(){var t=Qi(this.$e)||tr(this.Ae)&&this.Ae>this.$e;return(Qi(this.Qe)||t)&&(this.$e=Date.now(),this.Qe=!(null==Cs||!Cs.querySelector(dg))),!!this.Qe}xe(t){return!t||("swipe"===t.type?this.Ge(t):this.Ye(t))}Ge(t){if(va(t.node))return!0;var e=this.be.some((e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!e&&!fa(t.node,"html")&&ca(t.node)&&function(t,e){var i;if(!xs||Aa(t))return!1;var r=ir(e)?Ra:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:Ra;return!Ca(Da(t,!1).targetElementList,r)}(t.node,{css_selector_ignorelist:this.Pe.css_selector_ignorelist}))}Ye(t){return!(this.Pe.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.Ge(t)||(i=t.node,!(!xs||Aa(i))&&Da(i,!1).targetElementList.some((t=>fa(t,"a"))));var e,i}ze(){if(this.be.length){clearTimeout(this.Ze),this.Ze=void 0;var t=this.be;for(var e of(this.be=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.Ae&&this.Ae>=e.timestamp?this.Ae-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this._e&&this._e>=e.timestamp?this._e-e.timestamp:void 0,e.visibilityChangedDelayMs=this.Ee?Math.abs(e.timestamp-this.Ee):void 0;var r=vg(e.scrollDelayMs,this.Pe.scroll_threshold_ms),n=vg(e.selectionChangedDelayMs,this.Pe.selection_change_threshold_ms),s=vg(e.mutationDelayMs,this.Pe.mutation_threshold_ms),a=vg(e.absoluteDelayMs,1.1*this.Pe.mutation_threshold_ms),o=tr(e.scrollDelayMs)&&this.Pe.scroll_threshold_ms>e.scrollDelayMs,l=tr(e.mutationDelayMs)&&this.Pe.mutation_threshold_ms>e.mutationDelayMs,u=tr(e.selectionChangedDelayMs)&&this.Pe.selection_change_threshold_ms>e.selectionChangedDelayMs,h=tr(e.visibilityChangedDelayMs)&&this.Pe.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(o||l||u||h)){var d=vg(e.visibilityChangedDelayMs,this.Pe.selection_change_threshold_ms);if(r||s||a||n||d){var v=hg(e);if("$dead_swipe"===v){if(this.we>=this.Pe.max_dead_swipes_per_page_load)continue;this.we++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.Ae,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:a,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:d})}else this.Pe.mutation_threshold_ms>e.absoluteDelayMs&&this.be.push(e)}}this.Se()}}ge(t,e){var r=hg(t);this.instance.capture(r,i({},e,sg(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Pe.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[r+"_scroll_delay_ms"]:t.scrollDelayMs,[r+"_mutation_delay_ms"]:t.mutationDelayMs,[r+"_absolute_delay_ms"]:t.absoluteDelayMs,[r+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[r+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}}Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new cg(t,e);var fg=$s("[ExternalScriptsLoader]"),pg=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return fg.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=null==Cs?void 0:Cs.querySelectorAll("script");if(r)for(var n,s=function(){if(r[a].src===e){var t=r[a];return t.__posthog_loading_callback_fired?{v:i()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,i(void 0,e)})),t.onerror=t=>i(t),{v:void 0})}},a=0;r.length>a;a++)if(n=s())return n.v;var o=()=>{if(!Cs)return i("document not found");var r=Cs.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=e,r.onload=t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)},r.onerror=t=>i(t),t.config.prepare_external_dependency_script&&(r=t.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)Cs.head.appendChild(r);else{var n,s=Cs.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(r,s[0]):Cs.body.appendChild(r)}};null!=Cs&&Cs.body?o():null==Cs||Cs.addEventListener("DOMContentLoaded",o)};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{if("remote-config"!==e){var r;if(t.config.strict_script_versioning)r=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}r=t.requestRouter.endpointFor("assets",n)}pg(t,r,i)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");pg(t,a,i)}},Mo.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);pg(t,r,i)};Fs.DEBUG=!1,Fs.LIB_VERSION="1.412.0",Fs.LIB_NAME="web";class gg{constructor(t){this._instance=t}get Pe(){return this._instance.config}get consent(){return this.ti()?0:this.ei}isOptedOut(){return this.Pe.cookieless_mode===Th||this.isRejected()||-1===this.consent&&this.Pe.cookieless_mode===Mh}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Pe.opt_out_capturing_by_default}optInOut(t){this.ii.A(this.ri,t?1:0,this.Pe.cookie_expiration,this.Pe.cross_subdomain_cookie,this.Pe.secure_cookie)}reset(){this.ii.F(this.ri,this.Pe.cross_subdomain_cookie)}get ri(){var t=this._instance.config,e=t.token,i=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(i?i+e:"__ph_opt_in_out_"+e)}get ei(){var t=this.ii.q(this.ri);return dr(t)?1:Ni(vr,t)?0:-1}get ii(){var t=this.Pe.opt_out_capturing_persistence_type,e="localStorage"===t?td:Yh;if(!this.ni||this.ni!==e){this.ni=e;var i="localStorage"===t?Yh:td;i.q(this.ri)&&(this.ni.q(this.ri)||this.optInOut(dr(i.q(this.ri))),i.F(this.ri,this.Pe.cross_subdomain_cookie))}return this.ni}ti(){return!!this.Pe.respect_dnt&&[null==Ss?void 0:Ss.doNotTrack,null==Ss?void 0:Ss.msDoNotTrack,Mo.doNotTrack].some((t=>dr(t)))}}var mg=$s("[Dead Clicks]"),yg=()=>!0,bg=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(Au)),r=t.instance.config.capture_dead_clicks;return ir(r)?r:!!Zi(r)||i};class _g{get lazyLoadedDeadClicksAutocapture(){return this.si}constructor(t,e,i){this.instance=t,this.isEnabled=e,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Au]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.ai((()=>{this.oi()})):this.stop()}ai(t){var e,i;null!=(e=Mo.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(i=Mo.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?mg.error("failed to load script",e):t()}))}oi(){var t;if(Cs){if(!this.si&&null!=(t=Mo.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Zi(this.instance.config.capture_dead_clicks)?i({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.si=Mo.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.si.start(Cs),mg.info("starting...")}}else mg.error("`document` not found. Cannot start.")}stop(){this.si&&(this.si.stop(),this.si=void 0,mg.info("stopping..."))}}var wg=$s("[SegmentIntegration]");var xg="posthog-js";function kg(t,e){var r=void 0===e?{}:e,n=r.organization,s=r.projectId,a=r.prefix,o=r.severityAllowList,l=void 0===o?["error"]:o,u=r.sendExceptionsToPostHog,h=void 0===u||u;return e=>{var r,o,u,d,v;if("*"!==l&&!l.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var c=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=c,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f,p=(null==(r=e.exception)?void 0:r.values)||[],g=p.map((t=>i({},t,{stacktrace:t.stacktrace?i({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>i({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(o=p[0])?void 0:o.value)||e.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(v=p[0])?void 0:v.type,$sentry_tags:e.tags};return n&&s&&(m.$sentry_url=(a||"https://sentry.io/organizations/")+n+"/issues/?project="+s+"&query="+e.event_id),h&&(null==(f=t.exceptions)||f.sendExceptionEvent(m)),e}}class Sg{constructor(t,e,i,r,n,s){this.name=xg,this.setupOnce=function(a){a(kg(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class Cg{constructor(t){this.li=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Ds.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.ui=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.hi()}hi(){var t;this.di=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.li)}destroy(){var t;null==(t=this.di)||t.call(this),this.di=void 0}doPageView(t,e){var i,r=this.vi(t,e);return this.ui={pathname:null!==(i=null==xs?void 0:xs.location.pathname)&&void 0!==i?i:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.vi(t,null==(e=this.ui)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ui)?void 0:t.pageViewId}}vi(t,e){var i=this.ui;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var s=n.maxScrollHeight,a=n.lastScrollY,o=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(Qi(s)||Qi(a)||Qi(o)||Qi(l)||Qi(u)||Qi(h))){s=Math.ceil(s),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?cr(a/s,0,1,Ds):1,v=s>1?cr(o/s,0,1,Ds):1,c=l>1?cr(u/l,0,1,Ds):1,f=l>1?cr(h/l,0,1,Ds):1;r=js(r,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}}var Mg=["flags","surveys"],Tg={[Su]:{exposure:"hidden"},[Tu]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Eu]:{exposure:"hidden"},[Iu]:{exposure:"event"},[Pu]:{exposure:"hidden"},[Ru]:{exposure:"event"},[Lu]:{exposure:"hidden"},[Ou]:{exposure:"event"},[Fu]:{exposure:"event"},[Au]:{exposure:"event"},[Du]:{exposure:"hidden"},[$u]:{exposure:"event"},[Nu]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[zu]:{exposure:"hidden"},[Wu]:{exposure:"event"},[qu]:{exposure:"event",shouldSkipFromEventProperties:t=>Yi(t)},$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"},$sess_rec_flush_size:{exposure:"hidden"},[Vu]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Zi(t))return{};for(var e={},i=Object.keys(t),r=0;i.length>r;r++)e["$feature/"+i[r]]=t[i[r]];return e}},[Zu]:{exposure:"event",storageGroup:"flags"},[Gu]:{exposure:"hidden"},[Qu]:{exposure:"hidden",storageGroup:"flags"},[Ju]:{exposure:"event",storageGroup:"flags"},[Ku]:{exposure:"event",storageGroup:"flags",volatile:!0},[Yu]:{exposure:"hidden",storageGroup:"flags"},[Xu]:{exposure:"event"},[th]:{exposure:"hidden"},[eh]:{exposure:"hidden"},[ih]:{exposure:"hidden"},[rh]:{exposure:"hidden",storageGroup:"surveys"},[nh]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[sh]:{exposure:"event"},[ah]:{exposure:"hidden"},[oh]:{exposure:"hidden"},[lh]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[uh]:{exposure:"hidden"},[hh]:{exposure:"hidden"},[dh]:{exposure:"hidden"},[vh]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ch]:{exposure:"hidden"},[fh]:{exposure:"hidden"},[ph]:{exposure:"hidden"},[gh]:{exposure:"hidden"},[mh]:{exposure:"hidden"},[yh]:{exposure:"hidden"},[bh]:{exposure:"hidden"},[ju]:{exposure:"event"},[Bu]:{exposure:"event"},[Hu]:{exposure:"event"},[Uu]:{exposure:"event"},[xh]:{exposure:"event"},[kh]:{exposure:"event"},[Sh]:{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"}},Eg=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Ig=t=>{var e=Tg[t];if(e)return e;for(var i of Eg){var r=i[1];if(0===t.indexOf(i[0]))return r}},Pg={flags:vh,surveys:nh},Rg=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Lg="main";class Og{constructor(t,e,r){if(void 0===r&&(r=!0),this.ci={},this.fi=!1,this.pi=!1,this.Pe=t,this.gi=r,this.props={},this.mi=void 0,this.yi=(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.ii=this.bi(t),this.pi=this.wi(t),this.load(),t.debug&&Ds.info("Persistence loaded",t.persistence,i({},this.props)),this.update_config(t,t,e),this.save(),xs){var n=()=>this.flush();Zs(xs,"beforeunload",n,{capture:!1}),Zs(xs,"pagehide",n,{capture:!1})}}xi(){var t,e=null==(t=this.Pe)?void 0:t.persistence_save_debounce_ms;return tr(e)&&e>0?e:0}isDisabled(){return!!this.ki}bi(t){-1===Rg.indexOf(t.persistence.toLowerCase())&&(Ds.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,r=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var r=[...ed,...t];return i({},td,{H(t){try{var i={};try{i=Yh.H(t)||{}}catch(t){}var r,n=JSON.parse(td.q(t)||"{}");if(e){var s={};for(var a in i){var o=i[a];Yi(o)||""===o||(s[a]=o)}r=js(n,s)}else r=js(i,n);return td.A(t,r),r}catch(t){}return null},A(t,e,i,n,s,a){var o=td.A(t,e,void 0,void 0,a);try{var l={};r.forEach((t=>{e[t]&&(l[t]=e[t])})),Object.keys(l).length&&Yh.A(t,l,i,n,s,a)}catch(t){td.j(t)}return o},F(t,e){try{null==xs||xs.localStorage.removeItem(t),Yh.F(t,e)}catch(t){td.j(t)}}})}(t.cookie_persisted_properties||[],t.__preview_cookie_wins_on_conflict||!1),n=!1,s=t.persistence.toLowerCase();return"localstorage"===s&&td.P()?(e=td,n=!0):"localstorage+cookie"===s&&r.P()?(e=r,n=!0):"sessionstorage"===s&&sd.P()?e=sd:"memory"===s?e=rd:"cookie"===s?e=Yh:r.P()?(e=r,n=!0):e=Yh,this.fi=n,e}Si(t){return this.yi+"__"+t}wi(t){return this.fi&&!!t.split_storage}Ci(t){var e=null!=t?t:this.Pe.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var i=this.props[vh];return!i||"number"!=typeof i||Date.now()-i>e}properties(){var t={};return qs(this.props,((e,i)=>{var r=Ig(i);if("derived"===(null==r?void 0:r.exposure)){if(null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e,i===Vu?()=>this.Ci():()=>!1))return;r.transformToEventProperties&&js(t,r.transformToEventProperties(e))}else if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e,(()=>!1)))return;t[i]=e}})),t}load(){if(!this.ki){var t=this.ii.H(this.yi);t&&(this.props=js({},t)),this.pi&&this.Mi()}}Mi(){for(var t of Mg){var e=td.H(this.Si(t));if(e&&!Gi(e)){var i=this.Ti(t);i.persisted=!0,this.Ei(t)||(i.fingerprint=this.Ii(e,t)),this.Pi(t,e)||js(this.props,e)}}}Ei(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=Ig(e))?void 0:i.storageGroup)===t}))}Pi(t,e){var i=Pg[t];if(!i)return!1;var r=e[i],n=this.props[i];return tr(r)&&tr(n)&&n>r}refreshKey(t){var e;if(!this.ki){var i=this.pi?null==(e=Ig(t))?void 0:e.storageGroup:void 0,r=i?td.H(this.Si(i)):this.ii.H(this.yi);if(r&&t in r)this.Ri(t,r[t]);else{if(i){var n=this.ii.H(this.yi);if(n&&t in n)return void this.Ri(t,n[t])}this.Li(t)}}}save(){if(!this.ki){var t=this.xi();t>0?Qi(this.Oi)&&(this.Oi=setTimeout((()=>{this.Oi=void 0,this.Fi()}),t)):this.Fi()}}flush(){Qi(this.Oi)||(clearTimeout(this.Oi),this.Oi=void 0,this.Fi())}Fi(){this.ki||(this.pi?this.Ai():this.Di(this.ii,this.yi,this.props,Lg))}Ai(){var t=this.$i(),e=t.main,i=t.groups;for(var r of(this.Di(this.ii,this.yi,e,Lg),Mg)){var n,s=i[r];(!Gi(s)||null!=(n=this.ci[r])&&n.persisted)&&this.Di(td,this.Si(r),s,r)}}$i(){var t={},e={flags:{},surveys:{}};return qs(this.props,((i,r)=>{var n,s=null==(n=Ig(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i})),{main:t,groups:e}}Ii(t,e){if(e===Lg)return JSON.stringify(t)+"|"+this.Ni+"|"+this.qi+"|"+this.ji;var i={};return qs(t,((t,e)=>{var r;i[e]=null!=(r=Ig(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}Di(t,e,i,r){var n=this.Ti(r);if(r===Lg||n.dirty||Qi(n.fingerprint)){var s;try{if((s=this.Ii(i,r))===n.fingerprint)return void(n.dirty=!1)}catch(t){s=void 0}t.A(e,i,this.Ni,this.qi,this.ji,this.Pe.debug)?(n.dirty=!1,r!==Lg&&(n.persisted=!0),Qi(s)||(n.fingerprint=s)):this.Pe.debug&&Ds.warn('failed to persist storage entry "'+e+'"; will retry on next save')}}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(Qi(this.Oi)||(clearTimeout(this.Oi),this.Oi=void 0),this.ii.F(this.yi,!1),this.ii.F(this.yi,!0),!i&&this.gi)for(var r of Mg)td.F(this.Si(r));i?delete this.ci[Lg]:this.ci={}}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Zi(t)){Qi(e)&&(e="None"),this.Ni=Qi(i)?this.Bi:i;var r=!1;if(qs(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Ri(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(Zi(t)){this.Ni=Qi(e)?this.Bi:e;var i=!1;if(qs(t,((e,r)=>{t.hasOwnProperty(r)&&this.props[r]!==e&&(this.Ri(r,e),i=!0)})),i)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Li(t),this.save())}update_campaign_params(){var t=null==Cs?void 0:Cs.URL;if(t!==this.mi){var e=pv(this.Pe.custom_campaign_params,this.Pe.mask_personal_data_properties,this.Pe.custom_personal_data_properties);Gi(zs(e))||this.register(e),this.mi=t}}update_search_keyword(){var t;this.register((t=null==Cs?void 0:Cs.referrer)?mv(t):{})}update_referrer_info(){var t;this.register_once({$referrer:_v(),$referring_domain:null!=Cs&&Cs.referrer&&(null==(t=Js(Cs.referrer))?void 0:t.host)||bv},void 0)}set_initial_person_info(){this.props[gh]||this.props[mh]||this.register_once({[yh]:wv(this.Pe.mask_personal_data_properties,this.Pe.custom_personal_data_properties,this.Pe.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};qs([mh,gh],(e=>{var i=this.props[e];i&&qs(i,(function(e,i){t["$initial_"+ji(i)]=e}))}));var e=this.props[yh];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=xv(t,e),r={};return qs(i,(function(t,e){r["$initial_"+ji(e)]=t})),r}(e,this.Pe.disable_capture_url_hashes);js(t,i)}return t}safe_merge(t){return qs(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){this.Bi=this.Ni=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!i),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie);var r=t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every(((t,e)=>t===r[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),n=r?this.bi(t):this.ii,s=this.wi(t);if(r||s!==this.pi){var a=this.props;this.clear(),this.ii=n,this.pi=s,this.props=a,this.save()}}set_disabled(t){this.ki=t,this.ki?this.remove():this.save()}set_cross_subdomain(t){t!==this.qi&&(this.qi=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.ji&&(this.ji=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[Eu]||{};i[t]=e,this.Ri(Eu,i),this.save()}remove_event_timer(t){var e=this.props[Eu]||{},i=e[t];return Qi(i)||(delete e[t],this.Ri(Eu,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Ri(t,e),this.save()}Ri(t,e){var i;this.props[t]=e,null!=(i=Ig(t))&&i.volatile||this.Hi(t)}Li(t){delete this.props[t],this.Hi(t)}Hi(t){var e,i=null==(e=Ig(t))?void 0:e.storageGroup;i&&(this.Ti(i).dirty=!0)}Ti(t){return this.ci[t]||(this.ci[t]={})}}var Fg=$s("[RateLimiter]");class Ag{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=>{Fg.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void Fg.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,i,r;void 0===t&&(t=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,a=(new Date).getTime(),o=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(ph))&&void 0!==e?e:{tokens:n,last:a};o.tokens+=(a-o.last)/1e3*s,o.last=a,o.tokens>n&&(o.tokens=n);var l=1>o.tokens;if(l||t||(o.tokens=Math.max(0,o.tokens-1)),l&&!t){var u=(tr(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.Ui(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(ph,o),{isRateLimited:l,remainingTokens:o.tokens}}zi(t){var e=this.instance.config.property_denylist;return!Wi(e)||!e.includes(t)}Wi(){var t;if(this.zi("$current_url")&&this.zi("$pathname")&&null!=Ms&&Ms.pathname)return""+(null!==(t=Ms.origin)&&void 0!==t?t:"")+Ms.pathname}Ui(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.Wi(),a=this.zi("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,o=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,a?"session "+a:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+o+". Config is set to "+n+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Dg=$s("[RemoteConfig]");class $g{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=Mo._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Vi(t){var e,i;null!=(e=Mo.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=Mo.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Zi(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t})}load(){try{if(this.remoteConfig)return Dg.info("Using preloaded remote config",this.remoteConfig),this.Gi(this.remoteConfig),void this.Qi();if(this._instance.Ji())return void Dg.warn("Remote config is disabled. Falling back to local config.");this.Vi((t=>{if(!t)return Dg.info("No config found after loading remote JS config. Falling back to JSON."),void this.Zi((t=>{this.Gi(t.json,t),this.Qi()}));this.Gi(t),this.Qi()}))}catch(t){Dg.error("Error loading remote config",t),this.Gi()}}stop(){this.Ki&&(clearInterval(this.Ki),this.Ki=void 0)}refresh(){!this._instance.Ji()&&Cs&&"hidden"!==Cs.visibilityState&&this._instance.reloadFeatureFlags()}Qi(){var t;if(!this.Ki){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.Ki=setInterval((()=>{this.refresh()}),e))}}Gi(t,e){!t&&e&&(0===e.statusCode?e.error||Dg.warn("Failed to fetch remote config from PostHog."):Dg.error("Failed to fetch remote config from PostHog."));try{this._instance.Gi(t?{ok:!0,config:t}:{ok:!1})}catch(t){Dg.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(t){Dg.error("Error loading feature flags",t)}}}var Ng=Uint8Array,qg=Uint16Array,jg=Uint32Array,Bg=new Ng([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]),Hg=new Ng([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]),Ug=new Ng([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zg=function(t,e){for(var i=new qg(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new jg(i[30]);for(r=1;30>r;++r)for(var s=i[r];i[r+1]>s;++s)n[s]=s-i[r]<<5|r;return[i,n]},Wg=zg(Bg,2),Vg=Wg[1];Wg[0][28]=258,Vg[258]=28;for(var Zg=zg(Hg,0)[1],Gg=new qg(32768),Qg=0;32768>Qg;++Qg){var Jg=(43690&Qg)>>>1|(21845&Qg)<<1;Gg[Qg]=((65280&(Jg=(61680&(Jg=(52428&Jg)>>>2|(13107&Jg)<<2))>>>4|(3855&Jg)<<4))>>>8|(255&Jg)<<8)>>>1}var Kg=function(t,e,i){for(var r=t.length,n=0,s=new qg(e);r>n;++n)++s[t[n]-1];var a,o=new qg(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(i){a=new qg(1<<e);var l=15-e;for(n=0;r>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=o[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)a[Gg[d]>>>l]=u}else for(a=new qg(r),n=0;r>n;++n)a[n]=Gg[o[t[n]-1]++]>>>15-t[n];return a},Yg=new Ng(288);for(Qg=0;144>Qg;++Qg)Yg[Qg]=8;for(Qg=144;256>Qg;++Qg)Yg[Qg]=9;for(Qg=256;280>Qg;++Qg)Yg[Qg]=7;for(Qg=280;288>Qg;++Qg)Yg[Qg]=8;var Xg=new Ng(32);for(Qg=0;32>Qg;++Qg)Xg[Qg]=5;var tm=Kg(Yg,9,0),em=Kg(Xg,5,0),im=function(t){return(t/8>>0)+(7&t&&1)},rm=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof qg?qg:t instanceof jg?jg:Ng)(i-e);return r.set(t.subarray(e,i)),r},nm=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},sm=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},am=function(t,e){for(var i=[],r=0;t.length>r;++r)t[r]&&i.push({s:r,f:t[r]});var n=i.length,s=i.slice();if(!n)return[new Ng(0),0];if(1==n){var a=new Ng(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=n-1;)o=i[i[d].f>i[u].f?u++:d++],l=i[u!=h&&i[d].f>i[u].f?u++:d++],i[h++]={s:-1,f:o.f+l.f,l:o,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new qg(v+1),f=om(i[h-1],c,0);if(f>e){r=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return c[e.s]-c[t.s]||t.f-e.f}));n>r;++r){var y=s[r].s;if(e>=c[y])break;p+=m-(1<<f-c[y]),c[y]=e}for(p>>>=g;p>0;){var b=s[r].s;e>c[b]?p-=1<<e-c[b]++-1:++r}for(;r>=0&&p;--r){var _=s[r].s;c[_]==e&&(--c[_],++p)}f=e}return[new Ng(c),f]},om=function(t,e,i){return-1==t.s?Math.max(om(t.l,e,i+1),om(t.r,e,i+1)):e[t.s]=i},lm=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new qg(++e),r=0,n=t[0],s=1,a=function(t){i[r++]=t},o=1;e>=o;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[i.subarray(0,r),e]},um=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},hm=function(t,e,i){var r=i.length,n=im(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;r>s;++s)t[n+s+4]=i[s];return 8*(n+4+r)},dm=function(t,e,i,r,n,s,a,o,l,u,h){nm(e,h++,i),++n[256];for(var d=am(n,15),v=d[0],c=d[1],f=am(s,15),p=f[0],g=f[1],m=lm(v),y=m[0],b=m[1],_=lm(p),w=_[0],x=_[1],k=new qg(19),S=0;y.length>S;++S)k[31&y[S]]++;for(S=0;w.length>S;++S)k[31&w[S]]++;for(var C=am(k,7),M=C[0],T=C[1],E=19;E>4&&!M[Ug[E-1]];--E);var I,P,R,L,O=u+5<<3,F=um(n,Yg)+um(s,Xg)+a,A=um(n,v)+um(s,p)+a+14+3*E+um(k,M)+(2*k[16]+3*k[17]+7*k[18]);if(F>=O&&A>=O)return hm(e,h,t.subarray(l,l+u));if(nm(e,h,1+(F>A)),h+=2,F>A){I=Kg(v,c,0),P=v,R=Kg(p,g,0),L=p;var D=Kg(M,T,0);for(nm(e,h,b-257),nm(e,h+5,x-1),nm(e,h+10,E-4),h+=14,S=0;E>S;++S)nm(e,h+3*S,M[Ug[S]]);h+=3*E;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(S=0;j.length>S;++S)nm(e,h,D[B=31&j[S]]),h+=M[B],B>15&&(nm(e,h,j[S]>>>5&127),h+=j[S]>>>12)}}else I=tm,P=Yg,R=em,L=Xg;for(S=0;o>S;++S)if(r[S]>255){var B;sm(e,h,I[257+(B=r[S]>>>18&31)]),h+=P[B+257],B>7&&(nm(e,h,r[S]>>>23&31),h+=Bg[B]);var H=31&r[S];sm(e,h,R[H]),h+=L[H],H>3&&(sm(e,h,r[S]>>>5&8191),h+=Hg[H])}else sm(e,h,I[r[S]]),h+=P[r[S]];return sm(e,h,I[256]),h+P[256]},vm=new jg([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),cm=function(){for(var t=new jg(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),fm=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function pm(t,e){void 0===e&&(e={});var i=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=cm[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var n,s,a,o,l=(n=t,s=e,a=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),o=8,function(t,e,i,r,n,s){var a=t.length,o=new Ng(r+a+5*(1+Math.floor(a/7e3))+n),l=o.subarray(r,o.length-n),u=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var d=h+65535;a>d?u=hm(l,u,t.subarray(h,d)):(l[h]=!0,u=hm(l,u,t.subarray(h,a)))}else{for(var v=vm[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new qg(32768),m=new qg(p+1),y=Math.ceil(i/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new jg(25e3),x=new qg(288),k=new qg(32),S=0,C=0,M=(h=0,0),T=0,E=0;a>h;++h){var I=_(h),P=32767&h,R=m[I];if(g[P]=R,m[I]=P,h>=T){var L=a-h;if((S>7e3||M>24576)&&L>423){u=dm(t,l,0,w,x,k,C,M,E,h-E,u),M=S=C=0,E=h;for(var O=0;286>O;++O)x[O]=0;for(O=0;30>O;++O)k[O]=0}var F=2,A=0,D=f,N=P-R&32767;if(L>2&&I==_(h-N))for(var q=Math.min(c,L)-1,j=Math.min(32767,h),B=Math.min(258,L);j>=N&&--D&&P!=R;){if(t[h+F]==t[h+F-N]){for(var H=0;B>H&&t[h+H]==t[h+H-N];++H);if(H>F){if(F=H,A=N,H>q)break;var U=Math.min(N,H-2),z=0;for(O=0;U>O;++O){var W=h-N+O+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,R=W)}}}N+=(P=R)-(R=g[P])+32768&32767}if(A){w[M++]=268435456|Vg[F]<<18|Zg[A];var Z=31&Vg[F],G=31&Zg[A];C+=Bg[Z]+Hg[G],++x[257+Z],++k[G],T=h+F,++S}else w[M++]=t[h],++x[t[h]]}}u=dm(t,l,!0,w,x,k,C,M,E,h-E,u)}return rm(o,0,r+im(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,a,o)),u=l.length;return function(t,e){var i=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&&fm(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;i.length>=r;++r)t[r+10]=i.charCodeAt(r)}}(l,e),fm(l,u-8,i.d()),fm(l,u-4,r),l}var gm=!!Es||!!Ts,mm="text/plain",ym=!1,bm=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],a=n[1];if(!a)return t;var o=a.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(o?"?"+o:"")+(r?"#"+r:"")},_m=function(t,e,r){var n;void 0===r&&(r=!0);var s=t.split("?"),a=s[0],o=s[1],l=i({},e),u=null!==(n=null==o?void 0:o.split("&").map((t=>{var e,i=t.split("="),n=i[0],s=r&&null!==(e=l[n])&&void 0!==e?e:i[1];return delete l[n],n+"="+s})))&&void 0!==n?n:[],h=Ks(l);return h&&u.push(h),u.length>0?a+"?"+u.join("&"):a},wm=t=>{if(t.Yi)return t.Yi;var e=t.data,i=t.compression;if(e){if(i===zl){var r=pm(function(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Ng(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},a=0;i>a;++a){if(n+5>r.length){var o=new Ng(n+8+(i-a<<1));o.set(r),r=o}var l=t.charCodeAt(a);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++a))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return rm(r,0,n)}(Qs(e)),{mtime:0});return{contentType:mm,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Wl){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Qs(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Qs(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Qs(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},xm=t=>{var e,r,n=()=>"sendBeacon"===t.transport?{url:_m(t.url,{compression:Wl}),encodedBody:wm(i({},t,{compression:Wl,Yi:void 0}))}:{url:bm(t.url,"compression"),encodedBody:wm(i({},t,{compression:void 0,Yi:void 0}))};try{e=wm(t)}catch(e){if(Ri(t.compression,Ys(t.url,"compression")))return Ds.error("Failed to gzip request body, sending uncompressed payload",e),n();throw e}return e&&Ri(t.compression,Ys(t.url,"compression"))&&!((r=e.body)instanceof ArrayBuffer?Pi(new Uint8Array(r)):ArrayBuffer.isView(r)&&Pi(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(ym=!0,n()):{url:t.url,encodedBody:e}},km=t=>{try{return xm(t)}catch(e){return Ds.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},Sm=function(){var t=e((function*(t){var e=Qs(t.data),r=yield function(t,e,i){return Ai.apply(this,arguments)}(e,Fs.DEBUG,{rethrow:!0});if(!r)return t;var n=yield r.arrayBuffer();return i({},t,{Yi:{contentType:mm,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),Cm=/Failed to fetch|NetworkError|Load failed/i,Mm=t=>{var e=km(t);if(e){var r=e.url,n=e.encodedBody,s=null!=n?n:{},a=s.contentType,o=s.body,l=s.estimatedSize,u=new Headers;qs(t.headers,(function(t,e){u.append(e,t)})),a&&u.append("Content-Type",a);var h=null,d=!1;if(Is){var v=new Is;h={signal:v.signal,timeout:setTimeout((()=>{var e,i;d=!0,v.abort((e=t.timeout,(i=new Error("PostHog request timed out"+(e?" after "+e+"ms":""))).name="AbortError",i))}),t.timeout)}}var c=e=>{d&&"AbortError"===(null==e?void 0:e.name)||(t=>"TypeError"===(null==t?void 0:t.name)&&Cm.test((null==t?void 0:t.message)||""))(e)?Ds.warn(e):Ds.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var f;Ts(r,i({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.Xi&&52428.8>(l||0),body:o,signal:null==(f=h)?void 0:f.signal},t.fetchOptions)).then((e=>e.text().then((i=>{var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){Ds.error(t)}null==t.callback||t.callback(r)})))).catch(c).finally((()=>h?clearTimeout(h.timeout):null))}catch(t){h&&clearTimeout(h.timeout),c(t)}}},Tm=t=>{try{var e,r=xm(t),n=r.url,s=r.encodedBody,a=null!=s?s:{},o=a.body,l=a.estimatedSize;if(!o)return;var u=o instanceof Blob?o:new Blob([o],{type:a.contentType});if(Ss.sendBeacon(n,u))return;var h=Wi(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(Wi(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),v=e=>Wi(t.data)?e:i({},t.data,{batch:e});return Tm(i({},t,{data:v(h.slice(0,d))})),void Tm(i({},t,{data:v(h.slice(d))}))}Ds.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Mm(i({},t,{Xi:!0}))}catch(t){Ds.warn("Beacon send failed",t)}},Em=(t,e,r,n)=>{var s="query"===n?"POST"===e?"sent_at":"_":void 0;return _m(r===zl?bm(t,"compression"):t,i({},s?{[s]:Date.now().toString()}:{},r===zl?{}:{compression:r}))},Im=[];Ts&&Im.push({transport:"fetch",method:Mm}),Es&&Im.push({transport:"XHR",method(t){var e=km(t);if(e){var i=new Es,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,a=n.body;qs(t.headers,(function(t,e){i.setRequestHeader(e,t)})),s&&i.setRequestHeader("Content-Type",s),t.timeout&&(i.timeout=t.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var e={statusCode:i.status,text:i.responseText};if(200===i.status)try{e.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(e)}},i.send(a)}}}),null!=Ss&&Ss.sendBeacon&&Im.push({transport:"sendBeacon",method:Tm});var Pm=3e3;class Rm{constructor(t,e){this.tr=!0,this.er=[],this.ir=cr((null==e?void 0:e.flush_interval_ms)||Pm,250,5e3,Ds.createLogger("flush interval"),Pm),this.rr=t}enqueue(t){this.er.push(t),this.nr||this.sr()}unload(){this.ar();var t=this.er.length>0?this.lr():{},e=Object.values(t),r=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];r.map((t=>{this.ur(i({},t,{transport:"sendBeacon"}))}))}enable(){this.tr=!1,this.sr()}sr(){var t=this;this.tr||(this.nr=setTimeout((()=>{if(this.ar(),this.er.length>0){var e=this.lr(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&Wi(i.data)&&qs(i.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.ur(i)};for(var r in e)i()}}),this.ir))}ur(t){try{this.rr(t)}catch(t){Ds.error(t)}}ar(){clearTimeout(this.nr),this.nr=void 0}lr(){var t={};return qs(this.er,(e=>{var r,n=e,s=(n?n.batchKey:null)||n.url;Qi(t[s])&&(t[s]=i({},n,{data:[]})),null==(r=t[s].data)||r.push(n.data)})),this.er=[],t}}var Lm=["retriesPerformedSoFar"];class Om{constructor(t){this.hr=!1,this.dr=3e3,this.er=[],this._instance=t,this.er=[],this.vr=!0,!Qi(xs)&&"onLine"in xs.navigator&&(this.vr=xs.navigator.onLine,this.cr=()=>{this.vr=!0,this.pr()},this.gr=()=>{this.vr=!1},Zs(xs,"online",this.cr),Zs(xs,"offline",this.gr))}get length(){return this.er.length}retriableRequest(t){var e=t.retriesPerformedSoFar,n=r(t,Lm);er(e)&&(n.url=_m(n.url,{retry_count:e})),this._instance._send_request(i({},n,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.Lt(i({retriesPerformedSoFar:e},n));0===t.statusCode&&Ds.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=e?e:0)+" retries.")}null==n.callback||n.callback(t)}}))}Lt(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var i=function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),n=Math.random()-.5;return Math.ceil(r+n*(r-i))}(e),r=Date.now()+i;this.er.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),Ds.warn(n),this.hr||(this.hr=!0,this.mr())}mr(){if(this.yr&&clearTimeout(this.yr),0===this.er.length)return this.hr=!1,void(this.yr=void 0);this.yr=setTimeout((()=>{this.vr&&this.er.length>0&&this.pr(),this.mr()}),this.dr)}pr(){var t=Date.now(),e=[],i=this.er.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this.er=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var t of(this.yr&&(clearTimeout(this.yr),this.yr=void 0),this.hr=!1,Qi(xs)||(this.cr&&(xs.removeEventListener("online",this.cr),this.cr=void 0),this.gr&&(xs.removeEventListener("offline",this.gr),this.gr=void 0)),this.er)){var e=t.requestOptions;try{this._instance._send_request(i({},e,{transport:"sendBeacon"}))}catch(t){Ds.error(t)}}this.er=[]}}class Fm{constructor(t){this.br=()=>{var t,e,i,r;this._r||(this._r={});var n=this.scrollElement(),s=this.scrollY(),a=n?Math.max(0,n.scrollHeight-n.clientHeight):0,o=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this._r.lastScrollY=Math.ceil(s),this._r.maxScrollY=Math.max(s,null!==(t=this._r.maxScrollY)&&void 0!==t?t:0),this._r.maxScrollHeight=Math.max(a,null!==(e=this._r.maxScrollHeight)&&void 0!==e?e:0),this._r.lastContentY=o,this._r.maxContentY=Math.max(o,null!==(i=this._r.maxContentY)&&void 0!==i?i:0),this._r.maxContentHeight=Math.max(l,null!==(r=this._r.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get wr(){return this._instance.config.scroll_root_selector}getContext(){return this._r}resetContext(){var t=this._r;return setTimeout(this.br,0),t}startMeasuringScrollPosition(){Zs(xs,"scroll",this.br,{capture:!0}),Zs(xs,"scrollend",this.br,{capture:!0}),Zs(xs,"resize",this.br)}scrollElement(){if(!this.wr)return null==xs?void 0:xs.document.documentElement;var t=Wi(this.wr)?this.wr:[this.wr];for(var e of t){var i=null==xs?void 0:xs.document.querySelector(e);if(i)return i}}kr(t){var e="y"===t?"scrollTop":"scrollLeft";if(this.wr){var i=this.scrollElement();return i&&i[e]||0}return xs?"y"===t?xs.scrollY||xs.pageYOffset||xs.document.documentElement.scrollTop||0:xs.scrollX||xs.pageXOffset||xs.document.documentElement.scrollLeft||0:0}scrollY(){return this.kr("y")}scrollX(){return this.kr("x")}}var Am=t=>wv(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class Dm{constructor(t,e,i,r){this.Sr=t=>{var e=this.Cr();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Mr(this._instance)};this.Tr.register({[fh]:i})}},this._instance=t,this.Er=e,this.Tr=i,this.Mr=r||Am,this.Er.onSessionId(this.Sr)}Cr(){return this.Tr.props[fh]}getSetOnceProps(){var t,e=null==(t=this.Cr())?void 0:t.props;return e?"r"in e?xv(e,this._instance.config.disable_capture_url_hashes):{$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 qs(zs(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+ji(i)]=e})),t}}class $m{on(t,e){return this.Ir[t]||(this.Ir[t]=[]),this.Ir[t].push(e),()=>{this.Ir[t]=this.Ir[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.Ir[t]||[])i(e);for(var r of this.Ir["*"]||[])r(t,e)}constructor(){this.Ir={}}}var Nm=$s("[SessionId]");class qm{on(t,e){return this.Pr.on(t,e)}constructor(t,e,i){var r;if(this.Rr=null,this.Lr=[],this.Or=void 0,this.Fr=!1,this.Pr=new $m,this.Ar=(t,e)=>!(!er(t)||!er(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Th)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Pe=t.config,this.Tr=t.persistence,this.Dr=void 0,this.$r=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Nr=e||Hh,this.qr=i||Hh;var n=this.Pe.persistence_name||this.Pe.token;if(this._sessionTimeoutMs=1e3*cr(this.Pe.session_idle_timeout_seconds||1800,60,36e3,Nm.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.jr(),this.Br="ph_"+n+"_window_id",this.Hr="ph_"+n+"_primary_window_exists",this.Ur()){var s=sd.H(this.Br),a=sd.H(this.Hr);s&&!a?this.Dr=s:sd.F(this.Br),sd.A(this.Hr,!0)}if(null!=(r=this.Pe.bootstrap)&&r.sessionID)try{var o=(t=>{var e=this.Pe.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.zr(this.Pe.bootstrap.sessionID,(new Date).getTime(),o)}catch(t){Nm.error("Invalid sessionID in bootstrap",t)}this.Wr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Qi(this.Lr)&&(this.Lr=[]),this.Lr.push(t),this.$r&&t(this.$r,this.Dr),()=>{this.Lr=this.Lr.filter((e=>e!==t))}}Ur(){return"memory"!==this.Pe.persistence&&!this.Tr.ki&&sd.P()}Vr(t){t!==this.Dr&&(this.Dr=t,this.Ur()&&sd.A(this.Br,t))}Zr(){return this.Dr?this.Dr:this.Ur()?sd.H(this.Br):null}Gr(t){var e=this.Rr;return!Yi(e)&&!Yi(t)&&5e3>Math.abs(t-e)}zr(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this.$r||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.$r=t,n&&!r||n&&this.Gr(e)||(this.Rr=e,this.Tr.register({[zu]:[e,t,i]}))}Qr(){var t,e=null==(t=this.Pe)?void 0:t.persistence_save_debounce_ms;return er(e)&&e>0}Jr(){this.Qr()?this.Tr.refreshKey(zu):(this.Tr.flush(),this.Tr.load())}Kr(){var t;if(!Yi(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Rr){this.Jr();var e=this.Yr();e[1]===this.$r&&e[2]===this._sessionStartTimestamp&&(this.Rr=this._sessionActivityTimestamp,this.Tr.register({[zu]:[this._sessionActivityTimestamp,null!==(t=this.$r)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Tr.flush())}}Xr(){var t=this.Yr()[0],e=er(t)?t:0,i=er(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}tn(t){return this.Jr(),this.Ar(t,this.Xr())}Yr(){var t=this.Tr.props[zu];return Wi(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Rr=null,clearTimeout(this.en),this.en=void 0,this.zr(null,null,null)}destroy(){this.Fr=!0,this.Kr(),clearTimeout(this.en),this.en=void 0,this.Or&&xs&&(xs.removeEventListener(Lh,this.Or,{capture:!1}),this.Or=void 0),this.Lr=[]}Wr(){this.Or=()=>{this.Kr(),this.Ur()&&sd.F(this.Hr)},Zs(xs,Lh,this.Or,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Pe.cookieless_mode===Th)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=e||(new Date).getTime(),r=this.Yr(),n=r[1],s=r[2],a=this.Xr(),o=this.Zr(),l=er(s)&&Math.abs(i-s)>864e5,u=!1,h=!1,d=!n,v=n,c=!d&&!t&&this.Ar(i,a);if(c){(c=this.tn(i))||Nm.info("cross-tab refresh kept the session alive",{sessionId:n});var f=this.Yr();n=f[1],s=f[2]}d||c||l?(n=this.Nr(),o=this.qr(),Nm.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:d,activityTimeout:c,sessionPastMaximumLength:l}}),s=i,u=!0):(o||(o=this.qr(),u=!0),(h=n!==v)&&(Nm.info("adopted cross-tab session id",{sessionId:n,windowId:o}),u=!0));var p=er(a)&&t&&!l?a:i,g=er(s)?s:(new Date).getTime();this.Vr(o),this.zr(n,p,g),t||this.jr();var m={noSessionId:d,activityTimeout:c,sessionPastMaximumLength:l,crossTabAdoption:h};return u&&this.Lr.forEach((t=>t(n,o,m))),{sessionId:n,windowId:o,sessionStartTimestamp:g,changeReason:u?m:void 0,lastActivityTimestamp:a}}jr(){this.Fr||(clearTimeout(this.en),this.en=setTimeout((()=>{if(!this.Fr)if(this.tn((new Date).getTime())){var t=this.$r;this.resetSessionId(),this.Pr.emit("forcedIdleReset",{idleSessionId:t})}else this.jr()}),1.1*this.sessionTimeoutMs))}}var jm=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&$i(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>$i(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function Bm(){return Bm=e((function*(){var t=null==Ss?void 0:Ss.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),i=null==e?void 0:e.model;return Ji(i)&&i.length>0?i:void 0}catch(t){return void Ds.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),Bm.apply(this,arguments)}var Hm="custom",Um="i.posthog.com",zm=/^\/static\//;class Wm{constructor(t){this.rn={},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("."+Um,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.rn[this.apiHost]||(this.rn[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":Hm),this.rn[this.apiHost]}nn(t){if(zm.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)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 i=this.nn(e);if(i)return""+i+e}if(this.region===Hm)return this.apiHost+e;var r=Um+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Vm=$s("[PostHog ExternalIntegrations]"),Zm={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Gm{constructor(t){this._instance=t}ai(t,e){var i;null==(i=Mo.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return Vm.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],a=i[1];!a||null!=(e=Mo.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.ai(Zm[s],(()=>{var e;null==(e=Mo.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!a&&null!=(r=Mo.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[s]&&(null==(n=Mo.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[s])||n.stop())};for(var i of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r;e()}}}class Qm{constructor(t,e){this.rt=t,this.sn=e,this.an=new Map,this.ln=!1}add(t){var i=this;return e((function*(){if(i.ln)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(i.an.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');i.an.set(t.name,t);try{var e=t.setup(i.sn);e&&(yield e)}catch(e){var r=i.an.get(t.name)===t;r&&i.an.delete(t.name),i.rt.error('Failed to set up browser extension "'+t.name+'"',e),r&&i.un(t)}}))()}dispose(){if(!this.ln){this.ln=!0;var t=Array.from(this.an.values()).reverse();for(var e of(this.an.clear(),t))this.un(e)}}un(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Vi(e.then)&&e.then(void 0,(e=>{this.rt.error('Failed to dispose browser extension "'+t.name+'"',e)}))}catch(e){this.rt.error('Failed to dispose browser extension "'+t.name+'"',e)}}}class Jm{constructor(t){this._instance=t}get(t){var e;return null==(e=this._instance.persistence)?void 0:e.get_property(t)}set(t,e){var i;null==(i=this._instance.persistence)||i.set_property(t,e)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}}var Km="extensionsRemoteConfig";class Ym{constructor(t){this.ln=!1,this.instance=t,this.rt=Ds.createLogger("[BrowserExtensions]"),this.hn=t.dn,this.kv=new Jm(t),this.onEvent=t=>Ul(this.instance.on("eventCaptured",(e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.rt.error("Browser extension event listener failed",t)}}))),this.onRemoteConfig=t=>{if(this.ln)return Ul((()=>{}));var e=e=>{try{t(e)}catch(t){this.rt.error("Browser extension remote config listener failed",t)}},i=this.instance.vn.on(Km,e);return this.hn&&e(this.hn),Ul(i)},this.cn=new Qm(this.rt,this)}get logger(){return this.rt}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property(Cu))&&void 0!==t?t:this.distinctId}get groups(){return this.instance.getGroups()}get session(){try{var t,e,i,r,n=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==n?void 0:n.sessionId)&&void 0!==e?e:"",windowId:null!==(i=null==n?void 0:n.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(r=null==n?void 0:n.sessionStartTimestamp)&&void 0!==r?r:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(t){return this.cn.add(t)}capture(t,i,r){var n=this;return e((function*(){r?n.instance.capture(t,i,{timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce}):n.instance.capture(t,i)}))()}registerDynamicEventProperties(t){return Ul(this.instance.fn(t))}handleRemoteConfig(t){this.ln||(this.hn=t,this.instance.vn.emit(Km,t))}sendRequest(t,i){var r=this;return e((function*(){var e;void 0===i&&(i={});var n=r.instance.requestRouter.endpointFor(null!==(e=i.target)&&void 0!==e?e:"api",t),s={method:i.method,url:i.query?_m(n,i.query):n,data:i.body,headers:i.headers,timeout:i.timeoutMs,fireCallbackOnDrop:!0,transport:i.transport};return"sendBeacon"===i.transport?(r.instance._send_request(s),{statusCode:202}):new Promise((t=>{s.callback=t,r.instance._send_request(s)}))}))()}dispose(){this.ln||(this.ln=!0,this.cn.dispose())}}var Xm={},ty=0,ey=()=>{},iy='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ry="Surveys module not available",ny="sanitize_properties is deprecated. Use before_send instead",sy="Invalid value for property_denylist config: ",ay=["token","distinct_id",wh],oy="posthog",ly=!gm&&-1===(null==Rs?void 0:Rs.indexOf("MSIE"))&&-1===(null==Rs?void 0:Rs.indexOf("Mozilla")),uy=t=>{var e;return i({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Vs(null==Cs?void 0:Cs.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:ey,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:Ms&&Ji(null==Ms?void 0:Ms.search)&&-1!==Ms.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,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==xs||null==(e=xs.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){Ds.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:Ph,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Pm},error_tracking:{},_onCapture:ey},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Ia,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>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}: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),disable_capture_url_hashes:!(!t||"2026-06-25">t)}))(t))},hy=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],dy=t=>{var e={};for(var i of hy){var r=i[0],n=i[1];Qi(t[r])||(e[n]=t[r])}var s=js({},e,t),a=t.__preview_external_dependency_versioned_paths;return Qi(a)||(Qi(t.strict_script_versioning)&&(s.strict_script_versioning=!!a),Ji(a)&&Qi(t.asset_host)&&(s.asset_host=a)),Wi(t.property_blacklist)&&(Qi(t.property_denylist)?s.property_denylist=t.property_blacklist:Wi(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:Ds.error(sy+t.property_denylist)),s};class vy{constructor(){this.__forceAllowLocalhost=!1}get pn(){return this.__forceAllowLocalhost}set pn(t){Ds.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class cy{gn(t,e){if(t){var i=this.an.indexOf(t);-1!==i&&this.an.splice(i,1)}return this.an.push(e),null==e.initialize||e.initialize(),e}mn(){return this.config.cookieless_mode===Th||this.config.cookieless_mode===Mh&&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 vy,this.yn=!1,this.version=Fs.LIB_VERSION,this.vn=new $m,this.an=[],this.bn=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=uy(),this.SentryIntegration=Sg,this.sentryIntegration=t=>function(t,e){var i=kg(t,e);return{name:xg,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._n=!1,this.wn=null,this.xn=null,this.kn=null,this.scrollManager=new Fm(this),this.pageViewManager=new Cg(this),this.rateLimiter=new Ag(this),this.requestRouter=new Wm(this),this.consent=new gg(this),this.externalIntegrations=new Gm(this);var e=null!==(t=cy.__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.metrics=e.metrics&&new e.metrics(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,i)=>{var r=Ji(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Ji(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>Ds.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==oy){var r,n=null!==(r=Xm[i])&&void 0!==r?r:new cy;return n._init(t,e,i),Xm[i]=n,Xm[oy][i]=n,n}return this._init(t,e,i)}_init(t,e,r){var n,s;void 0===e&&(e={});var a,o=Ji(t)?t.trim():"";if(!o)return Ds.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 o!==(null==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+o+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=uy(e.defaults),e.debug=this.Sn(e.debug),this.Cn=e,this.Mn=[],e.person_profiles?this.xn=e.person_profiles:e.process_person&&(this.xn=e.process_person);var l=uy(e.defaults),u=dy(e),h=js({},l,u,{name:r,token:o});Zi(l.rageclick)&&Zi(u.rageclick)&&(h.rageclick=js({},l.rageclick,u.rageclick)),Zi(l.session_recording)&&Zi(u.session_recording)&&(h.session_recording=js({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&Ds.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:zl;var d=this.Tn();this.persistence=new Og(this.config,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Og(i({},this.config,{persistence:"sessionStorage"}),d,!1);var v=i({},this.persistence.props),c=i({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.En=new Rm((t=>this.In(t)),this.config.request_queue_config),this.Pn=new Om(this),this.__request_queue=[];var f=this.mn();if(f||(this.sessionManager=new qm(this),this.sessionPropsManager=new Dm(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Ds.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Rn(f)}),0)):(Ds.info("Initializing extensions synchronously"),this.Rn(f)),Fs.DEBUG=Fs.DEBUG||this.config.debug,Fs.DEBUG&&Ds.info("Starting in debug mode",{this:this,config:e,thisC:i({},this.config),p:v,s:c}),!this.config.identity_distinct_id||null!=(n=e.bootstrap)&&n.distinctID||(e.bootstrap=i({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=e.bootstrap)?void 0:s.distinctID)){var p=e.bootstrap.distinctID,g=this.get_distinct_id(),m=this.persistence.get_property(ch);if(e.bootstrap.isIdentifiedID&&null!=g&&g!==p&&m===Eh)this.identify(p);else if(e.bootstrap.isIdentifiedID&&null!=g&&g!==p&&m===Ih)Ds.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 y=this.config.get_device_id(Hh()),b=e.bootstrap.isIdentifiedID?y:p;this.persistence.set_property(ch,e.bootstrap.isIdentifiedID?Ih:Eh),this.register({distinct_id:p,$device_id:b})}}if(f)this.register_once({distinct_id:_h,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(Hh());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(ch,Eh)}return Zs(xs,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?function(t,e){var i=t.config.segment;if(!i)return e();!function(t,e){var i=t.config.segment;if(!i)return e();var r=i=>{var r=()=>i.anonymousId()||Hh();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(ch,Ih)),e()},n=i.user();"then"in n&&Vi(n.then)?n.then(r):r(n)}(t,(()=>{i.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||wg.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,i)=>{if(!i)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(wg.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(wg.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var r=t.calculateEventProperties(i,e.event.properties);return e.event.properties=Object.assign({},r,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,Oh),identify:t=>e(t,Ah),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Ln())):this.Ln(),Vi(this.config._onCapture)&&this.config._onCapture!==ey&&(Ds.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&Ds.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.config.disableDeviceModel||function(){return Bm.apply(this,arguments)}().then((t=>{t&&this.register({[Mu]:t})})).catch(ey),this}Rn(t){var e,r,n,s,a,o,l,u,h=performance.now(),d=i({},cy.__defaultExtensionClasses,this.config.__extensionClasses),v=[];d.featureFlags&&this.an.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new d.featureFlags(this)),d.exceptions&&this.an.push(this.exceptions=null!==(r=this.exceptions)&&void 0!==r?r:new d.exceptions(this)),d.historyAutocapture&&this.an.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.an.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.an.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!t&&this.an.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||v.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),d.autocapture&&this.an.push(this.autocapture=new d.autocapture(this)),d.surveys&&this.an.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new d.surveys(this)),d.logs&&this.an.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new d.logs(this)),d.metrics&&this.an.push(this.metrics=null!==(a=this.metrics)&&void 0!==a?a:new d.metrics(this)),d.conversations&&this.an.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new d.conversations(this)),d.productTours&&this.an.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.an.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.an.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.an.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.an.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,bg)),d.toolbar&&this.an.push(this.toolbar=null!==(l=this.toolbar)&&void 0!==l?l:new d.toolbar(this)),d.experiments&&this.an.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this.an.forEach((t=>{t.initialize&&v.push((()=>{null==t.initialize||t.initialize()}))})),v.push((()=>{if(this.On){var t=this.On;this.On=void 0,this.an.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.Fn(v,h)}Fn(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Fn(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){Ds.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[xh]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[kh]:r}),this.config.__preview_deferred_init_extensions&&Ds.info("PostHog extensions initialized ("+r+"ms)")}Gi(t){var e;if(!Cs||!Cs.body)return Ds.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Gi(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.On=t),this.dn=t,this.compression=void 0,t.ok){var i,r=t.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=Ni(r.supportedCompression,zl)?zl:Ni(r.supportedCompression,Wl)?Wl:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.xn?this.xn:Ph}),null==(e=this.An)||e.handleRemoteConfig(t),this.an.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Ln(){try{this.config.loaded(this)}catch(t){Ds.critical("`loaded` function failed",t)}if(this.Dn(),this.config.internal_or_test_user_hostname&&null!=Ms&&Ms.hostname){var t=Ms.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.mn())&&this.$n()}),1),this.Nn=new $g(this),this.Nn.load()}Dn(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.En)||t.enable())}_dom_loaded(){this.is_capturing()&&Ns(this.__request_queue,(t=>this.In(t))),this.__request_queue=[],this.Dn()}_handle_unload(){var t,e,i,r,n;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.qn()&&this.capture(Fh),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.En)||r.unload(),null==(n=this.Pn)||n.unload()):this.qn()&&this.capture(Fh,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?ly?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=i({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,(Qi(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,r,n,s=i({},t);s.timeout=s.timeout||6e4;var a,o,l,u,h,d=null!==(e=s.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Qi(s.compression)&&s.data&&(s.compression=Wl),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(o=null==(h=(u=Wi(a=s.data)?a:[a])[0])||null==(l=h.properties)?void 0:l.token)&&void 0!==o?o:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),Wi(t)?t.map((t=>i({},t,{sent_at:e}))):i({},t,{sent_at:e})}(s.data))),s.url=Em(s.url,s.method,s.compression,s.timestampMode);var v=Im.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),c=null!==(r=null==(n=function(t,e){for(var i=0;t.length>i;i++)if(e(t[i]))return t[i]}(v,(t=>t.transport===d)))?void 0:n.method)&&void 0!==r?r:v[0].method;if(!c)throw new Error("No available transport method");"sendBeacon"!==d&&s.data&&s.compression===zl&&Ps&&"undefined"!=typeof Promise&&!ym?Sm(s).then((t=>{c(t)})).catch((e=>{if(Li(e))return ym=!0,void c(i({},s,{compression:void 0,url:Em(t.url,t.method,void 0,t.timestampMode)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Li(t)||e===Ii})(e)&&(ym=!0),c(s)})):c(s)})(i({},t,{callback:e=>{var i,r;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}In(t){this.Pn?this.Pn.retriableRequest(t):this._send_request(t)}_execute_array(t){ty++;try{var e,i=[],r=[],n=[];Ns(t,(t=>{if(t)if(Wi(e=t[0]))n.push(t);else if(Vi(t))try{t.call(this)}catch(e){Ds.error("Error executing queued PostHog call",t,e)}else Wi(t)&&"alias"===e?i.push(t):Wi(t)&&-1!==e.indexOf("capture")&&Vi(this[e])?n.push(t):r.push(t)}));var s=function(t,e){Ns(t,(function(t){try{if(Wi(t[0])){var i=e;qs(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){Ds.error("Error executing queued PostHog call",t,e)}}))};s(i,this),s(r,this),s(n,this)}finally{ty--}}push(t){if(ty>0&&Wi(t)&&Ji(t[0])){var e=cy.prototype[t[0]];Vi(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,r){var n,s,a,o,l,u,h;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.En){if(this.is_capturing())if(!Qi(t)&&Ji(t)){var d=!this.config.opt_out_useragent_filter&&this._is_bot();if(!d||this.config.__preview_capture_bot_pageviews){var v=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==v||!v.isRateLimited){if(this.bn.length>0){var c={};for(var f of this.bn.slice())try{js(c,f())}catch(t){Ds.error("Failed to produce browser extension event properties",t)}e=i({},c,null!=e?e:{})}var p;null!=(n=e)&&n.$current_url&&!Ji(null==(s=e)?void 0:s.$current_url)&&(Ds.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==(p=e)||delete p.$current_url),"$exception"!==t||null!=r&&r.jn||Ds.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 g=new Date,m=(null==r?void 0:r.timestamp)||g,y=xn(null==r?void 0:r.uuid,Hh),b={uuid:y,event:t,properties:this.calculateEventProperties(t,e||{},m,y)};t===Oh&&this.config.__preview_capture_bot_pageviews&&d&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),v&&(b.properties.$lib_rate_limit_remaining_tokens=v.remainingTokens);var _="$feature_flag_called"===t&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property(Yu);(null==r?void 0:r.$set)&&!_&&(b.$set=null==r?void 0:r.$set);var w=null==r?void 0:r.$unset;w&&(b.$unset=w);var x=_?void 0:this.Bn(null==r?void 0:r.$set_once,t!==Dh,t===Ah);if(x&&(b.$set_once=x),null!=r&&r._noTruncate||(o=this.config.properties_string_max_length,l=b,u=t=>Ji(t)?t.slice(0,o):t,h=new Set,b=function t(e,i){if(e!==Object(e))return u?u(e):e;if(!h.has(e)){var r;if(h.add(e),Wi(e))r=[],Ns(e,(e=>{r.push(t(e))}));else{var n={};qs(e,((e,i)=>{h.has(e)||(n[i]=t(e,i))})),r=n}return r}}(l)),b.timestamp=m,Qi(null==r?void 0:r.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=g),_&&(b.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return xi.forEach(r),e.forEach(r),i}(b.properties,ay)),t===eu.DISMISSED||t===eu.SENT){var k,S,C=null==(k=e)?void 0:k[iu.SURVEY_ID],M=null==(S=e)?void 0:S[iu.SURVEY_ITERATION];wu({id:C,current_iteration:M}),b.$set=i({},b.$set,{[ou({id:C,current_iteration:M},t===eu.SENT?"responded":"dismissed")]:!0})}else t===eu.SHOWN&&(b.$set=i({},b.$set,{[iu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===t){var T,E=null==(T=e)?void 0:T.$product_tour_type;E&&(b.$set=i({},b.$set,{["$product_tour_last_seen_date/"+E]:(new Date).toISOString()}))}var I=i({},b.properties.$set,b.$set);if(Gi(I)||this.setPersonPropertiesForFlags(I),!Xi(this.config.before_send)){var P=this.Pt(b);if(!P)return;(b=P).uuid=xn(b.uuid,Hh)}this.vn.emit("eventCaptured",b);var R=null!==(a=null==r?void 0:r._url)&&void 0!==a?a:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),L={method:"POST",url:R,data:b,compression:"best-available",timestampMode:"recordings"===(null==r?void 0:r._batchKey)||/\/s\/(?:\?|$)/.test(R)?"body":"capture-body",batchKey:null==r?void 0:r._batchKey,transport:null==r?void 0:r.transport};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this.In(L):this.En.enqueue(L),b}Ds.critical("This capture call is ignored due to client rate limiting.")}}else Ds.error("No event name provided to posthog.capture")}else Ds.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}Hn(){var t;return null!==(t=this.An)&&void 0!==t?t:this.An=new Ym(this)}fn(t){this.bn.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.bn.indexOf(t);-1!==i&&this.bn.splice(i,1)}}}calculateEventProperties(t,e,r,n,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return e;var a=s?void 0:this.persistence.remove_event_timer(t),o=i({},e);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.mn()&&(o[wh]=!0),"$snapshot"===t){var l=i({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!Ji(o.distinct_id)&&!tr(o.distinct_id)||Ki(o.distinct_id))&&Ds.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var u,h=function(t,e,i,r){var n,s,a,o;if(void 0===r&&(r=!1),!Rs)return{};var l,u=t?[...dv,...e||[]]:[],h=function(t){for(var e=0;yn.length>e;e++){var i=yn[e],r=i[1],n=i[0].exec(t),s=n&&(Vi(r)?r(n,t):r);if(s)return s}return["",""]}(Rs),d=h[0],v=h[1],c=null!=(l="undefined"!=typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},f={};Qi(i)||(f.detectGoogleSearchApp=i);var p={},g=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,m=null==(s=navigator)?void 0:s.maxTouchPoints,y=null==xs||null==(a=xs.screen)?void 0:a.width,b=null==xs||null==(o=xs.screen)?void 0:o.height,_=null==xs?void 0:xs.devicePixelRatio;Qi(g)||(p.userAgentDataPlatform=g),Qi(m)||(p.maxTouchPoints=m),Qi(y)||(p.screenWidth=y),Qi(b)||(p.screenHeight=b),Qi(_)||(p.devicePixelRatio=_);var w,x=js(zs({$os:d,$os_version:v,$browser:pn(Rs,navigator.vendor,c,f),$device:bn(Rs),$device_type:_n(Rs,p),$timezone:kv(),$timezone_offset:Sv()}),{$current_url:Xs(r?kn(null==Ms?void 0:Ms.href):null==Ms?void 0:Ms.href,u,cv),$host:null==Ms?void 0:Ms.host,$pathname:null==Ms?void 0:Ms.pathname,$raw_user_agent:Rs.length>1e3?Rs.substring(0,997)+"...":Rs,$browser_version:mn(Rs,navigator.vendor,c,f),$browser_language:yv(),$browser_language_prefix:(w=yv(),"string"==typeof w?w.split("-")[0]:void 0),$screen_height:null==xs?void 0:xs.screen.height,$screen_width:null==xs?void 0:xs.screen.width,$viewport_height:null==xs?void 0:xs.innerHeight,$viewport_width:null==xs?void 0:xs.innerWidth,$lib:Fs.LIB_NAME,$lib_version:Fs.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Fs.SDK_DIST_CHANNEL&&(x.$sdk_dist_channel=Fs.SDK_DIST_CHANNEL),x}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var d=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime()),v=d.windowId;o.$session_id=d.sessionId,o.$window_id=v}this.sessionPropsManager&&js(o,this.sessionPropsManager.getSessionProps());try{var c;this.sessionRecording&&js(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=null==(c=this.Pn)?void 0:c.length}catch(t){o.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===Hm&&(o.$lib_custom_api_host=this.config.api_host),u=t!==Oh||s?t!==Fh||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,n),o=js(o,u),t===Oh&&Cs&&(o.title=Cs.title),!Qi(a)){var f=r.getTime()-a;o.$duration=parseFloat((f/1e3).toFixed(3))}Rs&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser");var p=this.persistence.properties(),g=this.sessionPersistence.properties();qs(["$referrer","$referring_domain"],(t=>{t in p&&delete g[t]})),(o=js({},h,p,g,o)).$is_identified=this._isIdentified(),Wi(this.config.property_denylist)?qs(this.config.property_denylist,(function(t){delete o[t]})):Ds.error(sy+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(Ds.error(ny),o=m(o,t));var y=this.Un();return o.$process_person_profile=y,y&&!s&&this.zn("_calculate_event_properties"),o}Bn(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.Un())return t;if(this.yn&&!i)return t;var n=this.persistence.get_initial_props(),s=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),a=js({},n,s||{},t||{}),o=this.config.sanitize_properties;return o&&(Ds.error(ny),a=o(a,"$set_once")),e&&(this.yn=!0),Gi(a)?void 0:a}register(t,e){var i;null==(i=this.persistence)||i.register(t,e)}register_once(t,e,i){var r;null==(r=this.persistence)||r.register_once(t,e,i)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}Wn(t,e){this.register({[t]:e})}getFeatureFlag(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var i,r;return null!==(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(t,e))&&void 0!==i?i:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,i){var r;null==(r=this.featureFlags)||r.updateFlags(t,e,i)}updateEarlyAccessFeatureEnrollment(t,e,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){var r;return void 0===e&&(e=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.vn.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:ry}),()=>{})}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:ry})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:ry})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=ku),null==(i=this.surveys)||i.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,i;return null!==(e=null==(i=this.surveys)?void 0:i.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:ry}}canRenderSurveyAsync(t,e){var i,r;return void 0===e&&(e=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(t,e))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:ry})}Vn(t){return!t||Ki(t)?(Ds.critical("Unique user id has not been set in posthog.identify"),!1):t===_h?(Ds.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())||(Ds.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,i){if(!this.__loaded||!this.persistence)return Ds.uninitializedWarning("posthog.identify");if(tr(t)&&(t=t.toString(),Ds.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Vn(t)&&this.zn("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:t}),this.get_property(Cu)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),t!==r&&t!==this.get_property(Tu)&&(this.unregister(Tu),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(ch)||Eh)===Eh,a=t!==r,o=!a&&s;if(a&&s)this.persistence.set_property(ch,Ih),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.capture(Ah,{distinct_id:t,$anon_distinct_id:r},{$set:e||{},$set_once:i||{}}),this.kn=Wh(t,e,i),null==(n=this.featureFlags)||n.setAnonymousDistinctId(r);else if(o){this.persistence.set_property(ch,Ih);var l=e||{},u=i||{};this.setPersonPropertiesForFlags({$set:l,$set_once:u},!1),this.capture("$set",{$set:l,$set_once:u}),this.kn=Wh(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);a?(this.reloadFeatureFlags(),this.unregister(uh)):o&&(e||i)&&this.reloadFeatureFlags()}}setPersonProperties(t,e){if((t||e)&&this.zn("posthog.setPersonProperties")){var i=Wh(this.get_distinct_id(),t,e);this.kn!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.kn=i):Ds.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(Wi(t)?t:[t]).filter((t=>Ji(t)&&t.length>0));0!==i.length&&this.zn("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.kn=null)}group(t,e,r){if(t&&e){var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:i({},n,{[t]:e})}),s||r){var a={$group_type:t,$group_key:e};r&&(a.$group_set=r),this.capture(Dh,a)}r&&this.setGroupPropertiesForFlags({[t]:r}),s&&!r&&this.reloadFeatureFlags()}else Ds.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),this.zn("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){this.Zn(t)}Zn(t,e){var i,r,n,s,a,o,l,u,h,d;if(void 0===e&&(e=!1),Ds.info("reset"),!this.__loaded)return Ds.uninitializedWarning("posthog.reset");var v,c=this.get_property(Cu),f=this.get_property(Mu),p=this.get_property(Nu),g=this.is_capturing();if(this.consent.reset(),e||!g||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after."),null==(i=this.persistence)||i.clear(),null==(r=this.sessionPersistence)||r.clear(),Qi(p)||null==(v=this.persistence)||v.register({[Nu]:p}),null==(n=this.surveys)||n.reset(),null==(s=this.Nn)||s.stop(),null==(a=this.featureFlags)||a.reset(),null==(o=this.conversations)||o.reset(),null==(l=this.logs)||l.reset(),null==(u=this.metrics)||u.reset(),null==(h=this.persistence)||h.set_property(ch,Eh),null==(d=this.sessionManager)||d.resetSessionId(),this.kn=null,this.config.cookieless_mode===Th)this.register_once({distinct_id:_h,$device_id:null},"");else{var m=this.config.get_device_id(Hh());this.register_once({distinct_id:m,$device_id:t?m:c},""),t||Qi(f)||this.register({[Mu]:f})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(t){var i=this;return e((function*(){var t,e,r,n,s,a,o;i.__loaded?(null==(t=i.Nn)||t.stop(),null==(e=i.An)||e.dispose(),null==(r=i.logs)||r.flushLogs("sendBeacon"),null==(n=i.metrics)||n.flush("sendBeacon"),null==(s=i.En)||s.unload(),null==(a=i.Pn)||a.unload(),null==(o=i.featureFlags)||o.destroy()):Ds.uninitializedWarning("posthog.shutdown")}))()}setIdentity(t,e){var i;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.Gn()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.Qn()}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 e=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=e.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&i){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0)}return r}alias(t,e){return t===this.get_property(Su)?(Ds.critical("Attempting to create alias for existing People user - aborting."),-2):this.zn("posthog.alias")?(Qi(e)&&(e=this.get_distinct_id()),t!==e?(this.Wn(Tu,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(Ds.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=i({},this.config);if(Zi(t)){var r,n,s,a,o,l,u,h,d,v,c;js(this.config,dy(t));var f=this.Tn();null==(r=this.persistence)||r.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Og(i({},this.config,{persistence:"sessionStorage"}),f,!1);var p=this.Sn(this.config.debug);ir(p)&&(this.config.debug=p),ir(this.config.debug)&&(this.config.debug?(Fs.DEBUG=!0,td.P()&&td.A("ph_debug",!0),Ds.info("set_config",{config:t,oldConfig:e,newConfig:i({},this.config)})):(Fs.DEBUG=!1,td.P()&&td.F("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(v=this.surveys)||v.loadIfEnabled(),this.Jn(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){Fs.LIB_NAME=t,Fs.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,a=!0===t,o={sampling:a||!(null==t||!t.sampling),linked_flag:a||!(null==t||!t.linked_flag),url_trigger:a||!(null==t||!t.url_trigger),event_trigger:a||!(null==t||!t.event_trigger)};Object.values(o).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),o.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),o.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 r=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(i({},n,e))}}addExceptionStep(t,e){var i;null==(i=this.exceptions)||i.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:cy.Kn}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,i;return null!==(e=null==(i=this.toolbar)?void 0:i.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:oy;return e!==oy&&(e=oy+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(ch))===Ih||(null==(e=this.sessionPersistence)?void 0:e.get_property(ch))===Ih}Un(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Ph&&!this._isIdentified()&&Gi(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Tu])&&(null==(e=this.persistence)||null==(e=e.props)||!e[bh]))}qn(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Un()||this.zn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.zn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}zn(t){return"never"===this.config.person_profiles?(Ds.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Wn(bh,!0),!0)}Tn(){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!==Mh)}Jn(){var t,e,i,r,n=this.Tn();return(null==(t=this.persistence)?void 0:t.ki)!==n&&(null==(i=this.persistence)||i.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.ki)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Th){if(this.mn()){var i,r,n,s,a;this.Zn(!0,!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new qm(this),this.pageViewManager=new Cg(this),this.persistence&&(this.sessionPropsManager=new Dm(this,this.sessionManager,this.persistence));var o,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(a=cy.__defaultExtensionClasses)?void 0:a.sessionRecording;l&&(this.sessionRecording=this.gn(this.sessionRecording,new l(this)),this.dn&&(null==(o=this.sessionRecording)||null==o.onRemoteConfig||o.onRemoteConfig(this.dn)))}var u,h;this.consent.optInOut(!0),this.Jn(),this.Dn(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Mh&&(null==(u=this.surveys)||u.loadIfEnabled()),(Qi(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.$n()}else Ds.warn(iy)}opt_out_capturing(){var t,e,i;this.config.cookieless_mode!==Th?(this.config.cookieless_mode===Mh&&this.consent.isOptedIn()&&this.Zn(!0,!0),this.consent.optInOut(!1),this.Jn(),this.config.cookieless_mode===Mh&&(this.register({distinct_id:_h,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.$n(),this.Dn())):Ds.warn(iy)}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===Th||(this.config.cookieless_mode===Mh?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Jn()}_is_bot(){return Ss?jm(Ss,this.config.custom_blocked_useragents):void 0}$n(){Cs&&("visible"===Cs.visibilityState?this._n||(this._n=!0,this.capture(Oh,{title:Cs.title},{send_instantly:!0}),this.wn&&(Cs.removeEventListener(Rh,this.wn),this.wn=null)):this.wn||(this.wn=this.$n.bind(this),Zs(Cs,Rh,this.wn)))}debug(t){!1===t?(null==xs||xs.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==xs||xs.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}))}Ji(){var t=this.Cn||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Ds.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):function(t,e,i,r,n){var s=e in t&&!Xi(t[e]),a=i in t&&!Xi(t[i]);return s?t[e]:!!a&&(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,Ds)}Pt(t){var e;if(Xi(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(sr),r=Wi(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r){if(n=s(n),Xi(n)){var a="Event '"+t.event+"' was rejected in beforeSend function";return nr(t.event)?Ds.warn(a+". This can cause unexpected behavior."):Ds.info(a),null}n.properties&&!Gi(n.properties)||Ds.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}for(var o of i)if(n.properties&&Xi(n.properties[o]))return Ds.warn("Event '"+t.event+"' had its '"+o+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var t;return null==(t=this.pageViewManager.ui)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(i)})}Sn(t){var e=ir(t)&&!t,i=td.P()&&"true"===td.q("ph_debug");return!e&&(!!i||t)}}cy.__defaultExtensionClasses={},cy.Kn=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Us(t.prototype[e[i]])}(cy,["identify"]);var fy=$s("[ExceptionAutocapture]"),py=$s("[TracingHeaders]"),gy=$s("[Web Vitals]"),my=9e5,yy="disabled",by="lazy_loading",_y="awaiting_config",wy="missing_config";$s("[SessionRecording]"),$s("[SessionRecording]");var xy="[SessionRecording]",ky=$s(xy),Sy=$s("[Heatmaps]");function Cy(t){return Zi(t)&&"clientX"in t&&"clientY"in t&&tr(t.clientX)&&tr(t.clientY)}var My=$s("[Product Tours]"),Ty=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(Du))},Ey=["$set_once","$set"],Iy=$s("[SiteApps]"),Py="Error while initializing PostHog app with config id ";function Ry(t,e,i){if(Xi(t))return!1;switch(i){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class Ly{constructor(t){this.Yn=new $m,this.Xn=(t,e)=>this.ts(t,e)&&this.es(t,e)&&this.rs(t,e)&&this.ns(t,e),this.ts=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.ss=new Set,this.os=new Set}init(){var t,e;Qi(null==(t=this._instance)?void 0:t._addCaptureHook)||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)})))}register(t){var e,i;if(!Qi(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,i;null==(e=this.os)||e.add(t),null==(i=t.steps)||i.forEach((t=>{var e;null==(e=this.ss)||e.add((null==t?void 0:t.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var r,n=new Set;t.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&n.add(null==t?void 0:t.selector)}))})),null==(r=this._instance)||r.autocapture.setElementSelectors(n)}}on(t,e){var i;null!=e&&0!=t.length&&(this.ss.has(t)||this.ss.has(e.event))&&this.os&&(null==(i=this.os)?void 0:i.size)>0&&this.os.forEach((t=>{this.ls(e,t)&&this.Yn.emit("actionCaptured",t.name)}))}us(t){this.onAction("actionCaptured",(e=>t(e)))}ls(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.Xn(t,i))return!0;return!1}onAction(t,e){return this.Yn.on(t,e)}es(t,e){if(null!=e&&e.url){var i,r=null==t||null==(i=t.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r)return!1;if(!Ry(r,e.url,e.url_matching||"contains"))return!1}return!0}rs(t,e){return!!this.hs(t,e)&&!!this.ds(t,e)&&!!this.vs(t,e)}hs(t,e){var i;if(null==e||!e.href)return!0;var r=this.cs(t);if(r.length>0)return r.some((t=>Ry(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&Ry((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}ds(t,e){var i;if(null==e||!e.text)return!0;var r=this.cs(t);if(r.length>0)return r.some((t=>Ry(t.text,e.text,e.text_matching||"exact")||Ry(t.$el_text,e.text,e.text_matching||"exact")));var n,s,a,o=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!o&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!Xi(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(o),s=e.text,a=e.text_matching||"exact",n.some((t=>Ry(t,s,a))))}vs(t,e){var i,r;if(null==e||!e.selector)return!0;var n=null==t||null==(i=t.properties)?void 0:i.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}cs(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}ns(t,e){return null==e||!e.properties||0===e.properties.length||Gh(e.properties.reduce(((t,e)=>{var i=Wi(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:i,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Oy{constructor(t){var e;this.fs=[],this._instance=t,this.ps=new Map,this.gs=new Map,this.ys=new Map,null==(e=this._instance)||null==e.onSessionId||e.onSessionId((t=>this.bs(t)))}_s(t){return!1}ws(){return null}xs(t){}ks(){}Ss(t,e){return!!t&&Gh(t.propertyFilters,null==e?void 0:e.properties)}Cs(t,e){var i=new Map;return t.forEach((t=>{var r;null==(r=t.conditions)||null==(r=r[e])||null==(r=r.values)||r.forEach((e=>{if(null!=e&&e.name){var r=i.get(e.name)||[];r.push(t.id),i.set(e.name,r)}}))})),i}Ms(t,e,i){var r=(i===Vl?this.ps:this.gs).get(t),n=[];return this.Ts((t=>{n=t.filter((t=>null==r?void 0:r.includes(t.id)))})),n.filter((r=>{var n,s=null==(n=r.conditions)||null==(n=n[i])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.Ss(s,e)}))}register(t){var e;Qi(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.Es(t),this.Is(t))}Is(t){var e=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0}));0!==e.length&&(null==this.Ps&&(this.Ps=new Ly(this._instance),this.Ps.init(),this.Ps.us((t=>{this.onAction(t)}))),e.forEach((t=>{var e,i,r,n,s;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(i=t.conditions)&&null!=(i=i.actions)&&i.values&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(n=this.Ps)||n.register(t.conditions.actions.values),null==(s=t.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((e=>{if(e&&e.name){var i=this.ys.get(e.name);i&&i.push(t.id),this.ys.set(e.name,i||[t.id])}})))})))}Es(t){var e,i=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.events)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0})),r=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(i=t.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0}));0===i.length&&0===r.length||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.ps=this.Cs(t,Vl),this.gs=this.Cs(t,Zl))}onEvent(t,e){var i,r,n=this.Rs(),s=(null==e||null==(i=e.properties)?void 0:i.$survey_id)||(null==e||null==(r=e.properties)?void 0:r.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var a=this.Ls(t,s);if("consume"===a)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Os([s]);if("persist"===a)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Fs(s),void this.As([s])}if(this.gs.has(t)){var o=this.Ms(t,e,Zl);o.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:o.map((t=>t.id))}),this.Os(o.map((t=>t.id))),o.forEach((t=>this.Ds(t.id))))}if(this.ps.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.ps.get(t)});var l=this.Ms(t,e,Vl);this.$s(l.map((t=>t.id)))}}onAction(t){this.ys.has(t)&&this.$s(this.ys.get(t)||[])}$s(t){var e;if(0!==t.length){var i=!(null==(e=this._instance)||null==e.get_session_id||!e.get_session_id()),r=[];for(var n of t)i&&this._s(n)?this.Fs(n)&&this.Ns(n):r.push(n);r.length>0&&(this.fs=[...new Set([...this.fs,...r])]),this.Rs().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Fs(t){this.fs=this.fs.filter((e=>e!==t));var e=this.qs();return!e.includes(t)&&(this.js([...e,t]),this.Bs(),!0)}Os(t){var e=new Set(t);this.fs=this.fs.filter((t=>!e.has(t)));var i=this.Hs(),r=i.filter((t=>!e.has(t)));r.length!==i.length&&(this.js(r),0===r.length&&this.Us()),this.As(t)}zs(){var t,e=this.ws();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}Ns(t){if(this.ws()){var e=this.zs();this.xs(i({},e,{[t]:Date.now()}))}}As(t){if(this.ws()){var e=this.zs(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],a=n[1];t.includes(s)?r=!0:i[s]=a}r&&(Gi(i)?this.ks():this.xs(i))}}Ws(){this.ws()&&this.ks()}getActivationTimestamp(t){if(this.qs().includes(t)){var e=this.zs()[t];return tr(e)?e:void 0}}Hs(){var t,e=this.Vs();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}qs(){var t,e,i=this.Hs();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Zs()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}Bs(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.Gs(e)}Us(){this.Qs()}bs(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Zs()];if(i&&i!==t){var r=this.Hs(),n=this.zs();r.length>0&&(this.js([]),r.filter((t=>tr(n[t]))).forEach((t=>this.Ds(t)))),this.Us(),this.Ws()}}getActivatedIds(){return[...new Set([...this.qs(),...this.fs])].filter((t=>!this.Js(t)))}reset(){this.fs=[],this.Hs().length>0&&this.js([]),this.Us(),this.Ws()}getEventToItemsMap(){return this.ps}Ks(){return this.Ps}}class Fy extends Oy{constructor(t){super(t)}Vs(){return sh}Zs(){return ah}ws(){return oh}xs(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[oh]:t})}ks(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(oh)}_s(t){var e,i;this.Ts((e=>{i=e.find((e=>e.id===t))}));var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return tr(r)&&r>0}Ys(){return eu.SHOWN}Ts(t){var e;null==(e=this._instance)||e.getSurveys(t)}Ds(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Rs(){return fu}js(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[sh]:t})}Gs(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ah]:t})}Qs(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(ah)}Js(){return!1}Ls(t,e){var i;return this.Ts((t=>{i=t.find((t=>t.id===e))})),!i||cu(i)?t===eu.SHOWN?"consume":"ignore":t===eu.SHOWN?"persist":t===eu.DISMISSED||t===eu.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Ay="SDK is not enabled or survey functionality is not yet loaded",Dy="Disabled. Not loading surveys.",$y=null!=xs&&xs.location?ta(xs.location.hash,"__posthog")||ta(location.hash,"state"):null,Ny="_postHogToolbarParams",qy=$s("[Toolbar]"),jy=$s("[FeatureFlags]"),By=$s("[FeatureFlags]",{debugEnabled:!0}),Hy="\" failed. Feature flags didn't load in time.",Uy=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},zy=t=>{var e={};for(var i of Bs(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},Wy="Refusing to render web experiment since the viewer is a likely bot",Vy={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>zh(e,t),not_regex:(t,e)=>!zh(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Zy{get Pe(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Zy.Xs("retrieved web experiments from the server"),e.ta=new Map,t.forEach((t=>{if(t.feature_flag_key){var i;e.ta&&(Zy.Xs("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e.ta)||i.set(t.feature_flag_key,t));var r=e._instance.getFeatureFlag(t.feature_flag_key);Ji(r)&&t.variants[r]&&e.ea(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];Zy.ia(s,e._instance)&&e.ea(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Zy.Xs(Wy);else if(!this.Pe.disable_web_experiments){if(Xi(this.ta))return this.ta=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Zy.Xs("applying feature flags",t),t.forEach((t=>{var e;if(this.ta&&null!=(e=this.ta)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.ta)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.ea(n.name,r,n.variants[r].transforms)}}))}}previewWebExperiment(){var t=Zy.getWindowLocation();if(null!=t&&t.search){var e=Ys(null==t?void 0:t.search,"__experiment_id"),i=Ys(null==t?void 0:t.search,"__experiment_variant");e&&i&&(Zy.Xs("previewing web experiments "+e+" && "+i),this.getWebExperiments((t=>{this.ra(parseInt(e),i,t)}),!1,!0))}}loadIfEnabled(){this.Pe.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.Pe.disable_web_experiments&&!i)return t([]);var r=this._instance.get_property("$web_experiments");if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Pe.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}ra(t,e,i){var r=i.filter((e=>e.id===t));r&&r.length>0&&(Zy.Xs("Previewing web experiment ["+r[0].name+"] with variant ["+e+"]"),this.ea(r[0].name,e,r[0].variants[e].transforms))}static ia(t,e){return!Xi(t.conditions)&&Zy.na(t,e)&&Zy.sa(t)}static na(t,e){var i;if(Xi(t.conditions)||Xi(null==(i=t.conditions)?void 0:i.url))return!0;var r=Zy.getWindowLocation();if(r){var n,s,a,o=aa(e,r.href);return null==(n=t.conditions)||!n.url||Vy[null!==(s=null==(a=t.conditions)?void 0:a.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,o)}return!1}static getWindowLocation(){return null==xs?void 0:xs.location}static sa(t){var e;if(Xi(t.conditions)||Xi(null==(e=t.conditions)?void 0:e.utm))return!0;var i=pv();if(i.utm_source){var r,n,s,a,o,l,u,h,d=null==(r=t.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==i.utm_campaign,v=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(a=t.conditions)||null==(a=a.utm)?void 0:a.utm_source)==i.utm_source,c=null==(o=t.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==i.utm_term;return d&&c&&f&&v}return!1}static Xs(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];Ds.info("[WebExperiments] "+t,i)}ea(t,e,i){this._is_bot()?Zy.Xs(Wy):"control"!==e?i.forEach((i=>{if(i.selector){var r;Zy.Xs("applying transform of variant "+e+" for experiment "+t+" ",i);var n=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==n||n.forEach((t=>{var e=t;i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)}))}})):Zy.Xs("Control variants leave the page unmodified.")}_is_bot(){return Ss&&this._instance?jm(Ss,this.Pe.custom_blocked_useragents):void 0}}var Gy=$s("[Conversations]"),Qy="Conversations not available yet.",Jy="console",Ky="__posthogHandledLogsRequestError",Yy=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[Ky]=!0,i},Xy=t=>!!t&&"object"==typeof t&&!0===t[Ky],tb={featureFlags:class{constructor(t){this.aa=!1,this.oa=!1,this.la=!1,this.ua=!1,this.ha=!1,this.da=!1,this.va=!1,this.ca=!1,this.fa=0,this.pa=()=>{var t=this.ga();this.fa=0,t&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],xs&&Zs(xs,"online",this.pa)}destroy(){null==xs||xs.removeEventListener("online",this.pa)}get Pe(){return this._instance.config}get Tr(){return this._instance.persistence}ma(t){return this._instance.get_property(t)}ya(){var t,e;return null!==(t=null==(e=this.Tr)?void 0:e.Ci(this.Pe.feature_flag_cache_ttl_ms))&&void 0!==t&&t}ba(){return!!this.ya()&&(this.ca||this.la||(this.ca=!0,jy.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}_a(){var t,e=null!==(t=this.Pe.evaluation_contexts)&&void 0!==t?t:this.Pe.evaluation_environments;return!this.Pe.evaluation_environments||this.Pe.evaluation_contexts||this.va||(jy.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.va=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||jy.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}wa(){return this._a().length>0}xa(){var t=this.Pe.flag_keys;if(!Qi(t)){if(Wi(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||jy.error("Invalid flag key found:",t,"Expected non-empty string"),e}));jy.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,i=this._instance.config,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,a=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},o=Object.keys(r).filter((t=>!!r[t])).reduce(((t,e)=>(t[e]=r[e]||!1,t)),{}),l=Object.keys(a).filter((t=>o[t])).reduce(((t,e)=>(a[e]&&(t[e]=a[e]),t)),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:l})}}updateFlags(t,e,r){var n,s,a=null!=r&&r.merge&&null!==(n=this.ma(Vu))&&void 0!==n?n:{},o=null!=r&&r.merge&&null!==(s=this.ma(Ju))&&void 0!==s?s:{},l=i({},a,t),u=i({},o,e),h={};for(var d of Object.entries(l)){var v=d[0],c=d[1];h[v]={key:v,enabled:bi(c),variant:_i(c),reason:void 0,metadata:Qi(null==u?void 0:u[v])?void 0:{id:0,version:void 0,description:void 0,payload:u[v]}}}this.receivedFeatureFlags({flags:h})}get hasLoadedFlags(){return this.oa}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.ma(Qu),e=this.ma(Xu),r=this.ma(th);if(!r&&!e)return t||{};var n=js({},t||{}),s=[...new Set([...Object.keys(r||{}),...Object.keys(e||{})])];for(var a of s){var o,l,u=n[a],h=null==e?void 0:e[a],d=Qi(h)?null!==(o=null==u?void 0:u.enabled)&&void 0!==o&&o:!!h,v=Qi(h)?u.variant:"string"==typeof h?h:void 0,c=null==r?void 0:r[a],f=i({},u,{enabled:d,variant:d?null!=v?v:null==u?void 0:u.variant:void 0});d!==(null==u?void 0:u.enabled)&&(f.original_enabled=null==u?void 0:u.enabled),v!==(null==u?void 0:u.variant)&&(f.original_variant=null==u?void 0:u.variant),c&&(f.metadata=i({},null==u?void 0:u.metadata,{payload:c,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload})),n[a]=f}return this.aa||(jy.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:n}),this.aa=!0),n}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((i=>{var r=t[i];return{key:i,enabled:bi(r),variant:_i(r),payload:yi(e[i])}}))}getFlagVariants(){var t=this.ma(Vu),e=this.ma(Xu);if(!e)return t||{};for(var i=js({},t),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.aa||(jy.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.aa=!0),i}getFlagPayloads(){var t=this.ma(Ju),e=this.ma(th);if(!e)return t||{};for(var i=js({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.aa||(jy.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.aa=!0),i}reloadFeatureFlags(){this.ua||this.Pe.advanced_disable_feature_flags||this.ga()||this.ka||(this._instance.vn.emit("featureFlagsReloading",!0),this.ka=setTimeout((()=>{this.Sa()}),5))}Ca(){clearTimeout(this.ka),this.ka=void 0}ensureFlagsLoaded(){this.oa||this.la||this.ka||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ua=t}Sa(t){var e;if(this.Ca(),!this._instance.Ji()&&!this.ga())if(this.la)this.ha=!0;else{var r=this.Pe.token,n=this.ma(Cu),s={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i({},(null==(e=this.Tr)?void 0:e.get_initial_props())||{},this.ma(eh)||{},{$lib:Fs.LIB_NAME,$lib_version:Fs.LIB_VERSION}),group_properties:this.ma(ih),timezone:kv()};Yi(n)||Qi(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this.Pe.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.wa()&&(s.evaluation_contexts=this._a());var a=this.xa();Qi(a)||(s.flag_keys=a);var o=!!this.Pe.advanced_only_evaluate_survey_feature_flags,l=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Pe.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.la=!0,this._instance._send_request({method:"POST",url:l,data:s,compression:this.Pe.disable_compression?void 0:Wl,timestampMode:"body",timeout:this.Pe.feature_flag_request_timeout_ms,callback:t=>{var e,i,r,n=!0;if(this.Ma(t.statusCode),200===t.statusCode&&(this.ha||(this.$anon_distinct_id=void 0),n=!1),this.la=!1,!s.disable_flags||this.ha){this.da=!n;var a=[];t.error?t.error instanceof Error?a.push("AbortError"===t.error.name?"timeout":"connection_error"):a.push("unknown_error"):200!==t.statusCode&&a.push("api_error_"+t.statusCode),null!=(e=t.json)&&e.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");var l,u=!(null==(i=t.json)||null==(i=i.quotaLimited)||!i.includes("feature_flags"));if(u&&a.push("quota_limited"),null==(r=this.Tr)||r.register({[dh]:a}),u)jy.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!==(l=t.json)&&void 0!==l?l:{},n,{partialResponse:o}),this.ha&&(this.ha=!1,this.Sa())}}})}}ga(){return ea(this.fa,3)}Ma(t){this.fa=ia(t,this.fa,3,(()=>jy.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var i;if(void 0===e&&(e={}),!e.fresh||this.da)if(this.oa||this.getFlags()&&this.getFlags().length>0){if(!this.ba()){var r=this.getFeatureFlagResult(t,e);return null!==(i=null==r?void 0:r.variant)&&void 0!==i?i:null==r?void 0:r.enabled}}else jy.warn('getFeatureFlag for key "'+t+Hy)}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.da)if(this.oa||this.getFlags()&&this.getFlags().length>0){if(!this.ba()){var i=this.getFlagVariants(),r=t in i,n=i[t],s=this.getFlagPayloads()[t],a=String(n),o=this.ma(Ku)||void 0,l=this.ma(vh)||void 0,u=this.ma(uh)||{};if(this.Pe.advanced_feature_flags_dedup_per_session){var h,d=this._instance.get_session_id(),v=this.ma(hh);d&&d!==v&&(u={},null==(h=this.Tr)||h.register({[uh]:u,[hh]:d}))}if((e.send_event||!("send_event"in e))&&(!(t in u)||!u[t].includes(a))){var c,f,p,g,m,y,b,_,w,x,k;Wi(u[t])?u[t].push(a):u[t]=[a],null==(c=this.Tr)||c.register({[uh]:u});var S=this.getFeatureFlagDetails(t),C=[...null!==(f=this.ma(dh))&&void 0!==f?f:[]];Qi(n)&&C.push("flag_missing");var M={$feature_flag:t,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this.Pe.bootstrap)||null==(p=p.featureFlags)?void 0:p[t])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Pe.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[t])||null,$used_bootstrap_value:!this.da};Qi(null==S||null==(m=S.metadata)?void 0:m.has_experiment)||(M.$feature_flag_has_experiment=S.metadata.has_experiment),Qi(null==S||null==(y=S.metadata)?void 0:y.version)||(M.$feature_flag_version=S.metadata.version);var T,E=null!==(b=null==S||null==(_=S.reason)?void 0:_.description)&&void 0!==b?b:null==S||null==(w=S.reason)?void 0:w.code;E&&(M.$feature_flag_reason=E),null!=S&&null!=(x=S.metadata)&&x.id&&(M.$feature_flag_id=S.metadata.id),Qi(null==S?void 0:S.original_variant)&&Qi(null==S?void 0:S.original_enabled)||(M.$feature_flag_original_response=Qi(S.original_variant)?S.original_enabled:S.original_variant),null!=S&&null!=(k=S.metadata)&&k.original_payload&&(M.$feature_flag_original_payload=null==S||null==(T=S.metadata)?void 0:T.original_payload),C.length&&(M.$feature_flag_error=C.join(",")),this._instance.capture("$feature_flag_called",M)}if(r)return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:yi(s)}}}else jy.warn('getFeatureFlagResult for key "'+t+Hy)}getRemoteConfigPayload(t,e){var i=this.Pe.token,r={distinct_id:this._instance.get_distinct_id(),token:i,person_properties:{$lib:Fs.LIB_NAME,$lib_version:Fs.LIB_VERSION}};this.wa()&&(r.evaluation_contexts=this._a());var n=this.xa();Qi(n)||(r.flag_keys=n),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Pe.disable_compression?void 0:Wl,timestampMode:"body",timeout:this.Pe.feature_flag_request_timeout_ms,callback(i){var r,n=null==(r=i.json)?void 0:r.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.da)return e.defaultValue;if(!(this.oa||this.getFlags()&&this.getFlags().length>0))return jy.warn('isFeatureEnabled for key "'+t+Hy),e.defaultValue;var i=this.getFeatureFlag(t,e);return Qi(i)?e.defaultValue:!!i}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,r){if(this.Tr){this.oa=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),a=this.getFlagsWithDetails();!function(t,e,r,n,s,a){void 0===r&&(r={}),void 0===n&&(n={}),void 0===s&&(s={});var o=(t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var i;return[t,null!==(i=e[t].variant)&&void 0!==i?i:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var i;return null==(i=e[t].metadata)?void 0:i.payload})).map((t=>{var i;return[t,null==(i=e[t].metadata)?void 0:i.payload]})))):t.featureFlags&&jy.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t})(t),l=o.flags,u=o.featureFlags,h=o.featureFlagPayloads;if(u){var d=t.requestId,v=t.evaluatedAt;if(Wi(u)){jy.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var c={};if(u)for(var f=0;u.length>f;f++)c[u[f]]=!0;e&&e.register({[Zu]:u,[Vu]:c,[Yu]:!1})}else{var p=u,g=h,m=l;if(null!=a&&a.partialResponse)p=i({},r,p),g=i({},n,g),m=i({},s,m);else if(t.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter((t=>{var e;return!(null!=(e=l[t])&&e.failed)})));p=i({},r,Object.fromEntries(Object.entries(p).filter((t=>y.has(t[0]))))),g=i({},n,Object.fromEntries(Object.entries(g||{}).filter((t=>y.has(t[0]))))),m=i({},s,Object.fromEntries(Object.entries(m||{}).filter((t=>y.has(t[0])))))}else p=i({},r,p),g=i({},n,g),m=i({},s,m);e&&e.register(i({[Zu]:Object.keys(zy(p)),[Vu]:p||{},[Ju]:g||{},[Qu]:m||{},[Yu]:!0===t.minimalFlagCalledEvents},d?{[Ku]:d}:{},v?{[vh]:v}:{}))}}}(t,this.Tr,n,s,a,r),e||(this.ca=!1),this.Ta(e)}}override(t,e){void 0===e&&(e=!1),jy.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.Tr)return jy.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.Tr.unregister(Xu),this.Tr.unregister(th),this.Ta(),By.info("All overrides cleared");if(Wi(t)){var e=Uy(t);return this.Tr.register({[Xu]:e}),this.Ta(),By.info("Flag overrides set",{flags:t})}if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var i,r=t;if(this.aa=Boolean(null!==(i=r.suppressWarning)&&void 0!==i&&i),"flags"in r)if(!1===r.flags)this.Tr.unregister(Xu),By.info("Flag overrides cleared");else if(r.flags){if(Wi(r.flags)){var n=Uy(r.flags);this.Tr.register({[Xu]:n})}else this.Tr.register({[Xu]:r.flags});By.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this.Tr.unregister(th),By.info("Payload overrides cleared")):r.payloads&&(this.Tr.register({[th]:r.payloads}),By.info("Payload overrides set",{payloads:r.payloads}))),void this.Ta()}if(t&&"object"==typeof t)return this.Tr.register({[Xu]:t}),this.Ta(),By.info("Flag overrides set",{flags:t});jy.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.oa){var e=this.Ea(),i=e.flags,r=e.flagVariants;try{t(i,r)}catch(t){jy.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,r){var n,s=(this.ma(Gu)||[]).find((e=>e.flagKey===t)),a={["$feature_enrollment/"+t]:e},o={$feature_flag:t,$feature_enrollment:e,$set:a};s&&(o.$early_access_feature_name=s.name),r&&(o.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(a,!1);var l=i({},this.getFlagVariants(),{[t]:e});null==(n=this.Tr)||n.register({[Zu]:Object.keys(zy(l)),[Vu]:l}),this.Ta()}getEarlyAccessFeatures(t,e,i){void 0===e&&(e=!1);var r=this.ma(Gu),n=i?"&"+i.map((t=>"stage="+t)).join("&"):"";if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Pe.token+n),method:"GET",timestampMode:"query",callback:e=>{var i,r;if(e.json){var n=e.json.earlyAccessFeatures;return null==(i=this.Tr)||i.unregister(Gu),null==(r=this.Tr)||r.register({[Gu]:n}),t(n)}}})}Ea(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,i)=>(t[i]=e[i],t)),{})}}Ta(t){var e=this.Ea(),i=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((e=>{try{e(i,r,{errorsLoading:t})}catch(t){jy.error("Error while running feature flags callback",t)}}))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var r=this.ma(eh)||{},n=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$set_once,a={};if(s)for(var o in s)({}).hasOwnProperty.call(s,o)&&(o in r||(a[o]=s[o]));this._instance.register({[eh]:i({},r,a,n)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var r=i({},this.ma(eh)||{});t.forEach((t=>{delete r[t]})),this._instance.register({[eh]:r}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this._instance.unregister(eh),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var r=this.ma(ih)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((e=>{r[e]=i({},r[e],t[e]),delete t[e]})),this._instance.register({[ih]:i({},r,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.ma(ih)||{};this._instance.register({[ih]:i({},e,{[t]:{}})})}else this._instance.unregister(ih)}reset(){this.oa=!1,this.la=!1,this.ua=!1,this.ha=!1,this.da=!1,this.$anon_distinct_id=void 0,this.Ca(),this.aa=!1,this.fa=0}}},eb={sessionRecording:class{get Pe(){return this._instance.config}get Tr(){return this._instance.persistence}get started(){var t;return!(null==(t=this.Ia)||!t.isStarted)}get status(){var t,e;return this.Pa===_y||this.Pa===wy?this.Pa:null!==(t=null==(e=this.Ia)?void 0:e.status)&&void 0!==t?t:this.Pa}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Pa=yy,this.Ra=void 0,this._instance=t,!this._instance.sessionManager)throw ky.error("started without valid sessionManager"),new Error(xy+" started without valid sessionManager. This is a bug.");if(this.Pe.cookieless_mode===Th)throw new Error(xy+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get La(){var t,e=!(null==(t=this._instance.get_property(Nu))||!t.enabled),i=!this.Pe.disable_session_recording,r=this.Pe.disable_session_recording||this._instance.consent.isOptedOut();return xs&&e&&i&&!r}startIfEnabledOrStop(t){var e;if(!this.La||null==(e=this.Ia)||!e.isStarted){var i=!Qi(Object.assign)&&!Qi(Array.from);this.La&&i?(this.Oa(t),ky.info("starting")):(this.Pa=yy,this.stopRecording())}}Oa(t){var e,i,r;this.La&&(this.Pa!==_y&&this.Pa!==wy&&(this.Pa=by),null!=Mo&&null!=(e=Mo.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=Mo.__PosthogExtensions__)&&i.initSessionRecording?this.Fa(t):null==(r=Mo.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Aa,(e=>{if(e)return ky.error("could not load recorder",e);this.Fa(t)})))}stopRecording(){var t,e;null==(t=this.Ra)||t.call(this),this.Ra=void 0,null==(e=this.Ia)||e.stop()}Da(){var t,e;null==(t=this.Ra)||t.call(this),this.Ra=void 0,null==(e=this.Ia)||e.discard()}$a(){var t,e;null==(t=this.Tr)||t.unregister(Wu),null==(e=this.Tr)||e.unregister(qu)}Na(t,e){if(Xi(t))return null;var i,r=tr(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(ky.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}qa(t){if(this.Tr){var e,r,n=this.Tr,s=()=>{var e,r=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.Na(null==(e=this.Pe.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),a=this.Na(null==r?void 0:r.sampleRate,"remote config sampleRate"),o=null!=s?s:a;Xi(o)&&this.$a();var l=null==r?void 0:r.minimumDurationMilliseconds;n.register({[Nu]:i({cache_timestamp:Date.now(),enabled:!!r},r,{networkPayloadCapture:i({capturePerformance:t.capturePerformance},null==r?void 0:r.networkPayloadCapture),canvasRecording:{enabled:null==r?void 0:r.recordCanvas,fps:null==r?void 0:r.canvasFps,quality:null==r?void 0:r.canvasQuality},sampleRate:o,minimumDurationMilliseconds:Qi(l)?null:l,endpoint:null==r?void 0:r.endpoint,triggerMatchType:null==r?void 0:r.triggerMatchType,masking:null==r?void 0:r.masking,urlTriggers:null==r?void 0:r.urlTriggers,version:null==r?void 0:r.version,triggerGroups:null==r?void 0:r.triggerGroups})})};s(),null==(e=this.Ra)||e.call(this),this.Ra=null==(r=this._instance.sessionManager)?void 0:r.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.qa(e),void this.Da()):(this.qa(e),void this.startIfEnabledOrStop()):(this.Pa===_y&&(this.Pa=wy,ky.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var i;void 0===e&&(e="log"),null!=(i=this.Ia)&&i.log?this.Ia.log(t,e):ky.warn("log called before recorder was ready")}get Aa(){var t,e,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Nu);return(null==i||null==(e=i.scriptConfig)?void 0:e.script)||"lazy-recorder"}ja(){var t,e,i=this._instance.get_property(Nu);if(!i)return!1;try{e="object"==typeof i?i:JSON.parse(i)}catch(t){return ky.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}var r=null!==(t=e.cache_timestamp)&&void 0!==t?t:Date.now();return 36e5>=Date.now()-r}Fa(t){var e,i;if(null==(e=Mo.__PosthogExtensions__)||!e.initSessionRecording)return ky.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Sh]:!0});if(this.Ia||(this.Ia=null==(i=Mo.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.Ia._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ja()){if(this.Pa===wy||this.Pa===_y)return;return this.Pa=_y,ky.info("persisted remote config is stale, requesting fresh config before starting"),void new $g(this._instance).load()}this.Pa=by,this.Ia.start(t)}onRRwebEmit(t){var e;null==(e=this.Ia)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Ia||null==(e=this.Tr)||e.register({[Bu]:!0}),null==(t=this.Ia)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Ia||null==(e=this.Tr)||e.register({[ju]:!0}),null==(t=this.Ia)||t.overrideSampling()}overrideTrigger(t){var e,i;this.Ia||null==(i=this.Tr)||i.register({["url"===t?Hu:Uu]:!0}),null==(e=this.Ia)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Ia)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.Ia)||!i.tryAddCustomEvent(t,e))}}},ib={autocapture:class{constructor(t){this.Ba=!1,this.Ha=null,this.Ua=!1,this.za=!1,this.instance=t,this.rageclicks=new tg(t.config.rageclick),this.Wa=null}initialize(){this.startIfEnabled()}get Pe(){var t,e,i=Zi(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(t=i.url_allowlist)?void 0:t.map((t=>new RegExp(t))),i.url_ignorelist=null==(e=i.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),i}Va(){if(this.isBrowserSupported()){if(xs&&Cs){var t=t=>{t=t||(null==xs?void 0:xs.event);try{this.Za(t)}catch(t){ig.error("Failed to capture event",t)}};if(Zs(Cs,"submit",t,{capture:!0}),Zs(Cs,"change",t,{capture:!0}),Zs(Cs,"click",t,{capture:!0}),this.Pe.capture_copied_text){var e=t=>{t=t||(null==xs?void 0:xs.event);try{this.Za(t,eg)}catch(t){ig.error("Failed to capture copy/cut event",t)}};Zs(Cs,"copy",e,{capture:!0}),Zs(Cs,"cut",e,{capture:!0})}}}else ig.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ba&&(this.Va(),this.Ba=!0)}onRemoteConfig(t){if(this.Ua=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.za=e.elementsChainAsString);var i=e.autocapture_opt_out;ir(i)&&(this.instance.persistence&&this.instance.persistence.register({[Iu]:i}),this.Ha=i),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.Wa=t}getElementSelectors(t){var e,i=[];return null==(e=this.Wa)||e.forEach((e=>{var r=null==Cs?void 0:Cs.querySelectorAll(e);null==r||r.forEach((r=>{t===r&&i.push(e)}))})),i}get isEnabled(){var t,e,i=null==(t=this.instance.persistence)?void 0:t.props[Iu],r=this.Ha,n=this.instance.Ji()&&!this.Ua;if(Yi(r)&&!ir(i)&&!n)return!1;var s=null!==(e=this.Ha)&&void 0!==e?e:!!i;return!!this.instance.config.autocapture&&!s}Za(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var i,r=ka(t);pa(r)&&(r=r.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&Fa(r,this.instance.config.rageclick)&&this.Za(t,"$rageclick");var n=e===eg;if(r&&function(t,e,i,r,n,s){var a;if(!xs||Aa(t))return!1;if(null!=i&&i.url_allowlist&&!ba(i.url_allowlist,s))return!1;if(null!=i&&i.url_ignorelist&&ba(i.url_ignorelist,s))return!1;if(null!=i&&i.dom_event_allowlist){var o=i.dom_event_allowlist;if(o&&!o.some((t=>e.type===t)))return!1}var l=Da(t,r),u=l.parentIsUsefulElement,h=l.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(Qi(i))return!0;var r,n=function(t){if(i.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(h,i))return!1;if(!Ca(h,null==i?void 0:i.css_selector_allowlist))return!1;if(Ca(h,null!==(a=null==i?void 0:i.css_selector_ignorelist)&&void 0!==a?a:Ta))return!1;try{var d=xs.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0}catch(t){}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 u?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(Sa.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}(r,t,this.Pe,n,n?["copy","cut"]:void 0,this.instance)){var s=sg(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Pe.element_attribute_ignorelist,elementsChainAsString:this.za,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),a=s.props;if(s.explicitNoCapture)return!1;var o=this.getElementSelectors(r);if(o&&o.length>0&&(a.$element_selectors=o),e===eg){var l,u=wa(null==xs||null==(l=xs.getSelection())?void 0:l.toString()),h=t.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=h}return this.instance.capture(e,a),!0}}}isBrowserSupported(){return Vi(null==Cs?void 0:Cs.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Ga=(null==xs||null==(e=xs.location)?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(Ds.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Qa&&this.Qa(),this.Qa=void 0,Ds.info("History API monitoring stopped")}monitorHistoryChanges(){xs&&xs.history&&(this.Ja("pushState"),this.Ja("replaceState"),this.Ka())}Ja(t){var e;if(xs&&(null==(e=xs.history[t])||!e.__posthog_wrapped__)){var i=this;na(xs.history,t,(e=>function(r,n,s){e.call(this,r,n,s),i.Ya(t)}))}}Ya(t){try{var e,i=null==xs||null==(e=xs.location)?void 0:e.pathname;if(!i)return;i!==this.Ga&&this.isEnabled&&this._instance.capture(Oh,{navigation_type:t}),this.Ga=i}catch(e){Ds.error("Error capturing "+t+" pageview",e)}}Ka(){if(!this.Qa){var t=()=>{this.Ya("popstate")};Zs(xs,"popstate",t),this.Qa=()=>{xs&&xs.removeEventListener("popstate",t)}}}},heatmaps:class{get Pe(){return this.instance.config}constructor(t){var e;this.Xa=!1,this.Ba=!1,this.eo=null,this.instance=t,this.Xa=!(null==(e=this.instance.persistence)||!e.props[Pu]),this.rageclicks=new tg(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Zi(this.Pe.capture_heatmaps)&&this.Pe.capture_heatmaps.flush_interval_milliseconds&&(t=this.Pe.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Xi(this.Pe.capture_heatmaps)?Xi(this.Pe.enable_heatmaps)?this.Xa:this.Pe.enable_heatmaps:!1!==this.Pe.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ba)return;Sy.info("starting..."),this.io(),this.Ie()}else{var t;clearInterval(null!==(t=this.eo)&&void 0!==t?t:void 0),this.ro(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var i=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Pu]:i}),this.Xa=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.O;return this.O=void 0,t}no(t){Cy(t.originalEvent)&&this.ke(t.originalEvent,"deadclick")}Ie(){this.eo&&clearInterval(this.eo),this.eo=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(Cs)?setInterval(this.pr.bind(this),this.flushIntervalMilliseconds):null}io(){xs&&Cs&&(this.so=this.pr.bind(this),Zs(xs,Lh,this.so),this.ao=t=>this.ke(t||(null==xs?void 0:xs.event)),Zs(Cs,"click",this.ao,{capture:!0}),this.oo=t=>this.lo(t||(null==xs?void 0:xs.event)),Zs(Cs,"mousemove",this.oo,{capture:!0}),this.uo=new _g(this.instance,yg,this.no.bind(this)),this.uo.startIfEnabledOrStop(),this.ho=this.Ie.bind(this),Zs(Cs,Rh,this.ho),this.Ba=!0)}ro(){var t;xs&&Cs&&(this.so&&xs.removeEventListener(Lh,this.so),this.ao&&Cs.removeEventListener("click",this.ao,{capture:!0}),this.oo&&Cs.removeEventListener("mousemove",this.oo,{capture:!0}),this.ho&&Cs.removeEventListener(Rh,this.ho),clearTimeout(this.do),null==(t=this.uo)||t.stop(),this.Ba=!1)}vo(t,e){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,i){for(var r=t;r&&ca(r)&&!fa(r,"body");){if(r===i)return!1;var n=void 0;try{var s,a,o;n=null==(s=null!==(a=null==(o=r.ownerDocument)?void 0:o.defaultView)&&void 0!==a?a:xs)?void 0:s.getComputedStyle(r).position}catch(t){return!1}if(Ni(e,n))return!0;r=Ma(r)}return!1}(ka(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:r),y:t.clientY+(s?0:i),target_fixed:s,type:e}}ke(t,e){var r;if(void 0===e&&(e="click"),!va(t.target)&&Cy(t)){var n=this.vo(t,e);null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&Fa(ka(t),this.instance.config.rageclick)&&this.Vt(i({},n,{type:"rageclick"})),this.Vt(n)}}lo(t){!va(t.target)&&Cy(t)&&(clearTimeout(this.do),this.do=setTimeout((()=>{this.Vt(this.vo(t,"mousemove"))}),500))}Vt(t){if(xs){var e=this.Pe.disable_capture_url_hashes?kn(xs.location.href):xs.location.href,i=this.Pe.custom_personal_data_properties,r=this.Pe.mask_personal_data_properties?[...dv,...i||[]]:[],n=Xs(e,r,cv);this.O=this.O||{},this.O[n]||(this.O[n]=[]),this.O[n].push(t)}}pr(){this.O&&!Gi(this.O)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:_g,webVitalsAutocapture:class{constructor(t){var e;this.Xa=!1,this.Ba=!1,this.O={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.co=()=>{clearTimeout(this.fo),this.fo=void 0,0!==this.O.metrics.length&&(this._instance.capture("$web_vitals",i({$current_url:this.O.url},this.O.metrics.reduce(((t,e)=>i({},t,{["$web_vitals_"+e.name+"_event"]:i({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{}))),this.O={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.po=t=>{var e;if(this.O=this.O||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Xi(null==t?void 0:t.name)||Xi(null==t?void 0:t.value))gy.error("Invalid metric received",t);else{var r="string"==typeof t.navigationURL?t.navigationURL:void 0,n=this.mo(r);if(!Qi(n)){var s=tr(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+n;if(!this.yo||this.yo>t.value){this.O.navigationKey!==s&&(this.co(),this.fo=setTimeout(this.co,this.flushToCaptureTimeoutMs)),Qi(this.O.navigationKey)&&(this.O.navigationKey=s,this.O.url=n),this.O.firstMetricTimestamp=Qi(this.O.firstMetricTimestamp)?Date.now():this.O.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0);var a=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),o=i({},t,r?{navigationURL:n}:{},{$current_url:n,timestamp:Date.now()});Qi(a)||(o.$session_id=a.sessionId,o.$window_id=a.windowId),this.O.metrics.push(o),this.O.metrics.length===this.allowedMetrics.length&&this.co()}else gy.error("Ignoring metric with value >= "+this.yo,t)}}},this.bo=()=>{if(!this.Ba){var t,e,i,r,n=Mo.__PosthogExtensions__,s=null==n?void 0:n.postHogWebVitalsCallbacksByFlavor,a=(null==s?void 0:s[this._o])||("web-vitals"===this._o&&Qi(s)?null==n?void 0:n.postHogWebVitalsCallbacks:void 0);if(Qi(a)||(t=a.onLCP,e=a.onCLS,i=a.onFCP,r=a.onINP),t&&e&&i&&r){var o={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf("LCP")>-1&&t(this.po.bind(this),o),this.allowedMetrics.indexOf("CLS")>-1&&e(this.po.bind(this),o),this.allowedMetrics.indexOf("FCP")>-1&&i(this.po.bind(this),o),this.allowedMetrics.indexOf("INP")>-1&&r(this.po.bind(this),o),this.Ba=!0}else gy.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Xa=!(null==(e=this._instance.persistence)||!e.props[Fu]),this.startIfEnabled()}get wo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Zi(this.wo)?null==(t=this.wo)?void 0:t.web_vitals_allowed_metrics:void 0;return Xi(i)?(null==(e=this._instance.persistence)?void 0:e.props[$u])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(Zi(this.wo)?this.wo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Zi(this.wo)?this.wo.web_vitals_attribution:void 0;return null!=t&&t}get useSoftNavs(){var t=Zi(this.wo)?this.wo.__preview_web_vitals_soft_navs:void 0;return null!=t&&t}get yo(){var t=Zi(this.wo)&&tr(this.wo.__web_vitals_max_value)?this.wo.__web_vitals_max_value:my;return t>0&&6e4>=t?my:t}get isEnabled(){var t=null==Ms?void 0:Ms.protocol;if("http:"!==t&&"https:"!==t)return gy.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Zi(this.wo)?this.wo.web_vitals:ir(this.wo)?this.wo:void 0;return ir(e)?e:this.Xa}startIfEnabled(){this.isEnabled&&!this.Ba&&(gy.info("enabled, starting..."),this.ai(this.bo))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=Zi(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Zi(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Fu]:i}),this._instance.persistence.register({[$u]:r})),this.Xa=i,this.startIfEnabled()}}}get _o(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}ai(t){var e=Mo.__PosthogExtensions__,i=this._o,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&Qi(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,(e=>{e?gy.error("failed to load script",e):t()}))}mo(t){var e=t||(null==xs?void 0:xs.location.href);if(e){var i=this._instance.config.disable_capture_url_hashes?kn(e):e,r=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...dv,...r||[]]:[];return Xs(i,n,cv)}gy.error("Could not determine current URL")}}},rb={exceptionObserver:class{constructor(t){var e;this.bo=()=>{var t;if(xs&&this.isEnabled&&null!=(t=Mo.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=Mo.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=Mo.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=Mo.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.xo&&this.Pe.capture_unhandled_errors&&(this.xo=e(this.captureException.bind(this))),!this.ko&&this.Pe.capture_unhandled_rejections&&(this.ko=i(this.captureException.bind(this))),!this.So&&this.Pe.capture_console_errors&&(this.So=r(this.captureException.bind(this)))}catch(t){fy.error("failed to start",t),this.Co()}}},this._instance=t,this.Mo=!(null==(e=this._instance.persistence)||!e.props[Ru]),this.To=new fr(i({},function(t){var e,i,r,n;return void 0===t&&(t={}),{refillRate:null!==(e=null!==(i=t.exceptionRateLimiterRefillRate)&&void 0!==i?i:t.__exceptionRateLimiterRefillRate)&&void 0!==e?e:1,bucketSize:null!==(r=null!==(n=t.exceptionRateLimiterBucketSize)&&void 0!==n?n:t.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10}}(this._instance.config.error_tracking),{refillInterval:1e4,rt:fy})),this.Pe=this.Eo(),this.startIfEnabledOrStop()}Eo(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Zi(t)?e=i({},e,t):(Qi(t)?this.Mo:t)&&(e=i({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Pe.capture_console_errors||this.Pe.capture_unhandled_errors||this.Pe.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(fy.info("enabled"),this.Co(),this.ai(this.bo)):this.Co()}ai(t){var e,i;null!=(e=Mo.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(i=Mo.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return fy.error("failed to load script",e);t()}))}Co(){var t,e,i;null==(t=this.xo)||t.call(this),this.xo=void 0,null==(e=this.ko)||e.call(this),this.ko=void 0,null==(i=this.So)||i.call(this),this.So=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Mo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Ru]:this.Mo}),this.Pe=this.Eo(),this.startIfEnabledOrStop())}}onConfigChange(){this.Pe=this.Eo()}captureException(t){var e,i,r,n=null!==(e=null==t||null==(i=t.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==e?e:"Exception";this.To.consumeRateLimit(n)?fy.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,i;this.Io=[],this.Po=Gv(),this._instance=t,this.Io=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property(Lu))&&void 0!==e?e:[],this.Ro=bs(this.Lo()),this.Oo=new _s(this.Ro)}onConfigChange(){this.Ro=bs(this.Lo()),this.Oo.setConfig(this.Ro)}onRemoteConfig(t){var e,i,r;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(i=n.errorTracking)?void 0:i.suppressionRules)&&void 0!==e?e:[],a=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this.Io=s,this._instance.persistence&&this._instance.persistence.register({[Lu]:this.Io,[Ou]:a})}}}get Fo(){var t,e=!!this._instance.get_property(Ou),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=i?i:e)&&void 0!==t&&t}buildProperties(t,e){return this.Po.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.Ro.enabled)try{if(!Ji(t)||0===t.trim().length)return void Zv.warn("Ignoring exception step because message must be a non-empty string");var r=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((i,r)=>ms.has(r)?(e.push(r),i):(i[r]=t[r],i)),{}),droppedKeys:e}}(this.Ao(e)),n=r.sanitizedProperties,s=r.droppedKeys;s.length>0&&Zv.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Oo.add(i({[ps]:t,[gs]:(new Date).toISOString()},n))}catch(t){Zv.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Do(e)){if(this.$o(e))return this.No("Exception dropped: matched a suppression rule"),void Zv.info("Skipping exception capture because a suppression rule matched");if(!this.Fo&&this.qo(e))return this.No("Exception dropped: thrown by a browser extension"),void Zv.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.jo(e))return this.No("Exception dropped: thrown by the PostHog SDK"),void Zv.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.Ro.enabled&&Xi(t.$exception_steps)?this.Bo(t):t,r="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;r&&(i.$release_id=r);try{var n=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",jn:!0});return n&&this.Oo.clear(),n}catch(t){return Zv.error("Failed to capture exception event. Dropping this exception.",t),void this.Oo.clear()}}catch(t){return void Zv.error("Failed to process exception event. Ignoring this exception.",t)}var s}Bo(t){try{var e=this.Oo.getAttachable();return 0===e.length?t:i({},t,{$exception_steps:e})}catch(e){return Zv.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}No(t){this.Ro.enabled&&this.Oo.add({[ps]:t,[gs]:(new Date).toISOString()})}Ao(t){return Zi(t)?i({},t):{}}Lo(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}$o(t){if(0===t.length)return!1;try{var e=t.reduce(((t,e)=>{var i=e.type,r=e.value;return Ji(i)&&i.length>0&&t.$exception_types.push(i),Ji(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.Io.some((t=>{var i=t.values.map((t=>{var i=Vh[t.operator],r=e[t.key];if(!i||!r)return!1;var n=Wi(t.value)?t.value:[t.value];return n.length>0&&i(n,r)}));return"OR"===t.type?i.some(Boolean):i.every(Boolean)}))}catch(t){return Zv.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}qo(t){var e=t.flatMap((t=>{var e,i;return null!==(e=null==(i=t.stacktrace)?void 0:i.frames)&&void 0!==e?e:[]}));return e.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}jo(t){if(t.length>0){var e,i,r,n,s=null!==(e=null==(i=t[0].stacktrace)?void 0:i.frames)&&void 0!==e?e:[],a=s[s.length-1];return null!==(r=null==a||null==(n=a.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Do(t){return!Xi(t)&&Wi(t)}}},nb=i({productTours:class{get Tr(){return this._instance.persistence}constructor(t){this.Ho=null,this.Uo=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var i,r;if(this.Tr&&this.Tr.register({[Du]:!!e.productTours}),!Ty(this._instance))return!this.Ho&&Xi(null==(i=this.Tr)?void 0:i.props[lh])||My.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.Ho)||r.stop(),this.Ho=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Ho&&Ty(this._instance)&&this.ai((()=>this.zo()))}ai(t){var e,i;null!=(e=Mo.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=Mo.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",(e=>{e?My.error("Could not load product tours script",e):t()}))}zo(){var t;!this.Ho&&null!=(t=Mo.__PosthogExtensions__)&&t.generateProductTours&&(this.Ho=Mo.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Wi(this.Uo)||e){var i=this.Tr;if(i){var r=i.props[lh];if(Wi(r)&&!e)return this.Uo=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:e=>{if(Ty(this._instance)){var r=e.statusCode;if(200!==r||!e.json){var n="Product Tours API could not be loaded, status: "+r;return 0===r?e.error||My.warn(n):My.error(n),void t([],{isLoaded:!1,error:n})}var s=Wi(e.json.product_tours)?e.json.product_tours:[];this.Uo=s,i&&i.register({[lh]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Uo,{isLoaded:!0})}getActiveProductTours(t){Xi(this.Ho)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ho.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Ho)||e.showTourById(t)}previewTour(t){this.Ho?this.Ho.previewTour(t):this.ai((()=>{var e;this.zo(),null==(e=this.Ho)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Ho)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Ho)||t.nextStep()}previousStep(){var t;null==(t=this.Ho)||t.previousStep()}clearCache(){var t;this.Uo=null,null==(t=this.Tr)||t.unregister(lh)}resetTour(t){var e;null==(e=this.Ho)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Ho)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Ho)||e.cancelPendingTour(t)}}},tb),sb={siteApps:class{constructor(t){this.Wo=0,this._instance=t,this.Vo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Zo(t,e){if(e){var i=this.globalsForEvent(e);this.Vo.push(i),this.Vo.length>1e3&&(this.Vo=this.Vo.slice(10))}}get siteAppLoaders(){var t;return null==(t=Mo._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Zo.bind(this));this.Go=()=>{t(),this.Vo=[],this.Go=void 0}}}globalsForEvent(t){var e,n,s,a,o,l,u;if(!t)throw new Error("Event payload is required");var h={},d=this._instance.get_property("$groups")||[],v=this._instance.get_property("$stored_group_properties")||{};for(var c of Object.entries(v)){var f=c[0];h[f]={id:d[f],type:f,properties:c[1]}}var p=t.$set_once,g=t.$set;return{event:i({},r(t,Ey),{properties:i({},t.properties,g?{$set:i({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:i({},null!==(s=null==(a=t.properties)?void 0:a.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(o=null==(l=t.properties)?void 0:l.$elements_chain)&&void 0!==o?o:"",distinct_id:null==(u=t.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}Qo(t){var e,i=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Iy.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(Iy.error("prepare_external_dependency_script returned null"),null):t}Jo(){var t,e,i,r,n,s,a,o;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==Cs?void 0:Cs.defaultView,u=null==l||null==(t=l.Node)?void 0:t.prototype;if(!l||!u)return()=>{};if(this.Wo++,this.Ko)return this.Yo();var h=[],d=this,v=new WeakSet,c=(t,e,i)=>{if(null!=t&&t[e]){var r=t[e];t[e]=i(r),h.push((()=>{t[e]=r}))}},f=t=>{if(v.has(t))return t;var e=d.Qo(t);return e&&v.add(e),e},p=t=>t.map((t=>"string"==typeof t?t:f(t))).filter((t=>!Yi(t)));return c(u,"appendChild",(t=>function(e){var i=f(e);return i?t.call(this,i):e})),c(u,"insertBefore",(t=>function(e,i){var r=f(e);return r?t.call(this,r,i):e})),c(u,"replaceChild",(t=>function(e,i){var r=f(e);return r?t.call(this,r,i):i})),[null==(e=l.Element)?void 0:e.prototype,null==(i=l.Document)?void 0:i.prototype,null==(r=l.DocumentFragment)?void 0:r.prototype].forEach((t=>{c(t,"append",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,p(i))})),c(t,"prepend",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,p(i))}))})),[null==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(a=l.DocumentType)?void 0:a.prototype].forEach((t=>{c(t,"before",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,p(i))})),c(t,"after",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,p(i))})),c(t,"replaceWith",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];var n=p(i);return i.length&&!n.length?void 0:t.apply(this,n)}))})),c(null==(o=l.Element)?void 0:o.prototype,"insertAdjacentElement",(t=>function(e,i){var r=f(i);return r?t.call(this,e,r):null})),this.Ko=()=>{h.forEach((t=>t())),this.Ko=void 0},this.Yo()}Yo(){var t=!1;return()=>{var e;t||(t=!0,this.Wo--,0===this.Wo&&(null==(e=this.Ko)||e.call(this)))}}Xo(t,e){void 0===e&&(e=!0);var i=this.Jo();try{var r=t(i);return e&&i(),r}catch(t){throw i(),t}}setupSiteApp(t){var e=this.apps[t.id],i=()=>{var i;!e.errored&&this.Vo.length&&(Iy.info("Processing "+this.Vo.length+" events for site app with id "+t.id),this.Vo.forEach((t=>this.Xo((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(i=this.Go)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,Iy.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.Xo((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){Iy.error(Py+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){Iy.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}tl(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of t)this.setupSiteApp(i)}el(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.Xo((()=>null==r.processEvent?void 0:r.processEvent(i)))}catch(e){Iy.error("Error while processing event "+t.event+" for site app "+r.id,e)}};for(var n of Object.values(this.apps))r(n)}}onRemoteConfig(t){var e,i,r,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.tl(),void this._instance.on("eventCaptured",(t=>this.el(t)))):void Iy.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Go)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var a=function(){var t,e=o.id,i=o.url;Mo["__$$ph_site_app_"+e]=n._instance,null==(t=Mo.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,(t=>{if(t)return Iy.error(Py+e,t)}))};for(var o of s.siteApps)a()}else Iy.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},ab={tracingHeaders:class{constructor(t){this.il=void 0,this.rl=void 0,this.nl=void 0,this.bo=()=>{var t,e,i=this.sl();i?(Qi(this.il)&&(this.il=null==(t=Mo.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),Qi(this.rl)&&(this.rl=null==(e=Mo.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Co()},this._instance=t}initialize(){this.startIfEnabledOrStop()}ai(t){var e,i;null!=(e=Mo.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(i=Mo.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return py.error("failed to load script",e);t()}))}al(){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}sl(){var t=this.al();return Wi(t)?(Wi(this.nl)?this.nl.splice(0,this.nl.length,...t):this.nl=[...t],t.length>0?this.nl:void 0):(Wi(this.nl)&&this.nl.splice(0),this.nl=t||void 0,this.nl)}Co(){var t,e;null==(t=this.il)||t.call(this),null==(e=this.rl)||e.call(this),this.il=void 0,this.rl=void 0}startIfEnabledOrStop(){this.sl()?this.ai(this.bo):this.Co()}}},ob=i({surveys:class{get Pe(){return this._instance.config}constructor(t){this.ol=void 0,this._surveyManager=null,this.ll=!1,this.ul=[],this.hl=null,this.dl=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Pe.disable_surveys){if(!t.ok)return fu.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Xi(e))return fu.warn("Flags not loaded yet. Not loading surveys.");var i=Wi(e);this.ol=i?e.length>0:e,fu.info("flags response received, isSurveysEnabled: "+this.ol),this.loadIfEnabled()}}reset(){try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],i=0;i<localStorage.length;i++){var r=localStorage.key(i);(null!=r&&r.startsWith(mu)||null!=r&&r.startsWith(yu))&&e.push(r)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this._surveyManager)if(this.ll)fu.info("Already initializing surveys, skipping...");else if(this.Pe.disable_surveys)fu.info(Dy);else if(this.Pe.cookieless_mode&&this._instance.consent.isOptedOut())fu.info("Not loading surveys in cookieless mode without consent.");else{var t=null==Mo?void 0:Mo.__PosthogExtensions__;if(t){if(!Qi(this.ol)||this.Pe.advanced_enable_surveys){var e=this.ol||this.Pe.advanced_enable_surveys;this.ll=!0;try{var i=t.generateSurveys;if(i)return void this.vl(i,e);var r=t.loadExternalDependency;if(!r)return void this.cl(Ch);r(this._instance,"surveys",(i=>{i||!t.generateSurveys?this.cl("Could not load surveys script",i):this.vl(t.generateSurveys,e)}))}catch(t){throw this.cl("Error initializing surveys",t),t}finally{this.ll=!1}}}else fu.error("PostHog Extensions not found.")}}vl(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Fy(this._instance),fu.info("Surveys loaded successfully"),this.fl({isLoaded:!0})}cl(t,e){fu.error(t,e),this.fl({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.ul.push(t),this._surveyManager&&this.fl({isLoaded:!0}),()=>{this.ul=this.ul.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.Pe.disable_surveys)return fu.info(Dy),t([]);var i,r=this._instance.get_property(rh);if(r&&!e)return t(r,{isLoaded:!0}),void(this.pl()&&this.getSurveys((()=>{}),!0));"undefined"!=typeof Promise&&this.hl?this.hl.then((e=>t(e.surveys,e.context))):("undefined"!=typeof Promise&&(this.hl=new Promise((t=>{i=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Pe.token),method:"GET",timestampMode:"query",timeout:this.Pe.surveys_request_timeout_ms,callback:e=>{var r;this.hl=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;0!==n?fu.error(s):e.error||fu.warn(s),this.dl=Date.now();var a={isLoaded:!1,error:s};return t([],a),void(null==i||i({surveys:[],context:a}))}this.dl=null;var o,l=e.json.surveys||[],u=l.filter((t=>pu(t)&&(vu(t)||gu(t))));u.length>0&&(null==(o=this._surveyEventReceiver)||o.register(u)),null==(r=this._instance.persistence)||r.register({[rh]:l,[nh]:Date.now()});var h={isLoaded:!0};t(l,h),null==i||i({surveys:l,context:h})}}))}pl(){return this.gl()&&!this.hl&&!this.ml()}gl(){var t=this._instance.get_property(nh);return tr(t)&&Date.now()-t>3e5}ml(){return tr(this.dl)&&3e5>Date.now()-this.dl}markSurveyAsSeen(t,e){var i,r={id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null};wu(r);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}fl(t){for(var e of this.ul)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){fu.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Xi(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);fu.warn("init was not called")}yl(t){var e=null;return this.getSurveys((i=>{var r;e=null!==(r=i.find((e=>e.id===t)))&&void 0!==r?r:null})),e}bl(t){if(Xi(this._surveyManager))return{eligible:!1,reason:Ay};var e="string"==typeof t?this.yl(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}_l(t){if(Xi(this._surveyManager))return{eligible:!1,reason:Ay};var e="string"==typeof t?this.yl(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Xi(this._surveyManager))return fu.warn("init was not called"),{visible:!1,disabledReason:Ay};var e=this._l(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Xi(this._surveyManager)?(fu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Ay})):new Promise((i=>{this.getSurveys((e=>{var r,n=null!==(r=e.find((e=>e.id===t)))&&void 0!==r?r:null;if(n){var s=this._l(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,i){var r;if(Xi(this._surveyManager))fu.warn("init was not called");else{var n="string"==typeof t?this.yl(t):t;if(null!=n&&n.id)if(xu.includes(n.type)){var s=null==Cs?void 0:Cs.querySelector(e);if(s)return null!=(r=n.appearance)&&r.surveyPopupDelaySeconds?(fu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;fu.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,i),fu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,i);fu.warn("Survey element not found")}else fu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else fu.warn("Survey not found")}}displaySurvey(t,e){var r;if(Xi(this._surveyManager))fu.warn("init was not called");else{var n=this.yl(t);if(n){var s=n;if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=i({},n,{appearance:i({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==ru&&e.initialResponses&&fu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var a=this.bl(n);if(!a.eligible)return void fu.warn("Survey is not eligible to be displayed: ",a.reason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else fu.warn("Survey not found")}}cancelPendingSurvey(t){Xi(this._surveyManager)?fu.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}},tb),lb={toolbar:class{constructor(t){this.instance=t}wl(t){Mo.ph_toolbar_state=t}xl(){var t;return null!==(t=Mo.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,i){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),Gs(this.instance.config))return!1;if(!xs||!Cs)return!1;t=null!=t?t:xs.location,i=null!=i?i:xs.history;try{if(!e){try{xs.localStorage.setItem("test","test"),xs.localStorage.removeItem("test")}catch(t){return!1}e=null==xs?void 0:xs.localStorage}var r,n=$y||ta(t.hash,"__posthog")||ta(t.hash,"state"),s=n?Hs((()=>JSON.parse(atob(decodeURIComponent(n)))))||Hs((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?t.hash=s.desiredHash:i?i.replaceState(i.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(Ny)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(t){return!1}}kl(t){var e=Mo.ph_load_toolbar||Mo.ph_load_editor;!Xi(e)&&Vi(e)?e(t,this.instance):qy.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==Cs||!Cs.getElementById(la));if(!xs||e)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=i({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(xs.localStorage.setItem(Ny,JSON.stringify(i({},n,{source:void 0}))),2===this.xl())this.kl(n);else if(0===this.xl()){var s;this.wl(1),null==(s=Mo.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return qy.error("[Toolbar] Failed to load",t),void this.wl(0);this.wl(2),this.kl(n)})),Zs(xs,"turbolinks:load",(()=>{this.wl(0),this.loadToolbar(n)}))}return!0}Sl(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,i){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(t,e,i)}}},ub=i({experiments:Zy},tb),hb={conversations:class{constructor(t){this.Cl=void 0,this._conversationsManager=null,this.Ml=!1,this.Tl=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&t.ok){var e=t.config.conversations;Xi(e)||(ir(e)?this.Cl=e:(this.Cl=e.enabled,this.Tl=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Cl=void 0,this.Tl=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ml||this._instance.config.disable_conversations||Gs(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==Mo?void 0:Mo.__PosthogExtensions__;if(t&&!Qi(this.Cl)&&this.Cl)if(this.Tl&&this.Tl.token){this.Ml=!0;try{var e=t.initConversations;if(e)return this.El(e),void(this.Ml=!1);var i=t.loadExternalDependency;if(!i)return void this.Il(Ch);i(this._instance,"conversations",(e=>{e||!t.initConversations?this.Il("Could not load conversations script",e):this.El(t.initConversations),this.Ml=!1}))}catch(t){this.Il("Error initializing conversations",t),this.Ml=!1}}else Gy.error("Conversations enabled but missing token in remote config.")}}El(t){if(this.Tl)try{this._conversationsManager=t(this.Tl,this._instance),Gy.info("Conversations loaded successfully")}catch(t){this.Il("Error completing conversations initialization",t)}else Gy.error("Cannot complete initialization: remote config is null")}Il(t,e){Gy.error(t,e),this._conversationsManager=null,this.Ml=!1}show(){this._conversationsManager?this._conversationsManager.show():Gy.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Cl&&!Yi(this._conversationsManager)}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,i,r){var n=this;return e((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,i,r):(Gy.warn(Qy),null)}))()}getMessages(t,i){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getMessages(t,i):(Gy.warn(Qy),null)}))()}markAsRead(t){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.markAsRead(t):(Gy.warn(Qy),null)}))()}getTickets(t){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getTickets(t):(Gy.warn(Qy),null)}))()}requestRestoreLink(t){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.requestRestoreLink(t):(Gy.warn(Qy),null)}))()}restoreFromToken(t){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.restoreFromToken(t):(Gy.warn(Qy),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Gy.warn(Qy),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}Gn(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Qn(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},db={logs:class{constructor(t){var e,r=this;this.Pl=!1,this.Rl=!1,this.rt=$s("[logs]"),this.Ll=i({},this.rt,{error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];e.some(Xy)||r.rt.error(...e)}}),this.er=[],this.Ol=[],this.fa=0,this.Fl=()=>{var t,e;this.fa=0,null==(t=this.Al)||t.onReconnect(),null==(e=this.Dl)||e.onReconnect()},this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.Pl=!0),xs&&Zs(xs,"online",this.Fl)}$l(t,e,i,r){var n,s=function(t,e){var i,r,n,s,a,o,l,u=null!==(i=null==t?void 0:t.flushIntervalMs)&&void 0!==i?i:3e3,h=null!==(r=null==t?void 0:t.maxBufferSize)&&void 0!==r?r:100,d=null!=e&&e.consoleCapture?void 0:null!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,v=Qi(d)?Math.max(h,2048):Math.max(h,d),c=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(s=null!==(a=null==c?void 0:c["service.name"])&&void 0!==a?a:null==t?void 0:t.serviceName)&&void 0!==s?s:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(o=null==c?void 0:c["service.version"])&&void 0!==o?o:null==t?void 0:t.serviceVersion,environment:null!==(l=null==c?void 0:c["deployment.environment"])&&void 0!==l?l:null==t?void 0:t.environment,resourceAttributes:c,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:v,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new An(this.Nl(t,e),s,this.Ll,(()=>this.ql()),(t=>t()),void 0,r),s]}jl(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Al||this.Bl!==e){var i;null==(i=this.Al)||i.reset(),this.Bl=e;var r=this.$l((()=>this.er),(t=>{this.er=t}));this.Al=r[0],this.Hl=r[1]}return this.Al}Ul(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Dl||this.zl!==e){var i;null==(i=this.Dl)||i.reset(),this.zl=e;var r=this.$l((()=>this.Ol),(t=>{this.Ol=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Jy);this.Dl=r[0],this.Wl=r[1]}return this.Dl}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var i=null==(e=t.config.logs)?void 0:e.captureConsoleLogs;!Xi(i)&&i&&(this.Pl=!0,this.loadIfEnabled())}}reset(){var t,e;this.er=[],null==(t=this.Al)||t.reset(),this.Ol=[],null==(e=this.Dl)||e.reset(),this.fa=0}captureLog(t){this.jl().captureLog(t)}he(t){this.Ul().captureLog(t)}get logger(){return this.Vl||(this.Vl={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.Vl}flushLogs(t){t?this.Zl(t):(this.Al&&this.Al.flush().catch((t=>this.Gl(t))),this.Dl&&this.Dl.flush().catch((t=>this.Gl(t))))}Gl(t){Xy(t)||this.rt.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Pl&&!this.Rl){var t=null==Mo?void 0:Mo.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(e=>{var i;e||null==(i=t.logs)||!i.initializeLogs?this.rt.error("Could not load logs script",e):(t.logs.initializeLogs(this._instance),this.Rl=!0)})):this.rt.error(Ch)}else this.rt.error("PostHog Extensions not found.")}}Nl(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===ki.LogsQueue?t():void 0,setPersistedProperty(t,i){var r;t===ki.LogsQueue&&e(null!==(r=i)&&void 0!==r?r:[])},At:t=>this.At(t),getLibraryId:()=>Fs.LIB_NAME,getLibraryVersion:()=>Fs.LIB_VERSION}}At(t){return new Promise((e=>{if(ea(this.fa,3))e({kind:"fatal",error:Yy(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=t=>{i||(i=!0,clearTimeout(n),e(t))},n=setTimeout((()=>{this.rt.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:Yy(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.Ql(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.Jl(e),e>=200&&300>e)r({kind:"ok"});else if(413===e)r({kind:"too-large"});else if(0!==e&&429!==e&&500>e)r({kind:"fatal",error:new Error("logs request failed with status "+e)});else{var i;0===e?(t.error||this.rt.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:Yy(t.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("logs request failed with status "+e)})}}})}}))}Jl(t){(0!==t||this._instance.__loaded)&&(this.fa=ia(t,this.fa,3,(()=>this.rt.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}Zl(t){this.er.length>0&&this.Kl(t,this.er,this.Hl,Fs.LIB_NAME,(t=>{this.er=t})),this.Ol.length>0&&this.Kl(t,this.Ol,this.Wl,Jy,(t=>{this.Ol=t}))}Kl(t,e,i,r,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var a=Fn(s,On(i,Fs.LIB_NAME,Fs.LIB_VERSION),r,Fs.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Ql(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}Ql(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}ql(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=i.windowId,n=i.sessionStartTimestamp,s=i.lastActivityTimestamp;e.sessionId=i.sessionId,e.windowId=r,Xi(n)||(e.sessionStartTimestamp=n),Xi(s)||(e.lastActivityTimestamp=s)}if(null!=Mo&&null!=(t=Mo.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?kn(Mo.location.href):Mo.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},vb={metrics:class{constructor(t){this.rt=$s("[metrics]"),this._instance=t}initialize(){}jl(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Al&&this.Bl===i||(null==(e=this.Al)||e.reset(),this.Bl=i,this.Al=new qn(this.Nl(),function(t){var e,i,r,n,s,a=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==a?void 0:a["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==a?void 0:a["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==a?void 0:a["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:a,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(i),this.rt)),this.Al}count(t,e,i){void 0===e&&(e=1),this.jl().count(t,e,i)}gauge(t,e,i){this.jl().gauge(t,e,i)}histogram(t,e,i){this.jl().histogram(t,e,i)}flush(t){if(!this.Al)return Promise.resolve();if(t){var e=this.Al.drainWindow();return e&&this.Kt(e,t),Promise.resolve()}return this.Al.flush().catch((t=>this.rt.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.Al)||t.reset()}Nl(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Kt:t=>e.Kt(t),getLibraryId:()=>Fs.LIB_NAME,getLibraryVersion:()=>Fs.LIB_VERSION}}Kt(t,e){return new Promise((r=>{var n=!1,s=t=>{n||(n=!0,clearTimeout(a),r(t))},a=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(i({method:"POST",url:this.Yl(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e=t.statusCode;if(e>=200&&300>e)s({kind:"ok"});else if(413===e)s({kind:"too-large"});else if(0!==e&&429!==e&&500>e)s({kind:"fatal",error:new Error("metrics request failed with status "+e)});else{var i;s({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("metrics request failed with status "+e)})}}}))}))}Yl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},cb=i({},tb,eb,ib,rb,nb,sb,ob,ab,lb,ub,hb,db,vb);cy.__defaultExtensionClasses=i({},cb),function(){Fs.SDK_DIST_CHANNEL="cdn";var t=Mo.posthog;if(!t||Wi(t._i)){var e=Xm[oy]=new cy;if(t){var i=[];qs(t._i,(function(r){if(r&&Wi(r)){var n=e.init(r[0],r[1],r[2]),s=t[r[2]]||t;n.__loaded&&-1===i.indexOf(s)&&(i.push(s),n._execute_array.call(n.people,s.people),n._execute_array(s))}}))}e.__SV=1,Mo.posthog=e,function(){function t(){t.done||(t.done=!0,ly=!1,qs(Xm,(function(t){t._dom_loaded()})))}null!=Cs&&Cs.addEventListener?"complete"===Cs.readyState?t():Zs(Cs,"DOMContentLoaded",t,{capture:!1}):xs&&Ds.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}()}();
1
+ !function(){"use strict";function t(t,e,i,r,n,s,a){try{var o=t[s](a),l=o.value}catch(t){return void i(t)}o.done?e(l):Promise.resolve(l).then(r,n)}function e(e){return function(){var i=this,r=arguments;return new Promise((function(n,s){var a=e.apply(i,r);function o(e){t(a,n,s,o,l,"next",e)}function l(e){t(a,n,s,o,l,"throw",e)}o(void 0)}))}}function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},i.apply(null,arguments)}function r(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}var n,s=["type"],a=Object.defineProperty,o=(t,e,i)=>((t,e,i)=>e in t?a(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),l=(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))(l||{}),u=(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))(u||{}),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||{}),d=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(d||{}),v=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(v||{}),c=(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))(c||{}),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||{});function p(t,e){return-1!==t.indexOf(e)}var g={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},m={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},y={};function b(t){if(y[t])return y[t];var e=function(t){var e,i,r=null==(i=null==(e=null==globalThis?void 0:globalThis.Zone)?void 0:e.__symbol__)?void 0:i.call(e,t);return r&&globalThis[r]?globalThis[r]:void 0}(t)||globalThis[t],i=e.prototype,r=t in g?g[t]:void 0,n=Boolean(r&&r.every((t=>{var e,r;return Boolean(null==(r=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:r.toString().includes("[native code]"))}))),s=t in m?m[t]:void 0,a=Boolean(s&&s.every((t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))})));if(n&&a)return y[t]=e.prototype,e.prototype;var o=document.createElement("iframe");o.style.display="none";var l=!1;try{document.body.appendChild(o);var u=o.contentWindow;if(!u)return e.prototype;var h=u[t].prototype;return h?(function(t){return p(t,"AppleWebKit")&&!p(t,"Chrome")}(navigator.userAgent)&&(o.classList.add("rr-block","ph-no-capture"),o.setAttribute("__rrwebUntaintedPrototype",t),l=!0),y[t]=h):i}catch(t){return i}finally{!l&&o.parentNode&&document.body.removeChild(o)}}var _={};function w(t,e,i){var r,n=t+"."+String(i);if(_[n])return _[n].call(e);var s=b(t),a=null==(r=Object.getOwnPropertyDescriptor(s,i))?void 0:r.get;return a?(_[n]=a,a.call(e)):e[i]}var x={};function k(t,e,i){var r=t+"."+String(i);if(x[r])return x[r].bind(e);var n=b(t)[i];return"function"!=typeof n?e[i]:(x[r]=n,n.bind(e))}function S(){return b("MutationObserver").constructor}function C(t,e,i){try{if(!(e in t))return()=>{};var r=t[e],n={next:r},s=i((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return n.next.apply(this,e)}));return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=s,()=>{if(t[e]!==s)for(var i=t[e];"function"==typeof i&&i.__rrweb_layer__;){var r=i.__rrweb_layer__;if(r.next===s)return void(r.next=n.next);i=r.next}else t[e]=n.next}}catch(t){return()=>{}}}var M={childNodes:t=>w("Node",t,"childNodes"),parentNode:t=>w("Node",t,"parentNode"),parentElement:t=>w("Node",t,"parentElement"),textContent:t=>w("Node",t,"textContent"),contains:(t,e)=>k("Node",t,"contains")(e),getRootNode:t=>k("Node",t,"getRootNode")(),host:t=>t&&"host"in t?w("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?w("Element",t,"shadowRoot"):null,querySelector:(t,e)=>k("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>k("Element",t,"querySelectorAll")(e),mutationObserver:S,patch:C},T=()=>({durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,deferredStylesheetCount:0});function E(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var I=0,P=0,R=T(),L=null,O=null,F=[],A={slowestBatchMs:0},D=t=>t&&t>0?t:null,N=32;function q(t,e,i){var r=t.length;if(i>=N)return r;for(var n=0;t.length>n;n++){var s=t[n];try{var a=s.cssRules;if(a&&a.length)r+=q(a,e,i+1);else if(e&&s.styleSheet){var o=s.styleSheet;if(!e.has(o)){e.add(o);var l=o.rules||o.cssRules;l&&(r+=q(l,e,i+1))}}}catch(t){}}return r}function j(t){return 0!==I&&null!==O&&(R.cssRuleCount>=O||R.cssRuleCount+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var i=new WeakSet;return i.add(t),q(e,i,0)}catch(t){return 0}}(t)>O)}function B(t){return t.nodeType===t.ELEMENT_NODE}function H(t){var e=t&&"host"in t&&"mode"in t&&M.host(t)||null;return Boolean(e&&"shadowRoot"in e&&M.shadowRoot(e)===t)}function U(t){return"[object ShadowRoot]"==={}.toString.call(t)}var z=0;function W(t){var e,i,r=0===z,n=r?E():0;z+=1;try{var s=t.rules||t.cssRules;if(!s)return null;!function(t){0!==I&&(R.cssRuleCount+=q(t,null,0))}(s);var a=t.href;return!a&&t.ownerNode&&(a=t.ownerNode.baseURI),(i=Array.from(s,(t=>V(t,a))).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}finally{z-=1,r&&(e=E()-n,I>0&&(R.stylesheetMs+=e))}}function V(t,e){var i;if(function(t){return"styleSheet"in t}(t)){var r;try{r=W(t.styleSheet)||function(t){var e=t.cssText;if(3>e.split('"').length)return e;var i=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?i.push("layer"):t.layerName&&i.push("layer("+t.layerName+")"),t.supportsText&&i.push("supports("+t.supportsText+")"),t.media.length&&i.push(t.media.mediaText),i.join(" ")+";"}(t)}catch(e){r=t.cssText}try{if(r&&(null==(i=t.styleSheet)?void 0:i.href))return it(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?it(n,e):n}class Z{constructor(){o(this,"idNodeMap",new Map),o(this,"nodeMetaMap",new WeakMap)}getId(t){var e;if(!t)return-1;var i=null==(e=this.getMeta(t))?void 0:e.id;return null!=i?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach((t=>this.removeNodeFromMap(t))),B(t)){var i=M.shadowRoot(t);i&&this.removeNodeFromMap(i),"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 i=this.getNode(t);if(i){var r=this.nodeMetaMap.get(i);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function G(t){var e=t.element,i=t.maskInputOptions,r=t.tagName,n=t.type,s=t.maskInputFn,a=t.value||"",o=n&&Q(n);return(i[r.toLowerCase()]||o&&i[o])&&(a=s?s(a,e):"*".repeat(a.length)),a}function Q(t){return t.toLowerCase()}var J="__rrweb_original__";function K(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Q(e):null}catch(t){return null}}var Y=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,X=/^(?:[a-z+]+:)?\/\//i,tt=/^www\..*/i,et=/^(data:)([^,]*),(.*)/i;function it(t,e){return(t||"").replace(Y,((t,i,r,n,s,a)=>{var o,l=r||s||a,u=i||n||"";if(!l)return t;if(X.test(l)||tt.test(l))return"url("+u+l+u+")";if(et.test(l))return"url("+u+l+u+")";if("/"===l[0])return"url("+u+(((o=e).indexOf("//")>-1?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+l)+u+")";var h=e.split("/"),d=l.split("/");for(var v of(h.pop(),d))"."!==v&&(".."===v?h.pop():h.push(v));return"url("+u+h.join("/")+u+")"}))}var rt,nt,st="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==",at=4096,ot=1e5,lt=10,ut=new Map,ht=1,dt=new RegExp("[^a-z0-9-_:]"),vt=-2;function ct(){return ht++}var ft=/^[^ \t\n\r\u000c]+/,pt=/^[, \t\n\r\u000c]+/,gt=new WeakMap;function mt(t,e){return e&&""!==e.trim()?yt(t,e):e}function yt(t,e){var i=gt.get(t);if(i||(i=t.createElement("a"),gt.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function bt(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?st:t}(t,e.maxBase64ImageLength):t}function _t(t,e,i,r,n,s){var a;if(!r)return r;if("src"===i||"href"===i&&("use"!==e||"#"!==r[0])){if("link"===e&&n){var o=null==(a=n.sheet)?void 0:a.href;if(o)return o}var l=mt(t,r);if(l.startsWith("data:")){if("img"===e&&n){var u=l;return((null==s?void 0:s.type)||void 0!==(null==s?void 0:s.quality))&&(u=function(t,e,i,r){if(ot>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>at||t.naturalHeight>at)return e;var n=ut.get(e);if(n&&n.type===i&&n.quality===r)return n.result;try{var s=document.createElement("canvas");s.width=t.naturalWidth,s.height=t.naturalHeight;var a=s.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var o=s.toDataURL(i||"image/webp",null!=r?r:.4),l=e.length>o.length?o:e;if(ut.size>=lt){var u=ut.keys().next().value;void 0!==u&&ut.delete(u)}return ut.set(e,{type:i,quality:r,result:l}),l}catch(t){return e}}(n,l,s.type,s.quality)),bt(u,s)}if("image"===e)return bt(l,s)}return l}if("xlink:href"===i&&"#"!==r[0]){var h=mt(t,r);return"image"===e&&h.startsWith("data:")?bt(h,s):h}return"background"!==i||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===i?function(t,e){if(""===e.trim())return e;var i=0;function r(t){var r,n=t.exec(e.substring(i));return n?(i+=(r=n[0]).length,r):""}for(var n=[];r(pt),e.length>i;){var s=r(ft);if(","===s.slice(-1))s=mt(t,s.substring(0,s.length-1)),n.push(s);else{var a="";s=mt(t,s);for(var o=!1;;){var l=e.charAt(i);if(""===l){n.push((s+a).trim());break}if(o)")"===l&&(o=!1);else{if(","===l){i+=1,n.push((s+a).trim());break}"("===l&&(o=!0)}a+=l,i+=1}}}return n.join(", ")}(t,r):"style"===i?it(r,yt(t)):"object"===e&&"data"===i?mt(t,r):r:mt(t,r)}function wt(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function xt(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&xt(M.parentNode(t),e,i);for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;return!!i&&xt(M.parentNode(t),e,i)}function kt(t,e,i,r){var n;if(B(t)){if(!M.childNodes(n=t).length)return!1}else{if(null===M.parentElement(t))return!1;n=M.parentElement(t)}try{if("string"==typeof e){if(r){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(xt(n,e,r))return!0;if(i)if(r){if(n.closest(i))return!0}else if(n.matches(i))return!0}catch(t){}return!1}function St(t,e,i){var r=t.removeEventListener;"function"==typeof r&&r.call(t,e,i)}var Ct=new Map;function Mt(t,e){return Array.from(t.styleSheets).find((t=>t.href===e))}function Tt(t){return null==t?"":t.toLowerCase()}var Et=50,It=!1,Pt=!1;function Rt(t,e){var i=e.doc,r=e.mirror,n=e.blockClass,s=e.blockSelector,a=e.maskTextClass,o=e.maskTextSelector,l=e.skipChild,u=void 0!==l&&l,h=e.inlineStylesheet,d=void 0===h||h,v=e.maskInputOptions,c=void 0===v?{}:v,p=e.maskTextFn,g=e.maskInputFn,m=e.slimDOMOptions,y=e.dataURLOptions,b=void 0===y?{}:y,_=e.inlineImages,w=void 0!==_&&_,x=e.recordCanvas,k=void 0!==x&&x,S=e.canvasMaskingConfigured,C=e.onSerialize,T=e.onIframeLoad,E=e.iframeLoadTimeout,P=void 0===E?5e3:E,L=e.onIframeListenerRegistered,O=e.onStylesheetLoad,A=e.stylesheetLoadTimeout,D=void 0===A?5e3:A,N=e.keepIframeSrcFn,q=void 0===N?()=>!1:N,z=e.newlyAddedElement,V=void 0!==z&&z,Z=e.depth,Y=void 0===Z?0:Z,X=e.maxDepth,tt=void 0===X?Et:X,et=e.needsMask,st=e.preserveWhiteSpace,at=void 0===st||st;if(Y>=tt)return Pt=!0,It||(It=!0,console.warn("[rrweb-snapshot] DOM tree depth exceeded max depth of "+tt+". Children beyond this depth will not be recorded. This may indicate deeply nested DOM structures.")),null;et||(et=kt(t,a,o,void 0===et)),I>0&&(R.nodeCount+=1);var ot,lt=function(t,e){var i=e.doc,r=e.blockClass,n=e.blockSelector,s=e.needsMask,a=e.inlineStylesheet,o=e.maskInputOptions,l=void 0===o?{}:o,u=e.maskTextFn,h=e.maskInputFn,d=e.dataURLOptions,v=void 0===d?{}:d,c=e.inlineImages,p=e.recordCanvas,g=e.canvasMaskingConfigured,m=e.keepIframeSrcFn,y=e.newlyAddedElement,b=void 0!==y&&y,_=function(t,e){if(e.hasNode(t)){var i=e.getId(t);return 1===i?void 0:i}}(i,e.mirror);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:_};case t.ELEMENT_NODE:return function(t,e){for(var i,r,n,s,a=e.doc,o=e.inlineStylesheet,l=e.maskInputOptions,u=void 0===l?{}:l,h=e.maskInputFn,d=e.dataURLOptions,v=void 0===d?{}:d,c=e.inlineImages,p=e.recordCanvas,g=e.canvasMaskingConfigured,m=e.keepIframeSrcFn,y=e.newlyAddedElement,b=void 0!==y&&y,_=e.rootId,w=function(t,e,i){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var r=t.classList.length;r--;)if(e.test(t.classList[r]))return!0;if(i)return t.matches(i)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),x=function(t){if(t instanceof HTMLFormElement)return"form";var e=Q(t.tagName);return dt.test(e)?"div":e}(t),k={},S=t.attributes.length,C=0;S>C;C++){var T=t.attributes[C];wt(x,T.name)||(k[T.name]=_t(a,x,Q(T.name),T.value,t,v))}if("link"===x&&o&&!w){var E=t.sheet;if(!E){var P=function(t){return t.href}(t);P&&!(E=Mt(a,P))&&P.includes(".css")&&(E=Mt(a,window.location.origin+"/"+P.replace(window.location.href,"")))}var R=null;E&&(j(E)?I>0&&F.push(t):R=W(E)),R&&(delete k.rel,delete k.href,k._cssText=R)}var L;if("style"===x&&t.sheet&&!(t.innerText||M.textContent(t)||"").trim().length){var O=W(t.sheet);O&&(k._cssText=O)}if("input"===x||"textarea"===x||"select"===x){var A=t.value,D=t.checked;"radio"!==k.type&&"checkbox"!==k.type&&"submit"!==k.type&&"button"!==k.type&&A?k.value=G({element:t,type:K(t),tagName:x,value:A,maskInputOptions:u,maskInputFn:h}):D&&(k.checked=D)}if("option"===x&&(t.selected&&!u.select?k.selected=!0:delete k.selected),"dialog"===x&&t.open)try{k.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){k.rr_open_mode="modal",k.ph_rr_could_not_detect_modal=!0}if("canvas"===x&&p&&!(null==g?void 0:g()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var i=0;t.width>i;i+=50)for(var r=0;t.height>r;r+=50){var n=e.getImageData;if(new Uint32Array((J in n?n[J]:n).call(e,i,r,Math.min(50,t.width-i),Math.min(50,t.height-r)).data.buffer).some((t=>0!==t)))return!1}return!0})(t)||(k.rr_dataURL=t.toDataURL(v.type,v.quality));else if(!("__context"in t)){var N=t.toDataURL(v.type,v.quality),q=a.createElement("canvas");q.width=t.width,q.height=t.height,N!==q.toDataURL(v.type,v.quality)&&(k.rr_dataURL=N)}if("img"===x&&c){rt||(rt=a.createElement("canvas"),nt=rt.getContext("2d"));var B=t,H=B.currentSrc||B.getAttribute("src")||"<unknown-src>",U=B.crossOrigin,z=()=>{St(B,"load",z);try{rt.width=B.naturalWidth,rt.height=B.naturalHeight,nt.drawImage(B,0,0),k.rr_dataURL=rt.toDataURL(v.type,v.quality)}catch(t){if("anonymous"!==B.crossOrigin)return B.crossOrigin="anonymous",void(B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z));console.warn("Cannot inline img src="+H+"! Error: "+t)}"anonymous"===B.crossOrigin&&(U?k.crossOrigin=U:B.removeAttribute("crossorigin"))};B.complete&&0!==B.naturalWidth?z():B.addEventListener("load",z)}if("audio"===x||"video"===x){var V=k;V.rr_mediaState=t.paused?"paused":"played",V.rr_mediaCurrentTime=t.currentTime,V.rr_mediaPlaybackRate=t.playbackRate,V.rr_mediaMuted=t.muted,V.rr_mediaLoop=t.loop,V.rr_mediaVolume=t.volume}if(b||(t.scrollLeft&&(k.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(k.rr_scrollTop=t.scrollTop)),w){var Z=t.getBoundingClientRect(),Y=Z.width,X=Z.height,tt=Z.left,et=Z.top,it=null==(i=a.defaultView)?void 0:i.getComputedStyle(t);k={class:k.class,rr_width:Y+"px",rr_height:X+"px",rr_left:Math.floor(tt+((null==(r=a.defaultView)?void 0:r.scrollX)||0))+"px",rr_top:Math.floor(et+((null==(n=a.defaultView)?void 0:n.scrollY)||0))+"px"},it&&(k.rr_position=it.position||"static",it.transform&&"none"!==it.transform&&(k.rr_transform=it.transform),it.display&&it.display.startsWith("inline")&&(k.rr_display=it.display))}"iframe"!==x||m(k.src)||(t.contentDocument||(k.rr_src=k.src),delete k.src);try{customElements.get(x)&&(s=!0)}catch(t){}return{type:f.Element,tagName:x,attributes:k,childNodes:[],isSVG:(L=t,Boolean("svg"===L.tagName||L.ownerSVGElement)||void 0),needBlock:w,rootId:_,isCustom:s}}(t,{doc:i,blockClass:r,blockSelector:n,inlineStylesheet:a,maskInputOptions:l,maskInputFn:h,dataURLOptions:v,inlineImages:c,recordCanvas:p,canvasMaskingConfigured:g,keepIframeSrcFn:m,newlyAddedElement:b,rootId:_});case t.TEXT_NODE:return function(t,e){var i,r=e.needsMask,n=e.maskTextFn,s=e.rootId,a=M.parentNode(t),o=a&&a.tagName,l=M.textContent(t),u="STYLE"===o||void 0,h="SCRIPT"===o||void 0;if(u&&l){try{if(t.nextSibling||t.previousSibling);else if(j(a.sheet));else if(null==(i=a.sheet)?void 0:i.cssRules){var d=W(a.sheet);d&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(d)&&(l=d)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}l=it(l,yt(e.doc))}return h&&(l="SCRIPT_PLACEHOLDER"),!u&&!h&&l&&r&&(l=n?n(l,M.parentElement(t)):l.replace(/[\S]/g,"*")),{type:f.Text,textContent:l||"",isStyle:u,rootId:s}}(t,{doc:i,needsMask:s,maskTextFn:u,rootId:_});case t.CDATA_SECTION_NODE:return{type:f.CDATA,textContent:"",rootId:_};case t.COMMENT_NODE:return{type:f.Comment,textContent:M.textContent(t)||"",rootId:_};default:return!1}}(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:et,inlineStylesheet:d,maskInputOptions:c,maskTextFn:p,maskInputFn:g,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,keepIframeSrcFn:q,newlyAddedElement:V});if(!lt)return console.warn(t,"not serialized"),null;ot=r.hasNode(t)?r.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 i,r;try{r=new URL(t,window.location.href)}catch(t){return null}var n=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(i=null==n?void 0:n[1])&&void 0!==i?i:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(Tt(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Tt(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(Tt(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&Tt(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(Tt(t.attributes.property).match(/^(og|twitter|fb):/)||Tt(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===Tt(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(Tt(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(Tt(t.attributes.name))||Tt(t.attributes.property).match(/^article:/)||Tt(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(Tt(t.attributes.name)))return!0}}return!1}(lt,m)||!at&&lt.type===f.Text&&!lt.isStyle&&!lt.textContent.replace(/^\s+|\s+$/gm,"").length?vt:ct();var ut=Object.assign(lt,{id:ot});if(r.add(t,ut),ot===vt)return null;C&&C(t);var ht=!u;if(ut.type===f.Element){ht=ht&&!ut.needBlock,delete ut.needBlock;var ft=M.shadowRoot(t);ft&&U(ft)&&(ut.isShadowHost=!0)}if((ut.type===f.Document||ut.type===f.Element)&&ht){m.headWhitespace&&ut.type===f.Element&&"head"===ut.tagName&&(at=!1);var pt={doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:a,maskTextSelector:o,skipChild:u,inlineStylesheet:d,maskInputOptions:c,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:at,onSerialize:C,onIframeLoad:T,iframeLoadTimeout:P,onIframeListenerRegistered:L,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:q,depth:Y+1,maxDepth:tt};if(ut.type===f.Element&&"textarea"===ut.tagName&&void 0!==ut.attributes.value);else for(var gt of Array.from(M.childNodes(t))){var mt=Rt(gt,pt);mt&&ut.childNodes.push(mt)}var bt=null;if(B(t)&&(bt=M.shadowRoot(t)))for(var xt of Array.from(M.childNodes(bt))){var Lt=Rt(xt,pt);Lt&&(U(bt)&&(Lt.isShadow=!0),ut.childNodes.push(Lt))}}var Ot=M.parentNode(t);if(Ot&&H(Ot)&&U(Ot)&&(ut.isShadow=!0),ut.type===f.Element&&"iframe"===ut.tagName){var Ft=function(t,e,i){var r,n=()=>{},s=t.contentWindow;if(!s)return n;try{r=s.document.readyState}catch(t){return n}var a=()=>e();if("complete"!==r){var o=!1,l=null,u=()=>{o||(o=!0,null!==l&&(clearTimeout(l),l=null),St(t,"load",h),t.addEventListener("load",a),e())},h=()=>u();return l=setTimeout(u,i),t.addEventListener("load",h),()=>{null!==l&&(clearTimeout(l),l=null),o?St(t,"load",a):(o=!0,St(t,"load",h))}}var d,v="about:blank";try{d=s.location.href}catch(t){return n}if(d!==v||t.src===v||""===t.src){var c=setTimeout(e,0);return t.addEventListener("load",a),()=>{clearTimeout(c),St(t,"load",a)}}return t.addEventListener("load",a),()=>{St(t,"load",a)}}(t,(()=>{var e=t.contentDocument;if(e&&T){var i=Rt(e,{doc:e,mirror:r,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:at,onSerialize:C,onIframeLoad:T,iframeLoadTimeout:P,onIframeListenerRegistered:L,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:q,depth:Y+1,maxDepth:tt});i&&T(t,i)}}),P);null==L||L(t,Ft)}return ut.type===f.Element&&"link"===ut.tagName&&"stylesheet"===ut.attributes.rel&&function(e,l,u){if(!Ct.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var v=new AbortController,f=!1,y=()=>{if(!f){f=!0;try{(()=>{if(O){var e=Rt(t,{doc:i,mirror:r,blockClass:n,blockSelector:s,needsMask:et,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:d,maskInputOptions:c,maskTextFn:p,maskInputFn:g,slimDOMOptions:m,dataURLOptions:b,inlineImages:w,recordCanvas:k,canvasMaskingConfigured:S,preserveWhiteSpace:at,onSerialize:C,onIframeLoad:T,iframeLoadTimeout:P,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:q,depth:Y,maxDepth:tt});e&&O(t,e)}})()}finally{Ct.delete(e),v.abort()}}},_=setTimeout(y,u);v.signal.addEventListener("abort",(()=>clearTimeout(_)),{once:!0}),e.addEventListener("load",y,{signal:v.signal,once:!0}),Ct.set(e,v)}}}(t,0,D),ut}function Lt(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 Ot{constructor(){o(this,"parentElement",null),o(this,"parentNode",null),o(this,"ownerDocument"),o(this,"firstChild",null),o(this,"lastChild",null),o(this,"previousSibling",null),o(this,"nextSibling",null),o(this,"ELEMENT_NODE",1),o(this,"TEXT_NODE",3),o(this,"nodeType"),o(this,"nodeName"),o(this,"RRNodeType")}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Ot))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,i){void 0===i&&(i=document);var r={capture:!0,passive:!0};return i.addEventListener(t,e,r),()=>At(i,t,e,r)}function At(t,e,i,r){Dt((()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==r?n.call(t,e,i,r):n.call(t,e,i))}))}function Dt(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var $t="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.",Nt={map:{},getId(){return console.error($t),-1},getNode(){return console.error($t),null},removeNodeFromMap(){console.error($t)},has(){return console.error($t),!1},reset(){console.error($t)}};function qt(t,e,i){void 0===i&&(i={});var r=null,n=0;return function(){for(var s=arguments.length,a=new Array(s),o=0;s>o;o++)a[o]=arguments[o];var l=Date.now();n||!1!==i.leading||(n=l);var u=e-(l-n),h=this;0>=u||u>e?(r&&(clearTimeout(r),r=null),n=l,t.apply(h,a)):r||!1===i.trailing||(r=setTimeout((()=>{n=!1===i.leading?0:Date.now(),r=null,t.apply(h,a)}),u))}}function jt(t,e,i,r,n){void 0===n&&(n=window);var s=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,r?i:{set(t){if(setTimeout((()=>{try{i.set.call(this,t)}catch(t){}}),0),s&&s.set){if(s.get)try{s.get.call(this)}catch(t){return}s.set.call(this,t)}}}),()=>jt(t,e,s||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Nt=new Proxy(Nt,{get(t,e,i){return"map"===e&&console.error($t),Reflect.get(t,e,i)}}));var Bt=Date.now;function Ht(t){var e,i,r,n,s=t.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(e=M.parentElement(s.body))?void 0:e.scrollLeft)||(null==(i=null==s?void 0:s.body)?void 0:i.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(r=M.parentElement(s.body))?void 0:r.scrollTop)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollTop)||0}}function Ut(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function zt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Wt(t){return t?t.nodeType===t.ELEMENT_NODE?t:M.parentElement(t):null}function Vt(t,e,i,r){if(!t)return!1;var n=Wt(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(r&&null!==n.closest("."+e))return!0}else if(xt(n,e,r))return!0}catch(t){}if(i){if(n.matches(i))return!0;if(r&&null!==n.closest(i))return!0}return!1}function Zt(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||e.getId(t)===vt}function Gt(t,e){if(H(t))return!1;var i=e.getId(t);if(!e.has(i))return!0;var r=M.parentNode(t);return(!r||r.nodeType!==t.DOCUMENT_NODE)&&(!r||Gt(r,e))}function Qt(t){return Boolean(t.changedTouches)}function Jt(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Kt(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Yt(t){return!!t&&(t instanceof Ot&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(M.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Bt=()=>(new Date).getTime());class Xt{constructor(){o(this,"id",1),o(this,"styleIDMap",new WeakMap),o(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i);var i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function te(t){var e,i=null;return"getRootNode"in t&&(null==(e=M.getRootNode(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&M.host(M.getRootNode(t))&&(i=M.host(M.getRootNode(t))),i}function ee(t){var e=t.ownerDocument;return!!e&&(M.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var i=function(t){for(var e,i=t;e=te(i);)i=e;return i}(t);return M.contains(e,i)}(t))}function ie(t){return"__ln"in t}class re{constructor(){o(this,"length",0),o(this,"head",null),o(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,i=0;t>i;i++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&ie(t.previousSibling)){var i=t.previousSibling.__ln.next;e.next=i,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,i&&(i.previous=e)}else if(t.nextSibling&&ie(t.nextSibling)&&t.nextSibling.__ln.previous){var r=t.nextSibling.__ln.previous;e.previous=r,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,r&&(r.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}var ne,se=(t,e)=>t+"@"+e;class ae{constructor(){o(this,"frozen",!1),o(this,"locked",!1),o(this,"texts",[]),o(this,"attributes",[]),o(this,"attributeMap",new WeakMap),o(this,"removes",[]),o(this,"mapRemoves",[]),o(this,"movedMap",{}),o(this,"addedSet",new Set),o(this,"movedSet",new Set),o(this,"droppedSet",new Set),o(this,"removesSubTreeCache",new Set),o(this,"mutationCb"),o(this,"blockClass"),o(this,"blockSelector"),o(this,"maskTextClass"),o(this,"maskTextSelector"),o(this,"inlineStylesheet"),o(this,"maskInputOptions"),o(this,"maskTextFn"),o(this,"maskInputFn"),o(this,"keepIframeSrcFn"),o(this,"recordCanvas"),o(this,"canvasMaskingConfigured"),o(this,"inlineImages"),o(this,"slimDOMOptions"),o(this,"dataURLOptions"),o(this,"doc"),o(this,"mirror"),o(this,"iframeManager"),o(this,"stylesheetManager"),o(this,"shadowDomManager"),o(this,"canvasManager"),o(this,"processedNodeManager"),o(this,"unattachedDoc"),o(this,"canvasManagerReleased",!1),o(this,"processMutations",(t=>{t.forEach(this.processMutation),this.emit()})),o(this,"emit",(()=>{if(!this.frozen&&!this.locked){var t,e=E();try{this.processBufferedMutations()}finally{(t=E()-e)>A.slowestBatchMs&&(A.slowestBatchMs=t)}}})),o(this,"processBufferedMutations",(()=>{for(var t=[],e=new Set,i=new re,r=t=>{for(var e=t,i=vt;i===vt;)i=(e=e&&e.nextSibling)&&this.mirror.getId(e);return i},n=n=>{var s=M.parentNode(n);if(s&&ee(n)&&"TEXTAREA"!==s.tagName){var a=H(s)?this.mirror.getId(te(n)):this.mirror.getId(s),o=r(n);if(-1===a||-1===o)return i.addNode(n);var l=Rt(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,canvasMaskingConfigured:this.canvasMaskingConfigured,inlineImages:this.inlineImages,onSerialize:t=>{Jt(t,this.mirror)&&this.iframeManager.addIframe(t),Kt(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Yt(n)&&this.shadowDomManager.addShadowRoot(M.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)}});l&&(t.push({parentId:a,nextId:o,node:l}),e.add(l.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var s of this.movedSet)le(this.removesSubTreeCache,s)&&!this.movedSet.has(M.parentNode(s))||n(s);for(var a of this.addedSet)ue(this.droppedSet,a)||le(this.removesSubTreeCache,a)?ue(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var o=null;i.length;){var l=null;if(o){var u=this.mirror.getId(M.parentNode(o.value)),h=r(o.value);-1!==u&&-1!==h&&(l=o)}if(!l)for(var d=i.tail;d;){var v=d;if(d=d.previous,v){var c=this.mirror.getId(M.parentNode(v.value));if(-1===r(v.value))continue;if(-1!==c){l=v;break}var f=M.parentNode(v.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=M.host(f);if(-1!==this.mirror.getId(p)){l=v;break}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}o=l.previous,i.removeNode(l.value),n(l.value)}var g={texts:this.texts.map((t=>{var e=t.node,i=M.parentNode(e);return i&&"TEXTAREA"===i.tagName&&this.genTextAreaValueMutation(i),{id:this.mirror.getId(e),value:t.value}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),attributes:this.attributes.map((t=>{var e=t.attributes;if("string"==typeof e.style){var i=JSON.stringify(t.styleDiff),r=JSON.stringify(t._unchangedStyles);e.style.length>i.length&&(i+r).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}})).filter((t=>!e.has(t.id))).filter((t=>this.mirror.has(t.id))),removes:this.removes,adds:t};(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))})),o(this,"bufferBelongsToIframe",(t=>this.doc===t.contentDocument)),o(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 i=Array.from(M.childNodes(t),(t=>M.textContent(t)||"")).join("");e.attributes.value=G({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:K(t),value:i,maskInputFn:this.maskInputFn})})),o(this,"processMutation",(t=>{if(!Zt(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=M.textContent(t.target);Vt(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:kt(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,Wt(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var i=t.target,r=t.attributeName,n=t.target.getAttribute(r);if("value"===r){var s=K(i);n=G({element:i,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:s,value:n,maskInputFn:this.maskInputFn})}if(Vt(t.target,this.blockClass,this.blockSelector,!1)||n===t.oldValue)return;var a=this.attributeMap.get(t.target);if("IFRAME"===i.tagName&&"src"===r&&!this.keepIframeSrcFn(n)){if(i.contentDocument)return;r="rr_src"}if(a||(this.attributes.push(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,a)),"type"===r&&"INPUT"===i.tagName&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!wt(i.tagName,r))if(a.attributes[r]=_t(this.doc,Q(i.tagName),Q(r),n,i,this.dataURLOptions),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var o=this.unattachedDoc.createElement("span");for(var l of(t.oldValue&&(o.style.cssText=t.oldValue),Array.from(i.style))){var u=i.style.getPropertyValue(l),h=i.style.getPropertyPriority(l);u!==o.style.getPropertyValue(l)||h!==o.style.getPropertyPriority(l)?a.styleDiff[l]=""===h?u:[u,h]:a._unchangedStyles[l]=[u,h]}for(var d of Array.from(o.style))""===i.style.getPropertyValue(d)&&(a.styleDiff[d]=!1)}else"open"===r&&"DIALOG"===i.tagName&&(a.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal");break;case"childList":if(Vt(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach((e=>this.genAdds(e,t.target))),t.removedNodes.forEach((e=>{var i=this.mirror.getId(e),r=H(t.target)?this.mirror.getId(M.host(t.target)):this.mirror.getId(t.target);Vt(t.target,this.blockClass,this.blockSelector,!1)||Zt(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(oe(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||Gt(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[se(i,r)]?oe(this.movedSet,e):(this.removes.push({parentId:r,id:i,isShadow:!(!H(t.target)||!U(t.target))||void 0}),function(t,e){for(var i=[t];i.length;){var r=i.pop();e.has(r)||(e.add(r),M.childNodes(r).forEach((t=>i.push(t))))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))}))}})),o(this,"genAdds",((t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Zt(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var i=null;e&&this.mirror.hasNode(e)&&(i=this.mirror.getId(e)),i&&-1!==i&&(this.movedMap[se(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Vt(t,this.blockClass,this.blockSelector,!1)||(M.childNodes(t).forEach((t=>this.genAdds(t))),Yt(t)&&M.childNodes(M.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","canvasMaskingConfigured","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.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 oe(t,e){t.delete(e),M.childNodes(e).forEach((e=>oe(t,e)))}function le(t,e,i){return 0!==t.size&&function(t,e,i){var r=M.parentNode(e);return!!r&&t.has(r)}(t,e)}function ue(t,e){return 0!==t.size&&he(t,e)}function he(t,e){var i=M.parentNode(e);return!!i&&(!!t.has(i)||he(t,i))}var de=t=>ne?function(){try{return t(...arguments)}catch(t){if(ne&&!0===ne(t))return;throw t}}:t,ve=[];function ce(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 fe(t,e){var i=new ae;ve.push(i),i.init(t);var r=new(S())(de(i.processMutations.bind(i))),n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),r.observe(e,n),{observer:r,buffer:i}}function pe(t){var e=t.scrollCb,i=t.doc,r=t.mirror,n=t.blockClass,s=t.blockSelector,a=t.sampling,o=new Map,l=t=>{var a=ce(t);if(a&&!Vt(a,n,s,!0)){var l,u,h=r.getId(a);if(a===i&&i.defaultView){var d=Ht(i.defaultView);l=d.left,u=d.top}else l=a.scrollLeft,u=a.scrollTop;var v=l+","+u;o.get(h)!==v&&(o.set(h,v),e({id:h,x:l,y:u}))}},u=[Ft("scroll",de(qt(de((t=>l(t))),a.scroll||100)),i)];return"onscrollend"in i&&u.push(Ft("scrollend",de(l),i)),()=>u.forEach((t=>t()))}function ge(t,e){for(var i=ve.length-1;i>=0;i--){var r=ve[i];if(r){var n=r.bufferBelongsToIframe(t);!n&&e&&e.has(r.bufferDoc())&&(n=!0),n&&(r.reset(),ve.splice(i,1))}}}var me=["INPUT","TEXTAREA","SELECT"],ye=new WeakMap;function be(t){return function t(e,i){if(ke("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ke("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ke("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ke("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var r=Array.from(e.parentRule.cssRules).indexOf(e);return i.unshift(r),t(e.parentRule,i)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);i.unshift(n)}return i}(t,[])}function _e(t,e,i){var r,n;return t?(t.ownerNode?r=e.getId(t.ownerNode):n=i.getId(t),{styleId:n,id:r}):{}}function we(t,e){var i,r,n,s,a=t.stylesheetManager;s=t.mirror.getId("#document"===e.nodeName?e:M.host(e));var o="#document"===e.nodeName?null==(i=e.defaultView)?void 0:i.Document:null==(n=null==(r=e.ownerDocument)?void 0:r.defaultView)?void 0:n.ShadowRoot,l=(null==o?void 0:o.prototype)?Object.getOwnPropertyDescriptor(null==o?void 0:o.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&o&&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,i;try{i=null==(e=l.set)?void 0:e.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==s&&-1!==s)try{a.adoptStyleSheets(t,s)}catch(t){}return i}}),de((()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))):()=>{}}function xe(t,e){void 0===e&&(e={});var r,n,s=t.doc.defaultView;if(!s)return()=>{};if(function(t,e){var i=t.mutationCb,r=t.mousemoveCb,n=t.mouseInteractionCb,s=t.scrollCb,a=t.viewportResizeCb,o=t.inputCb,l=t.mediaInteractionCb,u=t.styleSheetRuleCb,h=t.styleDeclarationCb,d=t.canvasMutationCb,v=t.fontCb,c=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),i(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),r(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),s(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),o(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),l(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),u(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),d(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),v(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),c(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,e),t.recordDOM){var a=fe(t,t.doc);r=a.observer,n=a.buffer}var o,l,v,f,p,g,m,y,b,_=function(t){var e=t.mousemoveCb,i=t.sampling,r=t.doc,n=t.mirror;if(!1===i.mousemove)return()=>{};var s,a="number"==typeof i.mousemove?i.mousemove:50,o="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500,l=[],h=qt(de((t=>{var i=Date.now()-s;e(l.map((t=>(t.timeOffset-=i,t))),t),l=[],s=null})),o),d=de(qt(de((t=>{var e=ce(t),i=Qt(t)?t.changedTouches[0]:t,r=i.clientX,a=i.clientY;s||(s=Bt()),l.push({x:r,y:a,id:n.getId(e),timeOffset:Bt()-s}),h("undefined"!=typeof DragEvent&&t instanceof DragEvent?u.Drag:t instanceof MouseEvent?u.MouseMove:u.TouchMove)})),a,{trailing:!1})),v=[Ft("mousemove",d,r),Ft("touchmove",d,r),Ft("drag",d,r)];return de((()=>{v.forEach((t=>t()))}))}(t),w=function(t){var e=t.mouseInteractionCb,r=t.doc,n=t.mirror,s=t.blockClass,a=t.blockSelector,o=t.sampling;if(!1===o.mouseInteraction)return()=>{};var l=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,u=[],v=null;return Object.keys(h).filter((t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==l[t])).forEach((t=>{var o=Q(t),l=(t=>r=>{var o=ce(r);if(!Vt(o,s,a,!0)){var l=null,u=t;if("pointerType"in r){switch(r.pointerType){case"mouse":l=d.Mouse;break;case"touch":l=d.Touch;break;case"pen":l=d.Pen}l===d.Touch&&(h[t]===h.MouseDown?u="TouchStart":h[t]===h.MouseUp&&(u="TouchEnd"))}else Qt(r)&&(l=d.Touch);null!==l?(v=l,(u.startsWith("Touch")&&l===d.Touch||u.startsWith("Mouse")&&l===d.Mouse)&&(l=null)):h[t]===h.Click&&(l=v,v=null);var c=Qt(r)?r.changedTouches[0]:r;if(c){var f=n.getId(o),p=c.clientX,g=c.clientY;de(e)(i({type:h[u],id:f,x:p,y:g},null!==l&&{pointerType:l}))}}})(t);if(window.PointerEvent)switch(h[t]){case h.MouseDown:case h.MouseUp:o=o.replace("mouse","pointer");break;case h.TouchStart:case h.TouchEnd:return}u.push(Ft(o,l,r))})),de((()=>{u.forEach((t=>t()))}))}(t),x=pe(t),k=function(t,e){var i=t.viewportResizeCb,r=e.win,n=-1,s=-1;return Ft("resize",de(qt(de((()=>{var t=Ut(),e=zt();n===t&&s===e||(i({width:Number(e),height:Number(t)}),n=t,s=e)})),200)),r)}(t,{win:s}),S=function(t){var e=t.inputCb,r=t.doc,n=t.mirror,s=t.blockClass,a=t.blockSelector,o=t.ignoreClass,l=t.ignoreSelector,u=t.maskInputOptions,h=t.maskInputFn,d=t.userTriggeredOnInput;function v(t){var e=ce(t),i=t.isTrusted,n=r.defaultView;if(!e||!n||e instanceof n.HTMLElement){var v=e&&e.tagName;if(e&&"OPTION"===v&&(e=M.parentElement(e)),e&&v&&me.indexOf(v)>=0&&!Vt(e,s,a,!0)&&!(e.classList.contains(o)||l&&e.matches(l))){var f=e.value,p=!1,g=K(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(u[v.toLowerCase()]||u[g])&&(f=G({element:e,maskInputOptions:u,tagName:v,type:g,value:f,maskInputFn:h})),c(e,d?{text:f,isChecked:p,userTriggered:i}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&r.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach((t=>{if(t!==e){var i=t.value;c(t,d?{text:i,isChecked:!p,userTriggered:!1}:{text:i,isChecked:!p})}}))}}}function c(t,r){var s=ye.get(t);if(!s||s.text!==r.text||s.isChecked!==r.isChecked){ye.set(t,r);var a=n.getId(t);de(e)(i({},r,{id:a}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map((t=>Ft(t,de(v),r))),p=r.defaultView;if(!p)return()=>{f.forEach((t=>t()))};var g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value");return g&&g.set&&f.push(...[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]].map((t=>jt(t[0],t[1],{set(){de(v)({target:this,isTrusted:!1})}},!1,p)))),de((()=>{f.forEach((t=>t()))}))}(t),T=(l=(o=t).mediaInteractionCb,v=o.blockClass,f=o.blockSelector,p=o.mirror,g=o.sampling,m=o.doc,y=de((t=>qt(de((e=>{var i=ce(e);if(i&&!Vt(i,v,f,!0)){var r=i.currentTime,n=i.volume,s=i.muted,a=i.playbackRate,o=i.loop;l({type:t,id:p.getId(i),currentTime:r,volume:n,muted:s,playbackRate:a,loop:o})}})),g.media||500))),b=[Ft("play",y(c.Play),m),Ft("pause",y(c.Pause),m),Ft("seeked",y(c.Seeked),m),Ft("volumechange",y(c.VolumeChange),m),Ft("ratechange",y(c.RateChange),m)],de((()=>{b.forEach((t=>t()))}))),E=()=>{},I=()=>{},P=()=>{},R=()=>{};t.recordDOM&&(E=function(t,e){var i=t.styleSheetRuleCb,r=t.mirror,n=t.stylesheetManager,s=e.win;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};var a=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:de(((t,e,s)=>{var a=s[0],o=s[1],l=_e(e,r,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&i({id:u,styleId:h,adds:[{rule:a,index:o}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.addRule=function(t,e,i){return void 0===i&&(i=this.cssRules.length),s.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",i])};var o,l,u=s.CSSStyleSheet.prototype.deleteRule;s.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:de(((t,e,s)=>{var a=s[0],o=_e(e,r,n.styleMirror),l=o.id,u=o.styleId;return(l&&-1!==l||u&&-1!==u)&&i({id:l,styleId:u,removes:[{index:a}]}),t.apply(e,s)}))}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(o=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:de(((t,e,s)=>{var a=s[0],o=_e(e,r,n.styleMirror),l=o.id,u=o.styleId;return(l&&-1!==l||u&&-1!==u)&&i({id:l,styleId:u,replace:a}),t.apply(e,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(l=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:de(((t,e,s)=>{var a=s[0],o=_e(e,r,n.styleMirror),l=o.id,u=o.styleId;return(l&&-1!==l||u&&-1!==u)&&i({id:l,styleId:u,replaceSync:a}),t.apply(e,s)}))}));var h={};Se("CSSGroupingRule")?h.CSSGroupingRule=s.CSSGroupingRule:(Se("CSSMediaRule")&&(h.CSSMediaRule=s.CSSMediaRule),Se("CSSConditionRule")&&(h.CSSConditionRule=s.CSSConditionRule),Se("CSSSupportsRule")&&(h.CSSSupportsRule=s.CSSSupportsRule));var d={};return Object.entries(h).forEach((t=>{var e=t[0],s=t[1];d[e]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(d[e].insertRule,{apply:de(((t,e,s)=>{var a=s[0],o=s[1],l=_e(e.parentStyleSheet,r,n.styleMirror),u=l.id,h=l.styleId;return(u&&-1!==u||h&&-1!==h)&&i({id:u,styleId:h,adds:[{rule:a,index:[...be(e),o||0]}]}),t.apply(e,s)}))}),s.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:de(((t,e,s)=>{var a=s[0],o=_e(e.parentStyleSheet,r,n.styleMirror),l=o.id,u=o.styleId;return(l&&-1!==l||u&&-1!==u)&&i({id:l,styleId:u,removes:[{index:[...be(e),a]}]}),t.apply(e,s)}))})})),de((()=>{s.CSSStyleSheet.prototype.insertRule=a,s.CSSStyleSheet.prototype.deleteRule=u,o&&(s.CSSStyleSheet.prototype.replace=o),l&&(s.CSSStyleSheet.prototype.replaceSync=l),Object.entries(h).forEach((t=>{var e=t[0],i=t[1];i.prototype.insertRule=d[e].insertRule,i.prototype.deleteRule=d[e].deleteRule}))}))}(t,{win:s}),I=we(t,t.doc),P=function(t,e){var i=t.styleDeclarationCb,r=t.mirror,n=t.ignoreCSSAttributes,s=t.stylesheetManager,a=e.win,o=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:de(((t,e,a)=>{var l,u=a[0],h=a[1],d=a[2];if(n.has(u))return o.apply(e,[u,h,d]);var v=_e(null==(l=e.parentRule)?void 0:l.parentStyleSheet,r,s.styleMirror),c=v.id,f=v.styleId;return(c&&-1!==c||f&&-1!==f)&&i({id:c,styleId:f,set:{property:u,value:h,priority:d},index:be(e.parentRule)}),t.apply(e,a)}))});var l=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:de(((t,e,a)=>{var o,u=a[0];if(n.has(u))return l.apply(e,[u]);var h=_e(null==(o=e.parentRule)?void 0:o.parentStyleSheet,r,s.styleMirror),d=h.id,v=h.styleId;return(d&&-1!==d||v&&-1!==v)&&i({id:d,styleId:v,remove:{property:u},index:be(e.parentRule)}),t.apply(e,a)}))}),de((()=>{a.CSSStyleDeclaration.prototype.setProperty=o,a.CSSStyleDeclaration.prototype.removeProperty=l}))}(t,{win:s}),t.collectFonts&&(R=function(t){var e=t.fontCb,i=t.doc,r=i.defaultView;if(!r)return()=>{};var n=[],s=new WeakMap,a=r.FontFace;r.FontFace=function(t,e,i){var r=new a(t,e,i);return s.set(r,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),r};var o=C(i.fonts,"add",(function(t){return function(i){return setTimeout(de((()=>{var t=s.get(i);t&&(e(t),s.delete(i))})),0),t.apply(this,[i])}}));return n.push((()=>{r.FontFace=a})),n.push(o),de((()=>{n.forEach((t=>t()))}))}(t)));var L=function(t){var e=t.doc,i=t.mirror,r=t.blockClass,n=t.blockSelector,s=t.selectionCb,a=!0,o=de((()=>{var t=e.getSelection();if(!(!t||a&&(null==t?void 0:t.isCollapsed))){a=t.isCollapsed||!1;for(var o=[],l=t.rangeCount||0,u=0;l>u;u++){var h=t.getRangeAt(u),d=h.startContainer,v=h.startOffset,c=h.endContainer,f=h.endOffset;Vt(d,r,n,!0)||Vt(c,r,n,!0)||o.push({start:i.getId(d),startOffset:v,end:i.getId(c),endOffset:f})}s({ranges:o})}}));return o(),Ft("selectionchange",o)}(t),O=function(t){var e=t.customElementCb,i=t.doc.defaultView;return i&&i.customElements?C(i.customElements,"define",(function(t){return function(i,r,n){try{e({define:{name:i}})}catch(t){console.warn("Custom element callback failed for "+i)}return t.apply(this,[i,r,n])}})):()=>{}}(t),F=[];for(var A of t.plugins)F.push(A.observer(A.callback,s,A.options));return de((()=>{if(n){n.destroy(),n.reset();var e=ve.indexOf(n);-1!==e&&ve.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==r||r.disconnect(),_(),w(),x(),k(),S(),T(),E(),I(),P(),R(),L(),O(),F.forEach((t=>t()))}))}function ke(t){return void 0!==window[t]}function Se(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Ce{constructor(t){o(this,"iframeIdToRemoteIdMap",new WeakMap),o(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,r){var n=i||this.getIdToRemoteIdMap(t),s=r||this.getRemoteIdToIdMap(t),a=n.get(e);return a||(a=this.generateIdFn(),n.set(e,a),s.set(a,e)),a}getIds(t,e){var i=this.getIdToRemoteIdMap(t),r=this.getRemoteIdToIdMap(t);return e.map((e=>this.getId(t,e,i,r)))}getRemoteId(t,e,i){var r=i||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:r.get(e)||-1}getRemoteIds(t,e){var i=this.getRemoteIdToIdMap(t);return e.map((e=>this.getRemoteId(t,e,i)))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){var e=this.iframeIdToRemoteIdMap.get(t);return e||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 Me{constructor(t){o(this,"iframes",new WeakMap),o(this,"crossOriginIframeMap",new WeakMap),o(this,"crossOriginIframeMirror",new Ce(ct)),o(this,"crossOriginIframeStyleMirror"),o(this,"crossOriginIframeRootIdMap",new WeakMap),o(this,"mirror"),o(this,"mutationCb"),o(this,"wrappedEmit"),o(this,"loadListener"),o(this,"pageHideListener"),o(this,"stylesheetManager"),o(this,"recordCrossOriginIframes"),o(this,"messageHandler"),o(this,"nestedIframeListeners",new Map),o(this,"attachedWindows",new WeakMap),o(this,"attachedDocuments",new WeakMap),o(this,"attachedIframes",new Map),o(this,"loadListenerDisposers",new WeakMap),o(this,"iframeElementsById",new Map),o(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ce(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.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 i=this.loadListenerDisposers.get(t);i||this.loadListenerDisposers.set(t,i=new Set),i.add(e);var r=this.mirror.getId(t);-1!==r&&this.iframeElementsById.set(r,t)}getIframeElementById(t){var e,i,r;return null!==(e=null!==(i=null==(r=this.attachedIframes.get(t))?void 0:r.element)&&void 0!==i?i: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=>Dt(t))),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach((t=>{At(t.win,"pagehide",t.handler)})),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var i=this.mirror.getId(t);return this.attachedIframes.set(i,{element:t,content:e}),i}attachIframe(t,e){var i,r=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:r,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var s=t.contentWindow;if(this.recordCrossOriginIframes&&s&&!this.nestedIframeListeners.has(s)){var a=this.handleMessage.bind(this);Dt((()=>{s.addEventListener("message",a),this.nestedIframeListeners.set(s,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(s)}))}Dt((()=>{var e=t.contentWindow;if(e){var i=this.pageHideHandlers.get(t);if(i)for(var r of i)if(r.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),i||this.pageHideHandlers.set(t,i=new Set),i.add({win:e,handler:n})}})),null==(i=this.loadListener)||i.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var i=this.crossOriginIframeMap.get(t.source);if(i){var r=this.transformCrossOriginEvent(i,e.data.event);r&&this.wrappedEmit(r,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){var i;switch(e.type){case l.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:l.IncrementalSnapshot,data:{source:u.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case l.Meta:case l.Load:case l.DomContentLoaded:return!1;case l.Plugin:return e;case l.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case l.IncrementalSnapshot:switch(e.data.source){case u.Mutation:return e.data.adds.forEach((e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(e.node,i)})),e.data.removes.forEach((e=>{this.replaceIds(e,t,["parentId","id"])})),e.data.attributes.forEach((e=>{this.replaceIds(e,t,["id"])})),e.data.texts.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.Drag:case u.TouchMove:case u.MouseMove:return e.data.positions.forEach((e=>{this.replaceIds(e,t,["id"])})),e;case u.ViewportResize:return!1;case u.MediaInteraction:case u.MouseInteraction:case u.Scroll:case u.CanvasMutation:case u.Input:return this.replaceIds(e.data,t,["id"]),e;case u.StyleSheetRule:case u.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case u.Font:return e;case u.Selection:return e.data.ranges.forEach((e=>{this.replaceIds(e,t,["start","end"])})),e;case u.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(i=e.data.styles)||i.forEach((e=>{this.replaceStyleIds(e,t,["styleId"])})),e}}return!1}replace(t,e,i,r){for(var n of r)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(i,e[n]):t.getId(i,e[n]));return e}replaceIds(t,e,i){return this.replace(this.crossOriginIframeMirror,t,e,i)}replaceStyleIds(t,e,i){return this.replace(this.crossOriginIframeStyleMirror,t,e,i)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach((t=>{this.replaceIdOnNode(t,e)}))}patchRootIdOnNode(t,e){t.type===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),i=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),i){var r=i.contentWindow,n=this.attachedWindows.get(i);n&&(n.forEach((t=>{var e=this.nestedIframeListeners.get(t);e&&(At(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)})),this.attachedWindows.delete(i)),r&&this.nestedIframeListeners.has(r)&&(At(r,"message",this.nestedIframeListeners.get(r)),this.nestedIframeListeners.delete(r)),r&&this.crossOriginIframeMap.delete(r),this.iframes.delete(i),this.disposeLoadListeners(i),this.removePageHideListener(i);var s=this.attachedDocuments.get(i);s&&(s.forEach((t=>{Dt((()=>this.mirror.removeNodeFromMap(t)))})),Dt((()=>ge(i,s))),this.attachedDocuments.delete(i))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach(((e,i)=>{this.mirror.has(i)||t.push(i)})),t.forEach((t=>this.removeIframeById(t)))}}reattachIframes(){this.attachedIframes.forEach(((t,e)=>{var i=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:i}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)}))}destroy(){this.recordCrossOriginIframes&&At(window,"message",this.messageHandler),this.nestedIframeListeners.forEach(((t,e)=>{At(e,"message",t)})),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach((e=>t.add(e))),this.attachedIframes.forEach((e=>t.add(e.element))),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 Te{constructor(t){o(this,"shadowDoms",new WeakSet),o(this,"mutationCb"),o(this,"scrollCb"),o(this,"bypassOptions"),o(this,"mirror"),o(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){var r,n;if(U(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var s=null!==(r=null==(n=M.host(t))?void 0:n.ownerDocument)&&void 0!==r?r:e,a=fe(i({},this.bypassOptions,{doc:s,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),o=a.observer,l=a.buffer;this.restoreHandlers.push({doc:s,handler(){o.disconnect(),l.destroy(),l.releaseCanvasManager();var t=ve.indexOf(l);-1!==t&&ve.splice(t,1)}}),this.restoreHandlers.push({doc:s,handler:pe(i({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout((()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(M.host(t))),this.restoreHandlers.push({doc:s,handler:we({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})}),0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var i=this;this.restoreHandlers.push({doc:e,handler:C(t.prototype,"attachShadow",(function(t){return function(r){var n=t.call(this,r),s=M.shadowRoot(this);return s&&ee(this)&&i.addShadowRoot(s,e),n}}))})}reset(){this.restoreHandlers.forEach((t=>{var e=t.handler;try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var i of this.restoreHandlers)if(i.doc===t)try{i.handler()}catch(t){}else e.push(i);this.restoreHandlers=e}}var Ee="skip-frame";function Ie(t){if("object"!=typeof t||null===t)return!1;var e=t.y,i=t.width,r=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(i)&&Number.isFinite(r)&&i>=0&&r>=0}for(var Pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Re="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Le=0;64>Le;Le++)Re[Pe.charCodeAt(Le)]=Le;var Oe=new Map,Fe=(t,e,i)=>{if(t&&($e(t,e)||"object"==typeof t)){var r=function(t,e){var i=Oe.get(t);return i||Oe.set(t,i=new Map),i.has(e)||i.set(e,[]),i.get(e)}(i,t.constructor.name),n=r.indexOf(t);return-1===n&&(n=r.length,r.push(t)),n}};function Ae(t,e,i,r){if(t instanceof Array)return t.map((t=>Ae(t,e,i,r)));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,i=new Uint8Array(t),r=i.length,n="";for(e=0;r>e;e+=3)n+=Pe[i[e]>>2],n+=Pe[(3&i[e])<<4|i[e+1]>>4],n+=Pe[(15&i[e+1])<<2|i[e+2]>>6],n+=Pe[63&i[e+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(t);return{rr_type:n,base64:s}}return t instanceof DataView?{rr_type:t.constructor.name,args:[Ae(t.buffer,e,i,r),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(r.type,r.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[Ae(t.data,e,i,r),t.width,t.height]}:$e(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Fe(t,e,i)}:t}var De=(t,e,i,r)=>t.map((t=>Ae(t,e,i,r))),$e=(t,e)=>{var i=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((t=>"function"==typeof e[t]));return Boolean(i.find((i=>t instanceof e[i])))},Ne=["webgl","webgl2"];function qe(t){return"nodeType"in t}function je(t,e,r,n){var s=[];try{if(n){var a=function(t,e,r){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return C(n.prototype,"configure",(function(n){return function(s){var a=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!a||qe(a)&&Vt(a,e,r,!0))return n.call(this,s);qe(a)&&!("__context"in a)&&(a.__context="webgpu");var o=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==o&&s?i({},s,{usage:"number"==typeof s.usage?s.usage|o:o}):s)}}))}(t,e,r);a&&s.push(a)}var o=C(t.HTMLCanvasElement.prototype,"getContext",(function(t){return function(i){for(var s=function(t){return"experimental-webgl"===t?"webgl":t}(i),a=arguments.length,o=new Array(a>1?a-1:0),l=1;a>l;l++)o[l-1]=arguments[l];if(!Vt(this,e,r,!0)&&("__context"in this||(this.__context=s),n&&Ne.includes(s)))if(o[0]&&"object"==typeof o[0]){var u=o[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[i,...o])}}));s.push(o)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((t=>t()))}}function Be(t,e,i,r,n,s,a){var o=[],l=Object.getOwnPropertyNames(t),u=function(l){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))return 0;try{if("function"!=typeof t[l])return 0;var u=C(t,l,(function(t){return function(){for(var o=arguments.length,u=new Array(o),h=0;o>h;h++)u[h]=arguments[h];var d=t.apply(this,u);if(Fe(d,s,this),"tagName"in this.canvas&&!Vt(this.canvas,r,n,!0)){var v=De(u,s,this,a);i(this.canvas,{type:e,property:l,args:v})}return d}}));o.push(u)}catch(r){var h=jt(t,l,{set(t){i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});o.push(h)}};for(var h of l)u(h);return o}var He,Ue,ze,We='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastFingerprintMap = /* @__PURE__ */ new Map();\n const transparentFingerprintMap = /* @__PURE__ */ new Map();\n const lastSentAtMap = /* @__PURE__ */ new Map();\n const PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n function hashPixels(data) {\n const view = new Uint32Array(\n data.buffer,\n data.byteOffset,\n data.byteLength >>> 2\n );\n let primaryHash = 2166136261;\n let secondaryHash = 2654435769;\n for (let i2 = 0; i2 < view.length; i2++) {\n primaryHash ^= view[i2];\n primaryHash = Math.imul(primaryHash, 16777619);\n secondaryHash ^= view[i2];\n secondaryHash = Math.imul(secondaryHash, 2246822507);\n }\n return `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n }\n function frameFingerprint(width, height, data) {\n return `${width}x${height}:${hashPixels(data)}`;\n }\n function transparentFingerprint(width, height) {\n const pixelCount = width * height;\n let hash = transparentFingerprintMap.get(pixelCount);\n if (hash === void 0) {\n hash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n transparentFingerprintMap.set(pixelCount, hash);\n }\n return `${width}x${height}:${hash}`;\n }\n const worker = self;\n let reusableCanvas = null;\n let reusableCtx = null;\n worker.onmessage = async function(e) {\n if ("resetFrameDedup" in e.data) {\n lastFingerprintMap.clear();\n return;\n }\n if ("OffscreenCanvas" in globalThis) {\n const {\n id,\n bitmap,\n width,\n height,\n displayWidth,\n displayHeight,\n dataURLOptions,\n maskRegions\n } = e.data;\n try {\n if (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n reusableCanvas = new OffscreenCanvas(width, height);\n reusableCtx = reusableCanvas.getContext("2d", {\n willReadFrequently: true\n });\n }\n const ctx = reusableCtx;\n ctx.clearRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n if (maskRegions) {\n ctx.fillStyle = "black";\n for (const region of maskRegions) {\n ctx.fillRect(region.x, region.y, region.width, region.height);\n }\n }\n const fingerprint = frameFingerprint(\n width,\n height,\n ctx.getImageData(0, 0, width, height).data\n );\n const lastFingerprint = lastFingerprintMap.get(id) ?? transparentFingerprint(width, height);\n if (fingerprint === lastFingerprint) {\n const lastSentAt = lastSentAtMap.get(id);\n const keyframeDue = maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS;\n if (!keyframeDue) {\n return worker.postMessage({ id });\n }\n }\n const blob = await reusableCanvas.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n worker.postMessage({\n id,\n type: blob.type,\n base64: encode(arrayBuffer),\n // cpu intensive\n displayWidth,\n displayHeight\n });\n lastFingerprintMap.set(id, fingerprint);\n lastSentAtMap.set(id, Date.now());\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',Ve="undefined"!=typeof self&&self.Blob&&new Blob([We],{type:"text/javascript;charset=utf-8"});function Ze(t){var e;try{if(!(e=Ve&&(self.URL||self.webkitURL).createObjectURL(Ve)))throw"";var i=new Worker(e,{name:null==t?void 0:t.name});return i.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(e)})),i}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(We),{name:null==t?void 0:t.name})}finally{e&&(self.URL||self.webkitURL).revokeObjectURL(e)}}class Ge{constructor(t){o(this,"pendingCanvasMutations",new Map),o(this,"rafStamps",{latestId:0,invokeId:null}),o(this,"mirror"),o(this,"mutationCb"),o(this,"resetObservers"),o(this,"frozen",!1),o(this,"locked",!1),o(this,"rafIdTimestamp",null),o(this,"rafIdFlush",null),o(this,"refCount",0),o(this,"torndown",!1),o(this,"resetFrameDedup",null),o(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 e=t.sampling,i=void 0===e?"all":e,r=t.win,n=t.blockClass,s=t.blockSelector,a=t.recordCanvas,l=t.dataURLOptions,u=t.resolutionScale,h=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===i&&this.initCanvasMutationObserver(r,n,s,l),a&&"number"==typeof i&&this.initCanvasFPSObserver(i,r,n,s,{dataURLOptions:l,resolutionScale:u,canvasMasking:h})}onFullSnapshot(){var t;null==(t=this.resetFrameDedup)||t.call(this)}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,i,r,n,s){var a=this;if("OffscreenCanvas"in i){var o,l="number"==typeof s.resolutionScale&&Number.isFinite(s.resolutionScale)?Math.min(1,Math.max(.1,s.resolutionScale)):1,u=je(i,r,n,!0),h=new Map;try{o=new Ze}catch(t){return}var d=!1;o.onerror=()=>{var t;d=!0,cancelAnimationFrame(c),null==(t=o.terminate)||t.call(o),this.resetFrameDedup=null},this.resetFrameDedup=()=>{o.postMessage({resetFrameDedup:!0})},o.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var i=t.data,r=i.displayWidth,n=i.displayHeight;this.mutationCb({id:e,type:v["2D"],commands:[{property:"clearRect",args:[0,0,r,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i.base64}],type:i.type}]},0,0,r,n]}],displayWidth:r,displayHeight:n})}};var c,f=1e3/t,p=0,g=t=>{var u,v;d||(p&&f>t-p||(p=t,(u=[],v=t=>{try{t.querySelectorAll("canvas").forEach((t=>{Vt(t,r,n,!0)||u.push(t)})),t.querySelectorAll("*").forEach((t=>{t.shadowRoot&&v(t.shadowRoot)}))}catch(t){}},v(i.document),u).forEach(function(){var t=e((function*(t){var e,i,r=a.mirror.getId(t);if(!h.get(r)&&0!==t.width&&0!==t.height){h.set(r,!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 h.set(r,!1);!1===(null==(i=null==n?void 0:n.getContextAttributes())?void 0:i.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var u=t.clientWidth||t.width,d=t.clientHeight||t.height,v=Math.max(1,Math.round(u*l)),c=Math.max(1,Math.round(d*l)),f=function(t,e,i,r,n,s){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return Ee}if(void 0!==a){if(!Array.isArray(a)||!a.every(Ie))return Ee;var o=i/n,l=r/s;return a.filter((t=>t.width>0&&t.height>0)).map((t=>{var e=Math.floor(t.x*o),i=Math.floor(t.y*l);return{x:e,y:i,width:Math.ceil((t.x+t.width)*o)-e,height:Math.ceil((t.y+t.height)*l)-i}}))}}}(s.canvasMasking,t,v,c,u,d);if(f===Ee)return void h.set(r,!1);var p=yield createImageBitmap(t,1>l?{resizeWidth:v,resizeHeight:c,resizeQuality:"medium"}:{resizeWidth:v,resizeHeight:c});o.postMessage({id:r,bitmap:p,width:v,height:c,displayWidth:u,displayHeight:d,dataURLOptions:s.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(r,!1)}}}));return function(e){return t.apply(this,arguments)}}())),c=requestAnimationFrame(g))};c=requestAnimationFrame(g),this.resetObservers=()=>{var t;u(),cancelAnimationFrame(c),null==(t=o.terminate)||t.call(o),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,i,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=je(t,e,i,!1),s=function(t,e,i,r,n){var s=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),o=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var o=C(e.CanvasRenderingContext2D.prototype,a,(function(s){return function(){for(var o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];return Vt(this.canvas,i,r,!0)||setTimeout((()=>{var i=De(l,e,this,n);t(this.canvas,{type:v["2D"],property:a,args:i})}),0),s.apply(this,l)}}));s.push(o)}catch(i){var l=jt(e.CanvasRenderingContext2D.prototype,a,{set(e){t(this.canvas,{type:v["2D"],property:a,args:[e],setter:!0})}});s.push(l)}};for(var l of a)o(l);return()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r),a=function(t,e,i,r,n){var s=[];return void 0!==e.WebGLRenderingContext&&s.push(...Be(e.WebGLRenderingContext.prototype,v.WebGL,t,i,r,e,n)),void 0!==e.WebGL2RenderingContext&&s.push(...Be(e.WebGL2RenderingContext.prototype,v.WebGL2,t,i,r,e,n)),()=>{s.forEach((t=>t()))}}(this.processMutation.bind(this),t,e,i,r);this.resetObservers=()=>{n(),s(),a()}}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 i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)})),this.rafIdFlush=requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(t,e){if(!this.frozen&&!this.locked){var i=this.pendingCanvasMutations.get(t);if(i&&-1!==e){var n=i.map((t=>r(t,s)));this.mutationCb({id:e,type:i[0].type,commands:n}),this.pendingCanvasMutations.delete(t)}}}}class Qe{constructor(t){o(this,"trackedLinkElements",new WeakSet),o(this,"mutationCb"),o(this,"adoptedStyleSheetCb"),o(this,"styleMirror",new Xt),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)}inlineDeferredLinkElement(t,e){if(-1!==e&&t.isConnected){var i=null;try{var r=t.sheet;r&&(i=W(r))}catch(t){}i&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:i}}]})}}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var i=this;if(0!==t.length){var r={id:e,styleIds:[]},n=[],s=function(t){var e;i.styleMirror.has(t)?e=i.styleMirror.getId(t):(e=i.styleMirror.add(t),n.push({styleId:e,rules:Array.from(t.rules||CSSRule,((e,i)=>({rule:V(e,t.href),index:i})))})),r.styleIds.push(e)};for(var a of t)s(a);n.length>0&&(r.styles=n),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,Ct.forEach((t=>t.abort())),Ct.clear()}trackStylesheetInLinkElement(t){}}class Je{constructor(){o(this,"nodeMap",new WeakMap),o(this,"active",!1)}inOtherBuffer(t,e){var i=this.nodeMap.get(t);return i&&Array.from(i).some((t=>t!==e))}add(t,e){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}var Ke=!1;try{if(2!==Array.from([1],(t=>2*t))[0]){var Ye=document.createElement("iframe");document.body.appendChild(Ye),Array.from=(null==(n=Ye.contentWindow)?void 0:n.Array.from)||Array.from,document.body.removeChild(Ye)}}catch(t){console.debug("Unable to override Array.from",t)}var Xe=new Z,ti=new Set([u.Mutation,u.MediaInteraction,u.StyleSheetRule,u.CanvasMutation,u.Font,u.Log,u.StyleDeclaration,u.AdoptedStyleSheet]);function ei(t){var e=window;if("function"==typeof e.requestIdleCallback){var i=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null==(t=e.cancelIdleCallback)?void 0:t.call(e,i)}}}var r=setTimeout(t,250);return{cancel:()=>clearTimeout(r)}}function ii(t){var e;void 0===t&&(t={});var r=t,n=r.emit,s=r.checkoutEveryNms,a=r.checkoutEveryNth,o=r.blockClass,h=void 0===o?"rr-block":o,d=r.blockSelector,v=void 0===d?null:d,c=r.ignoreClass,f=void 0===c?"rr-ignore":c,p=r.ignoreSelector,g=void 0===p?null:p,m=r.maskTextClass,y=void 0===m?"rr-mask":m,b=r.maskTextSelector,_=void 0===b?null:b,w=r.inlineStylesheet,x=void 0===w||w,k=r.inlineStylesheetBudgetRules,S=void 0===k?1e4:k,C=r.maskAllInputs,A=r.maskInputOptions,N=r.slimDOMOptions,q=r.maskInputFn,j=r.maskTextFn,B=r.hooks,H=r.packFn,U=r.sampling,z=void 0===U?{}:U,W=r.dataURLOptions,V=void 0===W?{}:W,G=r.canvasResolutionScale,Q=r.canvasMasking,J=r.mousemoveWait,K=r.recordDOM,Y=void 0===K||K,X=r.recordCanvas,tt=void 0!==X&&X,et=r.recordCrossOriginIframes,it=void 0!==et&&et,rt=r.recordAfter,nt=void 0===rt?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":rt,st=r.userTriggeredOnInput,at=void 0!==st&&st,ot=r.collectFonts,lt=void 0!==ot&&ot,ut=r.inlineImages,ht=void 0!==ut&&ut,dt=r.plugins,vt=r.keepIframeSrcFn,ct=void 0===vt?()=>!1:vt,ft=r.ignoreCSSAttributes,pt=void 0===ft?new Set([]):ft,gt=r.attributeFilter;ne=r.errorHandler;var mt=i({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},V),yt=!it||window.parent===window,bt=!1;if(!yt)try{window.parent.document&&(bt=!1)}catch(t){bt=!0}if(yt&&!n)throw new Error("emit function is required");if(!yt&&!bt)return()=>{};void 0!==J&&void 0===z.mousemove&&(z.mousemove=J),Xe.reset();var _t,wt=!0===C?{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!==A?A:{password:!0},xt=Lt(void 0!==N&&N);!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 kt,St,Ct=0,Mt=new Map,Tt=t=>{for(var e of dt||[])e.eventProcessor&&(t=e.eventProcessor(t));return H&&!bt&&(t=H(t)),t};He=(t,e)=>{var i,r=t;if(r.timestamp=Bt(),!(null==(i=ve[0])?void 0:i.isFrozen())||r.type===l.FullSnapshot||r.type===l.IncrementalSnapshot&&ti.has(r.data.source)||ve.forEach((t=>t.unfreeze())),yt)null==n||n(Tt(r),e);else if(bt){var o={type:"rrweb",event:Tt(r),origin:window.location.origin,isCheckout:e};window.parent.postMessage(o,"*")}if(r.type===l.FullSnapshot)_t=r,Ct=0;else if(r.type===l.IncrementalSnapshot){if(r.data.source===u.Mutation&&r.data.isAttachIframe)return;Ct++,(a&&Ct>=a||s&&r.timestamp-_t.timestamp>s)&&Ue(!0)}};var Et=t=>{if(t.removes&&t.removes.length>0){var e=t.adds.length>0?new Set(t.adds.map((t=>t.node.id))):null,r=new Set;if(t.adds.length>0)for(var n of t.adds){var s=Xe.getNode(n.node.id);s&&"IFRAME"===s.nodeName&&r.add(s)}t.removes.forEach((t=>{var i=t.id;if(!e||!e.has(i)){var n=At.getIframeElementById(i);n&&r.has(n)?At.forgetIframeId(i):(null==kt||kt(i),At.removeIframeById(i))}})),null==St||St(),At.cleanupDetachedIframes()}He({type:l.IncrementalSnapshot,data:i({source:u.Mutation},t)})},It=t=>He({type:l.IncrementalSnapshot,data:i({source:u.Scroll},t)}),Pt=t=>He({type:l.IncrementalSnapshot,data:i({source:u.CanvasMutation},t)}),Ot=new Qe({mutationCb:Et,adoptedStyleSheetCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.AdoptedStyleSheet},t)})}),At=new Me({mirror:Xe,mutationCb:Et,stylesheetManager:Ot,recordCrossOriginIframes:it,wrappedEmit:He});for(var $t of dt||[])$t.getMirror&&$t.getMirror({nodeMirror:Xe,crossOriginIframeMirror:At.crossOriginIframeMirror,crossOriginIframeStyleMirror:At.crossOriginIframeStyleMirror});var Nt=new Je,qt=null==Q?void 0:Q.configured;ze=new Ge({recordCanvas:tt,mutationCb:Pt,win:window,blockClass:h,blockSelector:v,mirror:Xe,sampling:z.canvas,dataURLOptions:mt,resolutionScale:G,canvasMasking:Q});var jt=new Te({mutationCb:Et,scrollCb:It,bypassOptions:{blockClass:h,blockSelector:v,maskTextClass:y,maskTextSelector:_,inlineStylesheet:x,maskInputOptions:wt,dataURLOptions:mt,maskTextFn:j,maskInputFn:q,recordCanvas:tt,canvasMaskingConfigured:qt,inlineImages:ht,sampling:z,slimDOMOptions:xt,iframeManager:At,stylesheetManager:Ot,canvasManager:ze,keepIframeSrcFn:ct,processedNodeManager:Nt,attributeFilter:gt},mirror:Xe});Ue=function(t){if(void 0===t&&(t=!1),Y){He({type:l.Meta,data:{href:window.location.href,width:zt(),height:Ut()}},t),null==e||e(),e=void 0,Ot.reset(),jt.init(),ve.forEach((t=>t.lock()));var i,r,n=null;try{n=function(t,e){var i,r=e||{},n=r.mirror,s=void 0===n?new Z:n,a=r.blockClass,o=void 0===a?"rr-block":a,l=r.blockSelector,u=void 0===l?null:l,h=r.maskTextClass,d=void 0===h?"rr-mask":h,v=r.maskTextSelector,c=void 0===v?null:v,f=r.inlineStylesheet,p=void 0===f||f,g=r.inlineImages,m=void 0!==g&&g,y=r.recordCanvas,b=void 0!==y&&y,_=r.canvasMaskingConfigured,w=r.maskAllInputs,x=void 0!==w&&w,k=r.maskTextFn,S=r.maskInputFn,C=r.slimDOM,M=r.dataURLOptions,A=r.preserveWhiteSpace,N=r.onSerialize,q=r.onIframeLoad,j=r.iframeLoadTimeout,B=r.onIframeListenerRegistered,H=r.onStylesheetLoad,U=r.stylesheetLoadTimeout,z=r.keepIframeSrcFn,W=void 0===z?()=>!1:z,V=r.maxDepth,G=r.inlineStylesheetBudgetRules,Q=!0===x?{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===x?{password:!0}:x,J=Lt(void 0!==C&&C);i=G,(I+=1)>1||(R=T(),F=[],O=D(i),P=E());try{return Rt(t,{doc:t,mirror:s,blockClass:o,blockSelector:u,maskTextClass:d,maskTextSelector:c,skipChild:!1,inlineStylesheet:p,maskInputOptions:Q,maskTextFn:k,maskInputFn:S,slimDOMOptions:J,dataURLOptions:M,inlineImages:m,recordCanvas:b,canvasMaskingConfigured:_,preserveWhiteSpace:A,onSerialize:N,onIframeLoad:q,iframeLoadTimeout:j,onIframeListenerRegistered:B,onStylesheetLoad:H,stylesheetLoadTimeout:U,keepIframeSrcFn:W,newlyAddedElement:!1,maxDepth:V})}finally{0===I?L||T():(I-=1)>0||(R.durationMs=E()-P,R.deferredStylesheetCount=F.length,O=null,L=R)}}(document,{mirror:Xe,blockClass:h,blockSelector:v,maskTextClass:y,maskTextSelector:_,inlineStylesheet:x,maskAllInputs:wt,inlineStylesheetBudgetRules:S,maskTextFn:j,maskInputFn:q,slimDOM:xt,dataURLOptions:mt,recordCanvas:tt,canvasMaskingConfigured:qt,inlineImages:ht,onSerialize(t){Jt(t,Xe)&&At.addIframe(t),Kt(t,Xe)&&Ot.trackLinkElement(t),Yt(t)&&jt.addShadowRoot(M.shadowRoot(t),document)},onIframeLoad(t,e){At.attachIframe(t,e),jt.observeAttachShadow(t)},onIframeListenerRegistered(t,e){At.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){Ot.attachLinkElement(t,e)},keepIframeSrcFn:ct})}finally{i=F,F=[],r=i}if(!n)return console.warn("Failed to snapshot the document");He({type:l.FullSnapshot,data:{node:n,initialOffset:Ht(window)}},t),ve.forEach((t=>t.unlock())),ze.onFullSnapshot(),r.length&&(e=function(t,i,r){var n=!1,s=null,a=0,o=r=>{if(s=null,!n){var l=function(){var e=t[a];t[a]=null,a+=1,e&&Dt((()=>i.inlineDeferredLinkElement(e,Xe.getId(e))))};do{l()}while(t.length>a&&r&&!r.didTimeout&&r.timeRemaining()>5);t.length>a?s=ei(o):e=void 0}};return s=ei(o),()=>{n=!0,null==s||s.cancel(),s=null}}(r,Ot)),it&&At.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ot.adoptStyleSheets(document.adoptedStyleSheets,Xe.getId(document))}};try{var Wt=[];kt=t=>{var e=Mt.get(t);e&&(e.forEach((t=>{Dt(t);var e=Wt.indexOf(t);-1!==e&&Wt.splice(e,1)})),Mt.delete(t))},St=()=>{for(var t of Mt){var e=t[0],i=Xe.getNode(e);if(i)try{i.contentDocument&&i.contentDocument.defaultView||null==kt||kt(e)}catch(t){null==kt||kt(e)}else null==kt||kt(e)}};var Vt=t=>{var e;return de(xe)({mutationCb:Et,mousemoveCb:(t,e)=>He({type:l.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.MouseInteraction},t)}),scrollCb:It,viewportResizeCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.ViewportResize},t)}),inputCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.Input},t)}),mediaInteractionCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.MediaInteraction},t)}),styleSheetRuleCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.StyleSheetRule},t)}),styleDeclarationCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.StyleDeclaration},t)}),canvasMutationCb:Pt,fontCb:t=>He({type:l.IncrementalSnapshot,data:i({source:u.Font},t)}),selectionCb(t){He({type:l.IncrementalSnapshot,data:i({source:u.Selection},t)})},customElementCb(t){He({type:l.IncrementalSnapshot,data:i({source:u.CustomElement},t)})},blockClass:h,ignoreClass:f,ignoreSelector:g,maskTextClass:y,maskTextSelector:_,maskInputOptions:wt,inlineStylesheet:x,sampling:z,recordDOM:Y,recordCanvas:tt,canvasMaskingConfigured:qt,inlineImages:ht,userTriggeredOnInput:at,collectFonts:lt,doc:t,maskInputFn:q,maskTextFn:j,keepIframeSrcFn:ct,blockSelector:v,slimDOMOptions:xt,dataURLOptions:mt,mirror:Xe,iframeManager:At,stylesheetManager:Ot,shadowDomManager:jt,processedNodeManager:Nt,canvasManager:ze,ignoreCSSAttributes:pt,attributeFilter:gt,plugins:(null==(e=null==dt?void 0:dt.filter((t=>t.observer)))?void 0:e.map((t=>({observer:t.observer,options:t.options,callback:e=>He({type:l.Plugin,data:{plugin:t.name,payload:e}})}))))||[]},B)};At.addLoadListener((t=>{try{var e=Xe.getId(t),i=Vt(t.contentDocument);if(Wt.push(i),-1!==e){var r=Mt.get(e);r||Mt.set(e,r=new Set),r.add(i)}}catch(t){console.warn(t)}})),At.addPageHideListener((t=>{var e=Xe.getId(t);null==kt||kt(e),ge(t)}));var Zt=-1,Gt=t=>He({type:l.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Qt=()=>{var t,e,i,r,n=document,s=null!==(t=null!==(e=null!==(i=null!==(r=n.fullscreenElement)&&void 0!==r?r:n.webkitFullscreenElement)&&void 0!==i?i:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,a=s?Xe.getId(s):-1;a!==Zt&&(-1!==Zt&&Gt({id:Zt,enter:!1}),Zt=a,-1!==a&&Gt({id:a,enter:!0}))},Xt=()=>{Ue(),Wt.push(Vt(document)),Wt.push(Ft("fullscreenchange",Qt)),Wt.push(Ft("webkitfullscreenchange",Qt)),Wt.push(Ft("mozfullscreenchange",Qt)),Wt.push(Ft("MSFullscreenChange",Qt)),Ke=!0};return["interactive","complete"].includes(document.readyState)?Xt():(Wt.push(Ft("DOMContentLoaded",(()=>{He({type:l.DomContentLoaded,data:{}}),"DOMContentLoaded"===nt&&Xt()}))),Wt.push(Ft("load",(()=>{He({type:l.Load,data:{}}),"load"===nt&&Xt()}),window))),()=>{null==e||e(),e=void 0,Wt.forEach((t=>Dt(t))),Nt.destroy(),At.removeLoadListener(),At.destroy(),Mt.clear(),jt.reset(),Xe.reset(),Ke=!1,ne=void 0}}catch(t){console.warn(t)}}ii.addCustomEvent=(t,e)=>{if(!Ke)throw new Error("please add custom event after start recording");He({type:l.Custom,data:{tag:t,payload:e}})},ii.freezePage=()=>{ve.forEach((t=>t.freeze()))},ii.takeFullSnapshot=t=>{if(!Ke)throw new Error("please take full snapshot after start recording");Ue(t)},ii.mirror=Xe;var ri=Object.defineProperty,ni=(t,e,i)=>((t,e,i)=>e in t?ri(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);class si{constructor(t){ni(this,"fileName"),ni(this,"functionName"),ni(this,"lineNumber"),ni(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 ai=/(^|@)\S+:\d+/,oi=/^\s*at .*(\S+:\d+|\(native\))/m,li=/^(eval@)?(\[native code])?$/,ui={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(oi)?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(oi)}),this).map((function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),i=e.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(e=i?e.replace(i[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(i?i[1]:r.pop()),s=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new si({functionName:s,fileName:a,lineNumber:n[1],columnNumber:n[2]})}),this)},parseFFOrSafari(t){return t.stack.split("\n").filter((function(t){return!t.match(li)}),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 si({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(e),r=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(e,""));return new si({functionName:r,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,i=t.message.split("\n"),r=[],n=2,s=i.length;s>n;n+=2){var a=e.exec(i[n]);a&&r.push(new si({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,i=t.stacktrace.split("\n"),r=[],n=0,s=i.length;s>n;n+=2){var a=e.exec(i[n]);a&&r.push(new si({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11(t){return t.stack.split("\n").filter((function(t){return!!t.match(ai)&&!t.match(/^Error created at/)}),this).map((function(t){var e=t.split("@"),i=this.extractLocation(e.pop()),r=(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new si({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)}};function hi(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var i=t.localName;if(!i)break;i=i.toLowerCase();var r=t.parentElement,n=[];if(r.children&&r.children.length>0)for(var s=0;r.children.length>s;s++){var a=r.children[s];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===i&&n.push(a)}n.length>1&&(i+=":eq("+n.indexOf(t)+")"),e=i+(e?">"+e:""),t=r}return e}function di(t){return Array.isArray(t)}function vi(t){return"object"==typeof t&&null!==t&&!di(t)}function ci(t,e){if(0===e)return!0;var i=Object.keys(t);for(var r of i)if(vi(t[r])&&ci(t[r],e-1))return!0;return!1}function fi(t,e){var i={numOfKeysLimit:50,depthOfLimit:4};Object.assign(i,e);var r=[],n=[];return JSON.stringify(t,(function(t,e){if(r.length>0){var s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?n.splice(s,1/0,t):n.push(t),~r.indexOf(e)&&(e=r[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(e)).join(".")+"]")}else r.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(vi(a=e)&&Object.keys(a).length>i.numOfKeysLimit||"function"==typeof a||vi(a)&&ci(a,i.depthOfLimit))return function(t){var e=t.toString();return i.stringLengthLimit&&e.length>i.stringLengthLimit&&(e=e.slice(0,i.stringLengthLimit)+"..."),e}(e);var a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var o={};for(var l in e){var u=e[l];o[l]=di(u)?hi(u.length?u[0]:null):u}return o}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e}))}var pi={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 gi(t,e,i){var r,n=i?Object.assign({},pi,i):pi,s=n.logger;if(!s)return()=>{};r="string"==typeof s?e[s]:s;var a=0,o=!1,l=[];if(n.level.includes("error")){var u=e=>{var i=e.message,r=ui.parse(e.error).map((t=>t.toString())),s=[fi(i,n.stringifyOptions)];t({level:"error",trace:r,payload:s})};e.addEventListener("error",u),l.push((()=>{e.removeEventListener("error",u)}));var h=e=>{var i,r;e.reason instanceof Error?r=[fi("Uncaught (in promise) "+(i=e.reason).name+": "+i.message,n.stringifyOptions)]:(i=new Error,r=[fi("Uncaught (in promise)",n.stringifyOptions),fi(e.reason,n.stringifyOptions)]);var s=ui.parse(i).map((t=>t.toString()));t({level:"error",trace:s,payload:r})};e.addEventListener("unhandledrejection",h),l.push((()=>{e.removeEventListener("unhandledrejection",h)}))}for(var d of n.level)l.push(v(r,d));return()=>{l.forEach((t=>t()))};function v(e,i){var r=this;return e[i]?function(e,s,l){try{if(!(s in e))return()=>{};var u=e[s],h={next:u},d=(e=>function(){for(var s=arguments.length,l=new Array(s),u=0;s>u;u++)l[u]=arguments[u];if(e.apply(r,l),!("assert"===i&&l[0]||o)){o=!0;try{var h=ui.parse(new Error).map((t=>t.toString())).splice(1),d=("assert"===i?l.slice(1):l).map((t=>fi(t,n.stringifyOptions)));a++,n.lengthThreshold>a?t({level:i,trace:h,payload:d}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[fi("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...l)}finally{o=!1}}})((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return h.next.apply(this,e)}));return"function"==typeof d&&(d.prototype=d.prototype||{},Object.defineProperties(d,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:h}})),e[s]=d,()=>{if(e[s]!==d)for(var t=e[s];"function"==typeof t&&t.__rrweb_layer__;){var i=t.__rrweb_layer__;if(i.next===d)return void(i.next=h.next);t=i.next}else e[s]=h.next}}catch(t){return()=>{}}}(e,i):()=>{}}}var mi=t=>({name:"rrweb/console@1",observer:gi,options:t}),yi=t=>{if("string"!=typeof t)return t;try{return JSON.parse(t)}catch(e){return t}};function bi(t){return"string"==typeof t||t}function _i(t){return"string"==typeof t?t:void 0}var wi,xi=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],ki=function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t}({}),Si=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Ci="min_length",Mi="max_length",Ti=["$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"],Ei=["token"],Ii="NativeGzipValidationError",Pi=t=>t.length>=2&&31===t[0]&&139===t[1],Ri=(t,e)=>t===Si.GZipJS||e===Si.GZipJS||"gzip"===e,Li=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),Oi=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=Ii,e},Fi=function(){var t=e((function*(t,e){18>t.size&&Oi("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());Pi(i)&&8===i[2]||Oi("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(wi)return wi;wi=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;wi[t]=e>>>0}return wi})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&Oi("invalid-crc");var n=e.length>>>0;r.getUint32(4,!0)!==n&&Oi("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function Ai(){return Ai=e((function*(t,i,r){void 0===i&&(i=!0);try{var n=(new TextEncoder).encode(t),s=new globalThis.CompressionStream("gzip"),a=s.writable.getWriter(),o=a.write(n).then((()=>a.close())).catch(function(){var t=e((function*(t){try{yield a.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),l=new Response(s.readable).blob(),u=(yield Promise.all([l,o]))[0];return yield Fi(u,n),u}catch(t){if(null!=r&&r.rethrow)throw t;return i&&console.error("Failed to gzip compress data",t),null}})),Ai.apply(this,arguments)}var Di=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],$i=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return Di.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function Ni(t,e){return-1!==t.indexOf(e)}var qi=function(t){return t.trim()},ji=function(t){return t.replace(/^\$/,"")};function Bi(t){var e,i=[];return null!==(e=JSON.stringify(t,(function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(e))return"[Circular]";i.push(e)}return e}})))&&void 0!==e?e:"null"}var Hi=Object.prototype,Ui=Hi.hasOwnProperty,zi=Hi.toString,Wi=Array.isArray||function(t){return"[object Array]"===zi.call(t)},Vi=t=>"function"==typeof t,Zi=t=>t===Object(t)&&!Wi(t),Gi=t=>{if(Zi(t)){for(var e in t)if(Ui.call(t,e))return!1;return!0}return!1},Qi=t=>void 0===t,Ji=t=>"[object String]"==zi.call(t),Ki=t=>Ji(t)&&0===t.trim().length,Yi=t=>null===t,Xi=t=>Qi(t)||Yi(t),tr=t=>"[object Number]"==zi.call(t)&&t==t,er=t=>tr(t)&&t>0,ir=t=>"[object Boolean]"===zi.call(t),rr=t=>t instanceof FormData,nr=t=>Ni(Ti,t),sr=t=>Ni(Ei,t);function ar(t){return null===t||"object"!=typeof t}function or(t,e){return{}.toString.call(t)==="[object "+e+"]"}function lr(t){return"undefined"!=typeof Event&&ur(t,Event)}function ur(t,e){try{return t instanceof e}catch(t){return!1}}var hr=[!0,"true",1,"1","yes"],dr=t=>Ni(hr,t),vr=[!1,"false",0,"0","no"];function cr(t,e,i,r,n){return e>i&&(r.warn("min cannot be greater than max."),e=i),tr(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+n),cr(n||i,e,i,r))}class fr{constructor(t){this.tt={},this.et=t.et,this.it=cr(t.bucketSize,0,100,t.rt),this.nt=cr(t.refillRate,0,this.it,t.rt),this.st=cr(t.refillInterval,0,864e5,t.rt)}ot(t,e){var i=Math.floor((e-t.lastAccess)/this.st);i>0&&(t.tokens=Math.min(t.tokens+i*this.nt,this.it),t.lastAccess=t.lastAccess+i*this.st)}consumeRateLimit(t){var e,i=Date.now(),r=String(t),n=this.tt[r];return n?this.ot(n,i):this.tt[r]=n={tokens:this.it,lastAccess:i},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.et)||e.call(this,t)),0===n.tokens)}stop(){this.tt={}}}var pr="Mobile",gr="iOS",mr="Android",yr="Tablet",br=mr+" "+yr,_r="iPad",wr="Apple",xr=wr+" Watch",kr="Safari",Sr="BlackBerry",Cr="Samsung",Mr=Cr+"Browser",Tr=Cr+" Internet",Er="Chrome",Ir=Er+" OS",Pr=Er+" "+gr,Rr="Internet Explorer",Lr=Rr+" "+pr,Or="Opera",Fr=Or+" Mini",Ar="Edge",Dr="Microsoft "+Ar,$r="Firefox",Nr=$r+" "+gr,qr="Nintendo",jr="PlayStation",Br="Xbox",Hr=mr+" "+pr,Ur=pr+" "+kr,zr="Windows",Wr=zr+" Phone",Vr="Nokia",Zr="Ouya",Gr="Generic",Qr=Gr+" "+pr.toLowerCase(),Jr=Gr+" "+yr.toLowerCase(),Kr="Konqueror",Yr="Oculus Browser",Xr="Vivaldi",tn="Yandex",en="Whale",rn="DuckDuckGo",nn="Pale Moon",sn="Waterfox",an="Brave",on="Google Search App",ln="(\\d+(\\.\\d+)?)",un=new RegExp("Version/"+ln),hn=new RegExp(Br,"i"),dn=new RegExp(jr+" \\w+","i"),vn=new RegExp(qr+" \\w+","i"),cn=new RegExp(Sr+"|PlayBook|BB10","i"),fn={"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"},pn=function(t,e,i,r){e=e||"";var n=function(t){return null!=t&&t.brave?an:null}(i);return n||(null!=r&&r.detectGoogleSearchApp&&Ni(t,"GSA/")?on:Ni(t," OPR/")&&Ni(t,"Mini")?Fr:Ni(t," OPR/")?Or:cn.test(t)?Sr:Ni(t,"IE"+pr)||Ni(t,"WPDesktop")?Lr:Ni(t,"OculusBrowser")?Yr:Ni(t,Mr)?Tr:Ni(t,Ar)||Ni(t,"Edg/")?Dr:Ni(t,Xr+"/")?Xr:Ni(t,"YaBrowser/")?tn:Ni(t,en+"/")?en:Ni(t,rn+"/")||Ni(t,"Ddg/")?rn:Ni(t,"FBIOS")?"Facebook "+pr:Ni(t,"UCWEB")||Ni(t,"UCBrowser")?"UC Browser":Ni(t,"CriOS")?Pr:Ni(t,"CrMo")||Ni(t,Er)?Er:Ni(t,mr)&&Ni(t,kr)?Hr:Ni(t,"FxiOS")?Nr:Ni(t.toLowerCase(),Kr.toLowerCase())?Kr:Ni(t,an+"/")?an:((t,e)=>e&&Ni(e,wr)||function(t){return Ni(t,kr)&&!Ni(t,Er)&&!Ni(t,mr)}(t))(t,e)?Ni(t,pr)?Ur:kr:Ni(t,"PaleMoon/")?nn:Ni(t,sn+"/")?sn:Ni(t,$r)?$r:Ni(t,"MSIE")||Ni(t,"Trident/")?Rr:Ni(t,"Gecko")?$r:"")},gn={[Lr]:[new RegExp("rv:"+ln)],[Dr]:[new RegExp(Ar+"?\\/"+ln)],[Er]:[new RegExp("("+Er+"|CrMo)\\/"+ln)],[Pr]:[new RegExp("CriOS\\/"+ln)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ln)],[kr]:[un],[Ur]:[un],[Or]:[new RegExp("(Opera|OPR)\\/"+ln)],[$r]:[new RegExp($r+"\\/"+ln)],[Nr]:[new RegExp("FxiOS\\/"+ln)],[Kr]:[new RegExp("Konqueror[:/]?"+ln,"i")],[Sr]:[new RegExp(Sr+" "+ln),un],[Hr]:[new RegExp("android\\s"+ln,"i")],[Tr]:[new RegExp(Mr+"\\/"+ln)],[Yr]:[new RegExp("OculusBrowser\\/"+ln)],[Xr]:[new RegExp(Xr+"\\/"+ln)],[tn]:[new RegExp("YaBrowser\\/"+ln)],[en]:[new RegExp(en+"\\/"+ln)],[an]:[new RegExp(an+"\\/"+ln)],[rn]:[new RegExp("(DuckDuckGo|Ddg)\\/"+ln)],[nn]:[new RegExp("PaleMoon\\/"+ln)],[sn]:[new RegExp(sn+"\\/"+ln)],[on]:[new RegExp("GSA\\/"+ln)],[Rr]:[new RegExp("(rv:|MSIE )"+ln)],Mozilla:[new RegExp("rv:"+ln)]},mn=function(t,e,i,r){var n=pn(t,e,i,r),s=gn[n];if(Qi(s))return null;for(var a=0;s.length>a;a++){var o=t.match(s[a]);if(o)return parseFloat(o[o.length-2])}return null},yn=[[new RegExp(Br+"; "+Br+" (.*?)[);]","i"),t=>[Br,t&&t[1]||""]],[new RegExp(qr,"i"),[qr,""]],[new RegExp(jr,"i"),[jr,""]],[cn,[Sr,""]],[new RegExp(zr,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Wr,""];if(new RegExp(pr).test(e)&&!/IEMobile\b/.test(e))return[zr+" "+pr,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=fn[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[zr,r]}return[zr,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[gr,[t[3],t[4],t[5]||"0"].join(".")]:[gr,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=Qi(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+mr+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+mr+")","i"),t=>t&&t[2]?[mr,[t[2],t[3],t[4]||"0"].join(".")]:[mr,""]],[/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/,[Ir,""]],[/Linux|debian/i,["Linux",""]]],bn=function(t){return vn.test(t)?qr:dn.test(t)?jr:hn.test(t)?Br:new RegExp(Zr,"i").test(t)?Zr:new RegExp("("+Wr+"|WPDesktop)","i").test(t)?Wr:/iPad/.test(t)?_r:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?xr:cn.test(t)?Sr:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Vr,"i").test(t)?Vr:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(pr).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?mr:br:new RegExp("(pda|"+pr+")","i").test(t)?Qr:new RegExp(yr,"i").test(t)&&!new RegExp(yr+" pc","i").test(t)?Jr:""},_n=function(t,e){var i,r,n,s,a=bn(t);return a===_r||a===br||"Kobo"===a||"Kindle Fire"===a||a===Jr?yr:a===qr||a===Br||a===jr||a===Zr?"Console":a===xr?"Wearable":a?pr:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(i=null==e?void 0:e.maxTouchPoints)&&void 0!==i?i:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(n=null==e?void 0:e.screenHeight)&&void 0!==n?n:0)/(null!==(s=null==e?void 0:e.devicePixelRatio)&&void 0!==s?s:1)?pr:yr:"Desktop"},wn=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function xn(t,e){return"string"==typeof(i=t)&&wn.test(i)?t:e();var i}function kn(t){return t?t.split("#")[0]:t}function Sn(t,e){var i=setTimeout(t,e);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function Cn(t,e,i){return Mn.apply(this,arguments)}function Mn(){return(Mn=e((function*(t,e,i){var r;try{return yield Promise.race([t,new Promise(((t,n)=>{r=Sn((()=>{try{null==i||i(),t()}catch(t){n(t)}}),e)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}var Tn=t=>t instanceof Error,En={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}},In=En.info;function Pn(t){if(ir(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(Wi(t))return{arrayValue:{values:t.map((t=>Pn(t)))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}function Rn(t){var e=[];for(var i in t){var r=t[i];Yi(r)||Qi(r)||e.push({key:i,value:Pn(r)})}return e}function Ln(t,e){var r=En[t.level||"info"]||In,n=r.text,s=r.number,a=String(Date.now())+"000000",o={};e.distinctId&&(o.posthogDistinctId=e.distinctId),e.sessionId&&(o.sessionId=e.sessionId),e.windowId&&(o["window.id"]=e.windowId),Xi(e.sessionStartTimestamp)||(o.sessionStartTimestamp=String(e.sessionStartTimestamp)),Xi(e.lastActivityTimestamp)||(o.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(o["url.full"]=e.currentUrl),e.screenName&&(o["screen.name"]=e.screenName),e.appState&&(o["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(o.feature_flags=e.activeFeatureFlags);var l=i({},o,t.attributes||{}),u={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:s,severityText:n,body:{stringValue:t.body},attributes:Rn(l)};return t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),Qi(t.trace_flags)||(u.flags=t.trace_flags),u}function On(t,e,r){return i({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":r})}function Fn(t,e,i,r){return{resourceLogs:[{resource:{attributes:Rn(e)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}}let An=class{constructor(t,e,i,r,n,s,a){var o;void 0===s&&(s=()=>Promise.resolve()),this._instance=t,this.Pe=e,this.rt=i,this.ut=r,this.ht=n,this.dt=s,this.vt=a,this.ct=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.xt=e.maxBufferSize,this.kt=Math.max(null!==(o=e.maxQueueSize)&&void 0!==o?o:e.maxBufferSize,e.maxBufferSize),this.St=e.flushIntervalMs,this.Ct=e.maxBatchRecordsPerPost,this.Mt=e.rateCapWindowMs,this.Tt=e.maxLogsPerInterval}reset(){this.Et(),this.ct=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Pe.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.It()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=t&&t.body){var e=this.Pt(t);if(null!==e)if(e.body){if(this.Rt()){var i={record:Ln(e,this.ut())};this.ht((()=>this.Lt(i)))}}else this.rt.info("Log was rejected in beforeSend function")}}Pt(t){var e=this.Pe.beforeSend;if(!e)return t;var i=Wi(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.rt.info("Log was rejected in beforeSend function"),null;r=s}catch(t){return this.rt.error("Error in beforeSend function for log:",t),null}return r}Rt(){if(void 0===this.Tt)return!0;var t=Date.now(),e=t-this.bt;return this.Mt>e&&e>=0||(this.bt=t,this._t=0,this.wt=!1),this.Tt>this._t?(this._t++,!0):(this.wt||(this.rt.warn("captureLog dropping logs: exceeded "+this.Tt+" logs per "+this.Mt+"ms"),this.wt=!0),!1)}flush(){var t=this;return e((function*(){if(!t._instance.isDisabled)return t.ct||(t.ct=t.Ot().finally((()=>{t.ct=null}))),t.ct}))()}Ot(){var t=this;return e((function*(){var e;t.Et();var i=null!==(e=t._instance.getPersistedProperty(ki.LogsQueue))&&void 0!==e?e:[];if(0!==i.length)for(var r=i.length,n=0;i.length>0&&r>n;){var s,a;t.ft=0;var o=Math.min(i.length,t.Ct),l=i.slice(0,o),u=l.map((t=>t.record)),h=Fn(u,t.Ft(),null!==(s=t.vt)&&void 0!==s?s:t._instance.getLibraryId(),t._instance.getLibraryVersion()),d=yield t._instance.At(h);if("too-large"===d.kind&&l.length>1)t.Ct=Math.max(1,Math.floor(l.length/2)),t.rt.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+t.Ct);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?t.rt.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&t.Pe.maxBatchRecordsPerPost>t.Ct&&(t.Ct=Math.min(t.Pe.maxBatchRecordsPerPost,t.Ct+1)),yield t.Dt(l.length),i=null!==(a=t._instance.getPersistedProperty(ki.LogsQueue))&&void 0!==a?a:[],n+=l.length,"fatal"===d.kind)throw d.error}}}))()}Dt(t){var i=this;return e((function*(){var e,r=Math.max(0,t-i.ft),n=null!==(e=i._instance.getPersistedProperty(ki.LogsQueue))&&void 0!==e?e:[];i._instance.setPersistedProperty(ki.LogsQueue,n.slice(r)),yield i.dt()}))()}Ft(){return On(this.Pe,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Lt(t){var e;if(!this._instance.optedOut){var i=null!==(e=this._instance.getPersistedProperty(ki.LogsQueue))&&void 0!==e?e:[];this.kt>i.length||(i.shift(),this.ft++,this.rt.info("Logs queue is full, dropping oldest record.")),i.push(t),this._instance.setPersistedProperty(ki.LogsQueue,i),this.xt>i.length?this.$t():this.It()}}$t(t){void 0===t&&(t=this.St),this.Nt||(this.Nt=Sn((()=>{this.Nt=void 0,this.It()}),t))}qt(){var t=Math.min(Math.max(0,this.yt-1),6);return this.St*Math.pow(2,t)}jt(){var t=this._instance.getPersistedProperty(ki.LogsQueue);return!!t&&t.length>0}shutdown(t){var i=this;return e((function*(){i.Et();var e=i.flush().catch((()=>{}));void 0!==t?yield Cn(e,t):yield e}))()}flushWithTimeout(t){var i=this;return e((function*(){var e=i.flush();yield Cn(e,t,(()=>{e.catch((()=>{}))}))}))()}It(){this.flush().then((()=>{this.yt=0}),(t=>{this.yt++,this.rt.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.jt()&&this.$t(this.qt())}))}Et(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}};var Dn=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function $n(t){return String(t)+"000000"}function Nn(t,e,i,r){var n="";return r&&(n=Object.keys(r).sort().map((t=>JSON.stringify(t)+":"+JSON.stringify(r[t]))).join(",")),t+"\0"+e+"\0"+(null!=i?i:"")+"\0"+n}let qn=class{constructor(t,e,i){this._instance=t,this.Pe=e,this.rt=i,this.Bt=new Map,this.ct=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Wt=0}count(t,e,i){void 0===e&&(e=1),this.Vt({name:t,type:"count",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(t,e,i){this.Vt({name:t,type:"gauge",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(t,e,i){this.Vt({name:t,type:"histogram",value:e,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var t=this,i=this.ct,r=function(){var r=e((function*(){i&&(yield i.catch((()=>{}))),yield t.Zt()}));return function(){return r.apply(this,arguments)}}(),n=r().finally((()=>{this.ct===n&&(this.ct=null)}));return this.ct=n,n}drainWindow(){if(0===this.Bt.size)return null;var t=this.Bt;return this.Bt=new Map,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Gt(t)}reset(){this.Wt++,this.Et(),this.Bt=new Map,this.ct=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set}Vt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Pt(t);if(null!==e)if(e.name&&"string"==typeof e.name)if("number"==typeof e.value&&Number.isFinite(e.value))if("count"===e.type&&0>e.value)this.rt.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var r,n;try{r=e.attributes?i({},e.attributes):void 0,n=Nn(e.type,e.name,e.unit,r)}catch(t){return void this.rt.warn("Dropping metric '"+e.name+"': attributes could not be serialized",t)}var s=this.Bt.get(n);if(!s){if(!this.Qt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:r,windowStartMs:Date.now()},this.Bt.set(n,s)}var a=this.Ut.get(e.name);void 0===a?this.Ut.set(e.name,e.type):a===e.type||this.zt.has(e.name)||(this.zt.add(e.name),this.rt.warn("Metric name '"+e.name+"' is already used as a "+a+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Jt(s,e.value),this.$t()}else this.rt.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.rt.warn("Dropping metric with empty name")}}Qt(){return this.Pe.maxSeriesPerFlush>this.Bt.size||(this.Ht||(this.Ht=!0,this.rt.warn("Metric series cap reached ("+this.Pe.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Jt(t,e){var i;switch(t.type){case"count":t.total=(null!==(i=t.total)&&void 0!==i?i:0)+e;break;case"gauge":t.last=e;break;case"histogram":t.hist||(t.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(Dn.length+1).fill(0)});var r=t.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[function(t,e){for(var i=0;e.length>i;i++)if(e[i]>=t)return i;return e.length}(e,Dn)]+=1}}Pt(t){var e=this.Pe.beforeSend;if(!e)return t;var i=Wi(e)?e:[e],r=t;for(var n of i)try{var s=n(r);if(!s)return this.rt.info("Metric was rejected in beforeSend function"),null;r=s}catch(t){return this.rt.error("Error in beforeSend function for metric:",t),null}return r}$t(){this.Nt||(this.Nt=Sn((()=>{this.Nt=void 0,this.flush().catch((t=>{this.rt.error("Metrics flush failed:",t)}))}),this.Pe.flushIntervalMs))}Et(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}Zt(){var t=this;return e((function*(){if(0!==t.Bt.size){var e=t.Bt;t.Bt=new Map,t.Ht=!1,t.Ut=new Map,t.zt=new Set;var i=t.Wt,r=yield t._instance.Kt(t.Gt(e));if(i===t.Wt)switch(r.kind){case"ok":return;case"retry-later":return t.Yt(e),void t.$t();case"too-large":return void t.rt.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.rt.error("Failed to send metrics batch:",r.error)}}}))()}Gt(t){return e=this.Xt(t),r=function(t,e,r){return i({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":r})}(this.Pe,this._instance.getLibraryId(),this._instance.getLibraryVersion()),n=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Rn(r)},scopeMetrics:[{scope:{name:n,version:s},metrics:e}]}]};var e,r,n,s}Xt(t){var e=$n(Date.now()),r=new Map;for(var n of t.values()){var s,a=Nn(n.type,n.name,n.unit,void 0),o=r.get(a);o||(o=i({name:n.name},n.unit&&{unit:n.unit}),"count"===n.type?o.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===n.type?o.gauge={dataPoints:[]}:o.histogram={aggregationTemporality:1,dataPoints:[]},r.set(a,o));var l=Rn(null!==(s=n.attributes)&&void 0!==s?s:{}),u=$n(n.windowStartMs);if("count"===n.type){var h,d={attributes:l,startTimeUnixNano:u,timeUnixNano:e,asDouble:null!==(h=n.total)&&void 0!==h?h:0};o.sum.dataPoints.push(d)}else if("gauge"===n.type){var v,c={attributes:l,timeUnixNano:e,asDouble:null!==(v=n.last)&&void 0!==v?v:0};o.gauge.dataPoints.push(c)}else n.hist&&o.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:e,count:n.hist.count,sum:n.hist.sum,min:n.hist.min,max:n.hist.max,bucketCounts:n.hist.bucketCounts,explicitBounds:Dn})}return Array.from(r.values())}Yt(t){var e,i;for(var r of t){var n=r[0],s=r[1],a=this.Bt.get(n);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,s.windowStartMs),a.type){case"count":a.total=(null!==(e=a.total)&&void 0!==e?e:0)+(null!==(i=s.total)&&void 0!==i?i:0);break;case"gauge":break;case"histogram":if(s.hist)if(a.hist){a.hist.count+=s.hist.count,a.hist.sum+=s.hist.sum,a.hist.min=Math.min(a.hist.min,s.hist.min),a.hist.max=Math.max(a.hist.max,s.hist.max);for(var o=0;a.hist.bucketCounts.length>o;o++)a.hist.bucketCounts[o]+=s.hist.bucketCounts[o]}else a.hist=s.hist}else this.Qt()&&this.Bt.set(n,s)}}};function jn(t,e){if(t){var i=t.find((t=>t.type===e));return null==i?void 0:i.value}}var Bn,Hn,Un;function zn(t){var e=globalThis._posthogChunkIds;if(e){var i=Object.keys(e);return Un&&i.length===Hn||(Hn=i.length,Un=i.reduce(((i,r)=>{Bn||(Bn={});var n=Bn[r];if(n)i[n[0]]=n[1];else for(var s=t(r),a=s.length-1;a>=0;a--){var o=s[a],l=null==o?void 0:o.filename,u=e[r];if(l&&u){i[l]=u,Bn[r]=[l,u];break}}return i}),{})),Un}}class Wn{constructor(t,e,i){void 0===i&&(i=[]),this.coercers=t,this.stackParser=e,this.modifiers=i}buildFromUnknown(t,e){void 0===e&&(e={});var i=e&&e.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,e,0).apply(t),n=this.buildParsingContext(e),s=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(s,i),$exception_level:"error"}}modifyFrames(t){var i=this;return e((function*(){for(var e of t)e.stacktrace&&e.stacktrace.frames&&Wi(e.stacktrace.frames)&&(e.stacktrace.frames=yield i.applyModifiers(e.stacktrace.frames));return t}))()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,e){var r,n;return null!=t.cause&&(r=this.parseStacktrace(t.cause,e)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?e.skipFirstLines:0),e.chunkIdMap)),i({},t,{cause:r,stack:n})}applyChunkIds(t,e){return t.map((t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t)))}applyCoercers(t,e){for(var i of this.coercers)if(i.match(t))return i.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var i=this;return e((function*(){var e=t;for(var r of i.modifiers)e=yield r(e);return e}))()}convertToExceptionList(t,e){var r,n,s,a={type:t.type,value:t.value,mechanism:{type:null!==(r=e.type)&&void 0!==r?r:"generic",handled:null===(n=e.handled)||void 0===n||n,synthetic:null!==(s=t.synthetic)&&void 0!==s&&s}};t.stack&&(a.stacktrace={type:"raw",frames:t.stack});var o=[a];return null!=t.cause&&o.push(...this.convertToExceptionList(t.cause,i({},e,{handled:!0}))),o}buildParsingContext(t){var e;return{chunkIdMap:zn(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,e,r){void 0===r&&(r=0);var n=(i,r)=>{if(4>=r){var n=this.buildCoercingContext(t,e,r);return this.applyCoercers(i,n)}};return i({},e,{syntheticException:0==r?e.syntheticException:void 0,mechanism:t,apply:t=>n(t,r),next:t=>n(t,r+1)})}}var Vn="?";function Zn(t,e,i,r,n){var s={platform:t,filename:e,function:"<anonymous>"===i?Vn:i,in_app:!0};return Qi(r)||(s.lineno=r),Qi(n)||(s.colno=n),s}var Gn=(t,e)=>{var i=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return i||r?[-1!==t.indexOf("@")?t.split("@")[0]:Vn,i?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Qn=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Jn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Kn=/\((\S*)(?::(\d+))(?::(\d+))\)/,Yn=(t,e)=>{var i=Qn.exec(t);if(i)return Zn(e,i[1],Vn,+i[2],+i[3]);var r=Jn.exec(t);if(r){if(r[2]&&0===r[2].indexOf("eval")){var n=Kn.exec(r[2]);n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3])}var s=Gn(r[1]||Vn,r[2]);return Zn(e,s[1],s[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Xn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ts=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,es=(t,e)=>{var i=Xn.exec(t);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=ts.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var n=i[3],s=i[1]||Vn,a=Gn(s,n);return Zn(e,n=a[1],s=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},is=/\(error: (.*)\)/,rs=50;class ns{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var i=Ji(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:i?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return or(t,"DOMException")}isDOMError(t){return or(t,"DOMError")}}class ss{match(t){return function(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return ur(t,Error)}}(t)}coerce(t,e){return{type:this.getType(t),value:this.getMessage(t,e),stack:this.getStack(t),cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var i=t.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(t){return t.stacktrace||t.stack||void 0}}class as{constructor(){}match(t){return!!or(t,"ErrorEvent")&&(null!=t.error||this.fe(t))}coerce(t,e){var r;if(null!=t.error)return e.apply(t.error);var n=e.apply(t.message);return i({},n,{stack:null!==(r=this.pe(t))&&void 0!==r?r:n.stack,synthetic:!0})}fe(t){return Ji(t.message)&&t.message.length>0}pe(t){var e=t;if(Ji(e.filename)&&e.filename.length>0){var i,r,n=null!==(i=e.lineno)&&void 0!==i?i:0,s=null!==(r=e.colno)&&void 0!==r?r:0;return"Error\n at "+e.filename+":"+n+":"+s}}}var os=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class ls{match(t){return"string"==typeof t}coerce(t,e){var i,r=this.getInfos(t),n=r[0],s=r[1];return{type:null!=n?n:"Error",value:null!=s?s:t,stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(t){var e="Error",i=t,r=t.match(os);return r&&(e=r[1],i=r[2]),[e,i]}}var us=["fatal","error","warning","log","info","debug"];function hs(t,e){void 0===e&&(e=40);var i=Object.keys(t);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var n=i.slice(0,r).join(", ");if(e>=n.length)return r===i.length?n:n.length>e?n.slice(0,e)+"...":n}return""}class ds{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var i,r,n=this.getErrorPropertyFromObject(t);return n?e.apply(n):{type:this.getType(t),value:this.getValue(t),stack:null!==(i=this.getStack(t))&&void 0!==i?i:null==(r=e.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return lr(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var i=this.getObjectClassName(t);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+hs(t)}isSeverityLevel(t){return Ji(t)&&!Ki(t)&&us.indexOf(t)>=0}getStack(t){try{return Ji(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:Ji(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var i=t[e];if(Tn(i))return i}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}}class vs{match(t){return lr(t)}coerce(t,e){var i,r=t.constructor.name;return{type:r,value:r+" captured as exception with keys: "+hs(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class cs{match(t){return ar(t)}coerce(t,e){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}}}class fs{match(t){return or(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!lr(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 i,r=this.getUnhandledRejectionReason(t);return ar(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=e.syntheticException)?void 0:i.stack,synthetic:!0}:e.apply(r)}getUnhandledRejectionReason(t){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 ps="$message",gs="$timestamp",ms=new Set([ps,gs]),ys={enabled:!0,max_bytes:32768};function bs(t){var e;return t?{enabled:null!==(e=t.enabled)&&void 0!==e?e:ys.enabled,max_bytes:ws(t.max_bytes,ys.max_bytes)}:i({},ys)}class _s{constructor(t){this.Je=[],this.Ke=0,this.Pe=bs(t)}setConfig(t){this.Pe=bs(t),this.Xe()}add(t){var e=function(t){var e;try{e=Bi(t)}catch(t){return}try{var i=JSON.parse(e);if(!Zi(i))return;var r=i,n=r[ps],s=r[gs];if(!Ji(n)||0===n.trim().length)return;if(!Ji(s)&&!tr(s))return;return{step:r,json:e}}catch(t){return}}(t);if(e){var i=function(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var e=encodeURIComponent(t),i=0,r=0;e.length>r;r++)"%"===e[r]?(i+=1,r+=2):i+=1;return i}(e.json);i>this.Pe.max_bytes||(this.Je.push({step:e.step,bytes:i}),this.Ke+=i,this.Xe())}}getAttachable(){return this.Je.map((t=>t.step))}clear(){this.Je=[],this.Ke=0}size(){return this.Je.length}Xe(){for(;this.Ke>this.Pe.max_bytes&&this.Je.length>0;){var t=this.Je.shift();t&&(this.Ke-=t.bytes)}}}function ws(t,e){if(!tr(t)||t===1/0||t===-1/0)return e;var i=Math.floor(t);return 0>i?e:i}var xs="undefined"!=typeof window?window:void 0,ks="undefined"!=typeof globalThis?globalThis:xs,Ss=null==ks?void 0:ks.navigator,Cs=null==ks?void 0:ks.document,Ms=null==ks?void 0:ks.location,Ts=null==ks?void 0:ks.fetch,Es=null!=ks&&ks.XMLHttpRequest&&"withCredentials"in new ks.XMLHttpRequest?ks.XMLHttpRequest:void 0,Is=null==ks?void 0:ks.AbortController,Ps=null==ks?void 0:ks.CompressionStream,Rs=null==Ss?void 0:Ss.userAgent;function Ls(){return!(!xs||!1===xs.navigator.onLine)}var Os=t=>"undefined"!=typeof Document&&t instanceof Document,Fs={DEBUG:!1,LIB_VERSION:"0.3.1",LIB_NAME:"browser-common"},As=function(t,e){var i=(void 0===e?{}:e).debugEnabled,r={k(e){if(xs&&(Fs.DEBUG||xs.POSTHOG_DEBUG||i)&&!Qi(xs.console)&&xs.console){for(var r=("__rrweb_original__"in xs.console[e]?xs.console[e].__rrweb_original__:xs.console[e]),n=arguments.length,s=new Array(n>1?n-1:0),a=1;n>a;a++)s[a-1]=arguments[a];r(t,...s)}},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.k("error",...e)},critical(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning(t){r.error("You must initialize PostHog before calling "+t)},createLogger:(e,i)=>As(t+" "+e,i)};return r},Ds=As("[PostHog.js]"),$s=Ds.createLogger;function Ns(t,e){Wi(t)&&t.forEach(e)}function qs(t,e){if(!Xi(t))if(Wi(t))t.forEach(e);else if(rr(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)Ui.call(t,i)&&e(t[i],i)}var js=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];for(var n of i)for(var s in n)void 0!==n[s]&&(t[s]=n[s]);return t};function Bs(t){for(var e=Object.keys(t),i=e.length,r=new Array(i);i--;)r[i]=[e[i],t[e[i]]];return r}var Hs=function(t){try{return t()}catch(t){return}},Us=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){Ds.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Ds.critical(t)}}},zs=function(t){var e={};return qs(t,(function(t,i){(Ji(t)&&t.length>0||tr(t))&&(e[i]=t)})),e};var Ws=["herokuapp.com","vercel.app","netlify.app"];function Vs(t){var e=null==t?void 0:t.hostname;if(!Ji(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Ws)if(i===r)return!1;return!0}function Zs(t,e,i,r){var n=null!=r?r:{},s=n.capture,a=n.passive;null==t||t.addEventListener(e,i,{capture:void 0!==s&&s,passive:void 0===a||a})}function Gs(t){return"ph_toolbar_internal"===t.name}var Qs=(t,e)=>{try{return JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e)}catch(e){return Bi(t)}},Js=t=>{var e=null==Cs?void 0:Cs.createElement("a");return Qi(e)?null:(e.href=t,e)},Ks=function(t,e){var i,r;void 0===e&&(e="&");var n=[];return qs(t,(function(t,e){Qi(t)||Qi(e)||"undefined"===e||(i=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(e),n[n.length]=r+"="+i)})),n.join(e)},Ys=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),n=0;r.length>n;n++){var s=r[n].split("=");if(s[0]===e){i=s;break}}if(!Wi(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(t){Ds.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Xs=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),n=r[1],s=(r[0]||"").split("?"),a=s[1],o=s[0],l=(a||"").split("&"),u=[],h=0;l.length>h;h++){var d=l[h].split("=");Wi(d)&&(e.includes(d[0])?u.push(d[0]+"="+i):u.push(l[h]))}var v=o;return null!=a&&(v+="?"+u.join("&")),null!=n&&(v+="#"+n),v},ta=function(t,e){var i=t.match(new RegExp(e+"=([^&]*)"));return i?i[1]:null},ea=(t,e)=>t>=e&&Ls(),ia=(t,e,i,r)=>{if(0===t){if(Ls()){var n=e+1;return n===i&&r(),n}return e}return 0},ra=()=>{};function na(t,e,i){try{if(!(e in t))return ra;var r={next:t[e]},n=i((function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];return r.next.apply(this,e)}));return Vi(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),t[e]=n,()=>{if(t[e]!==n)for(var i=t[e];Vi(i)&&i.__posthog_layer__;){var s=i.__posthog_layer__;if(s.next===n)return void(s.next=r.next);i=s.next}else t[e]=r.next}}catch(t){return ra}}function sa(t,e){var i,r=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:r,isHostDenied:!1};if(null==(i=e.payloadHostDenyList)||!i.length||null==r||!r.trim().length)return n;for(var s of e.payloadHostDenyList)if(r.endsWith(s))return{hostname:r,isHostDenied:!0};return n}function aa(t,e){var i,r=null==t||null==(i=t.config)?void 0:i.get_current_url;if(!Vi(r))return e;try{var n=r(e);return Ji(n)&&n?n:e}catch(t){return Ds.error("Error in get_current_url, falling back to window.location.href",t),e}}function oa(t){var e,i=null==xs||null==(e=xs.location)?void 0:e.href;return Qi(i)?void 0:aa(t,i)}var la="__POSTHOG_TOOLBAR__",ua=1,ha=3,da=11;function va(t){return t instanceof Element&&(t.id===la||!(null==t.closest||!t.closest(".toolbar-global-fade-container")))}function ca(t){return!!t&&t.nodeType===ua}function fa(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function pa(t){return!!t&&t.nodeType===ha}function ga(t){return!!t&&t.nodeType===da&&ca(t.host)}var ma=1e3;function ya(t){return t?qi(t).split(/\s+/):[]}function ba(t,e){var i=oa(e);return!!(i&&t&&t.some((t=>i.match(t))))}function _a(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 ya(e)}function wa(t){return Xi(t)?null:qi(t).split(/(\s+)/).filter((t=>Va(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function xa(t){var e="";return $a(t)&&!Na(t)&&t.childNodes&&t.childNodes.length&&qs(t.childNodes,(function(t){var i;pa(t)&&t.textContent&&(e+=null!==(i=wa(t.textContent))&&void 0!==i?i:"")})),qi(e)}function ka(t){var e;return Qi(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var Sa=["a","button","form","input","select","textarea","label"];function Ca(t,e){if(Qi(e))return!0;var i,r=function(t){if(e.some((e=>function(t,e){var i=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!i&&i.call(t,e)}catch(t){return!1}}(t,e))))return{v:!0}};for(var n of t)if(i=r(n))return i.v;return!1}function Ma(t){var e=t.parentNode;return!(!e||!ca(e))&&e}var Ta=[".ph-no-autocapture","[data-ph-no-autocapture]"],Ea=["next","previous","prev",">","<"],Ia=[...Ea,"+","-","−","–"],Pa=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,Ra=[".ph-no-deadclick",".ph-no-capture"],La=[".ph-no-rageclick",".ph-no-capture"],Oa=["","text","search","email","password","url","tel","number"];function Fa(t,e){if(!xs||Aa(t))return!1;var i,r,n,s,a;if(ir(e)?(i=!!e&&La,r=void 0,n=!1):(i=null!==(s=null==e?void 0:e.css_selector_ignorelist)&&void 0!==s?s:La,r=null==e?void 0:e.content_ignorelist,n=null!==(a=null==e?void 0:e.ignore_text_selection)&&void 0!==a&&a),!1===i)return!1;if(n&&function(t){return!(!t||!ca(t))&&(!!fa(t,"textarea")||(fa(t,"input")?Ni(Oa,(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 o=Da(t,!1).targetElementList;return!function(t,e){if(!1===t||Qi(t))return!1;var i;if(!0===t)i=Ea;else{if(!Wi(t))return!1;if(t.length>10)return Ds.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=t.map((t=>t.toLowerCase()))}return e.some((t=>{var e=t.safeText,r=t.ariaLabel;return i.some((t=>Pa(e,t)||Pa(r,t)))}))}(r,o.map((t=>{var e;return{safeText:xa(t).toLowerCase(),ariaLabel:(null==(e=t.getAttribute("aria-label"))?void 0:e.toLowerCase().trim())||""}})))&&!Ca(o,i)}var Aa=t=>!t||fa(t,"html")||!ca(t),Da=(t,e)=>{if(!xs||Aa(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[t],n=t;n.parentNode&&!fa(n,"body");)if(ga(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var s=Ma(n);if(!s)break;if(e||Sa.indexOf(s.tagName.toLowerCase())>-1)i=!0;else try{var a=xs.getComputedStyle(s);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}catch(t){}r.push(s),n=s}return{parentIsUsefulElement:i,targetElementList:r}};function $a(t){for(var e=new Set,i=0,r=t;r.parentNode&&!fa(r,"body");r=r.parentNode){if(i++>=ma||e.has(r))return!1;e.add(r);var n=_a(r);if(Ni(n,"ph-sensitive")||Ni(n,"ph-no-capture"))return!1}if(Ni(_a(t),"ph-include"))return!0;var s=t.type||"";if(Ji(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!Ji(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function Na(t){return!!(fa(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||fa(t,"select")||fa(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var qa=new RegExp("^(?:(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}))$"),ja=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Ba=[16,15,14,13],Ha=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Ua=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),za=/[0-9A-Za-z_]/;function Wa(t){for(var e=0,i=!1,r=t.length-1;r>=0;r--){var n=t.charCodeAt(r)-48;i&&(n*=2)>9&&(n-=9),e+=n,i=!i}return e%10==0}function Va(t,e){if(void 0===e&&(e=!0),Xi(t))return!1;if(Ji(t)){t=qi(t);var i=e?qa.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(ja.lastIndex=0;e=ja.exec(t);){var i=e[2];if(i)for(var r=i.replace(/[- ]/g,""),n=0;r.length>n;n++)for(var s of Ba){var a=n+s;if(r.length>=a){var o=r.slice(n,a);if(qa.test(o)&&Wa(o))return!0}}}return!1}(t);if(i)return!1;var r=e?Ha.test(t):function(t){var e;for(Ua.lastIndex=0;e=Ua.exec(t);){var i=e[1],r=e[3];if(!(i&&r&&za.test(i)&&za.test(r)))return!0}return!1}(t);if(r)return!1}return!0}function Za(t){var e=xa(t);return Va(e=(e+" "+Ga(t)).trim())?e:""}function Ga(t){var e="";return t&&t.childNodes&&t.childNodes.length&&qs(t.childNodes,(function(t){var i;if(t&&"span"===(null==(i=t.tagName)?void 0:i.toLowerCase()))try{var r=xa(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Ga(t)).trim())}catch(t){Ds.error("[AutoCapture]",t)}})),e}function Qa(t){return t.replace(/"|\\"/g,'\\"')}function Ja(t){var e=t.attr__class;if(e)return Wi(e)?e:ya(e)}var Ka=1e6,Ya={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Ka,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","google-analytics.com","analytics.google.com","nr-data.net","datadoghq.com","datadoghq.eu","ddog-gov.com","segment.io","rudderstack.com","amplitude.com","mixpanel.com","hotjar.com","hotjar.io","fullstory.com"],streamNetworkBody:!1},Xa=$s("[Recorder]"),to=t=>"navigation"===t.entryType,eo=t=>"resource"===t.entryType;function io(t,e){return!!e&&(ir(e)||e[t])}function ro(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var no=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function so(t){var e=t.type,i=t.recordBody,r=t.headers;function n(t){var e=Object.keys(r).find((t=>"content-type"===t.toLowerCase())),i=e&&r[e];return t.some((t=>null==i?void 0:i.toLowerCase().includes(t)))}if(!i)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!ro(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(no))return!1;if(ir(i))return!0;if(Wi(i))return n(i);var s=i[e];return ir(s)?s:n(s)}function ao(t,e,i,r,n,s){return oo.apply(this,arguments)}function oo(){return oo=e((function*(t,e,i,r,n,s){if(void 0===s&&(s=0),s>10)return Xa.warn("Failed to get performance entry for request",{url:i,initiatorType:e}),null;var a=function(t,i){for(var s=t.length-1;s>=0;s-=1)if(eo(a=t[s])&&a.initiatorType===e&&(Qi(r)||a.startTime>=r)&&(Qi(n)||n>=a.startTime))return t[s];var a}(t.performance.getEntriesByName(i));return a||(yield new Promise((t=>setTimeout(t,50*s))),ao(t,e,i,r,n,s+1))})),oo.apply(this,arguments)}function lo(t){var e=t.body,i=t.options,r=t.url;if(Xi(e))return null;var n=sa(r,i);if(n.isHostDenied)return n.hostname+" is in deny list";if(Ji(e))return e;if(Os(e))return e.textContent;if(rr(e))return Ks(e);if(Zi(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 uo=t=>!Yi(t)&&("navigation"===t.entryType||"resource"===t.entryType);function ho(t){var e=t.entry,r=t.method,n=t.status,s=t.networkRequest,a=t.isInitial,o=t.start,l=t.end,u=t.url,h=t.initiatorType;o=e?e.startTime:o,l=e?e.responseEnd:l;var d=Math.floor(Date.now()-performance.now()),v=Math.floor(d+(o||0)),c=[i({},e?e.toJSON():{name:u},{startTime:Qi(o)?void 0:Math.round(o),endTime:Qi(l)?void 0:Math.round(l),timeOrigin:d,timestamp:v,method:r,initiatorType:h||(e?e.initiatorType:void 0),status:n,requestHeaders:s.requestHeaders,requestBody:s.requestBody,responseHeaders:s.responseHeaders,responseBody:s.responseBody,isInitial:a})];if(uo(e))for(var f of e.serverTiming||[])c.push({timeOrigin:d,timestamp:v,startTime:Math.round(e.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return c}var vo=["video/","audio/"];function co(t){return Zi(t)&&Vi(t.getReader)&&Vi(t.tee)}var fo=500,po="[SessionReplay] Timeout while trying to read body",go="[SessionReplay] Failed to read body";function mo(t){return go+": "+t}function yo(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function bo(t,e){if(!e.streamNetworkBody)return function(t){return new Promise((e=>{var i=setTimeout((()=>e(po)),fo);try{t.clone().text().then((t=>e(t)),(t=>e(mo(t)))).finally((()=>clearTimeout(i)))}catch(t){clearTimeout(i),e(go)}}))}(t);var i=function(t){var e;return Math.min(Ka,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:Ka)}(e);return function(t,e){try{var i,r=null==(i=t.headers)||null==i.get?void 0:i.get("content-length");if(!r)return!1;var n=parseInt(r,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,i)?Promise.resolve(yo(i)):function(t,e){return new Promise((i=>{var r,n=!1;function s(){try{var t;null==(t=r)||t.cancel()}catch(t){}}function a(t){n||(n=!0,clearTimeout(l),s(),i(t))}var o,l=setTimeout((()=>a(po)),fo);try{o=t.clone()}catch(t){return void a(go)}var u=o.body;if(co(u)&&"undefined"!=typeof TextDecoder){try{r=u.getReader()}catch(t){return void a(go)}var h=[],d=0;!function t(){r.read().then((i=>{var r=i.done,o=i.value;if(n)s();else if(r)a((new TextDecoder).decode(function(t,e){var i=new Uint8Array(e),r=0;for(var n of t)i.set(n,r),r+=n.byteLength;return i}(h,d)));else{if(o){if(d+o.byteLength>e)return void a(yo(e));d+=o.byteLength,h.push(o)}t()}}),(t=>a(mo(t))))}()}else try{o.text().then((t=>a(t)),(t=>a(mo(t))))}catch(t){a(go)}}))}(t,i)}function _o(){return _o=e((function*(t){var e=t.r,i=t.options,r=sa(t.url,i);return r.isHostDenied?Promise.resolve(r.hostname+" is in deny list"):bo(e,i)})),_o.apply(this,arguments)}function wo(){return wo=e((function*(t){var e=t.r,i=t.options,r=function(t){var e,i=t.r,r=t.options,n=t.url;if("chunked"===i.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var s=null==(e=i.headers.get("Content-Type"))?void 0:e.toLowerCase(),a=vo.some((t=>null==s?void 0:s.startsWith(t)));if(s&&a)return"Content-Type "+s+" is not supported";var o=sa(n,r);return o.isHostDenied?o.hostname+" is in deny list":null}({r:e,options:i,url:t.url});return Yi(r)?bo(e,i):Promise.resolve(r)})),wo.apply(this,arguments)}var xo=null;function ko(t,r,n){if(!("performance"in r))return()=>{};if(xo)return Xa.warn("Network observer already initialised, doing nothing"),()=>{};var s=n?Object.assign({},Ya,n):Ya,a=e=>{var r=[],n=!1;e.requests.forEach((t=>{var e="serverTiming"===t.entryType;if(!e||!n){var i=s.maskRequestFn(t);e||(n=!i),i&&r.push(i)}})),r.length>0&&t(i({},e,{requests:r}))},o=function(t,e,i){if(i.recordInitialRequests){var r=e.performance.getEntries().filter((t=>to(t)||eo(t)&&i.initiatorTypes.includes(t.initiatorType)));t({requests:r.flatMap((t=>ho({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0}))),isInitial:!0})}var n=new e.PerformanceObserver((e=>{var r=e.getEntries().filter((t=>to(t)||eo(t)&&i.initiatorTypes.includes(t.initiatorType)&&(t=>!i.recordBody&&!i.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)));t({requests:r.flatMap((t=>ho({entry:t,method:void 0,status:void 0,networkRequest:{}})))})})),s=PerformanceObserver.supportedEntryTypes.filter((t=>i.performanceEntryTypeToObserve.includes(t)));return n.observe({entryTypes:s}),()=>{n.disconnect()}}(a,r,s),l=()=>{},u=()=>{};return(s.recordHeaders||s.recordBody)&&(l=function(t,e,i){if(!i.initiatorTypes.includes("xmlhttprequest"))return()=>{};var r=io("request",i.recordHeaders),n=io("response",i.recordHeaders),s=na(e.XMLHttpRequest.prototype,"open",(s=>function(a,o,l,u,h){void 0===l&&(l=!0);var d=this;try{var v,c,f=new Request(o),p={},g={},m=d.setRequestHeader.bind(d);d.setRequestHeader=(t,e)=>(g[t]=e,m(t,e)),r&&(p.requestHeaders=g);var y=d.send.bind(d);d.send=t=>(so({type:"request",headers:g,url:o,recordBody:i.recordBody})&&(p.requestBody=lo({body:t,options:i,url:o})),v=e.performance.now(),y(t));var b=()=>{d.removeEventListener("readystatechange",_),d.removeEventListener("error",b),d.removeEventListener("abort",b),d.removeEventListener("timeout",b)},_=()=>{if(d.readyState===d.DONE){b(),c=e.performance.now();var r={};d.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{var e=t.split(": "),i=e.shift(),n=e.join(": ");i&&(r[i]=n)})),n&&(p.responseHeaders=r),so({type:"response",headers:r,url:o,recordBody:i.recordBody})&&(p.responseBody=lo({body:d.response,options:i,url:o})),ao(e,"xmlhttprequest",f.url,v,c).then((e=>{var i=ho({entry:e,method:a,status:null==d?void 0:d.status,networkRequest:p,start:v,end:c,url:o.toString(),initiatorType:"xmlhttprequest"});t({requests:i})})).catch((()=>{}))}};d.addEventListener("readystatechange",_),d.addEventListener("error",b),d.addEventListener("abort",b),d.addEventListener("timeout",b)}catch(t){Xa.error("Failed to instrument XHR for network capture",t)}s.call(d,a,o.toString(),l,u,h)}));return()=>{s()}}(a,r,s),u=function(t,i,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var n=io("request",r.recordHeaders),s=io("response",r.recordHeaders),a=na(i,"fetch",(a=>function(){var o=e((function*(e,o){var l,u;try{l=new Request(e,o)}catch(t){return Xa.error("Failed to instrument fetch for network capture",t),a(e,o)}var h,d,v={};try{try{var c={};l.headers.forEach(((t,e)=>{c[e]=t})),n&&(v.requestHeaders=c),!co(null==o?void 0:o.body)&&so({type:"request",headers:c,url:e,recordBody:r.recordBody})&&(v.requestBody=yield function(t){return _o.apply(this,arguments)}({r:l,options:r,url:e}))}catch(t){Xa.error("Failed to record fetch request for network capture",t)}h=i.performance.now(),u=ro(e)?yield a(l):yield a(e,o),d=i.performance.now();var f={};return u.headers.forEach(((t,e)=>{f[e]=t})),s&&(v.responseHeaders=f),so({type:"response",headers:f,url:e,recordBody:r.recordBody})&&(v.responseBody=yield function(t){return wo.apply(this,arguments)}({r:u,options:r,url:e})),u}finally{ao(i,"fetch",l.url,h,d).then((e=>{var i,r=ho({entry:e,method:l.method,status:null==(i=u)?void 0:i.status,networkRequest:v,start:h,end:d,url:l.url,initiatorType:"fetch"});t({requests:r})})).catch((()=>{}))}}));return function(t,e){return o.apply(this,arguments)}}()));return()=>{a()}}(a,r,s)),xo=()=>{o(),l(),u(),xo=null}}var So=t=>({name:"rrweb/network@1",observer:ko,options:t}),Co="undefined"!=typeof globalThis?globalThis:xs;Co&&"undefined"==typeof self&&(Co.self=Co),Co&&"undefined"==typeof File&&(Co.File=function(){});var Mo=null!=xs?xs:{};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:mi,getRecordNetworkPlugin:So},Mo.__PosthogExtensions__.rrweb={record:ii,version:"v2",wasMaxDepthReached:()=>Pt,resetMaxDepthState(){Pt=!1,It=!1},getLastSnapshotCost:()=>L,getMutationCost:()=>i({},A),resetSnapshotCostState(){I=0,P=0,R=T(),L=null,O=null,F=[],A={slowestBatchMs:0}}},Mo.rrweb={record:ii,version:"v2"},Mo.rrwebConsoleRecord={getRecordConsolePlugin:mi},Mo.getRecordNetworkPlugin=So;var To,Eo,Io,Po,Ro,Lo,Oo,Fo,Ao,Do,$o,No,qo,jo,Bo,Ho={},Uo=[],zo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Wo=Array.isArray;function Vo(t,e){for(var i in e)t[i]=e[i];return t}function Zo(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Go(t,e,i){var r,n,s,a={};for(s in e)"key"==s?r=e[s]:"ref"==s?n=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?To.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return Qo(t,a,r,n,null)}function Qo(t,e,i,r,n){var s={type:t,props:e,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Io:n,__i:-1,__u:0};return null==n&&null!=Eo.vnode&&Eo.vnode(s),s}function Jo(t){return t.children}function Ko(t,e){this.props=t,this.context=e}function Yo(t,e){if(null==e)return t.__?Yo(t.__,t.__i+1):null;for(var i;t.__k.length>e;e++)if(null!=(i=t.__k[e])&&null!=i.__e)return i.__e;return"function"==typeof t.type?Yo(t):null}function Xo(t){if(t.__P&&t.__d){var e=t.__v,i=e.__e,r=[],n=[],s=Vo({},e);s.__v=e.__v+1,Eo.vnode&&Eo.vnode(s),ul(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[i]:null,r,null==i?Yo(e):i,!!(32&e.__u),n),s.__v=e.__v,s.__.__k[s.__i]=s,dl(r,s,n),e.__e=e.__=null,s.__e!=i&&tl(s)}}function tl(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some((function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e})),tl(t)}function el(t){(!t.__d&&(t.__d=!0)&&Po.push(t)&&!il.__r++||Ro!=Eo.debounceRendering)&&((Ro=Eo.debounceRendering)||Lo)(il)}function il(){try{for(var t,e=1;Po.length;)Po.length>e&&Po.sort(Oo),t=Po.shift(),e=Po.length,Xo(t)}finally{Po.length=il.__r=0}}function rl(t,e,i,r,n,s,a,o,l,u,h){var d,v,c,f,p,g,m,y=r&&r.__k||Uo,b=e.length;for(l=function(t,e,i,r,n){var s,a,o,l,u,h=i.length,d=h,v=0;for(t.__k=new Array(n),s=0;n>s;s++)null!=(a=e[s])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=t.__k[s]=Qo(null,a,null,null,null):Wo(a)?a=t.__k[s]=Qo(Jo,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=t.__k[s]=Qo(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[s]=a,l=s+v,a.__=t,a.__b=t.__b+1,o=null,-1!=(u=a.__i=sl(a,i,l,d))&&(d--,(o=i[u])&&(o.__u|=2)),null==o||null==o.__v?(-1==u&&(n>h?v--:h>n&&v++),"function"!=typeof a.type&&(a.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,a.__u|=4))):t.__k[s]=null;if(d)for(s=0;h>s;s++)null!=(o=i[s])&&0==(2&o.__u)&&(o.__e==r&&(r=Yo(o)),fl(o,o));return r}(i,e,y,l,b),d=0;b>d;d++)null!=(c=i.__k[d])&&(v=-1!=c.__i&&y[c.__i]||Ho,c.__i=d,g=ul(t,c,v,n,s,a,o,l,u,h),f=c.__e,c.ref&&v.ref!=c.ref&&(v.ref&&cl(v.ref,null,c),h.push(c.ref,c.__c||f,c)),null==p&&null!=f&&(p=f),(m=!!(4&c.__u))||v.__k===c.__k?(l=nl(c,l,t,m),m&&v.__e&&(v.__e=null)):"function"==typeof c.type&&void 0!==g?l=g:f&&(l=f.nextSibling),c.__u&=-7);return i.__e=p,l}function nl(t,e,i,r){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=nl(n[s],e,i,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Yo(t)),i.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function sl(t,e,i,r){var n,s,a,o=t.key,l=t.type,u=e[i],h=null!=u&&0==(2&u.__u);if(null===u&&null==o||h&&o==u.key&&l==u.type)return i;if(r>(h?1:0))for(n=i-1,s=i+1;n>=0||e.length>s;)if(null!=(u=e[a=0>n?s++:n--])&&0==(2&u.__u)&&o==u.key&&l==u.type)return a;return-1}function al(t,e,i){"-"==e[0]?t.setProperty(e,null==i?"":i):t[e]=null==i?"":"number"!=typeof i||zo.test(e)?i:i+"px"}function ol(t,e,i,r,n){var s,a;t:if("style"==e)if("string"==typeof i)t.style.cssText=i;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)i&&e in i||al(t.style,e,"");if(i)for(e in i)r&&i[e]==r[e]||al(t.style,e,i[e])}else if("o"==e[0]&&"n"==e[1])s=e!=(e=e.replace($o,"$1")),a=e.toLowerCase(),e=a in t||"onFocusOut"==e||"onFocusIn"==e?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=i,i?r?i[Do]=r[Do]:(i[Do]=No,t.addEventListener(e,s?jo:qo,s)):t.removeEventListener(e,s?jo:qo,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==i?"":i;break t}catch(t){}"function"==typeof i||(null==i||!1===i&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==i?"":i))}}function ll(t){return function(e){if(this.l){var i=this.l[e.type+t];if(null==e[Ao])e[Ao]=No++;else if(i[Do]>e[Ao])return;return i(Eo.event?Eo.event(e):e)}}}function ul(t,e,i,r,n,s,a,o,l,u){var h,d,v,c,f,p,g,m,y,b,$,_,w,x,k,S,C=e.type;if(void 0!==e.constructor)return null;128&i.__u&&(l=!!(32&i.__u),s=[o=e.__e=i.__e]),(h=Eo.__b)&&h(e);t:if("function"==typeof C){d=a.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&r[h.__c],_=h?$?$.props.value:h.__:r,i.__c?m=(v=e.__c=i.__c).__=v.__E:(b?e.__c=v=new C(y,_):(e.__c=v=new Ko(y,_),v.constructor=C,v.render=pl),$&&$.sub(v),v.state||(v.state={}),v.__n=r,c=v.__d=!0,v.__h=[],v._sb=[]),b&&null==v.__s&&(v.__s=v.state),b&&null!=C.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=Vo({},v.__s)),Vo(v.__s,C.getDerivedStateFromProps(y,v.__s))),f=v.props,p=v.state,v.__v=e,c)b&&null==C.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),b&&null!=v.componentDidMount&&v.__h.push(v.componentDidMount);else{if(b&&null==C.getDerivedStateFromProps&&y!==f&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(y,_),e.__v==i.__v||!v.__e&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(y,v.__s,_)){e.__v!=i.__v&&(v.props=y,v.state=v.__s,v.__d=!1),e.__e=i.__e,e.__k=i.__k,e.__k.some((function(t){t&&(t.__=e)})),Uo.push.apply(v.__h,v._sb),v._sb=[],v.__h.length&&a.push(v);break t}null!=v.componentWillUpdate&&v.componentWillUpdate(y,v.__s,_),b&&null!=v.componentDidUpdate&&v.__h.push((function(){v.componentDidUpdate(f,p,g)}))}if(v.context=_,v.props=y,v.__P=t,v.__e=!1,w=Eo.__r,x=0,b)v.state=v.__s,v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),Uo.push.apply(v.__h,v._sb),v._sb=[];else do{v.__d=!1,w&&w(e),h=v.render(v.props,v.state,v.context),v.state=v.__s}while(v.__d&&25>++x);v.state=v.__s,null!=v.getChildContext&&(r=Vo(Vo({},r),v.getChildContext())),b&&!c&&null!=v.getSnapshotBeforeUpdate&&(g=v.getSnapshotBeforeUpdate(f,p)),k=null!=h&&h.type===Jo&&null==h.key?vl(h.props.children):h,o=rl(t,Wo(k)?k:[k],e,i,r,n,s,a,o,l,u),v.base=e.__e,e.__u&=-161,v.__h.length&&a.push(v),m&&(v.__E=v.__=null)}catch(t){if(a.length=d,e.__v=null,l||null!=s)if(t.then){for(e.__u|=l?160:128;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;null!=s&&(s[s.indexOf(o)]=null),e.__e=o}else{if(null!=s)for(S=s.length;S--;)Zo(s[S]);hl(e)}else e.__e=i.__e,!e.__k&&i.__k&&(e.__k=i.__k),t.then||hl(e);Eo.__e(t,e,i)}}else null==s&&e.__v==i.__v?(e.__k=i.__k,e.__e=i.__e):o=e.__e=function(t,e,i,r,n,s,a,o,l){var u,h,d,v,c,f,p,g=i.props||Ho,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(u=0;s.length>u;u++)if((c=s[u])&&"setAttribute"in c==!!y&&(y?c.localName==y:3==c.nodeType)){t=c,s[u]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),o&&(Eo.__m&&Eo.__m(e,s),o=!1),s=null}if(null==y)g===m||o&&t.data==m||(t.data=m);else{if(s="textarea"==y&&null!=m.defaultValue?null:s&&To.call(t.childNodes),!o&&null!=s)for(g={},u=0;t.attributes.length>u;u++)g[(c=t.attributes[u]).name]=c.value;for(u in g)c=g[u],"dangerouslySetInnerHTML"==u?d=c:"children"==u||u in m||"value"==u&&"defaultValue"in m||"checked"==u&&"defaultChecked"in m||ol(t,u,null,c,n);for(u in m)c=m[u],"children"==u?v=c:"dangerouslySetInnerHTML"==u?h=c:"value"==u?f=c:"checked"==u?p=c:o&&"function"!=typeof c||g[u]===c||ol(t,u,c,g[u],n);if(h)o||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),rl("template"==e.type?t.content:t,Wo(v)?v:[v],e,i,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,s,a,s?s[0]:i.__k&&Yo(i,0),o,l),null!=s)for(u=s.length;u--;)Zo(s[u]);o&&"textarea"!=y||(u="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[u]||"progress"==y&&!f||"option"==y&&f!=g[u])&&ol(t,u,f,g[u],n),u="checked",null!=p&&p!=t[u]&&ol(t,u,p,g[u],n))}return t}(i.__e,e,i,r,n,s,a,l,u);return(h=Eo.diffed)&&h(e),128&e.__u?void 0:o}function hl(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(hl))}function dl(t,e,i){for(var r=0;i.length>r;r++)cl(i[r],i[++r],i[++r]);Eo.__c&&Eo.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Eo.__e(t,e.__v)}}))}function vl(t){return"object"!=typeof t||null==t||t.__b>0?t:Wo(t)?t.map(vl):void 0!==t.constructor?null:Vo({},t)}function cl(t,e,i){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==e||(t.__u=t(e))}else t.current=e}catch(t){Eo.__e(t,i)}}function fl(t,e,i){var r,n;if(Eo.unmount&&Eo.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||cl(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){Eo.__e(t,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(n=0;r.length>n;n++)r[n]&&fl(r[n],e,i||"function"!=typeof t.type);i||Zo(t.__e),t.__c=t.__=t.__e=void 0}function pl(t,e,i){return this.constructor(t,i)}function gl(t,e,i){var r,n,s;e==document&&(e=document.documentElement),Eo.__&&Eo.__(t,e),r=e.__k,n=[],s=[],ul(e,t=e.__k=Go(Jo,null,[t]),r||Ho,Ho,e.namespaceURI,r?null:e.firstChild?To.call(e.childNodes):null,n,r?r.__e:e.firstChild,!1,s),dl(n,t,s),t.props.children=null}To=Uo.slice,Eo={__e(t,e,i,r){for(var n,s,a;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),a=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),a=n.__d),a)return n.__E=n}catch(e){t=e}throw t}},Io=0,Ko.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Vo({},this.state),"function"==typeof t&&(t=t(Vo({},i),this.props)),t&&Vo(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),el(this))},Ko.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),el(this))},Ko.prototype.render=Jo,Po=[],Lo="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Oo=function(t,e){return t.__v.__b-e.__v.__b},il.__r=0,Fo=Math.random().toString(8),Ao="__d"+Fo,Do="__a"+Fo,$o=/(PointerCapture)$|Capture$/i,No=0,qo=ll(!1),jo=ll(!0),Bo=0;var ml,yl,bl,_l,wl=0,xl=[],kl=Eo,Sl=kl.__b,Cl=kl.__r,Ml=kl.diffed,Tl=kl.__c,El=kl.unmount,Il=kl.__;function Pl(t,e){kl.__h&&kl.__h(yl,t,wl||e),wl=0;var i=yl.__H||(yl.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function Rl(t){return wl=1,function(t,e,i){var r=Pl(ml++,2);if(r.t=t,!r.__c&&(r.__=[Hl(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],i=r.t(e,t);e!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=yl,!yl.__f)){var n=function(t,e,i){if(!r.__c.__H)return!0;var n=!1,a=r.__c.props!==t;if(r.__c.__H.__.some((function(t){if(t.__N){n=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}})),s){var o=s.call(this,t,e,i);return n?o||a:o}return!n||a};yl.__f=!0;var s=yl.shouldComponentUpdate,a=yl.componentWillUpdate;yl.componentWillUpdate=function(t,e,i){if(this.__e){var r=s;s=void 0,n(t,e,i),s=r}a&&a.call(this,t,e,i)},yl.shouldComponentUpdate=n}return r.__N||r.__}(Hl,t)}function Ll(t,e){var i=Pl(ml++,3);!kl.__s&&Bl(i.__H,e)&&(i.__=t,i.u=e,yl.__H.__h.push(i))}function Ol(t){return wl=5,Fl((function(){return{current:t}}),[])}function Fl(t,e){var i=Pl(ml++,7);return Bl(i.__H,e)&&(i.__=t(),i.__H=e,i.__h=t),i.__}function Al(t){var e=yl.context[t.__c],i=Pl(ml++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(yl)),e.props.value):t.__}function Dl(){for(var t;t=xl.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(ql),e.__h.some(jl),e.__h=[]}catch(i){e.__h=[],kl.__e(i,t.__v)}}}kl.__b=function(t){yl=null,Sl&&Sl(t)},kl.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Il&&Il(t,e)},kl.__r=function(t){Cl&&Cl(t),ml=0;var e=(yl=t.__c).__H;e&&(bl===yl?(e.__h=[],yl.__h=[],e.__.some((function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0}))):(e.__h.length&&Dl(),ml=0)),bl=yl},kl.diffed=function(t){Ml&&Ml(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==xl.push(e)&&_l===kl.requestAnimationFrame||((_l=kl.requestAnimationFrame)||Nl)(Dl)),e.__H.__.some((function(t){t.u&&(t.__H=t.u,t.u=void 0)}))),bl=yl=null},kl.__c=function(t,e){e.some((function(t){try{t.__h.some(ql),t.__h=t.__h.filter((function(t){return!t.__||jl(t)}))}catch(i){e.some((function(t){t.__h&&(t.__h=[])})),e=[],kl.__e(i,t.__v)}})),Tl&&Tl(t,e)},kl.unmount=function(t){El&&El(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.some((function(t){try{ql(t)}catch(t){e=t}})),i.__H=void 0,e&&kl.__e(e,i.__v))};var $l="function"==typeof requestAnimationFrame;function Nl(t){var e,i=function(){clearTimeout(r),$l&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,35);$l&&(e=requestAnimationFrame(i))}function ql(t){var e=yl,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),yl=e}function jl(t){var e=yl;t.__c=t.__(),yl=e}function Bl(t,e){return!t||t.length!==e.length||e.some((function(e,i){return e!==t[i]}))}function Hl(t,e){return"function"==typeof e?e(t):e}function Ul(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&Vi(i.then)&&i.then(void 0,(()=>{}))}}}}var zl="gzip-js",Wl="base64",Vl="events",Zl="cancelEvents",Gl={Tab:"tab",Selector:"selector"},Ql={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Jl={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Kl={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Yl={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Xl={End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},tu="always",eu={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},iu={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_COMPLETED:"$survey_completed",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},ru="popover";function nu(t){return"$survey_response_"+t}function su(t,e){if(!e)return null;var i=t[nu(e)];return Wi(i)?[...i]:i}function au(t,e){void 0===t&&(t={});var r={};return e.questions.forEach((e=>{if(!Qi(e.originalQuestionIndex)){var i,n=0===(i=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+i,s=su(t,e.id);Qi(s)||(r[n]=s)}})),i({$survey_questions:e.questions.map((e=>({id:e.id,question:e.question,response:su(t,e.id)})))},t,r)}function ou(t,e){var i="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(i="$survey_"+e+"/"+t.id+"/"+t.current_iteration),i}function lu(t){return"string"==typeof t&&t.trim()?t.trim():null}function uu(t){return t.toLowerCase()}function hu(t,e,i){if(!t||!e)return null;var r=uu(e),n=Object.keys(t).find((t=>uu(t)===r));if(n)return null==i||i.debug("Found exact translation match: "+n),n;if(r.includes("-")){var s=r.split("-")[0],a=Object.keys(t).find((t=>uu(t)===s));if(a)return null==i||i.debug("Found base language translation match: "+a+" (from "+e+")"),a}return null}function du(t,e,r){var n,s=hu(t.translations,e,r),a=i({},t),o=!1;if(s){var l,u=null==(l=t.translations)?void 0:l[s];u&&(null==r||r.info("Applying survey-level translation for language: "+s),Qi(u.name)||(a.name=u.name,o=!0),a.appearance?(a.appearance=i({},a.appearance),Qi(u.thankYouMessageHeader)||(a.appearance.thankYouMessageHeader=u.thankYouMessageHeader,o=!0),Qi(u.thankYouMessageDescription)||(a.appearance.thankYouMessageDescription=u.thankYouMessageDescription,o=!0),Qi(u.thankYouMessageCloseButtonText)||(a.appearance.thankYouMessageCloseButtonText=u.thankYouMessageCloseButtonText,o=!0),Qi(u.submitButtonText)||(a.appearance.submitButtonText=u.submitButtonText,o=!0),Qi(u.backButtonText)||(a.appearance.backButtonText=u.backButtonText,o=!0)):function(t){return!(Qi(t.thankYouMessageHeader)&&Qi(t.thankYouMessageDescription)&&Qi(t.thankYouMessageCloseButtonText)&&Qi(t.submitButtonText)&&Qi(t.backButtonText))}(u)&&(o=!0))}var h=t.questions.map((t=>function(t,e,r){var n,s=hu(t.translations,e,r);if(!s)return{question:t,matchedKey:null,hasChanges:!1};var a=null==(n=t.translations)?void 0:n[s];if(!a)return{question:t,matchedKey:null,hasChanges:!1};var o=i({},t),l=!1;return Qi(a.question)||(o.question=a.question,l=!0),Qi(a.description)||(o.description=a.description,l=!0),Qi(a.buttonText)||(o.buttonText=a.buttonText,l=!0),"link"in o&&!Qi(a.link)&&(o.link=a.link,l=!0),"lowerBoundLabel"in o&&!Qi(a.lowerBoundLabel)&&(o.lowerBoundLabel=a.lowerBoundLabel,l=!0),"upperBoundLabel"in o&&!Qi(a.upperBoundLabel)&&(o.upperBoundLabel=a.upperBoundLabel,l=!0),"choices"in o&&function(t){return Wi(t.choices)}(a)&&(o.choices=a.choices,l=!0),{question:l?o:t,matchedKey:l?s:null,hasChanges:l}}(t,e,r))),d=h.map((t=>t.question)),v=h.some((t=>t.hasChanges)),c=null;return s||(c=(null==(n=h.find((t=>t.matchedKey)))?void 0:n.matchedKey)||null),v&&(a.questions=d,o=!0,null==r||r.info("Applied question-level translations for language: "+e)),{survey:a,matchedKey:o?s||c:null}}function vu(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}function cu(t){var e;return vu(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}var fu=$s("[Surveys]");function pu(t){return!(!t.start_date||t.end_date)}function gu(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}var mu="seenSurvey_",yu="inProgressSurvey_",bu=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),_u=t=>bu(mu,t),wu=t=>{try{var e=_u(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){fu.error("Failed to persist survey seen state",t)}},xu=[Kl.Popover,Kl.Widget,Kl.API],ku={ignoreConditions:!1,ignoreDelay:!1,displayType:ru},Su="$people_distinct_id",Cu="$device_id",Mu="$device_model",Tu="__alias",Eu="__timers",Iu="$autocapture_disabled_server_side",Pu="$heatmaps_enabled_server_side",Ru="$exception_capture_enabled_server_side",Lu="$error_tracking_suppression_rules",Ou="$error_tracking_capture_extension_exceptions",Fu="$web_vitals_enabled_server_side",Au="$dead_clicks_enabled_server_side",Du="$product_tours_enabled_server_side",$u="$web_vitals_allowed_metrics",Nu="$session_recording_remote_config",qu="$replay_sample_rate",ju="$replay_override_sampling",Bu="$replay_override_linked_flag",Hu="$replay_override_url_trigger",Uu="$replay_override_event_trigger",zu="$sesid",Wu="$session_is_sampled",Vu="$enabled_feature_flags",Zu="$active_feature_flags",Gu="$early_access_features",Qu="$feature_flag_details",Ju="$feature_flag_payloads",Ku="$feature_flag_request_id",Yu="$minimal_flag_called_events",Xu="$override_feature_flags",th="$override_feature_flag_payloads",eh="$stored_person_properties",ih="$stored_group_properties",rh="$surveys",nh="$surveys_loaded_at",sh="$surveys_activated",ah="$surveys_activated_session",oh="$surveys_activated_timestamps",lh="ph_product_tours",uh="$flag_call_reported",hh="$flag_call_reported_session_id",dh="$feature_flag_errors",vh="$feature_flag_evaluated_at",ch="$user_state",fh="$client_session_props",ph="$capture_rate_limit",gh="$initial_campaign_params",mh="$initial_referrer_info",yh="$initial_person_info",bh="$epp",_h="$posthog_cookieless",wh="$cookieless_mode",xh="$sdk_debug_extensions_init_method",kh="$sdk_debug_extensions_init_time_ms",Sh="$sdk_debug_recording_script_not_loaded",Ch="PostHog loadExternalDependency extension not found.",Mh="on_reject",Th="always",Eh="anonymous",Ih="identified",Ph="identified_only",Rh="visibilitychange",Lh="beforeunload",Oh="$pageview",Fh="$pageleave",Ah="$identify",Dh="$groupidentify";Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return tr(t)&&isFinite(t)&&Math.floor(t)===t});class $h{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,i,r){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>e||0>i||0>r||t>0xffffffffffff||e>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/Math.pow(2,40),n[1]=t/Math.pow(2,32),n[2]=t/Math.pow(2,24),n[3]=t/Math.pow(2,16),n[4]=t/256,n[5]=t,n[6]=112|e>>>8,n[7]=e,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new $h(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 $h(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}}class Nh{generate(){var t=this.generateOrAbort();if(!Qi(t))return t;this.S=0;var e=this.generateOrAbort();if(Qi(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=Date.now();if(t>this.S)this.S=t,this.C();else{if(this.S>=t+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return $h.fromFieldsV7(this.S,Math.trunc(this.I/Math.pow(2,30)),this.I&Math.pow(2,30)-1,this.R.nextUint32())}C(){this.I=1024*this.R.nextUint32()+(1023&this.R.nextUint32())}constructor(){this.S=0,this.I=0,this.R=new Bh}}var qh,jh=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};xs&&!Qi(xs.crypto)&&crypto.getRandomValues&&(jh=t=>crypto.getRandomValues(t));class Bh{nextUint32(){return this.O.length>this.N||(jh(this.O),this.N=0),this.O[this.N++]}constructor(){this.O=new Uint32Array(8),this.N=1/0}}var Hh=()=>Uh().toString(),Uh=()=>(qh||(qh=new Nh)).generate(),zh=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 Wh(t,e,i){return Qs({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var Vh={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=>zh(e,t))))),not_regex:(t,e)=>e.every((e=>t.every((t=>!zh(e,t))))),icontains:(t,e)=>e.map(Zh).some((e=>t.map(Zh).some((t=>e.includes(t))))),not_icontains:(t,e)=>e.map(Zh).every((e=>t.map(Zh).every((t=>!e.includes(t))))),gt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i>parseFloat(t)))})),lt:(t,e)=>e.some((e=>{var i=parseFloat(e);return!isNaN(i)&&t.some((t=>i<parseFloat(t)))}))},Zh=t=>t.toLowerCase();function Gh(t,e){return!t||Object.entries(t).every((t=>{var i=t[1],r=null==e?void 0:e[t[0]];if(Qi(r)||Yi(r))return!1;var n=[String(r)],s=Vh[i.operator];return!!s&&s(i.values,n)}))}var Qh=t=>{if(Cs){try{for(var e=t+"=",i=Cs.cookie.split(";").filter((t=>t.length)),r=0;i.length>r;r++){for(var n=i[r];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},Jh="",Kh=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Yh={P:()=>!!Cs,j(t){Ds.error("cookieStore error: "+t)},q:Qh,H(t){var e;try{e=JSON.parse(Yh.q(t))||{}}catch(t){}return e},A(t,e,i,r,n){if(!Cs)return!1;try{var s="",a="",o=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=Cs),Jh)return Jh;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),r=Math.min(i.length,8),n="dmn_chk_"+Hh();!Jh&&r--;){var s=i.slice(r).join("."),a=n+"=1;domain=."+s+";path=/";e.cookie=a+";max-age=3",e.cookie.includes(n)&&(e.cookie=a+";max-age=0",Jh=s)}return Jh}(t);if(!i){var r=(t=>{var e=t.match(Kh);return e?e[0]:""})(t);r!==i&&Ds.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(Cs.location.hostname,r);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),s="; expires="+l.toUTCString()}n&&(a="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+o+a;return u.length>3686.4&&Ds.warn("cookieStore warning: large cookie, len="+u.length),Cs.cookie=u,!0}catch(t){return!1}},F(t,e){if(null!=Cs&&Cs.cookie)try{Yh.A(t,"",-1,e)}catch(t){return}}},Xh=null,td={P(){if(!Yi(Xh))return Xh;var t=!0;if(Qi(xs))t=!1;else try{var e="__mplssupport__";td.A(e,"xyz"),'"xyz"'!==td.q(e)&&(t=!1),td.F(e)}catch(e){t=!1}return t||Ds.error("localStorage unsupported; falling back to cookie store"),Xh=t,t},j(t){Ds.error("localStorage error: "+t)},q(t){try{return null==xs?void 0:xs.localStorage.getItem(t)}catch(t){td.j(t)}return null},H(t){try{return JSON.parse(td.q(t))||{}}catch(t){}return null},A(t,e){try{return null==xs||xs.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){td.j(t)}return!1},F(t){try{null==xs||xs.localStorage.removeItem(t)}catch(t){td.j(t)}}},ed=[Cu,"distinct_id",zu,Wu,bh,yh,ch],id={},rd={P:()=>!0,j(t){Ds.error("memoryStorage error: "+t)},q:t=>id[t]||null,H:t=>id[t]||null,A:(t,e)=>(id[t]=e,!0),F(t){delete id[t]}},nd=null,sd={P(){if(!Yi(nd))return nd;if(nd=!0,Qi(xs))nd=!1;else try{var t="__support__";sd.A(t,"xyz"),'"xyz"'!==sd.q(t)&&(nd=!1),sd.F(t)}catch(t){nd=!1}return nd},j(t){Ds.error("sessionStorage error: ",t)},q(t){try{return null==xs?void 0:xs.sessionStorage.getItem(t)}catch(t){sd.j(t)}return null},H(t){try{return JSON.parse(sd.q(t))||null}catch(t){}return null},A(t,e){try{return null==xs||xs.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){sd.j(t)}return!1},F(t){try{null==xs||xs.sessionStorage.removeItem(t)}catch(t){sd.j(t)}}},ad=$s("[Stylesheet Loader]"),od=xs,ld=Cs,ud="#020617",hd={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:Ql.Right,widgetType:Gl.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:ud,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},dd=[Ql.Center,Ql.Left,Ql.Right];function vd(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 cd(t){var e;void 0===t&&(t=hd.backgroundColor),"#"===t[0]&&(e=vd(t)),t.startsWith("rgb")&&(e=t);var i={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(i&&(e=vd(i)),!e)return ud;var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var n=parseInt(r[1]),s=parseInt(r[2]),a=parseInt(r[3]);return Math.sqrt(n*n*.299+s*s*.587+a*a*.114)>127.5?ud:"white"}return ud}var fd=(t,e,r)=>{var n=Ld(t),s=ld.querySelector("."+n);if(s&&s.shadowRoot)return{shadow:s.shadowRoot,isNewlyCreated:!1};var a=ld.createElement("div");((t,e,r)=>{var n=i({},hd,r),s=t.style,a=!dd.includes(n.position)||e===Kl.Widget&&(null==r?void 0:r.widgetType)===Gl.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),a?(s.setProperty("--ph-survey-border-radius",n.borderRadius),s.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(s.setProperty("--ph-survey-border-bottom","none"),s.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),s.setProperty("--ph-survey-background-color",n.backgroundColor),s.setProperty("--ph-survey-box-shadow",n.boxShadow),s.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),s.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),s.setProperty("--ph-survey-submit-button-text-color",(null==r?void 0:r.submitButtonTextColor)||cd(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",cd(n.ratingButtonActiveColor)),s.setProperty("--ph-survey-text-primary-color",(null==r?void 0:r.textColor)||cd(n.backgroundColor)),s.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),s.setProperty("--ph-widget-color",n.widgetColor),s.setProperty("--ph-widget-text-color",cd(n.widgetColor)),s.setProperty("--ph-widget-z-index",n.zIndex);var o=(null==r?void 0:r.inputBackground)||(null==r?void 0:r.inputBackgroundColor),l=o||n.inputBackground;o||"white"!==n.backgroundColor||(l="#f8f8f8"),s.setProperty("--ph-survey-input-background",l);var u=(null==r?void 0:r.inputTextColor)||cd(l);s.setProperty("--ph-survey-input-text-color",u),s.setProperty("--ph-survey-rating-text-color",u),s.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),s.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),s.setProperty("--ph-survey-outline-color",n.outlineColor)})(a,t.type,t.appearance),a.className=n;var o=a.attachShadow({mode:"open"}),l=function(t){var e=((t,e,i)=>{var r=t.createElement("style");r.innerText=e;var n=(t=>{var e;return Vi(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(i);return n&&(r=n(r)),r||(ad.error("prepare_external_dependency_stylesheet returned null"),null)})(ld,':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{font-size:11px;justify-content:space-between;opacity:.7}.form-buttons,.rating-text{display:flex;flex-direction:row}.form-buttons{gap:8px;width:100%}.form-buttons-with-back>.form-submit{flex:1 1 auto;min-width:0}.form-submit{background:var(--ph-survey-submit-button-color);border:none;border-radius:6px;box-shadow:0 2px 0 rgba(0,0,0,.045);color:var(--ph-survey-submit-button-text-color);cursor:pointer;font-weight:700;min-width:100%;padding:12px;text-align:center;user-select:none}.form-submit:not([disabled]):hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.02)}.form-submit:not([disabled]):active{box-shadow:0 1px 2px rgba(0,0,0,.05);transform:scale(.98)}.form-submit[disabled]{cursor:not-allowed;opacity:var(--ph-survey-disabled-button-opacity)}.form-back{background:transparent;border:1.5px solid var(--ph-survey-border-color);border-radius:6px;color:var(--ph-survey-text-primary-color);cursor:pointer;flex:0 0 auto;font-weight:600;padding:12px 16px;text-align:center;user-select:none}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.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)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(e);if(l){var u=o.querySelector("style");u&&o.removeChild(u),o.appendChild(l)}return ld.body.appendChild(a),{shadow:o,isNewlyCreated:!0}},pd=t=>{var e=t.responses,r=t.survey,n=t.surveySubmissionId,s=t.posthog,a=t.isSurveyCompleted,o=t.properties,l=t.surveyLanguage;s?(wu(r),s.capture(eu.SENT,i({[iu.SURVEY_NAME]:r.name,[iu.SURVEY_ID]:r.id,[iu.SURVEY_ITERATION]:r.current_iteration,[iu.SURVEY_ITERATION_START_DATE]:r.current_iteration_start_date,[iu.SURVEY_SUBMISSION_ID]:n,[iu.SURVEY_COMPLETED]:a},l&&{[iu.SURVEY_LANGUAGE]:l},{sessionRecordingUrl:null==s.get_session_replay_url?void 0:s.get_session_replay_url()},au(e,r),o,{$set:{[ou(r,"responded")]:!0}})),a&&(od.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:r.id}})),Rd(r),s.reloadFeatureFlags())):fu.error("[survey sent] event not captured, PostHog instance not found.")},gd=(t,e,r)=>{return i({[iu.SURVEY_NAME]:t.name,[iu.SURVEY_ID]:t.id,[iu.SURVEY_ITERATION]:t.current_iteration,[iu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date,[iu.SURVEY_PARTIALLY_COMPLETED]:(n=null==e?void 0:e.responses,void 0===n&&(n={}),Object.values(n).some((t=>!Xi(t))))},(null==e?void 0:e.surveyLanguage)&&{[iu.SURVEY_LANGUAGE]:e.surveyLanguage},{sessionRecordingUrl:null==r.get_session_replay_url?void 0:r.get_session_replay_url(),[iu.SURVEY_SUBMISSION_ID]:null==e?void 0:e.surveySubmissionId},au(null==e?void 0:e.responses,t));var n},md=(t,e,r,n)=>{if(e){if(!r){var s=Id(t);e.capture(eu.DISMISSED,i({},gd(t,s,e),n&&{[iu.SURVEY_LANGUAGE]:n},{$set:{[ou(t,"dismissed")]:!0}})),Rd(t),wu(t),od.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else fu.error("[survey dismissed] event not captured, PostHog instance not found.")},yd=(t,e)=>{if(e){var i=(t=>bu("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(i))return}catch(t){return}var r=Id(t);if(r){try{localStorage.setItem(i,"true")}catch(t){}e.capture(eu.ABANDONED,gd(t,r,e),{transport:"sendBeacon"})}}else fu.error("[survey abandoned] event not captured, PostHog instance not found.")},bd=t=>t.map((t=>({sort:Math.floor(10*Math.random()),value:t}))).sort(((t,e)=>t.sort-e.sort)).map((t=>t.value)),_d=(t,e)=>t.length===e.length&&t.every(((t,i)=>t===e[i]))?e.reverse():e,wd=t=>t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?_d(t.questions,bd(t.questions)):t.questions,xd=t=>cu(t)||Pd(t),kd=function(t){function e(t){var i,r;return this.getChildContext||(i=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&i.forEach((function(t){t.__e=!0,el(t)}))},this.sub=function(t){i.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){i&&i.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+Bo++,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(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Sd=()=>Al(kd),Cd=t=>{var e=t.children,i=t.style;return function(t,e,i){var r,n,s,a,o=Vo({},t.props);for(s in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),e)"key"==s?r=e[s]:"ref"==s?n=e[s]:o[s]=void 0===e[s]&&null!=a?a[s]:e[s];return arguments.length>2&&(o.children=arguments.length>3?To.call(arguments,2):i),Qo(t.type,o,r||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:i}:{children:e,style:i})};function Md(t,e){var i,r;if(null==(i=t.conditions)||!i.url)return!0;var n=oa(e);if(!n)return!1;var s=[t.conditions.url],a=function(t){return null!=t?t:"icontains"}(null==(r=t.conditions)?void 0:r.urlMatchType);return Vh[a](s,[n])}var Td=t=>bu(yu,t),Ed=(t,e)=>{try{localStorage.setItem(Td(t),JSON.stringify(e))}catch(t){fu.error("Error setting in-progress survey state in localStorage",t)}},Id=t=>{try{var e=localStorage.getItem(Td(t));if(e)return JSON.parse(e)}catch(t){fu.error("Error getting in-progress survey state from localStorage",t)}return null},Pd=t=>{var e=Id(t);return!Xi(null==e?void 0:e.surveySubmissionId)},Rd=t=>{try{localStorage.removeItem(Td(t))}catch(t){fu.error("Error clearing in-progress survey state from localStorage",t)}};function Ld(t,e){void 0===e&&(e=!1);var i="PostHogSurvey-"+t.id;return e?"."+i:i}function Od(t,e,i){if(void 0===e&&(e=Ql.Right),t===Kl.ExternalSurvey)return{};switch(e){case Ql.TopLeft:return{top:"0",left:"0",transform:"translate(30px, 30px)"};case Ql.TopRight:return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case Ql.TopCenter:return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case Ql.MiddleLeft:return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case Ql.MiddleRight:return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case Ql.MiddleCenter:return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Ql.Left:return{left:"30px"};case Ql.Center:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Kl.Widget&&i===Gl.Tab?"60px":"30px"}}}var Fd=0;function Ad(t,e,i,r,n,s){e||(e={});var a,o,l=e;if("ref"in l)for(o in l={},e)"ref"==o?a=e[o]:l[o]=e[o];var u={type:t,props:l,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Fd,__i:-1,__u:0,__source:n,__self:s};if("function"==typeof t&&(a=t.defaultProps))for(o in a)void 0===l[o]&&(l[o]=a[o]);return Eo.vnode&&Eo.vnode(u),u}var Dd=Ad("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ad("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"})}),$d=Ad("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ad("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"})}),Nd=Ad("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ad("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"})}),qd=Ad("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ad("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"})}),jd=Ad("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Ad("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"})}),Bd=Ad("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ad("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"})}),Hd=Ad("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Ad("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"})}),Ud=function(t){var e=(void 0===t?{}:t).fill,i=void 0===e?"currentColor":e;return Ad("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:i,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Ad("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Ad("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:i})]})},zd=Ad("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Ad("g",{"clip-path":"url(#clip0_2415_6911)",children:[Ad("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Ad("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Ad("g",{mask:"url(#mask0_2415_6911)",children:[Ad("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"}),Ad("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"}),Ad("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"}),Ad("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"}),Ad("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"}),Ad("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"})]})]}),Ad("defs",{children:Ad("clipPath",{id:"clip0_2415_6911",children:Ad("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Wd(t){var e=t.urlParams,i=e?Object.entries(e).map((t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)})).join("&"):"";return Ad("a",{href:"https://posthog.com/surveys"+(i?"?"+i:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",zd]})}function Vd(t){var e=t.text,i=t.submitDisabled,r=t.appearance,n=t.onSubmit,s=t.link,a=t.onPreviewSubmit,o=t.skipSubmitButton,l=t.canGoBack,u=t.onBack,h=Al(kd).isPreviewMode,d=!!l&&!!u,v=!o&&Ad("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){s&&(null==xs||xs.open(s)),h?null==a||a():n()},children:e});return Ad("div",{className:"bottom-section",children:[d?Ad("div",{className:"form-buttons form-buttons-with-back",children:[Ad("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:u,children:r.backButtonText||"Back"}),v]}):v,!r.whiteLabel&&Ad(Wd,{urlParams:{utm_source:"survey-footer"}})]})}function Zd(t){var e=t.question,i=t.forceDisableHtml;return Ad("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Ad(e.type===Yl.Open?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&Cd({component:Go("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!i&&"text"!==e.descriptionContentType})]})}function Gd(t){return Ad("button",{className:"form-cancel",onClick:t.onClick,disabled:Al(kd).isPreviewMode,"aria-label":"Close survey",type:"button",children:Ud({fill:"black"})})}Ad("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ad("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 Qd=xs;function Jd(t){var e=t.header,i=t.description,r=t.contentType,n=t.forceDisableHtml,s=t.appearance,a=t.onClose,o=Al(kd).isPopup;return Ll((()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),a())};return Zs(Qd,"keydown",t),()=>{Qd.removeEventListener("keydown",t)}}),[a]),Ad("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[o&&!0!==s.hideCancelButton&&Ad(Gd,{onClick:()=>a()}),Ad("h3",{className:"thank-you-message-header",children:e}),i&&Cd({component:Go("p",{className:"thank-you-message-body"}),children:i,renderAsHtml:!n&&"text"!==r}),o&&Ad(Vd,{text:s.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:s,onSubmit:()=>a()})]})}var Kd=t=>Wi(t)&&t.every((t=>Ji(t)));function Yd(t){var e=t.question,i=t.forceDisableHtml,r=t.appearance,n=t.onSubmit,s=t.onPreviewSubmit,a=t.displayQuestionIndex,o=t.initialValue,l=t.canGoBack,u=t.onBack,h=Sd().isPreviewMode,d=Ol(null),v=Rl((()=>Ji(o)?o:"")),c=v[0],f=v[1],p=null==r?void 0:r.disableAutofocus;Ll((()=>{p||setTimeout((()=>{var t;h||null==(t=d.current)||t.focus()}),100)}),[h,p]);var g="surveyQuestion"+a,m=Fl((()=>function(t,e,i){var r,n,s=t.trim();if(!i&&""===s)return"This field is required";if(""===s)return!1;if(e&&e.length>0)for(var a of e)switch(a.type){case Ci:if(void 0!==a.value&&a.value>s.length)return null!==(r=a.errorMessage)&&void 0!==r?r:"Please enter at least "+a.value+" characters";break;case Mi:if(void 0!==a.value&&s.length>a.value)return null!==(n=a.errorMessage)&&void 0!==n?n:"Please enter no more than "+a.value+" characters"}return!1}(c,e.validation,e.optional)),[c,e.validation,e.optional]),y=jn(e.validation,Ci),b=jn(e.validation,Mi),_=Fl((()=>function(t,e){var i=1===t?void 0:t;return i&&e?"Enter "+i+"-"+e+" characters":i?"Enter at least "+i+" "+(1===i?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,b)),[y,b]),w=()=>{m||n(c.trim())},x=()=>{m||s(c.trim())};return Ad(Jo,{children:[Ad("div",{className:"question-container",children:[Ad(Zd,{question:e,forceDisableHtml:i,htmlFor:g}),Ad("textarea",{ref:d,id:g,rows:4,placeholder:null==r?void 0:r.placeholder,minLength:y,maxLength:b,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?x():w())},value:c}),_&&Ad("div",{className:"validation-hint",children:_})]}),Ad(Vd,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:r,onSubmit:w,onPreviewSubmit:x,canGoBack:l,onBack:u})]})}function Xd(t){var e=t.question,i=t.appearance,r=t.onSubmit,n=t.onPreviewSubmit,s=t.canGoBack,a=t.onBack;return Ad(Jo,{children:[Ad("div",{className:"question-container",children:Ad(Zd,{question:e,forceDisableHtml:t.forceDisableHtml})}),Ad(Vd,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:i,onSubmit:()=>r("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:s,onBack:a})]})}function tv(t){var e,i=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,a=t.onSubmit,o=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=i.scale,v=10===i.scale?0:1,c=Rl((()=>tr(l)?l:Wi(l)&&l.length>0&&tr(parseInt(l[0]))?parseInt(l[0]):Ji(l)&&tr(parseInt(l))?parseInt(l):null)),f=c[0],p=c[1],g="emoji"===i.display&&2===i.scale,m=Sd().isPreviewMode,y=t=>m?o(t):a(t);return Ad(Jo,{children:[Ad("div",{className:"question-container",children:[Ad(Zd,{question:i,forceDisableHtml:r}),Ad("div",{className:"rating-section",children:[Ad("div",{className:"rating-options",children:["emoji"===i.display&&Ad("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=av[i.scale])?void 0:e.map(((t,e)=>Ad("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),i.skipSubmitButton&&y(t)},children:t},e)))}),"number"===i.display&&Ad("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(d-v+1)+", minmax(0, 1fr))"},children:ov(i.scale).map(((t,e)=>Ad(ev,{displayQuestionIndex:n,active:f===t,appearance:s,num:t,setActiveNumber(t){p(t),i.skipSubmitButton&&y(t)}},e)))})]}),!g&&Ad("div",{className:"rating-text",children:[Ad("div",{children:i.lowerBoundLabel}),Ad("div",{children:i.upperBoundLabel})]})]})]}),Ad(Vd,{text:i.buttonText||(null==s?void 0:s.submitButtonText)||"Submit",submitDisabled:Yi(f)&&!i.optional,appearance:s,onSubmit:()=>a(f),onPreviewSubmit:()=>o(f),skipSubmitButton:i.skipSubmitButton,canGoBack:u,onBack:h})]})}function ev(t){var e=t.num,i=t.setActiveNumber;return Ad("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){i(e)},children:e})}function iv(t){var e=t.question,r=t.forceDisableHtml,n=t.displayQuestionIndex,s=t.appearance,a=t.onSubmit,o=t.onPreviewSubmit,l=t.initialValue,u=t.canGoBack,h=t.onBack,d=Ol(null),v=Fl((()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,i="";t.hasOpenChoice&&(i=e.pop());var r=_d(e,bd(e));return t.hasOpenChoice&&(t.choices.push(i),r.push(i)),r})(e)),[e]),c=Rl((()=>((t,e)=>Ji(t)||Kd(t)?t:e===Yl.SingleChoice?null:[])(l,e.type))),f=c[0],p=c[1],g=Rl((()=>((t,e)=>{if(Ji(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(Kd(t)){var i=t.find((t=>!e.includes(t)));if(i)return{isSelected:!0,inputValue:i}}return{isSelected:!1,inputValue:""}})(l,v))),m=g[0],y=g[1],b=Sd().isPreviewMode,_=e.type===Yl.SingleChoice,w=e.type===Yl.MultipleChoice,x=e.skipSubmitButton&&_&&!e.hasOpenChoice,k=(t,e)=>{if(e){var r=!m.isSelected;return y((t=>i({},t,{isSelected:r,inputValue:r?t.inputValue:""}))),_&&p(""),void(r&&setTimeout((()=>{var t;return null==(t=d.current)?void 0:t.focus()}),75))}if(_)return p(t),y((t=>i({},t,{isSelected:!1,inputValue:""}))),void(x&&(a(t),b&&o(t)));w&&Wi(f)&&(f.includes(t)?p(f.filter((e=>e!==t))):p([...f,t]))},S=t=>{t.stopPropagation();var e=t.currentTarget.value;y((t=>i({},t,{inputValue:e}))),_&&p(e)},C=t=>{t.stopPropagation(),"Enter"!==t.key||M()||(t.preventDefault(),T()),"Escape"===t.key&&(t.preventDefault(),y((t=>i({},t,{isSelected:!1,inputValue:""}))),_&&p(null))},M=()=>!(e.optional||!Yi(f)&&(!Wi(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),T=()=>{m.isSelected&&w?Wi(f)&&(b?o([...f,m.inputValue]):a([...f,m.inputValue])):b?o(f):a(f)};return Ad(Jo,{children:[Ad("div",{className:"question-container",children:[Ad(Zd,{question:e,forceDisableHtml:r}),Ad("fieldset",{className:"multiple-choice-options limit-height",children:[Ad("legend",{className:"sr-only",children:w?" Select all that apply":" Select one"}),v.map(((t,i)=>{var r=!!e.hasOpenChoice&&i===e.choices.length-1,s="surveyQuestion"+n+"Choice"+i,a=s+"Open",o=r?m.isSelected:_?f===t:Wi(f)&&f.includes(t);return Ad("label",{className:r?"choice-option-open":"",children:[Ad("div",{className:"response-choice",children:[Ad("input",{type:_?"radio":"checkbox",name:s,checked:o,onChange:()=>k(t,r),id:s,"aria-controls":a}),Ad("span",{children:r?t+":":t})]}),r&&Ad("input",{type:"text",ref:d,id:a,name:"question"+n+"Open",value:m.inputValue,onKeyDown:C,onInput:S,onClick(e){m.isSelected||k(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},i)}))]})]}),Ad(Vd,{text:e.buttonText||"Submit",submitDisabled:M(),appearance:s,onSubmit:T,onPreviewSubmit:T,skipSubmitButton:x,canGoBack:u,onBack:h})]})}var rv=[1,2,3,4,5],nv=[1,2,3,4,5,6,7],sv=[0,1,2,3,4,5,6,7,8,9,10],av={2:[Bd,Hd],3:[Nd,$d,Dd],5:[qd,Nd,$d,Dd,jd]};function ov(t){switch(t){case 5:default:return rv;case 7:return nv;case 10:return sv}}var lv=$s("[Surveys]");function uv(t,e,i){var r,n=t.questions[e],s=e+1;if(null==(r=n.branching)||!r.type)return e===t.questions.length-1?Xl.End:s;if(n.branching.type===Xl.End)return Xl.End;if(n.branching.type===Xl.SpecificQuestion){if(Number.isInteger(n.branching.index))return n.branching.index}else if(n.branching.type===Xl.ResponseBased){if(n.type===Yl.SingleChoice){var a,o=n.choices.indexOf(""+i);if(-1===o&&n.hasOpenChoice&&(o=n.choices.length-1),null!=(a=n.branching)&&null!=(a=a.responseValues)&&a.hasOwnProperty(o)){var l=n.branching.responseValues[o];return Number.isInteger(l)?l:l===Xl.End?Xl.End:s}}else if(n.type===Yl.Rating){var u;if("number"!=typeof i||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(t,e){if(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")}(i,n.scale);if(null!=(u=n.branching)&&null!=(u=u.responseValues)&&u.hasOwnProperty(h)){var d=n.branching.responseValues[h];return Number.isInteger(d)?d:d===Xl.End?Xl.End:s}}return s}return lv.warn("Falling back to next question index due to unexpected branching type"),s}var hv="https?://(.*)",dv=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],vv=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...dv],cv="<masked>",fv=["li_fat_id"];function pv(t,e,i){if(!Cs)return{};var r,n=e?[...dv,...i||[]]:[],s=gv(Xs(Cs.URL,n,cv),t),a=(r={},qs(fv,(function(t){var e=Qh(t);r[t]=e||null})),r);return js(a,s)}function gv(t,e){var i=vv.concat(e||[]),r={};return qs(i,(function(e){var i=Ys(t,e);r[e]=i||null})),r}function mv(t){var e=function(t){return t?0===t.search(hv+"google.([^/?]*)")?"google":0===t.search(hv+"bing.com")?"bing":0===t.search(hv+"yahoo.com")?"yahoo":0===t.search(hv+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",r={};if(!Yi(e)){r.$search_engine=e;var n=Cs?Ys(Cs.referrer,i):"";n.length&&(r.ph_keyword=n)}return r}function yv(){return navigator.language||navigator.userLanguage}var bv="$direct";function _v(){return(null==Cs?void 0:Cs.referrer)||bv}function wv(t,e,i){void 0===i&&(i=!1);var r=t?[...dv,...e||[]]:[],n=i?kn(null==Ms?void 0:Ms.href):null==Ms?void 0:Ms.href,s=null==n?void 0:n.substring(0,1e3);return{r:_v().substring(0,1e3),u:s?Xs(s,r,cv):void 0}}function xv(t,e){var i;void 0===e&&(e=!1);var r=t.r,n=t.u,s=e?kn(n):n,a={$referrer:r,$referring_domain:null==r?void 0:r==bv?bv:null==(i=Js(r))?void 0:i.host};if(s){a.$current_url=s;var o=Js(s);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname;var l=gv(s);js(a,l)}if(r){var u=mv(r);js(a,u)}return a}function kv(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function Sv(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Cv=$s("[SurveyTranslations]");function Mv(t,e){var i=function(t){return function(t,e){var i=t.storedPersonProperties,r=t.locale,n=lu(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var s=function(t){return t&&"object"==typeof t&&"language"in t?lu(t.language):null}(i);if(s)return null==e||e.info("Using person property language: "+s),s;var a=lu(r);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:Vi(t.get_property)?t.get_property(eh):void 0,locale:yv()},Cv)}(e);if(!i)return Cv.info("No user language detected"),{survey:t,language:null};var r=du(t,i,Cv);return{survey:r.survey,language:r.matchedKey}}var Tv=xs,Ev=Cs,Iv="ph:show_survey_widget",Pv="PHWidgetSurveyClickListener";function Rv(t,e){try{var i=t.getBoundingClientRect(),r=Tv.innerHeight,n=Tv.innerWidth,s=i.left+i.width/2-e/2;s+e>n-20&&(s=n-e-20),20>s&&(s=20);var a=r-i.bottom,o=250>a&&i.top>a;return{position:"fixed",top:o?"auto":i.bottom+12+"px",left:s+"px",right:"auto",bottom:o?r-i.top+12+"px":"auto",zIndex:hd.zIndex}}catch(t){return fu.warn("Failed to calculate trigger position:",t),null}}class Lv{constructor(t){var e=this;this.B=new Map,this.U=new Map,this.W=new Set,this.handlePageUnload=()=>{var t=this._posthog.get_property(rh);if(t)for(var e of t)Pd(e)&&yd(e,this._posthog)},this.handlePopoverSurvey=function(t,r,n){var s,a,o,l,u,h=(void 0===n?{}:n).resumeDelayFromActivation,d=void 0!==h&&h,v=e.V(t),c=v.survey,f=v.language,p=null!=r&&r.position||null!=r&&r.selector?i({},c,{appearance:i({},c.appearance,r.position&&{position:r.position},r.selector&&{widgetSelector:r.selector})}):c;e.Z(p.id);var g=null!=r?r:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&e.$(p,y,m,f);if(!b||null!=(s=p.appearance)&&s.displayThankYouMessage){e.G(p);var _={};if((null==(a=p.appearance)?void 0:a.position)===Ql.NextToTrigger&&null!=(o=p.appearance)&&o.widgetSelector){var w,x=Ev.querySelector(p.appearance.widgetSelector);x&&(_=Rv(x,parseInt((null==(w=p.appearance)?void 0:w.maxWidth)||hd.maxWidth))||{})}var k=(null==(l=p.appearance)?void 0:l.surveyPopupDelaySeconds)||0,S=fd(p,e._posthog).shadow,C={posthog:e._posthog,survey:p,removeSurveyFromFocus:e.Y,properties:m,style:_,isSurveyCompleted:b,skipShownEvent:null==r?void 0:r.skipShownEvent,surveyLanguage:f};if(0>=k)return gl(Ad(Dv,i({},C)),S);var M=()=>{if(!e.K(p))return fu.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),e.Y(p);gl(Ad(Dv,i({},C,{survey:i({},p,{appearance:i({},p.appearance,{surveyPopupDelaySeconds:0})})})),S)},T=d?null==(u=e._posthog.surveys)||null==(u=u._surveyEventReceiver)||null==u.getActivationTimestamp?void 0:u.getActivationTimestamp(p.id):void 0,E=tr(T)?Math.max(0,Date.now()-T):0,I=Math.max(0,1e3*k-E);if(0>=I)return M();var P=Tv.setTimeout((()=>{e.B.delete(p.id),M()}),I);e.B.set(p.id,P)}},this.J=t=>{var e=this.V(t),i=e.survey,r=e.language,n=fd(i,this._posthog),s=n.shadow;n.isNewlyCreated&&gl(Ad(Nv,{posthog:this._posthog,survey:i,surveyLanguage:r},t.id),s)},this.X=t=>{var e=this.U.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Pv),this.U.delete(t),fu.info("Removed click listener for survey "+t))},this.ee=t=>{this.te(t)||(this.re(t),this.X(t.id))},this.te=t=>{try{var e,i=Ev.querySelector(Ld(t,!0));return!(null==i||null==(e=i.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.ne=(t,e)=>{var i=Ev.querySelector(e),r=this.U.get(t.id);if(i){if(this.J(t),r){if(i===r.element)return;fu.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.X(t.id)}if(!i.hasAttribute(Pv)){var n=e=>{var i,r;e.stopPropagation();var n=(null==(i=t.appearance)?void 0:i.position)===Ql.NextToTrigger?Rv(e.currentTarget,parseInt((null==(r=t.appearance)?void 0:r.maxWidth)||hd.maxWidth)):{};Tv.dispatchEvent(new CustomEvent(Iv,{detail:{surveyId:t.id,position:n}}))};Zs(i,"click",n),i.setAttribute(Pv,"true"),this.U.set(t.id,{element:i,listener:n,survey:t}),fu.info("Attached click listener for feedback button survey "+t.id)}}else r&&this.ee(t)},this.renderPopover=t=>{var e=this.V(t),i=e.survey,r=e.language,n=fd(i,this._posthog).shadow;gl(Ad(Dv,{posthog:this._posthog,survey:i,removeSurveyFromFocus:this.Y,surveyLanguage:r}),n)},this.renderSurvey=(t,e,i)=>{var r,n=this.V(t),s=n.survey,a=n.language,o=!1;null!=(r=this._posthog.config)&&null!=(r=r.surveys)&&r.prefillFromUrl&&(o=this.ie(s,a,i)),gl(Ad(Dv,{posthog:this._posthog,survey:s,removeSurveyFromFocus:this.Y,isPopup:!1,properties:i,isSurveyCompleted:o,surveyLanguage:a}),e)},this.getActiveMatchingSurveys=function(t,i){var r;void 0===i&&(i=!1),null==(r=e._posthog)||null==(r=r.surveys)||r.getSurveys((i=>{var r=i.filter((t=>e.K(t)));t(r)}),i)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getActiveMatchingSurveys((t=>{var i=t.filter((t=>t.type===Kl.Popover||t.type===Kl.Widget)),r=new Set(i.map((t=>t.id)));for(var n of Array.from(e.B.keys()))r.has(n)||e.cancelSurvey(n);var s=e.ae(i),a=new Set;s.forEach((t=>{if(t.type===Kl.Widget){var i,r,n,s;if((null==(i=t.appearance)?void 0:i.widgetType)===Gl.Tab)return void e.J(t);(null==(r=t.appearance)?void 0:r.widgetType)===Gl.Selector&&null!=(n=t.appearance)&&n.widgetSelector&&(a.add(t.id),e.ne(t,null==(s=t.appearance)?void 0:s.widgetSelector))}Yi(e.oe)&&t.type===Kl.Popover&&e.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})})),e.U.forEach((t=>{var i=t.survey;a.has(i.id)||e.ee(i)}))}),t)},this.G=t=>{Yi(this.oe)||fu.error("Survey "+this.oe+" already in focus. Cannot add survey "+t.id+"."),this.oe=t.id},this.Y=t=>{this.oe!==t.id&&fu.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Z(t.id),this.oe=null,this.re(t)},this._posthog=t,this.oe=null}Z(t){var e=this.B.get(t);e&&(clearTimeout(e),this.B.delete(t))}cancelSurvey(t){this.B.has(t)&&(fu.info("Cancelled pending survey "+t),this.Z(t),this.oe===t&&(this.oe=null))}ae(t){return t.sort(((t,e)=>{var i,r,n=Pd(t),s=Pd(e);if(n&&!s)return-1;if(!n&&s)return 1;var a=t.schedule===tu,o=e.schedule===tu;return a&&!o?1:!a&&o?-1:((null==(i=t.appearance)?void 0:i.surveyPopupDelaySeconds)||0)-((null==(r=e.appearance)?void 0:r.surveyPopupDelaySeconds)||0)}))}V(t){return Mv(t,this._posthog)}ie(t,e,i){if(this.W.has(t.id))return!1;var r=function(t){var e={},i=!1,r=t.replace(/^\?/,"");if(!r)return{params:e,autoSubmit:i};var n=r.split("&");for(var s of n){var a=s.split("="),o=a[0],l=a[1];if(o&&!Qi(l)){var u=decodeURIComponent(o),h=decodeURIComponent(l);if("auto_submit"!==u||"true"!==h){var d=u.match(/^q(\d+)$/);if(d){var v=parseInt(d[1],10);e[v]||(e[v]=[]),e[v].push(h)}}else i=!0}}return{params:e,autoSubmit:i}}(Tv.location.search),n=r.params;if(0===Object.keys(n).length)return!1;fu.info("[Survey Prefill] Detected URL prefill parameters");var s=this.se(t,n,e);if(!s)return!1;var a=s.responses,o=s.submissionId,l=s.isSurveyCompleted,u=s.skippedResponses;return(Object.keys(u).length>0&&t.enable_partial_responses||l)&&pd({responses:l?a:u,survey:t,surveySubmissionId:o,posthog:this._posthog,isSurveyCompleted:l,properties:i,surveyLanguage:e}),this.W.add(t.id),l}$(t,e,i,r){var n={};for(var s of Object.entries(e)){var a=s[1];n[parseInt(s[0])]=Wi(a)?a.map(String):[String(a)]}fu.info("[Survey] Processing initial responses");var o=this.se(t,n,r);if(!o)return!1;var l=o.isSurveyCompleted;return pd({responses:o.responses,survey:t,surveySubmissionId:o.submissionId,posthog:this._posthog,isSurveyCompleted:l,properties:i,surveyLanguage:r}),l}se(t,e,i){try{var r=function(t,e){var i={};return t.questions.forEach(((t,r)=>{if(e[r]&&t.id){var n=e[r],s=nu(t.id);try{switch(t.type){case Yl.SingleChoice:if(!t.choices||0===t.choices.length)return void Ds.warn("[Survey Prefill] Question "+r+" has no choices");var a=parseInt(n[0],10);if(isNaN(a)||0>a||a>=t.choices.length)return void Ds.warn("[Survey Prefill] Invalid choice index for q"+r+": "+n[0]);i[s]=t.choices[a];break;case Yl.MultipleChoice:if(!t.choices||0===t.choices.length)return void Ds.warn("[Survey Prefill] Question "+r+" has no choices");var o=n.map((t=>parseInt(t,10))).filter((e=>!isNaN(e)&&e>=0&&t.choices.length>e));if(0===o.length)return void Ds.warn("[Survey Prefill] No valid choices for q"+r);var l=[...new Set(o.map((e=>t.choices[e])))];o.length>l.length&&Ds.warn("[Survey Prefill] Removed duplicate choices for q"+r),i[s]=l;break;case Yl.Rating:var u=parseInt(n[0],10),h=t.scale||10;if(isNaN(u)||0>u||u>h)return void Ds.warn("[Survey Prefill] Invalid rating for q"+r+": "+n[0]+" (scale: 0-"+h+")");i[s]=u;break;default:Ds.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Ds.error("[Survey Prefill] Error converting q"+r+":",t)}}})),i}(t,e);if(0===Object.keys(r).length)return fu.warn("[Survey Prefill] No valid responses after conversion"),null;var n=Hh(),s=Object.keys(e).map((t=>parseInt(t,10))),a=function(t,e,i){for(var r=0,n={},s=[],a=t.questions.length+1,o=0;t.questions.length>r&&a>o&&(o++,e.includes(r));){var l=t.questions[r];if(!l||!("skipSubmitButton"in l)||!l.skipSubmitButton)break;if(l.id){var u=nu(l.id);Qi(i[u])||(n[u]=i[u])}s.push(r);var h=uv(t,r,l.id?i[nu(l.id)]:null);if(h===Xl.End)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:s};r=h}return{startQuestionIndex:r,skippedResponses:n,skippedIndices:s}}(t,s,r),o=a.startQuestionIndex,l=a.skippedResponses,u=o>=t.questions.length;return Ed(t,{surveySubmissionId:n,responses:r,lastQuestionIndex:o,visitedIndices:a.skippedIndices,surveyLanguage:i}),fu.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:r,submissionId:n,startQuestionIndex:o,isSurveyCompleted:u,skippedResponses:l}}catch(t){return fu.error("[Survey Prefill] Error handling prefill:",t),null}}ue(t,e){var i;if(void 0===e&&(e=void 0),!t)return!0;var r,n=!(null==(i=this._posthog.featureFlags)||!i.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),s=!0;return e&&(s=(null==(r=this._posthog.featureFlags)?void 0:r.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),n&&s}le(t){return!t.conditions||Md(t,this._posthog)&&function(t){var e,i;return function(t,e){var i,r,n;if(!t||0===t.length)return!0;if(!Rs)return!1;var s=_n(Rs,{userAgentDataPlatform:null==Ss||null==(i=Ss.userAgentData)?void 0:i.platform,maxTouchPoints:null==Ss?void 0:Ss.maxTouchPoints,screenWidth:null==xs||null==(r=xs.screen)?void 0:r.width,screenHeight:null==xs||null==(n=xs.screen)?void 0:n.height,devicePixelRatio:null==xs?void 0:xs.devicePixelRatio});return Vh[null!=e?e:"icontains"](t,[s])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(i=t.conditions)?void 0:i.deviceTypesMatchType)}(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==ld||!ld.querySelector(t.conditions.selector))}(t)}ce(t){var e;return xd(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this._posthog.featureFlags)&&e.hasLoadedFlags?{satisfied:this.ue(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,i,r={eligible:!0,reason:void 0};if(!pu(t))return r.eligible=!1,r.reason="Survey is not running. It was completed on "+t.end_date,r;if(!xu.includes(t.type))return r.eligible=!1,r.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",r;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.ue(t.linked_flag_key,n))return r.eligible=!1,r.reason=n?"Survey linked feature flag is not enabled for variant "+n:"Survey linked feature flag is not enabled",r;if(!this.ue(t.targeting_flag_key))return r.eligible=!1,r.reason="Survey targeting feature flag is not enabled",r;var s,a=this.ce(t);return a.satisfied?function(t,e){if(!t||!e)return!0;var i="string"==typeof e?new Date(e):e,r=new Date,n=Math.abs(r.getTime()-i.getTime());return Math.ceil(n/864e5)>t}(null==(i=t.conditions)?void 0:i.seenSurveyWaitPeriodInDays,td.q("lastSeenSurveyDate"))?(t=>!!td.q(_u(t))&&!xd(t))(t)?(r.eligible=!1,r.reason="Survey has already been seen and it can't be activated again",r):r:(r.eligible=!1,r.reason="Survey wait period has not passed",r):(r.eligible=!1,r.reason=null!==(s=a.reason)&&void 0!==s?s:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",r)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.ve(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}ve(t){var e;if(!vu(t)&&!gu(t))return!0;var i=null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)?void 0:e.getSurveys();return!(null==i||!i.includes(t.id))}de(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every((t=>{var e=t.value;return!t.key||!e||this.ue(e)}))}K(t){return this.checkSurveyEligibility(t).eligible&&this.le(t)&&this.ve(t)&&this.de(t)}re(t){try{var e=Ev.querySelector(Ld(t,!0));null!=e&&e.shadowRoot&&gl(null,e.shadowRoot),null==e||e.remove()}catch(e){fu.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.G,removeSurveyFromFocus:this.Y,surveyInFocus:this.oe,surveyTimeouts:this.B,handleWidget:this.J,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.ne,sortSurveysByAppearanceDelay:this.ae,checkFlags:this.de.bind(this),isSurveyFeatureFlagEnabled:this.ue.bind(this)}}}function Ov(t,e){if(Ev&&Tv){var i,r=new Lv(t);if(t.config.disable_surveys_automatic_display)return fu.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),r;if(!1===e)return fu.info("There are no surveys to load or Surveys is disabled in the project settings."),r;r.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Qi(i)&&(i=setInterval((()=>{r.callSurveysAndEvaluateDisplayLogic(!1)}),1e3))};return n(),Zs(Ev,"visibilitychange",(()=>{Ev.hidden?Qi(i)||(clearInterval(i),i=void 0):(r.callSurveysAndEvaluateDisplayLogic(!1),n())})),r}}function Fv(t){var e=t.survey,i=t.removeSurveyFromFocus,r=void 0===i?()=>{}:i,n=t.setSurveyVisible,s=t.isPreviewMode,a=void 0!==s&&s,o=t.posthog;Ll((()=>{var t;if(!a&&null!=(t=e.conditions)&&t.url){var i=()=>{var t,i=e.type===Kl.Widget,s=Md(e,o),a=(null==(t=e.appearance)?void 0:t.widgetType)===Gl.Tab&&i;if(!s)return fu.info("Hiding survey "+e.id+" because URL does not match"),n(!1),r(e);a&&(fu.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};Zs(Tv,"popstate",i),Zs(Tv,"hashchange",i);var s=Tv.history.pushState,l=Tv.history.replaceState;return Tv.history.pushState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];s.apply(this,e),i()},Tv.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];l.apply(this,e),i()},()=>{Tv.removeEventListener("popstate",i),Tv.removeEventListener("hashchange",i),Tv.history.pushState=s,Tv.history.replaceState=l}}}),[a,e,r,n,o])}function Av(t){switch(void 0===t&&(t=Jl.Right),t){case Jl.Top:return{top:"0",left:"50%",transform:"translateX(-50%)"};case Jl.Left:return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case Jl.Bottom:return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Dv(t){var e,r,n,s,a,o,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.style,v=void 0===d?{}:d,c=t.previewPageIndex,f=t.removeSurveyFromFocus,p=void 0===f?()=>{}:f,g=t.isPopup,m=void 0===g||g,y=t.onPreviewSubmit,b=void 0===y?()=>{}:y,_=t.onPreviewBack,w=void 0===_?()=>{}:_,x=t.onPopupSurveyDismissed,k=void 0===x?()=>{}:x,S=t.onCloseConfirmationMessage,C=void 0===S?()=>{}:S,M=t.properties,T=t.isSurveyCompleted,E=t.skipShownEvent,I=t.surveyLanguage,P=Ol(null),R=Number.isInteger(c),L=null!=(e=l.appearance)&&e.surveyPopupDelaySeconds?1e3*l.appearance.surveyPopupDelaySeconds:0,O=function(t,e,r,n,s,a,o,l,u){var h=Rl(n||0===r||t.type===Kl.ExternalSurvey),d=h[0],v=h[1],c=Rl(!1),f=c[0],p=c[1],g=()=>{var e=()=>{a&&s(t),v(!1)};Ev.startViewTransition?Ev.startViewTransition((()=>{var t;null==o||null==(t=o.current)||t.remove()})).finished.then((()=>{setTimeout((()=>{e()}),100)})):e()},m=e=>{e.detail.surveyId===t.id&&g()};return Ll((()=>{if(e){if(!n){var s=e=>{var i,r;if(e.detail.surveyId===t.id){if(null==(i=t.appearance)||!i.displayThankYouMessage)return g();p(!0),null!=(r=t.appearance)&&r.autoDisappear&&setTimeout((()=>{g()}),5e3)}},a=()=>{if(Md(t,e)){v(!0),Tv.dispatchEvent(new Event("PHSurveyShown")),l||e.capture(eu.SHOWN,i({[iu.SURVEY_NAME]:t.name,[iu.SURVEY_ID]:t.id,[iu.SURVEY_ITERATION]:t.current_iteration,[iu.SURVEY_ITERATION_START_DATE]:t.current_iteration_start_date},u&&{[iu.SURVEY_LANGUAGE]:u},{sessionRecordingUrl:null==e.get_session_replay_url?void 0:e.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};if(Zs(Tv,"PHSurveyClosed",m),Zs(Tv,"PHSurveySent",s),r>0){var o=setTimeout(a,r);return()=>{clearTimeout(o),Tv.removeEventListener("PHSurveyClosed",m),Tv.removeEventListener("PHSurveySent",s)}}return a(),()=>{Tv.removeEventListener("PHSurveyClosed",m),Tv.removeEventListener("PHSurveySent",s)}}}else fu.error("usePopupVisibility hook called without a PostHog instance.")}),[]),Fv({survey:t,removeSurveyFromFocus:s,setSurveyVisible:v,isPreviewMode:n,posthog:e}),{isPopupVisible:d,isSurveySent:f,setIsPopupVisible:v,hidePopupWithViewTransition:g}}(l,h,L,R,p,m,P,E,I),F=O.isPopupVisible,A=O.hidePopupWithViewTransition,D=O.isSurveySent||c===l.questions.length||!0===T,N=Fl((()=>{var t=Id(l),e=(null==t?void 0:t.surveySubmissionId)||Hh();return{isPreviewMode:R,previewPageIndex:c,onPopupSurveyDismissed(){I?md(l,h,R,I):md(l,h,R),k()},isPopup:m||!1,surveySubmissionId:e,onPreviewSubmit:b,onPreviewBack:w,posthog:h,properties:M,surveyLanguage:I}}),[R,c,m,h,l,k,b,w,M,I]);return F?Ad(kd.Provider,{value:N,children:Ad("div",{className:"ph-survey",style:i({},Od(l.type,null==(r=l.appearance)?void 0:r.position,null==(n=l.appearance)?void 0:n.widgetType),v),ref:P,children:D?Ad(Jd,{header:(null==(s=l.appearance)?void 0:s.thankYouMessageHeader)||"Thank you!",description:(null==(a=l.appearance)?void 0:a.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null==(o=l.appearance)?void 0:o.thankYouMessageDescriptionContentType,appearance:l.appearance||hd,onClose(){A(),C()}}):Ad($v,{survey:l,forceDisableHtml:!!u,posthog:h})})}):null}function $v(t){var e,r,n=t.survey,s=t.forceDisableHtml,a=t.posthog,o=Fl((()=>{var t=Id(n);if(!t)return null;var e=tr(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&n.questions.length>t.lastQuestionIndex?t:(Rd(n),null)}),[n]),l=Rl((()=>(null!=o&&o.responses&&fu.info("Survey is already in progress, filling in initial responses"),(null==o?void 0:o.responses)||{}))),u=l[0],h=l[1],d=Al(kd),v=d.previewPageIndex,c=d.onPopupSurveyDismissed,f=d.isPopup,p=d.onPreviewSubmit,g=d.onPreviewBack,m=d.surveySubmissionId,y=d.isPreviewMode,b=d.properties,_=d.surveyLanguage,w=Rl((()=>{var t=null==o?void 0:o.lastQuestionIndex,e=tr(t)&&t>=0&&n.questions.length>t?t:0;return v||e})),x=w[0],k=w[1],S=Rl((()=>{var t;return(null!==(t=null==o?void 0:o.visitedIndices)&&void 0!==t?t:[]).filter((t=>t>=0&&n.questions.length>t))})),C=S[0],M=S[1],T=Fl((()=>wd(n)),[n]);Ll((()=>{y&&!Qi(v)&&k(v)}),[v,y]);var E=!(null==(e=n.appearance)||!e.allowGoBack)&&(y?(null!=v?v:0)>0:C.length>0),I=T.at(x);return I?Ad("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(r=n.appearance)?void 0:r.hideCancelButton)&&Ad(Gd,{onClick(){c()}}),Ad("div",{className:"survey-box","data-question-index":x,children:qv({question:I,forceDisableHtml:s,displayQuestionIndex:x,appearance:n.appearance||hd,onSubmit:t=>(t=>{var e=t.res,r=t.displayQuestionIndex,s=t.questionId;if(a)if(s){var o=nu(s),l=i({},u,{[o]:e});h(l);var d=uv(n,r,e),v=d===Xl.End,c=[...C,r];if(v||(M(c),k(d),Ed(n,{surveySubmissionId:m,responses:l,lastQuestionIndex:d,visitedIndices:c,surveyLanguage:_})),n.enable_partial_responses||v){var f=new Set(c.map((t=>{var e;return null==(e=T[t])?void 0:e.id})).filter((t=>!!t)).map((t=>nu(t)))),p=Object.fromEntries(Object.entries(l).filter((t=>f.has(t[0]))));pd({responses:p,survey:n,surveySubmissionId:m,isSurveyCompleted:v,posthog:a,properties:b,surveyLanguage:_})}}else fu.error("onNextButtonClick called without a questionId.");else fu.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:x,questionId:I.id}),onPreviewSubmit:p,initialValue:I.id?u[nu(I.id)]:void 0,canGoBack:E,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);M(e),k(t),Ed(n,{surveySubmissionId:m,responses:u,lastQuestionIndex:t,visitedIndices:e,surveyLanguage:_})}}})})]}):null}function Nv(t){var e,i,r,n,s,a,o,l=t.survey,u=t.forceDisableHtml,h=t.posthog,d=t.readOnly,v=t.surveyLanguage,c=Rl(!0),f=c[0],p=c[1],g=Rl(!1),m=g[0],y=g[1],b=Rl({}),_=b[0],w=b[1],x=()=>{y(!m)};if(Ll((()=>{var t;if(h){if(!d){"tab"===(null==(t=l.appearance)?void 0:t.widgetType)&&w({top:"50%",bottom:"auto"});var e=t=>{var e,i=t;(null==(e=i.detail)?void 0:e.surveyId)===l.id&&(fu.info("Received show event for feedback button survey "+l.id),w(i.detail.position||{}),x())};return Zs(Tv,Iv,e),()=>{Tv.removeEventListener(Iv,e)}}}else fu.error("FeedbackWidget called without a PostHog instance.")}),[h,d,l.id,null==(e=l.appearance)?void 0:e.widgetType,null==(i=l.appearance)?void 0:i.widgetSelector,null==(r=l.appearance)?void 0:r.borderColor]),Fv({survey:l,setSurveyVisible:p,posthog:h}),!f)return null;var k=()=>{l.schedule!==tu&&p(!1),setTimeout((()=>{y(!1)}),200)};return Ad(Jo,{children:["tab"===(null==(n=l.appearance)?void 0:n.widgetType)&&Ad("button",{className:"ph-survey-widget-tab "+((null==(s=l.appearance)?void 0:s.tabPosition)===Jl.Top?"widget-tab-top":""),onClick:x,disabled:d,style:Av(null==(a=l.appearance)?void 0:a.tabPosition),children:(null==(o=l.appearance)?void 0:o.widgetLabel)||""}),m&&Ad(Dv,{posthog:h,survey:l,forceDisableHtml:u,style:_,onPopupSurveyDismissed:k,onCloseConfirmationMessage:k,surveyLanguage:v})]})}var qv=t=>{var e=t.question,r=t.onSubmit,n=t.onPreviewSubmit,s={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){n(t)},onSubmit(t){r(t)},initialValue:t.initialValue,displayQuestionIndex:t.displayQuestionIndex,canGoBack:t.canGoBack,onBack:t.onBack};switch(e.type){case Yl.Open:return Go(Yd,i({},s,{question:e,key:e.id}));case Yl.Link:return Go(Xd,i({},s,{question:e,key:e.id}));case Yl.Rating:return Go(tv,i({},s,{question:e,key:e.id}));case Yl.SingleChoice:case Yl.MultipleChoice:return Go(iv,i({},s,{question:e,key:e.id}));default:return fu.error("Unsupported question type: "+e.type),null}};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.generateSurveys=Ov,Mo.extendPostHogWithSurveys=Ov;var jv=(t,e,i)=>i.remaining>0?e.length>i.remaining?(t.push(e.slice(0,i.remaining)),i.remaining=0,i.truncated=!0,!1):(t.push(e),i.remaining-=e.length,!0):(i.truncated=!0,!1),Bv=(t,e,i)=>{var r=JSON.stringify(t);if(i.remaining>=r.length)return jv(e,r,i);if(i.truncated=!0,2>i.remaining)return!1;for(var n=0,s=Math.min(t.length,i.remaining-2);s>n;){var a=Math.ceil((n+s)/2);JSON.stringify(t.slice(0,a)).length>i.remaining?s=a-1:n=a}return jv(e,JSON.stringify(t.slice(0,n)),i)},Hv=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Uv=(t,e,i)=>{if(!i.truncated){if(i.keysRemaining-=1,i.sizeRemaining-=String(e).length+t.length,0>=i.keysRemaining||0>=i.sizeRemaining)return i.truncated=!0,void(i.result.attributes_truncated=!0);i.result[t]=e}},zv=(t,e,i)=>{if(!i.truncated)if(Zi(t)){if(i.seen.has(t))return void Uv(e||"circular","[Circular]",i);i.seen.add(t);try{for(var r in t)try{if(!{}.hasOwnProperty.call(t,r))continue;if(zv(t[r],e?e+"."+r:r,i),i.truncated)return}catch(t){continue}}catch(t){}}else Uv(e,t,i)},Wv=function(t,e,i,r,n,s){if(void 0===n&&(n=!1),!Hv(t))return!n||jv(e,"null",i);if(Yi(t)||(t=>{try{return tr(t)||ir(t)}catch(t){return!1}})(t))return jv(e,JSON.stringify(t),i);if("string"==typeof t)return Bv(t,e,i);if(!Zi(t)&&!Wi(t))return jv(e,JSON.stringify(t),i);if(r.has(t))return Bv("[Circular]",e,i);r.add(t);try{var a=t.toJSON;if(Vi(a))return Wv(a.call(t),e,i,r,n)}catch(t){}try{var o={}.toString.call(t);if("[object String]"===o)return Bv(String(t.valueOf()),e,i);if("[object Number]"===o||"[object Boolean]"===o)return jv(e,JSON.stringify(t.valueOf()),i)}catch(t){}if(t instanceof Error){var l={};try{for(var u in t)({}).hasOwnProperty.call(t,u)&&(l[u]=t[u])}catch(t){}try{l.name=t.name}catch(t){}try{l.message=t.message}catch(t){}try{l.stack=t.stack}catch(t){}return Wv(l,e,i,r,n,s)}if(Wi(t)){if(!jv(e,"[",i))return!1;for(var h=0;t.length>h;h++){if(h>0&&!jv(e,",",i))return!1;var d=void 0;try{d=t[h]}catch(t){d=void 0}if(!Wv(d,e,i,r,!0))return!1}return jv(e,"]",i)}if(!jv(e,"{",i))return!1;var v=!0;try{for(var c in t)if({}.hasOwnProperty.call(t,c)){if(0>=i.remaining)return i.truncated=!0,!1;var f=void 0;try{f=t[c]}catch(t){continue}if(s)try{zv(f,c,s)}catch(t){}if(Hv(f)){var p=(v?"":",")+JSON.stringify(c)+":";if(p.length>=i.remaining)return i.truncated=!0,!1;var g=e.length,m=i.remaining,y=i.truncated;if(!jv(e,p,i))return!1;var b=e.length,_=Wv(f,e,i,r,!1),w=i.truncated;if(e.length!==b){if(v=!1,!_)return!1}else if(e.length=g,i.remaining=m,i.truncated=_?y:w,!_)return!1}}}catch(t){}return jv(e,"}",i)},Vv={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.logs={initializeLogs(t){var e={host:Mo.location.host},r=!1,n=function(n){var s=Mo.console[n],a=(s=>function(){for(var a=!1,o=arguments.length,l=new Array(o),u=0;o>u;u++)l[u]=arguments[u];try{if(l.length>0&&!r&&t.is_capturing()){var h;r=!0,a=!0;var d=((t,e)=>{for(var i=[],r={remaining:1e4,truncated:!1},n=Zi(t[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([t[0]])}:void 0,s=0;t.length>s&&(0>=s||jv(i," ",r))&&Wv(t[s],i,r,new WeakSet,!1,0===s?n:void 0);s++);return{body:i.join("")+(r.truncated?"...":""),truncated:r.truncated,attributes:(null==n?void 0:n.result)||{}}})(l),v=d.body,c=d.attributes,f=i({},e,d.truncated?{body_truncated:"true"}:{});null==(h=t.logs)||h.he({level:Vv[n],body:v,attributes:i({"log.source":"console."+n},f,c)})}}catch(t){}finally{a&&(r=!1),s.apply(Mo.console,l)}})(s);a.__rrweb_original__=(t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t})(s),Mo.console[n]=a};for(var s of Object.keys(Vv))n(s)}};var Zv=$s("[Error tracking]");function Gv(){return new Wn([new ns,new fs,new as,new ss,new vs,new ds,new ls,new cs],function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;e>n;n++)r[n-1]=arguments[n];return function(e,n){void 0===n&&(n=0);for(var s=[],a=e.split("\n"),o=n;a.length>o;o++){var l=a[o];if(1024>=l.length){var u=is.test(l)?l.replace(is,"$1"):l;if(!u.match(/\S*Error: /)){for(var h of r){var d=h(u,t);if(d){s.push(d);break}}if(s.length>=rs)break}}}return function(t){if(!t.length)return[];var e=Array.from(t);return e.reverse(),e.slice(0,rs).map((t=>{return i({},t,{filename:t.filename||(r=e,r[r.length-1]||{}).filename,function:t.function||Vn});var r}))}(s)}}("web:javascript",Yn,es))}var Qv=$s("[ExceptionAutocapture]"),Jv=Gv(),Kv={wrapOnError(t){var e=xs;e||Qv.info("window not available, cannot wrap onerror");var i=e.onerror;return e.onerror=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];var a=Jv.buildFromUnknown((t=>{var e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(null!=s)return s;if(Ji(e)&&Ji(i)&&i.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:e,filename:i,lineno:r,colno:n})}catch(t){return e}return e})(n),{mechanism:{handled:!1}});return t(a),!!Vi(i)&&null!==(e=i(...n))&&void 0!==e&&e},e.onerror.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onerror)||delete t.__POSTHOG_INSTRUMENTED__,e.onerror=i}},wrapUnhandledRejection(t){var e=xs;e||Qv.info("window not available, cannot wrap onUnhandledRejection");var i=e.onunhandledrejection;return e.onunhandledrejection=function(e){var r,n=Jv.buildFromUnknown(e,{mechanism:{handled:!1}});return t(n),!!Vi(i)&&null!==(r=i(e))&&void 0!==r&&r},e.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.onunhandledrejection)||delete t.__POSTHOG_INSTRUMENTED__,e.onunhandledrejection=i}},wrapConsoleError(t){var e=console;e||Qv.info("console not available, cannot wrap console.error");var i=e.error;return e.error=function(){for(var e,r=arguments.length,n=new Array(r),s=0;r>s;s++)n[s]=arguments[s];e=1==n.length?n[0]:n.join(" ");var a=n.find((t=>t instanceof Error)),o=Jv.buildFromUnknown(a||e,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2});t(o),Vi(i)&&i(...n)},e.error.__POSTHOG_INSTRUMENTED__=!0,()=>{var t;null==(t=e.error)||delete t.__POSTHOG_INSTRUMENTED__,e.error=i}}};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.errorWrappingFunctions=Kv,Mo.posthogErrorWrappingFunctions=Kv;var Yv="X-POSTHOG-SESSION-ID",Xv="X-POSTHOG-WINDOW-ID",tc="X-POSTHOG-DISTINCT-ID",ec=[Yv,Xv,tc],ic=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],rc=(t,e)=>({}.hasOwnProperty.call(t,e)),nc=t=>"object"==typeof t&&!Yi(t)||Vi(t),sc=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),ac=t=>{try{var e;return sc(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==xs||null==(e=xs.location)?void 0:e.href).toString()}catch(t){return}},oc=(t,e,i,r,n)=>{var s;try{s=new URL(r).hostname}catch(t){return!1}if(!t)return!1;if(Wi(t)&&!t.includes(s))return!1;var a=!1;if(i){var o=i.checkAndGetSessionAndWindowId(!0),l=o.windowId;n.set(Yv,o.sessionId),n.set(Xv,l),a=!0}var u=(t=>Vi(t)?t():t)(e);return u&&u!==_h&&(n.set(tc,u),a=!0),a};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{};var lc={_patchFetch:(t,e,r)=>na(xs,"fetch",(n=>function(s,a){var o=arguments.length>1?[s,a]:[s],l=o;try{var u=ac(s);if(u)if(sc(s)){var h=new Request(s,a);oc(t,e,r,h.url,h.headers),l=[h]}else{var d=new Headers(nc(a)?a.headers:void 0);if(oc(t,e,r,u,d)){var v=((t,e)=>{if(Qi(t)||Yi(t))return{headers:e};if(nc(t)){var r=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(r);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:e,writable:!0}),n}return new Proxy({headers:e},{get:(t,e)=>rc(t,e)?Reflect.get(t,e):Reflect.get(r,e,r),has:(t,e)=>rc(t,e)||e in r,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(r).forEach((t=>e.add(t))),ic.forEach((t=>{t in r&&e.add(t)})),Array.from(e)},getOwnPropertyDescriptor(t,e){var n=Reflect.getOwnPropertyDescriptor(t,e);if(n)return n;if("string"==typeof e&&ic.includes(e)&&e in r)return{configurable:!0,enumerable:!0,get(){return Reflect.get(r,e,r)}};var s=Reflect.getOwnPropertyDescriptor(r,e);return s?i({},s,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(r)})}})(a,d);v&&(l=[s,v])}}}catch(t){l=o}return n.apply(this,l)})),_patchXHR:(t,e,i)=>na(xs.XMLHttpRequest.prototype,"open",(r=>function(n,s,a,o,l){void 0===a&&(a=!0);var u=this,h=new Headers,d=ac(s);d&&oc(t,e,i,d,h);var v=r.call(u,n,s,a,o,l);return ec.forEach((t=>{var e=h.get(t);if(e)try{u.setRequestHeader(t,e)}catch(t){}})),v}))};Mo.__PosthogExtensions__.tracingHeadersPatchFns=lc,Mo.postHogTracingHeadersPatchFns=lc,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,i=Math.trunc(t)||0;return 0>i&&(i+=e),0>i||i>=e?void 0:this[i]},writable:!0,enumerable:!1,configurable:!0});let uc=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(!t.hadRecentInput){var i=this.i[0],r=this.i.at(-1);this.o&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var hc=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},dc=t=>{if("loading"===document.readyState)return"loading";var e=hc();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},vc=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},cc=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r,n=t,s=n.id?"#"+n.id:[vc(n),...Array.from(null!==(r=n.classList)&&void 0!==r?r:[]).sort()].join(".");if(e.length+s.length>99)return e||s;if(e=e?s+">"+e:s,n.id)break;t=n.parentNode}}catch(t){}return e},fc=new WeakMap;function pc(t,e){var i=fc.get(e);return i||(i=new WeakMap,fc.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var gc=-1,mc=()=>gc,yc=t=>{addEventListener("pageshow",(e=>{e.persisted&&(gc=e.timeStamp,t(e))}),!0)},bc=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((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,i),t(e))}},_c=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},wc=()=>{var t,e;return null!==(t=null==(e=hc())?void 0:e.activationStart)&&void 0!==t?t:0},xc=-1,kc=new Set,Sc=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Cc=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of kc)e();isFinite(xc)||(xc="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Cc,!0))}},Mc=function(t){if(void 0===t&&(t=!1),t&&(xc=1/0),0>xc){var e,i=wc(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;xc=null!=r?r:Sc(),addEventListener("visibilitychange",Cc,!0),addEventListener("prerenderingchange",Cc,!0),yc((()=>{setTimeout((()=>{xc=Sc()}))}))}return{get firstHiddenTime(){return xc},onHidden(t){kc.add(t)}}},Tc=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=hc(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>mc()?o&&(document.prerendering||wc()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==o?void 0:o.name),navigationStartTime:a||0}},Ec=function(t,e,r){void 0===r&&(r={});try{var n=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(n.length>0){var s=new PerformanceObserver((t=>{queueMicrotask((()=>{var i=t.getEntries();n.length>1&&i.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(i)}))}));for(var a of n)s.observe(i({type:a,buffered:!0},r));return s}}catch(t){}},Ic=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Pc=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},Rc=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let Lc=class{constructor(){this.u=void 0}};var Oc,Fc=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Ac=[1800,3e3],Dc=function(t,e){void 0===e&&(e={});var i=Ic(e);Fc((()=>{var r,n=pc(e,Lc),s=Mc(),a=Tc("FCP"),o=Ec(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-wc(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=bc(t,a,Ac,e.reportAllChanges),yc((i=>{a=Tc("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,mc()),r=bc(t,a,Ac,e.reportAllChanges),_c((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&Ec(["soft-navigation"],(i=>{i.forEach((i=>{n.u&&i.navigationId&&Pc(n.u,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=Tc("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=bc(t,a,Ac,e.reportAllChanges))(!0)}))}),e)}))},$c=[.1,.25],Nc=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],qc=0,jc=1/0,Bc=0,Hc=t=>{for(var e of t)e.interactionId&&(jc=Math.min(jc,e.interactionId),Bc=Math.max(Bc,e.interactionId),qc=Bc?(Bc-jc)/7+1:0)},Uc=()=>{var t;return Oc?qc:null!==(t=performance.interactionCount)&&void 0!==t?t:0},zc=0;let Wc=class{constructor(){this.h=[],this.v=new Map,this.p=void 0,this.m=void 0}M(){zc=Uc(),this.h.length=0,this.v.clear()}T(t){var e=Uc()-zc,i=Math.min(this.h.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.h[i]:{D:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.h.at(-1),r=this.v.get(t.interactionId);if(r||10>this.h.length||t.duration>i.D){var n;if(r?t.duration>r.D?(r.entries=[t],r.D=t.duration):t.duration===r.D&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.v.set((r={id:t.interactionId,entries:[t],D:t.duration}).id,r),this.h.push(r)),this.h.sort(((t,e)=>e.D-t.D)),this.h.length>10){var s=this.h.splice(10);for(var a of s)this.v.delete(a.id)}null==(n=this.m)||n.call(this,r)}}}};var Vc=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Rc(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},Zc=[200,500];let Gc=class{constructor(){this.p=void 0,this.u=void 0}l(t){var e;null==(e=this.p)||e.call(this,t)}};var Qc=[2500,4e3],Jc={onLCP(t,e){void 0===e&&(e={});var r=pc(e=Object.assign({},e),Gc),n=new WeakMap;Ic(e)&&(r.u=new Map),r.p=t=>{var i=t.element;if(i){var r,s=null!==(r=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==r?r:cc(i);n.set(t,s)}else t.id&&n.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var i=!1,r=Ic(e);Fc((()=>{var n,s=Mc(),a=Tc("LCP"),o=pc(e,Gc),l=(r,o,l,u,h)=>{a=Tc("LCP",-1,r,o,l,u,h),n=bc(t,a,Qc,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=Mc(!0))},u=t=>{o.u&&t.navigationId&&Pc(o.u,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-wc(),0),o.l(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.l(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=Ec(d,h);if(v){n=bc(t,a,Qc,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;Vc((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});yc((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,mc()),n=bc(t,a,Qc,e.reportAllChanges),_c((()=>{a.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var s,a,o,l,u,h,d=t.entries.at(-1),v=d.url&&performance.getEntriesByType("resource").find((t=>t.name===d.url));e.target=n.get(d),e.lcpEntry=d,d.url&&(e.url=d.url),v&&(e.lcpResourceEntry=v);var c=0,f=0;if("soft-navigation"!==t.navigationType?(c=null!==(s=null==(a=h=hc())?void 0:a.activationStart)&&void 0!==s?s:0,f=null!==(o=null==(l=h)?void 0:l.responseStart)&&void 0!==o?o:0):(c=t.navigationStartTime||0,h=null==(u=r.u)?void 0:u.get(t.navigationId)),h){var p=Math.max(0,f-c),g=Math.max(p,v?(v.requestStart||v.startTime)-c:0),m=Math.min(t.value,Math.max(g,v?v.responseEnd-c:0));e=i({},e,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:h})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var i=pc(e=Object.assign({},e),uc),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=Nc(t.sources),s=null==n?void 0:n.node;if(s){var a,o=null!==(a=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==a?a:cc(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=Mc();Dc(Rc((()=>{var r,n=Tc("CLS",0),s=pc(e,uc),a=(i,a,o,l,u)=>{n=Tc("CLS",0,i,a,o,l,u),s.o=0,r=bc(t,n,$c,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.o>n.value&&(n.value=s.o,n.entries=s.i),r(t)},l=t=>{o(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.l(e):l(e);o()},h=["layout-shift"];Ic(e)&&h.push("soft-navigation");var d=Ec(h,u);d&&(r=bc(t,n,$c,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),yc((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,mc()),_c(r)})),setTimeout(r))})))}((e=>{t((t=>{var e={};if(t.entries.length){var i,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(i=n.sources)&&i.length){var s=Nc(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:dc(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={});var i=pc(e=Object.assign({},e),Lc);Ic(e)&&(i.u=new Map),Dc((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:dc(mc())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var r=hc(),n=t.entries.at(-1);if(r){var s=Math.max(0,r.responseStart-(r.activationStart||0));e={timeToFirstByte:s,firstByteToFCP:t.value-s,loadState:dc(t.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}}else{var a,o=null==(a=i.u)?void 0:a.get(t.navigationId);o&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:o})}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var r=pc(e=Object.assign({},e),Wc),n=[],s=[],a=0,o=new WeakMap,l=new WeakMap,u=!1,h=()=>{u||(Vc(d),u=!0)},d=()=>{var t=new Set(r.h.map((t=>o.get(t.entries[0])))),e=s.length-10;s=s.filter(((i,r)=>r>=e||t.has(i)));var i=new Set;for(var l of s){var h=v(l.startTime,l.processingEnd);for(var d of h)i.add(d)}n=n.filter((t=>t.startTime>a||i.has(t))),u=!1};r.p=t=>{var i,r=t.startTime+t.duration;a=Math.max(a,t.processingEnd);for(var n=s.length-1;n>=0;n--){var l=s[n];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),e.includeProcessedEventEntries&&i.entries.push(t);break}}i||s.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&o.set(t,i),h()},r.m=t=>{if(!l.get(t)){var i,r=null==(i=t.entries.find((t=>t.target)))?void 0:i.target;if(r){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:cc(r);l.set(t,s)}else{var a,o=null==(a=t.entries.find((t=>t.targetSelector)))?void 0:a.targetSelector;o&&l.set(t,o)}}};var v=(t,e)=>{var i=[];for(var r of n)if(r.startTime+r.duration>=t){if(r.startTime>e)break;i.push(r)}return i};Ec(["long-animation-frame"],(t=>{n=n.concat(t),h()}),e),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=Mc();Fc((()=>{var n;"interactionCount"in performance||Oc||(Oc=Ec(["event"],Hc,{durationThreshold:0}));var s,a=Tc("INP"),o=pc(e,Wc),l=(i,r,n,l,u)=>{o.M(),a=Tc("INP",-1,i,r,n,l,u),s=bc(t,a,Zc,e.reportAllChanges)},u=()=>{var t=o.T(a.navigationType);t&&t.D!==a.value&&(a.value=t.D,a.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),Vc((()=>{for(var i of t)"soft-navigation"!==i.entryType?o.l(i):h(i);u(),e&&s(!0)}))},v=["event","first-input"];Ic(e)&&v.push("soft-navigation");var c=Ec(v,d,i({},e,{durationThreshold:null!==(n=e.durationThreshold)&&void 0!==n?n:40}));s=bc(t,a,Zc,e.reportAllChanges),c&&(r.onHidden((()=>{d(c.takeRecords(),!0)})),yc((()=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,mc())})))}))}}((e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:dc(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var i=t.entries[0],n=o.get(i),s=n.processingStart,a=Math.max(i.startTime+i.duration,s),u=Math.min(n.processingEnd,a),h=n.entries.sort(((t,e)=>t.processingStart-e.processingStart)),d=v(i.startTime,u),c=r.v.get(i.interactionId),f={interactionTarget:l.get(c),interactionType:i.name.startsWith("key")?"keyboard":"pointer",interactionTime:i.startTime,nextPaintTime:a,processedEventEntries:h,longAnimationFrameEntries:d,inputDelay:s-i.startTime,processingDuration:u-s,presentationDelay:a-u,loadState:dc(i.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{var i=t.interactionTime,r=t.nextPaintTime;if(null!=(e=t.longAnimationFrameEntries)&&e.length&&i&&r){var n,s,a=t.inputDelay,o=t.processingDuration,l=0,u=0,h=0,d=0;for(var v of t.longAnimationFrameEntries)for(var c of(u=u+v.startTime+v.duration-v.styleAndLayoutStart,v.scripts)){var f=c.startTime+c.duration;if(f>=i){var p=f-Math.max(i,c.startTime),g=c.duration?p/c.duration*c.forcedStyleAndLayoutDuration:0;l+=p-g,u+=g,p>d&&(s=i+a>c.startTime?"input-delay":i+a+o>c.startTime?"processing-duration":"presentation-delay",n=c,d=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=i+a+o&&(h=r-y),n&&s&&(t.longestScript={entry:n,subpart:s,intersectingDuration:d}),t.totalScriptDuration=l,t.totalStyleAndLayoutDuration=u,t.totalPaintDuration=h,t.totalUnattributedDuration=r-i-l-u-h}})(f),Object.assign(t,{attribution:f})})(e))}),e)}};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Jc,Mo.__PosthogExtensions__.postHogWebVitalsCallbacks=Jc,Mo.postHogWebVitalsCallbacks=Jc;var Kc=-1,Yc=()=>Kc,Xc=t=>{addEventListener("pageshow",(e=>{e.persisted&&(Kc=e.timeStamp,t(e))}),!0)},tf=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((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,i),t(e))}},ef=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},rf=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},nf=()=>{var t,e;return null!==(t=null==(e=rf())?void 0:e.activationStart)&&void 0!==t?t:0},sf=-1,af=new Set,of=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,lf=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of af)e();isFinite(sf)||(sf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",lf,!0))}},uf=function(t){if(void 0===t&&(t=!1),t&&(sf=1/0),0>sf){var e,i=nf(),r=document.prerendering||null==(e=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=i)))?void 0:e.startTime;sf=null!=r?r:of(),addEventListener("visibilitychange",lf,!0),addEventListener("prerenderingchange",lf,!0),Xc((()=>{setTimeout((()=>{sf=of()}))}))}return{get firstHiddenTime(){return sf},onHidden(t){af.add(t)}}},hf=function(t,e,i,r,n,s,a){void 0===e&&(e=-1),void 0===r&&(r=0);var o=rf(),l=(null==o?void 0:o.navigationId)||0,u="navigate";return i?u=i:0>Yc()?o&&(document.prerendering||nf()>0?u="prerender":document.wasDiscarded?u="restore":o.type&&(u=o.type.replace(/_/g,"-"))):u="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:u,navigationId:r||l,navigationInteractionId:n,navigationURL:s||(null==o?void 0:o.name),navigationStartTime:a||0}},df=new WeakMap;function vf(t,e){var i=df.get(e);return i||(i=new WeakMap,df.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}let cf=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var i=this.o[0],r=this.o.at(-1);this.i&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.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 ff=function(t,e,r){void 0===r&&(r={});try{var n=t.filter((t=>PerformanceObserver.supportedEntryTypes.includes(t)));if(n.length>0){var s=new PerformanceObserver((t=>{queueMicrotask((()=>{var i=t.getEntries();n.length>1&&i.sort(((t,e)=>t.startTime+t.duration-(e.startTime+e.duration))),e(i)}))}));for(var a of n)s.observe(i({type:a,buffered:!0},r));return s}}catch(t){}},pf=t=>{var e;return PerformanceObserver.supportedEntryTypes.includes("soft-navigation")&&"function"==typeof(null==(e=globalThis.PerformanceSoftNavigation)||null==(e=e.prototype)?void 0:e.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},gf=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var i=t.keys().next().value;void 0!==i&&t.delete(i)}},mf=t=>{var e=!1;return()=>{e||(t(),e=!0)}};let yf=class{constructor(){this.l=void 0}};var bf,_f=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},wf=[1800,3e3],xf=function(t,e){void 0===e&&(e={});var i=pf(e);_f((()=>{var r,n=vf(e,yf),s=uf(),a=hf("FCP"),o=ff(["paint"],(t=>{for(var e of t)"first-contentful-paint"===e.name&&(o.disconnect(),s.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-nf(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,r(!0)))}));o&&(r=tf(t,a,wf,e.reportAllChanges),Xc((i=>{a=hf("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Yc()),r=tf(t,a,wf,e.reportAllChanges),ef((()=>{a.value=performance.now()-i.timeStamp,r(!0)}))}))),i&&ff(["soft-navigation"],(i=>{i.forEach((i=>{n.l&&i.navigationId&&gf(n.l,i);var s=Math.max((i.presentationTime||i.paintTime||0)-i.startTime,0);a=hf("FCP",s,"soft-navigation",i.navigationId,i.interactionId,i.name,i.startTime),(r=tf(t,a,wf,e.reportAllChanges))(!0)}))}),e)}))},kf=[.1,.25],Sf=0,Cf=1/0,Mf=0,Tf=t=>{for(var e of t)e.interactionId&&(Cf=Math.min(Cf,e.interactionId),Mf=Math.max(Mf,e.interactionId),Sf=Mf?(Mf-Cf)/7+1:0)},Ef=()=>{var t;return bf?Sf:null!==(t=performance.interactionCount)&&void 0!==t?t:0},If=0;let Pf=class{constructor(){this.u=[],this.v=new Map,this.m=void 0,this.p=void 0}T(){If=Ef(),this.u.length=0,this.v.clear()}M(t){var e=Ef()-If,i=Math.min(this.u.length-1,Math.floor(e/50));return!e||-1!==i||"soft-navigation"!==t&&"back-forward-cache"!==t?this.u[i]:{_:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.u.at(-1),r=this.v.get(t.interactionId);if(r||10>this.u.length||t.duration>i._){var n;if(r?t.duration>r._?(r.entries=[t],r._=t.duration):t.duration===r._&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.v.set((r={id:t.interactionId,entries:[t],_:t.duration}).id,r),this.u.push(r)),this.u.sort(((t,e)=>e._-t._)),this.u.length>10){var s=this.u.splice(10);for(var a of s)this.v.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}};var Rf=t=>{var e="requestIdleCallback"in globalThis?1e3:0,i=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=mf(t),s=-1,a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=i((()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()}),{timeout:e})}},Lf=[200,500];let Of=class{constructor(){this.m=void 0,this.l=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}};var Ff=[2500,4e3],Af={onLCP(t,e){void 0===e&&(e={});var i=!1,r=pf(e);_f((()=>{var n,s=uf(),a=hf("LCP"),o=vf(e,Of),l=(r,o,l,u,h)=>{a=hf("LCP",-1,r,o,l,u,h),n=tf(t,a,Ff,e.reportAllChanges),i=!1,"soft-navigation"===r&&(s=uf(!0))},u=t=>{o.l&&t.navigationId&&gf(o.l,t),i||n(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var i of(e.reportAllChanges||r||(t=t.slice(-1)),t))if(i)if("soft-navigation"!==i.entryType){var l=0,h=[],d=i.startTime;if("largest-contentful-paint"===i.entryType)l=Math.max(i.startTime-nf(),0),o.h(i),h=[i];else if("interaction-contentful-paint"===i.entryType){var v,c=i;if(!a.navigationId)continue;if("interactionId"in c&&c.interactionId!=a.navigationInteractionId)continue;d=(null==(v=c.largestContentfulPaint)?void 0:v.renderTime)||0,l=Math.max(d-i.startTime,0),c.largestContentfulPaint&&(o.h(c.largestContentfulPaint),h=[c.largestContentfulPaint])}s.firstHiddenTime>d&&(a.value=l,a.entries=h,n())}else u(i)},d=["largest-contentful-paint"];r&&d.push("interaction-contentful-paint","soft-navigation");var v=ff(d,h);if(v){n=tf(t,a,Ff,e.reportAllChanges);var c=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!i){var e=a.id;Rf((()=>{if(!i){if(!r)for(var t of(v.disconnect(),c))removeEventListener(t,f,{capture:!0});e===a.id&&(i=!0,n(!0))}}))}};for(var p of c)addEventListener(p,f,{capture:!0});Xc((r=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Yc()),n=tf(t,a,Ff,e.reportAllChanges),ef((()=>{a.value=performance.now()-r.timeStamp,i=!0,n(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var i=uf();xf(mf((()=>{var r,n=hf("CLS",0),s=vf(e,cf),a=(i,a,o,l,u)=>{n=hf("CLS",0,i,a,o,l,u),s.i=0,r=tf(t,n,kf,e.reportAllChanges)},o=function(t){void 0===t&&(t=!1),s.i>n.value&&(n.value=s.i,n.entries=s.o),r(t)},l=t=>{o(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},u=t=>{for(var e of t)"soft-navigation"!==e.entryType?s.h(e):l(e);o()},h=["layout-shift"];pf(e)&&h.push("soft-navigation");var d=ff(h,u);d&&(r=tf(t,n,kf,e.reportAllChanges),i.onHidden((()=>{u(d.takeRecords()),r(!0)})),Xc((()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Yc()),ef(r)})),setTimeout(r))})))},onFCP:xf,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var r=uf();_f((()=>{var n;"interactionCount"in performance||bf||(bf=ff(["event"],Tf,{durationThreshold:0}));var s,a=hf("INP"),o=vf(e,Pf),l=(i,r,n,l,u)=>{o.T(),a=hf("INP",-1,i,r,n,l,u),s=tf(t,a,Lf,e.reportAllChanges)},u=()=>{var t=o.M(a.navigationType);t&&t._!==a.value&&(a.value=t._,a.entries=t.entries,s())},h=t=>{u(),s(!0),l("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},d=function(t,e){void 0===e&&(e=!1),Rf((()=>{for(var i of t)"soft-navigation"!==i.entryType?o.h(i):h(i);u(),e&&s(!0)}))},v=["event","first-input"];pf(e)&&v.push("soft-navigation");var c=ff(v,d,i({},e,{durationThreshold:null!==(n=e.durationThreshold)&&void 0!==n?n:40}));s=tf(t,a,Lf,e.reportAllChanges),c&&(r.onHidden((()=>{d(c.takeRecords(),!0)})),Xc((()=>{l("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Yc())})))}))}}};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=Af,Mo.__PosthogExtensions__.postHogWebVitalsCallbacks=Af,Mo.postHogWebVitalsCallbacks=Af,Mo.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Af;let Df=class{constructor(){this.t=void 0,this.o=0,this.i=[]}u(t){var e;if(!t.hadRecentInput){var i=this.i[0],r=this.i.at(-1);this.o&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}};var $f=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Nf=t=>{if("loading"===document.readyState)return"loading";var e=$f();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},qf=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},jf=t=>{var e="";try{for(;9!==(null==(i=t)?void 0:i.nodeType);){var i,r=t,n=r.id?"#"+r.id:[qf(r),...Array.from(r.classList).sort()].join(".");if(e.length+n.length>99)return e||n;if(e=e?n+">"+e:n,r.id)break;t=r.parentNode}}catch(t){}return e},Bf=new WeakMap;function Hf(t,e){var i=Bf.get(e);return i||(i=new WeakMap,Bf.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}var Uf,zf=-1,Wf=()=>zf,Vf=t=>{addEventListener("pageshow",(e=>{e.persisted&&(zf=e.timeStamp,t(e))}),!0)},Zf=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((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,i),t(e))}},Gf=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},Qf=()=>{var t,e;return null!==(t=null==(e=$f())?void 0:e.activationStart)&&void 0!==t?t:0},Jf=function(t,e){void 0===e&&(e=-1);var i=$f(),r="navigate";return 0>Wf()?i&&(document.prerendering||Qf()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-"))):r="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Kf=function(t,e,r){void 0===r&&(r={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return n.observe(i({type:t,buffered:!0},r)),n}}catch(t){}},Yf=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Xf=-1,tp=new Set,ep=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,ip=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of tp)e();isFinite(Xf)||(Xf="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",ip,!0))}},rp=()=>{if(0>Xf){var t,e=Qf(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;Xf=null!=i?i:ep(),addEventListener("visibilitychange",ip,!0),addEventListener("prerenderingchange",ip,!0),Vf((()=>{setTimeout((()=>{Xf=ep()}))}))}return{get firstHiddenTime(){return Xf},onHidden(t){tp.add(t)}}},np=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},sp=[1800,3e3],ap=function(t,e){void 0===e&&(e={}),np((()=>{var i,r=rp(),n=Jf("FCP"),s=Kf("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-Qf(),0),n.entries.push(e),i(!0)))}));s&&(i=Zf(t,n,sp,e.reportAllChanges),Vf((r=>{n=Jf("FCP"),i=Zf(t,n,sp,e.reportAllChanges),Gf((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},op=[.1,.25],lp=t=>t.find((t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)}))||t[0],up=0,hp=1/0,dp=0,vp=t=>{for(var e of t)e.interactionId&&(hp=Math.min(hp,e.interactionId),dp=Math.max(dp,e.interactionId),up=dp?(dp-hp)/7+1:0)},cp=()=>{var t;return Uf?up:null!==(t=performance.interactionCount)&&void 0!==t?t:0},fp=0;let pp=class{constructor(){this.l=[],this.h=new Map,this.m=void 0,this.p=void 0}v(){fp=cp(),this.l.length=0,this.h.clear()}M(){var t=Math.min(this.l.length-1,Math.floor((cp()-fp)/50));return this.l[t]}u(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.l.at(-1),r=this.h.get(t.interactionId);if(r||10>this.l.length||t.duration>i.T){var n;if(r?t.duration>r.T?(r.entries=[t],r.T=t.duration):t.duration===r.T&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.h.set((r={id:t.interactionId,entries:[t],T:t.duration}).id,r),this.l.push(r)),this.l.sort(((t,e)=>e.T-t.T)),this.l.length>10){var s=this.l.splice(10);for(var a of s)this.h.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}};var gp=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=Yf(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},mp=[200,500];let yp=class{constructor(){this.m=void 0}u(t){var e;null==(e=this.m)||e.call(this,t)}};var $=[2500,4e3],bp={onLCP(t,e){void 0===e&&(e={});var r=Hf(e=Object.assign({},e),yp),n=new WeakMap;r.m=t=>{var i=t.element;if(i){var r,s=null!==(r=null==e.generateTarget?void 0:e.generateTarget(i))&&void 0!==r?r:jf(i);n.set(t,s)}else t.id&&n.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={}),np((()=>{var i,r=rp(),n=Jf("LCP"),s=Hf(e,yp),a=t=>{for(var a of(e.reportAllChanges||(t=t.slice(-1)),t))s.u(a),r.firstHiddenTime>a.startTime&&(n.value=Math.max(a.startTime-Qf(),0),n.entries=[a],i())},o=Kf("largest-contentful-paint",a);if(o){i=Zf(t,n,$,e.reportAllChanges);var l=Yf((()=>{a(o.takeRecords()),o.disconnect(),i(!0)})),u=t=>{t.isTrusted&&(gp(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});Vf((r=>{n=Jf("LCP"),i=Zf(t,n,$,e.reportAllChanges),Gf((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))}))}}))}((e=>{t((t=>{var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var r=t.entries.at(-1),s=r.url&&performance.getEntriesByType("resource").find((t=>t.name===r.url));e.target=n.get(r),e.lcpEntry=r,r.url&&(e.url=r.url),s&&(e.lcpResourceEntry=s);var a=$f();if(a){var o=a.activationStart||0,l=Math.max(0,a.responseStart-o),u=Math.max(l,s?(s.requestStart||s.startTime)-o:0),h=Math.min(t.value,Math.max(u,s?s.responseEnd-o:0));e=i({},e,{timeToFirstByte:l,resourceLoadDelay:u-l,resourceLoadDuration:h-u,elementRenderDelay:t.value-h,navigationEntry:a})}}return Object.assign(t,{attribution:e})})(e))}),e)},onCLS(t,e){void 0===e&&(e={});var i=Hf(e=Object.assign({},e),Df),r=new WeakMap;i.t=t=>{var i;if(null!=t&&null!=(i=t.sources)&&i.length){var n=lp(t.sources),s=null==n?void 0:n.node;if(s){var a,o=null!==(a=null==e.generateTarget?void 0:e.generateTarget(s))&&void 0!==a?a:jf(s);r.set(n,o)}}},function(t,e){void 0===e&&(e={});var i=rp();ap(Yf((()=>{var r,n=Jf("CLS",0),s=Hf(e,Df),a=t=>{for(var e of t)s.u(e);s.o>n.value&&(n.value=s.o,n.entries=s.i,r())},o=Kf("layout-shift",a);o&&(r=Zf(t,n,op,e.reportAllChanges),i.onHidden((()=>{a(o.takeRecords()),r(!0)})),Vf((()=>{s.o=0,n=Jf("CLS",0),r=Zf(t,n,op,e.reportAllChanges),Gf(r)})),setTimeout(r))})))}((e=>{t((t=>{var e={};if(t.entries.length){var i,n=t.entries.reduce(((t,e)=>t.value>e.value?t:e));if(null!=n&&null!=(i=n.sources)&&i.length){var s=lp(n.sources);s&&(e={largestShiftTarget:r.get(s),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:s,largestShiftEntry:n,loadState:Nf(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))}),e)},onFCP(t,e){void 0===e&&(e={}),ap((e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Nf(Wf())};if(t.entries.length){var i=$f(),r=t.entries.at(-1);if(i){var n=Math.max(0,i.responseStart-(i.activationStart||0));e={timeToFirstByte:n,firstByteToFCP:t.value-n,loadState:Nf(t.entries[0].startTime),navigationEntry:i,fcpEntry:r}}}return Object.assign(t,{attribution:e})})(e))}),e)},onINP(t,e){void 0===e&&(e={});var i=Hf(e=Object.assign({},e),pp),r=[],n=[],s=0,a=new WeakMap,o=new WeakMap,l=!1,u=()=>{l||(gp(h),l=!0)},h=()=>{var t=new Set(i.l.map((t=>a.get(t.entries[0])))),e=n.length-10;n=n.filter(((i,r)=>r>=e||t.has(i)));var o=new Set;for(var u of n){var h=d(u.startTime,u.processingEnd);for(var v of h)o.add(v)}r=r.filter((t=>t.startTime>s||o.has(t))),l=!1};i.m=t=>{var i,r=t.startTime+t.duration;s=Math.max(s,t.processingEnd);for(var o=n.length-1;o>=0;o--){var l=n[o];if(8>=Math.abs(r-l.renderTime)){(i=l).startTime=Math.min(t.startTime,i.startTime),i.processingStart=Math.min(t.processingStart,i.processingStart),i.processingEnd=Math.max(t.processingEnd,i.processingEnd),!1!==e.includeProcessedEventEntries&&i.entries.push(t);break}}i||n.push(i={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:!1!==e.includeProcessedEventEntries?[t]:[]}),(t.interactionId||"first-input"===t.entryType)&&a.set(t,i),u()},i.p=t=>{if(!o.get(t)){var i,r=null==(i=t.entries.find((t=>t.target)))?void 0:i.target;if(r){var n,s=null!==(n=null==e.generateTarget?void 0:e.generateTarget(r))&&void 0!==n?n:jf(r);o.set(t,s)}else{var a,l=null==(a=t.entries.find((t=>t.targetSelector)))?void 0:a.targetSelector;l&&o.set(t,l)}}};var d=(t,e)=>{var i=[];for(var n of r)if(n.startTime+n.duration>=t){if(n.startTime>e)break;i.push(n)}return i};Kf("long-animation-frame",(t=>{r=r.concat(t),u()})),function(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=rp();np((()=>{var r;"interactionCount"in performance||Uf||(Uf=Kf("event",vp,{durationThreshold:0}));var n,s=Jf("INP"),a=Hf(e,pp),o=t=>{gp((()=>{for(var e of t)a.u(e);var i=a.M();i&&i.T!==s.value&&(s.value=i.T,s.entries=i.entries,n())}))},l=Kf("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=Zf(t,s,mp,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{o(l.takeRecords()),n(!0)})),Vf((()=>{a.v(),s=Jf("INP"),n=Zf(t,s,mp,e.reportAllChanges)})))}))}}((e=>{t((t=>{var e=t.entries[0],r=a.get(e),n=e.processingStart,s=Math.max(e.startTime+e.duration,n),l=Math.min(r.processingEnd,s),u=r.entries.sort(((t,e)=>t.processingStart-e.processingStart)),h=d(e.startTime,l),v=i.h.get(e.interactionId),c={interactionTarget:o.get(v),interactionType:e.name.startsWith("key")?"keyboard":"pointer",interactionTime:e.startTime,nextPaintTime:s,processedEventEntries:u,longAnimationFrameEntries:h,inputDelay:n-e.startTime,processingDuration:l-n,presentationDelay:s-l,loadState:Nf(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{if(null!=(e=t.longAnimationFrameEntries)&&e.length){var i,r,n=t.interactionTime,s=t.inputDelay,a=t.processingDuration,o=0,l=0,u=0,h=0;for(var d of t.longAnimationFrameEntries)for(var v of(l=l+d.startTime+d.duration-d.styleAndLayoutStart,d.scripts)){var c=v.startTime+v.duration;if(c>=n){var f=c-Math.max(n,v.startTime),p=v.duration?f/v.duration*v.forcedStyleAndLayoutDuration:0;o+=f-p,l+=p,f>h&&(r=n+s>v.startTime?"input-delay":n+s+a>v.startTime?"processing-duration":"presentation-delay",i=v,h=f)}}var g=t.longAnimationFrameEntries.at(-1),m=g?g.startTime+g.duration:0;m>=n+s+a&&(u=t.nextPaintTime-m),i&&r&&(t.longestScript={entry:i,subpart:r,intersectingDuration:h}),t.totalScriptDuration=o,t.totalStyleAndLayoutDuration=l,t.totalPaintDuration=u,t.totalUnattributedDuration=t.nextPaintTime-n-o-l-u}})(c),Object.assign(t,{attribution:c})})(e))}),e)}};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=bp,Mo.__PosthogExtensions__.postHogWebVitalsCallbacks=bp,Mo.postHogWebVitalsCallbacks=bp;var _p=-1,wp=t=>{addEventListener("pageshow",(e=>{e.persisted&&(_p=e.timeStamp,t(e))}),!0)},xp=(t,e,i,r)=>{var n,s;return a=>{e.value>=0&&(a||r)&&((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,i),t(e))}},kp=t=>{requestAnimationFrame((()=>requestAnimationFrame(t)))},Sp=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Cp=()=>{var t,e;return null!==(t=null==(e=Sp())?void 0:e.activationStart)&&void 0!==t?t:0},Mp=function(t,e){void 0===e&&(e=-1);var i=Sp(),r="navigate";return 0>_p?i&&(document.prerendering||Cp()>0?r="prerender":document.wasDiscarded?r="restore":i.type&&(r=i.type.replace(/_/g,"-"))):r="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v5-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Tp=new WeakMap;function Ep(t,e){var i=Tp.get(e);return i||(i=new WeakMap,Tp.set(e,i)),i.get(t)||i.set(t,new e),i.get(t)}class Ip{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var i=this.o[0],r=this.o.at(-1);this.i&&i&&r&&1e3>t.startTime-r.startTime&&5e3>t.startTime-i.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 Pp,Rp=function(t,e,r){void 0===r&&(r={});try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((t=>{queueMicrotask((()=>{e(t.getEntries())}))}));return n.observe(i({type:t,buffered:!0},r)),n}}catch(t){}},Lp=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Op=-1,Fp=new Set,Ap=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Dp=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of Fp)e();isFinite(Op)||(Op="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Dp,!0))}},$p=()=>{if(0>Op){var t,e=Cp(),i=document.prerendering||null==(t=globalThis.performance.getEntriesByType("visibility-state").find((t=>"hidden"===t.name&&t.startTime>=e)))?void 0:t.startTime;Op=null!=i?i:Ap(),addEventListener("visibilitychange",Dp,!0),addEventListener("prerenderingchange",Dp,!0),wp((()=>{setTimeout((()=>{Op=Ap()}))}))}return{get firstHiddenTime(){return Op},onHidden(t){Fp.add(t)}}},Np=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},qp=[1800,3e3],jp=function(t,e){void 0===e&&(e={}),Np((()=>{var i,r=$p(),n=Mp("FCP"),s=Rp("paint",(t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),r.firstHiddenTime>e.startTime&&(n.value=Math.max(e.startTime-Cp(),0),n.entries.push(e),i(!0)))}));s&&(i=xp(t,n,qp,e.reportAllChanges),wp((r=>{n=Mp("FCP"),i=xp(t,n,qp,e.reportAllChanges),kp((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))})))}))},Bp=[.1,.25],Hp=0,Up=1/0,zp=0,Wp=t=>{for(var e of t)e.interactionId&&(Up=Math.min(Up,e.interactionId),zp=Math.max(zp,e.interactionId),Hp=zp?(zp-Up)/7+1:0)},Vp=()=>{var t;return Pp?Hp:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Zp=0;class Gp{constructor(){this.l=[],this.u=new Map,this.m=void 0,this.p=void 0}v(){Zp=Vp(),this.l.length=0,this.u.clear()}T(){var t=Math.min(this.l.length-1,Math.floor((Vp()-Zp)/50));return this.l[t]}h(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId||"first-input"===t.entryType){var i=this.l.at(-1),r=this.u.get(t.interactionId);if(r||10>this.l.length||t.duration>i.L){var n;if(r?t.duration>r.L?(r.entries=[t],r.L=t.duration):t.duration===r.L&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(this.u.set((r={id:t.interactionId,entries:[t],L:t.duration}).id,r),this.l.push(r)),this.l.sort(((t,e)=>e.L-t.L)),this.l.length>10){var s=this.l.splice(10);for(var a of s)this.u.delete(a.id)}null==(n=this.p)||n.call(this,r)}}}}var Qp=t=>{var e=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var r=Lp(t),n=-1,s=()=>{i(n),r()};addEventListener("visibilitychange",s,{once:!0,capture:!0}),n=e((()=>{removeEventListener("visibilitychange",s,{capture:!0}),r()}))}},Jp=[200,500];class Kp{constructor(){this.m=void 0}h(t){var e;null==(e=this.m)||e.call(this,t)}}var Yp=[2500,4e3],Xp={onLCP(t,e){void 0===e&&(e={}),Np((()=>{var i,r=$p(),n=Mp("LCP"),s=Ep(e,Kp),a=t=>{for(var a of(e.reportAllChanges||(t=t.slice(-1)),t))s.h(a),r.firstHiddenTime>a.startTime&&(n.value=Math.max(a.startTime-Cp(),0),n.entries=[a],i())},o=Rp("largest-contentful-paint",a);if(o){i=xp(t,n,Yp,e.reportAllChanges);var l=Lp((()=>{a(o.takeRecords()),o.disconnect(),i(!0)})),u=t=>{t.isTrusted&&(Qp(l),removeEventListener(t.type,u,{capture:!0}))};for(var h of["keydown","click","visibilitychange"])addEventListener(h,u,{capture:!0});wp((r=>{n=Mp("LCP"),i=xp(t,n,Yp,e.reportAllChanges),kp((()=>{n.value=performance.now()-r.timeStamp,i(!0)}))}))}}))},onCLS(t,e){void 0===e&&(e={});var i=$p();jp(Lp((()=>{var r,n=Mp("CLS",0),s=Ep(e,Ip),a=t=>{for(var e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,r())},o=Rp("layout-shift",a);o&&(r=xp(t,n,Bp,e.reportAllChanges),i.onHidden((()=>{a(o.takeRecords()),r(!0)})),wp((()=>{s.i=0,n=Mp("CLS",0),r=xp(t,n,Bp,e.reportAllChanges),kp(r)})),setTimeout(r))})))},onFCP:jp,onINP(t,e){if(void 0===e&&(e={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=$p();Np((()=>{var r;"interactionCount"in performance||Pp||(Pp=Rp("event",Wp,{durationThreshold:0}));var n,s=Mp("INP"),a=Ep(e,Gp),o=t=>{Qp((()=>{for(var e of t)a.h(e);var i=a.T();i&&i.L!==s.value&&(s.value=i.L,s.entries=i.entries,n())}))},l=Rp("event",o,{durationThreshold:null!==(r=e.durationThreshold)&&void 0!==r?r:40});n=xp(t,s,Jp,e.reportAllChanges),l&&(l.observe({type:"first-input",buffered:!0}),i.onHidden((()=>{o(l.takeRecords()),n(!0)})),wp((()=>{a.v(),s=Mp("INP"),n=xp(t,s,Jp,e.reportAllChanges)})))}))}}};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},Mo.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=Xp,Mo.__PosthogExtensions__.postHogWebVitalsCallbacks=Xp,Mo.postHogWebVitalsCallbacks=Xp,Mo.__PosthogExtensions__.loadWebVitalsCallbacks=()=>Xp;class tg{constructor(t){this.disabled=!1===t;var e=Zi(t)?t:{};this.thresholdPx=e.threshold_px||30,this.timeoutMs=e.timeout_ms||1e3,this.clickCount=e.click_count||3,this.clicks=[]}isRageClick(t,e,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(t-r.x)+Math.abs(e-r.y)<this.thresholdPx&&this.timeoutMs>i-r.timestamp){if(this.clicks.push({x:t,y:e,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:e,timestamp:i}];return!1}}var eg="$copy_autocapture",ig=$s("[AutoCapture]");function rg(t,e){return e.length>t?e.slice(0,t)+"...":e}function ng(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!ca(e));return e}function sg(t,e){var r,n,s=e.e,a=e.maskAllElementAttributes,o=e.maskAllText,l=e.elementAttributeIgnoreList,u=e.elementsChainAsString,h=e.disableCaptureUrlHashes;if(!ca(t))return{props:{}};for(var d=[t],v=new Set([t]),c=t;c.parentNode&&!fa(c,"body")&&ma>d.length;)if(ga(c.parentNode)){var f=c.parentNode.host;if(v.has(f))break;v.add(f),d.push(f),c=f}else{if(!ca(c.parentNode))break;if(v.has(c.parentNode))break;v.add(c.parentNode),d.push(c.parentNode),c=c.parentNode}var p,g,m=[],y={},b=!1,_=!1;if(qs(d,(t=>{var e=$a(t);if(fa(t,"a")){var i=t.getAttribute("href");b=!!(e&&i&&Va(i))&&(h?kn(i):i)}Ni(_a(t),"ph-no-capture")&&(_=!0),m.push(function(t,e,i,r,n){void 0===n&&(n=!1);var s=t.tagName.toLowerCase(),a={tag_name:s};Sa.indexOf(s)>-1&&!i&&(a.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?rg(1024,Za(t)):rg(1024,xa(t)));var o=_a(t);o.length>0&&(a.classes=o.filter((function(t){return""!==t}))),qs(t.attributes,(function(i){var s;if((!Na(t)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!e&&Va(i.value)&&(!Ji(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var o=i.value;"class"===i.name&&(o=ya(o).join(" ")),a["attr__"+i.name]=rg(1024,"href"===i.name&&n?kn(o):o)}}));for(var l=1,u=1,h=t;h=ng(h);)l++,h.tagName===t.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(t,a,o,l,h));var r=function(t){if(!$a(t))return{};var e={};return qs(t.attributes,(function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var i=t.name.replace("data-ph-capture-attribute-",""),r=t.value;i&&r&&Va(r)&&(e[i]=r)}})),e}(t);js(y,r)})),_)return{props:{},explicitNoCapture:_};if(o||(m[0].$el_text=fa(t,"a")||fa(t,"button")?Za(t):xa(t)),b){var w,x;m[0].attr__href=b;var k=null==(w=Js(b))?void 0:w.host,S=null==xs||null==(x=xs.location)?void 0:x.host;k&&S&&k!==S&&(p=b)}return{props:js({$event_type:s.type,$ce_version:1},u?{}:{$elements:m},{$elements_chain:(g=m,function(t){return t.map((t=>{var e,r,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var s of(t.attr_class.sort(),t.attr_class))n+="."+s.replace(/"/g,"");var a=i({},t.text?{text:t.text}:{},{"nth-child":null!==(e=t.nth_child)&&void 0!==e?e:0,"nth-of-type":null!==(r=t.nth_of_type)&&void 0!==r?r:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),o={};return Bs(a).sort(((t,e)=>t[0].localeCompare(e[0]))).forEach((t=>{var e=t[1];return o[Qa(t[0].toString())]=Qa(e.toString())})),(n+=":")+Bs(o).map((t=>t[0]+'="'+t[1]+'"')).join("")})).join(";")}(function(t){return t.map((t=>{var e,i,r={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(i=t.attr__href)?void 0:i.slice(0,2048),attr_class:Ja(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Bs(t).filter((t=>0===t[0].indexOf("attr__"))).forEach((t=>r.attributes[t[0]]=t[1])),r}))}(g)))},null!=(r=m[0])&&r.$el_text?{$el_text:null==(n=m[0])?void 0:n.$el_text}:{},p&&"click"===s.type?{$external_click_url:p}:{},y)}}var ag={};function og(t,e){var i=ag[t];if(i)return i;var r=e[t];if((t=>Vi(t)&&-1!==t.toString().indexOf("[native code]"))(r)&&(null==xs||!xs.Zone))return ag[t]=r.bind(e);var n=e.document;if(n&&Vi(n.createElement)){var s,a=!1;try{(s=n.createElement("iframe")).hidden=!0,n.head.appendChild(s);var o,l,u=s.contentWindow;u&&u[t]&&(r=u[t],"MutationObserver"===t&&function(t){return Ni(t,"AppleWebKit")&&!Ni(t,"Chrome")}(null!==(o=null==(l=e.navigator)?void 0:l.userAgent)&&void 0!==o?o:"")&&(s.classList.add("rr-block","ph-no-capture"),a=!0))}catch(e){Ds.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var h;!a&&null!=(h=s)&&h.parentNode&&s.parentNode.removeChild(s)}}return r&&Vi(r)?ag[t]=r.bind(e):r}function lg(t,e){var r=ka(t);return r?i({node:r,originalEvent:t,timestamp:Date.now()},e):null}function ug(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function hg(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var dg="canvas,video,audio,embed,object";function vg(t,e){return tr(t)&&t>=e}class cg{me(t){var e,i,r,n,s,a,o,l,u=this.ye((null==t?void 0:t.__onCapture)||this.ge.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:u.element_attribute_ignorelist,scroll_threshold_ms:null!==(i=null==t?void 0:t.scroll_threshold_ms)&&void 0!==i?i:u.scroll_threshold_ms,selection_change_threshold_ms:null!==(r=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==r?r:u.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:u.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(s=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==s?s:u.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(a=null==t?void 0:t.capture_dead_swipes)&&void 0!==a?a:u.capture_dead_swipes,swipe_threshold_px:null!==(o=null==t?void 0:t.swipe_threshold_px)&&void 0!==o?o:u.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(l=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==l?l:u.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:u.__onCapture}}constructor(t,e){this.be=[],this.we=0,this.ye=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.ke=t=>{var e=lg(t,{type:"click"});Yi(e)||this.xe(e)||this.be.push(e),this.Se()},this.Ce=()=>{var t=Date.now();this.Me=t,t%50==0&&this.be.forEach((e=>{Qi(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)}))},this.Te=()=>{this._e=Date.now()},this.Ie=()=>{"visible"===(null==Cs?void 0:Cs.visibilityState)&&(this.Ee=Date.now())},this.Le=t=>{var e=t.touches,i=1===(null==e?void 0:e.length)?e[0]:void 0;this.Re=i?{x:i.clientX,y:i.clientY,timestamp:Date.now()}:void 0},this.Oe=()=>{this.Re=void 0},this.Ne=t=>{var e,i=this.Re;if(this.Re=void 0,!Qi(i)&&this.Pe.max_dead_swipes_per_page_load>this.we){var r=t,n=null==(e=r.changedTouches)?void 0:e[0];if(n){var s=n.clientX-i.x,a=n.clientY-i.y,o=s*s+a*a,l=this.Pe.swipe_threshold_px;if(o>=l*l&&![this.Me,this.Ae,this._e].some((t=>tr(t)&&t>=i.timestamp))){var u;if(this.De()&&(null!==(u=null==Cs||null==Cs.elementsFromPoint?void 0:Cs.elementsFromPoint(i.x,i.y))&&void 0!==u?u:[]).some((t=>null==t.matches?void 0:t.matches(dg))))return;var h=lg(r,{type:"swipe",swipeDirection:ug(s,a),swipeDistancePx:Math.round(Math.sqrt(o))});Yi(h)||this.xe(h)||this.be.push(h),this.Se()}}}},this.instance=t,this.Pe=this.me(e),this._onCapture=this.Pe.__onCapture}start(t){this.qe(),this.Fe(),this.je(),this.He(),this.Be(t),this.Pe.capture_dead_swipes&&this.Ue()}Be(t){if(!this.We){var e=function(t){return og("MutationObserver",t)}(Mo);this.We=new e((t=>{this.Ve(t)})),this.We.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.We)||t.disconnect(),this.We=void 0,Mo.removeEventListener("click",this.ke),Mo.removeEventListener("scroll",this.Ce,{capture:!0}),Mo.removeEventListener("selectionchange",this.Te),Mo.removeEventListener("touchstart",this.Le,{capture:!0}),Mo.removeEventListener("touchend",this.Ne,{capture:!0}),Mo.removeEventListener("touchcancel",this.Oe,{capture:!0}),null==Cs||Cs.removeEventListener("visibilitychange",this.Ie),this.Re=void 0}Ve(t){this.Ae=Date.now()}qe(){Zs(Mo,"click",this.ke)}Se(){this.be.length&&Qi(this.Ze)&&(this.Ze=Mo.setTimeout((()=>{this.ze()}),1e3))}Fe(){Zs(Mo,"scroll",this.Ce,{capture:!0})}je(){Zs(Mo,"selectionchange",this.Te)}He(){Zs(Cs,"visibilitychange",this.Ie)}Ue(){Zs(Mo,"touchstart",this.Le,{capture:!0,passive:!0}),Zs(Mo,"touchend",this.Ne,{capture:!0,passive:!0}),Zs(Mo,"touchcancel",this.Oe,{capture:!0,passive:!0})}De(){var t=Qi(this.$e)||tr(this.Ae)&&this.Ae>this.$e;return(Qi(this.Qe)||t)&&(this.$e=Date.now(),this.Qe=!(null==Cs||!Cs.querySelector(dg))),!!this.Qe}xe(t){return!t||("swipe"===t.type?this.Ge(t):this.Ye(t))}Ge(t){if(va(t.node))return!0;var e=this.be.some((e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp)));return!(!e&&!fa(t.node,"html")&&ca(t.node)&&function(t,e){var i;if(!xs||Aa(t))return!1;var r=ir(e)?Ra:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:Ra;return!Ca(Da(t,!1).targetElementList,r)}(t.node,{css_selector_ignorelist:this.Pe.css_selector_ignorelist}))}Ye(t){return!(this.Pe.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.Ge(t)||(i=t.node,!(!xs||Aa(i))&&Da(i,!1).targetElementList.some((t=>fa(t,"a"))));var e,i}ze(){if(this.be.length){clearTimeout(this.Ze),this.Ze=void 0;var t=this.be;for(var e of(this.be=[],t)){var i;e.mutationDelayMs=null!==(i=e.mutationDelayMs)&&void 0!==i?i:this.Ae&&this.Ae>=e.timestamp?this.Ae-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this._e&&this._e>=e.timestamp?this._e-e.timestamp:void 0,e.visibilityChangedDelayMs=this.Ee?Math.abs(e.timestamp-this.Ee):void 0;var r=vg(e.scrollDelayMs,this.Pe.scroll_threshold_ms),n=vg(e.selectionChangedDelayMs,this.Pe.selection_change_threshold_ms),s=vg(e.mutationDelayMs,this.Pe.mutation_threshold_ms),a=vg(e.absoluteDelayMs,1.1*this.Pe.mutation_threshold_ms),o=tr(e.scrollDelayMs)&&this.Pe.scroll_threshold_ms>e.scrollDelayMs,l=tr(e.mutationDelayMs)&&this.Pe.mutation_threshold_ms>e.mutationDelayMs,u=tr(e.selectionChangedDelayMs)&&this.Pe.selection_change_threshold_ms>e.selectionChangedDelayMs,h=tr(e.visibilityChangedDelayMs)&&this.Pe.selection_change_threshold_ms>e.visibilityChangedDelayMs;if(!(o||l||u||h)){var d=vg(e.visibilityChangedDelayMs,this.Pe.selection_change_threshold_ms);if(r||s||a||n||d){var v=hg(e);if("$dead_swipe"===v){if(this.we>=this.Pe.max_dead_swipes_per_page_load)continue;this.we++}this._onCapture(e,{[v+"_last_mutation_timestamp"]:this.Ae,[v+"_event_timestamp"]:e.timestamp,[v+"_scroll_timeout"]:r,[v+"_mutation_timeout"]:s,[v+"_absolute_timeout"]:a,[v+"_selection_changed_timeout"]:n,[v+"_visibility_changed_timeout"]:d})}else this.Pe.mutation_threshold_ms>e.absoluteDelayMs&&this.be.push(e)}}this.Se()}}ge(t,e){var r=hg(t);this.instance.capture(r,i({},e,sg(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Pe.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[r+"_scroll_delay_ms"]:t.scrollDelayMs,[r+"_mutation_delay_ms"]:t.mutationDelayMs,[r+"_absolute_delay_ms"]:t.absoluteDelayMs,[r+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[r+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}}Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new cg(t,e);var fg=$s("[ExternalScriptsLoader]"),pg=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return fg.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=null==Cs?void 0:Cs.querySelectorAll("script");if(r)for(var n,s=function(){if(r[a].src===e){var t=r[a];return t.__posthog_loading_callback_fired?{v:i()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,i(void 0,e)})),t.onerror=t=>i(t),{v:void 0})}},a=0;r.length>a;a++)if(n=s())return n.v;var o=()=>{if(!Cs)return i("document not found");var r=Cs.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=e,r.onload=t=>{r.__posthog_loading_callback_fired=!0,i(void 0,t)},r.onerror=t=>i(t),t.config.prepare_external_dependency_script&&(r=t.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)Cs.head.appendChild(r);else{var n,s=Cs.querySelectorAll("body > script");s.length>0?null==(n=s[0].parentNode)||n.insertBefore(r,s[0]):Cs.body.appendChild(r)}};null!=Cs&&Cs.body?o():null==Cs||Cs.addEventListener("DOMContentLoaded",o)};Mo.__PosthogExtensions__=Mo.__PosthogExtensions__||{},Mo.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{if("remote-config"!==e){var r;if(t.config.strict_script_versioning)r=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}r=t.requestRouter.endpointFor("assets",n)}pg(t,r,i)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");pg(t,a,i)}},Mo.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);pg(t,r,i)};Fs.DEBUG=!1,Fs.LIB_VERSION="1.412.1",Fs.LIB_NAME="web";class gg{constructor(t){this._instance=t}get Pe(){return this._instance.config}get consent(){return this.ti()?0:this.ei}isOptedOut(){return this.Pe.cookieless_mode===Th||this.isRejected()||-1===this.consent&&this.Pe.cookieless_mode===Mh}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Pe.opt_out_capturing_by_default}optInOut(t){this.ii.A(this.ri,t?1:0,this.Pe.cookie_expiration,this.Pe.cross_subdomain_cookie,this.Pe.secure_cookie)}reset(){this.ii.F(this.ri,this.Pe.cross_subdomain_cookie)}get ri(){var t=this._instance.config,e=t.token,i=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(i?i+e:"__ph_opt_in_out_"+e)}get ei(){var t=this.ii.q(this.ri);return dr(t)?1:Ni(vr,t)?0:-1}get ii(){var t=this.Pe.opt_out_capturing_persistence_type,e="localStorage"===t?td:Yh;if(!this.ni||this.ni!==e){this.ni=e;var i="localStorage"===t?Yh:td;i.q(this.ri)&&(this.ni.q(this.ri)||this.optInOut(dr(i.q(this.ri))),i.F(this.ri,this.Pe.cross_subdomain_cookie))}return this.ni}ti(){return!!this.Pe.respect_dnt&&[null==Ss?void 0:Ss.doNotTrack,null==Ss?void 0:Ss.msDoNotTrack,Mo.doNotTrack].some((t=>dr(t)))}}var mg=$s("[Dead Clicks]"),yg=()=>!0,bg=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(Au)),r=t.instance.config.capture_dead_clicks;return ir(r)?r:!!Zi(r)||i};class _g{get lazyLoadedDeadClicksAutocapture(){return this.si}constructor(t,e,i){this.instance=t,this.isEnabled=e,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(t){if(t.ok){var e=t.config;"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Au]:e.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.ai((()=>{this.oi()})):this.stop()}ai(t){var e,i;null!=(e=Mo.__PosthogExtensions__)&&e.initDeadClicksAutocapture?t():null==(i=Mo.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(e=>{e?mg.error("failed to load script",e):t()}))}oi(){var t;if(Cs){if(!this.si&&null!=(t=Mo.__PosthogExtensions__)&&t.initDeadClicksAutocapture){var e=Zi(this.instance.config.capture_dead_clicks)?i({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.si=Mo.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.si.start(Cs),mg.info("starting...")}}else mg.error("`document` not found. Cannot start.")}stop(){this.si&&(this.si.stop(),this.si=void 0,mg.info("stopping..."))}}var wg=$s("[SegmentIntegration]");var xg="posthog-js";function kg(t,e){var r=void 0===e?{}:e,n=r.organization,s=r.projectId,a=r.prefix,o=r.severityAllowList,l=void 0===o?["error"]:o,u=r.sendExceptionsToPostHog,h=void 0===u||u;return e=>{var r,o,u,d,v;if("*"!==l&&!l.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var c=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=c,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var f,p=(null==(r=e.exception)?void 0:r.values)||[],g=p.map((t=>i({},t,{stacktrace:t.stacktrace?i({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>i({},t,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:(null==(o=p[0])?void 0:o.value)||e.message,$exception_type:null==(u=p[0])?void 0:u.type,$exception_level:e.level,$exception_list:g,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(v=p[0])?void 0:v.type,$sentry_tags:e.tags};return n&&s&&(m.$sentry_url=(a||"https://sentry.io/organizations/")+n+"/issues/?project="+s+"&query="+e.event_id),h&&(null==(f=t.exceptions)||f.sendExceptionEvent(m)),e}}class Sg{constructor(t,e,i,r,n,s){this.name=xg,this.setupOnce=function(a){a(kg(t,{organization:e,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:null==s||s}))}}}class Cg{constructor(t){this.li=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(Ds.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.ui=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.hi()}hi(){var t;this.di=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.li)}destroy(){var t;null==(t=this.di)||t.call(this),this.di=void 0}doPageView(t,e){var i,r=this.vi(t,e);return this.ui={pathname:null!==(i=null==xs?void 0:xs.location.pathname)&&void 0!==i?i:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.vi(t,null==(e=this.ui)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.ui)?void 0:t.pageViewId}}vi(t,e){var i=this.ui;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var s=n.maxScrollHeight,a=n.lastScrollY,o=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,h=n.maxContentY;if(!(Qi(s)||Qi(a)||Qi(o)||Qi(l)||Qi(u)||Qi(h))){s=Math.ceil(s),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var d=s>1?cr(a/s,0,1,Ds):1,v=s>1?cr(o/s,0,1,Ds):1,c=l>1?cr(u/l,0,1,Ds):1,f=l>1?cr(h/l,0,1,Ds):1;r=js(r,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}}var Mg=["flags","surveys"],Tg={[Su]:{exposure:"hidden"},[Tu]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Eu]:{exposure:"hidden"},[Iu]:{exposure:"event"},[Pu]:{exposure:"hidden"},[Ru]:{exposure:"event"},[Lu]:{exposure:"hidden"},[Ou]:{exposure:"event"},[Fu]:{exposure:"event"},[Au]:{exposure:"event"},[Du]:{exposure:"hidden"},[$u]:{exposure:"event"},[Nu]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[zu]:{exposure:"hidden"},[Wu]:{exposure:"event"},[qu]:{exposure:"event",shouldSkipFromEventProperties:t=>Yi(t)},$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"},$sess_rec_flush_size:{exposure:"hidden"},[Vu]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Zi(t))return{};for(var e={},i=Object.keys(t),r=0;i.length>r;r++)e["$feature/"+i[r]]=t[i[r]];return e}},[Zu]:{exposure:"event",storageGroup:"flags"},[Gu]:{exposure:"hidden"},[Qu]:{exposure:"hidden",storageGroup:"flags"},[Ju]:{exposure:"event",storageGroup:"flags"},[Ku]:{exposure:"event",storageGroup:"flags",volatile:!0},[Yu]:{exposure:"hidden",storageGroup:"flags"},[Xu]:{exposure:"event"},[th]:{exposure:"hidden"},[eh]:{exposure:"hidden"},[ih]:{exposure:"hidden"},[rh]:{exposure:"hidden",storageGroup:"surveys"},[nh]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[sh]:{exposure:"event"},[ah]:{exposure:"hidden"},[oh]:{exposure:"hidden"},[lh]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[uh]:{exposure:"hidden"},[hh]:{exposure:"hidden"},[dh]:{exposure:"hidden"},[vh]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[ch]:{exposure:"hidden"},[fh]:{exposure:"hidden"},[ph]:{exposure:"hidden"},[gh]:{exposure:"hidden"},[mh]:{exposure:"hidden"},[yh]:{exposure:"hidden"},[bh]:{exposure:"hidden"},[ju]:{exposure:"event"},[Bu]:{exposure:"event"},[Hu]:{exposure:"event"},[Uu]:{exposure:"event"},[xh]:{exposure:"event"},[kh]:{exposure:"event"},[Sh]:{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"}},Eg=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Ig=t=>{var e=Tg[t];if(e)return e;for(var i of Eg){var r=i[1];if(0===t.indexOf(i[0]))return r}},Pg={flags:vh,surveys:nh},Rg=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Lg="main";class Og{constructor(t,e,r){if(void 0===r&&(r=!0),this.ci={},this.fi=!1,this.pi=!1,this.Pe=t,this.gi=r,this.props={},this.mi=void 0,this.yi=(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.ii=this.bi(t),this.pi=this.wi(t),this.load(),t.debug&&Ds.info("Persistence loaded",t.persistence,i({},this.props)),this.update_config(t,t,e),this.save(),xs){var n=()=>this.flush();Zs(xs,"beforeunload",n,{capture:!1}),Zs(xs,"pagehide",n,{capture:!1})}}xi(){var t,e=null==(t=this.Pe)?void 0:t.persistence_save_debounce_ms;return tr(e)&&e>0?e:0}isDisabled(){return!!this.ki}bi(t){-1===Rg.indexOf(t.persistence.toLowerCase())&&(Ds.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,r=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1);var r=[...ed,...t];return i({},td,{H(t){try{var i={};try{i=Yh.H(t)||{}}catch(t){}var r,n=JSON.parse(td.q(t)||"{}");if(e){var s={};for(var a in i){var o=i[a];Yi(o)||""===o||(s[a]=o)}r=js(n,s)}else r=js(i,n);return td.A(t,r),r}catch(t){}return null},A(t,e,i,n,s,a){var o=td.A(t,e,void 0,void 0,a);try{var l={};r.forEach((t=>{e[t]&&(l[t]=e[t])})),Object.keys(l).length&&Yh.A(t,l,i,n,s,a)}catch(t){td.j(t)}return o},F(t,e){try{null==xs||xs.localStorage.removeItem(t),Yh.F(t,e)}catch(t){td.j(t)}}})}(t.cookie_persisted_properties||[],t.__preview_cookie_wins_on_conflict||!1),n=!1,s=t.persistence.toLowerCase();return"localstorage"===s&&td.P()?(e=td,n=!0):"localstorage+cookie"===s&&r.P()?(e=r,n=!0):"sessionstorage"===s&&sd.P()?e=sd:"memory"===s?e=rd:"cookie"===s?e=Yh:r.P()?(e=r,n=!0):e=Yh,this.fi=n,e}Si(t){return this.yi+"__"+t}wi(t){return this.fi&&!!t.split_storage}Ci(t){var e=null!=t?t:this.Pe.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var i=this.props[vh];return!i||"number"!=typeof i||Date.now()-i>e}properties(){var t={};return qs(this.props,((e,i)=>{var r=Ig(i);if("derived"===(null==r?void 0:r.exposure)){if(null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e,i===Vu?()=>this.Ci():()=>!1))return;r.transformToEventProperties&&js(t,r.transformToEventProperties(e))}else if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e,(()=>!1)))return;t[i]=e}})),t}load(){if(!this.ki){var t=this.ii.H(this.yi);t&&(this.props=js({},t)),this.pi&&this.Mi()}}Mi(){for(var t of Mg){var e=td.H(this.Si(t));if(e&&!Gi(e)){var i=this.Ti(t);i.persisted=!0,this.Ei(t)||(i.fingerprint=this.Ii(e,t)),this.Pi(t,e)||js(this.props,e)}}}Ei(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=Ig(e))?void 0:i.storageGroup)===t}))}Pi(t,e){var i=Pg[t];if(!i)return!1;var r=e[i],n=this.props[i];return tr(r)&&tr(n)&&n>r}refreshKey(t){var e;if(!this.ki){var i=this.pi?null==(e=Ig(t))?void 0:e.storageGroup:void 0,r=i?td.H(this.Si(i)):this.ii.H(this.yi);if(r&&t in r)this.Ri(t,r[t]);else{if(i){var n=this.ii.H(this.yi);if(n&&t in n)return void this.Ri(t,n[t])}this.Li(t)}}}save(){if(!this.ki){var t=this.xi();t>0?Qi(this.Oi)&&(this.Oi=setTimeout((()=>{this.Oi=void 0,this.Fi()}),t)):this.Fi()}}flush(){Qi(this.Oi)||(clearTimeout(this.Oi),this.Oi=void 0,this.Fi())}Fi(){this.ki||(this.pi?this.Ai():this.Di(this.ii,this.yi,this.props,Lg))}Ai(){var t=this.$i(),e=t.main,i=t.groups;for(var r of(this.Di(this.ii,this.yi,e,Lg),Mg)){var n,s=i[r];(!Gi(s)||null!=(n=this.ci[r])&&n.persisted)&&this.Di(td,this.Si(r),s,r)}}$i(){var t={},e={flags:{},surveys:{}};return qs(this.props,((i,r)=>{var n,s=null==(n=Ig(r))?void 0:n.storageGroup;s?e[s][r]=i:t[r]=i})),{main:t,groups:e}}Ii(t,e){if(e===Lg)return JSON.stringify(t)+"|"+this.Ni+"|"+this.qi+"|"+this.ji;var i={};return qs(t,((t,e)=>{var r;i[e]=null!=(r=Ig(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}Di(t,e,i,r){var n=this.Ti(r);if(r===Lg||n.dirty||Qi(n.fingerprint)){var s;try{if((s=this.Ii(i,r))===n.fingerprint)return void(n.dirty=!1)}catch(t){s=void 0}t.A(e,i,this.Ni,this.qi,this.ji,this.Pe.debug)?(n.dirty=!1,r!==Lg&&(n.persisted=!0),Qi(s)||(n.fingerprint=s)):this.Pe.debug&&Ds.warn('failed to persist storage entry "'+e+'"; will retry on next save')}}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(Qi(this.Oi)||(clearTimeout(this.Oi),this.Oi=void 0),this.ii.F(this.yi,!1),this.ii.F(this.yi,!0),!i&&this.gi)for(var r of Mg)td.F(this.Si(r));i?delete this.ci[Lg]:this.ci={}}clear(){this.remove(),this.props={}}register_once(t,e,i){if(Zi(t)){Qi(e)&&(e="None"),this.Ni=Qi(i)?this.Bi:i;var r=!1;if(qs(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Ri(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(Zi(t)){this.Ni=Qi(e)?this.Bi:e;var i=!1;if(qs(t,((e,r)=>{t.hasOwnProperty(r)&&this.props[r]!==e&&(this.Ri(r,e),i=!0)})),i)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.Li(t),this.save())}update_campaign_params(){var t=null==Cs?void 0:Cs.URL;if(t!==this.mi){var e=pv(this.Pe.custom_campaign_params,this.Pe.mask_personal_data_properties,this.Pe.custom_personal_data_properties);Gi(zs(e))||this.register(e),this.mi=t}}update_search_keyword(){var t;this.register((t=null==Cs?void 0:Cs.referrer)?mv(t):{})}update_referrer_info(){var t;this.register_once({$referrer:_v(),$referring_domain:null!=Cs&&Cs.referrer&&(null==(t=Js(Cs.referrer))?void 0:t.host)||bv},void 0)}set_initial_person_info(){this.props[gh]||this.props[mh]||this.register_once({[yh]:wv(this.Pe.mask_personal_data_properties,this.Pe.custom_personal_data_properties,this.Pe.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};qs([mh,gh],(e=>{var i=this.props[e];i&&qs(i,(function(e,i){t["$initial_"+ji(i)]=e}))}));var e=this.props[yh];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=xv(t,e),r={};return qs(i,(function(t,e){r["$initial_"+ji(e)]=t})),r}(e,this.Pe.disable_capture_url_hashes);js(t,i)}return t}safe_merge(t){return qs(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){this.Bi=this.Ni=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!i),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie);var r=t.persistence!==e.persistence||!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every(((t,e)=>t===r[e]))})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),n=r?this.bi(t):this.ii,s=this.wi(t);if(r||s!==this.pi){var a=this.props;this.clear(),this.ii=n,this.pi=s,this.props=a,this.save()}}set_disabled(t){this.ki=t,this.ki?this.remove():this.save()}set_cross_subdomain(t){t!==this.qi&&(this.qi=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.ji&&(this.ji=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[Eu]||{};i[t]=e,this.Ri(Eu,i),this.save()}remove_event_timer(t){var e=this.props[Eu]||{},i=e[t];return Qi(i)||(delete e[t],this.Ri(Eu,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Ri(t,e),this.save()}Ri(t,e){var i;this.props[t]=e,null!=(i=Ig(t))&&i.volatile||this.Hi(t)}Li(t){delete this.props[t],this.Hi(t)}Hi(t){var e,i=null==(e=Ig(t))?void 0:e.storageGroup;i&&(this.Ti(i).dirty=!0)}Ti(t){return this.ci[t]||(this.ci[t]={})}}var Fg=$s("[RateLimiter]");class Ag{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=>{Fg.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void Fg.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,i,r;void 0===t&&(t=!1);var n=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,a=(new Date).getTime(),o=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(ph))&&void 0!==e?e:{tokens:n,last:a};o.tokens+=(a-o.last)/1e3*s,o.last=a,o.tokens>n&&(o.tokens=n);var l=1>o.tokens;if(l||t||(o.tokens=Math.max(0,o.tokens-1)),l&&!t){var u=(tr(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.Ui(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(ph,o),{isRateLimited:l,remainingTokens:o.tokens}}zi(t){var e=this.instance.config.property_denylist;return!Wi(e)||!e.includes(t)}Wi(){var t;if(this.zi("$current_url")&&this.zi("$pathname")&&null!=Ms&&Ms.pathname)return""+(null!==(t=Ms.origin)&&void 0!==t?t:"")+Ms.pathname}Ui(t){var e,i,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,s=this.Wi(),a=this.zi("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,o=[t+" event(s) dropped since the last warning",s?"triggered on "+s:void 0,a?"session "+a:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+o+". Config is set to "+n+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Dg=$s("[RemoteConfig]");class $g{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=Mo._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Vi(t){var e,i;null!=(e=Mo.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=Mo.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Zi(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t})}load(){try{if(this.remoteConfig)return Dg.info("Using preloaded remote config",this.remoteConfig),this.Gi(this.remoteConfig),void this.Qi();if(this._instance.Ji())return void Dg.warn("Remote config is disabled. Falling back to local config.");this.Vi((t=>{if(!t)return Dg.info("No config found after loading remote JS config. Falling back to JSON."),void this.Zi((t=>{this.Gi(t.json,t),this.Qi()}));this.Gi(t),this.Qi()}))}catch(t){Dg.error("Error loading remote config",t),this.Gi()}}stop(){this.Ki&&(clearInterval(this.Ki),this.Ki=void 0)}refresh(){!this._instance.Ji()&&Cs&&"hidden"!==Cs.visibilityState&&this._instance.reloadFeatureFlags()}Qi(){var t;if(!this.Ki){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.Ki=setInterval((()=>{this.refresh()}),e))}}Gi(t,e){!t&&e&&(0===e.statusCode?e.error||Dg.warn("Failed to fetch remote config from PostHog."):Dg.error("Failed to fetch remote config from PostHog."));try{this._instance.Gi(t?{ok:!0,config:t}:{ok:!1})}catch(t){Dg.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(t){Dg.error("Error loading feature flags",t)}}}var Ng=Uint8Array,qg=Uint16Array,jg=Uint32Array,Bg=new Ng([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]),Hg=new Ng([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]),Ug=new Ng([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zg=function(t,e){for(var i=new qg(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var n=new jg(i[30]);for(r=1;30>r;++r)for(var s=i[r];i[r+1]>s;++s)n[s]=s-i[r]<<5|r;return[i,n]},Wg=zg(Bg,2),Vg=Wg[1];Wg[0][28]=258,Vg[258]=28;for(var Zg=zg(Hg,0)[1],Gg=new qg(32768),Qg=0;32768>Qg;++Qg){var Jg=(43690&Qg)>>>1|(21845&Qg)<<1;Gg[Qg]=((65280&(Jg=(61680&(Jg=(52428&Jg)>>>2|(13107&Jg)<<2))>>>4|(3855&Jg)<<4))>>>8|(255&Jg)<<8)>>>1}var Kg=function(t,e,i){for(var r=t.length,n=0,s=new qg(e);r>n;++n)++s[t[n]-1];var a,o=new qg(e);for(n=0;e>n;++n)o[n]=o[n-1]+s[n-1]<<1;if(i){a=new qg(1<<e);var l=15-e;for(n=0;r>n;++n)if(t[n])for(var u=n<<4|t[n],h=e-t[n],d=o[t[n]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)a[Gg[d]>>>l]=u}else for(a=new qg(r),n=0;r>n;++n)a[n]=Gg[o[t[n]-1]++]>>>15-t[n];return a},Yg=new Ng(288);for(Qg=0;144>Qg;++Qg)Yg[Qg]=8;for(Qg=144;256>Qg;++Qg)Yg[Qg]=9;for(Qg=256;280>Qg;++Qg)Yg[Qg]=7;for(Qg=280;288>Qg;++Qg)Yg[Qg]=8;var Xg=new Ng(32);for(Qg=0;32>Qg;++Qg)Xg[Qg]=5;var tm=Kg(Yg,9,0),em=Kg(Xg,5,0),im=function(t){return(t/8>>0)+(7&t&&1)},rm=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof qg?qg:t instanceof jg?jg:Ng)(i-e);return r.set(t.subarray(e,i)),r},nm=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},sm=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},am=function(t,e){for(var i=[],r=0;t.length>r;++r)t[r]&&i.push({s:r,f:t[r]});var n=i.length,s=i.slice();if(!n)return[new Ng(0),0];if(1==n){var a=new Ng(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,h=1,d=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=n-1;)o=i[i[d].f>i[u].f?u++:d++],l=i[u!=h&&i[d].f>i[u].f?u++:d++],i[h++]={s:-1,f:o.f+l.f,l:o,r:l};var v=s[0].s;for(r=1;n>r;++r)s[r].s>v&&(v=s[r].s);var c=new qg(v+1),f=om(i[h-1],c,0);if(f>e){r=0;var p=0,g=f-e,m=1<<g;for(s.sort((function(t,e){return c[e.s]-c[t.s]||t.f-e.f}));n>r;++r){var y=s[r].s;if(e>=c[y])break;p+=m-(1<<f-c[y]),c[y]=e}for(p>>>=g;p>0;){var b=s[r].s;e>c[b]?p-=1<<e-c[b]++-1:++r}for(;r>=0&&p;--r){var _=s[r].s;c[_]==e&&(--c[_],++p)}f=e}return[new Ng(c),f]},om=function(t,e,i){return-1==t.s?Math.max(om(t.l,e,i+1),om(t.r,e,i+1)):e[t.s]=i},lm=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new qg(++e),r=0,n=t[0],s=1,a=function(t){i[r++]=t},o=1;e>=o;++o)if(t[o]==n&&o!=e)++s;else{if(!n&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(n),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(n);s=1,n=t[o]}return[i.subarray(0,r),e]},um=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},hm=function(t,e,i){var r=i.length,n=im(e+2);t[n]=255&r,t[n+1]=r>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var s=0;r>s;++s)t[n+s+4]=i[s];return 8*(n+4+r)},dm=function(t,e,i,r,n,s,a,o,l,u,h){nm(e,h++,i),++n[256];for(var d=am(n,15),v=d[0],c=d[1],f=am(s,15),p=f[0],g=f[1],m=lm(v),y=m[0],b=m[1],_=lm(p),w=_[0],x=_[1],k=new qg(19),S=0;y.length>S;++S)k[31&y[S]]++;for(S=0;w.length>S;++S)k[31&w[S]]++;for(var C=am(k,7),M=C[0],T=C[1],E=19;E>4&&!M[Ug[E-1]];--E);var I,P,R,L,O=u+5<<3,F=um(n,Yg)+um(s,Xg)+a,A=um(n,v)+um(s,p)+a+14+3*E+um(k,M)+(2*k[16]+3*k[17]+7*k[18]);if(F>=O&&A>=O)return hm(e,h,t.subarray(l,l+u));if(nm(e,h,1+(F>A)),h+=2,F>A){I=Kg(v,c,0),P=v,R=Kg(p,g,0),L=p;var D=Kg(M,T,0);for(nm(e,h,b-257),nm(e,h+5,x-1),nm(e,h+10,E-4),h+=14,S=0;E>S;++S)nm(e,h+3*S,M[Ug[S]]);h+=3*E;for(var N=[y,w],q=0;2>q;++q){var j=N[q];for(S=0;j.length>S;++S)nm(e,h,D[B=31&j[S]]),h+=M[B],B>15&&(nm(e,h,j[S]>>>5&127),h+=j[S]>>>12)}}else I=tm,P=Yg,R=em,L=Xg;for(S=0;o>S;++S)if(r[S]>255){var B;sm(e,h,I[257+(B=r[S]>>>18&31)]),h+=P[B+257],B>7&&(nm(e,h,r[S]>>>23&31),h+=Bg[B]);var H=31&r[S];sm(e,h,R[H]),h+=L[H],H>3&&(sm(e,h,r[S]>>>5&8191),h+=Hg[H])}else sm(e,h,I[r[S]]),h+=P[r[S]];return sm(e,h,I[256]),h+P[256]},vm=new jg([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),cm=function(){for(var t=new jg(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),fm=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function pm(t,e){void 0===e&&(e={});var i=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=cm[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var n,s,a,o,l=(n=t,s=e,a=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),o=8,function(t,e,i,r,n,s){var a=t.length,o=new Ng(r+a+5*(1+Math.floor(a/7e3))+n),l=o.subarray(r,o.length-n),u=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var d=h+65535;a>d?u=hm(l,u,t.subarray(h,d)):(l[h]=!0,u=hm(l,u,t.subarray(h,a)))}else{for(var v=vm[e-1],c=v>>>13,f=8191&v,p=(1<<i)-1,g=new qg(32768),m=new qg(p+1),y=Math.ceil(i/3),b=2*y,_=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},w=new jg(25e3),x=new qg(288),k=new qg(32),S=0,C=0,M=(h=0,0),T=0,E=0;a>h;++h){var I=_(h),P=32767&h,R=m[I];if(g[P]=R,m[I]=P,h>=T){var L=a-h;if((S>7e3||M>24576)&&L>423){u=dm(t,l,0,w,x,k,C,M,E,h-E,u),M=S=C=0,E=h;for(var O=0;286>O;++O)x[O]=0;for(O=0;30>O;++O)k[O]=0}var F=2,A=0,D=f,N=P-R&32767;if(L>2&&I==_(h-N))for(var q=Math.min(c,L)-1,j=Math.min(32767,h),B=Math.min(258,L);j>=N&&--D&&P!=R;){if(t[h+F]==t[h+F-N]){for(var H=0;B>H&&t[h+H]==t[h+H-N];++H);if(H>F){if(F=H,A=N,H>q)break;var U=Math.min(N,H-2),z=0;for(O=0;U>O;++O){var W=h-N+O+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,R=W)}}}N+=(P=R)-(R=g[P])+32768&32767}if(A){w[M++]=268435456|Vg[F]<<18|Zg[A];var Z=31&Vg[F],G=31&Zg[A];C+=Bg[Z]+Hg[G],++x[257+Z],++k[G],T=h+F,++S}else w[M++]=t[h],++x[t[h]]}}u=dm(t,l,!0,w,x,k,C,M,E,h-E,u)}return rm(o,0,r+im(u)+n)}(n,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+s.mem,a,o)),u=l.length;return function(t,e){var i=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&&fm(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;i.length>=r;++r)t[r+10]=i.charCodeAt(r)}}(l,e),fm(l,u-8,i.d()),fm(l,u-4,r),l}var gm=!!Es||!!Ts,mm="text/plain",ym=!1,bm=(t,e)=>{var i=t.split("#"),r=i[1],n=i[0].split("?"),s=n[0],a=n[1];if(!a)return t;var o=a.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(o?"?"+o:"")+(r?"#"+r:"")},_m=function(t,e,r){var n;void 0===r&&(r=!0);var s=t.split("?"),a=s[0],o=s[1],l=i({},e),u=null!==(n=null==o?void 0:o.split("&").map((t=>{var e,i=t.split("="),n=i[0],s=r&&null!==(e=l[n])&&void 0!==e?e:i[1];return delete l[n],n+"="+s})))&&void 0!==n?n:[],h=Ks(l);return h&&u.push(h),u.length>0?a+"?"+u.join("&"):a},wm=t=>{if(t.Yi)return t.Yi;var e=t.data,i=t.compression;if(e){if(i===zl){var r=pm(function(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new Ng(t.length+(t.length>>>1)),n=0,s=function(t){r[n++]=t},a=0;i>a;++a){if(n+5>r.length){var o=new Ng(n+8+(i-a<<1));o.set(r),r=o}var l=t.charCodeAt(a);128>l?s(l):2048>l?(s(192|l>>>6),s(128|63&l)):l>55295&&57344>l?(s(240|(l=65536+(1047552&l)|1023&t.charCodeAt(++a))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return rm(r,0,n)}(Qs(e)),{mtime:0});return{contentType:mm,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Wl){var n=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Qs(e)),s=(t=>"data="+encodeURIComponent("string"==typeof t?t:Qs(t)))(n);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Qs(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},xm=t=>{var e,r,n=()=>"sendBeacon"===t.transport?{url:_m(t.url,{compression:Wl}),encodedBody:wm(i({},t,{compression:Wl,Yi:void 0}))}:{url:bm(t.url,"compression"),encodedBody:wm(i({},t,{compression:void 0,Yi:void 0}))};try{e=wm(t)}catch(e){if(Ri(t.compression,Ys(t.url,"compression")))return Ds.error("Failed to gzip request body, sending uncompressed payload",e),n();throw e}return e&&Ri(t.compression,Ys(t.url,"compression"))&&!((r=e.body)instanceof ArrayBuffer?Pi(new Uint8Array(r)):ArrayBuffer.isView(r)&&Pi(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(ym=!0,n()):{url:t.url,encodedBody:e}},km=t=>{try{return xm(t)}catch(e){return Ds.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},Sm=function(){var t=e((function*(t){var e=Qs(t.data),r=yield function(t,e,i){return Ai.apply(this,arguments)}(e,Fs.DEBUG,{rethrow:!0});if(!r)return t;var n=yield r.arrayBuffer();return i({},t,{Yi:{contentType:mm,body:n,estimatedSize:n.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),Cm=/Failed to fetch|NetworkError|Load failed/i,Mm=t=>{var e=km(t);if(e){var r=e.url,n=e.encodedBody,s=null!=n?n:{},a=s.contentType,o=s.body,l=s.estimatedSize,u=new Headers;qs(t.headers,(function(t,e){u.append(e,t)})),a&&u.append("Content-Type",a);var h=null,d=!1;if(Is){var v=new Is;h={signal:v.signal,timeout:setTimeout((()=>{var e,i;d=!0,v.abort((e=t.timeout,(i=new Error("PostHog request timed out"+(e?" after "+e+"ms":""))).name="AbortError",i))}),t.timeout)}}var c=e=>{d&&"AbortError"===(null==e?void 0:e.name)||(t=>"TypeError"===(null==t?void 0:t.name)&&Cm.test((null==t?void 0:t.message)||""))(e)?Ds.warn(e):Ds.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var f;Ts(r,i({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.Xi&&52428.8>(l||0),body:o,signal:null==(f=h)?void 0:f.signal},t.fetchOptions)).then((e=>e.text().then((i=>{var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){Ds.error(t)}null==t.callback||t.callback(r)})))).catch(c).finally((()=>h?clearTimeout(h.timeout):null))}catch(t){h&&clearTimeout(h.timeout),c(t)}}},Tm=t=>{try{var e,r=xm(t),n=r.url,s=r.encodedBody,a=null!=s?s:{},o=a.body,l=a.estimatedSize;if(!o)return;var u=o instanceof Blob?o:new Blob([o],{type:a.contentType});if(Ss.sendBeacon(n,u))return;var h=Wi(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(Wi(h)&&h.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(h.length/2),v=e=>Wi(t.data)?e:i({},t.data,{batch:e});return Tm(i({},t,{data:v(h.slice(0,d))})),void Tm(i({},t,{data:v(h.slice(d))}))}Ds.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Mm(i({},t,{Xi:!0}))}catch(t){Ds.warn("Beacon send failed",t)}},Em=(t,e,r,n)=>{var s="query"===n?"POST"===e?"sent_at":"_":void 0;return _m(r===zl?bm(t,"compression"):t,i({},s?{[s]:Date.now().toString()}:{},r===zl?{}:{compression:r}))},Im=[];Ts&&Im.push({transport:"fetch",method:Mm}),Es&&Im.push({transport:"XHR",method(t){var e=km(t);if(e){var i=new Es,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var n=null!=r?r:{},s=n.contentType,a=n.body;qs(t.headers,(function(t,e){i.setRequestHeader(e,t)})),s&&i.setRequestHeader("Content-Type",s),t.timeout&&(i.timeout=t.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var e={statusCode:i.status,text:i.responseText};if(200===i.status)try{e.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(e)}},i.send(a)}}}),null!=Ss&&Ss.sendBeacon&&Im.push({transport:"sendBeacon",method:Tm});var Pm=3e3;class Rm{constructor(t,e){this.tr=!0,this.er=[],this.ir=cr((null==e?void 0:e.flush_interval_ms)||Pm,250,5e3,Ds.createLogger("flush interval"),Pm),this.rr=t}enqueue(t){this.er.push(t),this.nr||this.sr()}unload(){this.ar();var t=this.er.length>0?this.lr():{},e=Object.values(t),r=[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))];r.map((t=>{this.ur(i({},t,{transport:"sendBeacon"}))}))}enable(){this.tr=!1,this.sr()}sr(){var t=this;this.tr||(this.nr=setTimeout((()=>{if(this.ar(),this.er.length>0){var e=this.lr(),i=function(){var i=e[r],n=(new Date).getTime();i.data&&Wi(i.data)&&qs(i.data,(t=>{t.offset=Math.abs(t.timestamp-n),delete t.timestamp})),t.ur(i)};for(var r in e)i()}}),this.ir))}ur(t){try{this.rr(t)}catch(t){Ds.error(t)}}ar(){clearTimeout(this.nr),this.nr=void 0}lr(){var t={};return qs(this.er,(e=>{var r,n=e,s=(n?n.batchKey:null)||n.url;Qi(t[s])&&(t[s]=i({},n,{data:[]})),null==(r=t[s].data)||r.push(n.data)})),this.er=[],t}}var Lm=["retriesPerformedSoFar"];class Om{constructor(t){this.hr=!1,this.dr=3e3,this.er=[],this._instance=t,this.er=[],this.vr=!0,!Qi(xs)&&"onLine"in xs.navigator&&(this.vr=xs.navigator.onLine,this.cr=()=>{this.vr=!0,this.pr()},this.gr=()=>{this.vr=!1},Zs(xs,"online",this.cr),Zs(xs,"offline",this.gr))}get length(){return this.er.length}retriableRequest(t){var e=t.retriesPerformedSoFar,n=r(t,Lm);er(e)&&(n.url=_m(n.url,{retry_count:e})),this._instance._send_request(i({},n,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.Lt(i({retriesPerformedSoFar:e},n));0===t.statusCode&&Ds.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=e?e:0)+" retries.")}null==n.callback||n.callback(t)}}))}Lt(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var i=function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),n=Math.random()-.5;return Math.ceil(r+n*(r-i))}(e),r=Date.now()+i;this.er.push({retryAt:r,requestOptions:t});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),Ds.warn(n),this.hr||(this.hr=!0,this.mr())}mr(){if(this.yr&&clearTimeout(this.yr),0===this.er.length)return this.hr=!1,void(this.yr=void 0);this.yr=setTimeout((()=>{this.vr&&this.er.length>0&&this.pr(),this.mr()}),this.dr)}pr(){var t=Date.now(),e=[],i=this.er.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this.er=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var t of(this.yr&&(clearTimeout(this.yr),this.yr=void 0),this.hr=!1,Qi(xs)||(this.cr&&(xs.removeEventListener("online",this.cr),this.cr=void 0),this.gr&&(xs.removeEventListener("offline",this.gr),this.gr=void 0)),this.er)){var e=t.requestOptions;try{this._instance._send_request(i({},e,{transport:"sendBeacon"}))}catch(t){Ds.error(t)}}this.er=[]}}class Fm{constructor(t){this.br=()=>{var t,e,i,r;this._r||(this._r={});var n=this.scrollElement(),s=this.scrollY(),a=n?Math.max(0,n.scrollHeight-n.clientHeight):0,o=s+((null==n?void 0:n.clientHeight)||0),l=(null==n?void 0:n.scrollHeight)||0;this._r.lastScrollY=Math.ceil(s),this._r.maxScrollY=Math.max(s,null!==(t=this._r.maxScrollY)&&void 0!==t?t:0),this._r.maxScrollHeight=Math.max(a,null!==(e=this._r.maxScrollHeight)&&void 0!==e?e:0),this._r.lastContentY=o,this._r.maxContentY=Math.max(o,null!==(i=this._r.maxContentY)&&void 0!==i?i:0),this._r.maxContentHeight=Math.max(l,null!==(r=this._r.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get wr(){return this._instance.config.scroll_root_selector}getContext(){return this._r}resetContext(){var t=this._r;return setTimeout(this.br,0),t}startMeasuringScrollPosition(){Zs(xs,"scroll",this.br,{capture:!0}),Zs(xs,"scrollend",this.br,{capture:!0}),Zs(xs,"resize",this.br)}scrollElement(){if(!this.wr)return null==xs?void 0:xs.document.documentElement;var t=Wi(this.wr)?this.wr:[this.wr];for(var e of t){var i=null==xs?void 0:xs.document.querySelector(e);if(i)return i}}kr(t){var e="y"===t?"scrollTop":"scrollLeft";if(this.wr){var i=this.scrollElement();return i&&i[e]||0}return xs?"y"===t?xs.scrollY||xs.pageYOffset||xs.document.documentElement.scrollTop||0:xs.scrollX||xs.pageXOffset||xs.document.documentElement.scrollLeft||0:0}scrollY(){return this.kr("y")}scrollX(){return this.kr("x")}}var Am=t=>wv(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class Dm{constructor(t,e,i,r){this.Sr=t=>{var e=this.Cr();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Mr(this._instance)};this.Tr.register({[fh]:i})}},this._instance=t,this.Er=e,this.Tr=i,this.Mr=r||Am,this.Er.onSessionId(this.Sr)}Cr(){return this.Tr.props[fh]}getSetOnceProps(){var t,e=null==(t=this.Cr())?void 0:t.props;return e?"r"in e?xv(e,this._instance.config.disable_capture_url_hashes):{$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 qs(zs(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+ji(i)]=e})),t}}class $m{on(t,e){return this.Ir[t]||(this.Ir[t]=[]),this.Ir[t].push(e),()=>{this.Ir[t]=this.Ir[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.Ir[t]||[])i(e);for(var r of this.Ir["*"]||[])r(t,e)}constructor(){this.Ir={}}}var Nm=$s("[SessionId]");class qm{on(t,e){return this.Pr.on(t,e)}constructor(t,e,i){var r;if(this.Rr=null,this.Lr=[],this.Or=void 0,this.Fr=!1,this.Pr=new $m,this.Ar=(t,e)=>!(!er(t)||!er(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Th)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Pe=t.config,this.Tr=t.persistence,this.Dr=void 0,this.$r=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Nr=e||Hh,this.qr=i||Hh;var n=this.Pe.persistence_name||this.Pe.token;if(this._sessionTimeoutMs=1e3*cr(this.Pe.session_idle_timeout_seconds||1800,60,36e3,Nm.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.jr(),this.Br="ph_"+n+"_window_id",this.Hr="ph_"+n+"_primary_window_exists",this.Ur()){var s=sd.H(this.Br),a=sd.H(this.Hr);s&&!a?this.Dr=s:sd.F(this.Br),sd.A(this.Hr,!0)}if(null!=(r=this.Pe.bootstrap)&&r.sessionID)try{var o=(t=>{var e=this.Pe.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.zr(this.Pe.bootstrap.sessionID,(new Date).getTime(),o)}catch(t){Nm.error("Invalid sessionID in bootstrap",t)}this.Wr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Qi(this.Lr)&&(this.Lr=[]),this.Lr.push(t),this.$r&&t(this.$r,this.Dr),()=>{this.Lr=this.Lr.filter((e=>e!==t))}}Ur(){return"memory"!==this.Pe.persistence&&!this.Tr.ki&&sd.P()}Vr(t){t!==this.Dr&&(this.Dr=t,this.Ur()&&sd.A(this.Br,t))}Zr(){return this.Dr?this.Dr:this.Ur()?sd.H(this.Br):null}Gr(t){var e=this.Rr;return!Yi(e)&&!Yi(t)&&5e3>Math.abs(t-e)}zr(t,e,i){var r=e!==this._sessionActivityTimestamp,n=!(t!==this.$r||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.$r=t,n&&!r||n&&this.Gr(e)||(this.Rr=e,this.Tr.register({[zu]:[e,t,i]}))}Qr(){var t,e=null==(t=this.Pe)?void 0:t.persistence_save_debounce_ms;return er(e)&&e>0}Jr(){this.Qr()?this.Tr.refreshKey(zu):(this.Tr.flush(),this.Tr.load())}Kr(){var t;if(!Yi(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Rr){this.Jr();var e=this.Yr();e[1]===this.$r&&e[2]===this._sessionStartTimestamp&&(this.Rr=this._sessionActivityTimestamp,this.Tr.register({[zu]:[this._sessionActivityTimestamp,null!==(t=this.$r)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Tr.flush())}}Xr(){var t=this.Yr()[0],e=er(t)?t:0,i=er(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}tn(t){return this.Jr(),this.Ar(t,this.Xr())}Yr(){var t=this.Tr.props[zu];return Wi(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Rr=null,clearTimeout(this.en),this.en=void 0,this.zr(null,null,null)}destroy(){this.Fr=!0,this.Kr(),clearTimeout(this.en),this.en=void 0,this.Or&&xs&&(xs.removeEventListener(Lh,this.Or,{capture:!1}),this.Or=void 0),this.Lr=[]}Wr(){this.Or=()=>{this.Kr(),this.Ur()&&sd.F(this.Hr)},Zs(xs,Lh,this.Or,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Pe.cookieless_mode===Th)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=e||(new Date).getTime(),r=this.Yr(),n=r[1],s=r[2],a=this.Xr(),o=this.Zr(),l=er(s)&&Math.abs(i-s)>864e5,u=!1,h=!1,d=!n,v=n,c=!d&&!t&&this.Ar(i,a);if(c){(c=this.tn(i))||Nm.info("cross-tab refresh kept the session alive",{sessionId:n});var f=this.Yr();n=f[1],s=f[2]}d||c||l?(n=this.Nr(),o=this.qr(),Nm.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:d,activityTimeout:c,sessionPastMaximumLength:l}}),s=i,u=!0):(o||(o=this.qr(),u=!0),(h=n!==v)&&(Nm.info("adopted cross-tab session id",{sessionId:n,windowId:o}),u=!0));var p=er(a)&&t&&!l?a:i,g=er(s)?s:(new Date).getTime();this.Vr(o),this.zr(n,p,g),t||this.jr();var m={noSessionId:d,activityTimeout:c,sessionPastMaximumLength:l,crossTabAdoption:h};return u&&this.Lr.forEach((t=>t(n,o,m))),{sessionId:n,windowId:o,sessionStartTimestamp:g,changeReason:u?m:void 0,lastActivityTimestamp:a}}jr(){this.Fr||(clearTimeout(this.en),this.en=setTimeout((()=>{if(!this.Fr)if(this.tn((new Date).getTime())){var t=this.$r;this.resetSessionId(),this.Pr.emit("forcedIdleReset",{idleSessionId:t})}else this.jr()}),1.1*this.sessionTimeoutMs))}}var jm=function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&$i(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>$i(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver};function Bm(){return Bm=e((function*(){var t=null==Ss?void 0:Ss.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),i=null==e?void 0:e.model;return Ji(i)&&i.length>0?i:void 0}catch(t){return void Ds.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})),Bm.apply(this,arguments)}var Hm="custom",Um="i.posthog.com",zm=/^\/static\//;class Wm{constructor(t){this.rn={},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("."+Um,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.rn[this.apiHost]||(this.rn[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":Hm),this.rn[this.apiHost]}nn(t){if(zm.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)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 i=this.nn(e);if(i)return""+i+e}if(this.region===Hm)return this.apiHost+e;var r=Um+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Vm=$s("[PostHog ExternalIntegrations]"),Zm={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Gm{constructor(t){this._instance=t}ai(t,e){var i;null==(i=Mo.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return Vm.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(){var e,r,n,s=i[0],a=i[1];!a||null!=(e=Mo.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[s]||t.ai(Zm[s],(()=>{var e;null==(e=Mo.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(t._instance)})),!a&&null!=(r=Mo.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[s]&&(null==(n=Mo.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[s])||n.stop())};for(var i of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r;e()}}}class Qm{constructor(t,e){this.rt=t,this.sn=e,this.an=new Map,this.ln=!1}add(t){var i=this;return e((function*(){if(i.ln)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(i.an.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');i.an.set(t.name,t);try{var e=t.setup(i.sn);e&&(yield e)}catch(e){var r=i.an.get(t.name)===t;r&&i.an.delete(t.name),i.rt.error('Failed to set up browser extension "'+t.name+'"',e),r&&i.un(t)}}))()}dispose(){if(!this.ln){this.ln=!0;var t=Array.from(this.an.values()).reverse();for(var e of(this.an.clear(),t))this.un(e)}}un(t){try{var e=null==t.dispose?void 0:t.dispose();e&&Vi(e.then)&&e.then(void 0,(e=>{this.rt.error('Failed to dispose browser extension "'+t.name+'"',e)}))}catch(e){this.rt.error('Failed to dispose browser extension "'+t.name+'"',e)}}}class Jm{constructor(t){this._instance=t}get(t){var e;return null==(e=this._instance.persistence)?void 0:e.get_property(t)}set(t,e){var i;null==(i=this._instance.persistence)||i.set_property(t,e)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}}var Km="extensionsRemoteConfig";class Ym{constructor(t){this.ln=!1,this.instance=t,this.rt=Ds.createLogger("[BrowserExtensions]"),this.hn=t.dn,this.kv=new Jm(t),this.onEvent=t=>Ul(this.instance.on("eventCaptured",(e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.rt.error("Browser extension event listener failed",t)}}))),this.onRemoteConfig=t=>{if(this.ln)return Ul((()=>{}));var e=e=>{try{t(e)}catch(t){this.rt.error("Browser extension remote config listener failed",t)}},i=this.instance.vn.on(Km,e);return this.hn&&e(this.hn),Ul(i)},this.cn=new Qm(this.rt,this)}get logger(){return this.rt}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property(Cu))&&void 0!==t?t:this.distinctId}get groups(){return this.instance.getGroups()}get session(){try{var t,e,i,r,n=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==n?void 0:n.sessionId)&&void 0!==e?e:"",windowId:null!==(i=null==n?void 0:n.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(r=null==n?void 0:n.sessionStartTimestamp)&&void 0!==r?r:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(t){return this.cn.add(t)}capture(t,i,r){var n=this;return e((function*(){r?n.instance.capture(t,i,{timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce}):n.instance.capture(t,i)}))()}registerDynamicEventProperties(t){return Ul(this.instance.fn(t))}handleRemoteConfig(t){this.ln||(this.hn=t,this.instance.vn.emit(Km,t))}sendRequest(t,i){var r=this;return e((function*(){var e;void 0===i&&(i={});var n=r.instance.requestRouter.endpointFor(null!==(e=i.target)&&void 0!==e?e:"api",t),s={method:i.method,url:i.query?_m(n,i.query):n,data:i.body,headers:i.headers,timeout:i.timeoutMs,fireCallbackOnDrop:!0,transport:i.transport};return"sendBeacon"===i.transport?(r.instance._send_request(s),{statusCode:202}):new Promise((t=>{s.callback=t,r.instance._send_request(s)}))}))()}dispose(){this.ln||(this.ln=!0,this.cn.dispose())}}var Xm={},ty=0,ey=()=>{},iy='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ry="Surveys module not available",ny="sanitize_properties is deprecated. Use before_send instead",sy="Invalid value for property_denylist config: ",ay=["token","distinct_id",wh],oy="posthog",ly=!gm&&-1===(null==Rs?void 0:Rs.indexOf("MSIE"))&&-1===(null==Rs?void 0:Rs.indexOf("Mozilla")),uy=t=>{var e;return i({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Vs(null==Cs?void 0:Cs.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:ey,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:Ms&&Ji(null==Ms?void 0:Ms.search)&&-1!==Ms.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,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==xs||null==(e=xs.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){Ds.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:Ph,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Pm},error_tracking:{},_onCapture:ey},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Ia,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>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}: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),disable_capture_url_hashes:!(!t||"2026-06-25">t)}))(t))},hy=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],dy=t=>{var e={};for(var i of hy){var r=i[0],n=i[1];Qi(t[r])||(e[n]=t[r])}var s=js({},e,t),a=t.__preview_external_dependency_versioned_paths;return Qi(a)||(Qi(t.strict_script_versioning)&&(s.strict_script_versioning=!!a),Ji(a)&&Qi(t.asset_host)&&(s.asset_host=a)),Wi(t.property_blacklist)&&(Qi(t.property_denylist)?s.property_denylist=t.property_blacklist:Wi(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:Ds.error(sy+t.property_denylist)),s};class vy{constructor(){this.__forceAllowLocalhost=!1}get pn(){return this.__forceAllowLocalhost}set pn(t){Ds.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class cy{gn(t,e){if(t){var i=this.an.indexOf(t);-1!==i&&this.an.splice(i,1)}return this.an.push(e),null==e.initialize||e.initialize(),e}mn(){return this.config.cookieless_mode===Th||this.config.cookieless_mode===Mh&&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 vy,this.yn=!1,this.version=Fs.LIB_VERSION,this.vn=new $m,this.an=[],this.bn=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=uy(),this.SentryIntegration=Sg,this.sentryIntegration=t=>function(t,e){var i=kg(t,e);return{name:xg,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._n=!1,this.wn=null,this.xn=null,this.kn=null,this.scrollManager=new Fm(this),this.pageViewManager=new Cg(this),this.rateLimiter=new Ag(this),this.requestRouter=new Wm(this),this.consent=new gg(this),this.externalIntegrations=new Gm(this);var e=null!==(t=cy.__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.metrics=e.metrics&&new e.metrics(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,i)=>{var r=Ji(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=Ji(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>Ds.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==oy){var r,n=null!==(r=Xm[i])&&void 0!==r?r:new cy;return n._init(t,e,i),Xm[i]=n,Xm[oy][i]=n,n}return this._init(t,e,i)}_init(t,e,r){var n,s;void 0===e&&(e={});var a,o=Ji(t)?t.trim():"";if(!o)return Ds.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 o!==(null==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+o+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=uy(e.defaults),e.debug=this.Sn(e.debug),this.Cn=e,this.Mn=[],e.person_profiles?this.xn=e.person_profiles:e.process_person&&(this.xn=e.process_person);var l=uy(e.defaults),u=dy(e),h=js({},l,u,{name:r,token:o});Zi(l.rageclick)&&Zi(u.rageclick)&&(h.rageclick=js({},l.rageclick,u.rageclick)),Zi(l.session_recording)&&Zi(u.session_recording)&&(h.session_recording=js({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&Ds.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:zl;var d=this.Tn();this.persistence=new Og(this.config,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Og(i({},this.config,{persistence:"sessionStorage"}),d,!1);var v=i({},this.persistence.props),c=i({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.En=new Rm((t=>this.In(t)),this.config.request_queue_config),this.Pn=new Om(this),this.__request_queue=[];var f=this.mn();if(f||(this.sessionManager=new qm(this),this.sessionPropsManager=new Dm(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Ds.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Rn(f)}),0)):(Ds.info("Initializing extensions synchronously"),this.Rn(f)),Fs.DEBUG=Fs.DEBUG||this.config.debug,Fs.DEBUG&&Ds.info("Starting in debug mode",{this:this,config:e,thisC:i({},this.config),p:v,s:c}),!this.config.identity_distinct_id||null!=(n=e.bootstrap)&&n.distinctID||(e.bootstrap=i({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(s=e.bootstrap)?void 0:s.distinctID)){var p=e.bootstrap.distinctID,g=this.get_distinct_id(),m=this.persistence.get_property(ch);if(e.bootstrap.isIdentifiedID&&null!=g&&g!==p&&m===Eh)this.identify(p);else if(e.bootstrap.isIdentifiedID&&null!=g&&g!==p&&m===Ih)Ds.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 y=this.config.get_device_id(Hh()),b=e.bootstrap.isIdentifiedID?y:p;this.persistence.set_property(ch,e.bootstrap.isIdentifiedID?Ih:Eh),this.register({distinct_id:p,$device_id:b})}}if(f)this.register_once({distinct_id:_h,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(Hh());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(ch,Eh)}return Zs(xs,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),e.segment?function(t,e){var i=t.config.segment;if(!i)return e();!function(t,e){var i=t.config.segment;if(!i)return e();var r=i=>{var r=()=>i.anonymousId()||Hh();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(ch,Ih)),e()},n=i.user();"then"in n&&Vi(n.then)?n.then(r):r(n)}(t,(()=>{i.register((t=>{"undefined"!=typeof Promise&&Promise.resolve||wg.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,i)=>{if(!i)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(wg.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(wg.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var r=t.calculateEventProperties(i,e.event.properties);return e.event.properties=Object.assign({},r,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,Oh),identify:t=>e(t,Ah),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Ln())):this.Ln(),Vi(this.config._onCapture)&&this.config._onCapture!==ey&&(Ds.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&Ds.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.config.disableDeviceModel||function(){return Bm.apply(this,arguments)}().then((t=>{t&&this.register({[Mu]:t})})).catch(ey),this}Rn(t){var e,r,n,s,a,o,l,u,h=performance.now(),d=i({},cy.__defaultExtensionClasses,this.config.__extensionClasses),v=[];d.featureFlags&&this.an.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new d.featureFlags(this)),d.exceptions&&this.an.push(this.exceptions=null!==(r=this.exceptions)&&void 0!==r?r:new d.exceptions(this)),d.historyAutocapture&&this.an.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.an.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.an.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!t&&this.an.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||v.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),d.autocapture&&this.an.push(this.autocapture=new d.autocapture(this)),d.surveys&&this.an.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new d.surveys(this)),d.logs&&this.an.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new d.logs(this)),d.metrics&&this.an.push(this.metrics=null!==(a=this.metrics)&&void 0!==a?a:new d.metrics(this)),d.conversations&&this.an.push(this.conversations=null!==(o=this.conversations)&&void 0!==o?o:new d.conversations(this)),d.productTours&&this.an.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.an.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.an.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.an.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.an.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,bg)),d.toolbar&&this.an.push(this.toolbar=null!==(l=this.toolbar)&&void 0!==l?l:new d.toolbar(this)),d.experiments&&this.an.push(this.experiments=null!==(u=this.experiments)&&void 0!==u?u:new d.experiments(this)),this.an.forEach((t=>{t.initialize&&v.push((()=>{null==t.initialize||t.initialize()}))})),v.push((()=>{if(this.On){var t=this.On;this.On=void 0,this.an.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}})),this.Fn(v,h)}Fn(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Fn(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){Ds.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[xh]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[kh]:r}),this.config.__preview_deferred_init_extensions&&Ds.info("PostHog extensions initialized ("+r+"ms)")}Gi(t){var e;if(!Cs||!Cs.body)return Ds.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Gi(t)}),500);if(this.config.__preview_deferred_init_extensions&&(this.On=t),this.dn=t,this.compression=void 0,t.ok){var i,r=t.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=Ni(r.supportedCompression,zl)?zl:Ni(r.supportedCompression,Wl)?Wl:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.xn?this.xn:Ph}),null==(e=this.An)||e.handleRemoteConfig(t),this.an.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Ln(){try{this.config.loaded(this)}catch(t){Ds.critical("`loaded` function failed",t)}if(this.Dn(),this.config.internal_or_test_user_hostname&&null!=Ms&&Ms.hostname){var t=Ms.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.mn())&&this.$n()}),1),this.Nn=new $g(this),this.Nn.load()}Dn(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.En)||t.enable())}_dom_loaded(){this.is_capturing()&&Ns(this.__request_queue,(t=>this.In(t))),this.__request_queue=[],this.Dn()}_handle_unload(){var t,e,i,r,n;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.qn()&&this.capture(Fh),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.En)||r.unload(),null==(n=this.Pn)||n.unload()):this.qn()&&this.capture(Fh,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?ly?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=i({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,(Qi(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,r,n,s=i({},t);s.timeout=s.timeout||6e4;var a,o,l,u,h,d=null!==(e=s.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&Qi(s.compression)&&s.data&&(s.compression=Wl),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(o=null==(h=(u=Wi(a=s.data)?a:[a])[0])||null==(l=h.properties)?void 0:l.token)&&void 0!==o?o:null==h?void 0:h.token,batch:u,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),Wi(t)?t.map((t=>i({},t,{sent_at:e}))):i({},t,{sent_at:e})}(s.data))),s.url=Em(s.url,s.method,s.compression,s.timestampMode);var v=Im.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),c=null!==(r=null==(n=function(t,e){for(var i=0;t.length>i;i++)if(e(t[i]))return t[i]}(v,(t=>t.transport===d)))?void 0:n.method)&&void 0!==r?r:v[0].method;if(!c)throw new Error("No available transport method");"sendBeacon"!==d&&s.data&&s.compression===zl&&Ps&&"undefined"!=typeof Promise&&!ym?Sm(s).then((t=>{c(t)})).catch((e=>{if(Li(e))return ym=!0,void c(i({},s,{compression:void 0,url:Em(t.url,t.method,void 0,t.timestampMode)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return Li(t)||e===Ii})(e)&&(ym=!0),c(s)})):c(s)})(i({},t,{callback:e=>{var i,r;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}In(t){this.Pn?this.Pn.retriableRequest(t):this._send_request(t)}_execute_array(t){ty++;try{var e,i=[],r=[],n=[];Ns(t,(t=>{if(t)if(Wi(e=t[0]))n.push(t);else if(Vi(t))try{t.call(this)}catch(e){Ds.error("Error executing queued PostHog call",t,e)}else Wi(t)&&"alias"===e?i.push(t):Wi(t)&&-1!==e.indexOf("capture")&&Vi(this[e])?n.push(t):r.push(t)}));var s=function(t,e){Ns(t,(function(t){try{if(Wi(t[0])){var i=e;qs(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){Ds.error("Error executing queued PostHog call",t,e)}}))};s(i,this),s(r,this),s(n,this)}finally{ty--}}push(t){if(ty>0&&Wi(t)&&Ji(t[0])){var e=cy.prototype[t[0]];Vi(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,r){var n,s,a,o,l,u,h;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.En){if(this.is_capturing())if(!Qi(t)&&Ji(t)){var d=!this.config.opt_out_useragent_filter&&this._is_bot();if(!d||this.config.__preview_capture_bot_pageviews){var v=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==v||!v.isRateLimited){if(this.bn.length>0){var c={};for(var f of this.bn.slice())try{js(c,f())}catch(t){Ds.error("Failed to produce browser extension event properties",t)}e=i({},c,null!=e?e:{})}var p;null!=(n=e)&&n.$current_url&&!Ji(null==(s=e)?void 0:s.$current_url)&&(Ds.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==(p=e)||delete p.$current_url),"$exception"!==t||null!=r&&r.jn||Ds.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 g=new Date,m=(null==r?void 0:r.timestamp)||g,y=xn(null==r?void 0:r.uuid,Hh),b={uuid:y,event:t,properties:this.calculateEventProperties(t,e||{},m,y)};t===Oh&&this.config.__preview_capture_bot_pageviews&&d&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),v&&(b.properties.$lib_rate_limit_remaining_tokens=v.remainingTokens);var _="$feature_flag_called"===t&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property(Yu);(null==r?void 0:r.$set)&&!_&&(b.$set=null==r?void 0:r.$set);var w=null==r?void 0:r.$unset;w&&(b.$unset=w);var x=_?void 0:this.Bn(null==r?void 0:r.$set_once,t!==Dh,t===Ah);if(x&&(b.$set_once=x),null!=r&&r._noTruncate||(o=this.config.properties_string_max_length,l=b,u=t=>Ji(t)?t.slice(0,o):t,h=new Set,b=function t(e,i){if(e!==Object(e))return u?u(e):e;if(!h.has(e)){var r;if(h.add(e),Wi(e))r=[],Ns(e,(e=>{r.push(t(e))}));else{var n={};qs(e,((e,i)=>{h.has(e)||(n[i]=t(e,i))})),r=n}return r}}(l)),b.timestamp=m,Qi(null==r?void 0:r.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=g),_&&(b.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return xi.forEach(r),e.forEach(r),i}(b.properties,ay)),t===eu.DISMISSED||t===eu.SENT){var k,S,C=null==(k=e)?void 0:k[iu.SURVEY_ID],M=null==(S=e)?void 0:S[iu.SURVEY_ITERATION];wu({id:C,current_iteration:M}),b.$set=i({},b.$set,{[ou({id:C,current_iteration:M},t===eu.SENT?"responded":"dismissed")]:!0})}else t===eu.SHOWN&&(b.$set=i({},b.$set,{[iu.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if("product tour shown"===t){var T,E=null==(T=e)?void 0:T.$product_tour_type;E&&(b.$set=i({},b.$set,{["$product_tour_last_seen_date/"+E]:(new Date).toISOString()}))}var I=i({},b.properties.$set,b.$set);if(Gi(I)||this.setPersonPropertiesForFlags(I),!Xi(this.config.before_send)){var P=this.Pt(b);if(!P)return;(b=P).uuid=xn(b.uuid,Hh)}this.vn.emit("eventCaptured",b);var R=null!==(a=null==r?void 0:r._url)&&void 0!==a?a:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),L={method:"POST",url:R,data:b,compression:"best-available",timestampMode:"recordings"===(null==r?void 0:r._batchKey)||/\/s\/(?:\?|$)/.test(R)?"body":"capture-body",batchKey:null==r?void 0:r._batchKey,transport:null==r?void 0:r.transport};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this.In(L):this.En.enqueue(L),b}Ds.critical("This capture call is ignored due to client rate limiting.")}}else Ds.error("No event name provided to posthog.capture")}else Ds.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}Hn(){var t;return null!==(t=this.An)&&void 0!==t?t:this.An=new Ym(this)}fn(t){this.bn.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.bn.indexOf(t);-1!==i&&this.bn.splice(i,1)}}}calculateEventProperties(t,e,r,n,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return e;var a=s?void 0:this.persistence.remove_event_timer(t),o=i({},e);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.mn()&&(o[wh]=!0),"$snapshot"===t){var l=i({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!Ji(o.distinct_id)&&!tr(o.distinct_id)||Ki(o.distinct_id))&&Ds.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var u,h=function(t,e,i,r){var n,s,a,o;if(void 0===r&&(r=!1),!Rs)return{};var l,u=t?[...dv,...e||[]]:[],h=function(t){for(var e=0;yn.length>e;e++){var i=yn[e],r=i[1],n=i[0].exec(t),s=n&&(Vi(r)?r(n,t):r);if(s)return s}return["",""]}(Rs),d=h[0],v=h[1],c=null!=(l="undefined"!=typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},f={};Qi(i)||(f.detectGoogleSearchApp=i);var p={},g=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,m=null==(s=navigator)?void 0:s.maxTouchPoints,y=null==xs||null==(a=xs.screen)?void 0:a.width,b=null==xs||null==(o=xs.screen)?void 0:o.height,_=null==xs?void 0:xs.devicePixelRatio;Qi(g)||(p.userAgentDataPlatform=g),Qi(m)||(p.maxTouchPoints=m),Qi(y)||(p.screenWidth=y),Qi(b)||(p.screenHeight=b),Qi(_)||(p.devicePixelRatio=_);var w,x=js(zs({$os:d,$os_version:v,$browser:pn(Rs,navigator.vendor,c,f),$device:bn(Rs),$device_type:_n(Rs,p),$timezone:kv(),$timezone_offset:Sv()}),{$current_url:Xs(r?kn(null==Ms?void 0:Ms.href):null==Ms?void 0:Ms.href,u,cv),$host:null==Ms?void 0:Ms.host,$pathname:null==Ms?void 0:Ms.pathname,$raw_user_agent:Rs.length>1e3?Rs.substring(0,997)+"...":Rs,$browser_version:mn(Rs,navigator.vendor,c,f),$browser_language:yv(),$browser_language_prefix:(w=yv(),"string"==typeof w?w.split("-")[0]:void 0),$screen_height:null==xs?void 0:xs.screen.height,$screen_width:null==xs?void 0:xs.screen.width,$viewport_height:null==xs?void 0:xs.innerHeight,$viewport_width:null==xs?void 0:xs.innerWidth,$lib:Fs.LIB_NAME,$lib_version:Fs.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Fs.SDK_DIST_CHANNEL&&(x.$sdk_dist_channel=Fs.SDK_DIST_CHANNEL),x}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var d=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime()),v=d.windowId;o.$session_id=d.sessionId,o.$window_id=v}this.sessionPropsManager&&js(o,this.sessionPropsManager.getSessionProps());try{var c;this.sessionRecording&&js(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=null==(c=this.Pn)?void 0:c.length}catch(t){o.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===Hm&&(o.$lib_custom_api_host=this.config.api_host),u=t!==Oh||s?t!==Fh||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,n),o=js(o,u),t===Oh&&Cs&&(o.title=Cs.title),!Qi(a)){var f=r.getTime()-a;o.$duration=parseFloat((f/1e3).toFixed(3))}Rs&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser");var p=this.persistence.properties(),g=this.sessionPersistence.properties();qs(["$referrer","$referring_domain"],(t=>{t in p&&delete g[t]})),(o=js({},h,p,g,o)).$is_identified=this._isIdentified(),Wi(this.config.property_denylist)?qs(this.config.property_denylist,(function(t){delete o[t]})):Ds.error(sy+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(Ds.error(ny),o=m(o,t));var y=this.Un();return o.$process_person_profile=y,y&&!s&&this.zn("_calculate_event_properties"),o}Bn(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.Un())return t;if(this.yn&&!i)return t;var n=this.persistence.get_initial_props(),s=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),a=js({},n,s||{},t||{}),o=this.config.sanitize_properties;return o&&(Ds.error(ny),a=o(a,"$set_once")),e&&(this.yn=!0),Gi(a)?void 0:a}register(t,e){var i;null==(i=this.persistence)||i.register(t,e)}register_once(t,e,i){var r;null==(r=this.persistence)||r.register_once(t,e,i)}register_for_session(t){var e;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}Wn(t,e){this.register({[t]:e})}getFeatureFlag(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var i,r;return null!==(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(t,e))&&void 0!==i?i:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,i){var r;null==(r=this.featureFlags)||r.updateFlags(t,e,i)}updateEarlyAccessFeatureEnrollment(t,e,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){var r;return void 0===e&&(e=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.vn.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:ry}),()=>{})}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:ry})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:ry})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=ku),null==(i=this.surveys)||i.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,i;return null!==(e=null==(i=this.surveys)?void 0:i.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:ry}}canRenderSurveyAsync(t,e){var i,r;return void 0===e&&(e=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(t,e))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:ry})}Vn(t){return!t||Ki(t)?(Ds.critical("Unique user id has not been set in posthog.identify"),!1):t===_h?(Ds.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())||(Ds.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,i){if(!this.__loaded||!this.persistence)return Ds.uninitializedWarning("posthog.identify");if(tr(t)&&(t=t.toString(),Ds.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Vn(t)&&this.zn("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:t}),this.get_property(Cu)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),t!==r&&t!==this.get_property(Tu)&&(this.unregister(Tu),this.register({distinct_id:t}));var n,s=(this.persistence.get_property(ch)||Eh)===Eh,a=t!==r,o=!a&&s;if(a&&s)this.persistence.set_property(ch,Ih),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.capture(Ah,{distinct_id:t,$anon_distinct_id:r},{$set:e||{},$set_once:i||{}}),this.kn=Wh(t,e,i),null==(n=this.featureFlags)||n.setAnonymousDistinctId(r);else if(o){this.persistence.set_property(ch,Ih);var l=e||{},u=i||{};this.setPersonPropertiesForFlags({$set:l,$set_once:u},!1),this.capture("$set",{$set:l,$set_once:u}),this.kn=Wh(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);a?(this.reloadFeatureFlags(),this.unregister(uh)):o&&(e||i)&&this.reloadFeatureFlags()}}setPersonProperties(t,e){if((t||e)&&this.zn("posthog.setPersonProperties")){var i=Wh(this.get_distinct_id(),t,e);this.kn!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.kn=i):Ds.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(Wi(t)?t:[t]).filter((t=>Ji(t)&&t.length>0));0!==i.length&&this.zn("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.kn=null)}group(t,e,r){if(t&&e){var n=this.getGroups(),s=n[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:i({},n,{[t]:e})}),s||r){var a={$group_type:t,$group_key:e};r&&(a.$group_set=r),this.capture(Dh,a)}r&&this.setGroupPropertiesForFlags({[t]:r}),s&&!r&&this.reloadFeatureFlags()}else Ds.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),this.zn("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){this.Zn(t)}Zn(t,e){var i,r,n,s,a,o,l,u,h,d;if(void 0===e&&(e=!1),Ds.info("reset"),!this.__loaded)return Ds.uninitializedWarning("posthog.reset");var v,c=this.get_property(Cu),f=this.get_property(Mu),p=this.get_property(Nu),g=this.is_capturing();if(this.consent.reset(),e||!g||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after."),null==(i=this.persistence)||i.clear(),null==(r=this.sessionPersistence)||r.clear(),Qi(p)||null==(v=this.persistence)||v.register({[Nu]:p}),null==(n=this.surveys)||n.reset(),null==(s=this.Nn)||s.stop(),null==(a=this.featureFlags)||a.reset(),null==(o=this.conversations)||o.reset(),null==(l=this.logs)||l.reset(),null==(u=this.metrics)||u.reset(),null==(h=this.persistence)||h.set_property(ch,Eh),null==(d=this.sessionManager)||d.resetSessionId(),this.kn=null,this.config.cookieless_mode===Th)this.register_once({distinct_id:_h,$device_id:null},"");else{var m=this.config.get_device_id(Hh());this.register_once({distinct_id:m,$device_id:t?m:c},""),t||Qi(f)||this.register({[Mu]:f})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(t){var i=this;return e((function*(){var t,e,r,n,s,a,o;i.__loaded?(null==(t=i.Nn)||t.stop(),null==(e=i.An)||e.dispose(),null==(r=i.logs)||r.flushLogs("sendBeacon"),null==(n=i.metrics)||n.flush("sendBeacon"),null==(s=i.En)||s.unload(),null==(a=i.Pn)||a.unload(),null==(o=i.featureFlags)||o.destroy()):Ds.uninitializedWarning("posthog.shutdown")}))()}setIdentity(t,e){var i;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.Gn()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.Qn()}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 e=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=e.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&i){var n,s=null!==(n=t.timestampLookBack)&&void 0!==n?n:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-s,0)}return r}alias(t,e){return t===this.get_property(Su)?(Ds.critical("Attempting to create alias for existing People user - aborting."),-2):this.zn("posthog.alias")?(Qi(e)&&(e=this.get_distinct_id()),t!==e?(this.Wn(Tu,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(Ds.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=i({},this.config);if(Zi(t)){var r,n,s,a,o,l,u,h,d,v,c;js(this.config,dy(t));var f=this.Tn();null==(r=this.persistence)||r.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Og(i({},this.config,{persistence:"sessionStorage"}),f,!1);var p=this.Sn(this.config.debug);ir(p)&&(this.config.debug=p),ir(this.config.debug)&&(this.config.debug?(Fs.DEBUG=!0,td.P()&&td.A("ph_debug",!0),Ds.info("set_config",{config:t,oldConfig:e,newConfig:i({},this.config)})):(Fs.DEBUG=!1,td.P()&&td.F("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(h=this.exceptionObserver)||h.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(v=this.surveys)||v.loadIfEnabled(),this.Jn(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){Fs.LIB_NAME=t,Fs.LIB_VERSION=e}startSessionRecording(t){var e,i,r,n,s,a=!0===t,o={sampling:a||!(null==t||!t.sampling),linked_flag:a||!(null==t||!t.linked_flag),url_trigger:a||!(null==t||!t.url_trigger),event_trigger:a||!(null==t||!t.event_trigger)};Object.values(o).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),o.url_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("url")),o.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 r=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(i({},n,e))}}addExceptionStep(t,e){var i;null==(i=this.exceptions)||i.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:cy.Kn}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,i;return null!==(e=null==(i=this.toolbar)?void 0:i.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:oy;return e!==oy&&(e=oy+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(ch))===Ih||(null==(e=this.sessionPersistence)?void 0:e.get_property(ch))===Ih}Un(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Ph&&!this._isIdentified()&&Gi(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[Tu])&&(null==(e=this.persistence)||null==(e=e.props)||!e[bh]))}qn(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Un()||this.zn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.zn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}zn(t){return"never"===this.config.person_profiles?(Ds.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Wn(bh,!0),!0)}Tn(){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!==Mh)}Jn(){var t,e,i,r,n=this.Tn();return(null==(t=this.persistence)?void 0:t.ki)!==n&&(null==(i=this.persistence)||i.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.ki)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Th){if(this.mn()){var i,r,n,s,a;this.Zn(!0,!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new qm(this),this.pageViewManager=new Cg(this),this.persistence&&(this.sessionPropsManager=new Dm(this,this.sessionManager,this.persistence));var o,l=null!==(n=null==(s=this.config.__extensionClasses)?void 0:s.sessionRecording)&&void 0!==n?n:null==(a=cy.__defaultExtensionClasses)?void 0:a.sessionRecording;l&&(this.sessionRecording=this.gn(this.sessionRecording,new l(this)),this.dn&&(null==(o=this.sessionRecording)||null==o.onRemoteConfig||o.onRemoteConfig(this.dn)))}var u,h;this.consent.optInOut(!0),this.Jn(),this.Dn(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Mh&&(null==(u=this.surveys)||u.loadIfEnabled()),(Qi(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.$n()}else Ds.warn(iy)}opt_out_capturing(){var t,e,i;this.config.cookieless_mode!==Th?(this.config.cookieless_mode===Mh&&this.consent.isOptedIn()&&this.Zn(!0,!0),this.consent.optInOut(!1),this.Jn(),this.config.cookieless_mode===Mh&&(this.register({distinct_id:_h,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.$n(),this.Dn())):Ds.warn(iy)}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===Th||(this.config.cookieless_mode===Mh?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Jn()}_is_bot(){return Ss?jm(Ss,this.config.custom_blocked_useragents):void 0}$n(){Cs&&("visible"===Cs.visibilityState?this._n||(this._n=!0,this.capture(Oh,{title:Cs.title},{send_instantly:!0}),this.wn&&(Cs.removeEventListener(Rh,this.wn),this.wn=null)):this.wn||(this.wn=this.$n.bind(this),Zs(Cs,Rh,this.wn)))}debug(t){!1===t?(null==xs||xs.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==xs||xs.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}))}Ji(){var t=this.Cn||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Ds.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):function(t,e,i,r,n){var s=e in t&&!Xi(t[e]),a=i in t&&!Xi(t[i]);return s?t[e]:!!a&&(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,Ds)}Pt(t){var e;if(Xi(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(sr),r=Wi(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var s of r){if(n=s(n),Xi(n)){var a="Event '"+t.event+"' was rejected in beforeSend function";return nr(t.event)?Ds.warn(a+". This can cause unexpected behavior."):Ds.info(a),null}n.properties&&!Gi(n.properties)||Ds.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}for(var o of i)if(n.properties&&Xi(n.properties[o]))return Ds.warn("Event '"+t.event+"' had its '"+o+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var t;return null==(t=this.pageViewManager.ui)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(i)})}Sn(t){var e=ir(t)&&!t,i=td.P()&&"true"===td.q("ph_debug");return!e&&(!!i||t)}}cy.__defaultExtensionClasses={},cy.Kn=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Us(t.prototype[e[i]])}(cy,["identify"]);var fy=$s("[ExceptionAutocapture]"),py=$s("[TracingHeaders]"),gy=$s("[Web Vitals]"),my=9e5,yy="disabled",by="lazy_loading",_y="awaiting_config",wy="missing_config";$s("[SessionRecording]"),$s("[SessionRecording]");var xy="[SessionRecording]",ky=$s(xy),Sy=$s("[Heatmaps]");function Cy(t){return Zi(t)&&"clientX"in t&&"clientY"in t&&tr(t.clientX)&&tr(t.clientY)}var My=$s("[Product Tours]"),Ty=t=>{var e;return!t.config.disable_product_tours&&!(null==(e=t.persistence)||!e.get_property(Du))},Ey=["$set_once","$set"],Iy=$s("[SiteApps]"),Py="Error while initializing PostHog app with config id ";function Ry(t,e,i){if(Xi(t))return!1;switch(i){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}class Ly{constructor(t){this.Yn=new $m,this.Xn=(t,e)=>this.ts(t,e)&&this.es(t,e)&&this.rs(t,e)&&this.ns(t,e),this.ts=(t,e)=>null==e||!e.event||(null==t?void 0:t.event)===(null==e?void 0:e.event),this._instance=t,this.ss=new Set,this.os=new Set}init(){var t,e;Qi(null==(t=this._instance)?void 0:t._addCaptureHook)||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.on(t,e)})))}register(t){var e,i;if(!Qi(null==(e=this._instance)?void 0:e._addCaptureHook)&&(t.forEach((t=>{var e,i;null==(e=this.os)||e.add(t),null==(i=t.steps)||i.forEach((t=>{var e;null==(e=this.ss)||e.add((null==t?void 0:t.event)||"")}))})),null!=(i=this._instance)&&i.autocapture)){var r,n=new Set;t.forEach((t=>{var e;null==(e=t.steps)||e.forEach((t=>{null!=t&&t.selector&&n.add(null==t?void 0:t.selector)}))})),null==(r=this._instance)||r.autocapture.setElementSelectors(n)}}on(t,e){var i;null!=e&&0!=t.length&&(this.ss.has(t)||this.ss.has(e.event))&&this.os&&(null==(i=this.os)?void 0:i.size)>0&&this.os.forEach((t=>{this.ls(e,t)&&this.Yn.emit("actionCaptured",t.name)}))}us(t){this.onAction("actionCaptured",(e=>t(e)))}ls(t,e){if(null==(null==e?void 0:e.steps))return!1;for(var i of e.steps)if(this.Xn(t,i))return!0;return!1}onAction(t,e){return this.Yn.on(t,e)}es(t,e){if(null!=e&&e.url){var i,r=null==t||null==(i=t.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r)return!1;if(!Ry(r,e.url,e.url_matching||"contains"))return!1}return!0}rs(t,e){return!!this.hs(t,e)&&!!this.ds(t,e)&&!!this.vs(t,e)}hs(t,e){var i;if(null==e||!e.href)return!0;var r=this.cs(t);if(r.length>0)return r.some((t=>Ry(t.href,e.href,e.href_matching||"exact")));var n,s=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!s&&Ry((n=s.match(/(?::|")href="(.*?)"/))?n[1]:"",e.href,e.href_matching||"exact")}ds(t,e){var i;if(null==e||!e.text)return!0;var r=this.cs(t);if(r.length>0)return r.some((t=>Ry(t.text,e.text,e.text_matching||"exact")||Ry(t.$el_text,e.text,e.text_matching||"exact")));var n,s,a,o=(null==t||null==(i=t.properties)?void 0:i.$elements_chain)||"";return!!o&&(n=function(t){for(var e,i=[],r=/(?::|")text="(.*?)"/g;!Xi(e=r.exec(t));)i.includes(e[1])||i.push(e[1]);return i}(o),s=e.text,a=e.text_matching||"exact",n.some((t=>Ry(t,s,a))))}vs(t,e){var i,r;if(null==e||!e.selector)return!0;var n=null==t||null==(i=t.properties)?void 0:i.$element_selectors;if(null!=n&&n.includes(e.selector))return!0;var s=(null==t||null==(r=t.properties)?void 0:r.$elements_chain)||"";if(e.selector_regex&&s)try{return new RegExp(e.selector_regex).test(s)}catch(t){return!1}return!1}cs(t){var e;return null==(null==t||null==(e=t.properties)?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}ns(t,e){return null==e||!e.properties||0===e.properties.length||Gh(e.properties.reduce(((t,e)=>{var i=Wi(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:i,operator:e.operator||"exact"},t}),{}),null==t?void 0:t.properties)}}class Oy{constructor(t){var e;this.fs=[],this._instance=t,this.ps=new Map,this.gs=new Map,this.ys=new Map,null==(e=this._instance)||null==e.onSessionId||e.onSessionId((t=>this.bs(t)))}_s(t){return!1}ws(){return null}xs(t){}ks(){}Ss(t,e){return!!t&&Gh(t.propertyFilters,null==e?void 0:e.properties)}Cs(t,e){var i=new Map;return t.forEach((t=>{var r;null==(r=t.conditions)||null==(r=r[e])||null==(r=r.values)||r.forEach((e=>{if(null!=e&&e.name){var r=i.get(e.name)||[];r.push(t.id),i.set(e.name,r)}}))})),i}Ms(t,e,i){var r=(i===Vl?this.ps:this.gs).get(t),n=[];return this.Ts((t=>{n=t.filter((t=>null==r?void 0:r.includes(t.id)))})),n.filter((r=>{var n,s=null==(n=r.conditions)||null==(n=n[i])||null==(n=n.values)?void 0:n.find((e=>e.name===t));return this.Ss(s,e)}))}register(t){var e;Qi(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.Es(t),this.Is(t))}Is(t){var e=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.actions)&&(null==(i=t.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0}));0!==e.length&&(null==this.Ps&&(this.Ps=new Ly(this._instance),this.Ps.init(),this.Ps.us((t=>{this.onAction(t)}))),e.forEach((t=>{var e,i,r,n,s;t.conditions&&null!=(e=t.conditions)&&e.actions&&null!=(i=t.conditions)&&null!=(i=i.actions)&&i.values&&(null==(r=t.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(n=this.Ps)||n.register(t.conditions.actions.values),null==(s=t.conditions)||null==(s=s.actions)||null==(s=s.values)||s.forEach((e=>{if(e&&e.name){var i=this.ys.get(e.name);i&&i.push(t.id),this.ys.set(e.name,i||[t.id])}})))})))}Es(t){var e,i=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.events)&&(null==(i=t.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0})),r=t.filter((t=>{var e,i;return(null==(e=t.conditions)?void 0:e.cancelEvents)&&(null==(i=t.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0}));0===i.length&&0===r.length||(null==(e=this._instance)||e._addCaptureHook(((t,e)=>{this.onEvent(t,e)})),this.ps=this.Cs(t,Vl),this.gs=this.Cs(t,Zl))}onEvent(t,e){var i,r,n=this.Rs(),s=(null==e||null==(i=e.properties)?void 0:i.$survey_id)||(null==e||null==(r=e.properties)?void 0:r.$product_tour_id);if(s&&this.getActivatedIds().includes(s)){var a=this.Ls(t,s);if("consume"===a)return n.info("event consumed activated item, removing it",{event:t,itemId:s}),void this.Os([s]);if("persist"===a)return n.info("shown item promoted to persisted activation",{event:t,itemId:s}),this.Fs(s),void this.As([s])}if(this.gs.has(t)){var o=this.Ms(t,e,Zl);o.length>0&&(n.info("cancel event matched, cancelling items",{event:t,itemsToCancel:o.map((t=>t.id))}),this.Os(o.map((t=>t.id))),o.forEach((t=>this.Ds(t.id))))}if(this.ps.has(t)){n.info("event name matched",{event:t,eventPayload:e,items:this.ps.get(t)});var l=this.Ms(t,e,Vl);this.$s(l.map((t=>t.id)))}}onAction(t){this.ys.has(t)&&this.$s(this.ys.get(t)||[])}$s(t){var e;if(0!==t.length){var i=!(null==(e=this._instance)||null==e.get_session_id||!e.get_session_id()),r=[];for(var n of t)i&&this._s(n)?this.Fs(n)&&this.Ns(n):r.push(n);r.length>0&&(this.fs=[...new Set([...this.fs,...r])]),this.Rs().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Fs(t){this.fs=this.fs.filter((e=>e!==t));var e=this.qs();return!e.includes(t)&&(this.js([...e,t]),this.Bs(),!0)}Os(t){var e=new Set(t);this.fs=this.fs.filter((t=>!e.has(t)));var i=this.Hs(),r=i.filter((t=>!e.has(t)));r.length!==i.length&&(this.js(r),0===r.length&&this.Us()),this.As(t)}zs(){var t,e=this.ws();if(!e)return{};var i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e];return i&&"object"==typeof i?i:{}}Ns(t){if(this.ws()){var e=this.zs();this.xs(i({},e,{[t]:Date.now()}))}}As(t){if(this.ws()){var e=this.zs(),i={},r=!1;for(var n of Object.entries(e)){var s=n[0],a=n[1];t.includes(s)?r=!0:i[s]=a}r&&(Gi(i)?this.ks():this.xs(i))}}Ws(){this.ws()&&this.ks()}getActivationTimestamp(t){if(this.qs().includes(t)){var e=this.zs()[t];return tr(e)?e:void 0}}Hs(){var t,e=this.Vs();return(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e])||[]}qs(){var t,e,i=this.Hs();if(0===i.length)return[];var r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Zs()],n=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();return n&&r===n?i:[]}Bs(){var t,e=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();e&&this.Gs(e)}Us(){this.Qs()}bs(t){var e,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Zs()];if(i&&i!==t){var r=this.Hs(),n=this.zs();r.length>0&&(this.js([]),r.filter((t=>tr(n[t]))).forEach((t=>this.Ds(t)))),this.Us(),this.Ws()}}getActivatedIds(){return[...new Set([...this.qs(),...this.fs])].filter((t=>!this.Js(t)))}reset(){this.fs=[],this.Hs().length>0&&this.js([]),this.Us(),this.Ws()}getEventToItemsMap(){return this.ps}Ks(){return this.Ps}}class Fy extends Oy{constructor(t){super(t)}Vs(){return sh}Zs(){return ah}ws(){return oh}xs(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[oh]:t})}ks(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(oh)}_s(t){var e,i;this.Ts((e=>{i=e.find((e=>e.id===t))}));var r=null==(e=i)||null==(e=e.appearance)?void 0:e.surveyPopupDelaySeconds;return tr(r)&&r>0}Ys(){return eu.SHOWN}Ts(t){var e;null==(e=this._instance)||e.getSurveys(t)}Ds(t){var e;null==(e=this._instance)||e.cancelPendingSurvey(t)}Rs(){return fu}js(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[sh]:t})}Gs(t){var e;null==(e=this._instance)||null==(e=e.persistence)||e.register({[ah]:t})}Qs(){var t;null==(t=this._instance)||null==(t=t.persistence)||t.unregister(ah)}Js(){return!1}Ls(t,e){var i;return this.Ts((t=>{i=t.find((t=>t.id===e))})),!i||cu(i)?t===eu.SHOWN?"consume":"ignore":t===eu.SHOWN?"persist":t===eu.DISMISSED||t===eu.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Ay="SDK is not enabled or survey functionality is not yet loaded",Dy="Disabled. Not loading surveys.",$y=null!=xs&&xs.location?ta(xs.location.hash,"__posthog")||ta(location.hash,"state"):null,Ny="_postHogToolbarParams",qy=$s("[Toolbar]"),jy=$s("[FeatureFlags]"),By=$s("[FeatureFlags]",{debugEnabled:!0}),Hy="\" failed. Feature flags didn't load in time.",Uy=t=>{for(var e={},i=0;t.length>i;i++)e[t[i]]=!0;return e},zy=t=>{var e={};for(var i of Bs(t||{})){var r=i[1];r&&(e[i[0]]=r)}return e},Wy="Refusing to render web experiment since the viewer is a likely bot",Vy={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>-1===e.toLowerCase().indexOf(t.toLowerCase()),regex:(t,e)=>zh(e,t),not_regex:(t,e)=>!zh(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Zy{get Pe(){return this._instance.config}constructor(t){var e=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),e.getWebExperiments((t=>{Zy.Xs("retrieved web experiments from the server"),e.ta=new Map,t.forEach((t=>{if(t.feature_flag_key){var i;e.ta&&(Zy.Xs("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=e.ta)||i.set(t.feature_flag_key,t));var r=e._instance.getFeatureFlag(t.feature_flag_key);Ji(r)&&t.variants[r]&&e.ea(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var s=t.variants[n];Zy.ia(s,e._instance)&&e.ea(t.name,n,s.transforms)}}))}),t)},this._instance=t,this._instance.onFeatureFlags((t=>{this.onFeatureFlags(t)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())Zy.Xs(Wy);else if(!this.Pe.disable_web_experiments){if(Xi(this.ta))return this.ta=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Zy.Xs("applying feature flags",t),t.forEach((t=>{var e;if(this.ta&&null!=(e=this.ta)&&e.has(t)){var i,r=this._instance.getFeatureFlag(t),n=null==(i=this.ta)?void 0:i.get(t);r&&null!=n&&n.variants[r]&&this.ea(n.name,r,n.variants[r].transforms)}}))}}previewWebExperiment(){var t=Zy.getWindowLocation();if(null!=t&&t.search){var e=Ys(null==t?void 0:t.search,"__experiment_id"),i=Ys(null==t?void 0:t.search,"__experiment_variant");e&&i&&(Zy.Xs("previewing web experiments "+e+" && "+i),this.getWebExperiments((t=>{this.ra(parseInt(e),i,t)}),!1,!0))}}loadIfEnabled(){this.Pe.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,e,i){if(this.Pe.disable_web_experiments&&!i)return t([]);var r=this._instance.get_property("$web_experiments");if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Pe.token),method:"GET",timestampMode:"query",callback:e=>t(200===e.statusCode&&e.json&&e.json.experiments||[])})}ra(t,e,i){var r=i.filter((e=>e.id===t));r&&r.length>0&&(Zy.Xs("Previewing web experiment ["+r[0].name+"] with variant ["+e+"]"),this.ea(r[0].name,e,r[0].variants[e].transforms))}static ia(t,e){return!Xi(t.conditions)&&Zy.na(t,e)&&Zy.sa(t)}static na(t,e){var i;if(Xi(t.conditions)||Xi(null==(i=t.conditions)?void 0:i.url))return!0;var r=Zy.getWindowLocation();if(r){var n,s,a,o=aa(e,r.href);return null==(n=t.conditions)||!n.url||Vy[null!==(s=null==(a=t.conditions)?void 0:a.urlMatchType)&&void 0!==s?s:"icontains"](t.conditions.url,o)}return!1}static getWindowLocation(){return null==xs?void 0:xs.location}static sa(t){var e;if(Xi(t.conditions)||Xi(null==(e=t.conditions)?void 0:e.utm))return!0;var i=pv();if(i.utm_source){var r,n,s,a,o,l,u,h,d=null==(r=t.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(n=t.conditions)||null==(n=n.utm)?void 0:n.utm_campaign)==i.utm_campaign,v=null==(s=t.conditions)||null==(s=s.utm)||!s.utm_source||(null==(a=t.conditions)||null==(a=a.utm)?void 0:a.utm_source)==i.utm_source,c=null==(o=t.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=t.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,f=null==(u=t.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=t.conditions)||null==(h=h.utm)?void 0:h.utm_term)==i.utm_term;return d&&c&&f&&v}return!1}static Xs(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];Ds.info("[WebExperiments] "+t,i)}ea(t,e,i){this._is_bot()?Zy.Xs(Wy):"control"!==e?i.forEach((i=>{if(i.selector){var r;Zy.Xs("applying transform of variant "+e+" for experiment "+t+" ",i);var n=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==n||n.forEach((t=>{var e=t;i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)}))}})):Zy.Xs("Control variants leave the page unmodified.")}_is_bot(){return Ss&&this._instance?jm(Ss,this.Pe.custom_blocked_useragents):void 0}}var Gy=$s("[Conversations]"),Qy="Conversations not available yet.",Jy="console",Ky="__posthogHandledLogsRequestError",Yy=(t,e)=>{var i=t instanceof Error?t:new Error(e);return i[Ky]=!0,i},Xy=t=>!!t&&"object"==typeof t&&!0===t[Ky],tb={featureFlags:class{constructor(t){this.aa=!1,this.oa=!1,this.la=!1,this.ua=!1,this.ha=!1,this.da=!1,this.va=!1,this.ca=!1,this.fa=0,this.pa=()=>{var t=this.ga();this.fa=0,t&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],xs&&Zs(xs,"online",this.pa)}destroy(){null==xs||xs.removeEventListener("online",this.pa)}get Pe(){return this._instance.config}get Tr(){return this._instance.persistence}ma(t){return this._instance.get_property(t)}ya(){var t,e;return null!==(t=null==(e=this.Tr)?void 0:e.Ci(this.Pe.feature_flag_cache_ttl_ms))&&void 0!==t&&t}ba(){return!!this.ya()&&(this.ca||this.la||(this.ca=!0,jy.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}_a(){var t,e=null!==(t=this.Pe.evaluation_contexts)&&void 0!==t?t:this.Pe.evaluation_environments;return!this.Pe.evaluation_environments||this.Pe.evaluation_contexts||this.va||(jy.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.va=!0),null!=e&&e.length?e.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||jy.error("Invalid evaluation context found:",t,"Expected non-empty string"),e})):[]}wa(){return this._a().length>0}xa(){var t=this.Pe.flag_keys;if(!Qi(t)){if(Wi(t))return t.filter((t=>{var e=t&&"string"==typeof t&&t.trim().length>0;return e||jy.error("Invalid flag key found:",t,"Expected non-empty string"),e}));jy.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,i=this._instance.config,r=null!==(t=null==(e=i.bootstrap)?void 0:e.featureFlags)&&void 0!==t?t:{};if(Object.keys(r).length){var n,s,a=null!==(n=null==(s=i.bootstrap)?void 0:s.featureFlagPayloads)&&void 0!==n?n:{},o=Object.keys(r).filter((t=>!!r[t])).reduce(((t,e)=>(t[e]=r[e]||!1,t)),{}),l=Object.keys(a).filter((t=>o[t])).reduce(((t,e)=>(a[e]&&(t[e]=a[e]),t)),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:l})}}updateFlags(t,e,r){var n,s,a=null!=r&&r.merge&&null!==(n=this.ma(Vu))&&void 0!==n?n:{},o=null!=r&&r.merge&&null!==(s=this.ma(Ju))&&void 0!==s?s:{},l=i({},a,t),u=i({},o,e),h={};for(var d of Object.entries(l)){var v=d[0],c=d[1];h[v]={key:v,enabled:bi(c),variant:_i(c),reason:void 0,metadata:Qi(null==u?void 0:u[v])?void 0:{id:0,version:void 0,description:void 0,payload:u[v]}}}this.receivedFeatureFlags({flags:h})}get hasLoadedFlags(){return this.oa}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.ma(Qu),e=this.ma(Xu),r=this.ma(th);if(!r&&!e)return t||{};var n=js({},t||{}),s=[...new Set([...Object.keys(r||{}),...Object.keys(e||{})])];for(var a of s){var o,l,u=n[a],h=null==e?void 0:e[a],d=Qi(h)?null!==(o=null==u?void 0:u.enabled)&&void 0!==o&&o:!!h,v=Qi(h)?u.variant:"string"==typeof h?h:void 0,c=null==r?void 0:r[a],f=i({},u,{enabled:d,variant:d?null!=v?v:null==u?void 0:u.variant:void 0});d!==(null==u?void 0:u.enabled)&&(f.original_enabled=null==u?void 0:u.enabled),v!==(null==u?void 0:u.variant)&&(f.original_variant=null==u?void 0:u.variant),c&&(f.metadata=i({},null==u?void 0:u.metadata,{payload:c,original_payload:null==u||null==(l=u.metadata)?void 0:l.payload})),n[a]=f}return this.aa||(jy.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:n}),this.aa=!0),n}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((i=>{var r=t[i];return{key:i,enabled:bi(r),variant:_i(r),payload:yi(e[i])}}))}getFlagVariants(){var t=this.ma(Vu),e=this.ma(Xu);if(!e)return t||{};for(var i=js({},t),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.aa||(jy.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:i}),this.aa=!0),i}getFlagPayloads(){var t=this.ma(Ju),e=this.ma(th);if(!e)return t||{};for(var i=js({},t||{}),r=Object.keys(e),n=0;r.length>n;n++)i[r[n]]=e[r[n]];return this.aa||(jy.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:i}),this.aa=!0),i}reloadFeatureFlags(){this.ua||this.Pe.advanced_disable_feature_flags||this.ga()||this.ka||(this._instance.vn.emit("featureFlagsReloading",!0),this.ka=setTimeout((()=>{this.Sa()}),5))}Ca(){clearTimeout(this.ka),this.ka=void 0}ensureFlagsLoaded(){this.oa||this.la||this.ka||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.ua=t}Sa(t){var e;if(this.Ca(),!this._instance.Ji()&&!this.ga())if(this.la)this.ha=!0;else{var r=this.Pe.token,n=this.ma(Cu),s={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i({},(null==(e=this.Tr)?void 0:e.get_initial_props())||{},this.ma(eh)||{},{$lib:Fs.LIB_NAME,$lib_version:Fs.LIB_VERSION}),group_properties:this.ma(ih),timezone:kv()};Yi(n)||Qi(n)||(s.$device_id=n),(null!=t&&t.disableFlags||this.Pe.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.wa()&&(s.evaluation_contexts=this._a());var a=this.xa();Qi(a)||(s.flag_keys=a);var o=!!this.Pe.advanced_only_evaluate_survey_feature_flags,l=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Pe.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.la=!0,this._instance._send_request({method:"POST",url:l,data:s,compression:this.Pe.disable_compression?void 0:Wl,timestampMode:"body",timeout:this.Pe.feature_flag_request_timeout_ms,callback:t=>{var e,i,r,n=!0;if(this.Ma(t.statusCode),200===t.statusCode&&(this.ha||(this.$anon_distinct_id=void 0),n=!1),this.la=!1,!s.disable_flags||this.ha){this.da=!n;var a=[];t.error?t.error instanceof Error?a.push("AbortError"===t.error.name?"timeout":"connection_error"):a.push("unknown_error"):200!==t.statusCode&&a.push("api_error_"+t.statusCode),null!=(e=t.json)&&e.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");var l,u=!(null==(i=t.json)||null==(i=i.quotaLimited)||!i.includes("feature_flags"));if(u&&a.push("quota_limited"),null==(r=this.Tr)||r.register({[dh]:a}),u)jy.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!==(l=t.json)&&void 0!==l?l:{},n,{partialResponse:o}),this.ha&&(this.ha=!1,this.Sa())}}})}}ga(){return ea(this.fa,3)}Ma(t){this.fa=ia(t,this.fa,3,(()=>jy.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes.")))}getFeatureFlag(t,e){var i;if(void 0===e&&(e={}),!e.fresh||this.da)if(this.oa||this.getFlags()&&this.getFlags().length>0){if(!this.ba()){var r=this.getFeatureFlagResult(t,e);return null!==(i=null==r?void 0:r.variant)&&void 0!==i?i:null==r?void 0:r.enabled}}else jy.warn('getFeatureFlag for key "'+t+Hy)}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.da)if(this.oa||this.getFlags()&&this.getFlags().length>0){if(!this.ba()){var i=this.getFlagVariants(),r=t in i,n=i[t],s=this.getFlagPayloads()[t],a=String(n),o=this.ma(Ku)||void 0,l=this.ma(vh)||void 0,u=this.ma(uh)||{};if(this.Pe.advanced_feature_flags_dedup_per_session){var h,d=this._instance.get_session_id(),v=this.ma(hh);d&&d!==v&&(u={},null==(h=this.Tr)||h.register({[uh]:u,[hh]:d}))}if((e.send_event||!("send_event"in e))&&(!(t in u)||!u[t].includes(a))){var c,f,p,g,m,y,b,_,w,x,k;Wi(u[t])?u[t].push(a):u[t]=[a],null==(c=this.Tr)||c.register({[uh]:u});var S=this.getFeatureFlagDetails(t),C=[...null!==(f=this.ma(dh))&&void 0!==f?f:[]];Qi(n)&&C.push("flag_missing");var M={$feature_flag:t,$feature_flag_response:n,$feature_flag_payload:s||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this.Pe.bootstrap)||null==(p=p.featureFlags)?void 0:p[t])||null,$feature_flag_bootstrapped_payload:(null==(g=this.Pe.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[t])||null,$used_bootstrap_value:!this.da};Qi(null==S||null==(m=S.metadata)?void 0:m.has_experiment)||(M.$feature_flag_has_experiment=S.metadata.has_experiment),Qi(null==S||null==(y=S.metadata)?void 0:y.version)||(M.$feature_flag_version=S.metadata.version);var T,E=null!==(b=null==S||null==(_=S.reason)?void 0:_.description)&&void 0!==b?b:null==S||null==(w=S.reason)?void 0:w.code;E&&(M.$feature_flag_reason=E),null!=S&&null!=(x=S.metadata)&&x.id&&(M.$feature_flag_id=S.metadata.id),Qi(null==S?void 0:S.original_variant)&&Qi(null==S?void 0:S.original_enabled)||(M.$feature_flag_original_response=Qi(S.original_variant)?S.original_enabled:S.original_variant),null!=S&&null!=(k=S.metadata)&&k.original_payload&&(M.$feature_flag_original_payload=null==S||null==(T=S.metadata)?void 0:T.original_payload),C.length&&(M.$feature_flag_error=C.join(",")),this._instance.capture("$feature_flag_called",M)}if(r)return{key:t,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:yi(s)}}}else jy.warn('getFeatureFlagResult for key "'+t+Hy)}getRemoteConfigPayload(t,e){var i=this.Pe.token,r={distinct_id:this._instance.get_distinct_id(),token:i,person_properties:{$lib:Fs.LIB_NAME,$lib_version:Fs.LIB_VERSION}};this.wa()&&(r.evaluation_contexts=this._a());var n=this.xa();Qi(n)||(r.flag_keys=n),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Pe.disable_compression?void 0:Wl,timestampMode:"body",timeout:this.Pe.feature_flag_request_timeout_ms,callback(i){var r,n=null==(r=i.json)?void 0:r.featureFlagPayloads;e((null==n?void 0:n[t])||void 0)}})}isFeatureEnabled(t,e){if(void 0===e&&(e={}),e.fresh&&!this.da)return e.defaultValue;if(!(this.oa||this.getFlags()&&this.getFlags().length>0))return jy.warn('isFeatureEnabled for key "'+t+Hy),e.defaultValue;var i=this.getFeatureFlag(t,e);return Qi(i)?e.defaultValue:!!i}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,r){if(this.Tr){this.oa=!0;var n=this.getFlagVariants(),s=this.getFlagPayloads(),a=this.getFlagsWithDetails();!function(t,e,r,n,s,a){void 0===r&&(r={}),void 0===n&&(n={}),void 0===s&&(s={});var o=(t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((t=>{var i;return[t,null!==(i=e[t].variant)&&void 0!==i?i:e[t].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((t=>e[t].enabled)).filter((t=>{var i;return null==(i=e[t].metadata)?void 0:i.payload})).map((t=>{var i;return[t,null==(i=e[t].metadata)?void 0:i.payload]})))):t.featureFlags&&jy.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t})(t),l=o.flags,u=o.featureFlags,h=o.featureFlagPayloads;if(u){var d=t.requestId,v=t.evaluatedAt;if(Wi(u)){jy.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var c={};if(u)for(var f=0;u.length>f;f++)c[u[f]]=!0;e&&e.register({[Zu]:u,[Vu]:c,[Yu]:!1})}else{var p=u,g=h,m=l;if(null!=a&&a.partialResponse)p=i({},r,p),g=i({},n,g),m=i({},s,m);else if(t.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter((t=>{var e;return!(null!=(e=l[t])&&e.failed)})));p=i({},r,Object.fromEntries(Object.entries(p).filter((t=>y.has(t[0]))))),g=i({},n,Object.fromEntries(Object.entries(g||{}).filter((t=>y.has(t[0]))))),m=i({},s,Object.fromEntries(Object.entries(m||{}).filter((t=>y.has(t[0])))))}else p=i({},r,p),g=i({},n,g),m=i({},s,m);e&&e.register(i({[Zu]:Object.keys(zy(p)),[Vu]:p||{},[Ju]:g||{},[Qu]:m||{},[Yu]:!0===t.minimalFlagCalledEvents},d?{[Ku]:d}:{},v?{[vh]:v}:{}))}}}(t,this.Tr,n,s,a,r),e||(this.ca=!1),this.Ta(e)}}override(t,e){void 0===e&&(e=!1),jy.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.Tr)return jy.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===t)return this.Tr.unregister(Xu),this.Tr.unregister(th),this.Ta(),By.info("All overrides cleared");if(Wi(t)){var e=Uy(t);return this.Tr.register({[Xu]:e}),this.Ta(),By.info("Flag overrides set",{flags:t})}if(t&&"object"==typeof t&&("flags"in t||"payloads"in t)){var i,r=t;if(this.aa=Boolean(null!==(i=r.suppressWarning)&&void 0!==i&&i),"flags"in r)if(!1===r.flags)this.Tr.unregister(Xu),By.info("Flag overrides cleared");else if(r.flags){if(Wi(r.flags)){var n=Uy(r.flags);this.Tr.register({[Xu]:n})}else this.Tr.register({[Xu]:r.flags});By.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this.Tr.unregister(th),By.info("Payload overrides cleared")):r.payloads&&(this.Tr.register({[th]:r.payloads}),By.info("Payload overrides set",{payloads:r.payloads}))),void this.Ta()}if(t&&"object"==typeof t)return this.Tr.register({[Xu]:t}),this.Ta(),By.info("Flag overrides set",{flags:t});jy.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.oa){var e=this.Ea(),i=e.flags,r=e.flagVariants;try{t(i,r)}catch(t){jy.error("Error while running feature flags callback",t)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,r){var n,s=(this.ma(Gu)||[]).find((e=>e.flagKey===t)),a={["$feature_enrollment/"+t]:e},o={$feature_flag:t,$feature_enrollment:e,$set:a};s&&(o.$early_access_feature_name=s.name),r&&(o.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(a,!1);var l=i({},this.getFlagVariants(),{[t]:e});null==(n=this.Tr)||n.register({[Zu]:Object.keys(zy(l)),[Vu]:l}),this.Ta()}getEarlyAccessFeatures(t,e,i){void 0===e&&(e=!1);var r=this.ma(Gu),n=i?"&"+i.map((t=>"stage="+t)).join("&"):"";if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Pe.token+n),method:"GET",timestampMode:"query",callback:e=>{var i,r;if(e.json){var n=e.json.earlyAccessFeatures;return null==(i=this.Tr)||i.unregister(Gu),null==(r=this.Tr)||r.register({[Gu]:n}),t(n)}}})}Ea(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,i)=>(t[i]=e[i],t)),{})}}Ta(t){var e=this.Ea(),i=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((e=>{try{e(i,r,{errorsLoading:t})}catch(t){jy.error("Error while running feature flags callback",t)}}))}setPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var r=this.ma(eh)||{},n=(null==t?void 0:t.$set)||(null!=t&&t.$set_once?{}:t),s=null==t?void 0:t.$set_once,a={};if(s)for(var o in s)({}).hasOwnProperty.call(s,o)&&(o in r||(a[o]=s[o]));this._instance.register({[eh]:i({},r,a,n)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){void 0===e&&(e=!0);var r=i({},this.ma(eh)||{});t.forEach((t=>{delete r[t]})),this._instance.register({[eh]:r}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){void 0===t&&(t=!0),this._instance.unregister(eh),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){void 0===e&&(e=!0);var r=this.ma(ih)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((e=>{r[e]=i({},r[e],t[e]),delete t[e]})),this._instance.register({[ih]:i({},r,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.ma(ih)||{};this._instance.register({[ih]:i({},e,{[t]:{}})})}else this._instance.unregister(ih)}reset(){this.oa=!1,this.la=!1,this.ua=!1,this.ha=!1,this.da=!1,this.$anon_distinct_id=void 0,this.Ca(),this.aa=!1,this.fa=0}}},eb={sessionRecording:class{get Pe(){return this._instance.config}get Tr(){return this._instance.persistence}get started(){var t;return!(null==(t=this.Ia)||!t.isStarted)}get status(){var t,e;return this.Pa===_y||this.Pa===wy?this.Pa:null!==(t=null==(e=this.Ia)?void 0:e.status)&&void 0!==t?t:this.Pa}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Pa=yy,this.Ra=void 0,this._instance=t,!this._instance.sessionManager)throw ky.error("started without valid sessionManager"),new Error(xy+" started without valid sessionManager. This is a bug.");if(this.Pe.cookieless_mode===Th)throw new Error(xy+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get La(){var t,e=!(null==(t=this._instance.get_property(Nu))||!t.enabled),i=!this.Pe.disable_session_recording,r=this.Pe.disable_session_recording||this._instance.consent.isOptedOut();return xs&&e&&i&&!r}startIfEnabledOrStop(t){var e;if(!this.La||null==(e=this.Ia)||!e.isStarted){var i=!Qi(Object.assign)&&!Qi(Array.from);this.La&&i?(this.Oa(t),ky.info("starting")):(this.Pa=yy,this.stopRecording())}}Oa(t){var e,i,r;this.La&&(this.Pa!==_y&&this.Pa!==wy&&(this.Pa=by),null!=Mo&&null!=(e=Mo.__PosthogExtensions__)&&null!=(e=e.rrweb)&&e.record&&null!=(i=Mo.__PosthogExtensions__)&&i.initSessionRecording?this.Fa(t):null==(r=Mo.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Aa,(e=>{if(e)return ky.error("could not load recorder",e);this.Fa(t)})))}stopRecording(){var t,e;null==(t=this.Ra)||t.call(this),this.Ra=void 0,null==(e=this.Ia)||e.stop()}Da(){var t,e;null==(t=this.Ra)||t.call(this),this.Ra=void 0,null==(e=this.Ia)||e.discard()}$a(){var t,e;null==(t=this.Tr)||t.unregister(Wu),null==(e=this.Tr)||e.unregister(qu)}Na(t,e){if(Xi(t))return null;var i,r=tr(t)?t:parseFloat(t);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(ky.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}qa(t){if(this.Tr){var e,r,n=this.Tr,s=()=>{var e,r=!1===t.sessionRecording?void 0:t.sessionRecording,s=this.Na(null==(e=this.Pe.session_recording)?void 0:e.sampleRate,"session_recording.sampleRate"),a=this.Na(null==r?void 0:r.sampleRate,"remote config sampleRate"),o=null!=s?s:a;Xi(o)&&this.$a();var l=null==r?void 0:r.minimumDurationMilliseconds;n.register({[Nu]:i({cache_timestamp:Date.now(),enabled:!!r},r,{networkPayloadCapture:i({capturePerformance:t.capturePerformance},null==r?void 0:r.networkPayloadCapture),canvasRecording:{enabled:null==r?void 0:r.recordCanvas,fps:null==r?void 0:r.canvasFps,quality:null==r?void 0:r.canvasQuality},sampleRate:o,minimumDurationMilliseconds:Qi(l)?null:l,endpoint:null==r?void 0:r.endpoint,triggerMatchType:null==r?void 0:r.triggerMatchType,masking:null==r?void 0:r.masking,urlTriggers:null==r?void 0:r.urlTriggers,version:null==r?void 0:r.version,triggerGroups:null==r?void 0:r.triggerGroups})})};s(),null==(e=this.Ra)||e.call(this),this.Ra=null==(r=this._instance.sessionManager)?void 0:r.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?!1===e.sessionRecording?(this.qa(e),void this.Da()):(this.qa(e),void this.startIfEnabledOrStop()):(this.Pa===_y&&(this.Pa=wy,ky.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var i;void 0===e&&(e="log"),null!=(i=this.Ia)&&i.log?this.Ia.log(t,e):ky.warn("log called before recorder was ready")}get Aa(){var t,e,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.get_property(Nu);return(null==i||null==(e=i.scriptConfig)?void 0:e.script)||"lazy-recorder"}ja(){var t,e,i=this._instance.get_property(Nu);if(!i)return!1;try{e="object"==typeof i?i:JSON.parse(i)}catch(t){return ky.warn("persisted remote config for session recording is invalid and will be ignored",t),!1}var r=null!==(t=e.cache_timestamp)&&void 0!==t?t:Date.now();return 36e5>=Date.now()-r}Fa(t){var e,i;if(null==(e=Mo.__PosthogExtensions__)||!e.initSessionRecording)return ky.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Sh]:!0});if(this.Ia||(this.Ia=null==(i=Mo.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.Ia._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ja()){if(this.Pa===wy||this.Pa===_y)return;return this.Pa=_y,ky.info("persisted remote config is stale, requesting fresh config before starting"),void new $g(this._instance).load()}this.Pa=by,this.Ia.start(t)}onRRwebEmit(t){var e;null==(e=this.Ia)||null==e.onRRwebEmit||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Ia||null==(e=this.Tr)||e.register({[Bu]:!0}),null==(t=this.Ia)||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Ia||null==(e=this.Tr)||e.register({[ju]:!0}),null==(t=this.Ia)||t.overrideSampling()}overrideTrigger(t){var e,i;this.Ia||null==(i=this.Tr)||i.register({["url"===t?Hu:Uu]:!0}),null==(e=this.Ia)||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return(null==(t=this.Ia)?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var i;return!(null==(i=this.Ia)||!i.tryAddCustomEvent(t,e))}}},ib={autocapture:class{constructor(t){this.Ba=!1,this.Ha=null,this.Ua=!1,this.za=!1,this.instance=t,this.rageclicks=new tg(t.config.rageclick),this.Wa=null}initialize(){this.startIfEnabled()}get Pe(){var t,e,i=Zi(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(t=i.url_allowlist)?void 0:t.map((t=>new RegExp(t))),i.url_ignorelist=null==(e=i.url_ignorelist)?void 0:e.map((t=>new RegExp(t))),i}Va(){if(this.isBrowserSupported()){if(xs&&Cs){var t=t=>{t=t||(null==xs?void 0:xs.event);try{this.Za(t)}catch(t){ig.error("Failed to capture event",t)}};if(Zs(Cs,"submit",t,{capture:!0}),Zs(Cs,"change",t,{capture:!0}),Zs(Cs,"click",t,{capture:!0}),this.Pe.capture_copied_text){var e=t=>{t=t||(null==xs?void 0:xs.event);try{this.Za(t,eg)}catch(t){ig.error("Failed to capture copy/cut event",t)}};Zs(Cs,"copy",e,{capture:!0}),Zs(Cs,"cut",e,{capture:!0})}}}else ig.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ba&&(this.Va(),this.Ba=!0)}onRemoteConfig(t){if(this.Ua=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.za=e.elementsChainAsString);var i=e.autocapture_opt_out;ir(i)&&(this.instance.persistence&&this.instance.persistence.register({[Iu]:i}),this.Ha=i),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.Wa=t}getElementSelectors(t){var e,i=[];return null==(e=this.Wa)||e.forEach((e=>{var r=null==Cs?void 0:Cs.querySelectorAll(e);null==r||r.forEach((r=>{t===r&&i.push(e)}))})),i}get isEnabled(){var t,e,i=null==(t=this.instance.persistence)?void 0:t.props[Iu],r=this.Ha,n=this.instance.Ji()&&!this.Ua;if(Yi(r)&&!ir(i)&&!n)return!1;var s=null!==(e=this.Ha)&&void 0!==e?e:!!i;return!!this.instance.config.autocapture&&!s}Za(t,e){if(void 0===e&&(e="$autocapture"),this.isEnabled){var i,r=ka(t);pa(r)&&(r=r.parentNode||null),"$autocapture"===e&&"click"===t.type&&t instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(t.clientX,t.clientY,t.timeStamp||(new Date).getTime())&&Fa(r,this.instance.config.rageclick)&&this.Za(t,"$rageclick");var n=e===eg;if(r&&function(t,e,i,r,n,s){var a;if(!xs||Aa(t))return!1;if(null!=i&&i.url_allowlist&&!ba(i.url_allowlist,s))return!1;if(null!=i&&i.url_ignorelist&&ba(i.url_ignorelist,s))return!1;if(null!=i&&i.dom_event_allowlist){var o=i.dom_event_allowlist;if(o&&!o.some((t=>e.type===t)))return!1}var l=Da(t,r),u=l.parentIsUsefulElement,h=l.targetElementList;if(!function(t,e){var i=null==e?void 0:e.element_allowlist;if(Qi(i))return!0;var r,n=function(t){if(i.some((e=>t.tagName.toLowerCase()===e)))return{v:!0}};for(var s of t)if(r=n(s))return r.v;return!1}(h,i))return!1;if(!Ca(h,null==i?void 0:i.css_selector_allowlist))return!1;if(Ca(h,null!==(a=null==i?void 0:i.css_selector_ignorelist)&&void 0!==a?a:Ta))return!1;try{var d=xs.getComputedStyle(t);if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===e.type)return!0}catch(t){}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 u?(n||["click"]).indexOf(e.type)>=0:(n||["click"]).indexOf(e.type)>=0&&(Sa.indexOf(v)>-1||"true"===t.getAttribute("contenteditable"))}}(r,t,this.Pe,n,n?["copy","cut"]:void 0,this.instance)){var s=sg(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Pe.element_attribute_ignorelist,elementsChainAsString:this.za,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),a=s.props;if(s.explicitNoCapture)return!1;var o=this.getElementSelectors(r);if(o&&o.length>0&&(a.$element_selectors=o),e===eg){var l,u=wa(null==xs||null==(l=xs.getSelection())?void 0:l.toString()),h=t.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=h}return this.instance.capture(e,a),!0}}}isBrowserSupported(){return Vi(null==Cs?void 0:Cs.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Ga=(null==xs||null==(e=xs.location)?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(Ds.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Qa&&this.Qa(),this.Qa=void 0,Ds.info("History API monitoring stopped")}monitorHistoryChanges(){xs&&xs.history&&(this.Ja("pushState"),this.Ja("replaceState"),this.Ka())}Ja(t){var e;if(xs&&(null==(e=xs.history[t])||!e.__posthog_wrapped__)){var i=this;na(xs.history,t,(e=>function(r,n,s){e.call(this,r,n,s),i.Ya(t)}))}}Ya(t){try{var e,i=null==xs||null==(e=xs.location)?void 0:e.pathname;if(!i)return;i!==this.Ga&&this.isEnabled&&this._instance.capture(Oh,{navigation_type:t}),this.Ga=i}catch(e){Ds.error("Error capturing "+t+" pageview",e)}}Ka(){if(!this.Qa){var t=()=>{this.Ya("popstate")};Zs(xs,"popstate",t),this.Qa=()=>{xs&&xs.removeEventListener("popstate",t)}}}},heatmaps:class{get Pe(){return this.instance.config}constructor(t){var e;this.Xa=!1,this.Ba=!1,this.eo=null,this.instance=t,this.Xa=!(null==(e=this.instance.persistence)||!e.props[Pu]),this.rageclicks=new tg(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Zi(this.Pe.capture_heatmaps)&&this.Pe.capture_heatmaps.flush_interval_milliseconds&&(t=this.Pe.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Xi(this.Pe.capture_heatmaps)?Xi(this.Pe.enable_heatmaps)?this.Xa:this.Pe.enable_heatmaps:!1!==this.Pe.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Ba)return;Sy.info("starting..."),this.io(),this.Ie()}else{var t;clearInterval(null!==(t=this.eo)&&void 0!==t?t:void 0),this.ro(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var i=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Pu]:i}),this.Xa=i,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.O;return this.O=void 0,t}no(t){Cy(t.originalEvent)&&this.ke(t.originalEvent,"deadclick")}Ie(){this.eo&&clearInterval(this.eo),this.eo=function(t){return"visible"===(null==t?void 0:t.visibilityState)}(Cs)?setInterval(this.pr.bind(this),this.flushIntervalMilliseconds):null}io(){xs&&Cs&&(this.so=this.pr.bind(this),Zs(xs,Lh,this.so),this.ao=t=>this.ke(t||(null==xs?void 0:xs.event)),Zs(Cs,"click",this.ao,{capture:!0}),this.oo=t=>this.lo(t||(null==xs?void 0:xs.event)),Zs(Cs,"mousemove",this.oo,{capture:!0}),this.uo=new _g(this.instance,yg,this.no.bind(this)),this.uo.startIfEnabledOrStop(),this.ho=this.Ie.bind(this),Zs(Cs,Rh,this.ho),this.Ba=!0)}ro(){var t;xs&&Cs&&(this.so&&xs.removeEventListener(Lh,this.so),this.ao&&Cs.removeEventListener("click",this.ao,{capture:!0}),this.oo&&Cs.removeEventListener("mousemove",this.oo,{capture:!0}),this.ho&&Cs.removeEventListener(Rh,this.ho),clearTimeout(this.do),null==(t=this.uo)||t.stop(),this.Ba=!1)}vo(t,e){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),s=function(t,e,i){for(var r=t;r&&ca(r)&&!fa(r,"body");){if(r===i)return!1;var n=void 0;try{var s,a,o;n=null==(s=null!==(a=null==(o=r.ownerDocument)?void 0:o.defaultView)&&void 0!==a?a:xs)?void 0:s.getComputedStyle(r).position}catch(t){return!1}if(Ni(e,n))return!0;r=Ma(r)}return!1}(ka(t),["fixed","sticky"],n);return{x:t.clientX+(s?0:r),y:t.clientY+(s?0:i),target_fixed:s,type:e}}ke(t,e){var r;if(void 0===e&&(e="click"),!va(t.target)&&Cy(t)){var n=this.vo(t,e);null!=(r=this.rageclicks)&&r.isRageClick(t.clientX,t.clientY,(new Date).getTime())&&Fa(ka(t),this.instance.config.rageclick)&&this.Vt(i({},n,{type:"rageclick"})),this.Vt(n)}}lo(t){!va(t.target)&&Cy(t)&&(clearTimeout(this.do),this.do=setTimeout((()=>{this.Vt(this.vo(t,"mousemove"))}),500))}Vt(t){if(xs){var e=this.Pe.disable_capture_url_hashes?kn(xs.location.href):xs.location.href,i=this.Pe.custom_personal_data_properties,r=this.Pe.mask_personal_data_properties?[...dv,...i||[]]:[],n=Xs(e,r,cv);this.O=this.O||{},this.O[n]||(this.O[n]=[]),this.O[n].push(t)}}pr(){this.O&&!Gi(this.O)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:_g,webVitalsAutocapture:class{constructor(t){var e;this.Xa=!1,this.Ba=!1,this.O={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.co=()=>{clearTimeout(this.fo),this.fo=void 0,0!==this.O.metrics.length&&(this._instance.capture("$web_vitals",i({$current_url:this.O.url},this.O.metrics.reduce(((t,e)=>i({},t,{["$web_vitals_"+e.name+"_event"]:i({},e),["$web_vitals_"+e.name+"_value"]:e.value})),{}))),this.O={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.po=t=>{var e;if(this.O=this.O||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Xi(null==t?void 0:t.name)||Xi(null==t?void 0:t.value))gy.error("Invalid metric received",t);else{var r="string"==typeof t.navigationURL?t.navigationURL:void 0,n=this.mo(r);if(!Qi(n)){var s=tr(t.navigationId)||"string"==typeof t.navigationId?"navigation:"+t.navigationId:"url:"+n;if(!this.yo||this.yo>t.value){this.O.navigationKey!==s&&(this.co(),this.fo=setTimeout(this.co,this.flushToCaptureTimeoutMs)),Qi(this.O.navigationKey)&&(this.O.navigationKey=s,this.O.url=n),this.O.firstMetricTimestamp=Qi(this.O.firstMetricTimestamp)?Date.now():this.O.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0);var a=null==(e=this._instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0),o=i({},t,r?{navigationURL:n}:{},{$current_url:n,timestamp:Date.now()});Qi(a)||(o.$session_id=a.sessionId,o.$window_id=a.windowId),this.O.metrics.push(o),this.O.metrics.length===this.allowedMetrics.length&&this.co()}else gy.error("Ignoring metric with value >= "+this.yo,t)}}},this.bo=()=>{if(!this.Ba){var t,e,i,r,n=Mo.__PosthogExtensions__,s=null==n?void 0:n.postHogWebVitalsCallbacksByFlavor,a=(null==s?void 0:s[this._o])||("web-vitals"===this._o&&Qi(s)?null==n?void 0:n.postHogWebVitalsCallbacks:void 0);if(Qi(a)||(t=a.onLCP,e=a.onCLS,i=a.onFCP,r=a.onINP),t&&e&&i&&r){var o={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf("LCP")>-1&&t(this.po.bind(this),o),this.allowedMetrics.indexOf("CLS")>-1&&e(this.po.bind(this),o),this.allowedMetrics.indexOf("FCP")>-1&&i(this.po.bind(this),o),this.allowedMetrics.indexOf("INP")>-1&&r(this.po.bind(this),o),this.Ba=!0}else gy.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.Xa=!(null==(e=this._instance.persistence)||!e.props[Fu]),this.startIfEnabled()}get wo(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,i=Zi(this.wo)?null==(t=this.wo)?void 0:t.web_vitals_allowed_metrics:void 0;return Xi(i)?(null==(e=this._instance.persistence)?void 0:e.props[$u])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(Zi(this.wo)?this.wo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Zi(this.wo)?this.wo.web_vitals_attribution:void 0;return null!=t&&t}get useSoftNavs(){var t=Zi(this.wo)?this.wo.__preview_web_vitals_soft_navs:void 0;return null!=t&&t}get yo(){var t=Zi(this.wo)&&tr(this.wo.__web_vitals_max_value)?this.wo.__web_vitals_max_value:my;return t>0&&6e4>=t?my:t}get isEnabled(){var t=null==Ms?void 0:Ms.protocol;if("http:"!==t&&"https:"!==t)return gy.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Zi(this.wo)?this.wo.web_vitals:ir(this.wo)?this.wo:void 0;return ir(e)?e:this.Xa}startIfEnabled(){this.isEnabled&&!this.Ba&&(gy.info("enabled, starting..."),this.ai(this.bo))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var i=Zi(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Zi(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Fu]:i}),this._instance.persistence.register({[$u]:r})),this.Xa=i,this.startIfEnabled()}}}get _o(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}ai(t){var e=Mo.__PosthogExtensions__,i=this._o,r=null==e?void 0:e.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&Qi(r)&&null!=e&&e.postHogWebVitalsCallbacks?t():null==e||null==e.loadExternalDependency||e.loadExternalDependency(this._instance,i,(e=>{e?gy.error("failed to load script",e):t()}))}mo(t){var e=t||(null==xs?void 0:xs.location.href);if(e){var i=this._instance.config.disable_capture_url_hashes?kn(e):e,r=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...dv,...r||[]]:[];return Xs(i,n,cv)}gy.error("Could not determine current URL")}}},rb={exceptionObserver:class{constructor(t){var e;this.bo=()=>{var t;if(xs&&this.isEnabled&&null!=(t=Mo.__PosthogExtensions__)&&t.errorWrappingFunctions){var e=Mo.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=Mo.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=Mo.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.xo&&this.Pe.capture_unhandled_errors&&(this.xo=e(this.captureException.bind(this))),!this.ko&&this.Pe.capture_unhandled_rejections&&(this.ko=i(this.captureException.bind(this))),!this.So&&this.Pe.capture_console_errors&&(this.So=r(this.captureException.bind(this)))}catch(t){fy.error("failed to start",t),this.Co()}}},this._instance=t,this.Mo=!(null==(e=this._instance.persistence)||!e.props[Ru]),this.To=new fr(i({},function(t){var e,i,r,n;return void 0===t&&(t={}),{refillRate:null!==(e=null!==(i=t.exceptionRateLimiterRefillRate)&&void 0!==i?i:t.__exceptionRateLimiterRefillRate)&&void 0!==e?e:1,bucketSize:null!==(r=null!==(n=t.exceptionRateLimiterBucketSize)&&void 0!==n?n:t.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10}}(this._instance.config.error_tracking),{refillInterval:1e4,rt:fy})),this.Pe=this.Eo(),this.startIfEnabledOrStop()}Eo(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Zi(t)?e=i({},e,t):(Qi(t)?this.Mo:t)&&(e=i({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Pe.capture_console_errors||this.Pe.capture_unhandled_errors||this.Pe.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(fy.info("enabled"),this.Co(),this.ai(this.bo)):this.Co()}ai(t){var e,i;null!=(e=Mo.__PosthogExtensions__)&&e.errorWrappingFunctions?t():null==(i=Mo.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",(e=>{if(e)return fy.error("failed to load script",e);t()}))}Co(){var t,e,i;null==(t=this.xo)||t.call(this),this.xo=void 0,null==(e=this.ko)||e.call(this),this.ko=void 0,null==(i=this.So)||i.call(this),this.So=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Mo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Ru]:this.Mo}),this.Pe=this.Eo(),this.startIfEnabledOrStop())}}onConfigChange(){this.Pe=this.Eo()}captureException(t){var e,i,r,n=null!==(e=null==t||null==(i=t.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==e?e:"Exception";this.To.consumeRateLimit(n)?fy.info("Skipping exception capture because of client rate limiting.",{exception:n}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,i;this.Io=[],this.Po=Gv(),this._instance=t,this.Io=null!==(e=null==(i=this._instance.persistence)?void 0:i.get_property(Lu))&&void 0!==e?e:[],this.Ro=bs(this.Lo()),this.Oo=new _s(this.Ro)}onConfigChange(){this.Ro=bs(this.Lo()),this.Oo.setConfig(this.Ro)}onRemoteConfig(t){var e,i,r;if(t.ok){var n=t.config;if("errorTracking"in n){var s=null!==(e=null==(i=n.errorTracking)?void 0:i.suppressionRules)&&void 0!==e?e:[],a=null==(r=n.errorTracking)?void 0:r.captureExtensionExceptions;this.Io=s,this._instance.persistence&&this._instance.persistence.register({[Lu]:this.Io,[Ou]:a})}}}get Fo(){var t,e=!!this._instance.get_property(Ou),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(t=null!=i?i:e)&&void 0!==t&&t}buildProperties(t,e){return this.Po.buildFromUnknown(t,{syntheticException:null==e?void 0:e.syntheticException,mechanism:{handled:null==e?void 0:e.handled}})}addExceptionStep(t,e){if(this.Ro.enabled)try{if(!Ji(t)||0===t.trim().length)return void Zv.warn("Ignoring exception step because message must be a non-empty string");var r=function(t){if(!t)return{sanitizedProperties:{},droppedKeys:[]};var e=[];return{sanitizedProperties:Object.keys(t).reduce(((i,r)=>ms.has(r)?(e.push(r),i):(i[r]=t[r],i)),{}),droppedKeys:e}}(this.Ao(e)),n=r.sanitizedProperties,s=r.droppedKeys;s.length>0&&Zv.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Oo.add(i({[ps]:t,[gs]:(new Date).toISOString()},n))}catch(t){Zv.error("Failed to add exception step. Ignoring breadcrumb.",t)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.Do(e)){if(this.$o(e))return this.No("Exception dropped: matched a suppression rule"),void Zv.info("Skipping exception capture because a suppression rule matched");if(!this.Fo&&this.qo(e))return this.No("Exception dropped: thrown by a browser extension"),void Zv.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.jo(e))return this.No("Exception dropped: thrown by the PostHog SDK"),void Zv.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.Ro.enabled&&Xi(t.$exception_steps)?this.Bo(t):t,r="string"==typeof(s=globalThis._posthogReleaseId)&&s.length>0?s:void 0;r&&(i.$release_id=r);try{var n=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",jn:!0});return n&&this.Oo.clear(),n}catch(t){return Zv.error("Failed to capture exception event. Dropping this exception.",t),void this.Oo.clear()}}catch(t){return void Zv.error("Failed to process exception event. Ignoring this exception.",t)}var s}Bo(t){try{var e=this.Oo.getAttachable();return 0===e.length?t:i({},t,{$exception_steps:e})}catch(e){return Zv.error("Failed to read buffered exception steps. Capturing exception without steps.",e),t}}No(t){this.Ro.enabled&&this.Oo.add({[ps]:t,[gs]:(new Date).toISOString()})}Ao(t){return Zi(t)?i({},t):{}}Lo(){var t,e;return null!==(t=null==(e=this._instance.config.error_tracking)?void 0:e.exception_steps)&&void 0!==t?t:{}}$o(t){if(0===t.length)return!1;try{var e=t.reduce(((t,e)=>{var i=e.type,r=e.value;return Ji(i)&&i.length>0&&t.$exception_types.push(i),Ji(r)&&r.length>0&&t.$exception_values.push(r),t}),{$exception_types:[],$exception_values:[]});return this.Io.some((t=>{var i=t.values.map((t=>{var i=Vh[t.operator],r=e[t.key];if(!i||!r)return!1;var n=Wi(t.value)?t.value:[t.value];return n.length>0&&i(n,r)}));return"OR"===t.type?i.some(Boolean):i.every(Boolean)}))}catch(t){return Zv.warn("Failed to evaluate suppression rules. Capturing the exception.",t),!1}}qo(t){var e=t.flatMap((t=>{var e,i;return null!==(e=null==(i=t.stacktrace)?void 0:i.frames)&&void 0!==e?e:[]}));return e.some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}jo(t){if(t.length>0){var e,i,r,n,s=null!==(e=null==(i=t[0].stacktrace)?void 0:i.frames)&&void 0!==e?e:[],a=s[s.length-1];return null!==(r=null==a||null==(n=a.filename)?void 0:n.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Do(t){return!Xi(t)&&Wi(t)}}},nb=i({productTours:class{get Tr(){return this._instance.persistence}constructor(t){this.Ho=null,this.Uo=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var i,r;if(this.Tr&&this.Tr.register({[Du]:!!e.productTours}),!Ty(this._instance))return!this.Ho&&Xi(null==(i=this.Tr)?void 0:i.props[lh])||My.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.Ho)||r.stop(),this.Ho=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Ho&&Ty(this._instance)&&this.ai((()=>this.zo()))}ai(t){var e,i;null!=(e=Mo.__PosthogExtensions__)&&e.generateProductTours?t():null==(i=Mo.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",(e=>{e?My.error("Could not load product tours script",e):t()}))}zo(){var t;!this.Ho&&null!=(t=Mo.__PosthogExtensions__)&&t.generateProductTours&&(this.Ho=Mo.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(void 0===e&&(e=!1),!Wi(this.Uo)||e){var i=this.Tr;if(i){var r=i.props[lh];if(Wi(r)&&!e)return this.Uo=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:e=>{if(Ty(this._instance)){var r=e.statusCode;if(200!==r||!e.json){var n="Product Tours API could not be loaded, status: "+r;return 0===r?e.error||My.warn(n):My.error(n),void t([],{isLoaded:!1,error:n})}var s=Wi(e.json.product_tours)?e.json.product_tours:[];this.Uo=s,i&&i.register({[lh]:s}),t(s,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Uo,{isLoaded:!0})}getActiveProductTours(t){Xi(this.Ho)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Ho.getActiveProductTours(t)}showProductTour(t){var e;null==(e=this.Ho)||e.showTourById(t)}previewTour(t){this.Ho?this.Ho.previewTour(t):this.ai((()=>{var e;this.zo(),null==(e=this.Ho)||e.previewTour(t)}))}dismissProductTour(){var t;null==(t=this.Ho)||t.dismissTour("user_clicked_skip")}nextStep(){var t;null==(t=this.Ho)||t.nextStep()}previousStep(){var t;null==(t=this.Ho)||t.previousStep()}clearCache(){var t;this.Uo=null,null==(t=this.Tr)||t.unregister(lh)}resetTour(t){var e;null==(e=this.Ho)||e.resetTour(t)}resetAllTours(){var t;null==(t=this.Ho)||t.resetAllTours()}cancelPendingTour(t){var e;null==(e=this.Ho)||e.cancelPendingTour(t)}}},tb),sb={siteApps:class{constructor(t){this.Wo=0,this._instance=t,this.Vo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Zo(t,e){if(e){var i=this.globalsForEvent(e);this.Vo.push(i),this.Vo.length>1e3&&(this.Vo=this.Vo.slice(10))}}get siteAppLoaders(){var t;return null==(t=Mo._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Zo.bind(this));this.Go=()=>{t(),this.Vo=[],this.Go=void 0}}}globalsForEvent(t){var e,n,s,a,o,l,u;if(!t)throw new Error("Event payload is required");var h={},d=this._instance.get_property("$groups")||[],v=this._instance.get_property("$stored_group_properties")||{};for(var c of Object.entries(v)){var f=c[0];h[f]={id:d[f],type:f,properties:c[1]}}var p=t.$set_once,g=t.$set;return{event:i({},r(t,Ey),{properties:i({},t.properties,g?{$set:i({},null!==(e=null==(n=t.properties)?void 0:n.$set)&&void 0!==e?e:{},g)}:{},p?{$set_once:i({},null!==(s=null==(a=t.properties)?void 0:a.$set_once)&&void 0!==s?s:{},p)}:{}),elements_chain:null!==(o=null==(l=t.properties)?void 0:l.$elements_chain)&&void 0!==o?o:"",distinct_id:null==(u=t.properties)?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:h}}Qo(t){var e,i=null==(e=t.tagName)?void 0:e.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Iy.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(t)||(Iy.error("prepare_external_dependency_script returned null"),null):t}Jo(){var t,e,i,r,n,s,a,o;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==Cs?void 0:Cs.defaultView,u=null==l||null==(t=l.Node)?void 0:t.prototype;if(!l||!u)return()=>{};if(this.Wo++,this.Ko)return this.Yo();var h=[],d=this,v=new WeakSet,c=(t,e,i)=>{if(null!=t&&t[e]){var r=t[e];t[e]=i(r),h.push((()=>{t[e]=r}))}},f=t=>{if(v.has(t))return t;var e=d.Qo(t);return e&&v.add(e),e},p=t=>t.map((t=>"string"==typeof t?t:f(t))).filter((t=>!Yi(t)));return c(u,"appendChild",(t=>function(e){var i=f(e);return i?t.call(this,i):e})),c(u,"insertBefore",(t=>function(e,i){var r=f(e);return r?t.call(this,r,i):e})),c(u,"replaceChild",(t=>function(e,i){var r=f(e);return r?t.call(this,r,i):i})),[null==(e=l.Element)?void 0:e.prototype,null==(i=l.Document)?void 0:i.prototype,null==(r=l.DocumentFragment)?void 0:r.prototype].forEach((t=>{c(t,"append",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,p(i))})),c(t,"prepend",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,p(i))}))})),[null==(n=l.Element)?void 0:n.prototype,null==(s=l.CharacterData)?void 0:s.prototype,null==(a=l.DocumentType)?void 0:a.prototype].forEach((t=>{c(t,"before",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,p(i))})),c(t,"after",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,p(i))})),c(t,"replaceWith",(t=>function(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];var n=p(i);return i.length&&!n.length?void 0:t.apply(this,n)}))})),c(null==(o=l.Element)?void 0:o.prototype,"insertAdjacentElement",(t=>function(e,i){var r=f(i);return r?t.call(this,e,r):null})),this.Ko=()=>{h.forEach((t=>t())),this.Ko=void 0},this.Yo()}Yo(){var t=!1;return()=>{var e;t||(t=!0,this.Wo--,0===this.Wo&&(null==(e=this.Ko)||e.call(this)))}}Xo(t,e){void 0===e&&(e=!0);var i=this.Jo();try{var r=t(i);return e&&i(),r}catch(t){throw i(),t}}setupSiteApp(t){var e=this.apps[t.id],i=()=>{var i;!e.errored&&this.Vo.length&&(Iy.info("Processing "+this.Vo.length+" events for site app with id "+t.id),this.Vo.forEach((t=>this.Xo((()=>null==e.processEvent?void 0:e.processEvent(t))))),e.processedBuffer=!0),Object.values(this.apps).every((t=>t.processedBuffer||t.errored))&&(null==(i=this.Go)||i.call(this))},r=!1,n=n=>{e.errored=!n,e.loaded=!0,Iy.info("Site app with id "+t.id+" "+(n?"loaded":"errored")),r&&i()};try{var s=this.Xo((e=>t.init({posthog:this._instance,callback(t){e(),n(t)}})),!1).processEvent;s&&(e.processEvent=s),r=!0}catch(e){Iy.error(Py+t.id,e),n(!1)}if(r&&e.loaded)try{i()}catch(i){Iy.error("Error while processing buffered events PostHog app with config id "+t.id,i),e.errored=!0}}tl(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of t)this.setupSiteApp(i)}el(t){var e=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(t),r=function(r){try{e.Xo((()=>null==r.processEvent?void 0:r.processEvent(i)))}catch(e){Iy.error("Error while processing event "+t.event+" for site app "+r.id,e)}};for(var n of Object.values(this.apps))r(n)}}onRemoteConfig(t){var e,i,r,n=this;if(null!=(e=this.siteAppLoaders)&&e.length)return this.isEnabled?(this.tl(),void this._instance.on("eventCaptured",(t=>this.el(t)))):void Iy.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Go)||i.call(this),t.ok){var s=t.config;if(null!=(r=s.siteApps)&&r.length)if(this.isEnabled){var a=function(){var t,e=o.id,i=o.url;Mo["__$$ph_site_app_"+e]=n._instance,null==(t=Mo.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(n._instance,i,(t=>{if(t)return Iy.error(Py+e,t)}))};for(var o of s.siteApps)a()}else Iy.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},ab={tracingHeaders:class{constructor(t){this.il=void 0,this.rl=void 0,this.nl=void 0,this.bo=()=>{var t,e,i=this.sl();i?(Qi(this.il)&&(this.il=null==(t=Mo.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchXHR(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),Qi(this.rl)&&(this.rl=null==(e=Mo.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchFetch(i,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Co()},this._instance=t}initialize(){this.startIfEnabledOrStop()}ai(t){var e,i;null!=(e=Mo.__PosthogExtensions__)&&e.tracingHeadersPatchFns?t():null==(i=Mo.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",(e=>{if(e)return py.error("failed to load script",e);t()}))}al(){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}sl(){var t=this.al();return Wi(t)?(Wi(this.nl)?this.nl.splice(0,this.nl.length,...t):this.nl=[...t],t.length>0?this.nl:void 0):(Wi(this.nl)&&this.nl.splice(0),this.nl=t||void 0,this.nl)}Co(){var t,e;null==(t=this.il)||t.call(this),null==(e=this.rl)||e.call(this),this.il=void 0,this.rl=void 0}startIfEnabledOrStop(){this.sl()?this.ai(this.bo):this.Co()}}},ob=i({surveys:class{get Pe(){return this._instance.config}constructor(t){this.ol=void 0,this._surveyManager=null,this.ll=!1,this.ul=[],this.hl=null,this.dl=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Pe.disable_surveys){if(!t.ok)return fu.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Xi(e))return fu.warn("Flags not loaded yet. Not loading surveys.");var i=Wi(e);this.ol=i?e.length>0:e,fu.info("flags response received, isSurveysEnabled: "+this.ol),this.loadIfEnabled()}}reset(){try{var t;null==(t=this._surveyEventReceiver)||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],i=0;i<localStorage.length;i++){var r=localStorage.key(i);(null!=r&&r.startsWith(mu)||null!=r&&r.startsWith(yu))&&e.push(r)}e.forEach((t=>localStorage.removeItem(t)))}catch(t){}}loadIfEnabled(){if(!this._surveyManager)if(this.ll)fu.info("Already initializing surveys, skipping...");else if(this.Pe.disable_surveys)fu.info(Dy);else if(this.Pe.cookieless_mode&&this._instance.consent.isOptedOut())fu.info("Not loading surveys in cookieless mode without consent.");else{var t=null==Mo?void 0:Mo.__PosthogExtensions__;if(t){if(!Qi(this.ol)||this.Pe.advanced_enable_surveys){var e=this.ol||this.Pe.advanced_enable_surveys;this.ll=!0;try{var i=t.generateSurveys;if(i)return void this.vl(i,e);var r=t.loadExternalDependency;if(!r)return void this.cl(Ch);r(this._instance,"surveys",(i=>{i||!t.generateSurveys?this.cl("Could not load surveys script",i):this.vl(t.generateSurveys,e)}))}catch(t){throw this.cl("Error initializing surveys",t),t}finally{this.ll=!1}}}else fu.error("PostHog Extensions not found.")}}vl(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Fy(this._instance),fu.info("Surveys loaded successfully"),this.fl({isLoaded:!0})}cl(t,e){fu.error(t,e),this.fl({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.ul.push(t),this._surveyManager&&this.fl({isLoaded:!0}),()=>{this.ul=this.ul.filter((e=>e!==t))}}getSurveys(t,e){if(void 0===e&&(e=!1),this.Pe.disable_surveys)return fu.info(Dy),t([]);var i,r=this._instance.get_property(rh);if(r&&!e)return t(r,{isLoaded:!0}),void(this.pl()&&this.getSurveys((()=>{}),!0));"undefined"!=typeof Promise&&this.hl?this.hl.then((e=>t(e.surveys,e.context))):("undefined"!=typeof Promise&&(this.hl=new Promise((t=>{i=t}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Pe.token),method:"GET",timestampMode:"query",timeout:this.Pe.surveys_request_timeout_ms,callback:e=>{var r;this.hl=null;var n=e.statusCode;if(200!==n||!e.json){var s="Surveys API could not be loaded, status: "+n;0!==n?fu.error(s):e.error||fu.warn(s),this.dl=Date.now();var a={isLoaded:!1,error:s};return t([],a),void(null==i||i({surveys:[],context:a}))}this.dl=null;var o,l=e.json.surveys||[],u=l.filter((t=>pu(t)&&(vu(t)||gu(t))));u.length>0&&(null==(o=this._surveyEventReceiver)||o.register(u)),null==(r=this._instance.persistence)||r.register({[rh]:l,[nh]:Date.now()});var h={isLoaded:!0};t(l,h),null==i||i({surveys:l,context:h})}}))}pl(){return this.gl()&&!this.hl&&!this.ml()}gl(){var t=this._instance.get_property(nh);return tr(t)&&Date.now()-t>3e5}ml(){return tr(this.dl)&&3e5>Date.now()-this.dl}markSurveyAsSeen(t,e){var i,r={id:t,current_iteration:null!==(i=null==e?void 0:e.iteration)&&void 0!==i?i:null};wu(r);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}fl(t){for(var e of this.ul)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(t){fu.error("Error in survey callback",t)}}getActiveMatchingSurveys(t,e){if(void 0===e&&(e=!1),!Xi(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);fu.warn("init was not called")}yl(t){var e=null;return this.getSurveys((i=>{var r;e=null!==(r=i.find((e=>e.id===t)))&&void 0!==r?r:null})),e}bl(t){if(Xi(this._surveyManager))return{eligible:!1,reason:Ay};var e="string"==typeof t?this.yl(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}_l(t){if(Xi(this._surveyManager))return{eligible:!1,reason:Ay};var e="string"==typeof t?this.yl(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Xi(this._surveyManager))return fu.warn("init was not called"),{visible:!1,disabledReason:Ay};var e=this._l(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Xi(this._surveyManager)?(fu.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Ay})):new Promise((i=>{this.getSurveys((e=>{var r,n=null!==(r=e.find((e=>e.id===t)))&&void 0!==r?r:null;if(n){var s=this._l(n);i({visible:s.eligible,disabledReason:s.reason})}else i({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,i){var r;if(Xi(this._surveyManager))fu.warn("init was not called");else{var n="string"==typeof t?this.yl(t):t;if(null!=n&&n.id)if(xu.includes(n.type)){var s=null==Cs?void 0:Cs.querySelector(e);if(s)return null!=(r=n.appearance)&&r.surveyPopupDelaySeconds?(fu.info("Rendering survey "+n.id+" with delay of "+n.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var t,e;fu.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,i),fu.info("Survey "+n.id+" rendered")}),1e3*n.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(n,s,i);fu.warn("Survey element not found")}else fu.warn("Surveys of type "+n.type+" cannot be rendered in the app");else fu.warn("Survey not found")}}displaySurvey(t,e){var r;if(Xi(this._surveyManager))fu.warn("init was not called");else{var n=this.yl(t);if(n){var s=n;if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=i({},n,{appearance:i({},n.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==ru&&e.initialResponses&&fu.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===e.ignoreConditions){var a=this.bl(n);if(!a.eligible)return void fu.warn("Survey is not eligible to be displayed: ",a.reason)}"inline"!==e.displayType?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else fu.warn("Survey not found")}}cancelPendingSurvey(t){Xi(this._surveyManager)?fu.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;null==(t=this._surveyManager)||null==t.handlePageUnload||t.handlePageUnload()}}},tb),lb={toolbar:class{constructor(t){this.instance=t}wl(t){Mo.ph_toolbar_state=t}xl(){var t;return null!==(t=Mo.ph_toolbar_state)&&void 0!==t?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,i){if(void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),Gs(this.instance.config))return!1;if(!xs||!Cs)return!1;t=null!=t?t:xs.location,i=null!=i?i:xs.history;try{if(!e){try{xs.localStorage.setItem("test","test"),xs.localStorage.removeItem("test")}catch(t){return!1}e=null==xs?void 0:xs.localStorage}var r,n=$y||ta(t.hash,"__posthog")||ta(t.hash,"state"),s=n?Hs((()=>JSON.parse(atob(decodeURIComponent(n)))))||Hs((()=>JSON.parse(decodeURIComponent(n)))):null;return s&&"ph_authorize"===s.action?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?t.hash=s.desiredHash:i?i.replaceState(i.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(Ny)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(t){return!1}}kl(t){var e=Mo.ph_load_toolbar||Mo.ph_load_editor;!Xi(e)&&Vi(e)?e(t,this.instance):qy.warn("No toolbar load function found")}loadToolbar(t){var e=!(null==Cs||!Cs.getElementById(la));if(!xs||e)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=i({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(xs.localStorage.setItem(Ny,JSON.stringify(i({},n,{source:void 0}))),2===this.xl())this.kl(n);else if(0===this.xl()){var s;this.wl(1),null==(s=Mo.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this.instance,"toolbar",(t=>{if(t)return qy.error("[Toolbar] Failed to load",t),void this.wl(0);this.wl(2),this.kl(n)})),Zs(xs,"turbolinks:load",(()=>{this.wl(0),this.loadToolbar(n)}))}return!0}Sl(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,i){return void 0===t&&(t=void 0),void 0===e&&(e=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(t,e,i)}}},ub=i({experiments:Zy},tb),hb={conversations:class{constructor(t){this.Cl=void 0,this._conversationsManager=null,this.Ml=!1,this.Tl=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&t.ok){var e=t.config.conversations;Xi(e)||(ir(e)?this.Cl=e:(this.Cl=e.enabled,this.Tl=e),this.loadIfEnabled())}}reset(){var t;null==(t=this._conversationsManager)||t.reset(),this._conversationsManager=null,this.Cl=void 0,this.Tl=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ml||this._instance.config.disable_conversations||Gs(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=null==Mo?void 0:Mo.__PosthogExtensions__;if(t&&!Qi(this.Cl)&&this.Cl)if(this.Tl&&this.Tl.token){this.Ml=!0;try{var e=t.initConversations;if(e)return this.El(e),void(this.Ml=!1);var i=t.loadExternalDependency;if(!i)return void this.Il(Ch);i(this._instance,"conversations",(e=>{e||!t.initConversations?this.Il("Could not load conversations script",e):this.El(t.initConversations),this.Ml=!1}))}catch(t){this.Il("Error initializing conversations",t),this.Ml=!1}}else Gy.error("Conversations enabled but missing token in remote config.")}}El(t){if(this.Tl)try{this._conversationsManager=t(this.Tl,this._instance),Gy.info("Conversations loaded successfully")}catch(t){this.Il("Error completing conversations initialization",t)}else Gy.error("Cannot complete initialization: remote config is null")}Il(t,e){Gy.error(t,e),this._conversationsManager=null,this.Ml=!1}show(){this._conversationsManager?this._conversationsManager.show():Gy.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Cl&&!Yi(this._conversationsManager)}isVisible(){var t,e;return null!==(t=null==(e=this._conversationsManager)?void 0:e.isVisible())&&void 0!==t&&t}sendMessage(t,i,r){var n=this;return e((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(t,i,r):(Gy.warn(Qy),null)}))()}getMessages(t,i){var r=this;return e((function*(){return r._conversationsManager?r._conversationsManager.getMessages(t,i):(Gy.warn(Qy),null)}))()}markAsRead(t){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.markAsRead(t):(Gy.warn(Qy),null)}))()}getTickets(t){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.getTickets(t):(Gy.warn(Qy),null)}))()}requestRestoreLink(t){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.requestRestoreLink(t):(Gy.warn(Qy),null)}))()}restoreFromToken(t){var i=this;return e((function*(){return i._conversationsManager?i._conversationsManager.restoreFromToken(t):(Gy.warn(Qy),null)}))()}restoreFromUrlToken(){var t=this;return e((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Gy.warn(Qy),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}Gn(){var t;null==(t=this._conversationsManager)||t.setIdentity()}Qn(){var t;null==(t=this._conversationsManager)||t.clearIdentity()}}},db={logs:class{constructor(t){var e,r=this;this.Pl=!1,this.Rl=!1,this.rt=$s("[logs]"),this.Ll=i({},this.rt,{error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];e.some(Xy)||r.rt.error(...e)}}),this.er=[],this.Ol=[],this.fa=0,this.Fl=()=>{var t,e;this.fa=0,null==(t=this.Al)||t.onReconnect(),null==(e=this.Dl)||e.onReconnect()},this._instance=t,this._instance&&null!=(e=this._instance.config.logs)&&e.captureConsoleLogs&&(this.Pl=!0),xs&&Zs(xs,"online",this.Fl)}$l(t,e,i,r){var n,s=function(t,e){var i,r,n,s,a,o,l,u=null!==(i=null==t?void 0:t.flushIntervalMs)&&void 0!==i?i:3e3,h=null!==(r=null==t?void 0:t.maxBufferSize)&&void 0!==r?r:100,d=null!=e&&e.consoleCapture?void 0:null!==(n=null==t?void 0:t.maxLogsPerInterval)&&void 0!==n?n:1e3,v=Qi(d)?Math.max(h,2048):Math.max(h,d),c=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(s=null!==(a=null==c?void 0:c["service.name"])&&void 0!==a?a:null==t?void 0:t.serviceName)&&void 0!==s?s:null==e?void 0:e.serviceNameDefault,serviceVersion:null!==(o=null==c?void 0:c["service.version"])&&void 0!==o?o:null==t?void 0:t.serviceVersion,environment:null!==(l=null==c?void 0:c["deployment.environment"])&&void 0!==l?l:null==t?void 0:t.environment,resourceAttributes:c,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:v,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(n=this._instance)||null==(n=n.config)?void 0:n.logs,i);return[new An(this.Nl(t,e),s,this.Ll,(()=>this.ql()),(t=>t()),void 0,r),s]}jl(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Al||this.Bl!==e){var i;null==(i=this.Al)||i.reset(),this.Bl=e;var r=this.$l((()=>this.er),(t=>{this.er=t}));this.Al=r[0],this.Hl=r[1]}return this.Al}Ul(){var t,e=null==(t=this._instance)||null==(t=t.config)?void 0:t.logs;if(!this.Dl||this.zl!==e){var i;null==(i=this.Dl)||i.reset(),this.zl=e;var r=this.$l((()=>this.Ol),(t=>{this.Ol=t}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},Jy);this.Dl=r[0],this.Wl=r[1]}return this.Dl}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var i=null==(e=t.config.logs)?void 0:e.captureConsoleLogs;!Xi(i)&&i&&(this.Pl=!0,this.loadIfEnabled())}}reset(){var t,e;this.er=[],null==(t=this.Al)||t.reset(),this.Ol=[],null==(e=this.Dl)||e.reset(),this.fa=0}captureLog(t){this.jl().captureLog(t)}he(t){this.Ul().captureLog(t)}get logger(){return this.Vl||(this.Vl={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.Vl}flushLogs(t){t?this.Zl(t):(this.Al&&this.Al.flush().catch((t=>this.Gl(t))),this.Dl&&this.Dl.flush().catch((t=>this.Gl(t))))}Gl(t){Xy(t)||this.rt.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Pl&&!this.Rl){var t=null==Mo?void 0:Mo.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(e=>{var i;e||null==(i=t.logs)||!i.initializeLogs?this.rt.error("Could not load logs script",e):(t.logs.initializeLogs(this._instance),this.Rl=!0)})):this.rt.error(Ch)}else this.rt.error("PostHog Extensions not found.")}}Nl(t,e){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:e=>e===ki.LogsQueue?t():void 0,setPersistedProperty(t,i){var r;t===ki.LogsQueue&&e(null!==(r=i)&&void 0!==r?r:[])},At:t=>this.At(t),getLibraryId:()=>Fs.LIB_NAME,getLibraryVersion:()=>Fs.LIB_VERSION}}At(t){return new Promise((e=>{if(ea(this.fa,3))e({kind:"fatal",error:Yy(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=t=>{i||(i=!0,clearTimeout(n),e(t))},n=setTimeout((()=>{this.rt.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:Yy(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.Ql(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:t=>{var e=t.statusCode;if(this.Jl(e),e>=200&&300>e)r({kind:"ok"});else if(413===e)r({kind:"too-large"});else if(0!==e&&429!==e&&500>e)r({kind:"fatal",error:new Error("logs request failed with status "+e)});else{var i;0===e?(t.error||this.rt.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:Yy(t.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("logs request failed with status "+e)})}}})}}))}Jl(t){(0!==t||this._instance.__loaded)&&(this.fa=ia(t,this.fa,3,(()=>this.rt.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes."))))}Zl(t){this.er.length>0&&this.Kl(t,this.er,this.Hl,Fs.LIB_NAME,(t=>{this.er=t})),this.Ol.length>0&&this.Kl(t,this.Ol,this.Wl,Jy,(t=>{this.Ol=t}))}Kl(t,e,i,r,n){if(0!==e.length){var s=e.map((t=>t.record));n([]);var a=Fn(s,On(i,Fs.LIB_NAME,Fs.LIB_VERSION),r,Fs.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Ql(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}Ql(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}ql(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=i.windowId,n=i.sessionStartTimestamp,s=i.lastActivityTimestamp;e.sessionId=i.sessionId,e.windowId=r,Xi(n)||(e.sessionStartTimestamp=n),Xi(s)||(e.lastActivityTimestamp=s)}if(null!=Mo&&null!=(t=Mo.location)&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?kn(Mo.location.href):Mo.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},vb={metrics:class{constructor(t){this.rt=$s("[metrics]"),this._instance=t}initialize(){}jl(){var t,e,i=null==(t=this._instance)||null==(t=t.config)?void 0:t.metrics;return this.Al&&this.Bl===i||(null==(e=this.Al)||e.reset(),this.Bl=i,this.Al=new qn(this.Nl(),function(t){var e,i,r,n,s,a=null==t?void 0:t.resourceAttributes;return{serviceName:null!==(e=null==a?void 0:a["service.name"])&&void 0!==e?e:null==t?void 0:t.serviceName,serviceVersion:null!==(i=null==a?void 0:a["service.version"])&&void 0!==i?i:null==t?void 0:t.serviceVersion,environment:null!==(r=null==a?void 0:a["deployment.environment"])&&void 0!==r?r:null==t?void 0:t.environment,resourceAttributes:a,beforeSend:null==t?void 0:t.beforeSend,flushIntervalMs:null!==(n=null==t?void 0:t.flushIntervalMs)&&void 0!==n?n:1e4,maxSeriesPerFlush:null!==(s=null==t?void 0:t.maxSeriesPerFlush)&&void 0!==s?s:1e3}}(i),this.rt)),this.Al}count(t,e,i){void 0===e&&(e=1),this.jl().count(t,e,i)}gauge(t,e,i){this.jl().gauge(t,e,i)}histogram(t,e,i){this.jl().histogram(t,e,i)}flush(t){if(!this.Al)return Promise.resolve();if(t){var e=this.Al.drainWindow();return e&&this.Kt(e,t),Promise.resolve()}return this.Al.flush().catch((t=>this.rt.error("PostHog metrics flush failed:",t)))}reset(){var t;null==(t=this.Al)||t.reset()}Nl(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Kt:t=>e.Kt(t),getLibraryId:()=>Fs.LIB_NAME,getLibraryVersion:()=>Fs.LIB_VERSION}}Kt(t,e){return new Promise((r=>{var n=!1,s=t=>{n||(n=!0,clearTimeout(a),r(t))},a=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(i({method:"POST",url:this.Yl(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(t){var e=t.statusCode;if(e>=200&&300>e)s({kind:"ok"});else if(413===e)s({kind:"too-large"});else if(0!==e&&429!==e&&500>e)s({kind:"fatal",error:new Error("metrics request failed with status "+e)});else{var i;s({kind:"retry-later",error:null!==(i=t.error)&&void 0!==i?i:new Error("metrics request failed with status "+e)})}}}))}))}Yl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},cb=i({},tb,eb,ib,rb,nb,sb,ob,ab,lb,ub,hb,db,vb);cy.__defaultExtensionClasses=i({},cb),function(){Fs.SDK_DIST_CHANNEL="cdn";var t=Mo.posthog;if(!t||Wi(t._i)){var e=Xm[oy]=new cy;if(t){var i=[];qs(t._i,(function(r){if(r&&Wi(r)){var n=e.init(r[0],r[1],r[2]),s=t[r[2]]||t;n.__loaded&&-1===i.indexOf(s)&&(i.push(s),n._execute_array.call(n.people,s.people),n._execute_array(s))}}))}e.__SV=1,Mo.posthog=e,function(){function t(){t.done||(t.done=!0,ly=!1,qs(Xm,(function(t){t._dom_loaded()})))}null!=Cs&&Cs.addEventListener?"complete"===Cs.readyState?t():Zs(Cs,"DOMContentLoaded",t,{capture:!1}):xs&&Ds.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}()}}()}();
2
2
  //# sourceMappingURL=array.full.js.map